diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 53a18cf16fd..5d906dc709a 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -116,6 +116,9 @@ jobs: - name: API contract boundary audit run: bun run check:api-validation:strict + - name: Shared utils enforcement audit + run: bun run check:utils + - name: Zustand v5 selector audit run: bun run check:zustand-v5 diff --git a/.gitignore b/.gitignore index a700a66602a..a8a0d8e2fde 100644 --- a/.gitignore +++ b/.gitignore @@ -96,3 +96,7 @@ i18n.cache # Personal Cursor Skills .cursor/skills/ask-sim/ + +# Python (apps/pii tests/tooling) +__pycache__/ +.pytest_cache/ diff --git a/apps/docs/content/docs/en/platform/enterprise/access-control.mdx b/apps/docs/content/docs/en/platform/enterprise/access-control.mdx index f71ad748aff..dcc896d9fc3 100644 --- a/apps/docs/content/docs/en/platform/enterprise/access-control.mdx +++ b/apps/docs/content/docs/en/platform/enterprise/access-control.mdx @@ -77,7 +77,7 @@ Controls which workflow blocks members can place and execute. Controls visibility of platform features and modules. -Platform tab showing feature toggles grouped by category: Sidebar (Knowledge Base, Tables, Templates), Workflow Panel (Copilot), Settings Tabs, Tools, Deploy Tabs, Features, Logs, and Collaboration Each checkbox maps to a specific feature; checking it hides or disables that feature for group members. +Platform tab showing feature toggles grouped by category: Sidebar (Knowledge Base, Tables), Workflow Panel (Copilot), Settings Tabs, Tools, Deploy Tabs, Features, Logs, and Collaboration Each checkbox maps to a specific feature; checking it hides or disables that feature for group members. **Sidebar** @@ -85,7 +85,6 @@ Controls visibility of platform features and modules. |---------|-------------------| | Knowledge Base | Hides the Knowledge Base section from the sidebar | | Tables | Hides the Tables section from the sidebar | -| Templates | Hides the Templates section from the sidebar | **Workflow Panel** diff --git a/apps/docs/content/docs/en/platform/enterprise/custom-blocks.mdx b/apps/docs/content/docs/en/platform/enterprise/custom-blocks.mdx new file mode 100644 index 00000000000..57fe1bc6ce4 --- /dev/null +++ b/apps/docs/content/docs/en/platform/enterprise/custom-blocks.mdx @@ -0,0 +1,136 @@ +--- +title: Custom Blocks +description: Publish a deployed workflow as a reusable block for your organization +--- + +import { FAQ } from '@/components/ui/faq' +import { Image } from '@/components/ui/image' + +Custom blocks let you package a deployed workflow as a reusable block for your whole organization. Once published, the block appears in the workflow editor's block toolbar alongside built-in blocks like Agent and Function. Anyone in your organization can drop it into a workflow, fill in its inputs, and use its outputs — without needing access to the workflow behind it. + +A custom block always runs the **latest deployed version** of its source workflow, so improving the block is as simple as redeploying that workflow. + +--- + +## Common uses + +Custom blocks turn a workflow one team owns into infrastructure the whole organization can safely reuse. Credentials and complexity stay with the block's author; everyone else gets a clean block that's always up to date. A few patterns: + +- **Internal API gateway.** Wrap an authenticated internal or partner endpoint — "Create Ticket", "Charge Account", "Provision User" — behind a block that takes only the business inputs. Teammates call it without the base URL, API key, or auth headers, and when the endpoint changes you update one workflow instead of every consumer's. +- **Blessed knowledge lookup.** Package a vetted retrieval pipeline — chunking, filters, reranking — as "Search Company Docs" with a single query input, so teams reuse the approved retrieval instead of each rebuilding it. +- **Governed LLM step.** Share a prompt, model, and guardrail combination like "Summarize (house style)". You control the model and prompt org-wide; changing them is a redeploy, not a hunt through everyone's workflows. +- **Data enrichment.** Expose "Enrich Company" or "Lookup Customer by Email" that hides the provider keys and returns clean fields. +- **Compliance gate.** Offer "Redact PII" or "Policy Check" as a standardized step teams drop into their flows, with the rules maintained in one place. + +--- + +## Before you start + +- **Deploy the workflow first.** Only deployed workflows can be published as a block. If the workflow isn't deployed, deploy it, then come back. +- **Be a workspace admin.** Publishing and managing custom blocks requires workspace admin access. + +--- + +## Publishing a block + +### 1. Open Custom blocks settings + +Go to **Settings → Enterprise → Custom blocks** and click **Create block**. + +Custom blocks settings page listing a published block with its icon, name, and description, with a Create block button in the header + + +### 2. Choose the source workflow + +| Field | Description | +|-------|-------------| +| **Workspace** | The workspace that holds the workflow you want to publish. Only workspaces in your organization are listed. | +| **Workflow** | The workflow to publish. Only deployed workflows appear. If a workflow isn't deployed, deploy it first, then return here. | + +The block runs the source workflow's latest deployment. You publish one block per workflow, and the source workflow can't be changed later — to point at a different workflow, delete the block and publish a new one. + +### 3. Name and describe the block + +| Field | Description | +|-------|-------------| +| **Icon** | Optional. A square image (PNG, JPEG, SVG, or WebP) shown on the block. Falls back to your organization's logo, then a default glyph. | +| **Name** | The block's display name in the toolbar (e.g. `Invoice Parser`). Max 60 characters. | +| **Description** | A short summary of what the block does. Max 280 characters. | + +### 4. Configure inputs + +Every input on the source workflow's **Start** block is exposed as a field on the custom block. You don't choose which inputs to include — they all carry over, along with each input's name, type, and description. + +For each input you can add an optional **placeholder** (max 200 characters) — the hint text shown in the empty field to tell consumers what to enter. + +Because inputs are read live from the deployed workflow, renaming or adding a Start input and redeploying updates the block's fields automatically. + +### 5. Choose outputs + +Pick which of the workflow's outputs consumers can use, and give each one a name. Outputs are grouped by the block they come from, so you can expose exactly the values that matter and hide everything internal. + +- **At least one output is required.** +- Each exposed output needs a unique **name** (max 60 characters) — that's the name consumers reference in their workflows. + +Create block form filled in: Workspace and Workflow selectors, an uploaded icon, Name and Description fields, an expanded input with a placeholder, and two selected outputs each given a name + +### 6. Save + +Click **Save changes**. The block is published immediately and becomes available to everyone in your organization in the workflow editor's block toolbar. + +--- + +## Using a custom block + +In the workflow editor, open the block toolbar. Published custom blocks appear under a **Custom blocks** section. Drag one onto the canvas like any other block, fill in its inputs (using the placeholders as a guide), and reference its outputs in downstream blocks. + +Workflow editor block toolbar with a Custom Blocks section listing two published blocks below Core Blocks + +Consumers don't need any access to the source workflow. The block runs on its own, using only the inputs provided, and returns only the outputs you exposed. Internal steps, models, and intermediate values of the source workflow are never visible. + +A custom block connected to a Start block on the workflow canvas, with its query input filled in and the run output showing the returned fields + +--- + +## Managing blocks + +Open a block from **Settings → Enterprise → Custom blocks** to edit or delete it. + +- **Editing** changes only the block's presentation and interface — name, description, icon, input placeholders, and exposed outputs. The source workflow can't be re-pointed. +- **Changing what the block does** is done by editing and **redeploying the source workflow**. The block picks up the new deployment automatically; there's nothing to republish. +- **Deleting** a block is permanent. Workflows already using it will have that block removed, so replace it before deleting if it's in active use. + +--- + +## Good to know + +- **Always current.** A custom block runs the source workflow's latest deployment. There are no versions to pin or manage. +- **Access control.** Custom blocks appear in [Access Control](/platform/enterprise/access-control) alongside built-in blocks, so you can allowlist or restrict them per permission group. +- **Disabled blocks.** A disabled block can't be added to new workflows, but existing placements keep working. +- **Removed blocks.** Deleting a block (or deleting its source workflow) removes it from workflows that used it. +- **Not deployed.** If the source workflow is undeployed, the block shows a clear error when run. Redeploy the workflow to fix it. + +--- + + diff --git a/apps/docs/content/docs/en/platform/enterprise/forks.mdx b/apps/docs/content/docs/en/platform/enterprise/forks.mdx new file mode 100644 index 00000000000..08f7e3bfd3a --- /dev/null +++ b/apps/docs/content/docs/en/platform/enterprise/forks.mdx @@ -0,0 +1,361 @@ +--- +title: Workspace Forks +description: Clone a workspace, keep it linked to its parent, and push or pull deployed workflow changes +--- + +import { Callout } from 'fumadocs-ui/components/callout' +import { FAQ } from '@/components/ui/faq' +import { Image } from '@/components/ui/image' + +Workspace Forks let you clone a workspace into a child, keep the two linked, and move **deployed** workflow changes between them later. Think of **Deploy** as a git commit: only what you have deployed is what Forks can copy or sync. **Sync** is always a force push or force pull — the target side is overwritten for the workflows in the sync. There is no merge UI. + +One workspace has at most one parent. A parent can have many children. You can only sync along a **direct** parent↔child edge — not with a grandparent or sibling. + +--- + +## Who can use Forks + +| Requirement | Detail | +|-------------|--------| +| **Plan** | Enterprise on Sim Cloud | +| **Role** | Workspace **admin** — non-admins never see the Forks tab | +| **Self-hosted** | Set `FORKING_ENABLED` / `NEXT_PUBLIC_FORKING_ENABLED` (see [Self-hosted setup](#self-hosted-setup)) | + +On Sim Cloud, your organization may also need the feature turned on for your account before the tab appears. + +--- + +## Setup + +### 1. Open Forks + +Go to **Settings → Enterprise → Workspace Forks** in the workspace you want to fork from (or manage). + +Workspace Forks settings page showing Parent and Forks sections with Docs, See activity, and Create fork actions + +You will see: + +- **Parent** — if this workspace was forked from another +- **Forks** — children of this workspace +- **See activity** — history of forks, syncs, and rollbacks +- **Create fork** — start a new child + +### 2. Create a fork + +Click **Create fork**. Name the child (defaults to `{workspace} (fork)`), then review **Copy resources**. + +Fork workspace modal with name field and Copy resources list fully selected + +Everything under **Copy resources** starts **selected**. That is usually what you want: tables, knowledge bases, files, custom tools, skills, and MCP servers the child will need. + + + If you deselect a resource, references to it in the forked workflows are **cleared** in the child. You will see a warning before you confirm. + + +Fork workspace modal showing a warning that deselected resources will clear references in the fork + +Click **Fork**. The child workspace is created immediately. Deployed workflows land as **drafts** in the child. Large content (table rows, knowledge base files, file blobs) may finish copying in the background — watch **Activity** on the source workspace. + + + Only **deployed** workflows are forked. Drafts and undeployed work stay in the parent. If the parent has nothing deployed, the child starts with a blank starter workflow. + + +### 3. Open the parent edge (from the child) + +Open the **child** workspace → **Settings → Enterprise → Workspace Forks**. On the **Parent** row, open the menu and choose **Edit mappings**. + +Child rows (when you are on the parent) only offer **Open workspace** and **Disconnect** — mapping and sync are owned by the child configuring how it relates to its parent. + +**Open workspace** is disabled with a tooltip if you do not have access to the other workspace. **Disconnect** stays available so you can still sever the link. + +### 4. Understand mappings + +A **mapping** means: “this resource in the source is the same logical thing as that resource in the target.” When you sync, workflow fields that pointed at the source resource are rewritten to the target resource so blocks keep working. + +| Approach | When to use it | +|----------|----------------| +| **Map** | Both sides already have (or should keep) their own resource — e.g. each workspace’s Slack credential, Gmail account, or secret value | +| **Copy** | The target should receive a **new** clone of the source resource — a new table, knowledge base, file, or MCP server config | + +**Credentials** and **Secrets** are **map-only**. They are never copied. Secret *values* never leave their workspace; only names like `{{API_KEY}}` appear in workflow text. + +Mappings are saved on the fork relationship. You can click **Save** without syncing. Sync always uses the saved mappings. + +After you map or copy a parent resource (credential, knowledge base, table, …), **dependent fields** — Gmail labels, Slack channels, knowledge base documents, and similar — often need a fresh pick in the target. Required dependents block **Sync** until they are filled. + +### 5. Map, reconfigure, then Sync + +On the sync page you will see direction (**Push** / **Pull**), deployed workflow changes, **Mappings**, optional **Copy resources**, and any **Blocking sync** items. + +Sync detail page with Push and Pull direction, deployed workflows, and mapping status badges + +- **Push** — overwrite the **other** workspace with this workspace’s deployed workflows +- **Pull** — overwrite **this** workspace with the other’s deployed workflows + +Both are force operations. Confirm carefully. + +Copy resources section showing resources used by workflows and a Not used by any workflow group + +Resources referenced by the workflows in the sync default to selected for copy. Unused ones sit under **Not used by any workflow** (off by default). If you **map** a resource, it leaves the copy list — maps win. + +Dependent field reconfigure card under a mapped resource with a required field marked + +**Sync** stays disabled until: + +- Every blocking reference is mapped, copied, or fixed in the source +- Required credentials and secrets are mapped +- Required dependent fields are filled +- Sync details have finished loading + +### 6. Confirm and run + +Click **Sync**. You will get an overwrite confirmation. + +Overwrite target workspace confirmation dialog warning that syncing overwrites changes on the target + +On success you will see a toast such as **Pushed to "…"** or **Pulled from "…"**. If some workflows fail to redeploy, you get a warning to open and redeploy them manually. + +--- + +## Activity + +**See activity** (or the Activity view from the Forks header) lists forks, pushes, pulls, and rollbacks that involve this workspace — including events recorded on the other side of the edge. + +Activity view showing Fork and Push events with expandable detail rows + +Expand a row for names of workflows and resources that were created, updated, or archived, and any warnings (for example failed background copies or deploy failures). + +--- + +## Rollback vs Disconnect + +| Action | What it does | Keep in mind | +|--------|--------------|--------------| +| **Rollback** | Undoes the **last sync into this workspace** — restores each affected workflow to its prior deployed version and removes workflows that sync created | Copied resources from past syncs **may remain**. Rollback does not delete tables, KBs, or files that were copied in. | +| **Disconnect** | Permanently removes the fork relationship | Both workspaces stay. Saved mappings and sync history for the pair are deleted. Forking again creates a **new** child, not a reconnect. | + +--- + +## Permissions + +| Action | Who | +|--------|-----| +| See Forks / create a fork | Admin on this workspace (+ feature available) | +| Sync / edit mappings | Admin on **both** sides of the edge | +| Rollback | Admin on the workspace the sync landed in | +| Disconnect | Admin on **this** side only (you can disconnect even without access to the other workspace) | +| Open the other workspace | You must be a member of that workspace | + +--- + +## Resource reference + +How each resource behaves at **fork** time vs **sync** time. Use this when you are deciding what to select under **Copy resources**, or why Sync is asking you to map something. + +### At a glance + +| Resource | Fork | Sync | +|----------|------|------| +| Deployed workflows | Always copied as drafts | Updated / created / archived (force overwrite) | +| Undeployed workflows | Not copied | Not synced | +| Files | Optional copy (default on) | Map or copy | +| Tables | Optional copy (default on) | Map or copy | +| Knowledge bases (+ documents) | Optional copy; referenced docs come with the KB | Map or copy; documents follow the KB | +| Custom tools | Optional copy (default on) | Map or copy | +| Skills | Optional copy (default on) | Map or copy | +| External MCP servers | Optional copy (config only; sign-in cleared) | Map or copy (config only; sign-in cleared) | +| Workflow MCP servers | Optional copy (server shells + attachments when workflows copy) | Kept in sync automatically with the workflows | +| Deployed chats | Carried with a **new** chat URL | Created on the target if it has no chat yet | +| Credentials | Never — fields cleared | Map only | +| Secrets | Values never; `{{KEY}}` names kept | Map key names only | +| Public API | Child starts private | Flag follows the workflow | +| Schedules / webhooks / triggers | Not live until you deploy in the child | Follow whatever you deploy on the target | +| History, API keys, memory, scheduled jobs | Never | Never | + +--- + +### Workflows + +Only **deployed** workflows move. Deploy is the commit; sync is the force push/pull of those commits. + +| | Behavior | +|---|----------| +| **Fork** | Each deployed workflow becomes a **draft** in the child. Run history is not copied. Only folders that contain a copied workflow are kept. | +| **Sync** | The change list shows what will be updated, created, or archived. The target is overwritten for those workflows. | + +**Example:** Parent has `Support triage` deployed and `WIP experiment` as a draft. The fork gets only `Support triage` as a draft. A later push updates the child from the parent’s latest deploy of `Support triage`. + +--- + +### Files + +| | Behavior | +|---|----------| +| **Fork** | Listed under **Copy resources** (default on). Copies land at the child’s **file root** (original file folders are not rebuilt). Deselect → file fields in workflows clear. | +| **Sync** | Map to a file that already exists on the target, or copy. Files used by the sync’s workflows default to selected. | + +**Example:** A workflow attaches `brand-guide.pdf`. Fork with Files selected → the child has its own copy and the block still points at it. + +--- + +### Tables + +| | Behavior | +|---|----------| +| **Fork** | Optional copy (default on). Rows may finish copying in the background after the fork is created. Deselect → table fields clear. | +| **Sync** | Map if both sides should keep pointing at “the same” logical table through the mapping, or copy for an independent dataset on the target. | + +**Example:** An enrichment workflow uses a “Leads” table. Copy on fork so the child can experiment without touching production data. On sync, map if you intentionally want both sides aligned to paired tables, or copy a new table when the target should get a fresh clone. + +--- + +### Knowledge bases and documents + +| | Behavior | +|---|----------| +| **Fork** | Optional copy (default on). Tag definitions come with the knowledge base. Documents that the forked workflows actually reference are included. Deselect → knowledge base / document fields clear. | +| **Sync** | Map or copy the knowledge base. Documents are not mapped by themselves — they follow the knowledge base (copied with it, or re-picked when you map to an existing one). | + +**Example:** An agent searches knowledge base “Product docs.” Fork with that knowledge base selected → the child gets the base, tags, and the documents the agent used. On sync, mapping to the child’s existing “Product docs” means re-picking which document the tool should use. + +--- + +### Custom tools + +| | Behavior | +|---|----------| +| **Fork** | Optional copy (default on). The tool definition comes along so agent / tool picks keep working. | +| **Sync** | Map when both sides already maintain the same tool; copy when the target should receive the source’s definition as a new tool. | + +**Example:** A `lookup_customer` custom tool used by an agent. Fork with Custom tools selected → the child’s agent still has the tool. On push, a brand-new tool on the child can be copied into the parent if you leave it selected under **Copy resources**. + +--- + +### Skills + +| | Behavior | +|---|----------| +| **Fork** | Optional copy (default on). Skill content comes along. Links inside the skill to files or other Sim resources are updated when those resources were also copied. Deselect → skill fields on agents clear. | +| **Sync** | Map or copy, same idea as custom tools. | + +**Example:** A “Support tone” skill on an agent. Deselecting it on fork clears the skill on the child’s agent until you attach one again. + +--- + +### External MCP servers + +Servers you connect to an external MCP endpoint (not “publish this workflow as MCP”). + +| | Behavior | +|---|----------| +| **Fork** | Optional copy (default on). **Connection settings** (URL, headers, transport) copy. **Sign-in / OAuth is not copied** — OAuth servers show up disconnected until someone signs in again in the child. Tool picks on MCP and agent blocks follow the new server. | +| **Sync** | Map or copy under the same rules. Mapping is typical when each workspace has its own server aimed at the same upstream system. | + +**Example:** An MCP server for an internal API. After fork, open MCP settings in the child and complete OAuth (or confirm API headers) before those tools will run. On sync, map child ↔ parent servers so tool selections survive push and pull. + +--- + +### Workflow MCP servers + +Servers that **publish workflows as MCP tools**. + +| | Behavior | +|---|----------| +| **Fork** | Optional under **Copy resources**. You get matching server shells in the child. When the workflow was also forked, its tool attachment on that server is carried over. | +| **Sync** | These are not shown in the mapping list. Attachments stay aligned as you sync — tools are added, updated, or removed to match the source. | + +**Example:** Parent exposes `Support triage` on a workflow MCP server. Fork with Workflow MCP servers selected → the child gets a matching server and the attachment to the child’s copy of the workflow. + +--- + +### Deployed chats + +| | Behavior | +|---|----------| +| **Fork** | Live chat deployments on copied workflows come along with a **new chat URL**. Conversation history is not copied — only the chat setup (including which blocks feed the chat). | +| **Sync** | If the target workflow has **no** chat yet, the source’s live chat is created there (again with a new URL). Existing chats on the target are left alone. Workflows that are not ready to deploy do not get a chat. | + +**Example:** Parent has a public chat on `Support triage`. The fork gets its own chat URL right away. A later push onto a parent workflow that never had a chat can create one there. + +--- + +### Credentials + +| | Behavior | +|---|----------| +| **Fork** | **Never copied.** Credential fields in workflows are cleared. Connect or pick credentials in the child. | +| **Sync** | **Map only.** Every credential used by the synced workflows must be mapped to a credential on the target (same kind of integration). Sync stays blocked until that is done. Then re-pick dependents (labels, calendars, channels, …). | + +**Example:** A Gmail block using “Support inbox.” Fork clears it. Before the first sync, map it to the child’s “Support inbox” credential and re-pick the label. + +--- + +### Secrets (environment variables) + +| | Behavior | +|---|----------| +| **Fork** | **Values never leave the source.** Workflow text still contains `{{KEY}}` names. Create matching secrets (or the names you will map to) under the child’s **Secrets**. | +| **Sync** | Map source key names to target key names. Values stay in each workspace. Unmapped required secrets block Sync. | + +**Example:** Workflows use `{{OPENAI_API_KEY}}`. After fork, add that secret in the child (or map `OPENAI_API_KEY` to whatever name the child uses) before runs and syncs succeed. + +--- + +### Public API + +| | Behavior | +|---|----------| +| **Fork** | Child workflows start **private** — not exposed as public API endpoints, even if the parent was. | +| **Sync** | The source workflow’s public API setting is carried. Push a public endpoint and the target becomes public too. | + +--- + +### Not carried + +These do not move at fork or sync time: + +- Undeployed workflows and local drafts +- Execution / run history +- Sim API keys +- Memory stores and scheduled jobs +- BYOK provider keys +- Permission groups (the child inherits the organization, but groups are not specially applied by forking) + +Schedules, webhooks, and triggers are not live in the child until you **deploy** there — same “deploy = commit” rule. + +--- + +## Edge cases to keep in mind + +- **Force overwrite** — Sync does not merge canvas changes. Anything only on the target that conflicts with the source’s deployed workflows can be lost. Use the confirm dialog’s archive list carefully. +- **Deselect on fork** — Cleared references are intentional. Prefer copying the resource, or plan to reconnect it in the child. +- **Background copy** — Right after fork, large tables / knowledge bases / files may still be copying. Check **Activity** if something looks empty. +- **OAuth MCP** — Expect a reconnect in the child (and after a copied server on sync). +- **Rollback ≠ undo copies** — Workflow versions roll back; copied resources can remain as orphans. +- **Disconnect is permanent** — You cannot “reconnect” the same edge; you would fork again into a new workspace. +- **No grandparent sync** — Only the direct parent↔child pair. + +--- + + + +--- + +## Self-hosted setup + +Self-hosted deployments turn Forks on with an environment variable instead of the Enterprise plan. + +| Variable | Description | +|----------|-------------| +| `FORKING_ENABLED`, `NEXT_PUBLIC_FORKING_ENABLED` | Enables workspace forking when billing is not used as the entitlement gate | + +Once enabled, use the same **Settings → Enterprise → Workspace Forks** UI as Sim Cloud. Only workspace admins can manage forks. diff --git a/apps/docs/content/docs/en/platform/enterprise/index.mdx b/apps/docs/content/docs/en/platform/enterprise/index.mdx index fef18101d99..6aee826a8af 100644 --- a/apps/docs/content/docs/en/platform/enterprise/index.mdx +++ b/apps/docs/content/docs/en/platform/enterprise/index.mdx @@ -5,7 +5,7 @@ description: Enterprise features for business organizations import { FAQ } from '@/components/ui/faq' -Sim Enterprise adds fine-grained access control, SSO, audit logging, and compliance features on top of Team plans. +Sim Enterprise adds fine-grained access control, SSO, audit logging, compliance features, and workspace forking on top of Team plans. --- @@ -65,8 +65,14 @@ Continuously export workflow logs, audit logs, and Mothership data to a customer --- +## Workspace Forks + +Clone a workspace into a linked child, then push or pull **deployed** workflow changes between them. Deploy is like a commit; sync is a force push or force pull. See the [workspace forks guide](/platform/enterprise/forks). + +--- + @@ -86,6 +92,7 @@ Self-hosted deployments enable enterprise features via environment variables ins | `AUDIT_LOGS_ENABLED`, `NEXT_PUBLIC_AUDIT_LOGS_ENABLED` | Audit logging | | `NEXT_PUBLIC_DATA_RETENTION_ENABLED` | Data retention configuration | | `DATA_DRAINS_ENABLED`, `NEXT_PUBLIC_DATA_DRAINS_ENABLED` | Data drains | +| `FORKING_ENABLED`, `NEXT_PUBLIC_FORKING_ENABLED` | Workspace forking | | `INBOX_ENABLED`, `NEXT_PUBLIC_INBOX_ENABLED` | Sim Mailer inbox | | `DISABLE_INVITATIONS`, `NEXT_PUBLIC_DISABLE_INVITATIONS` | Disable invitations; manage membership via Admin API | diff --git a/apps/docs/content/docs/en/platform/enterprise/meta.json b/apps/docs/content/docs/en/platform/enterprise/meta.json index 8ac0662175e..c8a33a7e287 100644 --- a/apps/docs/content/docs/en/platform/enterprise/meta.json +++ b/apps/docs/content/docs/en/platform/enterprise/meta.json @@ -4,10 +4,12 @@ "index", "sso", "access-control", + "custom-blocks", "whitelabeling", "audit-logs", "data-retention", - "data-drains" + "data-drains", + "forks" ], "defaultOpen": false } diff --git a/apps/docs/package.json b/apps/docs/package.json index 9f8d622f6cc..6c9e64cf5bb 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -50,8 +50,9 @@ "@types/node": "^22.14.1", "@types/react": "^19.1.2", "@types/react-dom": "^19.0.4", + "@typescript/native-preview": "7.0.0-dev.20260707.2", "postcss": "^8.5.3", "tailwindcss": "^4.0.12", - "typescript": "^5.8.2" + "typescript": "^7.0.2" } } diff --git a/apps/docs/public/static/enterprise/custom-blocks-canvas.png b/apps/docs/public/static/enterprise/custom-blocks-canvas.png new file mode 100644 index 00000000000..e952b15bb1b Binary files /dev/null and b/apps/docs/public/static/enterprise/custom-blocks-canvas.png differ diff --git a/apps/docs/public/static/enterprise/custom-blocks-form.png b/apps/docs/public/static/enterprise/custom-blocks-form.png new file mode 100644 index 00000000000..ed68e0e9ce5 Binary files /dev/null and b/apps/docs/public/static/enterprise/custom-blocks-form.png differ diff --git a/apps/docs/public/static/enterprise/custom-blocks-list.png b/apps/docs/public/static/enterprise/custom-blocks-list.png new file mode 100644 index 00000000000..18671499275 Binary files /dev/null and b/apps/docs/public/static/enterprise/custom-blocks-list.png differ diff --git a/apps/docs/public/static/enterprise/custom-blocks-toolbar.png b/apps/docs/public/static/enterprise/custom-blocks-toolbar.png new file mode 100644 index 00000000000..cd8fc3b8d92 Binary files /dev/null and b/apps/docs/public/static/enterprise/custom-blocks-toolbar.png differ diff --git a/apps/docs/public/static/enterprise/forks-activity.png b/apps/docs/public/static/enterprise/forks-activity.png new file mode 100644 index 00000000000..dd9398b34a2 Binary files /dev/null and b/apps/docs/public/static/enterprise/forks-activity.png differ diff --git a/apps/docs/public/static/enterprise/forks-copy-resources.png b/apps/docs/public/static/enterprise/forks-copy-resources.png new file mode 100644 index 00000000000..616b8204a1f Binary files /dev/null and b/apps/docs/public/static/enterprise/forks-copy-resources.png differ diff --git a/apps/docs/public/static/enterprise/forks-create-modal.png b/apps/docs/public/static/enterprise/forks-create-modal.png new file mode 100644 index 00000000000..ff20e2c78e7 Binary files /dev/null and b/apps/docs/public/static/enterprise/forks-create-modal.png differ diff --git a/apps/docs/public/static/enterprise/forks-create-warning.png b/apps/docs/public/static/enterprise/forks-create-warning.png new file mode 100644 index 00000000000..14e120bdc42 Binary files /dev/null and b/apps/docs/public/static/enterprise/forks-create-warning.png differ diff --git a/apps/docs/public/static/enterprise/forks-list.png b/apps/docs/public/static/enterprise/forks-list.png new file mode 100644 index 00000000000..5d31ccef839 Binary files /dev/null and b/apps/docs/public/static/enterprise/forks-list.png differ diff --git a/apps/docs/public/static/enterprise/forks-reconfigure.png b/apps/docs/public/static/enterprise/forks-reconfigure.png new file mode 100644 index 00000000000..32ea2605de1 Binary files /dev/null and b/apps/docs/public/static/enterprise/forks-reconfigure.png differ diff --git a/apps/docs/public/static/enterprise/forks-sync-confirm.png b/apps/docs/public/static/enterprise/forks-sync-confirm.png new file mode 100644 index 00000000000..74d5ea07dd2 Binary files /dev/null and b/apps/docs/public/static/enterprise/forks-sync-confirm.png differ diff --git a/apps/docs/public/static/enterprise/forks-sync-overview.png b/apps/docs/public/static/enterprise/forks-sync-overview.png new file mode 100644 index 00000000000..3ae743c1571 Binary files /dev/null and b/apps/docs/public/static/enterprise/forks-sync-overview.png differ diff --git a/apps/docs/tsconfig.json b/apps/docs/tsconfig.json index 1a45ee64711..857bd1f7da6 100644 --- a/apps/docs/tsconfig.json +++ b/apps/docs/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "@sim/tsconfig/nextjs.json", "compilerOptions": { - "baseUrl": ".", "paths": { "@/.source/*": ["./.source/*"], "@/*": ["./*"] diff --git a/apps/pii/engines.py b/apps/pii/engines.py new file mode 100644 index 00000000000..c8edf982ff1 --- /dev/null +++ b/apps/pii/engines.py @@ -0,0 +1,267 @@ +"""Analyzer engine builders for the PII service. + +Two NER engines share one recognizer surface: + +- spacy (default): the 5 large spaCy models do NER (PERSON/LOCATION/NRP/ + DATE_TIME) and tokenization. +- gliner (opt-in): one multilingual GLiNER model does NER on CPU or GPU; + small spaCy models remain only for tokenization + lemmas. + +Both engines register the identical regex/checksum recognizer set (Presidio +defaults, EXTRA_RECOGNIZERS, VIN) — only the source of the 4 NER entity types +differs. Side-effect free: importing this module loads no models. +""" + +import importlib.util + +import spacy.util +from presidio_analyzer import AnalyzerEngine, Pattern, PatternRecognizer +from presidio_analyzer.nlp_engine import NlpEngineProvider +from presidio_analyzer.predefined_recognizers import ( + AuAbnRecognizer, + AuAcnRecognizer, + AuMedicareRecognizer, + AuTfnRecognizer, + EsNieRecognizer, + EsNifRecognizer, + FiPersonalIdentityCodeRecognizer, + GLiNERRecognizer, + InAadhaarRecognizer, + InPanRecognizer, + InPassportRecognizer, + InVehicleRegistrationRecognizer, + InVoterRecognizer, + ItDriverLicenseRecognizer, + ItFiscalCodeRecognizer, + ItIdentityCardRecognizer, + ItPassportRecognizer, + ItVatCodeRecognizer, + PlPeselRecognizer, + SgFinRecognizer, + SgUenRecognizer, + UkNinoRecognizer, +) + +# Languages served. Each needs its spaCy model installed in the image; the +# es/it/pl/fi predefined recognizers (ES_NIF, IT_FISCAL_CODE, PL_PESEL, ...) +# auto-load once their NLP engine is present. +NLP_CONFIGURATION = { + "nlp_engine_name": "spacy", + "models": [ + {"lang_code": "en", "model_name": "en_core_web_lg"}, + {"lang_code": "es", "model_name": "es_core_news_lg"}, + {"lang_code": "it", "model_name": "it_core_news_lg"}, + {"lang_code": "pl", "model_name": "pl_core_news_lg"}, + {"lang_code": "fi", "model_name": "fi_core_news_lg"}, + ], +} +SUPPORTED_LANGUAGES = [m["lang_code"] for m in NLP_CONFIGURATION["models"]] + +# The gliner engine still needs a spaCy pipeline per language: the regex +# recognizers consume NlpArtifacts and the LemmaContextAwareEnhancer boosts +# scores from surrounding lemmas. The small models (~12-40MB each vs ~400MB +# large) keep tokenization + lemmas intact while GLiNER owns NER. Blank +# pipelines ("blank:xx") are not an option: Presidio's SpacyNlpEngine treats +# unknown model names as pip packages and tries to download them. +# labels_to_ignore strips the small models' NER output from NlpArtifacts — +# correctness comes from removing SpacyRecognizer in build_gliner_analyzer; +# this only silences unmapped-label noise. +GLINER_NLP_CONFIGURATION = { + "nlp_engine_name": "spacy", + "models": [ + {"lang_code": "en", "model_name": "en_core_web_sm"}, + {"lang_code": "es", "model_name": "es_core_news_sm"}, + {"lang_code": "it", "model_name": "it_core_news_sm"}, + {"lang_code": "pl", "model_name": "pl_core_news_sm"}, + {"lang_code": "fi", "model_name": "fi_core_news_sm"}, + ], + "ner_model_configuration": { + "labels_to_ignore": [ + "CARDINAL", "DATE", "EVENT", "FAC", "GPE", "LANGUAGE", "LAW", + "LOC", "MISC", "MONEY", "NORP", "ORDINAL", "ORG", "PER", + "PERCENT", "PERSON", "PRODUCT", "QUANTITY", "TIME", "WORK_OF_ART", + ], + }, +} + +# Zero-shot label prompts -> the 4 Presidio NER entities GLiNER owns. Multiple +# prompts per entity trade a little inference cost for recall; tune against +# scripts/bench_engines.py output. +GLINER_ENTITY_MAPPING = { + "person": "PERSON", + "name": "PERSON", + "location": "LOCATION", + "address": "LOCATION", + "date": "DATE_TIME", + "time": "DATE_TIME", + "nationality": "NRP", + "religious group": "NRP", + "political group": "NRP", + "ethnic group": "NRP", +} + +# Predefined recognizers Presidio ships but does NOT load into the default +# registry — they must be added explicitly. Each carries its own +# supported_language, so it fires under that language once its NLP model is +# loaded. en: UK/AU/IN/SG locale ids; es/it/pl/fi: national ids. +EXTRA_RECOGNIZERS = [ + UkNinoRecognizer, + AuAbnRecognizer, + AuAcnRecognizer, + AuTfnRecognizer, + AuMedicareRecognizer, + InPanRecognizer, + InAadhaarRecognizer, + InVehicleRegistrationRecognizer, + InVoterRecognizer, + InPassportRecognizer, + SgFinRecognizer, + SgUenRecognizer, + EsNifRecognizer, + EsNieRecognizer, + ItFiscalCodeRecognizer, + ItDriverLicenseRecognizer, + ItVatCodeRecognizer, + ItPassportRecognizer, + ItIdentityCardRecognizer, + PlPeselRecognizer, + FiPersonalIdentityCodeRecognizer, +] + + +class VinRecognizer(PatternRecognizer): + """VIN (17 chars, A-Z/0-9 excluding I/O/Q) with ISO 3779 check-digit + validation (position 9). Validation makes accidental matches on arbitrary + 17-char codes (request ids, SKUs, tokens) extremely unlikely. Some + non-North-American VINs omit the check digit and are skipped — an + intentional bias toward precision. + """ + + _TRANSLIT = { + **{str(d): d for d in range(10)}, + "A": 1, "B": 2, "C": 3, "D": 4, "E": 5, "F": 6, "G": 7, "H": 8, + "J": 1, "K": 2, "L": 3, "M": 4, "N": 5, "P": 7, "R": 9, + "S": 2, "T": 3, "U": 4, "V": 5, "W": 6, "X": 7, "Y": 8, "Z": 9, + } + _WEIGHTS = [8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2] + + def validate_result(self, pattern_text: str): + vin = pattern_text.upper() + if len(vin) != 17: + return False + try: + total = sum(self._TRANSLIT[c] * w for c, w in zip(vin, self._WEIGHTS)) + except KeyError: + return False + check = total % 11 + expected = "X" if check == 10 else str(check) + return vin[8] == expected + + +class SharedModelGLiNERRecognizer(GLiNERRecognizer): + """Per-language GLiNER recognizer sharing ONE loaded model. + + Presidio routes recognizers by supported_language, so the registry holds + one instance per served language — but each instance's load() would pull + its own ~1.2GB model copy. The first instance loads (an ImportError from + a missing gliner package propagates — fail fast in the lean image); the + rest reuse the cached model. + """ + + _shared_models: dict = {} + + def load(self) -> None: + key = (self.model_name, self.map_location) + cached = self._shared_models.get(key) + if cached is None: + super().load() + self._shared_models[key] = self.gliner + else: + self.gliner = cached + + def analyze(self, text, entities, nlp_artifacts=None): + """GLiNERRecognizer appends any requested entity it doesn't know as an + ad-hoc zero-shot label and returns its hits. The analyzer passes ALL + supported entities (~40) when a request doesn't narrow them, which + would prompt GLiNER for CREDIT_CARD/VIN/ES_NIF/... — wrong scope, and + inference cost scales with label count. Restrict to the NER entities + this recognizer owns.""" + requested = [e for e in (entities or self.supported_entities) if e in self.supported_entities] + if not requested: + return [] + return super().analyze(text, requested, nlp_artifacts) + + +def _register_common_recognizers(analyzer: AnalyzerEngine) -> None: + """Regex/checksum recognizers shared by both engines.""" + # VIN is language-agnostic, so register it under every served language — + # a recognizer only fires for the language the caller routes to. + vin_pattern = Pattern(name="vin", regex=r"\b[A-HJ-NPR-Z0-9]{17}\b", score=0.7) + for language in SUPPORTED_LANGUAGES: + analyzer.registry.add_recognizer( + VinRecognizer( + supported_entity="VIN", + patterns=[vin_pattern], + context=["vin", "vehicle", "chassis"], + supported_language=language, + ) + ) + for recognizer_cls in EXTRA_RECOGNIZERS: + analyzer.registry.add_recognizer(recognizer_cls()) + + +def build_spacy_analyzer() -> AnalyzerEngine: + nlp_engine = NlpEngineProvider(nlp_configuration=NLP_CONFIGURATION).create_engine() + analyzer = AnalyzerEngine(nlp_engine=nlp_engine, supported_languages=SUPPORTED_LANGUAGES) + _register_common_recognizers(analyzer) + return analyzer + + +def build_gliner_analyzer(model_name: str, device: str | None) -> AnalyzerEngine: + """GLiNER engine: one multilingual zero-shot model replaces spaCy NER for + PERSON/LOCATION/NRP/DATE_TIME; everything else is unchanged. + + :param model_name: HuggingFace id of the GLiNER model. + :param device: torch device ("cpu", "cuda", "cuda:0"); None auto-detects + via Presidio's device_detector (cuda when available, else cpu). + """ + # Fail fast with an actionable message when gliner deps are missing (e.g. + # a custom-built image without them). Without these checks Presidio would + # try to pip-download the missing spaCy models at startup (a silent + # network fallback that dies with an unrelated pip permission error), and + # the gliner ImportError would surface only later. + if importlib.util.find_spec("gliner") is None: + raise RuntimeError( + "PII_ENGINE=gliner but the gliner package is not installed; " + "use the stock pii image (docker/pii.Dockerfile ships torch + gliner)" + ) + missing = [ + m["model_name"] + for m in GLINER_NLP_CONFIGURATION["models"] + if not spacy.util.is_package(m["model_name"]) + ] + if missing: + raise RuntimeError( + f"PII_ENGINE=gliner needs spaCy models {missing}; " + "use the stock pii image (docker/pii.Dockerfile ships them)" + ) + nlp_engine = NlpEngineProvider(nlp_configuration=GLINER_NLP_CONFIGURATION).create_engine() + analyzer = AnalyzerEngine(nlp_engine=nlp_engine, supported_languages=SUPPORTED_LANGUAGES) + # The default registry wires SpacyRecognizer per language; with GLiNER + # owning the NER entities it would emit duplicate/competing spans from the + # small models' ner pipe. remove_recognizer only logs when nothing matched, + # so assert the removal actually happened. + analyzer.registry.remove_recognizer("SpacyRecognizer") + if any(r.name == "SpacyRecognizer" for r in analyzer.registry.recognizers): + raise RuntimeError("SpacyRecognizer removal failed; Presidio registry layout changed") + for language in SUPPORTED_LANGUAGES: + analyzer.registry.add_recognizer( + SharedModelGLiNERRecognizer( + entity_mapping=GLINER_ENTITY_MAPPING, + model_name=model_name, + map_location=device, + supported_language=language, + ) + ) + _register_common_recognizers(analyzer) + return analyzer diff --git a/apps/pii/requirements-dev.txt b/apps/pii/requirements-dev.txt new file mode 100644 index 00000000000..4c330d999ae --- /dev/null +++ b/apps/pii/requirements-dev.txt @@ -0,0 +1,5 @@ +# Test-only deps. Unit tests need requirements.txt + this file (no models); +# integration tests additionally need the models baked into the docker images +# (see tests/test_integration.py). +pytest==8.4.1 +httpx==0.28.1 diff --git a/apps/pii/requirements-gliner.txt b/apps/pii/requirements-gliner.txt new file mode 100644 index 00000000000..d620c5f1825 --- /dev/null +++ b/apps/pii/requirements-gliner.txt @@ -0,0 +1,10 @@ +# Extras for the opt-in GLiNER engine — installed ONLY in the `gliner` +# Dockerfile target, on top of requirements.txt. Pinned for reproducible image +# builds; bump deliberately. presidio-analyzer 2.2.362 requires +# gliner >=0.2.13,<1.0.0. +# +# torch is pinned in the Dockerfile instead: the CPU and CUDA targets install +# the same version from different wheel indexes. +gliner==0.2.27 +transformers==4.56.2 +huggingface_hub==0.35.3 diff --git a/apps/pii/scripts/bench_engines.py b/apps/pii/scripts/bench_engines.py new file mode 100644 index 00000000000..b7ea70ca764 --- /dev/null +++ b/apps/pii/scripts/bench_engines.py @@ -0,0 +1,206 @@ +"""Benchmark + parity harness for the spacy vs gliner NER engines. + +Runs the same payload through both engines and reports per-engine throughput +(batch analyze, the production /redact_batch path) and per-text latency, plus +an accuracy diff over the 4 NER entity types (PERSON/LOCATION/NRP/DATE_TIME). +Non-NER (regex/checksum) results must be identical between engines — both +register the same recognizers — so any mismatch there is a wiring bug and the +script exits non-zero. + +Meant to run inside the pii image (both engines ship in it): + + docker run --rm python scripts/bench_engines.py + docker run --rm -v $PWD/texts.json:/data.json \\ + python scripts/bench_engines.py --payload /data.json + +Payload format: JSON list of {"text": str, "language": str} objects. +This doubles as the tuning harness for GLINER_ENTITY_MAPPING label prompts. +""" + +import argparse +import json +import statistics +import sys +import time +from collections import defaultdict +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) + +import engines # noqa: E402 + +# Entities sourced from the NER models rather than regex/checksum patterns. +# ORGANIZATION is emitted by the spacy engine's NER on unfiltered requests but +# is not in the app's supported set and has no GLiNER mapping — it shows up in +# the NER diff (spacy-only) rather than failing the regex-parity gate. +NER_ENTITIES = {"PERSON", "LOCATION", "NRP", "DATE_TIME", "ORGANIZATION"} +DEFAULT_PAYLOAD = Path(__file__).resolve().parent / "bench_payload.json" + + +def parse_args(): + parser = argparse.ArgumentParser(description=__doc__.splitlines()[0]) + parser.add_argument("--payload", type=Path, default=DEFAULT_PAYLOAD) + parser.add_argument("--engines", default="spacy,gliner") + parser.add_argument("--runs", type=int, default=3) + parser.add_argument("--warmup", type=int, default=1) + parser.add_argument("--device", default=None, help="torch device for gliner (default: auto)") + parser.add_argument("--gliner-model", default="urchade/gliner_multi_pii-v1") + parser.add_argument("--max-examples", type=int, default=10) + parser.add_argument("--json", action="store_true", help="emit machine-readable JSON") + return parser.parse_args() + + +def build(engine: str, args) -> tuple: + started = time.perf_counter() + if engine == "spacy": + analyzer = engines.build_spacy_analyzer() + elif engine == "gliner": + analyzer = engines.build_gliner_analyzer(model_name=args.gliner_model, device=args.device) + else: + raise ValueError(f"Unknown engine {engine!r}") + return analyzer, time.perf_counter() - started + + +def analyze_all(analyzer, items) -> list[list]: + """One analyze() call per text, in payload order.""" + return [analyzer.analyze(text=item["text"], language=item["language"]) for item in items] + + +def bench(analyzer, items, runs: int, warmup: int) -> dict: + for _ in range(warmup): + analyze_all(analyzer, items) + run_times = [] + latencies = [] + for _ in range(runs): + run_started = time.perf_counter() + for item in items: + text_started = time.perf_counter() + analyzer.analyze(text=item["text"], language=item["language"]) + latencies.append(time.perf_counter() - text_started) + run_times.append(time.perf_counter() - run_started) + total_chars = sum(len(item["text"]) for item in items) + avg_run = statistics.mean(run_times) + return { + "texts_per_sec": len(items) / avg_run, + "chars_per_sec": total_chars / avg_run, + "latency_p50_ms": statistics.median(latencies) * 1000, + "latency_p95_ms": statistics.quantiles(latencies, n=20)[18] * 1000, + } + + +def spans(results, keep_ner: bool) -> set: + return { + (r.entity_type, r.start, r.end) + for r in results + if (r.entity_type in NER_ENTITIES) == keep_ner + } + + +def iou(a: tuple, b: tuple) -> float: + inter = max(0, min(a[2], b[2]) - max(a[1], b[1])) + union = max(a[2], b[2]) - min(a[1], b[1]) + return inter / union if union else 0.0 + + +def diff_ner(items, results_a, results_b, max_examples: int) -> dict: + """Per-entity-type agreement between two engines (span IoU >= 0.5).""" + per_type = defaultdict(lambda: {"a_total": 0, "b_total": 0, "matched": 0}) + examples = [] + for item, res_a, res_b in zip(items, results_a, results_b): + a = sorted(spans(res_a, keep_ner=True)) + b = sorted(spans(res_b, keep_ner=True)) + unmatched_b = set(b) + for span_a in a: + per_type[span_a[0]]["a_total"] += 1 + match = next( + (s for s in unmatched_b if s[0] == span_a[0] and iou(span_a, s) >= 0.5), None + ) + if match: + per_type[span_a[0]]["matched"] += 1 + unmatched_b.discard(match) + for span_b in b: + per_type[span_b[0]]["b_total"] += 1 + only_a = [s for s in a if not any(s[0] == t[0] and iou(s, t) >= 0.5 for t in b)] + only_b = sorted(unmatched_b) + if (only_a or only_b) and len(examples) < max_examples: + examples.append( + { + "text": item["text"], + "language": item["language"], + "only_a": [f"{t}[{s}:{e}]={item['text'][s:e]!r}" for t, s, e in only_a], + "only_b": [f"{t}[{s}:{e}]={item['text'][s:e]!r}" for t, s, e in only_b], + } + ) + return {"per_type": dict(per_type), "examples": examples} + + +def diff_regex(items, results_a, results_b) -> list: + """Non-NER results must be identical: same recognizers on both engines.""" + mismatches = [] + for item, res_a, res_b in zip(items, results_a, results_b): + a = spans(res_a, keep_ner=False) + b = spans(res_b, keep_ner=False) + if a != b: + mismatches.append({"text": item["text"], "only_a": sorted(a - b), "only_b": sorted(b - a)}) + return mismatches + + +def main() -> int: + args = parse_args() + items = json.loads(args.payload.read_text()) + engine_names = [e.strip() for e in args.engines.split(",") if e.strip()] + + report = {"payload": str(args.payload), "texts": len(items), "engines": {}} + results_by_engine = {} + for name in engine_names: + analyzer, build_secs = build(name, args) + stats = bench(analyzer, items, runs=args.runs, warmup=args.warmup) + stats["build_secs"] = build_secs + report["engines"][name] = stats + results_by_engine[name] = analyze_all(analyzer, items) + + exit_code = 0 + if set(engine_names) >= {"spacy", "gliner"}: + report["ner_diff"] = diff_ner( + items, results_by_engine["spacy"], results_by_engine["gliner"], args.max_examples + ) + regex_mismatches = diff_regex( + items, results_by_engine["spacy"], results_by_engine["gliner"] + ) + report["regex_mismatches"] = regex_mismatches + if regex_mismatches: + exit_code = 1 + + if args.json: + print(json.dumps(report, indent=2, default=str)) + return exit_code + + for name, stats in report["engines"].items(): + print(f"\n== {name} ==") + print(f" build: {stats['build_secs']:.1f}s") + print(f" throughput: {stats['texts_per_sec']:.2f} texts/s ({stats['chars_per_sec']:.0f} chars/s)") + print(f" latency: p50 {stats['latency_p50_ms']:.1f}ms p95 {stats['latency_p95_ms']:.1f}ms") + if "ner_diff" in report: + print("\n== NER parity (spacy=a vs gliner=b, span IoU>=0.5) ==") + for entity, counts in sorted(report["ner_diff"]["per_type"].items()): + print( + f" {entity:<10} spacy={counts['a_total']:<4} gliner={counts['b_total']:<4} " + f"matched={counts['matched']}" + ) + for example in report["ner_diff"]["examples"]: + print(f"\n [{example['language']}] {example['text']}") + if example["only_a"]: + print(f" spacy only: {', '.join(example['only_a'])}") + if example["only_b"]: + print(f" gliner only: {', '.join(example['only_b'])}") + if report["regex_mismatches"]: + print("\n!! REGEX MISMATCHES (wiring bug — engines must agree on non-NER):") + for mismatch in report["regex_mismatches"]: + print(f" {mismatch}") + else: + print("\n regex/checksum entities: identical across engines ✓") + return exit_code + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/apps/pii/scripts/bench_payload.json b/apps/pii/scripts/bench_payload.json new file mode 100644 index 00000000000..fd0f207164d --- /dev/null +++ b/apps/pii/scripts/bench_payload.json @@ -0,0 +1,97 @@ +[ + { "text": "My name is John Smith and I live in Paris with my wife Marie.", "language": "en" }, + { + "text": "Dr. Angela Rodriguez will see you on March 14, 2026 at 3:30 PM in the Boston clinic.", + "language": "en" + }, + { + "text": "Contact Sarah O'Connor at sarah.oconnor@example.com or call (212) 555-0123.", + "language": "en" + }, + { "text": "The package ships to 45 Queen Street, Toronto, next Tuesday.", "language": "en" }, + { + "text": "Ahmed is a practicing Muslim from Egypt who moved to Berlin in 2019.", + "language": "en" + }, + { "text": "She is a Catholic Norwegian citizen born on 12/05/1988.", "language": "en" }, + { + "text": "Payment with card 4111111111111111 was declined yesterday at 10am.", + "language": "en" + }, + { + "text": "The vehicle VIN 1HGCM82633A004352 was registered to James Wilson in Ohio.", + "language": "en" + }, + { + "text": "His National Insurance number is AB123456C and he lives in Manchester.", + "language": "en" + }, + { + "text": "Meeting rescheduled: Friday, 9 January 2026, 14:00, with Priya Natarajan from Mumbai.", + "language": "en" + }, + { "text": "Send the invoice to accounts@acme.io before the end of Q1 2026.", "language": "en" }, + { + "text": "Klaus, a German engineer, and his Buddhist colleague Mei flew from Munich to Osaka.", + "language": "en" + }, + { + "text": "The Democrats and Republicans debated in Washington on election night.", + "language": "en" + }, + { + "text": "No PII here: the quarterly revenue grew 14% and margins held steady.", + "language": "en" + }, + { + "text": "Server request id a7f3k2m9x1q8w5z2b is not a VIN and not a person.", + "language": "en" + }, + { + "text": "Me llamo María García y vivo en Madrid desde el 3 de mayo de 2020.", + "language": "es" + }, + { "text": "Mi NIF es 12345678Z y mi correo es maria.garcia@ejemplo.es.", "language": "es" }, + { + "text": "El señor Javier Morales, ciudadano mexicano, llegó a Barcelona el lunes.", + "language": "es" + }, + { "text": "La reunión con Carmen será el 15 de junio de 2026 en Sevilla.", "language": "es" }, + { + "text": "Los musulmanes y los católicos convivieron durante siglos en Córdoba.", + "language": "es" + }, + { "text": "Mi chiamo Marco Rossi e abito a Roma vicino al Colosseo.", "language": "it" }, + { + "text": "Il codice fiscale di Maria Rossi è RSSMRA85T10A562S, nata il 10 dicembre 1985.", + "language": "it" + }, + { + "text": "Giulia Bianchi, cittadina italiana, si trasferì a Milano nel gennaio 2021.", + "language": "it" + }, + { + "text": "L'appuntamento con il dottor Ferrari è fissato per il 20 marzo 2026 a Torino.", + "language": "it" + }, + { "text": "Nazywam się Jan Kowalski i mieszkam w Warszawie od 2015 roku.", "language": "pl" }, + { + "text": "Mój numer PESEL to 44051401359, urodziłem się 14 maja 1944 w Krakowie.", + "language": "pl" + }, + { + "text": "Anna Nowak, obywatelka polska, spotka się z nami we wtorek 12 maja 2026.", + "language": "pl" + }, + { "text": "Katolicy i protestanci wspólnie świętowali w Gdańsku.", "language": "pl" }, + { + "text": "Nimeni on Matti Virtanen ja asun Helsingissä Töölön kaupunginosassa.", + "language": "fi" + }, + { + "text": "Henkilötunnukseni on 131052-308T ja synnyin Tampereella lokakuussa 1952.", + "language": "fi" + }, + { "text": "Liisa Korhonen muutti Ouluun maanantaina 5. tammikuuta 2026.", "language": "fi" }, + { "text": "Suomalaiset ja ruotsalaiset kilpailevat jääkiekossa joka vuosi.", "language": "fi" } +] diff --git a/apps/pii/server.py b/apps/pii/server.py index e2f7ad706d3..3f59cc540aa 100644 --- a/apps/pii/server.py +++ b/apps/pii/server.py @@ -3,148 +3,52 @@ Constructs one warm AnalyzerEngine (multi-language NLP + a native check-digit VIN recognizer) and one AnonymizerEngine at startup, exposing stock-compatible endpoints so a single PRESIDIO_URL serves both. + +NER engine selection (see engines.py): +- PII_ENGINE=spacy (default): the 5 large spaCy models, unchanged behavior. +- PII_ENGINE=gliner: one multilingual GLiNER model for PERSON/LOCATION/NRP/ + DATE_TIME. The stock image ships both engines, so this is a pure env flip. + PII_DEVICE picks cpu/cuda (unset = auto-detect), PII_GLINER_MODEL overrides + the model id. The same code runs on CPU and GPU. Each uvicorn worker + (PII_WORKERS) loads its own GLiNER model copy — into GPU memory when on + cuda — so GPU deployments generally want PII_WORKERS=1 per GPU, unlike the + CPU/spacy path where workers scale with vCPUs. """ import logging +import os import time from typing import Any +from engines import build_gliner_analyzer, build_spacy_analyzer from fastapi import FastAPI -from presidio_analyzer import ( - AnalyzerEngine, - BatchAnalyzerEngine, - Pattern, - PatternRecognizer, - RecognizerResult, -) -from presidio_analyzer.nlp_engine import NlpEngineProvider -from presidio_analyzer.predefined_recognizers import ( - AuAbnRecognizer, - AuAcnRecognizer, - AuMedicareRecognizer, - AuTfnRecognizer, - EsNieRecognizer, - EsNifRecognizer, - FiPersonalIdentityCodeRecognizer, - InAadhaarRecognizer, - InPanRecognizer, - InPassportRecognizer, - InVehicleRegistrationRecognizer, - InVoterRecognizer, - ItDriverLicenseRecognizer, - ItFiscalCodeRecognizer, - ItIdentityCardRecognizer, - ItPassportRecognizer, - ItVatCodeRecognizer, - PlPeselRecognizer, - SgFinRecognizer, - SgUenRecognizer, - UkNinoRecognizer, -) +from presidio_analyzer import AnalyzerEngine, BatchAnalyzerEngine, RecognizerResult from presidio_anonymizer import AnonymizerEngine from presidio_anonymizer.entities import OperatorConfig from pydantic import BaseModel -# Languages served. Each needs its spaCy model installed in the image; the -# es/it/pl/fi predefined recognizers (ES_NIF, IT_FISCAL_CODE, PL_PESEL, ...) -# auto-load once their NLP engine is present. -NLP_CONFIGURATION = { - "nlp_engine_name": "spacy", - "models": [ - {"lang_code": "en", "model_name": "en_core_web_lg"}, - {"lang_code": "es", "model_name": "es_core_news_lg"}, - {"lang_code": "it", "model_name": "it_core_news_lg"}, - {"lang_code": "pl", "model_name": "pl_core_news_lg"}, - {"lang_code": "fi", "model_name": "fi_core_news_lg"}, - ], -} -SUPPORTED_LANGUAGES = [m["lang_code"] for m in NLP_CONFIGURATION["models"]] - -# Predefined recognizers Presidio ships but does NOT load into the default -# registry — they must be added explicitly. Each carries its own -# supported_language, so it fires under that language once its NLP model is -# loaded. en: UK/AU/IN/SG locale ids; es/it/pl/fi: national ids. -EXTRA_RECOGNIZERS = [ - UkNinoRecognizer, - AuAbnRecognizer, - AuAcnRecognizer, - AuTfnRecognizer, - AuMedicareRecognizer, - InPanRecognizer, - InAadhaarRecognizer, - InVehicleRegistrationRecognizer, - InVoterRecognizer, - InPassportRecognizer, - SgFinRecognizer, - SgUenRecognizer, - EsNifRecognizer, - EsNieRecognizer, - ItFiscalCodeRecognizer, - ItDriverLicenseRecognizer, - ItVatCodeRecognizer, - ItPassportRecognizer, - ItIdentityCardRecognizer, - PlPeselRecognizer, - FiPersonalIdentityCodeRecognizer, -] - - -class VinRecognizer(PatternRecognizer): - """VIN (17 chars, A-Z/0-9 excluding I/O/Q) with ISO 3779 check-digit - validation (position 9). Validation makes accidental matches on arbitrary - 17-char codes (request ids, SKUs, tokens) extremely unlikely. Some - non-North-American VINs omit the check digit and are skipped — an - intentional bias toward precision. - """ - - _TRANSLIT = { - **{str(d): d for d in range(10)}, - "A": 1, "B": 2, "C": 3, "D": 4, "E": 5, "F": 6, "G": 7, "H": 8, - "J": 1, "K": 2, "L": 3, "M": 4, "N": 5, "P": 7, "R": 9, - "S": 2, "T": 3, "U": 4, "V": 5, "W": 6, "X": 7, "Y": 8, "Z": 9, - } - _WEIGHTS = [8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2] +PII_ENGINE = os.environ.get("PII_ENGINE", "spacy") +if PII_ENGINE not in ("spacy", "gliner"): + raise ValueError(f"Invalid PII_ENGINE={PII_ENGINE!r}; expected 'spacy' or 'gliner'") +# Empty/unset -> None -> auto-detect (cuda when torch sees a GPU, else cpu). +PII_DEVICE = os.environ.get("PII_DEVICE") or None +PII_GLINER_MODEL = os.environ.get("PII_GLINER_MODEL", "urchade/gliner_multi_pii-v1") - def validate_result(self, pattern_text: str): - vin = pattern_text.upper() - if len(vin) != 17: - return False - try: - total = sum(self._TRANSLIT[c] * w for c, w in zip(vin, self._WEIGHTS)) - except KeyError: - return False - check = total % 11 - expected = "X" if check == 10 else str(check) - return vin[8] == expected +# Propagates to uvicorn's root handler, so timing lands in the container log stream. +logger = logging.getLogger("sim.pii") def build_analyzer() -> AnalyzerEngine: - nlp_engine = NlpEngineProvider(nlp_configuration=NLP_CONFIGURATION).create_engine() - analyzer = AnalyzerEngine(nlp_engine=nlp_engine, supported_languages=SUPPORTED_LANGUAGES) - # VIN is language-agnostic, so register it under every served language — - # a recognizer only fires for the language the caller routes to. - vin_pattern = Pattern(name="vin", regex=r"\b[A-HJ-NPR-Z0-9]{17}\b", score=0.7) - for language in SUPPORTED_LANGUAGES: - analyzer.registry.add_recognizer( - VinRecognizer( - supported_entity="VIN", - patterns=[vin_pattern], - context=["vin", "vehicle", "chassis"], - supported_language=language, - ) - ) - for recognizer_cls in EXTRA_RECOGNIZERS: - analyzer.registry.add_recognizer(recognizer_cls()) - return analyzer + if PII_ENGINE == "gliner": + return build_gliner_analyzer(model_name=PII_GLINER_MODEL, device=PII_DEVICE) + return build_spacy_analyzer() +logger.info("building analyzer engine=%s device=%s", PII_ENGINE, PII_DEVICE or "auto") analyzer = build_analyzer() batch_analyzer = BatchAnalyzerEngine(analyzer_engine=analyzer) anonymizer = AnonymizerEngine() -# Propagates to uvicorn's root handler, so timing lands in the container log stream. -logger = logging.getLogger("sim.pii") - app = FastAPI(title="Sim Presidio", docs_url=None, redoc_url=None) diff --git a/apps/pii/tests/conftest.py b/apps/pii/tests/conftest.py new file mode 100644 index 00000000000..c9787a309d9 --- /dev/null +++ b/apps/pii/tests/conftest.py @@ -0,0 +1,5 @@ +import sys +from pathlib import Path + +# server.py / engines.py live one level up (repo: apps/pii, image: /app). +sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) diff --git a/apps/pii/tests/test_engines.py b/apps/pii/tests/test_engines.py new file mode 100644 index 00000000000..1e6c1b8840c --- /dev/null +++ b/apps/pii/tests/test_engines.py @@ -0,0 +1,105 @@ +"""Unit tests for engines.py — no models, no downloads, no network. + +Run: pip install -r requirements.txt -r requirements-dev.txt && python -m pytest tests +""" + +import importlib.util +import os +import subprocess +import sys +from pathlib import Path + +import pytest +from presidio_analyzer.predefined_recognizers.ner import gliner_recognizer + +import engines + +PII_DIR = Path(__file__).resolve().parent.parent + + +class FakeModel: + def __init__(self): + self.seen_labels: list[list[str]] = [] + + def predict_entities(self, text, labels, flat_ner=True, threshold=0.3, multi_label=False): + self.seen_labels.append(list(labels)) + return [{"label": "person", "score": 0.92, "start": 0, "end": 4, "text": text[0:4]}] + + +class FakeGLiNER: + calls = 0 + + @classmethod + def from_pretrained(cls, model_name, **kwargs): + cls.calls += 1 + return FakeModel() + + +@pytest.fixture +def fake_gliner(monkeypatch): + monkeypatch.setattr(gliner_recognizer, "GLiNER", FakeGLiNER) + engines.SharedModelGLiNERRecognizer._shared_models.clear() + FakeGLiNER.calls = 0 + yield FakeGLiNER + engines.SharedModelGLiNERRecognizer._shared_models.clear() + + +def make_recognizer(language: str): + return engines.SharedModelGLiNERRecognizer( + entity_mapping=engines.GLINER_ENTITY_MAPPING, + model_name="fake/model", + map_location="cpu", + supported_language=language, + ) + + +def test_invalid_pii_engine_fails_import(): + result = subprocess.run( + [sys.executable, "-c", "import server"], + cwd=PII_DIR, + env={**os.environ, "PII_ENGINE": "bogus"}, + capture_output=True, + text=True, + ) + assert result.returncode != 0 + assert "Invalid PII_ENGINE" in result.stderr + + +@pytest.mark.skipif( + importlib.util.find_spec("gliner") is not None, + reason="fail-fast path only exists when gliner is not installed", +) +def test_build_gliner_analyzer_fails_fast_without_gliner(): + with pytest.raises(RuntimeError, match="gliner package is not installed"): + engines.build_gliner_analyzer(model_name="fake/model", device="cpu") + + +def test_shared_model_loads_once_across_languages(fake_gliner): + first = make_recognizer("en") + second = make_recognizer("es") + assert fake_gliner.calls == 1 + assert first.gliner is second.gliner + + +def test_analyze_never_prompts_gliner_with_foreign_entities(fake_gliner): + recognizer = make_recognizer("en") + all_supported = ["PERSON", "LOCATION", "NRP", "DATE_TIME", "CREDIT_CARD", "VIN", "ES_NIF"] + results = recognizer.analyze("John went home", entities=all_supported) + for labels in recognizer.gliner.seen_labels: + assert set(labels) <= set(engines.GLINER_ENTITY_MAPPING) + assert results and results[0].entity_type == "PERSON" + + +def test_analyze_skips_inference_when_no_owned_entity_requested(fake_gliner): + recognizer = make_recognizer("en") + assert recognizer.analyze("4111111111111111", entities=["CREDIT_CARD"]) == [] + assert recognizer.gliner.seen_labels == [] + + +def test_entity_mapping_targets_exactly_the_ner_entities(): + assert set(engines.GLINER_ENTITY_MAPPING.values()) == { + "PERSON", + "LOCATION", + "NRP", + "DATE_TIME", + } diff --git a/apps/pii/tests/test_integration.py b/apps/pii/tests/test_integration.py new file mode 100644 index 00000000000..40c97975754 --- /dev/null +++ b/apps/pii/tests/test_integration.py @@ -0,0 +1,102 @@ +"""Integration tests — exercise the real engines end-to-end via the FastAPI app. + +Requires the models present, so run inside the built images (gated behind +RUN_PII_INTEGRATION to keep plain `pytest` runs model-free): + + # spacy regression (default engine) + docker run --rm -e RUN_PII_INTEGRATION=1 python -m pytest tests + + # gliner engine + docker run --rm -e RUN_PII_INTEGRATION=1 -e PII_ENGINE=gliner \ + python -m pytest tests/test_integration.py + +The suite adapts to PII_ENGINE: shared assertions always run, engine-specific +ones only for the active engine. +""" + +import os + +import pytest + +if not os.environ.get("RUN_PII_INTEGRATION"): + pytest.skip( + "integration tests need the built image (RUN_PII_INTEGRATION=1)", + allow_module_level=True, + ) + +from fastapi.testclient import TestClient + +import server + +ENGINE = server.PII_ENGINE +client = TestClient(server.app) + + +def redact_batch(texts, language="en"): + response = client.post("/redact_batch", json={"texts": texts, "language": language}) + assert response.status_code == 200 + return response.json()["texts"] + + +def test_health(): + assert client.get("/health").json() == {"status": "ok"} + + +def test_masks_person_and_email(): + [masked] = redact_batch(["My name is John Smith, email john.smith@example.com."]) + assert "" in masked + assert "" in masked + assert "John Smith" not in masked + assert "john.smith@example.com" not in masked + + +def test_masks_location_and_phone(): + [masked] = redact_batch(["I live in Paris, call me at (212) 555-0123."]) + assert "" in masked + assert "" in masked + assert "Paris" not in masked + + +def test_regex_recognizers_fire_in_non_english_languages(): + [masked] = redact_batch(["Mi NIF es 12345678Z."], language="es") + assert "" in masked + # On the spacy engine the it_core_news_lg NER tags the fiscal code as + # ORGANIZATION and outscores the pattern recognizer, so only assert the + # value is masked; the exact label is checked on the gliner engine where + # spaCy NER can't compete. + [masked] = redact_batch(["Il codice fiscale è RSSMRA85T10A562S."], language="it") + assert "RSSMRA85T10A562S" not in masked + if ENGINE == "gliner": + assert "" in masked + + +def test_vin_checksum_recognizer_fires(): + [masked] = redact_batch(["The car VIN is 1HGCM82633A004352."]) + assert "" in masked + + +def test_no_pii_passes_through_unchanged(): + # NB: "Quarterly" would be tagged DATE_TIME by the spacy engine — keep + # this text free of anything either engine considers an entity. + text = "Revenue grew and margins held steady." + assert redact_batch([text]) == [text] + + +@pytest.mark.skipif(ENGINE != "gliner", reason="gliner-only wiring assertions") +def test_gliner_registry_has_no_spacy_recognizer(): + names = {r.name for r in server.analyzer.registry.recognizers} + assert "SpacyRecognizer" not in names + assert "GLiNERRecognizer" in names + + +@pytest.mark.skipif(ENGINE != "gliner", reason="gliner-only wiring assertions") +def test_gliner_supported_entities_keep_ner_types(): + supported = set(server.analyzer.get_supported_entities("en")) + assert {"PERSON", "LOCATION", "NRP", "DATE_TIME"} <= supported + + +@pytest.mark.skipif(ENGINE != "spacy", reason="spacy-only wiring assertions") +def test_spacy_registry_unchanged(): + names = {r.name for r in server.analyzer.registry.recognizers} + assert "SpacyRecognizer" in names + assert "GLiNERRecognizer" not in names diff --git a/apps/realtime/package.json b/apps/realtime/package.json index 83ca341b44d..633ffb60827 100644 --- a/apps/realtime/package.json +++ b/apps/realtime/package.json @@ -43,7 +43,7 @@ "@sim/tsconfig": "workspace:*", "@types/node": "24.2.1", "socket.io-client": "4.8.1", - "typescript": "^5.7.3", + "typescript": "^7.0.2", "vitest": "^4.1.0" } } diff --git a/apps/realtime/tsconfig.json b/apps/realtime/tsconfig.json index cce62771d4d..00b8ae857fc 100644 --- a/apps/realtime/tsconfig.json +++ b/apps/realtime/tsconfig.json @@ -1,9 +1,9 @@ { "extends": "@sim/tsconfig/base.json", "compilerOptions": { - "baseUrl": ".", + "lib": ["ES2022", "DOM"], "paths": { - "@/*": ["src/*"] + "@/*": ["./src/*"] } }, "include": ["src/**/*"], diff --git a/apps/sim/app/(auth)/login/login-form.tsx b/apps/sim/app/(auth)/login/login-form.tsx index d0f1fa59a29..9fd5adb148c 100644 --- a/apps/sim/app/(auth)/login/login-form.tsx +++ b/apps/sim/app/(auth)/login/login-form.tsx @@ -11,6 +11,7 @@ import { } from '@sim/emcn' import { createLogger } from '@sim/logger' import { getErrorMessage } from '@sim/utils/errors' +import { normalizeEmail } from '@sim/utils/string' import { useRouter, useSearchParams } from 'next/navigation' import { requestJson } from '@/lib/api/client/request' import { forgetPasswordContract } from '@/lib/api/contracts' @@ -45,7 +46,7 @@ const validateEmailField = (emailValue: string): string[] => { return errors } - const validation = quickValidateEmail(emailValue.trim().toLowerCase()) + const validation = quickValidateEmail(normalizeEmail(emailValue)) if (!validation.isValid) { errors.push(validation.reason || 'Please enter a valid email address.') } @@ -159,7 +160,7 @@ export default function LoginPage({ const formData = new FormData(e.currentTarget) const emailRaw = formData.get('email') as string - const email = emailRaw.trim().toLowerCase() + const email = normalizeEmail(emailRaw) const emailValidationErrors = validateEmailField(email) setEmailErrors(emailValidationErrors) @@ -277,7 +278,7 @@ export default function LoginPage({ return } - const emailValidation = quickValidateEmail(forgotPasswordEmail.trim().toLowerCase()) + const emailValidation = quickValidateEmail(normalizeEmail(forgotPasswordEmail)) if (!emailValidation.isValid) { setResetStatus({ type: 'error', diff --git a/apps/sim/app/(interfaces)/resume/[workflowId]/[executionId]/resume-page-client.tsx b/apps/sim/app/(interfaces)/resume/[workflowId]/[executionId]/resume-page-client.tsx index e6bf318c428..88a7cf3edae 100644 --- a/apps/sim/app/(interfaces)/resume/[workflowId]/[executionId]/resume-page-client.tsx +++ b/apps/sim/app/(interfaces)/resume/[workflowId]/[executionId]/resume-page-client.tsx @@ -18,6 +18,7 @@ import { TableRow, Tooltip, } from '@sim/emcn' +import { formatDateTime } from '@sim/utils/formatting' import { useQueryClient } from '@tanstack/react-query' import { RefreshCw } from 'lucide-react' import { useRouter } from 'next/navigation' @@ -68,7 +69,7 @@ const STATUS_BADGE_VARIANT: Record -
-
- -
-
-
- -
-
-
- - - - -
-
- -
- - -
-
-
-
-
- -
- -
-
-
-
- - - - - - - - -
-
-
-
- -
- - ) + return } diff --git a/apps/sim/app/(landing)/blog/[slug]/page.tsx b/apps/sim/app/(landing)/blog/[slug]/page.tsx index afd7f32a439..2e8b50b2dd5 100644 --- a/apps/sim/app/(landing)/blog/[slug]/page.tsx +++ b/apps/sim/app/(landing)/blog/[slug]/page.tsx @@ -1,14 +1,8 @@ -import { Avatar, AvatarFallback, AvatarImage } from '@sim/emcn' import type { Metadata } from 'next' -import Image from 'next/image' -import Link from 'next/link' -import { FAQ } from '@/lib/blog/faq' import { getAllPostMeta, getPostBySlug, getRelatedPosts } from '@/lib/blog/registry' -import { buildPostGraphJsonLd, buildPostMetadata } from '@/lib/blog/seo' +import { BLOG_SECTION, buildPostGraphJsonLd, buildPostMetadata } from '@/lib/blog/seo' import { getBaseUrl } from '@/lib/core/utils/urls' -import { ShareButton } from '@/app/(landing)/blog/[slug]/share-button' -import { BackLink } from '@/app/(landing)/components' -import { JsonLd } from '@/app/(landing)/components/json-ld' +import { ContentPostPage } from '@/app/(landing)/components' export const dynamicParams = false @@ -32,150 +26,16 @@ export const revalidate = 86400 export default async function Page({ params }: { params: Promise<{ slug: string }> }) { const { slug } = await params const post = await getPostBySlug(slug) - const Article = post.Content - const graphJsonLd = buildPostGraphJsonLd(post) const related = await getRelatedPosts(slug, 3) return ( -
- -
-
- -
- -
-
-
- {post.title} -
-
-
-
-

- {post.title} -

-

- {post.description} -

-
-
- - -
- {(post.authors || [post.author]).map((a) => ( -
- {a?.avatarUrl ? ( - - - {a.name.slice(0, 2)} - - ) : null} - - {a?.name} - -
- ))} -
-
- -
-
-
-
-
- -
- -
-
-
-
-
- {post.faq && post.faq.length > 0 ? : null} -
-
- - {related.length > 0 && ( - <> -
- - - )} -
-
- -
- - - - - {post.wordCount && } -
+ ) } diff --git a/apps/sim/app/(landing)/blog/authors/[id]/loading.tsx b/apps/sim/app/(landing)/blog/authors/[id]/loading.tsx index bf0e6b5f5d9..315e1bad6d0 100644 --- a/apps/sim/app/(landing)/blog/authors/[id]/loading.tsx +++ b/apps/sim/app/(landing)/blog/authors/[id]/loading.tsx @@ -1,25 +1,5 @@ -import { Skeleton } from '@sim/emcn' - -const SKELETON_POST_COUNT = 4 +import { ContentAuthorLoading } from '@/app/(landing)/components' export default function AuthorLoading() { - return ( -
-
- - -
-
- {Array.from({ length: SKELETON_POST_COUNT }).map((_, i) => ( -
- -
- - -
-
- ))} -
-
- ) + return } diff --git a/apps/sim/app/(landing)/blog/authors/[id]/page.tsx b/apps/sim/app/(landing)/blog/authors/[id]/page.tsx index 7055eee586c..302b843cae6 100644 --- a/apps/sim/app/(landing)/blog/authors/[id]/page.tsx +++ b/apps/sim/app/(landing)/blog/authors/[id]/page.tsx @@ -1,9 +1,7 @@ import type { Metadata } from 'next' -import Image from 'next/image' -import Link from 'next/link' import { getAllPostMeta } from '@/lib/blog/registry' -import { SITE_URL } from '@/lib/core/utils/urls' -import { JsonLd } from '@/app/(landing)/components/json-ld' +import { BLOG_SECTION, buildAuthorGraphJsonLd, buildAuthorMetadata } from '@/lib/blog/seo' +import { ContentAuthorPage } from '@/app/(landing)/components' export const revalidate = 3600 @@ -14,115 +12,21 @@ export async function generateMetadata({ }): Promise { const { id } = await params const posts = (await getAllPostMeta()).filter((p) => p.author.id === id) - const author = posts[0]?.author - const name = author?.name ?? 'Author' - return { - title: `${name} | Sim Blog`, - description: `Read articles by ${name} on the Sim blog.`, - alternates: { canonical: `${SITE_URL}/blog/authors/${id}` }, - openGraph: { - title: `${name} | Sim Blog`, - description: `Read articles by ${name} on the Sim blog.`, - url: `${SITE_URL}/blog/authors/${id}`, - siteName: 'Sim', - type: 'profile', - ...(author?.avatarUrl - ? { images: [{ url: author.avatarUrl, width: 400, height: 400, alt: name }] } - : {}), - }, - twitter: { - card: 'summary', - title: `${name} | Sim Blog`, - description: `Read articles by ${name} on the Sim blog.`, - site: '@simdotai', - ...(author?.xHandle ? { creator: `@${author.xHandle}` } : {}), - }, - } + return buildAuthorMetadata(id, posts[0]?.author) } export default async function AuthorPage({ params }: { params: Promise<{ id: string }> }) { const { id } = await params const posts = (await getAllPostMeta()).filter((p) => p.author.id === id) const author = posts[0]?.author - if (!author) { - return ( -
-

Author not found

-
- ) - } - const graphJsonLd = { - '@context': 'https://schema.org', - '@graph': [ - { - '@type': 'Person', - name: author.name, - url: `${SITE_URL}/blog/authors/${author.id}`, - sameAs: author.url ? [author.url] : [], - image: author.avatarUrl, - worksFor: { - '@type': 'Organization', - name: 'Sim', - url: SITE_URL, - }, - }, - { - '@type': 'BreadcrumbList', - itemListElement: [ - { '@type': 'ListItem', position: 1, name: 'Home', item: SITE_URL }, - { '@type': 'ListItem', position: 2, name: 'Blog', item: `${SITE_URL}/blog` }, - { - '@type': 'ListItem', - position: 3, - name: author.name, - item: `${SITE_URL}/blog/authors/${author.id}`, - }, - ], - }, - ], - } + return ( -
- -
- {author.avatarUrl ? ( - {author.name} - ) : null} -

{author.name}

-
-
- {posts.map((p) => ( - -
- {p.title} -
-
- {new Date(p.date).toLocaleDateString('en-US', { - month: 'short', - day: 'numeric', - year: 'numeric', - })} -
-
{p.title}
-
-
- - ))} -
-
+ ) } diff --git a/apps/sim/app/(landing)/blog/loading.tsx b/apps/sim/app/(landing)/blog/loading.tsx index f99f2c60c4a..ff8439df978 100644 --- a/apps/sim/app/(landing)/blog/loading.tsx +++ b/apps/sim/app/(landing)/blog/loading.tsx @@ -1,57 +1,5 @@ -import { Skeleton } from '@sim/emcn' +import { ContentIndexLoading } from '@/app/(landing)/components' export default function BlogLoading() { - return ( -
-
- {/* Header skeleton */} -
- -
- - -
-
- - {/* Content area with vertical border rails */} -
-
- - {/* Featured skeleton */} -
- {Array.from({ length: 3 }).map((_, i) => ( -
- -
- - - -
-
- ))} -
- -
- - {/* List skeleton */} - {Array.from({ length: 5 }).map((_, i) => ( -
-
- -
- - -
- -
-
-
- ))} -
-
-
- ) + return } diff --git a/apps/sim/app/(landing)/blog/page.tsx b/apps/sim/app/(landing)/blog/page.tsx index 5d5c0d6172d..80ce791204b 100644 --- a/apps/sim/app/(landing)/blog/page.tsx +++ b/apps/sim/app/(landing)/blog/page.tsx @@ -1,20 +1,12 @@ -import { ChipLink } from '@sim/emcn' import type { Metadata } from 'next' -import Image from 'next/image' -import Link from 'next/link' import { getAllPostMeta } from '@/lib/blog/registry' -import { buildCollectionPageJsonLd } from '@/lib/blog/seo' -import { SITE_URL } from '@/lib/core/utils/urls' -import { withFilteredNoindex } from '@/lib/landing/seo' -import { Cta } from '@/app/(landing)/components' -import { JsonLd } from '@/app/(landing)/components/json-ld' +import { BLOG_SECTION, buildCollectionPageJsonLd, buildIndexMetadata } from '@/lib/blog/seo' +import { ContentIndexPage } from '@/app/(landing)/components' /** * Filtered/paginated variants render genuinely different lists, but only the - * bare index is indexable — same policy as the integrations and models - * catalogs — so canonical always points at the unfiltered page and the - * variant itself is noindexed rather than asking Google to index every - * tag/page permutation. + * bare index is indexable — see `buildIndexMetadata` in `@/lib/content/seo` + * for the shared noindex policy. */ export async function generateMetadata({ searchParams, @@ -23,49 +15,7 @@ export async function generateMetadata({ }): Promise { const { page, tag } = await searchParams const pageNum = Math.max(1, Number(page || 1)) - - const titleParts = ['Blog'] - if (tag) titleParts.push(tag) - if (pageNum > 1) titleParts.push(`Page ${pageNum}`) - const title = titleParts.join(' | ') - - const description = tag - ? `Sim blog posts tagged "${tag}": insights and guides for building AI agents.` - : 'Announcements, insights, and guides from Sim, the open-source AI workspace, for building, deploying, and managing AI agents.' - - const canonical = `${SITE_URL}/blog` - const isFiltered = Boolean(tag) || pageNum > 1 - - return withFilteredNoindex( - { - title, - description, - alternates: { canonical }, - openGraph: { - title: `${title} | Sim`, - description, - url: canonical, - siteName: 'Sim', - locale: 'en_US', - type: 'website', - images: [ - { - url: `${SITE_URL}/logo/primary/medium.png`, - width: 1200, - height: 630, - alt: 'Sim Blog', - }, - ], - }, - twitter: { - card: 'summary_large_image', - title: `${title} | Sim`, - description, - site: '@simdotai', - }, - }, - isFiltered - ) + return buildIndexMetadata({ tag, pageNum }) } export default async function BlogIndex({ @@ -75,180 +25,17 @@ export default async function BlogIndex({ }) { const { page, tag } = await searchParams const pageNum = Math.max(1, Number(page || 1)) - const perPage = 20 - - const all = await getAllPostMeta() - const filtered = tag ? all.filter((p) => p.tags.includes(tag)) : all - - const sorted = - pageNum === 1 - ? filtered.sort((a, b) => { - if (a.featured && !b.featured) return -1 - if (!a.featured && b.featured) return 1 - return new Date(b.date).getTime() - new Date(a.date).getTime() - }) - : filtered - - const totalPages = Math.max(1, Math.ceil(sorted.length / perPage)) - const start = (pageNum - 1) * perPage - const posts = sorted.slice(start, start + perPage) - const featured = pageNum === 1 ? posts.slice(0, 3) : [] - const remaining = pageNum === 1 ? posts.slice(3) : posts - - const collectionJsonLd = buildCollectionPageJsonLd() + const posts = await getAllPostMeta() return ( - <> -
- - - {/* Section header */} -
-
-

- Latest from Sim -

-

- Announcements, insights, and guides for building AI agents. -

-
-
- - {/* Full-width top line */} -
- - {/* Content area with vertical border rails */} -
-
- {/* Featured posts */} - {featured.length > 0 && ( - <> - - -
- - )} - - {remaining.map((p) => ( -
- - {/* Date */} - - {new Date(p.date).toLocaleDateString('en-US', { - month: 'short', - day: 'numeric', - year: 'numeric', - })} - - - {/* Title + description */} -
- - {new Date(p.date).toLocaleDateString('en-US', { - month: 'short', - day: 'numeric', - year: 'numeric', - })} - -

- {p.title} -

-

- {p.description} -

-
- - {/* Image */} -
- {p.title} -
- -
-
- ))} - - {/* Pagination */} - {totalPages > 1 && ( - - )} -
-
- - {/* Full-width bottom line - overlaps last inner divider to avoid double border */} -
-
- -
- -
- + ) } diff --git a/apps/sim/app/(landing)/blog/rss.xml/route.ts b/apps/sim/app/(landing)/blog/rss.xml/route.ts index 6460e032216..0ddbbdab7a1 100644 --- a/apps/sim/app/(landing)/blog/rss.xml/route.ts +++ b/apps/sim/app/(landing)/blog/rss.xml/route.ts @@ -1,5 +1,6 @@ import { NextResponse } from 'next/server' import { getAllPostMeta } from '@/lib/blog/registry' +import { latestModified } from '@/lib/content/utils' import { SITE_URL } from '@/lib/core/utils/urls' export const revalidate = 3600 @@ -8,8 +9,7 @@ export async function GET() { const posts = await getAllPostMeta() const items = posts.slice(0, 50) const site = SITE_URL - const lastBuildDate = - items.length > 0 ? new Date(items[0].date).toUTCString() : new Date().toUTCString() + const lastBuildDate = (latestModified(items) ?? new Date()).toUTCString() const xml = ` diff --git a/apps/sim/app/(landing)/blog/tags/loading.tsx b/apps/sim/app/(landing)/blog/tags/loading.tsx index 0ab53a285bd..1fbabbbd995 100644 --- a/apps/sim/app/(landing)/blog/tags/loading.tsx +++ b/apps/sim/app/(landing)/blog/tags/loading.tsx @@ -1,20 +1,5 @@ -import { Skeleton } from '@sim/emcn' - -const SKELETON_TAG_COUNT = 12 +import { ContentTagsLoading } from '@/app/(landing)/components' export default function TagsLoading() { - return ( -
- -
- {Array.from({ length: SKELETON_TAG_COUNT }).map((_, i) => ( - - ))} -
-
- ) + return } diff --git a/apps/sim/app/(landing)/blog/tags/page.tsx b/apps/sim/app/(landing)/blog/tags/page.tsx index 9f04edac3ca..8cbf0e3bbb7 100644 --- a/apps/sim/app/(landing)/blog/tags/page.tsx +++ b/apps/sim/app/(landing)/blog/tags/page.tsx @@ -1,59 +1,17 @@ -import { ChipLink } from '@sim/emcn' import type { Metadata } from 'next' import { getAllTags } from '@/lib/blog/registry' -import { SITE_URL } from '@/lib/core/utils/urls' -import { JsonLd } from '@/app/(landing)/components/json-ld' +import { BLOG_SECTION, buildTagsBreadcrumbJsonLd, buildTagsMetadata } from '@/lib/blog/seo' +import { ContentTagsPage } from '@/app/(landing)/components' -export const metadata: Metadata = { - title: 'Tags', - description: 'Browse Sim blog posts by topic: AI agents, workflows, integrations, and more.', - alternates: { canonical: `${SITE_URL}/blog/tags` }, - openGraph: { - title: 'Blog Tags | Sim', - description: 'Browse Sim blog posts by topic: AI agents, workflows, integrations, and more.', - url: `${SITE_URL}/blog/tags`, - siteName: 'Sim', - locale: 'en_US', - type: 'website', - }, - twitter: { - card: 'summary', - title: 'Blog Tags | Sim', - description: 'Browse Sim blog posts by topic: AI agents, workflows, integrations, and more.', - site: '@simdotai', - }, -} - -const breadcrumbJsonLd = { - '@context': 'https://schema.org', - '@type': 'BreadcrumbList', - itemListElement: [ - { '@type': 'ListItem', position: 1, name: 'Home', item: SITE_URL }, - { '@type': 'ListItem', position: 2, name: 'Blog', item: `${SITE_URL}/blog` }, - { '@type': 'ListItem', position: 3, name: 'Tags', item: `${SITE_URL}/blog/tags` }, - ], -} +export const metadata: Metadata = buildTagsMetadata() export default async function TagsIndex() { const tags = await getAllTags() return ( -
- -

Browse by tag

-
- - All - - {tags.map((t) => ( - - {t.tag} ({t.count}) - - ))} -
-
+ ) } diff --git a/apps/sim/app/(landing)/changelog/components/changelog-timeline/changelog-timeline.tsx b/apps/sim/app/(landing)/changelog/components/changelog-timeline/changelog-timeline.tsx index 195512cd149..a806a28bb8c 100644 --- a/apps/sim/app/(landing)/changelog/components/changelog-timeline/changelog-timeline.tsx +++ b/apps/sim/app/(landing)/changelog/components/changelog-timeline/changelog-timeline.tsx @@ -4,6 +4,7 @@ import { type ReactNode, useRef, useState } from 'react' import { Streamdown } from 'streamdown' import 'streamdown/styles.css' import { Avatar, AvatarFallback, AvatarImage, Chip, cn } from '@sim/emcn' +import { formatDate } from '@sim/utils/formatting' import type { ChangelogEntry, GitHubRelease } from '@/app/(landing)/changelog/types' import { mapReleases, releasesEndpoint } from '@/app/(landing)/changelog/utils' @@ -53,14 +54,6 @@ function isContributorsLabel(children: ReactNode): boolean { return /^\s*contributors\s*:?\s*$/i.test(String(children)) } -function formatDate(value: string): string { - return new Date(value).toLocaleDateString('en-US', { - year: 'numeric', - month: 'short', - day: 'numeric', - }) -} - export function ChangelogTimeline({ initialEntries }: ChangelogTimelineProps) { const [entries, setEntries] = useState(initialEntries) const [loading, setLoading] = useState(false) @@ -133,7 +126,9 @@ export function ChangelogTimeline({ initialEntries }: ChangelogTimelineProps) {
) : null}
- {formatDate(entry.date)} + + {formatDate(new Date(entry.date))} + @@ -602,7 +635,7 @@ export function CustomBlockDetail({ blockId, workspaceId, onBack }: CustomBlockD className='w-full' dropdownWidth='trigger' maxHeight={280} - disabled={deployed.isLoading || outputGroups.length === 0} + disabled={deployed.isLoading || outputGroups.length === 0 || !canManageBlock} emptyMessage={deployed.isLoading ? 'Loading workflow…' : 'No outputs found.'} options={[]} groups={outputGroups} @@ -634,6 +667,7 @@ export function CustomBlockDetail({ blockId, workspaceId, onBack }: CustomBlockD placeholder='name' className='w-[140px]' maxLength={60} + disabled={!canManageBlock} /> ) diff --git a/apps/sim/ee/custom-blocks/components/custom-blocks.tsx b/apps/sim/ee/custom-blocks/components/custom-blocks.tsx index 036d2aa9f56..f7534c9bf3f 100644 --- a/apps/sim/ee/custom-blocks/components/custom-blocks.tsx +++ b/apps/sim/ee/custom-blocks/components/custom-blocks.tsx @@ -12,6 +12,7 @@ import { getCustomBlockIcon } from '@/blocks/custom/custom-block-icon' import { CustomBlockDetail } from '@/ee/custom-blocks/components/custom-block-detail' import { useWhitelabelSettings } from '@/ee/whitelabeling/hooks/whitelabel' import { useCanPublishCustomBlock, useCustomBlocks } from '@/hooks/queries/custom-blocks' +import { useWorkspacesQuery } from '@/hooks/queries/workspace' export function CustomBlocks() { const params = useParams() @@ -19,6 +20,20 @@ export function CustomBlocks() { const { data: canManage = false, isLoading } = useCanPublishCustomBlock(workspaceId) const { data: blocks = [] } = useCustomBlocks(workspaceId) + const { data: workspaces = [] } = useWorkspacesQuery() + + // Any org member can view the org's blocks, but publishing requires admin on a + // source workspace — the publish route enforces admin on the picked workspace. + const currentOrgId = useMemo( + () => workspaces.find((w) => w.id === workspaceId)?.organizationId ?? null, + [workspaces, workspaceId] + ) + const canCreate = useMemo( + () => + !!currentOrgId && + workspaces.some((w) => w.organizationId === currentOrgId && w.permissions === 'admin'), + [workspaces, currentOrgId] + ) const { data: whitelabel } = useWhitelabelSettings(blocks[0]?.organizationId) const fallbackIconUrl = whitelabel?.logoUrl ?? null @@ -59,19 +74,25 @@ export function CustomBlocks() { onChange: setSearchTerm, placeholder: 'Search custom blocks...', }} - actions={[ - { - text: 'Create block', - icon: Plus, - variant: 'primary', - onSelect: () => setSelected('new'), - }, - ]} + actions={ + canCreate + ? [ + { + text: 'Create block', + icon: Plus, + variant: 'primary', + onSelect: () => setSelected('new'), + }, + ] + : [] + } > {blocks.length === 0 ? ( - No custom blocks yet. Click "Create block" to publish a workflow as a block. + {canCreate + ? 'No custom blocks yet. Click "Create block" to publish a workflow as a block.' + : 'No custom blocks yet.'} ) : filtered.length === 0 ? ( @@ -90,6 +111,7 @@ export function CustomBlocks() { > } + iconFill title={cb.name} description={cb.description || undefined} trailing={ diff --git a/apps/sim/ee/workspace-forking/components/fork-activity-panel/fork-activity-panel.tsx b/apps/sim/ee/workspace-forking/components/fork-activity-panel/fork-activity-panel.tsx new file mode 100644 index 00000000000..81faf69ef2c --- /dev/null +++ b/apps/sim/ee/workspace-forking/components/fork-activity-panel/fork-activity-panel.tsx @@ -0,0 +1,314 @@ +'use client' + +import { useCallback, useMemo } from 'react' +import { Badge, Button } from '@sim/emcn' +import { createLogger } from '@sim/logger' +import { formatDateTime } from '@sim/utils/formatting' +import type { BackgroundWorkItem } from '@/lib/api/contracts/workspace-fork' +import { + ActivityLog, + type ActivityLogEntry, +} from '@/app/workspace/[workspaceId]/settings/components/activity-log' +import { SettingsEmptyState } from '@/app/workspace/[workspaceId]/settings/components/settings-empty-state' +import { useWorkspaceBackgroundWork } from '@/ee/workspace-forking/hooks/background-work' + +const logger = createLogger('ForkActivityPanel') + +const plural = (n: number, noun: string) => `${n} ${noun}${n === 1 ? '' : 's'}` + +/** Join "N verb" segments (verbs like "updated" aren't pluralized), dropping zero counts. */ +function countList(pairs: Array<[number | undefined, string]>): string { + return pairs + .filter(([n]) => (n ?? 0) > 0) + .map(([n, verb]) => `${n} ${verb}`) + .join(' · ') +} + +/** A named group (one resource kind or change action) of a job's report. */ +interface ReportGroup { + label: string + names: string[] +} + +/** A job's expanded report: named groups plus plain notes (counts / warnings). */ +interface JobReport { + groups: ReportGroup[] + notes: Array<{ value: string; warning?: boolean }> +} + +/** The workspace whose activity is being viewed, for phrasing rows recorded on either side of an edge. */ +interface ActivityView { + workspaceId: string + /** Lineage partner names by id (the parent + this workspace's forks). */ + workspaceNames: ReadonlyMap +} + +/** Display name of the workspace a partner-recorded row was keyed to (the edge's other side). */ +function partnerName(job: BackgroundWorkItem, view: ActivityView): string { + return view.workspaceNames.get(job.workspaceId) ?? 'another workspace' +} + +/** + * The activity-row title, derived per kind from the job's metadata. Every event is + * recorded once, keyed to the workspace it was initiated from, so a row keyed to an + * edge partner is phrased from THIS workspace's side (e.g. the parent's "Pushed to X" + * row reads "Received push from " when X views it). + */ +function jobTitle(job: BackgroundWorkItem, view: ActivityView): string { + const m = job.metadata + const recordedHere = job.workspaceId === view.workspaceId + switch (job.kind) { + case 'fork_content_copy': + // A partner-recorded copy row is either this workspace's own creation (recorded + // on the parent, carrying our id as the child) or a sync's resource fill. + if (!recordedHere && m?.childWorkspaceId === view.workspaceId) { + return `Forked from "${partnerName(job, view)}"` + } + return m?.childWorkspaceName + ? `Forked into "${m.childWorkspaceName}"` + : (job.message ?? 'Fork') + case 'fork_sync': + if (!recordedHere) { + return m?.direction === 'pull' + ? `Pulled by "${partnerName(job, view)}"` + : `Received push from "${partnerName(job, view)}"` + } + if (!m?.otherWorkspaceName) return job.message ?? 'Sync' + return m.direction === 'pull' + ? `Pulled from "${m.otherWorkspaceName}"` + : `Pushed to "${m.otherWorkspaceName}"` + case 'fork_rollback': + if (!recordedHere) return `Sync undone in "${partnerName(job, view)}"` + return m?.otherWorkspaceName + ? `Undid sync from "${m.otherWorkspaceName}"` + : (job.message ?? 'Rollback') + default: + return job.message ?? 'Activity' + } +} + +/** Short action label for the Event badge, per job kind. */ +function jobEventLabel(job: BackgroundWorkItem): string { + switch (job.kind) { + case 'fork_content_copy': + return 'Fork' + case 'fork_sync': + return job.metadata?.direction === 'pull' ? 'Pull' : 'Push' + case 'fork_rollback': + return 'Rollback' + default: + return 'Activity' + } +} + +/** + * Badge variant: bad outcomes keep the status colors (red/amber), while successful + * rows are colored by operation so Fork / Push / Pull / Rollback are distinguishable + * at a glance. + */ +function jobBadgeVariant(job: BackgroundWorkItem) { + if (job.status === 'failed') return 'red' as const + if (job.status === 'completed_with_warnings') return 'amber' as const + if (job.status !== 'completed') return 'gray-secondary' as const + switch (job.kind) { + case 'fork_content_copy': + return 'blue' as const + case 'fork_sync': + return job.metadata?.direction === 'pull' ? ('cyan' as const) : ('green' as const) + case 'fork_rollback': + return 'purple' as const + default: + return 'gray-secondary' as const + } +} + +/** Build a job's report (named groups + plain notes) from its metadata. */ +function jobReport(job: BackgroundWorkItem): JobReport { + const m = job.metadata + const groups: ReportGroup[] = [] + const notes: JobReport['notes'] = [] + if (!m) return { groups, notes } + + const addGroup = (label: string, names: string[] | undefined) => { + if (names && names.length > 0) groups.push({ label, names }) + } + + if (job.kind === 'fork_sync') { + addGroup('Updated', m.updatedNames) + addGroup('Created', m.createdNames) + addGroup('Archived', m.archivedNames) + // Pre-names entries fall back to the count summary (redeployed mirrors updated). + if (groups.length === 0) { + const counts = countList([ + [m.updated, 'updated'], + [m.created, 'created'], + [m.archived, 'archived'], + ]) + if (counts) notes.push({ value: counts }) + } + if (m.needsConfiguration && m.needsConfiguration.length > 0) { + for (const item of m.needsConfiguration) { + notes.push({ + value: `${item.workflowName} — re-check ${item.blocks.join(', ')}`, + warning: true, + }) + } + } + if (m.clearedOptional && m.clearedOptional.length > 0) { + for (const item of m.clearedOptional) { + notes.push({ + value: `${item.workflowName} — optional cleared in ${item.blocks.join(', ')}`, + }) + } + } + if (m.deployFailed && m.deployFailed > 0) { + notes.push({ value: `${plural(m.deployFailed, 'workflow')} failed to deploy`, warning: true }) + } + return { groups, notes } + } + + if (job.kind === 'fork_rollback') { + const counts = countList([ + [m.restored, 'restored'], + [m.unarchived, 'unarchived'], + [m.removed, 'removed'], + [m.skipped, 'skipped'], + ]) + if (counts) notes.push({ value: counts }) + return { groups, notes } + } + + // fork_content_copy: a named breakdown of everything copied, by kind. + addGroup('Workflows', m.workflowNames) + addGroup('Knowledge bases', m.knowledgeBaseNames) + addGroup('Tables', m.tableNames) + addGroup('Files', m.fileNames) + addGroup('Custom tools', m.customToolNames) + addGroup('Skills', m.skillNames) + addGroup('MCP servers', m.mcpServerNames) + addGroup('Workflow MCP servers', m.workflowMcpServerNames) + // Sync content-copy rows record per-kind COUNTS only (fork rows carry names), so fall back + // to the counts when no named group rendered. + if (groups.length === 0) { + const counts = [ + [m.workflowsCopied, 'workflow'], + [m.knowledgeBases, 'knowledge base'], + [m.tables, 'table'], + [m.files, 'file'], + ] + .filter(([n]) => ((n as number | undefined) ?? 0) > 0) + .map(([n, noun]) => plural(n as number, noun as string)) + .join(' · ') + if (counts) notes.push({ value: counts }) + } + if (m.failed && m.failed > 0) { + notes.push({ value: `${plural(m.failed, 'resource')} failed to copy`, warning: true }) + } + if (m.clearingFailed) { + notes.push({ value: 'Reference cleanup incomplete', warning: true }) + } + return { groups, notes } +} + +/** The expanded detail box content for one job: named groups, notes, and any error. */ +function jobDetails(job: BackgroundWorkItem, report: JobReport) { + return ( + <> + {report.groups.map((group) => ( +
+ {group.label} + + {group.names.join(', ')} + +
+ ))} + {report.notes.map((note, index) => ( + + {note.value} + + ))} + {job.error ? {job.error} : null} + + ) +} + +/** Maps a background job to the shared {@link ActivityLog} row shape. */ +function toActivityEntry(job: BackgroundWorkItem, view: ActivityView): ActivityLogEntry { + const report = jobReport(job) + const hasDetails = report.groups.length > 0 || report.notes.length > 0 || Boolean(job.error) + return { + id: job.id, + timestamp: formatDateTime(new Date(job.startedAt)), + event: ( + + {jobEventLabel(job)} + + ), + description: jobTitle(job, view), + actor: job.metadata?.actorName || 'System', + details: hasDetails ? jobDetails(job, report) : undefined, + } +} + +interface ForkActivityPanelProps { + /** Poll the durable fork-job audit trail involving this workspace. */ + workspaceId: string + /** Lineage partner names by id (the parent + forks), for phrasing partner-recorded rows. */ + workspaceNames: ReadonlyMap +} + +/** + * A durable audit log of every fork, sync, and rollback involving the workspace + * (both sides of each fork edge), rendered through the shared {@link ActivityLog} + * so it reads identically to the enterprise audit log: each row (timestamp, action + * badge, description, actor) expands to a per-kind breakdown of what changed. + */ +export function ForkActivityPanel({ workspaceId, workspaceNames }: ForkActivityPanelProps) { + const { data, isPending, isError, hasNextPage, fetchNextPage, isFetchingNextPage } = + useWorkspaceBackgroundWork(workspaceId) + const view: ActivityView = { workspaceId, workspaceNames } + + const jobs = useMemo(() => { + if (!data?.pages) return [] + return data.pages.flatMap((page) => page.items) + }, [data]) + + const handleLoadMore = useCallback(() => { + if (hasNextPage && !isFetchingNextPage) { + fetchNextPage().catch((error: unknown) => { + logger.error('Failed to load more fork activity', { error }) + }) + } + }, [hasNextPage, isFetchingNextPage, fetchNextPage]) + + return ( + toActivityEntry(job, view))} + eventColumn='compact' + // A failed or still-loading feed must never claim "nothing here yet". + emptyState={ + isError ? ( + + Couldn't load activity. Try again shortly. + + ) : isPending ? undefined : ( + + Nothing here yet. Forks, syncs, and rollbacks will appear here. + + ) + } + footer={ + hasNextPage ? ( +
+ +
+ ) : undefined + } + /> + ) +} diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/fork-file-tree/fork-file-tree.test.ts b/apps/sim/ee/workspace-forking/components/fork-file-tree/fork-file-tree.test.ts similarity index 88% rename from apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/fork-file-tree/fork-file-tree.test.ts rename to apps/sim/ee/workspace-forking/components/fork-file-tree/fork-file-tree.test.ts index 39fa599a965..6a87974aa5e 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/fork-file-tree/fork-file-tree.test.ts +++ b/apps/sim/ee/workspace-forking/components/fork-file-tree/fork-file-tree.test.ts @@ -2,7 +2,7 @@ * @vitest-environment node */ import { describe, expect, it } from 'vitest' -import { groupForkFilesIntoFolders } from '@/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/fork-file-tree/fork-file-tree' +import { groupForkFilesIntoFolders } from '@/ee/workspace-forking/components/fork-file-tree/fork-file-tree' describe('groupForkFilesIntoFolders', () => { it('groups files under their folder and lifts un-foldered files to the root bucket', () => { diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/fork-file-tree/fork-file-tree.tsx b/apps/sim/ee/workspace-forking/components/fork-file-tree/fork-file-tree.tsx similarity index 100% rename from apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/fork-file-tree/fork-file-tree.tsx rename to apps/sim/ee/workspace-forking/components/fork-file-tree/fork-file-tree.tsx diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/fork-resource-picker/fork-resource-picker.tsx b/apps/sim/ee/workspace-forking/components/fork-resource-picker/fork-resource-picker.tsx similarity index 75% rename from apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/fork-resource-picker/fork-resource-picker.tsx rename to apps/sim/ee/workspace-forking/components/fork-resource-picker/fork-resource-picker.tsx index 82ffbf88cae..9762d82e74d 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/fork-resource-picker/fork-resource-picker.tsx +++ b/apps/sim/ee/workspace-forking/components/fork-resource-picker/fork-resource-picker.tsx @@ -6,7 +6,7 @@ import { ForkFileTree, type ForkFlatFile, groupForkFilesIntoFolders, -} from '@/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/fork-file-tree/fork-file-tree' +} from '@/ee/workspace-forking/components/fork-file-tree/fork-file-tree' /** A flat copyable resource (table / KB / custom tool / skill / MCP server) in the picker. */ export interface ForkResourcePickerItem { @@ -30,6 +30,9 @@ interface ResourceKindRowProps { * the user can copy a specific subset. Shared by the fork modal's "Copy resources" and the sync * modal's "Copy resources" so the two surfaces stay identical. Files nest in a folder tree * instead - use {@link FileKindRow}. + * + * Expanded body uses the settings MCP expand pattern (`border-t` + `--surface-2`) so items + * read as contained in the kind rather than indented siblings of other kinds. */ export function ResourceKindRow({ label, @@ -47,7 +50,7 @@ export function ResourceKindRow({ const headerState = selectedCount === 0 ? false : selectedCount === total ? true : 'indeterminate' return ( -
+
{expanded ? ( -
- {items.map((item) => { - const isChecked = selected.has(item.id) - const itemId = `${fieldId}-${item.id}` - return ( - - ) - })} +
+
+ {items.map((item) => { + const isChecked = selected.has(item.id) + const itemId = `${fieldId}-${item.id}` + return ( + + ) + })} +
) : null}
@@ -145,7 +150,7 @@ export function FileKindRow({ const { folders, rootFiles } = useMemo(() => groupForkFilesIntoFolders(files), [files]) return ( -
+
{expanded ? ( -
+
type WorkflowRef = Extract @@ -50,7 +50,7 @@ const dependentRef = ( parentSourceId, }) -// The modal's predicate is `mapped || copied`; here we model each disposition as a resolved key so +// The page's predicate is `mapped || copied`; here we model each disposition as a resolved key so // the document-under-KB case is exercised for both a copied parent and a mapped parent. const resolvedKeys = (...keys: string[]) => { const set = new Set(keys) @@ -116,7 +116,7 @@ describe('selectVisibleClearedRefs', () => { ]) }) - it('always keeps a workflow reference (it cannot be resolved in the modal)', () => { + it('always keeps a workflow reference (it cannot be resolved on the page)', () => { const workflowReference = workflowRef('wf-other') expect( selectVisibleClearedRefs([workflowReference], resolvedKeys('workflow:wf-other')) @@ -153,7 +153,7 @@ describe('forkBlockerResolution', () => { 'map it to a target or select it for copy' ) expect(forkBlockerResolution(referenceRef('mcp-server', 'srv-1'))).toBe( - 'map it to an MCP server in the target workspace' + 'map it to a target or select it for copy' ) expect(forkBlockerResolution(referenceRef('knowledge-base', 'kb-gone', 'KB', true))).toBe( 'deleted in the source — map it to an existing knowledge base in the target' diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/promote-workspace-modal/cleared-refs-list.ts b/apps/sim/ee/workspace-forking/components/fork-sync/cleared-refs-list.ts similarity index 93% rename from apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/promote-workspace-modal/cleared-refs-list.ts rename to apps/sim/ee/workspace-forking/components/fork-sync/cleared-refs-list.ts index d55a460fa07..d80da2d03f0 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/promote-workspace-modal/cleared-refs-list.ts +++ b/apps/sim/ee/workspace-forking/components/fork-sync/cleared-refs-list.ts @@ -1,5 +1,5 @@ import type { ForkClearedRef } from '@/lib/api/contracts/workspace-fork' -import { forkSyncBlockerReasonFor } from '@/lib/workspaces/fork/promote/sync-blockers' +import { forkSyncBlockerReasonFor } from '@/ee/workspace-forking/lib/promote/sync-blockers' /** Whether a resource is resolved by the current selection (mapped to a target OR selected for copy). */ export type ClearedRefResolvedPredicate = (kind: string, sourceId: string) => boolean @@ -21,9 +21,9 @@ const PARENT_KINDS_THAT_PRESERVE_CHILD: ReadonlySet = new Set(['knowledg * using the SAME predicate as `reference` - but ONLY when the child follows that parent (a * document under a KB). A credential- or table-anchored dependent is cleared on any parent remap, * so it stays even after the parent is mapped. - * - `workflow`: always stays - a cross-workflow reference cannot be resolved in the modal. + * - `workflow`: always stays - a cross-workflow reference cannot be resolved here. * - * Pure so the reactive list is unit-testable independent of the modal's selection state. + * Pure so the reactive list is unit-testable independent of the page's selection state. */ export function selectVisibleClearedRefs( clearedRefs: ForkClearedRef[], @@ -42,7 +42,7 @@ export function selectVisibleClearedRefs( /** * Split the visible would-clear entries into sync BLOCKERS (cause `reference`/`workflow` - the * sync is disabled while any remain) and the informational remainder (`dependent` entries, owned - * by the reconfigure flow - they clear but never block). Pure, so the modal's gate and the two + * by the reconfigure flow - they clear but never block). Pure, so the page's gate and the two * sections stay one testable rule. */ export function splitForkClearedRefs(visibleRefs: ForkClearedRef[]): { @@ -78,8 +78,6 @@ export function forkBlockerResolution(ref: ForkClearedRef): string | null { switch (reason) { case 'unmapped-copyable': return 'map it to a target or select it for copy' - case 'unmapped-mcp-server': - return 'map it to an MCP server in the target workspace' case 'source-deleted': return `deleted in the source — map it to an existing ${BLOCKER_KIND_LABEL[ref.kind] ?? 'resource'} in the target` case 'workflow-missing': diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/promote-workspace-modal/copy-reconciliation.test.ts b/apps/sim/ee/workspace-forking/components/fork-sync/copy-reconciliation.test.ts similarity index 77% rename from apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/promote-workspace-modal/copy-reconciliation.test.ts rename to apps/sim/ee/workspace-forking/components/fork-sync/copy-reconciliation.test.ts index 1fa0bf53f67..3c3c3c90150 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/promote-workspace-modal/copy-reconciliation.test.ts +++ b/apps/sim/ee/workspace-forking/components/fork-sync/copy-reconciliation.test.ts @@ -8,12 +8,13 @@ import { forkCopyingKeys, forkDefaultCopySelection, forkMappedCopyableKeys, + forkParentResolution, forkRefKey, forkRequiredKindsLabel, forkRequiredPending, forkVisibleCopyables, isForkRequiredComplete, -} from '@/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/promote-workspace-modal/copy-reconciliation' +} from '@/ee/workspace-forking/components/fork-sync/copy-reconciliation' const entry = (overrides: Partial): ForkMappingEntry => ({ kind: 'credential', @@ -161,6 +162,51 @@ describe('forkRequiredKindsLabel', () => { }) }) +describe('forkParentResolution', () => { + const kb = entry({ kind: 'knowledge-base', sourceId: 'kb-1' }) + + it('is copied when the entry is selected for copy', () => { + expect(forkParentResolution(kb, {}, new Set(['knowledge-base:kb-1']))).toBe('copied') + }) + + it('is mapped with a persisted or in-session target, unresolved with neither', () => { + expect( + forkParentResolution( + entry({ kind: 'knowledge-base', sourceId: 'kb-1', targetId: 'kb-tgt' }), + {}, + new Set() + ) + ).toBe('mapped') + expect(forkParentResolution(kb, { 'knowledge-base:kb-1': 'kb-tgt' }, new Set())).toBe('mapped') + expect(forkParentResolution(kb, {}, new Set())).toBe('unresolved') + }) + + it('toggling copy⇄map flips the resolution (the selector scope + seed follow it)', () => { + // Copy-selected: the dependent selectors browse the SOURCE parent. + const copying = new Set(['knowledge-base:kb-1']) + expect(forkParentResolution(kb, {}, copying)).toBe('copied') + // The user maps a target instead: the mapped entry drops out of the visible copyables + // (copy-vs-map reconciliation), so its copying key disappears and the resolution flips. + const targets = { 'knowledge-base:kb-1': 'kb-tgt' } + const mappedKeys = forkMappedCopyableKeys([kb], targets) + const copyingAfterMap = forkCopyingKeys( + forkVisibleCopyables([copyable({ kind: 'knowledge-base', sourceId: 'kb-1' })], mappedKeys), + copying + ) + expect(forkParentResolution(kb, targets, copyingAfterMap)).toBe('mapped') + // Back to copy ('' target override): the copyable is visible + still selected again. + const cleared = { 'knowledge-base:kb-1': '' } + const copyingAfterClear = forkCopyingKeys( + forkVisibleCopyables( + [copyable({ kind: 'knowledge-base', sourceId: 'kb-1' })], + forkMappedCopyableKeys([kb], cleared) + ), + copying + ) + expect(forkParentResolution(kb, cleared, copyingAfterClear)).toBe('copied') + }) +}) + describe('forkRequiredPending', () => { it('is true when a required ref is neither mapped nor selected for copy', () => { const items = [entry({ kind: 'credential', sourceId: 'c1', required: true })] diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/promote-workspace-modal/copy-reconciliation.ts b/apps/sim/ee/workspace-forking/components/fork-sync/copy-reconciliation.ts similarity index 79% rename from apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/promote-workspace-modal/copy-reconciliation.ts rename to apps/sim/ee/workspace-forking/components/fork-sync/copy-reconciliation.ts index afea9cd5010..1cb90b2bc8a 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/promote-workspace-modal/copy-reconciliation.ts +++ b/apps/sim/ee/workspace-forking/components/fork-sync/copy-reconciliation.ts @@ -62,6 +62,26 @@ export function forkCopyingKeys( return keys } +/** + * How a mapping entry is resolved under the live selection, for its dependents' behavior: + * - `copied`: selected for copy - dependents stay editable against the SOURCE parent (the copy + * will contain the source's children), seeded from the source reference. + * - `mapped`: has an effective target - dependents re-pick against the TARGET parent. + * - `unresolved`: neither - dependents are disabled; the parent's own gate owns the block. + * Mapped and copied are mutually exclusive by construction (a mapped copyable is excluded from + * the copy candidates), so the branch order is not load-bearing. + */ +export type ForkParentResolution = 'mapped' | 'copied' | 'unresolved' + +export function forkParentResolution( + entry: ForkMappingEntry, + targets: Record, + copyingKeys: ReadonlySet +): ForkParentResolution { + if (copyingKeys.has(forkRefKey(entry))) return 'copied' + return effectiveForkTarget(entry, targets) !== '' ? 'mapped' : 'unresolved' +} + /** * Whether every required reference is satisfied - it has a mapping target OR is selected for copy. * The server accepts a copy as resolving a required ref (promote.ts `willResolve`), so the client @@ -83,7 +103,7 @@ export function isForkRequiredComplete( /** * Whether any reference in a kind is required AND still unmapped AND not selected for copy - drives - * the overview's amber "pending" badge. Mirrors {@link isForkRequiredComplete}'s satisfied rule. + * the mapping summary's amber "pending" badge. Mirrors {@link isForkRequiredComplete}'s satisfied rule. */ export function forkRequiredPending( items: ForkMappingEntry[], diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/promote-workspace-modal/components/dependent-field-selector.tsx b/apps/sim/ee/workspace-forking/components/fork-sync/dependent-field-selector.tsx similarity index 95% rename from apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/promote-workspace-modal/components/dependent-field-selector.tsx rename to apps/sim/ee/workspace-forking/components/fork-sync/dependent-field-selector.tsx index b906d7cb858..f1768f1278a 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/promote-workspace-modal/components/dependent-field-selector.tsx +++ b/apps/sim/ee/workspace-forking/components/fork-sync/dependent-field-selector.tsx @@ -17,7 +17,7 @@ interface DependentFieldSelectorProps { } /** - * A controlled, standalone selector for the sync modal's pre-sync reconfigure: fetches + * A controlled, standalone selector for the sync page's pre-sync reconfigure: fetches * options via the shared selector data layer (the same `useSelectorOptions` registry the * canvas selectors use) without the canvas store/blockId coupling. Mirrors * {@link ConnectorSelectorField}. diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/promote-workspace-modal/dependent-value.test.ts b/apps/sim/ee/workspace-forking/components/fork-sync/dependent-value.test.ts similarity index 53% rename from apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/promote-workspace-modal/dependent-value.test.ts rename to apps/sim/ee/workspace-forking/components/fork-sync/dependent-value.test.ts index 16f49d4de4a..0f4963adcad 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/promote-workspace-modal/dependent-value.test.ts +++ b/apps/sim/ee/workspace-forking/components/fork-sync/dependent-value.test.ts @@ -5,8 +5,9 @@ import { describe, expect, it } from 'vitest' import type { ForkDependentReconfig } from '@/lib/api/contracts/workspace-fork' import { dependentKey, + effectiveCopyDependentValue, effectiveDependentValue, -} from '@/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/promote-workspace-modal/dependent-value' +} from '@/ee/workspace-forking/components/fork-sync/dependent-value' const field = (overrides: Partial = {}): ForkDependentReconfig => ({ parentKind: 'credential', @@ -22,6 +23,7 @@ const field = (overrides: Partial = {}): ForkDependentRec required: false, consumesContextKeys: [], context: {}, + sourceValue: '', ...overrides, }) @@ -57,3 +59,41 @@ describe('effectiveDependentValue', () => { expect(effectiveDependentValue(f, { [dependentKey(f)]: '' }, false)).toBe('') }) }) + +describe('effectiveCopyDependentValue', () => { + const copyField = (overrides: Partial = {}) => + field({ + parentKind: 'knowledge-base', + parentSourceId: 'kb-src', + parentContextKey: 'knowledgeBaseId', + subBlockKey: 'documentSelector', + selectorKey: 'knowledge.documents', + title: 'Document', + ...overrides, + }) + + it('seeds from the raw source reference when nothing is stored (the copy will contain it)', () => { + const f = copyField({ currentValue: '', sourceValue: 'doc-src' }) + expect(effectiveCopyDependentValue(f, {})).toBe('doc-src') + }) + + it('prefers the stored value over the source reference (a saved re-pick survives reload)', () => { + const f = copyField({ currentValue: 'doc-saved', sourceValue: 'doc-src' }) + expect(effectiveCopyDependentValue(f, {})).toBe('doc-saved') + }) + + it('an in-session re-pick wins over both', () => { + const f = copyField({ currentValue: 'doc-saved', sourceValue: 'doc-src' }) + expect(effectiveCopyDependentValue(f, { [dependentKey(f)]: 'doc-picked' })).toBe('doc-picked') + }) + + it('an explicit empty re-pick is respected (a required field then gates as usual)', () => { + const f = copyField({ currentValue: '', sourceValue: 'doc-src' }) + expect(effectiveCopyDependentValue(f, { [dependentKey(f)]: '' })).toBe('') + }) + + it('is blank when the source never referenced anything and nothing was stored', () => { + const f = copyField({ currentValue: '', sourceValue: '' }) + expect(effectiveCopyDependentValue(f, {})).toBe('') + }) +}) diff --git a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/promote-workspace-modal/dependent-value.ts b/apps/sim/ee/workspace-forking/components/fork-sync/dependent-value.ts similarity index 51% rename from apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/promote-workspace-modal/dependent-value.ts rename to apps/sim/ee/workspace-forking/components/fork-sync/dependent-value.ts index 653e9d1fdcd..04f8d213377 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/components/promote-workspace-modal/dependent-value.ts +++ b/apps/sim/ee/workspace-forking/components/fork-sync/dependent-value.ts @@ -9,7 +9,7 @@ export function dependentKey(dependent: ForkDependentReconfig): string { * The value sent + displayed for a dependent: the user's in-session re-pick if present, else the * stored value (`currentValue`). Blank when the parent target changed in-session, since the old * stored value was for the previous parent and won't resolve against the new one. Shared by the - * modal (gate + payload) and the per-block selector so the rule can't drift between them. + * sync gate + payload build and the per-block selector so the rule can't drift between them. */ export function effectiveDependentValue( field: ForkDependentReconfig, @@ -20,3 +20,20 @@ export function effectiveDependentValue( if (repicked !== undefined) return repicked return parentChanged ? '' : field.currentValue } + +/** + * The value sent + displayed for a dependent whose parent is resolved by COPY: the user's + * in-session re-pick, else the stored value, else the field's raw SOURCE reference. The copy + * brings the source parent's children along (a copied KB carries its referenced documents), so + * the source reference is exactly what the copied parent will contain - the selector browses the + * SOURCE parent and this seed resolves there. An explicit empty re-pick is respected (it gates a + * required field as usual). + */ +export function effectiveCopyDependentValue( + field: ForkDependentReconfig, + reconfig: Record +): string { + const repicked = reconfig[dependentKey(field)] + if (repicked !== undefined) return repicked + return field.currentValue || field.sourceValue +} diff --git a/apps/sim/ee/workspace-forking/components/fork-sync/fork-sync-view.tsx b/apps/sim/ee/workspace-forking/components/fork-sync/fork-sync-view.tsx new file mode 100644 index 00000000000..f4f18667a61 --- /dev/null +++ b/apps/sim/ee/workspace-forking/components/fork-sync/fork-sync-view.tsx @@ -0,0 +1,747 @@ +'use client' + +import { type Dispatch, Fragment, type SetStateAction, useMemo, useState } from 'react' +import { + Badge, + ChevronDown, + ChipCombobox, + ChipSwitch, + CollapsibleCard, + cn, + FieldDivider, + Label, +} from '@sim/emcn' +import { ArrowRight } from 'lucide-react' +import type { + ForkCopyableUnmapped, + ForkDependentReconfig, + ForkMappingEntry, + ForkResourceUsage, +} from '@/lib/api/contracts/workspace-fork' +import { SettingsEmptyState } from '@/app/workspace/[workspaceId]/settings/components/settings-empty-state' +import { SettingsSection } from '@/app/workspace/[workspaceId]/settings/components/settings-section/settings-section' +import { + FileKindRow, + ResourceKindRow, +} from '@/ee/workspace-forking/components/fork-resource-picker/fork-resource-picker' +import { forkBlockerResolution } from '@/ee/workspace-forking/components/fork-sync/cleared-refs-list' +import { forkRefKey } from '@/ee/workspace-forking/components/fork-sync/copy-reconciliation' +import { DependentFieldSelector } from '@/ee/workspace-forking/components/fork-sync/dependent-field-selector' +import { + dependentKey, + effectiveCopyDependentValue, + effectiveDependentValue, +} from '@/ee/workspace-forking/components/fork-sync/dependent-value' +import type { + ForkKindSummary, + ForkMappingGroup, + ForkSyncController, +} from '@/ee/workspace-forking/components/fork-sync/use-fork-sync' +import type { ForkDirection } from '@/ee/workspace-forking/hooks/workspace-fork' +import type { SelectorKey } from '@/hooks/selectors/types' + +/** + * Copyable kinds as expandable rows in the "Copy resources" section, ordered + labeled to match + * the fork modal's resource picker exactly. Files nest in a folder ▸ file tree; every other kind + * is a flat list. + */ +const COPYABLE_KIND_SECTIONS: ReadonlyArray<{ + kind: ForkCopyableUnmapped['kind'] + label: string +}> = [ + { kind: 'file', label: 'Files' }, + { kind: 'table', label: 'Tables' }, + { kind: 'knowledge-base', label: 'Knowledge bases' }, + { kind: 'custom-tool', label: 'Custom tools' }, + { kind: 'skill', label: 'Skills' }, + { kind: 'mcp-server', label: 'MCP servers' }, +] + +/** + * Sentinel option value for the "New copy" entry - the displayed resolution while a copyable + * is copy-selected, and the way back to the copy flow after mapping. Handled via onSelect, + * never sent. + */ +const NEW_COPY_VALUE = '__new_copy__' + +/** Fixed target-picker width so every mapping row's control lines up as one column (mirrors General). */ +const MAPPING_TARGET_TRIGGER_CLASS = 'w-[240px] flex-shrink-0' + +interface DependentBlock { + targetBlockId: string + blockName: string + fields: ForkDependentReconfig[] +} + +interface WorkflowDependents { + workflowId: string + workflowName: string + blocks: DependentBlock[] +} + +/** + * Bucket an entry's dependents per workflow, then per block within it - the + * workflow → block hierarchy the workflow cards render from. + */ +function groupDependentsByWorkflow( + workflows: ForkResourceUsage['workflows'], + dependents: ForkDependentReconfig[] +): WorkflowDependents[] { + const byWorkflow = new Map() + for (const dependent of dependents) { + const list = byWorkflow.get(dependent.targetWorkflowId) + if (list) list.push(dependent) + else byWorkflow.set(dependent.targetWorkflowId, [dependent]) + } + return workflows.map((workflow) => { + const byBlock = new Map() + for (const field of byWorkflow.get(workflow.workflowId) ?? []) { + let block = byBlock.get(field.targetBlockId) + if (!block) { + block = { targetBlockId: field.targetBlockId, blockName: field.blockName, fields: [] } + byBlock.set(field.targetBlockId, block) + } + block.fields.push(field) + } + return { + workflowId: workflow.workflowId, + workflowName: workflow.workflowName, + blocks: Array.from(byBlock.values()).sort((a, b) => a.blockName.localeCompare(b.blockName)), + } + }) +} + +/** Chain state for one block: the SelectorContext values its parent fields provide. */ +function blockChainState( + block: DependentBlock, + effectiveValue: (field: ForkDependentReconfig) => string +) { + const providedValues: Record = {} + const providedContextKeys = new Set() + for (const field of block.fields) { + if (field.providesContextKey) { + providedContextKeys.add(field.providesContextKey) + const value = effectiveValue(field) + if (value) providedValues[field.providesContextKey] = value + } + } + return { providedValues, providedContextKeys } +} + +/** Store a re-pick and invalidate in-block children chained off the changed field. */ +function applyDependentRepick( + setReconfig: Dispatch>>, + field: ForkDependentReconfig, + blockFields: ForkDependentReconfig[], + value: string +) { + setReconfig((prev) => { + const nextState = { ...prev, [dependentKey(field)]: value } + // A changed parent invalidates its children's stale re-picks. + const providedKey = field.providesContextKey + if (providedKey) { + for (const sibling of blockFields) { + if (sibling.consumesContextKeys.includes(providedKey)) { + delete nextState[dependentKey(sibling)] + } + } + } + return nextState + }) +} + +interface DependentSelectorProps { + field: ForkDependentReconfig + block: DependentBlock + target: string + parentChanged: boolean + /** True when the parent is resolved by COPY: browse the SOURCE parent, seeded from the source. */ + copying: boolean + workspaceId: string + sourceWorkspaceId: string + reconfig: Record + setReconfig: Dispatch>> +} + +/** + * One depends-on field's selector. Under a MAPPED parent it browses the TARGET parent + * (pre-filled from the stored value, blank after a parent change) and is disabled until the + * parent target is set. Under a COPY-resolved parent it browses the SOURCE parent (the copy + * will contain exactly those children), pre-filled with the source reference. Either way it + * stays disabled until every chained in-block parent has a value, and a re-pick invalidates + * chained children. + */ +function DependentSelector({ + field, + block, + target, + parentChanged, + copying, + workspaceId, + sourceWorkspaceId, + reconfig, + setReconfig, +}: DependentSelectorProps) { + const effectiveValue = (f: ForkDependentReconfig) => + copying + ? effectiveCopyDependentValue(f, reconfig) + : effectiveDependentValue(f, reconfig, parentChanged) + const { providedValues, providedContextKeys } = blockChainState(block, effectiveValue) + // Disabled until every in-block parent it depends on has a value, so a child never queries + // a stale upstream value. + const ready = field.consumesContextKeys.every( + (key) => !providedContextKeys.has(key) || providedValues[key] !== undefined + ) + // A copy-resolved parent has no target id until the sync runs - scope to the SOURCE parent + // instead (its children are what the copy brings), keeping the selector fully editable. + const parentValue = copying ? field.parentSourceId : target + return ( + applyDependentRepick(setReconfig, field, block.fields, value)} + title={field.title} + /> + ) +} + +interface DependentWorkflowCardProps { + workflow: WorkflowDependents + target: string + parentChanged: boolean + /** True when the parent is resolved by COPY - the selectors browse the SOURCE parent. */ + copying: boolean + workspaceId: string + sourceWorkspaceId: string + reconfig: Record + setReconfig: Dispatch>> +} + +/** + * One workflow's dependent fields as a collapsible card (the same `CollapsibleCard` the table + * workflow sidebar's input mapping and the enrichment config use): the header names the + * workflow; the body groups fields under block → optional tool → plain field label. + * Cards holding a required field start expanded - a required field is what gates Sync. + */ +function DependentWorkflowCard({ + workflow, + target, + parentChanged, + copying, + workspaceId, + sourceWorkspaceId, + reconfig, + setReconfig, +}: DependentWorkflowCardProps) { + const [collapsed, setCollapsed] = useState( + () => !workflow.blocks.some((block) => block.fields.some((field) => field.required)) + ) + return ( + setCollapsed((value) => !value)} + > +
+ {workflow.blocks.map((block) => { + const topLevel = block.fields.filter((field) => !field.toolName) + const byTool = new Map() + for (const field of block.fields) { + if (!field.toolName) continue + const list = byTool.get(field.toolName) + if (list) list.push(field) + else byTool.set(field.toolName, [field]) + } + const toolGroups = Array.from(byTool.entries()).sort(([a], [b]) => a.localeCompare(b)) + + return ( +
+ + {topLevel.map((field) => ( +
+ + +
+ ))} + {toolGroups.map(([toolName, fields]) => ( +
+ {toolName} + {fields.map((field) => ( +
+ + +
+ ))} +
+ ))} +
+ ) + })} +
+
+ ) +} + +interface MappingEntryProps { + controller: ForkSyncController + group: ForkMappingGroup + entry: ForkMappingEntry +} + +/** + * One mapping entry: the source ↔ target picker row (with a "Copy instead" entry for copy + * candidates and per-source taken-target disabling on push), then one collapsible card per + * workflow the resource is used in, holding that workflow's dependent field selectors. + * Workflows with nothing to configure are named in a muted note so the usage stays visible. + */ +function MappingEntry({ controller, group, entry }: MappingEntryProps) { + const target = controller.targetFor(entry) + const takenOwners = controller.takenOwnersFor(entry, group.items) + const parentChanged = controller.parentChangedFor(entry) + const entryRefKey = forkRefKey(entry) + const copying = controller.copyingKeys.has(entryRefKey) + + const usages = controller.usagesForEntry(entry) + const dependents = controller.dependentsForEntry(entry) + // Group once per (usages, dependents) change - both keep stable references from the + // controller's memoized maps, so this skips recompute across the page's frequent re-renders. + const workflows = useMemo( + () => groupDependentsByWorkflow(usages, dependents), + [usages, dependents] + ) + const configurable = workflows.filter((workflow) => workflow.blocks.length > 0) + const usedOnly = workflows.filter((workflow) => workflow.blocks.length === 0) + + return ( +
+
+
+ +
+
+
+ {entry.candidatesTruncated ? ( +

+ More options than shown — search by name. +

+ ) : null} +
+ {configurable.map((workflow) => ( + + ))} + {usedOnly.length > 0 ? ( +

+ Also used in {usedOnly.map((workflow) => workflow.workflowName).join(', ')} — nothing to + configure there. +

+ ) : null} +
+ ) +} + +/** Badge copy + color for one kind's mapping status (shared badge rules with the old summary). */ +function kindStatusBadge(summary: ForkKindSummary): { + label: string + variant: 'green' | 'amber' | 'gray-secondary' +} { + const { total, mapped, copied, requiredPending, reconfigPending } = summary + const resolved = mapped + copied + const complete = resolved === total && !reconfigPending + const label = complete + ? mapped === total + ? 'Fully mapped' + : copied === total + ? 'Copied' + : 'Mapped & copied' + : reconfigPending && resolved === total + ? 'Needs setup' + : copied > 0 + ? `${resolved}/${total} ready` + : `${mapped}/${total} mapped` + const variant = complete + ? 'green' + : requiredPending || reconfigPending + ? 'amber' + : 'gray-secondary' + return { label, variant } +} + +interface MappingKindRowProps { + controller: ForkSyncController + group: ForkMappingGroup + summary: ForkKindSummary +} + +/** + * One resource kind in the Mappings section: a chevron header row with the kind's status badge + * (the summary IS the entry), expanding to that kind's mapping entries. Mirrors the expandable + * kind rows of the Copy resources section so the two sections share one interaction rhythm. + */ +function MappingKindRow({ controller, group, summary }: MappingKindRowProps) { + const [open, setOpen] = useState(false) + const badge = kindStatusBadge(summary) + return ( +
+ + {open ? ( +
+ {group.items.map((entry, index) => ( + + {index > 0 ? : null} + + + ))} +
+ ) : null} +
+ ) +} + +interface CopyKindSectionsProps { + controller: ForkSyncController + byKind: ReadonlyMap +} + +/** + * One expandable row per copyable kind present in `byKind` - shared by the referenced group + * and the unreferenced "Not used by any workflow" group so both render exactly like the fork + * picker (files as a folder tree, every other kind flat). + */ +function CopyKindSections({ controller, byKind }: CopyKindSectionsProps) { + return ( + <> + {COPYABLE_KIND_SECTIONS.map((section) => { + const candidates = byKind.get(section.kind) + if (!candidates || candidates.length === 0) return null + // The picker rows track item ids; copy selection is keyed `${kind}:${id}` + // (matching `forkRefKey`), so derive the per-kind selected-id subset and + // re-prefix on toggle. + const selectedIds = new Set( + candidates + .filter((candidate) => controller.copySelected.has(forkRefKey(candidate))) + .map((candidate) => candidate.sourceId) + ) + const toggleMany = (ids: string[], checked: boolean) => + controller.toggleCopyKeys( + ids.map((id) => `${section.kind}:${id}`), + checked + ) + const toggleAll = (selectAll: boolean) => + toggleMany( + candidates.map((candidate) => candidate.sourceId), + selectAll + ) + return section.kind === 'file' ? ( + ({ + id: candidate.sourceId, + label: candidate.label, + folderId: candidate.parentId, + folderName: candidate.parentLabel, + }))} + selected={selectedIds} + onToggleAll={toggleAll} + onToggleItem={(id, checked) => toggleMany([id], checked)} + onToggleMany={toggleMany} + disabled={controller.submitting} + /> + ) : ( + ({ + id: candidate.sourceId, + label: candidate.label, + }))} + selected={selectedIds} + onToggleMany={toggleMany} + onToggleItem={(id, checked) => toggleMany([id], checked)} + disabled={controller.submitting} + /> + ) + })} + + ) +} + +interface ForkSyncViewProps { + controller: ForkSyncController + onDirectionChange: (direction: ForkDirection) => void +} + +/** + * The parent fork edge's sync experience as page sections: pick a direction, review the + * deployed-workflow changes, resolve the per-kind mappings (each kind an expandable row whose + * status badge doubles as the summary), choose which unmapped resources to copy, and clear any + * blocking references. The page header's Sync action commits it (after the overwrite confirm). + */ +export function ForkSyncView({ controller, onDirectionChange }: ForkSyncViewProps) { + const detailsError = controller.errorMessage ?? controller.diffErrorMessage + const headsUp = controller.mcpReauthCount > 0 || controller.inlineSecretCount > 0 + + return ( +
+ +
+ +

+ {controller.direction === 'push' + ? `Push this workspace's deployed workflows to "${controller.otherWorkspaceName}", overwriting it.` + : `Pull deployed workflows from "${controller.otherWorkspaceName}", overwriting this workspace.`} +

+
+
+ + {/* Surface a failed/pending fetch so the page never renders blank below the direction. */} + {detailsError ? ( + +
{detailsError}
+
+ ) : !controller.hasDiff ? ( +
Loading sync details…
+ ) : null} + + {/* Always shown once the diff loads so the user sees the section even with nothing + deployed - an empty change list means the source has no deployed workflows (every + deployed workflow appears here, changed or not), so the muted state nudges a deploy. */} + {controller.hasDiff ? ( + + {controller.workflowChanges.length > 0 ? ( +
+ {controller.workflowChanges.map((change, index) => { + const renamed = change.currentName !== change.otherName + return ( +
+ + {change.currentName} + + {renamed ? ( + <> + + + {change.otherName} + + + ) : null} +
+ ) + })} +
+ ) : ( +
+ {controller.direction === 'push' + ? `No deployed workflows. Deploy workflows to push changes to ${controller.otherWorkspaceName}.` + : `No deployed workflows in ${controller.otherWorkspaceName} to pull.`} +
+ )} +
+ ) : null} + + {headsUp ? ( + + {controller.mcpReauthCount > 0 ? ( +
+ {controller.mcpReauthCount} MCP server(s) use OAuth and must be re-authorized in the + target workspace. +
+ ) : null} + {controller.inlineSecretCount > 0 ? ( +
+ {controller.inlineSecretCount} inline secret(s) can't be auto-mapped — set them in the + target workspace. +
+ ) : null} +
+ ) : null} + + {controller.hasMapping ? ( + + {controller.groups.length > 0 ? ( +
+ {controller.groups.map((group) => { + const summary = controller.kindSummaries.find((item) => item.kind === group.kind) + if (!summary) return null + return ( + + ) + })} +
+ ) : ( + + This workspace's deployed workflows have no mappable references. + + )} +
+ ) : null} + + {controller.hasVisibleCopyables ? ( + +
+ {controller.referencedByKind.size > 0 ? ( + + ) : null} + {controller.unreferencedByKind.size > 0 ? ( + <> + {controller.referencedByKind.size > 0 ? ( +
+ Not used by any workflow +
+ ) : null} + + + ) : null} +
+
+ ) : null} + + {controller.blockingRefs.length > 0 ? ( + +
+ {controller.blockingRefs.map((ref, index) => ( +
+ {ref.blockLabel} would lose{' '} + {ref.fieldLabel} in{' '} + {ref.workflowName} — {forkBlockerResolution(ref)} +
+ ))} +
+
+ ) : null} + + {controller.dependentClears.length > 0 ? ( + +
+ {controller.dependentClears.map((ref, index) => ( +
+ {ref.blockLabel} will lose{' '} + {ref.fieldLabel} in{' '} + {ref.workflowName} +
+ ))} +
+

+ Re-pick these in the target after the sync. +

+
+ ) : null} +
+ ) +} diff --git a/apps/sim/ee/workspace-forking/components/fork-sync/use-fork-sync.ts b/apps/sim/ee/workspace-forking/components/fork-sync/use-fork-sync.ts new file mode 100644 index 00000000000..f84895e72b9 --- /dev/null +++ b/apps/sim/ee/workspace-forking/components/fork-sync/use-fork-sync.ts @@ -0,0 +1,810 @@ +'use client' + +import { type Dispatch, type SetStateAction, useEffect, useMemo, useState } from 'react' +import { toast } from '@sim/emcn' +import { getErrorMessage } from '@sim/utils/errors' +import type { + ForkClearedRef, + ForkCopyableUnmapped, + ForkDependentReconfig, + ForkMappingEntry, + ForkResourceUsage, + ForkWorkflowChange, +} from '@/lib/api/contracts/workspace-fork' +import { + selectVisibleClearedRefs, + splitForkClearedRefs, +} from '@/ee/workspace-forking/components/fork-sync/cleared-refs-list' +import { + effectiveForkTarget, + type ForkParentResolution, + forkCopyingKeys, + forkDefaultCopySelection, + forkMappedCopyableKeys, + forkParentResolution, + forkRefKey, + forkRequiredKindsLabel, + forkRequiredPending, + forkVisibleCopyables, + isForkRequiredComplete, +} from '@/ee/workspace-forking/components/fork-sync/copy-reconciliation' +import { + dependentKey, + effectiveCopyDependentValue, + effectiveDependentValue, +} from '@/ee/workspace-forking/components/fork-sync/dependent-value' +import { + type ForkDirection, + useForkDiff, + useForkMapping, + usePromoteFork, + useUpdateForkMapping, +} from '@/ee/workspace-forking/hooks/workspace-fork' + +/** + * The mapping kinds that can be a standalone mapping entry. `knowledge-document` is excluded: + * the mapping view (`getForkMappingView`) skips documents — they ride their parent KB via the + * reconfigure flow — so a `knowledge-document` mapping section is never reachable. + */ +export type MappableMappingKind = Exclude + +/** Section label + display order per mapping kind (one mapping group per kind). */ +const MAPPING_SECTION: Record = { + credential: { label: 'Credentials', order: 0 }, + 'env-var': { label: 'Secrets', order: 1 }, + table: { label: 'Tables', order: 2 }, + 'knowledge-base': { label: 'Knowledge bases', order: 3 }, + file: { label: 'Files', order: 4 }, + 'mcp-server': { label: 'MCP servers', order: 5 }, + 'custom-tool': { label: 'Custom tools', order: 6 }, + skill: { label: 'Skills', order: 7 }, +} + +/** Shared empty owners map for the pull direction so the options mapper never re-allocates. */ +const EMPTY_TARGET_OWNERS: ReadonlyMap = new Map() + +/** + * Stable empty arrays so an entry with no usages/dependents keeps a constant prop reference, + * letting the workflow-card grouping memos skip recompute across the page's frequent re-renders. + */ +const EMPTY_USAGES: ForkResourceUsage['workflows'] = [] +const EMPTY_DEPENDENTS: ForkDependentReconfig[] = [] + +/** Target workflows this sync archives, previewed in the confirm before "and X more". */ +export const ARCHIVED_PREVIEW_LIMIT = 5 + +export interface ForkMappingGroup { + kind: MappableMappingKind + label: string + items: ForkMappingEntry[] +} + +/** Per-kind mapping status for the Mappings section's summary badges. */ +export interface ForkKindSummary { + kind: MappableMappingKind + total: number + mapped: number + copied: number + requiredPending: boolean + reconfigPending: boolean +} + +export interface ForkSyncController { + direction: ForkDirection + otherWorkspaceName: string + isLoading: boolean + isError: boolean + errorMessage: string | null + /** Diff fetch failure, surfaced inline (the mapping may still have loaded). */ + diffErrorMessage: string | null + /** True once the diff payload for ANY direction is present (placeholder included). */ + hasDiff: boolean + /** True once the mapping payload is present (placeholder included), gating the Mappings section. */ + hasMapping: boolean + groups: ForkMappingGroup[] + /** Per-kind mapping status, aligned with `groups` (same kinds, same order). */ + kindSummaries: ForkKindSummary[] + /** Effective (in-session override, else persisted/suggested) target for an entry. */ + targetFor: (entry: ForkMappingEntry) => string + /** Set an entry's target ('' clears it) and drop its dependents' stale re-picks. */ + setTarget: (entry: ForkMappingEntry, value: string) => void + /** Targets already claimed by another source in the same kind (push targets are unique; pull never disables). */ + takenOwnersFor: ( + entry: ForkMappingEntry, + items: ForkMappingEntry[] + ) => ReadonlyMap + /** Every workflow an entry's resource is used in (diff-fed; empty until the diff loads). */ + usagesForEntry: (entry: ForkMappingEntry) => ForkResourceUsage['workflows'] + /** An entry's dependent fields (its credential/KB/table's selectors), from the diff. */ + dependentsForEntry: (entry: ForkMappingEntry) => ForkDependentReconfig[] + /** + * Whether an entry needs an in-place reconfigure: its effective target changed in-session, + * or it's an unconfirmed suggestion (accepting it as-is still remaps + clears the dependents). + */ + parentChangedFor: (entry: ForkMappingEntry) => boolean + /** The workspace a MAPPED parent's dependent selectors query against (direction-aware from the diff). */ + targetWorkspaceId: string + /** + * The sync's source workspace (push: this one; pull: the other), which a COPY-resolved + * parent's dependent selectors browse - the copy will contain the source parent's children, + * so the source is the truthful catalog to pick from. + */ + sourceWorkspaceId: string + /** In-session dependent re-picks, keyed by `dependentKey`. */ + reconfig: Record + setReconfig: Dispatch>> + /** Keys the backend offers as copy candidates, for the entry rows' "Copy instead" affordance. */ + copyableKeys: ReadonlySet + /** Copyables actually selected for copy (visible + checked), keyed `${kind}:${sourceId}`. */ + copyingKeys: ReadonlySet + /** The raw copy selection (visible-ness not applied), for per-kind selected-id derivation. */ + copySelected: ReadonlySet + toggleCopyKeys: (keys: string[], checked: boolean) => void + /** Visible copy candidates split by referenced-ness, grouped per kind for the section rows. */ + referencedByKind: ReadonlyMap + unreferencedByKind: ReadonlyMap + hasVisibleCopyables: boolean + /** Would-clear references that BLOCK sync (mirrors the server's zero-cleared-refs gate). */ + blockingRefs: ForkClearedRef[] + /** Informational would-clear dependents (owned by the reconfigure flow; never block). */ + dependentClears: ForkClearedRef[] + /** Deployed-workflow change list (update → create → archive, then by name). */ + workflowChanges: ForkWorkflowChange[] + /** Names of target workflows this sync archives, for the confirm modal. */ + archivedWorkflowNames: string[] + mcpReauthCount: number + inlineSecretCount: number + dirty: boolean + saving: boolean + save: () => void + discard: () => void + submitting: boolean + syncDisabled: boolean + /** Names the failing gate for the disabled Sync chip's tooltip; undefined when enabled. */ + syncDisabledReason: string | undefined + /** Persist the effective mapping + dependents + copy selection, then promote. */ + sync: () => Promise +} + +const entryKey = (entry: ForkMappingEntry) => forkRefKey(entry) + +/** + * Whether a mapping entry needs an in-place reconfigure: its effective target was changed + * in-session, or it's an unconfirmed suggestion (accepting it as-is still remaps + clears + * the dependents). Pure over (entry, in-session targets) so the inline render, the Sync + * gate, and the payload build share one predicate instead of drifting copies. + */ +function shouldReconfigureEntry(entry: ForkMappingEntry, targets: Record): boolean { + const next = targets[entryKey(entry)] ?? entry.targetId ?? '' + if (next === '') return false + return entry.suggested || next !== (entry.targetId ?? '') +} + +/** + * Targets already taken by OTHER sources in the same kind, each mapped to the owning + * source's label (for a hint). Used to disable those targets on PUSH: a push row is unique + * on the parent (target) side, so a parent target can back only one source - a second source + * picking it would be silently dropped on save. Pull is the inverse (many parent sources may + * share one fork target, which resolves correctly), so pull passes the empty map and never + * disables. Excludes `exclude` so a source never disables its own current selection. + */ +function takenTargetOwners( + items: ForkMappingEntry[], + targets: Record, + exclude: ForkMappingEntry +): Map { + const owners = new Map() + for (const item of items) { + if (entryKey(item) === entryKey(exclude)) continue + const target = targets[entryKey(item)] ?? item.targetId ?? '' + if (target !== '') owners.set(target, item.sourceLabel) + } + return owners +} + +/** + * The full sync surface's state for one fork edge, in the chosen direction: the editable + * resource mapping (in-session target overrides + dependent re-picks, persisted via Save or + * as part of Sync), the copy-resources selection (seeded once the diff settles), the reactive + * would-clear blockers, the per-kind status summaries, the Sync gate, and the promote run + * itself. A direction switch drops every in-session choice — the mapping set, copy candidates, + * and blockers all depend on the direction — and the copy selection re-seeds only from a + * settled (non-placeholder) diff so a stale payload can't latch wrong keys. + */ +export function useForkSync(params: { + workspaceId: string + otherWorkspaceId?: string + otherWorkspaceName: string + direction: ForkDirection + enabled: boolean +}): ForkSyncController { + const { workspaceId, otherWorkspaceId, otherWorkspaceName, direction, enabled } = params + + // User's IN-SESSION mapping overrides only - NOT the source of truth. The displayed/persisted + // target falls back to each entry's stored `targetId` (see `targetFor`), so a reopened edge + // shows its remembered mappings even though React Query's structural sharing keeps `entries` + // referentially stable (a target-seeding effect gated on `entries` would never re-run there). + const [targets, setTargets] = useState>({}) + // In-session re-picks for dependent fields whose parent the user swapped, keyed by + // `dependentKey`. Folded into the full effective set sent on save/sync, which the server + // persists as the stored mapping - so the selection survives every future sync without + // re-picking. + const [reconfig, setReconfig] = useState>({}) + // Referenced-but-unmapped resources the user chose to copy into the target (keyed by + // `${kind}:${sourceId}`); default-selected once the diff loads. Selected ones are copied on + // sync so their references resolve to the copy instead of being cleared. + const [copySelected, setCopySelected] = useState>(new Set()) + const [copyDefaulted, setCopyDefaulted] = useState(false) + const [submitting, setSubmitting] = useState(false) + + // Drop every in-session choice when the direction (or edge) changes - the mapping set, + // copy candidates, and blockers all depend on it. + useEffect(() => { + setTargets({}) + setReconfig({}) + setCopySelected(new Set()) + setCopyDefaulted(false) + }, [direction, otherWorkspaceId]) + + const mapping = useForkMapping({ workspaceId, otherWorkspaceId, direction, enabled }) + const diff = useForkDiff({ workspaceId, otherWorkspaceId, direction, enabled }) + const updateMapping = useUpdateForkMapping() + const promote = usePromoteFork() + + const entries = useMemo(() => mapping.data?.entries ?? [], [mapping.data]) + const dependentReconfigs = useMemo( + () => diff.data?.dependentReconfigs ?? [], + [diff.data?.dependentReconfigs] + ) + const resourceUsages = useMemo(() => diff.data?.resourceUsages ?? [], [diff.data?.resourceUsages]) + const copyableUnmapped = useMemo( + () => diff.data?.copyableUnmapped ?? [], + [diff.data?.copyableUnmapped] + ) + const clearedRefs = useMemo(() => diff.data?.clearedRefs ?? [], [diff.data?.clearedRefs]) + + // Keys the backend offers as copy candidates, so the entry rows show a "Copy instead" + // affordance only for those - clearing a name-match suggestion returns the ref to the copy + // list (it re-enters `visibleCopyables` once its effective target is ''). + const copyableKeys = useMemo( + () => new Set(copyableUnmapped.map((candidate) => forkRefKey(candidate))), + [copyableUnmapped] + ) + + // Copy-vs-map reconciliation: a copyable resource the user has given an effective (in-session + // or persisted) mapping target must NOT also appear in the copy list - the user picked map, not + // copy. `forkRefKey` shares the `${kind}:${sourceId}` keyspace across entries and candidates, + // so a mapped entry's key directly excludes its copy candidate. The server enforces the same + // precedence: a mapped resource resolves != null, so it never reaches the plan's + // `copyableUnmapped`, and a copy request for it is dropped by `buildPromoteCopySelection`. + const mappedCopyableKeys = useMemo( + () => forkMappedCopyableKeys(entries, targets), + [entries, targets] + ) + + const visibleCopyables = useMemo( + () => forkVisibleCopyables(copyableUnmapped, mappedCopyableKeys), + [copyableUnmapped, mappedCopyableKeys] + ) + + // Copyables actually selected for copy (visible + checked), keyed for an O(1) lookup so a + // copyable mapping entry can show a "will be copied" note. + const copyingKeys = useMemo( + () => forkCopyingKeys(visibleCopyables, copySelected), + [visibleCopyables, copySelected] + ) + + // Group the visible copy candidates by kind so each renders as its own expandable section + // (chevron + tri-state select-all + count), matching the fork picker. Referenced and + // unreferenced candidates group separately: unreferenced ones (used by no synced workflow) + // render under a muted "Not used by any workflow" grouping and default to unselected. + const { referencedByKind, unreferencedByKind } = useMemo(() => { + const referenced = new Map() + const unreferenced = new Map() + for (const candidate of visibleCopyables) { + const groups = candidate.referenced ? referenced : unreferenced + const list = groups.get(candidate.kind) + if (list) list.push(candidate) + else groups.set(candidate.kind, [candidate]) + } + return { referencedByKind: referenced, unreferencedByKind: unreferenced } + }, [visibleCopyables]) + + // Default every REFERENCED copyable resource to "copy" once the diff loads, so the common case + // (bring the referenced resources along) needs no clicks; the user can deselect to clear + // instead. Unreferenced candidates start unselected (see `forkDefaultCopySelection`) - copying + // them is opt-in since nothing references them. Seed ONLY from a settled diff for the current + // direction: on a direction switch the reset clears `copyDefaulted`, but `useForkDiff` keeps + // the previous direction's payload (placeholderData) until the new fetch resolves - seeding + // from it would latch against stale keys and leave the real copyables unchecked, clearing + // their references on Sync. + useEffect(() => { + if (!enabled || diff.isPlaceholderData || copyableUnmapped.length === 0 || copyDefaulted) return + setCopyDefaulted(true) + setCopySelected(forkDefaultCopySelection(copyableUnmapped)) + }, [enabled, diff.isPlaceholderData, copyableUnmapped, copyDefaulted]) + + // Group dependents by their parent (kind:sourceId) once, so each mapping entry gets a + // STABLE `dependents` array reference - a fresh `.filter` per render would defeat the + // workflow-card grouping memos. + const dependentsByParent = useMemo(() => { + const map = new Map() + for (const dependent of dependentReconfigs) { + const key = `${dependent.parentKind}:${dependent.parentSourceId}` + const list = map.get(key) + if (list) list.push(dependent) + else map.set(key, [dependent]) + } + return map + }, [dependentReconfigs]) + + // Effective target for an entry: the user's in-session override if present, else the + // persisted mapping from the server. Read directly from `entries` so a reopened edge + // reflects stored mappings without a seeding effect. + const targetFor = (entry: ForkMappingEntry) => effectiveForkTarget(entry, targets) + + const usagesForEntry = (entry: ForkMappingEntry): ForkResourceUsage['workflows'] => + resourceUsages.find( + (usage) => usage.parentKind === entry.kind && usage.parentSourceId === entry.sourceId + )?.workflows ?? EMPTY_USAGES + + const dependentsForEntry = (entry: ForkMappingEntry): ForkDependentReconfig[] => + dependentsByParent.get(entryKey(entry)) ?? EMPTY_DEPENDENTS + + const parentChangedFor = (entry: ForkMappingEntry): boolean => + shouldReconfigureEntry(entry, targets) + + // Set an entry's in-session mapping target. A `value` of '' explicitly clears it, overriding + // any name-match suggestion (effectiveForkTarget's `??` treats '' as present, so the suggestion + // no longer wins) - so the resource re-enters `visibleCopyables` and is copy-selectable again. + // Changing the parent invalidates its dependents' in-session re-picks (chosen against the old + // account), so drop them. + const setTarget = (entry: ForkMappingEntry, value: string) => { + setTargets((prev) => ({ ...prev, [entryKey(entry)]: value })) + setReconfig((prev) => { + let changed = false + const next = { ...prev } + for (const dependent of dependentsForEntry(entry)) { + const key = dependentKey(dependent) + if (key in next) { + delete next[key] + changed = true + } + } + return changed ? next : prev + }) + } + + const takenOwnersFor = ( + entry: ForkMappingEntry, + items: ForkMappingEntry[] + ): ReadonlyMap => + direction === 'push' ? takenTargetOwners(items, targets, entry) : EMPTY_TARGET_OWNERS + + const toggleCopyKeys = (keys: string[], checked: boolean) => + setCopySelected((prev) => { + const next = new Set(prev) + for (const key of keys) { + if (checked) next.add(key) + else next.delete(key) + } + return next + }) + + // Group mappings by resource type - one accordion row per kind, required types first. + const groups = useMemo(() => { + const byKind = new Map() + for (const entry of entries) { + // The mapping view never emits a document entry (it rides its KB), so the group is + // unreachable - skip defensively so the narrowed `MAPPING_SECTION` lookup stays sound. + if (entry.kind === 'knowledge-document') continue + const list = byKind.get(entry.kind) + if (list) list.push(entry) + else byKind.set(entry.kind, [entry]) + } + return Array.from(byKind, ([kind, items]) => ({ + kind, + label: MAPPING_SECTION[kind].label, + items: items.slice().sort((a, b) => a.sourceLabel.localeCompare(b.sourceLabel)), + })).sort((a, b) => MAPPING_SECTION[a.kind].order - MAPPING_SECTION[b.kind].order) + }, [entries]) + + // The mapping entry each dependent hangs off, indexed by `kind:sourceId` (matching `entryKey`) + // so the per-field lookups below are O(1) instead of rescanning `entries` for every dependent - + // and several times per field across the Sync gate, the value helper, and the payload build. + const entriesByParent = useMemo(() => { + const map = new Map() + for (const entry of entries) map.set(entryKey(entry), entry) + return map + }, [entries]) + + const entryForDependent = (field: ForkDependentReconfig) => + entriesByParent.get(`${field.parentKind}:${field.parentSourceId}`) + + const resolutionFor = (entry: ForkMappingEntry): ForkParentResolution => + forkParentResolution(entry, targets, copyingKeys) + + // The value sent + displayed for a dependent (delegates to the shared per-resolution rule): + // the user's re-pick, else - under a MAPPED parent - the stored value (blank when the parent + // target changed in-session), or - under a COPY-resolved parent - the stored value falling + // back to the raw source reference (which the copied parent will contain). Callers that + // already resolved the parent pass both in to skip repeat lookups. + const dependentValueFor = ( + field: ForkDependentReconfig, + parent = entryForDependent(field), + resolution: ForkParentResolution = parent ? resolutionFor(parent) : 'unresolved' + ): string => { + if (resolution === 'copied') return effectiveCopyDependentValue(field, reconfig) + return effectiveDependentValue( + field, + reconfig, + parent ? shouldReconfigureEntry(parent, targets) : false + ) + } + + // A required reference is satisfied when it has a mapping target OR the user selected it for + // copy (the server accepts a copy as resolving a required ref). See `isForkRequiredComplete`. + const requiredComplete = isForkRequiredComplete(entries, targets, copyingKeys) + + // Every required dependent whose parent is RESOLVED must have a value before sync. Under a + // mapped parent the user re-picks against the target; under a copy-resolved parent the field + // pre-fills with the source reference (the copy carries it), so it's satisfied out of the box + // and gates only when explicitly emptied. A dependent whose parent is unresolved can't be + // picked yet (its selector is disabled) and is gated by `requiredComplete` on the parent + // instead, so it's skipped here. + const reconfigComplete = dependentReconfigs.every((field) => { + if (!field.required) return true + const parent = entryForDependent(field) + if (!parent) return true + const resolution = resolutionFor(parent) + if (resolution === 'unresolved') return true + return dependentValueFor(field, parent, resolution) !== '' + }) + + // Kinds with a required DEPENDENT that still has no value (its parent is resolved): these + // block Sync via `reconfigComplete`, so the summary badge for that kind must not read + // "Fully mapped". + const reconfigPendingByKind = new Set() + for (const field of dependentReconfigs) { + if (!field.required) continue + const parent = entryForDependent(field) + if (!parent) continue + const resolution = resolutionFor(parent) + if (resolution === 'unresolved') continue + if (dependentValueFor(field, parent, resolution) === '') { + reconfigPendingByKind.add(parent.kind as MappableMappingKind) + } + } + + // The references this sync would blank, reactively narrowed to the current selection. A + // resource is "resolved" once it has a mapping target OR is selected for copy - the same + // predicate drives a `reference` (its own resource) and a `dependent` (its PARENT resource), + // so mapping or copying a parent KB makes its child document drop off. Then split: + // `reference`/`workflow` entries are BLOCKERS (Sync stays disabled while any remain - + // mirroring the server's zero-cleared-refs gate); `dependent` entries stay informational + // (the reconfigure flow owns them). + const { blockers: blockingRefs, informational: dependentClears } = useMemo(() => { + const isResolved = (kind: string, sourceId: string) => { + const key = `${kind}:${sourceId}` + const entry = entriesByParent.get(key) + const mapped = entry ? (targets[key] ?? entry.targetId ?? '') !== '' : false + return mapped || copyingKeys.has(key) + } + return splitForkClearedRefs(selectVisibleClearedRefs(clearedRefs, isResolved)) + }, [clearedRefs, entriesByParent, targets, copyingKeys]) + + // Per-kind status for the Mappings summary: "Fully mapped" or "n/total mapped", flagged when + // a REQUIRED target is still missing (which blocks Sync). Reads the effective + // (override-or-persisted) target so it reflects both remembered mappings and in-session edits. + const kindSummaries: ForkKindSummary[] = groups.map((group) => { + const total = group.items.length + const mapped = group.items.filter((entry) => targetFor(entry) !== '').length + // Copy-selected items are resolved too (their refs are kept), so they count toward + // completion and render as "copied" rather than unconfigured. mapped/copied are disjoint: + // a mapped copyable is excluded from the copy candidates, so copyingKeys never overlaps a + // mapped entry. + const copied = group.items.filter((entry) => copyingKeys.has(entryKey(entry))).length + // Mirror the Sync gate: a required ref selected for copy is satisfied, so it is not + // "pending". + const requiredPending = forkRequiredPending(group.items, targets, copyingKeys) + const reconfigPending = reconfigPendingByKind.has(group.kind) + return { kind: group.kind, total, mapped, copied, requiredPending, reconfigPending } + }) + + // Kinds whose required gate is still failing, so the Sync tooltip can name the actual + // obstacle. An unmapped credential/secret is NEVER a cleared-ref blocker (the collector + // excludes required kinds), so the required gate must not borrow the blocker message - + // it would point at a "Blocking sync" section that isn't rendered. + const pendingRequiredKinds = new Set( + kindSummaries.filter((summary) => summary.requiredPending).map((summary) => summary.kind) + ) + + // Sync details still settling for the current direction: loading, a failed/empty mapping + // (`!mapping.data` must not read as "nothing required"), or the PREVIOUS direction's + // placeholder after a switch (syncing on it would send stale mappings/copies and clear + // references). Until `diff.data` arrives `dependentReconfigs` is empty, so `reconfigComplete` + // is vacuously true. + const dataPending = + mapping.isLoading || + !mapping.data || + mapping.isPlaceholderData || + !diff.data || + diff.isPlaceholderData + // A failed fetch also gates Sync: a failed REFETCH keeps the last successful payload in + // `data` (so `dataPending` stays false), and every gate below would be judging that stale + // snapshot while the page shows the load error. + const dataError = mapping.isError || diff.isError + // Zero-blockers invariant (mirrors the server gate): Sync stays disabled while ANY reference + // would clear in a synced target workflow. `requiredComplete` covers the mapping entries + // (credentials/secrets and unresolved resource refs); `blockingRefs` additionally covers + // workflow-to-workflow references, which have no mapping entry to resolve. + const syncBlocked = blockingRefs.length > 0 + const syncDisabled = + submitting || + !otherWorkspaceId || + !requiredComplete || + !reconfigComplete || + syncBlocked || + dataPending || + dataError + + // A load failure outranks the gates - they're computed from the stale (or absent) payload, + // so naming one would mislead. Then priority mirrors the resolution flow: clear the + // blockers, map the required resources, reconfigure their dependents - each failing gate + // names ITS obstacle (an unmapped credential/secret is a required-mapping failure, not a + // cleared-ref blocker; see `pendingRequiredKinds`). + const syncDisabledReason = dataError + ? "Couldn't load sync details — reload the page to retry" + : syncBlocked + ? 'Resolve every blocking reference first — map it, copy it, or fix it in the source' + : !requiredComplete + ? `Map all required ${forkRequiredKindsLabel(pendingRequiredKinds)} first` + : !reconfigComplete + ? 'Reconfigure all required fields first' + : dataPending + ? 'Loading sync details…' + : undefined + + const workflowChanges = useMemo(() => { + const order: Record = { update: 0, create: 1, archive: 2 } + return [...(diff.data?.workflows ?? [])].sort( + (a, b) => order[a.action] - order[b.action] || a.currentName.localeCompare(b.currentName) + ) + }, [diff.data?.workflows]) + + // Target workflows this sync archives (their source was deleted), named in the confirm modal + // so the overwrite warning is concrete. + const archivedWorkflowNames = useMemo( + () => + workflowChanges + .filter((change) => change.action === 'archive') + .map((change) => change.currentName), + [workflowChanges] + ) + + // Send the full stored mapping for every dependent whose parent is RESOLVED - mapped (its + // effective value: re-pick, stored, or blank-after-change) or copy-selected (re-pick, stored, + // or the source reference; promote translates a source document id to its copied counterpart + // at write time). The server persists this verbatim as the stored mapping; fields whose + // parent is unresolved are omitted (they can't be configured). This is the whole "what's in + // the mapping goes in" contract, shared by Save and Sync so the two persist identically. + const buildDependentValues = () => + dependentReconfigs.flatMap((field) => { + const parent = entryForDependent(field) + if (!parent) return [] + const resolution = resolutionFor(parent) + if (resolution === 'unresolved') return [] + return [ + { + workflowId: field.targetWorkflowId, + blockId: field.targetBlockId, + subBlockKey: field.subBlockKey, + value: dependentValueFor(field, parent, resolution), + }, + ] + }) + + const buildMappingEntries = () => + entries.map((entry) => ({ + resourceType: entry.resourceType, + sourceId: entry.sourceId, + targetId: targetFor(entry) || null, + })) + + // Dirty only on a real change from the stored/suggested target - so a freshly loaded + // mapping (even with name-match suggestions shown) isn't dirty until the user edits. + const targetsDirty = useMemo( + () => + entries.some((entry) => { + const key = entryKey(entry) + return key in targets && targets[key] !== (entry.targetId ?? '') + }), + [entries, targets] + ) + + // A dependent re-pick that differs from its stored value also dirties the editor. A re-pick + // under a changed parent is covered by `targetsDirty` (the parent override is the change). + const reconfigDirty = useMemo( + () => + dependentReconfigs.some((field) => { + const repicked = reconfig[dependentKey(field)] + return repicked !== undefined && repicked !== field.currentValue + }), + [dependentReconfigs, reconfig] + ) + + const dirty = targetsDirty || reconfigDirty + + const save = () => { + if (!otherWorkspaceId || !dirty || updateMapping.isPending) return + updateMapping.mutate( + { + workspaceId, + body: { + otherWorkspaceId, + direction, + // Persist the full effective set (WYSIWYG). Only include dependentValues once the + // diff has loaded; omitted before that so an early save can't wipe the store from + // an unknown set. + entries: buildMappingEntries(), + ...(diff.data ? { dependentValues: buildDependentValues() } : {}), + }, + }, + { + onSuccess: () => { + setTargets({}) + setReconfig({}) + toast.success('Mapping saved') + }, + onError: (error) => toast.error(getErrorMessage(error, 'Failed to save mapping')), + } + ) + } + + const discard = () => { + setTargets({}) + setReconfig({}) + } + + const sync = async () => { + if (!otherWorkspaceId) return + setSubmitting(true) + // Capture every payload from the state at confirm time, before any await - the page's + // controls stay mounted during the run (unlike the old modal, which blocked its UI), so a + // mid-flight edit must not leak into the promote body. + const mappingEntries = buildMappingEntries() + const dependentValues = diff.data ? buildDependentValues() : null + // Copy the referenced-but-unmapped resources the user kept selected, excluding any the + // user mapped in-session (reconciliation: maps win). The backend validates each id + // against the plan's copy candidates too, so a mapped/stale id is dropped server-side + // regardless. + const selectedCopyables = visibleCopyables.filter((candidate) => + copySelected.has(forkRefKey(candidate)) + ) + try { + await updateMapping.mutateAsync({ + workspaceId, + body: { otherWorkspaceId, direction, entries: mappingEntries }, + }) + const copyResources = { + knowledgeBases: selectedCopyables + .filter((c) => c.kind === 'knowledge-base') + .map((c) => c.sourceId), + tables: selectedCopyables.filter((c) => c.kind === 'table').map((c) => c.sourceId), + customTools: selectedCopyables + .filter((c) => c.kind === 'custom-tool') + .map((c) => c.sourceId), + skills: selectedCopyables.filter((c) => c.kind === 'skill').map((c) => c.sourceId), + // Files are identified by storage key (the copyable candidate's sourceId is the key). + files: selectedCopyables.filter((c) => c.kind === 'file').map((c) => c.sourceId), + mcpServers: selectedCopyables.filter((c) => c.kind === 'mcp-server').map((c) => c.sourceId), + } + + const result = await promote.mutateAsync({ + workspaceId, + body: { + otherWorkspaceId, + direction, + // Once the diff has loaded, ALWAYS send the full effective set - including `[]`, + // which means "every dependent went away" and must reconcile/clear the live replace + // targets' stored rows. Collapsing `[]` into omission would make the backend + // PRESERVE stale rows. Only omit before the diff loads (set unknown), so the + // existing store is left untouched. + ...(dependentValues !== null ? { dependentValues } : {}), + ...(selectedCopyables.length > 0 ? { copyResources } : {}), + }, + }) + + if (!result.promoteRunId) { + if (result.blockers.length > 0) { + // The server's authoritative gate re-found would-clear references (something changed + // between the preview and Sync). The mutation's settled invalidation refetches the + // diff, so the refreshed blocker list is already on its way in. + const count = result.blockers.length + toast.error( + `Sync blocked: ${count} reference${count === 1 ? '' : 's'} would break in the target. Review the updated list and try again.` + ) + return + } + if (result.unmappedRequired.length > 0) { + // Name the actual blocking kinds rather than always blaming credentials: the server + // blocks on required REFERENCES (credentials and/or secrets); required dependents are + // gated client-side before this runs (see the Sync chip's disabled tooltip). + const kinds = new Set(result.unmappedRequired.map((reference) => reference.kind)) + toast.error(`Map all required ${forkRequiredKindsLabel(kinds)} first`) + return + } + toast.error('Sync did not complete') + return + } + + const target = otherWorkspaceName || 'the workspace' + const label = direction === 'pull' ? `Pulled from "${target}"` : `Pushed to "${target}"` + // A sync only commits once every reference is mapped/copied and every required dependent + // has a value (the zero-cleared-refs invariant + `reconfigComplete`), so the old + // "re-check X block - something may have been cleared" warnings only fired on + // preview-vs-commit races and read as false alarms. Those rare cases still land in the + // Activity entry (needsConfiguration/clearedOptional are recorded there) and a + // needs-config workflow visibly stays undeployed. Deploy FAILURES remain a real, + // actionable outcome, so they keep a warning. + if (result.deployFailed > 0) { + const n = result.deployFailed + toast.warning( + `${label}, but ${n} workflow${n === 1 ? '' : 's'} failed to deploy — open and redeploy ${n === 1 ? 'it' : 'them'}.` + ) + } else { + toast.success(label) + } + } catch (error) { + toast.error(getErrorMessage(error, 'Sync failed')) + } finally { + setSubmitting(false) + } + } + + return { + direction, + otherWorkspaceName, + isLoading: enabled && mapping.isLoading, + isError: mapping.isError, + errorMessage: mapping.isError ? getErrorMessage(mapping.error, 'Failed to load mapping') : null, + diffErrorMessage: diff.isError + ? getErrorMessage(diff.error, "Couldn't load sync details. Reload the page to retry.") + : null, + hasDiff: Boolean(diff.data), + hasMapping: Boolean(mapping.data), + groups, + kindSummaries, + targetFor, + setTarget, + takenOwnersFor, + usagesForEntry, + dependentsForEntry, + parentChangedFor, + targetWorkspaceId: diff.data?.targetWorkspaceId ?? '', + sourceWorkspaceId: diff.data?.sourceWorkspaceId ?? '', + reconfig, + setReconfig, + copyableKeys, + copyingKeys, + copySelected, + toggleCopyKeys, + referencedByKind, + unreferencedByKind, + hasVisibleCopyables: visibleCopyables.length > 0, + blockingRefs, + dependentClears, + workflowChanges, + archivedWorkflowNames, + mcpReauthCount: diff.data?.mcpReauthServerIds.length ?? 0, + inlineSecretCount: diff.data?.inlineSecretSources.length ?? 0, + dirty, + saving: updateMapping.isPending, + save, + discard, + submitting, + syncDisabled, + syncDisabledReason, + sync, + } +} diff --git a/apps/sim/ee/workspace-forking/components/fork-workspace-modal/fork-workspace-modal.tsx b/apps/sim/ee/workspace-forking/components/fork-workspace-modal/fork-workspace-modal.tsx new file mode 100644 index 00000000000..0623ffc0de4 --- /dev/null +++ b/apps/sim/ee/workspace-forking/components/fork-workspace-modal/fork-workspace-modal.tsx @@ -0,0 +1,299 @@ +'use client' + +import { useEffect, useMemo, useState } from 'react' +import { + ChipCopyInput, + ChipInput, + ChipModal, + ChipModalBody, + ChipModalError, + ChipModalFooter, + ChipModalHeader, + toast, +} from '@sim/emcn' +import { AlertTriangle } from 'lucide-react' +import { useRouter } from 'next/navigation' +import type { GetForkResourcesResponse } from '@/lib/api/contracts/workspace-fork' +import { SettingsSection } from '@/app/workspace/[workspaceId]/settings/components/settings-section/settings-section' +import { + FileKindRow, + ResourceKindRow, +} from '@/ee/workspace-forking/components/fork-resource-picker/fork-resource-picker' +import { useForkResources, useForkWorkspace } from '@/ee/workspace-forking/hooks/workspace-fork' + +interface ForkWorkspaceModalProps { + open: boolean + onOpenChange: (open: boolean) => void + sourceWorkspaceId: string + sourceWorkspaceName: string + /** Whether the user is under their workspace cap; creating a fork is gated on this. */ + canFork: boolean + /** Sends the user to upgrade (billing) when they try to fork at the cap. */ + onUpgrade: () => void +} + +type ResourceKey = Exclude +type ResourceSelection = Record> + +const RESOURCE_KINDS: ReadonlyArray<{ key: ResourceKey; label: string }> = [ + { key: 'files', label: 'Files' }, + { key: 'tables', label: 'Tables' }, + { key: 'knowledgeBases', label: 'Knowledge bases' }, + { key: 'customTools', label: 'Custom tools' }, + { key: 'skills', label: 'Skills' }, + { key: 'mcpServers', label: 'MCP servers' }, + { key: 'workflowMcpServers', label: 'Workflow MCP servers' }, +] + +const emptySelection = (): ResourceSelection => ({ + files: new Set(), + tables: new Set(), + knowledgeBases: new Set(), + customTools: new Set(), + skills: new Set(), + mcpServers: new Set(), + workflowMcpServers: new Set(), +}) + +const fullSelection = (data: GetForkResourcesResponse): ResourceSelection => { + const selection = emptySelection() + for (const kind of RESOURCE_KINDS) { + selection[kind.key] = new Set((data[kind.key] ?? []).map((item) => item.id)) + } + return selection +} + +/** + * Names and creates a fork of the current workspace, letting the user pick which + * resources to copy (whole kinds or a specific subset). Unselected resources leave + * the corresponding workflow subblocks empty. On success the modal closes - the + * Forks settings page's Activity log tracks the copy job, and the toast offers a + * one-click jump into the new fork. + */ +export function ForkWorkspaceModal({ + open, + onOpenChange, + sourceWorkspaceId, + sourceWorkspaceName, + canFork, + onUpgrade, +}: ForkWorkspaceModalProps) { + const router = useRouter() + const forkWorkspace = useForkWorkspace() + const resources = useForkResources(sourceWorkspaceId, open) + const [name, setName] = useState('') + const [selected, setSelected] = useState(emptySelection) + const [defaulted, setDefaulted] = useState(false) + const [error, setError] = useState(null) + + useEffect(() => { + if (open) { + setName(`${sourceWorkspaceName} (fork)`) + setSelected(emptySelection()) + setDefaulted(false) + setError(null) + } + }, [open, sourceWorkspaceName]) + + useEffect(() => { + if (!open || !resources.data || defaulted) return + setDefaulted(true) + setSelected(fullSelection(resources.data)) + }, [open, resources.data, defaulted]) + + const isForking = forkWorkspace.isPending + + const availableKinds = useMemo( + () => RESOURCE_KINDS.filter((kind) => (resources.data?.[kind.key].length ?? 0) > 0), + [resources.data] + ) + + const hasDeselection = useMemo( + () => + defaulted && + availableKinds.some( + (kind) => selected[kind.key].size < (resources.data?.[kind.key]?.length ?? 0) + ), + [defaulted, availableKinds, selected, resources.data] + ) + + // A fork always produces a usable workspace: deployed workflows are copied, and + // when the source has none, create-fork seeds a blank starter workflow (plus any + // selected resources). So forking is never blocked - we just set expectations when + // there are no deployed workflows to carry over. + const noDeployedWorkflows = + Boolean(resources.data) && (resources.data?.deployedWorkflowCount ?? 0) === 0 + + const handleSubmit = () => { + // At a workspace cap, creating a fork is the only gated action - send the user to + // upgrade rather than blocking the whole modal. + if (!canFork) { + onUpgrade() + return + } + const trimmed = name.trim() + // Block until the resources query resolves: building `copy` from an unloaded `resources.data` + // would send an empty selection and silently clear every reference in the fork. The Fork + // action is disabled in this state too; this is the defense-in-depth guard. + if (!trimmed || isForking || !resources.data) return + setError(null) + const copy = Object.fromEntries( + RESOURCE_KINDS.map((kind) => [kind.key, Array.from(selected[kind.key])]) + ) + forkWorkspace.mutate( + { workspaceId: sourceWorkspaceId, body: { name: trimmed, copy } }, + { + onSuccess: (result) => { + // The copy job's progress lands in the page's Activity log; the toast action + // preserves the old modal's one-click "Open fork". + toast.success(`Forked into "${result.workspace.name}"`, { + action: { + label: 'Open fork', + onClick: () => router.push(`/workspace/${result.workspace.id}/w`), + }, + }) + onOpenChange(false) + }, + onError: (err) => setError(err.message || 'Failed to fork workspace'), + } + ) + } + + return ( + + onOpenChange(false)}>Fork workspace + +
+ + + + + + * + + } + > + setName(event.target.value)} + onKeyDown={(event) => { + if (event.key === 'Enter' && !event.nativeEvent.isComposing) { + event.preventDefault() + handleSubmit() + } + }} + placeholder='Workspace name' + maxLength={100} + autoComplete='off' + disabled={isForking} + aria-label='Workspace name' + /> + + + {availableKinds.length > 0 ? ( + +
+ {availableKinds.map((kind) => + kind.key === 'files' ? ( + + setSelected((prev) => ({ + ...prev, + files: selectAll + ? new Set((resources.data?.files ?? []).map((item) => item.id)) + : new Set(), + })) + } + onToggleItem={(id, checked) => + setSelected((prev) => { + const next = new Set(prev.files) + if (checked) next.add(id) + else next.delete(id) + return { ...prev, files: next } + }) + } + onToggleMany={(ids, checked) => + setSelected((prev) => { + const next = new Set(prev.files) + for (const id of ids) { + if (checked) next.add(id) + else next.delete(id) + } + return { ...prev, files: next } + }) + } + disabled={isForking} + /> + ) : ( + + setSelected((prev) => { + const next = new Set(prev[kind.key]) + for (const id of ids) { + if (checked) next.add(id) + else next.delete(id) + } + return { ...prev, [kind.key]: next } + }) + } + onToggleItem={(id, checked) => + setSelected((prev) => { + const next = new Set(prev[kind.key]) + if (checked) next.add(id) + else next.delete(id) + return { ...prev, [kind.key]: next } + }) + } + disabled={isForking} + /> + ) + )} + {hasDeselection ? ( +
+ + + Some resources are not selected — references to them in your workflows will be + cleared in the fork. + +
+ ) : null} +
+
+ ) : null} + + {noDeployedWorkflows ? ( +

+ No deployed workflows to copy — your fork will start with a blank workflow. +

+ ) : null} +
+ {error ?? undefined} +
+ onOpenChange(false)} + cancelDisabled={isForking} + primaryAction={{ + label: isForking ? 'Forking...' : 'Fork', + onClick: handleSubmit, + // At the cap the button stays clickable (no name needed) so it can route to + // upgrade. Otherwise it needs a name AND the resources query loaded - forking + // before `resources.data` arrives would clear every reference (P1-C). + disabled: isForking || (canFork && (!name.trim() || !resources.data)), + disabledTooltip: + canFork && name.trim() && !resources.data ? 'Loading workspace resources…' : undefined, + }} + /> +
+ ) +} diff --git a/apps/sim/ee/workspace-forking/components/forks.tsx b/apps/sim/ee/workspace-forking/components/forks.tsx new file mode 100644 index 00000000000..dca079338e0 --- /dev/null +++ b/apps/sim/ee/workspace-forking/components/forks.tsx @@ -0,0 +1,580 @@ +'use client' + +import { useState } from 'react' +import { ChipConfirmModal, toast } from '@sim/emcn' +import { ArrowLeft } from '@sim/emcn/icons' +import { getErrorMessage } from '@sim/utils/errors' +import { AlertTriangle, Plus } from 'lucide-react' +import { useParams, useRouter } from 'next/navigation' +import { useQueryState } from 'nuqs' +import type { ForkLineageChildApi, ForkLineageNodeApi } from '@/lib/api/contracts/workspace-fork' +import { FloatingOverflowText } from '@/app/workspace/[workspaceId]/components' +import { UnsavedChangesModal } from '@/app/workspace/[workspaceId]/components/credential-detail' +import { useUserPermissionsContext } from '@/app/workspace/[workspaceId]/providers/workspace-permissions-provider' +import { + forkIdParam, + forkIdUrlKeys, + forkSyncDirectionParam, + forkSyncDirectionUrlKeys, + forkViewParam, + forkViewUrlKeys, +} from '@/app/workspace/[workspaceId]/settings/[section]/search-params' +import { + type RowAction, + RowActionsMenu, +} from '@/app/workspace/[workspaceId]/settings/components/row-actions-menu' +import { saveDiscardActions } from '@/app/workspace/[workspaceId]/settings/components/save-discard-actions/save-discard-actions' +import { SettingsEmptyState } from '@/app/workspace/[workspaceId]/settings/components/settings-empty-state' +import type { SettingsAction } from '@/app/workspace/[workspaceId]/settings/components/settings-header/settings-header' +import { SettingsPanel } from '@/app/workspace/[workspaceId]/settings/components/settings-panel' +import { SettingsSection } from '@/app/workspace/[workspaceId]/settings/components/settings-section/settings-section' +import { useSettingsUnsavedGuard } from '@/app/workspace/[workspaceId]/settings/hooks/use-settings-unsaved-guard' +import { isBillingEnabled } from '@/app/workspace/[workspaceId]/settings/navigation' +import { ForkActivityPanel } from '@/ee/workspace-forking/components/fork-activity-panel/fork-activity-panel' +import { ForkSyncView } from '@/ee/workspace-forking/components/fork-sync/fork-sync-view' +import { + ARCHIVED_PREVIEW_LIMIT, + useForkSync, +} from '@/ee/workspace-forking/components/fork-sync/use-fork-sync' +import { ForkWorkspaceModal } from '@/ee/workspace-forking/components/fork-workspace-modal/fork-workspace-modal' +import { useForkingAvailability } from '@/ee/workspace-forking/hooks/use-forking-available' +import { + useForkLineage, + useRollbackFork, + useUnlinkFork, +} from '@/ee/workspace-forking/hooks/workspace-fork' +import { useWorkspaceCreationPolicy, useWorkspacesQuery } from '@/hooks/queries/workspace' +import { useSettingsNavigation } from '@/hooks/use-settings-navigation' + +/** Explains a disabled lineage action whose target workspace the viewer cannot open. */ +const NO_ACCESS_TOOLTIP = "You don't have access to this workspace" + +/** Lineage partner names by id (the parent + this workspace's forks), for the Activity view. */ +function lineagePartnerNames( + parent: ForkLineageNodeApi | null, + forks: ForkLineageChildApi[] +): ReadonlyMap { + const names = new Map() + if (parent) names.set(parent.id, parent.name) + for (const fork of forks) names.set(fork.id, fork.name) + return names +} + +interface ForkListRowProps { + name: string + /** Entries for the row's `...` menu (Edit mappings / Open workspace / Disconnect). */ + actions: RowAction[] +} + +function ForkListRow({ name, actions }: ForkListRowProps) { + return ( +
+ +
+ +
+
+ ) +} + +interface ForkSyncDetailViewProps { + title: string + workspaceId: string + /** The other side of the edge being synced (this workspace's parent). */ + otherWorkspaceId: string + otherWorkspaceName: string + onBack: () => void + /** Header chips rendered left of Sync (e.g. Open workspace) — the caller owns those. */ + actions: SettingsAction[] +} + +/** + * The parent edge's sync page (reached from the parent row): direction, deployed-workflow + * changes, per-kind mappings (each an expandable row whose status badge is the summary), + * copy resources, and blocking references, all as page sections. + * The header's Sync chip is gated until zero blockers + required mappings + reconfigure are + * complete, and always confirms the overwrite first — that confirm is the flow's one modal. + * While the mapping has unsaved edits the header swaps to Discard/Save and leaving is guarded; + * Sync itself persists the effective mapping as part of the run. + */ +function ForkSyncDetailView({ + title, + workspaceId, + otherWorkspaceId, + otherWorkspaceName, + onBack, + actions, +}: ForkSyncDetailViewProps) { + // Sync direction is shareable view state: a copied link opens the same side of the sync. + const [direction, setDirection] = useQueryState(forkSyncDirectionParam.key, { + ...forkSyncDirectionParam.parser, + ...forkSyncDirectionUrlKeys, + }) + + const controller = useForkSync({ + workspaceId, + otherWorkspaceId, + otherWorkspaceName, + direction, + enabled: true, + }) + + // Guard leaving the detail view (Back) while the mapping has unsaved edits, and feed + // the shared settings dirty store so a sidebar section switch confirms too. + const guard = useSettingsUnsavedGuard({ isDirty: controller.dirty }) + + const [confirmSyncOpen, setConfirmSyncOpen] = useState(false) + + // Sync is the edge's primary action, so it's the rightmost/black chip; the caller's + // Open workspace chip sits left of it. Dirty mapping edits swap the whole cluster + // for Discard/Save until they're saved or discarded. + const panelActions: SettingsAction[] = controller.dirty + ? saveDiscardActions({ + dirty: controller.dirty, + saving: controller.saving, + onSave: controller.save, + onDiscard: controller.discard, + }) + : [ + ...actions, + { + text: controller.submitting ? 'Working...' : 'Sync', + variant: 'primary' as const, + onSelect: () => setConfirmSyncOpen(true), + disabled: controller.syncDisabled, + tooltip: controller.syncDisabled + ? controller.syncDisabledReason + : `Push to or pull from ${otherWorkspaceName}`, + }, + ] + + const targetWorkspaceName = direction === 'push' ? otherWorkspaceName : 'this workspace' + + return ( + <> + + guard.guardBack(() => { + void setDirection(null) + onBack() + }), + }} + title={title} + actions={panelActions} + > + void setDirection(next)} + /> + + + + + { + setConfirmSyncOpen(false) + void controller.sync() + }, + pending: controller.submitting, + pendingLabel: 'Syncing...', + }} + > + {controller.archivedWorkflowNames.length > 0 ? ( +
+

+ Will be archived in {targetWorkspaceName}{' '} + (deleted in the source): +

+ {controller.archivedWorkflowNames + .slice(0, ARCHIVED_PREVIEW_LIMIT) + .map((name, index) => ( +
+ {name} +
+ ))} + {controller.archivedWorkflowNames.length > ARCHIVED_PREVIEW_LIMIT ? ( +
+ and {controller.archivedWorkflowNames.length - ARCHIVED_PREVIEW_LIMIT} more +
+ ) : null} +
+ ) : null} +
+ + ) +} + +interface ForkActivityDetailViewProps { + workspaceId: string + /** Lineage partner names by id, for phrasing rows recorded on the other side of an edge. */ + workspaceNames: ReadonlyMap + onBack: () => void + /** Header actions (e.g. the destructive Rollback chip while the last sync is undoable). */ + actions?: SettingsAction[] +} + +/** + * Workspace-scoped activity: every fork, sync, and rollback involving this workspace + * (both sides of each edge), reached from the page header's "See activity" action. + */ +function ForkActivityDetailView({ + workspaceId, + workspaceNames, + onBack, + actions, +}: ForkActivityDetailViewProps) { + return ( + + + + ) +} + +/** + * Forks settings page. The workspace's single parent (if it's a fork) sits in its own + * "Parent" section, above the "Forks" list of child forks. The parent row's `...` menu + * has Edit mappings (the child owns its edge's re-picks), Open workspace, and + * Disconnect; fork rows offer Open workspace and Disconnect only. Activity is + * workspace-scoped and lives behind the header's "See activity" action (including + * Rollback when the last sync into this workspace is undoable). Sync lives on the + * parent's sync detail page. + * Forking and sync rewrite workflow state and deployments en masse, so the page is + * workspace-admin only and gated on the workspace's fork entitlement - every fork route + * re-checks both; the server remains the boundary. + */ +export function Forks() { + const params = useParams() + const router = useRouter() + const workspaceId = params.workspaceId as string + + const { canAdmin, isLoading: permissionsLoading } = useUserPermissionsContext() + const { available: forkingAvailable, isLoading: availabilityLoading } = + useForkingAvailability(workspaceId) + const canUseForking = forkingAvailable && canAdmin + + const { data: workspaces } = useWorkspacesQuery() + const { data: creationPolicy } = useWorkspaceCreationPolicy() + const { navigateToSettings } = useSettingsNavigation() + const lineage = useForkLineage(workspaceId, canUseForking) + const rollback = useRollbackFork() + const unlink = useUnlinkFork() + + const [searchTerm, setSearchTerm] = useState('') + const [isForkModalOpen, setIsForkModalOpen] = useState(false) + const [confirmRollbackOpen, setConfirmRollbackOpen] = useState(false) + const [confirmUnlink, setConfirmUnlink] = useState<{ id: string; name: string } | null>(null) + + const [selectedForkId, setSelectedForkId] = useQueryState(forkIdParam.key, { + ...forkIdParam.parser, + ...forkIdUrlKeys, + }) + const [forkView, setForkView] = useQueryState(forkViewParam.key, { + ...forkViewParam.parser, + ...forkViewUrlKeys, + }) + + const workspaceName = workspaces?.find((workspace) => workspace.id === workspaceId)?.name + const canFork = creationPolicy?.canCreate ?? true + const parent = lineage.data?.parent ?? null + const forks = lineage.data?.children ?? [] + const undoableRun = lineage.data?.undoableRun ?? null + const gateLoading = availabilityLoading || permissionsLoading + + // Rollback undoes the last sync INTO this workspace, restoring each affected + // workflow to its prior deployed version. + const runRollback = async () => { + if (!undoableRun) return + try { + await rollback.mutateAsync({ + workspaceId, + body: { otherWorkspaceId: undoableRun.otherWorkspaceId }, + }) + toast.success(`Undid sync from "${undoableRun.otherName}"`) + setConfirmRollbackOpen(false) + } catch (err) { + toast.error(getErrorMessage(err, 'Undo failed')) + } + } + + const openForkWorkspace = (forkId: string) => { + router.push(`/workspace/${forkId}/w`) + } + + const openForkMappings = (forkId: string) => { + void setSelectedForkId(forkId) + } + + /** Permanently dissolve the edge with the confirmed workspace; both workspaces remain. */ + const runUnlink = async () => { + if (!confirmUnlink) return + try { + await unlink.mutateAsync({ + workspaceId, + body: { otherWorkspaceId: confirmUnlink.id }, + }) + toast.success(`Disconnected "${confirmUnlink.name}"`) + setConfirmUnlink(null) + } catch (err) { + toast.error(getErrorMessage(err, 'Disconnect failed')) + } + } + + if (gateLoading) { + return + } + + if (!canUseForking) { + return ( + + + {canAdmin + ? 'Forking is not available for this workspace.' + : 'Only workspace admins can manage forks.'} + + + ) + } + + const searchLower = searchTerm.trim().toLowerCase() + const parentVisible = + parent !== null && (!searchLower || parent.name.toLowerCase().includes(searchLower)) + const filteredForks = forks.filter((fork) => fork.name.toLowerCase().includes(searchLower)) + const hasRows = parent !== null || forks.length > 0 + + // The sync detail exists only for the PARENT edge: sync (and the mapping re-picks it + // persists) belongs to the child workspace configuring how it maps its parent's + // resources, so a parent browsing its forks gets no detail for them (a stale fork-id + // deep link falls back to the list). Fork rows offer Open workspace / Disconnect only. + const showParentDetail = Boolean(selectedForkId && parent && parent.id === selectedForkId) + + // Open workspace sits left of the detail view's primary Sync chip, which the sync + // page owns (it carries the gating). Rollback lives on the Activity view only. + const parentHeaderActions: SettingsAction[] = parent + ? [ + { + text: 'Open workspace', + onSelect: () => openForkWorkspace(parent.id), + disabled: !parent.viewerAccessible, + tooltip: parent.viewerAccessible ? undefined : NO_ACCESS_TOOLTIP, + }, + ] + : [] + + return ( + <> + {showParentDetail && parent ? ( + setSelectedForkId(null)} + actions={parentHeaderActions} + /> + ) : forkView === 'activity' ? ( + setForkView(null)} + actions={ + undoableRun + ? [ + { + text: 'Rollback', + variant: 'destructive', + onSelect: () => setConfirmRollbackOpen(true), + disabled: rollback.isPending, + tooltip: `The last sync into this workspace (from ${undoableRun.otherName}) can be undone — it restores each workflow's prior deployed version.`, + }, + ] + : undefined + } + /> + ) : ( + void setForkView('activity') }, + { + text: 'Create fork', + icon: Plus, + variant: 'primary', + onSelect: () => setIsForkModalOpen(true), + }, + ]} + > + {lineage.isError ? ( +
+

+ {getErrorMessage(lineage.error, 'Failed to load forks')} +

+
+ ) : lineage.isLoading ? null : !hasRows ? ( + Click "Create fork" above to get started + ) : ( +
+ {parentVisible && parent !== null && ( + + openForkMappings(parent.id), + disabled: !parent.viewerAccessible, + tooltip: parent.viewerAccessible ? undefined : NO_ACCESS_TOOLTIP, + }, + { + label: 'Open workspace', + onSelect: () => openForkWorkspace(parent.id), + disabled: !parent.viewerAccessible, + tooltip: parent.viewerAccessible ? undefined : NO_ACCESS_TOOLTIP, + }, + // Disconnect stays enabled regardless of access: severing the edge is a + // current-workspace operation (admin on the acting side only), and must + // remain reachable exactly when the other side is inaccessible. + { + label: 'Disconnect', + destructive: true, + onSelect: () => setConfirmUnlink({ id: parent.id, name: parent.name }), + }, + ]} + /> + + )} + + {filteredForks.length > 0 ? ( +
+ {filteredForks.map((fork) => ( + openForkWorkspace(fork.id), + disabled: !fork.viewerAccessible, + tooltip: fork.viewerAccessible ? undefined : NO_ACCESS_TOOLTIP, + }, + { + label: 'Disconnect', + destructive: true, + onSelect: () => setConfirmUnlink({ id: fork.id, name: fork.name }), + }, + ]} + /> + ))} +
+ ) : ( + + {searchTerm.trim() + ? `No forks found matching "${searchTerm}"` + : 'No forks yet — click "Create fork" above to get started'} + + )} +
+
+ )} +
+ )} + + { + if (isBillingEnabled) navigateToSettings({ section: 'billing' }) + }} + /> + + { + if (!open) setConfirmUnlink(null) + }} + srTitle='Disconnect fork' + title='Disconnect fork' + text={[ + 'This permanently removes the fork relationship with ', + { text: confirmUnlink?.name ?? '', bold: true }, + ". Both workspaces stay exactly as they are, but they will no longer appear in each other's fork lists, and syncing between them stops.", + ]} + confirm={{ + label: 'Disconnect', + onClick: () => void runUnlink(), + pending: unlink.isPending, + pendingLabel: 'Disconnecting...', + }} + > +
+ + + This cannot be undone — the saved mappings and sync history for this pair are deleted, + and forking again creates a brand-new workspace. + +
+
+ + void runRollback(), + pending: rollback.isPending, + pendingLabel: 'Rolling back...', + }} + > +
+ + + Resources copied into this workspace during syncs may remain afterward — rollback + restores workflows to their prior versions but does not remove copied resources. + +
+
+ + ) +} diff --git a/apps/sim/ee/workspace-forking/hooks/background-work.ts b/apps/sim/ee/workspace-forking/hooks/background-work.ts new file mode 100644 index 00000000000..04ff26407f6 --- /dev/null +++ b/apps/sim/ee/workspace-forking/hooks/background-work.ts @@ -0,0 +1,60 @@ +import { useInfiniteQuery } from '@tanstack/react-query' +import { requestJson } from '@/lib/api/client/request' +import { + type BackgroundWorkItem, + type GetWorkspaceBackgroundWorkResponse, + getWorkspaceBackgroundWorkContract, +} from '@/lib/api/contracts/workspace-fork' + +export const backgroundWorkKeys = { + all: ['backgroundWork'] as const, + // 'infinite' segments the key from the pre-pagination plain-query era: the data shape + // under the old key was an array, and an infinite query reading such a cache entry + // renders as empty. A shape change must always re-key. + lists: () => [...backgroundWorkKeys.all, 'list', 'infinite'] as const, + list: (workspaceId?: string) => [...backgroundWorkKeys.lists(), workspaceId ?? ''] as const, +} + +export const BACKGROUND_WORK_STALE_TIME = 5_000 + +/** Page size for the fork Activity feed, matching the audit log's. */ +const BACKGROUND_WORK_PAGE_SIZE = '50' + +async function fetchWorkspaceBackgroundWork( + workspaceId: string, + cursor?: string, + signal?: AbortSignal +): Promise { + return requestJson(getWorkspaceBackgroundWorkContract, { + params: { id: workspaceId }, + query: { cursor, limit: BACKGROUND_WORK_PAGE_SIZE }, + signal, + }) +} + +const isActive = (item: BackgroundWorkItem) => + item.status === 'pending' || item.status === 'processing' + +/** + * Durable "background work in progress" status for a workspace (fork content copy + + * any deployment side-effects), keyset-paginated like the enterprise audit log + * (`getNextPageParam` from the page's `nextCursor`). Poll-first per the best-practice + * for long jobs: the status survives a reload (it's a DB row), and we only keep + * polling while something is still running, then stop - the poll refetches every + * loaded page sequentially with fresh cursors, so pagination stays consistent. + * Refetch on focus catches changes after the tab was away. + */ +export function useWorkspaceBackgroundWork(workspaceId?: string) { + return useInfiniteQuery({ + queryKey: backgroundWorkKeys.list(workspaceId), + queryFn: ({ pageParam, signal }) => + fetchWorkspaceBackgroundWork(workspaceId as string, pageParam, signal), + initialPageParam: undefined as string | undefined, + getNextPageParam: (lastPage) => lastPage.nextCursor, + enabled: Boolean(workspaceId), + staleTime: BACKGROUND_WORK_STALE_TIME, + refetchInterval: (query) => + (query.state.data?.pages ?? []).some((page) => page.items.some(isActive)) ? 5_000 : false, + refetchOnWindowFocus: true, + }) +} diff --git a/apps/sim/ee/workspace-forking/hooks/use-forking-available.ts b/apps/sim/ee/workspace-forking/hooks/use-forking-available.ts new file mode 100644 index 00000000000..90380a9bff7 --- /dev/null +++ b/apps/sim/ee/workspace-forking/hooks/use-forking-available.ts @@ -0,0 +1,40 @@ +import { useQuery } from '@tanstack/react-query' +import { requestJson } from '@/lib/api/client/request' +import { getForkAvailabilityContract } from '@/lib/api/contracts/workspace-fork' + +export const forkAvailabilityKeys = { + all: ['fork-availability'] as const, + details: () => [...forkAvailabilityKeys.all, 'detail'] as const, + detail: (workspaceId?: string) => [...forkAvailabilityKeys.details(), workspaceId ?? ''] as const, +} + +/** Availability flips only on plan changes or flag rollouts - cache generously. */ +const FORK_AVAILABILITY_STALE_TIME = 5 * 60 * 1000 + +interface ForkingAvailability { + available: boolean + /** The lookup is still in flight - callers that gate a whole page wait on this. */ + isLoading: boolean +} + +/** + * Server-evaluated fork availability for the workspace: the verdict of the exact gate + * every fork route enforces (env/plan + the `workspace-forking` AppConfig rollout + * flag), served by the availability route. Used to hide the Forks settings tab and + * the fork context-menu entries; the server gate remains the security boundary. + */ +export function useForkingAvailability(workspaceId?: string): ForkingAvailability { + const { data, isLoading } = useQuery({ + queryKey: forkAvailabilityKeys.detail(workspaceId), + queryFn: ({ signal }) => + requestJson(getForkAvailabilityContract, { params: { id: workspaceId as string }, signal }), + enabled: Boolean(workspaceId), + staleTime: FORK_AVAILABILITY_STALE_TIME, + }) + return { available: data?.available ?? false, isLoading } +} + +/** Boolean shorthand for surfaces that only show/hide fork entry points. */ +export function useForkingAvailable(workspaceId?: string): boolean { + return useForkingAvailability(workspaceId).available +} diff --git a/apps/sim/hooks/queries/workspace-fork.ts b/apps/sim/ee/workspace-forking/hooks/workspace-fork.ts similarity index 90% rename from apps/sim/hooks/queries/workspace-fork.ts rename to apps/sim/ee/workspace-forking/hooks/workspace-fork.ts index 45d026a98f9..3b806ca8b16 100644 --- a/apps/sim/hooks/queries/workspace-fork.ts +++ b/apps/sim/ee/workspace-forking/hooks/workspace-fork.ts @@ -11,11 +11,13 @@ import { promoteForkContract, type RollbackForkBody, rollbackForkContract, + type UnlinkForkBody, type UpdateForkMappingBody, + unlinkForkContract, updateForkMappingContract, } from '@/lib/api/contracts/workspace-fork' import type { WorkspacesResponse } from '@/lib/api/contracts/workspaces' -import { backgroundWorkKeys } from '@/hooks/queries/background-work' +import { backgroundWorkKeys } from '@/ee/workspace-forking/hooks/background-work' import { deploymentKeys } from '@/hooks/queries/deployments' import { workspaceKeys } from '@/hooks/queries/workspace' @@ -164,6 +166,22 @@ export function usePromoteFork() { }) } +export function useUnlinkFork() { + const queryClient = useQueryClient() + return useMutation({ + mutationFn: (vars: { workspaceId: string; body: UnlinkForkBody }) => + requestJson(unlinkForkContract, { params: { id: vars.workspaceId }, body: vars.body }), + onSettled: () => { + // Unlink dissolves the edge: lineage loses the row, and the edge's mappings/diff + // no longer exist. Workflows and deployments are untouched. + queryClient.invalidateQueries({ queryKey: forkKeys.lineages() }) + queryClient.invalidateQueries({ queryKey: forkKeys.mappings() }) + queryClient.invalidateQueries({ queryKey: forkKeys.diffs() }) + queryClient.invalidateQueries({ queryKey: backgroundWorkKeys.lists() }) + }, + }) +} + export function useRollbackFork() { const queryClient = useQueryClient() return useMutation({ diff --git a/apps/sim/ee/workspace-forking/lib/background-work/store.test.ts b/apps/sim/ee/workspace-forking/lib/background-work/store.test.ts new file mode 100644 index 00000000000..bffc56645c9 --- /dev/null +++ b/apps/sim/ee/workspace-forking/lib/background-work/store.test.ts @@ -0,0 +1,265 @@ +/** + * @vitest-environment node + */ +import { dbChainMock, dbChainMockFns, resetDbChainMock } from '@sim/testing' +import { beforeEach, describe, expect, it, vi } from 'vitest' +import type { DbOrTx } from '@/lib/db/types' +import { listSurfacedBackgroundWork } from '@/ee/workspace-forking/lib/background-work/store' + +const executor = dbChainMock.db as unknown as DbOrTx + +/** Shape produced by the drizzle-orm mock's `sql` tagged template. */ +interface MockSqlFragment { + strings: readonly string[] + values: unknown[] +} + +interface MockCondition { + type: string + conditions?: MockCondition[] + left?: unknown + right?: unknown + column?: unknown + values?: unknown[] +} + +/** Resolves the first `.where(...)` (the children lookup) to the given fork ids. */ +function mockChildrenLookup(childIds: string[]) { + dbChainMockFns.where.mockImplementationOnce( + () => Promise.resolve(childIds.map((id) => ({ id }))) as never + ) +} + +/** Builds an opaque cursor the way the store encodes one (base64 JSON). */ +function encodeCursor(data: { updatedAt: string; id: string }): string { + return Buffer.from(JSON.stringify(data)).toString('base64') +} + +function decodeCursor(cursor: string): { updatedAt: string; id: string } { + return JSON.parse(Buffer.from(cursor, 'base64').toString()) +} + +describe('listSurfacedBackgroundWork', () => { + beforeEach(() => { + vi.clearAllMocks() + resetDbChainMock() + }) + + it('returns the surfaced rows ordered by recency with the id tiebreaker', async () => { + mockChildrenLookup([]) + const rows = [ + { id: 'job-1', updatedAt: new Date('2026-07-01T10:00:00.000Z') }, + { id: 'job-2', updatedAt: new Date('2026-07-01T09:00:00.000Z') }, + ] + dbChainMockFns.limit.mockResolvedValueOnce(rows as never) + + const result = await listSurfacedBackgroundWork(executor, 'ws-1') + + expect(result.rows).toEqual(rows) + expect(dbChainMockFns.orderBy).toHaveBeenCalledWith( + { type: 'desc', column: 'updatedAt' }, + { type: 'desc', column: 'id' } + ) + // Over-fetches one row past the default page size to detect another page. + expect(dbChainMockFns.limit).toHaveBeenCalledWith(51) + }) + + it('returns a null cursor when the page is not full', async () => { + mockChildrenLookup([]) + dbChainMockFns.limit.mockResolvedValueOnce([ + { id: 'job-1', updatedAt: new Date('2026-07-01T10:00:00.000Z') }, + ] as never) + + const result = await listSurfacedBackgroundWork(executor, 'ws-1', { limit: 2 }) + + expect(result.rows).toHaveLength(1) + expect(result.nextCursor).toBeNull() + }) + + it('returns a null cursor for an empty page', async () => { + mockChildrenLookup([]) + dbChainMockFns.limit.mockResolvedValueOnce([] as never) + + const result = await listSurfacedBackgroundWork(executor, 'ws-1') + + expect(result).toEqual({ rows: [], nextCursor: null }) + }) + + it('trims the over-fetched row and encodes the next cursor from the last returned row', async () => { + mockChildrenLookup([]) + const rows = [ + { id: 'job-1', updatedAt: new Date('2026-07-01T10:00:00.000Z') }, + { id: 'job-2', updatedAt: new Date('2026-07-01T09:00:00.000Z') }, + { id: 'job-3', updatedAt: new Date('2026-07-01T08:00:00.000Z') }, + ] + dbChainMockFns.limit.mockResolvedValueOnce(rows as never) + + const result = await listSurfacedBackgroundWork(executor, 'ws-1', { limit: 2 }) + + expect(dbChainMockFns.limit).toHaveBeenCalledWith(3) + expect(result.rows).toEqual(rows.slice(0, 2)) + expect(result.nextCursor).not.toBeNull() + expect(decodeCursor(result.nextCursor as string)).toEqual({ + updatedAt: '2026-07-01T09:00:00.000Z', + id: 'job-2', + }) + }) + + it('applies the cursor as a keyset condition with the id tiebreaker', async () => { + mockChildrenLookup([]) + const cursor = encodeCursor({ updatedAt: '2026-07-01T09:00:00.000Z', id: 'job-2' }) + + await listSurfacedBackgroundWork(executor, 'ws-1', { cursor }) + + const rowsWhere = dbChainMockFns.where.mock.calls[1][0] as MockCondition + expect(rowsWhere.type).toBe('and') + expect(rowsWhere.conditions).toHaveLength(3) + + const cursorDate = new Date('2026-07-01T09:00:00.000Z') + const keyset = (rowsWhere.conditions as MockCondition[])[2] + expect(keyset).toEqual({ + type: 'or', + conditions: [ + { type: 'lt', left: 'updatedAt', right: cursorDate }, + { + type: 'and', + conditions: [ + { type: 'eq', left: 'updatedAt', right: cursorDate }, + { type: 'lt', left: 'id', right: 'job-2' }, + ], + }, + ], + }) + }) + + it('pages through rows with identical updatedAt via the id tiebreaker', async () => { + // Two rows share one timestamp; page 1 ends on the higher id. The next + // cursor must carry that id so the second page matches the remaining row + // through the eq(updatedAt) + lt(id) arm instead of skipping it. + const sharedAt = new Date('2026-07-01T09:00:00.000Z') + mockChildrenLookup([]) + dbChainMockFns.limit.mockResolvedValueOnce([ + { id: 'job-b', updatedAt: sharedAt }, + { id: 'job-a', updatedAt: sharedAt }, + ] as never) + + const firstPage = await listSurfacedBackgroundWork(executor, 'ws-1', { limit: 1 }) + expect(firstPage.rows).toEqual([{ id: 'job-b', updatedAt: sharedAt }]) + expect(decodeCursor(firstPage.nextCursor as string)).toEqual({ + updatedAt: sharedAt.toISOString(), + id: 'job-b', + }) + + mockChildrenLookup([]) + dbChainMockFns.limit.mockResolvedValueOnce([{ id: 'job-a', updatedAt: sharedAt }] as never) + + const secondPage = await listSurfacedBackgroundWork(executor, 'ws-1', { + cursor: firstPage.nextCursor as string, + limit: 1, + }) + + const rowsWhere = dbChainMockFns.where.mock.calls[3][0] as MockCondition + const keyset = (rowsWhere.conditions as MockCondition[])[2] + expect(keyset.conditions?.[1]).toEqual({ + type: 'and', + conditions: [ + { type: 'eq', left: 'updatedAt', right: sharedAt }, + { type: 'lt', left: 'id', right: 'job-b' }, + ], + }) + expect(secondPage.rows).toEqual([{ id: 'job-a', updatedAt: sharedAt }]) + expect(secondPage.nextCursor).toBeNull() + }) + + it('ignores an undecodable cursor and serves the first page', async () => { + mockChildrenLookup([]) + + await listSurfacedBackgroundWork(executor, 'ws-1', { cursor: 'not-base64-json' }) + + const rowsWhere = dbChainMockFns.where.mock.calls[1][0] as MockCondition + expect(rowsWhere.conditions).toHaveLength(2) + }) + + it('clamps the requested limit to the server-side cap', async () => { + mockChildrenLookup([]) + + await listSurfacedBackgroundWork(executor, 'ws-1', { limit: 5000 }) + + expect(dbChainMockFns.limit).toHaveBeenCalledWith(101) + }) + + it('looks up live forks of the workspace for the child-keyed clause', async () => { + mockChildrenLookup([]) + await listSurfacedBackgroundWork(executor, 'ws-1') + + const childrenWhere = dbChainMockFns.where.mock.calls[0][0] as MockCondition + expect(childrenWhere).toEqual({ + type: 'and', + conditions: [ + { type: 'eq', left: 'forkedFromWorkspaceId', right: 'ws-1' }, + { type: 'isNull', column: 'archivedAt' }, + ], + }) + }) + + it('matches rows keyed to the workspace, to it as fork child, and to it as edge partner', async () => { + mockChildrenLookup([]) + await listSurfacedBackgroundWork(executor, 'ws-1') + + const rowsWhere = dbChainMockFns.where.mock.calls[1][0] as MockCondition + expect(rowsWhere.type).toBe('and') + expect(rowsWhere.conditions).toHaveLength(2) + const [involves, statuses] = rowsWhere.conditions as [MockCondition, MockCondition] + + expect(involves.type).toBe('or') + const orConditions = involves.conditions as unknown as [ + MockCondition, + MockSqlFragment, + MockSqlFragment, + ] + expect(orConditions).toHaveLength(3) + + expect(orConditions[0]).toEqual({ type: 'eq', left: 'workspaceId', right: 'ws-1' }) + + const childIdClause = orConditions[1] + expect(childIdClause.strings.join('?')).toContain("->> 'childWorkspaceId' =") + expect(childIdClause.values).toEqual(['metadata', 'ws-1']) + + const otherIdClause = orConditions[2] + expect(otherIdClause.strings.join('?')).toContain("->> 'otherWorkspaceId' =") + expect(otherIdClause.values).toEqual(['metadata', 'ws-1']) + + expect(statuses).toEqual({ + type: 'inArray', + column: 'status', + values: ['pending', 'processing', 'completed', 'completed_with_warnings', 'failed'], + }) + }) + + it('also matches sync/rollback rows keyed to the forks of the workspace (pre-otherWorkspaceId history)', async () => { + mockChildrenLookup(['fork-1', 'fork-2']) + await listSurfacedBackgroundWork(executor, 'ws-1') + + const rowsWhere = dbChainMockFns.where.mock.calls[1][0] as MockCondition + const involves = (rowsWhere.conditions as MockCondition[])[0] + expect(involves.conditions).toHaveLength(4) + + const childKeyedClause = (involves.conditions as MockCondition[])[3] + expect(childKeyedClause).toEqual({ + type: 'and', + conditions: [ + { type: 'inArray', column: 'workspaceId', values: ['fork-1', 'fork-2'] }, + { type: 'inArray', column: 'kind', values: ['fork_sync', 'fork_rollback'] }, + ], + }) + }) + + it('omits the child-keyed clause when the workspace has no forks', async () => { + mockChildrenLookup([]) + await listSurfacedBackgroundWork(executor, 'ws-1') + + const rowsWhere = dbChainMockFns.where.mock.calls[1][0] as MockCondition + const involves = (rowsWhere.conditions as MockCondition[])[0] + expect(involves.conditions).toHaveLength(3) + }) +}) diff --git a/apps/sim/lib/workspaces/fork/background-work/store.ts b/apps/sim/ee/workspace-forking/lib/background-work/store.ts similarity index 59% rename from apps/sim/lib/workspaces/fork/background-work/store.ts rename to apps/sim/ee/workspace-forking/lib/background-work/store.ts index 307c094df9f..a0f86376b27 100644 --- a/apps/sim/lib/workspaces/fork/background-work/store.ts +++ b/apps/sim/ee/workspace-forking/lib/background-work/store.ts @@ -1,7 +1,7 @@ -import { backgroundWorkStatus } from '@sim/db/schema' +import { backgroundWorkStatus, workspace } from '@sim/db/schema' import { createLogger } from '@sim/logger' import { generateId } from '@sim/utils/id' -import { and, desc, eq, inArray, isNull, lte } from 'drizzle-orm' +import { and, desc, eq, inArray, isNull, lt, lte, or, type SQL, sql } from 'drizzle-orm' import type { DbOrTx } from '@/lib/db/types' const logger = createLogger('ForkBackgroundWork') @@ -27,8 +27,11 @@ const SURFACED_STATUSES: BackgroundWorkStatusValue[] = [ 'failed', ] -/** Cap on recent jobs returned for a workspace's Activity tab. */ -const BACKGROUND_WORK_LIST_LIMIT = 20 +/** Default page size for the workspace's Activity tab (mirrors the audit log's). */ +const BACKGROUND_WORK_PAGE_SIZE = 50 + +/** Server-side cap on the requested page size (mirrors the audit log's). */ +const BACKGROUND_WORK_PAGE_SIZE_MAX = 100 /** * An active (pending/processing) row older than this is treated as abandoned: the @@ -182,27 +185,120 @@ function toMetadataRecord(value: unknown): Record { : {} } +/** Keyset position of the last row of a page: `updatedAt` plus the `id` tiebreaker. */ +interface BackgroundWorkCursorData { + updatedAt: string + id: string +} + +/** Encodes the keyset position as an opaque base64 cursor (mirrors the audit log's). */ +function encodeCursor(data: BackgroundWorkCursorData): string { + return Buffer.from(JSON.stringify(data)).toString('base64') +} + +function decodeCursor(cursor: string): BackgroundWorkCursorData | null { + try { + return JSON.parse(Buffer.from(cursor, 'base64').toString()) + } catch { + return null + } +} + +/** + * Keyset condition for rows strictly after the cursor position in + * `updatedAt DESC, id DESC` order: older `updatedAt`, or the same `updatedAt` + * (which is not unique) with a smaller `id`. Null for an invalid cursor, which + * degrades to the first page rather than erroring. + */ +function buildCursorCondition(cursor: string): SQL | null { + const cursorData = decodeCursor(cursor) + if (!cursorData?.updatedAt || !cursorData.id) return null + + const cursorDate = new Date(cursorData.updatedAt) + if (Number.isNaN(cursorDate.getTime())) return null + + return or( + lt(backgroundWorkStatus.updatedAt, cursorDate), + and(eq(backgroundWorkStatus.updatedAt, cursorDate), lt(backgroundWorkStatus.id, cursorData.id)) + )! +} + +export interface BackgroundWorkPage { + rows: BackgroundWorkRow[] + /** Cursor for the next page; null when this page is the last. */ + nextCursor: string | null +} + /** - * Recent background-work jobs for a workspace - the durable audit record the Activity - * tab renders, most-recent first and capped. Fork jobs are append-only (one row per - * fork), so this is the workspace's fork history; older rows are pruned by the cron. + * Recent background-work jobs involving a workspace - the durable audit record the + * Activity view renders, most-recent first and keyset-paginated (`updatedAt DESC, + * id DESC`, cursor + limit mirroring the audit log's `queryAuditLogs`). Fork jobs + * are append-only (one row per fork), so this is the workspace's fork history; + * older rows are pruned by the cron. + * + * Every fork event is recorded ONCE, keyed to the workspace it was initiated from + * (fork-create → the parent; sync/rollback/sync-copy → the workspace whose page ran + * it), so "involving" matches both sides of each edge without double-writing rows: + * + * - rows keyed to this workspace (its own forks, syncs it ran, its rollbacks); + * - rows whose `metadata.childWorkspaceId` is this workspace (its own creation, + * recorded on the parent); + * - rows whose `metadata.otherWorkspaceId` is this workspace (the other side of a + * sync/rollback/sync-copy edge); + * - sync/rollback rows keyed to one of this workspace's forks - a fork's only sync + * edge is its parent, so these are guaranteed edge events (covers rows written + * before `metadata.otherWorkspaceId` existed). */ export async function listSurfacedBackgroundWork( executor: DbOrTx, - workspaceId: string -): Promise { - const rows = await executor + workspaceId: string, + options?: { cursor?: string; limit?: number } +): Promise { + const limit = Math.min( + Math.max(options?.limit ?? BACKGROUND_WORK_PAGE_SIZE, 1), + BACKGROUND_WORK_PAGE_SIZE_MAX + ) + + const childRows = await executor + .select({ id: workspace.id }) + .from(workspace) + .where(and(eq(workspace.forkedFromWorkspaceId, workspaceId), isNull(workspace.archivedAt))) + const childWorkspaceIds = childRows.map((row) => row.id) + + const involvesWorkspace = or( + eq(backgroundWorkStatus.workspaceId, workspaceId), + sql`${backgroundWorkStatus.metadata} ->> 'childWorkspaceId' = ${workspaceId}`, + sql`${backgroundWorkStatus.metadata} ->> 'otherWorkspaceId' = ${workspaceId}`, + ...(childWorkspaceIds.length > 0 + ? [ + and( + inArray(backgroundWorkStatus.workspaceId, childWorkspaceIds), + inArray(backgroundWorkStatus.kind, ['fork_sync', 'fork_rollback']) + ), + ] + : []) + ) + + const conditions = [involvesWorkspace, inArray(backgroundWorkStatus.status, SURFACED_STATUSES)] + if (options?.cursor) { + const cursorCondition = buildCursorCondition(options.cursor) + if (cursorCondition) conditions.push(cursorCondition) + } + + // Over-fetch by one row to learn whether another page exists (audit-log pattern). + const rows = (await executor .select() .from(backgroundWorkStatus) - .where( - and( - eq(backgroundWorkStatus.workspaceId, workspaceId), - inArray(backgroundWorkStatus.status, SURFACED_STATUSES) - ) - ) - .orderBy(desc(backgroundWorkStatus.updatedAt)) - .limit(BACKGROUND_WORK_LIST_LIMIT) - return rows as BackgroundWorkRow[] + .where(and(...conditions)) + .orderBy(desc(backgroundWorkStatus.updatedAt), desc(backgroundWorkStatus.id)) + .limit(limit + 1)) as BackgroundWorkRow[] + + const hasMore = rows.length > limit + const page = rows.slice(0, limit) + const last = page[page.length - 1] + const nextCursor = + hasMore && last ? encodeCursor({ updatedAt: last.updatedAt.toISOString(), id: last.id }) : null + return { rows: page, nextCursor } } /** @@ -232,7 +328,7 @@ export async function reapStaleBackgroundWork(executor: DbOrTx): Promise .returning({ id: backgroundWorkStatus.id }) // Retention: the append-only fork audit trail would otherwise grow forever, so drop - // terminal rows past the retention window. The Activity tab caps display separately. + // terminal rows past the retention window. The Activity tab paginates separately. await executor .delete(backgroundWorkStatus) .where( diff --git a/apps/sim/lib/workspaces/fork/copy/cleanup-failed.test.ts b/apps/sim/ee/workspace-forking/lib/copy/cleanup-failed.test.ts similarity index 98% rename from apps/sim/lib/workspaces/fork/copy/cleanup-failed.test.ts rename to apps/sim/ee/workspace-forking/lib/copy/cleanup-failed.test.ts index 1aa6378e8ed..0139b9c738c 100644 --- a/apps/sim/lib/workspaces/fork/copy/cleanup-failed.test.ts +++ b/apps/sim/ee/workspace-forking/lib/copy/cleanup-failed.test.ts @@ -89,16 +89,16 @@ vi.mock('@/tools/params', () => ({ formatParameterLabel: (label: string) => label, })) +import { getBlock } from '@/blocks/registry' +import type { BlockConfig, SubBlockConfig } from '@/blocks/types' import { clearFailedForkResourceReferences, clearFailedReferencesInDeploymentVersions, clearFailedReferencesInWorkflows, rewriteDeploymentVersionState, -} from '@/lib/workspaces/fork/copy/cleanup-failed' -import type { ForkCopyResolver } from '@/lib/workspaces/fork/remap/fork-bootstrap' -import type { ForkRemapKind } from '@/lib/workspaces/fork/remap/remap-references' -import { getBlock } from '@/blocks/registry' -import type { BlockConfig, SubBlockConfig } from '@/blocks/types' +} from '@/ee/workspace-forking/lib/copy/cleanup-failed' +import type { ForkCopyResolver } from '@/ee/workspace-forking/lib/remap/fork-bootstrap' +import type { ForkRemapKind } from '@/ee/workspace-forking/lib/remap/remap-references' const blockWith = (subBlocks: SubBlockConfig[]): BlockConfig => ({ name: 'Knowledge', description: '', subBlocks, outputs: {} }) as unknown as BlockConfig diff --git a/apps/sim/lib/workspaces/fork/copy/cleanup-failed.ts b/apps/sim/ee/workspace-forking/lib/copy/cleanup-failed.ts similarity index 98% rename from apps/sim/lib/workspaces/fork/copy/cleanup-failed.ts rename to apps/sim/ee/workspace-forking/lib/copy/cleanup-failed.ts index 936a777a82d..dcf3f6ffed8 100644 --- a/apps/sim/lib/workspaces/fork/copy/cleanup-failed.ts +++ b/apps/sim/ee/workspace-forking/lib/copy/cleanup-failed.ts @@ -12,13 +12,13 @@ import { getErrorMessage } from '@sim/utils/errors' import { and, asc, eq, gt, inArray } from 'drizzle-orm' import { isRecord, type SubBlockRecord } from '@/lib/workflows/persistence/remap-internal-ids' import { invalidateDeployedStateCache } from '@/lib/workflows/persistence/utils' -import type { ForkFailedResource } from '@/lib/workspaces/fork/copy/copy-resources' -import type { ForkCopyResolver } from '@/lib/workspaces/fork/remap/fork-bootstrap' +import type { ForkFailedResource } from '@/ee/workspace-forking/lib/copy/copy-resources' +import type { ForkCopyResolver } from '@/ee/workspace-forking/lib/remap/fork-bootstrap' import { clearDependentsOnRemap, type ForkRemapKind, remapForkSubBlocks, -} from '@/lib/workspaces/fork/remap/remap-references' +} from '@/ee/workspace-forking/lib/remap/remap-references' const logger = createLogger('WorkspaceForkCleanupFailed') diff --git a/apps/sim/lib/workspaces/fork/copy/content-copy-runner.test.ts b/apps/sim/ee/workspace-forking/lib/copy/content-copy-runner.test.ts similarity index 92% rename from apps/sim/lib/workspaces/fork/copy/content-copy-runner.test.ts rename to apps/sim/ee/workspace-forking/lib/copy/content-copy-runner.test.ts index 0dea89e5db4..90168d7ac40 100644 --- a/apps/sim/lib/workspaces/fork/copy/content-copy-runner.test.ts +++ b/apps/sim/ee/workspace-forking/lib/copy/content-copy-runner.test.ts @@ -5,9 +5,9 @@ import { describe, expect, it } from 'vitest' import { hasForkContentToCopy, serializeContentRefMaps, -} from '@/lib/workspaces/fork/copy/content-copy-runner' -import type { BlobCopyTask } from '@/lib/workspaces/fork/copy/copy-files' -import type { ForkContentPlan } from '@/lib/workspaces/fork/copy/copy-resources' +} from '@/ee/workspace-forking/lib/copy/content-copy-runner' +import type { BlobCopyTask } from '@/ee/workspace-forking/lib/copy/copy-files' +import type { ForkContentPlan } from '@/ee/workspace-forking/lib/copy/copy-resources' describe('serializeContentRefMaps', () => { it('converts each map to a record and drops empty maps', () => { diff --git a/apps/sim/lib/workspaces/fork/copy/content-copy-runner.ts b/apps/sim/ee/workspace-forking/lib/copy/content-copy-runner.ts similarity index 93% rename from apps/sim/lib/workspaces/fork/copy/content-copy-runner.ts rename to apps/sim/ee/workspace-forking/lib/copy/content-copy-runner.ts index 2a60f33f333..16672fa39cd 100644 --- a/apps/sim/lib/workspaces/fork/copy/content-copy-runner.ts +++ b/apps/sim/ee/workspace-forking/lib/copy/content-copy-runner.ts @@ -3,13 +3,16 @@ import { createLogger } from '@sim/logger' import { getErrorMessage } from '@sim/utils/errors' import { isTriggerDevEnabled } from '@/lib/core/config/env-flags' import { runDetached } from '@/lib/core/utils/background' -import { finishBackgroundWork } from '@/lib/workspaces/fork/background-work/store' -import { clearFailedForkResourceReferences } from '@/lib/workspaces/fork/copy/cleanup-failed' -import type { BlobCopyTask } from '@/lib/workspaces/fork/copy/copy-files' -import { executeForkFileBlobCopies } from '@/lib/workspaces/fork/copy/copy-files' -import type { ForkContentPlan, ForkFailedResource } from '@/lib/workspaces/fork/copy/copy-resources' -import { copyForkResourceContent } from '@/lib/workspaces/fork/copy/copy-resources' -import type { ForkContentRefMaps } from '@/lib/workspaces/fork/remap/remap-content-refs' +import { finishBackgroundWork } from '@/ee/workspace-forking/lib/background-work/store' +import { clearFailedForkResourceReferences } from '@/ee/workspace-forking/lib/copy/cleanup-failed' +import type { BlobCopyTask } from '@/ee/workspace-forking/lib/copy/copy-files' +import { executeForkFileBlobCopies } from '@/ee/workspace-forking/lib/copy/copy-files' +import type { + ForkContentPlan, + ForkFailedResource, +} from '@/ee/workspace-forking/lib/copy/copy-resources' +import { copyForkResourceContent } from '@/ee/workspace-forking/lib/copy/copy-resources' +import type { ForkContentRefMaps } from '@/ee/workspace-forking/lib/remap/remap-content-refs' const logger = createLogger('WorkspaceForkContentCopy') diff --git a/apps/sim/ee/workspace-forking/lib/copy/copy-chats.test.ts b/apps/sim/ee/workspace-forking/lib/copy/copy-chats.test.ts new file mode 100644 index 00000000000..c234ff18847 --- /dev/null +++ b/apps/sim/ee/workspace-forking/lib/copy/copy-chats.test.ts @@ -0,0 +1,153 @@ +/** + * @vitest-environment node + */ +import { describe, expect, it } from 'vitest' +import type { DbOrTx } from '@/lib/db/types' +import { copyForkChatDeployments } from '@/ee/workspace-forking/lib/copy/copy-chats' + +/** + * Sequenced select mock: each `.select().from().where()` resolves the next queued result. + * The chat copy issues (1) source chats, (2) target chat rows, then per identifier attempt + * (3+) the taken-identifier check; inserts are captured. + */ +function makeTx(selectResults: unknown[][]) { + const inserted: Array> = [] + let call = 0 + const tx = { + select: () => ({ + from: () => ({ where: () => Promise.resolve(selectResults[call++] ?? []) }), + }), + insert: () => ({ + values: (values: Array>) => { + inserted.push(...values) + return Promise.resolve() + }, + }), + } + return { tx: tx as unknown as DbOrTx, inserted } +} + +const sourceChat = (overrides: Record = {}) => ({ + id: 'chat-src', + workflowId: 'wf-src', + userId: 'src-user', + identifier: 'original-chat', + title: 'Support Chat', + description: 'desc', + isActive: true, + customizations: { welcomeMessage: 'hi' }, + authType: 'password', + password: 'hashed-secret', + allowedEmails: ['a@b.com'], + outputConfigs: [{ blockId: 'block-src', path: 'content' }], + archivedAt: null, + createdAt: new Date('2026-01-01'), + updatedAt: new Date('2026-01-01'), + ...overrides, +}) + +const pair = { + sourceWorkflowId: 'wf-src', + targetWorkflowId: 'wf-tgt', + workflowName: 'Support Flow', +} + +describe('copyForkChatDeployments', () => { + it('copies a live source chat with a generated identifier and remapped output block ids', async () => { + const { tx, inserted } = makeTx([ + [sourceChat()], + [], // target has no chat rows + [], // no identifier collisions + ]) + const result = await copyForkChatDeployments({ + tx, + pairs: [pair], + targetWorkspaceName: 'My Team WS', + userId: 'user-1', + now: new Date('2026-07-07'), + resolveBlockId: (targetWorkflowId, sourceBlockId) => + `${targetWorkflowId}:${sourceBlockId}:mapped`, + }) + + expect(result.created).toBe(1) + expect(inserted).toHaveLength(1) + const copy = inserted[0] + expect(copy.id).not.toBe('chat-src') + expect(copy.workflowId).toBe('wf-tgt') + expect(copy.userId).toBe('user-1') + // `{workspace}-{workflow}-{randomnum}` in the identifier charset. + expect(copy.identifier).toMatch(/^my-team-ws-support-flow-\d{6}$/) + // Config copies verbatim - auth (hashed password) included. + expect(copy.title).toBe('Support Chat') + expect(copy.authType).toBe('password') + expect(copy.password).toBe('hashed-secret') + expect(copy.allowedEmails).toEqual(['a@b.com']) + // Output configs bind to the target's block ids via the sync's block resolver. + expect(copy.outputConfigs).toEqual([{ blockId: 'wf-tgt:block-src:mapped', path: 'content' }]) + expect(copy.archivedAt).toBeNull() + }) + + it('leaves a target that already has ANY chat row untouched (live or archived - never resurrects)', async () => { + const { tx, inserted } = makeTx([ + [sourceChat()], + [{ workflowId: 'wf-tgt' }], // target already has a chat row + ]) + const result = await copyForkChatDeployments({ + tx, + pairs: [pair], + targetWorkspaceName: 'WS', + userId: 'user-1', + now: new Date(), + resolveBlockId: (_wf, blockId) => blockId, + }) + expect(result.created).toBe(0) + expect(inserted).toHaveLength(0) + }) + + it('never emits duplicate identifiers within a batch (same workspace + workflow slug)', async () => { + const twoChats = makeTx([ + [sourceChat(), sourceChat({ id: 'chat-src-2', identifier: 'other' })], + [], // target has no chat rows + [], // no live-identifier collisions + ]) + const result = await copyForkChatDeployments({ + tx: twoChats.tx, + pairs: [pair], + targetWorkspaceName: 'WS', + userId: 'user-1', + now: new Date(), + resolveBlockId: (_wf, blockId) => blockId, + }) + expect(result.created).toBe(2) + const identifiers = twoChats.inserted.map((row) => row.identifier) + expect(new Set(identifiers).size).toBe(2) + }) + + it('no-ops with no pairs or no live source chats', async () => { + const empty = makeTx([[]]) + expect( + ( + await copyForkChatDeployments({ + tx: empty.tx, + pairs: [pair], + targetWorkspaceName: 'WS', + userId: 'user-1', + now: new Date(), + resolveBlockId: (_wf, blockId) => blockId, + }) + ).created + ).toBe(0) + expect( + ( + await copyForkChatDeployments({ + tx: empty.tx, + pairs: [], + targetWorkspaceName: 'WS', + userId: 'user-1', + now: new Date(), + resolveBlockId: (_wf, blockId) => blockId, + }) + ).created + ).toBe(0) + }) +}) diff --git a/apps/sim/ee/workspace-forking/lib/copy/copy-chats.ts b/apps/sim/ee/workspace-forking/lib/copy/copy-chats.ts new file mode 100644 index 00000000000..bf4eeebe9f4 --- /dev/null +++ b/apps/sim/ee/workspace-forking/lib/copy/copy-chats.ts @@ -0,0 +1,190 @@ +import { chat } from '@sim/db/schema' +import { createLogger } from '@sim/logger' +import { generateId, generateShortId } from '@sim/utils/id' +import { randomInt } from '@sim/utils/random' +import { and, inArray, isNull } from 'drizzle-orm' +import type { DbOrTx } from '@/lib/db/types' +import { isRecord } from '@/lib/workflows/persistence/remap-internal-ids' + +const logger = createLogger('WorkspaceForkCopyChats') + +/** Attempts at a random chat identifier before falling back to a long random suffix. */ +const IDENTIFIER_ATTEMPTS = 5 + +export interface ForkChatCopyPair { + sourceWorkflowId: string + targetWorkflowId: string + /** The target workflow's display name, for the generated chat identifier. */ + workflowName: string +} + +/** Lowercase a display name into the chat identifier charset (`[a-z0-9-]`), bounded. */ +function slugifyForIdentifier(value: string): string { + const slug = value + .toLowerCase() + .replace(/[^a-z0-9]+/g, '-') + .replace(/^-+|-+$/g, '') + .slice(0, 24) + .replace(/-+$/g, '') + return slug || 'chat' +} + +/** + * `{workspace}-{workflow}-{randomnum}` in the identifier charset. Six digits: concurrent forks + * of one parent share the workspace/workflow slugs and can't see each other's uncommitted rows, + * so the number is the only collision guard across simultaneous transactions. + */ +function buildIdentifierCandidate(workspaceSlug: string, workflowName: string): string { + const random = randomInt(100000, 1000000) + return `${workspaceSlug}-${slugifyForIdentifier(workflowName)}-${random}` +} + +/** Remap each output config's `blockId` onto the target workflow's block ids. */ +function remapChatOutputConfigs( + value: unknown, + targetWorkflowId: string, + resolveBlockId: (targetWorkflowId: string, sourceBlockId: string) => string +): unknown { + if (!Array.isArray(value)) return value + return value.map((entry) => { + if (!isRecord(entry) || typeof entry.blockId !== 'string') return entry + return { ...entry, blockId: resolveBlockId(targetWorkflowId, entry.blockId) } + }) +} + +/** + * Carry chat deployments onto the target side of a fork or sync: each LIVE source chat whose + * target workflow has NO chat row at all (live or archived) is copied with a freshly generated + * identifier - `{target-workspace}-{workflow}-{randomnum}` - so the copy serves at its own URL + * immediately once the workflow deploys. Config copies verbatim (title, customizations, auth + * incl. the hashed password and allowed emails); `outputConfigs` block ids are remapped through + * the SAME block-id resolver the workflow write used, so the outputs bind to the target's + * blocks. + * + * Targets with ANY existing chat row are left completely untouched ("maintained"): an already + * carried-over chat keeps its identifier and config on every subsequent sync, and a chat the + * target side deliberately archived is never resurrected. Bounded by the synced workflow count; + * identifiers are collision-checked against live chats and fall back to a long random suffix. + */ +export async function copyForkChatDeployments(params: { + tx: DbOrTx + pairs: ForkChatCopyPair[] + /** The TARGET workspace's display name, the identifier's first segment. */ + targetWorkspaceName: string + userId: string + now: Date + resolveBlockId: (targetWorkflowId: string, sourceBlockId: string) => string + requestId?: string +}): Promise<{ created: number }> { + const { tx, pairs, targetWorkspaceName, userId, now, resolveBlockId, requestId } = params + if (pairs.length === 0) return { created: 0 } + + const pairBySource = new Map(pairs.map((pair) => [pair.sourceWorkflowId, pair])) + const sourceChats = await tx + .select() + .from(chat) + .where(and(inArray(chat.workflowId, [...pairBySource.keys()]), isNull(chat.archivedAt))) + if (sourceChats.length === 0) return { created: 0 } + + // A target workflow with ANY chat row (live or archived) keeps it: live means the carry-over + // already happened (or the target made its own); archived means the target deliberately + // retired it - recreating would resurrect against their intent. + const candidateTargetIds = [ + ...new Set( + sourceChats + .map((row) => pairBySource.get(row.workflowId)?.targetWorkflowId) + .filter((id): id is string => Boolean(id)) + ), + ] + const existingTargetRows = await tx + .select({ workflowId: chat.workflowId }) + .from(chat) + .where(inArray(chat.workflowId, candidateTargetIds)) + const targetsWithChat = new Set(existingTargetRows.map((row) => row.workflowId)) + + const toCopy = sourceChats.filter((row) => { + const pair = pairBySource.get(row.workflowId) + return pair && !targetsWithChat.has(pair.targetWorkflowId) + }) + if (toCopy.length === 0) return { created: 0 } + + // Generate identifiers, retrying collisions against LIVE chats (the unique index is partial + // on `archived_at IS NULL`, so archived identifiers are reusable) and against this batch. + const workspaceSlug = slugifyForIdentifier(targetWorkspaceName) + const identifierByChatId = new Map() + let pending = toCopy.map((row) => ({ + chatId: row.id, + workflowName: pairBySource.get(row.workflowId)?.workflowName ?? 'chat', + })) + for (let attempt = 0; attempt < IDENTIFIER_ATTEMPTS && pending.length > 0; attempt++) { + const claimed = new Set(identifierByChatId.values()) + const candidates = pending.map((entry) => { + let candidate = buildIdentifierCandidate(workspaceSlug, entry.workflowName) + while (claimed.has(candidate)) { + candidate = buildIdentifierCandidate(workspaceSlug, entry.workflowName) + } + claimed.add(candidate) + return { ...entry, candidate } + }) + const taken = new Set( + ( + await tx + .select({ identifier: chat.identifier }) + .from(chat) + .where( + and( + inArray( + chat.identifier, + candidates.map((entry) => entry.candidate) + ), + isNull(chat.archivedAt) + ) + ) + ).map((row) => row.identifier) + ) + pending = [] + for (const entry of candidates) { + if (taken.has(entry.candidate)) pending.push(entry) + else identifierByChatId.set(entry.chatId, entry.candidate) + } + } + for (const entry of pending) { + // Exhausted the friendly attempts: a long random suffix is effectively collision-free + // (the global unique index still backstops it). + identifierByChatId.set( + entry.chatId, + `${workspaceSlug}-${slugifyForIdentifier(entry.workflowName)}-${generateShortId(10) + .toLowerCase() + .replace(/[^a-z0-9]/g, '0')}` + ) + } + + const inserts: (typeof chat.$inferInsert)[] = [] + for (const row of toCopy) { + const pair = pairBySource.get(row.workflowId) + const identifier = identifierByChatId.get(row.id) + if (!pair || !identifier) continue + inserts.push({ + ...row, + id: generateId(), + workflowId: pair.targetWorkflowId, + userId, + identifier, + outputConfigs: remapChatOutputConfigs( + row.outputConfigs, + pair.targetWorkflowId, + resolveBlockId + ), + archivedAt: null, + createdAt: now, + updatedAt: now, + }) + } + if (inserts.length > 0) { + await tx.insert(chat).values(inserts) + logger.info(`[${requestId ?? 'unknown'}] Carried ${inserts.length} chat deployment(s)`, { + identifiers: inserts.map((row) => row.identifier), + }) + } + return { created: inserts.length } +} diff --git a/apps/sim/lib/workspaces/fork/copy/copy-files.test.ts b/apps/sim/ee/workspace-forking/lib/copy/copy-files.test.ts similarity index 99% rename from apps/sim/lib/workspaces/fork/copy/copy-files.test.ts rename to apps/sim/ee/workspace-forking/lib/copy/copy-files.test.ts index e0b5c3c0e58..66a2f36f8a0 100644 --- a/apps/sim/lib/workspaces/fork/copy/copy-files.test.ts +++ b/apps/sim/ee/workspace-forking/lib/copy/copy-files.test.ts @@ -24,7 +24,7 @@ import { type BlobCopyTask, executeForkFileBlobCopies, planForkFileCopies, -} from '@/lib/workspaces/fork/copy/copy-files' +} from '@/ee/workspace-forking/lib/copy/copy-files' function makeTask(overrides: Partial = {}): BlobCopyTask { return { diff --git a/apps/sim/lib/workspaces/fork/copy/copy-files.ts b/apps/sim/ee/workspace-forking/lib/copy/copy-files.ts similarity index 99% rename from apps/sim/lib/workspaces/fork/copy/copy-files.ts rename to apps/sim/ee/workspace-forking/lib/copy/copy-files.ts index 828aa16513a..e5f060786ba 100644 --- a/apps/sim/lib/workspaces/fork/copy/copy-files.ts +++ b/apps/sim/ee/workspace-forking/lib/copy/copy-files.ts @@ -12,7 +12,7 @@ import { MAX_FILE_SIZE } from '@/lib/uploads/utils/validation' import { type ForkContentRefMaps, rewriteForkContentRefs, -} from '@/lib/workspaces/fork/remap/remap-content-refs' +} from '@/ee/workspace-forking/lib/remap/remap-content-refs' const logger = createLogger('WorkspaceForkCopyFiles') diff --git a/apps/sim/lib/workspaces/fork/copy/copy-resources.test.ts b/apps/sim/ee/workspace-forking/lib/copy/copy-resources.test.ts similarity index 86% rename from apps/sim/lib/workspaces/fork/copy/copy-resources.test.ts rename to apps/sim/ee/workspace-forking/lib/copy/copy-resources.test.ts index e33be42700f..1d2af612ff2 100644 --- a/apps/sim/lib/workspaces/fork/copy/copy-resources.test.ts +++ b/apps/sim/ee/workspace-forking/lib/copy/copy-resources.test.ts @@ -26,8 +26,8 @@ import { copyForkResourceContent, type ForkContentPlan, planForkMappedKbDocumentCopies, -} from '@/lib/workspaces/fork/copy/copy-resources' -import type { ForkReferenceResolver } from '@/lib/workspaces/fork/remap/remap-references' +} from '@/ee/workspace-forking/lib/copy/copy-resources' +import type { ForkReferenceResolver } from '@/ee/workspace-forking/lib/remap/remap-references' function basePlan(overrides: Partial = {}): ForkContentPlan { return { @@ -277,6 +277,7 @@ describe('copyForkResourceContainers custom-tool code env rewrite', () => { const customToolSelection = { customTools: ['ct-1'], skills: [], + mcpServers: [], workflowMcpServers: [], tables: [], knowledgeBases: [], @@ -319,6 +320,87 @@ describe('copyForkResourceContainers custom-tool code env rewrite', () => { }) }) +describe('copyForkResourceContainers external MCP server copy', () => { + function makeServerTx(rows: Array>) { + const inserted: Array> = [] + const tx = { + select: () => ({ from: () => ({ where: () => Promise.resolve(rows) }) }), + insert: () => ({ + values: (values: Array>) => { + inserted.push(...values) + return Promise.resolve() + }, + }), + } + return { tx: tx as unknown as DbOrTx, inserted } + } + + it('copies the config row with runtime status reset, records the mapping, and never copies tokens', async () => { + const { tx, inserted } = makeServerTx([ + { + id: 'mcp-1', + workspaceId: 'src-ws', + createdBy: 'src-user', + name: 'Linear MCP', + transport: 'streamable-http', + url: 'https://mcp.linear.app/mcp', + authType: 'headers', + headers: { Authorization: 'Bearer {{LINEAR_KEY}}' }, + connectionStatus: 'connected', + lastConnected: new Date(), + lastError: 'old error', + statusConfig: { consecutiveFailures: 2, lastSuccessfulDiscovery: 'x' }, + toolCount: 12, + lastToolsRefresh: new Date(), + totalRequests: 99, + lastUsed: new Date(), + deletedAt: null, + }, + ]) + + const result = await copyForkResourceContainers({ + tx, + sourceWorkspaceId: 'src-ws', + childWorkspaceId: 'child-ws', + userId: 'user-1', + now: new Date(), + selection: { + customTools: [], + skills: [], + mcpServers: ['mcp-1'], + workflowMcpServers: [], + tables: [], + knowledgeBases: [], + }, + workflowIdMap: new Map(), + }) + + expect(inserted).toHaveLength(1) + const child = inserted[0] + expect(child.id).not.toBe('mcp-1') + expect(child.workspaceId).toBe('child-ws') + expect(child.createdBy).toBe('user-1') + // Config copies verbatim - url/headers ({{ENV}} refs resolve against the child's env). + expect(child.url).toBe('https://mcp.linear.app/mcp') + expect(child.headers).toEqual({ Authorization: 'Bearer {{LINEAR_KEY}}' }) + // Runtime status resets: tools re-discover on first use in the child (cache is + // workspace-keyed), and no `mcp_server_oauth` row is ever inserted (re-auth required). + expect(child.connectionStatus).toBe('disconnected') + expect(child.lastConnected).toBeNull() + expect(child.lastError).toBeNull() + expect(child.toolCount).toBe(0) + expect(child.lastToolsRefresh).toBeNull() + // The id map + mapping rows record the copy so subblock references remap onto it. + expect(result.idMap.get('mcp_server')?.get('mcp-1')).toBe(child.id) + expect(result.mappingEntries).toContainEqual({ + resourceType: 'mcp_server', + parentResourceId: 'mcp-1', + childResourceId: child.id, + }) + expect(result.names.mcpServers).toEqual(['Linear MCP']) + }) +}) + describe('copyForkResourceContainers skill copy', () => { function makeSkillTx(rows: Array>) { const inserted: Array> = [] @@ -337,6 +419,7 @@ describe('copyForkResourceContainers skill copy', () => { const skillSelection = { customTools: [], skills: ['sk-1'], + mcpServers: [], workflowMcpServers: [], tables: [], knowledgeBases: [], @@ -402,6 +485,7 @@ describe('copyForkResourceContainers knowledge-base tag definitions', () => { const kbSelection = { customTools: [], skills: [], + mcpServers: [], workflowMcpServers: [], tables: [], knowledgeBases: ['kb-1'], diff --git a/apps/sim/lib/workspaces/fork/copy/copy-resources.ts b/apps/sim/ee/workspace-forking/lib/copy/copy-resources.ts similarity index 91% rename from apps/sim/lib/workspaces/fork/copy/copy-resources.ts rename to apps/sim/ee/workspace-forking/lib/copy/copy-resources.ts index a6b3779c4ce..31151be46b0 100644 --- a/apps/sim/lib/workspaces/fork/copy/copy-resources.ts +++ b/apps/sim/ee/workspace-forking/lib/copy/copy-resources.ts @@ -5,6 +5,7 @@ import { embedding, knowledgeBase, knowledgeBaseTagDefinitions, + mcpServers, skill, userTableDefinitions, userTableRows, @@ -24,18 +25,18 @@ import { isRecord } from '@/lib/workflows/persistence/remap-internal-ids' import type { ForkMappingUpsert, ForkResourceType, -} from '@/lib/workspaces/fork/mapping/mapping-store' -import type { ForkBlockIdResolver } from '@/lib/workspaces/fork/remap/block-identity' +} from '@/ee/workspace-forking/lib/mapping/mapping-store' +import type { ForkBlockIdResolver } from '@/ee/workspace-forking/lib/remap/block-identity' import { type ForkContentRefMaps, rewriteForkContentRefs, rewriteForkResourceUrls, -} from '@/lib/workspaces/fork/remap/remap-content-refs' +} from '@/ee/workspace-forking/lib/remap/remap-content-refs' import { type ForkReferenceResolver, rewriteEnvRefsInText, -} from '@/lib/workspaces/fork/remap/remap-references' -import { remapForkTableWorkflowGroups } from '@/lib/workspaces/fork/remap/remap-table-groups' +} from '@/ee/workspace-forking/lib/remap/remap-references' +import { remapForkTableWorkflowGroups } from '@/ee/workspace-forking/lib/remap/remap-table-groups' const logger = createLogger('WorkspaceForkCopyResources') @@ -66,6 +67,8 @@ export interface CopyResourcesParams { selection: { customTools: string[] skills: string[] + /** External MCP servers, copied as config rows (fork-only; sync resolves them by mapping). */ + mcpServers: string[] workflowMcpServers: string[] tables: string[] knowledgeBases: string[] @@ -175,6 +178,7 @@ export interface ForkCopiedResourceNames { knowledgeBases: string[] customTools: string[] skills: string[] + mcpServers: string[] workflowMcpServers: string[] } @@ -239,6 +243,7 @@ export async function copyForkResourceContainers( knowledgeBases: [], customTools: [], skills: [], + mcpServers: [], workflowMcpServers: [], } @@ -322,6 +327,64 @@ export async function copyForkResourceContainers( if (inserts.length > 0) await tx.insert(skill).values(inserts) } + if (selection.mcpServers.length > 0) { + const rows = await tx + .select() + .from(mcpServers) + .where( + and( + inArray(mcpServers.id, selection.mcpServers), + eq(mcpServers.workspaceId, sourceWorkspaceId), + isNull(mcpServers.deletedAt) + ) + ) + // Copy external MCP servers as CONFIG rows: transport/url/headers (and pre-registered OAuth + // client info) verbatim - the forking admin can already read them in the source. OAuth + // tokens (`mcp_server_oauth`) are never copied: an oauth-auth server lands disconnected in + // the child until re-authorized. Runtime status resets to a clean slate - the tool cache is + // workspace-keyed, so the child's first tool-selector open / execution re-discovers tools + // fresh; subblock tool SELECTIONS remap onto the copied server id (tool names carry over). + // `{{ENV}}` refs in the url/headers are rewritten through the env-name resolver when a sync + // renames an env var (fork passes no resolver - names preserve verbatim), mirroring the + // custom-tool `code` rewrite. + const rewriteEnv = (value: string): string => + resolveEnvName ? rewriteEnvRefsInText(value, resolveEnvName) : value + const inserts: (typeof mcpServers.$inferInsert)[] = [] + for (const row of rows) { + const childId = generateId() + const headers = isRecord(row.headers) + ? Object.fromEntries( + Object.entries(row.headers).map(([key, value]) => [ + key, + typeof value === 'string' ? rewriteEnv(value) : value, + ]) + ) + : row.headers + inserts.push({ + ...row, + id: childId, + workspaceId: childWorkspaceId, + createdBy: userId, + url: typeof row.url === 'string' ? rewriteEnv(row.url) : row.url, + headers, + connectionStatus: 'disconnected', + lastConnected: null, + lastError: null, + statusConfig: { consecutiveFailures: 0, lastSuccessfulDiscovery: null }, + toolCount: 0, + lastToolsRefresh: null, + totalRequests: 0, + lastUsed: null, + deletedAt: null, + createdAt: now, + updatedAt: now, + }) + record('mcp_server', row.id, childId) + names.mcpServers.push(row.name) + } + if (inserts.length > 0) await tx.insert(mcpServers).values(inserts) + } + if (selection.workflowMcpServers.length > 0) { const rows = await tx .select() @@ -334,20 +397,23 @@ export async function copyForkResourceContainers( ) ) // Copy workflow-publishing MCP servers as config-only shells: the server definition - // (name/description/visibility) with NO `workflow_mcp_tool` rows attached, so the child - // re-registers its own workflows. These are fork-copy-only (not referenced by subblocks), - // so they are not recorded in the fork resource map. + // (name/description/visibility) with NO `workflow_mcp_tool` rows attached - the child's + // attachments are seeded by the chat/attachment carry-over and re-derived on deploy. The + // shell copy IS recorded in the fork resource map (`workflow_mcp_server` identity), so a + // later sync can mirror `workflow_mcp_tool` attachments onto the mapped counterpart. const inserts: (typeof workflowMcpServer.$inferInsert)[] = [] for (const row of rows) { + const childId = generateId() inserts.push({ ...row, - id: generateId(), + id: childId, workspaceId: childWorkspaceId, createdBy: userId, deletedAt: null, createdAt: now, updatedAt: now, }) + record('workflow_mcp_server', row.id, childId) names.workflowMcpServers.push(row.name) } if (inserts.length > 0) await tx.insert(workflowMcpServer).values(inserts) diff --git a/apps/sim/lib/workspaces/fork/copy/copy-workflows.test.ts b/apps/sim/ee/workspace-forking/lib/copy/copy-workflows.test.ts similarity index 99% rename from apps/sim/lib/workspaces/fork/copy/copy-workflows.test.ts rename to apps/sim/ee/workspace-forking/lib/copy/copy-workflows.test.ts index 74b7ade28f9..88d22a908bf 100644 --- a/apps/sim/lib/workspaces/fork/copy/copy-workflows.test.ts +++ b/apps/sim/ee/workspace-forking/lib/copy/copy-workflows.test.ts @@ -16,7 +16,7 @@ import { buildWorkflowNameRegistry, copyWorkflowStateIntoTarget, resolveForkFolderMapping, -} from '@/lib/workspaces/fork/copy/copy-workflows' +} from '@/ee/workspace-forking/lib/copy/copy-workflows' describe('buildWorkflowNameRegistry', () => { it('reports a name as taken by another workflow in the same folder', () => { diff --git a/apps/sim/lib/workspaces/fork/copy/copy-workflows.ts b/apps/sim/ee/workspace-forking/lib/copy/copy-workflows.ts similarity index 94% rename from apps/sim/lib/workspaces/fork/copy/copy-workflows.ts rename to apps/sim/ee/workspace-forking/lib/copy/copy-workflows.ts index f1d7be3ecbb..ca6f476c85c 100644 --- a/apps/sim/lib/workspaces/fork/copy/copy-workflows.ts +++ b/apps/sim/ee/workspace-forking/lib/copy/copy-workflows.ts @@ -15,12 +15,12 @@ import { saveWorkflowToNormalizedTables } from '@/lib/workflows/persistence/util import { deriveForkBlockId, type ForkBlockIdResolver, -} from '@/lib/workspaces/fork/remap/block-identity' +} from '@/ee/workspace-forking/lib/remap/block-identity' import { applyDependentOverrides, collectClearedDependents, type NeedsConfigurationField, -} from '@/lib/workspaces/fork/remap/remap-references' +} from '@/ee/workspace-forking/lib/remap/remap-references' import type { BlockData, BlockState, @@ -318,6 +318,13 @@ export interface CopyWorkflowStateParams { description: string | null folderId: string | null sortOrder: number + /** + * Whether the source's deployed API is public (unauthenticated). Carried onto sync targets + * so a public source stays public after push/pull - the target org's own access-control + * gate (`validatePublicApiAllowed`) still applies at execution. Omitted at fork-create: + * the child starts undeployed and private (going public is an explicit act there). + */ + isPublicApi?: boolean } /** source workflow id -> target workflow id, for `workflow-selector` references */ workflowIdMap: Map @@ -464,7 +471,15 @@ export async function copyWorkflowStateIntoTarget( // source carried but the target never set isn't flagged. if (mode === 'replace' && targetCurrent) { clearedDependents.push( - ...collectClearedDependents(block.type, newBlockId, block.name, targetCurrent, subBlocks) + ...collectClearedDependents( + block.type, + newBlockId, + block.name, + targetCurrent, + subBlocks, + (block.data as { canonicalModes?: Record } | undefined) + ?.canonicalModes + ) ) } @@ -553,6 +568,9 @@ export async function copyWorkflowStateIntoTarget( runCount: 0, locked: false, variables: remappedVariables, + // Deployment visibility follows the source on sync (a public source stays public in + // the target); fork-create omits the field, so the child starts private. + ...(sourceMeta.isPublicApi !== undefined ? { isPublicApi: sourceMeta.isPublicApi } : {}), }) } else { await tx @@ -564,6 +582,7 @@ export async function copyWorkflowStateIntoTarget( variables: remappedVariables, lastSynced: now, updatedAt: now, + ...(sourceMeta.isPublicApi !== undefined ? { isPublicApi: sourceMeta.isPublicApi } : {}), }) .where(eq(workflow.id, targetWorkflowId)) } diff --git a/apps/sim/lib/workspaces/fork/copy/deploy-bridge.ts b/apps/sim/ee/workspace-forking/lib/copy/deploy-bridge.ts similarity index 97% rename from apps/sim/lib/workspaces/fork/copy/deploy-bridge.ts rename to apps/sim/ee/workspace-forking/lib/copy/deploy-bridge.ts index 01c2aaedd23..9c7ab55c0dc 100644 --- a/apps/sim/lib/workspaces/fork/copy/deploy-bridge.ts +++ b/apps/sim/ee/workspace-forking/lib/copy/deploy-bridge.ts @@ -4,7 +4,7 @@ import { createLogger } from '@sim/logger' import { and, eq, exists, inArray, isNull, sql } from 'drizzle-orm' import type { DbOrTx } from '@/lib/db/types' import { loadDeployedWorkflowState } from '@/lib/workflows/persistence/utils' -import { ForkError } from '@/lib/workspaces/fork/lineage/authz' +import { ForkError } from '@/ee/workspace-forking/lib/lineage/authz' import type { Variable, WorkflowState } from '@/stores/workflows/workflow/types' const logger = createLogger('WorkspaceForkDeployBridge') @@ -26,6 +26,8 @@ export interface DeployedWorkflowSummary { description: string | null folderId: string | null sortOrder: number + /** Whether the deployed API accepts unauthenticated calls; carried onto sync targets. */ + isPublicApi: boolean } /** @@ -48,6 +50,7 @@ export async function listDeployedWorkflows( description: workflow.description, folderId: workflow.folderId, sortOrder: workflow.sortOrder, + isPublicApi: workflow.isPublicApi, }) .from(workflow) .where( diff --git a/apps/sim/lib/workspaces/fork/copy/storage-quota.test.ts b/apps/sim/ee/workspace-forking/lib/copy/storage-quota.test.ts similarity index 95% rename from apps/sim/lib/workspaces/fork/copy/storage-quota.test.ts rename to apps/sim/ee/workspace-forking/lib/copy/storage-quota.test.ts index 04f0ef050f5..6c02154b2e1 100644 --- a/apps/sim/lib/workspaces/fork/copy/storage-quota.test.ts +++ b/apps/sim/ee/workspace-forking/lib/copy/storage-quota.test.ts @@ -15,7 +15,7 @@ vi.mock('@/lib/billing/storage', () => ({ * Minimal stand-in for the domain error so this unit test never loads the authz module's * billing/feature-flag import chain. Shape-compatible with the real `ForkError`. */ -vi.mock('@/lib/workspaces/fork/lineage/authz', () => ({ +vi.mock('@/ee/workspace-forking/lib/lineage/authz', () => ({ ForkError: class ForkError extends Error { statusCode: number constructor(message: string, statusCode = 400) { @@ -30,8 +30,8 @@ import type { DbOrTx } from '@/lib/db/types' import { assertForkStorageHeadroom, sumForkCopyBytes, -} from '@/lib/workspaces/fork/copy/storage-quota' -import { ForkError } from '@/lib/workspaces/fork/lineage/authz' +} from '@/ee/workspace-forking/lib/copy/storage-quota' +import { ForkError } from '@/ee/workspace-forking/lib/lineage/authz' /** * Fake executor resolving one aggregate row per query, in call order. Supports both sum diff --git a/apps/sim/lib/workspaces/fork/copy/storage-quota.ts b/apps/sim/ee/workspace-forking/lib/copy/storage-quota.ts similarity index 98% rename from apps/sim/lib/workspaces/fork/copy/storage-quota.ts rename to apps/sim/ee/workspace-forking/lib/copy/storage-quota.ts index 91a250f1b5d..12ab6e800a5 100644 --- a/apps/sim/lib/workspaces/fork/copy/storage-quota.ts +++ b/apps/sim/ee/workspace-forking/lib/copy/storage-quota.ts @@ -2,7 +2,7 @@ import { document, knowledgeBase, workspaceFiles } from '@sim/db/schema' import { and, eq, inArray, isNotNull, isNull, or, sql } from 'drizzle-orm' import { checkStorageQuota } from '@/lib/billing/storage' import type { DbOrTx } from '@/lib/db/types' -import { ForkError } from '@/lib/workspaces/fork/lineage/authz' +import { ForkError } from '@/ee/workspace-forking/lib/lineage/authz' /** Resource ids whose blob bytes a fork/sync copy would duplicate into the target. */ export interface ForkCopyBytesSelection { diff --git a/apps/sim/lib/workspaces/fork/copy/workflow-id-map.test.ts b/apps/sim/ee/workspace-forking/lib/copy/workflow-id-map.test.ts similarity index 94% rename from apps/sim/lib/workspaces/fork/copy/workflow-id-map.test.ts rename to apps/sim/ee/workspace-forking/lib/copy/workflow-id-map.test.ts index b0fb5f7a963..75faf014b89 100644 --- a/apps/sim/lib/workspaces/fork/copy/workflow-id-map.test.ts +++ b/apps/sim/ee/workspace-forking/lib/copy/workflow-id-map.test.ts @@ -2,7 +2,7 @@ * @vitest-environment node */ import { describe, expect, it } from 'vitest' -import { buildForkWorkflowIdMap } from '@/lib/workspaces/fork/copy/workflow-id-map' +import { buildForkWorkflowIdMap } from '@/ee/workspace-forking/lib/copy/workflow-id-map' describe('buildForkWorkflowIdMap', () => { const sequentialIds = () => { diff --git a/apps/sim/lib/workspaces/fork/copy/workflow-id-map.ts b/apps/sim/ee/workspace-forking/lib/copy/workflow-id-map.ts similarity index 100% rename from apps/sim/lib/workspaces/fork/copy/workflow-id-map.ts rename to apps/sim/ee/workspace-forking/lib/copy/workflow-id-map.ts diff --git a/apps/sim/ee/workspace-forking/lib/copy/workflow-mcp-attachments.test.ts b/apps/sim/ee/workspace-forking/lib/copy/workflow-mcp-attachments.test.ts new file mode 100644 index 00000000000..392cef66340 --- /dev/null +++ b/apps/sim/ee/workspace-forking/lib/copy/workflow-mcp-attachments.test.ts @@ -0,0 +1,224 @@ +/** + * @vitest-environment node + */ +import { describe, expect, it, vi } from 'vitest' + +const { mockGetEdgeMappingRows, mockAcquireLock } = vi.hoisted(() => ({ + mockGetEdgeMappingRows: vi.fn(), + mockAcquireLock: vi.fn(), +})) + +vi.mock('@/ee/workspace-forking/lib/mapping/mapping-store', () => ({ + getEdgeMappingRows: mockGetEdgeMappingRows, +})) +vi.mock('@/lib/mcp/server-locks', () => ({ + acquireWorkflowMcpServerLock: mockAcquireLock, +})) + +import type { DbOrTx } from '@/lib/db/types' +import { + copyForkWorkflowMcpAttachments, + reconcileForkWorkflowMcpAttachments, +} from '@/ee/workspace-forking/lib/copy/workflow-mcp-attachments' + +/** Sequenced select mock + captured inserts/updates. */ +function makeTx(selectResults: unknown[][]) { + const inserted: Array> = [] + const updates: Array> = [] + let call = 0 + const select = vi.fn(() => ({ + from: () => ({ where: () => Promise.resolve(selectResults[call++] ?? []) }), + })) + const tx = { + select, + insert: () => ({ + values: (values: Array>) => { + inserted.push(...values) + return Promise.resolve() + }, + }), + update: () => ({ + set: (set: Record) => ({ + where: () => { + updates.push(set) + return Promise.resolve() + }, + }), + }), + } + return { tx: tx as unknown as DbOrTx, inserted, updates, select } +} + +const attachment = (overrides: Record = {}) => ({ + serverId: 'srv-src', + workflowId: 'wf-src', + toolName: 'run_support_flow', + toolDescription: 'Runs the support flow', + parameterSchema: { type: 'object', properties: {} }, + parameterDescriptionOverrides: {}, + ...overrides, +}) + +const serverMappingRow = { + id: 'map-1', + childWorkspaceId: 'child-ws', + resourceType: 'workflow_mcp_server' as const, + parentResourceId: 'srv-parent', + childResourceId: 'srv-child', +} + +describe('reconcileForkWorkflowMcpAttachments', () => { + it('creates the target attachment for a mapped server + written pair (push: child -> parent)', async () => { + mockGetEdgeMappingRows.mockResolvedValue([serverMappingRow]) + mockAcquireLock.mockClear() + const { tx, inserted, select } = makeTx([ + [{ id: 'srv-child' }, { id: 'srv-parent' }], // both mapped servers still live + [attachment({ serverId: 'srv-child', workflowId: 'wf-child' })], + [], // no existing target attachments + ]) + const result = await reconcileForkWorkflowMcpAttachments({ + tx, + childWorkspaceId: 'child-ws', + sourceIsParent: false, // push: source is the child + now: new Date(), + writtenPairs: [{ sourceWorkflowId: 'wf-child', targetWorkflowId: 'wf-parent' }], + }) + expect(inserted).toHaveLength(1) + expect(inserted[0]).toMatchObject({ + serverId: 'srv-parent', + workflowId: 'wf-parent', + toolName: 'run_support_flow', + }) + expect(result.affectedServerIds).toEqual(['srv-parent']) + expect(mockAcquireLock).toHaveBeenCalledWith(tx, 'srv-parent') + // The lock must precede every read: locking after the diff is computed would let a + // concurrent attach commit in between and abort the promote on the unique constraint. + expect(mockAcquireLock.mock.invocationCallOrder[0]).toBeLessThan( + select.mock.invocationCallOrder[0] + ) + }) + + it('archives a target attachment whose source counterpart was detached', async () => { + mockGetEdgeMappingRows.mockResolvedValue([serverMappingRow]) + const { tx, inserted, updates } = makeTx([ + [{ id: 'srv-child' }, { id: 'srv-parent' }], // both mapped servers still live + [], // source has no attachments left + [ + { + id: 'tool-tgt', + serverId: 'srv-parent', + workflowId: 'wf-parent', + toolName: 'run_support_flow', + toolDescription: null, + parameterDescriptionOverrides: {}, + }, + ], + ]) + const result = await reconcileForkWorkflowMcpAttachments({ + tx, + childWorkspaceId: 'child-ws', + sourceIsParent: false, + now: new Date(), + writtenPairs: [{ sourceWorkflowId: 'wf-child', targetWorkflowId: 'wf-parent' }], + }) + expect(inserted).toHaveLength(0) + expect(updates).toHaveLength(1) + expect(updates[0].archivedAt).toBeInstanceOf(Date) + expect(result.affectedServerIds).toEqual(['srv-parent']) + }) + + it('refreshes drifted metadata on an existing target attachment', async () => { + mockGetEdgeMappingRows.mockResolvedValue([serverMappingRow]) + const { tx, updates } = makeTx([ + [{ id: 'srv-child' }, { id: 'srv-parent' }], // both mapped servers still live + [attachment({ serverId: 'srv-child', workflowId: 'wf-child', toolName: 'renamed_tool' })], + [ + { + id: 'tool-tgt', + serverId: 'srv-parent', + workflowId: 'wf-parent', + toolName: 'run_support_flow', + toolDescription: 'Runs the support flow', + parameterDescriptionOverrides: {}, + }, + ], + ]) + await reconcileForkWorkflowMcpAttachments({ + tx, + childWorkspaceId: 'child-ws', + sourceIsParent: false, + now: new Date(), + writtenPairs: [{ sourceWorkflowId: 'wf-child', targetWorkflowId: 'wf-parent' }], + }) + expect(updates).toHaveLength(1) + expect(updates[0].toolName).toBe('renamed_tool') + }) + + it('skips a mapped pair whose target server was deleted (stale identity row must never FK-crash the sync)', async () => { + mockGetEdgeMappingRows.mockResolvedValue([serverMappingRow]) + const { tx, inserted } = makeTx([ + [{ id: 'srv-child' }], // target server srv-parent hard-deleted: only the source is live + ]) + const result = await reconcileForkWorkflowMcpAttachments({ + tx, + childWorkspaceId: 'child-ws', + sourceIsParent: false, + now: new Date(), + writtenPairs: [{ sourceWorkflowId: 'wf-child', targetWorkflowId: 'wf-parent' }], + }) + expect(inserted).toHaveLength(0) + expect(result.affectedServerIds).toEqual([]) + }) + + it('no-ops with no mapped servers (attachments follow the server identity)', async () => { + mockGetEdgeMappingRows.mockResolvedValue([ + { ...serverMappingRow, resourceType: 'table' as const }, + ]) + const { tx, inserted } = makeTx([]) + const result = await reconcileForkWorkflowMcpAttachments({ + tx, + childWorkspaceId: 'child-ws', + sourceIsParent: false, + now: new Date(), + writtenPairs: [{ sourceWorkflowId: 'wf-child', targetWorkflowId: 'wf-parent' }], + }) + expect(inserted).toHaveLength(0) + expect(result.affectedServerIds).toEqual([]) + }) +}) + +describe('copyForkWorkflowMcpAttachments', () => { + it('copies an attachment only when BOTH its server and workflow were copied', async () => { + const { tx, inserted } = makeTx([ + [ + attachment(), // both mapped + attachment({ serverId: 'srv-uncopied', workflowId: 'wf-src' }), + attachment({ serverId: 'srv-src', workflowId: 'wf-uncopied' }), + ], + ]) + const result = await copyForkWorkflowMcpAttachments({ + tx, + serverIdMap: new Map([['srv-src', 'srv-copy']]), + workflowIdMap: new Map([['wf-src', 'wf-copy']]), + now: new Date(), + }) + expect(result.copied).toBe(1) + expect(inserted[0]).toMatchObject({ + serverId: 'srv-copy', + workflowId: 'wf-copy', + toolName: 'run_support_flow', + }) + }) + + it('no-ops when either id map is empty', async () => { + const { tx, inserted } = makeTx([]) + const result = await copyForkWorkflowMcpAttachments({ + tx, + serverIdMap: new Map(), + workflowIdMap: new Map([['wf-src', 'wf-copy']]), + now: new Date(), + }) + expect(result.copied).toBe(0) + expect(inserted).toHaveLength(0) + }) +}) diff --git a/apps/sim/ee/workspace-forking/lib/copy/workflow-mcp-attachments.ts b/apps/sim/ee/workspace-forking/lib/copy/workflow-mcp-attachments.ts new file mode 100644 index 00000000000..2a5168dfa47 --- /dev/null +++ b/apps/sim/ee/workspace-forking/lib/copy/workflow-mcp-attachments.ts @@ -0,0 +1,296 @@ +import { workflowMcpServer, workflowMcpTool } from '@sim/db/schema' +import { generateId } from '@sim/utils/id' +import { and, eq, inArray, isNull } from 'drizzle-orm' +import type { DbOrTx } from '@/lib/db/types' +import { acquireWorkflowMcpServerLock } from '@/lib/mcp/server-locks' +import { validateMcpToolMetadataForStorage } from '@/lib/mcp/tool-limits' +import { getEdgeMappingRows } from '@/ee/workspace-forking/lib/mapping/mapping-store' + +/** + * The seed `parameterSchema` for a copied attachment. The source's schema is copied so the tool + * serves correctly before the target's first deploy, UNLESS it exceeds the per-tool storage + * limit - then the empty schema is seeded instead (the same degradation the deploy-time sync + * applies) and the deployment outbox re-derives the real one when the target deploys. + */ +function seedParameterSchema(parameterSchema: unknown): unknown { + const invalid = validateMcpToolMetadataForStorage({ + parameterSchema: parameterSchema as Record, + }) + return invalid ? { type: 'object', properties: {} } : parameterSchema +} + +export interface ForkMcpAttachmentPair { + sourceWorkflowId: string + targetWorkflowId: string +} + +/** + * Copy `workflow_mcp_tool` attachments into a fresh fork: every source attachment whose server + * AND workflow were both copied gets a child row (fresh id; metadata + schema copied - the child + * re-derives the schema when it first deploys). Insert-only: the child is brand new, so there is + * nothing to update or archive, and no server locks are needed (the child's servers are + * invisible until the fork transaction commits). Must run AFTER the child workflow rows exist + * (FK). A no-op when either map is empty. + */ +export async function copyForkWorkflowMcpAttachments(params: { + tx: DbOrTx + /** Source workflow-publishing server id -> child copy id. */ + serverIdMap: ReadonlyMap + /** Source workflow id -> child workflow id. */ + workflowIdMap: ReadonlyMap + now: Date +}): Promise<{ copied: number }> { + const { tx, serverIdMap, workflowIdMap, now } = params + if (serverIdMap.size === 0 || workflowIdMap.size === 0) return { copied: 0 } + + const sourceAttachments = await tx + .select({ + serverId: workflowMcpTool.serverId, + workflowId: workflowMcpTool.workflowId, + toolName: workflowMcpTool.toolName, + toolDescription: workflowMcpTool.toolDescription, + parameterSchema: workflowMcpTool.parameterSchema, + parameterDescriptionOverrides: workflowMcpTool.parameterDescriptionOverrides, + }) + .from(workflowMcpTool) + .where( + and( + inArray(workflowMcpTool.serverId, [...serverIdMap.keys()]), + inArray(workflowMcpTool.workflowId, [...workflowIdMap.keys()]), + isNull(workflowMcpTool.archivedAt) + ) + ) + + const inserts: (typeof workflowMcpTool.$inferInsert)[] = [] + for (const attachment of sourceAttachments) { + const childServerId = serverIdMap.get(attachment.serverId) + const childWorkflowId = workflowIdMap.get(attachment.workflowId) + if (!childServerId || !childWorkflowId) continue + inserts.push({ + id: generateId(), + serverId: childServerId, + workflowId: childWorkflowId, + toolName: attachment.toolName, + toolDescription: attachment.toolDescription, + parameterSchema: seedParameterSchema(attachment.parameterSchema), + parameterDescriptionOverrides: attachment.parameterDescriptionOverrides, + createdAt: now, + updatedAt: now, + }) + } + if (inserts.length > 0) await tx.insert(workflowMcpTool).values(inserts) + return { copied: inserts.length } +} + +/** + * Mirror `workflow_mcp_tool` attachments (a workflow exposed as a tool on a + * workflow-publishing MCP server) onto the target side of a sync, through the edge's + * `workflow_mcp_server` identity map (seeded when a fork copies the server shells). + * + * For each written workflow pair whose source is attached to a MAPPED server: + * - a missing target attachment is created (metadata copied; `parameterSchema` is copied as a + * seed and re-derived by the deployment outbox when the target deploys), + * - an existing one has its user-set metadata (tool name / description / description + * overrides) refreshed to the source's, + * - a target attachment on a mapped server + synced workflow with NO source counterpart is + * archived (the source detached it) - target attachments on unmapped servers or unsynced + * workflows are never touched. + * + * Unmapped servers are skipped entirely: attachment sync follows the server identity, exactly + * like subblock references follow resource mappings. Bounded by (written workflows x mapped + * servers); acquires the same per-server advisory locks the deploy-time tool sync takes. + * Returns the affected target server ids so the caller can notify them post-commit. + */ +export async function reconcileForkWorkflowMcpAttachments(params: { + tx: DbOrTx + childWorkspaceId: string + /** True when the sync SOURCE is the parent workspace (a pull). */ + sourceIsParent: boolean + now: Date + /** The workflow pairs THIS sync wrote (replace + create). */ + writtenPairs: ForkMcpAttachmentPair[] +}): Promise<{ affectedServerIds: string[] }> { + const { tx, childWorkspaceId, sourceIsParent, now, writtenPairs } = params + if (writtenPairs.length === 0) return { affectedServerIds: [] } + + const mappingRows = await getEdgeMappingRows(tx, childWorkspaceId) + const serverMap = new Map() + for (const row of mappingRows) { + if (row.resourceType !== 'workflow_mcp_server' || row.childResourceId == null) continue + if (sourceIsParent) serverMap.set(row.parentResourceId, row.childResourceId) + else serverMap.set(row.childResourceId, row.parentResourceId) + } + if (serverMap.size === 0) return { affectedServerIds: [] } + + // Same per-server serialization as the deploy-time tool sync and the attach/delete routes, + // in sorted order so two concurrent syncs can't deadlock on each other's server locks. + // Acquired BEFORE the reads below: every other attachment writer locks first, so locking + // after computing the diff would let a concurrent attach commit in between and turn our + // insert into a unique-constraint abort of the whole promote transaction (and a concurrent + // server delete into an FK abort). + for (const serverId of [...new Set(serverMap.values())].sort()) { + await acquireWorkflowMcpServerLock(tx, serverId) + } + + // Liveness guard: a mapped server may have been deleted since the fork (server deletion is a + // hard delete that cascades its tools but leaves the identity row). A dead SOURCE server has + // nothing to mirror; a dead TARGET server must be skipped or the insert below would violate + // the `server_id` FK and abort the whole promote transaction. Target liveness is stable for + // the rest of the transaction: the delete route takes the per-server lock we now hold. + const mappedServerIds = [...new Set([...serverMap.keys(), ...serverMap.values()])] + const liveServerIds = new Set( + ( + await tx + .select({ id: workflowMcpServer.id }) + .from(workflowMcpServer) + .where( + and(inArray(workflowMcpServer.id, mappedServerIds), isNull(workflowMcpServer.deletedAt)) + ) + ).map((row) => row.id) + ) + for (const [sourceServerId, targetServerId] of serverMap) { + if (!liveServerIds.has(sourceServerId) || !liveServerIds.has(targetServerId)) { + serverMap.delete(sourceServerId) + } + } + if (serverMap.size === 0) return { affectedServerIds: [] } + + const targetBySource = new Map( + writtenPairs.map((pair) => [pair.sourceWorkflowId, pair.targetWorkflowId]) + ) + const sourceAttachments = await tx + .select({ + serverId: workflowMcpTool.serverId, + workflowId: workflowMcpTool.workflowId, + toolName: workflowMcpTool.toolName, + toolDescription: workflowMcpTool.toolDescription, + parameterSchema: workflowMcpTool.parameterSchema, + parameterDescriptionOverrides: workflowMcpTool.parameterDescriptionOverrides, + }) + .from(workflowMcpTool) + .where( + and( + inArray(workflowMcpTool.workflowId, [...targetBySource.keys()]), + inArray(workflowMcpTool.serverId, [...serverMap.keys()]), + isNull(workflowMcpTool.archivedAt) + ) + ) + + /** Desired live target pairs, keyed `${targetServerId}\u0000${targetWorkflowId}`. */ + const desired = new Map< + string, + { + serverId: string + workflowId: string + toolName: string + toolDescription: string | null + parameterSchema: unknown + parameterDescriptionOverrides: Record + } + >() + for (const attachment of sourceAttachments) { + const targetServerId = serverMap.get(attachment.serverId) + const targetWorkflowId = targetBySource.get(attachment.workflowId) + if (!targetServerId || !targetWorkflowId) continue + desired.set(`${targetServerId}\u0000${targetWorkflowId}`, { + serverId: targetServerId, + workflowId: targetWorkflowId, + toolName: attachment.toolName, + toolDescription: attachment.toolDescription, + parameterSchema: attachment.parameterSchema, + parameterDescriptionOverrides: attachment.parameterDescriptionOverrides, + }) + } + + // The reconcile scope: every mapped TARGET server x every synced TARGET workflow. Rows + // outside this product are never touched. + const mappedTargetServerIds = [...new Set(serverMap.values())].sort() + const syncedTargetWorkflowIds = [...new Set(targetBySource.values())] + const existing = await tx + .select({ + id: workflowMcpTool.id, + serverId: workflowMcpTool.serverId, + workflowId: workflowMcpTool.workflowId, + toolName: workflowMcpTool.toolName, + toolDescription: workflowMcpTool.toolDescription, + parameterDescriptionOverrides: workflowMcpTool.parameterDescriptionOverrides, + }) + .from(workflowMcpTool) + .where( + and( + inArray(workflowMcpTool.serverId, mappedTargetServerIds), + inArray(workflowMcpTool.workflowId, syncedTargetWorkflowIds), + isNull(workflowMcpTool.archivedAt) + ) + ) + const existingByKey = new Map( + existing.map((row) => [`${row.serverId}\u0000${row.workflowId}`, row]) + ) + + const inserts: (typeof workflowMcpTool.$inferInsert)[] = [] + const updates: Array<{ id: string; set: Partial }> = [] + const archiveIds: string[] = [] + const affectedServerIds = new Set() + + for (const [key, want] of desired) { + const current = existingByKey.get(key) + if (!current) { + inserts.push({ + id: generateId(), + serverId: want.serverId, + workflowId: want.workflowId, + toolName: want.toolName, + toolDescription: want.toolDescription, + // Seed with the source's schema; the deployment outbox re-derives it from the + // target's deployed state right after this sync deploys the workflow. + parameterSchema: seedParameterSchema(want.parameterSchema), + parameterDescriptionOverrides: want.parameterDescriptionOverrides, + createdAt: now, + updatedAt: now, + }) + affectedServerIds.add(want.serverId) + continue + } + const overridesChanged = + JSON.stringify(current.parameterDescriptionOverrides ?? {}) !== + JSON.stringify(want.parameterDescriptionOverrides ?? {}) + if ( + current.toolName !== want.toolName || + current.toolDescription !== want.toolDescription || + overridesChanged + ) { + updates.push({ + id: current.id, + set: { + toolName: want.toolName, + toolDescription: want.toolDescription, + parameterDescriptionOverrides: want.parameterDescriptionOverrides, + updatedAt: now, + }, + }) + affectedServerIds.add(current.serverId) + } + } + for (const [key, row] of existingByKey) { + if (desired.has(key)) continue + archiveIds.push(row.id) + affectedServerIds.add(row.serverId) + } + + if (inserts.length === 0 && updates.length === 0 && archiveIds.length === 0) { + return { affectedServerIds: [] } + } + + if (inserts.length > 0) await tx.insert(workflowMcpTool).values(inserts) + for (const update of updates) { + await tx.update(workflowMcpTool).set(update.set).where(eq(workflowMcpTool.id, update.id)) + } + if (archiveIds.length > 0) { + await tx + .update(workflowMcpTool) + .set({ archivedAt: now, updatedAt: now }) + .where(inArray(workflowMcpTool.id, archiveIds)) + } + + return { affectedServerIds: [...affectedServerIds] } +} diff --git a/apps/sim/lib/workspaces/fork/create-fork.test.ts b/apps/sim/ee/workspace-forking/lib/create-fork.test.ts similarity index 72% rename from apps/sim/lib/workspaces/fork/create-fork.test.ts rename to apps/sim/ee/workspace-forking/lib/create-fork.test.ts index c2f1ee680f8..7b0f2742a09 100644 --- a/apps/sim/lib/workspaces/fork/create-fork.test.ts +++ b/apps/sim/ee/workspace-forking/lib/create-fork.test.ts @@ -13,6 +13,7 @@ const { mockStartBackgroundWork, mockFinishBackgroundWork, mockScheduleForkContentCopy, + mockSeedEdgeMappings, } = vi.hoisted(() => ({ mockSumForkCopyBytes: vi.fn(), mockAssertForkStorageHeadroom: vi.fn(), @@ -22,6 +23,7 @@ const { mockStartBackgroundWork: vi.fn(), mockFinishBackgroundWork: vi.fn(), mockScheduleForkContentCopy: vi.fn(), + mockSeedEdgeMappings: vi.fn(), })) vi.mock('@sim/db', () => dbChainMock) @@ -31,47 +33,53 @@ vi.mock('@/lib/workflows/defaults', () => ({ vi.mock('@/lib/workflows/persistence/utils', () => ({ saveWorkflowToNormalizedTables: vi.fn(), })) -vi.mock('@/lib/workspaces/fork/background-work/store', () => ({ +vi.mock('@/ee/workspace-forking/lib/background-work/store', () => ({ startBackgroundWork: mockStartBackgroundWork, finishBackgroundWork: mockFinishBackgroundWork, })) -vi.mock('@/lib/workspaces/fork/copy/content-copy-runner', () => ({ +vi.mock('@/ee/workspace-forking/lib/copy/content-copy-runner', () => ({ hasForkContentToCopy: vi.fn(() => false), scheduleForkContentCopy: mockScheduleForkContentCopy, serializeContentRefMaps: vi.fn(() => ({})), })) -vi.mock('@/lib/workspaces/fork/copy/copy-files', () => ({ +vi.mock('@/ee/workspace-forking/lib/copy/copy-chats', () => ({ + copyForkChatDeployments: vi.fn(async () => ({ created: 0 })), +})) +vi.mock('@/ee/workspace-forking/lib/copy/copy-files', () => ({ planForkFileCopies: mockPlanForkFileCopies, })) -vi.mock('@/lib/workspaces/fork/copy/copy-resources', () => ({ +vi.mock('@/ee/workspace-forking/lib/copy/workflow-mcp-attachments', () => ({ + copyForkWorkflowMcpAttachments: vi.fn(async () => ({ copied: 0 })), +})) +vi.mock('@/ee/workspace-forking/lib/copy/copy-resources', () => ({ copyForkResourceContainers: mockCopyForkResourceContainers, })) -vi.mock('@/lib/workspaces/fork/copy/storage-quota', () => ({ +vi.mock('@/ee/workspace-forking/lib/copy/storage-quota', () => ({ sumForkCopyBytes: mockSumForkCopyBytes, assertForkStorageHeadroom: mockAssertForkStorageHeadroom, })) -vi.mock('@/lib/workspaces/fork/copy/copy-workflows', () => ({ +vi.mock('@/ee/workspace-forking/lib/copy/copy-workflows', () => ({ copyWorkflowStateIntoTarget: vi.fn(), loadWorkflowNameRegistry: vi.fn(async () => new Map()), resolveForkFolderMapping: vi.fn(async () => new Map()), })) -vi.mock('@/lib/workspaces/fork/copy/deploy-bridge', () => ({ +vi.mock('@/ee/workspace-forking/lib/copy/deploy-bridge', () => ({ loadSourceDeployedStates: mockLoadSourceDeployedStates, })) -vi.mock('@/lib/workspaces/fork/lineage/lineage', () => ({ +vi.mock('@/ee/workspace-forking/lib/lineage/lineage', () => ({ setForkLockTimeout: vi.fn(), })) -vi.mock('@/lib/workspaces/fork/mapping/block-map-store', () => ({ +vi.mock('@/ee/workspace-forking/lib/mapping/block-map-store', () => ({ reconcileForkBlockPairs: vi.fn(), toForkBlockPairs: vi.fn(() => []), })) -vi.mock('@/lib/workspaces/fork/mapping/mapping-store', () => ({ - seedEdgeMappings: vi.fn(), +vi.mock('@/ee/workspace-forking/lib/mapping/mapping-store', () => ({ + seedEdgeMappings: mockSeedEdgeMappings, })) -vi.mock('@/lib/workspaces/fork/remap/fork-bootstrap', () => ({ +vi.mock('@/ee/workspace-forking/lib/remap/fork-bootstrap', () => ({ createForkBootstrapTransform: vi.fn(() => (subBlocks: unknown) => subBlocks), })) -vi.mock('@/lib/workspaces/fork/remap/reference-scan', () => ({ +vi.mock('@/ee/workspace-forking/lib/remap/reference-scan', () => ({ collectReferencedDocumentIds: vi.fn(() => new Set()), })) vi.mock('@/lib/workspaces/policy', () => ({ @@ -82,7 +90,7 @@ vi.mock('@/lib/workspaces/policy', () => ({ }, })) -import { createFork } from '@/lib/workspaces/fork/create-fork' +import { createFork } from '@/ee/workspace-forking/lib/create-fork' const SOURCE = { id: 'src-ws', name: 'Parent' } as never const POLICY = { @@ -106,6 +114,7 @@ function forkParams(selection?: { knowledgeBases: selection?.knowledgeBases ?? [], customTools: [], skills: [], + mcpServers: [], workflowMcpServers: [], }, requestId: 'test', @@ -144,6 +153,7 @@ describe('createFork storage headroom gate', () => { knowledgeBases: [], customTools: [], skills: [], + mcpServers: [], workflowMcpServers: [], }, }) @@ -184,4 +194,22 @@ describe('createFork storage headroom gate', () => { expect(mockAssertForkStorageHeadroom).toHaveBeenCalledWith({ userId: 'user-1', bytes: 500 }) expect(dbChainMockFns.transaction).toHaveBeenCalledTimes(1) }) + + it('seeds identity mappings for copied FILES by storage key (a later sync must not re-offer them)', async () => { + mockPlanForkFileCopies.mockResolvedValue({ + keyMap: new Map([['workspace/src-ws/a.png', 'workspace/child/a.png']]), + idMap: new Map([['file-1', 'file-1-copy']]), + blobTasks: [], + }) + + await createFork(forkParams({ files: ['file-1'] })) + + expect(mockSeedEdgeMappings).toHaveBeenCalledTimes(1) + const seeded = mockSeedEdgeMappings.mock.calls[0][3] as Array> + expect(seeded).toContainEqual({ + resourceType: 'file', + parentResourceId: 'workspace/src-ws/a.png', + childResourceId: 'workspace/child/a.png', + }) + }) }) diff --git a/apps/sim/lib/workspaces/fork/create-fork.ts b/apps/sim/ee/workspace-forking/lib/create-fork.ts similarity index 81% rename from apps/sim/lib/workspaces/fork/create-fork.ts rename to apps/sim/ee/workspace-forking/lib/create-fork.ts index 37230f4ddd9..cc7bf83b2a9 100644 --- a/apps/sim/lib/workspaces/fork/create-fork.ts +++ b/apps/sim/ee/workspace-forking/lib/create-fork.ts @@ -8,49 +8,52 @@ import { and, eq } from 'drizzle-orm' import type { Workspace } from '@/lib/api/contracts/workspaces' import { buildDefaultWorkflowArtifacts } from '@/lib/workflows/defaults' import { saveWorkflowToNormalizedTables } from '@/lib/workflows/persistence/utils' +import type { WorkspaceWithOwner } from '@/lib/workspaces/permissions/utils' +import type { WorkspaceCreationPolicy } from '@/lib/workspaces/policy' +import { WORKSPACE_MODE } from '@/lib/workspaces/policy' import { finishBackgroundWork, startBackgroundWork, -} from '@/lib/workspaces/fork/background-work/store' +} from '@/ee/workspace-forking/lib/background-work/store' import { type ForkContentCopyPayload, hasForkContentToCopy, scheduleForkContentCopy, serializeContentRefMaps, -} from '@/lib/workspaces/fork/copy/content-copy-runner' -import { planForkFileCopies } from '@/lib/workspaces/fork/copy/copy-files' +} from '@/ee/workspace-forking/lib/copy/content-copy-runner' +import { copyForkChatDeployments } from '@/ee/workspace-forking/lib/copy/copy-chats' +import { planForkFileCopies } from '@/ee/workspace-forking/lib/copy/copy-files' import { copyForkResourceContainers, type ForkCopiedResourceNames, -} from '@/lib/workspaces/fork/copy/copy-resources' +} from '@/ee/workspace-forking/lib/copy/copy-resources' import { copyWorkflowStateIntoTarget, loadWorkflowNameRegistry, resolveForkFolderMapping, -} from '@/lib/workspaces/fork/copy/copy-workflows' -import { loadSourceDeployedStates } from '@/lib/workspaces/fork/copy/deploy-bridge' +} from '@/ee/workspace-forking/lib/copy/copy-workflows' +import { loadSourceDeployedStates } from '@/ee/workspace-forking/lib/copy/deploy-bridge' import { assertForkStorageHeadroom, sumForkCopyBytes, -} from '@/lib/workspaces/fork/copy/storage-quota' -import { buildForkWorkflowIdMap } from '@/lib/workspaces/fork/copy/workflow-id-map' -import { setForkLockTimeout } from '@/lib/workspaces/fork/lineage/lineage' +} from '@/ee/workspace-forking/lib/copy/storage-quota' +import { buildForkWorkflowIdMap } from '@/ee/workspace-forking/lib/copy/workflow-id-map' +import { copyForkWorkflowMcpAttachments } from '@/ee/workspace-forking/lib/copy/workflow-mcp-attachments' +import { setForkLockTimeout } from '@/ee/workspace-forking/lib/lineage/lineage' import { type ForkBlockPair, reconcileForkBlockPairs, toForkBlockPairs, -} from '@/lib/workspaces/fork/mapping/block-map-store' +} from '@/ee/workspace-forking/lib/mapping/block-map-store' import { type ForkMappingUpsert, type ForkResourceType, seedEdgeMappings, -} from '@/lib/workspaces/fork/mapping/mapping-store' -import { createForkBootstrapTransform } from '@/lib/workspaces/fork/remap/fork-bootstrap' -import { collectReferencedDocumentIds } from '@/lib/workspaces/fork/remap/reference-scan' -import type { ForkRemapKind } from '@/lib/workspaces/fork/remap/remap-references' -import type { WorkspaceWithOwner } from '@/lib/workspaces/permissions/utils' -import type { WorkspaceCreationPolicy } from '@/lib/workspaces/policy' -import { WORKSPACE_MODE } from '@/lib/workspaces/policy' +} from '@/ee/workspace-forking/lib/mapping/mapping-store' +import { deriveForkBlockId } from '@/ee/workspace-forking/lib/remap/block-identity' +import { createForkBootstrapTransform } from '@/ee/workspace-forking/lib/remap/fork-bootstrap' +import { collectReferencedDocumentIds } from '@/ee/workspace-forking/lib/remap/reference-scan' +import type { ForkRemapKind } from '@/ee/workspace-forking/lib/remap/remap-references' const logger = createLogger('WorkspaceForkCreate') @@ -61,7 +64,9 @@ export interface ForkResourceSelection { knowledgeBases: string[] customTools: string[] skills: string[] - /** Workflow-publishing MCP servers (copied as config-only shells); external MCP is never copied. */ + /** External MCP servers, copied as config rows (OAuth tokens never copied - re-auth in child). */ + mcpServers: string[] + /** Workflow-publishing MCP servers, copied as config-only shells with no workflows attached. */ workflowMcpServers: string[] } @@ -71,6 +76,7 @@ const EMPTY_SELECTION: ForkResourceSelection = { knowledgeBases: [], customTools: [], skills: [], + mcpServers: [], workflowMcpServers: [], } @@ -91,14 +97,15 @@ export interface CreateForkResult { workflowsCopied: number } -// External MCP servers are intentionally absent: a fork never copies them, so their -// references resolve to null here and are cleared on remap (re-add + re-auth in the child). +// Credentials are intentionally absent: a fork never copies them, so their references +// resolve to null here and are cleared on remap (re-connect in the child). const FORK_KIND_TO_RESOURCE_TYPE: Partial> = { 'custom-tool': 'custom_tool', skill: 'skill', table: 'table', 'knowledge-base': 'knowledge_base', 'knowledge-document': 'knowledge_document', + 'mcp-server': 'mcp_server', } /** @@ -146,6 +153,7 @@ export async function createFork(params: CreateForkParams): Promise { @@ -240,6 +248,7 @@ export async function createFork(params: CreateForkParams): Promise { + const targetWorkflowId = workflowIdMap.get(wf.id) + return targetWorkflowId + ? [{ sourceWorkflowId: wf.id, targetWorkflowId, workflowName: wf.name }] + : [] + }), + targetWorkspaceName: childName, + userId, + now, + resolveBlockId: deriveForkBlockId, + requestId, + }) + + // Carry workflow-as-MCP-tool attachments onto the copied server shells: an attachment + // copies only when BOTH its server and its workflow were copied. Runs after the workflow + // rows exist (FK); the child re-derives each tool's parameter schema on first deploy. + await copyForkWorkflowMcpAttachments({ + tx, + serverIdMap: resourceResult.idMap.get('workflow_mcp_server') ?? new Map(), + workflowIdMap, + now, + }) + // A fork carries only DEPLOYED workflows. When the source has none (e.g. it was // itself just forked and never redeployed), seed a default workflow so the child // is a usable workspace rather than a blank one with no workflow at all - the same @@ -332,6 +370,18 @@ export async function createFork(params: CreateForkParams): Promise task.fileName), customToolNames: forkedResourceNames.customTools, skillNames: forkedResourceNames.skills, + mcpServerNames: forkedResourceNames.mcpServers, workflowMcpServerNames: forkedResourceNames.workflowMcpServers, }, }) diff --git a/apps/sim/lib/workspaces/fork/lineage/authz.ts b/apps/sim/ee/workspace-forking/lib/lineage/authz.ts similarity index 79% rename from apps/sim/lib/workspaces/fork/lineage/authz.ts rename to apps/sim/ee/workspace-forking/lib/lineage/authz.ts index ecbb2c6d8db..8a7cbcc70a4 100644 --- a/apps/sim/lib/workspaces/fork/lineage/authz.ts +++ b/apps/sim/ee/workspace-forking/lib/lineage/authz.ts @@ -2,9 +2,9 @@ import { isOrganizationOnEnterprisePlan } from '@/lib/billing/core/subscription' import { isAppConfigEnabled, isBillingEnabled, isForkingEnabled } from '@/lib/core/config/env-flags' import { isFeatureEnabled } from '@/lib/core/config/feature-flags' import { HttpError } from '@/lib/core/utils/http-error' -import { type ForkEdge, resolveForkEdge } from '@/lib/workspaces/fork/lineage/lineage' import { checkWorkspaceAccess, type WorkspaceWithOwner } from '@/lib/workspaces/permissions/utils' import { getWorkspaceCreationPolicy, type WorkspaceCreationPolicy } from '@/lib/workspaces/policy' +import { type ForkEdge, resolveForkEdge } from '@/ee/workspace-forking/lib/lineage/lineage' /** Direction of a promote, relative to the workspace the caller is acting from. */ export type PromoteDirection = 'push' | 'pull' @@ -41,6 +41,24 @@ async function assertForkingEnabled(organizationId: string | null, userId: strin } } +/** + * Non-throwing availability verdict of the exact {@link assertForkingEnabled} gate + * (env/plan + AppConfig rollout flag), for surfaces that show/hide fork UI. The + * availability route serves this to the client so tab visibility can never drift + * from what the fork routes actually enforce. + */ +export async function isForkingAvailableForWorkspace( + organizationId: string | null, + userId: string +): Promise { + try { + await assertForkingEnabled(organizationId, userId) + return true + } catch { + return false + } +} + /** * Domain error for fork/promote operations. Carries a concrete `statusCode` so * `withRouteHandler` maps it to the right HTTP status and forwards the @@ -153,3 +171,29 @@ export async function assertCanRollback( ): Promise { return assertWorkspaceAdminAccess(targetWorkspaceId, userId) } + +export interface UnlinkAuthorization { + edge: ForkEdge + current: WorkspaceWithOwner +} + +/** + * Authorize permanently dissolving the fork edge between `currentWorkspaceId` and + * `otherWorkspaceId`. Requires admin on the ACTING side only (mirrors rollback): + * either participant may sever the association about itself — unlinking removes + * shared edge metadata without reading or writing the other workspace's content, + * and requiring both-side admin would strand an edge whose other side lost its + * admins. + */ +export async function assertCanUnlink( + currentWorkspaceId: string, + otherWorkspaceId: string, + userId: string +): Promise { + const current = await assertWorkspaceAdminAccess(currentWorkspaceId, userId) + const edge = await resolveForkEdge(currentWorkspaceId, otherWorkspaceId) + if (!edge) { + throw new ForkError('These workspaces are not a direct fork edge', 400) + } + return { edge, current } +} diff --git a/apps/sim/lib/workspaces/fork/lineage/lineage.ts b/apps/sim/ee/workspace-forking/lib/lineage/lineage.ts similarity index 85% rename from apps/sim/lib/workspaces/fork/lineage/lineage.ts rename to apps/sim/ee/workspace-forking/lib/lineage/lineage.ts index 588bf2e433c..c7449df0082 100644 --- a/apps/sim/lib/workspaces/fork/lineage/lineage.ts +++ b/apps/sim/ee/workspace-forking/lib/lineage/lineage.ts @@ -1,6 +1,6 @@ import { db } from '@sim/db' import { workspace } from '@sim/db/schema' -import { and, eq, isNull, sql } from 'drizzle-orm' +import { and, desc, eq, isNull, sql } from 'drizzle-orm' import type { DbOrTx } from '@/lib/db/types' export interface ForkLineageNode { @@ -9,6 +9,10 @@ export interface ForkLineageNode { organizationId: string | null } +export interface ForkLineageChild extends ForkLineageNode { + createdAt: Date +} + export interface ForkEdge { childWorkspaceId: string parentWorkspaceId: string @@ -43,6 +47,23 @@ export async function getForkParent(workspaceId: string): Promise { + return db + .select({ + id: workspace.id, + name: workspace.name, + organizationId: workspace.organizationId, + createdAt: workspace.createdAt, + }) + .from(workspace) + .where(and(eq(workspace.forkedFromWorkspaceId, workspaceId), isNull(workspace.archivedAt))) + .orderBy(desc(workspace.createdAt)) +} + /** * Resolve the strict fork edge between two workspaces, identifying which is the * child (the one whose `forkedFromWorkspaceId` points at the other). Returns diff --git a/apps/sim/ee/workspace-forking/lib/lineage/unlink.test.ts b/apps/sim/ee/workspace-forking/lib/lineage/unlink.test.ts new file mode 100644 index 00000000000..f2a34ce1c25 --- /dev/null +++ b/apps/sim/ee/workspace-forking/lib/lineage/unlink.test.ts @@ -0,0 +1,65 @@ +/** + * @vitest-environment node + */ +import { beforeEach, describe, expect, it, vi } from 'vitest' + +const { mockTransaction, mockSetForkLockTimeout, mockAcquireForkEdgeLock } = vi.hoisted(() => ({ + mockTransaction: vi.fn(), + mockSetForkLockTimeout: vi.fn(), + mockAcquireForkEdgeLock: vi.fn(), +})) + +vi.mock('@sim/db', () => ({ db: { transaction: mockTransaction } })) +vi.mock('@/ee/workspace-forking/lib/lineage/lineage', () => ({ + setForkLockTimeout: mockSetForkLockTimeout, + acquireForkEdgeLock: mockAcquireForkEdgeLock, +})) + +import { unlinkForkEdge } from '@/ee/workspace-forking/lib/lineage/unlink' + +/** A fake tx whose update returns `updatedRows` and whose deletes record their calls. */ +function fakeTx(updatedRows: Array<{ id: string }>) { + const updateWhere = vi.fn(() => ({ returning: vi.fn().mockResolvedValue(updatedRows) })) + const updateSet = vi.fn(() => ({ where: updateWhere })) + const update = vi.fn(() => ({ set: updateSet })) + const deleteWhere = vi.fn().mockResolvedValue(undefined) + const del = vi.fn(() => ({ where: deleteWhere })) + return { tx: { update, delete: del }, update, updateSet, del } +} + +const EDGE = { childWorkspaceId: 'child-ws', parentWorkspaceId: 'parent-ws' } + +describe('unlinkForkEdge', () => { + beforeEach(() => { + vi.clearAllMocks() + }) + + it('nulls the child pointer and purges all four edge tables under the edge lock', async () => { + const { tx, update, updateSet, del } = fakeTx([{ id: 'child-ws' }]) + mockTransaction.mockImplementation(async (cb: (t: unknown) => unknown) => cb(tx)) + + const result = await unlinkForkEdge(EDGE, 'req-1') + + expect(result).toEqual({ unlinked: true }) + expect(mockSetForkLockTimeout).toHaveBeenCalledTimes(1) + expect(mockAcquireForkEdgeLock).toHaveBeenCalledWith(tx, 'child-ws') + expect(update).toHaveBeenCalledTimes(1) + expect(updateSet).toHaveBeenCalledWith(expect.objectContaining({ forkedFromWorkspaceId: null })) + expect(del).toHaveBeenCalledTimes(4) + }) + + it('is an idempotent no-op when the edge was already dissolved', async () => { + const { tx, del } = fakeTx([]) + mockTransaction.mockImplementation(async (cb: (t: unknown) => unknown) => cb(tx)) + + const result = await unlinkForkEdge(EDGE) + + expect(result).toEqual({ unlinked: false }) + expect(del).not.toHaveBeenCalled() + }) + + it('propagates a transaction failure without swallowing it', async () => { + mockTransaction.mockRejectedValue(new Error('lock timeout')) + await expect(unlinkForkEdge(EDGE)).rejects.toThrow('lock timeout') + }) +}) diff --git a/apps/sim/ee/workspace-forking/lib/lineage/unlink.ts b/apps/sim/ee/workspace-forking/lib/lineage/unlink.ts new file mode 100644 index 00000000000..f4fcaafdd49 --- /dev/null +++ b/apps/sim/ee/workspace-forking/lib/lineage/unlink.ts @@ -0,0 +1,78 @@ +import { db } from '@sim/db' +import { + workspace, + workspaceForkBlockMap, + workspaceForkDependentValue, + workspaceForkPromoteRun, + workspaceForkResourceMap, +} from '@sim/db/schema' +import { createLogger } from '@sim/logger' +import { and, eq } from 'drizzle-orm' +import { + acquireForkEdgeLock, + type ForkEdge, + setForkLockTimeout, +} from '@/ee/workspace-forking/lib/lineage/lineage' + +const logger = createLogger('ForkUnlink') + +export interface UnlinkForkResult { + /** False when the edge was already dissolved by a concurrent unlink (idempotent no-op). */ + unlinked: boolean +} + +/** + * Permanently dissolve a fork edge: null the child's `forkedFromWorkspaceId` (the + * edge's single source of truth) and purge the edge's fork state — resource map, + * block map, dependent values, and promote-run undo points. Both workspaces are + * left untouched; only the association and its metadata are removed. + * + * Runs in one transaction under the edge advisory lock, which every promote and + * rollback on the edge also holds, so an in-flight sync either finishes before the + * unlink or re-resolves the edge afterwards and fails with "not a direct fork edge". + * The edge is re-verified inside the lock; a concurrently-dissolved edge is an + * idempotent success rather than an error. + */ +export async function unlinkForkEdge( + edge: ForkEdge, + requestId?: string +): Promise { + const { childWorkspaceId, parentWorkspaceId } = edge + + const unlinked = await db.transaction(async (tx) => { + await setForkLockTimeout(tx) + await acquireForkEdgeLock(tx, childWorkspaceId) + + const updated = await tx + .update(workspace) + .set({ forkedFromWorkspaceId: null, updatedAt: new Date() }) + .where( + and( + eq(workspace.id, childWorkspaceId), + eq(workspace.forkedFromWorkspaceId, parentWorkspaceId) + ) + ) + .returning({ id: workspace.id }) + if (updated.length === 0) return false + + await tx + .delete(workspaceForkResourceMap) + .where(eq(workspaceForkResourceMap.childWorkspaceId, childWorkspaceId)) + await tx + .delete(workspaceForkBlockMap) + .where(eq(workspaceForkBlockMap.childWorkspaceId, childWorkspaceId)) + await tx + .delete(workspaceForkDependentValue) + .where(eq(workspaceForkDependentValue.childWorkspaceId, childWorkspaceId)) + await tx + .delete(workspaceForkPromoteRun) + .where(eq(workspaceForkPromoteRun.childWorkspaceId, childWorkspaceId)) + return true + }) + + logger.info(`[${requestId ?? 'unlink'}] Fork edge ${unlinked ? 'dissolved' : 'already gone'}`, { + childWorkspaceId, + parentWorkspaceId, + }) + return { unlinked } +} diff --git a/apps/sim/lib/workspaces/fork/mapping/block-map-store.test.ts b/apps/sim/ee/workspace-forking/lib/mapping/block-map-store.test.ts similarity index 93% rename from apps/sim/lib/workspaces/fork/mapping/block-map-store.test.ts rename to apps/sim/ee/workspace-forking/lib/mapping/block-map-store.test.ts index 55f33423302..86d5dbcc466 100644 --- a/apps/sim/lib/workspaces/fork/mapping/block-map-store.test.ts +++ b/apps/sim/ee/workspace-forking/lib/mapping/block-map-store.test.ts @@ -2,7 +2,7 @@ * @vitest-environment node */ import { describe, expect, it } from 'vitest' -import { toForkBlockPairs } from '@/lib/workspaces/fork/mapping/block-map-store' +import { toForkBlockPairs } from '@/ee/workspace-forking/lib/mapping/block-map-store' describe('toForkBlockPairs', () => { const mapping = new Map([ diff --git a/apps/sim/lib/workspaces/fork/mapping/block-map-store.ts b/apps/sim/ee/workspace-forking/lib/mapping/block-map-store.ts similarity index 95% rename from apps/sim/lib/workspaces/fork/mapping/block-map-store.ts rename to apps/sim/ee/workspace-forking/lib/mapping/block-map-store.ts index 68f8b2e1eb6..765fe414281 100644 --- a/apps/sim/lib/workspaces/fork/mapping/block-map-store.ts +++ b/apps/sim/ee/workspace-forking/lib/mapping/block-map-store.ts @@ -2,7 +2,7 @@ import { workspaceForkBlockMap } from '@sim/db/schema' import { generateId } from '@sim/utils/id' import { and, eq, inArray } from 'drizzle-orm' import type { DbOrTx } from '@/lib/db/types' -import type { ForkBlockMap } from '@/lib/workspaces/fork/remap/block-identity' +import type { ForkBlockMap } from '@/ee/workspace-forking/lib/remap/block-identity' /** One persisted block-identity pair for an edge (carries both workflow sides). */ export interface ForkBlockPair { @@ -15,8 +15,8 @@ export interface ForkBlockPair { /** * Load an edge's persisted block-identity pairs into both lookup directions, each entry * carrying its target-side workflow so the resolver can scope a reuse to the right workflow - * (see {@link buildForkBlockIdResolver}). Empty for an edge that predates the map (every - * block id then derives, exactly as before). + * (see {@link buildForkBlockIdResolver}). Blocks without a pair (added since the last sync) + * fall back to the deterministic derive. */ export async function loadForkBlockMap( executor: DbOrTx, diff --git a/apps/sim/lib/workspaces/fork/mapping/cascade.test.ts b/apps/sim/ee/workspace-forking/lib/mapping/cascade.test.ts similarity index 97% rename from apps/sim/lib/workspaces/fork/mapping/cascade.test.ts rename to apps/sim/ee/workspace-forking/lib/mapping/cascade.test.ts index 9ed938ad3d9..0a5ce7b7434 100644 --- a/apps/sim/lib/workspaces/fork/mapping/cascade.test.ts +++ b/apps/sim/ee/workspace-forking/lib/mapping/cascade.test.ts @@ -3,11 +3,11 @@ */ import { describe, expect, it } from 'vitest' import type { DbOrTx } from '@/lib/db/types' -import { detectForkCascadeReferences } from '@/lib/workspaces/fork/mapping/cascade' +import { detectForkCascadeReferences } from '@/ee/workspace-forking/lib/mapping/cascade' import type { ForkReference, ForkReferenceResolver, -} from '@/lib/workspaces/fork/remap/remap-references' +} from '@/ee/workspace-forking/lib/remap/remap-references' /** Executor that returns the queued result arrays in the order queries are issued. */ function queuedExecutor(results: unknown[][]): DbOrTx { diff --git a/apps/sim/lib/workspaces/fork/mapping/cascade.ts b/apps/sim/ee/workspace-forking/lib/mapping/cascade.ts similarity index 99% rename from apps/sim/lib/workspaces/fork/mapping/cascade.ts rename to apps/sim/ee/workspace-forking/lib/mapping/cascade.ts index 917760a081d..d74125ea94e 100644 --- a/apps/sim/lib/workspaces/fork/mapping/cascade.ts +++ b/apps/sim/ee/workspace-forking/lib/mapping/cascade.ts @@ -5,7 +5,7 @@ import { ENV_REF_PATTERN, type ForkReference, type ForkReferenceResolver, -} from '@/lib/workspaces/fork/remap/remap-references' +} from '@/ee/workspace-forking/lib/remap/remap-references' function extractEnvKeys(text: string): string[] { const keys = new Set() diff --git a/apps/sim/lib/workspaces/fork/mapping/dependent-reconfigs.test.ts b/apps/sim/ee/workspace-forking/lib/mapping/dependent-reconfigs.test.ts similarity index 94% rename from apps/sim/lib/workspaces/fork/mapping/dependent-reconfigs.test.ts rename to apps/sim/ee/workspace-forking/lib/mapping/dependent-reconfigs.test.ts index 9b9927cb489..47edd6330e4 100644 --- a/apps/sim/lib/workspaces/fork/mapping/dependent-reconfigs.test.ts +++ b/apps/sim/ee/workspace-forking/lib/mapping/dependent-reconfigs.test.ts @@ -2,17 +2,17 @@ * @vitest-environment node */ import { describe, expect, it, vi } from 'vitest' +import { getBlock } from '@/blocks/registry' +import type { BlockConfig, SubBlockConfig } from '@/blocks/types' import { collectForkDependentReconfigs, collectForkResourceUsages, -} from '@/lib/workspaces/fork/mapping/dependent-reconfigs' +} from '@/ee/workspace-forking/lib/mapping/dependent-reconfigs' import { buildForkBlockIdResolver, deriveForkBlockId, EMPTY_FORK_BLOCK_MAP, -} from '@/lib/workspaces/fork/remap/block-identity' -import { getBlock } from '@/blocks/registry' -import type { BlockConfig, SubBlockConfig } from '@/blocks/types' +} from '@/ee/workspace-forking/lib/remap/block-identity' import type { WorkflowState } from '@/stores/workflows/workflow/types' const blockWith = (subBlocks: SubBlockConfig[]): BlockConfig => @@ -92,11 +92,12 @@ describe('collectForkDependentReconfigs', () => { required: true, consumesContextKeys: [], context: {}, + sourceValue: 'INBOX', }, ]) }) - it('anchors a dependent on the ACTIVE advanced parent member (not the dormant basic selector)', () => { + it('skips an anchor whose canonical pair is in advanced (manual) mode - the value passes through', () => { vi.mocked(getBlock).mockReturnValue( blockWith([ { @@ -148,17 +149,10 @@ describe('collectForkDependentReconfigs', () => { new Map([['wf-src', advancedState]]), resolve ) - // Today (raw basic read) this is skipped because the basic selector is empty; the active-member - // resolution anchors the document on the advanced KB id so the re-pick is offered. - expect(result).toHaveLength(1) - expect(result[0]).toMatchObject({ - parentKind: 'knowledge-base', - parentSourceId: 'kb-active', - parentContextKey: 'knowledgeBaseId', - subBlockKey: 'documentSelector', - selectorKey: 'knowledge.documents', - currentValue: 'doc-1', - }) + // Advanced (manual) mode: the manual KB id is user-owned and passes through verbatim on + // sync - it is never remapped, so its dependents are never cleared and there is nothing + // to re-pick. No reconfig is offered. + expect(result).toEqual([]) }) it('emits a knowledge-base-dependent document selector', () => { @@ -206,6 +200,7 @@ describe('collectForkDependentReconfigs', () => { required: true, consumesContextKeys: [], context: {}, + sourceValue: 'doc-src', }, ]) }) @@ -374,16 +369,18 @@ describe('collectForkDependentReconfigs', () => { blockName: 'Block', subBlockKey: 'tools[0].folder', selectorKey: 'gmail.labels', - title: 'Gmail 1: Label', + title: 'Label', + toolName: 'Gmail 1', currentValue: 'INBOX', required: true, consumesContextKeys: [], context: {}, + sourceValue: 'INBOX', }, ]) }) - it('honors a nested tool-scoped advanced override (anchors on the active member, not the dormant basic)', () => { + it('honors a nested tool-scoped advanced override (manual mode passes through - no re-pick)', () => { vi.mocked(getBlock).mockImplementation((type) => { if (type === 'agent') return blockWith([{ id: 'tools', title: 'Tools', type: 'tool-input' }]) if (type === 'gmail') @@ -446,18 +443,14 @@ describe('collectForkDependentReconfigs', () => { variables: {}, }) as unknown as WorkflowState - // Scoped override present -> anchors on the ACTIVE advanced member (today's heuristic missed it). + // Scoped override present -> advanced (manual) mode: the manual credential passes through + // verbatim on sync, so its dependents are never cleared and no re-pick is offered. const withOverride = collectForkDependentReconfigs( [replaceItem], new Map([['wf-src', agentState({ 'gmail:credential': 'advanced' })]]), resolve ) - expect(withOverride).toHaveLength(1) - expect(withOverride[0]).toMatchObject({ - parentKind: 'credential', - parentSourceId: 'cred-active', - subBlockKey: 'tools[0].folder', - }) + expect(withOverride).toEqual([]) // Control: no override -> the value heuristic keeps the non-empty basic (unchanged behavior). const heuristic = collectForkDependentReconfigs( @@ -502,7 +495,11 @@ describe('collectForkDependentReconfigs', () => { ]) const result = collectForkDependentReconfigs([replaceItem], states, resolve) expect(result).toHaveLength(1) - expect(result[0]).toMatchObject({ subBlockKey: 'tools[0].folder', title: 'Gmail 1: Label' }) + expect(result[0]).toMatchObject({ + subBlockKey: 'tools[0].folder', + title: 'Label', + toolName: 'Gmail 1', + }) }) it('evaluates a nested tool selector condition against the tool-level operation', () => { @@ -650,10 +647,16 @@ describe('collectForkResourceUsages', () => { ]) }) - it('skips create-mode targets (the source config carries over on first sync)', () => { + it('includes create-mode targets (never-synced workflows count toward the next sync)', () => { const states = new Map([['wf-a', credentialState('cred-src')]]) expect( collectForkResourceUsages([usageItem('wf-a', 'wf-tgt-a', 'A', 'create')], states) - ).toEqual([]) + ).toEqual([ + { + parentKind: 'credential', + parentSourceId: 'cred-src', + workflows: [{ workflowId: 'wf-tgt-a', workflowName: 'A' }], + }, + ]) }) }) diff --git a/apps/sim/lib/workspaces/fork/mapping/dependent-reconfigs.ts b/apps/sim/ee/workspace-forking/lib/mapping/dependent-reconfigs.ts similarity index 82% rename from apps/sim/lib/workspaces/fork/mapping/dependent-reconfigs.ts rename to apps/sim/ee/workspace-forking/lib/mapping/dependent-reconfigs.ts index 9b20a3dfaac..b2489c0ed86 100644 --- a/apps/sim/lib/workspaces/fork/mapping/dependent-reconfigs.ts +++ b/apps/sim/ee/workspace-forking/lib/mapping/dependent-reconfigs.ts @@ -10,18 +10,19 @@ import { buildSubBlockValues, type CanonicalModeOverrides, evaluateSubBlockCondition, - resolveActiveCanonicalValue, + isNonEmptyValue, scopeCanonicalModesForTool, } from '@/lib/workflows/subblocks/visibility' -import type { ForkBlockIdResolver } from '@/lib/workspaces/fork/remap/block-identity' -import { toScannerBlocks } from '@/lib/workspaces/fork/remap/reference-scan' -import { - isSubBlockRequired, - scanWorkflowReferences, -} from '@/lib/workspaces/fork/remap/remap-references' import { getBlock } from '@/blocks/registry' import type { SubBlockConfig } from '@/blocks/types' import { getDependsOnFields } from '@/blocks/utils' +import type { ForkBlockIdResolver } from '@/ee/workspace-forking/lib/remap/block-identity' +import { toScannerBlocks } from '@/ee/workspace-forking/lib/remap/reference-scan' +import { + createCanonicalModeGates, + isSubBlockRequired, + scanWorkflowReferences, +} from '@/ee/workspace-forking/lib/remap/remap-references' import type { WorkflowState } from '@/stores/workflows/workflow/types' const isSelectorContextKey = ( @@ -73,6 +74,8 @@ interface EmitAnchoredParams { /** Map a dependent's config id to its wire `subBlockKey` (identity, or nested `tools[i].id`). */ makeSubBlockKey: (dependentId: string) => string makeTitle: (dependent: SubBlockConfig) => string + /** Nested `tool-input` tool display name; omitted for top-level block subblocks. */ + toolName?: string /** * Emit `providesContextKey`/`consumesContextKeys` so the modal can chain in-block * re-picks. Top-level chains; nested tool params don't (a tool's chain would need @@ -101,11 +104,13 @@ function emitAnchoredDependents(params: EmitAnchoredParams): void { resolveTargetBlockId, makeSubBlockKey, makeTitle, + toolName, chaining, out, } = params const fullContext = buildSelectorContextFromBlock(contextBlockType, contextSubBlocks) const canonicalIndex = buildCanonicalIndex(config.subBlocks) + const gates = createCanonicalModeGates(config.subBlocks, values, canonicalModes) const configById = new Map(config.subBlocks.filter((cfg) => cfg.id).map((cfg) => [cfg.id, cfg])) // A field could hang off two anchors (or be reachable via two paths); emit it once. const seen = new Set() @@ -113,14 +118,22 @@ function emitAnchoredDependents(params: EmitAnchoredParams): void { for (const anchor of PARENT_ANCHORS) { for (const anchorCfg of config.subBlocks) { if (anchorCfg.type !== anchor.subBlockType || !anchorCfg.id) continue - // Resolve the parent's ACTIVE canonical value: an advanced override (or an advanced-only - // value) beats a stale dormant basic selector, so a dependent re-pick is offered when - // advanced mode is active (today's raw basic read skips it). - const canonicalId = canonicalIndex.canonicalIdBySubBlockId[anchorCfg.id] - const group = canonicalId ? canonicalIndex.groupsById[canonicalId] : undefined - const rawValue = group - ? resolveActiveCanonicalValue(group, values, canonicalModes) - : values[anchorCfg.id] + // An anchor whose canonical pair is in ADVANCED (manual) mode is skipped entirely: the + // active value is the user-owned manual member's, which is verbatim by policy - a sync + // never remaps it, so its dependents are never cleared and there is nothing to re-pick. + if (gates.isAdvancedActiveGroup(anchorCfg.id)) continue + // Basic mode: the anchor selector's own value. Nested tools can store the pick under the + // pair's `canonicalParamId` instead (the tool-input UI writes the canonical key), so fall + // back to it - but only when that key is not itself a subblock id (when it is, the key + // is the manual member's own field and reading it would leak a manual value). + let rawValue = values[anchorCfg.id] + if ( + !isNonEmptyValue(rawValue) && + anchorCfg.canonicalParamId && + !configById.has(anchorCfg.canonicalParamId) + ) { + rawValue = values[anchorCfg.canonicalParamId] + } const parentSourceId = typeof rawValue === 'string' ? rawValue : '' if (!parentSourceId) continue // Multi-value parents (comma-joined) can't match a single mapping entry; skip @@ -143,6 +156,10 @@ function emitAnchoredDependents(params: EmitAnchoredParams): void { // offered, so the user can set a label/sheet during the swap even when the source // (or a prior sync) cleared it - the whole point of the in-place re-pick. if (dependent.condition && !evaluateSubBlockCondition(dependent.condition, values)) continue + // Skip a DORMANT canonical member: when the dependent's own pair is in advanced + // (manual) mode, the selector is not the live field - the manual member is, and it + // is verbatim by policy (never cleared by a remap), so there's nothing to re-pick. + if (gates.isDormantMember(dependent.id)) continue // The SelectorContext key this field supplies to its own descendants, so the // modal can chain re-picks (re-picked spreadsheet feeds the sheet selector). const canonicalKey = canonicalIndex.canonicalIdBySubBlockId[dependent.id] ?? dependent.id @@ -170,6 +187,14 @@ function emitAnchoredDependents(params: EmitAnchoredParams): void { typeof dependent.mimeType === 'string' && dependent.mimeType ? { ...context, mimeType: dependent.mimeType } : context + // Nested tools can store the pick under the pair's `canonicalParamId` (the tool-input + // UI writes the canonical key); fall back to it when the key isn't a subblock's own id. + const rawDependentValue = + values[dependent.id] ?? + (dependent.canonicalParamId && !configById.has(dependent.canonicalParamId) + ? values[dependent.canonicalParamId] + : undefined) + const rawSourceValue = typeof rawDependentValue === 'string' ? rawDependentValue : '' out.push({ parentKind: anchor.parentKind, parentSourceId, @@ -180,13 +205,16 @@ function emitAnchoredDependents(params: EmitAnchoredParams): void { subBlockKey: makeSubBlockKey(dependent.id), selectorKey: dependent.selectorKey, title: makeTitle(dependent), + ...(toolName ? { toolName } : {}), // Source value, so the always-on listing pre-fills a stable parent's selector. - currentValue: - typeof values[dependent.id] === 'string' ? (values[dependent.id] as string) : '', + // The diff route overlays the stored/target-draft value onto `currentValue`; + // `sourceValue` stays the raw source reference (the copy-resolved parent's seed). + currentValue: rawSourceValue, required: isSubBlockRequired(dependent.required, values), providesContextKey, consumesContextKeys, context: dependentContext, + sourceValue: rawSourceValue, }) } } @@ -204,7 +232,9 @@ function emitAnchoredDependents(params: EmitAnchoredParams): void { * operation is emitted - including ones the source left empty - so the user can set a * value in place during the swap even when the source (or a prior sync) had none; only * selectors gated off by their `condition` (a different operation's variant) are skipped. - * Replace targets only: a freshly created target has nothing configured to swap yet. + * Scans one target `mode` per call: `replace` for targets that exist (re-pick against the + * swapped parent), `create` for never-synced workflows (pre-configure what the first sync + * writes - the diff route emits both). * * `resolveTargetBlockId` MUST be the same resolver `copyWorkflowStateIntoTarget` uses for * this promote (see {@link buildForkBlockIdResolver}); otherwise the modal would key a @@ -255,8 +285,8 @@ export function collectForkDependentReconfigs( }) // Nested `tool-input` tools: each selected tool's own credential-anchored selectors, - // keyed `toolInput[index].paramId` (matching the needs-config key) and titled with the - // tool so the modal re-picks them under the same block card. + // keyed `toolInput[index].paramId` (matching the needs-config key). Field `title` stays + // plain; `toolName` carries the tool so the UI can show block → tool → field tiers. for (const cfg of config.subBlocks) { if (cfg.type !== 'tool-input' || !cfg.id) continue const { array: tools } = coerceObjectArray(subBlocks[cfg.id]?.value) @@ -292,7 +322,8 @@ export function collectForkDependentReconfigs( canonicalModes: scopeCanonicalModesForTool(block.data?.canonicalModes, tool.type), resolveTargetBlockId: resolveBlockId, makeSubBlockKey: (id) => `${toolInputKey}[${toolIndex}].${id}`, - makeTitle: (dependent) => `${toolLabel}: ${dependent.title ?? dependent.id ?? ''}`, + makeTitle: (dependent) => dependent.title ?? dependent.id ?? '', + toolName: toolLabel, chaining: false, out, }) @@ -318,8 +349,8 @@ interface ResourceUsageItem { * groups them by `(kind, sourceId)`. Unlike {@link collectForkDependentReconfigs} this is * NOT anchor-limited: it includes resources with no configurable dependent (env vars, files, * a Gmail block with no active label) so the modal can still list - greyed - the workflows - * they appear in. Replace targets only, mirroring the dependent collector (a freshly created - * target carries the source config over and has nothing to reconcile yet). + * they appear in. Covers EVERY deployed source workflow - replace targets and creates + * (never-synced workflows) alike - so the listing accounts for the full next sync. */ export function collectForkResourceUsages( items: ResourceUsageItem[], @@ -327,7 +358,6 @@ export function collectForkResourceUsages( ): ForkResourceUsage[] { const byResource = new Map() for (const item of items) { - if (item.mode !== 'replace') continue const state = sourceStates.get(item.sourceWorkflowId) if (!state) continue // scanWorkflowReferences already dedups by `${kind}:${sourceId}` across the workflow, diff --git a/apps/sim/lib/workspaces/fork/mapping/dependent-value-store.test.ts b/apps/sim/ee/workspace-forking/lib/mapping/dependent-value-store.test.ts similarity index 71% rename from apps/sim/lib/workspaces/fork/mapping/dependent-value-store.test.ts rename to apps/sim/ee/workspace-forking/lib/mapping/dependent-value-store.test.ts index 29bde91f43c..d94f7f2d90b 100644 --- a/apps/sim/lib/workspaces/fork/mapping/dependent-value-store.test.ts +++ b/apps/sim/ee/workspace-forking/lib/mapping/dependent-value-store.test.ts @@ -4,10 +4,13 @@ import { describe, expect, it, vi } from 'vitest' import type { DbOrTx } from '@/lib/db/types' import { + type ForkDependentValue, forkDependentValueKey, loadForkDependentValues, reconcileForkDependentValues, -} from '@/lib/workspaces/fork/mapping/dependent-value-store' + translateForkDependentValues, +} from '@/ee/workspace-forking/lib/mapping/dependent-value-store' +import type { ForkReferenceResolver } from '@/ee/workspace-forking/lib/remap/remap-references' describe('forkDependentValueKey', () => { it('builds a stable triple key', () => { @@ -53,6 +56,46 @@ describe('loadForkDependentValues', () => { }) }) +describe('translateForkDependentValues', () => { + const value = (overrides: Partial = {}): ForkDependentValue => ({ + targetWorkflowId: 'wf-1', + targetBlockId: 'blk-1', + subBlockKey: 'documentSelector', + value: 'doc-src', + ...overrides, + }) + + /** Resolver mapping only the copied/mapped source document ids, like promote's post-copy one. */ + const resolver: ForkReferenceResolver = (kind, sourceId) => + kind === 'knowledge-document' && sourceId === 'doc-src' ? 'doc-copy' : null + + it('rewrites a SOURCE document id to its copied counterpart (the apply must never write a source id)', () => { + expect(translateForkDependentValues([value()], resolver)).toEqual([ + value({ value: 'doc-copy' }), + ]) + }) + + it('keeps values the resolver does not know verbatim (target doc ids, labels, column ids)', () => { + const targetDoc = value({ value: 'doc-tgt-existing' }) + const label = value({ subBlockKey: 'folder', value: 'INBOX' }) + expect(translateForkDependentValues([targetDoc, label], resolver)).toEqual([targetDoc, label]) + }) + + it('keeps empty (cleared) values untouched without consulting the resolver', () => { + const resolve = vi.fn(() => 'never') + const cleared = value({ value: '' }) + expect(translateForkDependentValues([cleared], resolve)).toEqual([cleared]) + expect(resolve).not.toHaveBeenCalled() + }) + + it('consults only the knowledge-document kind (documents are the one copied dependent value)', () => { + const resolve = vi.fn(() => null) + translateForkDependentValues([value()], resolve) + expect(resolve).toHaveBeenCalledTimes(1) + expect(resolve).toHaveBeenCalledWith('knowledge-document', 'doc-src') + }) +}) + describe('reconcileForkDependentValues', () => { function fakeExecutor() { const deleteWhere = vi.fn().mockResolvedValue(undefined) diff --git a/apps/sim/lib/workspaces/fork/mapping/dependent-value-store.ts b/apps/sim/ee/workspace-forking/lib/mapping/dependent-value-store.ts similarity index 74% rename from apps/sim/lib/workspaces/fork/mapping/dependent-value-store.ts rename to apps/sim/ee/workspace-forking/lib/mapping/dependent-value-store.ts index aa60dbdc102..cc4335f24db 100644 --- a/apps/sim/lib/workspaces/fork/mapping/dependent-value-store.ts +++ b/apps/sim/ee/workspace-forking/lib/mapping/dependent-value-store.ts @@ -2,6 +2,7 @@ import { workspaceForkDependentValue } from '@sim/db/schema' import { generateId } from '@sim/utils/id' import { and, eq, inArray } from 'drizzle-orm' import type { DbOrTx } from '@/lib/db/types' +import type { ForkReferenceResolver } from '@/ee/workspace-forking/lib/remap/remap-references' /** One stored dependent-field value for an edge. */ export interface ForkDependentValue { @@ -52,6 +53,30 @@ export async function loadForkDependentValues( .where(where) } +/** + * Translate dependent values through the promote resolver before they are applied to the + * written state and persisted: a value that is a SOURCE knowledge-document id (a pick under a + * copy-resolved KB) becomes its copied/mapped counterpart id, so the + * dependent-value apply - which runs AFTER the reference remap and wins for its subblock - + * never writes a source-workspace document id into the target, and the store stays coherent + * for the next sync's (then-mapped) display. Only ids the resolver actually knows are + * rewritten: a target document id, a Gmail label, a column id, or any other opaque value + * misses the map and is kept verbatim. Documents are the one dependent-selector value that is + * itself a copied resource id, so `knowledge-document` is the only kind consulted. Pure. + */ +export function translateForkDependentValues( + values: ForkDependentValue[], + resolve: ForkReferenceResolver +): ForkDependentValue[] { + return values.map((entry) => { + if (entry.value === '') return entry + const translated = resolve('knowledge-document', entry.value) + return translated != null && translated !== entry.value + ? { ...entry, value: translated } + : entry + }) +} + /** * Replace the stored dependent values for the given target workflows with `values` (the full * set the modal sent). Deletes those workflows' rows first, then inserts the non-empty values, diff --git a/apps/sim/lib/workspaces/fork/mapping/mapping-service.test.ts b/apps/sim/ee/workspace-forking/lib/mapping/mapping-service.test.ts similarity index 96% rename from apps/sim/lib/workspaces/fork/mapping/mapping-service.test.ts rename to apps/sim/ee/workspace-forking/lib/mapping/mapping-service.test.ts index 86570341867..4efb1d0778a 100644 --- a/apps/sim/lib/workspaces/fork/mapping/mapping-service.test.ts +++ b/apps/sim/ee/workspace-forking/lib/mapping/mapping-service.test.ts @@ -2,7 +2,7 @@ * @vitest-environment node */ import { beforeEach, describe, expect, it, vi } from 'vitest' -import type { ForkRemapKind } from '@/lib/workspaces/fork/remap/remap-references' +import type { ForkRemapKind } from '@/ee/workspace-forking/lib/remap/remap-references' const { mockFilterExisting, mockGetCredentialProviders, mockGetEnvKeys } = vi.hoisted(() => ({ mockFilterExisting: vi.fn(), @@ -10,7 +10,7 @@ const { mockFilterExisting, mockGetCredentialProviders, mockGetEnvKeys } = vi.ho mockGetEnvKeys: vi.fn(), })) -vi.mock('@/lib/workspaces/fork/mapping/resources', () => ({ +vi.mock('@/ee/workspace-forking/lib/mapping/resources', () => ({ listForkResourceCandidates: vi.fn(), classifyCredentialResourceType: vi.fn(), getWorkspaceEnvKeys: mockGetEnvKeys, @@ -19,13 +19,13 @@ vi.mock('@/lib/workspaces/fork/mapping/resources', () => ({ CANDIDATE_LIMIT: 1000, })) -import { ForkError } from '@/lib/workspaces/fork/lineage/authz' +import { ForkError } from '@/ee/workspace-forking/lib/lineage/authz' import { findDuplicateTargetEntry, suggestTarget, validateForkMappingTargets, -} from '@/lib/workspaces/fork/mapping/mapping-service' -import type { ForkResourceCandidate } from '@/lib/workspaces/fork/mapping/resources' +} from '@/ee/workspace-forking/lib/mapping/mapping-service' +import type { ForkResourceCandidate } from '@/ee/workspace-forking/lib/mapping/resources' type ExistingByKind = Partial>> diff --git a/apps/sim/lib/workspaces/fork/mapping/mapping-service.ts b/apps/sim/ee/workspace-forking/lib/mapping/mapping-service.ts similarity index 94% rename from apps/sim/lib/workspaces/fork/mapping/mapping-service.ts rename to apps/sim/ee/workspace-forking/lib/mapping/mapping-service.ts index 14410f2cf43..64f3ca2d91a 100644 --- a/apps/sim/lib/workspaces/fork/mapping/mapping-service.ts +++ b/apps/sim/ee/workspace-forking/lib/mapping/mapping-service.ts @@ -1,10 +1,13 @@ import { db } from '@sim/db' import type { ForkMappableResourceType, ForkMappingEntry } from '@/lib/api/contracts/workspace-fork' import type { DbOrTx } from '@/lib/db/types' -import { listDeployedWorkflows, readDeployedState } from '@/lib/workspaces/fork/copy/deploy-bridge' -import { ForkError } from '@/lib/workspaces/fork/lineage/authz' -import type { ForkEdge } from '@/lib/workspaces/fork/lineage/lineage' -import { detectForkCascadeReferences } from '@/lib/workspaces/fork/mapping/cascade' +import { + listDeployedWorkflows, + readDeployedState, +} from '@/ee/workspace-forking/lib/copy/deploy-bridge' +import { ForkError } from '@/ee/workspace-forking/lib/lineage/authz' +import type { ForkEdge } from '@/ee/workspace-forking/lib/lineage/lineage' +import { detectForkCascadeReferences } from '@/ee/workspace-forking/lib/mapping/cascade' import { buildForkResolver, deleteEdgeMappingsByChildResources, @@ -13,7 +16,7 @@ import { nonCredentialForkKindToResourceType, resourceTypeToForkKind, upsertEdgeMappings, -} from '@/lib/workspaces/fork/mapping/mapping-store' +} from '@/ee/workspace-forking/lib/mapping/mapping-store' import { CANDIDATE_LIMIT, classifyCredentialResourceType, @@ -22,13 +25,13 @@ import { getCredentialProvidersByIds, getWorkspaceEnvKeys, listForkResourceCandidates, -} from '@/lib/workspaces/fork/mapping/resources' -import { toScannerBlocks } from '@/lib/workspaces/fork/remap/reference-scan' +} from '@/ee/workspace-forking/lib/mapping/resources' +import { toScannerBlocks } from '@/ee/workspace-forking/lib/remap/reference-scan' import { type ForkReference, type ForkRemapKind, scanWorkflowReferences, -} from '@/lib/workspaces/fork/remap/remap-references' +} from '@/ee/workspace-forking/lib/remap/remap-references' interface ForkMappingViewParams { edge: ForkEdge @@ -76,10 +79,16 @@ export async function getForkMappingView( const resourceTypeBySourceId = new Map() for (const row of mappingRows) { - // Workflow identity rows are system-managed and document rows ride their parent KB - neither is - // user-mappable. Skip both so a scanned reference can never be labeled with a non-mappable type - // and the view stays within the mappable-type contract. - if (row.resourceType === 'workflow' || row.resourceType === 'knowledge_document') continue + // Workflow + workflow-publishing-server identity rows are system-managed and document rows + // ride their parent KB - none is user-mappable. Skip them so a scanned reference can never + // be labeled with a non-mappable type and the view stays within the mappable-type contract. + if ( + row.resourceType === 'workflow' || + row.resourceType === 'workflow_mcp_server' || + row.resourceType === 'knowledge_document' + ) { + continue + } const key = sourceIsParent ? row.parentResourceId : row.childResourceId if (key) resourceTypeBySourceId.set(key, row.resourceType) } diff --git a/apps/sim/lib/workspaces/fork/mapping/mapping-store.test.ts b/apps/sim/ee/workspace-forking/lib/mapping/mapping-store.test.ts similarity index 95% rename from apps/sim/lib/workspaces/fork/mapping/mapping-store.test.ts rename to apps/sim/ee/workspace-forking/lib/mapping/mapping-store.test.ts index 491256729c1..104b6217cc9 100644 --- a/apps/sim/lib/workspaces/fork/mapping/mapping-store.test.ts +++ b/apps/sim/ee/workspace-forking/lib/mapping/mapping-store.test.ts @@ -2,7 +2,10 @@ * @vitest-environment node */ import { describe, expect, it } from 'vitest' -import { buildForkResolver, type ForkMappingRow } from '@/lib/workspaces/fork/mapping/mapping-store' +import { + buildForkResolver, + type ForkMappingRow, +} from '@/ee/workspace-forking/lib/mapping/mapping-store' const credentialRow: ForkMappingRow = { id: 'm1', diff --git a/apps/sim/lib/workspaces/fork/mapping/mapping-store.ts b/apps/sim/ee/workspace-forking/lib/mapping/mapping-store.ts similarity index 97% rename from apps/sim/lib/workspaces/fork/mapping/mapping-store.ts rename to apps/sim/ee/workspace-forking/lib/mapping/mapping-store.ts index fffff6a7a23..f9d1e938275 100644 --- a/apps/sim/lib/workspaces/fork/mapping/mapping-store.ts +++ b/apps/sim/ee/workspace-forking/lib/mapping/mapping-store.ts @@ -7,7 +7,7 @@ import type { DbOrTx } from '@/lib/db/types' import type { ForkReferenceResolver, ForkRemapKind, -} from '@/lib/workspaces/fork/remap/remap-references' +} from '@/ee/workspace-forking/lib/remap/remap-references' /** Mapping rows per insert; each row binds ~8 params, keeping well under PG's limit. */ const MAPPING_INSERT_CHUNK = 1000 @@ -39,6 +39,9 @@ const RESOURCE_TYPE_TO_FORK_KIND: Record knowledge_document: 'knowledge-document', file: 'file', mcp_server: 'mcp-server', + // Identity-only, like `workflow`: nothing in a subblock references a workflow-publishing + // server, so these rows never participate in reference remapping. + workflow_mcp_server: null, custom_tool: 'custom-tool', skill: 'skill', } diff --git a/apps/sim/lib/workspaces/fork/mapping/resources.test.ts b/apps/sim/ee/workspace-forking/lib/mapping/resources.test.ts similarity index 99% rename from apps/sim/lib/workspaces/fork/mapping/resources.test.ts rename to apps/sim/ee/workspace-forking/lib/mapping/resources.test.ts index a29094c217e..0995c26178c 100644 --- a/apps/sim/lib/workspaces/fork/mapping/resources.test.ts +++ b/apps/sim/ee/workspace-forking/lib/mapping/resources.test.ts @@ -8,7 +8,7 @@ import { listForkCopyableSourceResources, listForkResourceCandidates, loadForkCopyableResourceLabels, -} from '@/lib/workspaces/fork/mapping/resources' +} from '@/ee/workspace-forking/lib/mapping/resources' const executor = dbChainMock.db as unknown as DbOrTx diff --git a/apps/sim/lib/workspaces/fork/mapping/resources.ts b/apps/sim/ee/workspace-forking/lib/mapping/resources.ts similarity index 89% rename from apps/sim/lib/workspaces/fork/mapping/resources.ts rename to apps/sim/ee/workspace-forking/lib/mapping/resources.ts index 1a9702e2da9..2d04e0b96aa 100644 --- a/apps/sim/lib/workspaces/fork/mapping/resources.ts +++ b/apps/sim/ee/workspace-forking/lib/mapping/resources.ts @@ -16,8 +16,11 @@ import { import { and, count, eq, exists, inArray, isNull, sql } from 'drizzle-orm' import type { ForkCopyableKind } from '@/lib/api/contracts/workspace-fork' import type { DbOrTx } from '@/lib/db/types' -import type { ForkResourceType } from '@/lib/workspaces/fork/mapping/mapping-store' -import type { ForkMcpServerMeta, ForkRemapKind } from '@/lib/workspaces/fork/remap/remap-references' +import type { ForkResourceType } from '@/ee/workspace-forking/lib/mapping/mapping-store' +import type { + ForkMcpServerMeta, + ForkRemapKind, +} from '@/ee/workspace-forking/lib/remap/remap-references' export interface ForkResourceCandidate { id: string @@ -391,7 +394,9 @@ export interface ForkCopyableResources { knowledgeBases: ForkResourceCandidate[] customTools: ForkResourceCandidate[] skills: ForkResourceCandidate[] - /** Workflow-publishing MCP servers, copied as config-only shells (external MCP is not copied). */ + /** External MCP servers, copied as config rows (OAuth tokens never copied - re-auth in child). */ + mcpServers: ForkResourceCandidate[] + /** Workflow-publishing MCP servers, copied as config-only shells with no workflows attached. */ workflowMcpServers: ForkResourceCandidate[] /** * Count of deployed workflows that the fork would copy. When 0, the fork modal shows an @@ -410,44 +415,48 @@ export async function listForkCopyableResources( executor: DbOrTx, workspaceId: string ): Promise { - const [files, tables, kbs, tools, skills, servers, deployed] = await Promise.all([ - fileCandidatesWithFolderQuery(executor, workspaceId), - tableCandidatesQuery(executor, workspaceId), - knowledgeBaseCandidatesQuery(executor, workspaceId), - customToolCandidatesQuery(executor, workspaceId), - skillCandidatesQuery(executor, workspaceId), - executor - .select({ id: workflowMcpServer.id, label: workflowMcpServer.name }) - .from(workflowMcpServer) - .where( - and(eq(workflowMcpServer.workspaceId, workspaceId), isNull(workflowMcpServer.deletedAt)) - ) - .limit(CANDIDATE_LIMIT), - executor - .select({ value: count() }) - .from(workflow) - // Match listDeployedWorkflows: a workflow only counts as copyable when it has an - // actually-active deployment version, not just the isDeployed flag, so the fork - // modal's preflight count never over-reports "ghost" deployed workflows. - .where( - and( - eq(workflow.workspaceId, workspaceId), - eq(workflow.isDeployed, true), - isNull(workflow.archivedAt), - exists( - executor - .select({ one: sql`1` }) - .from(workflowDeploymentVersion) - .where( - and( - eq(workflowDeploymentVersion.workflowId, workflow.id), - eq(workflowDeploymentVersion.isActive, true) + const [files, tables, kbs, tools, skills, externalServers, servers, deployed] = await Promise.all( + [ + fileCandidatesWithFolderQuery(executor, workspaceId), + tableCandidatesQuery(executor, workspaceId), + knowledgeBaseCandidatesQuery(executor, workspaceId), + customToolCandidatesQuery(executor, workspaceId), + skillCandidatesQuery(executor, workspaceId), + // External MCP servers copy as config rows (same filter as the mapping candidates). + mcpServerCandidatesQuery(executor, workspaceId), + executor + .select({ id: workflowMcpServer.id, label: workflowMcpServer.name }) + .from(workflowMcpServer) + .where( + and(eq(workflowMcpServer.workspaceId, workspaceId), isNull(workflowMcpServer.deletedAt)) + ) + .limit(CANDIDATE_LIMIT), + executor + .select({ value: count() }) + .from(workflow) + // Match listDeployedWorkflows: a workflow only counts as copyable when it has an + // actually-active deployment version, not just the isDeployed flag, so the fork + // modal's preflight count never over-reports "ghost" deployed workflows. + .where( + and( + eq(workflow.workspaceId, workspaceId), + eq(workflow.isDeployed, true), + isNull(workflow.archivedAt), + exists( + executor + .select({ one: sql`1` }) + .from(workflowDeploymentVersion) + .where( + and( + eq(workflowDeploymentVersion.workflowId, workflow.id), + eq(workflowDeploymentVersion.isActive, true) + ) ) - ) + ) ) - ) - ), - ]) + ), + ] + ) return { // The shared folder query also selects the storage key (for the label lookup); the copy // picker addresses files by `workspace_files.id`, so drop the key here. @@ -461,6 +470,7 @@ export async function listForkCopyableResources( knowledgeBases: kbs, customTools: tools, skills, + mcpServers: externalServers, workflowMcpServers: servers, deployedWorkflowCount: deployed[0]?.value ?? 0, } @@ -496,20 +506,20 @@ export interface ForkCopyableSourceResource { * per-kind {@link CANDIDATE_LIMIT} cap as the copy picker), as sync-copy candidate entries. The * promote plan filters these down to the UNREFERENCED-and-unmapped set it offers for copy * alongside the referenced candidates. Covers exactly the sync-copyable kinds - * (`forkCopyableKindSchema`): workflow-publishing MCP servers are fork-copy-only (their copies - * are not recorded in the fork resource map, so a sync copy could never be idempotent) and - * external MCP servers / credentials / env vars are never copied. + * (`forkCopyableKindSchema`): workflow-publishing MCP servers are fork-copy-only shells, and + * credentials / env vars are never copied. */ export async function listForkCopyableSourceResources( executor: DbOrTx, sourceWorkspaceId: string ): Promise { - const [files, tables, kbs, tools, skills] = await Promise.all([ + const [files, tables, kbs, tools, skills, mcp] = await Promise.all([ fileCandidatesWithFolderQuery(executor, sourceWorkspaceId), tableCandidatesQuery(executor, sourceWorkspaceId), knowledgeBaseCandidatesQuery(executor, sourceWorkspaceId), customToolCandidatesQuery(executor, sourceWorkspaceId), skillCandidatesQuery(executor, sourceWorkspaceId), + mcpServerCandidatesQuery(executor, sourceWorkspaceId), ]) const flat = ( kind: ForkCopyableKind, @@ -534,6 +544,7 @@ export async function listForkCopyableSourceResources( ...flat('knowledge-base', kbs), ...flat('custom-tool', tools), ...flat('skill', skills), + ...flat('mcp-server', mcp), ] } @@ -558,10 +569,11 @@ export async function loadForkCopyableResourceLabels( const tableIds = ids('table') const toolIds = ids('custom-tool') const skillIds = ids('skill') + const mcpIds = ids('mcp-server') // Files are keyed by storage key (not `workspace_files.id`), so they label by key. const fileKeys = ids('file') - const [kbs, tables, tools, skills, files] = await Promise.all([ + const [kbs, tables, tools, skills, mcp, files] = await Promise.all([ kbIds.length === 0 ? Promise.resolve([] as Array<{ id: string; label: string }>) : knowledgeBaseCandidatesQuery(executor, sourceWorkspaceId, kbIds), @@ -574,6 +586,9 @@ export async function loadForkCopyableResourceLabels( skillIds.length === 0 ? Promise.resolve([] as Array<{ id: string; label: string }>) : skillCandidatesQuery(executor, sourceWorkspaceId, skillIds), + mcpIds.length === 0 + ? Promise.resolve([] as Array<{ id: string; label: string }>) + : mcpServerCandidatesQuery(executor, sourceWorkspaceId, mcpIds), fileKeys.length === 0 ? Promise.resolve( [] as Array<{ @@ -591,6 +606,7 @@ export async function loadForkCopyableResourceLabels( for (const row of tables) labels.set(`table:${row.id}`, flat(row.label)) for (const row of tools) labels.set(`custom-tool:${row.id}`, flat(row.label)) for (const row of skills) labels.set(`skill:${row.id}`, flat(row.label)) + for (const row of mcp) labels.set(`mcp-server:${row.id}`, flat(row.label)) for (const row of files) { labels.set(`file:${row.key}`, { label: row.label, diff --git a/apps/sim/lib/workspaces/fork/promote/cleared-refs.test.ts b/apps/sim/ee/workspace-forking/lib/promote/cleared-refs.test.ts similarity index 94% rename from apps/sim/lib/workspaces/fork/promote/cleared-refs.test.ts rename to apps/sim/ee/workspace-forking/lib/promote/cleared-refs.test.ts index 278f421b111..0487a6082c9 100644 --- a/apps/sim/lib/workspaces/fork/promote/cleared-refs.test.ts +++ b/apps/sim/ee/workspace-forking/lib/promote/cleared-refs.test.ts @@ -25,7 +25,7 @@ const { mockFilterExisting, mockLoadCopyableLabels } = vi.hoisted(() => ({ mockFilterExisting: vi.fn(), mockLoadCopyableLabels: vi.fn(), })) -vi.mock('@/lib/workspaces/fork/mapping/resources', () => ({ +vi.mock('@/ee/workspace-forking/lib/mapping/resources', () => ({ filterExistingForkTargets: mockFilterExisting, loadForkCopyableResourceLabels: mockLoadCopyableLabels, getWorkspaceEnvKeys: vi.fn(), @@ -37,20 +37,20 @@ vi.mock('@/lib/workspaces/fork/mapping/resources', () => ({ })) import type { DbOrTx } from '@/lib/db/types' +import { getBlock } from '@/blocks/registry' +import type { BlockConfig } from '@/blocks/types' import { annotateForkClearedRefSourceLiveness, collectForkClearedRefCandidates, collectForkSyncBlockers, -} from '@/lib/workspaces/fork/promote/cleared-refs' -import { buildPromoteWorkflowIdMap } from '@/lib/workspaces/fork/promote/promote-plan' +} from '@/ee/workspace-forking/lib/promote/cleared-refs' +import { buildPromoteWorkflowIdMap } from '@/ee/workspace-forking/lib/promote/promote-plan' import { buildForkBlockIdResolver, deriveForkBlockId, EMPTY_FORK_BLOCK_MAP, -} from '@/lib/workspaces/fork/remap/block-identity' -import type { ForkReferenceResolver } from '@/lib/workspaces/fork/remap/remap-references' -import { getBlock } from '@/blocks/registry' -import type { BlockConfig } from '@/blocks/types' +} from '@/ee/workspace-forking/lib/remap/block-identity' +import type { ForkReferenceResolver } from '@/ee/workspace-forking/lib/remap/remap-references' import type { WorkflowState } from '@/stores/workflows/workflow/types' const blockWith = (subBlocks: SubBlockConfig[]): BlockConfig => @@ -667,6 +667,63 @@ describe('collectForkClearedRefCandidates', () => { ]) }) + it('prefixes nested toolName onto dependent fieldLabel so two tools with Label stay distinct', () => { + vi.mocked(getBlock).mockImplementation((type) => { + if (type === 'agent') return blockWith([{ id: 'tools', title: 'Tools', type: 'tool-input' }]) + if (type === 'gmail') + return blockWith([ + { id: 'credential', title: 'Credential', type: 'oauth-input' }, + { + id: 'folder', + title: 'Label', + type: 'folder-selector', + dependsOn: ['credential'], + selectorKey: 'gmail.labels', + }, + ]) + return undefined as unknown as BlockConfig + }) + const result = collectForkClearedRefCandidates( + params({ + items: [ + { + sourceWorkflowId: 'wf-src', + targetWorkflowId: 'wf-tgt', + mode: 'create', + sourceMeta: { name: 'New Workflow' }, + }, + ], + sourceStates: new Map([ + [ + 'wf-src', + stateWith('agent', 'Agent', { + tools: { + type: 'tool-input', + value: [ + { + type: 'gmail', + title: 'Gmail 1', + params: { credential: 'cred-src', folder: 'INBOX' }, + }, + { + type: 'gmail', + title: 'Gmail 2', + params: { credential: 'cred-src', folder: 'SENT' }, + }, + ], + }, + }), + ], + ]), + sourceLabels: new Map([['credential:cred-src', 'Work Gmail']]), + }) + ) + expect(result.map((ref) => ref.fieldLabel).sort()).toEqual(['Gmail 1: Label', 'Gmail 2: Label']) + expect(result.every((ref) => ref.cause === 'dependent' && ref.blockLabel === 'Agent')).toBe( + true + ) + }) + it('carries the knowledge-base parent on a document-selector dependent (so it can drop off)', () => { vi.mocked(getBlock).mockReturnValue( blockWith([ @@ -951,7 +1008,7 @@ describe('collectForkSyncBlockers', () => { expect(select).not.toHaveBeenCalled() }) - it('blocks an unmapped external MCP server (unmapped-mcp-server), named via the source read', async () => { + it('blocks an unmapped external MCP server (unmapped-copyable: map it or copy it), named via the source read', async () => { vi.mocked(getBlock).mockReturnValue( blockWith([{ id: 'server', title: 'Server', type: 'mcp-server-selector' }]) ) @@ -975,7 +1032,7 @@ describe('collectForkSyncBlockers', () => { kind: 'mcp-server', sourceId: 'srv-1', sourceLabel: 'Internal Tools', - reason: 'unmapped-mcp-server', + reason: 'unmapped-copyable', }), ]) }) diff --git a/apps/sim/lib/workspaces/fork/promote/cleared-refs.ts b/apps/sim/ee/workspace-forking/lib/promote/cleared-refs.ts similarity index 89% rename from apps/sim/lib/workspaces/fork/promote/cleared-refs.ts rename to apps/sim/ee/workspace-forking/lib/promote/cleared-refs.ts index cb31fef852b..521111dfde4 100644 --- a/apps/sim/lib/workspaces/fork/promote/cleared-refs.ts +++ b/apps/sim/ee/workspace-forking/lib/promote/cleared-refs.ts @@ -12,31 +12,29 @@ import { type SubBlockRecord, } from '@/lib/workflows/persistence/remap-internal-ids' import { - buildCanonicalIndex, buildSubBlockValues, type CanonicalModeOverrides, - isCanonicalPair, - resolveCanonicalMode, } from '@/lib/workflows/subblocks/visibility' -import { collectForkDependentReconfigs } from '@/lib/workspaces/fork/mapping/dependent-reconfigs' +import { getBlock } from '@/blocks/registry' +import { collectForkDependentReconfigs } from '@/ee/workspace-forking/lib/mapping/dependent-reconfigs' import { filterExistingForkTargets, loadForkCopyableResourceLabels, -} from '@/lib/workspaces/fork/mapping/resources' -import { isForkCopyableKind } from '@/lib/workspaces/fork/promote/promote-plan' +} from '@/ee/workspace-forking/lib/mapping/resources' +import { isForkCopyableKind } from '@/ee/workspace-forking/lib/promote/promote-plan' import { selectForkSyncBlockingRefs, toForkSyncBlockers, -} from '@/lib/workspaces/fork/promote/sync-blockers' -import type { ForkBlockIdResolver } from '@/lib/workspaces/fork/remap/block-identity' +} from '@/ee/workspace-forking/lib/promote/sync-blockers' +import type { ForkBlockIdResolver } from '@/ee/workspace-forking/lib/remap/block-identity' import { + createCanonicalModeGates, type ForkReference, type ForkReferenceResolver, type ForkRemapKind, REQUIRED_KINDS, remapForkSubBlocks, -} from '@/lib/workspaces/fork/remap/remap-references' -import { getBlock } from '@/blocks/registry' +} from '@/ee/workspace-forking/lib/remap/remap-references' import type { WorkflowState } from '@/stores/workflows/workflow/types' /** @@ -84,7 +82,7 @@ function baseSubBlockId(key: string): string { * {@link remapWorkflowReferencesInSubBlocks} so the cleared-ref list flags exactly the refs that * remap would clear - the free-form manual fields (`manualWorkflowId`, `manualWorkflowIds`) are * user-owned and never remapped/cleared, so they are intentionally excluded (the `workflowIds` - * branch is gated on TYPE `dropdown` because the legacy logs block's `workflowIds` is a manual + * branch is gated on TYPE `dropdown` because the logs block's `workflowIds` is a manual * `short-input`). Returns one entry per referenced workflow id with its owning subblock key. */ function collectForkWorkflowReferences( @@ -93,25 +91,21 @@ function collectForkWorkflowReferences( canonicalModes: CanonicalModeOverrides | undefined ): Array<{ workflowId: string; subBlockKey: string }> { const out: Array<{ workflowId: string; subBlockKey: string }> = [] - // Collapse each canonical pair to its ACTIVE member: only the selector members are - // remapped/cleared (the advanced `manualWorkflowId`/`manualWorkflowIds` are user-owned and - // preserved verbatim), so a DORMANT member's stale value is not a ref that would be cleared - - // it must not become an unresolvable sync blocker. Mirrors `isDormantCanonicalMember` in - // remap-references.ts: the lookup is per subblock key, so the scalar `workflowId` pair, the - // deployments block's scalar `workflowSelector` pair, and the logs block's multi-select - // `workflowSelector` (`workflowIds` group) all resolve through their OWN group. A missing - // config or a non-pair member is never skipped (legacy/no-pair states keep emitting). - const canonicalIndex = config ? buildCanonicalIndex(config.subBlocks) : undefined - const values = canonicalIndex ? buildSubBlockValues(subBlocks) : {} - const isDormantCanonicalMember = (key: string): boolean => { - if (!canonicalIndex) return false - const baseKey = baseSubBlockId(key) - const canonicalId = canonicalIndex.canonicalIdBySubBlockId[baseKey] - const group = canonicalId ? canonicalIndex.groupsById[canonicalId] : undefined - if (!group || !isCanonicalPair(group)) return false - const activeMode = resolveCanonicalMode(group, values, canonicalModes) - return (activeMode === 'advanced') !== group.advancedIds.includes(baseKey) - } + // Collapse each canonical pair to its ACTIVE member and skip condition-hidden fields: only a + // value that serializes is a ref that a sync would clear (the advanced + // `manualWorkflowId`/`manualWorkflowIds` are user-owned and preserved verbatim, an inactive + // operation's selector never executes) - neither may become an unresolvable sync blocker. + // Shares {@link createCanonicalModeGates} with the reference scan, so the scalar `workflowId` + // pair, the deployments block's scalar `workflowSelector` pair, and the logs block's + // multi-select `workflowSelector` (`workflowIds` group) all resolve through their OWN group. A + // missing config or a non-pair member is never skipped (no-pair states keep emitting). + const gates = createCanonicalModeGates( + config?.subBlocks, + buildSubBlockValues(subBlocks), + canonicalModes + ) + const detectionSkipped = (key: string) => + gates.isDormantMember(key) || gates.isConditionHidden(key) for (const [key, subBlock] of Object.entries(subBlocks)) { if (!subBlock || typeof subBlock !== 'object') continue const baseKey = baseSubBlockId(key) @@ -122,13 +116,13 @@ function collectForkWorkflowReferences( ) { // Only the SELECTOR is remapped/cleared; the manual member is user-owned and preserved // verbatim, so skip the dormant selector when advanced/manual mode is active. - if (isDormantCanonicalMember(key)) continue + if (detectionSkipped(key)) continue out.push({ workflowId: subBlock.value, subBlockKey: key }) } else if ( baseKey === 'workflowSelector' || (subBlock.type === 'dropdown' && baseKey === 'workflowIds') ) { - if (isDormantCanonicalMember(key)) continue + if (detectionSkipped(key)) continue const ids = Array.isArray(subBlock.value) ? subBlock.value : typeof subBlock.value === 'string' @@ -259,7 +253,11 @@ export function collectForkClearedRefCandidates( workflowName: workflowNameByTarget.get(dependent.targetWorkflowId) ?? '', blockId: dependent.targetBlockId, blockLabel: dependent.blockName, - fieldLabel: dependent.title, + // Nested tool fields keep a plain `title` for the reconfigure UI; warnings need the + // tool disambiguator so two tools with the same field name stay distinguishable. + fieldLabel: dependent.toolName + ? `${dependent.toolName}: ${dependent.title}` + : dependent.title, kind: dependent.parentKind, sourceId: dependent.parentSourceId, sourceLabel: labelFor(dependent.parentKind, dependent.parentSourceId), diff --git a/apps/sim/lib/workspaces/fork/promote/copy-unmapped.test.ts b/apps/sim/ee/workspace-forking/lib/promote/copy-unmapped.test.ts similarity index 94% rename from apps/sim/lib/workspaces/fork/promote/copy-unmapped.test.ts rename to apps/sim/ee/workspace-forking/lib/promote/copy-unmapped.test.ts index 4737665694f..8f792f3df95 100644 --- a/apps/sim/lib/workspaces/fork/promote/copy-unmapped.test.ts +++ b/apps/sim/ee/workspace-forking/lib/promote/copy-unmapped.test.ts @@ -22,25 +22,25 @@ const { mockPlanForkFileCopies: vi.fn(), })) -vi.mock('@/lib/workspaces/fork/mapping/mapping-store', () => ({ +vi.mock('@/ee/workspace-forking/lib/mapping/mapping-store', () => ({ upsertEdgeMappings: mockUpsertEdgeMappings, deleteEdgeMappingsByChildResources: mockDeleteEdgeMappingsByChildResources, resourceTypeToForkKind: vi.fn(), })) -vi.mock('@/lib/workspaces/fork/copy/copy-resources', () => ({ +vi.mock('@/ee/workspace-forking/lib/copy/copy-resources', () => ({ copyForkResourceContainers: mockCopyForkResourceContainers, planForkMappedKbDocumentCopies: mockPlanForkMappedKbDocumentCopies, copyForkResourceContent: vi.fn(), })) -vi.mock('@/lib/workspaces/fork/copy/copy-files', () => ({ +vi.mock('@/ee/workspace-forking/lib/copy/copy-files', () => ({ planForkFileCopies: mockPlanForkFileCopies, executeForkFileBlobCopies: vi.fn(), })) -import type { ForkEdge } from '@/lib/workspaces/fork/lineage/lineage' -import type { ForkMappingUpsert } from '@/lib/workspaces/fork/mapping/mapping-store' +import type { ForkEdge } from '@/ee/workspace-forking/lib/lineage/lineage' +import type { ForkMappingUpsert } from '@/ee/workspace-forking/lib/mapping/mapping-store' import { augmentForkResolver, buildPromoteCopySelection, @@ -48,9 +48,9 @@ import { FORK_COPYABLE_KIND_TO_SELECTION_KEY, hasPromoteCopySelection, persistPromoteCopiedMappings, -} from '@/lib/workspaces/fork/promote/copy-unmapped' -import { isForkCopyableKind } from '@/lib/workspaces/fork/promote/promote-plan' -import type { ForkRemapKind } from '@/lib/workspaces/fork/remap/remap-references' +} from '@/ee/workspace-forking/lib/promote/copy-unmapped' +import { isForkCopyableKind } from '@/ee/workspace-forking/lib/promote/promote-plan' +import type { ForkRemapKind } from '@/ee/workspace-forking/lib/remap/remap-references' const candidates: ForkCopyableUnmapped[] = [ { @@ -197,6 +197,7 @@ describe('hasPromoteCopySelection', () => { tables: [], knowledgeBases: ['kb-1'], files: [], + mcpServers: [], }) ).toBe(true) expect( @@ -206,6 +207,7 @@ describe('hasPromoteCopySelection', () => { tables: [], knowledgeBases: [], files: [], + mcpServers: [], }) ).toBe(false) expect( @@ -215,6 +217,7 @@ describe('hasPromoteCopySelection', () => { tables: [], knowledgeBases: [], files: ['workspace/SRC/file.png'], + mcpServers: [], }) ).toBe(true) }) @@ -306,6 +309,7 @@ describe('copyPromoteUnmappedResources - files + folder content-refs', () => { knowledgeBases: [], customTools: [], skills: [], + mcpServers: [], workflowMcpServers: [], }, }) @@ -402,6 +406,7 @@ describe('copyPromoteUnmappedResources - files + folder content-refs', () => { knowledgeBases: [], customTools: [], skills: [], + mcpServers: [], workflowMcpServers: [], }, }) @@ -453,6 +458,7 @@ describe('copyPromoteUnmappedResources - files + folder content-refs', () => { tables: [], knowledgeBases: ['kb-1'], files: [], + mcpServers: [], }, workflowIdMap: new Map(), folderIdMap: new Map(), @@ -467,8 +473,8 @@ describe('copyPromoteUnmappedResources - files + folder content-refs', () => { expect.objectContaining({ referencedDocumentIds: ['doc-1', 'doc-2'], // Workflow-publishing MCP servers are fork-create-only; a sync always passes the - // shared pipeline's slot empty (PromoteCopySelection has no such field). - selection: expect.objectContaining({ workflowMcpServers: [] }), + // shared pipeline's slot empty. External MCP servers flow through the selection. + selection: expect.objectContaining({ mcpServers: [], workflowMcpServers: [] }), // The promote-built block-id resolver reaches the table remap unchanged, so copied // tables' workflow-group outputs use the persisted-pair ids, not the derive. resolveBlockId, @@ -491,12 +497,7 @@ describe('fork copyable kind drift', () => { for (const kind of forkCopyableKindSchema.options) { expect(isForkCopyableKind(kind)).toBe(true) } - const nonCopyable: ForkRemapKind[] = [ - 'credential', - 'env-var', - 'knowledge-document', - 'mcp-server', - ] + const nonCopyable: ForkRemapKind[] = ['credential', 'env-var', 'knowledge-document'] for (const kind of nonCopyable) { expect(isForkCopyableKind(kind)).toBe(false) } diff --git a/apps/sim/lib/workspaces/fork/promote/copy-unmapped.ts b/apps/sim/ee/workspace-forking/lib/promote/copy-unmapped.ts similarity index 92% rename from apps/sim/lib/workspaces/fork/promote/copy-unmapped.ts rename to apps/sim/ee/workspace-forking/lib/promote/copy-unmapped.ts index cf1d33d56c8..40b5fcaba49 100644 --- a/apps/sim/lib/workspaces/fork/promote/copy-unmapped.ts +++ b/apps/sim/ee/workspace-forking/lib/promote/copy-unmapped.ts @@ -7,25 +7,25 @@ import type { DbOrTx } from '@/lib/db/types' import { type SerializableForkContentRefMaps, serializeContentRefMaps, -} from '@/lib/workspaces/fork/copy/content-copy-runner' -import { type BlobCopyTask, planForkFileCopies } from '@/lib/workspaces/fork/copy/copy-files' -import type { ForkContentPlan } from '@/lib/workspaces/fork/copy/copy-resources' +} from '@/ee/workspace-forking/lib/copy/content-copy-runner' +import { type BlobCopyTask, planForkFileCopies } from '@/ee/workspace-forking/lib/copy/copy-files' +import type { ForkContentPlan } from '@/ee/workspace-forking/lib/copy/copy-resources' import { copyForkResourceContainers, planForkMappedKbDocumentCopies, -} from '@/lib/workspaces/fork/copy/copy-resources' -import type { ForkEdge } from '@/lib/workspaces/fork/lineage/lineage' +} from '@/ee/workspace-forking/lib/copy/copy-resources' +import type { ForkEdge } from '@/ee/workspace-forking/lib/lineage/lineage' import { deleteEdgeMappingsByChildResources, type ForkMappingUpsert, resourceTypeToForkKind, upsertEdgeMappings, -} from '@/lib/workspaces/fork/mapping/mapping-store' -import type { ForkBlockIdResolver } from '@/lib/workspaces/fork/remap/block-identity' +} from '@/ee/workspace-forking/lib/mapping/mapping-store' +import type { ForkBlockIdResolver } from '@/ee/workspace-forking/lib/remap/block-identity' import type { ForkReferenceResolver, ForkRemapKind, -} from '@/lib/workspaces/fork/remap/remap-references' +} from '@/ee/workspace-forking/lib/remap/remap-references' /** * The source ids selected for copy at promote, validated against the plan's copyable @@ -39,6 +39,8 @@ export interface PromoteCopySelection { knowledgeBases: string[] /** Workspace files to copy, identified by storage key (not `workspace_files.id`). */ files: string[] + /** External MCP servers to copy as config rows (OAuth tokens never copied - re-auth). */ + mcpServers: string[] } /** @@ -55,6 +57,7 @@ export const FORK_COPYABLE_KIND_TO_SELECTION_KEY: Record< 'custom-tool': 'customTools', skill: 'skills', file: 'files', + 'mcp-server': 'mcpServers', } /** @@ -80,6 +83,7 @@ export function buildPromoteCopySelection( tables: [], knowledgeBases: [], files: [], + mcpServers: [], } const willResolve = new Set() const apply = ( @@ -100,6 +104,7 @@ export function buildPromoteCopySelection( apply('custom-tool', requested?.customTools) apply('skill', requested?.skills) apply('file', requested?.files) + apply('mcp-server', requested?.mcpServers) return { selection, willResolve } } @@ -110,7 +115,8 @@ export function hasPromoteCopySelection(selection: PromoteCopySelection): boolea selection.skills.length > 0 || selection.tables.length > 0 || selection.knowledgeBases.length > 0 || - selection.files.length > 0 + selection.files.length > 0 || + selection.mcpServers.length > 0 ) } @@ -211,8 +217,9 @@ export async function copyPromoteUnmappedResources(params: { selection: { customTools: selection.customTools, skills: selection.skills, - // Workflow-publishing MCP servers are fork-create-only (never a sync-copy candidate); - // the shared copy pipeline still takes the slot, so pass it empty. + // External MCP servers copy as config rows (like fork); workflow-publishing MCP servers + // are fork-create-only shells (the shared pipeline still takes the slot - pass it empty). + mcpServers: selection.mcpServers, workflowMcpServers: [], tables: selection.tables, knowledgeBases: selection.knowledgeBases, diff --git a/apps/sim/lib/workspaces/fork/promote/promote-plan.test.ts b/apps/sim/ee/workspace-forking/lib/promote/promote-plan.test.ts similarity index 97% rename from apps/sim/lib/workspaces/fork/promote/promote-plan.test.ts rename to apps/sim/ee/workspace-forking/lib/promote/promote-plan.test.ts index f01e4d44a35..ab5b51948a5 100644 --- a/apps/sim/lib/workspaces/fork/promote/promote-plan.test.ts +++ b/apps/sim/ee/workspace-forking/lib/promote/promote-plan.test.ts @@ -5,14 +5,14 @@ import { describe, expect, it } from 'vitest' import type { ForkCopyableLabel, ForkCopyableSourceResource, -} from '@/lib/workspaces/fork/mapping/resources' +} from '@/ee/workspace-forking/lib/mapping/resources' import { assembleForkCopyableUnmapped, buildPromoteWorkflowIdMap, collectForkCopyableIdsByKind, collectForkUnreferencedCopyables, -} from '@/lib/workspaces/fork/promote/promote-plan' -import type { ForkReference } from '@/lib/workspaces/fork/remap/remap-references' +} from '@/ee/workspace-forking/lib/promote/promote-plan' +import type { ForkReference } from '@/ee/workspace-forking/lib/remap/remap-references' const ref = (kind: ForkReference['kind'], sourceId: string): ForkReference => ({ kind, diff --git a/apps/sim/lib/workspaces/fork/promote/promote-plan.ts b/apps/sim/ee/workspace-forking/lib/promote/promote-plan.ts similarity index 95% rename from apps/sim/lib/workspaces/fork/promote/promote-plan.ts rename to apps/sim/ee/workspace-forking/lib/promote/promote-plan.ts index 32289c204fd..5f3a773a1b4 100644 --- a/apps/sim/lib/workspaces/fork/promote/promote-plan.ts +++ b/apps/sim/ee/workspace-forking/lib/promote/promote-plan.ts @@ -3,14 +3,14 @@ import { generateId } from '@sim/utils/id' import { and, eq, isNull } from 'drizzle-orm' import { type ForkCopyableKind, forkCopyableKindSchema } from '@/lib/api/contracts/workspace-fork' import type { DbOrTx } from '@/lib/db/types' -import type { DeployedWorkflowSummary } from '@/lib/workspaces/fork/copy/deploy-bridge' -import type { ForkEdge } from '@/lib/workspaces/fork/lineage/lineage' -import { detectForkCascadeReferences } from '@/lib/workspaces/fork/mapping/cascade' +import type { DeployedWorkflowSummary } from '@/ee/workspace-forking/lib/copy/deploy-bridge' +import type { ForkEdge } from '@/ee/workspace-forking/lib/lineage/lineage' +import { detectForkCascadeReferences } from '@/ee/workspace-forking/lib/mapping/cascade' import { buildForkResolver, getEdgeMappingRows, resourceTypeToForkKind, -} from '@/lib/workspaces/fork/mapping/mapping-store' +} from '@/ee/workspace-forking/lib/mapping/mapping-store' import { type ForkCopyableLabel, type ForkCopyableSourceResource, @@ -18,14 +18,14 @@ import { getWorkspaceEnvKeys, listForkCopyableSourceResources, loadForkCopyableResourceLabels, -} from '@/lib/workspaces/fork/mapping/resources' -import { toScannerBlocks } from '@/lib/workspaces/fork/remap/reference-scan' +} from '@/ee/workspace-forking/lib/mapping/resources' +import { toScannerBlocks } from '@/ee/workspace-forking/lib/remap/reference-scan' import { type ForkReference, type ForkReferenceResolver, type ForkRemapKind, scanWorkflowReferences, -} from '@/lib/workspaces/fork/remap/remap-references' +} from '@/ee/workspace-forking/lib/remap/remap-references' import type { WorkflowState } from '@/stores/workflows/workflow/types' export interface ForkPromotePlanItem { @@ -39,6 +39,8 @@ export interface ForkPromotePlanItem { description: string | null folderId: string | null sortOrder: number + /** Source's public-API flag, carried onto the written target (see copyWorkflowStateIntoTarget). */ + isPublicApi: boolean } } @@ -305,6 +307,7 @@ export async function computeForkPromotePlan(params: { description: source.description, folderId: source.folderId, sortOrder: source.sortOrder, + isPublicApi: source.isPublicApi, }, }) diff --git a/apps/sim/lib/workspaces/fork/promote/promote-run-store.ts b/apps/sim/ee/workspace-forking/lib/promote/promote-run-store.ts similarity index 100% rename from apps/sim/lib/workspaces/fork/promote/promote-run-store.ts rename to apps/sim/ee/workspace-forking/lib/promote/promote-run-store.ts diff --git a/apps/sim/lib/workspaces/fork/promote/promote.test.ts b/apps/sim/ee/workspace-forking/lib/promote/promote.test.ts similarity index 54% rename from apps/sim/lib/workspaces/fork/promote/promote.test.ts rename to apps/sim/ee/workspace-forking/lib/promote/promote.test.ts index e9b2a4f7d5b..efafe557fb6 100644 --- a/apps/sim/lib/workspaces/fork/promote/promote.test.ts +++ b/apps/sim/ee/workspace-forking/lib/promote/promote.test.ts @@ -48,70 +48,103 @@ vi.mock('@/lib/workflows/orchestration/deploy', () => ({ vi.mock('@/lib/workflows/persistence/utils', () => ({ undeployWorkflow: vi.fn(async () => ({ success: true })), })) -vi.mock('@/lib/workspaces/fork/background-work/store', () => ({ +vi.mock('@/ee/workspace-forking/lib/background-work/store', () => ({ startBackgroundWork: vi.fn(), })) -vi.mock('@/lib/workspaces/fork/copy/content-copy-runner', () => ({ +vi.mock('@/ee/workspace-forking/lib/copy/content-copy-runner', () => ({ hasForkContentToCopy: vi.fn(() => false), scheduleForkContentCopy: vi.fn(), })) -vi.mock('@/lib/workspaces/fork/copy/copy-workflows', () => ({ +vi.mock('@/ee/workspace-forking/lib/copy/copy-workflows', () => ({ copyWorkflowStateIntoTarget: vi.fn(), loadTargetDraftSubBlocks: vi.fn(async () => new Map()), loadWorkflowNameRegistry: vi.fn(async () => new Map()), resolveForkFolderMapping: mockResolveFolderMapping, })) -vi.mock('@/lib/workspaces/fork/copy/storage-quota', () => ({ +vi.mock('@/ee/workspace-forking/lib/copy/storage-quota', () => ({ sumForkCopyBytes: mockSumForkCopyBytes, assertForkStorageHeadroom: mockAssertForkStorageHeadroom, })) -vi.mock('@/lib/workspaces/fork/copy/deploy-bridge', () => ({ +vi.mock('@/ee/workspace-forking/lib/copy/deploy-bridge', () => ({ getActiveDeploymentVersionNumbers: vi.fn(async () => new Map()), loadSourceDeployedStates: mockLoadSourceDeployedStates, })) -vi.mock('@/lib/workspaces/fork/lineage/lineage', () => ({ +vi.mock('@/ee/workspace-forking/lib/lineage/lineage', () => ({ acquireForkEdgeLock: vi.fn(), acquireForkTargetLock: vi.fn(), setForkLockTimeout: vi.fn(), })) -vi.mock('@/lib/workspaces/fork/mapping/block-map-store', () => ({ +vi.mock('@/ee/workspace-forking/lib/mapping/block-map-store', () => ({ loadForkBlockMap: mockLoadBlockMap, reconcileForkBlockPairs: vi.fn(), toForkBlockPairs: vi.fn(() => []), })) -vi.mock('@/lib/workspaces/fork/mapping/dependent-value-store', () => ({ +vi.mock('@/ee/workspace-forking/lib/mapping/dependent-value-store', () => ({ loadForkDependentValues: vi.fn(async () => []), reconcileForkDependentValues: vi.fn(), + // Faithful mirror of the real pure translation (unit-tested in dependent-value-store.test.ts), + // so promote's apply/reconcile paths exercise the actual source-doc-id rewrite. + translateForkDependentValues: vi.fn( + ( + values: Array<{ value: string }>, + resolve: (kind: string, sourceId: string) => string | null | undefined + ) => + values.map((entry) => { + if (entry.value === '') return entry + const translated = resolve('knowledge-document', entry.value) + return translated != null && translated !== entry.value + ? { ...entry, value: translated } + : entry + }) + ), })) -vi.mock('@/lib/workspaces/fork/mapping/mapping-store', () => ({ +vi.mock('@/ee/workspace-forking/lib/mapping/mapping-store', () => ({ deleteWorkflowIdentityByIds: vi.fn(), upsertEdgeMappings: vi.fn(), })) -vi.mock('@/lib/workspaces/fork/promote/cleared-refs', () => ({ +vi.mock('@/ee/workspace-forking/lib/promote/cleared-refs', () => ({ collectForkSyncBlockers: mockCollectBlockers, })) -vi.mock('@/lib/workspaces/fork/promote/copy-unmapped', () => ({ - augmentForkResolver: vi.fn((base) => base), +vi.mock('@/ee/workspace-forking/lib/promote/copy-unmapped', () => ({ + // Faithful mirror of the real overlay so a copy's id maps resolve through the augmented + // resolver (the dependent-value translation and MCP meta read depend on it). + augmentForkResolver: vi.fn( + ( + base: (kind: string, sourceId: string) => string | null | undefined, + extra: Map> + ) => + (kind: string, sourceId: string) => + extra.get(kind)?.get(sourceId) ?? base(kind, sourceId) + ), buildPromoteCopySelection: mockBuildCopySelection, copyPromoteUnmappedResources: mockCopyUnmapped, hasPromoteCopySelection: mockHasCopySelection, })) -vi.mock('@/lib/workspaces/fork/promote/promote-plan', () => ({ +vi.mock('@/ee/workspace-forking/lib/promote/promote-plan', () => ({ computeForkPromotePlan: mockComputePlan, })) -vi.mock('@/lib/workspaces/fork/promote/promote-run-store', () => ({ +vi.mock('@/ee/workspace-forking/lib/copy/copy-chats', () => ({ + copyForkChatDeployments: vi.fn(async () => ({ created: 0 })), +})) +vi.mock('@/ee/workspace-forking/lib/copy/workflow-mcp-attachments', () => ({ + reconcileForkWorkflowMcpAttachments: vi.fn(async () => ({ affectedServerIds: [] })), +})) +vi.mock('@/lib/mcp/workflow-mcp-sync', () => ({ + notifyMcpToolServers: vi.fn(), +})) +vi.mock('@/ee/workspace-forking/lib/promote/promote-run-store', () => ({ upsertPromoteRun: mockUpsertPromoteRun, })) -vi.mock('@/lib/workspaces/fork/mapping/resources', () => ({ +vi.mock('@/ee/workspace-forking/lib/mapping/resources', () => ({ getMcpServerMetaByIds: mockGetMcpServerMeta, })) -vi.mock('@/lib/workspaces/fork/remap/block-identity', () => ({ +vi.mock('@/ee/workspace-forking/lib/remap/block-identity', () => ({ buildForkBlockIdResolver: mockBuildBlockIdResolver, })) -vi.mock('@/lib/workspaces/fork/remap/remap-references', () => ({ +vi.mock('@/ee/workspace-forking/lib/remap/remap-references', () => ({ createForkSubBlockTransform: mockCreateTransform, })) -vi.mock('@/lib/workspaces/fork/socket', () => ({ +vi.mock('@/ee/workspace-forking/lib/socket', () => ({ notifyForkWorkflowChanged: vi.fn(), })) vi.mock('@/lib/workspaces/permissions/utils', () => ({ @@ -119,8 +152,10 @@ vi.mock('@/lib/workspaces/permissions/utils', () => ({ })) import { db } from '@sim/db' -import { promoteFork } from '@/lib/workspaces/fork/promote/promote' -import type { ForkPromotePlan } from '@/lib/workspaces/fork/promote/promote-plan' +import { copyWorkflowStateIntoTarget } from '@/ee/workspace-forking/lib/copy/copy-workflows' +import { reconcileForkDependentValues } from '@/ee/workspace-forking/lib/mapping/dependent-value-store' +import { promoteFork } from '@/ee/workspace-forking/lib/promote/promote' +import type { ForkPromotePlan } from '@/ee/workspace-forking/lib/promote/promote-plan' const EDGE = { childWorkspaceId: 'child-ws', parentWorkspaceId: 'parent-ws' } @@ -176,34 +211,52 @@ function promoteParams() { } } -describe('promoteFork gates', () => { - beforeEach(() => { - vi.clearAllMocks() - vi.mocked(db.transaction).mockImplementation( - async (cb: (tx: unknown) => unknown) => cb({}) as never - ) - mockGetUsersWithPermissions.mockResolvedValue([]) - mockLoadSourceDeployedStates.mockResolvedValue({ - deployedWorkflows: [], - sourceStates: new Map(), - }) - mockComputePlan.mockResolvedValue(makePlan()) - mockBuildCopySelection.mockReturnValue({ - selection: EMPTY_SELECTION, - willResolve: new Set(), - }) - mockHasCopySelection.mockReturnValue(false) - mockCollectBlockers.mockResolvedValue([]) - mockLoadBlockMap.mockResolvedValue(new Map()) - mockBuildBlockIdResolver.mockReturnValue((_wf: string, blockId: string) => blockId) - mockResolveFolderMapping.mockResolvedValue(new Map()) - mockUpsertPromoteRun.mockResolvedValue('run-1') - mockGetMcpServerMeta.mockResolvedValue(new Map()) - mockCreateTransform.mockReturnValue((subBlocks: unknown) => subBlocks) - mockSumForkCopyBytes.mockResolvedValue(0) - mockAssertForkStorageHeadroom.mockResolvedValue(undefined) +/** A copy result carrying no content/id maps, for tests that only need the copy to run. */ +function emptyCopyResult() { + return { + contentPlan: { + sourceWorkspaceId: 'src-ws', + childWorkspaceId: 'tgt-ws', + userId: 'user-1', + tables: [], + knowledgeBases: [], + skills: [], + documents: [], + }, + copyIdMapByKind: new Map(), + contentRefMaps: {}, + blobTasks: [], + } +} + +beforeEach(() => { + vi.clearAllMocks() + vi.mocked(db.transaction).mockImplementation( + async (cb: (tx: unknown) => unknown) => cb({}) as never + ) + mockGetUsersWithPermissions.mockResolvedValue([]) + mockLoadSourceDeployedStates.mockResolvedValue({ + deployedWorkflows: [], + sourceStates: new Map(), }) + mockComputePlan.mockResolvedValue(makePlan()) + mockBuildCopySelection.mockReturnValue({ + selection: EMPTY_SELECTION, + willResolve: new Set(), + }) + mockHasCopySelection.mockReturnValue(false) + mockCollectBlockers.mockResolvedValue([]) + mockLoadBlockMap.mockResolvedValue(new Map()) + mockBuildBlockIdResolver.mockReturnValue((_wf: string, blockId: string) => blockId) + mockResolveFolderMapping.mockResolvedValue(new Map()) + mockUpsertPromoteRun.mockResolvedValue('run-1') + mockGetMcpServerMeta.mockResolvedValue(new Map()) + mockCreateTransform.mockReturnValue((subBlocks: unknown) => subBlocks) + mockSumForkCopyBytes.mockResolvedValue(0) + mockAssertForkStorageHeadroom.mockResolvedValue(undefined) +}) +describe('promoteFork gates', () => { it('blocks an over-quota copy selection before any lock, read, or write', async () => { mockSumForkCopyBytes.mockResolvedValue(999_999) mockAssertForkStorageHeadroom.mockRejectedValue( @@ -399,3 +452,171 @@ describe('promoteFork gates', () => { expect(transformOptions.resolveMcpServerMeta('srv-unknown')).toBeUndefined() }) }) + +describe('promoteFork dependent values', () => { + it('unions the dependent-value picks into the copy discovery set (a re-picked document must be copied)', async () => { + mockComputePlan.mockResolvedValue( + makePlan({ + references: [ + { + kind: 'knowledge-document', + sourceId: 'doc-a', + subBlockKey: 'documentSelector', + required: false, + }, + ], + }) + ) + // No container selection: the document candidates alone must trigger the copy pass. + mockHasCopySelection.mockReturnValue(false) + mockCopyUnmapped.mockResolvedValue(emptyCopyResult()) + + await promoteFork({ + ...promoteParams(), + dependentValues: [ + // Duplicates the plan's own scan -> deduped. + { workflowId: 'wf-t', blockId: 'b1', subBlockKey: 'documentSelector', value: 'doc-a' }, + // A fresh pick the source state does not reference -> must join the discovery set. + { workflowId: 'wf-t', blockId: 'b2', subBlockKey: 'documentSelector', value: 'doc-b' }, + // Cleared values are skipped; non-document values ride along (DB-filtered downstream). + { workflowId: 'wf-t', blockId: 'b3', subBlockKey: 'folder', value: '' }, + { workflowId: 'wf-t', blockId: 'b4', subBlockKey: 'folder', value: 'INBOX' }, + ], + }) + + expect(mockCopyUnmapped).toHaveBeenCalledTimes(1) + expect(mockCopyUnmapped.mock.calls[0][0].referencedDocumentIds).toEqual([ + 'doc-a', + 'doc-b', + 'INBOX', + ]) + }) + + it('translates a source document id under a copy-resolved KB for BOTH the written state and the store', async () => { + const item = { + sourceWorkflowId: 'wf-src', + targetWorkflowId: 'wf-tgt', + targetName: 'Flow', + mode: 'replace' as const, + sourceMeta: { name: 'Flow', description: null, folderId: null, sortOrder: 0 }, + } + mockComputePlan.mockResolvedValue(makePlan({ items: [item] })) + mockLoadSourceDeployedStates.mockResolvedValue({ + deployedWorkflows: [], + sourceStates: new Map([ + ['wf-src', { blocks: {}, edges: [], loops: {}, parallels: {}, variables: {} }], + ]), + }) + // The KB is copy-selected; the copy assigns the picked source document its copied id. + mockHasCopySelection.mockReturnValue(true) + mockCopyUnmapped.mockResolvedValue({ + ...emptyCopyResult(), + copyIdMapByKind: new Map([['knowledge-document', new Map([['doc-src', 'doc-copy']])]]), + }) + vi.mocked(copyWorkflowStateIntoTarget).mockResolvedValue({ + targetWorkflowId: 'wf-tgt', + mode: 'replace', + name: 'Flow', + blocksCount: 0, + edgesCount: 0, + subflowsCount: 0, + clearedDependents: [], + blockIdMapping: new Map(), + }) + + const result = await promoteFork({ + ...promoteParams(), + copyResources: { knowledgeBases: ['kb-src'] }, + dependentValues: [ + { + workflowId: 'wf-tgt', + blockId: 'blk-1', + subBlockKey: 'documentSelector', + value: 'doc-src', + }, + ], + }) + + expect(result.blocked).toBeNull() + // The apply map the workflow write receives carries the COPIED id: the dependent-value + // apply runs AFTER the reference remap and wins for its subblock, so a raw source id + // would clobber the remapped value in the written state. + expect(vi.mocked(copyWorkflowStateIntoTarget)).toHaveBeenCalledTimes(1) + const writeParams = vi.mocked(copyWorkflowStateIntoTarget).mock.calls[0][0] + expect(writeParams.dependentOverrides?.get('blk-1')?.get('documentSelector')).toBe('doc-copy') + // The store persists the translated value too, so the next sync (whose parent is then + // MAPPED via the persisted copy mapping) pre-fills a document id that resolves in the target. + expect(vi.mocked(reconcileForkDependentValues)).toHaveBeenCalledWith( + expect.anything(), + 'child-ws', + ['wf-tgt'], + [ + { + targetWorkflowId: 'wf-tgt', + targetBlockId: 'blk-1', + subBlockKey: 'documentSelector', + value: 'doc-copy', + }, + ] + ) + }) + + it('keeps a mapped parent dependent value verbatim (a target-space value never re-translates)', async () => { + const item = { + sourceWorkflowId: 'wf-src', + targetWorkflowId: 'wf-tgt', + targetName: 'Flow', + mode: 'replace' as const, + sourceMeta: { name: 'Flow', description: null, folderId: null, sortOrder: 0 }, + } + mockComputePlan.mockResolvedValue(makePlan({ items: [item] })) + mockLoadSourceDeployedStates.mockResolvedValue({ + deployedWorkflows: [], + sourceStates: new Map([ + ['wf-src', { blocks: {}, edges: [], loops: {}, parallels: {}, variables: {} }], + ]), + }) + // The value joins the discovery candidates, so the copy pass runs - and resolves nothing. + mockCopyUnmapped.mockResolvedValue(emptyCopyResult()) + vi.mocked(copyWorkflowStateIntoTarget).mockResolvedValue({ + targetWorkflowId: 'wf-tgt', + mode: 'replace', + name: 'Flow', + blocksCount: 0, + edgesCount: 0, + subflowsCount: 0, + clearedDependents: [], + blockIdMapping: new Map(), + }) + + await promoteFork({ + ...promoteParams(), + dependentValues: [ + { + workflowId: 'wf-tgt', + blockId: 'blk-1', + subBlockKey: 'documentSelector', + value: 'doc-tgt-existing', + }, + ], + }) + + const writeParams = vi.mocked(copyWorkflowStateIntoTarget).mock.calls[0][0] + expect(writeParams.dependentOverrides?.get('blk-1')?.get('documentSelector')).toBe( + 'doc-tgt-existing' + ) + expect(vi.mocked(reconcileForkDependentValues)).toHaveBeenCalledWith( + expect.anything(), + 'child-ws', + ['wf-tgt'], + [ + { + targetWorkflowId: 'wf-tgt', + targetBlockId: 'blk-1', + subBlockKey: 'documentSelector', + value: 'doc-tgt-existing', + }, + ] + ) + }) +}) diff --git a/apps/sim/lib/workspaces/fork/promote/promote.ts b/apps/sim/ee/workspace-forking/lib/promote/promote.ts similarity index 77% rename from apps/sim/lib/workspaces/fork/promote/promote.ts rename to apps/sim/ee/workspace-forking/lib/promote/promote.ts index c475e8f7d25..6992a59ed1e 100644 --- a/apps/sim/lib/workspaces/fork/promote/promote.ts +++ b/apps/sim/ee/workspace-forking/lib/promote/promote.ts @@ -1,86 +1,91 @@ import { db } from '@sim/db' -import { credential, credentialMember, workflow } from '@sim/db/schema' +import { chat, credential, credentialMember, workflow, workspace } from '@sim/db/schema' import { createLogger } from '@sim/logger' import { getErrorMessage } from '@sim/utils/errors' import { generateId } from '@sim/utils/id' -import { and, eq, inArray } from 'drizzle-orm' +import { and, eq, inArray, isNull } from 'drizzle-orm' import type { ForkSyncBlocker, PromoteCopyResources } from '@/lib/api/contracts/workspace-fork' import type { DbOrTx } from '@/lib/db/types' +import { notifyMcpToolServers } from '@/lib/mcp/workflow-mcp-sync' import { enqueueWorkflowUndeploySideEffects, processWorkflowDeploymentOutboxEvent, } from '@/lib/workflows/deployment-outbox' import { performFullDeploy } from '@/lib/workflows/orchestration/deploy' import { undeployWorkflow } from '@/lib/workflows/persistence/utils' -import { startBackgroundWork } from '@/lib/workspaces/fork/background-work/store' +import { getUsersWithPermissions } from '@/lib/workspaces/permissions/utils' +import { startBackgroundWork } from '@/ee/workspace-forking/lib/background-work/store' import { type ForkContentCopyPayload, hasForkContentToCopy, type SerializableForkContentRefMaps, scheduleForkContentCopy, -} from '@/lib/workspaces/fork/copy/content-copy-runner' -import type { BlobCopyTask } from '@/lib/workspaces/fork/copy/copy-files' -import type { ForkContentPlan } from '@/lib/workspaces/fork/copy/copy-resources' +} from '@/ee/workspace-forking/lib/copy/content-copy-runner' +import { copyForkChatDeployments } from '@/ee/workspace-forking/lib/copy/copy-chats' +import type { BlobCopyTask } from '@/ee/workspace-forking/lib/copy/copy-files' +import type { ForkContentPlan } from '@/ee/workspace-forking/lib/copy/copy-resources' import { copyWorkflowStateIntoTarget, loadTargetDraftSubBlocks, loadWorkflowNameRegistry, resolveForkFolderMapping, -} from '@/lib/workspaces/fork/copy/copy-workflows' +} from '@/ee/workspace-forking/lib/copy/copy-workflows' import { getActiveDeploymentVersionNumbers, loadSourceDeployedStates, -} from '@/lib/workspaces/fork/copy/deploy-bridge' +} from '@/ee/workspace-forking/lib/copy/deploy-bridge' import { assertForkStorageHeadroom, sumForkCopyBytes, -} from '@/lib/workspaces/fork/copy/storage-quota' +} from '@/ee/workspace-forking/lib/copy/storage-quota' +import { reconcileForkWorkflowMcpAttachments } from '@/ee/workspace-forking/lib/copy/workflow-mcp-attachments' import { acquireForkEdgeLock, acquireForkTargetLock, type ForkEdge, setForkLockTimeout, -} from '@/lib/workspaces/fork/lineage/lineage' +} from '@/ee/workspace-forking/lib/lineage/lineage' import { type ForkBlockPair, loadForkBlockMap, reconcileForkBlockPairs, toForkBlockPairs, -} from '@/lib/workspaces/fork/mapping/block-map-store' +} from '@/ee/workspace-forking/lib/mapping/block-map-store' import { type ForkDependentValue, loadForkDependentValues, reconcileForkDependentValues, -} from '@/lib/workspaces/fork/mapping/dependent-value-store' + translateForkDependentValues, +} from '@/ee/workspace-forking/lib/mapping/dependent-value-store' import { deleteWorkflowIdentityByIds, type ForkMappingUpsert, upsertEdgeMappings, -} from '@/lib/workspaces/fork/mapping/mapping-store' -import { getMcpServerMetaByIds } from '@/lib/workspaces/fork/mapping/resources' -import { collectForkSyncBlockers } from '@/lib/workspaces/fork/promote/cleared-refs' +} from '@/ee/workspace-forking/lib/mapping/mapping-store' +import { getMcpServerMetaByIds } from '@/ee/workspace-forking/lib/mapping/resources' +import { collectForkSyncBlockers } from '@/ee/workspace-forking/lib/promote/cleared-refs' import { augmentForkResolver, buildPromoteCopySelection, copyPromoteUnmappedResources, hasPromoteCopySelection, -} from '@/lib/workspaces/fork/promote/copy-unmapped' +} from '@/ee/workspace-forking/lib/promote/copy-unmapped' import { computeForkPromotePlan, type ForkPromotePlan, -} from '@/lib/workspaces/fork/promote/promote-plan' +} from '@/ee/workspace-forking/lib/promote/promote-plan' import { type PromoteRunWorkflowSnapshot, upsertPromoteRun, -} from '@/lib/workspaces/fork/promote/promote-run-store' -import { buildForkBlockIdResolver } from '@/lib/workspaces/fork/remap/block-identity' +} from '@/ee/workspace-forking/lib/promote/promote-run-store' +import { buildForkBlockIdResolver } from '@/ee/workspace-forking/lib/remap/block-identity' import { createForkSubBlockTransform, type ForkReference, type ForkReferenceResolver, -} from '@/lib/workspaces/fork/remap/remap-references' -import { notifyForkWorkflowChanged } from '@/lib/workspaces/fork/socket' -import { getUsersWithPermissions } from '@/lib/workspaces/permissions/utils' + type ForkRemapKind, +} from '@/ee/workspace-forking/lib/remap/remap-references' +import { notifyForkWorkflowChanged } from '@/ee/workspace-forking/lib/socket' const logger = createLogger('WorkspaceForkPromote') @@ -90,6 +95,8 @@ export interface PromoteForkParams { targetWorkspaceId: string direction: 'push' | 'pull' userId: string + /** Initiator's display name, stamped on the sync's content-copy Activity row. */ + actorName?: string /** * The full stored mapping of dependent-field values the caller is committing (target * workflow id + deterministic block id + subblock key -> value). Applied to the target @@ -306,13 +313,14 @@ interface PromoteTxApplied { copyContentRefMaps: SerializableForkContentRefMaps | null /** File blob duplications for copied workspace files, run post-commit by the content-copy runner. */ copyContentBlobTasks: BlobCopyTask[] + /** Workflow-publishing MCP servers whose tool attachments changed, notified post-commit. */ + mcpAttachmentServerIds: string[] } /** * Group flat dependent values into the apply map `target workflow -> block id -> subblock -> value` - * that {@link copyWorkflowStateIntoTarget} consumes. Pure (no DB), so the provided-value path can - * build it before the transaction (it doesn't depend on the plan); the omitted path feeds it the - * loaded store rows inside the tx, where the plan's replace targets are known. + * that {@link copyWorkflowStateIntoTarget} consumes. Pure (no DB). Built inside the tx from the + * TRANSLATED values (see {@link translateForkDependentValues}) once the post-copy resolver exists. */ function groupDependentOverrides( values: ForkDependentValue[] @@ -352,20 +360,20 @@ export async function promoteFork(params: PromoteForkParams): Promise ({ - targetWorkflowId: entry.workflowId, - targetBlockId: entry.blockId, - subBlockKey: entry.subBlockKey, - value: entry.value, - })) - ) + const providedDependentValues: ForkDependentValue[] | null = dependentValuesProvided + ? (params.dependentValues ?? []).map((entry) => ({ + targetWorkflowId: entry.workflowId, + targetBlockId: entry.blockId, + subBlockKey: entry.subBlockKey, + value: entry.value, + })) : null // Copied blob bytes (selected workspace files + selected KBs' document blobs) are @@ -383,6 +391,15 @@ export async function promoteFork(params: PromoteForkParams): Promise m.userId) + // The target workspace's display name seeds carried chat identifiers + // (`{target-workspace}-{workflow}-{randomnum}`); read pre-tx like the other lookups. + const [targetWorkspaceRow] = await db + .select({ name: workspace.name }) + .from(workspace) + .where(eq(workspace.id, targetWorkspaceId)) + .limit(1) + const targetWorkspaceName = targetWorkspaceRow?.name ?? 'workspace' + // Read the source's deployed workflows + states BEFORE the transaction so these // heavy per-workflow reads never check out a second pooled connection from inside // the promote tx (which can deadlock the pool at saturation). The source is @@ -490,15 +507,37 @@ export async function promoteFork(params: PromoteForkParams): Promise reference.kind === 'knowledge-document') - .map((reference) => reference.sourceId) + // Every dependent value this sync will apply, as flat store rows: the provided payload, or + // (omitted) the persisted store for the plan's targets - loaded here, BEFORE the copy, so + // document picks can join the copy's discovery set below. The apply map + reconcile further + // down consume these after translating them through the post-copy resolver. + const flatDependentValues = + providedDependentValues ?? + (await loadForkDependentValues( + tx, + edge.childWorkspaceId, + plan.items.map((item) => item.targetWorkflowId) + )) + + // Knowledge-document ids the synced workflows reference, from the plan's already-scanned + // references (never a re-scan inside this locked tx) - UNIONED with the dependent-value + // picks: a document re-picked in the sync page's reconfigure selector under a copy-resolved + // KB isn't referenced by the source STATE, but must still be copied so the applied pick + // resolves in the target. Non-document values ride along harmlessly: every consumer filters + // candidates through `inArray(document.id, ...)`, so a label or column id matches no row. + const referencedDocumentIds = [ + ...new Set([ + ...plan.references + .filter((reference) => reference.kind === 'knowledge-document') + .map((reference) => reference.sourceId), + ...flatDependentValues.map((entry) => entry.value).filter((value) => value !== ''), + ]), + ] // Run the copy when the user selected resources to copy OR any document is referenced (a // referenced document under an already-mapped KB is auto-copied into that KB so its reference // remaps instead of clearing). It runs only after the required-reference gate above, so a // blocked sync copies nothing. + let copyIdMapByKind: Map> | null = null if (hasPromoteCopySelection(copySelection) || referencedDocumentIds.length > 0) { const copyResult = await copyPromoteUnmappedResources({ tx, @@ -518,17 +557,18 @@ export async function promoteFork(params: PromoteForkParams): Promise mcpServerMetaById.get(targetServerId), + // Copy provenance: a parent resolved through THIS sync's copy selection keeps its + // copy-faithful dependents (a copied table's column picks) instead of clearing them. + isCopiedTarget: (kind, sourceId) => copyIdMapByKind?.get(kind)?.has(sourceId) ?? false, }) // Batch every prior-version read (replace + archive targets) into one query before any @@ -572,16 +615,18 @@ export async function promoteFork(params: PromoteForkParams): Promise block id -> subblock -> value). When the - // caller PROVIDED values it was built pre-tx (plan-independent); apply it and reconcile the - // store below. When OMITTED the store is the sole source of truth - load the existing values - // for the plan's replace targets (one indexed query) and build the map, skipping the reconcile - // below so an omitted field never wipes the saved mapping. - const overridesByWorkflow = - providedOverridesByWorkflow ?? - groupDependentOverrides( - await loadForkDependentValues(tx, edge.childWorkspaceId, replaceTargetIds) - ) + // The dependent-value apply map (target workflow -> block id -> subblock -> value), built + // from the flat values loaded above (the provided payload, or - omitted - the stored + // mapping, which stays the sole source of truth; the reconcile below is skipped then so an + // omitted field never wipes it). Values are translated through the post-copy resolver + // FIRST: the apply runs AFTER the reference remap inside `copyWorkflowStateIntoTarget` and + // wins for its subblock, so a SOURCE document id picked under a copy-resolved KB must + // become the copied counterpart here - otherwise the stale source id would clobber the + // remapped value in the written state. Create targets are included: a value pre-configured + // for a never-synced workflow (keyed by its deterministic target id) applies on the first + // sync that creates it. + const appliedDependentValues = translateForkDependentValues(flatDependentValues, resolver) + const overridesByWorkflow = groupDependentOverrides(appliedDependentValues) // New block pairs recorded by the write loop (blocks added since the last sync), using the // block map + resolver loaded before the would-clear gate above. @@ -662,30 +707,69 @@ export async function promoteFork(params: PromoteForkParams): Promise entry.workflowId)) + await copyForkChatDeployments({ + tx, + pairs: writtenItems.flatMap((item) => + needsConfigurationTargetIds.has(item.targetWorkflowId) + ? [] + : [ + { + sourceWorkflowId: item.sourceWorkflowId, + targetWorkflowId: item.targetWorkflowId, + workflowName: item.sourceMeta.name, + }, + ] + ), + targetWorkspaceName, + userId, + now, + resolveBlockId, + requestId, + }) + + // Mirror workflow-as-MCP-tool attachments onto MAPPED workflow-publishing servers for the + // written pairs: missing target attachments are created, drifted metadata refreshed, and a + // detached source's counterpart archived. The deployment outbox re-derives each affected + // tool's parameter schema when the target deploys below. + const mcpAttachmentResult = await reconcileForkWorkflowMcpAttachments({ + tx, + childWorkspaceId: edge.childWorkspaceId, + sourceIsParent, + now, + writtenPairs: writtenItems.map((item) => ({ + sourceWorkflowId: item.sourceWorkflowId, + targetWorkflowId: item.targetWorkflowId, + })), + }) + // Persist / prune the stored dependent mapping. When the caller PROVIDED values, replace - // every written replace-target's stored set (cleared/removed fields drop out so the store - // equals exactly what was sent) AND prune the archived targets' now-dead rows (their - // workflow no longer exists and has no FK to cascade). Scope the inserted values to the - // delete's workflows so a value for a workflow skipped this pass (its source state + // every written target's stored set (cleared/removed fields drop out so the store equals + // exactly what was applied) AND prune the archived targets' now-dead rows (their workflow + // no longer exists and has no FK to cascade). The TRANSLATED values are persisted - a + // source document id picked under a copy-resolved KB is stored as its copied counterpart, + // so the next sync (whose parent is then MAPPED via the persisted copy mapping) pre-fills + // a value that resolves in the target. Written CREATE targets persist too - they exist + // as of this sync, and their sent values (pre-configured in the mapping editor or the + // modal) must survive as the stored mapping for future syncs. Scope the inserted values + // to the delete's workflows so a value for a workflow skipped this pass (its source state // vanished) can't be inserted without first clearing its old row and trip the unique // constraint. When OMITTED, the store stays the source of truth (already applied above) - - // only prune archived targets, never touch the live replace targets' mapping. - const dependentTargetIds = new Set( - writtenItems.filter((item) => item.mode === 'replace').map((item) => item.targetWorkflowId) - ) + // only prune archived targets, never touch the live targets' mapping. + const dependentTargetIds = new Set(writtenItems.map((item) => item.targetWorkflowId)) if (dependentValuesProvided) { await reconcileForkDependentValues( tx, edge.childWorkspaceId, [...dependentTargetIds, ...plan.archivedTargetIds], - (params.dependentValues ?? []) - .filter((entry) => dependentTargetIds.has(entry.workflowId)) - .map((entry) => ({ - targetWorkflowId: entry.workflowId, - targetBlockId: entry.blockId, - subBlockKey: entry.subBlockKey, - value: entry.value, - })) + appliedDependentValues.filter((entry) => dependentTargetIds.has(entry.targetWorkflowId)) ) } else if (plan.archivedTargetIds.length > 0) { await reconcileForkDependentValues(tx, edge.childWorkspaceId, plan.archivedTargetIds, []) @@ -727,6 +811,15 @@ export async function promoteFork(params: PromoteForkParams): Promise 0) { + await tx + .update(chat) + .set({ archivedAt: now, isActive: false, updatedAt: now }) + .where(and(inArray(chat.workflowId, plan.archivedTargetIds), isNull(chat.archivedAt))) + } const identityEntries: ForkMappingUpsert[] = writtenItems.map((item) => ({ resourceType: 'workflow' as const, @@ -805,6 +898,7 @@ export async function promoteFork(params: PromoteForkParams): Promise 0) { + notifyMcpToolServers(txResult.mcpAttachmentServerIds.map((serverId) => ({ serverId }))) + } + let redeployed = 0 const deployFailures: string[] = [] const deployWarnings: string[] = [] @@ -910,6 +1010,11 @@ export async function promoteFork(params: PromoteForkParams): Promise ({ +vi.mock('@/ee/workspace-forking/lib/lineage/lineage', () => ({ resolveForkEdge: mockResolveForkEdge, acquireForkTargetLock: mockAcquireTargetLock, acquireForkEdgeLock: mockAcquireEdgeLock, setForkLockTimeout: vi.fn(), })) -vi.mock('@/lib/workspaces/fork/promote/promote-run-store', () => ({ +vi.mock('@/ee/workspace-forking/lib/promote/promote-run-store', () => ({ getLatestPromoteRunForTarget: mockGetLatestRun, deleteAllPromoteRunsForTarget: mockDeleteAllRuns, })) -vi.mock('@/lib/workspaces/fork/promote/reactivate-in-tx', () => ({ +vi.mock('@/ee/workspace-forking/lib/promote/reactivate-in-tx', () => ({ reactivateDeployedVersionInTx: mockReactivate, })) @@ -49,7 +49,7 @@ vi.mock('@/lib/workflows/persistence/utils', () => ({ undeployWorkflow: mockUndeploy, })) -vi.mock('@/lib/workspaces/fork/mapping/mapping-store', () => ({ +vi.mock('@/ee/workspace-forking/lib/mapping/mapping-store', () => ({ deleteWorkflowIdentityByIds: mockDeleteIdentity, })) @@ -58,12 +58,12 @@ vi.mock('@/lib/workflows/deployment-outbox', () => ({ processWorkflowDeploymentOutboxEvent: mockProcessOutbox, })) -vi.mock('@/lib/workspaces/fork/socket', () => ({ +vi.mock('@/ee/workspace-forking/lib/socket', () => ({ notifyForkWorkflowChanged: mockNotify, })) import { db } from '@sim/db' -import { rollbackFork } from '@/lib/workspaces/fork/promote/rollback' +import { rollbackFork } from '@/ee/workspace-forking/lib/promote/rollback' const EDGE = { childWorkspaceId: 'child-ws', parentWorkspaceId: 'parent-ws' } diff --git a/apps/sim/lib/workspaces/fork/promote/rollback.ts b/apps/sim/ee/workspace-forking/lib/promote/rollback.ts similarity index 90% rename from apps/sim/lib/workspaces/fork/promote/rollback.ts rename to apps/sim/ee/workspace-forking/lib/promote/rollback.ts index 86fe6d7996f..42c8eac4b0d 100644 --- a/apps/sim/lib/workspaces/fork/promote/rollback.ts +++ b/apps/sim/ee/workspace-forking/lib/promote/rollback.ts @@ -1,26 +1,26 @@ import { db } from '@sim/db' -import { workflow } from '@sim/db/schema' +import { chat, workflow } from '@sim/db/schema' import { createLogger } from '@sim/logger' -import { inArray } from 'drizzle-orm' +import { and, inArray, isNull } from 'drizzle-orm' import { enqueueWorkflowUndeploySideEffects, processWorkflowDeploymentOutboxEvent, } from '@/lib/workflows/deployment-outbox' import { undeployWorkflow } from '@/lib/workflows/persistence/utils' -import { ForkError } from '@/lib/workspaces/fork/lineage/authz' +import { ForkError } from '@/ee/workspace-forking/lib/lineage/authz' import { acquireForkEdgeLock, acquireForkTargetLock, resolveForkEdge, setForkLockTimeout, -} from '@/lib/workspaces/fork/lineage/lineage' -import { deleteWorkflowIdentityByIds } from '@/lib/workspaces/fork/mapping/mapping-store' +} from '@/ee/workspace-forking/lib/lineage/lineage' +import { deleteWorkflowIdentityByIds } from '@/ee/workspace-forking/lib/mapping/mapping-store' import { deleteAllPromoteRunsForTarget, getLatestPromoteRunForTarget, -} from '@/lib/workspaces/fork/promote/promote-run-store' -import { reactivateDeployedVersionInTx } from '@/lib/workspaces/fork/promote/reactivate-in-tx' -import { notifyForkWorkflowChanged } from '@/lib/workspaces/fork/socket' +} from '@/ee/workspace-forking/lib/promote/promote-run-store' +import { reactivateDeployedVersionInTx } from '@/ee/workspace-forking/lib/promote/reactivate-in-tx' +import { notifyForkWorkflowChanged } from '@/ee/workspace-forking/lib/socket' const logger = createLogger('WorkspaceForkRollback') @@ -209,6 +209,14 @@ export async function rollbackFork(params: RollbackForkParams): Promise type DependentRef = Extract @@ -45,17 +45,19 @@ const dependentRef = (parentKind: DependentRef['parentKind']): DependentRef => ( describe('forkSyncBlockerReasonFor', () => { it('maps a live unmapped copyable-kind reference to unmapped-copyable (map or copy)', () => { - for (const kind of ['table', 'knowledge-base', 'file', 'custom-tool', 'skill'] as const) { + for (const kind of [ + 'table', + 'knowledge-base', + 'file', + 'custom-tool', + 'skill', + // External MCP servers are copyable too (config rows; OAuth tokens never copied). + 'mcp-server', + ] as const) { expect(forkSyncBlockerReasonFor(referenceRef(kind, 'src-1'))).toBe('unmapped-copyable') } }) - it('maps a live unmapped MCP server to unmapped-mcp-server (map-only; no copy option)', () => { - expect(forkSyncBlockerReasonFor(referenceRef('mcp-server', 'srv-1'))).toBe( - 'unmapped-mcp-server' - ) - }) - it('maps a source-deleted reference of ANY kind to source-deleted (no exemption)', () => { expect(forkSyncBlockerReasonFor(referenceRef('table', 'tbl-gone', true))).toBe('source-deleted') expect(forkSyncBlockerReasonFor(referenceRef('mcp-server', 'srv-gone', true))).toBe( @@ -96,7 +98,7 @@ describe('selectForkSyncBlockingRefs / toForkSyncBlockers', () => { const blocking = selectForkSyncBlockingRefs(refs) expect(blocking.map(({ ref, reason }) => [ref.sourceId, reason])).toEqual([ ['tbl-1', 'unmapped-copyable'], - ['srv-1', 'unmapped-mcp-server'], + ['srv-1', 'unmapped-copyable'], ['sk-gone', 'source-deleted'], ['wf-other', 'workflow-missing'], ]) diff --git a/apps/sim/lib/workspaces/fork/promote/sync-blockers.ts b/apps/sim/ee/workspace-forking/lib/promote/sync-blockers.ts similarity index 91% rename from apps/sim/lib/workspaces/fork/promote/sync-blockers.ts rename to apps/sim/ee/workspace-forking/lib/promote/sync-blockers.ts index b5d2bbed6c2..a5369209c1d 100644 --- a/apps/sim/lib/workspaces/fork/promote/sync-blockers.ts +++ b/apps/sim/ee/workspace-forking/lib/promote/sync-blockers.ts @@ -24,15 +24,13 @@ const COPYABLE_BLOCKER_KINDS: ReadonlySet = new Set(forkCopyableKindSche * remove the reference). * - `reference` + source deleted -> `source-deleted` (map the dead id to a live target * resource, or fix/archive the source workflow). - * - `reference` + external MCP server -> `unmapped-mcp-server` (map it; MCP servers are never - * copied). - * - `reference` + copyable kind -> `unmapped-copyable` (map it or select it for copy). + * - `reference` + copyable kind (incl. external MCP servers) -> `unmapped-copyable` (map it + * or select it for copy). */ export function forkSyncBlockerReasonFor(ref: ForkClearedRef): ForkSyncBlockerReason | null { if (ref.cause === 'workflow') return 'workflow-missing' if (ref.cause !== 'reference') return null if (ref.sourceDeleted) return 'source-deleted' - if (ref.kind === 'mcp-server') return 'unmapped-mcp-server' if (COPYABLE_BLOCKER_KINDS.has(ref.kind)) return 'unmapped-copyable' // Credential / env-var / knowledge-document never reach the cleared list (excluded by the // collector; the first two gate via the kind-level required gate, documents follow their KB). diff --git a/apps/sim/lib/workspaces/fork/remap/block-identity.test.ts b/apps/sim/ee/workspace-forking/lib/remap/block-identity.test.ts similarity index 98% rename from apps/sim/lib/workspaces/fork/remap/block-identity.test.ts rename to apps/sim/ee/workspace-forking/lib/remap/block-identity.test.ts index fc782916caa..c2ccf55d98d 100644 --- a/apps/sim/lib/workspaces/fork/remap/block-identity.test.ts +++ b/apps/sim/ee/workspace-forking/lib/remap/block-identity.test.ts @@ -8,7 +8,7 @@ import { deriveForkBlockId, EMPTY_FORK_BLOCK_MAP, type ForkBlockMap, -} from '@/lib/workspaces/fork/remap/block-identity' +} from '@/ee/workspace-forking/lib/remap/block-identity' describe('deriveForkBlockId', () => { const targetA = 'wf-target-a' diff --git a/apps/sim/lib/workspaces/fork/remap/block-identity.ts b/apps/sim/ee/workspace-forking/lib/remap/block-identity.ts similarity index 100% rename from apps/sim/lib/workspaces/fork/remap/block-identity.ts rename to apps/sim/ee/workspace-forking/lib/remap/block-identity.ts diff --git a/apps/sim/lib/workspaces/fork/remap/fork-bootstrap.ts b/apps/sim/ee/workspace-forking/lib/remap/fork-bootstrap.ts similarity index 64% rename from apps/sim/lib/workspaces/fork/remap/fork-bootstrap.ts rename to apps/sim/ee/workspace-forking/lib/remap/fork-bootstrap.ts index 2e4bdb0f124..34224a38b48 100644 --- a/apps/sim/lib/workspaces/fork/remap/fork-bootstrap.ts +++ b/apps/sim/ee/workspace-forking/lib/remap/fork-bootstrap.ts @@ -4,7 +4,7 @@ import { clearDependentsOnRemap, type ForkRemapKind, remapForkSubBlocks, -} from '@/lib/workspaces/fork/remap/remap-references' +} from '@/ee/workspace-forking/lib/remap/remap-references' /** * Resolves a source resource reference to its copied child id, or null when the @@ -29,7 +29,21 @@ export function createForkBootstrapTransform( canonicalModes?: CanonicalModeOverrides ) => SubBlockRecord { return (subBlocks, blockType, canonicalModes) => { - const result = remapForkSubBlocks(subBlocks, resolveCopied, 'create') - return clearDependentsOnRemap(result.subBlocks, blockType, result.remappedKeys, canonicalModes) + // Every resolution at fork-create IS a copy (the resolver is the copy id map), so all + // remapped keys carry copy provenance - copy-faithful dependents (column picks) survive. + // `blockType`/`canonicalModes` activate the mode policy: active basic remaps, active + // advanced (manual) passes through with its dependents, dormant members clear. + const result = remapForkSubBlocks(subBlocks, resolveCopied, 'create', { + blockType, + canonicalModes, + isCopiedTarget: (kind, sourceId) => resolveCopied(kind, sourceId) != null, + }) + return clearDependentsOnRemap( + result.subBlocks, + blockType, + result.remappedKeys, + canonicalModes, + result.copyRemappedKeys + ) } } diff --git a/apps/sim/lib/workspaces/fork/remap/reference-scan.ts b/apps/sim/ee/workspace-forking/lib/remap/reference-scan.ts similarity index 97% rename from apps/sim/lib/workspaces/fork/remap/reference-scan.ts rename to apps/sim/ee/workspace-forking/lib/remap/reference-scan.ts index c0085f59fc3..cf0e9190cbb 100644 --- a/apps/sim/lib/workspaces/fork/remap/reference-scan.ts +++ b/apps/sim/ee/workspace-forking/lib/remap/reference-scan.ts @@ -2,7 +2,7 @@ import type { CanonicalModeOverrides } from '@/lib/workflows/subblocks/visibilit import { type ForkRemapKind, scanWorkflowReferences, -} from '@/lib/workspaces/fork/remap/remap-references' +} from '@/ee/workspace-forking/lib/remap/remap-references' import type { WorkflowState } from '@/stores/workflows/workflow/types' /** A block reduced to what the reference scanner reads (incl. canonical context for detection). */ diff --git a/apps/sim/lib/workspaces/fork/remap/remap-content-refs.test.ts b/apps/sim/ee/workspace-forking/lib/remap/remap-content-refs.test.ts similarity index 99% rename from apps/sim/lib/workspaces/fork/remap/remap-content-refs.test.ts rename to apps/sim/ee/workspace-forking/lib/remap/remap-content-refs.test.ts index a6acca88bf7..ba06a73c683 100644 --- a/apps/sim/lib/workspaces/fork/remap/remap-content-refs.test.ts +++ b/apps/sim/ee/workspace-forking/lib/remap/remap-content-refs.test.ts @@ -6,7 +6,7 @@ import { type ForkContentRefMaps, rewriteForkContentRefs, rewriteForkResourceUrls, -} from '@/lib/workspaces/fork/remap/remap-content-refs' +} from '@/ee/workspace-forking/lib/remap/remap-content-refs' const SRC_KEY = 'workspace/SRC/1700000000000-deadbeef-photo.png' const DST_KEY = 'workspace/DST/1700000000001-cafebabe-photo.png' diff --git a/apps/sim/lib/workspaces/fork/remap/remap-content-refs.ts b/apps/sim/ee/workspace-forking/lib/remap/remap-content-refs.ts similarity index 100% rename from apps/sim/lib/workspaces/fork/remap/remap-content-refs.ts rename to apps/sim/ee/workspace-forking/lib/remap/remap-content-refs.ts diff --git a/apps/sim/lib/workspaces/fork/remap/remap-files.test.ts b/apps/sim/ee/workspace-forking/lib/remap/remap-files.test.ts similarity index 96% rename from apps/sim/lib/workspaces/fork/remap/remap-files.test.ts rename to apps/sim/ee/workspace-forking/lib/remap/remap-files.test.ts index e1c5fb909a1..93a55edc3b7 100644 --- a/apps/sim/lib/workspaces/fork/remap/remap-files.test.ts +++ b/apps/sim/ee/workspace-forking/lib/remap/remap-files.test.ts @@ -2,7 +2,7 @@ * @vitest-environment node */ import { describe, expect, it } from 'vitest' -import { remapForkFileUploadValue } from '@/lib/workspaces/fork/remap/remap-files' +import { remapForkFileUploadValue } from '@/ee/workspace-forking/lib/remap/remap-files' const map = (entries: Record) => (key: string) => entries[key] ?? null diff --git a/apps/sim/lib/workspaces/fork/remap/remap-files.ts b/apps/sim/ee/workspace-forking/lib/remap/remap-files.ts similarity index 100% rename from apps/sim/lib/workspaces/fork/remap/remap-files.ts rename to apps/sim/ee/workspace-forking/lib/remap/remap-files.ts diff --git a/apps/sim/lib/workspaces/fork/remap/remap-references.test.ts b/apps/sim/ee/workspace-forking/lib/remap/remap-references.test.ts similarity index 76% rename from apps/sim/lib/workspaces/fork/remap/remap-references.test.ts rename to apps/sim/ee/workspace-forking/lib/remap/remap-references.test.ts index 94ccc3845e0..a5be6bc02da 100644 --- a/apps/sim/lib/workspaces/fork/remap/remap-references.test.ts +++ b/apps/sim/ee/workspace-forking/lib/remap/remap-references.test.ts @@ -20,7 +20,8 @@ vi.mock('@/tools/params', () => ({ })) import type { SubBlockRecord } from '@/lib/workflows/persistence/remap-internal-ids' -import { createForkBootstrapTransform } from '@/lib/workspaces/fork/remap/fork-bootstrap' +import { getBlock } from '@/blocks/registry' +import { createForkBootstrapTransform } from '@/ee/workspace-forking/lib/remap/fork-bootstrap' import { applyDependentOverrides, clearDependentsOnRemap, @@ -31,8 +32,7 @@ import { remapForkSubBlocks, remapToolBlockResources, scanWorkflowReferences, -} from '@/lib/workspaces/fork/remap/remap-references' -import { getBlock } from '@/blocks/registry' +} from '@/ee/workspace-forking/lib/remap/remap-references' const blockConfigs: Record = { testblock: { @@ -424,7 +424,7 @@ describe('MCP block server remap follows the tool selection (optimistic verbatim expect(result.arguments.value).toBe('') }) - it('fork-create: servers are not copied, so the reference clears and dependents clear with it', () => { + it('fork-create: an UNSELECTED server clears, and its tool + arguments clear with it', () => { vi.mocked(getBlock).mockReturnValue(mcpBlock()) const transform = createForkBootstrapTransform(() => null) const result = transform(mcpSubBlocks(), 'mcp') @@ -433,6 +433,46 @@ describe('MCP block server remap follows the tool selection (optimistic verbatim expect(result.arguments.value).toBe('') }) + it('fork-create: a COPIED server remaps and the tool selection + arguments follow it', () => { + // The fork resolver now carries `mcp-server` entries for copied external servers, so the + // MCP block is preserved end-to-end: server -> copied id, tool -> embedded id swapped + // (name verbatim, re-resolved by the child's first discovery), arguments untouched. + vi.mocked(getBlock).mockReturnValue(mcpBlock()) + const transform = createForkBootstrapTransform(mapServer as never) + const result = transform(mcpSubBlocks(), 'mcp') + expect(result.server.value).toBe('mcp-tgt9') + expect(result.tool.value).toBe('mcp-tgt9-search_docs') + expect(result.arguments.value).toBe('{"query":"hello"}') + }) + + it('fork-create: a COPIED server rewrites an agent tool-input MCP entry (serverId + toolId)', () => { + vi.mocked(getBlock).mockReturnValue( + blockWith([{ id: 'tools', title: 'Tools', type: 'tool-input' }]) + ) + const transform = createForkBootstrapTransform(mapServer as never) + const result = transform( + { + tools: { + id: 'tools', + type: 'tool-input', + value: [ + { + type: 'mcp', + title: 'Search Docs', + params: { serverId: 'mcp-src1', toolName: 'search_docs' }, + toolId: 'mcp-src1-search_docs', + }, + ], + }, + }, + 'agent' + ) + const [tool] = result.tools.value as Array<{ params: Record; toolId: string }> + expect(tool.params.serverId).toBe('mcp-tgt9') + expect(tool.params.toolName).toBe('search_docs') + expect(tool.toolId).toBe('mcp-tgt9-search_docs') + }) + it('remap layer: the tool follow-rewrite is not registered as a remapped parent key', () => { // Only `server` may drive dependent clears; the followed tool must not (its own // dependent - arguments - is preserved with it). @@ -921,7 +961,8 @@ describe('collectClearedDependents', () => { blockId: 'b1', blockName: 'Agent', subBlockKey: 'tools[0].folder', - title: 'Gmail: Label', + title: 'Label', + toolName: 'Gmail', required: true, }, ]) @@ -1107,3 +1148,316 @@ describe('readTargetDraftDependentValue', () => { expect(readTargetDraftDependentValue(target, source, 'tools[0].folder')).toBe('INBOX') }) }) + +/** The knowledge block's canonical shape: KB + document pairs, tag fields as KB dependents. */ +const knowledgePairBlock = () => + blockWith([ + { + id: 'knowledgeBaseSelector', + title: 'KB', + type: 'knowledge-base-selector', + canonicalParamId: 'knowledgeBaseId', + mode: 'basic', + }, + { + id: 'manualKnowledgeBaseId', + title: 'KB ID', + type: 'short-input', + canonicalParamId: 'knowledgeBaseId', + mode: 'advanced', + }, + { + id: 'documentSelector', + title: 'Document', + type: 'document-selector', + dependsOn: ['knowledgeBaseSelector'], + }, + { + id: 'tagFilters', + title: 'Tag Filters', + type: 'knowledge-tag-filters', + dependsOn: ['knowledgeBaseSelector'], + }, + { + id: 'documentTags', + title: 'Document Tags', + type: 'document-tag-entry', + dependsOn: ['knowledgeBaseSelector'], + }, + ]) + +describe('canonical mode policy (fork/promote)', () => { + const copyMap: Record = { + 'knowledge-base:kb-src': 'kb-copy', + 'knowledge-document:doc-src': 'doc-copy', + } + const resolveCopy = (kind: string, id: string) => copyMap[`${kind}:${id}`] ?? null + + it('basic mode: remaps the selector + document, preserves tag fields, clears the dormant manual member', () => { + vi.mocked(getBlock).mockReturnValue(knowledgePairBlock()) + const transform = createForkBootstrapTransform(resolveCopy as never) + const result = transform( + { + knowledgeBaseSelector: entry('knowledgeBaseSelector', 'knowledge-base-selector', 'kb-src'), + manualKnowledgeBaseId: entry('manualKnowledgeBaseId', 'short-input', 'stale-manual-kb'), + documentSelector: entry('documentSelector', 'document-selector', 'doc-src'), + tagFilters: entry('tagFilters', 'knowledge-tag-filters', '[{"tagName":"team"}]'), + documentTags: entry('documentTags', 'document-tag-entry', '[{"tagName":"team"}]'), + }, + 'knowledge', + { knowledgeBaseId: 'basic' } + ) + expect(result.knowledgeBaseSelector.value).toBe('kb-copy') + expect(result.documentSelector.value).toBe('doc-copy') + // Name/slot-based tag fields stay valid on the copy (tag definitions copy verbatim). + expect(result.tagFilters.value).toBe('[{"tagName":"team"}]') + expect(result.documentTags.value).toBe('[{"tagName":"team"}]') + // Only the active mode matters: the dormant manual member's stale value is cleared. + expect(result.manualKnowledgeBaseId.value).toBe('') + }) + + it('advanced (manual) mode: passes the manual value + its dependents through verbatim, clears the dormant selector', () => { + vi.mocked(getBlock).mockReturnValue(knowledgePairBlock()) + const transform = createForkBootstrapTransform(resolveCopy as never) + const result = transform( + { + knowledgeBaseSelector: entry('knowledgeBaseSelector', 'knowledge-base-selector', 'kb-src'), + manualKnowledgeBaseId: entry('manualKnowledgeBaseId', 'short-input', 'kb-manual'), + documentSelector: entry('documentSelector', 'document-selector', 'doc-src'), + tagFilters: entry('tagFilters', 'knowledge-tag-filters', '[{"tagName":"team"}]'), + }, + 'knowledge', + { knowledgeBaseId: 'advanced' } + ) + // The manual value is user-owned: kept verbatim, never remapped. + expect(result.manualKnowledgeBaseId.value).toBe('kb-manual') + // Its dependents ride along verbatim too - no remap, no clear. + expect(result.documentSelector.value).toBe('doc-src') + expect(result.tagFilters.value).toBe('[{"tagName":"team"}]') + // The dormant basic selector is cleared outright (not remapped to the copy). + expect(result.knowledgeBaseSelector.value).toBe('') + }) + + it('advanced mode: nothing is detected as a reference (no mapping requirement)', () => { + vi.mocked(getBlock).mockReturnValue(knowledgePairBlock()) + const scan = scanWorkflowReferences( + [ + { + id: 'b1', + name: 'KB', + type: 'knowledge', + subBlocks: { + knowledgeBaseSelector: entry( + 'knowledgeBaseSelector', + 'knowledge-base-selector', + 'kb-src' + ), + manualKnowledgeBaseId: entry('manualKnowledgeBaseId', 'short-input', 'kb-manual'), + documentSelector: entry('documentSelector', 'document-selector', 'doc-src'), + }, + canonicalModes: { knowledgeBaseId: 'advanced' }, + }, + ], + () => null + ) + expect(scan.references).toEqual([]) + }) + + it('does not detect a condition-hidden subblock (its value never executes)', () => { + vi.mocked(getBlock).mockReturnValue( + blockWith([ + { id: 'mode', title: 'Mode', type: 'dropdown' }, + { + id: 'cloudKb', + title: 'Cloud KB', + type: 'knowledge-base-selector', + condition: { field: 'mode', value: 'cloud' }, + }, + { + id: 'localKb', + title: 'Local KB', + type: 'knowledge-base-selector', + condition: { field: 'mode', value: 'local' }, + }, + ]) + ) + const scan = scanWorkflowReferences( + [ + { + id: 'b1', + name: 'Pi', + type: 'pi', + subBlocks: { + mode: entry('mode', 'dropdown', 'local'), + cloudKb: entry('cloudKb', 'knowledge-base-selector', 'kb-hidden'), + localKb: entry('localKb', 'knowledge-base-selector', 'kb-active'), + }, + }, + ], + () => null + ) + expect(scan.references.map((ref) => ref.sourceId)).toEqual(['kb-active']) + }) + + it('nested tool: remaps a canonical-keyed param (and both keys when aliased)', () => { + const tool = { + type: 'tblblock', + toolId: 'tblblock_run', + params: { tableId: 'tbl-src', tableSelector: 'tbl-src' }, + } + const result = remapToolBlockResources(tool, { + resolve: (kind, id) => (kind === 'table' && id === 'tbl-src' ? 'tbl-dst' : null), + resolveFileKey: () => null, + clearUnresolved: true, + blockConfigs: { + tblblock: { + subBlocks: [ + { + id: 'tableSelector', + title: 'Table', + type: 'table-selector', + canonicalParamId: 'tableId', + mode: 'basic', + }, + { + id: 'manualTableId', + title: 'Table ID', + type: 'short-input', + canonicalParamId: 'tableId', + mode: 'advanced', + }, + ], + }, + }, + }) + expect(result.params).toEqual({ tableId: 'tbl-dst', tableSelector: 'tbl-dst' }) + }) + + it('nested tool: keeps a reference-shaped canonical value verbatim (user-owned)', () => { + const tool = { + type: 'tblblock', + toolId: 'tblblock_run', + params: { tableId: '' }, + } + const result = remapToolBlockResources(tool, { + resolve: () => null, + resolveFileKey: () => null, + clearUnresolved: true, + blockConfigs: { + tblblock: { + subBlocks: [ + { + id: 'tableSelector', + title: 'Table', + type: 'table-selector', + canonicalParamId: 'tableId', + }, + ], + }, + }, + }) + expect(result).toBe(tool) + }) + + it('nested tool: preserves tag filters under a remapped parent, clears them under a cleared parent', () => { + const kbToolConfigs = { + kbblock: { + subBlocks: [ + { id: 'knowledgeBaseId', title: 'KB', type: 'knowledge-base-selector' }, + { + id: 'tagFilters', + title: 'Tag Filters', + type: 'knowledge-tag-filters', + dependsOn: ['knowledgeBaseId'], + }, + ] as SubBlockConfig[], + }, + } + const tool = () => ({ + type: 'kbblock', + toolId: 'kbblock_run', + params: { knowledgeBaseId: 'kb-src', tagFilters: '[{"tagName":"team"}]' }, + }) + const remapped = remapToolBlockResources(tool(), { + resolve: (kind, id) => (kind === 'knowledge-base' && id === 'kb-src' ? 'kb-dst' : null), + resolveFileKey: () => null, + clearUnresolved: true, + blockConfigs: kbToolConfigs, + }) + expect(remapped.params).toEqual({ + knowledgeBaseId: 'kb-dst', + tagFilters: '[{"tagName":"team"}]', + }) + const cleared = remapToolBlockResources(tool(), { + resolve: () => null, + resolveFileKey: () => null, + clearUnresolved: true, + blockConfigs: kbToolConfigs, + }) + expect(cleared.params).toEqual({ knowledgeBaseId: '', tagFilters: '' }) + }) + + it('preserves a column selection under a COPIED table, clears it under a mapped one', () => { + const tableBlock = () => + blockWith([ + { + id: 'tableSelector', + title: 'Table', + type: 'table-selector', + canonicalParamId: 'tableId', + mode: 'basic', + }, + { + id: 'manualTableId', + title: 'Table ID', + type: 'short-input', + canonicalParamId: 'tableId', + mode: 'advanced', + }, + { + id: 'conflictColumnSelector', + title: 'Conflict Column', + type: 'column-selector', + dependsOn: ['tableSelector'], + }, + ]) + const subBlocks = (): SubBlockRecord => ({ + tableSelector: entry('tableSelector', 'table-selector', 'tbl-src'), + conflictColumnSelector: entry('conflictColumnSelector', 'column-selector', 'col_a'), + }) + vi.mocked(getBlock).mockReturnValue(tableBlock()) + // Fork-create: the table is a COPY (identical column ids) - the column pick survives. + const forkTransform = createForkBootstrapTransform(((kind: string, id: string) => + kind === 'table' && id === 'tbl-src' ? 'tbl-copy' : null) as never) + const forked = forkTransform(subBlocks(), 'table') + expect(forked.tableSelector.value).toBe('tbl-copy') + expect(forked.conflictColumnSelector.value).toBe('col_a') + // Promote onto a MAPPED (different) table: column ids differ - the pick clears (re-pick flow). + const mappedTransform = createForkSubBlockTransform((kind, id) => + kind === 'table' && id === 'tbl-src' ? 'tbl-mapped' : null + ) + const mapped = mappedTransform(subBlocks(), 'table') + expect(mapped.tableSelector.value).toBe('tbl-mapped') + expect(mapped.conflictColumnSelector.value).toBe('') + }) + + it('collectClearedDependents skips a dormant canonical member (only the active mode matters)', () => { + vi.mocked(getBlock).mockReturnValue(knowledgePairBlock()) + const targetDraft: SubBlockRecord = { + knowledgeBaseSelector: entry('knowledgeBaseSelector', 'knowledge-base-selector', 'kb-old'), + manualKnowledgeBaseId: entry('manualKnowledgeBaseId', 'short-input', 'stale-manual'), + documentSelector: entry('documentSelector', 'document-selector', 'doc-old'), + } + // The merge cleared the dormant manual member and the document; only the document (an + // active dependent) is flagged - the dormant manual slot is not a lost configuration. + const merged: SubBlockRecord = { + knowledgeBaseSelector: entry('knowledgeBaseSelector', 'knowledge-base-selector', 'kb-new'), + manualKnowledgeBaseId: entry('manualKnowledgeBaseId', 'short-input', ''), + documentSelector: entry('documentSelector', 'document-selector', ''), + } + const fields = collectClearedDependents('knowledge', 'b1', 'KB', targetDraft, merged, { + knowledgeBaseId: 'basic', + }) + expect(fields.map((field) => field.subBlockKey)).toEqual(['documentSelector']) + }) +}) diff --git a/apps/sim/lib/workspaces/fork/remap/remap-references.ts b/apps/sim/ee/workspace-forking/lib/remap/remap-references.ts similarity index 63% rename from apps/sim/lib/workspaces/fork/remap/remap-references.ts rename to apps/sim/ee/workspace-forking/lib/remap/remap-references.ts index 679ccdedd0f..aae84339baa 100644 --- a/apps/sim/lib/workspaces/fork/remap/remap-references.ts +++ b/apps/sim/ee/workspace-forking/lib/remap/remap-references.ts @@ -25,16 +25,19 @@ import { evaluateSubBlockCondition, isCanonicalPair, isNonEmptyValue, + resolveActiveCanonicalValue, resolveCanonicalMode, + scopeCanonicalModesForTool, } from '@/lib/workflows/subblocks/visibility' import type { ParsedStoredTool } from '@/lib/workflows/tool-input/types' +import { getBlock } from '@/blocks/registry' +import type { SubBlockConfig } from '@/blocks/types' +import { getDependsOnFields, getSubBlocksDependingOnChange } from '@/blocks/utils' import { collectForkFileUploadKeys, remapForkFileUploadValue, -} from '@/lib/workspaces/fork/remap/remap-files' -import { getBlock } from '@/blocks/registry' -import type { SubBlockConfig } from '@/blocks/types' -import { getSubBlocksDependingOnChange } from '@/blocks/utils' +} from '@/ee/workspace-forking/lib/remap/remap-files' +import { isEnvVarReference, isReference } from '@/executor/constants' /** * Resource kinds the fork remapper rewrites across workspaces, derived from the @@ -90,6 +93,26 @@ export const REGISTRY_KIND_TO_FORK_KIND: Partial< // {@link remapForkSubBlocks}) and `clearDependentsOnRemap` exempts it. When the server // is CLEARED (unmapped / fork-create) the tool still clears as a dependent. +/** + * Dependent subblock types whose values are name/slot-based rather than id-based, so they stay + * valid on a COPIED parent (tag definitions are copied verbatim - same names, same slots) and on a + * MAPPED parent (mapping asserts the resources are equivalent). The dependent-clear passes preserve + * these when their parent was remapped to a non-empty target; a CLEARED parent still clears them. + */ +const PRESERVED_NAME_BASED_DEPENDENT_TYPES = new Set([ + 'knowledge-tag-filters', + 'document-tag-entry', +]) + +/** + * Dependent subblock types preserved ONLY when their parent was remapped via a COPY: a copied + * table duplicates its schema verbatim (identical column ids), so a column selection stays valid + * on the copy - while a MAPPED (different) table has its own column ids, so the value clears and + * the reconfigure flow offers a re-pick. Matches how filter/sort builders (no `dependsOn`) already + * carry over on a copy. + */ +const PRESERVED_UNDER_COPY_DEPENDENT_TYPES = new Set(['column-selector']) + /** Matches `{{ENV_KEY}}` references inside subblock values; shared with cascade detection. */ export const ENV_REF_PATTERN = /\{\{\s*([A-Za-z_][A-Za-z0-9_]*)\s*\}\}/g @@ -154,6 +177,111 @@ export interface RemapSubBlocksResult { unmapped: ForkReference[] /** Subblock keys whose resource id was rewritten/cleared this pass (the `dependsOn` parents). */ remappedKeys: Set + /** + * The subset of {@link remappedKeys} whose new target is a COPY of the source resource + * (per the caller's `isCopiedTarget`), so copy-faithful dependents (a copied table's column + * selection) can be preserved instead of cleared. Empty when no provenance was supplied. + */ + copyRemappedKeys: Set +} + +/** + * The canonical-pair mode questions every fork/promote surface asks of a subblock key. + * A pair is two SUBBLOCKS with different ids sharing one `canonicalParamId`; the block's + * `canonicalModes[canonicalId]` (falling back to the value heuristic) picks the ACTIVE member. + * The policy the gates encode: only the active member is real - an active basic selector is + * remapped and requires mapping, an active advanced (manual) member and its dependents pass + * through verbatim, and a dormant member's value is cleared and never detected. + */ +export interface CanonicalModeGates { + /** The key is a pair member that is NOT the pair's active member. */ + isDormantMember: (subBlockKey: string) => boolean + /** The key is the pair's ACTIVE advanced member - the live, user-owned manual field. */ + isActiveManualMember: (subBlockKey: string) => boolean + /** A direct `dependsOn` parent of this key is a pair in advanced (manual) mode. */ + isManualParentDependent: (subBlockKey: string) => boolean + /** The pair containing (or named by) this id resolves to advanced (manual) mode. */ + isAdvancedActiveGroup: (memberOrCanonicalId: string) => boolean + /** The key's `condition` evaluates false against the serializer's params view. */ + isConditionHidden: (subBlockKey: string) => boolean +} + +const NO_GATES: CanonicalModeGates = { + isDormantMember: () => false, + isActiveManualMember: () => false, + isManualParentDependent: () => false, + isAdvancedActiveGroup: () => false, + isConditionHidden: () => false, +} + +/** + * Build the {@link CanonicalModeGates} for one block (or nested tool) from its subblock configs + * and a flat id -> value map (top-level subblock values, or a tool's params). One canonical + * index and one mode resolution feed every gate, so all surfaces answer identically. Mode + * resolution uses the RAW values (member ids only); condition evaluation uses a separate view + * augmented with each pair's ACTIVE value under its canonical id, mirroring how the serializer + * exposes params to conditions. With no configs (unknown block type) every gate is a no-op: + * everything is detected and nothing passes through, the conservative default. + */ +export function createCanonicalModeGates( + configSubBlocks: SubBlockConfig[] | undefined, + values: Record, + canonicalModes?: CanonicalModeOverrides +): CanonicalModeGates { + if (!configSubBlocks || configSubBlocks.length === 0) return NO_GATES + const canonicalIndex = buildCanonicalIndex(configSubBlocks) + const configByBaseKey = new Map( + configSubBlocks.filter((cfg) => cfg.id).map((cfg) => [cfg.id, cfg]) + ) + const conditionValues = { ...values } + for (const [canonicalId, group] of Object.entries(canonicalIndex.groupsById)) { + if (conditionValues[canonicalId] === undefined) { + conditionValues[canonicalId] = resolveActiveCanonicalValue(group, values, canonicalModes) + } + } + + const groupFor = (memberOrCanonicalId: string) => { + const canonicalId = + canonicalIndex.canonicalIdBySubBlockId[memberOrCanonicalId] ?? memberOrCanonicalId + const group = canonicalIndex.groupsById[canonicalId] + return group && isCanonicalPair(group) ? group : undefined + } + const baseKeyOf = (subBlockKey: string) => subBlockKey.replace(/_\d+$/, '') + + const isAdvancedActiveGroup = (memberOrCanonicalId: string): boolean => { + const group = groupFor(memberOrCanonicalId) + if (!group) return false + return resolveCanonicalMode(group, values, canonicalModes) === 'advanced' + } + + return { + isDormantMember: (subBlockKey) => { + const baseKey = baseKeyOf(subBlockKey) + const group = groupFor(baseKey) + if (!group || !canonicalIndex.canonicalIdBySubBlockId[baseKey]) return false + return isAdvancedActiveGroup(baseKey) !== group.advancedIds.includes(baseKey) + }, + isActiveManualMember: (subBlockKey) => { + const baseKey = baseKeyOf(subBlockKey) + const group = groupFor(baseKey) + if (!group || !group.advancedIds.includes(baseKey)) return false + return isAdvancedActiveGroup(baseKey) + }, + isManualParentDependent: (subBlockKey) => { + const cfg = configByBaseKey.get(baseKeyOf(subBlockKey)) + if (!cfg?.dependsOn) return false + return getDependsOnFields(cfg.dependsOn).some((parent) => isAdvancedActiveGroup(parent)) + }, + isAdvancedActiveGroup, + isConditionHidden: (subBlockKey) => { + const cfg = configByBaseKey.get(baseKeyOf(subBlockKey)) + if (!cfg?.condition) return false + return !evaluateSubBlockCondition( + cfg.condition as Parameters[0], + conditionValues + ) + }, + } } /** Per-block context for the fork remap. `blockType`/`canonicalModes` gate DETECTION (not rewrite). */ @@ -166,6 +294,12 @@ export interface RemapForkContext { canonicalModes?: CanonicalModeOverrides /** Target MCP server row lookup for rewriting remapped tool-input entries' server metadata. */ resolveMcpServerMeta?: ForkMcpServerMetaResolver + /** + * Whether a resolved (kind, sourceId) target is a COPY of the source (fork-create: always; + * promote: the copy-selection overlay). Feeds `copyRemappedKeys` so copy-faithful dependents + * (a copied table's column selection) survive the dependent-clear pass. + */ + isCopiedTarget?: (kind: ForkRemapKind, sourceId: string) => boolean } function remapEnvInValue( @@ -212,6 +346,13 @@ interface ToolBlockRemapOptions { clearUnresolved: boolean /** Injected block configs (production falls back to the block registry). */ blockConfigs?: Parameters[0]['blockConfigs'] + /** Copy provenance for a resolved target (see {@link RemapForkContext.isCopiedTarget}). */ + isCopiedTarget?: (kind: ForkRemapKind, sourceId: string) => boolean + /** + * The owning BLOCK's `data.canonicalModes` (keys scoped `${toolType}:${canonicalId}` for + * nested tools), so the active canonical member per pair matches the tool-input UI. + */ + parentCanonicalModes?: CanonicalModeOverrides } /** @@ -240,12 +381,33 @@ export function remapToolBlockResources( } const remappedParamIds = new Set() - // Id-keyed resource params (credential / triggerCredentials / manual* overrides): - // walked from the raw params so they're caught even when their config is filtered - // out by a reactive condition (the registry loop below would otherwise miss them). + // Mode policy for the tool's canonical pairs, mirroring the top-level pass: only the ACTIVE + // member matters. A DORMANT member key is cleared outright (no record, no dependent clearing); + // an ACTIVE MANUAL parent passes its dependents through verbatim. Modes resolve exactly as the + // tool-input UI does: the block-level overrides scoped to this tool, then the value heuristic. + const toolValues: Record = + typeof tool.operation === 'string' ? { operation: tool.operation, ...params } : { ...params } + const scopedModes = scopeCanonicalModesForTool(opts.parentCanonicalModes, tool.type) + const toolBlockSubBlocks = (opts.blockConfigs?.[tool.type] ?? getBlock(tool.type))?.subBlocks + const gates = createCanonicalModeGates(toolBlockSubBlocks, toolValues, scopedModes) + + // Clear DORMANT member keys first: a stale inactive value must not survive the copy (and must + // never be recorded). Not a dependent-clear seed - the pair's ACTIVE member carries the live + // value, and only ITS remap clears dependents. + for (const paramKey of Object.keys(params)) { + if (!gates.isDormantMember(paramKey)) continue + const currentValue = params[paramKey] + if (currentValue == null || currentValue === '') continue + setParam(paramKey, '') + } + + // Id-keyed resource params (credential / triggerCredentials overrides): walked from the raw + // params so they're caught even when their config is filtered out by a reactive condition + // (the registry loop below would otherwise miss them). Dormant members were cleared above. for (const paramId of Object.keys(params)) { const overrideKind = getToolParamOverrideKind(paramId) if (!overrideKind) continue + if (gates.isDormantMember(paramId)) continue const currentValue = params[paramId] if (typeof currentValue !== 'string' || !currentValue) continue const target = opts.resolve(overrideKind, currentValue) @@ -270,7 +432,11 @@ export function remapToolBlockResources( } let configs: ReturnType try { - configs = getToolInputParamConfigs({ tool: toolView, blockConfigs: opts.blockConfigs }) + configs = getToolInputParamConfigs({ + tool: toolView, + parentCanonicalModes: opts.parentCanonicalModes, + blockConfigs: opts.blockConfigs, + }) } catch (error) { // Unknown block / resolver failure: don't crash the fork/promote, but log so a // real bug isn't masked. Nested resource ids in this tool stay as-is. @@ -281,72 +447,154 @@ export function remapToolBlockResources( return nextParams ? { ...tool, params: nextParams } : tool } + // Subblock ids whose value changed, seeding the dependent-clear walk below (the walk runs on + // subblock ids; `remappedParamIds` tracks the PARAM KEYS written, which for a canonical pair + // can be the `canonicalParamId` rather than the subblock id). + const remappedSubBlockIds = new Set(remappedParamIds) + /** Subblock ids remapped via a COPY, so copy-faithful dependents (column picks) survive. */ + const copyRemappedSubBlockIds = new Set() + for (const { paramId, config } of configs) { if (getToolParamOverrideKind(paramId)) continue const definition = getWorkflowSearchSubBlockResourceDefinition(config) if (!definition) continue - const currentValue = (nextParams ?? params)[paramId] - - if (definition.kind === 'file') { - // file-upload (workspace file) remaps by storage key; file-selector (external - // provider id) carries over unchanged. Each key is recorded as a `file` reference so - // a nested tool's workspace file surfaces in the scan / unmapped set and can be copied. - if (config.type !== 'file-upload') continue - for (const fileKey of collectForkFileUploadKeys(currentValue)) { - opts.record?.('file', fileKey, opts.resolveFileKey(fileKey) != null) - } - const remapped = remapForkFileUploadValue(currentValue, opts.resolveFileKey) - if (remapped !== currentValue) { - setParam(paramId, remapped) - remappedParamIds.add(paramId) + // Belt-and-braces: the params helper already returns only each pair's ACTIVE member, but a + // dormant member slipping through must never remap - in advanced mode the shared + // `canonicalParamId` params key holds the user-owned manual value. + if (gates.isDormantMember(paramId)) continue + // A dependent scoped to an ACTIVE MANUAL parent rides the manual value - the parent is + // user-owned and never remapped, so the dependent passes through verbatim too. + if (gates.isManualParentDependent(paramId)) continue + // A stored tool's params key resources by the subblock id OR by the pair's + // `canonicalParamId` (the tool-input UI writes the canonical key) - and legacy rows can + // carry both. Remap every present key so no alias keeps a stale source id. + const paramKeys = [paramId, config.canonicalParamId].filter( + (key): key is string => typeof key === 'string' && key.length > 0 + ) + + for (const paramKey of new Set(paramKeys)) { + const currentValue = (nextParams ?? params)[paramKey] + if (currentValue == null) continue + + if (definition.kind === 'file') { + // file-upload (workspace file) remaps by storage key; file-selector (external + // provider id) carries over unchanged. Each key is recorded as a `file` reference so + // a nested tool's workspace file surfaces in the scan / unmapped set and can be copied. + if (config.type !== 'file-upload') continue + for (const fileKey of collectForkFileUploadKeys(currentValue)) { + opts.record?.('file', fileKey, opts.resolveFileKey(fileKey) != null) + } + const remapped = remapForkFileUploadValue(currentValue, opts.resolveFileKey) + if (remapped !== currentValue) { + setParam(paramKey, remapped) + remappedParamIds.add(paramKey) + remappedSubBlockIds.add(paramId) + } + continue } - continue - } - const forkKind = REGISTRY_KIND_TO_FORK_KIND[definition.kind] - if (!forkKind) continue - - const refs = parseWorkflowSearchSubBlockResources(currentValue, config) - if (refs.length === 0) continue - - let value = currentValue - const seen = new Set() - for (const ref of refs) { - if (seen.has(ref.rawValue)) continue - seen.add(ref.rawValue) - const target = opts.resolve(forkKind, ref.rawValue) - const mapped = target != null - opts.record?.(forkKind, ref.rawValue, mapped) - if (mapped) { - if (target !== ref.rawValue) { - const replaced = definition.codec.replace(value, ref.rawValue, target) + const forkKind = REGISTRY_KIND_TO_FORK_KIND[definition.kind] + if (!forkKind) continue + + const refs = parseWorkflowSearchSubBlockResources(currentValue, config) + if (refs.length === 0) continue + + let value: unknown = currentValue + const seen = new Set() + for (const ref of refs) { + if (seen.has(ref.rawValue)) continue + seen.add(ref.rawValue) + // A canonical param key is also the advanced (manual) member's write target, so it can + // hold user-owned references (`` / `{{ENV}}`). Those are never workspace ids: + // keep them verbatim (the manual escape hatch), don't record or clear them. + if (isReference(ref.rawValue) || isEnvVarReference(ref.rawValue)) continue + const target = opts.resolve(forkKind, ref.rawValue) + const mapped = target != null + opts.record?.(forkKind, ref.rawValue, mapped) + if (mapped) { + if (target !== ref.rawValue) { + const replaced = definition.codec.replace(value, ref.rawValue, target) + if (replaced.success) { + value = replaced.nextValue + if (opts.isCopiedTarget?.(forkKind, ref.rawValue)) { + copyRemappedSubBlockIds.add(paramId) + } + } + } + } else if (opts.clearUnresolved) { + // Drop only this unresolved entry (blank it - empties are filtered at parse + // time), so a mixed copied/uncopied multi-value field keeps its copied refs. + const replaced = definition.codec.replace(value, ref.rawValue, '') if (replaced.success) value = replaced.nextValue } - } else if (opts.clearUnresolved) { - // Drop only this unresolved entry (blank it - empties are filtered at parse - // time), so a mixed copied/uncopied multi-value field keeps its copied refs. - const replaced = definition.codec.replace(value, ref.rawValue, '') - if (replaced.success) value = replaced.nextValue } - } - if (value !== currentValue) { - setParam(paramId, value) - remappedParamIds.add(paramId) + if (value !== currentValue) { + setParam(paramKey, value) + remappedParamIds.add(paramKey) + remappedSubBlockIds.add(paramId) + } } } - if (remappedParamIds.size > 0) { - const toolBlockConfig = opts.blockConfigs?.[tool.type] ?? getBlock(tool.type) - const toolSubBlocks = toolBlockConfig?.subBlocks - if (toolSubBlocks) { - const currentParams = nextParams ?? params - for (const paramId of remappedParamIds) { - for (const clear of getWorkflowSearchDependentClears(toolSubBlocks, paramId)) { - if (remappedParamIds.has(clear.subBlockId)) continue - const existing = currentParams[clear.subBlockId] + if (remappedSubBlockIds.size > 0 && toolBlockSubBlocks) { + const configBySubBlockId = new Map( + toolBlockSubBlocks.filter((cfg) => cfg.id).map((cfg) => [cfg.id, cfg]) + ) + const currentParams = nextParams ?? params + const readParam = (cfg: SubBlockConfig | undefined, subBlockId: string): unknown => { + const direct = currentParams[subBlockId] + if (direct != null && direct !== '') return direct + const canonicalKey = cfg?.canonicalParamId + return canonicalKey ? currentParams[canonicalKey] : direct + } + // A params key equal to a pair's shared `canonicalParamId` is also the advanced (manual) + // member's write target. When the pair resolves to advanced, that key holds the + // user-owned manual value - verbatim by policy, so the clear pass must not blank it. + const isManualCanonicalValue = (cfg: SubBlockConfig | undefined, key: string): boolean => + cfg?.canonicalParamId === key && gates.isAdvancedActiveGroup(key) + for (const subBlockId of remappedSubBlockIds) { + const parentCfg = configBySubBlockId.get(subBlockId) + const parentRemappedNonEmpty = isNonEmptyValue(readParam(parentCfg, subBlockId)) + const parentCopied = parentRemappedNonEmpty && copyRemappedSubBlockIds.has(subBlockId) + for (const clear of getWorkflowSearchDependentClears(toolBlockSubBlocks, subBlockId)) { + const dependentCfg = configBySubBlockId.get(clear.subBlockId) + // A verbatim manual-parent dependent is never cleared, even when reachable from a + // second (remapped) parent. + if (gates.isManualParentDependent(clear.subBlockId)) continue + // Tag fields are name/slot-based, portable onto a copied or mapped-equivalent + // parent - preserve them when the parent remapped to a target instead of clearing. + // A COPIED parent additionally keeps copy-faithful dependents (column picks - the + // copy duplicates the table schema verbatim, so column ids stay valid). + if ( + parentRemappedNonEmpty && + dependentCfg && + (PRESERVED_NAME_BASED_DEPENDENT_TYPES.has(dependentCfg.type) || + (parentCopied && PRESERVED_UNDER_COPY_DEPENDENT_TYPES.has(dependentCfg.type))) + ) { + continue + } + const clearKeys = new Set( + [clear.subBlockId, dependentCfg?.canonicalParamId].filter( + (key): key is string => typeof key === 'string' && key.length > 0 + ) + ) + // A dependent that was itself remapped followed the parent onto the target - + // keep it (matching the top-level pass), under whichever key it was written. + if ([...clearKeys].some((key) => remappedParamIds.has(key))) continue + for (const clearKey of clearKeys) { + const existing = currentParams[clearKey] if (existing === '' || existing == null) continue - setParam(clear.subBlockId, '') + // User-owned references (`` / `{{ENV}}`) resolve at runtime and are + // never scoped to the old parent's id space - keep them verbatim. + if ( + typeof existing === 'string' && + (isReference(existing) || isEnvVarReference(existing)) + ) { + continue + } + if (isManualCanonicalValue(dependentCfg, clearKey)) continue + setParam(clearKey, '') } } } @@ -362,6 +610,10 @@ interface ForkToolInputOptions { record?: (kind: ForkRemapKind, sourceId: string, mapped: boolean) => void /** Target MCP server row lookup for rewriting a remapped MCP entry's server metadata. */ resolveMcpServerMeta?: ForkMcpServerMetaResolver + /** Copy provenance for a resolved target (see {@link RemapForkContext.isCopiedTarget}). */ + isCopiedTarget?: (kind: ForkRemapKind, sourceId: string) => boolean + /** Block-level canonical-mode overrides (`${toolType}:`-scoped for nested tools). */ + parentCanonicalModes?: CanonicalModeOverrides } /** @@ -440,6 +692,8 @@ function remapForkToolInputValue( resolveFileKey: (key) => resolve('file', key) ?? null, record: opts.record, clearUnresolved: opts.clearUnresolved, + isCopiedTarget: opts.isCopiedTarget, + parentCanonicalModes: opts.parentCanonicalModes, }) if (remapped !== tool) changed = true return [remapped] @@ -501,6 +755,7 @@ export function remapForkSubBlocks( const references = new Map() const unmapped = new Map() const remappedKeys = new Set() + const copyRemappedKeys = new Set() /** MCP server ids remapped to a DIFFERENT mapped target this pass (source id -> target id). */ const mcpServerRemaps = new Map() @@ -510,24 +765,19 @@ export function remapForkSubBlocks( if (!mapped) unmapped.set(key, reference) } - // DETECTION gate: a DORMANT canonical member's stale value must not be recorded as a reference - // (so it is never offered as a required mapping / copyable / usage and can't gate sync). The value - // REWRITE below is untouched - both basic + advanced ids are still remapped. Needs `blockType` to - // build the canonical index; callers that omit it (create-mode transforms) keep today's detection, - // and with `canonicalModes` absent the value heuristic keeps a populated member active (no-op). - const canonicalIndex = context?.blockType - ? buildCanonicalIndex(getBlock(context.blockType)?.subBlocks ?? []) - : undefined - const detectionValues = canonicalIndex ? buildSubBlockValues(subBlocks) : {} - const isDormantCanonicalMember = (key: string): boolean => { - if (!canonicalIndex) return false - const baseKey = key.replace(/_\d+$/, '') - const canonicalId = canonicalIndex.canonicalIdBySubBlockId[baseKey] - const group = canonicalId ? canonicalIndex.groupsById[canonicalId] : undefined - if (!group || !isCanonicalPair(group)) return false - const activeMode = resolveCanonicalMode(group, detectionValues, context?.canonicalModes) - return (activeMode === 'advanced') !== group.advancedIds.includes(baseKey) - } + // Mode policy (see {@link createCanonicalModeGates}): only the ACTIVE canonical member is a + // real reference. An active BASIC selector is remapped + detected (mapping/copy/blockers); an + // active ADVANCED (manual) member - and every dependent scoped to it - passes through VERBATIM + // (user-owned, never remapped, never a mapping requirement); a DORMANT member's value is + // CLEARED outright (below) so no stale id ever survives in an inactive slot. A condition-hidden + // subblock is still rewritten but not detected. Needs `blockType` for the config; an unknown + // block type gets no gating (everything detected, nothing passed through - the conservative + // default). + const gates = createCanonicalModeGates( + context?.blockType ? getBlock(context.blockType)?.subBlocks : undefined, + buildSubBlockValues(subBlocks), + context?.canonicalModes + ) for (const [subBlockKey, subBlock] of Object.entries(subBlocks)) { if (!subBlock || typeof subBlock !== 'object') { @@ -544,9 +794,19 @@ export function remapForkSubBlocks( ) const forkKind = definition ? REGISTRY_KIND_TO_FORK_KIND[definition.kind] : undefined - if (definition && forkKind && subBlockType) { - // A dormant canonical member is rewritten (below) but NOT detected as a reference. - const isDormant = isDormantCanonicalMember(subBlockKey) + // Mode policy per key: a DORMANT canonical member's value is cleared outright (only the + // active mode matters - a stale inactive value must not survive the copy); a dependent + // under a MANUAL (advanced-active) parent passes through verbatim; a condition-hidden + // subblock is rewritten but never detected. + const dormant = gates.isDormantMember(subBlockKey) + const verbatimManualDependent = !dormant && gates.isManualParentDependent(subBlockKey) + const detectionSkipped = + dormant || verbatimManualDependent || gates.isConditionHidden(subBlockKey) + if (dormant && isNonEmptyValue(value)) { + value = '' + } + + if (definition && forkKind && subBlockType && !verbatimManualDependent) { const parsed = parseWorkflowSearchSubBlockResources(value, { type: subBlockType as SubBlockType, }) @@ -565,12 +825,17 @@ export function remapForkSubBlocks( } const target = resolve(forkKind, ref.rawValue) const mapped = target != null - if (!isDormant) recordReference(`${forkKind}:${ref.rawValue}`, reference, mapped) + if (!detectionSkipped) recordReference(`${forkKind}:${ref.rawValue}`, reference, mapped) if (mapped) { if (target !== ref.rawValue) { if (forkKind === 'mcp-server') mcpServerRemaps.set(ref.rawValue, target) const replaceResult = definition.codec.replace(value, ref.rawValue, target) - if (replaceResult.success) value = replaceResult.nextValue + if (replaceResult.success) { + value = replaceResult.nextValue + if (context?.isCopiedTarget?.(forkKind, ref.rawValue)) { + copyRemappedKeys.add(subBlockKey) + } + } } } else if (clearUnresolved) { // Drop only this unresolved entry (blank it - empties are filtered at @@ -588,6 +853,7 @@ export function remapForkSubBlocks( // key once the file has been copied; an unmapped (uncopied) key is dropped by the remap // below. `file-selector` (external provider ids) is untouched. for (const fileKey of collectForkFileUploadKeys(value)) { + if (detectionSkipped) break recordReference( `file:${fileKey}`, { @@ -603,7 +869,8 @@ export function remapForkSubBlocks( } value = remapForkFileUploadValue(value, (sourceKey) => resolve('file', sourceKey) ?? null) } else if (subBlockType === 'tool-input' || subBlockType === 'skill-input') { - const record = (kind: ForkRemapKind, sourceId: string, mapped: boolean) => + const record = (kind: ForkRemapKind, sourceId: string, mapped: boolean) => { + if (detectionSkipped) return recordReference( `${kind}:${sourceId}`, { @@ -616,21 +883,27 @@ export function remapForkSubBlocks( }, mapped ) + } value = subBlockType === 'tool-input' ? remapForkToolInputValue(value, resolve, { clearUnresolved, record, resolveMcpServerMeta: context?.resolveMcpServerMeta, + isCopiedTarget: context?.isCopiedTarget, + parentCanonicalModes: context?.canonicalModes, }) : remapForkSkillInputValue(value, resolve, { clearUnresolved, record }) } if (value !== valueBeforeResource) remappedKeys.add(subBlockKey) - // Promote rewrites `{{ENV}}` refs via the resolver; fork preserves them by name. + // Promote rewrites `{{ENV}}` refs via the resolver; fork preserves them by name. A hidden + // field's ref is rewritten (kept verbatim when unmapped) but not recorded - it never + // executes, so it must not become a required sync blocker. if (mode === 'promote') { value = remapEnvInValue(value, resolve, (sourceId, mapped) => { + if (detectionSkipped) return recordReference( `env-var:${sourceId}`, { @@ -680,6 +953,7 @@ export function remapForkSubBlocks( references: Array.from(references.values()), unmapped: Array.from(unmapped.values()), remappedKeys, + copyRemappedKeys, } } @@ -689,20 +963,26 @@ export function remapForkSubBlocks( * Slack channel, a sheet tab) never carries a stale id into the target. Uses * the same dependent walk as search-replace (canonical-pair aware, transitive * over `dependsOn` chains) so fork/promote and in-editor search-replace clear - * identically - with ONE remap-specific exemption: an `mcp-tool-selector` under - * an `mcp-server-selector` parent that was REMAPPED to a mapped target (its - * post-remap value is non-empty) is preserved along with its own dependents - * (the tool's arguments), because mapping asserts the servers are equivalent - * and {@link remapForkSubBlocks} already followed the selection onto the target - * server. A CLEARED server (unmapped / fork-create) still clears its dependents. - * Children of an unchanged parent are preserved; a no-op for unknown block - * types or when nothing was remapped. + * identically - with two remap-specific exemptions for dependents that stay + * valid on the remapped target: an `mcp-tool-selector` under an + * `mcp-server-selector` parent REMAPPED to a mapped target (its post-remap + * value is non-empty) is preserved along with its own dependents (the tool's + * arguments), because mapping asserts the servers are equivalent and + * {@link remapForkSubBlocks} already followed the selection onto the target + * server; and the name/slot-based tag fields (`knowledge-tag-filters`, + * `document-tag-entry`) are preserved under any parent remapped to a non-empty + * target - a copy duplicates the tag definitions verbatim and a mapping asserts + * equivalence. A CLEARED parent (unmapped / fork-create) still clears its + * dependents. Children of an unchanged parent are preserved; a no-op for + * unknown block types or when nothing was remapped. */ export function clearDependentsOnRemap( subBlocks: SubBlockRecord, blockType: string, remappedKeys: ReadonlySet, - canonicalModes?: CanonicalModeOverrides + canonicalModes?: CanonicalModeOverrides, + /** Keys remapped via a COPY (see {@link RemapSubBlocksResult.copyRemappedKeys}). */ + copyRemappedKeys?: ReadonlySet ): SubBlockRecord { if (remappedKeys.size === 0) return subBlocks const config = getBlock(blockType) @@ -713,16 +993,11 @@ export function clearDependentsOnRemap( // (only the active mode is serialized). With `canonicalModes` absent the value heuristic keeps a // populated basic member active, so this is a no-op for the normal case; the gate only bites the // toggle-with-stale-dormant edge (advanced active + a dormant basic that was remapped). - const canonicalIndex = buildCanonicalIndex(config.subBlocks) - const values = buildSubBlockValues(subBlocks) - const isDormantCanonicalMember = (key: string): boolean => { - const baseKey = key.replace(/_\d+$/, '') - const canonicalId = canonicalIndex.canonicalIdBySubBlockId[baseKey] - const group = canonicalId ? canonicalIndex.groupsById[canonicalId] : undefined - if (!group || !isCanonicalPair(group)) return false - const mode = resolveCanonicalMode(group, values, canonicalModes) - return (mode === 'advanced') !== group.advancedIds.includes(baseKey) - } + const gates = createCanonicalModeGates( + config.subBlocks, + buildSubBlockValues(subBlocks), + canonicalModes + ) // The exemption's parent test: an mcp-server selector whose POST-remap value is non-empty was // remapped to a mapped target (a cleared one is empty), so its tool selection is preserved. @@ -735,27 +1010,48 @@ export function clearDependentsOnRemap( return parent && typeof parent === 'object' ? isNonEmptyValue(parent.value) : false } - // The preserve decision is hoisted out of the per-key walk and keyed on the SELECTOR (not on + // A parent key remapped to a non-empty target (a cleared one is empty post-remap): its + // name/slot-based dependents (tag filters / document tags) stay valid on the target - + // mapping asserts equivalence and a copy duplicates the tag definitions verbatim. + const isRemappedToNonEmpty = (key: string): boolean => { + const parent = subBlocks[key] + return parent && typeof parent === 'object' ? isNonEmptyValue(parent.value) : false + } + + // The preserve decision is hoisted out of the per-key walk and keyed on the DEPENDENT (not on // which remapped key reaches it): `toClear` is a union across per-key BFS passes (each with its // own `visited`), so an in-loop exemption holds only against the exempting key - a second - // remapped key (or a longer dependsOn path) reaching the same tool selector would re-add it. - // Unreachable with today's registry (the tool selector's only dependsOn parent is its server), - // but this makes the exemption independent of key order and path by construction. - const preservedMcpToolSelectors = new Set() + // remapped key (or a longer dependsOn path) reaching the same dependent would re-add it. + // Preserved: an `mcp-tool-selector` under a remapped (non-empty) `mcp-server-selector`, and the + // name-based tag fields under ANY parent remapped to a non-empty target. + const preservedDependents = new Set() for (const key of remappedKeys) { - if (isDormantCanonicalMember(key) || !isRemappedMcpServerParent(key)) continue + if (gates.isDormantMember(key)) continue + const mcpParent = isRemappedMcpServerParent(key) + const nonEmptyParent = isRemappedToNonEmpty(key) + const copiedParent = nonEmptyParent && (copyRemappedKeys?.has(key) ?? false) + if (!mcpParent && !nonEmptyParent) continue for (const dependent of getSubBlocksDependingOnChange(config.subBlocks, key)) { - if (dependent.id && dependent.type === 'mcp-tool-selector') { - preservedMcpToolSelectors.add(dependent.id) + if (!dependent.id) continue + if (mcpParent && dependent.type === 'mcp-tool-selector') { + preservedDependents.add(dependent.id) + } + if (nonEmptyParent && PRESERVED_NAME_BASED_DEPENDENT_TYPES.has(dependent.type)) { + preservedDependents.add(dependent.id) + } + if (copiedParent && PRESERVED_UNDER_COPY_DEPENDENT_TYPES.has(dependent.type)) { + preservedDependents.add(dependent.id) } } } - // Same BFS as `getWorkflowSearchDependentClears`, with the preserved tool selector's subtree - // pruned (skipping it keeps its own dependents - the arguments - out of the clear set too). + // Same BFS as `getWorkflowSearchDependentClears`, with each preserved dependent's subtree + // pruned (skipping it keeps its own dependents - e.g. a tool's arguments - out of the clear + // set). A dependent under an ACTIVE MANUAL parent is verbatim by policy (the manual value is + // never remapped), so it is pruned the same way. const toClear = new Set() for (const key of remappedKeys) { - if (isDormantCanonicalMember(key)) continue + if (gates.isDormantMember(key)) continue const visited = new Set([key]) const queue = [key] while (queue.length > 0) { @@ -763,7 +1059,8 @@ export function clearDependentsOnRemap( if (!current) continue for (const dependent of getSubBlocksDependingOnChange(config.subBlocks, current)) { if (!dependent.id || visited.has(dependent.id)) continue - if (preservedMcpToolSelectors.has(dependent.id)) continue + if (preservedDependents.has(dependent.id)) continue + if (gates.isManualParentDependent(dependent.id)) continue visited.add(dependent.id) if (!remappedKeys.has(dependent.id)) toClear.add(dependent.id) queue.push(dependent.id) @@ -776,6 +1073,17 @@ export function clearDependentsOnRemap( const existing = subBlocks[id] if (!existing || typeof existing !== 'object') continue if (existing.value === '' || existing.value == null) continue + // User-owned references (`` / `{{ENV}}`) resolve at runtime and are never + // scoped to the old parent's id space - keep them verbatim. + if ( + typeof existing.value === 'string' && + (isReference(existing.value) || isEnvVarReference(existing.value)) + ) { + continue + } + // A live manual (advanced) member is user-owned and verbatim by policy - a parent remap + // must not blank it (matching how manual values are never remapped). A dormant one may. + if (gates.isActiveManualMember(id)) continue next ??= { ...subBlocks } next[id] = { ...existing, value: '' } } @@ -790,7 +1098,10 @@ export interface NeedsConfigurationField { blockId: string blockName: string subBlockKey: string + /** Plain field title (e.g. `Label`), never a `Tool: Field` composite. */ title: string + /** Nested `tool-input` tool display name when the field lives under a tool. */ + toolName?: string required: boolean } @@ -815,7 +1126,8 @@ function collectClearedToolParamDependents( blockName: string, targetCurrentValue: unknown, mergedValue: unknown, - out: NeedsConfigurationField[] + out: NeedsConfigurationField[], + parentCanonicalModes?: CanonicalModeOverrides ): void { const { array: targetTools } = coerceObjectArray(targetCurrentValue) const { array: mergedTools } = coerceObjectArray(mergedValue) @@ -838,12 +1150,21 @@ function collectClearedToolParamDependents( typeof tool.operation === 'string' ? { operation: tool.operation, ...mergedParams } : mergedParams + // A DORMANT canonical member's cleared slot is not a lost configuration (only the pair's + // active member executes). Modes resolve like the tool-input UI: tool-scoped overrides, + // then the value heuristic over the merged params. + const gates = createCanonicalModeGates( + toolConfig.subBlocks, + mergedValues, + scopeCanonicalModesForTool(parentCanonicalModes, tool.type) + ) const toolLabel = typeof tool.title === 'string' && tool.title ? tool.title : toolConfig.name for (const cfg of toolConfig.subBlocks) { if (!cfg.dependsOn || !cfg.id) continue // Only flag a param the TARGET tool had configured (not one the source carried in). if (!isNonEmptyValue(targetParams[cfg.id])) continue if (isNonEmptyValue(mergedParams[cfg.id])) continue + if (gates.isDormantMember(cfg.id)) continue // Skip fields gated off by their `condition` (a stale value under an inactive // operation isn't actually required now). if (cfg.condition && !evaluateSubBlockCondition(cfg.condition, mergedValues)) continue @@ -851,7 +1172,8 @@ function collectClearedToolParamDependents( blockId, blockName, subBlockKey: `${toolInputKey}[${index}].${cfg.id}`, - title: `${toolLabel}: ${cfg.title ?? cfg.id}`, + title: cfg.title ?? cfg.id, + toolName: toolLabel, required: isSubBlockRequired(cfg.required, mergedValues), }) } @@ -874,22 +1196,27 @@ export function collectClearedDependents( blockId: string, blockName: string, targetCurrentSubBlocks: SubBlockRecord, - mergedSubBlocks: SubBlockRecord + mergedSubBlocks: SubBlockRecord, + canonicalModes?: CanonicalModeOverrides ): NeedsConfigurationField[] { const config = getBlock(blockType) if (!config) return [] const targetValues = buildSubBlockValues(targetCurrentSubBlocks) const mergedValues = buildSubBlockValues(mergedSubBlocks) + // A DORMANT canonical member the merge cleared is not a lost configuration - only the pair's + // active member executes, so an inactive slot must never demand a re-pick. + const gates = createCanonicalModeGates(config.subBlocks, mergedValues, canonicalModes) const fields: NeedsConfigurationField[] = [] for (const cfg of config.subBlocks) { if (!cfg.id) continue // Only flag a field the target had configured (so the user lost their own selection), // still empty after merge, and currently active (a value under a now-inactive - // `condition`/operation isn't really in play). + // `condition`/operation or a dormant canonical member isn't really in play). if ( cfg.dependsOn && isNonEmptyValue(targetValues[cfg.id]) && !isNonEmptyValue(mergedValues[cfg.id]) && + !gates.isDormantMember(cfg.id) && (!cfg.condition || evaluateSubBlockCondition(cfg.condition, mergedValues)) ) { fields.push({ @@ -907,7 +1234,8 @@ export function collectClearedDependents( blockName, targetValues[cfg.id], mergedValues[cfg.id], - fields + fields, + canonicalModes ) } } @@ -931,9 +1259,10 @@ export function parseNestedDependentKey( /** * Read a dependent field's currently-configured value from a target block's draft subBlocks - - * the first-sync fallback used when the stored mapping has no entry yet. Seeds the diff pre-fill - * from the TARGET (never the source, which would overwrite the target's own selection on an edge - * that predates the store). Identity-aware: for a nested `toolInput[index].paramId` key it only + * the first-sync fallback used when the stored mapping has no entry yet (fork-create seeds + * mappings but no dependent values, so every edge starts here). Seeds the diff pre-fill from + * the TARGET (never the source, which would overwrite the target's own selection). + * Identity-aware: for a nested `toolInput[index].paramId` key it only * reads the target draft's param when the target tool at that index is the SAME tool type the * SOURCE dependent hangs off; otherwise that index holds a different tool whose value isn't this * field's. Returns '' when unset or when identity can't be verified. @@ -1081,6 +1410,8 @@ export function createForkSubBlockTransform( options?: { /** Mapped-target MCP server rows, so remapped tool-input entries rewrite their server metadata. */ resolveMcpServerMeta?: ForkMcpServerMetaResolver + /** Copy provenance (promote's copy-selection overlay), keeping copy-faithful dependents. */ + isCopiedTarget?: (kind: ForkRemapKind, sourceId: string) => boolean } ): ( subBlocks: SubBlockRecord, @@ -1089,9 +1420,18 @@ export function createForkSubBlockTransform( ) => SubBlockRecord { return (subBlocks, blockType, canonicalModes) => { const result = remapSubBlocks(subBlocks, resolve, { + blockType, + canonicalModes, resolveMcpServerMeta: options?.resolveMcpServerMeta, + isCopiedTarget: options?.isCopiedTarget, }) - return clearDependentsOnRemap(result.subBlocks, blockType, result.remappedKeys, canonicalModes) + return clearDependentsOnRemap( + result.subBlocks, + blockType, + result.remappedKeys, + canonicalModes, + result.copyRemappedKeys + ) } } diff --git a/apps/sim/lib/workspaces/fork/remap/remap-table-groups.test.ts b/apps/sim/ee/workspace-forking/lib/remap/remap-table-groups.test.ts similarity index 96% rename from apps/sim/lib/workspaces/fork/remap/remap-table-groups.test.ts rename to apps/sim/ee/workspace-forking/lib/remap/remap-table-groups.test.ts index c49ee410b03..edc97cb3d16 100644 --- a/apps/sim/lib/workspaces/fork/remap/remap-table-groups.test.ts +++ b/apps/sim/ee/workspace-forking/lib/remap/remap-table-groups.test.ts @@ -6,8 +6,8 @@ import type { TableSchema } from '@/lib/table/types' import { buildForkBlockIdResolver, deriveForkBlockId, -} from '@/lib/workspaces/fork/remap/block-identity' -import { remapForkTableWorkflowGroups } from '@/lib/workspaces/fork/remap/remap-table-groups' +} from '@/ee/workspace-forking/lib/remap/block-identity' +import { remapForkTableWorkflowGroups } from '@/ee/workspace-forking/lib/remap/remap-table-groups' describe('remapForkTableWorkflowGroups', () => { it('remaps a manual group workflowId and outputs[].blockId to child ids', () => { diff --git a/apps/sim/lib/workspaces/fork/remap/remap-table-groups.ts b/apps/sim/ee/workspace-forking/lib/remap/remap-table-groups.ts similarity index 97% rename from apps/sim/lib/workspaces/fork/remap/remap-table-groups.ts rename to apps/sim/ee/workspace-forking/lib/remap/remap-table-groups.ts index 1d278f2b2ad..592f0565cc7 100644 --- a/apps/sim/lib/workspaces/fork/remap/remap-table-groups.ts +++ b/apps/sim/ee/workspace-forking/lib/remap/remap-table-groups.ts @@ -2,7 +2,7 @@ import type { TableSchema } from '@/lib/table/types' import { deriveForkBlockId, type ForkBlockIdResolver, -} from '@/lib/workspaces/fork/remap/block-identity' +} from '@/ee/workspace-forking/lib/remap/block-identity' /** * Remap the workflow/block references embedded in a copied table's schema so its diff --git a/apps/sim/lib/workspaces/fork/socket.ts b/apps/sim/ee/workspace-forking/lib/socket.ts similarity index 100% rename from apps/sim/lib/workspaces/fork/socket.ts rename to apps/sim/ee/workspace-forking/lib/socket.ts diff --git a/apps/sim/executor/handlers/agent/agent-handler.ts b/apps/sim/executor/handlers/agent/agent-handler.ts index c9bb5291347..50e183de22f 100644 --- a/apps/sim/executor/handlers/agent/agent-handler.ts +++ b/apps/sim/executor/handlers/agent/agent-handler.ts @@ -3,6 +3,7 @@ import { mcpServers } from '@sim/db/schema' import { createLogger } from '@sim/logger' import { toError } from '@sim/utils/errors' import { sleep } from '@sim/utils/helpers' +import { truncate } from '@sim/utils/string' import { and, eq, inArray, isNull } from 'drizzle-orm' import { normalizeStringRecord, normalizeWorkflowVariables } from '@/lib/core/utils/records' import { createMcpToolId } from '@/lib/mcp/utils' @@ -1176,7 +1177,7 @@ export class AgentBlockHandler implements BlockHandler { } } catch (error) { logger.error('LLM did not adhere to structured response format:', { - content: content.substring(0, 200) + (content.length > 200 ? '...' : ''), + content: truncate(content, 200), responseFormat: responseFormat, }) diff --git a/apps/sim/hooks/queries/background-work.ts b/apps/sim/hooks/queries/background-work.ts deleted file mode 100644 index 8af0e33ab68..00000000000 --- a/apps/sim/hooks/queries/background-work.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { useQuery } from '@tanstack/react-query' -import { requestJson } from '@/lib/api/client/request' -import { - type BackgroundWorkItem, - getWorkspaceBackgroundWorkContract, -} from '@/lib/api/contracts/workspace-fork' - -export const backgroundWorkKeys = { - all: ['backgroundWork'] as const, - lists: () => [...backgroundWorkKeys.all, 'list'] as const, - list: (workspaceId?: string) => [...backgroundWorkKeys.lists(), workspaceId ?? ''] as const, -} - -export const BACKGROUND_WORK_STALE_TIME = 5_000 - -async function fetchWorkspaceBackgroundWork( - workspaceId: string, - signal?: AbortSignal -): Promise { - const data = await requestJson(getWorkspaceBackgroundWorkContract, { - params: { id: workspaceId }, - signal, - }) - return data.items -} - -const isActive = (item: BackgroundWorkItem) => - item.status === 'pending' || item.status === 'processing' - -/** - * Durable "background work in progress" status for a workspace (fork content copy + - * any deployment side-effects). Poll-first per the best-practice for long jobs: the - * status survives a reload (it's a DB row), and we only keep polling while something is - * still running, then stop. Refetch on focus catches changes after the tab was away. - */ -export function useWorkspaceBackgroundWork(workspaceId?: string) { - return useQuery({ - queryKey: backgroundWorkKeys.list(workspaceId), - queryFn: ({ signal }) => fetchWorkspaceBackgroundWork(workspaceId as string, signal), - enabled: Boolean(workspaceId), - staleTime: BACKGROUND_WORK_STALE_TIME, - refetchInterval: (query) => ((query.state.data ?? []).some(isActive) ? 5_000 : false), - refetchOnWindowFocus: true, - }) -} diff --git a/apps/sim/hooks/queries/tables.ts b/apps/sim/hooks/queries/tables.ts index a33f2e240c9..7510875ebbf 100644 --- a/apps/sim/hooks/queries/tables.ts +++ b/apps/sim/hooks/queries/tables.ts @@ -817,7 +817,7 @@ type BatchCreateTableRowsParams = Omit /** - * Batch create rows in a table. Supports optional per-row positions for undo restore. + * Batch create rows in a table. Supports optional per-row order keys for undo restore. */ export function useBatchCreateTableRows({ workspaceId, tableId }: RowMutationContext) { const queryClient = useQueryClient() @@ -832,7 +832,6 @@ export function useBatchCreateTableRows({ workspaceId, tableId }: RowMutationCon body: { workspaceId, rows: variables.rows as RowData[], - positions: variables.positions, orderKeys: variables.orderKeys, }, }) diff --git a/apps/sim/hooks/queries/unsubscribe.test.tsx b/apps/sim/hooks/queries/unsubscribe.test.tsx index 97a7c492276..edaf3981107 100644 --- a/apps/sim/hooks/queries/unsubscribe.test.tsx +++ b/apps/sim/hooks/queries/unsubscribe.test.tsx @@ -2,6 +2,7 @@ * @vitest-environment jsdom */ import { act, type ReactNode } from 'react' +import { sleep } from '@sim/utils/helpers' import { QueryClient, QueryClientProvider } from '@tanstack/react-query' import { createRoot, type Root } from 'react-dom/client' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' @@ -89,7 +90,7 @@ async function flush() { await act(async () => { for (let i = 0; i < 5; i++) { await Promise.resolve() - await new Promise((resolve) => setTimeout(resolve, 0)) + await sleep(0) } }) } diff --git a/apps/sim/hooks/use-table-undo.ts b/apps/sim/hooks/use-table-undo.ts index 4014043c71e..dd403c4c27c 100644 --- a/apps/sim/hooks/use-table-undo.ts +++ b/apps/sim/hooks/use-table-undo.ts @@ -136,12 +136,11 @@ export function useTableUndo({ deleteRowMutation.mutate(action.rowId) } else { // Redo via the batch path so the saved orderKey restores exact placement. - // The single-insert API has no orderKey field, and under the fractional-ordering - // flag its `position` is read as a rank — a gappy saved position misplaces. + // The single-insert API has no orderKey field, and order_key is authoritative — + // a gappy saved position would misplace the row. batchCreateRowsMutation.mutate( { rows: [action.data ?? {}], - positions: [action.position], orderKeys: action.orderKey ? [action.orderKey] : undefined, }, { @@ -169,7 +168,6 @@ export function useTableUndo({ batchCreateRowsMutation.mutate( { rows: action.rows.map((r) => r.data), - positions: action.rows.map((r) => r.position), orderKeys: action.rows.every((r) => r.orderKey) ? action.rows.map((r) => r.orderKey as string) : undefined, @@ -194,7 +192,6 @@ export function useTableUndo({ batchCreateRowsMutation.mutate( { rows: action.rows.map((row) => row.data), - positions: action.rows.map((row) => row.position), orderKeys: action.rows.every((row) => row.orderKey) ? action.rows.map((row) => row.orderKey as string) : undefined, diff --git a/apps/sim/lib/api/contracts/custom-blocks.ts b/apps/sim/lib/api/contracts/custom-blocks.ts index baf18abeaf4..95d0915bca2 100644 --- a/apps/sim/lib/api/contracts/custom-blocks.ts +++ b/apps/sim/lib/api/contracts/custom-blocks.ts @@ -39,6 +39,8 @@ export const customBlockSchema = z.object({ workflowId: z.string(), /** Name of the bound source workflow (for display; the source can't be changed). */ workflowName: z.string(), + /** Source workflow's home workspace id — used client-side to gate manage affordances. */ + workspaceId: z.string().nullable(), /** Name of the source workflow's home workspace (display only). */ workspaceName: z.string().nullable(), type: z.string(), diff --git a/apps/sim/lib/api/contracts/tables.ts b/apps/sim/lib/api/contracts/tables.ts index d657619f710..c357cc585e8 100644 --- a/apps/sim/lib/api/contracts/tables.ts +++ b/apps/sim/lib/api/contracts/tables.ts @@ -199,16 +199,9 @@ export const batchInsertTableRowsBodySchema = z TABLE_LIMITS.MAX_BATCH_INSERT_SIZE, `Cannot insert more than ${TABLE_LIMITS.MAX_BATCH_INSERT_SIZE} rows per batch` ), - positions: z.array(z.number().int().min(0)).max(TABLE_LIMITS.MAX_BATCH_INSERT_SIZE).optional(), - /** Fractional ordering: exact per-row order keys (undo restore). Takes precedence over `positions`. */ + /** Fractional ordering: exact per-row order keys (undo restore). */ orderKeys: z.array(z.string().min(1)).max(TABLE_LIMITS.MAX_BATCH_INSERT_SIZE).optional(), }) - .refine((data) => !data.positions || data.positions.length === data.rows.length, { - message: 'positions array length must match rows array length', - }) - .refine((data) => !data.positions || new Set(data.positions).size === data.positions.length, { - message: 'positions must not contain duplicates', - }) .refine((data) => !data.orderKeys || data.orderKeys.length === data.rows.length, { message: 'orderKeys array length must match rows array length', }) diff --git a/apps/sim/lib/api/contracts/tools/aws/sts-assume-role.ts b/apps/sim/lib/api/contracts/tools/aws/sts-assume-role.ts index 2366f94e357..f02dfe6e566 100644 --- a/apps/sim/lib/api/contracts/tools/aws/sts-assume-role.ts +++ b/apps/sim/lib/api/contracts/tools/aws/sts-assume-role.ts @@ -1,3 +1,4 @@ +import { isRecordLike } from '@sim/utils/object' import { z } from 'zod' import type { ContractBody, @@ -37,7 +38,7 @@ const AssumeRoleSchema = z.object({ if (!v) return true try { const parsed = JSON.parse(v) - return typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed) + return isRecordLike(parsed) } catch { return false } diff --git a/apps/sim/lib/api/contracts/workspace-fork.test.ts b/apps/sim/lib/api/contracts/workspace-fork.test.ts index bdfdf40ea66..0441151bc54 100644 --- a/apps/sim/lib/api/contracts/workspace-fork.test.ts +++ b/apps/sim/lib/api/contracts/workspace-fork.test.ts @@ -3,7 +3,10 @@ */ import { describe, expect, it } from 'vitest' import { + forkLineageChildSchema, + forkLineageNodeSchema, forkMappableResourceTypeSchema, + getWorkspaceBackgroundWorkQuerySchema, updateForkMappingBodySchema, } from '@/lib/api/contracts/workspace-fork' @@ -33,6 +36,43 @@ describe('forkMappableResourceTypeSchema', () => { }) }) +describe('forkLineageNodeSchema', () => { + const baseNode = { id: 'ws-1', name: 'Parent', organizationId: null } + + it('requires viewerAccessible on every node (both accessible and inaccessible parse)', () => { + expect(forkLineageNodeSchema.safeParse(baseNode).success).toBe(false) + expect(forkLineageNodeSchema.safeParse({ ...baseNode, viewerAccessible: true }).success).toBe( + true + ) + expect(forkLineageNodeSchema.safeParse({ ...baseNode, viewerAccessible: false }).success).toBe( + true + ) + }) + + it('requires viewerAccessible on child nodes too', () => { + const child = { ...baseNode, createdAt: '2026-01-01T00:00:00.000Z' } + expect(forkLineageChildSchema.safeParse(child).success).toBe(false) + expect(forkLineageChildSchema.safeParse({ ...child, viewerAccessible: false }).success).toBe( + true + ) + }) +}) + +describe('getWorkspaceBackgroundWorkQuerySchema', () => { + it('defaults the limit to 50 and clamps it to 1..100 (audit-log behavior)', () => { + expect(getWorkspaceBackgroundWorkQuerySchema.parse({}).limit).toBe(50) + expect(getWorkspaceBackgroundWorkQuerySchema.parse({ limit: '25' }).limit).toBe(25) + expect(getWorkspaceBackgroundWorkQuerySchema.parse({ limit: '5000' }).limit).toBe(100) + expect(getWorkspaceBackgroundWorkQuerySchema.parse({ limit: '-3' }).limit).toBe(1) + expect(getWorkspaceBackgroundWorkQuerySchema.parse({ limit: 'garbage' }).limit).toBe(50) + }) + + it('treats the cursor as an optional opaque string', () => { + expect(getWorkspaceBackgroundWorkQuerySchema.parse({}).cursor).toBeUndefined() + expect(getWorkspaceBackgroundWorkQuerySchema.parse({ cursor: 'abc' }).cursor).toBe('abc') + }) +}) + describe('updateForkMappingBodySchema', () => { const base = { otherWorkspaceId: 'ws-1', direction: 'push' as const } @@ -62,4 +102,30 @@ describe('updateForkMappingBodySchema', () => { }) expect(result.success).toBe(false) }) + + it('accepts optional dependentValues, including cleared (empty-string) values', () => { + const result = updateForkMappingBodySchema.safeParse({ + ...base, + entries: [{ resourceType: 'oauth_credential', sourceId: 'cred-1', targetId: 'cred-2' }], + dependentValues: [ + { workflowId: 'wf-1', blockId: 'block-1', subBlockKey: 'label', value: 'INBOX' }, + { workflowId: 'wf-1', blockId: 'block-2', subBlockKey: 'sheet', value: '' }, + ], + }) + expect(result.success).toBe(true) + }) + + it('rejects a dependent value with an empty blockId or subBlockKey', () => { + for (const entry of [ + { workflowId: 'wf-1', blockId: '', subBlockKey: 'label', value: 'INBOX' }, + { workflowId: 'wf-1', blockId: 'block-1', subBlockKey: '', value: 'INBOX' }, + ]) { + const result = updateForkMappingBodySchema.safeParse({ + ...base, + entries: [], + dependentValues: [entry], + }) + expect(result.success).toBe(false) + } + }) }) diff --git a/apps/sim/lib/api/contracts/workspace-fork.ts b/apps/sim/lib/api/contracts/workspace-fork.ts index ec1280b9d15..04736f9a6b8 100644 --- a/apps/sim/lib/api/contracts/workspace-fork.ts +++ b/apps/sim/lib/api/contracts/workspace-fork.ts @@ -27,6 +27,12 @@ export const forkResourceTypeSchema = z.enum([ 'knowledge_document', 'file', 'mcp_server', + /** + * Workflow-publishing MCP server identity (parent shell <-> fork copy), seeded at fork so a + * sync can mirror `workflow_mcp_tool` attachments onto the mapped counterpart. System-managed; + * never user-mapped (nothing in a workflow references these servers). + */ + 'workflow_mcp_server', 'custom_tool', 'skill', ]) @@ -35,12 +41,16 @@ export const forkResourceTypeSchema = z.enum([ * Resource types a user may map via the mapping editor. Excludes `workflow` (identity is * system-managed - seeded at fork, maintained by promote, dissolved by rollback - and must never * be written through the editor, or a crafted entry could repoint a promote at the wrong target - * workflow) AND `knowledge_document` (a document is never a standalone mapping: it follows its - * parent knowledge base, re-picked in that KB's reconfigure flow and auto-remapped when the KB is - * copied - the mapping view never emits one and `listForkResourceCandidates` returns none). + * workflow), `workflow_mcp_server` (identity is likewise system-managed - seeded when a fork + * copies the server shells - and nothing in a workflow references one, so there is never a + * mapping entry to edit), AND `knowledge_document` (a document is never a standalone mapping: it + * follows its parent knowledge base, re-picked in that KB's reconfigure flow and auto-remapped + * when the KB is copied - the mapping view never emits one and `listForkResourceCandidates` + * returns none). */ export const forkMappableResourceTypeSchema = forkResourceTypeSchema.exclude([ 'workflow', + 'workflow_mcp_server', 'knowledge_document', ]) export type ForkMappableResourceType = z.infer @@ -49,8 +59,8 @@ export const forkDirectionSchema = z.enum(['push', 'pull']) /** * The remappable, copyable resource kinds a sync can copy into the target when they are - * referenced but unmapped (the fork-style copy at promote time). Excludes credentials, env - * vars, and external MCP servers (never copied this way); documents are auto-copied with their + * unmapped (the fork-style copy at promote time), whether referenced by the synced workflows or + * not. Excludes credentials and env vars (never copied); documents are auto-copied with their * parent knowledge base, not selected individually. Workspace `file` references are keyed by * storage key (not `workspace_files.id`) and copied like fork does. */ @@ -60,6 +70,11 @@ export const forkCopyableKindSchema = z.enum([ 'custom-tool', 'skill', 'file', + /** + * External MCP servers copy as CONFIG rows (transport/url/headers verbatim; OAuth tokens + * never copied - oauth-auth servers land disconnected until re-authorized in the target). + */ + 'mcp-server', ]) export type ForkCopyableKind = z.infer @@ -67,6 +82,18 @@ export const forkLineageNodeSchema = z.object({ id: z.string(), name: z.string(), organizationId: z.string().nullable(), + /** + * Whether the viewer has any access (read or higher, explicit or org-derived) to this + * lineage workspace. Drives the Forks page's row-action gating - lineage rows are visible + * to any admin of the CURRENT workspace, who may hold no access to the other side. + */ + viewerAccessible: z.boolean(), +}) + +/** A live fork of this workspace, listed read-only on the Forks settings page. */ +export const forkLineageChildSchema = forkLineageNodeSchema.extend({ + /** When the fork was created (ISO timestamp). */ + createdAt: z.string(), }) export const getForkLineageContract = defineRouteContract({ @@ -78,6 +105,8 @@ export const getForkLineageContract = defineRouteContract({ schema: z.object({ workspaceId: z.string(), parent: forkLineageNodeSchema.nullable(), + /** Live forks created from this workspace, newest first. */ + children: z.array(forkLineageChildSchema), /** The most recent undoable promote into this workspace, for the rollback UI. */ undoableRun: z .object({ @@ -90,6 +119,7 @@ export const getForkLineageContract = defineRouteContract({ }, }) export type ForkLineageNodeApi = z.output +export type ForkLineageChildApi = z.output export type GetForkLineageResponse = z.output const forkResourceIdList = z.array(nonEmptyIdSchema).max(2000).optional() @@ -100,8 +130,13 @@ export const forkResourceSelectionSchema = z.object({ knowledgeBases: forkResourceIdList, customTools: forkResourceIdList, skills: forkResourceIdList, - // External MCP servers are never copied (they carry secrets / require re-auth); only - // workflow-publishing MCP servers are copyable, as config-only shells with no workflows. + /** + * External MCP servers, copied as config rows (transport/url/headers) so MCP tool selections + * in the forked workflows keep working. OAuth tokens are never copied - an oauth-auth server + * lands disconnected in the child until re-authorized; tools re-discover on first use. + */ + mcpServers: forkResourceIdList, + /** Workflow-publishing MCP servers, copied as config-only shells with no workflows attached. */ workflowMcpServers: forkResourceIdList, }) @@ -153,6 +188,8 @@ export const getForkResourcesContract = defineRouteContract({ knowledgeBases: z.array(forkCopyableResourceSchema), customTools: z.array(forkCopyableResourceSchema), skills: z.array(forkCopyableResourceSchema), + /** External MCP servers (config rows; OAuth tokens never copied). */ + mcpServers: z.array(forkCopyableResourceSchema), workflowMcpServers: z.array(forkCopyableResourceSchema), deployedWorkflowCount: z.number().int(), }), @@ -207,6 +244,22 @@ export const getForkMappingContract = defineRouteContract({ }) export type GetForkMappingResponse = z.output +/** + * One dependent field's value in the stored mapping. The sync modal and the Forks + * settings page's mapping editor send the full set for every dependent whose parent is + * mapped; the server persists them to `workspace_fork_dependent_value` (promote also + * applies them verbatim to the target blocks), so the user's selection survives every + * future sync without re-picking. `blockId` is the deterministic fork block id, so the + * value lands on the right block. + */ +export const forkDependentValueEntrySchema = z.object({ + workflowId: nonEmptyIdSchema, + blockId: nonEmptyIdSchema, + subBlockKey: z.string().min(1, 'subBlockKey is required'), + value: z.string(), +}) +export type ForkDependentValueEntry = z.input + export const updateForkMappingBodySchema = z.object({ otherWorkspaceId: workspaceIdSchema, direction: forkDirectionSchema, @@ -219,6 +272,14 @@ export const updateForkMappingBodySchema = z.object({ }) ) .max(5000), + /** + * The full stored mapping of dependent-field values for the workflows it names; persisted + * to `workspace_fork_dependent_value` alongside the mapping entries (each named workflow's + * stored set is replaced by exactly what was sent - cleared fields drop out). Omitting the + * field leaves the stored mapping untouched. Unlike promote this only stores the values; + * they are applied to the target blocks on the next sync. + */ + dependentValues: z.array(forkDependentValueEntrySchema).max(2000).optional(), }) export const updateForkMappingContract = defineRouteContract({ method: 'PUT', @@ -270,7 +331,13 @@ export const forkDependentReconfigSchema = z.object({ blockName: z.string(), subBlockKey: z.string(), selectorKey: z.string(), + /** Plain field title (e.g. `Label`), never a `Tool: Field` composite. */ title: z.string(), + /** + * Display name of the nested `tool-input` tool this field belongs to (e.g. `Gmail` / + * `Gmail 1`). Absent for top-level block subblocks. + */ + toolName: z.string().optional(), /** * The field's stored value (from the persisted mapping), so the always-on reconfigure listing * pre-fills the selector with what the user last set. Empty string when unset; for an edge @@ -280,6 +347,13 @@ export const forkDependentReconfigSchema = z.object({ * resolves against the new parent. */ currentValue: z.string(), + /** + * The field's raw value in the SOURCE workflow state (what the source references today), + * untouched by the stored/target-draft overlay that `currentValue` carries. Seeds the selector + * when the parent is resolved by COPY: the copy brings the source parent's children along, so + * the source reference is exactly what the copied parent will contain. + */ + sourceValue: z.string(), /** Whether the field is required - a required empty field blocks Sync. */ required: z.boolean(), /** @@ -376,10 +450,9 @@ export type ForkClearedRef = z.output /** * Why a would-clear reference blocks the sync, so clients can phrase the resolution: - * - `unmapped-copyable`: a live copyable-kind resource (table / KB / file / custom tool / skill) - * with no target mapping - resolve by mapping it or selecting it for copy. - * - `unmapped-mcp-server`: a live external MCP server with no target mapping - resolve by mapping - * (MCP servers are never copied; create one in the target first if none exists). + * - `unmapped-copyable`: a live copyable-kind resource (table / KB / file / custom tool / + * skill / external MCP server) with no target mapping - resolve by mapping it or selecting + * it for copy. * - `source-deleted`: the referenced resource was deleted in the source - resolve by mapping the * dead id to an existing live target resource, or by fixing/archiving the source workflow. * - `workflow-missing`: a cross-workflow reference to a workflow not carried into the target - @@ -387,7 +460,6 @@ export type ForkClearedRef = z.output */ export const forkSyncBlockerReasonSchema = z.enum([ 'unmapped-copyable', - 'unmapped-mcp-server', 'source-deleted', 'workflow-missing', ]) @@ -486,21 +558,6 @@ export const forkNeedsConfigurationSchema = z.object({ }) export type ForkNeedsConfiguration = z.output -/** - * One dependent field's value in the stored mapping. The sync modal sends the full set for - * every dependent whose parent is mapped; promote persists them to - * `workspace_fork_dependent_value` and applies them verbatim to the target blocks, so the - * user's selection survives every future sync without re-picking. `blockId` is the - * deterministic fork block id, so the value lands on the right block. - */ -export const forkDependentValueEntrySchema = z.object({ - workflowId: nonEmptyIdSchema, - blockId: nonEmptyIdSchema, - subBlockKey: z.string().min(1, 'subBlockKey is required'), - value: z.string(), -}) -export type ForkDependentValueEntry = z.input - /** * Source resource ids (by kind) the user chose to copy into the target before the sync gate - * unmapped resources, whether referenced by the synced workflows or not. Each kind's documents @@ -514,6 +571,8 @@ export const promoteCopyResourcesSchema = z.object({ skills: forkResourceIdList, /** Workspace files to copy, identified by storage key (not `workspace_files.id`). */ files: forkResourceIdList, + /** External MCP servers to copy as config rows (OAuth tokens never copied - re-auth). */ + mcpServers: forkResourceIdList, }) export type PromoteCopyResources = z.input @@ -586,8 +645,15 @@ export const backgroundWorkMetadataSchema = z fileNames: z.array(z.string()).optional(), customToolNames: z.array(z.string()).optional(), skillNames: z.array(z.string()).optional(), + mcpServerNames: z.array(z.string()).optional(), workflowMcpServerNames: z.array(z.string()).optional(), // Sync / rollback + /** + * The other side of the fork edge (by id) for sync/rollback/sync-copy rows. Written so + * the activity query can surface a row to BOTH edge workspaces, and so the client can + * tell which side a row was recorded on. + */ + otherWorkspaceId: z.string().optional(), otherWorkspaceName: z.string().optional(), direction: z.enum(['push', 'pull']).optional(), updated: z.number().int().optional(), @@ -622,13 +688,27 @@ export const backgroundWorkItemSchema = z.object({ completedAt: z.string().nullable(), }) export type BackgroundWorkMetadata = z.output +/** Keyset pagination inputs, mirroring the audit log's (`auditLogsQuerySchema`). */ +export const getWorkspaceBackgroundWorkQuerySchema = z.object({ + /** Opaque cursor from a prior page's `nextCursor`; omit for the first page. */ + cursor: z.string().optional(), + limit: z + .string() + .optional() + .transform((value) => Math.min(Math.max(Number(value) || 50, 1), 100)), +}) export const getWorkspaceBackgroundWorkContract = defineRouteContract({ method: 'GET', path: '/api/workspaces/[id]/background-work', params: workspaceIdParamsSchema, + query: getWorkspaceBackgroundWorkQuerySchema, response: { mode: 'json', - schema: z.object({ items: z.array(backgroundWorkItemSchema) }), + schema: z.object({ + items: z.array(backgroundWorkItemSchema), + /** Opaque keyset cursor for the next page; null when this page is the last. */ + nextCursor: z.string().nullable(), + }), }, }) export type BackgroundWorkItem = z.output @@ -657,3 +737,38 @@ export const rollbackForkContract = defineRouteContract({ }) export type RollbackForkBody = z.input export type RollbackForkResponse = z.output + +export const getForkAvailabilityContract = defineRouteContract({ + method: 'GET', + path: '/api/workspaces/[id]/fork/availability', + params: workspaceIdParamsSchema, + response: { + mode: 'json', + schema: z.object({ + /** Server-evaluated verdict of the fork gate: env/plan + AppConfig rollout flag. */ + available: z.boolean(), + }), + }, +}) +export type GetForkAvailabilityResponse = z.output< + typeof getForkAvailabilityContract.response.schema +> + +export const unlinkForkBodySchema = z.object({ + otherWorkspaceId: workspaceIdSchema, +}) +export const unlinkForkContract = defineRouteContract({ + method: 'POST', + path: '/api/workspaces/[id]/fork/unlink', + params: workspaceIdParamsSchema, + body: unlinkForkBodySchema, + response: { + mode: 'json', + schema: z.object({ + /** False when the edge was already dissolved by a concurrent unlink (idempotent no-op). */ + unlinked: z.boolean(), + }), + }, +}) +export type UnlinkForkBody = z.input +export type UnlinkForkResponse = z.output diff --git a/apps/sim/lib/billing/validation/seat-management.ts b/apps/sim/lib/billing/validation/seat-management.ts index f9f671ddc1a..ec4317683cc 100644 --- a/apps/sim/lib/billing/validation/seat-management.ts +++ b/apps/sim/lib/billing/validation/seat-management.ts @@ -1,6 +1,7 @@ import { db } from '@sim/db' import { invitation, member, organization, subscription, user } from '@sim/db/schema' import { createLogger } from '@sim/logger' +import { normalizeEmail } from '@sim/utils/string' import { and, count, eq, gt, ne } from 'drizzle-orm' import { getOrganizationSubscription } from '@/lib/billing/core/billing' import { isEnterprise, isFree } from '@/lib/billing/plan-helpers' @@ -231,7 +232,7 @@ export async function validateBulkInvitations( try { const uniqueEmails = [...new Set(emailList)] const validEmails = uniqueEmails.filter( - (email) => quickValidateEmail(email.trim().toLowerCase()).isValid + (email) => quickValidateEmail(normalizeEmail(email)).isValid ) const duplicateEmails = emailList.filter((email, index) => emailList.indexOf(email) !== index) diff --git a/apps/sim/lib/blog/registry.ts b/apps/sim/lib/blog/registry.ts index 04b3b25cfa7..ff766e02d7f 100644 --- a/apps/sim/lib/blog/registry.ts +++ b/apps/sim/lib/blog/registry.ts @@ -1,221 +1,24 @@ -import fs from 'fs/promises' import path from 'path' -import { cache } from 'react' -import matter from 'gray-matter' -import { compileMDX } from 'next-mdx-remote/rsc' -import rehypeAutolinkHeadings from 'rehype-autolink-headings' -import rehypeSlug from 'rehype-slug' -import remarkGfm from 'remark-gfm' -import { mdxComponents } from '@/lib/blog/mdx' -import type { BlogMeta, BlogPost, TagWithCount } from '@/lib/blog/schema' -import { AuthorSchema, BlogFrontmatterSchema } from '@/lib/blog/schema' -import { AUTHORS_DIR, BLOG_DIR, byDateDesc, ensureContentDirs, toIsoDate } from '@/lib/blog/utils' +import { createContentRegistry } from '@/lib/content/registry-factory' -const postComponentsRegistry: Record> = {} +const BLOG_DIR = path.join(process.cwd(), 'content', 'blog') +const AUTHORS_DIR = path.join(process.cwd(), 'content', 'authors') -let cachedMeta: BlogMeta[] | null = null -let cachedAuthors: Record | null = null - -async function loadAuthors(): Promise> { - if (cachedAuthors) return cachedAuthors - await ensureContentDirs() - const files = await fs.readdir(AUTHORS_DIR).catch(() => []) - const authors: Record = {} - for (const file of files) { - if (!file.endsWith('.json')) continue - const raw = await fs.readFile(path.join(AUTHORS_DIR, file), 'utf-8') - const json = JSON.parse(raw) - const author = AuthorSchema.parse(json) - authors[author.id] = author - } - cachedAuthors = authors - return authors -} - -function slugify(text: string): string { - return text - .toLowerCase() - .trim() - .replace(/[^a-z0-9\s-]/g, '') - .replace(/\s+/g, '-') -} - -async function scanFrontmatters(): Promise { - if (cachedMeta) { - return cachedMeta - } - await ensureContentDirs() - const entries = await fs.readdir(BLOG_DIR).catch(() => []) - const authorsMap = await loadAuthors() - const results = await Promise.all( - entries.map(async (slug): Promise => { - const postDir = path.join(BLOG_DIR, slug) - const stat = await fs.stat(postDir).catch(() => null) - if (!stat || !stat.isDirectory()) return null - const mdxPath = path.join(postDir, 'index.mdx') - const hasMdx = await fs - .stat(mdxPath) - .then((s) => s.isFile()) - .catch(() => false) - if (!hasMdx) return null - const raw = await fs.readFile(mdxPath, 'utf-8') - const { data, content: mdxContent } = matter(raw) - const fm = BlogFrontmatterSchema.parse(data) - const wordCount = mdxContent - .replace(/```[\s\S]*?```/g, '') - .replace(/import\s+.*?from\s+['"].*?['"]/g, '') - .replace(/<[^>]+>/g, '') - .replace(/[#*_~`[\]()!|>-]/g, '') - .split(/\s+/) - .filter((w) => w.length > 0).length - const authors = fm.authors.map((id) => authorsMap[id]).filter(Boolean) - if (authors.length === 0) throw new Error(`Authors not found for "${slug}"`) - return { - slug: fm.slug, - title: fm.title, - description: fm.description, - date: toIsoDate(fm.date), - updated: fm.updated ? toIsoDate(fm.updated) : undefined, - author: authors[0], - authors, - readingTime: fm.readingTime, - tags: fm.tags, - ogImage: fm.ogImage, - canonical: fm.canonical, - ogAlt: fm.ogAlt, - about: fm.about, - timeRequired: fm.timeRequired, - faq: fm.faq, - wordCount, - draft: fm.draft, - featured: fm.featured ?? false, - } - }) - ) - cachedMeta = results.filter((result): result is BlogMeta => result !== null).sort(byDateDesc) - return cachedMeta -} - -export async function getAllPostMeta(): Promise { - return (await scanFrontmatters()).filter((p) => !p.draft) -} - -export const getNavBlogPosts = cache( - async (): Promise[]> => { - const allPosts = await getAllPostMeta() - const featuredPost = allPosts.find((p) => p.featured) ?? allPosts[0] - if (!featuredPost) return [] - const recentPosts = allPosts.filter((p) => p.slug !== featuredPost.slug).slice(0, 5) - return [featuredPost, ...recentPosts].map((p) => ({ - slug: p.slug, - title: p.title, - ogImage: p.ogImage, - })) - } -) - -export async function getAllTags(): Promise { - const posts = await getAllPostMeta() - const counts: Record = {} - for (const p of posts) { - for (const t of p.tags) counts[t] = (counts[t] || 0) + 1 - } - return Object.entries(counts) - .map(([tag, count]) => ({ tag, count })) - .sort((a, b) => b.count - a.count || a.tag.localeCompare(b.tag)) -} - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -const BLOG_COMPONENT_LOADERS: Record< - string, - () => Promise>> -> = { +/** Posts that ship custom MDX component overrides alongside their content. */ +const BLOG_COMPONENT_LOADERS = { enterprise: () => import('@/content/blog/enterprise/components'), 'v0-5': () => import('@/content/blog/v0-5/components'), } -async function loadPostComponents(slug: string): Promise> { - if (postComponentsRegistry[slug]) { - return postComponentsRegistry[slug] - } - - const loader = BLOG_COMPONENT_LOADERS[slug] - if (!loader) { - postComponentsRegistry[slug] = {} - return {} - } - - try { - const postComponents = await loader() - postComponentsRegistry[slug] = postComponents - return postComponents - } catch { - postComponentsRegistry[slug] = {} - return {} - } -} - -export async function getPostBySlug(slug: string): Promise { - const meta = await scanFrontmatters() - const found = meta.find((m) => m.slug === slug) - if (!found) throw new Error(`Post not found: ${slug}`) - const mdxPath = path.join(BLOG_DIR, slug, 'index.mdx') - const raw = await fs.readFile(mdxPath, 'utf-8') - const { content, data } = matter(raw) - const fm = BlogFrontmatterSchema.parse(data) - - const postComponents = await loadPostComponents(slug) - const mergedComponents = { ...mdxComponents, ...postComponents } +const blogRegistry = createContentRegistry({ + contentDir: BLOG_DIR, + authorsDir: AUTHORS_DIR, + componentLoaders: BLOG_COMPONENT_LOADERS, +}) - const compiled = await compileMDX({ - source: content, - components: mergedComponents as any, - options: { - parseFrontmatter: false, - mdxOptions: { - remarkPlugins: [remarkGfm], - rehypePlugins: [ - rehypeSlug, - [rehypeAutolinkHeadings, { behavior: 'wrap', properties: { className: 'anchor' } }], - ], - }, - }, - }) - const headings: { text: string; id: string }[] = [] - const lines = content.split('\n') - for (const line of lines) { - const match = /^##\s+(.+)$/.exec(line.trim()) - if (match) { - const text = match[1].trim() - headings.push({ text, id: slugify(text) }) - } - } - return { - ...found, - Content: () => (compiled as any).content, - updated: fm.updated ? toIsoDate(fm.updated) : found.updated, - headings, - } -} - -export function invalidateBlogCaches() { - cachedMeta = null - cachedAuthors = null - Object.keys(postComponentsRegistry).forEach((key) => delete postComponentsRegistry[key]) -} - -export async function getRelatedPosts(slug: string, limit = 3): Promise { - const posts = await getAllPostMeta() - const current = posts.find((p) => p.slug === slug) - if (!current) return [] - const others = posts.filter((p) => p.slug !== slug) - const scored = others - .map((p) => ({ - post: p, - score: p.tags.filter((t) => current.tags.includes(t)).length, - })) - .sort((a, b) => b.score - a.score || byDateDesc(a.post, b.post)) - .slice(0, limit) - .map((x) => x.post) - return scored -} +export const getAllPostMeta = blogRegistry.getAllPostMeta +export const getPostBySlug = blogRegistry.getPostBySlug +export const getAllTags = blogRegistry.getAllTags +export const getRelatedPosts = blogRegistry.getRelatedPosts +export const getNavBlogPosts = blogRegistry.getNavPosts +export const invalidateBlogCaches = blogRegistry.invalidateCaches diff --git a/apps/sim/lib/blog/seo.ts b/apps/sim/lib/blog/seo.ts index a3fbd3f520e..3ed28831504 100644 --- a/apps/sim/lib/blog/seo.ts +++ b/apps/sim/lib/blog/seo.ts @@ -1,172 +1,50 @@ -import type { Metadata } from 'next' -import type { BlogMeta } from '@/lib/blog/schema' -import { SITE_URL } from '@/lib/core/utils/urls' - -export function buildPostMetadata(post: BlogMeta): Metadata { - const base = new URL(post.canonical) - const baseUrl = `${base.protocol}//${base.host}` - return { - title: post.title, - description: post.description, - keywords: post.tags, - authors: (post.authors && post.authors.length > 0 ? post.authors : [post.author]).map((a) => ({ - name: a.name, - url: a.url, - })), - creator: post.author.name, - publisher: 'Sim', - robots: post.draft - ? { index: false, follow: false, googleBot: { index: false, follow: false } } - : { index: true, follow: true, googleBot: { index: true, follow: true } }, - alternates: { canonical: post.canonical }, - openGraph: { - title: post.title, - description: post.description, - url: post.canonical, - siteName: 'Sim', - locale: 'en_US', - type: 'article', - publishedTime: post.date, - modifiedTime: post.updated ?? post.date, - authors: (post.authors && post.authors.length > 0 ? post.authors : [post.author]).map( - (a) => a.name - ), - tags: post.tags, - images: [ - { - url: post.ogImage.startsWith('http') ? post.ogImage : `${baseUrl}${post.ogImage}`, - width: 1200, - height: 630, - alt: post.ogAlt || post.title, - }, - ], - }, - twitter: { - card: 'summary_large_image', - title: post.title, - description: post.description, - images: [post.ogImage], - creator: post.author.url?.includes('x.com') ? `@${post.author.xHandle || ''}` : undefined, - site: '@simdotai', - }, - other: { - 'article:published_time': post.date, - 'article:modified_time': post.updated ?? post.date, - 'article:author': post.author.name, - 'article:section': 'Technology', - }, - } +import type { Author, ContentMeta } from '@/lib/content/schema' +import type { ContentSection } from '@/lib/content/seo' +import { + buildArticleJsonLd, + buildAuthorGraphJsonLd as buildAuthorGraphJsonLdGeneric, + buildAuthorMetadata as buildAuthorMetadataGeneric, + buildCollectionPageJsonLd as buildCollectionPageJsonLdGeneric, + buildFaqJsonLd, + buildIndexMetadata as buildIndexMetadataGeneric, + buildPostGraphJsonLd as buildPostGraphJsonLdGeneric, + buildPostMetadata, + buildTagsBreadcrumbJsonLd as buildTagsBreadcrumbJsonLdGeneric, + buildTagsMetadata as buildTagsMetadataGeneric, +} from '@/lib/content/seo' + +export const BLOG_SECTION: ContentSection = { + name: 'Blog', + basePath: '/blog', + description: 'Announcements, insights, and guides for building AI agents.', } -export function buildArticleJsonLd(post: BlogMeta) { - return { - '@type': 'TechArticle', - url: post.canonical, - headline: post.title, - description: post.description, - image: [ - { - '@type': 'ImageObject', - url: post.ogImage, - width: 1200, - height: 630, - caption: post.ogAlt || post.title, - }, - ], - datePublished: post.date, - dateModified: post.updated ?? post.date, - wordCount: post.wordCount, - proficiencyLevel: 'Beginner', - author: (post.authors && post.authors.length > 0 ? post.authors : [post.author]).map((a) => ({ - '@type': 'Person', - name: a.name, - url: a.url, - ...(a.url ? { sameAs: [a.url] } : {}), - })), - publisher: { - '@type': 'Organization', - name: 'Sim', - url: SITE_URL, - logo: { - '@type': 'ImageObject', - url: `${SITE_URL}/logo/primary/medium.png`, - }, - }, - mainEntityOfPage: { - '@type': 'WebPage', - '@id': post.canonical, - }, - keywords: post.tags.join(', '), - about: (post.about || []).map((a) => ({ '@type': 'Thing', name: a })), - isAccessibleForFree: true, - timeRequired: post.timeRequired, - articleSection: 'Technology', - inLanguage: 'en-US', - speakable: { - '@type': 'SpeakableSpecification', - cssSelector: ['[itemprop="headline"]', '[itemprop="description"]'], - }, - } +export { buildArticleJsonLd, buildFaqJsonLd, buildPostMetadata } + +export function buildPostGraphJsonLd(post: ContentMeta) { + return buildPostGraphJsonLdGeneric(post, BLOG_SECTION) } -export function buildBreadcrumbJsonLd(post: BlogMeta) { - return { - '@type': 'BreadcrumbList', - itemListElement: [ - { '@type': 'ListItem', position: 1, name: 'Home', item: SITE_URL }, - { '@type': 'ListItem', position: 2, name: 'Blog', item: `${SITE_URL}/blog` }, - { '@type': 'ListItem', position: 3, name: post.title, item: post.canonical }, - ], - } +export function buildCollectionPageJsonLd() { + return buildCollectionPageJsonLdGeneric(BLOG_SECTION) } -export function buildFaqJsonLd(items: { q: string; a: string }[] | undefined) { - if (!items || items.length === 0) return null - return { - '@type': 'FAQPage', - mainEntity: items.map((it) => ({ - '@type': 'Question', - name: it.q, - acceptedAnswer: { '@type': 'Answer', text: it.a }, - })), - } +export function buildIndexMetadata(input: { tag?: string; pageNum: number }) { + return buildIndexMetadataGeneric(BLOG_SECTION, input) } -export function buildPostGraphJsonLd(post: BlogMeta) { - const graph: Record[] = [buildArticleJsonLd(post), buildBreadcrumbJsonLd(post)] +export function buildTagsMetadata() { + return buildTagsMetadataGeneric(BLOG_SECTION) +} - const faq = buildFaqJsonLd(post.faq) - if (faq) { - graph.push(faq) - } +export function buildTagsBreadcrumbJsonLd() { + return buildTagsBreadcrumbJsonLdGeneric(BLOG_SECTION) +} - return { - '@context': 'https://schema.org', - '@graph': graph, - } +export function buildAuthorMetadata(id: string, author?: Author) { + return buildAuthorMetadataGeneric(BLOG_SECTION, id, author) } -export function buildCollectionPageJsonLd() { - return { - '@context': 'https://schema.org', - '@type': 'CollectionPage', - name: 'Sim Blog', - url: `${SITE_URL}/blog`, - description: 'Announcements, insights, and guides for building AI agents.', - publisher: { - '@type': 'Organization', - name: 'Sim', - url: SITE_URL, - logo: { - '@type': 'ImageObject', - url: `${SITE_URL}/logo/primary/medium.png`, - }, - }, - inLanguage: 'en-US', - isPartOf: { - '@type': 'WebSite', - name: 'Sim', - url: SITE_URL, - }, - } +export function buildAuthorGraphJsonLd(author: Author) { + return buildAuthorGraphJsonLdGeneric(BLOG_SECTION, author) } diff --git a/apps/sim/lib/blog/utils.ts b/apps/sim/lib/blog/utils.ts deleted file mode 100644 index 9ba7ad6abf5..00000000000 --- a/apps/sim/lib/blog/utils.ts +++ /dev/null @@ -1,27 +0,0 @@ -import fs from 'fs/promises' -import path from 'path' - -export const BLOG_DIR = path.join(process.cwd(), 'content', 'blog') -export const AUTHORS_DIR = path.join(process.cwd(), 'content', 'authors') - -export async function ensureContentDirs() { - await fs.mkdir(BLOG_DIR, { recursive: true }) - await fs.mkdir(AUTHORS_DIR, { recursive: true }) -} - -export function toIsoDate(value: Date | string | number): string { - if (value instanceof Date) return value.toISOString() - return new Date(value).toISOString() -} - -export function byDateDesc(a: T, b: T) { - return new Date(b.date).getTime() - new Date(a.date).getTime() -} - -export function stripMdxExtension(file: string) { - return file.replace(/\.mdx?$/i, '') -} - -export function isRelativeUrl(url: string) { - return url.startsWith('/') -} diff --git a/apps/sim/lib/compare/data/competitors/claude-cowork.ts b/apps/sim/lib/compare/data/competitors/claude-cowork.ts index ce43773693a..786c7c99e58 100644 --- a/apps/sim/lib/compare/data/competitors/claude-cowork.ts +++ b/apps/sim/lib/compare/data/competitors/claude-cowork.ts @@ -20,13 +20,13 @@ export const claudeCoworkProfile: CompetitorProfile = { { title: 'Dynamic, runtime tool selection (no pre-wiring)', description: - 'Claude picks the fastest path itself at execution time: a connector for Slack, Chrome for web research, or direct screen/computer-use to open an app when no direct integration exists, rather than a builder pre-wiring which tool/connector an agent step uses.', + 'Claude decides itself at execution time how to reach a given goal: "Tell Claude what you need, not how" — it opens a browser for web tasks and takes over the screen directly only when it has to, rather than a builder where a user pre-wires which tool a step uses.', shortDescription: - 'Claude picks connectors, browser, or screen control at runtime instead of pre-wired steps.', + 'Claude decides whether to use the browser or take over the screen at runtime, not pre-wired steps.', source: { - url: 'https://support.claude.com/en/articles/13345190-get-started-with-claude-cowork', - label: 'Anthropic/Claude documentation', - asOf: '2026-07-02', + url: 'https://claude.com/product/cowork', + label: 'Claude Cowork product page (Claude)', + asOf: '2026-07-08', }, }, { @@ -79,38 +79,38 @@ export const claudeCoworkProfile: CompetitorProfile = { ], limitations: [ { - title: 'No unattended/webhook-triggered automation. Desktop app must stay open', + title: 'No webhook/external-event-triggered automation', description: - 'Task initiation is either manual (prompt via desktop or mobile) or on a user-defined schedule (hourly/daily/weekly/weekdays). Scheduled tasks only run while the computer is awake and the Claude Desktop app is open; if the device sleeps or the app is closed, the run is skipped and auto-executed on next wake, with a notification. There is no external event/webhook trigger capability.', + "Task initiation is manual (prompt via desktop or mobile) or on a user-defined schedule (hourly/daily/weekly/weekdays). Scheduled tasks now run remotely in the cloud on their set cadence, independent of whether the user's computer is awake or the Claude Desktop app is open. There is still no external event/webhook trigger capability — only time-based scheduling.", shortDescription: - 'Tasks only run manually or on a schedule while the desktop app is open and awake.', + 'Tasks run manually or on a schedule (now remote); no external event/webhook trigger.', source: { url: 'https://support.claude.com/en/articles/13854387-schedule-recurring-tasks-in-claude-cowork', label: 'Anthropic/Claude documentation', - asOf: '2026-07-02', + asOf: '2026-07-08', }, }, { title: 'No API publishing / callable endpoint deployment', description: - 'Cowork has no mechanism to publish or deploy a task as an API endpoint that external systems can call. Unlike a Sim workflow, it is strictly a session inside the Claude Desktop (and companion mobile) app, run manually or on a schedule.', + 'Cowork has no mechanism to publish or deploy a task as an API endpoint that external systems can call. Unlike a Sim workflow, it is strictly a session inside the Claude apps (web, desktop, and mobile), run manually or on a schedule.', shortDescription: 'Tasks cannot be published as callable API endpoints for external systems.', source: { url: 'https://claude.com/product/cowork', label: 'Anthropic/Claude documentation', - asOf: '2026-07-02', + asOf: '2026-07-08', }, }, { title: 'Cowork activity is not captured in audit logs / Compliance API', description: - 'Cowork activity does not appear in the Compliance API or standard data exports. OpenTelemetry (Team/Enterprise only) is the only visibility mechanism, and it can be cross-referenced with Compliance API records via a shared user identifier, but it is not a full audit trail on its own.', + 'Cowork activity does not appear in the Compliance API or standard data exports. OpenTelemetry (Team/Enterprise only) is the only visibility mechanism documented for streaming Cowork events to SIEM/observability tools; Anthropic does not document a way to reconcile it with Compliance API records, so it is not a full audit trail on its own.', shortDescription: 'Cowork actions are absent from the Compliance API and standard data exports.', source: { url: 'https://support.claude.com/en/articles/13364135-use-claude-cowork-safely', label: 'Anthropic/Claude documentation', - asOf: '2026-07-02', + asOf: '2026-07-08', }, }, { @@ -159,14 +159,14 @@ export const claudeCoworkProfile: CompetitorProfile = { selfHostOption: { value: 'No', detail: - "Cowork is a proprietary desktop application (macOS/Windows, Linux in beta) that requires a paid Claude plan and connects to Anthropic's cloud. There is no self-hosted or on-prem deployment option.", + "Cowork is a proprietary application (web, macOS/Windows desktop, and mobile; Linux desktop in beta) that requires a paid Claude plan and connects to Anthropic's cloud. There is no self-hosted or on-prem deployment option.", shortValue: 'No self-hosting option', confidence: 'verified', sources: [ { url: 'https://support.claude.com/en/articles/13345190-get-started-with-claude-cowork', label: 'Get started with Claude Cowork', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -251,21 +251,21 @@ export const claudeCoworkProfile: CompetitorProfile = { }, nativeFileStorage: { value: - "No: Claude Cowork works directly on the user's local files and folders inside an isolated sandboxed VM on their own machine. It is not a native cloud file-storage product with its own folder hierarchy, link-based sharing (password/SSO options), and deleted-item recovery. Recovering files after a destructive Cowork action relies on OS-level backup tools (Time Machine, File History, iCloud) or third-party recovery scripts, not a built-in trash or recovery feature.", + "No: Claude Cowork works on the user's connected local files/folders (via the Desktop app) and, as of the current beta, can also execute tasks remotely in an isolated environment on Anthropic's servers, saving sessions and files to the user's Claude account; it is not a native cloud file-storage product with its own folder hierarchy, link-based sharing, and deleted-item recovery.", detail: - 'Cowork has deleted user files with no built-in recovery path, underscoring that this is local file access, not a managed storage product.', - shortValue: 'No: operates on local files, no native cloud storage/trash', + 'Cowork has deleted user files with no built-in recovery path, underscoring that this is task/file access rather than a managed storage product.', + shortValue: 'No: local files + remote beta execution, no native storage/trash', confidence: 'verified', sources: [ { url: 'https://support.claude.com/en/articles/13345190-get-started-with-claude-cowork', label: 'Get started with Claude Cowork', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://github.com/anthropics/claude-code/issues/32637', label: '[BUG] Cowork destroys user files when reorganizing (GitHub issue)', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -329,6 +329,26 @@ export const claudeCoworkProfile: CompetitorProfile = { }, ], }, + customBlocks: { + value: + "No: Claude Cowork has no visual workflow builder, so there is no completed workflow to publish as a reusable block. The closest adjacent capability is org-wide Skills sharing: a member enables 'Share with organization' on a Skill (a SKILL.md instruction file, optionally with reference docs/scripts), and it becomes available to everyone in Customize > Skills. Recipients can enable and use a shared Skill but cannot edit its contents.", + detail: + "This does not meet the bar of a published-workflow-as-block. A Skill is read-only prompt/instruction text Claude consults at runtime, not an encapsulated, deployed multi-step workflow with auto-derived inputs, hand-picked named outputs, and a hidden internal implementation that always tracks the source's latest version. Cowork Projects, the closest thing to a saved unit of work, explicitly do not support sharing for members of Team and Enterprise plans; separately, Anthropic notes projects are 'desktop-only and stored locally,' with no cloud sync.", + shortValue: 'No: no publish-workflow-as-block feature exists', + confidence: 'verified', + sources: [ + { + url: 'https://support.claude.com/en/articles/13119606-provision-and-manage-skills-for-your-organization', + label: 'Provision and manage skills for your organization', + asOf: '2026-07-08', + }, + { + url: 'https://support.claude.com/en/articles/14116274-organize-your-tasks-with-projects-in-claude-cowork', + label: 'Organize your tasks with projects in Claude Cowork', + asOf: '2026-07-08', + }, + ], + }, }, aiCapabilities: { multiLlmSupport: { @@ -421,16 +441,17 @@ export const claudeCoworkProfile: CompetitorProfile = { ], }, humanInTheLoop: { - value: 'Yes: plan review and per-action approval by default', + value: + 'Partial: per-action approval for deletions/app access by default; full plan review is opt-in', detail: - "Claude shows a plan and waits for approval before acting. Explicit permission is required before permanently deleting files and before accessing each application. An opt-in 'Act Without Asking' mode removes step-by-step pauses but increases prompt-injection risk.", - shortValue: 'Plan review + per-action approval', + "Cowork's default mode is continuous execution without pausing. Explicit permission is still required before permanently deleting files and before accessing each application. Users can opt into 'Ask before acting' mode for a plan-review/step-by-step approval workflow on high-stakes tasks.", + shortValue: 'Partial: deletion/app approval by default, plan review opt-in', confidence: 'verified', sources: [ { url: 'https://support.claude.com/en/articles/13364135-use-claude-cowork-safely', label: 'Use Claude Cowork safely', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -608,14 +629,19 @@ export const claudeCoworkProfile: CompetitorProfile = { customCodeSteps: { value: 'No user-authorable code-step primitive; agent can execute code internally', detail: - 'Cowork tasks run in an isolated VM and can execute code as part of completing a task, but there is no workflow-builder-style code block a user writes or inserts into a task definition.', + 'Custom logic is added via plugins that bundle skills (instructions in SKILL.md files), connectors, and sub-agents — not a user-written code block inserted into a task. Shell commands and any code Cowork writes execute inside an isolated Linux VM as part of the agent loop, not as a user-authored step.', shortValue: 'No user-authorable code step', confidence: 'estimated', sources: [ { - url: 'https://www.anthropic.com/product/claude-cowork', - label: 'Claude Cowork product page (Anthropic)', - asOf: '2026-07-02', + url: 'https://support.claude.com/en/articles/13837440-use-plugins-in-claude', + label: 'Use plugins in Claude', + asOf: '2026-07-08', + }, + { + url: 'https://support.claude.com/en/articles/14479288-claude-cowork-architecture-overview', + label: 'Claude Cowork architecture overview', + asOf: '2026-07-08', }, ], }, @@ -721,9 +747,9 @@ export const claudeCoworkProfile: CompetitorProfile = { confidence: 'estimated', sources: [ { - url: 'https://support.claude.com/en/articles/10015870-what-certifications-has-anthropic-obtained', - label: 'What Certifications has Anthropic obtained?', - asOf: '2026-07-02', + url: 'https://platform.claude.com/docs/en/manage-claude/data-residency', + label: 'Data residency - Claude Platform Docs', + asOf: '2026-07-08', }, ], }, @@ -758,15 +784,15 @@ export const claudeCoworkProfile: CompetitorProfile = { }, additionalCompliance: { value: - 'ISO 27001:2022, ISO/IEC 42001:2023, HIPAA-ready (BAA via sales-assisted Enterprise), GDPR', + 'ISO 27001:2022, ISO/IEC 42001:2023, HIPAA-ready (BAA via sales-assisted Enterprise)', detail: 'Company-wide Anthropic certifications, not Cowork-scoped.', - shortValue: 'ISO 27001, ISO 42001, HIPAA-ready, GDPR', + shortValue: 'ISO 27001, ISO 42001, HIPAA-ready', confidence: 'estimated', sources: [ { url: 'https://support.claude.com/en/articles/10015870-what-certifications-has-anthropic-obtained', label: 'What Certifications has Anthropic obtained?', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -824,21 +850,21 @@ export const claudeCoworkProfile: CompetitorProfile = { }, dataRetention: { value: - 'Yes: Enterprise plan Owners/Primary Owners can set a custom data retention period (minimum 30 days) for conversation data and audit logs in Organization settings > Data and Privacy. Without customization, data is kept indefinitely.', + "Yes for org-wide Claude data, but this does not cover Cowork: Enterprise plan Owners/Primary Owners can set a custom data retention period (minimum 30 days) for conversation and project data in Organization settings > Data and Privacy, and data is kept indefinitely without customization. Cowork conversation history is stored locally on users' computers, is not subject to this standard retention policy, and cannot be centrally managed or exported by admins; Cowork activity is also not currently captured in the Compliance API.", detail: - "This is an org-wide Claude Enterprise setting, not per-resource-type the way Sim's granular retention is. Cowork's local session history sits outside this policy entirely, stored only on-device. Anthropic's current documentation does not describe a Zero-Data-Retention addendum for conversation data.", - shortValue: 'Yes: org-configurable retention, min 30 days, indefinite by default', + "This is an org-wide Claude Enterprise setting, not per-resource-type the way Sim's granular retention is, and it explicitly excludes Cowork. Cowork's local session history sits outside this policy entirely, stored only on-device. No Zero-Data-Retention addendum is described for conversation data.", + shortValue: 'Org retention is min 30 days, but Cowork history stays local, unmanaged', confidence: 'verified', sources: [ { url: 'https://privacy.claude.com/en/articles/10440198-configure-custom-data-retention-controls-for-enterprise-plans', label: 'Configure custom data retention controls for Enterprise plans', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://support.claude.com/en/articles/13455879-use-claude-cowork-on-team-and-enterprise-plans', label: 'Use Claude Cowork on Team and Enterprise plans', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -917,30 +943,30 @@ export const claudeCoworkProfile: CompetitorProfile = { ], }, durabilityModel: { - value: 'Weak. Client-dependent, not durable server-side execution', + value: 'Durable server-side execution for scheduled tasks', detail: - "Scheduled tasks only run while the computer is awake and Claude Desktop is open. A missed run due to sleep or a closed app is skipped and auto-run on next wake (with a notification), rather than executed at the scheduled time on infrastructure independent of the user's machine.", - shortValue: 'Client-dependent, not server-durable', + "Scheduled tasks in Claude Cowork now run remotely on Anthropic's infrastructure, independent of whether the user's computer is awake or the Desktop app is open — this is durable server-side execution, not client-dependent.", + shortValue: 'Server-durable: runs remotely regardless of device state', confidence: 'verified', sources: [ { url: 'https://support.claude.com/en/articles/13854387-schedule-recurring-tasks-in-claude-cowork', label: 'Schedule recurring tasks in Claude Cowork', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, failureAlerting: { - value: 'Minimal. Notification only for skipped scheduled runs', + value: 'Not documented under the current remote-execution model', detail: - 'Users receive a notification when a scheduled task run is skipped because the computer was asleep or the app was closed. There is no broader failure-alerting/retry policy for task errors.', - shortValue: 'Notifies only on skipped runs', - confidence: 'estimated', + 'Earlier documentation described a notification only when a scheduled run was skipped due to sleep/closed app, but that premise no longer applies now that scheduled tasks run remotely regardless of device state. The current schedule-recurring-tasks article is silent on failure/retry alerting for task errors, so this behavior should be treated as unverified pending updated Anthropic documentation.', + shortValue: 'Not documented; prior skipped-run notification premise is outdated', + confidence: 'unknown', sources: [ { url: 'https://support.claude.com/en/articles/13854387-schedule-recurring-tasks-in-claude-cowork', label: 'Schedule recurring tasks in Claude Cowork', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -976,21 +1002,22 @@ export const claudeCoworkProfile: CompetitorProfile = { }, asyncExecution: { value: - 'No: Claude Cowork does not offer true server-side background execution you can walk away from indefinitely. The Claude Desktop app must remain open while Claude works, and closing the app ends the session. Scheduled/recurring tasks (set up via the /schedule skill) run at a set cadence, but only while the computer is awake and the desktop app is open, and they are skipped, then caught up later, if the app is closed when the run was due.', + "Yes: Claude Cowork now supports true server-side background execution: remote sessions and scheduled tasks continue running on Anthropic's infrastructure even when the Desktop app is closed or the computer is asleep, except for tasks that require local file or browser access, which still need the app open.", detail: - "The phrase 'assign a task and step away' means you don't have to babysit each step in real time within an open session, and scheduled tasks let you check back later for results. But this is not equivalent to a cloud job you can trigger and poll while fully offline: the desktop app and an awake machine are hard prerequisites.", - shortValue: 'Requires app open, not fully async', + "The phrase 'assign a task and step away' now more closely matches a real cloud job: remote sessions and scheduled/recurring tasks (set up via the /schedule skill) run on their cadence independent of device state. Tasks that need local file system or browser access are the exception and still require the desktop app open on an awake machine.", + shortValue: + 'Yes: remote sessions/tasks run without the app open, with local-access exceptions', confidence: 'verified', sources: [ { url: 'https://support.claude.com/en/articles/13345190-get-started-with-claude-cowork', label: 'Get started with Claude Cowork (Claude Help Center)', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://support.claude.com/en/articles/13854387-schedule-recurring-tasks-in-claude-cowork', label: 'Schedule recurring tasks in Claude Cowork (Claude Help Center)', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://www.anthropic.com/product/claude-cowork', @@ -1048,16 +1075,16 @@ export const claudeCoworkProfile: CompetitorProfile = { }, unattendedExecution: { value: - 'No: scheduled tasks require the Claude Desktop app open and the computer awake on the client device', + "Yes: scheduled tasks execute server-side/remotely on Anthropic's infrastructure, independent of whether the Claude Desktop app is open or the device is awake, per Anthropic's current documentation", detail: - "There is no server-side execution path independent of the client. A scheduled/recurring task only fires while the desktop app is running and the machine is awake; if the device sleeps or the app is closed when a run is due, that run is skipped and auto-executed on next wake, with a notification, rather than firing on schedule from infrastructure independent of the user's machine.", - shortValue: 'No: requires desktop app open and computer awake', + "Scheduled/recurring tasks now run on their cadence on Anthropic's infrastructure regardless of client device state. Tasks that require local file or browser access remain the exception and still need the desktop app open and the machine awake.", + shortValue: 'Yes: runs remotely regardless of desktop app/device state', confidence: 'verified', sources: [ { url: 'https://support.claude.com/en/articles/13854387-schedule-recurring-tasks-in-claude-cowork', label: 'Schedule recurring tasks in Claude Cowork', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, diff --git a/apps/sim/lib/compare/data/competitors/crewai.ts b/apps/sim/lib/compare/data/competitors/crewai.ts index 6924cb95276..5d6327facb0 100644 --- a/apps/sim/lib/compare/data/competitors/crewai.ts +++ b/apps/sim/lib/compare/data/competitors/crewai.ts @@ -31,12 +31,12 @@ export const crewaiProfile: CompetitorProfile = { { title: 'Large, fast-growing open-source community', description: - 'The crewAIInc/crewAI GitHub repository has surpassed 54,800 stars and is MIT licensed, one of the most-starred open-source multi-agent orchestration frameworks. CrewAI reports its open-source framework executes over 10 million agents per month and is used by roughly half of the Fortune 500.', - shortDescription: '54,800+ GitHub stars, MIT licensed, widely adopted.', + 'The crewAIInc/crewAI GitHub repository has surpassed 55,000 stars and is MIT licensed, one of the most-starred open-source multi-agent orchestration frameworks. CrewAI reports over 100,000 developers certified through its community courses at learn.crewai.com.', + shortDescription: '55,000+ GitHub stars, MIT licensed, 100,000+ certified developers.', source: { url: 'https://github.com/crewAIInc/crewAI', label: 'crewAIInc/crewAI (GitHub)', - asOf: '2026-07-02', + asOf: '2026-07-08', }, }, { @@ -91,12 +91,12 @@ export const crewaiProfile: CompetitorProfile = { title: 'Human-in-the-loop input is a blocking, single-step primitive, not a rich approval workflow', description: - "The framework's built-in human_input=True flag on a Task pauses for a human response, but it is limited to synchronous stdin-style input in local runs. Production human-in-the-loop, via AMP webhooks and a pending-review state, requires the paid platform and custom webhook wiring rather than a built-in multi-channel approval UI.", - shortDescription: 'Basic human_input flag is stdin-style; rich approval needs AMP webhooks.', + "HITL in the open-source framework is now the @human_feedback decorator on Flows (v1.8.0+), which pauses for synchronous, console-based review in local runs, replacing the older Task human_input=True flag. Production HITL, via webhooks, an in-platform pending-review state, responder assignment, SLAs, and escalation policies (the 'Flow HITL Management Platform'), requires CrewAI AMP/Enterprise.", + shortDescription: 'OSS HITL is console-based via @human_feedback; rich approval needs AMP.', source: { url: 'https://docs.crewai.com/en/learn/human-in-the-loop', label: 'Human-in-the-Loop (HITL) Workflows - CrewAI Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, }, { @@ -331,6 +331,32 @@ export const crewaiProfile: CompetitorProfile = { }, ], }, + customBlocks: { + value: + 'No: no documented feature to publish a deployed crew/flow as an encapsulated, org-wide reusable block', + detail: + "CrewAI AMP's Tool Repository publishes individual custom Tools (single Python functions/classes wrapping an API) to a shared, permissioned catalog, not entire crews or flows. No CrewAI source describes taking a deployed crew or flow and publishing it as a named, iconed block that appears in a shared builder palette for other org members to drop into their own separate crews, with internals hidden and the block auto-tracking the source's latest deployed version. The closest pattern, wrapping a Crew's kickoff as a callable Tool for another Crew, is discussed only as a same-project code workaround in CrewAI's community forum, not a first-party, org-wide publish-as-block feature.", + shortValue: + 'No, Tool Repository publishes single Tools, not published crews/flows as blocks', + confidence: 'estimated', + sources: [ + { + url: 'https://docs.crewai.com/en/enterprise/guides/tool-repository', + label: 'Tool Repository - CrewAI Docs', + asOf: '2026-07-08', + }, + { + url: 'https://docs.crewai.com/en/enterprise/features/crew-studio', + label: 'Crew Studio - CrewAI Docs', + asOf: '2026-07-08', + }, + { + url: 'https://community.crewai.com/t/crew-method-as-tool/400', + label: 'Crew method as tool - CrewAI Community', + asOf: '2026-07-08', + }, + ], + }, }, aiCapabilities: { multiLlmSupport: { @@ -415,9 +441,9 @@ export const crewaiProfile: CompetitorProfile = { confidence: 'verified', sources: [ { - url: 'https://towardsdatascience.com/how-to-implement-guardrails-for-your-ai-agents-with-crewai-80b8cb55fa43/', - label: 'How to Implement Guardrails for Your AI Agents with CrewAI', - asOf: '2026-07-02', + url: 'https://docs.crewai.com/en/concepts/tasks', + label: 'Tasks (Guardrails) - CrewAI Docs', + asOf: '2026-07-08', }, { url: 'https://docs.crewai.com/en/enterprise/features/hallucination-guardrail', @@ -428,46 +454,51 @@ export const crewaiProfile: CompetitorProfile = { }, humanInTheLoop: { value: - 'Yes: a human_input flag pauses a Task for review; AMP adds a webhook-driven pending-review state', + 'Yes: the @human_feedback decorator pauses a Flow for review, plus a Task-level human_input parameter; AMP adds a webhook-driven pending-review state', detail: - 'Setting human_input=True on a Task pauses execution for human feedback before continuing, though the base mechanism is a synchronous, stdin-style prompt in local runs. CrewAI AMP extends this to a "Pending Human Input" state for deployed crews, where a reviewer\'s feedback and approval are submitted via task/webhook URLs to resume execution asynchronously.', - shortValue: 'Yes, human_input Task flag; async pending-review state on AMP', + 'CrewAI supports human-in-the-loop via the @human_feedback decorator on Flows (v1.8.0+), which pauses for synchronous, console-based review in local runs, and a separate human_input Task parameter for agent-level review. CrewAI AMP/Enterprise extends this to a "Pending Human Input" state for deployed crews, resumed asynchronously via webhook URLs.', + shortValue: 'Yes, @human_feedback Flow decorator and Task human_input; async on AMP', confidence: 'verified', sources: [ { url: 'https://docs.crewai.com/en/learn/human-in-the-loop', label: 'Human-in-the-Loop (HITL) Workflows - CrewAI Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, generativeMedia: { value: - 'Partial: image generation and vision tools exist via community/first-party tools, not a broad native suite', + 'Partial: image generation and vision tools exist via first-party tools, not a broad native suite', detail: - 'crewAI-tools includes a DallETool (image generation) and a VisionTool, giving CrewAI agents first-party access to image generation and image understanding. No native video-generation or text-to-speech/speech-to-text tool ships in the core crewAI-tools package; those require calling a provider directly through a custom or community tool.', + "crewAI's tools package (now maintained at github.com/crewAIInc/crewAI/tree/main/lib/crewai-tools, formerly the standalone crewAI-tools repo, archived November 2025) includes a DallETool (image generation) and a VisionTool, giving CrewAI agents first-party access to image generation and image understanding. No native video-generation or text-to-speech/speech-to-text tool ships in the core package; those require calling a provider directly through a custom or community tool.", shortValue: 'DallETool and VisionTool ship; no native video/TTS tool', confidence: 'estimated', sources: [ { - url: 'https://github.com/crewAIInc/crewAI-tools', - label: 'crewAIInc/crewAI-tools (GitHub)', - asOf: '2026-07-02', + url: 'https://github.com/crewAIInc/crewAI/tree/main/lib/crewai-tools', + label: 'crewAIInc/crewAI - lib/crewai-tools (GitHub)', + asOf: '2026-07-08', }, ], }, dynamicToolUse: { value: - 'Yes: an Agent selects among all tools assigned to it at reasoning time, rather than a fixed pre-wired call', + 'Yes: agents call tools via LLM function-calling during execution, choosing among their assigned tools at each step', detail: - "An Agent's `tools` list is the pool it reasons over; the agent's LLM decides at runtime which tool, if any, to invoke for a given step, including tools loaded dynamically from an MCP server via MCPServerAdapter. This is a design property of the Agent/Task model itself, not a separately named feature.", - shortValue: 'Yes, agents reason over their assigned tool pool at runtime', + "An Agent's `tools` list (including tools loaded dynamically from an MCP server via MCPServerAdapter) is a set of callable functions passed to a function-calling LLM; the model decides which tool, if any, to call at each step of execution. CrewAI's own docs don't name this as a distinct feature: the Agents/Tools concept pages only show tools statically assigned at agent creation, and the underlying per-step tool-call behavior surfaces indirectly through CrewAI's Tool Call Hooks, which intercept tool calls the agent makes during execution.", + shortValue: 'Yes, via LLM function-calling per step; not documented as a named feature', confidence: 'estimated', sources: [ { url: 'https://docs.crewai.com/en/concepts/agents', label: 'Agents - CrewAI Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', + }, + { + url: 'https://docs.crewai.com/en/learn/tool-hooks', + label: 'Tool Call Hooks - CrewAI Docs', + asOf: '2026-07-08', }, ], }, @@ -576,21 +607,21 @@ export const crewaiProfile: CompetitorProfile = { integrations: { integrationCount: { value: - 'crewAI-tools ships dozens of first-party tools; broader integration reach comes via Composio (1,000+ apps)', + 'crewai-tools ships 70+ first-party tools; broader integration reach comes via Composio (250+ production-ready tools)', detail: - 'The official crewAIInc/crewAI-tools repository provides dozens of built-in tools spanning file operations, web scraping, database search (Postgres, MySQL), search APIs, and AI tools (DALL-E, Vision); there is no single vendor-published total count. CrewAI docs separately show first-party ComposioTool integration, and Composio advertises 1,000+ pre-authenticated third-party apps pluggable into CrewAI agents.', - shortValue: 'Dozens of first-party tools; 1,000+ apps via Composio', + "crewAI's tools package (now maintained at github.com/crewAIInc/crewAI/tree/main/lib/crewai-tools, formerly the standalone crewAI-tools repo, archived November 2025) ships over 70 built-in tool modules spanning file operations, web scraping, database search (Postgres, MySQL, Snowflake, Databricks), search APIs, and AI tools (DALL-E, Vision, OCR); there is no single vendor-published total count. CrewAI docs separately show first-party ComposioTool integration, and Composio's own CrewAI docs advertise 250+ production-ready tools pluggable into CrewAI agents.", + shortValue: '70+ first-party tools; 250+ via Composio', confidence: 'estimated', sources: [ { - url: 'https://github.com/crewAIInc/crewAI-tools', - label: 'crewAIInc/crewAI-tools (GitHub)', - asOf: '2026-07-02', + url: 'https://github.com/crewAIInc/crewAI/tree/main/lib/crewai-tools/src/crewai_tools/tools', + label: 'crewAIInc/crewAI - lib/crewai-tools/tools directory (GitHub)', + asOf: '2026-07-08', }, { url: 'https://docs.crewai.com/en/tools/automation/composiotool', label: 'Composio Tool - CrewAI Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -665,31 +696,31 @@ export const crewaiProfile: CompetitorProfile = { pricing: { pricingModel: { value: - 'Free open-source framework (self-hosted); CrewAI AMP tiers priced per monthly workflow execution plus seats', + 'Free open-source framework (self-hosted); CrewAI AMP offers a free Basic tier plus custom Enterprise pricing', detail: - 'The open-source Python framework has no license cost. CrewAI AMP is priced on a Free/Basic tier (50 executions/month), a Professional tier ($25/month, roughly double the execution cap plus an extra seat), and custom-quoted Enterprise pricing for compliance, dedicated support, and private-infrastructure deployment.', - shortValue: 'Free framework; AMP billed by monthly executions plus seats', + "The open-source Python framework has no license cost. CrewAI AMP currently lists a free Basic tier (50 executions/month) and custom-quoted Enterprise pricing for compliance, dedicated support, and private-infrastructure deployment; no separate mid-tier paid plan is currently shown on CrewAI's pricing page.", + shortValue: 'Free framework; AMP has a free Basic tier and custom Enterprise pricing', confidence: 'verified', sources: [ { url: 'https://crewai.com/pricing', label: 'CrewAI Pricing', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, entryPaidPlan: { value: - 'CrewAI AMP Professional: $25/month, roughly 100 workflow executions/month plus one added seat', + 'No mid-tier paid plan currently listed; CrewAI AMP pricing goes from a free Basic tier straight to custom Enterprise pricing', detail: - "The Free/Basic AMP tier includes 50 executions/month; third-party pricing analyses put the $25/month Professional tier at roughly double that cap (about 100 executions/month) plus a team seat. CrewAI's own pricing page does not spell out the exact numeric caps per tier beyond the free tier's 50 executions/month.", - shortValue: '$25/month, ~100 executions/month, +1 seat', + "CrewAI AMP pricing currently lists only a free Basic tier (50 executions/month) and custom Enterprise pricing; the previously offered $25/month Professional tier is no longer shown on CrewAI's pricing page.", + shortValue: 'None currently listed: free Basic tier, then custom Enterprise', confidence: 'estimated', sources: [ { url: 'https://crewai.com/pricing', label: 'CrewAI Pricing', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -749,9 +780,9 @@ export const crewaiProfile: CompetitorProfile = { confidence: 'estimated', sources: [ { - url: 'https://sambanova.ai/blog/sambanova-and-crewai-partner-to-deliver-agentic-ai-at-scale-on-crewai-amp', - label: 'SambaNova and CrewAI Partner on CrewAI AMP', - asOf: '2026-07-02', + url: 'https://docs.crewai.com/en/enterprise/features/sso', + label: 'SSO - CrewAI Docs', + asOf: '2026-07-08', }, ], }, @@ -764,9 +795,9 @@ export const crewaiProfile: CompetitorProfile = { confidence: 'estimated', sources: [ { - url: 'https://sambanova.ai/blog/sambanova-and-crewai-partner-to-deliver-agentic-ai-at-scale-on-crewai-amp', - label: 'SambaNova and CrewAI Partner on CrewAI AMP', - asOf: '2026-07-02', + url: 'https://docs.crewai.com/en/enterprise/features/sso', + label: 'SSO - CrewAI Docs', + asOf: '2026-07-08', }, ], }, @@ -876,9 +907,9 @@ export const crewaiProfile: CompetitorProfile = { }, thirdPartyVetting: { value: - 'Partial: the core crewai-tools package is maintainer-reviewed, but the Enterprise Tool Repository lets any org publish public tools with only automated security checks, and CrewAI also supports the open, community-run MCP server ecosystem', + 'Partial: the core crewai-tools code is maintainer-reviewed in the main crewAI repo, but the platform Tool Repository lets any org publish public tools with only automated security checks, and CrewAI also supports the open, community-run MCP server ecosystem', detail: - "CrewAI's official crewai-tools GitHub repository is a first-party, contribution-reviewed catalog: community pull requests are merged by CrewAI maintainers. Separately, CrewAI's Enterprise docs describe a Tool Repository where any user with org permissions can publish a tool with the --public flag, making it installable by other users; the docs state only that 'every published version undergoes automated security checks' before install, with no described human/editorial review process. CrewAI also supports the Model Context Protocol, giving agents access to 'thousands of tools from hundreds of MCP servers built by the community,' third-party code not authored or reviewed by CrewAI. No CrewAI-specific documented security incident (malicious tool, credential leak via a community tool or MCP server) was found in public sources.", + "crewAI's tools code now lives in the main crewAI monorepo (github.com/crewAIInc/crewAI/tree/main/lib/crewai-tools; the standalone crewAI-tools repo is archived as of November 2025) and is maintainer-reviewed via PRs there. Separately, CrewAI's platform docs describe a Tool Repository where any user with org permissions can publish a tool with the --public flag, making it installable by other users; the docs state only that 'every published version undergoes automated security checks' before install, with no described human/editorial review process, and it is not documented as an Enterprise-exclusive tier. CrewAI also supports the Model Context Protocol, giving agents access to 'thousands of tools from hundreds of MCP servers built by the community,' third-party code not authored or reviewed by CrewAI. No CrewAI-specific documented security incident (malicious tool, credential leak via a community tool or MCP server) was found in public sources.", shortValue: 'Partial, reviewed core repo + open public Tool Repository + community MCP', confidence: 'estimated', sources: [ @@ -888,9 +919,9 @@ export const crewaiProfile: CompetitorProfile = { asOf: '2026-07-02', }, { - url: 'https://github.com/crewAIInc/crewAI-tools', - label: 'crewAI-tools GitHub repository', - asOf: '2026-07-02', + url: 'https://github.com/crewAIInc/crewAI/tree/main/lib/crewai-tools', + label: 'crewAIInc/crewAI - lib/crewai-tools (GitHub)', + asOf: '2026-07-08', }, ], }, @@ -936,16 +967,31 @@ export const crewaiProfile: CompetitorProfile = { }, dataDrains: { value: - 'Yes: third-party OpenTelemetry-based exports to Datadog, Dynatrace, SigNoz, and Instana are documented', + 'Yes: OpenTelemetry-based exports to Datadog are documented by CrewAI; Dynatrace, SigNoz, and IBM Instana document their own CrewAI support', detail: - 'CrewAI traces and execution data can be continuously exported to external observability platforms via OpenTelemetry-based integrations (documented by Datadog, Dynatrace, SigNoz, and IBM Instana), beyond viewing traces inside the native AMP dashboard.', - shortValue: 'Yes, via OpenTelemetry to Datadog/Dynatrace/SigNoz/Instana', + "CrewAI's own docs show traces exported straight to Datadog's OTLP intake, plus generic OTLP-compatible backend examples (Grafana, Honeycomb, New Relic). Separately, Dynatrace, SigNoz, and IBM Instana each document OpenTelemetry-based CrewAI support on their own sites (not in CrewAI's docs), so exporting continuously to any of those platforms, beyond viewing traces in the native AMP dashboard, is documented, just split across CrewAI's and each vendor's own pages.", + shortValue: 'Yes, via OpenTelemetry; Datadog documented by CrewAI, others by the vendor', confidence: 'verified', sources: [ + { + url: 'https://docs.crewai.com/en/enterprise/guides/capture_telemetry_logs', + label: 'Capture Telemetry Logs - CrewAI Docs', + asOf: '2026-07-08', + }, + { + url: 'https://www.dynatrace.com/hub/detail/crewai-observability/', + label: 'CrewAI monitoring & observability - Dynatrace Hub', + asOf: '2026-07-08', + }, { url: 'https://signoz.io/docs/crewai-observability/', label: 'CrewAI Observability & Monitoring with OpenTelemetry - SigNoz Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', + }, + { + url: 'https://www.ibm.com/docs/en/instana-observability/1.0.304?topic=frameworks-crewai', + label: 'CrewAI - IBM Instana Observability Docs', + asOf: '2026-07-08', }, ], }, @@ -958,9 +1004,9 @@ export const crewaiProfile: CompetitorProfile = { confidence: 'verified', sources: [ { - url: 'https://docs.crewai.com/how-to/kickoff-async', + url: 'https://docs.crewai.com/en/learn/kickoff-async', label: 'Kickoff Crew Asynchronously - CrewAI Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -988,9 +1034,9 @@ export const crewaiProfile: CompetitorProfile = { confidence: 'estimated', sources: [ { - url: 'https://towardsdatascience.com/how-to-implement-guardrails-for-your-ai-agents-with-crewai-80b8cb55fa43/', - label: 'How to Implement Guardrails for Your AI Agents with CrewAI', - asOf: '2026-07-02', + url: 'https://docs.crewai.com/en/concepts/tasks', + label: 'Tasks (Guardrails - guardrail_max_retries) - CrewAI Docs', + asOf: '2026-07-08', }, ], }, @@ -1008,9 +1054,9 @@ export const crewaiProfile: CompetitorProfile = { asOf: '2026-07-02', }, { - url: 'https://docs.crewai.com/enterprise/guides/use-crew-api', - label: 'Trigger Deployed Crew API - CrewAI Docs', - asOf: '2026-07-02', + url: 'https://docs.crewai.com/en/enterprise/guides/kickoff-crew', + label: 'Kickoff Crew - CrewAI Docs', + asOf: '2026-07-08', }, ], }, @@ -1074,16 +1120,22 @@ export const crewaiProfile: CompetitorProfile = { ], }, academy: { - value: 'Yes: CrewAI offers free, structured courses at learn.crewai.com', + value: + 'Partial: CrewAI offers a free short course hosted on DeepLearning.AI, linked from learn.crewai.com', detail: - 'CrewAI operates a learning platform with self-paced, structured courses covering the framework, Flows, and agent-building concepts, beyond ad hoc blog posts or docs pages.', - shortValue: "Yes, free structured courses at CrewAI's learning platform", + 'CrewAI offers a short course, \'Multi AI Agent Systems with crewAI,\' hosted on DeepLearning.AI and linked from learn.crewai.com, covering the framework and agent-building concepts, beyond ad hoc blog posts or docs pages. The DeepLearning.AI course page states access is free ("free for a limited time during the DeepLearning.AI learning platform beta"). learn.crewai.com itself is a marketing landing page that points to this single third-party course rather than hosting a broader in-house curriculum.', + shortValue: 'Partial, one free DeepLearning.AI course linked from learn.crewai.com', confidence: 'estimated', sources: [ { url: 'https://learn.crewai.com', label: 'CrewAI Academy (learn.crewai.com)', - asOf: '2026-07-04', + asOf: '2026-07-08', + }, + { + url: 'https://www.deeplearning.ai/short-courses/multi-ai-agent-systems-with-crewai/', + label: 'Multi AI Agent Systems with crewAI - DeepLearning.AI', + asOf: '2026-07-08', }, ], }, diff --git a/apps/sim/lib/compare/data/competitors/dust.ts b/apps/sim/lib/compare/data/competitors/dust.ts index 3e1bb4ed63d..3f4aaba8ae9 100644 --- a/apps/sim/lib/compare/data/competitors/dust.ts +++ b/apps/sim/lib/compare/data/competitors/dust.ts @@ -179,36 +179,31 @@ export const dustProfile: CompetitorProfile = { }, deploymentOptions: { value: - 'Multi-tenant hosted cloud with a choice of US or EU data-hosting region; Enterprise plan adds single-tenant deployment', + 'Multi-tenant hosted cloud by default; an EU data-hosting option for databases, files, and vectors is available, documented as exclusive to Enterprise customers rather than a self-serve region choice on every tier', detail: - "Dust's Enterprise plan documentation lists 'US & EU data residency options' and 'single-tenant deployment' alongside SSO/SCIM; lower tiers are multi-tenant cloud only.", - shortValue: 'Hosted cloud, US/EU regions, single-tenant on Enterprise', + "Dust's changelog states the EU data hosting option is 'available exclusively for enterprise customers' and covers 'storage of databases, files, and vectors' (calls to third-party LLM provider APIs remain outside this hosting boundary). No Dust source documents a selectable US-region toggle or a named single-tenant deployment tier.", + shortValue: 'Multi-tenant cloud by default; EU data hosting is Enterprise-exclusive', confidence: 'estimated', sources: [ { url: 'https://docs.dust.tt/changelog/eu-data-hosting-option-available', label: 'EU data hosting option available | Dust changelog', - asOf: '2026-07-02', - }, - { - url: 'https://dust.tt/home/enterprise', - label: 'Dust for Enterprise', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, templates: { value: - 'Yes: a Template Gallery of pre-built agents organized by department/use case (Sales, Support, Marketing, Engineering, HR, IT operations)', + 'Yes: a Template Gallery of pre-built agents organized by department/use case (Sales, Customer Support, Marketing, Engineering, Data Analytics, Knowledge Management, Recruiting, Product Design, Collaboration)', detail: - "Selecting a template opens a Sidekick-guided creation flow pre-loaded with the template's instructions and suggested tools/data sources, which the builder then reviews, adjusts, and publishes.", + "Selecting a template opens a Sidekick-guided creation flow pre-loaded with the template's instructions and suggested tools/data sources; templates are organized by department/use case including Sales, Customer Support, Marketing, Engineering, Data Analytics, Knowledge Management, Recruiting, Product Design, and Collaboration. The builder reviews, adjusts, and publishes from there.", shortValue: 'Template gallery organized by department/use case', confidence: 'verified', sources: [ { url: 'https://docs.dust.tt/docs/templates', label: 'Templates | Dust Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -342,20 +337,40 @@ export const dustProfile: CompetitorProfile = { }, ], }, + customBlocks: { + value: + 'No: Dust has no way to publish an agent as a named, encapsulated block that appears in a shared builder toolbox for other users, with its internals hidden and the source kept in sync', + detail: + 'The closest Dust feature is Skills, a reusable package of instructions, knowledge, and tools attached to multiple agents with edits auto-propagating, but Dust\'s own docs describe Skills as explicitly transparent rather than encapsulated: a read-only summary of every referenced instruction, tool, and knowledge source is shown to whoever authors it in the Skill Editor, not hidden behind an interface exposing only defined inputs/outputs. The separate "Run agent" tool (see subWorkflows) lets one agent call another saved agent, but that is picking an existing agent to call from a list, not publishing a workflow as a distinct, iconed block in a builder toolbox with only its inputs/outputs exposed.', + shortValue: 'No: Skills are transparent, not encapsulated; no publish-as-block toolbox', + confidence: 'estimated', + sources: [ + { + url: 'https://docs.dust.tt/docs/skills', + label: 'Skills | Dust Docs', + asOf: '2026-07-08', + }, + { + url: 'https://docs.dust.tt/docs/run-agent', + label: 'Run agent | Dust Docs', + asOf: '2026-07-08', + }, + ], + }, }, aiCapabilities: { multiLlmSupport: { value: - 'Yes: agents can be configured with a choice of model (e.g. GPT-5, Claude, Gemini, Mistral) and a creativity/temperature setting, selectable per agent', + 'Yes: agents can be configured with a choice of model (e.g. GPT-4 Turbo, Claude 3, Gemini Pro, Mistral Large) and a Reasoning Effort setting, selectable per agent', detail: - 'Advanced agent settings let a builder pick the model and a temperature preset (Creative, Balanced, Factual, Deterministic); marketing materials name GPT-5, Claude, Gemini, and Mistral as selectable models.', - shortValue: 'GPT-5, Claude, Gemini, Mistral selectable per agent', + 'Advanced agent settings let a builder pick the model and a reasoning-effort level (Light, Medium, High); Dust docs name GPT-4 Turbo, Claude 3, Gemini Pro, and Mistral Large as selectable models.', + shortValue: 'GPT-4 Turbo, Claude 3, Gemini Pro, Mistral Large selectable per agent', confidence: 'verified', sources: [ { url: 'https://docs.dust.tt/docs/what-settings-model-should-i-use', label: 'What settings / model should I use? | Dust Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -441,36 +456,37 @@ export const dustProfile: CompetitorProfile = { }, humanInTheLoop: { value: - "Yes: MCP tool execution supports an approval step ('always ask' vs. auto-execute) before a tool call runs, and Dust's own guidance recommends human approval checkpoints before irreversible agent actions", + "Yes: MCP tool execution uses a stakes-tiered approval model (high/medium/low-stake tools, with argument-level approval required for certain medium-stake tool parameters), not a simple 'always ask' vs. auto-execute toggle, and Dust's own guidance recommends human approval before irreversible agent actions", detail: - "Dust's MCP tool architecture includes an approval-workflow layer for tool execution, and Dust recommends 'mandatory steps, and human approval points before any irreversible action' for consequential agent actions. This is tool-execution approval, not a single named workflow node like a dedicated approval action in a workflow tool.", - shortValue: 'MCP tool-execution approval step; documented best-practice guidance', + "Dust's MCP tool architecture tiers tools by stake level and requires argument-level approval for certain medium-stake tool parameters before execution, and Dust recommends 'mandatory steps, and human approval points before any irreversible action' for consequential agent actions. This is a graduated tool-execution approval model, not a single named workflow node like a dedicated approval action in a workflow tool.", + shortValue: 'Stakes-tiered MCP approval model; documented best-practice guidance', confidence: 'estimated', sources: [ { url: 'https://deepwiki.com/dust-tt/dust/4-agent-system', label: 'MCP Tool System | dust-tt/dust | DeepWiki', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://dust.tt/blog/ai-agent-workflows', label: 'AI agent workflows: How they work and how to build your own | Dust Blog', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, generativeMedia: { value: - 'Partial: native image generation (via Gemini/Nano Banana) with reference-image consistency and parallel generation is built in; there is no dedicated native video-generation or text-to-speech/speech-to-text block', + "Partial: native image generation (via Google's gemini-3-pro-image model) with reference-image consistency (up to 14 reference images) and parallel generation is built in; there is no dedicated native video-generation block, though a separate 'Voice and sound generation' tool exists for audio", detail: - "Dust's Image Generation capability uses an underlying Gemini image model, supports up to 14 reference images for visual consistency across a series, and can run multiple generations in parallel; generated images are filtered for safety. Video and TTS/STT were not found as native Dust capabilities.", - shortValue: 'Native image generation with reference images; no native video/audio gen', + "Dust's Image Generation capability uses Google's gemini-3-pro-image model, supports up to 14 reference images for visual consistency across a series, and can run multiple generations in parallel; generated images are filtered for safety. A separate 'Voice and sound generation' tool provides native audio generation, but no dedicated native video-generation block was found.", + shortValue: + 'Native image gen (gemini-3-pro-image) + reference images; separate audio tool; no native video', confidence: 'estimated', sources: [ { url: 'https://docs.dust.tt/docs/image-generation', label: 'Image Generation | Dust Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -529,16 +545,17 @@ export const dustProfile: CompetitorProfile = { }, kbChunkVisibility: { value: - "Partial: Dust surfaces footnote-style citations tied to a specific source document in agent answers, but there's no dedicated raw chunk-index/content debugging inspector distinct from citation footnotes", + "Partial: Dust's product UI surfaces citations tied to a specific source document in agent answers, but there's no dedicated raw chunk-index/content debugging inspector distinct from those citations", detail: - "Documentation confirms the Search/RAG method attributes answers to specific source documents via citations. Whether a raw chunk-content inspector view exists as a separate debugging surface isn't confirmed in available docs.", - shortValue: 'Citations point to source documents; raw chunk inspector not confirmed', + "Dust's general RAG/Search explainer describes semantic retrieval but doesn't itself document citation formatting; the citation behavior (source documents listed under an answer, or visible via 'tool inspection') is described in Dust's own community support threads rather than a product page, and appears to vary by model. Whether a raw chunk-content inspector exists as a separate debugging surface isn't confirmed in official docs.", + shortValue: + 'Citations confirmed via product UI/community support, not a docs page; chunk inspector unconfirmed', confidence: 'estimated', sources: [ { - url: 'https://docs.dust.tt/docs/understanding-retrieval-augmented-generation-rag-and-the-search-method-in-dust', - label: 'Understanding Retrieval Augmented Generation (RAG) | Dust Docs', - asOf: '2026-07-02', + url: 'https://community.dust.tt/x/03help/6ku3a37chfyo/how-to-access-documents-from-the-dust-agent-a-guid', + label: 'How to Access Documents from the Dust Agent | Dust Community', + asOf: '2026-07-08', }, ], }, @@ -599,16 +616,17 @@ export const dustProfile: CompetitorProfile = { }, triggerTypes: { value: - 'Natural-language scheduled triggers and event-based triggers from connected systems (e.g. Slack messages), invoked in addition to manual chat invocation', + 'Natural-language scheduled triggers and event-based triggers from connected systems (e.g. GitHub, Jira, Zendesk, Linear, Fathom, or custom webhooks), invoked in addition to manual chat invocation', detail: - "Scheduled triggers run an agent on a recurring, plain-language schedule ('Every weekday at 8:30am') without cron syntax; Dust's Triggers feature separately supports agents reacting to events from external systems rather than only manual chat.", - shortValue: 'Natural-language schedules plus event-based triggers', + "Scheduled triggers run an agent on a recurring, plain-language schedule ('Every weekday at 8:30am') without cron syntax; Dust's Webhook Triggers separately let agents react to events from built-in providers (GitHub, Jira, Zendesk, Linear, Fathom) or custom webhooks, rather than only manual chat.", + shortValue: + 'Natural-language schedules plus webhook triggers (GitHub, Jira, Zendesk, Linear, Fathom)', confidence: 'verified', sources: [ { url: 'https://docs.dust.tt/docs/triggers', label: 'Triggers | Dust Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -885,21 +903,27 @@ export const dustProfile: CompetitorProfile = { }, thirdPartyVetting: { value: - 'Partial: native data connections (Slack, Notion, GitHub, Salesforce, and 50+ others) are first-party and built/maintained by the Dust team, but agent tools can also be extended with any external MCP server by pasting its public URL, with no Dust-led vetting or review of that server', + 'Partial: native data connections (11 fully-managed sources including Google Drive, Notion, Confluence, GitHub, Salesforce, Microsoft, Snowflake, BigQuery, Zendesk, Gong, and Intercom) are first-party and built/maintained by the Dust team; Slack and dozens of other business tools (Airtable, Asana, HubSpot, Jira, Salesloft, and more) are documented as separate MCP-based Tools rather than native Connections, and agent tools can also be extended with any external MCP server by pasting its public URL, with no Dust-led vetting or review of that server', detail: - "Docs describe adding a remote MCP server as entering the server's public URL, with workspace admins responsible for choosing and authenticating it. No formal Dust review process is described, unlike the fully managed first-party connectors, and no publicly documented security incident involving a malicious or compromised third-party MCP server on Dust was found.", - shortValue: 'First-party connectors, open bring-your-own-URL MCP tools', + "Docs list 11 fully-managed native Connections under Connections Management, while Dust's own Slack integration docs describe it as 'Slack MCP tools' added by selecting Slack 'from the available MCP servers,' distinct from that native Connections list. Dust's Tools catalog documents dozens of further business-tool integrations (Airtable, Asana, HubSpot, Jira, Salesloft, and more) alongside the ability to add any external MCP server by pasting its public URL, with workspace admins responsible for choosing and authenticating it. No formal Dust review process is described for pasted third-party MCP server URLs, and no publicly documented security incident involving a malicious or compromised third-party MCP server on Dust was found.", + shortValue: + '11 first-party Connections; Slack + dozens more via MCP-based Tools; open bring-your-own-URL MCP', confidence: 'verified', sources: [ { - url: 'https://docs.dust.tt/docs/remote-mcp-server', - label: 'Adding an MCP Server', - asOf: '2026-07-02', + url: 'https://docs.dust.tt/docs/connections', + label: 'Connections | Dust Docs', + asOf: '2026-07-08', }, { - url: 'https://docs.dust.tt/docs/connections', - label: 'Connections', - asOf: '2026-07-02', + url: 'https://docs.dust.tt/docs/slack-mcp', + label: 'Slack tools | Dust Docs', + asOf: '2026-07-08', + }, + { + url: 'https://docs.dust.tt/docs/tools', + label: 'Tools | Dust Docs', + asOf: '2026-07-08', }, ], }, @@ -907,16 +931,17 @@ export const dustProfile: CompetitorProfile = { observability: { tracingDepth: { value: - 'Yes: an Agent Builder dashboard shows real-time usage trends, tool execution patterns, feedback tracking, latency metrics, and RAG behavior tied to specific agent versions', + 'Partial: an Admin > Analytics dashboard shows workspace-wide credit consumption, message/conversation volume, tool execution patterns, and feedback tracking (thumb reactions/comments), broken out by agent, user, or message source, but it does not track latency metrics or RAG-specific behavior, and is not broken out by individual agent version', detail: - "Described as built natively into the agent-builder workflow with 'zero setup', showing signals specific to how agents work on the Dust platform, rather than a general-purpose distributed-tracing/span export product.", - shortValue: 'Per-agent-version dashboard: usage, tools, feedback, latency, RAG', - confidence: 'estimated', + "Dust's Workspace Analytics docs describe an Admin > Analytics dashboard for adoption, credit consumption, and usage patterns, including tool-execution counts/unique users per tool and message feedback, explicitly stating analytics never include message content and are not differentiated by agent version. Latency metrics and RAG-specific behavior are not part of this dashboard.", + shortValue: + 'Workspace-wide usage/feedback/tool dashboard; no latency or RAG metrics, not per-version', + confidence: 'verified', sources: [ { - url: 'https://deepwiki.com/dust-tt/dust/3.1-agent-configuration-and-management', - label: 'Agent Configuration and Management | dust-tt/dust | DeepWiki', - asOf: '2026-07-02', + url: 'https://docs.dust.tt/docs/workspace-analytics', + label: 'Workspace Analytics | Dust Docs', + asOf: '2026-07-08', }, ], }, diff --git a/apps/sim/lib/compare/data/competitors/flowise.ts b/apps/sim/lib/compare/data/competitors/flowise.ts index 3ed440bee2d..e360f4998af 100644 --- a/apps/sim/lib/compare/data/competitors/flowise.ts +++ b/apps/sim/lib/compare/data/competitors/flowise.ts @@ -31,13 +31,13 @@ export const flowiseProfile: CompetitorProfile = { { title: 'Built-in dataset-based batch evaluation', description: - "Flowise ships a built-in Evaluations feature that runs chatflows/agentflows against a saved dataset in one batch, scoring outputs with string, numeric, or LLM-as-judge evaluators and reporting pass/fail rate, average tokens, and latency across the whole run. Sim's own Evaluator block scores individual calls against user-defined metrics, but has no equivalent golden-dataset batch runner. (Flowise's Agentflow V2 also has a Human Input node for pausing on approve/reject feedback, comparable to Sim's own human-in-the-loop approval block.)", + "Flowise ships an Evaluations feature, available on Flowise Cloud/Enterprise plans (not the open-source self-hosted product), that runs chatflows/agentflows against a saved dataset in one batch, scoring outputs with string, numeric, or LLM-as-judge evaluators and reporting pass/fail rate, average tokens, and latency across the whole run. Sim's own Evaluator block scores individual calls against user-defined metrics, but has no equivalent golden-dataset batch runner. (Flowise's Agentflow V2 also has a Human Input node for pausing on approve/reject feedback, comparable to Sim's own human-in-the-loop approval block.)", shortDescription: - 'Built-in dataset-based batch evaluation with LLM-judge scoring and pass/fail reporting.', + 'Built-in dataset-based batch evaluation (Cloud/Enterprise plans) with LLM-judge scoring and pass/fail reporting.', source: { url: 'https://docs.flowiseai.com/using-flowise/evaluations', label: 'Flowise Docs: Evaluations', - asOf: '2026-07-02', + asOf: '2026-07-08', }, }, { @@ -69,12 +69,12 @@ export const flowiseProfile: CompetitorProfile = { { title: 'No native real-time multiplayer canvas editing', description: - "Flowise's core canvas supports only one user editing a flow at a time, with no built-in real-time co-editing (like Google Docs) of the same chatflow. Community members have requested true multi-user collaborative editing as a feature.", + "Flowise's core canvas supports only one user editing a flow at a time, with no built-in real-time co-editing of the same chatflow. A related multi-user/collaboration feature request (GitHub issue #2661) was closed as not planned.", shortDescription: 'No live multi-cursor concurrent editing of the same flow.', source: { url: 'https://github.com/FlowiseAI/Flowise/issues/2661', - label: 'GitHub Issue #2661: Multi User Support', - asOf: '2026-07-02', + label: 'GitHub Issue #2661: Multi User Support (closed, not planned)', + asOf: '2026-07-08', }, }, ], @@ -163,9 +163,14 @@ export const flowiseProfile: CompetitorProfile = { asOf: '2026-07-02', }, { - url: 'https://github.com/FlowiseAI/Flowise/issues/5164', - label: 'GitHub Issue #5164: Clarify Licensing Terms for Community vs Enterprise Code', - asOf: '2026-07-02', + url: 'https://docs.flowiseai.com/using-flowise/workspaces', + label: 'Flowise Docs: Workspaces', + asOf: '2026-07-08', + }, + { + url: 'https://docs.flowiseai.com/configuration/sso', + label: 'Flowise Docs: SSO', + asOf: '2026-07-08', }, ], }, @@ -191,16 +196,16 @@ export const flowiseProfile: CompetitorProfile = { }, realtimeCollaboration: { value: - "No: Flowise's canvas supports only one user per session, with no live, multi-cursor editing of the same flow. This has been an open community feature request.", + "No: Flowise's canvas supports only one user per session, with no live, multi-cursor editing of the same flow. Cloud/Enterprise multi-user features (workspaces, RBAC) govern access, not concurrent editing.", detail: - 'Cloud/Enterprise multi-user features (workspaces, RBAC) govern access, not concurrent editing.', + 'No public Flowise GitHub issue specifically tracks multi-cursor/real-time canvas collaboration as a feature request; GitHub issue #2661, sometimes cited for this, is actually a closed request about user authentication, RBAC, and audit trails, not concurrent editing.', shortValue: 'No live multi-user concurrent canvas editing', confidence: 'verified', sources: [ { - url: 'https://github.com/FlowiseAI/Flowise/issues/2661', - label: 'GitHub Issue #2661: Multi User Support', - asOf: '2026-07-02', + url: 'https://docs.flowiseai.com/using-flowise/workspaces', + label: 'Flowise Docs: Workspaces', + asOf: '2026-07-08', }, ], }, @@ -238,11 +243,31 @@ export const flowiseProfile: CompetitorProfile = { }, ], }, + customBlocks: { + value: + "No: Flowise has no feature for publishing a deployed chatflow/agentflow as a named, encapsulated block that appears in the node palette for other users across an organization. Its closest feature, the Execute Flow node, only lets a flow call another saved flow by name or ID from within the same Flowise instance, passing input and receiving output; the docs describe this as invoking an existing flow, not publishing a version-synced, credential-hidden component into a shared toolbar. Flowise's Custom Tool node is likewise scoped to inline JavaScript written within a single flow, not a published workflow-as-block. There is no documented mechanism that hides a source flow's internal steps/credentials from consumers, restricts a published block via access control/permission groups, or automatically points every consumer at the source flow's latest deployed version.", + detail: + "This is distinct from Flowise's Execute Flow sub-workflow calling (see subWorkflows above), which is same-instance flow-to-flow composition, not org-wide reuse of a hidden, centrally-updated block by other users.", + shortValue: 'No, only same-instance Execute Flow calls; no published org-wide block', + confidence: 'estimated', + sources: [ + { + url: 'https://docs.flowiseai.com/using-flowise/agentflowv2', + label: 'Flowise Docs: Agentflow V2 (Execute Flow node)', + asOf: '2026-07-08', + }, + { + url: 'https://docs.flowiseai.com/integrations/langchain/tools/custom-tool', + label: 'Flowise Docs: Custom Tool', + asOf: '2026-07-08', + }, + ], + }, }, aiCapabilities: { multiLlmSupport: { value: - 'Yes: Flowise integrates a broad set of LLM providers including OpenAI, Azure OpenAI, AWS Bedrock, Google PaLM/Vertex AI, Cohere, HuggingFace Inference, Ollama, Replicate, and Anthropic models (Claude 3.5/4), covering both hosted and self-hosted open-source models.', + 'Yes: Flowise integrates a broad set of LLM providers including OpenAI, Azure OpenAI, AWS Bedrock, Google Vertex AI, Cohere, HuggingFace Inference, Ollama, and Replicate, plus (via its separate Chat Models integrations, e.g. ChatAnthropic) Anthropic Claude models, covering both hosted and self-hosted open-source models.', shortValue: 'Broad support: OpenAI, Azure, Bedrock, Google, Anthropic, Ollama, more', confidence: 'verified', sources: [ @@ -251,6 +276,11 @@ export const flowiseProfile: CompetitorProfile = { label: 'Flowise Docs: LLMs', asOf: '2026-07-02', }, + { + url: 'https://docs.flowiseai.com/integrations/langchain/chat-models', + label: 'Flowise Docs: Chat Models (incl. ChatAnthropic)', + asOf: '2026-07-08', + }, ], }, agentReasoningBlocks: { @@ -498,9 +528,9 @@ export const flowiseProfile: CompetitorProfile = { confidence: 'verified', sources: [ { - url: 'https://docs.flowiseai.com/integrations/utilities/custom-js-function', - label: 'Flowise Docs: Custom JS Function', - asOf: '2026-07-02', + url: 'https://docs.flowiseai.com/integrations/langchain/tools/custom-tool', + label: 'Flowise Docs: Custom Tool (JS function support, built-in/external modules)', + asOf: '2026-07-08', }, ], }, @@ -871,9 +901,9 @@ export const flowiseProfile: CompetitorProfile = { confidence: 'estimated', sources: [ { - url: 'https://www.aicuflow.com/blog/enterprise-ai-sso-rbac-audit', - label: 'Aicuflow: Enterprise AI Platform with SSO, Role-Based Access, and Audit Trails', - asOf: '2026-07-02', + url: 'https://www.lindy.ai/blog/flowise-pricing', + label: 'Lindy: Flowise Pricing, Features, and Alternatives for 2026', + asOf: '2026-07-08', }, ], }, diff --git a/apps/sim/lib/compare/data/competitors/gumloop.ts b/apps/sim/lib/compare/data/competitors/gumloop.ts index edbebc9f1ee..71fe435f9be 100644 --- a/apps/sim/lib/compare/data/competitors/gumloop.ts +++ b/apps/sim/lib/compare/data/competitors/gumloop.ts @@ -25,26 +25,26 @@ export const gumloopProfile: CompetitorProfile = { 'Gumloop is a hosted, no-code visual platform for building and deploying AI agents and automations: a drag-and-drop canvas, an AI copilot ("Gen") for natural-language flow creation, and native MCP (Model Context Protocol) integration support.', standoutFeatures: [ { - title: '100+ fully hosted MCP servers', + title: '250+ fully hosted MCP servers', description: - 'Gumloop offers 100+ pre-built, zero-setup hosted MCP servers, plus any custom MCP server over HTTPS, with both native-MCP and backend-connector execution modes.', - shortDescription: - '100+ zero-setup hosted MCP servers, plus any custom MCP server over HTTPS.', + 'Gumloop offers 250+ pre-built, zero-setup hosted MCP servers spanning popular services, letting agents connect to external tools without manual configuration.', + shortDescription: '250+ zero-setup hosted MCP servers across popular services.', source: { url: 'https://www.gumloop.com/mcp', label: 'Gumloop: Fully Hosted MCP Servers', - asOf: '2026-07-02', + asOf: '2026-07-08', }, }, { - title: 'Gen copilot debugs existing flows node-by-node on canvas', + title: 'Gummie copilot builds, edits, and debugs flows from natural language', description: - 'Beyond building new flows from a prompt, Gen can step into an already-built workflow and debug it node-by-node directly on the canvas, working from a plain-English description of what is going wrong.', - shortDescription: 'Gen debugs an existing workflow node-by-node directly on the canvas.', + "Beyond building new flows from a prompt, Gumloop's AI copilot, Gummie, can edit, debug, and run existing workflows: users describe what they want changed or fixed in plain English and Gummie figures out the implementation.", + shortDescription: + 'Gummie copilot can build, edit, debug, and run workflows from natural-language prompts.', source: { - url: 'https://www.gumloop.com/blog/agentic-ai-tools', - label: 'Gumloop blog: agentic AI tools', - asOf: '2026-07-02', + url: 'https://www.gumloop.com/changelog', + label: 'Gumloop Changelog', + asOf: '2026-07-08', }, }, { @@ -97,24 +97,24 @@ export const gumloopProfile: CompetitorProfile = { { title: 'Proprietary license, closed source', description: - 'The core Gumloop application has no open-source license; it is a closed commercial product, unlike some workflow-automation competitors that ship an open-source core.', + 'The core Gumloop application has no open-source license; Gumloop\'s own Terms of Service state the Service, its features, and its functionality "are and will remain the exclusive property of AgentHub Inc. (doing business as Gumloop) and its licensors," unlike some workflow-automation competitors that ship an open-source core.', shortDescription: 'Closed commercial product with no open-source core.', source: { - url: 'https://www.gumloop.com/pricing', - label: 'Gumloop Pricing', - asOf: '2026-07-02', + url: 'https://www.gumloop.com/tos', + label: 'Gumloop Terms of Service', + asOf: '2026-07-08', }, }, { title: 'Inconsistent/unclear integration count across vendor pages', description: - "Gumloop's own pages give differing figures for integrations ('100+ nodes and integrations' vs '100+ MCP servers'), and the dedicated /integrations directory page returns a 404, making an exact, citable integration count hard to pin down from primary sources.", + "Gumloop's own pages give differing figures for integrations: its docs introduction cites '100+ pre-built nodes and integrations,' while its dedicated MCP page separately advertises '250+ MCP servers.' These may be different countable categories (native nodes vs MCP-protocol connectors), but neither page cross-references the other, and the dedicated /integrations directory page still returns a 404, making an exact, citable integration count hard to pin down from primary sources.", shortDescription: 'Vendor pages cite different integration counts with no single authoritative figure.', source: { - url: 'https://www.gumloop.com/mcp', - label: 'Gumloop: Fully Hosted MCP Servers', - asOf: '2026-07-02', + url: 'https://docs.gumloop.com/getting-started/introduction', + label: 'Getting Started - Gumloop docs', + asOf: '2026-07-08', }, }, { @@ -134,17 +134,17 @@ export const gumloopProfile: CompetitorProfile = { platform: { builderType: { value: - "Visual, no-code canvas builder with an AI copilot ('Gen') that can generate/modify flows from natural-language prompts", + "Visual, no-code canvas builder with an AI copilot ('Gummie') that can generate/modify flows from natural-language prompts", detail: - "Gumloop is a visual/no-code drag-and-drop canvas for chaining nodes (AI, integration, logic) into agent 'flows'; a chat-based AI copilot named Gen can build and edit these flows from plain-English instructions.", - shortValue: 'Visual canvas plus Gen AI copilot for building flows', + "Gumloop is a visual/no-code drag-and-drop canvas for chaining nodes (AI, integration, logic) into agent 'flows'; a chat-based AI agent named Gummie can build and edit these flows from plain-English instructions.", + shortValue: 'Visual canvas plus Gummie AI copilot for building flows', confidence: 'estimated', sources: [ - { url: 'https://www.gumloop.com', label: 'Gumloop homepage', asOf: '2026-07-02' }, + { url: 'https://www.gumloop.com', label: 'Gumloop homepage', asOf: '2026-07-08' }, { url: 'https://www.gumloop.com/blog/agentic-ai-tools', label: 'Gumloop blog: agentic AI tools', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -330,12 +330,32 @@ export const gumloopProfile: CompetitorProfile = { { url: 'https://docs.gumloop.com/core-concepts/subflows', label: 'Subflows - Gumloop docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, + ], + }, + customBlocks: { + value: + 'No: Gumloop has no feature that publishes an existing deployed workflow as an encapsulated, named block for the whole org to reuse. Subflows let a saved workflow be dropped into other flows as a node, but public docs describe this only as personal/same-project reuse, with no mention of hiding the subflow\'s internal steps or credentials, or of org-wide toolbar placement for other users. The one org-wide, block-like publishing surface Gumloop does have, the Custom Node Builder plus its "Node and Flow Library" Hub, is scoped to single AI-generated code nodes (wrapping an API or script), not a way to turn a multi-step visual workflow into a reusable block.', + detail: + "Gumloop's docs on Subflows describe only how to nest a saved workflow as a node with Input/Output nodes for parameters, with no documented mechanism for sharing that subflow node to other users, hiding its internal graph from them, or auto-propagating updates when the source workflow changes. Separately, docs.gumloop.com/core-concepts/node_and_flow_library confirms users can share a Custom Node organization-wide ('Share with Organization: Makes the node discoverable by all organization members'), appearing immediately in teammates' node libraries, but the page's substantive sections (Custom Nodes Tab, Sharing Custom Nodes, Publishing Custom Nodes) only ever cover single code-based nodes generated by the Custom Node Builder from a natural-language description, not multi-step canvas workflows. No Gumloop page describes converting an existing built flow into a shareable, encapsulated block the way a Custom Node is shared.", + shortValue: "No: Subflows aren't org-shared; org-shared Custom Nodes are code, not flows", + confidence: 'estimated', + sources: [ { - url: 'https://www.gumloop.com/university/lessons/subflows', - label: 'Gumloop University: Subflows', - asOf: '2026-07-02', + url: 'https://docs.gumloop.com/core-concepts/subflows', + label: 'Subflows - Gumloop docs', + asOf: '2026-07-08', + }, + { + url: 'https://docs.gumloop.com/core-concepts/node_and_flow_library', + label: 'Node and Workflow Library - Gumloop docs', + asOf: '2026-07-08', + }, + { + url: 'https://www.gumloop.com/blog/gumloop-custom-nodes', + label: 'Gumloop Blog: Gumloop Custom Nodes', + asOf: '2026-07-08', }, ], }, @@ -372,14 +392,14 @@ export const gumloopProfile: CompetitorProfile = { }, naturalLanguageBuilding: { value: - "Yes: an AI copilot named 'Gen' builds/edits flows from natural-language descriptions", - shortValue: 'Gen copilot builds and edits flows from prompts', + "Yes: an AI copilot named 'Gummie' builds/edits flows from natural-language descriptions", + shortValue: 'Gummie copilot builds and edits flows from prompts', confidence: 'estimated', sources: [ { url: 'https://www.gumloop.com/blog/agentic-ai-tools', label: 'Gumloop blog: agentic AI tools', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -393,21 +413,21 @@ export const gumloopProfile: CompetitorProfile = { }, mcpSupport: { value: - 'Yes: native MCP client/server support with 100+ pre-built hosted MCP servers plus custom MCP server connections', + 'Yes: native MCP client/server support with 250+ pre-built hosted MCP servers plus custom MCP server connections', detail: - "Gumloop can connect to any MCP server (custom URL over HTTPS), offers 100+ fully-hosted MCP servers with zero setup, and supports both 'native MCP' (model connects directly) and a 'backend connector' mode (Gumloop executes tool calls).", - shortValue: '100+ hosted MCP servers plus custom MCP', + "Gumloop can connect to any MCP server (custom URL over HTTPS), offers 250+ fully-hosted MCP servers with zero setup, and supports both 'native MCP' (model connects directly) and a 'backend connector' mode (Gumloop executes tool calls).", + shortValue: '250+ hosted MCP servers plus custom MCP', confidence: 'verified', sources: [ { url: 'https://www.gumloop.com/mcp', label: 'Gumloop: Fully Hosted MCP Servers', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://docs.gumloop.com/nodes/mcp/custom_mcp_servers', label: 'Gumloop docs: Custom MCP Servers', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -422,12 +442,7 @@ export const gumloopProfile: CompetitorProfile = { { url: 'https://www.gumloop.com/changelog', label: 'Gumloop Changelog', - asOf: '2026-07-02', - }, - { - url: 'https://www.gumloop.com/solutions/security', - label: 'Gumloop Security & Trust (guardrails/RBAC)', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -581,21 +596,16 @@ export const gumloopProfile: CompetitorProfile = { }, loopIteration: { value: - "Partial: Gumloop's only documented iteration primitive is 'Loop Mode', the same mechanism covered under parallelExecution, which auto-triggers when a list is connected to a node or Subflow and runs that node once per list item. Per Gumloop's docs this is concurrent (2 items at once on Free, 15 on Pro), not a strictly one-at-a-time sequential container, and no separate while-loop or fixed-iteration-count node is documented, only iteration over an existing list.", + "Partial: Gumloop's only documented iteration primitive is 'Loop Mode', the same mechanism covered under parallelExecution, which a user manually enables on a node so it runs once per item in a connected list. Per Gumloop's docs this is concurrent (2 items at once on Free, 15 on Pro), not a strictly one-at-a-time sequential container, and no separate while-loop or fixed-iteration-count node is documented, only manually-enabled iteration over an existing list.", detail: - "Gumloop docs describe Loop Mode as processing 'multiple items simultaneously' with concurrency capped by plan tier, distinct from a classic for-each node that guarantees one iteration finishes before the next starts. No dedicated while-loop (condition-based) or fixed-count repeat node is documented; all iteration is driven by connecting a list as input.", - shortValue: 'Partial: list-driven Loop Mode is concurrent, not a sequential loop node', + "Gumloop docs describe Loop Mode as a mode a user enables on a node ('When you enable Loop Mode on a node...'), which then processes multiple list items simultaneously with concurrency capped by plan tier, distinct from a classic for-each node that guarantees one iteration finishes before the next starts. No dedicated while-loop (condition-based) or fixed-count repeat node is documented; all iteration requires manually enabling Loop Mode with a list as input.", + shortValue: 'Partial: manually-enabled Loop Mode is concurrent, not a sequential loop node', confidence: 'estimated', sources: [ { url: 'https://docs.gumloop.com/core-concepts/loop_mode', label: 'Loop Mode - Gumloop docs', - asOf: '2026-07-02', - }, - { - url: 'https://www.gumloop.com/university/lessons/lists-loop-mode', - label: 'Gumloop University: Lists & Loop mode', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -603,16 +613,21 @@ export const gumloopProfile: CompetitorProfile = { integrations: { integrationCount: { value: - "Vendor-claimed figures vary by page: 100+ nodes/integrations, 100+ hosted MCP servers; third-party reviews cite '130+ native integrations'", + 'Vendor-claimed figures vary by page: 100+ pre-built nodes and integrations (per docs.gumloop.com), 250+ hosted MCP servers (per gumloop.com/mcp)', detail: - "No single authoritative exact count is published on a primary Gumloop page. gumloop.com/mcp cites '100+ MCP servers, fully hosted, zero setup' while other Gumloop copy references '100+ pre-built nodes and integrations,' and the dedicated /integrations directory page returns a 404.", - shortValue: '100+ integrations and MCP servers (vendor figures vary)', + "No single authoritative exact count is published on a primary Gumloop page. docs.gumloop.com's introduction cites '100+ pre-built nodes and integrations' while gumloop.com/mcp separately cites '250+ MCP servers, zero setup'; the two pages do not cross-reference each other, and the dedicated /integrations directory page returns a 404.", + shortValue: '100+ nodes/integrations, 250+ MCP servers (vendor figures vary)', confidence: 'estimated', sources: [ + { + url: 'https://docs.gumloop.com/getting-started/introduction', + label: 'Getting Started - Gumloop docs', + asOf: '2026-07-08', + }, { url: 'https://www.gumloop.com/mcp', label: 'Gumloop: Fully Hosted MCP Servers', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -683,7 +698,7 @@ export const gumloopProfile: CompetitorProfile = { }, mcpPublishing: { value: - "No: Gumloop's MCP capability mainly runs in the consuming direction. It connects agents/workflows to 100+ fully hosted MCP servers (Slack, Notion, GitHub, etc.) and lets users add custom MCP servers as tool sources. No official Gumloop documentation describes publishing a user's deployed workflow itself as a callable MCP server for external AI tools to consume.", + "No: Gumloop's MCP capability mainly runs in the consuming direction. It connects agents/workflows to 250+ fully hosted MCP servers and lets users add custom MCP servers as tool sources. No official Gumloop documentation describes publishing a user's deployed workflow itself as a callable MCP server for external AI tools to consume.", detail: 'A third-party, unofficial open-source project ("gumloop-mcp" on GitHub) wraps the Gumloop management API as an MCP server, but that is not the same as natively publishing a specific deployed workflow as an MCP tool, and it is not an official Gumloop product.', shortValue: "No: consumes MCP servers, doesn't publish flows as one", @@ -692,7 +707,7 @@ export const gumloopProfile: CompetitorProfile = { { url: 'https://www.gumloop.com/mcp', label: 'Fully Hosted MCP Servers for Your AI Agents - Gumloop', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://docs.gumloop.com/nodes/mcp/custom_mcp_servers', @@ -1152,7 +1167,7 @@ export const gumloopProfile: CompetitorProfile = { }, academy: { value: - 'Yes: Gumloop runs "Gumloop University," a structured learning resource with self-paced courses (e.g. "Gumloop 101"), live webinars, and week-long "Learning Cohorts" that award a certificate of completion for finishing practical challenges.', + 'Yes: Gumloop runs "Gumloop University," a structured learning resource with self-paced courses (e.g. "Getting Started with Gumloop"), live webinars, and week-long "Learning Cohorts" that award a certificate of completion for finishing practical challenges.', detail: 'Certification is tied to completing cohort challenges rather than a formal exam-based program, but it is a structured curriculum beyond ad hoc docs/blog posts.', shortValue: 'Yes: Gumloop University with courses and certificates', @@ -1161,17 +1176,12 @@ export const gumloopProfile: CompetitorProfile = { { url: 'https://university.gumloop.com/', label: 'Gumloop University', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://www.gumloop.com/cohorts', label: 'Gumloop Learning Cohorts', - asOf: '2026-07-02', - }, - { - url: 'https://www.gumloop.com/university/courses/gumloop-101', - label: 'Gumloop 101 course', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, diff --git a/apps/sim/lib/compare/data/competitors/langchain.ts b/apps/sim/lib/compare/data/competitors/langchain.ts index 0c58d2b12be..2bd50437677 100644 --- a/apps/sim/lib/compare/data/competitors/langchain.ts +++ b/apps/sim/lib/compare/data/competitors/langchain.ts @@ -24,9 +24,9 @@ export const langchainProfile: CompetitorProfile = { shortDescription: 'Snapshots graph state after every node so runs resume, not restart, on failure.', source: { - url: 'https://www.langchain.com/blog/fault-tolerance-in-langgraph', - label: 'Fault Tolerance in LangGraph (LangChain Blog)', - asOf: '2026-07-02', + url: 'https://docs.langchain.com/oss/python/langgraph/use-time-travel', + label: 'Time travel - Docs by LangChain', + asOf: '2026-07-08', }, }, { @@ -66,14 +66,15 @@ export const langchainProfile: CompetitorProfile = { }, }, { - title: 'LangGraph Studio: a browser-based visual agent IDE with time-travel debugging', + title: 'LangGraph Studio: browser-based execution visualization with hot-reload', description: - "Studio renders a running agent's graph (nodes, edges, conditional branches) visually, lets a developer inspect state at every node, rewind to a previous checkpoint, edit the state, and fork a new execution path from there, and hot-reloads when a prompt or tool signature changes in code.", - shortDescription: 'Visual graph IDE with checkpoint rewind, state editing, and hot-reload.', + "Studio is a browser-based UI (hosted at smith.langchain.com/studio) that connects to a locally running agent and shows each execution step, prompt, and tool call, and hot-reloads when a prompt or tool signature changes in code. LangGraph's time-travel capability (inspecting, editing, and forking from a prior checkpoint) is a separate, SDK-level feature exposed via code (get_state_history / update_state), not a point-and-click Studio UI.", + shortDescription: + 'Browser-based execution viewer with hot-reload; checkpoint rewind/fork is a separate SDK capability.', source: { - url: 'https://www.langchain.com/blog/langgraph-studio-the-first-agent-ide', - label: 'LangGraph Studio: The first agent IDE', - asOf: '2026-07-02', + url: 'https://docs.langchain.com/oss/python/langgraph/studio', + label: 'LangGraph Studio - Docs by LangChain', + asOf: '2026-07-08', }, }, ], @@ -91,15 +92,15 @@ export const langchainProfile: CompetitorProfile = { }, }, { - title: 'No native, publicly deployable chat UI shipped with the open-source libraries', + title: 'No one-click chat deployment tied to a specific agent', description: - 'Neither LangChain nor LangGraph ships a first-party, hosted chat widget or public chat surface a builder can toggle on for an end user. Teams that want a deployed conversational UI build their own frontend (or use a separate framework like Chainlit/Streamlit) and call the LangGraph Agent Server as a backend.', + 'Neither LangChain, LangGraph, nor LangSmith Deployment lets a builder toggle a hosted chat surface on for one specific agent the way a platform-managed deployment target would. LangChain does host a shared, generic "Agent Chat UI" instance at agentchat.vercel.app that any team can point at their own LangGraph Agent Server URL and API key, or a team can deploy the open-source Next.js app themselves (or use a separate framework like Chainlit/Streamlit).', shortDescription: - 'No first-party hosted chat UI; teams build their own frontend against the Agent Server.', + 'No per-agent hosted chat toggle; a shared generic Agent Chat UI instance exists, or self-deploy.', source: { - url: 'https://docs.langchain.com/langsmith/assistants', - label: 'Assistants - Docs by LangChain', - asOf: '2026-07-02', + url: 'https://github.com/langchain-ai/agent-chat-ui', + label: 'langchain-ai/agent-chat-ui (GitHub)', + asOf: '2026-07-08', }, }, { @@ -133,15 +134,15 @@ export const langchainProfile: CompetitorProfile = { value: 'Code-first Python/JavaScript framework (LangChain) plus a low-level graph-orchestration library (LangGraph) for building agents in code. LangGraph Studio adds a browser-based visual IDE to render, inspect, and debug an already-coded agent graph, and Deep Agents provides a batteries-included harness on top of both.', detail: - 'There is no drag-and-drop agent authoring surface; developers write Python or TypeScript against LangChain/LangGraph APIs, and Studio visualizes the resulting graph for debugging and time-travel, rather than authoring it visually from scratch.', + 'There is no drag-and-drop agent authoring surface; developers write Python or TypeScript against LangChain/LangGraph APIs, and Studio visualizes execution steps for debugging (time-travel checkpoint rewind/fork is a separate SDK-level feature) rather than authoring the graph visually from scratch.', shortValue: 'Code framework plus a graph-visualization/debugging Studio, not a visual builder', confidence: 'verified', sources: [ { - url: 'https://www.langchain.com/blog/langgraph-studio-the-first-agent-ide', - label: 'LangGraph Studio: The first agent IDE', - asOf: '2026-07-02', + url: 'https://docs.langchain.com/oss/python/langgraph/studio', + label: 'LangGraph Studio - Docs by LangChain', + asOf: '2026-07-08', }, { url: 'https://github.com/langchain-ai/deepagents', @@ -279,7 +280,7 @@ export const langchainProfile: CompetitorProfile = { }, nativeFileStorage: { value: - 'No: neither LangChain, LangGraph, nor LangSmith provides a Drive-like file storage system with folder hierarchy, link sharing, or a recycle bin. File handling is done in application code via document loaders and external storage integrations (S3, GCS, local filesystem) that a developer wires up themselves', + "No: neither LangChain, LangGraph, nor LangSmith provides a Drive-like file storage system with folder hierarchy, link sharing, or a recycle bin. Deep Agents offers a virtual filesystem abstraction (in-memory, local disk, LangGraph store, or custom backends) for an agent's own working context, but persistent storage still relies on external integrations (S3, GCS, local filesystem) a developer wires up themselves", detail: "Deep Agents provides a virtual/in-memory filesystem abstraction for an agent's own working context (planning, scratch files), which is a per-run working memory concept, not a persistent, user-facing file manager.", shortValue: 'No, file handling is via document-loader code, not a built-in file manager', @@ -288,7 +289,7 @@ export const langchainProfile: CompetitorProfile = { { url: 'https://docs.langchain.com/oss/python/deepagents/overview', label: 'Deep Agents overview - Docs by LangChain', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -332,20 +333,35 @@ export const langchainProfile: CompetitorProfile = { }, ], }, + customBlocks: { + value: + "No: LangChain/LangGraph has no drag-and-drop block toolbar at all, so there is no way to publish a deployed graph as a named, iconed block that other org members drop into their own separate graphs with auto-derived inputs and curated, renamed outputs. The closest adjacent capability is code-level: the RemoteGraph SDK class lets a developer add another team's deployed graph as a node in their own graph by writing code that points at its deployment URL and graph/assistant name.", + detail: + "RemoteGraph exposes the same programmatic interface as a locally compiled graph ('as if it were a local graph'), but the consuming developer must hand-write any state-schema-mapping wrapper code themselves, and there is no UI for picking/renaming which outputs to expose or for auto-deriving input fields from the source graph the way a visual builder does. LangChain's own docs describe RemoteGraph purely as an SDK for calling a deployment programmatically, not as a block placed in a shared, org-wide palette alongside built-in nodes.", + shortValue: 'No block toolbar exists; closest is code-level RemoteGraph SDK calls', + confidence: 'estimated', + sources: [ + { + url: 'https://docs.langchain.com/langsmith/use-remote-graph', + label: 'How to interact with a deployment using RemoteGraph - Docs by LangChain', + asOf: '2026-07-08', + }, + ], + }, }, aiCapabilities: { multiLlmSupport: { value: - 'Yes: LangChain provides a standardized interface (ChatModel/Runnable) to over 100 LLM providers and hundreds of documented integrations across providers, embeddings, and vector stores, including OpenAI, Anthropic, Google, AWS Bedrock, Azure OpenAI, Mistral, Cohere, and local models via Ollama', + 'Yes: LangChain provides a standardized model interface and advertises 1,000+ documented integrations across providers, embeddings, and vector stores, including OpenAI, Anthropic, Google, AWS, Groq, Hugging Face, Databricks, Mistral, and local models via Ollama', detail: "This is the framework's foundational design goal: swap providers by changing the model class instantiation, with the rest of a chain/graph remaining unchanged.", - shortValue: '100+ LLM providers via a standardized model interface', + shortValue: '1,000+ integrations via a standardized model interface', confidence: 'verified', sources: [ { url: 'https://www.langchain.com/langchain', label: 'LangChain: Open Source AI Agent Framework', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -384,9 +400,14 @@ export const langchainProfile: CompetitorProfile = { confidence: 'verified', sources: [ { - url: 'https://blog.langchain.com/launching-langgraph-templates/', - label: 'Launching LangGraph Templates (LangChain Blog)', - asOf: '2026-07-02', + url: 'https://docs.langchain.com/oss/python/langchain/retrieval', + label: 'Retrieval - Docs by LangChain', + asOf: '2026-07-08', + }, + { + url: 'https://docs.langchain.com/oss/python/integrations/vectorstores', + label: 'VectorStore Interface and Integrations - Docs by LangChain', + asOf: '2026-07-08', }, ], }, @@ -455,9 +476,9 @@ export const langchainProfile: CompetitorProfile = { confidence: 'verified', sources: [ { - url: 'https://blog.langchain.com/launching-langgraph-templates/', - label: 'Launching LangGraph Templates (LangChain Blog)', - asOf: '2026-07-02', + url: 'https://docs.langchain.com/oss/python/langchain/models', + label: 'Models - Docs by LangChain', + asOf: '2026-07-08', }, ], }, @@ -470,9 +491,9 @@ export const langchainProfile: CompetitorProfile = { confidence: 'verified', sources: [ { - url: 'https://python.langchain.com/v0.2/docs/how_to/fallbacks/', - label: 'How to add fallbacks to a runnable | LangChain', - asOf: '2026-07-02', + url: 'https://reference.langchain.com/python/langchain-core/runnables/fallbacks/RunnableWithFallbacks', + label: 'RunnableWithFallbacks - LangChain Reference', + asOf: '2026-07-08', }, ], }, @@ -493,16 +514,16 @@ export const langchainProfile: CompetitorProfile = { }, nativeChatDeployment: { value: - 'No: neither the open-source libraries nor LangGraph Platform ship a first-party, publicly deployable chat widget or hosted chat page. A team deploying a conversational agent builds its own frontend (or uses a separate UI framework) calling the LangGraph Agent Server as a backend', + 'Partial: neither the open-source libraries nor LangSmith Deployment let a builder toggle a hosted chat surface on for one specific agent. LangChain hosts a shared, generic "Agent Chat UI" instance at agentchat.vercel.app that any team can point at their own LangGraph Agent Server URL and API key, or a team can deploy the open-source Next.js app itself', detail: 'LangGraph Studio itself provides a chat-style interaction panel for testing/debugging a graph during development, but this is a developer tool, not a shippable end-user chat deployment target.', - shortValue: 'No first-party public chat surface; teams build and host their own frontend', + shortValue: 'Partial: shared generic hosted chat client, no per-agent one-click toggle', confidence: 'estimated', sources: [ { - url: 'https://docs.langchain.com/langsmith/assistants', - label: 'Assistants - Docs by LangChain', - asOf: '2026-07-02', + url: 'https://github.com/langchain-ai/agent-chat-ui', + label: 'langchain-ai/agent-chat-ui (GitHub)', + asOf: '2026-07-08', }, ], }, @@ -516,9 +537,9 @@ export const langchainProfile: CompetitorProfile = { confidence: 'verified', sources: [ { - url: 'https://blog.langchain.com/launching-langgraph-templates/', - label: 'Launching LangGraph Templates (LangChain Blog)', - asOf: '2026-07-02', + url: 'https://reference.langchain.com/python/langchain-core/documents/base/Document', + label: 'Document - LangChain Reference', + asOf: '2026-07-08', }, ], }, @@ -572,23 +593,22 @@ export const langchainProfile: CompetitorProfile = { }, integrations: { integrationCount: { - value: - '1,000+ integrations across model providers, vector stores, document loaders, and tools, with a unified interface to 100+ LLM providers specifically', + value: '1,000+ integrations, spanning model providers, data sources, and tools', detail: - 'The langchain-community package hosts many additional community-maintained integrations beyond what is centrally documented, so the true count is larger and harder to pin to one authoritative live number, unlike a connector-count page some workflow builders publish.', - shortValue: '1,000+ integrations; 100+ LLM providers via a unified interface', + 'Community-maintained integrations beyond what LangChain centrally documents also exist across dedicated integration repos, so the true count is larger and harder to pin to one authoritative live number, unlike a connector-count page some workflow builders publish.', + shortValue: '1,000+ integrations', confidence: 'estimated', sources: [ { url: 'https://www.langchain.com/langchain', label: 'LangChain: Open Source AI Agent Framework', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, triggerTypes: { value: - "Not a workflow-builder concept: agents are invoked programmatically (function/API call) or served over the LangGraph Agent Server's REST/SDK interface. The Agent Server also exposes protocol-level entry points (A2A, MCP), but there is no equivalent to a connector-event/schedule/webhook trigger picker.", + "Not a workflow-builder concept: agents are invoked programmatically (function/API call) or served over the LangGraph Agent Server's REST interface. The Agent Server also exposes protocol-level entry points (A2A), but there is no equivalent to a connector-event/schedule/webhook trigger picker.", detail: 'A developer wires up whatever trigger mechanism they need in their own application code (a cron job, a webhook handler, a queue consumer) that then calls the LangGraph SDK or REST API to start a run.', shortValue: @@ -596,9 +616,9 @@ export const langchainProfile: CompetitorProfile = { confidence: 'estimated', sources: [ { - url: 'https://docs.langchain.com/langsmith/assistants', - label: 'Assistants - Docs by LangChain', - asOf: '2026-07-02', + url: 'https://docs.langchain.com/langsmith/server-api-ref', + label: 'Agent Server API reference - Docs by LangChain', + asOf: '2026-07-08', }, ], }, @@ -613,52 +633,57 @@ export const langchainProfile: CompetitorProfile = { }, apiPublishing: { value: - 'Yes: the LangGraph Agent Server exposes deployed graphs over a REST API and SDKs (Python/JS), and additionally supports the Agent Protocol, MCP, and A2A as callable interfaces for the same deployed agent', + 'Yes: the LangGraph Agent Server exposes deployed graphs over a REST API, and additionally supports A2A as a callable interface for the same deployed agent', detail: - 'A single deployed graph can be called via plain REST, the LangGraph SDK, or one of the standardized agent-interop protocols, depending on the caller.', - shortValue: 'Yes, REST/SDK plus Agent Protocol, MCP, and A2A interfaces', + 'A single deployed graph can be called via plain REST or the standardized A2A agent-interop protocol, depending on the caller.', + shortValue: 'Yes, REST API plus an A2A interface', confidence: 'verified', sources: [ { - url: 'https://docs.langchain.com/langsmith/agent-server', - label: 'Agent Server - Docs by LangChain', - asOf: '2026-07-04', + url: 'https://docs.langchain.com/langsmith/server-api-ref', + label: 'Agent Server API reference - Docs by LangChain', + asOf: '2026-07-08', }, { url: 'https://docs.langchain.com/langsmith/server-a2a', label: 'A2A endpoint in Agent Server - Docs by LangChain', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, extensibilitySdk: { value: - 'Official Python and JavaScript/TypeScript SDKs for both LangChain and LangGraph, a public REST API for the Agent Server, and an open, MIT-licensed codebase that any developer can extend, fork, or contribute integrations back to via langchain-community', + 'Official Python and JavaScript/TypeScript SDKs for both LangChain and LangGraph, a public REST API for the Agent Server, and an open, MIT-licensed codebase that any developer can extend or fork; community integrations now live in their own dedicated repositories rather than the sunset langchain-community package', detail: 'Because the whole product is a set of open-source libraries, extensibility is inherent rather than a separately bolted-on SDK layer, distinct from a workflow builder that offers a custom-node development kit for an otherwise closed core product.', shortValue: - 'Official Python/JS SDKs, open MIT-licensed codebase, community integration package', + 'Official Python/JS SDKs, open MIT-licensed codebase, integrations in standalone repos', confidence: 'verified', sources: [ { url: 'https://github.com/langchain-ai/langchain', label: 'langchain-ai/langchain (GitHub)', - asOf: '2026-07-02', + asOf: '2026-07-08', + }, + { + url: 'https://pypi.org/project/langchain-community/', + label: 'langchain-community on PyPI (sunset notice)', + asOf: '2026-07-08', }, ], }, mcpPublishing: { value: - 'Yes: an agent built with LangChain/LangGraph can be exposed as MCP tools/resources for external AI clients to call, via the same langchain-mcp-adapters ecosystem used to consume external MCP servers, in addition to native A2A server exposure', + "Yes: a LangGraph agent deployed on LangGraph Server is automatically exposed as an MCP-compatible tool via the server's built-in /mcp endpoint (Streamable HTTP), a separate mechanism from langchain-mcp-adapters, which is used only to consume external MCP servers as LangChain tools. LangGraph also supports native A2A server exposure", detail: "This is the reverse direction from consuming an external MCP server's tools, publishing a LangGraph agent's own capabilities for other MCP clients to invoke.", - shortValue: 'Yes, agents can be exposed as MCP tools via langchain-mcp-adapters', + shortValue: 'Yes, LangGraph Server exposes deployed agents via a built-in /mcp endpoint', confidence: 'estimated', sources: [ { - url: 'https://github.com/langchain-ai/langchain-mcp-adapters', - label: 'langchain-ai/langchain-mcp-adapters (GitHub)', - asOf: '2026-07-02', + url: 'https://docs.langchain.com/langsmith/server-api-ref', + label: 'Agent Server API reference - Docs by LangChain', + asOf: '2026-07-08', }, ], }, @@ -696,16 +721,16 @@ export const langchainProfile: CompetitorProfile = { }, freeTier: { value: - "Yes: the LangChain/LangGraph open-source libraries are free with no usage limits of their own, and LangSmith's Developer plan is $0/seat/month with up to 5,000 base traces/month and a free, limited self-hosted LangGraph server tier (up to 100,000 nodes executed/month)", + "Yes: the LangChain/LangGraph open-source libraries are free with no usage limits of their own, and LangSmith's Developer plan is $0/seat/month with up to 5,000 base traces/month. Self-hosted LangGraph deployment is now an Enterprise (custom-priced) offering rather than a free tier", detail: - 'The free LangSmith Developer tier is capped at a single seat and community-only support; higher usage or team seats require moving to the Plus or Enterprise tier.', + 'The free LangSmith Developer tier is capped at a single seat and community-only support; higher usage, team seats, or self-hosted deployment require moving to a paid or Enterprise tier.', shortValue: 'Free OSS libraries, plus a free single-seat LangSmith Developer tier', confidence: 'verified', sources: [ { url: 'https://www.langchain.com/pricing', label: 'LangSmith Pricing', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -722,27 +747,23 @@ export const langchainProfile: CompetitorProfile = { }, security: { soc2: { - value: 'Yes: both LangSmith and LangGraph Platform are SOC 2 Type II compliant.', + value: + "Yes: LangSmith is SOC 2 Type II certified. LangGraph Platform (now branded LangSmith Deployment) is publicly announced as carrying the same attestation, sharing LangSmith's infrastructure and compliance posture.", detail: - 'Both LangSmith and LangGraph Platform (now branded LangSmith Deployment) carry the same SOC 2 Type II attestation.', - shortValue: 'Yes, SOC 2 Type II for both LangSmith and LangGraph Platform', + "LangChain's Trust Center (trust.langchain.com) is the canonical source but renders via client-side JavaScript, so it could not be directly verified by an automated fetch; the LangSmith-side certification is independently confirmed on a static docs page.", + shortValue: 'Yes, SOC 2 Type II for LangSmith; LangGraph Platform shares it', confidence: 'verified', sources: [ { - url: 'https://changelog.langchain.com/announcements/langsmith-is-now-soc-2-type-ii-compliant', - label: 'LangSmith is now SOC 2 Type II compliant (LangChain Changelog)', - asOf: '2026-07-02', - }, - { - url: 'https://trust.langchain.com/', - label: 'LangChain Trust Center', - asOf: '2026-07-02', + url: 'https://docs.langchain.com/langsmith/regions-faq', + label: 'Regions FAQ - Docs by LangChain (confirms SOC 2 Type 2)', + asOf: '2026-07-08', }, ], }, dataResidency: { value: - 'Yes: LangSmith offers selectable regions at no extra cost, US (GCP US, default), EU (GCP EU), APAC (GCP APAC), and a separate AWS US region, plus multi-geo data residency options for self-hosted deployments', + 'Yes: LangSmith offers selectable regions at no extra cost — US (GCP US), EU (GCP EU), APAC (GCP APAC), and a separate AWS US region', detail: 'Migrating an existing organization between regions is not supported; the region must be chosen at signup. Full self-hosting (of the OSS libraries or LangGraph Platform) is a further, absolute form of data residency control.', shortValue: 'Yes, US/EU/APAC/AWS-US selectable regions, no migration between them', @@ -751,7 +772,7 @@ export const langchainProfile: CompetitorProfile = { { url: 'https://docs.langchain.com/langsmith/regions-faq', label: 'Regions FAQ - Docs by LangChain', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -849,7 +870,7 @@ export const langchainProfile: CompetitorProfile = { }, piiRedaction: { value: - 'Yes: LangSmith supports masking sensitive data before it reaches the backend via environment-variable-level hiding of all inputs/outputs, custom masking functions for selective redaction, and regex-based anonymizers (with a reference implementation in langsmith-pii-removal) covering emails, IPs, phone numbers, credit cards, SSNs, and dates. It also integrates with third-party tools like Microsoft Presidio.', + 'Yes: LangSmith supports masking sensitive data before it reaches the backend via environment-variable-level hiding of all inputs/outputs, custom masking functions for selective redaction, and a reference regex-based anonymizer example covering emails, phone numbers, full names, credit cards, and SSNs. It also integrates with third-party tools like Microsoft Presidio.', detail: "Redaction happens client-side, before the trace payload is serialized and sent, via a create_anonymizer hook, so sensitive data is stripped in the customer's own process rather than being redacted after ingestion.", shortValue: 'Yes, client-side masking/anonymizer hooks with regex PII detection', @@ -858,7 +879,7 @@ export const langchainProfile: CompetitorProfile = { { url: 'https://docs.langchain.com/langsmith/mask-inputs-outputs', label: 'Prevent logging of sensitive data in traces - Docs by LangChain', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -871,9 +892,9 @@ export const langchainProfile: CompetitorProfile = { confidence: 'verified', sources: [ { - url: 'https://changelog.langchain.com/announcements/saml-sso-for-unified-access-to-langsmith', - label: 'SAML SSO for unified access to LangSmith (LangChain Changelog)', - asOf: '2026-07-02', + url: 'https://docs.langchain.com/langsmith/user-management', + label: 'User management - Docs by LangChain', + asOf: '2026-07-08', }, ], }, @@ -910,9 +931,14 @@ export const langchainProfile: CompetitorProfile = { confidence: 'verified', sources: [ { - url: 'https://www.langchain.com/blog/langgraph-studio-the-first-agent-ide', - label: 'LangGraph Studio: The first agent IDE', - asOf: '2026-07-02', + url: 'https://docs.langchain.com/langsmith/observability-concepts', + label: 'Observability concepts - Docs by LangChain', + asOf: '2026-07-08', + }, + { + url: 'https://docs.langchain.com/oss/python/langgraph/use-time-travel', + label: 'Time travel - Docs by LangChain', + asOf: '2026-07-08', }, ], }, @@ -958,16 +984,16 @@ export const langchainProfile: CompetitorProfile = { }, asyncExecution: { value: - 'Yes: the LangGraph Agent Server supports background/async execution. A run can be started and its result polled or streamed later via the SDK/REST API, and interrupt()-paused runs inherently execute asynchronously across a human-response gap by design.', + 'Yes: the LangGraph Agent Server enqueues each run for a queue worker to pick up, and its result can be polled or streamed later via the REST API, independent of the client connection that started it.', detail: "This is a natural consequence of the Agent Server's run/thread model, where a run's state persists server-side independent of any single blocking client connection.", - shortValue: "Yes, via the Agent Server's run/thread API and checkpoint-backed pausing", + shortValue: "Yes, via the Agent Server's queued run/thread API", confidence: 'estimated', sources: [ { - url: 'https://docs.langchain.com/langsmith/assistants', - label: 'Assistants - Docs by LangChain', - asOf: '2026-07-02', + url: 'https://docs.langchain.com/langsmith/agent-server', + label: 'Agent Server - Docs by LangChain', + asOf: '2026-07-08', }, ], }, diff --git a/apps/sim/lib/compare/data/competitors/langflow.ts b/apps/sim/lib/compare/data/competitors/langflow.ts index 93e28c1aee0..f9d41991de7 100644 --- a/apps/sim/lib/compare/data/competitors/langflow.ts +++ b/apps/sim/lib/compare/data/competitors/langflow.ts @@ -265,6 +265,26 @@ export const langflowProfile: CompetitorProfile = { }, ], }, + customBlocks: { + value: + "No: Langflow has no documented mechanism to publish a deployed flow as an encapsulated, named block that appears org-wide in the component sidebar for other users to drop into their own separate flows. The closest features are narrower: grouping components and saving them creates a static snapshot copy in the creating user's own Core components menu, with no documented auto-sync back to a source flow's latest version; and the legacy Langflow Store lets a user publish a component or flow to a public, account-based marketplace rather than a governed, org-scoped, live-linked block. Its Run Flow component (see subWorkflows) is same-project subflow composition, not org-wide reuse by other users.", + detail: + "Neither mechanism matches Sim's model of a workspace admin publishing a deployed workflow as a block that all consumers see in the shared toolbar, auto-tracks the source's latest deployed version, and hides the source's internal steps and credentials.", + shortValue: 'No, only static component snapshots or a public component store', + confidence: 'estimated', + sources: [ + { + url: 'https://docs.langflow.org/concepts-components', + label: 'Langflow Docs: Components overview (grouping and saving components)', + asOf: '2026-07-08', + }, + { + url: 'https://github.com/langflow-ai/langflow/discussions/4406', + label: 'GitHub Discussion 4406: How to save a custom component to the sidebar?', + asOf: '2026-07-08', + }, + ], + }, }, aiCapabilities: { multiLlmSupport: { @@ -766,32 +786,42 @@ export const langflowProfile: CompetitorProfile = { }, thirdPartyVetting: { value: - 'Partial: Langflow disclosed CVE-2025-3248, an unauthenticated remote code execution flaw in the custom-component code-validation endpoint, actively exploited in the wild to deploy the Flodrix botnet on unpatched instances before it was fixed in version 1.3.0. That incident reflects the underlying trust model: most built-in integration bundles are contributed as pull requests to the official langflow-ai/langflow codebase and merged by core maintainers, but Langflow also ships a community Store where users can share and install flows and components with lighter, informal vetting, plus a custom-component system that lets any user author and run their own Python code with full server access, the same trust level as the core server itself.', + 'Partial: Langflow disclosed CVE-2025-3248, an unauthenticated remote code execution flaw in the custom-component code-validation endpoint, fixed in version 1.3.0; security researchers confirmed it was actively exploited in the wild to deploy the Flodrix botnet on unpatched instances before the fix shipped. That incident reflects the underlying trust model: built-in integration bundles are contributed by third-party contributors as pull requests to the official langflow-ai/langflow codebase and reviewed and merged by core maintainers, but Langflow also ships a custom-component system that lets any user author and run their own Python code with full server access, the same trust level as the core server itself.', detail: - "Langflow documents that it does not enforce isolation between users or restrict local disk/network access, so both bundle and custom-component code run with the same trust level as the core server. By contrast, every one of Sim's blocks is first-party authored and code-reviewed through Sim's own pull-request process, and Sim has no public marketplace where a third party can publish installable executable tool code.", + "Langflow documents that it does not enforce isolation between users or restrict local disk/network access, so custom-component code runs with the same trust level as the core server. By contrast, every one of Sim's blocks is first-party authored and code-reviewed through Sim's own pull-request process, and Sim has no public marketplace where a third party can publish installable executable tool code.", shortValue: - 'Partial: disclosed CVE-2025-3248 RCE; lighter-vetted community Store and custom code', + 'Partial: disclosed CVE-2025-3248 RCE exploited via Flodrix botnet; custom code runs at full server trust', confidence: 'verified', sources: [ { url: 'https://docs.langflow.org/components-bundle-components', label: 'Langflow Docs - About bundles', - asOf: '2026-07-02', + asOf: '2026-07-08', + }, + { + url: 'https://docs.langflow.org/contributing-components', + label: 'Langflow Docs - Contribute components', + asOf: '2026-07-08', }, { url: 'https://docs.langflow.org/components-custom-components', label: 'Langflow Docs - Create custom Python components', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://docs.langflow.org/security', label: 'Langflow Docs - Security', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { - url: 'https://github.com/langflow-ai/langflow/security/advisories/GHSA-vwmf-pq79-vjvx', - label: 'GitHub Security Advisory GHSA-vwmf-pq79-vjvx (CVE-2025-3248)', - asOf: '2026-07-02', + url: 'https://github.com/langflow-ai/langflow/security/advisories/GHSA-rvqx-wpfh-mfx7', + label: 'GitHub Security Advisory GHSA-rvqx-wpfh-mfx7 (CVE-2025-3248)', + asOf: '2026-07-08', + }, + { + url: 'https://www.securityweek.com/recent-langflow-vulnerability-exploited-by-flodrix-botnet/', + label: 'SecurityWeek - Langflow Vulnerability Exploited by Flodrix Botnet', + asOf: '2026-07-08', }, ], }, diff --git a/apps/sim/lib/compare/data/competitors/make.ts b/apps/sim/lib/compare/data/competitors/make.ts index ee39cd274d7..210142f1369 100644 --- a/apps/sim/lib/compare/data/competitors/make.ts +++ b/apps/sim/lib/compare/data/competitors/make.ts @@ -79,34 +79,35 @@ export const makeProfile: CompetitorProfile = { { title: 'Proprietary, closed-source license', description: - "Unlike open-source workflow tools, Make's codebase is not published; there is no community fork/self-audit path and organizations depend entirely on Make's (Celonis-owned) roadmap and infrastructure.", + "Unlike open-source workflow tools, Make's codebase is not published; Celonis (Make's owner) retains exclusive ownership of the Services, and customers are contractually barred from copying, modifying, creating derivative works from, or reverse-engineering the platform, so there is no community fork/self-audit path and organizations depend entirely on Celonis's roadmap and infrastructure.", shortDescription: 'Closed-source codebase with no community fork or audit path.', source: { - url: 'https://www.make.com/en/pricing', - label: 'Make Pricing page', - asOf: '2026-07-02', + url: 'https://www.make.com/master-service-agreement.pdf', + label: 'Master Services Agreement for Make, Section 4.4 & 6.1 (Celonis)', + asOf: '2026-07-08', }, }, { - title: 'Code step is sandboxed with no network access or package installs', + title: 'Code step allows direct HTTP calls; custom package installs need Enterprise', description: - 'The native Make Code (JS/Python) module cannot make HTTP requests, has no external network access, and cannot install npm or PyPI packages, limiting it to pure in-memory data transforms rather than general-purpose custom integration code.', - shortDescription: 'Code step blocks network calls and package installs.', + "The native Make Code (JS/Python) module can make direct HTTP requests, though Make recommends using the dedicated HTTP module instead to avoid exposing credentials. Enterprise-plan customers can import custom third-party npm/PyPI libraries as declared dependencies; lower tiers only get Make's pre-installed common libraries.", + shortDescription: + 'Code step permits HTTP calls; custom package installs are Enterprise-only.', source: { url: 'https://apps.make.com/code', label: 'Make Code app docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, }, { title: 'Granular RBAC gated to the Teams plan and above', description: - "Full team/role-based permission management is only available starting on the Teams plan ($38/mo) and Enterprise; lower tiers (Free, Core, Pro) get unlimited users but no role-based access controls, unlike Sim, which ships admin/write/read roles on every tier. Audit logs are also gated to Teams/Enterprise, with default retention of just 30 days on paid plans, though this specific gating pattern isn't unique to Make: Sim's own dedicated audit-log API is likewise Enterprise-only.", - shortDescription: 'RBAC needs the Teams plan or above; audit logs are similarly gated.', + "Full team/role-based permission management ('Teams and team roles', letting admins manage unlimited team permissions for scenario apps, templates, and connections) is only listed as a feature starting on the Teams plan ($38/mo) and Enterprise; lower tiers (Free, Core, Pro) get unlimited users but no role-based access controls, unlike Sim, which ships admin/write/read roles on every tier.", + shortDescription: 'RBAC needs the Teams plan ($38/mo) or above.', source: { url: 'https://www.make.com/en/pricing', label: 'Make Pricing page', - asOf: '2026-07-02', + asOf: '2026-07-08', }, }, ], @@ -135,14 +136,19 @@ export const makeProfile: CompetitorProfile = { value: 'Low for simple linear automations; moderate-to-steep for complex branching/error-handling logic', detail: - 'Marketed as a no-code tool for non-developers building basic scenarios (drag modules, map fields). Complexity rises with routers, iterators/aggregators, error handlers, and AI Agent configuration/reasoning setup, which several reviews describe as requiring more automation experience than simpler tools like Zapier.', + 'Third-party reviews consistently describe Make as having a steeper learning curve than simpler tools like Zapier: new users need time to understand field mapping and branching, while routers, filters, iterators/aggregators, and error handlers give more control for complex, multi-step workflows once learned.', shortValue: 'Easy for basics, steep for advanced logic', confidence: 'estimated', sources: [ { - url: 'https://www.make.com/en/pricing', - label: 'Make Pricing page (Free tier description)', - asOf: '2026-07-02', + url: 'https://learn.g2.com/make-vs-zapier', + label: 'Make vs. Zapier - G2 Learn', + asOf: '2026-07-08', + }, + { + url: 'https://www.lindy.ai/blog/make-review', + label: 'Make Review 2026 - Lindy', + asOf: '2026-07-08', }, ], }, @@ -203,14 +209,14 @@ export const makeProfile: CompetitorProfile = { license: { value: 'Proprietary', detail: - 'Make (owned by Celonis) is closed-source commercial software; there is no open-source license or public source repository.', + 'Make (owned by Celonis) is closed-source commercial software; the Master Services Agreement states Celonis remains the exclusive owner of all right, title, and interest in the Services, and bars customers from copying, modifying, or reverse-engineering the platform, so there is no open-source license or public source repository.', shortValue: 'Closed-source, owned by Celonis', confidence: 'verified', sources: [ { - url: 'https://www.make.com/en/pricing', - label: 'Make Pricing page', - asOf: '2026-07-02', + url: 'https://www.make.com/master-service-agreement.pdf', + label: 'Master Services Agreement for Make, Section 6.1 (Celonis)', + asOf: '2026-07-08', }, ], }, @@ -303,11 +309,6 @@ export const makeProfile: CompetitorProfile = { label: 'Working with files - Make Help Center', asOf: '2026-07-02', }, - { - url: 'https://www.make.com/en/help/apps/file-and-document-management', - label: 'File and document management - Make Help Center', - asOf: '2026-07-02', - }, ], }, dataTables: { @@ -339,9 +340,9 @@ export const makeProfile: CompetitorProfile = { confidence: 'estimated', sources: [ { - url: 'https://www.make.com/en/help/apps/file-and-document-management', - label: 'File and document management - Make Help Center', - asOf: '2026-07-02', + url: 'https://apps.make.com/google-docs', + label: 'Google Docs - Apps Documentation - Make', + asOf: '2026-07-08', }, { url: 'https://www.make.com/en/help/app/markdown', @@ -370,6 +371,31 @@ export const makeProfile: CompetitorProfile = { }, ], }, + customBlocks: { + value: + "No: Make has no feature to publish an existing scenario as an encapsulated, named block that appears in a shared module toolbar for other users across the organization to drop into their own separate scenarios. The closest capabilities are each narrower: 'Call a Scenario' (Subscenarios) can only invoke a scenario already created within the same team, is not exposed as a general block in a module picker, and Make's own docs don't describe it as hiding internal steps or always tracking a source's latest published version. 'Scenarios as AI Agent tools' lets a scenario's defined inputs/outputs be used as a callable tool, but only inside that specific AI Agent's own tool configuration, not as a general-purpose block any builder can add to any regular scenario. The Custom Apps SDK builds brand-new integration connectors that wrap third-party REST APIs; it has no mechanism to package an existing scenario itself as a block.", + detail: + "Per Make's Subscenarios help doc, you can 'only call a scenario created in your team,' scoping reuse to team boundaries rather than an org-wide block toolbar, with no documented internals-hiding or auto-latest-version guarantee. Per the Scenarios-for-AI-agents help doc, scenario-as-tool configuration happens inside AI Agents' own tab/module, not as a block available to all scenario builders. Per the Custom Apps Developer Hub, Custom Apps exist to integrate a third-party application that has no existing Make app, mapping REST endpoints and auth, not to publish an existing scenario as a reusable block.", + shortValue: 'No: no publish-scenario-as-org-wide-block feature', + confidence: 'verified', + sources: [ + { + url: 'https://help.make.com/subscenarios', + label: 'Subscenarios - Make Help Center', + asOf: '2026-07-08', + }, + { + url: 'https://help.make.com/scenarios-for-ai-agents', + label: 'Scenarios for AI agents - Make Help Center', + asOf: '2026-07-08', + }, + { + url: 'https://developers.make.com/custom-apps-documentation', + label: 'Overview | Custom Apps Documentation | Make Developer Hub', + asOf: '2026-07-08', + }, + ], + }, }, aiCapabilities: { multiLlmSupport: { @@ -654,10 +680,11 @@ export const makeProfile: CompetitorProfile = { ], }, customCodeSteps: { - value: "Yes: native 'Make Code' module supporting JavaScript (Node.js) and Python", + value: + "Yes: native 'Make Code' module supporting JavaScript (Node.js) and Python, plus optional third-party packages on Enterprise", detail: - 'The Make Code app lets users write and run arbitrary JS or Python inside a scenario execution with no external servers; standard-library modules are available in Python, but the sandbox has no external network access and cannot install npm/PyPI packages.', - shortValue: 'Native JS/Python step, sandboxed', + 'The Make Code app lets users write and run JS or Python inside a scenario execution with no external servers; common libraries (moment/lodash for JS, pendulum/toolz/requests for Python) are pre-installed, and Enterprise plans can import additional third-party packages as declared dependencies. Direct outbound API calls are technically possible, but Make recommends using the HTTP module instead to avoid exposing credentials.', + shortValue: 'Native JS/Python step; HTTP calls possible, packages on Enterprise', confidence: 'verified', sources: [ { @@ -665,7 +692,7 @@ export const makeProfile: CompetitorProfile = { label: 'Make blog: Make Code App', asOf: '2026-07-02', }, - { url: 'https://apps.make.com/code', label: 'Make Code app docs', asOf: '2026-07-02' }, + { url: 'https://apps.make.com/code', label: 'Make Code app docs', asOf: '2026-07-08' }, ], }, apiPublishing: { @@ -707,9 +734,10 @@ export const makeProfile: CompetitorProfile = { asOf: '2026-07-02', }, { - url: 'https://developers.make.com/custom-apps-documentation/apps-marketplace/about', - label: 'About | Make Developer Hub (Apps Marketplace)', - asOf: '2026-07-02', + url: 'https://developers.make.com/custom-apps-documentation/app-components', + label: + 'App components (base, connections, modules, RPCs, webhooks) | Make Developer Hub', + asOf: '2026-07-08', }, { url: 'https://developers.make.com/api-documentation', @@ -1010,9 +1038,9 @@ export const makeProfile: CompetitorProfile = { asOf: '2026-07-02', }, { - url: 'https://developers.make.com/custom-apps-documentation/apps-marketplace/terms-and-conditions', - label: 'Apps Marketplace terms and conditions - Make Developer Hub', - asOf: '2026-07-02', + url: 'https://developers.make.com/custom-apps-documentation/app-review/prerequisites', + label: 'App review prerequisites - Make Developer Hub', + asOf: '2026-07-08', }, ], }, @@ -1126,26 +1154,27 @@ export const makeProfile: CompetitorProfile = { }, executionLimits: { value: - "Make publishes a hard 40-minute maximum run time per single scenario execution, confirmed in its own MCP Server documentation: a called scenario 'continues running in Make for up to 40 minutes.' Individual module/API calls within a run are also documented by users as timing out around 40 seconds. Make additionally lets admins cap how many instant-trigger scenario runs can start per minute, a configurable rate limit available on all plans. Concurrency across scenarios is plan-gated, though Make does not publish the exact concurrent-run numbers per plan tier in its public help docs.", + "Make's MCP Server enforces a per-call timeout of 25 seconds (OAuth authentication) or 40 seconds (MCP token authentication) before returning a timeout response, after which the called scenario continues running for up to 40 minutes in the background. Make does not publish a general per-module/API-call timeout figure or documented concurrent-execution caps per plan tier; the commonly cited ~40-second module timeout is user-reported, not officially documented. Make lets admins cap how many instant-trigger scenario runs can start per minute, a configurable rate limit available on all plans, though no specific default number is published.", detail: - "The 40-minute figure comes directly from Make's developer docs (MCP server page). The per-minute instant-trigger cap is configurable per the 'Scenario rate limits for instant triggers' help page, but that page does not state the exact default numeric ceiling per plan, and Make does not publicly document precise concurrent-execution-count limits per plan tier.", - shortValue: '40-min run cap; per-minute trigger rate limit', + "Per Make's MCP Server docs, the timeout before a timeout response is returned depends on the authentication method: 25 seconds for OAuth, 40 seconds for an MCP token; the called scenario itself keeps running in the background for up to 40 minutes. help.make.com/scenario-settings, sometimes cited for general module/API-call execution limits, does not document any timeout figure at all. Admins can cap instant-trigger scenario starts per minute via help.make.com/scenario-rate-limits-for-instant-triggers, but that page does not state a specific default numeric ceiling, and Make does not publicly document concurrent-execution-count limits per plan tier.", + shortValue: + '25s/40s MCP call timeout; 40-min background run; no published module-timeout figure', confidence: 'verified', sources: [ { url: 'https://developers.make.com/mcp-server', - label: 'Make MCP Server docs: 40-minute execution limit', - asOf: '2026-07-02', + label: 'Make MCP Server docs: 25s/40s call timeout, 40-minute background run', + asOf: '2026-07-08', }, { url: 'https://help.make.com/scenario-rate-limits-for-instant-triggers', label: 'Make Help Center: Scenario rate limits for instant triggers', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://help.make.com/scenario-settings', - label: 'Make Help Center: Scenario settings (cycles per run, other execution controls)', - asOf: '2026-07-02', + label: 'Make Help Center: Scenario settings (no documented timeout figure)', + asOf: '2026-07-08', }, ], }, diff --git a/apps/sim/lib/compare/data/competitors/microsoft-copilot.ts b/apps/sim/lib/compare/data/competitors/microsoft-copilot.ts index 06d02a37abe..e3601495b91 100644 --- a/apps/sim/lib/compare/data/competitors/microsoft-copilot.ts +++ b/apps/sim/lib/compare/data/competitors/microsoft-copilot.ts @@ -56,13 +56,13 @@ export const microsoftCopilotProfile: CompetitorProfile = { { title: 'Deep, per-session orchestration traces', description: - 'Conversation transcripts capture which topic fired, which knowledge sources were consulted, which tools and child agents or MCP servers were invoked, the orchestration plan, and how long each step took. They are viewable per-session in the Analytics area for the last 28 days and extendable via export to Azure Data Lake Storage.', + "Session tracking in the Monitor tab (part of Copilot Studio's new agent experience, currently in preview) lists each conversation session's status, duration, message count, and which tools were used, and selecting a session opens its full transcript with tool-invocation and knowledge-source usage detail.", shortDescription: - 'Per-session traces cover topics, tools, knowledge, sub-agents, and timing.', + 'Per-session transcripts in the Monitor tab cover status, tools, and knowledge used.', source: { url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/agents-experience/analytics-overview', label: 'Monitor an agent overview (preview) - Microsoft Copilot Studio | Microsoft Learn', - asOf: '2026-07-02', + asOf: '2026-07-08', }, }, ], @@ -94,16 +94,16 @@ export const microsoftCopilotProfile: CompetitorProfile = { }, }, { - title: 'Session transcript detail defaults to a 28-day window', + title: 'Session transcript detail defaults to a 29-day window', description: - "An agent's per-session transcripts, showing which topic fired, tools called, and knowledge consulted, are available in the Analytics area for the last 28 days by default. Retaining that detail longer requires a separate export pipeline (Azure Synapse Link for Dataverse into Azure Data Lake Storage Gen2), not a built-in retention setting.", + "An agent's per-session transcripts, showing which topic fired, tools called, and knowledge consulted, are downloadable from the Analytics area for roughly the last 29 days by default. Retaining that detail longer requires a separate export pipeline, not a built-in retention setting.", shortDescription: - 'Detailed session transcripts default to 28 days; longer retention needs a manual export.', + 'Detailed session transcripts default to ~29 days; longer retention needs a manual export.', source: { url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/analytics-transcripts-studio', label: 'Understand downloaded session data from Copilot Studio - Microsoft Copilot Studio | Microsoft Learn', - asOf: '2026-07-02', + asOf: '2026-07-08', }, }, { @@ -220,7 +220,7 @@ export const microsoftCopilotProfile: CompetitorProfile = { }, templates: { value: - 'Yes: an Agent Library of ready-to-use, pre-built agent templates (e.g. Employee Self-Service, Prompt Coach, IT Helpdesk, Financial Insights) with preconfigured instructions, actions, topics, and starter knowledge, deployable into an environment and then customized', + 'Yes: an Agent Library of ready-to-use, pre-built agent templates (e.g. My Company Policy, Request Tracker, Know Your Customer, Plan My Day, Executive Brief) with preconfigured instructions, actions, topics, and starter knowledge, deployable into an environment and then customized', detail: 'Templates are distributed as a visual, guided-deployment catalog on Microsoft Marketplace and as raw solution files on GitHub.', shortValue: 'Yes, Agent Library of pre-built, customizable templates', @@ -230,13 +230,13 @@ export const microsoftCopilotProfile: CompetitorProfile = { url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance/agent-library-overview', label: 'Configure and deploy agents from the Agent Library - Microsoft Copilot Studio | Microsoft Learn', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/template-fundamentals', label: 'Create a custom agent from a template - Microsoft Copilot Studio | Microsoft Learn', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -324,16 +324,22 @@ export const microsoftCopilotProfile: CompetitorProfile = { }, dataTables: { value: - 'No: Copilot Studio does not offer a lightweight, spreadsheet-like data table with arrow-key navigation and copy-paste. Its native structured-data store is Microsoft Dataverse, a full relational database with tables, relationships, and business rules, used both as an agent knowledge source and for storing conversation transcripts and custom analytics.', + 'No: Copilot Studio does not offer a lightweight, spreadsheet-like data table with arrow-key navigation and copy-paste. Its native structured-data store is Microsoft Dataverse, a full relational database with tables, relationships, and business rules, used both as an agent knowledge source and, via dedicated bot/botcomponent/conversationtranscript tables, for storing conversation transcripts and custom analytics.', detail: - 'Dataverse is the same underlying data platform Power Automate uses. It serves as the agent data platform for grounding, but it is a relational database product, not a simple spreadsheet-grid UI.', + "Dataverse is the same underlying data platform Power Automate uses, offering rich metadata/relationships plus business rules and workflows for data validation, not a simple spreadsheet-grid UI. Copilot Studio's custom-analytics guidance documents the ConversationTranscript, Copilot (bot), and Copilot component (botcomponent) tables it writes usage data into.", shortValue: 'Dataverse tables are a full DB, not a spreadsheet grid', - confidence: 'estimated', + confidence: 'verified', sources: [ { - url: 'https://www.microsoft.com/en-us/power-platform/blog/2026/05/05/dataverse-agent-data-platform/', - label: 'Dataverse Is Your Agent Data Platform - Microsoft Power Platform Blog', - asOf: '2026-07-02', + url: 'https://learn.microsoft.com/en-us/power-apps/maker/data-platform/data-platform-intro', + label: 'What is Microsoft Dataverse? - Power Apps | Microsoft Learn', + asOf: '2026-07-08', + }, + { + url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance/custom-analytics-strategy', + label: + 'Develop a custom analytics strategy - Microsoft Copilot Studio | Microsoft Learn', + asOf: '2026-07-08', }, ], }, @@ -363,15 +369,37 @@ export const microsoftCopilotProfile: CompetitorProfile = { confidence: 'estimated', sources: [ { - url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/flow-designer', + url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/flows-overview', + label: 'Agent flows overview - Microsoft Copilot Studio | Microsoft Learn', + asOf: '2026-07-08', + }, + ], + }, + customBlocks: { + value: + "Partial: a published agent flow (with a 'When an agent calls the flow' trigger and a 'Respond to the agent' action) can be added by another maker as a tool, and a published Copilot Studio agent can be added by another maker as a connected-agent tool that always resolves to the source's latest published version — but discovery for both is a per-item share-and-pick model within one environment, not an admin-governed entry that automatically appears in a block toolbar for the whole org, and there is no publisher step to hand-pick and rename a curated subset of outputs the way Sim's Custom Blocks do.", + detail: + "Adding a flow as an agent-level tool lists qualifying, published flows in the 'Add tool > Flow' picker; Microsoft's docs don't specify how the tool's inputs are derived from the flow's trigger or confirm it always tracks the flow's latest published version. Connected agents are the better-documented half: a maker can turn on 'Let other agents connect to and use this one' on a published agent so any maker who owns it or has it shared with them can add it as a connected-agent tool in their own, separate agent, always using the latest published version after republish. Neither mechanism auto-populates a single, organization-wide block palette; each is discovered per-item through sharing/run permissions, and there's no dedicated step for the publisher to select and rename specific outputs to expose, unlike Sim's Custom Blocks.", + shortValue: + 'Partial: published flows/agents become tools, but via per-item sharing, not an org-wide toolbar', + confidence: 'estimated', + sources: [ + { + url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/flow-agent', label: - 'Edit and manage your agent flow in the designer - Microsoft Copilot Studio | Microsoft Learn', - asOf: '2026-07-02', + 'Add an agent flow as a tool to an agent - Microsoft Copilot Studio | Microsoft Learn', + asOf: '2026-07-08', }, { - url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/advanced-use-flow', - label: 'Call an agent flow from an agent - Microsoft Copilot Studio | Microsoft Learn', - asOf: '2026-07-02', + url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/add-agent-copilot-studio-agent', + label: + 'Connect to an existing Copilot Studio agent - Microsoft Copilot Studio | Microsoft Learn', + asOf: '2026-07-08', + }, + { + url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/authoring-add-other-agents', + label: 'Add other agents overview - Microsoft Copilot Studio | Microsoft Learn', + asOf: '2026-07-08', }, ], }, @@ -400,7 +428,7 @@ export const microsoftCopilotProfile: CompetitorProfile = { }, agentReasoningBlocks: { value: - "Yes: generative orchestration is an LLM-driven planning layer that selects among an agent's topics, tools, knowledge sources, and child agents at runtime, and an optional deep reasoning model (GPT-5.5 Reasoning) can be enabled for tasks requiring step-by-step logical analysis, distinct from a fixed decision-tree topic flow", + "Yes: generative orchestration is an LLM-driven planning layer that selects among an agent's topics, tools, knowledge sources, and child agents at runtime, and an optional deep reasoning model (the Azure OpenAI o3 model) can be enabled for tasks requiring step-by-step logical analysis, distinct from a fixed decision-tree topic flow", detail: 'Deep reasoning is regionally limited to the United States and the EU (excluding the UK) and trades response speed for accuracy on complex tasks. The agent decides when to apply it, or a maker can force it via a "reason" keyword in instructions.', shortValue: 'Generative orchestration planning plus an optional deep reasoning model', @@ -416,7 +444,7 @@ export const microsoftCopilotProfile: CompetitorProfile = { url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/authoring-reasoning-models', label: 'Add a deep reasoning model for complex tasks (preview) - Microsoft Copilot Studio | Microsoft Learn', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -606,18 +634,21 @@ export const microsoftCopilotProfile: CompetitorProfile = { }, kbChunkVisibility: { value: - "Partial: Copilot Studio's test/preview panel shows a trace of which knowledge sources an agent consulted for an answer, with footnote-style citations tied to specific chunk metadata (e.g. document and page), and a maker can navigate from a citation to the source component to edit it, but there is no dedicated raw chunk-content inspector distinct from citation footnotes.", + "Partial: generative answers return citation links back to the knowledge source consulted for an answer, rendered automatically in the chat surface (Copilot Studio's own chat and Microsoft Teams, unless the response is customized), letting a user trace an answer to its source, but there is no documented chunk-level metadata (such as document/page numbers) or a dedicated raw chunk-content inspector distinct from the citation link itself.", detail: - 'Some knowledge formats, such as local JSON, lack citation metadata entirely, so chunk-level detail is not uniformly available across every knowledge-source type.', - shortValue: - 'Test panel shows citations/trace with chunk metadata, not a full chunk inspector', + "Citations returned from a knowledge source currently can't be used as inputs to other tools or actions, per Copilot Studio's own knowledge-sources documentation, and citation rendering must be explicitly re-added when a generative answer is customized before being sent to Teams.", + shortValue: 'Citation links trace an answer to its source; no chunk-inspector documented', confidence: 'estimated', sources: [ { - url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/knowledge-test', - label: - "Test your agent's knowledge sources - Microsoft Copilot Studio | Microsoft Learn", - asOf: '2026-07-02', + url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/knowledge-copilot-studio', + label: 'Knowledge sources summary - Microsoft Copilot Studio | Microsoft Learn', + asOf: '2026-07-08', + }, + { + url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/nlu-boost-node', + label: 'Add a generative answers node - Microsoft Copilot Studio | Microsoft Learn', + asOf: '2026-07-08', }, ], }, @@ -688,32 +719,34 @@ export const microsoftCopilotProfile: CompetitorProfile = { }, integrations: { integrationCount: { - value: '1,000+ pre-built connectors', + value: 'Many pre-built connectors from the shared Power Platform connector catalog', detail: - 'Copilot Studio shares the same underlying Power Platform connector catalog that Power Automate and Power Apps use, split into standard connectors (included with all plans) and premium connectors (available on select plans), plus custom connectors for any other API.', - shortValue: '1,000+ connectors from the shared Power Platform catalog', + 'Copilot Studio shares the same underlying Power Platform connector catalog that Power Automate and Power Apps use, split into standard connectors (included with all plans) and premium connectors (available on select plans), plus custom connectors for any other API. Microsoft does not publish a single current total connector count on this catalog documentation.', + shortValue: + 'Many connectors from the shared Power Platform catalog, standard/premium/custom', confidence: 'estimated', sources: [ { url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/advanced-connectors', label: 'Use connectors in Copilot Studio agents - Microsoft Copilot Studio | Microsoft Learn', - asOf: '2026-07-04', + asOf: '2026-07-08', }, ], }, triggerTypes: { value: - 'Conversational trigger phrases (topics), autonomous event-based triggers that wait for a specific event to fire the agent without a user prompting it, connector-event triggers, and schedule-based triggers for agent flows', + 'Conversational trigger phrases (topics) that fire only when a user types a matching phrase, plus event triggers that let an agent act autonomously without user input in response to a connector-sourced event, such as a new SharePoint item, an added OneDrive file, a completed Planner task, or a changed Dataverse row, including a built-in, schedule-based Recurrence trigger', detail: - 'Autonomous triggers let an agent proactively respond to events, such as a new record or an incoming email, rather than only reacting to a live conversation.', - shortValue: 'Trigger phrases, autonomous event triggers, connector events, schedules', - confidence: 'estimated', + "Event triggers require generative orchestration and deliver a JSON or plain-text payload describing the event to the agent, whose instructions then choose which action or topic to call in response. The Recurrence trigger is Copilot Studio's schedule-based event-trigger type, firing after a configured amount of time passes.", + shortValue: + 'Topic trigger phrases, plus connector-sourced and schedule-based event triggers', + confidence: 'verified', sources: [ { - url: 'https://adoption.microsoft.com/files/copilot-studio/Autonomous-agents-with-Microsoft-Copilot-Studio.pdf', - label: 'Autonomous Agents with Microsoft Copilot Studio', - asOf: '2026-07-02', + url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/authoring-triggers-about', + label: 'Event triggers overview - Microsoft Copilot Studio | Microsoft Learn', + asOf: '2026-07-08', }, ], }, @@ -951,9 +984,10 @@ export const microsoftCopilotProfile: CompetitorProfile = { asOf: '2026-07-02', }, { - url: 'https://learn.microsoft.com/en-us/power-platform/admin/wp-data-loss-prevention', - label: 'Data policies - Power Platform | Microsoft Learn', - asOf: '2026-07-02', + url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/admin-data-loss-prevention', + label: + 'Configure data policies for agents - Microsoft Copilot Studio | Microsoft Learn', + asOf: '2026-07-08', }, ], }, @@ -990,17 +1024,24 @@ export const microsoftCopilotProfile: CompetitorProfile = { }, dataRetention: { value: - 'Partial: session/transcript detail in the Analytics area defaults to a 28-day window (conversation transcripts downloadable for 29 days), extendable only via a separate export pipeline (Azure Synapse Link for Dataverse into Azure Data Lake Storage Gen2) rather than a built-in, admin-configurable retention setting for that transcript detail', + 'Partial: conversation transcripts downloaded directly from Copilot Studio only cover the past 29 days, while the underlying Dataverse conversation-transcript and custom-analytics tables default to a 30-day retention period; extending retention beyond that default requires either an admin changing the Dataverse retention setting or exporting the data via Azure Synapse Link for Dataverse into Azure Data Lake Storage Gen2', detail: - "This differs from Power Automate's flow-run-history retention, which is directly admin-configurable in the Power Platform admin center (28/14/7 days or a custom Dataverse field edit). Copilot Studio's session-transcript detail requires the export workaround instead.", - shortValue: '28-day default transcript window; longer retention needs a manual export', - confidence: 'estimated', + "Copilot Studio's own download experience is capped at the past 29 days regardless of the underlying Dataverse retention window. Microsoft's custom-analytics guidance documents the 30-day default retention on the Dataverse-side bot/botcomponent/conversationtranscript tables and recommends Synapse Link as the export path for longer-term or custom-reporting needs.", + shortValue: + '29-day direct download; 30-day default Dataverse retention, extendable via export', + confidence: 'verified', sources: [ { url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/analytics-transcripts-studio', label: 'Understand downloaded session data from Copilot Studio - Microsoft Copilot Studio | Microsoft Learn', - asOf: '2026-07-02', + asOf: '2026-07-08', + }, + { + url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance/custom-analytics-strategy', + label: + 'Develop a custom analytics strategy - Microsoft Copilot Studio | Microsoft Learn', + asOf: '2026-07-08', }, ], }, @@ -1013,10 +1054,10 @@ export const microsoftCopilotProfile: CompetitorProfile = { confidence: 'verified', sources: [ { - url: 'https://learn.microsoft.com/en-us/purview/ai-copilot-studio', + url: 'https://learn.microsoft.com/en-us/purview/dlp-microsoft365-copilot-location-learn-about', label: - 'Use Microsoft Purview to manage data security & compliance for Microsoft Copilot Studio | Microsoft Learn', - asOf: '2026-07-02', + 'Microsoft Purview DLP for Microsoft 365 Copilot and Copilot Chat | Microsoft Learn', + asOf: '2026-07-08', }, ], }, @@ -1183,21 +1224,21 @@ export const microsoftCopilotProfile: CompetitorProfile = { }, unattendedExecution: { value: - "Yes: autonomous event-triggered agent runs and agent flows execute on Microsoft-operated cloud infrastructure (the same Commercial/GCC/GCC High/DoD environments Copilot Studio's authoring and runtime services run in), not on a maker's own device or browser session", + "Yes in Commercial environments: autonomous event-triggered agent runs and agent flows execute on Microsoft-operated cloud infrastructure, not on a maker's own device or browser session. Per Microsoft's own GCC/GCC High licensing documentation, Triggers/Autonomous Agents are currently NOT available in GCC or GCC High government cloud environments.", detail: - "Autonomous triggers let an agent proactively respond to a connector event or schedule without a live conversation open, and agent flows run on the Power Automate flow engine's server-side runtime. Closing the authoring browser tab or shutting down a laptop has no effect on a published agent's ability to fire on a trigger or complete a run.", - shortValue: 'Yes, runs server-side on Microsoft-operated infrastructure', + "Autonomous triggers let an agent proactively respond to a connector event or schedule without a live conversation open, and agent flows run on the Power Automate flow engine's server-side runtime in Commercial environments. Closing the authoring browser tab or shutting down a laptop has no effect on a published agent's ability to fire on a trigger or complete a run, but Microsoft's GCC/GCC High feature-availability table lists Triggers/Autonomous Agents as unavailable in those government-cloud environments.", + shortValue: 'Yes in Commercial cloud; not available in GCC/GCC High per Microsoft docs', confidence: 'estimated', sources: [ { url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/requirements-licensing-gcc', label: 'US Government customers - Microsoft Copilot Studio | Microsoft Learn', - asOf: '2026-07-04', + asOf: '2026-07-08', }, { url: 'https://adoption.microsoft.com/files/copilot-studio/Autonomous-agents-with-Microsoft-Copilot-Studio.pdf', label: 'Autonomous Agents with Microsoft Copilot Studio', - asOf: '2026-07-04', + asOf: '2026-07-08', }, ], }, diff --git a/apps/sim/lib/compare/data/competitors/n8n.ts b/apps/sim/lib/compare/data/competitors/n8n.ts index 65779ed55da..18322c09408 100644 --- a/apps/sim/lib/compare/data/competitors/n8n.ts +++ b/apps/sim/lib/compare/data/competitors/n8n.ts @@ -52,12 +52,12 @@ export const n8nProfile: CompetitorProfile = { { title: 'Built-in Evaluations for AI workflows', description: - "A dedicated Evaluations feature runs a workflow against a test dataset with expected outputs. 'Light evaluations' are for dev-time spot checks, while 'Metric-based evaluations' score at production scale using built-in metrics (AI-judged helpfulness, string similarity, categorization, tools used) plus custom metrics.", + "A dedicated Evaluations feature runs a workflow against a test dataset with expected outputs. 'Light evaluations' are for dev-time spot checks, while 'Metric-based evaluations' score at production scale using built-in metrics (AI-judged Correctness and Helpfulness, String Similarity, Categorization, and Tools Used) plus custom metrics.", shortDescription: 'Native test-dataset evaluations for dev checks and production monitoring.', source: { - url: 'https://docs.n8n.io/advanced-ai/evaluations/overview/', - label: 'n8n Evaluations docs', - asOf: '2026-07-02', + url: 'https://docs.n8n.io/build/integrate-ai/test-and-improve-ai-workflows/use-metrics-to-measure-quality.md', + label: 'n8n docs: Use metrics to measure quality', + asOf: '2026-07-08', }, }, { @@ -127,19 +127,19 @@ export const n8nProfile: CompetitorProfile = { builderType: { value: 'Hybrid visual/code node-based builder', detail: - "n8n's core interface is a visual, drag-and-drop node canvas where each node is a step. It supports a Custom Code node (JavaScript/Python) and an HTTP Request Tool for arbitrary API calls, plus a beta natural-language AI Workflow Builder that generates an editable draft workflow from a text prompt.", + "n8n's core interface is a visual, drag-and-drop node canvas where each node is a step. It supports a Custom Code node (JavaScript/Python) and an HTTP Request Tool for arbitrary API calls, plus a natural-language AI Workflow Builder, gated by pricing tier rather than a beta flag, that generates an editable draft workflow from a text prompt.", shortValue: 'Visual canvas plus code node and AI builder', confidence: 'verified', sources: [ { - url: 'https://docs.n8n.io/advanced-ai/ai-workflow-builder/', + url: 'https://docs.n8n.io/build/ways-of-building-workflows/ai-workflow-builder', label: 'n8n AI Workflow Builder docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { - url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/tools-agent', - label: 'n8n Tools Agent docs', - asOf: '2026-07-02', + url: 'https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.code', + label: 'n8n Code node docs', + asOf: '2026-07-08', }, ], }, @@ -221,20 +221,15 @@ export const n8nProfile: CompetitorProfile = { shortValue: 'Git-backed whole-project promotion (Enterprise)', confidence: 'verified', sources: [ - { - url: 'https://docs.n8n.io/source-control-environments/understand/environments/', - label: 'Environments in n8n | n8n Docs', - asOf: '2026-07-02', - }, { url: 'https://docs.n8n.io/administer/use-source-control-and-environments/push-and-pull-changes', label: 'Push and pull changes | Administer | n8n Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { - url: 'https://docs.n8n.io/source-control-environments/using/push-pull/', - label: 'Push and pull | n8n Docs', - asOf: '2026-07-02', + url: 'https://docs.n8n.io/deploy/host-n8n/community-edition-features.md', + label: 'Community edition features | n8n Docs', + asOf: '2026-07-08', }, ], }, @@ -267,14 +262,14 @@ export const n8nProfile: CompetitorProfile = { confidence: 'verified', sources: [ { - url: 'https://docs.n8n.io/source-control-environments/', - label: 'Source control and environments | n8n Docs', - asOf: '2026-07-02', + url: 'https://docs.n8n.io/deploy/host-n8n/community-edition-features.md', + label: 'Community edition features | n8n Docs', + asOf: '2026-07-08', }, { - url: 'https://docs.n8n.io/hosting/community-edition-features/', - label: 'Community edition features | n8n Docs', - asOf: '2026-07-02', + url: 'https://docs.n8n.io/administer/use-source-control-and-environments', + label: 'Use source control and environments | Administer | n8n Docs', + asOf: '2026-07-08', }, ], }, @@ -327,9 +322,9 @@ export const n8nProfile: CompetitorProfile = { confidence: 'verified', sources: [ { - url: 'https://docs.n8n.io/workflows/components/sticky-notes/', + url: 'https://docs.n8n.io/build/understand-workflows/workflow-components/add-notes-and-documentation.md', label: 'Sticky Notes | n8n Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://www.createwith.com/tool/n8n/updates/n8n-adds-markdown-support-to-workflow-sticky-notes-for-embedded-images-and-video', @@ -353,6 +348,27 @@ export const n8nProfile: CompetitorProfile = { }, ], }, + customBlocks: { + value: + 'No: n8n has no feature to publish a deployed workflow as a named, encapsulated block that appears in the node panel for other users to drag into their own separate workflows. The closest built-in mechanism is the Execute Sub-workflow node, which calls another saved workflow (by database lookup, local file, parameter, or URL) from inside a workflow, but it is a generic caller node, not a distinct, iconed, named block per source workflow.', + detail: + "An n8n community feature request, 'Mark workflow as a custom node to be re-used in other workflows' (opened August 2024), asks for exactly this: turning a workflow into a reusable node listed under its own category in the node panel, with defined input parameters, so other builders can add it without touching the source workflow's internals. n8n has not shipped it; the documented mechanism remains the generic Execute Sub-workflow node. n8n's actual node-level encapsulation mechanism, custom/community nodes, requires writing and packaging real TypeScript code as an npm module, not publishing a no-code workflow someone built visually.", + shortValue: 'No, only generic Execute Sub-workflow calls, not a published block', + confidence: 'verified', + sources: [ + { + url: 'https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.executeworkflow/', + label: 'Execute Sub-workflow | Nodes | n8n Docs', + asOf: '2026-07-08', + }, + { + url: 'https://community.n8n.io/t/mark-workflow-as-a-custom-node-to-be-re-used-in-other-workflows/51808', + label: + 'Mark workflow as a custom node to be re-used in other workflows (n8n Community feature request)', + asOf: '2026-07-08', + }, + ], + }, }, aiCapabilities: { multiLlmSupport: { @@ -391,24 +407,25 @@ export const n8nProfile: CompetitorProfile = { label: 'n8n Tools Agent docs', asOf: '2026-07-02', }, - { - url: 'https://docs.n8n.io/advanced-ai/examples/understand-agents/', - label: "n8n docs: What's an agent in AI?", - asOf: '2026-07-02', - }, ], }, naturalLanguageBuilding: { - value: 'Yes: beta AI Workflow Builder, Cloud only currently', + value: + 'Yes: AI Workflow Builder, generally available on Starter, Pro, and Enterprise Cloud', detail: - 'Users describe a workflow in plain text and the beta AI Workflow Builder generates a draft, editable node-based workflow with iterative multi-turn refinement. Available in beta on Cloud (Trial, Starter, Pro plans), with Enterprise and self-hosted support planned for later.', - shortValue: 'Beta builder, Cloud plans only', + 'Users describe a workflow in plain text and the AI Workflow Builder generates a draft, editable node-based workflow with iterative multi-turn refinement. Launched in beta in late 2025, it reached general availability for n8n Cloud customers on the Starter, Pro, and Enterprise plans; self-hosted availability is not documented.', + shortValue: 'GA on Starter/Pro/Enterprise Cloud plans', confidence: 'verified', sources: [ { - url: 'https://docs.n8n.io/advanced-ai/ai-workflow-builder/', + url: 'https://blog.n8n.io/ai-workflow-builder-best-practices/', + label: 'n8n Blog: AI Workflow Builder Best Practices', + asOf: '2026-07-08', + }, + { + url: 'https://docs.n8n.io/build/ways-of-building-workflows/ai-workflow-builder', label: 'n8n AI Workflow Builder docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -555,9 +572,9 @@ export const n8nProfile: CompetitorProfile = { asOf: '2026-07-02', }, { - url: 'https://docs.n8n.io/advanced-ai/chat-hub/', + url: 'https://docs.n8n.io/build/ways-of-building-workflows/chat-hub', label: 'Chat Hub | n8n Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -591,9 +608,9 @@ export const n8nProfile: CompetitorProfile = { confidence: 'estimated', sources: [ { - url: 'https://docs.n8n.io/flow-logic/execution-order/', + url: 'https://docs.n8n.io/build/flow-logic/understand-execution-order', label: 'Execution order in multi-branch workflows | n8n Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://docs.n8n.io/build/flow-logic/merge-data', @@ -640,16 +657,16 @@ export const n8nProfile: CompetitorProfile = { }, integrations: { integrationCount: { - value: '1,921 integrations (per n8n.io/integrations)', + value: '1,936 integrations (per n8n.io/integrations)', detail: - "The n8n.io integrations directory page lists 1,921 integrations. n8n's GitHub repo description separately advertises a rounder '400+ integrations,' so the two vendor sources disagree slightly.", - shortValue: '1,921 listed integrations', + "The n8n.io integrations directory page lists 1,936 integrations. n8n's GitHub repo description separately advertises a rounder '400+ integrations,' so the two vendor sources disagree slightly.", + shortValue: '1,936 listed integrations', confidence: 'verified', sources: [ { url: 'https://n8n.io/integrations/', label: 'n8n.io Integrations directory', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -667,9 +684,9 @@ export const n8nProfile: CompetitorProfile = { asOf: '2026-07-02', }, { - url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolmcp/', - label: 'MCP Client/Server Trigger docs', - asOf: '2026-07-02', + url: 'https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-langchain.mcptrigger', + label: 'MCP Server Trigger docs', + asOf: '2026-07-08', }, ], }, @@ -681,9 +698,14 @@ export const n8nProfile: CompetitorProfile = { confidence: 'estimated', sources: [ { - url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/tools-agent', - label: 'n8n Tools Agent docs (mentions Custom Code Tool)', - asOf: '2026-07-02', + url: 'https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.code', + label: 'Code node docs', + asOf: '2026-07-08', + }, + { + url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolcode/', + label: 'Code Tool docs (AI agent custom code tool)', + asOf: '2026-07-08', }, ], }, @@ -696,9 +718,14 @@ export const n8nProfile: CompetitorProfile = { confidence: 'estimated', sources: [ { - url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolmcp/', - label: 'MCP Server/Client Tool docs', - asOf: '2026-07-02', + url: 'https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.webhook/', + label: 'Webhook trigger docs', + asOf: '2026-07-08', + }, + { + url: 'https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-langchain.mcptrigger', + label: 'MCP Server Trigger docs', + asOf: '2026-07-08', }, ], }, @@ -711,9 +738,9 @@ export const n8nProfile: CompetitorProfile = { confidence: 'verified', sources: [ { - url: 'https://docs.n8n.io/api/', - label: 'n8n public REST API Documentation | n8n Docs', - asOf: '2026-07-02', + url: 'https://docs.n8n.io/connect/n8n-api', + label: 'n8n API | Connect | n8n Docs', + asOf: '2026-07-08', }, { url: 'https://www.npmjs.com/package/@n8n/rest-api-client', @@ -721,9 +748,9 @@ export const n8nProfile: CompetitorProfile = { asOf: '2026-07-02', }, { - url: 'https://docs.n8n.io/integrations/creating-nodes/build/reference/code-standards/', - label: 'Code standards | n8n Docs', - asOf: '2026-07-02', + url: 'https://docs.n8n.io/connect/create-nodes/build-your-node/using-the-n8n-node-tool', + label: 'Using the n8n-node tool | Connect | n8n Docs', + asOf: '2026-07-08', }, ], }, @@ -741,9 +768,9 @@ export const n8nProfile: CompetitorProfile = { asOf: '2026-07-02', }, { - url: 'https://docs.n8n.io/advanced-ai/mcp/accessing-n8n-mcp-server/', - label: 'Set up and use n8n MCP server | n8n Docs', - asOf: '2026-07-02', + url: 'https://docs.n8n.io/connect/connect-to-n8n-mcp-server', + label: 'Connect to n8n MCP server | n8n Docs', + asOf: '2026-07-08', }, ], }, @@ -760,10 +787,10 @@ export const n8nProfile: CompetitorProfile = { entryPaidPlan: { value: 'Starter plan: €20/month (billed annually), 2,500 executions/month, cloud-hosted', detail: - 'Starter includes 2,500 workflow executions per month, 5 concurrent executions, 1 shared project, unlimited users, 50 AI credits, and forum support.', + 'Starter includes 2,500 workflow executions per month, 5 concurrent executions, 1 shared project, unlimited users, 2,300 AI credits, and forum support.', shortValue: '€20/month, 2,500 executions', confidence: 'verified', - sources: [{ url: 'https://n8n.io/pricing/', label: 'n8n Pricing', asOf: '2026-07-02' }], + sources: [{ url: 'https://n8n.io/pricing/', label: 'n8n Pricing', asOf: '2026-07-08' }], }, freeTier: { value: 'Yes: free self-hosted Community Edition, plus a free cloud trial (no credit card)', @@ -782,12 +809,23 @@ export const n8nProfile: CompetitorProfile = { }, byok: { value: - 'De facto yes: all Chat Model nodes require users\' own provider API credentials, though n8n does not name this "BYOK"', + 'De facto yes: Chat Model nodes require users\' own provider API credentials, though n8n does not name this "BYOK"', detail: - "n8n's pricing page describes plan-included 'AI credits' (50/150/1,000 depending on tier) for its own hosted AI features, but doesn't name a bring-your-own-API-key policy. Since all Chat Model nodes require users to supply their own provider API credentials to call OpenAI, Anthropic, and others directly, BYOK is the de facto default for workflow-level LLM calls.", + "n8n's OpenAI and Anthropic credential docs both walk users through generating an API key in the provider's own console and entering it as the node credential; no n8n-hosted key is supplied for these Chat Model nodes. Separately, n8n's pricing page describes plan-included 'AI credits' (2,300 on Starter, up to 13,700+ on higher tiers) for n8n's own in-app AI Assistant feature, which is distinct from the provider credentials Chat Model nodes require. n8n does not name a bring-your-own-API-key policy, but requiring each provider's own key for Chat Model nodes makes BYOK the de facto default for workflow-level LLM calls.", shortValue: 'De facto via provider API keys, not named', confidence: 'estimated', - sources: [{ url: 'https://n8n.io/pricing/', label: 'n8n Pricing', asOf: '2026-07-02' }], + sources: [ + { + url: 'https://docs.n8n.io/integrations/builtin/credentials/openai', + label: 'n8n docs: OpenAI credentials', + asOf: '2026-07-08', + }, + { + url: 'https://docs.n8n.io/integrations/builtin/credentials/anthropic', + label: 'n8n docs: Anthropic credentials', + asOf: '2026-07-08', + }, + ], }, }, security: { @@ -858,22 +896,22 @@ export const n8nProfile: CompetitorProfile = { }, additionalCompliance: { value: - 'GDPR (as data processor) and a publicly downloadable SOC 3 report; SOC 2 report available on request, not a certified SOC 2 Type II; no HIPAA, ISO 27001, PCI, or FedRAMP certification found', + 'GDPR (as data processor), SOC 2 Type II certification, and a publicly downloadable SOC 3 report; no HIPAA, ISO 27001, PCI, or FedRAMP certification found', detail: - "n8n's Trust Center (SafeBase-hosted) and legal/security page list GDPR compliance (as a data processor with a standard DPA), CAIQ self-assessment questionnaires for both cloud and self-hosted deployments, and a SOC 3 report that is publicly downloadable from the Security page. Its security program is aligned to the SOC 2 framework with annual independent audits, but n8n does not claim a certified SOC 2 Type II attestation, and the SOC 2 report itself is provided to enterprise customers on request rather than published. n8n holds no ISO 27001, HIPAA BAA, PCI-DSS, or FedRAMP certification. Third-party blog posts describe self-hosted n8n as helping organizations map to HIPAA/ISO 27001 requirements, but that is not the same as holding those certifications.", - shortValue: 'GDPR, public SOC 3, SOC 2 aligned (report on request)', + "n8n's Trust Center (SafeBase-hosted) and legal/security page list GDPR compliance (as a data processor with a standard DPA), CAIQ self-assessment questionnaires for both cloud and self-hosted deployments, and a SOC 3 report that is publicly downloadable from the Security page. n8n now holds SOC 2 Type II certification, viewable via the Trust Center, in addition to the public SOC 3 report. n8n holds no ISO 27001, HIPAA BAA, PCI-DSS, or FedRAMP certification. Third-party blog posts describe self-hosted n8n as helping organizations map to HIPAA/ISO 27001 requirements, but that is not the same as holding those certifications.", + shortValue: 'GDPR, SOC 2 Type II certified, public SOC 3 report', confidence: 'verified', sources: [ { url: 'https://trust.n8n.io/', label: 'n8n Trust Center | Powered by SafeBase', - asOf: '2026-07-04', + asOf: '2026-07-08', }, - { url: 'https://n8n.io/legal/security/', label: 'Security | n8n', asOf: '2026-07-04' }, + { url: 'https://n8n.io/legal/security/', label: 'Security | n8n', asOf: '2026-07-08' }, { url: 'https://support.n8n.io/article/request-for-soc-2-report', label: 'Request for SOC-2 report | n8n Help Center', - asOf: '2026-07-04', + asOf: '2026-07-08', }, ], }, @@ -886,21 +924,21 @@ export const n8nProfile: CompetitorProfile = { }, credentialGovernance: { value: - "Yes: n8n's RBAC model is scope-based, with custom project roles (Enterprise feature) letting admins grant or restrict access to specific credentials, workflows, and folders at a granular, per-resource level, beyond the built-in Admin/Editor/Viewer roles.", + "Yes: n8n's RBAC model is project-based, with built-in Admin/Editor/Viewer project roles, and custom project roles (Enterprise feature) let admins scope access across resource types, including credentials, workflows, folders, data tables, variables, and source control, beyond the default three roles.", detail: - 'Custom Project Roles (Enterprise) let admins build least-privilege roles scoped to particular credentials/resources, not just feature-level RBAC.', - shortValue: 'Yes, custom roles gate specific credentials', + "n8n's docs describe access control as project-based rather than scope-based: users get one of three built-in project roles (Admin, Editor, Viewer). Custom Project Roles (Enterprise) let admins build least-privilege roles whose permission surface spans Projects, Folders, Workflows, Credentials, Data tables, Variables, and Source control, rather than being limited to the three default roles.", + shortValue: 'Yes, project-based RBAC with custom Enterprise roles', confidence: 'verified', sources: [ { - url: 'https://docs.n8n.io/user-management/rbac/custom-roles/', - label: 'Custom project roles | n8n Docs', - asOf: '2026-07-02', + url: 'https://docs.n8n.io/administer/manage-users-and-access/set-permissions-and-roles-rbac/see-available-roles', + label: 'See available roles | Administer | n8n Docs', + asOf: '2026-07-08', }, { url: 'https://blog.n8n.io/introducing-custom-project-roles-and-user-provisioning-via-sso-built-for-enterprise-governance/', label: 'Introducing Custom Project Roles and User Provisioning via SSO', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -933,14 +971,14 @@ export const n8nProfile: CompetitorProfile = { confidence: 'verified', sources: [ { - url: 'https://docs.n8n.io/hosting/scaling/execution-data/', - label: 'Execution data | n8n Docs', - asOf: '2026-07-02', + url: 'https://docs.n8n.io/deploy/host-n8n/configure-n8n/scaling/manage-execution-data', + label: 'Manage execution data | Deploy | n8n Docs', + asOf: '2026-07-08', }, { - url: 'https://docs.n8n.io/manage-cloud/cloud-data-management/', - label: 'Cloud data management | n8n Docs', - asOf: '2026-07-02', + url: 'https://docs.n8n.io/deploy/use-n8n-cloud/configure-cloud/manage-your-data', + label: 'Manage your data | Deploy | n8n Docs', + asOf: '2026-07-08', }, ], }, @@ -1161,22 +1199,21 @@ export const n8nProfile: CompetitorProfile = { }, unattendedExecution: { value: - "Yes: scheduled, webhook, and other trigger-based executions run on n8n's own servers (n8n Cloud) or on the self-hosted n8n server process, not on a user's local machine", + 'Yes: active trigger-based executions (schedule, webhook, etc.) keep running on the n8n instance itself after a user closes their browser, whether that instance is n8n Cloud or a self-hosted server', detail: - "On n8n Cloud, n8n operates the infrastructure, so a trigger-based workflow fires and completes with no dependency on any user's browser tab or device staying open. Self-hosted n8n instead depends on the operator's own server/container (Docker, Kubernetes, or a host machine) staying up, since n8n is a server process rather than a desktop app; as long as that server process is running, individual client devices can disconnect freely.", - shortValue: - "Runs on n8n's server (Cloud) or the operator's own server (self-hosted); no client device dependency", + "n8n staff confirm in the community forum that once a workflow is activated with a trigger, execution continues on the n8n instance independent of the browser tab that was used to activate it; only workflows kicked off via a manual 'Execute Workflow' click stop when the browser closes mid-run. Since n8n itself is a server process (n8n Cloud or a self-hosted Docker/Kubernetes/host-machine instance) rather than a desktop app, unattended trigger-based runs depend on that server staying up, not on any individual client device.", + shortValue: 'Trigger-based runs continue on the server after the browser closes', confidence: 'verified', sources: [ { - url: 'https://docs.n8n.io/choose-how-to-use-n8n.md', - label: 'n8n docs: Choose how to use n8n', - asOf: '2026-07-04', + url: 'https://community.n8n.io/t/does-the-process-continue-even-though-i-close-the-browser-window/15307', + label: 'n8n Community: Does the process continue if I close the browser window?', + asOf: '2026-07-08', }, { - url: 'https://docs.n8n.io/hosting/', - label: 'n8n Docs: Hosting n8n', - asOf: '2026-07-04', + url: 'https://docs.n8n.io/choose-how-to-use-n8n.md', + label: 'n8n docs: Choose how to use n8n', + asOf: '2026-07-08', }, ], }, @@ -1206,18 +1243,22 @@ export const n8nProfile: CompetitorProfile = { sources: [{ url: 'https://n8n.io/pricing/', label: 'n8n Pricing', asOf: '2026-07-02' }], }, community: { - value: 'Large community: ~195k GitHub stars, ~82k Discord members, 30k+ forum members', + value: 'Large community: ~195k GitHub stars, 200k+ community members across all channels', detail: - 'The n8n-io/n8n GitHub repository shows about 194,939 stargazers (via GitHub API). The n8n Discord server is cited by third-party community trackers at roughly 82,422 members. The official n8n Community Forum is described as having 30k+ members.', - shortValue: '~195k GitHub stars, ~82k Discord members', + "The n8n-io/n8n GitHub repository shows 195,690 stargazers (via GitHub API). n8n's own homepage advertises 200k+ community members in aggregate across its Discord, forum, and other channels, but does not break that figure down by channel, and neither the n8n Discord server nor the official Community Forum (community.n8n.io) publishes an individual member-count total.", + shortValue: '~195k GitHub stars, 200k+ community members', confidence: 'verified', sources: [ { url: 'https://api.github.com/repos/n8n-io/n8n', label: 'GitHub API: n8n-io/n8n repo', - asOf: '2026-07-02', + asOf: '2026-07-08', + }, + { + url: 'https://n8n.io', + label: 'n8n.io homepage (200k+ community members)', + asOf: '2026-07-08', }, - { url: 'https://community.n8n.io/', label: 'n8n Community Forum', asOf: '2026-07-02' }, ], }, companyMaturity: { diff --git a/apps/sim/lib/compare/data/competitors/openai-agentkit.ts b/apps/sim/lib/compare/data/competitors/openai-agentkit.ts index 036fb22767f..c902df21996 100644 --- a/apps/sim/lib/compare/data/competitors/openai-agentkit.ts +++ b/apps/sim/lib/compare/data/competitors/openai-agentkit.ts @@ -350,6 +350,26 @@ export const openaiAgentkitProfile: CompetitorProfile = { }, ], }, + customBlocks: { + value: + "No: Agent Builder has no feature to publish a workflow as a named, encapsulated block that other org members can drop into their own separate workflows. Its full node palette (Start, Agent, Note, File search, Guardrails, MCP, If/else, While, Human approval, Transform, Set state) has no 'workflow as a block' node, and publishing only creates a versioned snapshot consumable via the API or embedded through ChatKit, not a reusable canvas block for teammates.", + detail: + "Publishing a workflow in Agent Builder produces a versioned object callable via API or embeddable through ChatKit, but that is deploying one workflow as an endpoint, not turning it into a block that appears in other users' canvases with inputs auto-derived from its Start node and internals hidden. Team-level reuse in the documented deployment paths (templates, ChatKit, SDK code export) means copying a template, embedding a chat surface, or exporting code, none of which give other builders a live, encapsulated block that stays in sync with the source workflow's latest published version. Agent Builder itself is also being wound down, with full shutdown November 30, 2026.", + shortValue: 'No dedicated publish-as-reusable-block feature found', + confidence: 'estimated', + sources: [ + { + url: 'https://developers.openai.com/api/docs/guides/node-reference', + label: 'Node reference | OpenAI API', + asOf: '2026-07-08', + }, + { + url: 'https://developers.openai.com/api/docs/guides/agent-builder', + label: 'Agent Builder | OpenAI API', + asOf: '2026-07-08', + }, + ], + }, }, aiCapabilities: { multiLlmSupport: { @@ -827,16 +847,26 @@ export const openaiAgentkitProfile: CompetitorProfile = { }, rbac: { value: - 'Yes, at the organization level. The Global Admin Console gates access to the Connector Registry, and the Admin API lets Organization Owners assign custom roles and enable or disable specific apps and actions. Granular access scoped to individual Agent Builder workflows is not documented.', + 'Yes, at the workspace level. Workspace Owners create custom roles and use per-role "Connected data" controls to allow or restrict which apps/connectors (and their actions) each role can use, with all apps disabled by default. A separate Global Admin Console (beta) adds a distinct Global admin role for centralizing access management across workspaces. Granular access scoped to individual Agent Builder workflows is not documented.', detail: - 'The Global Admin Console manages access to the Connector Registry used by Agent Builder, and the Admin API lets Organization Owners centrally manage workspaces, assign custom roles to teams, and enable/disable specific apps and actions. This is org/admin-level RBAC, not workflow-scoped permissions within Agent Builder itself.', - shortValue: 'Org-level RBAC via Admin API and Console', + 'ChatGPT Enterprise/Edu/Business workspaces let Workspace Owners create custom roles and, under each role\'s Connected data section, turn on "Allow members to use apps" and select which specific apps that role can access; when an admin enables an app, they can also set action controls (allow all actions, read-only, or a custom action set). All apps are disabled by default until an admin turns them on. The Global Admin Console is a newer, separate beta surface with its own Global admin role and an Access tab for centralizing SSO, domain, and external-application access across workspaces. This is workspace/role-level RBAC over apps and connectors, not permissions scoped to individual Agent Builder workflows.', + shortValue: 'Workspace-level RBAC via custom roles, per-app controls', confidence: 'estimated', sources: [ { - url: 'https://developers.openai.com/api/docs/guides/admin-apis', - label: 'Admin APIs | OpenAI API', - asOf: '2026-07-02', + url: 'https://help.openai.com/en/articles/11750701-rbac', + label: 'RBAC | OpenAI Help Center', + asOf: '2026-07-08', + }, + { + url: 'https://help.openai.com/en/articles/11509118-admin-controls-security-and-compliance-in-apps-enterprise-edu-and-business', + label: 'Admin Controls, Security, and Compliance in apps | OpenAI Help Center', + asOf: '2026-07-08', + }, + { + url: 'https://help.openai.com/en/articles/12289294-global-admin-console', + label: 'Global Admin Console | OpenAI Help Center', + asOf: '2026-07-08', }, ], }, @@ -857,22 +887,23 @@ export const openaiAgentkitProfile: CompetitorProfile = { }, additionalCompliance: { value: - 'SOC 2 Type 2, ISO/IEC 27001:2022, ISO/IEC 27701:2019; supports customer HIPAA/GDPR/CCPA/FERPA compliance via DPA + BAA', + 'FedRAMP Moderate Authorization (ChatGPT Enterprise and API Platform), PCI DSS v4.0.1, SOC 2 Type 2, ISO/IEC 27001:2022, ISO/IEC 27701:2019; supports customer HIPAA compliance via BAA and GDPR/CCPA via DPA; FERPA covered via a separate Student Data Privacy Agreement for ChatGPT Edu', detail: - "OpenAI's SOC 2 Type 2 examination (Security, Availability, Confidentiality, Privacy criteria) covers the API Platform, ChatGPT Enterprise, ChatGPT Edu, and ChatGPT Team, alongside ISO/IEC 27001:2022 and ISO/IEC 27701:2019 certifications for the same services. OpenAI supports customers' compliance with GDPR, CCPA, HIPAA, and FERPA, and offers a Data Processing Addendum and a Business Associate Agreement for HIPAA-regulated customers. This is enablement rather than OpenAI itself being HIPAA-certified, since HIPAA has no formal certification body. No FedRAMP or PCI attestation was found for the AgentKit/API products.", - shortValue: 'SOC 2, ISO 27001/27701, HIPAA/GDPR support', + "OpenAI's ChatGPT Enterprise and API Platform hold FedRAMP Moderate (Class C) authorization per the FedRAMP Marketplace listing. OpenAI's trust portal lists PCI DSS v4.0.1 for payment-processing components, a SOC 2 Type 2 examination (Security, Availability, Confidentiality, Privacy criteria) covering the API Platform, ChatGPT Enterprise, ChatGPT Edu, and ChatGPT Team, plus ISO/IEC 27001:2022, 27017:2015, 27018:2019, and 27701:2019 certifications, and lists GDPR and CCPA. OpenAI offers a Data Processing Addendum for GDPR/CCPA and a Business Associate Agreement for HIPAA-regulated customers on ChatGPT Enterprise/Edu and the API (not standard ChatGPT Business); this is enablement rather than OpenAI itself being HIPAA-certified, since HIPAA has no formal certification body. FERPA compliance for ChatGPT Edu/for Teachers runs through a separate Student Data Privacy Agreement rather than the general DPA.", + shortValue: 'FedRAMP Moderate, PCI DSS, SOC 2, ISO 27001/27701, HIPAA BAA', confidence: 'verified', sources: [ { - url: 'https://openai.com/security-and-privacy/', - label: 'Security and privacy at OpenAI', - asOf: '2026-07-02', + url: 'https://www.fedramp.gov/marketplace/products/FR2533155773/', + label: 'ChatGPT Enterprise and API Platform | FedRAMP Marketplace', + asOf: '2026-07-08', }, - { url: 'https://trust.openai.com/', label: 'OpenAI Trust Portal', asOf: '2026-07-02' }, + { url: 'https://trust.openai.com/', label: 'OpenAI Trust Portal', asOf: '2026-07-08' }, { - url: 'https://openai.com/business-data/', - label: 'Business data privacy, security, and compliance', - asOf: '2026-07-02', + url: 'https://help.openai.com/en/articles/8660679-how-can-i-get-a-business-associate-agreement-baa-with-openai', + label: + 'How can I get a Business Associate Agreement (BAA) with OpenAI? | OpenAI Help Center', + asOf: '2026-07-08', }, ], }, @@ -1232,26 +1263,21 @@ export const openaiAgentkitProfile: CompetitorProfile = { }, companyMaturity: { value: - 'Founded 2015; ~9,000+ employees; $852B valuation after $122B round closed March 2026', + 'Founded December 2015; ~4,500 employees (targeting ~8,000 by end of 2026); $852B valuation after $122B round closed April 2026', detail: - 'OpenAI was founded in December 2015 (originally as a nonprofit) by Sam Altman, Greg Brockman, Elon Musk, Ilya Sutskever, and others. On March 31, 2026, OpenAI closed a $122B funding round at an $852B post-money valuation, with Amazon ($50B, partly contingent on an IPO or reaching AGI), Nvidia ($30B), and SoftBank ($30B) as the largest backers, alongside co-investors including Andreessen Horowitz, D.E. Shaw Ventures, MGX, TPG, and T. Rowe Price-advised accounts; cumulative funding raised is around $180B+ across 15 rounds. Employee headcount estimates vary by source, with one tracker citing roughly 9,268 employees as of May 31, 2026 (other estimates range 3,800-8,000 depending on scope/date). This is a mature, well-capitalized company, though AgentKit/Agent Builder is a relatively new (October 2025) product line now being wound down, with shutdown scheduled for November 30, 2026.', - shortValue: 'Founded 2015, $852B valuation, ~9,000 employees', + 'OpenAI was founded in December 2015 (originally as a nonprofit) by Sam Altman, Greg Brockman, Elon Musk, Ilya Sutskever, and others. OpenAI closed a $122B funding round in April 2026 at an $852B post-money valuation, with Amazon ($50B), Nvidia ($30B), and SoftBank ($30B) as the largest backers. Employee headcount was roughly 4,500 as of 2026 per Wikipedia, with Financial Times reporting (via Engadget) that OpenAI aims to nearly double its headcount to about 8,000 employees by the end of 2026. This is a mature, well-capitalized company, though AgentKit/Agent Builder is a relatively new (October 2025) product line now being wound down, with shutdown scheduled for November 30, 2026.', + shortValue: 'Founded 2015, $852B valuation, ~4,500 employees', confidence: 'verified', sources: [ { url: 'https://en.wikipedia.org/wiki/OpenAI', label: 'OpenAI: Wikipedia', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { - url: 'https://sacra.com/c/openai/', - label: 'OpenAI revenue, valuation & funding: Sacra', - asOf: '2026-07-02', - }, - { - url: 'https://tracxn.com/d/companies/openai/__kElhSG7uVGeFk1i71Co9-nwFtmtyMVT7f-YHMn4TFBg', - label: 'OpenAI: Tracxn company profile', - asOf: '2026-07-02', + url: 'https://www.engadget.com/ai/openai-reportedly-plans-to-double-its-workforce-to-8000-employees-161028377.html', + label: 'OpenAI reportedly plans to double its workforce to 8,000 employees: Engadget', + asOf: '2026-07-08', }, ], }, diff --git a/apps/sim/lib/compare/data/competitors/openclaw.ts b/apps/sim/lib/compare/data/competitors/openclaw.ts index e00e959c956..86a25169eef 100644 --- a/apps/sim/lib/compare/data/competitors/openclaw.ts +++ b/apps/sim/lib/compare/data/competitors/openclaw.ts @@ -44,13 +44,13 @@ export const openClawProfile: CompetitorProfile = { { title: 'Sub-agent orchestration for parallel background work', description: - 'A running agent can spawn sub-agents, background runs in their own isolated session and (by default) sandbox, that work in parallel on research, long-running tools, or verification tasks and report results back to the requesting chat when finished. Nesting depth is capped at 2 levels.', + 'A running agent can spawn sub-agents, background runs in their own isolated session and (by default) sandbox, that work in parallel on research, long-running tools, or verification tasks and report results back to the requesting chat when finished. Nesting depth defaults to 1 level, with an orchestrator pattern recommended at depth 2, and a configurable maximum of 5 levels.', shortDescription: 'Spawns isolated sub-agents that run tasks in parallel and report back to chat.', source: { url: 'https://docs.openclaw.ai/tools/subagents', label: 'OpenClaw Docs: Sub-agents', - asOf: '2026-07-02', + asOf: '2026-07-08', }, }, { @@ -78,15 +78,15 @@ export const openClawProfile: CompetitorProfile = { }, }, { - title: 'Foundation-governed, MIT-licensed, with committed multi-year sponsorship', + title: 'MIT-licensed, moving to independent foundation governance', description: - 'After creator Peter Steinberger joined OpenAI in February 2026, governance passed to the independent, non-profit OpenClaw Foundation (a board of community-elected maintainers). OpenAI sponsors the project with funding and inference/security support (Codex Security scanning) but does not own it.', + 'After creator Peter Steinberger joined OpenAI in February 2026, he confirmed OpenClaw will become an open-source project run "under a foundation, supported by OpenAI but independent." Public reporting does not detail the foundation\'s formal name, board structure, or specific sponsorship terms.', shortDescription: - 'MIT-licensed, run by a non-profit Foundation with OpenAI sponsorship, not one company.', + 'MIT-licensed; governance is moving to an independent foundation supported, not owned, by OpenAI.', source: { - url: 'https://openclaw.ai/ecosystem/', - label: 'OpenClaw Ecosystem page', - asOf: '2026-07-02', + url: 'https://www.forbes.com/sites/ronschmelzer/2026/02/16/openai-hires-openclaw-creator-peter-steinberger-and-sets-up-foundation/', + label: 'Forbes: OpenAI Hires OpenClaw Creator Peter Steinberger And Sets Up Foundation', + asOf: '2026-07-08', }, }, ], @@ -106,13 +106,13 @@ export const openClawProfile: CompetitorProfile = { { title: 'ClawHub marketplace has documented, ongoing supply-chain security incidents', description: - 'Researchers found 283 ClawHub skills (roughly 7.1% of the registry at the time) leaking API keys and other credentials, and a separate scan identified 24 accounts distributing over 600 malicious skills before scanning was introduced. OpenClaw has since added VirusTotal and SkillSpector scanning, but its documentation still tells users to "treat third-party skills as untrusted code."', + 'A Kaspersky/Securelist scan of the ClawHub skill hub in April 2026 identified 24 accounts distributing more than 600 malicious skills. In response, OpenClaw added preliminary VirusTotal and NVIDIA SkillSpector scanning to the skill-publishing pipeline, but its documentation still tells users to treat third-party skills as untrusted code.', shortDescription: - 'Researchers found hundreds of ClawHub skills leaking credentials or containing malware.', + 'A single scan found 24 accounts distributing over 600 malicious ClawHub skills.', source: { - url: 'https://snyk.io/blog/openclaw-skills-credential-leaks-research/', - label: 'Snyk: 280+ Leaky Skills: How OpenClaw & ClawHub Are Exposing API Keys and PII', - asOf: '2026-07-02', + url: 'https://securelist.com/openclaw-security/120484/', + label: 'Securelist: Security risks for OpenClaw users and how to mitigate these risks', + asOf: '2026-07-08', }, }, { @@ -130,24 +130,24 @@ export const openClawProfile: CompetitorProfile = { { title: 'No SOC 2 report or other compliance attestation', description: - 'OpenClaw is a self-hosted open-source project run by a non-profit foundation, not a vendor selling a hosted service, so it publishes no SOC 2 report or other compliance attestation. Sim is SOC 2 compliant; like OpenClaw, Sim does not currently hold ISO 27001 or HIPAA certification. Security for data-at-rest and processing on OpenClaw falls entirely on the operator running their own instance.', + "OpenClaw has no OpenClaw-operated hosted service, only self-hosted software, and no SOC 2 report, trust center, or other compliance attestation is published anywhere on its official sites. Sim is SOC 2 compliant; like OpenClaw, Sim does not currently hold ISO 27001 or HIPAA certification. OpenClaw's own security documentation places responsibility for data-at-rest and processing security squarely on the operator running their own instance.", shortDescription: 'No SOC 2 report; the self-hosting operator owns all compliance risk.', source: { url: 'https://docs.openclaw.ai/gateway/security', label: 'OpenClaw Docs: Security', - asOf: '2026-07-02', + asOf: '2026-07-08', }, }, { - title: 'Rapid rebranding and name churn created real confusion and scam risk', + title: 'Rapid rebranding and name churn created real confusion', description: - 'The project launched in November 2025 as "Warelay," was renamed to "Clawdbot," then to "Moltbot" on January 27, 2026 after an Anthropic trademark complaint over similarity to "Claude," then to "OpenClaw" three days later. Coverage from the period documents scam and impersonation activity, including a reported $16M crypto scam, riding the confusion.', + 'The project launched on November 24, 2025 as "Warelay," then went through "CLAWDIS" and "Clawdbot" before being renamed to "Moltbot" on January 27, 2026 after an Anthropic trademark complaint over similarity to "Claude," then to "OpenClaw" three days later. Four name changes in about ten weeks made it hard for users to know which name, repo, or site was the legitimate project.', shortDescription: - 'Three name changes in about ten weeks, including an Anthropic trademark dispute, fueled scam activity.', + 'Four name changes in about ten weeks, including an Anthropic trademark dispute.', source: { url: 'https://en.wikipedia.org/wiki/OpenClaw', label: 'Wikipedia: OpenClaw', - asOf: '2026-07-02', + asOf: '2026-07-08', }, }, ], @@ -225,16 +225,16 @@ export const openClawProfile: CompetitorProfile = { }, templates: { value: - 'No workflow templates in the visual-builder sense; OpenClaw has no workflow canvas. ClawHub instead offers 60,000+ community-built Skills as installable starter packages for specific tasks.', + 'No workflow templates in the visual-builder sense; OpenClaw has no workflow canvas. ClawHub instead offers a small, curated catalog of community-built Skills as installable starter packages for specific tasks: the live registry currently lists roughly 30 featured skills and 12 plugins.', detail: - "ClawHub's live registry lists over 60,000 community-built skills and 56,000+ certified skills, the closest analog to a template gallery, but each is a Markdown instruction package installed into the agent, not a prebuilt multi-step workflow.", - shortValue: '60,000+ ClawHub skills, not workflow templates', + 'ClawHub is the closest analog to a template gallery, installable Markdown Skill packages for specific tasks, but its catalog is a curated set rather than a large template gallery, and catalog size has shifted significantly over time (including a security-driven cleanup, see integrations for detail). Each skill is a Markdown instruction package installed into the agent, not a prebuilt multi-step workflow.', + shortValue: '~30 ClawHub skills and 12 plugins currently listed, not workflow templates', confidence: 'estimated', sources: [ { url: 'https://clawhub.ai/', label: 'ClawHub registry', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -299,16 +299,16 @@ export const openClawProfile: CompetitorProfile = { }, nativeFileStorage: { value: - "No: OpenClaw has no cloud file-storage product of its own (no folder hierarchy, link-based sharing with password/SSO, or deleted-item recovery). It reads/writes files directly on the operator's own local filesystem or connected apps (e.g. via MCP servers, channel attachments) inside a sandboxed workspace directory.", + "No: OpenClaw has no cloud file-storage product of its own. It reads and writes files directly on the operator's own local filesystem, inside a sandboxed workspace directory, rather than through a dedicated hosted file-storage/sharing surface.", detail: - 'Tool access defaults to sandbox-isolated directories under the local workspace (~/.openclaw/workspace). There is no first-party hosted file-storage/sharing surface distinct from the local filesystem.', + 'Tool access defaults to sandbox-isolated directories under ~/.openclaw/sandboxes (agents.defaults.sandbox.workspaceAccess). There is no first-party hosted file-storage/sharing surface distinct from the local filesystem.', shortValue: 'No: operates on the local filesystem, no hosted file store', confidence: 'estimated', sources: [ { url: 'https://docs.openclaw.ai/gateway/security', label: 'OpenClaw Docs: Security', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -362,6 +362,32 @@ export const openClawProfile: CompetitorProfile = { }, ], }, + customBlocks: { + value: + "No: OpenClaw has no feature to publish a Lobster workflow or Task Flow as a named, iconed, encapsulated block that appears in a shared toolbar for other org members to drop into their own separate flows. The documented path for org-wide reuse is packaging a `.lobster` file plus setup notes as a Skill or plugin and publishing it through ClawHub, an installable instruction/code package the agent references, not a live block whose inputs/outputs are auto-derived from a source workflow and that tracks that workflow's latest deployed version automatically.", + detail: + "Lobster's own docs list run/command, pipeline, and approval as its only step types, with no invoke-another-workflow-as-a-block primitive. Task Flow is scoped to tracking state within a single multi-step run, not publishing that run as a reusable component. ClawHub Skills are markdown instruction files compiled into the system prompt for agent reasoning, not encapsulated, auto-input-derived workflow blocks with hand-picked outputs and hidden internals; a published Skill's `.lobster` file and setup notes are visible to whoever installs it, the opposite of Sim's full encapsulation.", + shortValue: + 'No: reuse is via ClawHub Skills (visible instructions), not a live workflow block', + confidence: 'estimated', + sources: [ + { + url: 'https://docs.openclaw.ai/tools/lobster', + label: 'OpenClaw Docs: Lobster', + asOf: '2026-07-08', + }, + { + url: 'https://docs.openclaw.ai/automation/taskflow', + label: 'OpenClaw Docs: Task flow', + asOf: '2026-07-08', + }, + { + url: 'https://docs.openclaw.ai/tools/skills', + label: 'OpenClaw Docs: Skills', + asOf: '2026-07-08', + }, + ], + }, }, aiCapabilities: { multiLlmSupport: { @@ -426,16 +452,16 @@ export const openClawProfile: CompetitorProfile = { }, mcpSupport: { value: - 'Yes: native MCP client support over both stdio and HTTP/SSE transports, connecting to any published MCP server by adding an mcpServers block to the OpenClaw config', + 'Yes: native MCP client support over both stdio and HTTP/SSE transports, connecting to any published MCP server by adding an mcpServers block to the OpenClaw config. Compatible with the entire published ecosystem of MCP servers (e.g. GitHub, Notion, Postgres, Slack). OpenClaw can also itself be run as an MCP server via `openclaw mcp serve`, exposing its channel conversations to external MCP clients like Claude Code.', detail: - 'Compatible with "the entire published ecosystem of MCP servers" (e.g. GitHub, Notion, Postgres, Slack). Whether OpenClaw itself can be published as an MCP server for external tools to call is undocumented (see mcpPublishing).', - shortValue: 'Yes, MCP client over stdio and HTTP/SSE', + 'The docs.openclaw.ai/cli/mcp page documents both directions: consuming external MCP servers via an mcpServers config block, and running `openclaw mcp serve` to start OpenClaw as a stdio MCP server exposing its channel conversations to external MCP clients.', + shortValue: 'Yes, MCP client over stdio/HTTP+SSE, and can run as an MCP server too', confidence: 'verified', sources: [ { url: 'https://docs.openclaw.ai/cli/mcp', label: 'OpenClaw Docs: MCP', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -491,16 +517,16 @@ export const openClawProfile: CompetitorProfile = { }, dynamicToolUse: { value: - 'Yes: the agent dynamically selects among its configured tools, connectors, and installed Skills at runtime based on the request, rather than following a pre-wired sequence of steps chosen at build time', + 'Partial: which Skills are even eligible for a session is snapshotted once when that session starts and reused for every subsequent turn, not re-selected per request; within that fixed snapshot, the agent still chooses which tool/skill to invoke on a given turn based on the request, rather than following a pre-wired sequence of steps chosen at build time.', detail: - 'This is the core operating model described throughout the docs (tool/skill dispatch decided per-turn by the agent), a consequence of there being no visual builder with pre-wired steps.', - shortValue: 'Yes, picks tools/skills dynamically per request', - confidence: 'estimated', + 'OpenClaw\'s own docs state it "snapshots eligible skills when a session starts and reuses that list for all subsequent turns in the session," with changes to skills or config taking effect only on the next new session (or when a skills-file watcher detects an edit).', + shortValue: 'Partial: skills are snapshotted per session, not re-selected per request', + confidence: 'verified', sources: [ { url: 'https://docs.openclaw.ai/tools/skills', label: 'OpenClaw Docs: Skills', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -553,16 +579,16 @@ export const openClawProfile: CompetitorProfile = { }, parallelExecution: { value: - 'Yes: sub-agents can run in parallel, working simultaneously on separate tasks (e.g. research, content generation, verification) and report back to the requesting session, up to a documented 2-level nesting depth (main session can spawn depth-1 sub-agents, which can spawn depth-2 workers, where depth-2 spawning further sub-agents is denied)', + 'Yes: sub-agents can run in parallel, working simultaneously on separate tasks (e.g. research, content generation, verification) and report back to the requesting session. Nesting defaults to depth 1, with a documented maxSpawnDepth configurable up to 5 levels via the maxSpawnDepth parameter (range 1-5).', detail: 'Each sub-agent gets its own session identifier, context window, and execution environment (with optional sandboxing), isolated from the main session and from sibling sub-agents.', - shortValue: 'Yes, parallel sub-agents up to 2 levels of nesting', + shortValue: 'Yes, parallel sub-agents with configurable nesting depth (up to 5)', confidence: 'verified', sources: [ { url: 'https://docs.openclaw.ai/tools/subagents', label: 'OpenClaw Docs: Sub-agents', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -607,21 +633,21 @@ export const openClawProfile: CompetitorProfile = { integrations: { integrationCount: { value: - '22+ native messaging channels plus 60,000+ community-built Skills and MCP access to the broader MCP server ecosystem', + "29 native messaging channels plus ClawHub's live registry of roughly 30 featured skills and 12 plugins, and MCP access to the broader MCP server ecosystem", detail: - "Native channel integrations (WhatsApp, Telegram, Slack, Discord, Signal, iMessage, Microsoft Teams, and more) are documented directly. ClawHub's live registry separately lists over 60,000 community-built skills (56,000+ certified), and MCP support adds access to hundreds of third-party MCP servers on top of that.", - shortValue: '22+ channels, 60,000+ Skills, plus MCP servers', + "Native channel integrations (WhatsApp, Telegram, Slack, Discord, Signal, iMessage, Microsoft Teams, and more) are documented directly, and the openclaw.ai homepage advertises 29 channels. ClawHub's live registry currently lists roughly 30 featured skills and 12 plugins; MCP support adds access to hundreds of third-party MCP servers on top of that.", + shortValue: '29 channels, ~30 ClawHub skills/12 plugins, plus MCP servers', confidence: 'estimated', sources: [ { url: 'https://openclaw.ai/', label: 'OpenClaw homepage', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://clawhub.ai/', label: 'ClawHub registry', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -785,16 +811,21 @@ export const openClawProfile: CompetitorProfile = { }, dataResidency: { value: - 'Yes, by construction: because OpenClaw is self-hosted only, all agent data (sessions, memory files, credentials) resides wherever the operator chooses to run the Gateway (laptop, homelab, or their own VPS/cloud region), giving complete control over data location with no vendor-side residency question.', + "Yes, by construction: because OpenClaw runs only as a self-hosted Gateway process, with no OpenClaw-operated hosted/SaaS version, all agent data (sessions, memory files, credentials) resides wherever the operator chooses to run it, e.g. a personal laptop or a self-hosted VPS/homelab using the project's own Ansible/NixOS deployment tooling, giving the operator full control over data location with no vendor-side residency question.", detail: - 'The OpenClaw Ecosystem page states data lives "where you choose, laptop, homelab, or VPS," a direct consequence of there being no vendor-operated cloud service.', + 'The OpenClaw Ecosystem page lists self-host infrastructure tooling (an Ansible playbook, NixOS packaging) for operators running the Gateway on their own server. Combined with there being no OpenClaw-operated cloud service, data residency is entirely a function of where the operator deploys the Gateway.', shortValue: 'Yes, fully controlled by self-hosting location', confidence: 'verified', sources: [ { url: 'https://openclaw.ai/ecosystem/', label: 'OpenClaw Ecosystem page', - asOf: '2026-07-02', + asOf: '2026-07-08', + }, + { + url: 'https://docs.openclaw.ai/', + label: 'OpenClaw Docs home', + asOf: '2026-07-08', }, ], }, @@ -845,16 +876,17 @@ export const openClawProfile: CompetitorProfile = { }, modelAndToolGovernance: { value: - 'Yes, at the single-operator level: OpenClaw supports per-agent tool allow/deny lists, sandbox-level tool filters, and per-model-provider configuration, so an operator can restrict which tools/models a given agent may use. This is configured by one trusted operator, not enforced org-wide across multiple admin-managed users.', + "Yes, at the single-operator level: OpenClaw supports per-agent tool allow/deny lists and sandbox-level workspace/tool restrictions (agents.defaults.sandbox, tools.allow/tools.deny), configured by one trusted operator, not enforced org-wide. The docs frame this as a layered 'identity → scope → model' design principle rather than a formally named three-gate system.", detail: - 'Documented as a three-gate system (agent-level tools.allow/deny, sandbox-level tools.allow, and container network access), plus explicit provider/model selection per agent in configuration.', - shortValue: 'Yes, operator-configured per-agent tool/model restrictions', + "Documented via agent-level tools.allow/tools.deny lists and sandbox-level workspace/tool restrictions, plus explicit provider/model selection per agent in configuration, framed by the docs around an 'identity → scope → model' design principle.", + shortValue: + 'Yes, operator-configured per-agent tool/model restrictions (identity → scope → model)', confidence: 'verified', sources: [ { url: 'https://docs.openclaw.ai/gateway/security', label: 'OpenClaw Docs: Security', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -941,10 +973,9 @@ export const openClawProfile: CompetitorProfile = { asOf: '2026-07-02', }, { - url: 'https://openclaw.ai/blog/openclaw-nvidia-skill-security', - label: - 'OpenClaw Blog: OpenClaw Collaborates with NVIDIA for Stronger Agent Skill Security', - asOf: '2026-07-02', + url: 'https://securelist.com/openclaw-security/120484/', + label: 'Securelist: Security risks for OpenClaw users and how to mitigate these risks', + asOf: '2026-07-08', }, ], }, @@ -967,31 +998,32 @@ export const openClawProfile: CompetitorProfile = { }, durabilityModel: { value: - 'Partial: cron-scheduled jobs run as isolated sessions that start clean and get pruned after a retention window, giving each run a clean, repeatable environment, but there is no automatic retry-with-backoff or checkpoint/replay-of-a-past-run feature for either scheduled jobs or interactive chat sessions.', + 'Partial: cron-scheduled jobs run as isolated sessions with retention/pruning, and OpenClaw now provides automatic retry-with-backoff for both one-shot jobs (up to retry.maxAttempts, default 3 attempts, at 30s/60s/5m) and recurring jobs (an extended 30s/60s/5m/15m/60m backoff on consecutive errors), though there is still no checkpoint/replay-of-a-past-run feature for either scheduled jobs or interactive chat sessions.', detail: - 'The cron docs describe delivery diagnostics (intended target, resolved target, fallback delivery used, final delivered state) for message delivery specifically, not a general execution-retry/checkpoint mechanism.', - shortValue: 'Clean isolated cron runs; no documented retry/checkpoint system', + 'The cron docs describe both delivery diagnostics (intended target, resolved target, fallback delivery used, final delivered state) for message delivery, and the retry/backoff schedule (cron.sessionRetention, runLog.keepLines, retry.maxAttempts) as configurable per job.', + shortValue: 'Clean isolated cron runs with retry-with-backoff; no checkpoint/replay', confidence: 'estimated', sources: [ { url: 'https://docs.openclaw.ai/automation/cron-jobs', label: 'OpenClaw Docs: Scheduled tasks (cron jobs)', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, failureAlerting: { value: - 'Partial: cron job runs report delivery diagnostics (whether the agent sent directly, whether fallback delivery was used, the final delivered state) back through the chat channel, but there is no separate proactive alerting mechanism (email/webhook alert on failure or cost/latency threshold).', + 'Partial: cron jobs support a dedicated failure-alerting path (a configurable cron.failureDestination global/per-job override, a webhook delivery mode, and --failure-alert-after/--failure-alert-cooldown tuning flags) in addition to normal chat delivery diagnostics, so failure alerting is a distinct feature rather than merely folded into chat delivery. There is still no email or cost/latency-threshold alerting.', detail: - 'Failure visibility is folded into the normal chat-delivery flow (the operator sees the delivery outcome in the channel where the job reports), not a distinct alerting/notification product feature.', - shortValue: 'Delivery diagnostics via chat, no separate alerting feature', + 'Failure alerting is a dedicated, tunable path (webhook delivery mode plus alert-frequency flags), separate from the normal chat-delivery flow where the operator otherwise sees delivery outcomes in the channel where the job reports.', + shortValue: + 'Dedicated failure-alerting path (webhook + tuning flags); no email/threshold alerts', confidence: 'estimated', sources: [ { url: 'https://docs.openclaw.ai/automation/cron-jobs', label: 'OpenClaw Docs: Scheduled tasks (cron jobs)', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -1026,17 +1058,17 @@ export const openClawProfile: CompetitorProfile = { }, executionLimits: { value: - 'No fixed platform-wide execution-time or concurrency ceiling is published by OpenClaw itself. Sub-agent nesting is capped at 2 levels deep (depth-2 sessions cannot spawn further sub-agents), and any other limits (request timeouts, rate limits) come from whichever LLM provider API the operator has configured, not from OpenClaw.', + 'No fixed platform-wide execution-time ceiling is published by default (runTimeoutSeconds defaults to 0/unlimited). Sub-agents cannot spawn their own children by default (maxSpawnDepth defaults to 1); setting maxSpawnDepth to 2 opts into one level of nesting (the documented "orchestrator pattern"), up to a configurable maximum of 5. agents.defaults.subagents.maxConcurrent caps concurrent sub-agent runs at 8 by default, with maxChildrenPerAgent capping children per orchestrator at 5 by default.', detail: - "Because OpenClaw runs on infrastructure the operator controls, execution-time/concurrency limits are a function of that operator's own hardware and their model provider's API limits, not an OpenClaw-side ceiling.", + "Because OpenClaw runs on infrastructure the operator controls, execution-time/concurrency limits beyond these published defaults (runTimeoutSeconds, maxSpawnDepth, maxConcurrent, maxChildrenPerAgent) are a function of that operator's own hardware and their model provider's API limits, not an OpenClaw-side ceiling.", shortValue: - 'No OpenClaw-side limit; only sub-agent depth cap (2 levels) and provider limits', - confidence: 'estimated', + 'No nesting by default (maxSpawnDepth 1, opt-in to 2+); maxConcurrent 8; no fixed time limit', + confidence: 'verified', sources: [ { url: 'https://docs.openclaw.ai/tools/subagents', label: 'OpenClaw Docs: Sub-agents', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, diff --git a/apps/sim/lib/compare/data/competitors/pipedream.ts b/apps/sim/lib/compare/data/competitors/pipedream.ts index ee506a3994a..9d938eaa30f 100644 --- a/apps/sim/lib/compare/data/competitors/pipedream.ts +++ b/apps/sim/lib/compare/data/competitors/pipedream.ts @@ -185,26 +185,21 @@ export const pipedreamProfile: CompetitorProfile = { }, environmentPromotion: { value: - 'Partial: GitHub Sync gives file-level promotion; no native fork/clone-project push between dev and prod', + 'Partial: GitHub Sync promotes an entire project (all its workflows) via a development-to-production branch merge; no per-file promotion and no native clone/fork of an existing project into a new one', detail: - "Pipedream projects have only two built-in environments (Development and Production) per project, used mainly for scoping env vars and Connect API tokens, not a promote/push pipeline. The closest equivalent is GitHub Sync (Advanced/Business plans): each project links to one GitHub repo, workflows are serialized to YAML and edited/committed via GitHub or a local clone, and pushing to the production branch triggers a deploy. This gives git-based promotion of an entire project's workflows, but it's opt-in, one repo per project, and not a dedicated staging-to-prod UI flow.", - shortValue: 'GitHub Sync gives file-level promotion', + "Pipedream Connect projects have Development and Production environments, but these scope connected end-user accounts and Connect API tokens — not general per-project workflow promotion. The closest equivalent for promoting workflows is GitHub Sync (Advanced/Business plans): each project links to one GitHub repo, all of a project's workflows and resources are serialized to YAML, changes are made in a development branch, and merging that branch into `production` deploys everything that changed to production workflows. This is project-level (whole-project, branch-merge) promotion, not file-level. Pipedream's own docs also state that syncing an existing GitHub repo of workflows into a new Pipedream project ('cloning' a project via GitHub Sync) is not currently possible.", + shortValue: 'GitHub Sync promotes whole projects via branch merge', confidence: 'estimated', sources: [ { - url: 'https://pipedream.com/docs/workflows/projects/', - label: 'Pipedream Docs – Projects', - asOf: '2026-07-02', + url: 'https://pipedream.com/docs/connect/managed-auth/environments/', + label: 'Pipedream Docs – Connect Environments', + asOf: '2026-07-08', }, { url: 'https://pipedream.com/docs/workflows/git', label: 'Pipedream Docs – GitHub Sync', - asOf: '2026-07-02', - }, - { - url: 'https://pipedream.com/blog/github-sync/', - label: 'Pipedream Blog – GitHub Sync', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -313,6 +308,26 @@ export const pipedreamProfile: CompetitorProfile = { }, ], }, + customBlocks: { + value: + "No: Pipedream's closest mechanism is publishing a single Node.js code step as a reusable 'custom action' that shows up under 'My Actions' for other steps to select, not a full multi-step deployed workflow turned into an org-wide toolbar block. The published code stays directly visible and editable to whoever adds it (no encapsulation of internals/credentials), and updates are opt-in: Pipedream's own docs state a new version 'doesn't automatically update all instances of the same action across your workflows... this gives you the control to gradually update.'", + detail: + "No Pipedream documentation describes taking an entire deployed workflow, auto-deriving its inputs, letting the publisher hand-pick named outputs, and exposing it as a named/iconed block in the builder toolbar for every other team member to drop into their own workflows while always running the source's latest deployed version. 'Sharing Code Across Workflows' scopes reuse to one code step at a time (multi-step reuse requires the CLI to build a full component, which then cannot be edited inline), and the Components docs don't address workflow-to-component conversion at all. Pipedream's registry model is instead built around wrapping third-party API calls into app integrations, not packaging a user's own business-logic workflow as a hidden-internals block.", + shortValue: 'No, only single code-step reuse with opt-in updates', + confidence: 'verified', + sources: [ + { + url: 'https://pipedream.com/docs/workflows/building-workflows/code/nodejs/sharing-code', + label: 'Pipedream Docs: Sharing Code Across Workflows', + asOf: '2026-07-08', + }, + { + url: 'https://pipedream.com/docs/components', + label: 'Pipedream Docs: Components Overview', + asOf: '2026-07-08', + }, + ], + }, }, aiCapabilities: { multiLlmSupport: { @@ -371,19 +386,19 @@ export const pipedreamProfile: CompetitorProfile = { mcpSupport: { value: 'Yes: first-class, hosted MCP server', detail: - 'Pipedream runs a hosted MCP server (mcp.pipedream.com) exposing 3,000+ apps / 10,000+ tools to any MCP client, with managed OAuth and credential isolation; also ships an official MCP server package in its GitHub repo.', + 'Pipedream runs a hosted MCP server (mcp.pipedream.com) exposing 3,000+ apps / 10,000+ tools to any MCP client, with managed OAuth and credential isolation. Its GitHub repo also includes a reference/self-hosted MCP server implementation, though Pipedream notes it is no longer actively maintained and recommends the hosted remote MCP server for production use.', shortValue: 'Hosted MCP server, 3,000+ apps as tools', confidence: 'verified', sources: [ { url: 'https://pipedream.com/docs/connect/mcp', label: 'Pipedream Docs: MCP Servers', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://github.com/PipedreamHQ/pipedream/blob/master/modelcontextprotocol/README.md', - label: 'GitHub: Modelcontextprotocol README', - asOf: '2026-07-02', + label: 'GitHub: Modelcontextprotocol README (reference implementation, unmaintained)', + asOf: '2026-07-08', }, ], }, @@ -581,34 +596,34 @@ export const pipedreamProfile: CompetitorProfile = { value: 'Yes: official TypeScript SDK (@pipedream/sdk) and Python SDK (pipedream on PyPI), plus @pipedream/connect-react for embeddable connect UI', detail: - "Pipedream ships an official TypeScript SDK, @pipedream/sdk (v3.1.1), and an official Python SDK, published as `pipedream` on PyPI (v2.1.8), both for programmatic access to the Pipedream/Connect APIs, alongside a companion @pipedream/connect-react package for embeddable React auth/connect UI. Beyond the SDKs, Pipedream provides a full component development kit: triggers and actions ('components') are plain Node.js modules that run on Pipedream's serverless infrastructure and can use most npm packages with no install step. Components are open-sourced in the public PipedreamHQ/pipedream GitHub monorepo, and community members can build and publish their own actions/sources that appear in Pipedream's UI/marketplace alongside first-party ones, functioning as a de facto community integration marketplace.", + "Pipedream ships an official TypeScript SDK, @pipedream/sdk (v3.1.1 on npm), and an official Python SDK, published as `pipedream` on PyPI (v2.1.14), both for programmatic access to the Pipedream/Connect APIs, alongside a companion @pipedream/connect-react package (v3.0.1 on npm) for embeddable React auth/connect UI. Beyond the SDKs, Pipedream provides a full component development kit: triggers and actions ('components') are plain Node.js modules that run on Pipedream's serverless infrastructure and can use most npm packages with no install step. Components are open-sourced in the public PipedreamHQ/pipedream GitHub monorepo, and community members can build and publish their own actions/sources that appear in Pipedream's UI/marketplace alongside first-party ones, functioning as a de facto community integration marketplace.", shortValue: 'TypeScript + Python SDKs, plus components SDK', confidence: 'verified', sources: [ { - url: 'https://www.npmjs.com/package/@pipedream/sdk', - label: 'npm – @pipedream/sdk', - asOf: '2026-07-02', + url: 'https://registry.npmjs.org/@pipedream/sdk/latest', + label: 'npm registry – @pipedream/sdk (latest)', + asOf: '2026-07-08', }, { - url: 'https://pipedream.com/docs/components/guidelines', - label: 'Pipedream Docs – Components Guidelines & Patterns', - asOf: '2026-07-02', + url: 'https://registry.npmjs.org/@pipedream/connect-react/latest', + label: 'npm registry – @pipedream/connect-react (latest)', + asOf: '2026-07-08', }, { - url: 'https://pipedream.com/docs/workflows/contributing/components/', - label: 'Pipedream Docs – Contributing Components', - asOf: '2026-07-02', + url: 'https://pypi.org/project/pipedream/', + label: 'PyPI – pipedream package', + asOf: '2026-07-08', }, { - url: 'https://github.com/PipedreamHQ/pipedream', - label: 'GitHub – PipedreamHQ/pipedream monorepo', - asOf: '2026-07-02', + url: 'https://pipedream.com/docs/components/guidelines', + label: 'Pipedream Docs – Components Guidelines & Patterns', + asOf: '2026-07-08', }, { - url: 'https://pypi.org/project/pipedream/', - label: 'PyPI package page', - asOf: '2026-07-02', + url: 'https://github.com/PipedreamHQ/pipedream', + label: 'GitHub – PipedreamHQ/pipedream monorepo', + asOf: '2026-07-08', }, ], }, @@ -1088,26 +1103,31 @@ export const pipedreamProfile: CompetitorProfile = { }, companyMaturity: { value: - 'Founded 2019, San Francisco; ~11-50 employees pre-acquisition; raised ~$22M across 2 rounds; agreed to be acquired by Workday (signed Nov 19, 2025), with no public confirmation the deal has closed as of mid-2026', + "Founded 2019 (some sources say 2018), San Francisco; ~21-50 employees; raised at least $20M in Series A financing; Workday signed a definitive agreement to acquire Pipedream (Nov 19, 2025), with the deal expected to close by the end of Workday's fiscal Q4 2026 (Jan 31, 2026) — no independently reachable source confirms the acquisition has actually closed", detail: - "Per Crunchbase, Pipedream was founded in 2019 and headquartered in San Francisco, CA, with founders including Tod Sacerdoti (CEO), Dylan Sather, TJ Koblentz, and Pravin Savkar; it raised a total of ~$22M across 2 funding rounds (investors include Felicis and CRV) and had a headcount signal of 11-50 employees. Workday signed a definitive agreement to acquire Pipedream on November 19, 2025, with the transaction originally expected to close in Workday's Q4 FY2026 (by end of January 2026), subject to closing conditions. That expected close date has since passed, and as of this writing neither Workday nor Pipedream has publicly announced that the deal has closed.", - shortValue: 'Founded 2019; agreed to be acquired by Workday, close unconfirmed', + "Pipedream was founded in 2019 and is headquartered in San Francisco, CA (company-data aggregators put the founding team at 8 people, including Tod Sacerdoti, Dylan Sather, and TJ Koblentz), with a current headcount signal of roughly 21-50 employees. Pipedream's own blog confirms it closed a $20M Series A round led by True Ventures, with CRV, Felicis Ventures, and World Innovation Lab participating. Workday signed a definitive agreement to acquire Pipedream on November 19, 2025; per Workday's own newsroom release, the transaction is expected to close in Workday's fiscal Q4 2026 (ending January 31, 2026), subject to closing conditions. Crunchbase (previously cited for a 'deal closed' date) returned 403 and could not be independently verified, so this claim no longer asserts the acquisition has closed.", + shortValue: 'Founded 2019; Workday acquisition pending, expected to close by Jan 2026', confidence: 'estimated', sources: [ { url: 'https://newsroom.workday.com/2025-11-19-Workday-Signs-Definitive-Agreement-to-Acquire-Pipedream', label: 'Workday Newsroom – Workday Signs Definitive Agreement to Acquire Pipedream', - asOf: '2026-07-06', + asOf: '2026-07-08', }, { url: 'https://pipedream.com/blog/pipedream-to-be-acquired-by-workday/', label: 'Pipedream Blog – Pipedream to be acquired by Workday', - asOf: '2026-07-06', + asOf: '2026-07-08', }, { - url: 'https://www.crunchbase.com/organization/pipedream', - label: 'Crunchbase – Pipedream company profile', - asOf: '2026-07-02', + url: 'https://pipedream.com/blog/series-a-financing/', + label: 'Pipedream Blog – Pipedream Closes $20M Series A Financing', + asOf: '2026-07-08', + }, + { + url: 'https://prospeo.io/c/pipedream', + label: 'Prospeo – Pipedream company profile', + asOf: '2026-07-08', }, ], }, diff --git a/apps/sim/lib/compare/data/competitors/power-automate.ts b/apps/sim/lib/compare/data/competitors/power-automate.ts index 84016f60493..0d280672d7b 100644 --- a/apps/sim/lib/compare/data/competitors/power-automate.ts +++ b/apps/sim/lib/compare/data/competitors/power-automate.ts @@ -33,9 +33,9 @@ export const powerAutomateProfile: CompetitorProfile = { shortDescription: 'Flows promote dev to test to production via Dataverse Solutions and Pipelines.', source: { - url: 'https://learn.microsoft.com/en-us/power-automate/export-flow-solution', - label: 'Export a solution - Power Automate | Microsoft Learn', - asOf: '2026-07-02', + url: 'https://learn.microsoft.com/en-us/power-platform/alm/pipelines', + label: 'Overview of pipelines in Power Platform - Microsoft Learn', + asOf: '2026-07-08', }, }, { @@ -62,15 +62,14 @@ export const powerAutomateProfile: CompetitorProfile = { }, }, { - title: 'Built-in per-run analytics dashboard and proactive failure alerting', + title: 'Built-in per-run analytics dashboard for cloud flows', description: - 'Each flow has an Analytics dashboard (run counts, success/failure rate, average execution time, 30-day rolling history) plus automatic per-run failure alert emails and a weekly failure digest, without needing a third-party observability tool.', - shortDescription: - 'Native run analytics and automatic failure alert emails, no third-party tool needed.', + 'The Power Platform admin center ships a native Power Automate Analytics dashboard with Runs, Usage, Created, Errors, Shared, and Connectors reports for cloud flows, without needing a third-party observability tool.', + shortDescription: 'Native run analytics dashboard, no third-party tool needed.', source: { - url: 'https://learn.microsoft.com/en-us/power-automate/understand-flow-failure-notifications', - label: 'Understand flow failure notifications - Power Automate | Microsoft Learn', - asOf: '2026-07-02', + url: 'https://learn.microsoft.com/en-us/power-platform/admin/analytics-flow', + label: 'View analytics for Power Automate cloud flows - Power Platform | Microsoft Learn', + asOf: '2026-07-08', }, }, ], @@ -182,31 +181,41 @@ export const powerAutomateProfile: CompetitorProfile = { }, deploymentOptions: { value: - 'Commercial multi-tenant cloud; Office 365 GCC, GCC High, and DoD sovereign/government cloud environments; on-prem gateway and desktop-flow runtime for local systems', + 'Commercial multi-tenant cloud; Office 365 GCC, GCC High, and DoD sovereign/government cloud environments; an on-premises data gateway for connecting cloud flows to on-prem systems (e.g., on-prem SQL Server, file shares); and a local desktop-flow runtime (Power Automate for desktop) for automating tasks on individual Windows workstations', detail: - "Microsoft's SOC 2 compliance documentation lists Commercial/GCC/GCC High/DoD as in-scope environments for Power Apps/Power Automate.", - shortValue: 'Commercial cloud plus GCC/GCC High/DoD government clouds', + "Microsoft's Power Automate US Government service description confirms separate Commercial, GCC, GCC High, and DoD deployment environments; the on-premises data gateway is a locally installed Windows service that relays cloud flow connections to on-prem resources without opening inbound ports; desktop flows run via a locally installed Power Automate for desktop application on the user's machine.", + shortValue: 'Commercial cloud, GCC/GCC High/DoD, on-prem gateway, desktop-flow runtime', confidence: 'verified', sources: [ { - url: 'https://learn.microsoft.com/en-us/compliance/regulatory/offering-soc-2', - label: 'SOC 2 Type 2 - Microsoft Compliance | Microsoft Learn', - asOf: '2026-07-02', + url: 'https://learn.microsoft.com/en-us/power-automate/us-govt', + label: 'Power Automate US Government - Power Automate | Microsoft Learn', + asOf: '2026-07-08', + }, + { + url: 'https://learn.microsoft.com/en-us/power-platform/admin/wp-onpremises-gateway', + label: 'About on-premises gateways - Power Platform | Microsoft Learn', + asOf: '2026-07-08', + }, + { + url: 'https://learn.microsoft.com/en-us/power-automate/desktop-flows/introduction', + label: 'Introduction to desktop flows - Power Automate | Microsoft Learn', + asOf: '2026-07-08', }, ], }, templates: { value: - 'Large built-in template gallery for common connector-to-connector automations (approvals, notifications, file sync) accessible from the flow creation screen', + 'Built-in template gallery for common connector-to-connector automations, searchable or browsable by category from the Templates navigation pane when creating a flow', detail: - 'Templates surface directly on the flow creation screen for common automation patterns.', - shortValue: 'Large built-in template gallery', - confidence: 'estimated', + "Users can search all templates or browse by category to find a matching scenario, then create a cloud flow directly from the template's predefined triggers and actions.", + shortValue: 'Built-in template gallery, searchable or browsable by category', + confidence: 'verified', sources: [ { - url: 'https://www.microsoft.com/en-us/power-platform/products/power-automate', - label: 'Power Automate product page', - asOf: '2026-07-02', + url: 'https://learn.microsoft.com/en-us/power-automate/get-started-logic-template', + label: 'Get started from a template - Power Automate | Microsoft Learn', + asOf: '2026-07-08', }, ], }, @@ -359,6 +368,27 @@ export const powerAutomateProfile: CompetitorProfile = { }, ], }, + customBlocks: { + value: + 'No: Power Automate has no feature to publish a deployed flow as a named, iconed, encapsulated block that shows up in the action picker for the whole tenant/organization. The closest mechanisms are child flows ("Run a Child Flow"), which are scoped to makers with access to the same Dataverse solution, and manually wrapping a flow behind a Custom Connector, which requires hand-authoring an OpenAPI/Swagger definition instead of auto-deriving inputs from the flow.', + detail: + 'Child-flow docs state a maker only sees "the flows only to which you have access and are located in a solution," so reuse is scoped to that solution\'s makers, not the whole org, and a caller can still open the child flow and see its steps and connections, no encapsulation. A Custom Connector can wrap any REST API (including a flow\'s own HTTP-triggered URL) so it appears as a reusable action, but the maker must hand-author or import an OpenAPI/Swagger definition describing its request/response shape, and the connector can be shared within the organization once created; it is the same generic API-wrapping mechanic Power Automate uses for any third-party API, not a one-click "publish this flow as a block" feature with live input derivation, hand-picked outputs, or automatic latest-deployed-version tracking.', + shortValue: + 'No: closest is solution-scoped child flows or manually wrapped custom connectors', + confidence: 'verified', + sources: [ + { + url: 'https://learn.microsoft.com/en-us/power-automate/create-child-flows', + label: 'Create child flows - Power Automate | Microsoft Learn', + asOf: '2026-07-08', + }, + { + url: 'https://learn.microsoft.com/en-us/connectors/custom-connectors/define-openapi-definition', + label: 'Create a custom connector from an OpenAPI definition - Microsoft Learn', + asOf: '2026-07-08', + }, + ], + }, }, aiCapabilities: { multiLlmSupport: { @@ -385,10 +415,16 @@ export const powerAutomateProfile: CompetitorProfile = { confidence: 'estimated', sources: [ { - url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/agent-extend-action-mcp', + url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance/generative-orchestration', label: - 'Extend your agent with Model Context Protocol - Microsoft Copilot Studio | Microsoft Learn', - asOf: '2026-07-02', + 'Apply generative orchestration capabilities - Microsoft Copilot Studio | Microsoft Learn', + asOf: '2026-07-08', + }, + { + url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/guidance/multi-agent-patterns', + label: + 'Multi-agent orchestration patterns and best practices - Microsoft Copilot Studio | Microsoft Learn', + asOf: '2026-07-08', }, ], }, @@ -408,21 +444,21 @@ export const powerAutomateProfile: CompetitorProfile = { }, knowledgeBaseRag: { value: - 'Yes: agents can be grounded via Retrieval-Augmented Generation over Dataverse tables, SharePoint/Office files, and connectors to systems like Salesforce/ServiceNow, using a semantic index with vector embeddings', + 'Yes: agents can be grounded via Retrieval-Augmented Generation over Dataverse tables and connectors to systems like Salesforce, Oracle, SAP, and Zendesk (Power Automate prompts only), using a semantic search index', detail: 'Dataverse is positioned as the agent data platform: the same semantic search index powering Power Apps global search provides retrieval/grounding for Copilot, agents, and MCP tools.', - shortValue: 'RAG grounding over Dataverse, SharePoint, connectors', + shortValue: 'RAG grounding over Dataverse and select connector tables', confidence: 'verified', sources: [ { url: 'https://www.microsoft.com/en-us/power-platform/blog/2026/05/05/dataverse-agent-data-platform/', label: 'Dataverse Is Your Agent Data Platform - Microsoft Power Platform Blog', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://learn.microsoft.com/en-us/ai-builder/use-your-own-prompt-data', label: 'Add knowledge to your prompt - Microsoft Copilot Studio | Microsoft Learn', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -478,7 +514,7 @@ export const powerAutomateProfile: CompetitorProfile = { }, generativeMedia: { value: - 'Partial: AI Builder ships an image-description (captioning) model and GPT-based text generation/summarization prompts, but no dedicated native image-generation, video-generation, or text-to-speech/speech-to-text block exists in its catalog', + "Partial: AI Builder ships an image-description (captioning) model and GPT-based text generation/summarization via the current prompt builder ('Create text using a prompt'/'Run a prompt'), but no dedicated native image-generation, video-generation, or text-to-speech/speech-to-text block exists in its catalog", detail: 'Generating images or audio requires calling an external connector, such as Azure OpenAI DALL-E or Azure AI Speech, rather than a first-party AI Builder generative-media model.', shortValue: 'Captioning and text gen only, no native image/audio generation', @@ -490,9 +526,9 @@ export const powerAutomateProfile: CompetitorProfile = { asOf: '2026-07-02', }, { - url: 'https://learn.microsoft.com/en-us/ai-builder/azure-openai-model-pauto', - label: 'Use the text generation model in Power Automate - Microsoft Learn', - asOf: '2026-07-02', + url: 'https://learn.microsoft.com/en-us/ai-builder/use-a-custom-prompt-in-flow', + label: 'Use your prompt in Power Automate - Microsoft Learn', + asOf: '2026-07-08', }, ], }, @@ -579,10 +615,10 @@ export const powerAutomateProfile: CompetitorProfile = { }, parallelExecution: { value: - "Yes: a flow can add a dedicated 'Parallel branch' from any step, so multiple branches of actions execute concurrently rather than sequentially, and the flow only continues once all parallel branches complete. Power Automate supports up to 50 total branches (main path plus up to 49 parallel branches) in a single flow.", + "Yes: a flow can add a dedicated 'Parallel branch' from any step, so multiple branches of actions execute concurrently rather than sequentially, and the flow only continues once all parallel branches complete.", detail: - "Added via the '+' icon between steps, then 'Add a parallel branch'; this is a native canvas feature, not a workaround using separate flows or a sequential loop.", - shortValue: 'Yes, native parallel branch (up to 50 concurrent branches)', + "Added via the '+' icon between steps, then 'Add a parallel branch'; this is a native canvas feature, not a workaround using separate flows or a sequential loop. Microsoft's guidance doesn't publish a specific numeric limit on the number of parallel branches in a flow (a separate, unrelated setting lets a maker set 'Apply to each' loop concurrency from 1 to 50).", + shortValue: 'Yes, native parallel branch functionality', confidence: 'verified', sources: [ { @@ -600,23 +636,17 @@ export const powerAutomateProfile: CompetitorProfile = { }, a2aProtocol: { value: - "No native support: Power Automate/Copilot Studio do not ship a first-party Agent2Agent (A2A) implementation. A third-party custom connector (built on the standard Custom Connector framework) can wrap an external A2A v1.0 agent's JSON-RPC or HTTP+JSON endpoints, and Microsoft has stated A2A is 'coming soon' to Azure AI Foundry and Copilot Studio as of mid-2026, but no built-in Agent Card discovery or native A2A peer-to-peer calling feature ships today.", + 'Yes, native support: Copilot Studio agents can connect to an external agent that implements the open Agent2Agent (A2A) protocol, letting the Copilot Studio agent delegate a task to the remote A2A agent and receive back a structured response (including full chat-history metadata for context continuity), rather than only calling it as a plain HTTP API.', detail: - 'The available A2A connectors, such as the community-built Agent2Agent/Power A2A Template connectors for Work IQ, are custom connectors that translate Power Platform requests into A2A protocol calls; they are not a native, first-party A2A feature in the Power Automate or Copilot Studio product surface.', - shortValue: - 'No native A2A; only third-party custom connectors, native support "coming soon"', - confidence: 'estimated', + "Configured from the agent's Agents page via 'Add an agent' > 'Connect to an external agent' > 'Agent2Agent', pointing at the remote agent's endpoint URL (with None, API key, or OAuth 2.0 authentication); Copilot Studio auto-populates the agent's name/description from its `.well-known` agent card when available.", + shortValue: 'Yes, native A2A protocol support for task delegation', + confidence: 'verified', sources: [ { - url: 'https://troystaylor.com/power%20platform/custom%20connectors/2026-05-05-agent-to-agent-a2a-connector-work-iq.html', - label: 'Agent-to-Agent (A2A) connector for Copilot Studio and Power Automate', - asOf: '2026-07-02', - }, - { - url: 'https://www.powercommunity.com/empowering-multi-agent-apps-with-the-open-agent2agent-a2a-protocol/', + url: 'https://learn.microsoft.com/en-us/microsoft-copilot-studio/add-agent-agent-to-agent', label: - 'Empowering multi-agent apps with the open Agent2Agent (A2A) protocol - Power Community', - asOf: '2026-07-02', + 'Connect to an agent over the Agent2Agent (A2A) protocol - Microsoft Copilot Studio | Microsoft Learn', + asOf: '2026-07-08', }, ], }, @@ -669,16 +699,33 @@ export const powerAutomateProfile: CompetitorProfile = { }, triggerTypes: { value: - 'Connector-event triggers (e.g., new email, new SharePoint item), scheduled/recurrence triggers, manual/button triggers (incl. Mobile), HTTP request/webhook triggers, Dataverse record-change triggers, and desktop-flow/UI-automation triggers', + "Connector-event triggers (e.g., new email, new SharePoint item), scheduled/recurrence triggers, manual/instant triggers (incl. mobile), the 'When an HTTP request is received' webhook trigger, and Dataverse 'row added, modified, or deleted' triggers. Desktop flows (RPA) are launched from a cloud flow via the 'Run a flow built with Power Automate for desktop' action, in attended or unattended mode, rather than having their own independent trigger type.", detail: - 'Trigger types span connector events, schedules, manual buttons, HTTP webhooks, Dataverse record changes, and desktop UI-automation events.', - shortValue: 'Connector, schedule, manual, webhook, Dataverse, desktop triggers', - confidence: 'estimated', + 'Trigger types span connector events, schedules, manual buttons, HTTP request/webhook endpoints, and Dataverse record changes; desktop-flow automation is invoked as a cloud-flow action, not a standalone trigger category.', + shortValue: 'Connector, schedule, manual, HTTP/webhook, and Dataverse triggers', + confidence: 'verified', sources: [ { - url: 'https://www.microsoft.com/en-us/power-platform/products/power-automate', - label: 'Power Automate product page', - asOf: '2026-07-02', + url: 'https://learn.microsoft.com/en-us/power-automate/triggers-introduction', + label: 'Triggers - Power Automate | Microsoft Learn', + asOf: '2026-07-08', + }, + { + url: 'https://learn.microsoft.com/en-us/power-automate/oauth-authentication', + label: + 'Add OAuth authentication for HTTP request triggers - Power Automate | Microsoft Learn', + asOf: '2026-07-08', + }, + { + url: 'https://learn.microsoft.com/en-us/power-automate/dataverse/create-update-delete-trigger', + label: + 'Trigger flows when a row is added, modified, or deleted - Power Automate | Microsoft Learn', + asOf: '2026-07-08', + }, + { + url: 'https://learn.microsoft.com/en-us/power-automate/desktop-flows/trigger-desktop-flows', + label: 'Trigger desktop flows from cloud flows - Power Automate | Microsoft Learn', + asOf: '2026-07-08', }, ], }, @@ -711,9 +758,15 @@ export const powerAutomateProfile: CompetitorProfile = { confidence: 'estimated', sources: [ { - url: 'https://www.microsoft.com/en-us/power-platform/products/power-automate', - label: 'Power Automate product page', - asOf: '2026-07-02', + url: 'https://learn.microsoft.com/en-us/power-automate/oauth-authentication', + label: + 'Add OAuth authentication for HTTP request triggers - Power Automate | Microsoft Learn', + asOf: '2026-07-08', + }, + { + url: 'https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/overview', + label: 'Use the Microsoft Dataverse Web API (Dataverse) - Power Apps | Microsoft Learn', + asOf: '2026-07-08', }, ], }, @@ -937,10 +990,10 @@ export const powerAutomateProfile: CompetitorProfile = { asOf: '2026-07-02', }, { - url: 'https://powerusers.microsoft.com/t5/Building-Power-Apps/Can-we-Rebrand-Power-APP-mobile-app-for-our-own-company-or/td-p/690023', + url: 'https://community.powerplatform.com/forums/thread/details/?threadid=76b575a4-f741-46fc-84e0-8de11a6f7b78', label: 'Can we Rebrand Power APP mobile app for our own company - Power Platform Community', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -966,23 +1019,24 @@ export const powerAutomateProfile: CompetitorProfile = { }, piiRedaction: { value: - "Yes, but as a block rather than a redaction: Microsoft Purview Data Loss Prevention (DLP) for Microsoft 365 Copilot (GA per Ignite 2025) scans Copilot prompts for sensitive content like SSNs and credit card numbers and blocks processing when it finds them. This protection extends to agents built in Copilot Studio, the Power Platform's agent surface. It stops sensitive content from being processed rather than redacting it in-line, and is not a feature built into Power Automate flows themselves.", + 'Yes, but as a block rather than a redaction: Microsoft Purview DLP for Microsoft 365 Copilot can block files/emails with sensitivity labels from being processed (generally available) and, in preview, can block prompts containing sensitive information types like SSNs and credit card numbers. It stops sensitive content from being processed rather than redacting it in-line, and is not a feature built into Power Automate flows themselves.', detail: - 'This is Microsoft Purview functionality (a separate, integrated compliance product) covering Microsoft 365 Copilot and Copilot Studio agents; it blocks processing rather than performing in-line redaction, and is not a native Power Automate flow-content feature.', - shortValue: 'Purview DLP blocks/detects PII in Copilot prompts (incl. Studio agents)', + 'This is Microsoft Purview functionality (a separate, integrated compliance product). Blocking prompts with sensitive information types is still a preview capability, not GA; DLP protection for agents built in Copilot Studio is currently limited to sensitivity-label-based restriction when the knowledge source is SharePoint, not general SIT-based prompt blocking, and none of this is a native Power Automate flow-content feature.', + shortValue: + 'Purview DLP blocks sensitivity-labeled content (GA); SIT prompt block (preview)', confidence: 'estimated', sources: [ { url: 'https://learn.microsoft.com/en-us/purview/dlp-microsoft365-copilot-location-learn-about', label: 'Microsoft Purview DLP for Microsoft 365 Copilot and Copilot Chat | Microsoft Learn', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://learn.microsoft.com/en-us/purview/ai-copilot-studio', label: 'Use Microsoft Purview to manage data security & compliance for Microsoft Copilot Studio | Microsoft Learn', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -1053,21 +1107,22 @@ export const powerAutomateProfile: CompetitorProfile = { }, durabilityModel: { value: - "Yes: configurable retry policies with exponential backoff on individual actions, and flow run history (including a Dataverse-backed FlowRun table option) that lets a user review a past run's inputs/outputs; resubmission/resubmit-from-history is a documented pattern for reprocessing a failed run", + "Yes: configurable retry policies with exponential backoff on individual actions, flow run history that lets a user review a past run's inputs/outputs, and a documented Resubmit action from the Run history page that reprocesses a past run with its original inputs after an issue (e.g., a connection or parameter) has been fixed", detail: - "Retry policies are set per-action with configurable interval/count and exponential backoff; run history in Dataverse's FlowRun table records start/end time, duration, status, and error detail for large-scale tracking.", - shortValue: 'Per-action retries with backoff plus resubmit-from-history', + "Retry policies are set per-action with configurable interval/count and exponential backoff. Resubmit is available from the flow's Run history page (individually or in bulk, up to 20 runs at a time); flows initiated by instant/manual triggers can always be resubmitted by their owner, and admins can extend resubmission to other users via a tenant setting.", + shortValue: 'Per-action retries with backoff, plus resubmit from run history', confidence: 'verified', sources: [ { - url: 'https://www.citrincooperman.com/In-Focus-Resource-Center/How-to-Automatically-Retry-a-Flow-in-Power-Automate', - label: 'Power Automate Flow: How to Automatically Retry When Flows Fail', - asOf: '2026-07-02', + url: 'https://learn.microsoft.com/en-us/power-automate/guidance/coding-guidelines/error-handling', + label: 'Employ robust error handling - Power Automate | Microsoft Learn', + asOf: '2026-07-08', }, { - url: 'https://learn.microsoft.com/en-us/power-automate/guidance/coding-guidelines/monitoring-and-alerting', - label: 'Monitor your flows - Power Automate | Microsoft Learn', - asOf: '2026-07-02', + url: 'https://learn.microsoft.com/en-us/power-automate/how-tos-bulk-resubmit', + label: + 'Cancel or resubmit flow runs in bulk in Power Automate - Power Automate | Microsoft Learn', + asOf: '2026-07-08', }, ], }, @@ -1187,16 +1242,23 @@ export const powerAutomateProfile: CompetitorProfile = { support: { supportChannels: { value: - 'Documentation via Microsoft Learn, the large Power Users community forum, and paid Microsoft support plans. Enterprise customers typically get support through their Microsoft account or Unified Support contract.', + 'Documentation via Microsoft Learn, the Power Platform Community forums, and paid Microsoft support plans (Professional Direct and Microsoft Unified Support) with severity-based initial response times, available on top of self-help resources in the Power Platform admin center.', detail: - "Drawn from Microsoft's broader support ecosystem and the active Power Platform community forum, rather than a single Power Automate-specific support-tier page.", - shortValue: 'Docs, community forum, and paid Microsoft support plans', - confidence: 'estimated', + 'Technical break-fix support and billing/subscription support are available at all support levels; advisory, escalation, and account-management services require a Professional Direct or Unified Support plan. Initial response times range from under 1 hour (Severity A, critical business impact) to under 8 hours (Severity C, minimum impact) depending on plan tier.', + shortValue: 'Docs, community forums, and paid Professional Direct/Unified Support plans', + confidence: 'verified', sources: [ { - url: 'https://powerusers.microsoft.com/t5/Building-Flows/How-to-restore-a-previous-version-of-a-flow/td-p/288145', - label: 'Power Platform Community forum example thread', - asOf: '2026-07-02', + url: 'https://learn.microsoft.com/en-us/power-platform/admin/support-overview', + label: + 'Support for Microsoft Power Platform and Dynamics 365 apps - Power Platform | Microsoft Learn', + asOf: '2026-07-08', + }, + { + url: 'https://learn.microsoft.com/en-us/power-platform/admin/get-help-support', + label: + 'Get support in the Power Platform admin center - Power Platform | Microsoft Learn', + asOf: '2026-07-08', }, ], }, @@ -1211,16 +1273,16 @@ export const powerAutomateProfile: CompetitorProfile = { }, community: { value: - 'Large. Active official Power Platform/Power Users community forums with structured Q&A on building, approvals, and troubleshooting flows', + 'Active, Microsoft-hosted Power Platform Community forums for Power Automate, organized into structured category boards (Building flows, Using flows, Using connectors, Power Automate Desktop, AI Builder, Power Automate Mobile App, General topics) with ongoing Q&A threads', detail: - 'Multiple community threads on powerusers.microsoft.com cover real production troubleshooting scenarios, such as restoring flow versions, showing an active, Microsoft-hosted community forum.', - shortValue: 'Large, active Power Platform community forum', + 'The Power Automate forum area on community.powerplatform.com is split into dedicated boards for building flows, using connectors, using flows, desktop automation, and AI Builder, with active threads receiving dozens of replies.', + shortValue: 'Active Power Platform community forum with structured category boards', confidence: 'verified', sources: [ { - url: 'https://powerusers.microsoft.com/t5/Building-Flows/How-to-restore-a-previous-version-of-a-flow/td-p/288145', - label: 'Power Platform Community - How to restore a previous version of a flow', - asOf: '2026-07-02', + url: 'https://community.powerplatform.com/forums/thread/?groupid=46ce02a3-e1a7-4176-81fc-d93a4001d287', + label: 'Power Automate forums - Microsoft Power Platform Community', + asOf: '2026-07-08', }, ], }, diff --git a/apps/sim/lib/compare/data/competitors/retool.ts b/apps/sim/lib/compare/data/competitors/retool.ts index e9f6b208d36..c64c5a8e7c5 100644 --- a/apps/sim/lib/compare/data/competitors/retool.ts +++ b/apps/sim/lib/compare/data/competitors/retool.ts @@ -27,13 +27,13 @@ export const retoolProfile: CompetitorProfile = { { title: 'Full internal business applications, not just agent workflows', description: - "Retool builds custom internal UI screens, forms, admin panels, and dashboards backed by Retool Database, a genuine Postgres database with real SQL joins and foreign keys, not a spreadsheet-like grid, plus a mature React app runtime. AppGen lets users describe an app in plain English and Retool generates pages, queries, components, data bindings, and event handlers already wired to production data and inheriting the org's existing SSO/RBAC/audit policies.", + "Retool builds full internal business applications, not just agent workflows: apps are now written in React on the frontend and TypeScript on the backend, giving teams a real app runtime instead of a proprietary component tree. AppGen lets users describe an app in plain English; Retool's agent generates the UI, data queries, and bindings from that prompt, wired to production data, with every generated app automatically inheriting the org's existing centralized authentication, role-based access controls, and data-access policies rather than having auth logic baked into the app code.", shortDescription: - 'Builds full internal apps on a real relational database, not just agent workflows.', + 'Builds full internal apps on a real React/TypeScript runtime, not just agent workflows.', source: { - url: 'https://retool.com/ai-app-generation', - label: 'Retool AI App Generation', - asOf: '2026-07-02', + url: 'https://retool.com/blog/retool-launches-react-ai-app-builder', + label: 'Retool launches a full-stack React AI app builder', + asOf: '2026-07-08', }, }, { @@ -79,9 +79,9 @@ export const retoolProfile: CompetitorProfile = { 'Retool is proprietary and closed-source. The self-hosted deployment can be forked and customized and bundles open-source dependencies, but still requires a Retool-issued license key to run. No OSS license covers the product itself.', shortDescription: 'Closed-source product; self-hosted still requires a Retool license key.', source: { - url: 'https://docs.retool.com/legal/open-source-license-disclosure', - label: 'Open Source License Disclosure | Retool Docs', - asOf: '2026-07-02', + url: 'https://docs.retool.com/self-hosted/tutorials/docker', + label: 'Deploy Self-hosted Retool with Docker | Retool Docs', + asOf: '2026-07-08', }, }, { @@ -277,13 +277,28 @@ export const retoolProfile: CompetitorProfile = { }, dataTables: { value: - "Yes: Retool Database is a real, built-in Postgres-backed database (not a spreadsheet-like store), so tables can be queried with actual SQL and joined against other Resources, in addition to a spreadsheet-style Edit Table view for inline editing. Retool's Table UI component separately renders and scrolls through 100,000+ rows and hundreds of columns without slowing down.", + "Yes: Retool Database is a real, built-in Postgres-backed database (not a spreadsheet-like store). Tables support foreign-key fields that link rows between tables, and any query can be written in raw SQL (Retool's SQL mode supports arbitrary SELECT/UPDATE/DELETE and other statements, including joins), in addition to a spreadsheet-style Edit Table view for inline editing. Retool's Table UI component separately renders and scrolls through 100,000+ rows and hundreds of columns without slowing down.", detail: - "Because it's genuine Postgres under the hood, Retool Database supports relational features (foreign keys, SQL joins/queries) that a typed-column grid like Sim's Tables does not expose; Retool does not publish hard row/column caps for Retool Database itself (forum threads mention plan-dependent limits like 50,000 records, unconfirmed as current). The Table UI component is documented to handle 100K+ rows.", + "Because it's genuine Postgres under the hood, Retool Database supports foreign-key relationships (with configurable on-delete/on-update behavior) and hand-written SQL queries that a typed-column grid like Sim's Tables does not expose; Retool does not publish hard row/column caps for Retool Database itself (forum threads mention plan-dependent limits like 50,000 records, unconfirmed as current). The Table UI component is documented to handle 100K+ rows.", shortValue: - 'Yes, real Postgres database (SQL-queryable), plus a large-dataset Table component', + 'Yes, real Postgres database (foreign keys, SQL-queryable), plus a large-dataset Table component', confidence: 'verified', sources: [ + { + url: 'https://retool.com/products/database', + label: 'Retool Database | Power apps with a built-in Postgres database', + asOf: '2026-07-08', + }, + { + url: 'https://docs.retool.com/data-sources/guides/retool-database/link-tables', + label: 'Link Retool Database tables (foreign keys) | Retool Docs', + asOf: '2026-07-08', + }, + { + url: 'https://docs.retool.com/queries/guides/sql/writes', + label: 'Write data to SQL databases | Retool Docs', + asOf: '2026-07-08', + }, { url: 'https://retool.com/blog/supercharging-the-retool-table', label: 'Supercharging the Retool table', @@ -341,6 +356,26 @@ export const retoolProfile: CompetitorProfile = { }, ], }, + customBlocks: { + value: + 'No: Retool has no way to publish a deployed workflow as a named, encapsulated block that shows up in a shared block library for other builders to drop into their own workflows. The closest primitive is the generic Workflow block (see subWorkflows), which requires manually selecting which saved workflow to call each time it is added, rather than appearing as its own distinct, iconed, org-wide toolbar entry. A public forum feature request asking for exactly this ("Workflow Block Library," save a block once and reuse it across workflows) is still open, with a Retool team member confirming only an internal, unshipped feature request exists for it.', + detail: + "The Workflow block abstracts away the called workflow's internal steps, but it is one generic block type, not a per-source-workflow custom block, and Retool's docs do not document automatic org-wide distribution or live-sync-to-latest-deploy behavior the way a dedicated published-block feature would.", + shortValue: 'No, only a generic workflow-calling block; no published block library', + confidence: 'verified', + sources: [ + { + url: 'https://community.retool.com/t/workflow-block-library/45360', + label: 'Workflow Block Library (Feature Request) - Retool Forum', + asOf: '2026-07-08', + }, + { + url: 'https://docs.retool.com/workflows/guides/blocks/run-workflow', + label: 'Run another workflow with the Workflow block | Retool Docs', + asOf: '2026-07-08', + }, + ], + }, }, aiCapabilities: { multiLlmSupport: { @@ -379,14 +414,14 @@ export const retoolProfile: CompetitorProfile = { }, knowledgeBaseRag: { value: - "Yes: Retool Vectors is a Retool-managed vector database that stores and indexes text, PDF, or web-page content, so AI apps and agents can retrieve relevant context in one click. Embedding calls always go through OpenAI's API (default model text-embedding-ada-002), regardless of which chat model is used.", + "Yes: Retool Vectors is a Retool-managed vector database that stores and indexes text, PDF, or web-page content, so AI apps and agents can retrieve relevant context in one click. Embedding calls go through OpenAI's API (default model text-embedding-ada-002).", shortValue: 'Managed vector store with built-in embeddings', confidence: 'verified', sources: [ { - url: 'https://retool.com/integrations/retool-vector', - label: 'Retool Vectors integration page', - asOf: '2026-07-02', + url: 'https://docs.retool.com/data-sources/tutorials/retool-vectors', + label: 'Retool-managed Vectors tutorial | Retool Docs', + asOf: '2026-07-08', }, { url: 'https://docs.retool.com/data-sources/guides/vectors/embeddings', @@ -445,14 +480,14 @@ export const retoolProfile: CompetitorProfile = { value: 'Native image generation only. No native video generation, text-to-speech, or speech-to-text block.', detail: - 'Retool\'s AI query block includes a native "Generate image" action (model options such as dall-e-2/gpt-image-1 via OpenAI) that returns a base64-encoded PNG. There is no native video-generation, text-to-speech, or speech-to-text block; users build these via third-party APIs.', + 'Retool\'s AI query block includes a native "Generate image" action (model options: GPT Image 1, GPT Image 1 Mini, and GPT Image 1.5, all via OpenAI) that returns a base64-encoded image. There is no native video-generation, text-to-speech, or speech-to-text block; users build these via third-party APIs.', shortValue: 'Image generation only, no video/TTS/STT', confidence: 'estimated', sources: [ { url: 'https://docs.retool.com/queries/guides/ai/image', label: 'Retool AI image actions (docs)', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://community.retool.com/t/speech-to-text-anybody/26774', @@ -882,10 +917,10 @@ export const retoolProfile: CompetitorProfile = { }, sso: { value: - 'Yes: Retool supports SAML 2.0 SSO (Business plan and above) compatible with Okta, Azure AD, Google Workspace, OneLogin and other SAML/OIDC providers, plus SCIM-based auto-provisioning (create/update/deactivate users automatically) available on Cloud or self-hosted 2.32.1+.', + 'Yes: Retool supports SAML 2.0 SSO and Custom SSO (Okta, Azure AD/Entra ID, Google Workspace, OneLogin, and other SAML/OIDC providers) — but only on the Enterprise plan, not Business. SCIM-based auto-provisioning is available on Cloud or self-hosted 2.32.1+.', detail: - "The Enterprise plan separately lists 'Custom SSO' as a feature, suggesting tiered SSO capability between Business and Enterprise.", - shortValue: 'Yes, SAML/OIDC SSO plus SCIM auto-provisioning', + "Retool's current pricing page places SAML/Custom SSO exclusively on the Enterprise tier; the Business plan's feature list does not include SSO/SAML.", + shortValue: 'Yes, Enterprise-only SSO plus SCIM auto-provisioning', confidence: 'verified', sources: [ { @@ -896,13 +931,13 @@ export const retoolProfile: CompetitorProfile = { { url: 'https://retool.com/pricing', label: 'Retool Pricing', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, thirdPartyVetting: { value: - "Yes: Retool's built-in integrations (Resources) are a first-party catalog of roughly 50 databases, APIs, and cloud services built and maintained by Retool, not an open marketplace of third-party-submitted connectors. Retool separately offers Custom Component Libraries, which let a customer's own developers pull in npm packages to build custom UI components, but these are private to the authoring organization by default (or explicitly made public by that org), not a shared registry where other Retool customers install code published by unrelated third parties.", + "Yes: Retool's built-in integrations (Resources) are a first-party catalog of roughly 90+ databases, APIs, AI services, and cloud tools built and maintained by Retool, not an open marketplace of third-party-submitted connectors. Custom Component Libraries let a customer's own developers pull in npm packages to build custom UI components, but these are private to the authoring organization by default, not a shared registry of code from unrelated third parties.", detail: "A custom component loads into a sandboxed iframe, and Retool's custom-component-guide plus a community forum thread ('Custom Component Vulnerabilities') flag that developers should run npm audit on dependencies pulled into their own component libraries. This is a supply-chain caution for self-authored code, not an incident involving a shared marketplace, since no public component marketplace exists.", shortValue: 'Yes, first-party integration catalog, no public component marketplace', @@ -911,7 +946,7 @@ export const retoolProfile: CompetitorProfile = { { url: 'https://retool.com/integrations', label: 'Retool Integrations', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://docs.retool.com/apps/guides/custom/custom-component-libraries/', @@ -999,26 +1034,27 @@ export const retoolProfile: CompetitorProfile = { }, asyncExecution: { value: - "Yes: Retool Workflows can run asynchronously in the background. Triggering a workflow (via the API startTrigger endpoint or a webhook) kicks off a run that continues executing after the initial request returns, and you can check back on it later using the Retool API's Get Workflow Run Details endpoint, which returns the run's status and result.", + "Yes: Retool workflows triggered via their webhook URL (the same api.retool.com/v1/workflows/{id}/startTrigger endpoint used for classic-app and API triggers) can run asynchronously. If the workflow has no Response block, it is enqueued for asynchronous execution and responds immediately; if it has a Response block, it responds synchronously up to that block and the rest of the run continues asynchronously afterward. Retool's own docs define a 30-hour timeout for 'asynchronous workflow runs' versus 15 minutes for 'synchronous workflow runs' (bound to the first Response block). Run status can optionally be checked via the Get Workflow Run Details endpoint, currently in private beta (Retool 3.122+, requires a 'Workflows > Read' API token scope, access by request).", detail: - "Retool explicitly distinguishes 'synchronous workflow runs' (blocks until a Response block executes, 15-minute timeout) from 'asynchronous workflow runs' (up to 30 hours) in its own docs, and provides a Get Workflow Run Details API to fetch a run's status/result after triggering.", - shortValue: 'Yes, async trigger + poll for run status', + 'The enqueue-and-respond-immediately behavior for Response-block-less runs is documented specifically for classic-app-triggered workflows, which fire through the same webhook/startTrigger mechanism as API-triggered ones. The Get Workflow Run Details API to fetch a run status/result after triggering is gated behind a private-beta signup, not generally available.', + shortValue: + 'Yes, async execution with Response-block gating; run-status API is private beta', confidence: 'verified', sources: [ { url: 'https://docs.retool.com/workflows/concepts/limits', label: 'Retool Docs: Workflow limits (sync vs async execution modes)', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://docs.retool.com/api/get-workflow-run-details', - label: 'Retool API Docs: Get Workflow Run Details', - asOf: '2026-07-02', + label: 'Retool API Docs: Get Workflow Run Details (private beta)', + asOf: '2026-07-08', }, { url: 'https://docs.retool.com/workflows/guides/webhooks', label: 'Retool Docs: Trigger workflows with webhooks', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -1076,39 +1112,48 @@ export const retoolProfile: CompetitorProfile = { support: { supportChannels: { value: - 'Community Discourse forum (free tier), email + chat (Team plan), dedicated/priority support (Business and Enterprise plans); a Slack group is available to invited "Power Users."', + "A 'Report a Breakage' form and billing/account email support (all customers, 2-business-day response), a Developer Forum and weekly office-hours Zoom calls with Community Engineers, and a Reddit community; a dedicated Enterprise Support Portal with response times per the Enterprise Support Policy is available for Enterprise customers.", detail: - 'Support channels scale with plan tier, from community forum access on the free tier up to dedicated support on Business and Enterprise.', - shortValue: 'Forum on free tier up to dedicated Enterprise support', + "No Team-tier email+chat or Business-tier dedicated support, and no Slack group for 'Power Users', is currently documented.", + shortValue: 'Breakage form/forum/office hours for all; dedicated portal on Enterprise', confidence: 'estimated', sources: [ { url: 'https://docs.retool.com/support/', label: 'Contact Retool support | Retool Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, sla: { value: - 'Yes: custom SLA available on the Enterprise plan, alongside dedicated support engineers/account management.', + "Enterprise plan includes Retool's Support Engineering team for technical support and access to a dedicated technical advisor for onboarding, training, and guidance.", detail: - 'Enterprise plans include dedicated support engineers, account management, and a custom SLA.', - shortValue: 'Custom SLA on Enterprise plan', + "The pricing page does not explicitly reference a named 'custom SLA' or 'account management' service.", + shortValue: 'Support Engineering + technical advisor on Enterprise', confidence: 'estimated', sources: [ - { url: 'https://retool.com/pricing', label: 'Retool Pricing', asOf: '2026-07-02' }, + { url: 'https://retool.com/pricing', label: 'Retool Pricing', asOf: '2026-07-08' }, ], }, community: { value: - 'Community Discourse forum with 1,000+ posts. No GitHub star count or Slack member count is publicly disclosed.', + 'Community Discourse forum with 190,000+ posts across 22,900+ topics and 17,000+ registered users. No GitHub star count or Slack member count is publicly disclosed.', detail: - 'Forum activity figures come from third-party reporting rather than a published Retool metrics page.', - shortValue: 'Active Discourse forum, no public star/member count', - confidence: 'estimated', + "Aggregate forum stats come from Retool's public Discourse instance stats endpoint rather than a published Retool metrics page.", + shortValue: 'Active Discourse forum (190K+ posts), no public star/member count', + confidence: 'verified', sources: [ - { url: 'https://retool.com/community', label: 'Retool Community', asOf: '2026-07-02' }, + { + url: 'https://community.retool.com/about.json', + label: 'Retool Forum stats (community.retool.com/about.json)', + asOf: '2026-07-08', + }, + { + url: 'https://community.retool.com/', + label: 'Retool Forum (community.retool.com)', + asOf: '2026-07-08', + }, ], }, companyMaturity: { @@ -1133,26 +1178,26 @@ export const retoolProfile: CompetitorProfile = { }, academy: { value: - 'Yes: Retool University (university.retool.com) is a structured education platform with course paths for developers, admins, and architects, including a Retool Platform Developer certification path with earnable digital badges, plus Labs walkthroughs and recorded Developer Day sessions.', + 'Yes: Retool University (university.retool.com) launched with five course paths (Fundamentals, Platform Developer, Platform Admin, Platform Architect, Platform Advanced Developer), with most courses awarding a digital badge on completion, and a live Retool Platform Developer badge is issued via Credly.', detail: - 'Launched with five course paths; Retool Platform Developer and Platform Admin courses award Credly digital badges. A third-party Coursera course also exists but the primary academy is Retool University.', + "Retool's education docs (docs.retool.com/education) have since been reframed around AI Apps, Workflows, and Agents rather than these named course paths, though the original five-path structure and Credly badges remain live via university.retool.com and the announcement blog post.", shortValue: 'Yes, Retool University with certification badges', confidence: 'verified', sources: [ { url: 'https://docs.retool.com/education/', label: 'Retool University docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://retool.com/blog/introducing-retool-university', label: 'Introducing Retool University', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://www.credly.com/org/retool-inc/badge/retool-platform-developer', label: 'Retool Platform Developer badge on Credly', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, diff --git a/apps/sim/lib/compare/data/competitors/stackai.ts b/apps/sim/lib/compare/data/competitors/stackai.ts index 7a4bf12253b..00a2b46fa57 100644 --- a/apps/sim/lib/compare/data/competitors/stackai.ts +++ b/apps/sim/lib/compare/data/competitors/stackai.ts @@ -65,12 +65,12 @@ export const stackaiProfile: CompetitorProfile = { { title: 'Not open source', description: - 'StackAI is a proprietary, closed-source commercial SaaS platform. Its GitHub organization contains only auxiliary tools and integrations, not the core platform, so there is no self-hostable OSS codebase to audit or fork.', + 'StackAI is a proprietary, closed-source commercial SaaS platform. Its GitHub organization (github.com/stackai) currently has no public repositories at all, so there is no self-hostable OSS codebase to audit or fork.', shortDescription: 'Closed-source SaaS with no auditable or forkable codebase.', source: { url: 'https://github.com/stackai', label: 'StackAI GitHub organization', - asOf: '2026-07-02', + asOf: '2026-07-08', }, }, { @@ -113,15 +113,24 @@ export const stackaiProfile: CompetitorProfile = { builderType: { value: 'Visual/low-code node-based workflow builder', detail: - 'Drag-and-drop canvas of nodes (LLM, tools, logic, multimodal) for building agents; also supports Python code nodes for custom logic.', - shortValue: 'Drag-and-drop nodes plus Python code nodes', + 'A 2D canvas where builders drag and drop nodes and connect them to build a workflow, drawing from Input, Output, Core (e.g. AI Agent, Knowledge Bases), Apps/integration, and Utils/Logic node categories; supports a Code Node for custom logic (the older Python Code node is now deprecated in favor of it).', + shortValue: 'Drag-and-drop node canvas plus Code Node', confidence: 'verified', sources: [ - { url: 'https://docs.stackai.com/', label: 'StackAI Docs Overview', asOf: '2026-07-02' }, { - url: 'https://docs.stackai.com/logic/python-code', - label: 'Python Code node - StackAI Docs', - asOf: '2026-07-02', + url: 'https://docs.stackai.com/welcome-to-stackai/overview/platform-overview', + label: 'Platform Overview - StackAI Docs', + asOf: '2026-07-08', + }, + { + url: 'https://docs.stackai.com/workflow-builder', + label: 'Workflow Builder node index - StackAI Docs', + asOf: '2026-07-08', + }, + { + url: 'https://docs.stackai.com/workflow-builder/utils-logic-and-others/logic/python-code', + label: 'Python Code node (deprecated) - StackAI Docs', + asOf: '2026-07-08', }, ], }, @@ -178,14 +187,14 @@ export const stackaiProfile: CompetitorProfile = { license: { value: 'Proprietary / closed source', detail: - 'Commercial SaaS platform; the GitHub org (github.com/stackai) contains only auxiliary repos, not the core platform.', + 'Commercial SaaS platform; the GitHub org (github.com/stackai) currently has no public repositories at all — the core platform is not open source.', shortValue: 'Closed-source commercial SaaS', confidence: 'verified', sources: [ { url: 'https://github.com/stackai', label: 'StackAI GitHub organization', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -241,9 +250,9 @@ export const stackaiProfile: CompetitorProfile = { asOf: '2026-07-02', }, { - url: 'https://docs.stackai.com/governance-and-security/workspace-and-folder-access', + url: 'https://docs.stackai.com/welcome-to-stackai/security-and-governance/security-in-stackai/workspace-and-folder-access', label: 'Workspace and Folder Access docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -284,6 +293,26 @@ export const stackaiProfile: CompetitorProfile = { }, ], }, + customBlocks: { + value: + 'No: StackAI has no feature for publishing a project as a named, iconed block that appears in a shared toolbar/library for every builder in the organization. The closest capability is the StackAI Project Node, which lets a builder reference another saved project by picking it from a dropdown inside their own workflow, and Subflow Tools, which do the same from an AI Agent node.', + detail: + "The Project Node docs describe manually matching the calling workflow's inputs to the target project's inputs (not an auto-derived input schema) and returning results as a single opaque JSON blob covering all of that project's outputs, reshaped afterward with the Output Node's Template feature, rather than the caller picking and naming individual outputs to expose. Neither the Project Node nor Subflow Tools docs describe the referenced project appearing as a distinct block in a shared, org-wide toolbar alongside built-in nodes, hiding its internal steps/credentials from the caller, or automatically tracking a separately published/deployed version of the source project.", + shortValue: 'No, only same-workspace Project Node / Subflow Tool references', + confidence: 'verified', + sources: [ + { + url: 'https://docs.stackai.com/workflow-builder/utils-logic-and-others/utils/stackai-project-node', + label: 'StackAI Project Node docs', + asOf: '2026-07-08', + }, + { + url: 'https://docs.stackai.com/workflow-builder/core-nodes/ai-agent-node/subflow-tools', + label: 'Subflow Tools docs', + asOf: '2026-07-08', + }, + ], + }, }, aiCapabilities: { multiLlmSupport: { @@ -365,26 +394,26 @@ export const stackaiProfile: CompetitorProfile = { { url: 'https://www.stackai.com/blog/introducing-stackai-human-in-the-loop-agentic-workflows-you-can-trust', label: 'Introducing StackAI Human-in-the-Loop - StackAI blog', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, generativeMedia: { value: 'Yes: image and audio generation nodes; no dedicated video generation node', detail: - 'A Text-to-Audio node uses ElevenLabs for TTS and voice cloning; an Image node generates images from text prompts using models such as OpenAI DALL·E 3 or Stable Diffusion.', + 'A Text-to-Audio node uses ElevenLabs voice-synthesis models (e.g. eleven_multilingual_v2) for TTS; an Image node generates images from text prompts using models such as OpenAI DALL·E 3 or Stable Diffusion.', shortValue: 'Image and audio nodes, no video', confidence: 'verified', sources: [ { url: 'https://docs.stackai.com/workflow-builder/outputs/image-node', label: 'Image Node - StackAI Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://docs.stackai.com/workflow-builder/outputs/audio-node', label: 'Audio Node - StackAI Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -409,9 +438,9 @@ export const stackaiProfile: CompetitorProfile = { confidence: 'estimated', sources: [ { - url: 'https://docs.stackai.com/other-views/prompt-library', + url: 'https://docs.stackai.com/agentic-adoption-and-security/scalability/prompt-library', label: 'Prompt Library docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -435,21 +464,21 @@ export const stackaiProfile: CompetitorProfile = { }, kbChunkVisibility: { value: - "Yes: StackAI's Knowledge Base nodes return retrieved chunks and let builders configure the chunking algorithm, chunk length, and chunk overlap. An output-format toggle switches between chunks, pages, and full documents, and a document preview view lets builders inspect indexed content.", + "Yes: StackAI's Knowledge Base node returns results as an array of document snippets/content chunks plus metadata (source, date, tags). Chunk-level indexing is configurable — chunking algorithm, chunk length, and chunk overlap — via the separate Files and Documents nodes used to index content.", detail: - 'Confirms chunk-level granularity is exposed (algorithm, length, overlap, chunk vs page vs doc output). A dedicated chunk-index debugging pane beyond the document preview is unconfirmed.', - shortValue: 'Yes, chunk-level config and output', + 'Knowledge Base node output is chunk-level (results array + metadata), but chunk-size controls live on the Files/Documents nodes used for indexing, not on the Knowledge Base node itself. No output-format toggle between chunks/pages/full documents and no dedicated document preview view is documented.', + shortValue: 'Yes, chunk-level results with metadata', confidence: 'verified', sources: [ { - url: 'https://docs.stackai.com/best-practices/chunking', + url: 'https://docs.stackai.com/getting-started/core-ai-concepts/chunking', label: 'Chunking docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://docs.stackai.com/workflow-builder/apps/knowledge-base', label: 'Knowledge Base docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -528,46 +557,52 @@ export const stackaiProfile: CompetitorProfile = { value: 'Scheduled/time-based triggers and outbound webhook calls (e.g., to Make); no native inbound webhook trigger node', detail: - 'Supports scheduled workflows (daily/weekly/monthly automation) and a Make node that can POST to trigger a Make.com scenario. Deployment surfaces include chat, forms, API, Slack, Teams, and batch run.', + 'Supports scheduled workflows (daily/weekly/monthly automation) and a Make node that can POST to trigger a Make.com scenario. Deployment surfaces (how a finished workflow is exposed, distinct from triggers) include Form, Chat Assistant, API, Website Chatbot, Batch Run, Slack App, and Microsoft Teams.', shortValue: 'Scheduled triggers, outbound webhooks only', confidence: 'estimated', sources: [ { url: 'https://www.stackai.com/insights/how-to-set-up-scheduled-ai-workflows-and-automated-reports-on-stackai', label: 'Scheduled AI Workflows - StackAI insights', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://docs.stackai.com/workflow-builder/apps/make', label: 'Make node - StackAI Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', + }, + { + url: 'https://docs.stackai.com/interface-and-deployment/end-user-interfaces', + label: 'End-User Interfaces - StackAI Docs', + asOf: '2026-07-08', }, ], }, customCodeSteps: { - value: 'Yes: Python code node', - detail: 'A dedicated Python Code node allows custom logic within workflows.', + value: 'Yes: Python code node (being migrated to a newer Code Node)', + detail: + "A Python Code node allows custom logic within workflows; StackAI's docs now note this node is deprecated in favor of a newer Code Node.", shortValue: 'Python code node', confidence: 'verified', sources: [ { - url: 'https://docs.stackai.com/logic/python-code', + url: 'https://docs.stackai.com/workflow-builder/utils-logic-and-others/logic/python-code', label: 'Python Code - StackAI Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, apiPublishing: { value: 'Yes: workflows publishable as a REST API with generated client snippets', detail: - 'Any flow can be exported and published as an API. Docs provide request snippets in Python, JavaScript, and cURL, with OAuth2-token authentication and a separate API reference.', + 'Any flow can be exported and published as an API. Docs provide request snippets in Python, JavaScript, and cURL, authenticated via a Bearer token using a public API key generated in Settings → API Keys.', shortValue: 'Publish workflows as REST APIs', confidence: 'verified', sources: [ { - url: 'https://docs.stackai.com/export-options/api', + url: 'https://docs.stackai.com/interface-and-deployment/end-user-interfaces/api', label: 'API - StackAI Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -580,27 +615,22 @@ export const stackaiProfile: CompetitorProfile = { confidence: 'estimated', sources: [ { - url: 'https://docs.stackai.com/export-options/api', + url: 'https://docs.stackai.com/interface-and-deployment/end-user-interfaces/api', label: 'API - StackAI Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, mcpPublishing: { value: - 'Yes: StackAI provides a hosted MCP server (mcp.stack.ai/mcp) and an open-source stack-ai-mcp server. Either lets external MCP-compatible clients, such as Claude Desktop, run a published StackAI workflow as a callable MCP tool, passing inputs in and getting structured results back.', - shortValue: 'Yes, publishes workflows as MCP servers', + 'Yes: StackAI provides a hosted MCP server (mcp.stack.ai/mcp) that lets external MCP-compatible clients, such as Claude Desktop, Claude Code, or Cursor, run a published StackAI workflow as a callable MCP tool, passing inputs in and getting structured results back.', + shortValue: 'Yes, publishes workflows as an MCP server', confidence: 'verified', sources: [ { - url: 'https://docs.stackai.com/workflow-builder/apps/mcp', - label: 'MCP node docs', - asOf: '2026-07-02', - }, - { - url: 'https://www.stackai.com/blog/how-to-use-the-stack-ai-mcp-server', - label: 'How to Use the Stack AI MCP Server', - asOf: '2026-07-02', + url: 'https://docs.stackai.com/interface-and-deployment/mcp-reference/stackai-mcp-server', + label: 'StackAI MCP Server docs', + asOf: '2026-07-08', }, ], }, @@ -673,21 +703,21 @@ export const stackaiProfile: CompetitorProfile = { }, auditLogging: { value: - 'Yes: automatic logs of every run, capturing input/output, token usage, and runtime, queryable through a pull-based Analytics API (filterable by run ID, status, user, and date range)', + 'Yes: automatic logs of every run, capturing input/output, token usage, and runtime, queryable through a pull-based Analytics API (filterable by status, user, and date range — no run ID filter parameter is documented)', detail: - 'The Analytics API is request/response only: a builder calls it to list flow runs or an org-level run summary. There is no documented continuous push/export of these logs to an external destination such as S3, BigQuery, Datadog, or a generic webhook sink, and no separate public audit-log API distinct from execution logs.', + 'The Analytics API is request/response only: a builder calls it to list flow runs or an org-level run summary, filtered by user_id, state (status), and date range. There is no documented continuous push/export of these logs to an external destination such as S3, BigQuery, Datadog, or a generic webhook sink, and no separate public audit-log API distinct from execution logs.', shortValue: 'Automatic per-run logs via a pull-based API, no export destination', confidence: 'estimated', sources: [ { url: 'https://docs.stackai.com/welcome-to-stackai/overview/platform-overview', label: 'StackAI Platform Overview docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://docs.stackai.com/interface-and-deployment/api-reference/analytics.md', label: 'StackAI API Reference: Analytics', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -721,9 +751,14 @@ export const stackaiProfile: CompetitorProfile = { confidence: 'verified', sources: [ { - url: 'https://docs.stackai.com/governance-and-security/workspace-and-folder-access', + url: 'https://docs.stackai.com/welcome-to-stackai/security-and-governance/security-in-stackai/workspace-and-folder-access', label: 'Workspace and Folder Access docs', - asOf: '2026-07-02', + asOf: '2026-07-08', + }, + { + url: 'https://docs.stackai.com/welcome-to-stackai/security-and-governance/security-in-stackai/connection-and-knowledge-base-permissions', + label: 'Connection and Knowledge Base Permissions docs', + asOf: '2026-07-08', }, ], }, @@ -750,47 +785,37 @@ export const stackaiProfile: CompetitorProfile = { asOf: '2026-07-02', }, { - url: 'https://docs.stackai.com/security-and-privacy', + url: 'https://docs.stackai.com/welcome-to-stackai/security-and-governance/security-and-privacy', label: 'Security & Privacy docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, piiRedaction: { value: - "Yes: StackAI's security page states that built-in mechanisms detect and mask personally identifiable information (PII) during processing. Its guardrails guidance also covers redacting PII in inputs, retrieval, and logs as part of enterprise agent design.", - shortValue: 'Yes, built-in PII detection/masking', - confidence: 'verified', + "Partial: StackAI's guardrails guidance recommends redacting personally identifiable information (PII) in inputs, retrieval, and logs as part of enterprise agent design, but StackAI's own security page does not itself assert a built-in PII detection/masking mechanism.", + shortValue: 'Guardrail guidance only, not a confirmed built-in feature', + confidence: 'estimated', sources: [ - { - url: 'https://www.stackai.com/security', - label: 'StackAI Security page', - asOf: '2026-07-02', - }, { url: 'https://www.stackai.com/insights/how-to-design-ai-agent-guardrails-best-practices-for-input-validation-output-filtering-and-safety-controls', label: 'AI Agent Guardrails guide', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, sso: { value: - 'Yes: StackAI supports Single Sign-On through a dedicated SSO settings page, integrating with identity providers like Okta and Entra ID to inherit groups and permissions. Newly provisioned SSO users get a default role, and admins can require SSO for all interfaces org-wide.', + 'Yes: StackAI supports Single Sign-On, integrating with identity providers like Okta and Entra ID to inherit groups and permissions. Newly provisioned SSO users get a default role, and admins can require SSO for all interfaces org-wide.', detail: - 'Docs confirm SSO login and default-role auto-provisioning behavior. SAML vs OIDC protocol details are not specified beyond the Okta/Entra ID integration.', + 'Docs confirm SSO login and default-role auto-provisioning behavior, enabled per interface or enforced org-wide via admin policy. SSO configuration is distributed across these governance controls rather than a single dedicated SSO settings page, and SAML vs OIDC protocol details are not specified beyond the Okta/Entra ID integration.', shortValue: 'Yes, SSO with Okta/Entra ID', - confidence: 'estimated', + confidence: 'verified', sources: [ { - url: 'https://www.stackai.com/sso', - label: 'StackAI SSO login page', - asOf: '2026-07-02', - }, - { - url: 'https://www.stackai.com/insights/sso-and-rbac-for-ai-agents-how-to-secure-enterprise-ai-deployments', - label: 'SSO and RBAC for AI Agents', - asOf: '2026-07-02', + url: 'https://docs.stackai.com/welcome-to-stackai/security-and-governance/ai-governance', + label: 'AI Governance - StackAI Docs', + asOf: '2026-07-08', }, ], }, @@ -934,12 +959,11 @@ export const stackaiProfile: CompetitorProfile = { }, support: { supportChannels: { - value: - 'Community Discord (free tier); dedicated solution engineers / forward-deployed engineers (Enterprise)', + value: 'Community Discord (free tier); dedicated solution engineers (Enterprise)', shortValue: 'Discord free, dedicated engineers on Enterprise', confidence: 'verified', sources: [ - { url: 'https://www.stackai.com/pricing', label: 'StackAI Pricing', asOf: '2026-07-02' }, + { url: 'https://www.stackai.com/pricing', label: 'StackAI Pricing', asOf: '2026-07-08' }, ], }, sla: { @@ -950,11 +974,11 @@ export const stackaiProfile: CompetitorProfile = { }, community: { value: - 'Discord community, comprehensive docs, and a StackAI Academy with tutorials and courses', + 'StackAI community support (Discord, at discord.gg/sSbwawtNsV, not linked from stackai.com/academy), comprehensive docs at docs.stackai.com, and a StackAI Academy with tutorials and courses', shortValue: 'Discord, docs, and StackAI Academy', confidence: 'verified', sources: [ - { url: 'https://www.stackai.com/academy', label: 'StackAI Academy', asOf: '2026-07-02' }, + { url: 'https://www.stackai.com/academy', label: 'StackAI Academy', asOf: '2026-07-08' }, ], }, companyMaturity: { diff --git a/apps/sim/lib/compare/data/competitors/tines.ts b/apps/sim/lib/compare/data/competitors/tines.ts index 4c062b7b6a0..4b095cb920f 100644 --- a/apps/sim/lib/compare/data/competitors/tines.ts +++ b/apps/sim/lib/compare/data/competitors/tines.ts @@ -331,6 +331,32 @@ export const tinesProfile: CompetitorProfile = { }, ], }, + customBlocks: { + value: + "No: Tines has no feature that lets a builder publish a Story as its own named, iconed entry in a shared block toolbar. The closest features are (1) Private/Public Templates, which are scoped to configuring a single action (e.g. a pre-built HTTP Request) with parameterized 'Action inputs' that hide that one action's underlying config, and can be shared team-wide or org-wide; and (2) Send to Story, one generic action type used to call any sub-story via a picker — the caller selects the target sub-story and enters its defined parameters, without needing view/edit access to the sub-story's own actions. Neither meets the bar: templates wrap one action, not a multi-step Story, and Send to Story is a single generic action a builder configures per call site, not a distinct block appearing in the toolbar for each published Story.", + detail: + "Public docs describe template edits as letting a builder 'optionally replace storyboard actions that use the template in one step,' confirming propagation is a manual, opt-in action rather than always running the source's latest deployed version automatically. Send to Story does genuinely hide a sub-story's internals from a caller without permission on it ('will not be able to view or modify the contents of the story unless you have the relevant permissions'), but it is one generic action configured with a target-story picker each time, not a separate published block per Story.", + shortValue: + 'No: templates are single-action; Send to Story is a generic picker, not a block', + confidence: 'verified', + sources: [ + { + url: 'https://www.tines.com/docs/actions/templates/private-templates/', + label: 'Private Templates | Docs | Tines', + asOf: '2026-07-08', + }, + { + url: 'https://www.tines.com/docs/actions/templates/templates/', + label: 'Public Templates | Docs | Tines', + asOf: '2026-07-08', + }, + { + url: 'https://www.tines.com/docs/stories/send-to-story/', + label: 'Send to Story | Docs | Tines', + asOf: '2026-07-08', + }, + ], + }, }, aiCapabilities: { multiLlmSupport: { @@ -915,24 +941,24 @@ export const tinesProfile: CompetitorProfile = { observability: { tracingDepth: { value: - 'Each workflow run ("Story run") gets a unique ID and a full, action-by-action event chain viewable in the UI or API. A Tenant Health dashboard (self-hosted) and Story/Action status views surface errors, run volume, and worker capacity, but this isn\'t OpenTelemetry-style distributed tracing by default; a separate community guide shows customers wiring up their own OpenTelemetry dashboard', + 'Each workflow run ("Story run") gets a unique ID and a full, action-by-action event chain viewable in the UI or API. A Tenant Health dashboard (self-hosted) and Story/Action status views surface errors, run volume, and worker capacity, but this isn\'t OpenTelemetry-style distributed tracing by default; Tines\' own documentation includes an official guide showing customers how to wire up their own OpenTelemetry dashboard', shortValue: 'Per-run GUID trace; no built-in OpenTelemetry dashboards', confidence: 'estimated', sources: [ { url: 'https://www.tines.com/docs/stories/story-runs/', label: 'Story runs docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://www.tines.com/docs/self-hosted/monitoring-tines/tenant-health-dashboard/', label: 'Tenant health dashboard docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://explained.tines.com/en/articles/14120923-opentelemetry-designing-a-dashboard', - label: 'OpenTelemetry: Designing a Dashboard', - asOf: '2026-07-02', + label: 'OpenTelemetry: Designing a Dashboard (official Tines guide)', + asOf: '2026-07-08', }, ], }, @@ -1086,14 +1112,16 @@ export const tinesProfile: CompetitorProfile = { support: { supportChannels: { value: - 'Dedicated support and training for Business/Enterprise plans; community Slack and documentation for lower tiers', - shortValue: 'Dedicated support for Business/Enterprise, Slack for others', + '"Dedicated support and training" for Business/Enterprise plans, per the pricing page; specific mechanisms (named CSM/CSE role, SLA terms) are not publicly itemized', + detail: + 'The pricing page lists "Dedicated support and training" as a Business/Enterprise inclusion but does not name a specific role (e.g. Customer Success Manager/Engineer) or publish SLA terms.', + shortValue: 'Dedicated support and training for Business/Enterprise', confidence: 'estimated', sources: [ { - url: 'https://explained.tines.com/en/articles/9620399-understanding-tines-pricing-and-packaging', - label: 'Understanding Tines pricing and packaging', - asOf: '2026-07-02', + url: 'https://www.tines.com/pricing/', + label: 'Pricing | Tines', + asOf: '2026-07-08', }, ], }, diff --git a/apps/sim/lib/compare/data/competitors/vellum.ts b/apps/sim/lib/compare/data/competitors/vellum.ts index f09de0f34f4..8a703b698b3 100644 --- a/apps/sim/lib/compare/data/competitors/vellum.ts +++ b/apps/sim/lib/compare/data/competitors/vellum.ts @@ -34,9 +34,9 @@ export const vellumProfile: CompetitorProfile = { 'Enterprise customers can get a Vellum-managed dedicated deployment inside a single-tenant AWS, Azure, or GCP VPC via a Replicated-based install. Sim offers self-hosting (Docker Compose or Kubernetes/Helm) but has no documented managed single-tenant/VPC hosting tier.', shortDescription: 'Vendor-managed single-tenant VPC tier that Sim does not offer.', source: { - url: 'https://docs.vellum.ai/self-hosting/getting-started/introduction', - label: 'Self-Hosted Vellum: Vellum Docs', - asOf: '2026-07-02', + url: 'https://www.vellum.ai/blog/announcing-vellum-vpc', + label: 'Announcing Vellum VPC', + asOf: '2026-07-08', }, }, ], @@ -54,21 +54,27 @@ export const vellumProfile: CompetitorProfile = { }, }, { - title: 'BYOK not documented on pricing', + title: 'Enterprise BYOK policy no longer verifiable', description: - "Vellum's pricing pages describe a prepaid-credit model that passes through LLM costs at cost, with no bring-your-own-API-key option mentioned as an alternative.", - shortDescription: 'No bring-your-own-key option mentioned on pricing pages.', - source: { url: 'https://www.vellum.ai/pricing', label: 'Vellum Pricing', asOf: '2026-07-02' }, + "Vellum's pricing page has been replaced by a consumer 'Personal Intelligence' pricing model (subscription plus pay-as-you-go credits); the original enterprise LLM-cost-pass-through pricing this claim describes, including any bring-your-own-API-key policy, is no longer published at this URL.", + shortDescription: + 'Pricing page now shows a different consumer product; enterprise BYOK policy unconfirmed.', + source: { + url: 'https://www.vellum.ai/pricing', + label: 'Vellum Pricing (now shows the consumer product)', + asOf: '2026-07-08', + }, }, { - title: 'No enterprise SLA published', + title: 'Enterprise SLA no longer verifiable', description: - 'No uptime or response-time SLA commitments are published on the enterprise or pricing pages.', - shortDescription: 'No public SLA commitments found.', + "The /enterprise page has been repurposed for Vellum's consumer product and no longer represents its (formerly documented) enterprise LLMOps offering, so SLA absence can no longer be verified against genuine enterprise-tier content at this URL.", + shortDescription: + 'SLA status unverifiable after the /enterprise page pivoted to the consumer product.', source: { url: 'https://www.vellum.ai/enterprise', - label: 'Vellum Enterprise', - asOf: '2026-07-02', + label: 'Vellum Enterprise (now shows the consumer product)', + asOf: '2026-07-08', }, }, { @@ -133,14 +139,20 @@ export const vellumProfile: CompetitorProfile = { ], }, deploymentOptions: { - value: 'Vellum Cloud (SaaS), self-hosted, and VPC install on AWS/Azure/GCP or on-prem', - shortValue: 'Cloud, self-hosted, or VPC install', + value: + 'Vellum Managed (fully managed hosted service), self-hosted, and Vellum VPC install on AWS, Azure, or GCP', + shortValue: 'Managed, self-hosted, or VPC install', confidence: 'estimated', sources: [ { url: 'https://docs.vellum.ai/self-hosting/getting-started/introduction', label: 'Self-Hosted Vellum: Vellum Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', + }, + { + url: 'https://www.vellum.ai/blog/announcing-vellum-vpc', + label: 'Announcing Vellum VPC', + asOf: '2026-07-08', }, ], }, @@ -277,6 +289,32 @@ export const vellumProfile: CompetitorProfile = { }, ], }, + customBlocks: { + value: + "Partial: Vellum has no documented feature for publishing a workflow as a named, iconed block that appears in a shared toolbar for the whole organization. Its closest mechanism is the Deployed Subworkflow node, a dedicated 'Deployed Subworkflow' option in the Insert Node Panel that lets a builder insert an already-deployed workflow as a single node in their own separate workflow, wiring only its defined inputs/outputs rather than exposing the source workflow's internal nodes. Pointing it at the LATEST release tag means it automatically runs the source workflow's newest deployment with no separate republish step.", + detail: + "Unlike Sim's Custom Blocks, there is no documented step where a publisher assigns a custom name/icon that then surfaces the workflow as a first-class item in the general node toolbar alongside built-in nodes; consumers instead search for and link a specific deployed workflow through the Subworkflow node type. There is also no documented ability to hand-pick and rename a subset of outputs to expose, and no Enterprise-only gating or block-level allow/deny governance specific to this reuse mechanism beyond Vellum's general workspace-wide RBAC roles.", + shortValue: + 'Partial: Deployed Subworkflow node, not a published named/iconed toolbar block', + confidence: 'estimated', + sources: [ + { + url: 'https://docs.vellum.ai/developers/workflows-sdk/api-reference/nodes/subworkflow-deployment-node', + label: 'Subworkflow Deployment Node - Vellum Documentation', + asOf: '2026-07-08', + }, + { + url: 'https://docs.vellum.ai/changelog/2025/2025-08', + label: 'Vellum Changelog: August 2025 (Insert Node Panel Subworkflow split)', + asOf: '2026-07-08', + }, + { + url: 'https://docs.vellum.ai/product/deployments/release-tags', + label: 'Release Tags - Vellum Documentation', + asOf: '2026-07-08', + }, + ], + }, }, aiCapabilities: { multiLlmSupport: { @@ -294,14 +332,14 @@ export const vellumProfile: CompetitorProfile = { }, agentReasoningBlocks: { value: - "Vellum's 'Agent Node' (formerly 'Tool Calling Node') is its dedicated agent/reasoning-and-tool-execution block within Workflows, supporting raw code, subworkflows, MCP tools, and Composio SaaS actions side by side in one node.", - shortValue: 'Agent Node handles reasoning + tool execution', + "Vellum's 'Agent Node' (formerly 'Tool Calling Node') is its dedicated agent/reasoning-and-tool-execution block within Workflows, currently documenting raw code, subworkflows, and Composio SaaS actions as tool types in one node; MCP tool support is not documented on the current Agent Node page.", + shortValue: 'Agent Node handles reasoning + tool execution; MCP not currently documented', confidence: 'verified', sources: [ { url: 'https://docs.vellum.ai/product/workflows/nodes/agent-node', label: 'Vellum Docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -674,13 +712,18 @@ export const vellumProfile: CompetitorProfile = { ], }, byok: { - value: 'Not mentioned on current pricing pages', + value: + "Unconfirmed for the enterprise platform: Vellum's pricing page has been replaced by an unrelated consumer 'Personal Intelligence' product page, so BYOK availability can no longer be verified from vellum.ai/pricing.", detail: - 'Pricing is structured around Vellum-provided credits passed through at cost, with no bring-your-own-API-key option described.', - shortValue: 'No BYOK option documented', + "The current pricing page describes Vellum-provided credits for the consumer product, not the enterprise platform's LLM-cost pass-through model; no bring-your-own-API-key policy is described for either product on this page.", + shortValue: 'Unverifiable after the pricing page pivoted to the consumer product', confidence: 'unknown', sources: [ - { url: 'https://www.vellum.ai/pricing', label: 'Vellum Pricing', asOf: '2026-07-02' }, + { + url: 'https://www.vellum.ai/pricing', + label: 'Vellum Pricing (now shows the consumer product)', + asOf: '2026-07-08', + }, ], }, }, @@ -872,14 +915,19 @@ export const vellumProfile: CompetitorProfile = { }, durabilityModel: { value: - "Vellum supports 'Retry Node Adornments' (organized under an 'Error Handling' section of node Settings) that automatically re-invoke a failed node up to a configured max-attempts count.", + "Vellum supports a 'Retry Node Adornment' — a standalone adornment applied to a node (separate from that node's Settings) that automatically re-invokes the node until it succeeds or reaches a configured max-attempts count.", shortValue: 'Automatic node-level retries', confidence: 'verified', sources: [ { - url: 'https://docs.vellum.ai/product/workflows/node-types', - label: 'Vellum Docs', - asOf: '2026-07-02', + url: 'https://docs.vellum.ai/product/workflows/nodes/overview', + label: 'Vellum Docs: Nodes Overview (adornments, error handling)', + asOf: '2026-07-08', + }, + { + url: 'https://docs.vellum.ai/changelog/2025/2025-03', + label: 'Vellum Changelog, March 2025 (Try/Retry node adornments)', + asOf: '2026-07-08', }, ], }, @@ -916,17 +964,17 @@ export const vellumProfile: CompetitorProfile = { { url: 'https://docs.vellum.ai/changelog/2025/2025-11', label: 'Vellum Changelog, November 2025 (async workflow execution)', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { - url: 'https://docs.vellum.ai/developers/client-sdk/workflows/execute-workflow', - label: 'Vellum Docs: Execute Workflow (synchronous SDK call)', - asOf: '2026-07-02', + url: 'https://docs.vellum.ai/developers/client-sdk/workflows/execute-workflow-async', + label: 'Vellum Docs: Execute Workflow Async', + asOf: '2026-07-08', }, { - url: 'https://docs.vellum.ai/api-reference/workflows/execute-workflow-stream', - label: 'Vellum API Reference: Execute Workflow as Stream', - asOf: '2026-07-02', + url: 'https://docs.vellum.ai/developers/client-sdk/workflows/execute-workflow-stream', + label: 'Vellum Docs: Execute Workflow as Stream', + asOf: '2026-07-08', }, ], }, @@ -970,30 +1018,30 @@ export const vellumProfile: CompetitorProfile = { { url: 'https://docs.vellum.ai/changelog/2025/2025-11', label: 'Vellum Changelog, November 2025 (Scheduled and Integration Triggers)', - asOf: '2026-07-04', - }, - { - url: 'https://docs.vellum.ai/product/workflows/api-integration', - label: 'Vellum Docs: Easy Integration with Vellum API for Workflows', - asOf: '2026-07-04', + asOf: '2026-07-08', }, ], }, }, support: { supportChannels: { - value: 'Discord community; priority support included on paid plans', + value: + 'Email, an in-app chat, a shared Slack channel for active customers, and a Discord community', detail: - 'The pricing and enterprise pages reference a Discord community channel and note that the Pro plan includes priority support.', - shortValue: 'Discord community + priority support', + "Vellum's help center lists email (support@vellum.ai), in-app chat via the dashboard's 'Get Help' button, and a shared Slack channel for active customers; the enterprise page separately links a public Discord community. vellum.ai/pricing has since been repurposed for a different 'personal AI assistant' product, so its 'priority support' mention describes that product's paid add-on, not the workflow platform's support tiers — no priority-support or SLA claim is made here.", + shortValue: 'Email, in-app chat, Slack (customers), Discord community', confidence: 'estimated', sources: [ + { + url: 'https://docs.vellum.ai/home/getting-started/support', + label: "Vellum's Help Center", + asOf: '2026-07-08', + }, { url: 'https://www.vellum.ai/enterprise', label: 'Vellum Enterprise', - asOf: '2026-07-02', + asOf: '2026-07-08', }, - { url: 'https://www.vellum.ai/pricing', label: 'Vellum Pricing', asOf: '2026-07-02' }, ], }, sla: { @@ -1018,24 +1066,24 @@ export const vellumProfile: CompetitorProfile = { }, companyMaturity: { value: - 'Founded 2023 (Y Combinator W23) by Noa Flaherty, Sidd Seethepalli, and Akash Sharma. Raised a $5M seed (2023) and a $20M Series A (July 2025, led by Leaders Fund). Crunchbase reports $25.5M raised in total across three funding rounds, implying additional undisclosed funding beyond these two rounds. Based in New York City, with 150+ reported customers as of the Series A announcement.', - shortValue: 'YC W23, ~$25.5M raised across 3 rounds, NYC-based', + 'Founded 2023 (Y Combinator W23) by Noa Flaherty, Sidd Seethepalli, and Akash Sharma. Raised a $5M seed (July 2023) and a $20M Series A (July 2025, led by Leaders Fund). Based in New York City, with 150+ reported customers as of the Series A announcement.', + shortValue: 'YC W23, $25M raised across 2 rounds, NYC-based', confidence: 'estimated', sources: [ { - url: 'https://www.vellum.ai/blog/announcing-our-20m-series-a', - label: 'Announcing our $20m Series A: Vellum', - asOf: '2026-07-02', + url: 'https://www.ycombinator.com/companies/vellum', + label: 'Vellum: Y Combinator', + asOf: '2026-07-08', }, { - url: 'https://www.crunchbase.com/organization/vellum-74f3', - label: 'Vellum: Crunchbase Company Profile & Funding', - asOf: '2026-07-02', + url: 'https://www.vellum.ai/blog/announcing-our-20m-series-a', + label: 'Announcing our $20m Series A: Vellum', + asOf: '2026-07-08', }, { url: 'https://voicebot.ai/2023/07/13/generative-ai-prompt-engineering-startup-vellum-ai-raises-5m/', label: 'Generative AI Prompt Engineering Startup Vellum.ai Raises $5M: Voicebot.ai', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, diff --git a/apps/sim/lib/compare/data/competitors/workato.ts b/apps/sim/lib/compare/data/competitors/workato.ts index 8e9fd6a00a4..71b71548154 100644 --- a/apps/sim/lib/compare/data/competitors/workato.ts +++ b/apps/sim/lib/compare/data/competitors/workato.ts @@ -103,25 +103,26 @@ export const workatoProfile: CompetitorProfile = { }, }, { - title: 'Native LLM choice limited to two providers', + title: 'Built-in AI actions limited to a fixed model set', description: - "AI Hub's native model picker for Genies covers Anthropic Claude and OpenAI GPT (plus BYOLLM for those same two providers); reaching other providers like Google Gemini or Amazon Bedrock requires going through separate integration connectors rather than a first-class in-agent model switch.", - shortDescription: 'Native model picker covers only Claude and GPT; others need connectors.', + "Workato's own 'AI by Workato' actions run on a fixed set of models under the hood — Anthropic's Claude Sonnet 4 in most regions, and OpenAI's GPT-4o mini in the Israel data center — rather than offering a first-class choice among the full range of LLM providers.", + shortDescription: 'Built-in AI actions run on a fixed Claude Sonnet 4 / GPT-4o mini set.', source: { url: 'https://docs.workato.com/connectors/ai-by-workato.html', label: 'AI by Workato | Workato docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, }, { - title: 'Knowledge base ingestion limited to text/PDF out of the box', + title: 'Knowledge base ingestion limited to four document formats', description: - "Workato's documented Knowledge Base Accelerator pattern natively supports only text and PDF document formats for RAG ingestion; support for other formats requires extending the accelerator yourself.", - shortDescription: 'RAG ingestion natively supports only text and PDF documents.', + "Workato's documented knowledge base data ingestion natively supports only PDF, PPTX, XLSX, and DOCX file types; other formats, including images, videos, and audio files, are not supported for RAG ingestion.", + shortDescription: + 'RAG ingestion supports only PDF, PPTX, XLSX, DOCX — no images, video, or audio.', source: { - url: 'https://docs.workato.com/en/agentic/agent-studio/knowledge-bases/knowledge-bases.html', - label: 'Knowledge bases | Workato Docs', - asOf: '2026-07-02', + url: 'https://docs.workato.com/en/agentic/agent-studio/knowledge-bases/data-ingestion.html', + label: 'Workato Docs: Knowledge base data ingestion', + asOf: '2026-07-08', }, }, { @@ -187,14 +188,19 @@ export const workatoProfile: CompetitorProfile = { }, deploymentOptions: { value: - 'Cloud-hosted SaaS platform (multi-region data centers) with an optional on-prem agent for hybrid/on-prem app and database connectivity; the on-prem agent itself can run on AWS/Azure/GCP VMs or a private physical/virtual machine', + 'Cloud-hosted SaaS platform (multi-region data centers) with an optional on-prem agent for hybrid/on-prem app and database connectivity; the on-prem agent itself installs on a Windows, Linux (DEB/RPM), Docker, or macOS host, whether that host is a cloud VM (AWS/Azure/GCP) or private physical/virtual machine', shortValue: 'Cloud SaaS with optional on-prem connectivity agent', confidence: 'verified', sources: [ { - url: 'https://docs.workato.com/on-prem/agents.html', - label: 'On-prem agent | Workato docs', - asOf: '2026-07-02', + url: 'https://docs.workato.com/on-prem.html', + label: 'On-prem connectivity | Workato Docs', + asOf: '2026-07-08', + }, + { + url: 'https://docs.workato.com/on-prem/groups/add-agent.html', + label: 'On-prem agent - Add an agent | Workato Docs', + asOf: '2026-07-08', }, ], }, @@ -366,6 +372,36 @@ export const workatoProfile: CompetitorProfile = { }, ], }, + customBlocks: { + value: + "No: Workato has no feature to publish a deployed recipe as a distinct, named, iconed block that appears in the recipe builder's general step/action picker for every other builder across the org to drop into their own separate recipes. The closest mechanism, Recipe Functions, lets any recipe in the workspace call another recipe (one built with a 'New function call' trigger) by adding a generic 'Recipe Functions by Workato' connector step and then picking the target function from a dropdown list of saved functions, not a bespoke block with its own name/icon sitting alongside built-in actions. The caller does only see the function's declared Input/Response schema, not its internal steps or credentials, and Workato's own marketing copy states 'update the function once, and the changes will take effect anywhere your function is invoked' (i.e. it always calls the live function recipe, not a frozen copy). No documentation describes per-function governance (allow/deny-listing one specific function for a permission group) distinct from ordinary project/connection-level access control.", + detail: + "Workato's separate Community Library sharing mechanism is explicitly a clone/template flow, not a live block: shared assets are described as 'intended to serve as a reusable set of templates, best practices and guidelines' for another user to install and then 'modify, customize and enhance' as their own independent copy, with no indication the installed copy stays linked to updates on the original. This rules out Community Library as a second candidate for the same capability.", + shortValue: "No, only a generic 'Call Recipe Function' connector, not a published block", + confidence: 'verified', + sources: [ + { + url: 'https://docs.workato.com/connectors/recipe-functions.html', + label: 'Recipe Functions by Workato | Workato Docs', + asOf: '2026-07-08', + }, + { + url: 'https://docs.workato.com/connectors/recipe-functions/actions/call-recipe-function-synchronously.html', + label: 'Recipe Functions - Call Recipe Function Synchronously | Workato Docs', + asOf: '2026-07-08', + }, + { + url: 'https://www.workato.com/product-hub/recipe-functions-build-reusable-automations/', + label: 'How to build reusable automations with Recipe Functions | Workato Product Hub', + asOf: '2026-07-08', + }, + { + url: 'https://docs.workato.com/community-library.html', + label: 'Community library | Workato Docs', + asOf: '2026-07-08', + }, + ], + }, }, aiCapabilities: { multiLlmSupport: { @@ -846,19 +882,14 @@ export const workatoProfile: CompetitorProfile = { }, dataResidency: { value: - "Yes, at signup: customers choose one data residency region per account from Workato's regional data centers (US, EU/Frankfurt, UK, Japan, Singapore, Australia, Israel, China, South Korea). That choice is fixed once the account is created; data cannot later be migrated to another region, and there is no ongoing per-workspace or per-project residency toggle. Using more than one region requires signing up for and maintaining a separate Workato account in each desired region. The on-prem agent additionally lets customers keep on-prem application data behind their own firewall, tunneling only authorized traffic to the Workato cloud.", - shortValue: 'Region chosen once at signup, fixed per account, not ongoing/toggleable', + "Yes, for enterprise customers: Workato enterprise customers can choose the region where their organization's automation data is stored and processed, from regional data centers (US, EU/Frankfurt, Japan, Singapore, Australia, Israel, China, South Korea). Once stored, data remains isolated in that region and is not shared or transferred across regions; there is no ongoing per-workspace or per-project residency toggle. Self-service (non-enterprise) users can't choose a region and are hosted in one of Workato's US data centers. Using more than one region requires signing up for and maintaining a separate Workato account in each desired region.", + shortValue: 'Enterprise customers pick a region; self-service defaults to US', confidence: 'verified', sources: [ { url: 'https://docs.workato.com/datacenter/datacenter-overview.html', label: 'Data center overview | Workato Docs', - asOf: '2026-07-04', - }, - { - url: 'https://docs.workato.com/connectors/ai-by-workato.html', - label: 'AI by Workato | Workato docs', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -882,14 +913,14 @@ export const workatoProfile: CompetitorProfile = { }, auditLogging: { value: - "Yes: an Activity audit log records users' significant actions across the workspace and can be streamed to an external destination for retention and analysis", + "Yes: an Activity audit log records users' significant actions across the workspace and can be streamed to an external destination (e.g. Amazon S3, Azure, Google Cloud Storage, Datadog, Splunk) for retention and analysis", shortValue: 'Activity audit log, streamable externally', confidence: 'verified', sources: [ { - url: 'https://docs.workato.com/user-accounts-and-teams/role-based-access/access-control-v2.html', - label: 'Manage workspace collaborators with role-based access control | Workato docs', - asOf: '2026-07-02', + url: 'https://docs.workato.com/features/activity-audit-log-streaming.html', + label: 'Audit log streaming | Workato Docs', + asOf: '2026-07-08', }, ], }, @@ -941,40 +972,40 @@ export const workatoProfile: CompetitorProfile = { }, whiteLabeling: { value: - 'Yes: Workato Embedded offers a Theme editor (Admin Console > Settings > Branding) for customizing colors, fonts, spacing, and adding a custom company logo/name, plus the ability to white-label error messages, notifications, and logs, for partners embedding Workato in their own product.', + 'Yes, partially self-service: Workato Embedded offers a Theme editor (Admin Console/Manage Customers > Settings > Branding) for customizing colors, fonts, and spacing, for partners embedding Workato in their own product. Adding a custom company logo is not part of the self-service Theme editor and instead requires contacting a Workato Success Representative.', detail: - 'This capability is scoped to the Workato Embedded/OEM offering, not the standard workspace UI.', - shortValue: 'Yes: Embedded theme editor with logo/branding', + 'Scoped to the Embedded/OEM offering, not the standard workspace UI. No current documentation supports white-labeling of error messages, notifications, or logs.', + shortValue: 'Yes: Embedded theme editor (colors/fonts/spacing); logo needs Support', confidence: 'verified', sources: [ { url: 'https://docs.workato.com/oem/branding.html', label: 'Workato Docs: Branding - Theme editor', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://www.workato.com/product-hub/customization-possibilities-with-the-embedded-theme-editor/', label: 'Workato Product Hub: Customization possibilities with the Embedded Theme editor', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, dataRetention: { value: - 'Yes: Workato supports org-configurable data retention for recipe job logs, with a default of 30 to 90 days depending on the workspace plan. Enterprise Workspaces, or workspaces with the Data Monitoring/Advanced Security & Compliance capability, can customize retention per recipe down to 1 hour, up to 90 days, or to zero retention.', - shortValue: 'Yes: configurable retention (1hr-90 days, or zero)', + 'Yes: Workato supports org-configurable data retention for recipe job logs, with a default of 30 to 90 days depending on the workspace plan. Enterprise Workspaces, or workspaces with the Data Monitoring/Advanced Security & Compliance capability, can set a workspace-wide custom retention period between 1 hour and 90 days; individual recipes can then be set to follow that workspace policy or to store no data at all.', + shortValue: 'Yes: org-configurable retention, 1hr-90 days (Enterprise/Data Monitoring)', confidence: 'verified', sources: [ { url: 'https://docs.workato.com/security/data-protection/data-retention/', label: 'Workato Docs: Data retention policies', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://docs.workato.com/security/data-protection/data-retention/configure-retention-for-recipes.html', label: 'Workato Docs: Recipe-level data retention', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, diff --git a/apps/sim/lib/compare/data/competitors/zapier.ts b/apps/sim/lib/compare/data/competitors/zapier.ts index 34fe0616d6f..467e179f099 100644 --- a/apps/sim/lib/compare/data/competitors/zapier.ts +++ b/apps/sim/lib/compare/data/competitors/zapier.ts @@ -50,12 +50,12 @@ export const zapierProfile: CompetitorProfile = { { title: 'Zapier Copilot (natural-language build assistant)', description: - 'Copilot (open beta) lets users describe an automation or agent in plain language and generates a draft Zap or agent, including custom code steps to fill integration gaps. Sim offers the same natural-language building capability via Chat and in-editor Copilot.', + 'Copilot lets users describe an automation or agent in plain language and generates a draft Zap or agent, including custom code steps to fill integration gaps. Sim offers the same natural-language building capability via Chat and in-editor Copilot.', shortDescription: 'Describe an automation and Copilot builds the Zap or agent for you.', source: { url: 'https://zapier.com/blog/zapier-copilot-guide/', label: 'Zapier Copilot: Build systems even faster with AI', - asOf: '2026-07-02', + asOf: '2026-07-08', }, }, ], @@ -163,7 +163,11 @@ export const zapierProfile: CompetitorProfile = { shortValue: 'Large library of prebuilt templates', confidence: 'estimated', sources: [ - { url: 'https://zapier.com/apps', label: 'Zapier App Directory', asOf: '2026-07-02' }, + { + url: 'https://zapier.com/templates', + label: 'Zapier Workflow Automation Templates', + asOf: '2026-07-08', + }, ], }, license: { @@ -172,9 +176,10 @@ export const zapierProfile: CompetitorProfile = { confidence: 'verified', sources: [ { - url: 'https://zapier.com/pricing', - label: 'Zapier Plans & Pricing', - asOf: '2026-07-02', + url: 'https://zapier.com/legal/terms-of-service', + label: + 'Zapier Terms of Service (Zapier and its licensors retain all right, title, and interest in the Service; no open-source license is offered)', + asOf: '2026-07-08', }, ], }, @@ -275,21 +280,21 @@ export const zapierProfile: CompetitorProfile = { }, dataTables: { value: - 'Yes: Zapier Tables is a native, spreadsheet-like data table feature (distinct from external DB connectors), with a spreadsheet-style grid interface and plan-based record limits (Free plan up to 2,500 records). Deleted records and fields go to a Trash with a 30-day recovery window.', + 'Yes: Zapier Tables is a native, spreadsheet-like data table feature (distinct from external DB connectors), with a spreadsheet-style grid interface and plan-based record limits (see zapier.com/pricing for current tier limits, as the usage-limits help page no longer states the Free plan figure directly). Deleted records and fields go to a Trash with a 30-day recovery window.', detail: 'Table components embedded in Interfaces/Forms display 20 rows by default (switchable to 10/20/50); keyboard-navigation parity with classic spreadsheets is not separately documented.', - shortValue: 'Yes: native Zapier Tables with record limits', + shortValue: 'Yes: native Zapier Tables with plan-based record limits', confidence: 'verified', sources: [ { url: 'https://help.zapier.com/hc/en-us/articles/15721386410765-Zapier-Tables-usage-limits', label: 'Zapier Tables usage limits', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://help.zapier.com/hc/en-us/articles/45396606105741-Restore-deleted-records-and-fields-from-Trash-in-Zapier-Tables', label: 'Restore deleted records and fields from Trash in Zapier Tables', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -333,23 +338,44 @@ export const zapierProfile: CompetitorProfile = { }, ], }, + customBlocks: { + value: + 'No: Zapier has no feature for publishing a deployed Zap as a named, iconed, encapsulated block that appears in the step picker for the whole team to drop into their own separate Zaps. Sub-Zaps are the closest analog, but they are reusable saved steps called by "Call a Sub-Zap," not a org-wide toolbar entry, and Zapier\'s own docs do not describe internals being hidden from other team members who can access the same account. A private integration published on the Developer Platform is a different mechanism: it wraps a third-party API as a connector app for the team, not a workflow.', + detail: + "Sub-Zaps and private integrations are the two Zapier features that come closest to reuse, but neither matches the mechanics: Sub-Zaps are invoked from a dedicated action step within the same account/team rather than surfaced as a first-class block alongside built-in app steps, and private integrations expose custom API actions, not a published Zap's logic with auto-derived inputs and hand-picked outputs that stay live-synced to a source workflow's latest deployed version.", + shortValue: + 'No equivalent: Sub-Zaps and private integrations are the closest, but neither matches', + confidence: 'estimated', + sources: [ + { + url: 'https://help.zapier.com/hc/en-us/articles/32283713627533-Understanding-Sub-Zaps', + label: 'Understanding Sub-Zaps', + asOf: '2026-07-08', + }, + { + url: 'https://docs.zapier.com/platform/quickstart/private-vs-public-integrations', + label: 'Private vs public integrations', + asOf: '2026-07-08', + }, + ], + }, }, aiCapabilities: { multiLlmSupport: { value: - 'OpenAI (GPT family), Anthropic (Claude family), and Google (Gemini family), with BYOK for OpenAI, Anthropic, Gemini, and Azure OpenAI in Chatbots', - shortValue: 'OpenAI, Anthropic, and Google models, with BYOK', + 'OpenAI (GPT family), Anthropic (Claude family), and Google (Gemini family), with BYOK for OpenAI and Anthropic only in Chatbots', + shortValue: 'OpenAI, Anthropic, and Google models; BYOK for OpenAI/Anthropic only', confidence: 'verified', sources: [ { url: 'https://zapier.com/blog/ai-models-on-zapier/', label: 'Which AI models can you automate on Zapier?', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://help.zapier.com/hc/en-us/articles/21959873616013-Use-your-own-API-key-with-a-Zapier-Chatbot', label: 'Use your own API key with a Zapier Chatbot', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -390,16 +416,25 @@ export const zapierProfile: CompetitorProfile = { mcpSupport: { value: 'Yes', detail: - 'Zapier operates a hosted MCP server (Streamable HTTP) exposing 9,000+ app connections and 30,000+ actions to any MCP client, and also offers an "MCP Client by Zapier" integration for calling external MCP servers from within Zaps. Costs 2 tasks per tool call on all plans.', + 'Zapier operates a hosted MCP server (Streamable HTTP) exposing 9,000+ app connections and 40,000+ actions to any MCP client, and also offers an "MCP Client by Zapier" integration for calling external MCP servers from within Zaps. Costs 2 tasks per tool call on all plans.', shortValue: 'Hosted MCP server plus an MCP client to call others', confidence: 'verified', sources: [ { - url: 'https://zapier.com/blog/zapier-mcp-guide/', - label: 'Zapier MCP: Perform 30,000+ actions in your AI tool', - asOf: '2026-07-02', + url: 'https://docs.zapier.com/mcp/home', + label: 'Zapier MCP docs (9,000+ apps and 40,000+ actions)', + asOf: '2026-07-08', + }, + { + url: 'https://docs.zapier.com/mcp/clients', + label: 'Zapier MCP docs — Clients (requires Streamable HTTP; SSE not supported)', + asOf: '2026-07-08', + }, + { + url: 'https://docs.zapier.com/mcp/usage/overview', + label: 'Zapier MCP docs — Usage overview (2 tasks per tool call)', + asOf: '2026-07-08', }, - { url: 'https://docs.zapier.com/mcp/home', label: 'Zapier MCP docs', asOf: '2026-07-02' }, ], }, evaluationGuardrails: { @@ -501,21 +536,27 @@ export const zapierProfile: CompetitorProfile = { }, nativeChatDeployment: { value: - 'Yes: Zapier Chatbots let a builder create a conversational AI agent connected to knowledge sources and 9,000+ apps, then deploy it via a public shareable URL or embed it on a website, Slack, or Teams.', + 'Yes: Zapier Chatbots let a builder create a conversational AI agent connected to knowledge sources, deployed via a public shareable URL or embedded on a website (pop-up, inline, or via Zapier Forms); Slack can also be connected via a separate Zap that triggers the chatbot\'s Generate Reply action and posts the reply back, rather than a direct "embed" option.', detail: "Chatbots and Interfaces are public by default unless restricted on a paid plan; the 'Built on Zapier' footer label can be removed on paid plans as well.", - shortValue: 'Yes: public chatbot URL or embed', + shortValue: 'Yes: public chatbot URL or website embed; Slack via a separate Zap', confidence: 'verified', sources: [ { url: 'https://help.zapier.com/hc/en-us/articles/21958023866381-Share-and-embed-a-chatbot', label: 'Share and embed a chatbot', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://help.zapier.com/hc/en-us/articles/21960697323533-Set-up-a-chatbot', label: 'Set up a chatbot', - asOf: '2026-07-02', + asOf: '2026-07-08', + }, + { + url: 'https://community.zapier.com/featured-articles-65/how-to-connect-your-zapier-chatbot-to-slack-for-smart-replies-46213', + label: + 'How to Connect Your Zapier Chatbot to Slack for Smart Replies (Zapier Community)', + asOf: '2026-07-08', }, ], }, @@ -685,17 +726,23 @@ export const zapierProfile: CompetitorProfile = { detail: 'A task is one completed action step in a Zap; trigger steps are free. MCP tool calls cost 2 tasks each. Plans are sold as monthly task blocks (e.g., 750, 2,000) with per-user limits on Team/Enterprise.', shortValue: 'Metered per-task pricing, tiered by monthly allotment', - confidence: 'estimated', + confidence: 'verified', sources: [ { - url: 'https://www.activepieces.com/blog/zapier-pricing', - label: 'Zapier Pricing Breakdown (third-party)', - asOf: '2026-07-02', + url: 'https://zapier.com/pricing', + label: + 'Zapier Pricing (task tiers from 100 to 2M/month; seat limits on Team/Enterprise)', + asOf: '2026-07-08', }, { - url: 'https://zapier.com/blog/zapier-mcp-guide/', - label: 'Zapier MCP guide (task cost per tool call)', - asOf: '2026-07-02', + url: 'https://help.zapier.com/hc/en-us/articles/8496196837261-How-is-task-usage-measured-in-Zapier', + label: 'How is task usage measured in Zapier? (Zap triggers never use tasks)', + asOf: '2026-07-08', + }, + { + url: 'https://docs.zapier.com/mcp/usage/overview', + label: 'Zapier MCP usage overview (task cost per tool call)', + asOf: '2026-07-08', }, ], }, @@ -729,14 +776,14 @@ export const zapierProfile: CompetitorProfile = { byok: { value: 'Yes, for Chatbots/AI steps', detail: - "Zapier Chatbots default to GPT-4.1 mini but let users add their own API key for OpenAI, Anthropic Claude, Google Gemini, or Azure OpenAI, with usage billed directly to the user's provider account.", - shortValue: 'Bring your own key for Chatbots/AI steps', + "Zapier Chatbots default to GPT-4.1 mini but let users add their own API key for OpenAI or Anthropic Claude, with usage billed directly to the user's provider account. (Gemini/Azure OpenAI BYOK is not documented.)", + shortValue: 'Bring your own key for OpenAI/Anthropic in Chatbots', confidence: 'verified', sources: [ { url: 'https://help.zapier.com/hc/en-us/articles/21959873616013-Use-your-own-API-key-with-a-Zapier-Chatbot', label: 'Use your own API key with a Zapier Chatbot', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -838,41 +885,41 @@ export const zapierProfile: CompetitorProfile = { }, credentialGovernance: { value: - "Yes, but coarser than per-role credential controls: Zapier lets an owner share a specific app connection with chosen users or teams (Enterprise), and Enterprise 'managed apps' let admins mark specific apps as admin-only, so only admins can create or share connections for that app while members still use admin-shared ones. This governs connections at the app/sharing level, not a fine-grained per-role permission matrix over individual stored credentials.", + "Yes, but coarser than per-role credential controls: Zapier lets an owner share a specific app connection with chosen individual users (Team plan) or with teams as a unit (Enterprise), and Enterprise 'managed apps' let admins mark specific apps as admin-only, so only admins can create or share connections for that app while members still use admin-shared ones. This governs connections at the app/sharing level, not a fine-grained per-role permission matrix over individual stored credentials.", detail: 'Admins can also globally restrict connection sharing account-wide via a toggle in the Admin Center.', - shortValue: 'Coarse: connection sharing plus admin-managed apps', + shortValue: 'Coarse: connection sharing (Team) plus admin-managed apps (Enterprise)', confidence: 'verified', sources: [ { url: 'https://help.zapier.com/hc/en-us/articles/8496326497037-Share-app-connections-with-members-of-your-Team-or-Enterprise-account', label: 'Share app connections with members of your Team or Enterprise account', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://help.zapier.com/hc/en-us/articles/44795921426317-Manage-app-connections-with-managed-apps', label: 'Manage app connections with managed apps', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, whiteLabeling: { value: - "Yes, but partial and tiered: Zapier offers a White Label product for embedding automation UI into a customer's own product (Company/Enterprise pricing). Separately, paid-plan customers can remove the 'Built on Zapier' label from Chatbots and Forms and apply custom brand colors and a logo to Forms. There is no platform-wide white-labeling of the core Zap editor or workspace itself.", + "Yes, but partial and tiered: Zapier offers a White Label product for embedding automation UI into a customer's own product (currently limited access, contact sales). Separately, Team/Enterprise Forms customers can remove the 'Built on Zapier' label, while Professional/Team/Enterprise customers can apply custom brand colors and a logo to Forms (Free cannot). There is no platform-wide white-labeling of the core Zap editor or workspace itself.", detail: - 'White Label is a distinct embedded product for SaaS builders; branding removal on Chatbots/Forms is a separate, narrower feature gated behind paid plans.', + 'White Label is a distinct embedded product for SaaS builders; branding removal on Forms is a separate, narrower feature gated behind paid plans, with label removal itself requiring Team/Enterprise.', shortValue: 'Partial: White Label embed product, tiered branding removal', confidence: 'verified', sources: [ { url: 'https://docs.zapier.com/white-label/getting-started', label: 'White Label getting started', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://help.zapier.com/hc/en-us/articles/15932034572685-Customize-branding-and-colors-in-Zapier-Forms', label: 'Customize branding and colors in Zapier Forms', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -1055,21 +1102,21 @@ export const zapierProfile: CompetitorProfile = { }, dataDrains: { value: - "Yes: Zapier offers 'Log streams' (Enterprise) that continuously stream Zap configuration-change and run-outcome events to an external SIEM/monitoring destination such as Datadog or Splunk, in addition to an in-product account-wide audit log with a Zap Runs API for pulling history.", + "Yes: Zapier offers 'Log streams' (Enterprise) that continuously stream Zap configuration-change and run-outcome events to an external SIEM/monitoring destination such as Datadog or Splunk, in addition to an in-product account-wide audit log (Teams/Enterprise) for change and run-outcome history. (Note: a Zap Runs/Workflow API for programmatically pulling history exists only as an experimental, non-public feature, not generally available.)", detail: "Log streams capture events only from when they're configured, not historical backfill.", - shortValue: 'Yes: log streams to Datadog, Splunk, SIEM', + shortValue: 'Yes: log streams to Datadog, Splunk, SIEM, plus in-product audit log', confidence: 'verified', sources: [ { url: 'https://help.zapier.com/hc/en-us/articles/43732241361421-Set-up-log-streams-to-monitor-Zap-activity', label: 'Set up log streams to monitor Zap activity', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://zapier.com/blog/mpe-admin-center-audit-logs/', label: 'Complete Control: Multi-Product Experience & Admin Center', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -1158,15 +1205,15 @@ export const zapierProfile: CompetitorProfile = { support: { supportChannels: { value: - 'Email/ticket support for all paid plans, Zapier Community forum (public, no account required), plus premium support (chat/priority) on Team and above', - shortValue: 'Email support, community forum, premium chat on Team+', + 'Email/ticket support for all paid plans (Professional and above, with faster SLAs on Team/Enterprise), Zapier Community forum (public, no account required to browse), plus live chat support starting on higher-tier Professional plans and 24/7 priority chat plus a dedicated Technical Account Manager on Enterprise', + shortValue: 'Email support from Professional+, community forum, chat on higher tiers', confidence: 'estimated', sources: [ - { url: 'https://community.zapier.com/', label: 'Zapier Community', asOf: '2026-07-02' }, + { url: 'https://community.zapier.com/', label: 'Zapier Community', asOf: '2026-07-08' }, { url: 'https://help.zapier.com/hc/en-us/articles/8496213764877-Get-help-and-support-with-Zapier', label: 'Get help and support with Zapier', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -1225,21 +1272,32 @@ export const zapierProfile: CompetitorProfile = { }, academy: { value: - 'Yes: Zapier operates Zapier Academy (learn.zapier.com), a structured hub of self-paced courses, tutorials, and learning paths, plus a Certified Zapier Expert program with an application, an exam, and an expert directory listing.', + 'Yes: Zapier operates Zapier Academy (learn.zapier.com), a hub of courses and tutorials, plus a Solution Partner Program (the rebranded successor to the former Zapier Experts/Certified Zapier Expert program) that requires an application and, per third-party accounts of the process, an invitation-only certification exam, leading to a partner directory listing at zapier.com/experts.', detail: - 'Zapier Academy covers beginner to advanced automation topics. Certification is a separate application-based exam program leading to a badge and directory listing.', - shortValue: 'Yes: Academy plus expert certification program', - confidence: 'verified', + 'Zapier Academy covers beginner to advanced automation topics. The former "Certified Zapier Expert" branding has been folded into the Solution Partner Program: applicants submit an application form, and if approved are invited to complete certification before earning a directory listing.', + shortValue: 'Yes: Academy plus Solution Partner Program (application-based)', + confidence: 'estimated', sources: [ { url: 'https://learn.zapier.com/', label: 'Zapier Academy', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { - url: 'https://community.zapier.com/show-tell-5/zapier-certification-42220', - label: 'Zapier Certification community thread', - asOf: '2026-07-02', + url: 'https://community.zapier.com/how-do-i-3/how-do-you-become-zapier-certified-3817', + label: 'How do you become Zapier Certified? (application process, Zapier Community)', + asOf: '2026-07-08', + }, + { + url: 'https://easyaiz.com/becoming-a-zapier-expert/', + label: + 'Becoming a Zapier Solution Partner: Step-by-Step Guide (third-party account of the certification exam)', + asOf: '2026-07-08', + }, + { + url: 'https://zapier.com/experts', + label: 'Zapier Solution Partner Directory', + asOf: '2026-07-08', }, ], }, diff --git a/apps/sim/lib/compare/data/feature-catalog.ts b/apps/sim/lib/compare/data/feature-catalog.ts index 4f9c4b614db..2f57db7ba9a 100644 --- a/apps/sim/lib/compare/data/feature-catalog.ts +++ b/apps/sim/lib/compare/data/feature-catalog.ts @@ -417,19 +417,9 @@ export const SIM_FEATURES: SimFeature[] = [ 'This is a genuine git-like fork/diff/promote/rollback system scoped to an entire workspace, not a single-workflow versioning feature. Most workflow-automation competitors only version individual workflows, not whole environments with cross-environment resource remapping.', sources: [ { - url: 'https://github.com/simstudioai/sim/blob/main/packages/db/schema.ts', - label: 'Sim codebase: workspaceForkResourceMap / workspaceForkPromoteRun tables', - asOf: '2026-07-02', - }, - { - url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/lib/workspaces/fork/promote/promote.ts', - label: 'Sim codebase: fork promote engine', - asOf: '2026-07-02', - }, - { - url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/app/api/workspaces/[id]/fork/route.ts', - label: 'Sim codebase: fork creation API', - asOf: '2026-07-02', + url: 'https://docs.sim.ai/platform/enterprise/forks', + label: 'Sim Docs: Workspace Forks', + asOf: '2026-07-08', }, ], }, @@ -444,19 +434,9 @@ export const SIM_FEATURES: SimFeature[] = [ 'Treating credentials/env-vars as required-and-blocking on promote (rather than silently copying secrets) is a specific, auditable safety design for enterprise dev→qa→prod pipelines.', sources: [ { - url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/lib/workspaces/fork/create-fork.ts', - label: 'Sim codebase: fork creation (credentials cleared)', - asOf: '2026-07-02', - }, - { - url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/lib/workspaces/fork/remap/remap-references.ts', - label: 'Sim codebase: required-kinds remap/block logic', - asOf: '2026-07-02', - }, - { - url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/app/api/workspaces/[id]/fork/mapping/route.ts', - label: 'Sim codebase: fork credential mapping API', - asOf: '2026-07-02', + url: 'https://docs.sim.ai/platform/enterprise/forks', + label: 'Sim Docs: Workspace Forks (mappings)', + asOf: '2026-07-08', }, ], }, @@ -469,9 +449,9 @@ export const SIM_FEATURES: SimFeature[] = [ 'Forking/promotion is gated on the billed account having Enterprise-tier access on hosted Sim, mirroring the same access-gate pattern used for SSO. Self-hosted deployments can enable it independent of billing via a FORKING_ENABLED/NEXT_PUBLIC_FORKING_ENABLED environment flag.', sources: [ { - url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/lib/workspaces/fork/lineage/authz.ts', - label: 'Sim codebase: assertForkingEnabled / assertCanFork', - asOf: '2026-07-02', + url: 'https://docs.sim.ai/platform/enterprise/forks', + label: 'Sim Docs: Workspace Forks (self-hosted setup)', + asOf: '2026-07-08', }, ], }, diff --git a/apps/sim/lib/compare/data/sim.ts b/apps/sim/lib/compare/data/sim.ts index c6f00502eba..06ccaf4e4d4 100644 --- a/apps/sim/lib/compare/data/sim.ts +++ b/apps/sim/lib/compare/data/sim.ts @@ -18,12 +18,13 @@ export const simProfile: CompetitorProfile = { { title: 'AI Copilot / Chat agent-building surface', description: - 'A natural-language surface (Chat) and in-editor Copilot that can explain, suggest, and build workflow changes directly, backed by a dedicated copilot module with its own tool registry.', - shortDescription: 'Chat and in-editor Copilot suggest and build workflow changes directly.', + 'A workspace-wide natural-language surface (Chat) that can build workflows, manage data, and take actions across integrations, plus an in-editor Copilot scoped to building and editing a single workflow directly.', + shortDescription: + 'Chat builds and manages work across the workspace; in-editor Copilot edits a single workflow.', source: { url: 'https://docs.sim.ai/copilot', label: 'Sim Docs: Copilot', - asOf: '2026-07-02', + asOf: '2026-07-08', }, }, { @@ -56,9 +57,9 @@ export const simProfile: CompetitorProfile = { 'Fork a whole workspace into a dev/qa/prod-style child environment, preview a diff, and promote changes bidirectionally. Credential and env-var remapping is required on every promote, so secrets never cross environments silently.', shortDescription: 'Fork, diff, and promote environments with mandatory credential remapping.', source: { - url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/lib/workspaces/fork/promote/promote.ts', - label: 'Sim codebase: fork promote engine', - asOf: '2026-07-02', + url: 'https://docs.sim.ai/platform/enterprise/forks', + label: 'Sim Docs: Workspace Forks', + asOf: '2026-07-08', }, }, { @@ -100,13 +101,13 @@ export const simProfile: CompetitorProfile = { { title: 'Smaller integration catalog than the largest generalist automation platforms', description: - "Sim ships 302 first-party blocks and roughly 3,900 underlying tool actions. Platforms like Zapier (9,000+ apps) or Pipedream (3,000+ apps) list larger raw app counts. Sim's MCP support lets teams add custom integrations beyond the built-in catalog.", + "Sim ships 266 first-party blocks and roughly 3,900 underlying tool actions. Platforms like Zapier (9,000+ apps) or Pipedream (3,000+ apps) list larger raw app counts. Sim's MCP support lets teams add custom integrations beyond the built-in catalog.", shortDescription: - "302 blocks and ~3,900 tool actions, versus Zapier and Pipedream's larger raw app counts.", + "266 blocks and ~3,900 tool actions, versus Zapier and Pipedream's larger raw app counts.", source: { url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/blocks/registry-maps.ts', label: 'Sim codebase: BLOCK_REGISTRY count', - asOf: '2026-07-02', + asOf: '2026-07-08', }, }, { @@ -129,22 +130,24 @@ export const simProfile: CompetitorProfile = { confidence: 'verified', sources: [ { - url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/blocks/registry-maps.ts', - label: 'Sim codebase: block registry', - asOf: '2026-07-02', + url: 'https://docs.sim.ai/introduction', + label: 'Sim Docs: Introduction (visual, natural-language, and API/SDK building)', + asOf: '2026-07-08', }, ], }, learningCurve: { - value: 'Low for visual building; natural-language Chat surface for non-technical builders', - detail: 'Chat lets users describe a workflow in plain language and have Sim build it.', + value: + 'Low for visual building; natural-language Chat surface (with a workflow-scoped Copilot) for non-technical builders', + detail: + 'Chat lets users describe a workflow in plain language and have Sim scaffold or edit it; the visual canvas requires no code to connect blocks.', shortValue: 'Low, plus natural-language Chat for non-technical users', - confidence: 'verified', + confidence: 'estimated', sources: [ { - url: 'https://docs.sim.ai/copilot', - label: 'Sim Docs: Copilot', - asOf: '2026-07-02', + url: 'https://docs.sim.ai/introduction', + label: 'Sim Docs: Introduction (visual, natural-language, and API/SDK building)', + asOf: '2026-07-08', }, ], }, @@ -174,9 +177,9 @@ export const simProfile: CompetitorProfile = { confidence: 'verified', sources: [ { - url: 'https://docs.sim.ai/platform/costs', - label: 'Sim Docs: Cost calculation & billing', - asOf: '2026-07-02', + url: 'https://docs.sim.ai/platform/self-hosting', + label: 'Sim Docs: Self-Hosting', + asOf: '2026-07-08', }, { url: 'https://www.sim.ai/pricing', @@ -187,14 +190,14 @@ export const simProfile: CompetitorProfile = { }, templates: { value: - 'Yes: pre-built workflow template library across categories (Marketing, Sales, Finance, Support, AI)', - shortValue: 'Templates across Marketing, Sales, Finance, Support, AI', + 'No: the pre-built workflow template gallery (landing and in-workspace) was removed platform-wide. Sim now surfaces per-integration starter prompts instead of a template library.', + shortValue: 'No template gallery; per-integration starter prompts only', confidence: 'verified', sources: [ { - url: 'https://www.sim.ai/blog/openai-vs-n8n-vs-sim', - label: 'Sim blog: OpenAI AgentKit vs n8n vs Sim', - asOf: '2026-07-02', + url: 'https://github.com/simstudioai/sim/commit/df5ad7d45f4fd38ab724e7726b083c2b928a1542', + label: 'Sim codebase: templates gallery and APIs removed', + asOf: '2026-07-08', }, ], }, @@ -219,14 +222,9 @@ export const simProfile: CompetitorProfile = { confidence: 'verified', sources: [ { - url: 'https://github.com/simstudioai/sim/blob/main/packages/db/schema.ts', - label: 'Sim codebase: workspaceForkResourceMap / workspaceForkPromoteRun', - asOf: '2026-07-02', - }, - { - url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/lib/workspaces/fork/promote/promote.ts', - label: 'Sim codebase: fork promote engine', - asOf: '2026-07-02', + url: 'https://docs.sim.ai/platform/enterprise/forks', + label: 'Sim Docs: Workspace Forks', + asOf: '2026-07-08', }, ], }, @@ -277,9 +275,14 @@ export const simProfile: CompetitorProfile = { confidence: 'verified', sources: [ { - url: 'https://docs.sim.ai/files', - label: 'Sim Docs: Files', - asOf: '2026-07-02', + url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/app/workspace/%5BworkspaceId%5D/files/components/share-modal/share-modal.tsx', + label: 'Sim codebase: file share modal (password/email/SSO modes)', + asOf: '2026-07-08', + }, + { + url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/app/workspace/%5BworkspaceId%5D/settings/components/recently-deleted/recently-deleted.tsx', + label: 'Sim codebase: Recently Deleted (files, folders, and other resources)', + asOf: '2026-07-08', }, ], }, @@ -325,6 +328,31 @@ export const simProfile: CompetitorProfile = { }, ], }, + customBlocks: { + value: + "Yes: a user with admin access on a workflow's workspace can publish its deployed version as a named, iconed custom block that appears in the block toolbar for the whole organization. Inputs are read live from the source workflow's Start block; the publisher picks which outputs to expose. The block always runs the source workflow's latest deployed version, and its internal steps and intermediate values are never exposed to consumers", + detail: + 'Enterprise-gated on Sim Cloud; self-hosted deployments can opt in via a feature flag. Distinct from the Workflow (sub-workflow) block, which composes a workflow the same author controls, and from custom code/tool blocks, which run inline code rather than a full deployed workflow.', + shortValue: 'Publish a deployed workflow as an org-wide reusable block', + confidence: 'verified', + sources: [ + { + url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/app/api/custom-blocks/route.ts', + label: 'Sim codebase: custom-blocks publish API (admin gate)', + asOf: '2026-07-08', + }, + { + url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/blocks/custom/build-config.ts', + label: 'Sim codebase: custom-block config builder', + asOf: '2026-07-08', + }, + { + url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/app/workspace/%5BworkspaceId%5D/settings/navigation.ts', + label: 'Sim codebase: Custom blocks nav entry (Enterprise/self-hosted gating)', + asOf: '2026-07-08', + }, + ], + }, }, aiCapabilities: { multiLlmSupport: { @@ -369,25 +397,24 @@ export const simProfile: CompetitorProfile = { }, knowledgeBaseRag: { value: - 'Yes: native hybrid vector (pgvector) + keyword search knowledge base, 11 supported file formats, configurable chunking, plus 51 connectors that continuously sync external sources (Google Drive, Confluence, Slack, Gmail, GitHub, HubSpot, Linear, Jira, and more) into the knowledge base rather than a one-shot upload', - shortValue: - 'Hybrid vector + keyword search, 11 file formats, 51 continuously-synced connectors', + 'Yes: hybrid vector (pgvector) plus full-text (tsvector) search knowledge base, 11 supported file formats (csv, doc, docx, html, json, md, pdf, pptx, txt, xlsx, yaml), configurable chunking, plus 51 connectors that continuously sync external sources (Google Drive, Confluence, Slack, Gmail, GitHub, HubSpot, Linear, Jira, and more) into the knowledge base rather than a one-shot upload', + shortValue: 'Hybrid vector + full-text search, 11 file formats, 51 connectors', confidence: 'verified', sources: [ { url: 'https://github.com/simstudioai/sim/blob/main/packages/db/schema.ts', label: 'Sim codebase: KB schema (pgvector + tsvector)', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { - url: 'https://docs.sim.ai/knowledgebase', - label: 'Sim Docs: Knowledge Base document types', - asOf: '2026-07-02', + url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/lib/file-parsers/index.ts', + label: 'Sim codebase: file-parser registry (11 format families)', + asOf: '2026-07-08', }, { url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/connectors/registry.ts', label: 'Sim codebase: connector registry (51 connectors)', - asOf: '2026-07-04', + asOf: '2026-07-08', }, ], }, @@ -449,19 +476,29 @@ export const simProfile: CompetitorProfile = { }, generativeMedia: { value: - 'Yes: dedicated image (4 provider families incl. OpenAI, Gemini, Fal.ai proxy), video (5+ provider families incl. Runway, Veo, Luma, Hailuo, Fal.ai proxy), text-to-speech (7 providers), and speech-to-text (5 providers) blocks', + 'Yes: dedicated image (3 provider families incl. OpenAI, Gemini, Fal.ai proxy), video (5 provider families incl. Runway, Veo, Luma, Hailuo, Fal.ai proxy), text-to-speech (7 providers), and speech-to-text (5 providers) blocks', shortValue: 'Image, video, text-to-speech, and speech-to-text blocks', confidence: 'verified', sources: [ { url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/blocks/blocks/image_generator.ts', label: 'Sim codebase: Image Generator V2', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/blocks/blocks/video_generator.ts', label: 'Sim codebase: Video Generator V3', - asOf: '2026-07-02', + asOf: '2026-07-08', + }, + { + url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/blocks/blocks/tts.ts', + label: 'Sim codebase: TTS block (7 providers)', + asOf: '2026-07-08', + }, + { + url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/blocks/blocks/stt.ts', + label: 'Sim codebase: STT block (5 providers)', + asOf: '2026-07-08', }, ], }, @@ -586,16 +623,16 @@ export const simProfile: CompetitorProfile = { integrations: { integrationCount: { value: - '1,000+ integrations counting individual API actions, built from 302 first-party blocks and roughly 3,900 underlying tool actions', + '1,000+ integrations counting individual API actions, built from 266 first-party blocks and roughly 3,900 underlying tool actions', detail: 'Sim\'s landing page cites the "1,000+ integrations" figure; the block/tool-action counts are the same integration surface measured at a different level of granularity.', - shortValue: '1,000+ integrations (302 blocks, ~3,900 tool actions)', + shortValue: '1,000+ integrations (266 blocks, ~3,900 tool actions)', confidence: 'verified', sources: [ { url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/blocks/registry-maps.ts', label: 'Sim codebase: BLOCK_REGISTRY', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://docs.sim.ai/tools', @@ -647,19 +684,21 @@ export const simProfile: CompetitorProfile = { }, apiPublishing: { value: - 'Yes: versioned public REST API (/api/v1) with rollback, streaming (SSE) execution responses with a resumable event buffer, an API-trigger block, and a chat-deployment surface', - shortValue: 'Versioned REST API with rollback and streaming execution', + 'Yes: a public REST API (mostly under /api/, with /api/v1 reserved for logs and audit-log endpoints) supporting API-triggered workflow execution and deployment rollback', + detail: + 'The API reference does not document SSE streaming, a resumable event buffer, a dedicated API-trigger block, or a chat-deployment surface as part of the REST API itself.', + shortValue: 'REST API (partially versioned) with rollback support', confidence: 'verified', sources: [ { url: 'https://docs.sim.ai/api-reference/getting-started', label: 'Sim Docs: API Reference - Getting Started', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://docs.sim.ai/execution/api', label: 'Sim Docs: External API', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -733,19 +772,19 @@ export const simProfile: CompetitorProfile = { }, freeTier: { value: - 'Yes: Free plan with 1,000 monthly credits (worth $5, env-configurable) refreshed daily, no credit card required', - shortValue: 'Free plan, 1,000 credits/month, no card required', + 'Yes: Free plan with 1,000 monthly credits (worth $5, env-configurable), granted monthly with no daily refresh (daily refresh is a paid-plan feature)', + shortValue: 'Free plan, 1,000 credits/month', confidence: 'verified', sources: [ { url: 'https://www.sim.ai/pricing', label: 'Sim Pricing', - asOf: '2026-07-02', + asOf: '2026-07-08', }, { url: 'https://github.com/simstudioai/sim/blob/main/apps/sim/lib/billing/constants.ts', label: 'Sim codebase: DEFAULT_FREE_CREDITS', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -962,16 +1001,16 @@ export const simProfile: CompetitorProfile = { }, thirdPartyVetting: { value: - "Yes: every one of Sim's 302 blocks is first-party authored and code-reviewed through the standard pull-request process in the main Sim repository; there is no public marketplace where an arbitrary third party can publish and have other users install executable tool code without going through Sim's own review", + "Yes: every one of Sim's 266 blocks is first-party authored and code-reviewed through the standard pull-request process in the main Sim repository; there is no public marketplace where an arbitrary third party can publish and have other users install executable tool code without going through Sim's own review", detail: "Custom code steps run inside Sim's own isolated-vm sandbox rather than as an installable third-party skill package, so the supply-chain trust boundary is Sim's codebase review, not an open registry.", - shortValue: 'All 302 blocks are first-party authored and code-reviewed', + shortValue: 'All 266 blocks are first-party authored and code-reviewed', confidence: 'verified', sources: [ { url: 'https://github.com/simstudioai/sim/tree/main/apps/sim/blocks/blocks', label: 'Sim codebase: first-party block directory', - asOf: '2026-07-02', + asOf: '2026-07-08', }, ], }, @@ -1137,14 +1176,14 @@ export const simProfile: CompetitorProfile = { }, sla: { value: - 'Yes: the Enterprise plan includes a dedicated support SLA, negotiated per contract; specific response-time and uptime figures are not published on the self-serve pricing page', - shortValue: 'Enterprise SLA included (contract-based)', + 'Yes: the Enterprise plan includes a "Dedicated Support" feature per the pricing plan-comparison table; no SLA terminology, response-time, or uptime figures are published on the enterprise or pricing pages', + shortValue: "Enterprise 'Dedicated Support' flag; no published SLA terms", confidence: 'verified', sources: [ { - url: 'https://sim.ai/enterprise', - label: 'Sim Enterprise Page', - asOf: '2026-07-02', + url: 'https://www.sim.ai/pricing', + label: 'Sim Pricing Page', + asOf: '2026-07-08', }, ], }, diff --git a/apps/sim/lib/compare/data/types.ts b/apps/sim/lib/compare/data/types.ts index 052823aaef8..91dc96c0065 100644 --- a/apps/sim/lib/compare/data/types.ts +++ b/apps/sim/lib/compare/data/types.ts @@ -66,6 +66,8 @@ export interface ComparisonFacts { richTextEditor: Fact /** Calling one saved workflow as a reusable step inside another workflow (composition/nesting), versus only being able to duplicate or manually re-wire the same logic per workflow. */ subWorkflows: Fact + /** Publishing a deployed workflow/flow as a reusable, named block with its own icon/inputs/outputs that appears in the block toolbar for other org members to drop into their own workflows, without needing access to the underlying flow — distinct from subWorkflows (same-author composition) and from custom code/tool blocks. */ + customBlocks: Fact } aiCapabilities: { multiLlmSupport: Fact diff --git a/apps/sim/lib/blog/code.tsx b/apps/sim/lib/content/code.tsx similarity index 87% rename from apps/sim/lib/blog/code.tsx rename to apps/sim/lib/content/code.tsx index dc7436f7ad5..16436e52ccb 100644 --- a/apps/sim/lib/blog/code.tsx +++ b/apps/sim/lib/content/code.tsx @@ -9,7 +9,7 @@ interface CodeBlockProps { export function CodeBlock({ code, language }: CodeBlockProps) { return ( -
+
-

FAQ

+

FAQ

{items.map((it, i) => (
-

+

{it.q}

diff --git a/apps/sim/lib/blog/mdx.tsx b/apps/sim/lib/content/mdx.tsx similarity index 77% rename from apps/sim/lib/blog/mdx.tsx rename to apps/sim/lib/content/mdx.tsx index 83835579009..8d6d840b12c 100644 --- a/apps/sim/lib/blog/mdx.tsx +++ b/apps/sim/lib/content/mdx.tsx @@ -1,11 +1,11 @@ import clsx from 'clsx' import type { MDXRemoteProps } from 'next-mdx-remote/rsc' -import { CodeBlock } from '@/lib/blog/code' -import { BlogImage } from '@/app/(landing)/blog/components/blog-image' +import { CodeBlock } from '@/lib/content/code' +import { ContentImage } from '@/app/(landing)/components/content-image' export const mdxComponents: MDXRemoteProps['components'] = { img: (props: any) => ( - {children} @@ -26,7 +26,7 @@ export const mdxComponents: MDXRemoteProps['components'] = {

{children}

@@ -35,7 +35,7 @@ export const mdxComponents: MDXRemoteProps['components'] = {

{children}

@@ -44,7 +44,7 @@ export const mdxComponents: MDXRemoteProps['components'] = {

), ul: (props: any) => ( @@ -52,7 +52,7 @@ export const mdxComponents: MDXRemoteProps['components'] = { {...props} style={{ fontSize: '19px', marginBottom: '1rem', fontWeight: '400' }} className={clsx( - 'list-outside list-disc pl-6 text-[var(--landing-text-muted)] leading-relaxed', + 'list-outside list-disc pl-6 text-[var(--text-body)] leading-relaxed', props.className )} /> @@ -62,7 +62,7 @@ export const mdxComponents: MDXRemoteProps['components'] = { {...props} style={{ fontSize: '19px', marginBottom: '1rem', fontWeight: '400' }} className={clsx( - 'list-outside list-decimal pl-6 text-[var(--landing-text-muted)] leading-relaxed', + 'list-outside list-decimal pl-6 text-[var(--text-body)] leading-relaxed', props.className )} /> @@ -71,10 +71,12 @@ export const mdxComponents: MDXRemoteProps['components'] = { strong: (props: any) => ( ), - em: (props: any) => , + em: (props: any) => ( + + ), a: (props: any) => { const isAnchorLink = props.className?.includes('anchor') if (isAnchorLink) { @@ -84,7 +86,7 @@ export const mdxComponents: MDXRemoteProps['components'] = { @@ -96,7 +98,7 @@ export const mdxComponents: MDXRemoteProps['components'] = { hr: (props: any) => (


), @@ -140,7 +142,7 @@ export const mdxComponents: MDXRemoteProps['components'] = { Promise>> +> + +export interface ContentRegistryConfig { + /** Directory holding one folder per post (`//index.mdx`). */ + contentDir: string + /** Directory holding one JSON file per author, shared across sections. */ + authorsDir: string + /** Per-slug custom MDX component overrides, merged over the base `mdxComponents` map. */ + componentLoaders?: ContentComponentLoaders +} + +export interface ContentRegistry { + getAllPostMeta: () => Promise + getPostBySlug: (slug: string) => Promise + getAllTags: () => Promise + getRelatedPosts: (slug: string, limit?: number) => Promise + getNavPosts: () => Promise[]> + invalidateCaches: () => void +} + +function slugifyHeading(text: string): string { + return text + .toLowerCase() + .trim() + .replace(/[^a-z0-9\s-]/g, '') + .replace(/\s+/g, '-') +} + +/** + * Author JSON is shared across every section (blog, library, ...) that + * points at the same `authorsDir`. Cache the parsed result per directory at + * module scope so multiple registry instantiations never re-read/re-parse + * the same author files. + */ +const authorsCacheByDir = new Map>>() + +async function loadAuthorsForDir(authorsDir: string): Promise> { + const cached = authorsCacheByDir.get(authorsDir) + if (cached) return cached + const promise = (async () => { + await fs.mkdir(authorsDir, { recursive: true }) + const files = await fs.readdir(authorsDir).catch(() => []) + const authors: Record = {} + for (const file of files) { + if (!file.endsWith('.json')) continue + const raw = await fs.readFile(path.join(authorsDir, file), 'utf-8') + const json = JSON.parse(raw) + const author = AuthorSchema.parse(json) + authors[author.id] = author + } + return authors + })() + authorsCacheByDir.set(authorsDir, promise) + return promise +} + +/** + * Builds an independent content registry (frontmatter scanning, MDX + * compilation, tag/related-post derivation, in-memory caching) over a single + * content directory. Each call owns its own post-level cache state via + * closures, so separate instantiations (e.g. blog vs. library) never + * collide, while the shared author pool is cached once per `authorsDir` + * (see `loadAuthorsForDir`). + */ +export function createContentRegistry(config: ContentRegistryConfig): ContentRegistry { + const { contentDir, authorsDir, componentLoaders = {} } = config + + const postComponentsRegistry: Record> = {} + let cachedMeta: ContentMeta[] | null = null + + async function loadAuthors(): Promise> { + return loadAuthorsForDir(authorsDir) + } + + async function scanFrontmatters(): Promise { + if (cachedMeta) { + return cachedMeta + } + await ensureContentDirs(contentDir, authorsDir) + const entries = await fs.readdir(contentDir).catch(() => []) + const authorsMap = await loadAuthors() + const results = await Promise.all( + entries.map(async (slug): Promise => { + const postDir = path.join(contentDir, slug) + const stat = await fs.stat(postDir).catch(() => null) + if (!stat || !stat.isDirectory()) return null + const mdxPath = path.join(postDir, 'index.mdx') + const hasMdx = await fs + .stat(mdxPath) + .then((s) => s.isFile()) + .catch(() => false) + if (!hasMdx) return null + const raw = await fs.readFile(mdxPath, 'utf-8') + const { data, content: mdxContent } = matter(raw) + const fm = ContentFrontmatterSchema.parse(data) + const wordCount = mdxContent + .replace(/```[\s\S]*?```/g, '') + .replace(/import\s+.*?from\s+['"].*?['"]/g, '') + .replace(/<[^>]+>/g, '') + .replace(/[#*_~`[\]()!|>-]/g, '') + .split(/\s+/) + .filter((w) => w.length > 0).length + const authors = fm.authors.map((id) => authorsMap[id]).filter(Boolean) + if (authors.length === 0) throw new Error(`Authors not found for "${slug}"`) + return { + slug: fm.slug, + title: fm.title, + description: fm.description, + date: toIsoDate(fm.date), + updated: fm.updated ? toIsoDate(fm.updated) : undefined, + author: authors[0], + authors, + readingTime: fm.readingTime, + tags: fm.tags, + ogImage: fm.ogImage, + canonical: fm.canonical, + ogAlt: fm.ogAlt, + about: fm.about, + timeRequired: fm.timeRequired, + faq: fm.faq, + wordCount, + draft: fm.draft, + featured: fm.featured ?? false, + } + }) + ) + cachedMeta = results.filter((result): result is ContentMeta => result !== null).sort(byDateDesc) + return cachedMeta + } + + async function getAllPostMeta(): Promise { + return (await scanFrontmatters()).filter((p) => !p.draft) + } + + /** + * Featured + 5 most recent posts for a navbar dropdown preview. Reserved + * for a future Blog/Library nav dropdown (same "defined but not yet wired + * up" pattern as `PLATFORM_MENU`/`SOLUTIONS_MENU` in + * `navbar/components/nav-menu-chip/constants.ts`); currently unconsumed. + */ + const getNavPosts = cache( + async (): Promise[]> => { + const allPosts = await getAllPostMeta() + const featuredPost = allPosts.find((p) => p.featured) ?? allPosts[0] + if (!featuredPost) return [] + const recentPosts = allPosts.filter((p) => p.slug !== featuredPost.slug).slice(0, 5) + return [featuredPost, ...recentPosts].map((p) => ({ + slug: p.slug, + title: p.title, + ogImage: p.ogImage, + })) + } + ) + + async function getAllTags(): Promise { + const posts = await getAllPostMeta() + const counts: Record = {} + for (const p of posts) { + for (const t of p.tags) counts[t] = (counts[t] || 0) + 1 + } + return Object.entries(counts) + .map(([tag, count]) => ({ tag, count })) + .sort((a, b) => b.count - a.count || a.tag.localeCompare(b.tag)) + } + + async function loadPostComponents(slug: string): Promise> { + if (postComponentsRegistry[slug]) { + return postComponentsRegistry[slug] + } + + const loader = componentLoaders[slug] + if (!loader) { + postComponentsRegistry[slug] = {} + return {} + } + + try { + const postComponents = await loader() + postComponentsRegistry[slug] = postComponents + return postComponents + } catch { + postComponentsRegistry[slug] = {} + return {} + } + } + + async function getPostBySlug(slug: string): Promise { + const meta = await scanFrontmatters() + const found = meta.find((m) => m.slug === slug) + if (!found) throw new Error(`Post not found: ${slug}`) + const mdxPath = path.join(contentDir, slug, 'index.mdx') + const raw = await fs.readFile(mdxPath, 'utf-8') + const { content, data } = matter(raw) + const fm = ContentFrontmatterSchema.parse(data) + + const postComponents = await loadPostComponents(slug) + const mergedComponents = { ...mdxComponents, ...postComponents } + + const compiled = await compileMDX({ + source: content, + components: mergedComponents as any, + options: { + parseFrontmatter: false, + mdxOptions: { + remarkPlugins: [remarkGfm], + rehypePlugins: [ + rehypeSlug, + [rehypeAutolinkHeadings, { behavior: 'wrap', properties: { className: 'anchor' } }], + ], + }, + }, + }) + const headings: { text: string; id: string }[] = [] + const lines = content.split('\n') + for (const line of lines) { + const match = /^##\s+(.+)$/.exec(line.trim()) + if (match) { + const text = match[1].trim() + headings.push({ text, id: slugifyHeading(text) }) + } + } + return { + ...found, + Content: () => (compiled as any).content, + updated: fm.updated ? toIsoDate(fm.updated) : found.updated, + headings, + } + } + + async function getRelatedPosts(slug: string, limit = 3): Promise { + const posts = await getAllPostMeta() + const current = posts.find((p) => p.slug === slug) + if (!current) return [] + const others = posts.filter((p) => p.slug !== slug) + return others + .map((p) => ({ + post: p, + score: p.tags.filter((t) => current.tags.includes(t)).length, + })) + .sort((a, b) => b.score - a.score || byDateDesc(a.post, b.post)) + .slice(0, limit) + .map((x) => x.post) + } + + function invalidateCaches() { + cachedMeta = null + authorsCacheByDir.delete(authorsDir) + Object.keys(postComponentsRegistry).forEach((key) => delete postComponentsRegistry[key]) + } + + return { + getAllPostMeta, + getPostBySlug, + getAllTags, + getRelatedPosts, + getNavPosts, + invalidateCaches, + } +} diff --git a/apps/sim/lib/blog/schema.ts b/apps/sim/lib/content/schema.ts similarity index 79% rename from apps/sim/lib/blog/schema.ts rename to apps/sim/lib/content/schema.ts index 81f9e6567de..731caaaa213 100644 --- a/apps/sim/lib/blog/schema.ts +++ b/apps/sim/lib/content/schema.ts @@ -12,7 +12,12 @@ export const AuthorSchema = z export type Author = z.infer -export const BlogFrontmatterSchema = z +/** + * Frontmatter schema shared by every content section (blog, library, and any + * future section). Section-specific behavior lives in the section's registry + * instantiation, not in this schema. + */ +export const ContentFrontmatterSchema = z .object({ slug: z.string().min(1), title: z.string().min(5), @@ -40,9 +45,9 @@ export const BlogFrontmatterSchema = z }) .strict() -export type BlogFrontmatter = z.infer +export type ContentFrontmatter = z.infer -export interface BlogMeta { +export interface ContentMeta { slug: string title: string description: string @@ -61,10 +66,9 @@ export interface BlogMeta { canonical: string draft: boolean featured: boolean - sourcePath?: string } -export interface BlogPost extends BlogMeta { +export interface ContentPost extends ContentMeta { Content: React.ComponentType headings?: { text: string; id: string }[] } diff --git a/apps/sim/lib/content/seo.ts b/apps/sim/lib/content/seo.ts new file mode 100644 index 00000000000..e6896715910 --- /dev/null +++ b/apps/sim/lib/content/seo.ts @@ -0,0 +1,366 @@ +import type { Metadata } from 'next' +import type { Author, ContentMeta } from '@/lib/content/schema' +import { SITE_URL } from '@/lib/core/utils/urls' +import { withFilteredNoindex } from '@/lib/landing/seo' + +/** + * Identifies the content section a post/collection belongs to, so the + * generic SEO builders below can emit section-correct breadcrumbs and + * collection metadata without hardcoding "Blog"/"/blog" anywhere. + */ +export interface ContentSection { + /** Display name, e.g. "Blog" or "Library". */ + name: string + /** Route base path, e.g. "/blog" or "/library". */ + basePath: string + /** Collection-page description used in `CollectionPage` JSON-LD. */ + description: string +} + +export function buildPostMetadata(post: ContentMeta): Metadata { + const base = new URL(post.canonical) + const baseUrl = `${base.protocol}//${base.host}` + return { + title: post.title, + description: post.description, + keywords: post.tags, + authors: (post.authors && post.authors.length > 0 ? post.authors : [post.author]).map((a) => ({ + name: a.name, + url: a.url, + })), + creator: post.author.name, + publisher: 'Sim', + robots: post.draft + ? { index: false, follow: false, googleBot: { index: false, follow: false } } + : { index: true, follow: true, googleBot: { index: true, follow: true } }, + alternates: { canonical: post.canonical }, + openGraph: { + title: post.title, + description: post.description, + url: post.canonical, + siteName: 'Sim', + locale: 'en_US', + type: 'article', + publishedTime: post.date, + modifiedTime: post.updated ?? post.date, + authors: (post.authors && post.authors.length > 0 ? post.authors : [post.author]).map( + (a) => a.name + ), + tags: post.tags, + images: [ + { + url: post.ogImage.startsWith('http') ? post.ogImage : `${baseUrl}${post.ogImage}`, + width: 1200, + height: 630, + alt: post.ogAlt || post.title, + }, + ], + }, + twitter: { + card: 'summary_large_image', + title: post.title, + description: post.description, + images: [post.ogImage], + creator: post.author.url?.includes('x.com') ? `@${post.author.xHandle || ''}` : undefined, + site: '@simdotai', + }, + other: { + 'article:published_time': post.date, + 'article:modified_time': post.updated ?? post.date, + 'article:author': post.author.name, + 'article:section': 'Technology', + }, + } +} + +export function buildArticleJsonLd(post: ContentMeta) { + return { + '@type': 'TechArticle', + url: post.canonical, + headline: post.title, + description: post.description, + image: [ + { + '@type': 'ImageObject', + url: post.ogImage, + width: 1200, + height: 630, + caption: post.ogAlt || post.title, + }, + ], + datePublished: post.date, + dateModified: post.updated ?? post.date, + wordCount: post.wordCount, + proficiencyLevel: 'Beginner', + author: (post.authors && post.authors.length > 0 ? post.authors : [post.author]).map((a) => ({ + '@type': 'Person', + name: a.name, + url: a.url, + ...(a.url ? { sameAs: [a.url] } : {}), + })), + publisher: { + '@type': 'Organization', + name: 'Sim', + url: SITE_URL, + logo: { + '@type': 'ImageObject', + url: `${SITE_URL}/logo/primary/medium.png`, + }, + }, + mainEntityOfPage: { + '@type': 'WebPage', + '@id': post.canonical, + }, + keywords: post.tags.join(', '), + about: (post.about || []).map((a) => ({ '@type': 'Thing', name: a })), + isAccessibleForFree: true, + timeRequired: post.timeRequired, + articleSection: 'Technology', + inLanguage: 'en-US', + speakable: { + '@type': 'SpeakableSpecification', + cssSelector: ['[itemprop="headline"]', '[itemprop="description"]'], + }, + } +} + +export function buildBreadcrumbJsonLd(post: ContentMeta, section: ContentSection) { + return { + '@type': 'BreadcrumbList', + itemListElement: [ + { '@type': 'ListItem', position: 1, name: 'Home', item: SITE_URL }, + { + '@type': 'ListItem', + position: 2, + name: section.name, + item: `${SITE_URL}${section.basePath}`, + }, + { '@type': 'ListItem', position: 3, name: post.title, item: post.canonical }, + ], + } +} + +export function buildFaqJsonLd(items: { q: string; a: string }[] | undefined) { + if (!items || items.length === 0) return null + return { + '@type': 'FAQPage', + mainEntity: items.map((it) => ({ + '@type': 'Question', + name: it.q, + acceptedAnswer: { '@type': 'Answer', text: it.a }, + })), + } +} + +export function buildPostGraphJsonLd(post: ContentMeta, section: ContentSection) { + const graph: Record[] = [ + buildArticleJsonLd(post), + buildBreadcrumbJsonLd(post, section), + ] + + const faq = buildFaqJsonLd(post.faq) + if (faq) { + graph.push(faq) + } + + return { + '@context': 'https://schema.org', + '@graph': graph, + } +} + +/** + * Filtered/paginated index variants render genuinely different lists, but + * only the bare index is indexable — same policy as the integrations and + * models catalogs — so canonical always points at the unfiltered index and + * the variant itself is noindexed rather than asking Google to index every + * tag/page permutation. + */ +export function buildIndexMetadata( + section: ContentSection, + { tag, pageNum }: { tag?: string; pageNum: number } +): Metadata { + const titleParts = [section.name] + if (tag) titleParts.push(tag) + if (pageNum > 1) titleParts.push(`Page ${pageNum}`) + const title = titleParts.join(' | ') + + const description = tag + ? `Sim ${section.name.toLowerCase()} posts tagged "${tag}": ${section.description}` + : section.description + + const canonical = `${SITE_URL}${section.basePath}` + const isFiltered = Boolean(tag) || pageNum > 1 + + return withFilteredNoindex( + { + title, + description, + alternates: { canonical }, + openGraph: { + title: `${title} | Sim`, + description, + url: canonical, + siteName: 'Sim', + locale: 'en_US', + type: 'website', + images: [ + { + url: `${SITE_URL}/logo/primary/medium.png`, + width: 1200, + height: 630, + alt: `Sim ${section.name}`, + }, + ], + }, + twitter: { + card: 'summary_large_image', + title: `${title} | Sim`, + description, + site: '@simdotai', + }, + }, + isFiltered + ) +} + +export function buildTagsMetadata(section: ContentSection): Metadata { + const canonical = `${SITE_URL}${section.basePath}/tags` + const description = `Browse Sim ${section.name.toLowerCase()} posts by topic: AI agents, workflows, integrations, and more.` + return { + title: 'Tags', + description, + alternates: { canonical }, + openGraph: { + title: `${section.name} Tags | Sim`, + description, + url: canonical, + siteName: 'Sim', + locale: 'en_US', + type: 'website', + }, + twitter: { + card: 'summary', + title: `${section.name} Tags | Sim`, + description, + site: '@simdotai', + }, + } +} + +export function buildTagsBreadcrumbJsonLd(section: ContentSection) { + return { + '@context': 'https://schema.org', + '@type': 'BreadcrumbList', + itemListElement: [ + { '@type': 'ListItem', position: 1, name: 'Home', item: SITE_URL }, + { + '@type': 'ListItem', + position: 2, + name: section.name, + item: `${SITE_URL}${section.basePath}`, + }, + { + '@type': 'ListItem', + position: 3, + name: 'Tags', + item: `${SITE_URL}${section.basePath}/tags`, + }, + ], + } +} + +export function buildAuthorMetadata( + section: ContentSection, + id: string, + author?: Author +): Metadata { + const name = author?.name ?? 'Author' + const canonical = `${SITE_URL}${section.basePath}/authors/${id}` + const description = `Read articles by ${name} on the Sim ${section.name.toLowerCase()}.` + return { + title: `${name} | Sim ${section.name}`, + description, + alternates: { canonical }, + openGraph: { + title: `${name} | Sim ${section.name}`, + description, + url: canonical, + siteName: 'Sim', + type: 'profile', + ...(author?.avatarUrl + ? { images: [{ url: author.avatarUrl, width: 400, height: 400, alt: name }] } + : {}), + }, + twitter: { + card: 'summary', + title: `${name} | Sim ${section.name}`, + description, + site: '@simdotai', + ...(author?.xHandle ? { creator: `@${author.xHandle}` } : {}), + }, + } +} + +export function buildAuthorGraphJsonLd(section: ContentSection, author: Author) { + return { + '@context': 'https://schema.org', + '@graph': [ + { + '@type': 'Person', + name: author.name, + url: `${SITE_URL}${section.basePath}/authors/${author.id}`, + sameAs: author.url ? [author.url] : [], + image: author.avatarUrl, + worksFor: { + '@type': 'Organization', + name: 'Sim', + url: SITE_URL, + }, + }, + { + '@type': 'BreadcrumbList', + itemListElement: [ + { '@type': 'ListItem', position: 1, name: 'Home', item: SITE_URL }, + { + '@type': 'ListItem', + position: 2, + name: section.name, + item: `${SITE_URL}${section.basePath}`, + }, + { + '@type': 'ListItem', + position: 3, + name: author.name, + item: `${SITE_URL}${section.basePath}/authors/${author.id}`, + }, + ], + }, + ], + } +} + +export function buildCollectionPageJsonLd(section: ContentSection) { + return { + '@context': 'https://schema.org', + '@type': 'CollectionPage', + name: `Sim ${section.name}`, + url: `${SITE_URL}${section.basePath}`, + description: section.description, + publisher: { + '@type': 'Organization', + name: 'Sim', + url: SITE_URL, + logo: { + '@type': 'ImageObject', + url: `${SITE_URL}/logo/primary/medium.png`, + }, + }, + inLanguage: 'en-US', + isPartOf: { + '@type': 'WebSite', + name: 'Sim', + url: SITE_URL, + }, + } +} diff --git a/apps/sim/lib/content/utils.ts b/apps/sim/lib/content/utils.ts new file mode 100644 index 00000000000..931a251db0f --- /dev/null +++ b/apps/sim/lib/content/utils.ts @@ -0,0 +1,24 @@ +import fs from 'fs/promises' + +export async function ensureContentDirs(contentDir: string, authorsDir: string) { + await fs.mkdir(contentDir, { recursive: true }) + await fs.mkdir(authorsDir, { recursive: true }) +} + +export function toIsoDate(value: Date | string | number): string { + if (value instanceof Date) return value.toISOString() + return new Date(value).toISOString() +} + +export function byDateDesc(a: T, b: T) { + return new Date(b.date).getTime() - new Date(a.date).getTime() +} + +/** Most recent `updated ?? date` across a set of posts, or `undefined` if empty. */ +export function latestModified( + posts: T[] +): Date | undefined { + return posts.length > 0 + ? new Date(Math.max(...posts.map((p) => new Date(p.updated ?? p.date).getTime()))) + : undefined +} diff --git a/apps/sim/lib/copilot/chat/workspace-context.ts b/apps/sim/lib/copilot/chat/workspace-context.ts index df8447b2015..7558b06f56c 100644 --- a/apps/sim/lib/copilot/chat/workspace-context.ts +++ b/apps/sim/lib/copilot/chat/workspace-context.ts @@ -10,6 +10,7 @@ import { } from '@sim/db/schema' import { createLogger } from '@sim/logger' import { toError } from '@sim/utils/errors' +import { truncate } from '@sim/utils/string' import { and, eq, inArray, isNull } from 'drizzle-orm' import type { VfsSnapshotV1, @@ -305,7 +306,7 @@ export function buildWorkspaceMd(data: WorkspaceMdData): string { if (j.lifecycle !== 'persistent') line += ` [${j.lifecycle}]` if (j.cronExpression) line += `, cron: ${j.cronExpression}` if (j.sourceTaskName) line += `, task: ${j.sourceTaskName}` - const promptPreview = j.prompt.length > 80 ? `${j.prompt.slice(0, 77)}...` : j.prompt + const promptPreview = j.prompt.length > 80 ? truncate(j.prompt, 77) : j.prompt line += `\n ${promptPreview}` return line }) diff --git a/apps/sim/lib/copilot/tools/server/files/doc-compile.ts b/apps/sim/lib/copilot/tools/server/files/doc-compile.ts index e27e94734d9..b9a6ea0a260 100644 --- a/apps/sim/lib/copilot/tools/server/files/doc-compile.ts +++ b/apps/sim/lib/copilot/tools/server/files/doc-compile.ts @@ -1,5 +1,6 @@ import { createLogger } from '@sim/logger' import { sha256Hex } from '@sim/security/hash' +import { getErrorMessage } from '@sim/utils/errors' import { isE2BDocEnabled } from '@/lib/core/config/env-flags' import { isFeatureEnabled } from '@/lib/core/config/feature-flags' import { executeInE2B, executeShellInE2B, type SandboxFile } from '@/lib/execution/e2b' @@ -152,7 +153,7 @@ async function stageReferencedImages(source: string, workspaceId: string): Promi logger.warn('Failed to resolve referenced image for doc compile', { workspaceId, fileId, - error: err instanceof Error ? err.message : String(err), + error: getErrorMessage(err), }) continue } @@ -177,7 +178,7 @@ async function stageReferencedImages(source: string, workspaceId: string): Promi logger.warn('Failed to stage referenced image for doc compile', { workspaceId, fileId, - error: err instanceof Error ? err.message : String(err), + error: getErrorMessage(err), }) continue } diff --git a/apps/sim/lib/copilot/tools/server/files/doc-compiled-store.ts b/apps/sim/lib/copilot/tools/server/files/doc-compiled-store.ts index 470cffef323..b0c8242bde5 100644 --- a/apps/sim/lib/copilot/tools/server/files/doc-compiled-store.ts +++ b/apps/sim/lib/copilot/tools/server/files/doc-compiled-store.ts @@ -1,5 +1,6 @@ import { createHash } from 'node:crypto' import { createLogger } from '@sim/logger' +import { getErrorMessage, toError } from '@sim/utils/errors' import { downloadFile, uploadFile } from '@/lib/uploads/core/storage-service' const logger = createLogger('CopilotDocCompiledStore') @@ -63,8 +64,8 @@ export async function storeCompiledDoc( } catch (err) { logger.error('Failed to store compiled doc artifact', { key, - error: err instanceof Error ? err.message : String(err), + error: getErrorMessage(err), }) - throw err instanceof Error ? err : new Error(String(err)) + throw toError(err) } } diff --git a/apps/sim/lib/copilot/tools/server/files/file-intent-store.test.ts b/apps/sim/lib/copilot/tools/server/files/file-intent-store.test.ts index e10e9978c26..be6852763c3 100644 --- a/apps/sim/lib/copilot/tools/server/files/file-intent-store.test.ts +++ b/apps/sim/lib/copilot/tools/server/files/file-intent-store.test.ts @@ -1,3 +1,4 @@ +import { generateShortId } from '@sim/utils/id' import { describe, expect, it, vi } from 'vitest' import { consumeLatestFileIntent, @@ -23,7 +24,7 @@ function makeIntent(overrides: Partial): PendingFileIntent { } function uniqueWorkspace(): string { - return `ws-${Math.random().toString(36).slice(2)}` + return `ws-${generateShortId()}` } describe('file-intent-store channel scoping', () => { diff --git a/apps/sim/lib/copilot/tools/server/knowledge/knowledge-base.ts b/apps/sim/lib/copilot/tools/server/knowledge/knowledge-base.ts index cbdfd91a6e2..97dd20c9d8d 100644 --- a/apps/sim/lib/copilot/tools/server/knowledge/knowledge-base.ts +++ b/apps/sim/lib/copilot/tools/server/knowledge/knowledge-base.ts @@ -3,6 +3,7 @@ import { knowledgeConnector } from '@sim/db/schema' import { createLogger } from '@sim/logger' import { getErrorMessage, toError } from '@sim/utils/errors' import { generateId } from '@sim/utils/id' +import { truncate } from '@sim/utils/string' import { and, eq, isNull } from 'drizzle-orm' import { generateInternalToken } from '@/lib/auth/internal' import { checkActorUsageLimits } from '@/lib/billing/calculations/usage-monitor' @@ -265,7 +266,7 @@ export const knowledgeBaseServerTool: BaseServerTool 50 ? '...' : ''}"`, + message: `Found ${results.length} result(s) for query "${truncate(args.query, 50)}"`, data: { knowledgeBaseId: args.knowledgeBaseId, knowledgeBaseName: kb.name, diff --git a/apps/sim/lib/copilot/tools/server/table/user-table.ts b/apps/sim/lib/copilot/tools/server/table/user-table.ts index ef1a8fed1b2..9e24963856a 100644 --- a/apps/sim/lib/copilot/tools/server/table/user-table.ts +++ b/apps/sim/lib/copilot/tools/server/table/user-table.ts @@ -506,20 +506,6 @@ export const userTableServerTool: BaseServerTool return { success: false, message: 'Workspace ID is required' } } - const positions = args.positions as number[] | undefined - if (positions !== undefined && positions.length !== args.rows.length) { - return { - success: false, - message: `positions length (${positions.length}) must match rows length (${args.rows.length})`, - } - } - if (positions !== undefined && new Set(positions).size !== positions.length) { - return { - success: false, - message: 'positions must not contain duplicate values', - } - } - const table = await getTableById(args.tableId) if (!table || table.workspaceId !== workspaceId) { return { success: false, message: `Table not found: ${args.tableId}` } @@ -535,7 +521,6 @@ export const userTableServerTool: BaseServerTool rows: args.rows.map((r: RowData) => rowDataNameToId(r, idByName)), workspaceId, userId: context.userId, - positions, }, table, requestId diff --git a/apps/sim/lib/core/config/env.ts b/apps/sim/lib/core/config/env.ts index 1d992f2b03c..d7903b9a380 100644 --- a/apps/sim/lib/core/config/env.ts +++ b/apps/sim/lib/core/config/env.ts @@ -79,8 +79,7 @@ export const env = createEnv({ ENTERPRISE_TIER_COST_LIMIT: z.number().optional(), // Cost limit for enterprise tier users ENTERPRISE_STORAGE_LIMIT_GB: z.number().optional().default(500), // Default storage limit in GB for enterprise tier (can be overridden per org) BILLING_ENABLED: z.boolean().optional(), // Enable billing enforcement and usage tracking - FREE_API_DEPLOYMENT_GATE_ENABLED: z.boolean().optional(), // Block free-plan accounts from programmatic execution (API/MCP/generic webhooks/chat embeds). Requires BILLING_ENABLED. Off by default for dark rollout - TABLES_FRACTIONAL_ORDERING: z.boolean().optional(), // Order table rows by fractional order_key (O(1) insert/delete) instead of integer position + FREE_API_DEPLOYMENT_GATE_ENABLED: z.boolean().optional(), // Block free-plan accounts from programmatic execution (API/MCP/A2A/generic webhooks/chat embeds). Requires BILLING_ENABLED. Off by default for dark rollout TABLE_SNAPSHOT_CACHE: z.boolean().optional(), // Mount tables into sandboxes by reference via a version-keyed CSV snapshot in object storage instead of draining the whole table into web-process heap PII_REDACTION: z.boolean().optional(), // Redact PII from workflow logs via configurable Data Retention rules (Presidio at the logger persist choke point) and expose the Data Retention config UI PII_GRANULAR_REDACTION: z.boolean().optional(), // Expose the execution-altering PII redaction stages (redact workflow input + block outputs in-flight) in the Data Retention config; layered on top of PII_REDACTION diff --git a/apps/sim/lib/core/config/feature-flags.test.ts b/apps/sim/lib/core/config/feature-flags.test.ts index d9a251d472f..8c9b95a7556 100644 --- a/apps/sim/lib/core/config/feature-flags.test.ts +++ b/apps/sim/lib/core/config/feature-flags.test.ts @@ -46,9 +46,9 @@ function withAppConfig(doc: unknown) { } /** - * `isFeatureEnabled` only accepts registered `FeatureFlagName`s. The registry is - * empty in this PR, so tests reference flags through the AppConfig document and - * cast their throwaway names through this helper. + * `isFeatureEnabled` only accepts registered `FeatureFlagName`s. These tests + * exercise the evaluation logic with throwaway flag names supplied through the + * AppConfig document, cast to `FeatureFlagName` through this helper. */ const enabled = (flag: string, ctx?: FeatureFlagContext) => isFeatureEnabled(flag as FeatureFlagName, ctx) @@ -62,7 +62,6 @@ describe('getFeatureFlags', () => { it('derives flags from fallback secrets when AppConfig is disabled, without fetching', async () => { const flags = await getFeatureFlags() // All registered flags should be present, disabled (env vars unset in test env) - expect(flags['tables-fractional-ordering']).toEqual({ enabled: false }) expect(flags['mothership-beta']).toEqual({ enabled: false }) expect(flags['pii-redaction']).toEqual({ enabled: false }) expect(flags['pii-granular-redaction']).toEqual({ enabled: false }) @@ -91,7 +90,6 @@ describe('getFeatureFlags', () => { flagRef.isAppConfigEnabled = true mockFetch.mockResolvedValue(null) const flags = await getFeatureFlags() - expect(flags['tables-fractional-ordering']).toEqual({ enabled: false }) expect(flags['mothership-beta']).toEqual({ enabled: false }) expect(flags['pii-redaction']).toEqual({ enabled: false }) expect(flags['pii-granular-redaction']).toEqual({ enabled: false }) diff --git a/apps/sim/lib/core/config/feature-flags.ts b/apps/sim/lib/core/config/feature-flags.ts index 1f345632c6b..8a44624ba78 100644 --- a/apps/sim/lib/core/config/feature-flags.ts +++ b/apps/sim/lib/core/config/feature-flags.ts @@ -62,10 +62,6 @@ interface FeatureFlagDefinition { /** The single registry of known flags. To add a flag, add one entry here. */ const FEATURE_FLAGS = { - 'tables-fractional-ordering': { - description: 'Order table rows by fractional order_key instead of legacy integer position', - fallback: 'TABLES_FRACTIONAL_ORDERING', - }, 'mothership-beta': { description: 'Mothership beta plan/changelog artifact surfaces in the copilot VFS and doc compiler. ' + diff --git a/apps/sim/lib/core/rate-limiter/hosted-key/hosted-key-rate-limiter.test.ts b/apps/sim/lib/core/rate-limiter/hosted-key/hosted-key-rate-limiter.test.ts index b14a34c634d..1d3b3b10cb9 100644 --- a/apps/sim/lib/core/rate-limiter/hosted-key/hosted-key-rate-limiter.test.ts +++ b/apps/sim/lib/core/rate-limiter/hosted-key/hosted-key-rate-limiter.test.ts @@ -1,3 +1,4 @@ +import { sleep } from '@sim/utils/helpers' import { afterEach, beforeEach, describe, expect, it, type Mock, vi } from 'vitest' import type { ConsumeResult, @@ -413,7 +414,7 @@ describe('HostedKeyRateLimiter', () => { controller.signal ) // Let the first bucket check run and the sleep begin, then abort. - await new Promise((resolve) => setTimeout(resolve, 20)) + await sleep(20) controller.abort() const result = await promise diff --git a/apps/sim/lib/core/security/deployment.ts b/apps/sim/lib/core/security/deployment.ts index 9b102bd9527..c87b49a20d2 100644 --- a/apps/sim/lib/core/security/deployment.ts +++ b/apps/sim/lib/core/security/deployment.ts @@ -1,6 +1,7 @@ import { safeCompare } from '@sim/security/compare' import { sha256Hex } from '@sim/security/hash' import { hmacSha256Hex } from '@sim/security/hmac' +import { normalizeEmail } from '@sim/utils/string' import type { NextResponse } from 'next/server' import { env } from '@/lib/core/config/env' import { isDev } from '@/lib/core/config/env-flags' @@ -114,8 +115,8 @@ export function setDeploymentAuthCookie( * sides, so callers don't need to normalize before calling. */ export function isEmailAllowed(email: string, allowedEmails: string[]): boolean { - const normalizedEmail = email.trim().toLowerCase() - const normalizedAllowed = allowedEmails.map((allowed) => allowed.trim().toLowerCase()) + const normalizedEmail = normalizeEmail(email) + const normalizedAllowed = allowedEmails.map(normalizeEmail) if (normalizedAllowed.includes(normalizedEmail)) { return true diff --git a/apps/sim/lib/core/utils/background.test.ts b/apps/sim/lib/core/utils/background.test.ts index dd4fad698ba..750b32fe116 100644 --- a/apps/sim/lib/core/utils/background.test.ts +++ b/apps/sim/lib/core/utils/background.test.ts @@ -1,10 +1,11 @@ /** * @vitest-environment node */ +import { sleep } from '@sim/utils/helpers' import { describe, expect, it, vi } from 'vitest' import { runDetached } from '@/lib/core/utils/background' -const flushMicrotasks = () => new Promise((resolve) => setTimeout(resolve, 0)) +const flushMicrotasks = () => sleep(0) describe('runDetached', () => { it('runs the work without the caller awaiting it', async () => { diff --git a/apps/sim/lib/core/utils/multipart.ts b/apps/sim/lib/core/utils/multipart.ts index f23969def51..f43a4e23fc8 100644 --- a/apps/sim/lib/core/utils/multipart.ts +++ b/apps/sim/lib/core/utils/multipart.ts @@ -1,5 +1,6 @@ import { Readable } from 'node:stream' import type { ReadableStream as NodeReadableStream } from 'node:stream/web' +import { getErrorMessage } from '@sim/utils/errors' import busboy from 'busboy' /** @@ -115,12 +116,7 @@ export function readMultipart( limits: { fileSize: maxFileBytes, files: 1 }, }) } catch (err) { - reject( - new MultipartError( - 'NOT_MULTIPART', - err instanceof Error ? err.message : 'Invalid multipart request' - ) - ) + reject(new MultipartError('NOT_MULTIPART', getErrorMessage(err, 'Invalid multipart request'))) return } @@ -228,7 +224,7 @@ export function readMultipart( }) bb.on('error', (err) => { - const message = err instanceof Error ? err.message : 'Failed to parse multipart body' + const message = getErrorMessage(err, 'Failed to parse multipart body') settle(() => reject(new MultipartError('PARSE_ERROR', message))) }) @@ -243,10 +239,7 @@ export function readMultipart( reject( err instanceof MultipartError ? err - : new MultipartError( - 'PARSE_ERROR', - err instanceof Error ? err.message : 'Failed to read request body' - ) + : new MultipartError('PARSE_ERROR', getErrorMessage(err, 'Failed to read request body')) ) ) }) diff --git a/apps/sim/lib/events/pubsub.ts b/apps/sim/lib/events/pubsub.ts index f866d8d1459..e8a36b5522e 100644 --- a/apps/sim/lib/events/pubsub.ts +++ b/apps/sim/lib/events/pubsub.ts @@ -7,6 +7,7 @@ import { EventEmitter } from 'events' import { createLogger } from '@sim/logger' +import { noop } from '@sim/utils/helpers' import Redis, { type RedisOptions } from 'ioredis' import { env } from '@/lib/core/config/env' import { getRedisConnectionDefaults } from '@/lib/core/config/redis' @@ -99,7 +100,6 @@ class RedisPubSubChannel implements PubSubChannel { this.disposed = true this.handlers.clear() - const noop = () => {} this.pub.removeAllListeners() this.sub.removeAllListeners() this.pub.on('error', noop) diff --git a/apps/sim/lib/execution/e2b.ts b/apps/sim/lib/execution/e2b.ts index ccefb86cf98..21c50af09b5 100644 --- a/apps/sim/lib/execution/e2b.ts +++ b/apps/sim/lib/execution/e2b.ts @@ -173,7 +173,7 @@ async function readSandboxOutputFile( } catch (error) { logger.warn('Failed to read requested sandbox output file', { outputSandboxPath, - error: error instanceof Error ? error.message : String(error), + error: getErrorMessage(error), }) return undefined } diff --git a/apps/sim/lib/execution/sandbox/bundles/docx.cjs b/apps/sim/lib/execution/sandbox/bundles/docx.cjs index f94ae48b832..01697107612 100644 --- a/apps/sim/lib/execution/sandbox/bundles/docx.cjs +++ b/apps/sim/lib/execution/sandbox/bundles/docx.cjs @@ -1,27 +1,42 @@ // sandbox bundle: docx // generated by apps/sim/lib/execution/sandbox/bundles/build.ts // do not edit by hand. run `bun run build:sandbox-bundles` to regenerate. -(()=>{var F7=Object.create;var{getPrototypeOf:N7,defineProperty:F8,getOwnPropertyNames:R7}=Object;var D7=Object.prototype.hasOwnProperty;function A7($){return this[$]}var P7,T7,C7=($,U,Y)=>{var Z=$!=null&&typeof $==="object";if(Z){var J=U?P7??=new WeakMap:T7??=new WeakMap,G=J.get($);if(G)return G}Y=$!=null?F7(N7($)):{};let X=U||!$||!$.__esModule?F8(Y,"default",{value:$,enumerable:!0}):Y;for(let Q of R7($))if(!D7.call(X,Q))F8(X,Q,{get:A7.bind($,Q),enumerable:!0});if(Z)J.set($,X);return X};var O7=($,U)=>()=>(U||$((U={exports:{}}).exports,U),U.exports);var k7=($)=>$;function E7($,U){this[$]=k7.bind(null,U)}var S7=($,U)=>{for(var Y in U)F8($,Y,{get:U[Y],enumerable:!0,configurable:!0,set:E7.bind(U,Y)})};var iU=O7((hB,pU)=>{var A0=pU.exports={},i0,r0;function S8(){throw Error("setTimeout has not been defined")}function v8(){throw Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function")i0=setTimeout;else i0=S8}catch($){i0=S8}try{if(typeof clearTimeout==="function")r0=clearTimeout;else r0=v8}catch($){r0=v8}})();function mU($){if(i0===setTimeout)return setTimeout($,0);if((i0===S8||!i0)&&setTimeout)return i0=setTimeout,setTimeout($,0);try{return i0($,0)}catch(U){try{return i0.call(null,$,0)}catch(Y){return i0.call(this,$,0)}}}function Xq($){if(r0===clearTimeout)return clearTimeout($);if((r0===v8||!r0)&&clearTimeout)return r0=clearTimeout,clearTimeout($);try{return r0($)}catch(U){try{return r0.call(null,$)}catch(Y){return r0.call(this,$)}}}var X2=[],g2=!1,T2,O1=-1;function Vq(){if(!g2||!T2)return;if(g2=!1,T2.length)X2=T2.concat(X2);else O1=-1;if(X2.length)lU()}function lU(){if(g2)return;var $=mU(Vq);g2=!0;var U=X2.length;while(U){T2=X2,X2=[];while(++O11)for(var Y=1;Y"u")DU.global=globalThis;var a0=[],u0=[],N8="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(A2=0,AU=N8.length;A20)throw Error("Invalid string. Length must be a multiple of 4");var Y=$.indexOf("=");if(Y===-1)Y=U;var Z=Y===U?0:4-Y%4;return[Y,Z]}function _7($,U){return($+U)*3/4-U}function y7($){var U,Y=v7($),Z=Y[0],J=Y[1],G=new Uint8Array(_7(Z,J)),X=0,Q=J>0?Z-4:Z,B;for(B=0;B>16&255,G[X++]=U>>8&255,G[X++]=U&255;if(J===2)U=u0[$.charCodeAt(B)]<<2|u0[$.charCodeAt(B+1)]>>4,G[X++]=U&255;if(J===1)U=u0[$.charCodeAt(B)]<<10|u0[$.charCodeAt(B+1)]<<4|u0[$.charCodeAt(B+2)]>>2,G[X++]=U>>8&255,G[X++]=U&255;return G}function b7($){return a0[$>>18&63]+a0[$>>12&63]+a0[$>>6&63]+a0[$&63]}function g7($,U,Y){var Z,J=[];for(var G=U;GQ?Q:X+G));if(Z===1)U=$[Y-1],J.push(a0[U>>2]+a0[U<<4&63]+"==");else if(Z===2)U=($[Y-2]<<8)+$[Y-1],J.push(a0[U>>10]+a0[U>>4&63]+a0[U<<2&63]+"=");return J.join("")}function T1($,U,Y,Z,J){var G,X,Q=J*8-Z-1,B=(1<>1,z=-7,W=Y?J-1:0,k=Y?-1:1,D=$[U+W];W+=k,G=D&(1<<-z)-1,D>>=-z,z+=Q;for(;z>0;G=G*256+$[U+W],W+=k,z-=8);X=G&(1<<-z)-1,G>>=-z,z+=Z;for(;z>0;X=X*256+$[U+W],W+=k,z-=8);if(G===0)G=1-F;else if(G===B)return X?NaN:(D?-1:1)*(1/0);else X=X+Math.pow(2,Z),G=G-F;return(D?-1:1)*X*Math.pow(2,G-Z)}function EU($,U,Y,Z,J,G){var X,Q,B,F=G*8-J-1,z=(1<>1,k=J===23?Math.pow(2,-24)-Math.pow(2,-77):0,D=Z?0:G-1,C=Z?1:-1,H=U<0||U===0&&1/U<0?1:0;if(U=Math.abs(U),isNaN(U)||U===1/0)Q=isNaN(U)?1:0,X=z;else{if(X=Math.floor(Math.log(U)/Math.LN2),U*(B=Math.pow(2,-X))<1)X--,B*=2;if(X+W>=1)U+=k/B;else U+=k*Math.pow(2,1-W);if(U*B>=2)X++,B/=2;if(X+W>=z)Q=0,X=z;else if(X+W>=1)Q=(U*B-1)*Math.pow(2,J),X=X+W;else Q=U*Math.pow(2,W-1)*Math.pow(2,J),X=0}for(;J>=8;$[Y+D]=Q&255,D+=C,Q/=256,J-=8);X=X<0;$[Y+D]=X&255,D+=C,X/=256,F-=8);$[Y+D-C]|=H*128}var TU=typeof Symbol==="function"&&typeof Symbol.for==="function"?Symbol.for("nodejs.util.inspect.custom"):null,x7=50,R8=2147483647;var{btoa:EB,atob:SB,File:vB,Blob:_B}=globalThis;function q2($){if($>R8)throw RangeError('The value "'+$+'" is invalid for option "size"');let U=new Uint8Array($);return Object.setPrototypeOf(U,G0.prototype),U}function C8($,U,Y){return class extends Y{constructor(){super();Object.defineProperty(this,"message",{value:U.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${$}]`,this.stack,delete this.name}get code(){return $}set code(Z){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Z,writable:!0})}toString(){return`${this.name} [${$}]: ${this.message}`}}}var f7=C8("ERR_BUFFER_OUT_OF_BOUNDS",function($){if($)return`${$} is outside of buffer bounds`;return"Attempt to access memory outside buffer bounds"},RangeError),h7=C8("ERR_INVALID_ARG_TYPE",function($,U){return`The "${$}" argument must be of type number. Received type ${typeof U}`},TypeError),D8=C8("ERR_OUT_OF_RANGE",function($,U,Y){let Z=`The value of "${$}" is out of range.`,J=Y;if(Number.isInteger(Y)&&Math.abs(Y)>4294967296)J=kU(String(Y));else if(typeof Y==="bigint"){if(J=String(Y),Y>BigInt(2)**BigInt(32)||Y<-(BigInt(2)**BigInt(32)))J=kU(J);J+="n"}return Z+=` It must be ${U}. Received ${J}`,Z},RangeError);function G0($,U,Y){if(typeof $==="number"){if(typeof U==="string")throw TypeError('The "string" argument must be of type string. Received type number');return O8($)}return SU($,U,Y)}Object.defineProperty(G0.prototype,"parent",{enumerable:!0,get:function(){if(!G0.isBuffer(this))return;return this.buffer}});Object.defineProperty(G0.prototype,"offset",{enumerable:!0,get:function(){if(!G0.isBuffer(this))return;return this.byteOffset}});G0.poolSize=8192;function SU($,U,Y){if(typeof $==="string")return d7($,U);if(ArrayBuffer.isView($))return c7($);if($==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof $);if(p0($,ArrayBuffer)||$&&p0($.buffer,ArrayBuffer))return P8($,U,Y);if(typeof SharedArrayBuffer<"u"&&(p0($,SharedArrayBuffer)||$&&p0($.buffer,SharedArrayBuffer)))return P8($,U,Y);if(typeof $==="number")throw TypeError('The "value" argument must not be of type number. Received type number');let Z=$.valueOf&&$.valueOf();if(Z!=null&&Z!==$)return G0.from(Z,U,Y);let J=m7($);if(J)return J;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof $[Symbol.toPrimitive]==="function")return G0.from($[Symbol.toPrimitive]("string"),U,Y);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof $)}G0.from=function($,U,Y){return SU($,U,Y)};Object.setPrototypeOf(G0.prototype,Uint8Array.prototype);Object.setPrototypeOf(G0,Uint8Array);function vU($){if(typeof $!=="number")throw TypeError('"size" argument must be of type number');else if($<0)throw RangeError('The value "'+$+'" is invalid for option "size"')}function u7($,U,Y){if(vU($),$<=0)return q2($);if(U!==void 0)return typeof Y==="string"?q2($).fill(U,Y):q2($).fill(U);return q2($)}G0.alloc=function($,U,Y){return u7($,U,Y)};function O8($){return vU($),q2($<0?0:k8($)|0)}G0.allocUnsafe=function($){return O8($)};G0.allocUnsafeSlow=function($){return O8($)};function d7($,U){if(typeof U!=="string"||U==="")U="utf8";if(!G0.isEncoding(U))throw TypeError("Unknown encoding: "+U);let Y=_U($,U)|0,Z=q2(Y),J=Z.write($,U);if(J!==Y)Z=Z.slice(0,J);return Z}function A8($){let U=$.length<0?0:k8($.length)|0,Y=q2(U);for(let Z=0;Z=R8)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+R8.toString(16)+" bytes");return $|0}G0.isBuffer=function($){return $!=null&&$._isBuffer===!0&&$!==G0.prototype};G0.compare=function($,U){if(p0($,Uint8Array))$=G0.from($,$.offset,$.byteLength);if(p0(U,Uint8Array))U=G0.from(U,U.offset,U.byteLength);if(!G0.isBuffer($)||!G0.isBuffer(U))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if($===U)return 0;let Y=$.length,Z=U.length;for(let J=0,G=Math.min(Y,Z);JZ.length){if(!G0.isBuffer(G))G=G0.from(G);G.copy(Z,J)}else Uint8Array.prototype.set.call(Z,G,J);else if(!G0.isBuffer(G))throw TypeError('"list" argument must be an Array of Buffers');else G.copy(Z,J);J+=G.length}return Z};function _U($,U){if(G0.isBuffer($))return $.length;if(ArrayBuffer.isView($)||p0($,ArrayBuffer))return $.byteLength;if(typeof $!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof $);let Y=$.length,Z=arguments.length>2&&arguments[2]===!0;if(!Z&&Y===0)return 0;let J=!1;for(;;)switch(U){case"ascii":case"latin1":case"binary":return Y;case"utf8":case"utf-8":return T8($).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y*2;case"hex":return Y>>>1;case"base64":return cU($).length;default:if(J)return Z?-1:T8($).length;U=(""+U).toLowerCase(),J=!0}}G0.byteLength=_U;function l7($,U,Y){let Z=!1;if(U===void 0||U<0)U=0;if(U>this.length)return"";if(Y===void 0||Y>this.length)Y=this.length;if(Y<=0)return"";if(Y>>>=0,U>>>=0,Y<=U)return"";if(!$)$="utf8";while(!0)switch($){case"hex":return $q(this,U,Y);case"utf8":case"utf-8":return bU(this,U,Y);case"ascii":return t7(this,U,Y);case"latin1":case"binary":return e7(this,U,Y);case"base64":return n7(this,U,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Uq(this,U,Y);default:if(Z)throw TypeError("Unknown encoding: "+$);$=($+"").toLowerCase(),Z=!0}}G0.prototype._isBuffer=!0;function P2($,U,Y){let Z=$[U];$[U]=$[Y],$[Y]=Z}G0.prototype.swap16=function(){let $=this.length;if($%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let U=0;U<$;U+=2)P2(this,U,U+1);return this};G0.prototype.swap32=function(){let $=this.length;if($%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let U=0;U<$;U+=4)P2(this,U,U+3),P2(this,U+1,U+2);return this};G0.prototype.swap64=function(){let $=this.length;if($%8!==0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let U=0;U<$;U+=8)P2(this,U,U+7),P2(this,U+1,U+6),P2(this,U+2,U+5),P2(this,U+3,U+4);return this};G0.prototype.toString=function(){let $=this.length;if($===0)return"";if(arguments.length===0)return bU(this,0,$);return l7.apply(this,arguments)};G0.prototype.toLocaleString=G0.prototype.toString;G0.prototype.equals=function($){if(!G0.isBuffer($))throw TypeError("Argument must be a Buffer");if(this===$)return!0;return G0.compare(this,$)===0};G0.prototype.inspect=function(){let $="",U=x7;if($=this.toString("hex",0,U).replace(/(.{2})/g,"$1 ").trim(),this.length>U)$+=" ... ";return""};if(TU)G0.prototype[TU]=G0.prototype.inspect;G0.prototype.compare=function($,U,Y,Z,J){if(p0($,Uint8Array))$=G0.from($,$.offset,$.byteLength);if(!G0.isBuffer($))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof $);if(U===void 0)U=0;if(Y===void 0)Y=$?$.length:0;if(Z===void 0)Z=0;if(J===void 0)J=this.length;if(U<0||Y>$.length||Z<0||J>this.length)throw RangeError("out of range index");if(Z>=J&&U>=Y)return 0;if(Z>=J)return-1;if(U>=Y)return 1;if(U>>>=0,Y>>>=0,Z>>>=0,J>>>=0,this===$)return 0;let G=J-Z,X=Y-U,Q=Math.min(G,X),B=this.slice(Z,J),F=$.slice(U,Y);for(let z=0;z2147483647)Y=2147483647;else if(Y<-2147483648)Y=-2147483648;if(Y=+Y,Number.isNaN(Y))Y=J?0:$.length-1;if(Y<0)Y=$.length+Y;if(Y>=$.length)if(J)return-1;else Y=$.length-1;else if(Y<0)if(J)Y=0;else return-1;if(typeof U==="string")U=G0.from(U,Z);if(G0.isBuffer(U)){if(U.length===0)return-1;return CU($,U,Y,Z,J)}else if(typeof U==="number"){if(U=U&255,typeof Uint8Array.prototype.indexOf==="function")if(J)return Uint8Array.prototype.indexOf.call($,U,Y);else return Uint8Array.prototype.lastIndexOf.call($,U,Y);return CU($,[U],Y,Z,J)}throw TypeError("val must be string, number or Buffer")}function CU($,U,Y,Z,J){let G=1,X=$.length,Q=U.length;if(Z!==void 0){if(Z=String(Z).toLowerCase(),Z==="ucs2"||Z==="ucs-2"||Z==="utf16le"||Z==="utf-16le"){if($.length<2||U.length<2)return-1;G=2,X/=2,Q/=2,Y/=2}}function B(z,W){if(G===1)return z[W];else return z.readUInt16BE(W*G)}let F;if(J){let z=-1;for(F=Y;FX)Y=X-Q;for(F=Y;F>=0;F--){let z=!0;for(let W=0;WJ)Z=J;let G=U.length;if(Z>G/2)Z=G/2;let X;for(X=0;X>>0,isFinite(Y)){if(Y=Y>>>0,Z===void 0)Z="utf8"}else Z=Y,Y=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let J=this.length-U;if(Y===void 0||Y>J)Y=J;if($.length>0&&(Y<0||U<0)||U>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!Z)Z="utf8";let G=!1;for(;;)switch(Z){case"hex":return a7(this,$,U,Y);case"utf8":case"utf-8":return p7(this,$,U,Y);case"ascii":case"latin1":case"binary":return i7(this,$,U,Y);case"base64":return r7(this,$,U,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s7(this,$,U,Y);default:if(G)throw TypeError("Unknown encoding: "+Z);Z=(""+Z).toLowerCase(),G=!0}};G0.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function n7($,U,Y){if(U===0&&Y===$.length)return PU($);else return PU($.slice(U,Y))}function bU($,U,Y){Y=Math.min($.length,Y);let Z=[],J=U;while(J239?4:G>223?3:G>191?2:1;if(J+Q<=Y){let B,F,z,W;switch(Q){case 1:if(G<128)X=G;break;case 2:if(B=$[J+1],(B&192)===128){if(W=(G&31)<<6|B&63,W>127)X=W}break;case 3:if(B=$[J+1],F=$[J+2],(B&192)===128&&(F&192)===128){if(W=(G&15)<<12|(B&63)<<6|F&63,W>2047&&(W<55296||W>57343))X=W}break;case 4:if(B=$[J+1],F=$[J+2],z=$[J+3],(B&192)===128&&(F&192)===128&&(z&192)===128){if(W=(G&15)<<18|(B&63)<<12|(F&63)<<6|z&63,W>65535&&W<1114112)X=W}}}if(X===null)X=65533,Q=1;else if(X>65535)X-=65536,Z.push(X>>>10&1023|55296),X=56320|X&1023;Z.push(X),J+=Q}return o7(Z)}var OU=4096;function o7($){let U=$.length;if(U<=OU)return String.fromCharCode.apply(String,$);let Y="",Z=0;while(ZZ)Y=Z;let J="";for(let G=U;GY)$=Y;if(U<0){if(U+=Y,U<0)U=0}else if(U>Y)U=Y;if(U<$)U=$;let Z=this.subarray($,U);return Object.setPrototypeOf(Z,G0.prototype),Z};function E0($,U,Y){if($%1!==0||$<0)throw RangeError("offset is not uint");if($+U>Y)throw RangeError("Trying to access beyond buffer length")}G0.prototype.readUintLE=G0.prototype.readUIntLE=function($,U,Y){if($=$>>>0,U=U>>>0,!Y)E0($,U,this.length);let Z=this[$],J=1,G=0;while(++G>>0,U=U>>>0,!Y)E0($,U,this.length);let Z=this[$+--U],J=1;while(U>0&&(J*=256))Z+=this[$+--U]*J;return Z};G0.prototype.readUint8=G0.prototype.readUInt8=function($,U){if($=$>>>0,!U)E0($,1,this.length);return this[$]};G0.prototype.readUint16LE=G0.prototype.readUInt16LE=function($,U){if($=$>>>0,!U)E0($,2,this.length);return this[$]|this[$+1]<<8};G0.prototype.readUint16BE=G0.prototype.readUInt16BE=function($,U){if($=$>>>0,!U)E0($,2,this.length);return this[$]<<8|this[$+1]};G0.prototype.readUint32LE=G0.prototype.readUInt32LE=function($,U){if($=$>>>0,!U)E0($,4,this.length);return(this[$]|this[$+1]<<8|this[$+2]<<16)+this[$+3]*16777216};G0.prototype.readUint32BE=G0.prototype.readUInt32BE=function($,U){if($=$>>>0,!U)E0($,4,this.length);return this[$]*16777216+(this[$+1]<<16|this[$+2]<<8|this[$+3])};G0.prototype.readBigUInt64LE=z2(function($){$=$>>>0,b2($,"offset");let U=this[$],Y=this[$+7];if(U===void 0||Y===void 0)$1($,this.length-8);let Z=U+this[++$]*256+this[++$]*65536+this[++$]*16777216,J=this[++$]+this[++$]*256+this[++$]*65536+Y*16777216;return BigInt(Z)+(BigInt(J)<>>0,b2($,"offset");let U=this[$],Y=this[$+7];if(U===void 0||Y===void 0)$1($,this.length-8);let Z=U*16777216+this[++$]*65536+this[++$]*256+this[++$],J=this[++$]*16777216+this[++$]*65536+this[++$]*256+Y;return(BigInt(Z)<>>0,U=U>>>0,!Y)E0($,U,this.length);let Z=this[$],J=1,G=0;while(++G=J)Z-=Math.pow(2,8*U);return Z};G0.prototype.readIntBE=function($,U,Y){if($=$>>>0,U=U>>>0,!Y)E0($,U,this.length);let Z=U,J=1,G=this[$+--Z];while(Z>0&&(J*=256))G+=this[$+--Z]*J;if(J*=128,G>=J)G-=Math.pow(2,8*U);return G};G0.prototype.readInt8=function($,U){if($=$>>>0,!U)E0($,1,this.length);if(!(this[$]&128))return this[$];return(255-this[$]+1)*-1};G0.prototype.readInt16LE=function($,U){if($=$>>>0,!U)E0($,2,this.length);let Y=this[$]|this[$+1]<<8;return Y&32768?Y|4294901760:Y};G0.prototype.readInt16BE=function($,U){if($=$>>>0,!U)E0($,2,this.length);let Y=this[$+1]|this[$]<<8;return Y&32768?Y|4294901760:Y};G0.prototype.readInt32LE=function($,U){if($=$>>>0,!U)E0($,4,this.length);return this[$]|this[$+1]<<8|this[$+2]<<16|this[$+3]<<24};G0.prototype.readInt32BE=function($,U){if($=$>>>0,!U)E0($,4,this.length);return this[$]<<24|this[$+1]<<16|this[$+2]<<8|this[$+3]};G0.prototype.readBigInt64LE=z2(function($){$=$>>>0,b2($,"offset");let U=this[$],Y=this[$+7];if(U===void 0||Y===void 0)$1($,this.length-8);let Z=this[$+4]+this[$+5]*256+this[$+6]*65536+(Y<<24);return(BigInt(Z)<>>0,b2($,"offset");let U=this[$],Y=this[$+7];if(U===void 0||Y===void 0)$1($,this.length-8);let Z=(U<<24)+this[++$]*65536+this[++$]*256+this[++$];return(BigInt(Z)<>>0,!U)E0($,4,this.length);return T1(this,$,!0,23,4)};G0.prototype.readFloatBE=function($,U){if($=$>>>0,!U)E0($,4,this.length);return T1(this,$,!1,23,4)};G0.prototype.readDoubleLE=function($,U){if($=$>>>0,!U)E0($,8,this.length);return T1(this,$,!0,52,8)};G0.prototype.readDoubleBE=function($,U){if($=$>>>0,!U)E0($,8,this.length);return T1(this,$,!1,52,8)};function b0($,U,Y,Z,J,G){if(!G0.isBuffer($))throw TypeError('"buffer" argument must be a Buffer instance');if(U>J||U$.length)throw RangeError("Index out of range")}G0.prototype.writeUintLE=G0.prototype.writeUIntLE=function($,U,Y,Z){if($=+$,U=U>>>0,Y=Y>>>0,!Z){let X=Math.pow(2,8*Y)-1;b0(this,$,U,Y,X,0)}let J=1,G=0;this[U]=$&255;while(++G>>0,Y=Y>>>0,!Z){let X=Math.pow(2,8*Y)-1;b0(this,$,U,Y,X,0)}let J=Y-1,G=1;this[U+J]=$&255;while(--J>=0&&(G*=256))this[U+J]=$/G&255;return U+Y};G0.prototype.writeUint8=G0.prototype.writeUInt8=function($,U,Y){if($=+$,U=U>>>0,!Y)b0(this,$,U,1,255,0);return this[U]=$&255,U+1};G0.prototype.writeUint16LE=G0.prototype.writeUInt16LE=function($,U,Y){if($=+$,U=U>>>0,!Y)b0(this,$,U,2,65535,0);return this[U]=$&255,this[U+1]=$>>>8,U+2};G0.prototype.writeUint16BE=G0.prototype.writeUInt16BE=function($,U,Y){if($=+$,U=U>>>0,!Y)b0(this,$,U,2,65535,0);return this[U]=$>>>8,this[U+1]=$&255,U+2};G0.prototype.writeUint32LE=G0.prototype.writeUInt32LE=function($,U,Y){if($=+$,U=U>>>0,!Y)b0(this,$,U,4,4294967295,0);return this[U+3]=$>>>24,this[U+2]=$>>>16,this[U+1]=$>>>8,this[U]=$&255,U+4};G0.prototype.writeUint32BE=G0.prototype.writeUInt32BE=function($,U,Y){if($=+$,U=U>>>0,!Y)b0(this,$,U,4,4294967295,0);return this[U]=$>>>24,this[U+1]=$>>>16,this[U+2]=$>>>8,this[U+3]=$&255,U+4};function gU($,U,Y,Z,J){dU(U,Z,J,$,Y,7);let G=Number(U&BigInt(4294967295));$[Y++]=G,G=G>>8,$[Y++]=G,G=G>>8,$[Y++]=G,G=G>>8,$[Y++]=G;let X=Number(U>>BigInt(32)&BigInt(4294967295));return $[Y++]=X,X=X>>8,$[Y++]=X,X=X>>8,$[Y++]=X,X=X>>8,$[Y++]=X,Y}function xU($,U,Y,Z,J){dU(U,Z,J,$,Y,7);let G=Number(U&BigInt(4294967295));$[Y+7]=G,G=G>>8,$[Y+6]=G,G=G>>8,$[Y+5]=G,G=G>>8,$[Y+4]=G;let X=Number(U>>BigInt(32)&BigInt(4294967295));return $[Y+3]=X,X=X>>8,$[Y+2]=X,X=X>>8,$[Y+1]=X,X=X>>8,$[Y]=X,Y+8}G0.prototype.writeBigUInt64LE=z2(function($,U=0){return gU(this,$,U,BigInt(0),BigInt("0xffffffffffffffff"))});G0.prototype.writeBigUInt64BE=z2(function($,U=0){return xU(this,$,U,BigInt(0),BigInt("0xffffffffffffffff"))});G0.prototype.writeIntLE=function($,U,Y,Z){if($=+$,U=U>>>0,!Z){let Q=Math.pow(2,8*Y-1);b0(this,$,U,Y,Q-1,-Q)}let J=0,G=1,X=0;this[U]=$&255;while(++J>0)-X&255}return U+Y};G0.prototype.writeIntBE=function($,U,Y,Z){if($=+$,U=U>>>0,!Z){let Q=Math.pow(2,8*Y-1);b0(this,$,U,Y,Q-1,-Q)}let J=Y-1,G=1,X=0;this[U+J]=$&255;while(--J>=0&&(G*=256)){if($<0&&X===0&&this[U+J+1]!==0)X=1;this[U+J]=($/G>>0)-X&255}return U+Y};G0.prototype.writeInt8=function($,U,Y){if($=+$,U=U>>>0,!Y)b0(this,$,U,1,127,-128);if($<0)$=255+$+1;return this[U]=$&255,U+1};G0.prototype.writeInt16LE=function($,U,Y){if($=+$,U=U>>>0,!Y)b0(this,$,U,2,32767,-32768);return this[U]=$&255,this[U+1]=$>>>8,U+2};G0.prototype.writeInt16BE=function($,U,Y){if($=+$,U=U>>>0,!Y)b0(this,$,U,2,32767,-32768);return this[U]=$>>>8,this[U+1]=$&255,U+2};G0.prototype.writeInt32LE=function($,U,Y){if($=+$,U=U>>>0,!Y)b0(this,$,U,4,2147483647,-2147483648);return this[U]=$&255,this[U+1]=$>>>8,this[U+2]=$>>>16,this[U+3]=$>>>24,U+4};G0.prototype.writeInt32BE=function($,U,Y){if($=+$,U=U>>>0,!Y)b0(this,$,U,4,2147483647,-2147483648);if($<0)$=4294967295+$+1;return this[U]=$>>>24,this[U+1]=$>>>16,this[U+2]=$>>>8,this[U+3]=$&255,U+4};G0.prototype.writeBigInt64LE=z2(function($,U=0){return gU(this,$,U,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});G0.prototype.writeBigInt64BE=z2(function($,U=0){return xU(this,$,U,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function fU($,U,Y,Z,J,G){if(Y+Z>$.length)throw RangeError("Index out of range");if(Y<0)throw RangeError("Index out of range")}function hU($,U,Y,Z,J){if(U=+U,Y=Y>>>0,!J)fU($,U,Y,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return EU($,U,Y,Z,23,4),Y+4}G0.prototype.writeFloatLE=function($,U,Y){return hU(this,$,U,!0,Y)};G0.prototype.writeFloatBE=function($,U,Y){return hU(this,$,U,!1,Y)};function uU($,U,Y,Z,J){if(U=+U,Y=Y>>>0,!J)fU($,U,Y,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return EU($,U,Y,Z,52,8),Y+8}G0.prototype.writeDoubleLE=function($,U,Y){return uU(this,$,U,!0,Y)};G0.prototype.writeDoubleBE=function($,U,Y){return uU(this,$,U,!1,Y)};G0.prototype.copy=function($,U,Y,Z){if(!G0.isBuffer($))throw TypeError("argument should be a Buffer");if(!Y)Y=0;if(!Z&&Z!==0)Z=this.length;if(U>=$.length)U=$.length;if(!U)U=0;if(Z>0&&Z=this.length)throw RangeError("Index out of range");if(Z<0)throw RangeError("sourceEnd out of bounds");if(Z>this.length)Z=this.length;if($.length-U>>0,Y=Y===void 0?this.length:Y>>>0,!$)$=0;let J;if(typeof $==="number")for(J=U;J=Z+4;Y-=3)U=`_${$.slice(Y-3,Y)}${U}`;return`${$.slice(0,Y)}${U}`}function Yq($,U,Y){if(b2(U,"offset"),$[U]===void 0||$[U+Y]===void 0)$1(U,$.length-(Y+1))}function dU($,U,Y,Z,J,G){if($>Y||$3)if(U===0||U===BigInt(0))Q=`>= 0${X} and < 2${X} ** ${(G+1)*8}${X}`;else Q=`>= -(2${X} ** ${(G+1)*8-1}${X}) and < 2 ** ${(G+1)*8-1}${X}`;else Q=`>= ${U}${X} and <= ${Y}${X}`;throw new D8("value",Q,$)}Yq(Z,J,G)}function b2($,U){if(typeof $!=="number")throw new h7(U,"number",$)}function $1($,U,Y){if(Math.floor($)!==$)throw b2($,Y),new D8(Y||"offset","an integer",$);if(U<0)throw new f7;throw new D8(Y||"offset",`>= ${Y?1:0} and <= ${U}`,$)}var Zq=/[^+/0-9A-Za-z-_]/g;function Qq($){if($=$.split("=")[0],$=$.trim().replace(Zq,""),$.length<2)return"";while($.length%4!==0)$=$+"=";return $}function T8($,U){U=U||1/0;let Y,Z=$.length,J=null,G=[];for(let X=0;X55295&&Y<57344){if(!J){if(Y>56319){if((U-=3)>-1)G.push(239,191,189);continue}else if(X+1===Z){if((U-=3)>-1)G.push(239,191,189);continue}J=Y;continue}if(Y<56320){if((U-=3)>-1)G.push(239,191,189);J=Y;continue}Y=(J-55296<<10|Y-56320)+65536}else if(J){if((U-=3)>-1)G.push(239,191,189)}if(J=null,Y<128){if((U-=1)<0)break;G.push(Y)}else if(Y<2048){if((U-=2)<0)break;G.push(Y>>6|192,Y&63|128)}else if(Y<65536){if((U-=3)<0)break;G.push(Y>>12|224,Y>>6&63|128,Y&63|128)}else if(Y<1114112){if((U-=4)<0)break;G.push(Y>>18|240,Y>>12&63|128,Y>>6&63|128,Y&63|128)}else throw Error("Invalid code point")}return G}function Jq($){let U=[];for(let Y=0;Y<$.length;++Y)U.push($.charCodeAt(Y)&255);return U}function Gq($,U){let Y,Z,J,G=[];for(let X=0;X<$.length;++X){if((U-=2)<0)break;Y=$.charCodeAt(X),Z=Y>>8,J=Y%256,G.push(J),G.push(Z)}return G}function cU($){return y7(Qq($))}function C1($,U,Y,Z){let J;for(J=0;J=U.length||J>=$.length)break;U[J+Y]=$[J]}return J}function p0($,U){return $ instanceof U||$!=null&&$.constructor!=null&&$.constructor.name!=null&&$.constructor.name===U.name}var Kq=function(){let $=Array(256);for(let U=0;U<16;++U){let Y=U*16;for(let Z=0;Z<16;++Z)$[Y+Z]="0123456789abcdef"[U]+"0123456789abcdef"[Z]}return $}();function z2($){return typeof BigInt>"u"?qq:$}function qq(){throw Error("BigInt not supported")}function E8($){return()=>{throw Error($+" is not implemented for node:buffer browser polyfill")}}var yB=E8("resolveObjectURL"),bB=E8("isUtf8");var gB=E8("transcode");var OB=C7(iU(),1);var FU={};S7(FU,{unsignedDecimalNumber:()=>W1,universalMeasureValue:()=>H1,uniqueUuid:()=>tQ,uniqueNumericIdCreator:()=>N1,uniqueId:()=>R1,uCharHexNumber:()=>D9,twipsMeasureValue:()=>T0,standardizeData:()=>mJ,signedTwipsMeasureValue:()=>e0,signedHpsMeasureValue:()=>LX,shortHexNumber:()=>DQ,sectionPageSizeDefaults:()=>h1,sectionMarginDefaults:()=>F2,positiveUniversalMeasureValue:()=>r9,pointMeasureValue:()=>CQ,percentageValue:()=>PQ,patchDocument:()=>AB,patchDetector:()=>TB,measurementOrPercentValue:()=>s9,longHexNumber:()=>BX,hpsMeasureValue:()=>AQ,hexColorValue:()=>S2,hashedId:()=>A9,encodeUtf8:()=>X1,eighthPointMeasureValue:()=>TQ,docPropertiesUniqueNumericIdGen:()=>nQ,decimalNumber:()=>S0,dateTimeValue:()=>OQ,createWrapTopAndBottom:()=>bJ,createWrapTight:()=>yJ,createWrapSquare:()=>_J,createWrapNone:()=>C9,createVerticalPosition:()=>JJ,createVerticalAlign:()=>f$,createUnderline:()=>mQ,createTransformation:()=>B$,createTableWidthElement:()=>M1,createTableRowHeight:()=>EK,createTableLook:()=>CK,createTableLayout:()=>PK,createTableFloatProperties:()=>AK,createTabStopItem:()=>PG,createTabStop:()=>TG,createStringElement:()=>u2,createSpacing:()=>AG,createSimplePos:()=>UJ,createShading:()=>j1,createSectionType:()=>nK,createRunFonts:()=>g1,createParagraphStyle:()=>K1,createPageSize:()=>rK,createPageNumberType:()=>iK,createPageMargin:()=>pK,createOutlineLevel:()=>yG,createMathSuperScriptProperties:()=>iG,createMathSuperScriptElement:()=>n2,createMathSubSuperScriptProperties:()=>oG,createMathSubScriptProperties:()=>sG,createMathSubScriptElement:()=>s2,createMathPreSubSuperScriptProperties:()=>eG,createMathNAryProperties:()=>T$,createMathLimitLocation:()=>cG,createMathBase:()=>y0,createMathAccentCharacter:()=>dG,createLineNumberType:()=>aK,createIndent:()=>EQ,createHorizontalPosition:()=>QJ,createHeaderFooterReference:()=>f1,createFrameProperties:()=>xG,createEmphasisMark:()=>Y$,createDotEmphasisMark:()=>HX,createDocumentGrid:()=>lK,createColumns:()=>mK,createBorderElement:()=>N0,createBodyProperties:()=>KJ,createAlignment:()=>n9,convertToXmlComponent:()=>U8,convertMillimetersToTwip:()=>bX,convertInchesToTwip:()=>d0,concreteNumUniqueNumericIdGen:()=>sQ,bookmarkUniqueNumericIdGen:()=>oQ,abstractNumUniqueNumericIdGen:()=>rQ,YearShort:()=>qG,YearLong:()=>BG,XmlComponent:()=>o,XmlAttributeComponent:()=>I0,WpsShapeRun:()=>aJ,WpgGroupRun:()=>pJ,WidthType:()=>l1,WORKAROUND4:()=>HV,WORKAROUND3:()=>VX,WORKAROUND2:()=>lV,VerticalPositionRelativeFrom:()=>$J,VerticalPositionAlign:()=>IX,VerticalMergeType:()=>d$,VerticalMergeRevisionType:()=>NV,VerticalMerge:()=>a1,VerticalAnchor:()=>GJ,VerticalAlignTable:()=>HK,VerticalAlignSection:()=>jK,VerticalAlign:()=>RV,UnderlineType:()=>Z$,ThematicBreak:()=>t9,Textbox:()=>G7,TextWrappingType:()=>G1,TextWrappingSide:()=>vJ,TextRun:()=>p2,TextEffect:()=>NX,TextDirection:()=>PV,TableRowPropertiesChange:()=>l$,TableRowProperties:()=>M8,TableRow:()=>SK,TableProperties:()=>L8,TableOfContents:()=>e5,TableLayoutType:()=>SV,TableCellBorders:()=>h$,TableCell:()=>V8,TableBorders:()=>B8,TableAnchorType:()=>TV,Table:()=>kK,TabStopType:()=>O9,TabStopPosition:()=>ZV,Tab:()=>w$,TDirection:()=>c$,SymbolRun:()=>G$,Styles:()=>B1,StyleLevel:()=>$7,StyleForParagraph:()=>y2,StyleForCharacter:()=>D2,StringValueElement:()=>Y2,StringEnumValueElement:()=>kQ,StringContainer:()=>L2,SpaceType:()=>g0,SoftHyphen:()=>JG,SimpleMailMergeField:()=>nJ,SimpleField:()=>J8,ShadingType:()=>WX,SequentialIdentifier:()=>rJ,Separator:()=>IG,SectionType:()=>dV,SectionPropertiesChange:()=>i$,SectionProperties:()=>I8,RunPropertiesDefaults:()=>XU,RunPropertiesChange:()=>J$,RunProperties:()=>J2,Run:()=>C0,RelativeVerticalPosition:()=>OV,RelativeHorizontalPosition:()=>CV,PrettifyType:()=>X7,PositionalTabRelativeTo:()=>eX,PositionalTabLeader:()=>$V,PositionalTabAlignment:()=>tX,PositionalTab:()=>FG,PatchType:()=>y9,ParagraphRunProperties:()=>Q$,ParagraphPropertiesDefaults:()=>qU,ParagraphPropertiesChange:()=>D$,ParagraphProperties:()=>Z2,Paragraph:()=>h0,PageTextDirectionType:()=>uV,PageTextDirection:()=>p$,PageReference:()=>gG,PageOrientation:()=>i1,PageNumberSeparator:()=>hV,PageNumberElement:()=>WG,PageNumber:()=>N2,PageBreakBefore:()=>H$,PageBreak:()=>RG,PageBorders:()=>a$,PageBorderZOrder:()=>fV,PageBorderOffsetFrom:()=>xV,PageBorderDisplay:()=>gV,Packer:()=>qB,OverlapType:()=>kV,OnOffElement:()=>X0,Numbering:()=>JU,NumberedItemReferenceFormat:()=>vG,NumberedItemReference:()=>_G,NumberValueElement:()=>k2,NumberProperties:()=>V1,NumberFormat:()=>wX,NoBreakHyphen:()=>QG,NextAttributeComponent:()=>n1,MonthShort:()=>KG,MonthLong:()=>VG,Media:()=>w8,MathSuperScript:()=>rG,MathSum:()=>mG,MathSubSuperScript:()=>tG,MathSubScript:()=>nG,MathSquareBrackets:()=>GK,MathRun:()=>hG,MathRoundBrackets:()=>JK,MathRadicalProperties:()=>O$,MathRadical:()=>ZK,MathPreSubSuperScript:()=>$K,MathNumerator:()=>P$,MathLimitUpper:()=>aG,MathLimitLower:()=>pG,MathLimit:()=>q8,MathIntegral:()=>lG,MathFunctionProperties:()=>E$,MathFunctionName:()=>k$,MathFunction:()=>QK,MathFraction:()=>uG,MathDenominator:()=>A$,MathDegree:()=>C$,MathCurlyBrackets:()=>KK,MathAngledBrackets:()=>qK,Math:()=>IV,LineRuleType:()=>v2,LineNumberRestartFormat:()=>bV,LevelSuffix:()=>aV,LevelOverride:()=>QU,LevelFormat:()=>n0,LevelForOverride:()=>F5,LevelBase:()=>W8,Level:()=>ZU,LeaderType:()=>YV,LastRenderedPageBreak:()=>jG,InternalHyperlink:()=>j$,InsertedTextRun:()=>BK,InsertedTableRow:()=>v$,InsertedTableCell:()=>y$,InitializableXmlComponent:()=>Y8,ImportedXmlComponent:()=>p9,ImportedRootElementAttributes:()=>i9,ImageRun:()=>lJ,IgnoreIfEmptyXmlComponent:()=>Q2,HyperlinkType:()=>QV,HpsMeasureElement:()=>q1,HorizontalPositionRelativeFrom:()=>eQ,HorizontalPositionAlign:()=>MX,HighlightColor:()=>RX,HeightRule:()=>_V,HeadingLevel:()=>UV,HeaderWrapper:()=>YU,HeaderFooterType:()=>S9,HeaderFooterReferenceType:()=>E2,Header:()=>U7,GridSpan:()=>u$,FrameWrap:()=>MV,FrameAnchorType:()=>LV,FootnoteReferenceRun:()=>Z7,FootnoteReferenceElement:()=>MG,FootnoteReference:()=>IU,FooterWrapper:()=>$U,Footer:()=>Y7,FootNotes:()=>UU,FootNoteReferenceRunAttributes:()=>MU,FileChild:()=>r2,File:()=>o5,ExternalHyperlink:()=>K8,Endnotes:()=>e$,EndnoteReferenceRunAttributes:()=>wU,EndnoteReferenceRun:()=>Q7,EndnoteReference:()=>I$,EndnoteIdReference:()=>WU,EmptyElement:()=>k0,EmphasisMarkType:()=>U$,EMPTY_OBJECT:()=>tZ,DropCapType:()=>BV,Drawing:()=>D1,DocumentGridType:()=>yV,DocumentDefaults:()=>VU,DocumentBackgroundAttributes:()=>s$,DocumentBackground:()=>n$,DocumentAttributes:()=>o2,DocumentAttributeNamespaces:()=>p1,Document:()=>o5,DeletedTextRun:()=>wK,DeletedTableRow:()=>_$,DeletedTableCell:()=>b$,DayShort:()=>GG,DayLong:()=>XG,ContinuationSeparator:()=>wG,ConcreteNumbering:()=>s1,ConcreteHyperlink:()=>_2,Comments:()=>M$,CommentReference:()=>ZG,CommentRangeStart:()=>UG,CommentRangeEnd:()=>YG,Comment:()=>L$,ColumnBreak:()=>DG,Column:()=>tK,CheckBoxUtil:()=>HU,CheckBoxSymbolElement:()=>L1,CheckBox:()=>J7,CharacterSet:()=>GV,CellMergeAttributes:()=>g$,CellMerge:()=>x$,CarriageReturn:()=>HG,BuilderElement:()=>B0,BorderStyle:()=>Q8,Border:()=>o9,BookmarkStart:()=>F$,BookmarkEnd:()=>N$,Bookmark:()=>z$,Body:()=>r$,BaseXmlComponent:()=>m2,Attributes:()=>O0,AnnotationReference:()=>LG,AlignmentType:()=>m0,AbstractNumbering:()=>r1});var{defineProperty:Bq,defineProperties:Lq,getOwnPropertyDescriptors:Mq,getOwnPropertySymbols:m1}=Object,sZ=Object.prototype.hasOwnProperty,nZ=Object.prototype.propertyIsEnumerable,z9=($,U,Y)=>(U in $)?Bq($,U,{enumerable:!0,configurable:!0,writable:!0,value:Y}):$[U]=Y,W0=($,U)=>{for(var Y in U||(U={}))if(sZ.call(U,Y))z9($,Y,U[Y]);if(m1){for(var Y of m1(U))if(nZ.call(U,Y))z9($,Y,U[Y])}return $},R0=($,U)=>Lq($,Mq(U)),oZ=($,U)=>{var Y={};for(var Z in $)if(sZ.call($,Z)&&U.indexOf(Z)<0)Y[Z]=$[Z];if($!=null&&m1){for(var Z of m1($))if(U.indexOf(Z)<0&&nZ.call($,Z))Y[Z]=$[Z]}return Y},Y0=($,U,Y)=>z9($,typeof U!=="symbol"?U+"":U,Y),b9=($,U,Y)=>{return new Promise((Z,J)=>{var G=(B)=>{try{Q(Y.next(B))}catch(F){J(F)}},X=(B)=>{try{Q(Y.throw(B))}catch(F){J(F)}},Q=(B)=>B.done?Z(B.value):Promise.resolve(B.value).then(G,X);Q((Y=Y.apply($,U)).next())})};class m2{constructor($){Y0(this,"rootKey"),this.rootKey=$}}var tZ=Object.seal({});class o extends m2{constructor($){super($);Y0(this,"root"),this.root=[]}prepForXml($){var U;$.stack.push(this);let Y=this.root.map((Z)=>{if(Z instanceof m2)return Z.prepForXml($);return Z}).filter((Z)=>Z!==void 0);return $.stack.pop(),{[this.rootKey]:Y.length?Y.length===1&&((U=Y[0])==null?void 0:U._attr)?Y[0]:Y:tZ}}addChildElement($){return this.root.push($),this}}class Q2 extends o{constructor($,U){super($);Y0(this,"includeIfEmpty"),this.includeIfEmpty=U}prepForXml($){let U=super.prepForXml($);if(this.includeIfEmpty)return U;if(U&&(typeof U[this.rootKey]!=="object"||Object.keys(U[this.rootKey]).length))return U;return}}class I0 extends m2{constructor($){super("_attr");Y0(this,"xmlKeys"),this.root=$}prepForXml($){let U={};return Object.entries(this.root).forEach(([Y,Z])=>{if(Z!==void 0){let J=this.xmlKeys&&this.xmlKeys[Y]||Y;U[J]=Z}}),{_attr:U}}}class n1 extends m2{constructor($){super("_attr");this.root=$}prepForXml($){return{_attr:Object.values(this.root).filter(({value:Y})=>Y!==void 0).reduce((Y,{key:Z,value:J})=>R0(W0({},Y),{[Z]:J}),{})}}}class O0 extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{val:"w:val",color:"w:color",fill:"w:fill",space:"w:space",sz:"w:sz",type:"w:type",rsidR:"w:rsidR",rsidRPr:"w:rsidRPr",rsidSect:"w:rsidSect",w:"w:w",h:"w:h",top:"w:top",right:"w:right",bottom:"w:bottom",left:"w:left",header:"w:header",footer:"w:footer",gutter:"w:gutter",linePitch:"w:linePitch",pos:"w:pos"})}}var c0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function g9($){return $&&$.__esModule&&Object.prototype.hasOwnProperty.call($,"default")?$.default:$}var _8={},k1={exports:{}},rU;function x9(){if(rU)return k1.exports;rU=1;var $=typeof Reflect==="object"?Reflect:null,U=$&&typeof $.apply==="function"?$.apply:function(A,y,g){return Function.prototype.apply.call(A,y,g)},Y;if($&&typeof $.ownKeys==="function")Y=$.ownKeys;else if(Object.getOwnPropertySymbols)Y=function(A){return Object.getOwnPropertyNames(A).concat(Object.getOwnPropertySymbols(A))};else Y=function(A){return Object.getOwnPropertyNames(A)};function Z(L){if(console&&console.warn)console.warn(L)}var J=Number.isNaN||function(A){return A!==A};function G(){G.init.call(this)}k1.exports=G,k1.exports.once=V,G.EventEmitter=G,G.prototype._events=void 0,G.prototype._eventsCount=0,G.prototype._maxListeners=void 0;var X=10;function Q(L){if(typeof L!=="function")throw TypeError('The "listener" argument must be of type Function. Received type '+typeof L)}Object.defineProperty(G,"defaultMaxListeners",{enumerable:!0,get:function(){return X},set:function(L){if(typeof L!=="number"||L<0||J(L))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+L+".");X=L}}),G.init=function(){if(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)this._events=Object.create(null),this._eventsCount=0;this._maxListeners=this._maxListeners||void 0},G.prototype.setMaxListeners=function(A){if(typeof A!=="number"||A<0||J(A))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+A+".");return this._maxListeners=A,this};function B(L){if(L._maxListeners===void 0)return G.defaultMaxListeners;return L._maxListeners}G.prototype.getMaxListeners=function(){return B(this)},G.prototype.emit=function(A){var y=[];for(var g=1;g0)s=y[0];if(s instanceof Error)throw s;var V0=Error("Unhandled error."+(s?" ("+s.message+")":""));throw V0.context=s,V0}var S=E[A];if(S===void 0)return!1;if(typeof S==="function")U(S,this,y);else{var h=S.length,N=C(S,h);for(var g=0;g0&&s.length>d&&!s.warned){s.warned=!0;var V0=Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(A)+" listeners added. Use emitter.setMaxListeners() to increase limit");V0.name="MaxListenersExceededWarning",V0.emitter=L,V0.type=A,V0.count=s.length,Z(V0)}}return L}G.prototype.addListener=function(A,y){return F(this,A,y,!1)},G.prototype.on=G.prototype.addListener,G.prototype.prependListener=function(A,y){return F(this,A,y,!0)};function z(){if(!this.fired){if(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0)return this.listener.call(this.target);return this.listener.apply(this.target,arguments)}}function W(L,A,y){var g={fired:!1,wrapFn:void 0,target:L,type:A,listener:y},d=z.bind(g);return d.listener=y,g.wrapFn=d,d}G.prototype.once=function(A,y){return Q(y),this.on(A,W(this,A,y)),this},G.prototype.prependOnceListener=function(A,y){return Q(y),this.prependListener(A,W(this,A,y)),this},G.prototype.removeListener=function(A,y){var g,d,E,s,V0;if(Q(y),d=this._events,d===void 0)return this;if(g=d[A],g===void 0)return this;if(g===y||g.listener===y){if(--this._eventsCount===0)this._events=Object.create(null);else if(delete d[A],d.removeListener)this.emit("removeListener",A,g.listener||y)}else if(typeof g!=="function"){E=-1;for(s=g.length-1;s>=0;s--)if(g[s]===y||g[s].listener===y){V0=g[s].listener,E=s;break}if(E<0)return this;if(E===0)g.shift();else H(g,E);if(g.length===1)d[A]=g[0];if(d.removeListener!==void 0)this.emit("removeListener",A,V0||y)}return this},G.prototype.off=G.prototype.removeListener,G.prototype.removeAllListeners=function(A){var y,g,d;if(g=this._events,g===void 0)return this;if(g.removeListener===void 0){if(arguments.length===0)this._events=Object.create(null),this._eventsCount=0;else if(g[A]!==void 0)if(--this._eventsCount===0)this._events=Object.create(null);else delete g[A];return this}if(arguments.length===0){var E=Object.keys(g),s;for(d=0;d=0;d--)this.removeListener(A,y[d]);return this};function k(L,A,y){var g=L._events;if(g===void 0)return[];var d=g[A];if(d===void 0)return[];if(typeof d==="function")return y?[d.listener||d]:[d];return y?O(d):C(d,d.length)}G.prototype.listeners=function(A){return k(this,A,!0)},G.prototype.rawListeners=function(A){return k(this,A,!1)},G.listenerCount=function(L,A){if(typeof L.listenerCount==="function")return L.listenerCount(A);else return D.call(L,A)},G.prototype.listenerCount=D;function D(L){var A=this._events;if(A!==void 0){var y=A[L];if(typeof y==="function")return 1;else if(y!==void 0)return y.length}return 0}G.prototype.eventNames=function(){return this._eventsCount>0?Y(this._events):[]};function C(L,A){var y=Array(A);for(var g=0;g1)for(var Y=1;Y0)throw Error("Invalid string. Length must be a multiple of 4");var H=D.indexOf("=");if(H===-1)H=C;var O=H===C?0:4-H%4;return[H,O]}function Q(D){var C=X(D),H=C[0],O=C[1];return(H+O)*3/4-O}function B(D,C,H){return(C+H)*3/4-H}function F(D){var C,H=X(D),O=H[0],V=H[1],j=new Y(B(D,O,V)),M=0,L=V>0?O-4:O,A;for(A=0;A>16&255,j[M++]=C>>8&255,j[M++]=C&255;if(V===2)C=U[D.charCodeAt(A)]<<2|U[D.charCodeAt(A+1)]>>4,j[M++]=C&255;if(V===1)C=U[D.charCodeAt(A)]<<10|U[D.charCodeAt(A+1)]<<4|U[D.charCodeAt(A+2)]>>2,j[M++]=C>>8&255,j[M++]=C&255;return j}function z(D){return $[D>>18&63]+$[D>>12&63]+$[D>>6&63]+$[D&63]}function W(D,C,H){var O,V=[];for(var j=C;jL?L:M+j));if(O===1)C=D[H-1],V.push($[C>>2]+$[C<<4&63]+"==");else if(O===2)C=(D[H-2]<<8)+D[H-1],V.push($[C>>10]+$[C>>4&63]+$[C<<2&63]+"=");return V.join("")}return U1}var S1={},tU;function zq(){if(tU)return S1;return tU=1,S1.read=function($,U,Y,Z,J){var G,X,Q=J*8-Z-1,B=(1<>1,z=-7,W=Y?J-1:0,k=Y?-1:1,D=$[U+W];W+=k,G=D&(1<<-z)-1,D>>=-z,z+=Q;for(;z>0;G=G*256+$[U+W],W+=k,z-=8);X=G&(1<<-z)-1,G>>=-z,z+=Z;for(;z>0;X=X*256+$[U+W],W+=k,z-=8);if(G===0)G=1-F;else if(G===B)return X?NaN:(D?-1:1)*(1/0);else X=X+Math.pow(2,Z),G=G-F;return(D?-1:1)*X*Math.pow(2,G-Z)},S1.write=function($,U,Y,Z,J,G){var X,Q,B,F=G*8-J-1,z=(1<>1,k=J===23?Math.pow(2,-24)-Math.pow(2,-77):0,D=Z?0:G-1,C=Z?1:-1,H=U<0||U===0&&1/U<0?1:0;if(U=Math.abs(U),isNaN(U)||U===1/0)Q=isNaN(U)?1:0,X=z;else{if(X=Math.floor(Math.log(U)/Math.LN2),U*(B=Math.pow(2,-X))<1)X--,B*=2;if(X+W>=1)U+=k/B;else U+=k*Math.pow(2,1-W);if(U*B>=2)X++,B/=2;if(X+W>=z)Q=0,X=z;else if(X+W>=1)Q=(U*B-1)*Math.pow(2,J),X=X+W;else Q=U*Math.pow(2,W-1)*Math.pow(2,J),X=0}for(;J>=8;$[Y+D]=Q&255,D+=C,Q/=256,J-=8);X=X<0;$[Y+D]=X&255,D+=C,X/=256,F-=8);$[Y+D-C]|=H*128},S1}var eU;function o1(){if(eU)return b8;return eU=1,function($){var U=jq(),Y=zq(),Z=typeof Symbol==="function"&&typeof Symbol.for==="function"?Symbol.for("nodejs.util.inspect.custom"):null;$.Buffer=Q,$.SlowBuffer=j,$.INSPECT_MAX_BYTES=50;var J=2147483647;if($.kMaxLength=J,Q.TYPED_ARRAY_SUPPORT=G(),!Q.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error==="function")console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function G(){try{var T=new Uint8Array(1),K={foo:function(){return 42}};return Object.setPrototypeOf(K,Uint8Array.prototype),Object.setPrototypeOf(T,K),T.foo()===42}catch(q){return!1}}Object.defineProperty(Q.prototype,"parent",{enumerable:!0,get:function(){if(!Q.isBuffer(this))return;return this.buffer}}),Object.defineProperty(Q.prototype,"offset",{enumerable:!0,get:function(){if(!Q.isBuffer(this))return;return this.byteOffset}});function X(T){if(T>J)throw RangeError('The value "'+T+'" is invalid for option "size"');var K=new Uint8Array(T);return Object.setPrototypeOf(K,Q.prototype),K}function Q(T,K,q){if(typeof T==="number"){if(typeof K==="string")throw TypeError('The "string" argument must be of type string. Received type number');return W(T)}return B(T,K,q)}Q.poolSize=8192;function B(T,K,q){if(typeof T==="string")return k(T,K);if(ArrayBuffer.isView(T))return C(T);if(T==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(e(T,ArrayBuffer)||T&&e(T.buffer,ArrayBuffer))return H(T,K,q);if(typeof SharedArrayBuffer<"u"&&(e(T,SharedArrayBuffer)||T&&e(T.buffer,SharedArrayBuffer)))return H(T,K,q);if(typeof T==="number")throw TypeError('The "value" argument must not be of type number. Received type number');var w=T.valueOf&&T.valueOf();if(w!=null&&w!==T)return Q.from(w,K,q);var x=O(T);if(x)return x;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]==="function")return Q.from(T[Symbol.toPrimitive]("string"),K,q);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}Q.from=function(T,K,q){return B(T,K,q)},Object.setPrototypeOf(Q.prototype,Uint8Array.prototype),Object.setPrototypeOf(Q,Uint8Array);function F(T){if(typeof T!=="number")throw TypeError('"size" argument must be of type number');else if(T<0)throw RangeError('The value "'+T+'" is invalid for option "size"')}function z(T,K,q){if(F(T),T<=0)return X(T);if(K!==void 0)return typeof q==="string"?X(T).fill(K,q):X(T).fill(K);return X(T)}Q.alloc=function(T,K,q){return z(T,K,q)};function W(T){return F(T),X(T<0?0:V(T)|0)}Q.allocUnsafe=function(T){return W(T)},Q.allocUnsafeSlow=function(T){return W(T)};function k(T,K){if(typeof K!=="string"||K==="")K="utf8";if(!Q.isEncoding(K))throw TypeError("Unknown encoding: "+K);var q=M(T,K)|0,w=X(q),x=w.write(T,K);if(x!==q)w=w.slice(0,x);return w}function D(T){var K=T.length<0?0:V(T.length)|0,q=X(K);for(var w=0;w=J)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+J.toString(16)+" bytes");return T|0}function j(T){if(+T!=T)T=0;return Q.alloc(+T)}Q.isBuffer=function(K){return K!=null&&K._isBuffer===!0&&K!==Q.prototype},Q.compare=function(K,q){if(e(K,Uint8Array))K=Q.from(K,K.offset,K.byteLength);if(e(q,Uint8Array))q=Q.from(q,q.offset,q.byteLength);if(!Q.isBuffer(K)||!Q.isBuffer(q))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(K===q)return 0;var w=K.length,x=q.length;for(var l=0,u=Math.min(w,x);lx.length)Q.from(u).copy(x,l);else Uint8Array.prototype.set.call(x,u,l);else if(!Q.isBuffer(u))throw TypeError('"list" argument must be an Array of Buffers');else u.copy(x,l);l+=u.length}return x};function M(T,K){if(Q.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||e(T,ArrayBuffer))return T.byteLength;if(typeof T!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);var q=T.length,w=arguments.length>2&&arguments[2]===!0;if(!w&&q===0)return 0;var x=!1;for(;;)switch(K){case"ascii":case"latin1":case"binary":return q;case"utf8":case"utf-8":return R(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q*2;case"hex":return q>>>1;case"base64":return v(T).length;default:if(x)return w?-1:R(T).length;K=(""+K).toLowerCase(),x=!0}}Q.byteLength=M;function L(T,K,q){var w=!1;if(K===void 0||K<0)K=0;if(K>this.length)return"";if(q===void 0||q>this.length)q=this.length;if(q<=0)return"";if(q>>>=0,K>>>=0,q<=K)return"";if(!T)T="utf8";while(!0)switch(T){case"hex":return U0(this,K,q);case"utf8":case"utf-8":return N(this,K,q);case"ascii":return m(this,K,q);case"latin1":case"binary":return J0(this,K,q);case"base64":return h(this,K,q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L0(this,K,q);default:if(w)throw TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),w=!0}}Q.prototype._isBuffer=!0;function A(T,K,q){var w=T[K];T[K]=T[q],T[q]=w}if(Q.prototype.swap16=function(){var K=this.length;if(K%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var q=0;qq)K+=" ... ";return""},Z)Q.prototype[Z]=Q.prototype.inspect;Q.prototype.compare=function(K,q,w,x,l){if(e(K,Uint8Array))K=Q.from(K,K.offset,K.byteLength);if(!Q.isBuffer(K))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof K);if(q===void 0)q=0;if(w===void 0)w=K?K.length:0;if(x===void 0)x=0;if(l===void 0)l=this.length;if(q<0||w>K.length||x<0||l>this.length)throw RangeError("out of range index");if(x>=l&&q>=w)return 0;if(x>=l)return-1;if(q>=w)return 1;if(q>>>=0,w>>>=0,x>>>=0,l>>>=0,this===K)return 0;var u=l-x,Q0=w-q,q0=Math.min(u,Q0),K0=this.slice(x,l),M0=K.slice(q,w);for(var w0=0;w02147483647)q=2147483647;else if(q<-2147483648)q=-2147483648;if(q=+q,I(q))q=x?0:T.length-1;if(q<0)q=T.length+q;if(q>=T.length)if(x)return-1;else q=T.length-1;else if(q<0)if(x)q=0;else return-1;if(typeof K==="string")K=Q.from(K,w);if(Q.isBuffer(K)){if(K.length===0)return-1;return g(T,K,q,w,x)}else if(typeof K==="number"){if(K=K&255,typeof Uint8Array.prototype.indexOf==="function")if(x)return Uint8Array.prototype.indexOf.call(T,K,q);else return Uint8Array.prototype.lastIndexOf.call(T,K,q);return g(T,[K],q,w,x)}throw TypeError("val must be string, number or Buffer")}function g(T,K,q,w,x){var l=1,u=T.length,Q0=K.length;if(w!==void 0){if(w=String(w).toLowerCase(),w==="ucs2"||w==="ucs-2"||w==="utf16le"||w==="utf-16le"){if(T.length<2||K.length<2)return-1;l=2,u/=2,Q0/=2,q/=2}}function q0(v0,j2){if(l===1)return v0[j2];else return v0.readUInt16BE(j2*l)}var K0;if(x){var M0=-1;for(K0=q;K0u)q=u-Q0;for(K0=q;K0>=0;K0--){var w0=!0;for(var H0=0;H0x)w=x;var l=K.length;if(w>l/2)w=l/2;for(var u=0;u>>0,isFinite(w)){if(w=w>>>0,x===void 0)x="utf8"}else x=w,w=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var l=this.length-q;if(w===void 0||w>l)w=l;if(K.length>0&&(w<0||q<0)||q>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!x)x="utf8";var u=!1;for(;;)switch(x){case"hex":return d(this,K,q,w);case"utf8":case"utf-8":return E(this,K,q,w);case"ascii":case"latin1":case"binary":return s(this,K,q,w);case"base64":return V0(this,K,q,w);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,K,q,w);default:if(u)throw TypeError("Unknown encoding: "+x);x=(""+x).toLowerCase(),u=!0}},Q.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function h(T,K,q){if(K===0&&q===T.length)return U.fromByteArray(T);else return U.fromByteArray(T.slice(K,q))}function N(T,K,q){q=Math.min(T.length,q);var w=[],x=K;while(x239?4:l>223?3:l>191?2:1;if(x+Q0<=q){var q0,K0,M0,w0;switch(Q0){case 1:if(l<128)u=l;break;case 2:if(q0=T[x+1],(q0&192)===128){if(w0=(l&31)<<6|q0&63,w0>127)u=w0}break;case 3:if(q0=T[x+1],K0=T[x+2],(q0&192)===128&&(K0&192)===128){if(w0=(l&15)<<12|(q0&63)<<6|K0&63,w0>2047&&(w0<55296||w0>57343))u=w0}break;case 4:if(q0=T[x+1],K0=T[x+2],M0=T[x+3],(q0&192)===128&&(K0&192)===128&&(M0&192)===128){if(w0=(l&15)<<18|(q0&63)<<12|(K0&63)<<6|M0&63,w0>65535&&w0<1114112)u=w0}}}if(u===null)u=65533,Q0=1;else if(u>65535)u-=65536,w.push(u>>>10&1023|55296),u=56320|u&1023;w.push(u),x+=Q0}return $0(w)}var a=4096;function $0(T){var K=T.length;if(K<=a)return String.fromCharCode.apply(String,T);var q="",w=0;while(ww)q=w;var x="";for(var l=K;lw)K=w;if(q<0){if(q+=w,q<0)q=0}else if(q>w)q=w;if(qq)throw RangeError("Trying to access beyond buffer length")}Q.prototype.readUintLE=Q.prototype.readUIntLE=function(K,q,w){if(K=K>>>0,q=q>>>0,!w)i(K,q,this.length);var x=this[K],l=1,u=0;while(++u>>0,q=q>>>0,!w)i(K,q,this.length);var x=this[K+--q],l=1;while(q>0&&(l*=256))x+=this[K+--q]*l;return x},Q.prototype.readUint8=Q.prototype.readUInt8=function(K,q){if(K=K>>>0,!q)i(K,1,this.length);return this[K]},Q.prototype.readUint16LE=Q.prototype.readUInt16LE=function(K,q){if(K=K>>>0,!q)i(K,2,this.length);return this[K]|this[K+1]<<8},Q.prototype.readUint16BE=Q.prototype.readUInt16BE=function(K,q){if(K=K>>>0,!q)i(K,2,this.length);return this[K]<<8|this[K+1]},Q.prototype.readUint32LE=Q.prototype.readUInt32LE=function(K,q){if(K=K>>>0,!q)i(K,4,this.length);return(this[K]|this[K+1]<<8|this[K+2]<<16)+this[K+3]*16777216},Q.prototype.readUint32BE=Q.prototype.readUInt32BE=function(K,q){if(K=K>>>0,!q)i(K,4,this.length);return this[K]*16777216+(this[K+1]<<16|this[K+2]<<8|this[K+3])},Q.prototype.readIntLE=function(K,q,w){if(K=K>>>0,q=q>>>0,!w)i(K,q,this.length);var x=this[K],l=1,u=0;while(++u=l)x-=Math.pow(2,8*q);return x},Q.prototype.readIntBE=function(K,q,w){if(K=K>>>0,q=q>>>0,!w)i(K,q,this.length);var x=q,l=1,u=this[K+--x];while(x>0&&(l*=256))u+=this[K+--x]*l;if(l*=128,u>=l)u-=Math.pow(2,8*q);return u},Q.prototype.readInt8=function(K,q){if(K=K>>>0,!q)i(K,1,this.length);if(!(this[K]&128))return this[K];return(255-this[K]+1)*-1},Q.prototype.readInt16LE=function(K,q){if(K=K>>>0,!q)i(K,2,this.length);var w=this[K]|this[K+1]<<8;return w&32768?w|4294901760:w},Q.prototype.readInt16BE=function(K,q){if(K=K>>>0,!q)i(K,2,this.length);var w=this[K+1]|this[K]<<8;return w&32768?w|4294901760:w},Q.prototype.readInt32LE=function(K,q){if(K=K>>>0,!q)i(K,4,this.length);return this[K]|this[K+1]<<8|this[K+2]<<16|this[K+3]<<24},Q.prototype.readInt32BE=function(K,q){if(K=K>>>0,!q)i(K,4,this.length);return this[K]<<24|this[K+1]<<16|this[K+2]<<8|this[K+3]},Q.prototype.readFloatLE=function(K,q){if(K=K>>>0,!q)i(K,4,this.length);return Y.read(this,K,!0,23,4)},Q.prototype.readFloatBE=function(K,q){if(K=K>>>0,!q)i(K,4,this.length);return Y.read(this,K,!1,23,4)},Q.prototype.readDoubleLE=function(K,q){if(K=K>>>0,!q)i(K,8,this.length);return Y.read(this,K,!0,52,8)},Q.prototype.readDoubleBE=function(K,q){if(K=K>>>0,!q)i(K,8,this.length);return Y.read(this,K,!1,52,8)};function _(T,K,q,w,x,l){if(!Q.isBuffer(T))throw TypeError('"buffer" argument must be a Buffer instance');if(K>x||KT.length)throw RangeError("Index out of range")}Q.prototype.writeUintLE=Q.prototype.writeUIntLE=function(K,q,w,x){if(K=+K,q=q>>>0,w=w>>>0,!x){var l=Math.pow(2,8*w)-1;_(this,K,q,w,l,0)}var u=1,Q0=0;this[q]=K&255;while(++Q0>>0,w=w>>>0,!x){var l=Math.pow(2,8*w)-1;_(this,K,q,w,l,0)}var u=w-1,Q0=1;this[q+u]=K&255;while(--u>=0&&(Q0*=256))this[q+u]=K/Q0&255;return q+w},Q.prototype.writeUint8=Q.prototype.writeUInt8=function(K,q,w){if(K=+K,q=q>>>0,!w)_(this,K,q,1,255,0);return this[q]=K&255,q+1},Q.prototype.writeUint16LE=Q.prototype.writeUInt16LE=function(K,q,w){if(K=+K,q=q>>>0,!w)_(this,K,q,2,65535,0);return this[q]=K&255,this[q+1]=K>>>8,q+2},Q.prototype.writeUint16BE=Q.prototype.writeUInt16BE=function(K,q,w){if(K=+K,q=q>>>0,!w)_(this,K,q,2,65535,0);return this[q]=K>>>8,this[q+1]=K&255,q+2},Q.prototype.writeUint32LE=Q.prototype.writeUInt32LE=function(K,q,w){if(K=+K,q=q>>>0,!w)_(this,K,q,4,4294967295,0);return this[q+3]=K>>>24,this[q+2]=K>>>16,this[q+1]=K>>>8,this[q]=K&255,q+4},Q.prototype.writeUint32BE=Q.prototype.writeUInt32BE=function(K,q,w){if(K=+K,q=q>>>0,!w)_(this,K,q,4,4294967295,0);return this[q]=K>>>24,this[q+1]=K>>>16,this[q+2]=K>>>8,this[q+3]=K&255,q+4},Q.prototype.writeIntLE=function(K,q,w,x){if(K=+K,q=q>>>0,!x){var l=Math.pow(2,8*w-1);_(this,K,q,w,l-1,-l)}var u=0,Q0=1,q0=0;this[q]=K&255;while(++u>0)-q0&255}return q+w},Q.prototype.writeIntBE=function(K,q,w,x){if(K=+K,q=q>>>0,!x){var l=Math.pow(2,8*w-1);_(this,K,q,w,l-1,-l)}var u=w-1,Q0=1,q0=0;this[q+u]=K&255;while(--u>=0&&(Q0*=256)){if(K<0&&q0===0&&this[q+u+1]!==0)q0=1;this[q+u]=(K/Q0>>0)-q0&255}return q+w},Q.prototype.writeInt8=function(K,q,w){if(K=+K,q=q>>>0,!w)_(this,K,q,1,127,-128);if(K<0)K=255+K+1;return this[q]=K&255,q+1},Q.prototype.writeInt16LE=function(K,q,w){if(K=+K,q=q>>>0,!w)_(this,K,q,2,32767,-32768);return this[q]=K&255,this[q+1]=K>>>8,q+2},Q.prototype.writeInt16BE=function(K,q,w){if(K=+K,q=q>>>0,!w)_(this,K,q,2,32767,-32768);return this[q]=K>>>8,this[q+1]=K&255,q+2},Q.prototype.writeInt32LE=function(K,q,w){if(K=+K,q=q>>>0,!w)_(this,K,q,4,2147483647,-2147483648);return this[q]=K&255,this[q+1]=K>>>8,this[q+2]=K>>>16,this[q+3]=K>>>24,q+4},Q.prototype.writeInt32BE=function(K,q,w){if(K=+K,q=q>>>0,!w)_(this,K,q,4,2147483647,-2147483648);if(K<0)K=4294967295+K+1;return this[q]=K>>>24,this[q+1]=K>>>16,this[q+2]=K>>>8,this[q+3]=K&255,q+4};function r(T,K,q,w,x,l){if(q+w>T.length)throw RangeError("Index out of range");if(q<0)throw RangeError("Index out of range")}function n(T,K,q,w,x){if(K=+K,q=q>>>0,!x)r(T,K,q,4);return Y.write(T,K,q,w,23,4),q+4}Q.prototype.writeFloatLE=function(K,q,w){return n(this,K,q,!0,w)},Q.prototype.writeFloatBE=function(K,q,w){return n(this,K,q,!1,w)};function Z0(T,K,q,w,x){if(K=+K,q=q>>>0,!x)r(T,K,q,8);return Y.write(T,K,q,w,52,8),q+8}Q.prototype.writeDoubleLE=function(K,q,w){return Z0(this,K,q,!0,w)},Q.prototype.writeDoubleBE=function(K,q,w){return Z0(this,K,q,!1,w)},Q.prototype.copy=function(K,q,w,x){if(!Q.isBuffer(K))throw TypeError("argument should be a Buffer");if(!w)w=0;if(!x&&x!==0)x=this.length;if(q>=K.length)q=K.length;if(!q)q=0;if(x>0&&x=this.length)throw RangeError("Index out of range");if(x<0)throw RangeError("sourceEnd out of bounds");if(x>this.length)x=this.length;if(K.length-q>>0,w=w===void 0?this.length:w>>>0,!K)K=0;var u;if(typeof K==="number")for(u=q;u55295&&q<57344){if(!x){if(q>56319){if((K-=3)>-1)l.push(239,191,189);continue}else if(u+1===w){if((K-=3)>-1)l.push(239,191,189);continue}x=q;continue}if(q<56320){if((K-=3)>-1)l.push(239,191,189);x=q;continue}q=(x-55296<<10|q-56320)+65536}else if(x){if((K-=3)>-1)l.push(239,191,189)}if(x=null,q<128){if((K-=1)<0)break;l.push(q)}else if(q<2048){if((K-=2)<0)break;l.push(q>>6|192,q&63|128)}else if(q<65536){if((K-=3)<0)break;l.push(q>>12|224,q>>6&63|128,q&63|128)}else if(q<1114112){if((K-=4)<0)break;l.push(q>>18|240,q>>12&63|128,q>>6&63|128,q&63|128)}else throw Error("Invalid code point")}return l}function c(T){var K=[];for(var q=0;q>8,x=q%256,l.push(x),l.push(w)}return l}function v(T){return U.toByteArray(P(T))}function b(T,K,q,w){for(var x=0;x=K.length||x>=T.length)break;K[x+q]=T[x]}return x}function e(T,K){return T instanceof K||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===K.name}function I(T){return T!==T}var t=function(){var T="0123456789abcdef",K=Array(256);for(var q=0;q<16;++q){var w=q*16;for(var x=0;x<16;++x)K[w+x]=T[q]+T[x]}return K}()}(b8),b8}var g8={},x8={},f8,$Y;function QQ(){if($Y)return f8;return $Y=1,f8=function(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function")return!1;if(typeof Symbol.iterator==="symbol")return!0;var U={},Y=Symbol("test"),Z=Object(Y);if(typeof Y==="string")return!1;if(Object.prototype.toString.call(Y)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(Z)!=="[object Symbol]")return!1;var J=42;U[Y]=J;for(var G in U)return!1;if(typeof Object.keys==="function"&&Object.keys(U).length!==0)return!1;if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(U).length!==0)return!1;var X=Object.getOwnPropertySymbols(U);if(X.length!==1||X[0]!==Y)return!1;if(!Object.prototype.propertyIsEnumerable.call(U,Y))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var Q=Object.getOwnPropertyDescriptor(U,Y);if(Q.value!==J||Q.enumerable!==!0)return!1}return!0},f8}var h8,UY;function f9(){if(UY)return h8;UY=1;var $=QQ();return h8=function(){return $()&&!!Symbol.toStringTag},h8}var u8,YY;function JQ(){if(YY)return u8;return YY=1,u8=Object,u8}var d8,ZY;function Fq(){if(ZY)return d8;return ZY=1,d8=Error,d8}var c8,QY;function Nq(){if(QY)return c8;return QY=1,c8=EvalError,c8}var m8,JY;function Rq(){if(JY)return m8;return JY=1,m8=RangeError,m8}var l8,GY;function Dq(){if(GY)return l8;return GY=1,l8=ReferenceError,l8}var a8,KY;function GQ(){if(KY)return a8;return KY=1,a8=SyntaxError,a8}var p8,qY;function t1(){if(qY)return p8;return qY=1,p8=TypeError,p8}var i8,XY;function Aq(){if(XY)return i8;return XY=1,i8=URIError,i8}var r8,VY;function Pq(){if(VY)return r8;return VY=1,r8=Math.abs,r8}var s8,BY;function Tq(){if(BY)return s8;return BY=1,s8=Math.floor,s8}var n8,LY;function Cq(){if(LY)return n8;return LY=1,n8=Math.max,n8}var o8,MY;function Oq(){if(MY)return o8;return MY=1,o8=Math.min,o8}var t8,IY;function kq(){if(IY)return t8;return IY=1,t8=Math.pow,t8}var e8,wY;function Eq(){if(wY)return e8;return wY=1,e8=Math.round,e8}var $6,WY;function Sq(){if(WY)return $6;return WY=1,$6=Number.isNaN||function(U){return U!==U},$6}var U6,HY;function vq(){if(HY)return U6;HY=1;var $=Sq();return U6=function(Y){if($(Y)||Y===0)return Y;return Y<0?-1:1},U6}var Y6,jY;function _q(){if(jY)return Y6;return jY=1,Y6=Object.getOwnPropertyDescriptor,Y6}var Z6,zY;function I1(){if(zY)return Z6;zY=1;var $=_q();if($)try{$([],"length")}catch(U){$=null}return Z6=$,Z6}var Q6,FY;function e1(){if(FY)return Q6;FY=1;var $=Object.defineProperty||!1;if($)try{$({},"a",{value:1})}catch(U){$=!1}return Q6=$,Q6}var J6,NY;function yq(){if(NY)return J6;NY=1;var $=typeof Symbol<"u"&&Symbol,U=QQ();return J6=function(){if(typeof $!=="function")return!1;if(typeof Symbol!=="function")return!1;if(typeof $("foo")!=="symbol")return!1;if(typeof Symbol("bar")!=="symbol")return!1;return U()},J6}var G6,RY;function KQ(){if(RY)return G6;return RY=1,G6=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,G6}var K6,DY;function qQ(){if(DY)return K6;DY=1;var $=JQ();return K6=$.getPrototypeOf||null,K6}var q6,AY;function bq(){if(AY)return q6;AY=1;var $="Function.prototype.bind called on incompatible ",U=Object.prototype.toString,Y=Math.max,Z="[object Function]",J=function(B,F){var z=[];for(var W=0;W"u"||!g?$:g(Uint8Array),N={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?$:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?$:ArrayBuffer,"%ArrayIteratorPrototype%":y&&g?g([][Symbol.iterator]()):$,"%AsyncFromSyncIteratorPrototype%":$,"%AsyncFunction%":S,"%AsyncGenerator%":S,"%AsyncGeneratorFunction%":S,"%AsyncIteratorPrototype%":S,"%Atomics%":typeof Atomics>"u"?$:Atomics,"%BigInt%":typeof BigInt>"u"?$:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?$:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?$:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?$:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Y,"%eval%":eval,"%EvalError%":Z,"%Float16Array%":typeof Float16Array>"u"?$:Float16Array,"%Float32Array%":typeof Float32Array>"u"?$:Float32Array,"%Float64Array%":typeof Float64Array>"u"?$:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?$:FinalizationRegistry,"%Function%":O,"%GeneratorFunction%":S,"%Int8Array%":typeof Int8Array>"u"?$:Int8Array,"%Int16Array%":typeof Int16Array>"u"?$:Int16Array,"%Int32Array%":typeof Int32Array>"u"?$:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":y&&g?g(g([][Symbol.iterator]())):$,"%JSON%":typeof JSON==="object"?JSON:$,"%Map%":typeof Map>"u"?$:Map,"%MapIteratorPrototype%":typeof Map>"u"||!y||!g?$:g(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":U,"%Object.getOwnPropertyDescriptor%":j,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?$:Promise,"%Proxy%":typeof Proxy>"u"?$:Proxy,"%RangeError%":J,"%ReferenceError%":G,"%Reflect%":typeof Reflect>"u"?$:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?$:Set,"%SetIteratorPrototype%":typeof Set>"u"||!y||!g?$:g(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?$:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":y&&g?g(""[Symbol.iterator]()):$,"%Symbol%":y?Symbol:$,"%SyntaxError%":X,"%ThrowTypeError%":A,"%TypedArray%":h,"%TypeError%":Q,"%Uint8Array%":typeof Uint8Array>"u"?$:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?$:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?$:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?$:Uint32Array,"%URIError%":B,"%WeakMap%":typeof WeakMap>"u"?$:WeakMap,"%WeakRef%":typeof WeakRef>"u"?$:WeakRef,"%WeakSet%":typeof WeakSet>"u"?$:WeakSet,"%Function.prototype.call%":V0,"%Function.prototype.apply%":s,"%Object.defineProperty%":M,"%Object.getPrototypeOf%":d,"%Math.abs%":F,"%Math.floor%":z,"%Math.max%":W,"%Math.min%":k,"%Math.pow%":D,"%Math.round%":C,"%Math.sign%":H,"%Reflect.getPrototypeOf%":E};if(g)try{null.error}catch(c){var a=g(g(c));N["%Error.prototype%"]=a}var $0=function c(f){var v;if(f==="%AsyncFunction%")v=V("async function () {}");else if(f==="%GeneratorFunction%")v=V("function* () {}");else if(f==="%AsyncGeneratorFunction%")v=V("async function* () {}");else if(f==="%AsyncGenerator%"){var b=c("%AsyncGeneratorFunction%");if(b)v=b.prototype}else if(f==="%AsyncIteratorPrototype%"){var e=c("%AsyncGenerator%");if(e&&g)v=g(e.prototype)}return N[f]=v,v},m={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},J0=w1(),U0=fq(),L0=J0.call(V0,Array.prototype.concat),i=J0.call(s,Array.prototype.splice),_=J0.call(V0,String.prototype.replace),r=J0.call(V0,String.prototype.slice),n=J0.call(V0,RegExp.prototype.exec),Z0=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,p=/\\(\\)?/g,P=function(f){var v=r(f,0,1),b=r(f,-1);if(v==="%"&&b!=="%")throw new X("invalid intrinsic syntax, expected closing `%`");else if(b==="%"&&v!=="%")throw new X("invalid intrinsic syntax, expected opening `%`");var e=[];return _(f,Z0,function(I,t,T,K){e[e.length]=T?_(K,p,"$1"):t||I}),e},R=function(f,v){var b=f,e;if(U0(m,b))e=m[b],b="%"+e[0]+"%";if(U0(N,b)){var I=N[b];if(I===S)I=$0(b);if(typeof I>"u"&&!v)throw new Q("intrinsic "+f+" exists, but is not available. Please file an issue!");return{alias:e,name:b,value:I}}throw new X("intrinsic "+f+" does not exist!")};return j6=function(f,v){if(typeof f!=="string"||f.length===0)throw new Q("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof v!=="boolean")throw new Q('"allowMissing" argument must be a boolean');if(n(/^%?[^%]*%?$/,f)===null)throw new X("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var b=P(f),e=b.length>0?b[0]:"",I=R("%"+e+"%",v),t=I.name,T=I.value,K=!1,q=I.alias;if(q)e=q[0],i(b,L0([0,1],q));for(var w=1,x=!0;w=b.length){var q0=j(T,l);if(x=!!q0,x&&"get"in q0&&!("originalValue"in q0.get))T=q0.get;else T=T[l]}else x=U0(T,l),T=T[l];if(x&&!K)N[t]=T}}return T},j6}var z6,bY;function LQ(){if(bY)return z6;bY=1;var $=BQ(),U=d9(),Y=U([$("%String.prototype.indexOf%")]);return z6=function(J,G){var X=$(J,!!G);if(typeof X==="function"&&Y(J,".prototype.")>-1)return U([X]);return X},z6}var F6,gY;function hq(){if(gY)return F6;gY=1;var $=f9()(),U=LQ(),Y=U("Object.prototype.toString"),Z=function(Q){if($&&Q&&typeof Q==="object"&&Symbol.toStringTag in Q)return!1;return Y(Q)==="[object Arguments]"},J=function(Q){if(Z(Q))return!0;return Q!==null&&typeof Q==="object"&&"length"in Q&&typeof Q.length==="number"&&Q.length>=0&&Y(Q)!=="[object Array]"&&"callee"in Q&&Y(Q.callee)==="[object Function]"},G=function(){return Z(arguments)}();return Z.isLegacyArguments=J,F6=G?Z:J,F6}var N6,xY;function uq(){if(xY)return N6;xY=1;var $=Object.prototype.toString,U=Function.prototype.toString,Y=/^\s*(?:function)?\*/,Z=f9()(),J=Object.getPrototypeOf,G=function(){if(!Z)return!1;try{return Function("return function*() {}")()}catch(Q){}},X;return N6=function(B){if(typeof B!=="function")return!1;if(Y.test(U.call(B)))return!0;if(!Z){var F=$.call(B);return F==="[object GeneratorFunction]"}if(!J)return!1;if(typeof X>"u"){var z=G();X=z?J(z):!1}return J(B)===X},N6}var R6,fY;function dq(){if(fY)return R6;fY=1;var $=Function.prototype.toString,U=typeof Reflect==="object"&&Reflect!==null&&Reflect.apply,Y,Z;if(typeof U==="function"&&typeof Object.defineProperty==="function")try{Y=Object.defineProperty({},"length",{get:function(){throw Z}}),Z={},U(function(){throw 42},null,Y)}catch(j){if(j!==Z)U=null}else U=null;var J=/^\s*class\b/,G=function(M){try{var L=$.call(M);return J.test(L)}catch(A){return!1}},X=function(M){try{if(G(M))return!1;return $.call(M),!0}catch(L){return!1}},Q=Object.prototype.toString,B="[object Object]",F="[object Function]",z="[object GeneratorFunction]",W="[object HTMLAllCollection]",k="[object HTML document.all class]",D="[object HTMLCollection]",C=typeof Symbol==="function"&&!!Symbol.toStringTag,H=!(0 in[,]),O=function(){return!1};if(typeof document==="object"){var V=document.all;if(Q.call(V)===Q.call(document.all))O=function(M){if((H||!M)&&(typeof M>"u"||typeof M==="object"))try{var L=Q.call(M);return(L===W||L===k||L===D||L===B)&&M("")==null}catch(A){}return!1}}return R6=U?function(M){if(O(M))return!0;if(!M)return!1;if(typeof M!=="function"&&typeof M!=="object")return!1;try{U(M,null,Y)}catch(L){if(L!==Z)return!1}return!G(M)&&X(M)}:function(M){if(O(M))return!0;if(!M)return!1;if(typeof M!=="function"&&typeof M!=="object")return!1;if(C)return X(M);if(G(M))return!1;var L=Q.call(M);if(L!==F&&L!==z&&!/^\[object HTML/.test(L))return!1;return X(M)},R6}var D6,hY;function cq(){if(hY)return D6;hY=1;var $=dq(),U=Object.prototype.toString,Y=Object.prototype.hasOwnProperty,Z=function(B,F,z){for(var W=0,k=B.length;W=3)W=z;if(X(B))Z(B,F,W);else if(typeof B==="string")J(B,F,W);else G(B,F,W)},D6}var A6,uY;function mq(){if(uY)return A6;return uY=1,A6=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],A6}var P6,dY;function lq(){if(dY)return P6;dY=1;var $=mq(),U=typeof globalThis>"u"?c0:globalThis;return P6=function(){var Z=[];for(var J=0;J<$.length;J++)if(typeof U[$[J]]==="function")Z[Z.length]=$[J];return Z},P6}var T6={exports:{}},C6,cY;function aq(){if(cY)return C6;cY=1;var $=e1(),U=GQ(),Y=t1(),Z=I1();return C6=function(G,X,Q){if(!G||typeof G!=="object"&&typeof G!=="function")throw new Y("`obj` must be an object or a function`");if(typeof X!=="string"&&typeof X!=="symbol")throw new Y("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=="boolean"&&arguments[3]!==null)throw new Y("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=="boolean"&&arguments[4]!==null)throw new Y("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=="boolean"&&arguments[5]!==null)throw new Y("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=="boolean")throw new Y("`loose`, if provided, must be a boolean");var B=arguments.length>3?arguments[3]:null,F=arguments.length>4?arguments[4]:null,z=arguments.length>5?arguments[5]:null,W=arguments.length>6?arguments[6]:!1,k=!!Z&&Z(G,X);if($)$(G,X,{configurable:z===null&&k?k.configurable:!z,enumerable:B===null&&k?k.enumerable:!B,value:Q,writable:F===null&&k?k.writable:!F});else if(W||!B&&!F&&!z)G[X]=Q;else throw new U("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},C6}var O6,mY;function pq(){if(mY)return O6;mY=1;var $=e1(),U=function(){return!!$};return U.hasArrayLengthDefineBug=function(){if(!$)return null;try{return $([],"length",{value:1}).length!==1}catch(Z){return!0}},O6=U,O6}var k6,lY;function iq(){if(lY)return k6;lY=1;var $=BQ(),U=aq(),Y=pq()(),Z=I1(),J=t1(),G=$("%Math.floor%");return k6=function(Q,B){if(typeof Q!=="function")throw new J("`fn` is not a function");if(typeof B!=="number"||B<0||B>4294967295||G(B)!==B)throw new J("`length` must be a positive 32-bit integer");var F=arguments.length>2&&!!arguments[2],z=!0,W=!0;if("length"in Q&&Z){var k=Z(Q,"length");if(k&&!k.configurable)z=!1;if(k&&!k.writable)W=!1}if(z||W||!F)if(Y)U(Q,"length",B,!0,!0);else U(Q,"length",B);return Q},k6}var E6,aY;function rq(){if(aY)return E6;aY=1;var $=w1(),U=u9(),Y=XQ();return E6=function(){return Y($,U,arguments)},E6}var pY;function sq(){if(pY)return T6.exports;return pY=1,function($){var U=iq(),Y=e1(),Z=d9(),J=rq();if($.exports=function(X){var Q=Z(arguments),B=X.length-(arguments.length-1);return U(Q,1+(B>0?B:0),!0)},Y)Y($.exports,"apply",{value:J});else $.exports.apply=J}(T6),T6.exports}var S6,iY;function MQ(){if(iY)return S6;iY=1;var $=cq(),U=lq(),Y=sq(),Z=LQ(),J=I1(),G=VQ(),X=Z("Object.prototype.toString"),Q=f9()(),B=typeof globalThis>"u"?c0:globalThis,F=U(),z=Z("String.prototype.slice"),W=Z("Array.prototype.indexOf",!0)||function(O,V){for(var j=0;j-1)return V;if(V!=="Object")return!1;return C(O)}if(!J)return null;return D(O)},S6}var v6,rY;function nq(){if(rY)return v6;rY=1;var $=MQ();return v6=function(Y){return!!$(Y)},v6}var sY;function oq(){if(sY)return x8;return sY=1,function($){var U=hq(),Y=uq(),Z=MQ(),J=nq();function G(w){return w.call.bind(w)}var X=typeof BigInt<"u",Q=typeof Symbol<"u",B=G(Object.prototype.toString),F=G(Number.prototype.valueOf),z=G(String.prototype.valueOf),W=G(Boolean.prototype.valueOf);if(X)var k=G(BigInt.prototype.valueOf);if(Q)var D=G(Symbol.prototype.valueOf);function C(w,x){if(typeof w!=="object")return!1;try{return x(w),!0}catch(l){return!1}}$.isArgumentsObject=U,$.isGeneratorFunction=Y,$.isTypedArray=J;function H(w){return typeof Promise<"u"&&w instanceof Promise||w!==null&&typeof w==="object"&&typeof w.then==="function"&&typeof w.catch==="function"}$.isPromise=H;function O(w){if(typeof ArrayBuffer<"u"&&ArrayBuffer.isView)return ArrayBuffer.isView(w);return J(w)||r(w)}$.isArrayBufferView=O;function V(w){return Z(w)==="Uint8Array"}$.isUint8Array=V;function j(w){return Z(w)==="Uint8ClampedArray"}$.isUint8ClampedArray=j;function M(w){return Z(w)==="Uint16Array"}$.isUint16Array=M;function L(w){return Z(w)==="Uint32Array"}$.isUint32Array=L;function A(w){return Z(w)==="Int8Array"}$.isInt8Array=A;function y(w){return Z(w)==="Int16Array"}$.isInt16Array=y;function g(w){return Z(w)==="Int32Array"}$.isInt32Array=g;function d(w){return Z(w)==="Float32Array"}$.isFloat32Array=d;function E(w){return Z(w)==="Float64Array"}$.isFloat64Array=E;function s(w){return Z(w)==="BigInt64Array"}$.isBigInt64Array=s;function V0(w){return Z(w)==="BigUint64Array"}$.isBigUint64Array=V0;function S(w){return B(w)==="[object Map]"}S.working=typeof Map<"u"&&S(new Map);function h(w){if(typeof Map>"u")return!1;return S.working?S(w):w instanceof Map}$.isMap=h;function N(w){return B(w)==="[object Set]"}N.working=typeof Set<"u"&&N(new Set);function a(w){if(typeof Set>"u")return!1;return N.working?N(w):w instanceof Set}$.isSet=a;function $0(w){return B(w)==="[object WeakMap]"}$0.working=typeof WeakMap<"u"&&$0(new WeakMap);function m(w){if(typeof WeakMap>"u")return!1;return $0.working?$0(w):w instanceof WeakMap}$.isWeakMap=m;function J0(w){return B(w)==="[object WeakSet]"}J0.working=typeof WeakSet<"u"&&J0(new WeakSet);function U0(w){return J0(w)}$.isWeakSet=U0;function L0(w){return B(w)==="[object ArrayBuffer]"}L0.working=typeof ArrayBuffer<"u"&&L0(new ArrayBuffer);function i(w){if(typeof ArrayBuffer>"u")return!1;return L0.working?L0(w):w instanceof ArrayBuffer}$.isArrayBuffer=i;function _(w){return B(w)==="[object DataView]"}_.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&_(new DataView(new ArrayBuffer(1),0,1));function r(w){if(typeof DataView>"u")return!1;return _.working?_(w):w instanceof DataView}$.isDataView=r;var n=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Z0(w){return B(w)==="[object SharedArrayBuffer]"}function p(w){if(typeof n>"u")return!1;if(typeof Z0.working>"u")Z0.working=Z0(new n);return Z0.working?Z0(w):w instanceof n}$.isSharedArrayBuffer=p;function P(w){return B(w)==="[object AsyncFunction]"}$.isAsyncFunction=P;function R(w){return B(w)==="[object Map Iterator]"}$.isMapIterator=R;function c(w){return B(w)==="[object Set Iterator]"}$.isSetIterator=c;function f(w){return B(w)==="[object Generator]"}$.isGeneratorObject=f;function v(w){return B(w)==="[object WebAssembly.Module]"}$.isWebAssemblyCompiledModule=v;function b(w){return C(w,F)}$.isNumberObject=b;function e(w){return C(w,z)}$.isStringObject=e;function I(w){return C(w,W)}$.isBooleanObject=I;function t(w){return X&&C(w,k)}$.isBigIntObject=t;function T(w){return Q&&C(w,D)}$.isSymbolObject=T;function K(w){return b(w)||e(w)||I(w)||t(w)||T(w)}$.isBoxedPrimitive=K;function q(w){return typeof Uint8Array<"u"&&(i(w)||p(w))}$.isAnyArrayBuffer=q,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(w){Object.defineProperty($,w,{enumerable:!1,value:function(){throw Error(w+" is not supported in userland")}})})}(x8),x8}var _6,nY;function tq(){if(nY)return _6;return nY=1,_6=function(U){return U&&typeof U==="object"&&typeof U.copy==="function"&&typeof U.fill==="function"&&typeof U.readUInt8==="function"},_6}var oY;function IQ(){if(oY)return g8;return oY=1,function($){var U=Object.getOwnPropertyDescriptors||function(r){var n=Object.keys(r),Z0={};for(var p=0;p=p)return c;switch(c){case"%s":return String(Z0[n++]);case"%d":return Number(Z0[n++]);case"%j":try{return JSON.stringify(Z0[n++])}catch(f){return"[Circular]"}default:return c}});for(var R=Z0[n];n"u")return function(){return $.deprecate(_,r).apply(this,arguments)};var n=!1;function Z0(){if(!n){if(j0.throwDeprecation)throw Error(r);else if(j0.traceDeprecation)console.trace(r);else console.error(r);n=!0}return _.apply(this,arguments)}return Z0};var Z={},J=/^$/;if(j0.env.NODE_DEBUG){var G=j0.env.NODE_DEBUG;G=G.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),J=new RegExp("^"+G+"$","i")}$.debuglog=function(_){if(_=_.toUpperCase(),!Z[_])if(J.test(_)){var r=j0.pid;Z[_]=function(){var n=$.format.apply($,arguments);console.error("%s %d: %s",_,r,n)}}else Z[_]=function(){};return Z[_]};function X(_,r){var n={seen:[],stylize:B};if(arguments.length>=3)n.depth=arguments[2];if(arguments.length>=4)n.colors=arguments[3];if(V(r))n.showHidden=r;else if(r)$._extend(n,r);if(g(n.showHidden))n.showHidden=!1;if(g(n.depth))n.depth=2;if(g(n.colors))n.colors=!1;if(g(n.customInspect))n.customInspect=!0;if(n.colors)n.stylize=Q;return z(n,_,n.depth)}$.inspect=X,X.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},X.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function Q(_,r){var n=X.styles[r];if(n)return"\x1B["+X.colors[n][0]+"m"+_+"\x1B["+X.colors[n][1]+"m";else return _}function B(_,r){return _}function F(_){var r={};return _.forEach(function(n,Z0){r[n]=!0}),r}function z(_,r,n){if(_.customInspect&&r&&S(r.inspect)&&r.inspect!==$.inspect&&!(r.constructor&&r.constructor.prototype===r)){var Z0=r.inspect(n,_);if(!A(Z0))Z0=z(_,Z0,n);return Z0}var p=W(_,r);if(p)return p;var P=Object.keys(r),R=F(P);if(_.showHidden)P=Object.getOwnPropertyNames(r);if(V0(r)&&(P.indexOf("message")>=0||P.indexOf("description")>=0))return k(r);if(P.length===0){if(S(r)){var c=r.name?": "+r.name:"";return _.stylize("[Function"+c+"]","special")}if(d(r))return _.stylize(RegExp.prototype.toString.call(r),"regexp");if(s(r))return _.stylize(Date.prototype.toString.call(r),"date");if(V0(r))return k(r)}var f="",v=!1,b=["{","}"];if(O(r))v=!0,b=["[","]"];if(S(r)){var e=r.name?": "+r.name:"";f=" [Function"+e+"]"}if(d(r))f=" "+RegExp.prototype.toString.call(r);if(s(r))f=" "+Date.prototype.toUTCString.call(r);if(V0(r))f=" "+k(r);if(P.length===0&&(!v||r.length==0))return b[0]+f+b[1];if(n<0)if(d(r))return _.stylize(RegExp.prototype.toString.call(r),"regexp");else return _.stylize("[Object]","special");_.seen.push(r);var I;if(v)I=D(_,r,n,R,P);else I=P.map(function(t){return C(_,r,n,R,t,v)});return _.seen.pop(),H(I,f,b)}function W(_,r){if(g(r))return _.stylize("undefined","undefined");if(A(r)){var n="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return _.stylize(n,"string")}if(L(r))return _.stylize(""+r,"number");if(V(r))return _.stylize(""+r,"boolean");if(j(r))return _.stylize("null","null")}function k(_){return"["+Error.prototype.toString.call(_)+"]"}function D(_,r,n,Z0,p){var P=[];for(var R=0,c=r.length;R-1)if(P)c=c.split(` -`).map(function(v){return" "+v}).join(` -`).slice(2);else c=` -`+c.split(` -`).map(function(v){return" "+v}).join(` -`)}else c=_.stylize("[Circular]","special");if(g(R)){if(P&&p.match(/^\d+$/))return c;if(R=JSON.stringify(""+p),R.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/))R=R.slice(1,-1),R=_.stylize(R,"name");else R=R.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),R=_.stylize(R,"string")}return R+": "+c}function H(_,r,n){var Z0=_.reduce(function(p,P){if(P.indexOf(` -`)>=0);return p+P.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(Z0>60)return n[0]+(r===""?"":r+` - `)+" "+_.join(`, - `)+" "+n[1];return n[0]+r+" "+_.join(", ")+" "+n[1]}$.types=oq();function O(_){return Array.isArray(_)}$.isArray=O;function V(_){return typeof _==="boolean"}$.isBoolean=V;function j(_){return _===null}$.isNull=j;function M(_){return _==null}$.isNullOrUndefined=M;function L(_){return typeof _==="number"}$.isNumber=L;function A(_){return typeof _==="string"}$.isString=A;function y(_){return typeof _==="symbol"}$.isSymbol=y;function g(_){return _===void 0}$.isUndefined=g;function d(_){return E(_)&&N(_)==="[object RegExp]"}$.isRegExp=d,$.types.isRegExp=d;function E(_){return typeof _==="object"&&_!==null}$.isObject=E;function s(_){return E(_)&&N(_)==="[object Date]"}$.isDate=s,$.types.isDate=s;function V0(_){return E(_)&&(N(_)==="[object Error]"||_ instanceof Error)}$.isError=V0,$.types.isNativeError=V0;function S(_){return typeof _==="function"}$.isFunction=S;function h(_){return _===null||typeof _==="boolean"||typeof _==="number"||typeof _==="string"||typeof _==="symbol"||typeof _>"u"}$.isPrimitive=h,$.isBuffer=tq();function N(_){return Object.prototype.toString.call(_)}function a(_){return _<10?"0"+_.toString(10):_.toString(10)}var $0=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function m(){var _=new Date,r=[a(_.getHours()),a(_.getMinutes()),a(_.getSeconds())].join(":");return[_.getDate(),$0[_.getMonth()],r].join(" ")}$.log=function(){console.log("%s - %s",m(),$.format.apply($,arguments))},$.inherits=R2(),$._extend=function(_,r){if(!r||!E(r))return _;var n=Object.keys(r),Z0=n.length;while(Z0--)_[n[Z0]]=r[n[Z0]];return _};function J0(_,r){return Object.prototype.hasOwnProperty.call(_,r)}var U0=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;$.promisify=function(r){if(typeof r!=="function")throw TypeError('The "original" argument must be of type Function');if(U0&&r[U0]){var n=r[U0];if(typeof n!=="function")throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(n,U0,{value:n,enumerable:!1,writable:!1,configurable:!0}),n}function n(){var Z0,p,P=new Promise(function(f,v){Z0=f,p=v}),R=[];for(var c=0;c0)this.tail.next=V;else this.head=V;this.tail=V,++this.length}},{key:"unshift",value:function(O){var V={data:O,next:this.head};if(this.length===0)this.tail=V;this.head=V,++this.length}},{key:"shift",value:function(){if(this.length===0)return;var O=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,O}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(O){if(this.length===0)return"";var V=this.head,j=""+V.data;while(V=V.next)j+=O+V.data;return j}},{key:"concat",value:function(O){if(this.length===0)return F.alloc(0);var V=F.allocUnsafe(O>>>0),j=this.head,M=0;while(j)D(j.data,V,M),M+=j.data.length,j=j.next;return V}},{key:"consume",value:function(O,V){var j;if(OL.length?L.length:O;if(A===L.length)M+=L;else M+=L.slice(0,O);if(O-=A,O===0){if(A===L.length)if(++j,V.next)this.head=V.next;else this.head=this.tail=null;else this.head=V,V.data=L.slice(A);break}++j}return this.length-=j,M}},{key:"_getBuffer",value:function(O){var V=F.allocUnsafe(O),j=this.head,M=1;j.data.copy(V),O-=j.data.length;while(j=j.next){var L=j.data,A=O>L.length?L.length:O;if(L.copy(V,V.length-O,0,A),O-=A,O===0){if(A===L.length)if(++M,j.next)this.head=j.next;else this.head=this.tail=null;else this.head=j,j.data=L.slice(A);break}++M}return this.length-=M,V}},{key:k,value:function(O,V){return W(this,U(U({},V),{},{depth:0,customInspect:!1}))}}]),C}(),y6}var b6,eY;function wQ(){if(eY)return b6;eY=1;function $(X,Q){var B=this,F=this._readableState&&this._readableState.destroyed,z=this._writableState&&this._writableState.destroyed;if(F||z){if(Q)Q(X);else if(X){if(!this._writableState)j0.nextTick(J,this,X);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,j0.nextTick(J,this,X)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy(X||null,function(W){if(!Q&&W)if(!B._writableState)j0.nextTick(U,B,W);else if(!B._writableState.errorEmitted)B._writableState.errorEmitted=!0,j0.nextTick(U,B,W);else j0.nextTick(Y,B);else if(Q)j0.nextTick(Y,B),Q(W);else j0.nextTick(Y,B)}),this}function U(X,Q){J(X,Q),Y(X)}function Y(X){if(X._writableState&&!X._writableState.emitClose)return;if(X._readableState&&!X._readableState.emitClose)return;X.emit("close")}function Z(){if(this._readableState)this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1;if(this._writableState)this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1}function J(X,Q){X.emit("error",Q)}function G(X,Q){var{_readableState:B,_writableState:F}=X;if(B&&B.autoDestroy||F&&F.autoDestroy)X.destroy(Q);else X.emit("error",Q)}return b6={destroy:$,undestroy:Z,errorOrDestroy:G},b6}var g6={},$Z;function i2(){if($Z)return g6;$Z=1;function $(Q,B){Q.prototype=Object.create(B.prototype),Q.prototype.constructor=Q,Q.__proto__=B}var U={};function Y(Q,B,F){if(!F)F=Error;function z(k,D,C){if(typeof B==="string")return B;else return B(k,D,C)}var W=function(k){$(D,k);function D(C,H,O){return k.call(this,z(C,H,O))||this}return D}(F);W.prototype.name=F.name,W.prototype.code=Q,U[Q]=W}function Z(Q,B){if(Array.isArray(Q)){var F=Q.length;if(Q=Q.map(function(z){return String(z)}),F>2)return"one of ".concat(B," ").concat(Q.slice(0,F-1).join(", "),", or ")+Q[F-1];else if(F===2)return"one of ".concat(B," ").concat(Q[0]," or ").concat(Q[1]);else return"of ".concat(B," ").concat(Q[0])}else return"of ".concat(B," ").concat(String(Q))}function J(Q,B,F){return Q.substr(0,B.length)===B}function G(Q,B,F){if(F===void 0||F>Q.length)F=Q.length;return Q.substring(F-B.length,F)===B}function X(Q,B,F){if(typeof F!=="number")F=0;if(F+B.length>Q.length)return!1;else return Q.indexOf(B,F)!==-1}return Y("ERR_INVALID_OPT_VALUE",function(Q,B){return'The value "'+B+'" is invalid for option "'+Q+'"'},TypeError),Y("ERR_INVALID_ARG_TYPE",function(Q,B,F){var z;if(typeof B==="string"&&J(B,"not "))z="must not be",B=B.replace(/^not /,"");else z="must be";var W;if(G(Q," argument"))W="The ".concat(Q," ").concat(z," ").concat(Z(B,"type"));else{var k=X(Q,".")?"property":"argument";W='The "'.concat(Q,'" ').concat(k," ").concat(z," ").concat(Z(B,"type"))}return W+=". Received type ".concat(typeof F),W},TypeError),Y("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),Y("ERR_METHOD_NOT_IMPLEMENTED",function(Q){return"The "+Q+" method is not implemented"}),Y("ERR_STREAM_PREMATURE_CLOSE","Premature close"),Y("ERR_STREAM_DESTROYED",function(Q){return"Cannot call "+Q+" after a stream was destroyed"}),Y("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),Y("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),Y("ERR_STREAM_WRITE_AFTER_END","write after end"),Y("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),Y("ERR_UNKNOWN_ENCODING",function(Q){return"Unknown encoding: "+Q},TypeError),Y("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),g6.codes=U,g6}var x6,UZ;function WQ(){if(UZ)return x6;UZ=1;var $=i2().codes.ERR_INVALID_OPT_VALUE;function U(Z,J,G){return Z.highWaterMark!=null?Z.highWaterMark:J?Z[G]:null}function Y(Z,J,G,X){var Q=U(J,X,G);if(Q!=null){if(!(isFinite(Q)&&Math.floor(Q)===Q)||Q<0){var B=X?G:"highWaterMark";throw new $(B,Q)}return Math.floor(Q)}return Z.objectMode?16:16384}return x6={getHighWaterMark:Y},x6}var f6,YZ;function $X(){if(YZ)return f6;YZ=1,f6=$;function $(Y,Z){if(U("noDeprecation"))return Y;var J=!1;function G(){if(!J){if(U("throwDeprecation"))throw Error(Z);else if(U("traceDeprecation"))console.trace(Z);else console.warn(Z);J=!0}return Y.apply(this,arguments)}return G}function U(Y){try{if(!c0.localStorage)return!1}catch(J){return!1}var Z=c0.localStorage[Y];if(Z==null)return!1;return String(Z).toLowerCase()==="true"}return f6}var h6,ZZ;function HQ(){if(ZZ)return h6;ZZ=1,h6=d;function $(p){var P=this;this.next=null,this.entry=null,this.finish=function(){Z0(P,p)}}var U;d.WritableState=y;var Y={deprecate:$X()},Z=ZQ(),J=o1().Buffer,G=(typeof c0<"u"?c0:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function X(p){return J.from(p)}function Q(p){return J.isBuffer(p)||p instanceof G}var B=wQ(),F=WQ(),z=F.getHighWaterMark,W=i2().codes,k=W.ERR_INVALID_ARG_TYPE,D=W.ERR_METHOD_NOT_IMPLEMENTED,C=W.ERR_MULTIPLE_CALLBACK,H=W.ERR_STREAM_CANNOT_PIPE,O=W.ERR_STREAM_DESTROYED,V=W.ERR_STREAM_NULL_VALUES,j=W.ERR_STREAM_WRITE_AFTER_END,M=W.ERR_UNKNOWN_ENCODING,L=B.errorOrDestroy;R2()(d,Z);function A(){}function y(p,P,R){if(U=U||l2(),p=p||{},typeof R!=="boolean")R=P instanceof U;if(this.objectMode=!!p.objectMode,R)this.objectMode=this.objectMode||!!p.writableObjectMode;this.highWaterMark=z(this,p,"writableHighWaterMark",R),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var c=p.decodeStrings===!1;this.decodeStrings=!c,this.defaultEncoding=p.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(f){$0(P,f)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=p.emitClose!==!1,this.autoDestroy=!!p.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new $(this)}y.prototype.getBuffer=function(){var P=this.bufferedRequest,R=[];while(P)R.push(P),P=P.next;return R},function(){try{Object.defineProperty(y.prototype,"buffer",{get:Y.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(p){}}();var g;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")g=Function.prototype[Symbol.hasInstance],Object.defineProperty(d,Symbol.hasInstance,{value:function(P){if(g.call(this,P))return!0;if(this!==d)return!1;return P&&P._writableState instanceof y}});else g=function(P){return P instanceof this};function d(p){U=U||l2();var P=this instanceof U;if(!P&&!g.call(d,this))return new d(p);if(this._writableState=new y(p,this,P),this.writable=!0,p){if(typeof p.write==="function")this._write=p.write;if(typeof p.writev==="function")this._writev=p.writev;if(typeof p.destroy==="function")this._destroy=p.destroy;if(typeof p.final==="function")this._final=p.final}Z.call(this)}d.prototype.pipe=function(){L(this,new H)};function E(p,P){var R=new j;L(p,R),j0.nextTick(P,R)}function s(p,P,R,c){var f;if(R===null)f=new V;else if(typeof R!=="string"&&!P.objectMode)f=new k("chunk",["string","Buffer"],R);if(f)return L(p,f),j0.nextTick(c,f),!1;return!0}d.prototype.write=function(p,P,R){var c=this._writableState,f=!1,v=!c.objectMode&&Q(p);if(v&&!J.isBuffer(p))p=X(p);if(typeof P==="function")R=P,P=null;if(v)P="buffer";else if(!P)P=c.defaultEncoding;if(typeof R!=="function")R=A;if(c.ending)E(this,R);else if(v||s(this,c,p,R))c.pendingcb++,f=S(this,c,v,p,P,R);return f},d.prototype.cork=function(){this._writableState.corked++},d.prototype.uncork=function(){var p=this._writableState;if(p.corked){if(p.corked--,!p.writing&&!p.corked&&!p.bufferProcessing&&p.bufferedRequest)U0(this,p)}},d.prototype.setDefaultEncoding=function(P){if(typeof P==="string")P=P.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((P+"").toLowerCase())>-1))throw new M(P);return this._writableState.defaultEncoding=P,this},Object.defineProperty(d.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function V0(p,P,R){if(!p.objectMode&&p.decodeStrings!==!1&&typeof P==="string")P=J.from(P,R);return P}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function S(p,P,R,c,f,v){if(!R){var b=V0(P,c,f);if(c!==b)R=!0,f="buffer",c=b}var e=P.objectMode?1:c.length;P.length+=e;var I=P.length>5===6)return 2;else if(V>>4===14)return 3;else if(V>>3===30)return 4;return V>>6===2?-1:-2}function X(V,j,M){var L=j.length-1;if(L=0){if(A>0)V.lastNeed=A-1;return A}if(--L=0){if(A>0)V.lastNeed=A-2;return A}if(--L=0){if(A>0)if(A===2)A=0;else V.lastNeed=A-3;return A}return 0}function Q(V,j,M){if((j[0]&192)!==128)return V.lastNeed=0,"�";if(V.lastNeed>1&&j.length>1){if((j[1]&192)!==128)return V.lastNeed=1,"�";if(V.lastNeed>2&&j.length>2){if((j[2]&192)!==128)return V.lastNeed=2,"�"}}}function B(V){var j=this.lastTotal-this.lastNeed,M=Q(this,V);if(M!==void 0)return M;if(this.lastNeed<=V.length)return V.copy(this.lastChar,j,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);V.copy(this.lastChar,j,0,V.length),this.lastNeed-=V.length}function F(V,j){var M=X(this,V,j);if(!this.lastNeed)return V.toString("utf8",j);this.lastTotal=M;var L=V.length-(M-this.lastNeed);return V.copy(this.lastChar,0,L),V.toString("utf8",j,L)}function z(V){var j=V&&V.length?this.write(V):"";if(this.lastNeed)return j+"�";return j}function W(V,j){if((V.length-j)%2===0){var M=V.toString("utf16le",j);if(M){var L=M.charCodeAt(M.length-1);if(L>=55296&&L<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=V[V.length-2],this.lastChar[1]=V[V.length-1],M.slice(0,-1)}return M}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=V[V.length-1],V.toString("utf16le",j,V.length-1)}function k(V){var j=V&&V.length?this.write(V):"";if(this.lastNeed){var M=this.lastTotal-this.lastNeed;return j+this.lastChar.toString("utf16le",0,M)}return j}function D(V,j){var M=(V.length-j)%3;if(M===0)return V.toString("base64",j);if(this.lastNeed=3-M,this.lastTotal=3,M===1)this.lastChar[0]=V[V.length-1];else this.lastChar[0]=V[V.length-2],this.lastChar[1]=V[V.length-1];return V.toString("base64",j,V.length-M)}function C(V){var j=V&&V.length?this.write(V):"";if(this.lastNeed)return j+this.lastChar.toString("base64",0,3-this.lastNeed);return j}function H(V){return V.toString(this.encoding)}function O(V){return V&&V.length?this.write(V):""}return d6}var c6,KZ;function c9(){if(KZ)return c6;KZ=1;var $=i2().codes.ERR_STREAM_PREMATURE_CLOSE;function U(G){var X=!1;return function(){if(X)return;X=!0;for(var Q=arguments.length,B=Array(Q),F=0;F0){if(typeof b!=="string"&&!T.objectMode&&Object.getPrototypeOf(b)!==Z.prototype)b=G(b);if(I)if(T.endEmitted)A(v,new V);else V0(v,T,b,!0);else if(T.ended)A(v,new H);else if(T.destroyed)return!1;else if(T.reading=!1,T.decoder&&!e)if(b=T.decoder.write(b),T.objectMode||b.length!==0)V0(v,T,b,!1);else U0(v,T);else V0(v,T,b,!1)}else if(!I)T.reading=!1,U0(v,T)}return!T.ended&&(T.length=h)v=h;else v--,v|=v>>>1,v|=v>>>2,v|=v>>>4,v|=v>>>8,v|=v>>>16,v++;return v}function a(v,b){if(v<=0||b.length===0&&b.ended)return 0;if(b.objectMode)return 1;if(v!==v)if(b.flowing&&b.length)return b.buffer.head.data.length;else return b.length;if(v>b.highWaterMark)b.highWaterMark=N(v);if(v<=b.length)return v;if(!b.ended)return b.needReadable=!0,0;return b.length}E.prototype.read=function(v){B("read",v),v=parseInt(v,10);var b=this._readableState,e=v;if(v!==0)b.emittedReadable=!1;if(v===0&&b.needReadable&&((b.highWaterMark!==0?b.length>=b.highWaterMark:b.length>0)||b.ended)){if(B("read: emitReadable",b.length,b.ended),b.length===0&&b.ended)R(this);else m(this);return null}if(v=a(v,b),v===0&&b.ended){if(b.length===0)R(this);return null}var I=b.needReadable;if(B("need readable",I),b.length===0||b.length-v0)t=P(v,b);else t=null;if(t===null)b.needReadable=b.length<=b.highWaterMark,v=0;else b.length-=v,b.awaitDrain=0;if(b.length===0){if(!b.ended)b.needReadable=!0;if(e!==v&&b.ended)R(this)}if(t!==null)this.emit("data",t);return t};function $0(v,b){if(B("onEofChunk"),b.ended)return;if(b.decoder){var e=b.decoder.end();if(e&&e.length)b.buffer.push(e),b.length+=b.objectMode?1:e.length}if(b.ended=!0,b.sync)m(v);else if(b.needReadable=!1,!b.emittedReadable)b.emittedReadable=!0,J0(v)}function m(v){var b=v._readableState;if(B("emitReadable",b.needReadable,b.emittedReadable),b.needReadable=!1,!b.emittedReadable)B("emitReadable",b.flowing),b.emittedReadable=!0,j0.nextTick(J0,v)}function J0(v){var b=v._readableState;if(B("emitReadable_",b.destroyed,b.length,b.ended),!b.destroyed&&(b.length||b.ended))v.emit("readable"),b.emittedReadable=!1;b.needReadable=!b.flowing&&!b.ended&&b.length<=b.highWaterMark,p(v)}function U0(v,b){if(!b.readingMore)b.readingMore=!0,j0.nextTick(L0,v,b)}function L0(v,b){while(!b.reading&&!b.ended&&(b.length1&&f(I.pipes,v)!==-1)&&!x)B("false write response, pause",I.awaitDrain),I.awaitDrain++;e.pause()}}function Q0(w0){if(B("onerror",w0),M0(),v.removeListener("error",Q0),U(v,"error")===0)A(v,w0)}g(v,"error",Q0);function q0(){v.removeListener("finish",K0),M0()}v.once("close",q0);function K0(){B("onfinish"),v.removeListener("close",q0),M0()}v.once("finish",K0);function M0(){B("unpipe"),e.unpipe(v)}if(v.emit("pipe",e),!I.flowing)B("pipe resume"),e.resume();return v};function i(v){return function(){var e=v._readableState;if(B("pipeOnDrain",e.awaitDrain),e.awaitDrain)e.awaitDrain--;if(e.awaitDrain===0&&U(v,"data"))e.flowing=!0,p(v)}}E.prototype.unpipe=function(v){var b=this._readableState,e={hasUnpiped:!1};if(b.pipesCount===0)return this;if(b.pipesCount===1){if(v&&v!==b.pipes)return this;if(!v)v=b.pipes;if(b.pipes=null,b.pipesCount=0,b.flowing=!1,v)v.emit("unpipe",this,e);return this}if(!v){var{pipes:I,pipesCount:t}=b;b.pipes=null,b.pipesCount=0,b.flowing=!1;for(var T=0;T0,I.flowing!==!1)this.resume()}else if(v==="readable"){if(!I.endEmitted&&!I.readableListening){if(I.readableListening=I.needReadable=!0,I.flowing=!1,I.emittedReadable=!1,B("on readable",I.length,I.reading),I.length)m(this);else if(!I.reading)j0.nextTick(r,this)}}return e},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(v,b){var e=Y.prototype.removeListener.call(this,v,b);if(v==="readable")j0.nextTick(_,this);return e},E.prototype.removeAllListeners=function(v){var b=Y.prototype.removeAllListeners.apply(this,arguments);if(v==="readable"||v===void 0)j0.nextTick(_,this);return b};function _(v){var b=v._readableState;if(b.readableListening=v.listenerCount("readable")>0,b.resumeScheduled&&!b.paused)b.flowing=!0;else if(v.listenerCount("data")>0)v.resume()}function r(v){B("readable nexttick read 0"),v.read(0)}E.prototype.resume=function(){var v=this._readableState;if(!v.flowing)B("resume"),v.flowing=!v.readableListening,n(this,v);return v.paused=!1,this};function n(v,b){if(!b.resumeScheduled)b.resumeScheduled=!0,j0.nextTick(Z0,v,b)}function Z0(v,b){if(B("resume",b.reading),!b.reading)v.read(0);if(b.resumeScheduled=!1,v.emit("resume"),p(v),b.flowing&&!b.reading)v.read(0)}E.prototype.pause=function(){if(B("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)B("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState.paused=!0,this};function p(v){var b=v._readableState;B("flow",b.flowing);while(b.flowing&&v.read()!==null);}if(E.prototype.wrap=function(v){var b=this,e=this._readableState,I=!1;v.on("end",function(){if(B("wrapped end"),e.decoder&&!e.ended){var K=e.decoder.end();if(K&&K.length)b.push(K)}b.push(null)}),v.on("data",function(K){if(B("wrapped data"),e.decoder)K=e.decoder.write(K);if(e.objectMode&&(K===null||K===void 0))return;else if(!e.objectMode&&(!K||!K.length))return;var q=b.push(K);if(!q)I=!0,v.pause()});for(var t in v)if(this[t]===void 0&&typeof v[t]==="function")this[t]=function(q){return function(){return v[q].apply(v,arguments)}}(t);for(var T=0;T=b.length){if(b.decoder)e=b.buffer.join("");else if(b.buffer.length===1)e=b.buffer.first();else e=b.buffer.concat(b.length);b.buffer.clear()}else e=b.buffer.consume(v,b.decoder);return e}function R(v){var b=v._readableState;if(B("endReadable",b.endEmitted),!b.endEmitted)b.ended=!0,j0.nextTick(c,b,v)}function c(v,b){if(B("endReadableNT",v.endEmitted,v.length),!v.endEmitted&&v.length===0){if(v.endEmitted=!0,b.readable=!1,b.emit("end"),v.autoDestroy){var e=b._writableState;if(!e||e.autoDestroy&&e.finished)b.destroy()}}}if(typeof Symbol==="function")E.from=function(v,b){if(L===void 0)L=ZX();return L(E,v,b)};function f(v,b){for(var e=0,I=v.length;e0;return Q(j,L,A,function(y){if(!O)O=y;if(y)V.forEach(B);if(L)return;V.forEach(B),H(O)})});return D.reduce(F)}return r6=W,r6}var s6,IZ;function m9(){if(IZ)return s6;IZ=1,s6=Y;var $=x9().EventEmitter,U=R2();U(Y,$),Y.Readable=jQ(),Y.Writable=HQ(),Y.Duplex=l2(),Y.Transform=zQ(),Y.PassThrough=QX(),Y.finished=c9(),Y.pipeline=JX(),Y.Stream=Y;function Y(){$.call(this)}return Y.prototype.pipe=function(Z,J){var G=this;function X(D){if(Z.writable){if(Z.write(D)===!1&&G.pause)G.pause()}}G.on("data",X);function Q(){if(G.readable&&G.resume)G.resume()}if(Z.on("drain",Q),!Z._isStdio&&(!J||J.end!==!1))G.on("end",F),G.on("close",z);var B=!1;function F(){if(B)return;B=!0,Z.end()}function z(){if(B)return;if(B=!0,typeof Z.destroy==="function")Z.destroy()}function W(D){if(k(),$.listenerCount(this,"error")===0)throw D}G.on("error",W),Z.on("error",W);function k(){G.removeListener("data",X),Z.removeListener("drain",Q),G.removeListener("end",F),G.removeListener("close",z),G.removeListener("error",W),Z.removeListener("error",W),G.removeListener("end",k),G.removeListener("close",k),Z.removeListener("close",k)}return G.on("end",k),G.on("close",k),Z.on("close",k),Z.emit("pipe",G),Z},s6}var wZ;function GX(){if(wZ)return _8;return wZ=1,function($){(function(U){U.parser=function(P,R){return new Z(P,R)},U.SAXParser=Z,U.SAXStream=z,U.createStream=F,U.MAX_BUFFER_LENGTH=65536;var Y=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];U.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function Z(P,R){if(!(this instanceof Z))return new Z(P,R);var c=this;if(G(c),c.q=c.c="",c.bufferCheckPosition=U.MAX_BUFFER_LENGTH,c.opt=R||{},c.opt.lowercase=c.opt.lowercase||c.opt.lowercasetags,c.looseCase=c.opt.lowercase?"toLowerCase":"toUpperCase",c.tags=[],c.closed=c.closedRoot=c.sawRoot=!1,c.tag=c.error=null,c.strict=!!P,c.noscript=!!(P||c.opt.noscript),c.state=E.BEGIN,c.strictEntities=c.opt.strictEntities,c.ENTITIES=c.strictEntities?Object.create(U.XML_ENTITIES):Object.create(U.ENTITIES),c.attribList=[],c.opt.xmlns)c.ns=Object.create(H);if(c.trackPosition=c.opt.position!==!1,c.trackPosition)c.position=c.line=c.column=0;V0(c,"onready")}if(!Object.create)Object.create=function(P){function R(){}R.prototype=P;var c=new R;return c};if(!Object.keys)Object.keys=function(P){var R=[];for(var c in P)if(P.hasOwnProperty(c))R.push(c);return R};function J(P){var R=Math.max(U.MAX_BUFFER_LENGTH,10),c=0;for(var f=0,v=Y.length;fR)switch(Y[f]){case"textNode":h(P);break;case"cdata":S(P,"oncdata",P.cdata),P.cdata="";break;case"script":S(P,"onscript",P.script),P.script="";break;default:a(P,"Max buffer length exceeded: "+Y[f])}c=Math.max(c,b)}var e=U.MAX_BUFFER_LENGTH-c;P.bufferCheckPosition=e+P.position}function G(P){for(var R=0,c=Y.length;R"||L(P)}function g(P,R){return P.test(R)}function d(P,R){return!g(P,R)}var E=0;U.STATE={BEGIN:E++,BEGIN_WHITESPACE:E++,TEXT:E++,TEXT_ENTITY:E++,OPEN_WAKA:E++,SGML_DECL:E++,SGML_DECL_QUOTED:E++,DOCTYPE:E++,DOCTYPE_QUOTED:E++,DOCTYPE_DTD:E++,DOCTYPE_DTD_QUOTED:E++,COMMENT_STARTING:E++,COMMENT:E++,COMMENT_ENDING:E++,COMMENT_ENDED:E++,CDATA:E++,CDATA_ENDING:E++,CDATA_ENDING_2:E++,PROC_INST:E++,PROC_INST_BODY:E++,PROC_INST_ENDING:E++,OPEN_TAG:E++,OPEN_TAG_SLASH:E++,ATTRIB:E++,ATTRIB_NAME:E++,ATTRIB_NAME_SAW_WHITE:E++,ATTRIB_VALUE:E++,ATTRIB_VALUE_QUOTED:E++,ATTRIB_VALUE_CLOSED:E++,ATTRIB_VALUE_UNQUOTED:E++,ATTRIB_VALUE_ENTITY_Q:E++,ATTRIB_VALUE_ENTITY_U:E++,CLOSE_TAG:E++,CLOSE_TAG_SAW_WHITE:E++,SCRIPT:E++,SCRIPT_ENDING:E++},U.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},U.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(U.ENTITIES).forEach(function(P){var R=U.ENTITIES[P],c=typeof R==="number"?String.fromCharCode(R):R;U.ENTITIES[P]=c});for(var s in U.STATE)U.STATE[U.STATE[s]]=s;E=U.STATE;function V0(P,R,c){P[R]&&P[R](c)}function S(P,R,c){if(P.textNode)h(P);V0(P,R,c)}function h(P){if(P.textNode=N(P.opt,P.textNode),P.textNode)V0(P,"ontext",P.textNode);P.textNode=""}function N(P,R){if(P.trim)R=R.trim();if(P.normalize)R=R.replace(/\s+/g," ");return R}function a(P,R){if(h(P),P.trackPosition)R+=` -Line: `+P.line+` -Column: `+P.column+` -Char: `+P.c;return R=Error(R),P.error=R,V0(P,"onerror",R),P}function $0(P){if(P.sawRoot&&!P.closedRoot)m(P,"Unclosed root tag");if(P.state!==E.BEGIN&&P.state!==E.BEGIN_WHITESPACE&&P.state!==E.TEXT)a(P,"Unexpected end");return h(P),P.c="",P.closed=!0,V0(P,"onend"),Z.call(P,P.strict,P.opt),P}function m(P,R){if(typeof P!=="object"||!(P instanceof Z))throw Error("bad call to strictFail");if(P.strict)a(P,R)}function J0(P){if(!P.strict)P.tagName=P.tagName[P.looseCase]();var R=P.tags[P.tags.length-1]||P,c=P.tag={name:P.tagName,attributes:{}};if(P.opt.xmlns)c.ns=R.ns;P.attribList.length=0,S(P,"onopentagstart",c)}function U0(P,R){var c=P.indexOf(":"),f=c<0?["",P]:P.split(":"),v=f[0],b=f[1];if(R&&P==="xmlns")v="xmlns",b="";return{prefix:v,local:b}}function L0(P){if(!P.strict)P.attribName=P.attribName[P.looseCase]();if(P.attribList.indexOf(P.attribName)!==-1||P.tag.attributes.hasOwnProperty(P.attribName)){P.attribName=P.attribValue="";return}if(P.opt.xmlns){var R=U0(P.attribName,!0),c=R.prefix,f=R.local;if(c==="xmlns")if(f==="xml"&&P.attribValue!==D)m(P,"xml: prefix must be bound to "+D+` -Actual: `+P.attribValue);else if(f==="xmlns"&&P.attribValue!==C)m(P,"xmlns: prefix must be bound to "+C+` -Actual: `+P.attribValue);else{var v=P.tag,b=P.tags[P.tags.length-1]||P;if(v.ns===b.ns)v.ns=Object.create(b.ns);v.ns[f]=P.attribValue}P.attribList.push([P.attribName,P.attribValue])}else P.tag.attributes[P.attribName]=P.attribValue,S(P,"onattribute",{name:P.attribName,value:P.attribValue});P.attribName=P.attribValue=""}function i(P,R){if(P.opt.xmlns){var c=P.tag,f=U0(P.tagName);if(c.prefix=f.prefix,c.local=f.local,c.uri=c.ns[f.prefix]||"",c.prefix&&!c.uri)m(P,"Unbound namespace prefix: "+JSON.stringify(P.tagName)),c.uri=f.prefix;var v=P.tags[P.tags.length-1]||P;if(c.ns&&v.ns!==c.ns)Object.keys(c.ns).forEach(function(u){S(P,"onopennamespace",{prefix:u,uri:c.ns[u]})});for(var b=0,e=P.attribList.length;b",P.tagName="",P.state=E.SCRIPT;return}S(P,"onscript",P.script),P.script=""}var R=P.tags.length,c=P.tagName;if(!P.strict)c=c[P.looseCase]();var f=c;while(R--){var v=P.tags[R];if(v.name!==f)m(P,"Unexpected close tag");else break}if(R<0){m(P,"Unmatched closing tag: "+P.tagName),P.textNode+="",P.state=E.TEXT;return}P.tagName=c;var b=P.tags.length;while(b-- >R){var e=P.tag=P.tags.pop();P.tagName=P.tag.name,S(P,"onclosetag",P.tagName);var I={};for(var t in e.ns)I[t]=e.ns[t];var T=P.tags[P.tags.length-1]||P;if(P.opt.xmlns&&e.ns!==T.ns)Object.keys(e.ns).forEach(function(K){var q=e.ns[K];S(P,"onclosenamespace",{prefix:K,uri:q})})}if(R===0)P.closedRoot=!0;P.tagName=P.attribValue=P.attribName="",P.attribList.length=0,P.state=E.TEXT}function r(P){var R=P.entity,c=R.toLowerCase(),f,v="";if(P.ENTITIES[R])return P.ENTITIES[R];if(P.ENTITIES[c])return P.ENTITIES[c];if(R=c,R.charAt(0)==="#")if(R.charAt(1)==="x")R=R.slice(2),f=parseInt(R,16),v=f.toString(16);else R=R.slice(1),f=parseInt(R,10),v=f.toString(10);if(R=R.replace(/^0+/,""),isNaN(f)||v.toLowerCase()!==R)return m(P,"Invalid character entity"),"&"+P.entity+";";return String.fromCodePoint(f)}function n(P,R){if(R==="<")P.state=E.OPEN_WAKA,P.startTagPosition=P.position;else if(!L(R))m(P,"Non-whitespace before first tag."),P.textNode=R,P.state=E.TEXT}function Z0(P,R){var c="";if(R")S(R,"onsgmldeclaration",R.sgmlDecl),R.sgmlDecl="",R.state=E.TEXT;else if(A(f))R.state=E.SGML_DECL_QUOTED,R.sgmlDecl+=f;else R.sgmlDecl+=f;continue;case E.SGML_DECL_QUOTED:if(f===R.q)R.state=E.SGML_DECL,R.q="";R.sgmlDecl+=f;continue;case E.DOCTYPE:if(f===">")R.state=E.TEXT,S(R,"ondoctype",R.doctype),R.doctype=!0;else if(R.doctype+=f,f==="[")R.state=E.DOCTYPE_DTD;else if(A(f))R.state=E.DOCTYPE_QUOTED,R.q=f;continue;case E.DOCTYPE_QUOTED:if(R.doctype+=f,f===R.q)R.q="",R.state=E.DOCTYPE;continue;case E.DOCTYPE_DTD:if(R.doctype+=f,f==="]")R.state=E.DOCTYPE;else if(A(f))R.state=E.DOCTYPE_DTD_QUOTED,R.q=f;continue;case E.DOCTYPE_DTD_QUOTED:if(R.doctype+=f,f===R.q)R.state=E.DOCTYPE_DTD,R.q="";continue;case E.COMMENT:if(f==="-")R.state=E.COMMENT_ENDING;else R.comment+=f;continue;case E.COMMENT_ENDING:if(f==="-"){if(R.state=E.COMMENT_ENDED,R.comment=N(R.opt,R.comment),R.comment)S(R,"oncomment",R.comment);R.comment=""}else R.comment+="-"+f,R.state=E.COMMENT;continue;case E.COMMENT_ENDED:if(f!==">")m(R,"Malformed comment"),R.comment+="--"+f,R.state=E.COMMENT;else R.state=E.TEXT;continue;case E.CDATA:if(f==="]")R.state=E.CDATA_ENDING;else R.cdata+=f;continue;case E.CDATA_ENDING:if(f==="]")R.state=E.CDATA_ENDING_2;else R.cdata+="]"+f,R.state=E.CDATA;continue;case E.CDATA_ENDING_2:if(f===">"){if(R.cdata)S(R,"oncdata",R.cdata);S(R,"onclosecdata"),R.cdata="",R.state=E.TEXT}else if(f==="]")R.cdata+="]";else R.cdata+="]]"+f,R.state=E.CDATA;continue;case E.PROC_INST:if(f==="?")R.state=E.PROC_INST_ENDING;else if(L(f))R.state=E.PROC_INST_BODY;else R.procInstName+=f;continue;case E.PROC_INST_BODY:if(!R.procInstBody&&L(f))continue;else if(f==="?")R.state=E.PROC_INST_ENDING;else R.procInstBody+=f;continue;case E.PROC_INST_ENDING:if(f===">")S(R,"onprocessinginstruction",{name:R.procInstName,body:R.procInstBody}),R.procInstName=R.procInstBody="",R.state=E.TEXT;else R.procInstBody+="?"+f,R.state=E.PROC_INST_BODY;continue;case E.OPEN_TAG:if(g(V,f))R.tagName+=f;else if(J0(R),f===">")i(R);else if(f==="/")R.state=E.OPEN_TAG_SLASH;else{if(!L(f))m(R,"Invalid character in tag name");R.state=E.ATTRIB}continue;case E.OPEN_TAG_SLASH:if(f===">")i(R,!0),_(R);else m(R,"Forward-slash in opening tag not followed by >"),R.state=E.ATTRIB;continue;case E.ATTRIB:if(L(f))continue;else if(f===">")i(R);else if(f==="/")R.state=E.OPEN_TAG_SLASH;else if(g(O,f))R.attribName=f,R.attribValue="",R.state=E.ATTRIB_NAME;else m(R,"Invalid attribute name");continue;case E.ATTRIB_NAME:if(f==="=")R.state=E.ATTRIB_VALUE;else if(f===">")m(R,"Attribute without value"),R.attribValue=R.attribName,L0(R),i(R);else if(L(f))R.state=E.ATTRIB_NAME_SAW_WHITE;else if(g(V,f))R.attribName+=f;else m(R,"Invalid attribute name");continue;case E.ATTRIB_NAME_SAW_WHITE:if(f==="=")R.state=E.ATTRIB_VALUE;else if(L(f))continue;else if(m(R,"Attribute without value"),R.tag.attributes[R.attribName]="",R.attribValue="",S(R,"onattribute",{name:R.attribName,value:""}),R.attribName="",f===">")i(R);else if(g(O,f))R.attribName=f,R.state=E.ATTRIB_NAME;else m(R,"Invalid attribute name"),R.state=E.ATTRIB;continue;case E.ATTRIB_VALUE:if(L(f))continue;else if(A(f))R.q=f,R.state=E.ATTRIB_VALUE_QUOTED;else m(R,"Unquoted attribute value"),R.state=E.ATTRIB_VALUE_UNQUOTED,R.attribValue=f;continue;case E.ATTRIB_VALUE_QUOTED:if(f!==R.q){if(f==="&")R.state=E.ATTRIB_VALUE_ENTITY_Q;else R.attribValue+=f;continue}L0(R),R.q="",R.state=E.ATTRIB_VALUE_CLOSED;continue;case E.ATTRIB_VALUE_CLOSED:if(L(f))R.state=E.ATTRIB;else if(f===">")i(R);else if(f==="/")R.state=E.OPEN_TAG_SLASH;else if(g(O,f))m(R,"No whitespace between attributes"),R.attribName=f,R.attribValue="",R.state=E.ATTRIB_NAME;else m(R,"Invalid attribute name");continue;case E.ATTRIB_VALUE_UNQUOTED:if(!y(f)){if(f==="&")R.state=E.ATTRIB_VALUE_ENTITY_U;else R.attribValue+=f;continue}if(L0(R),f===">")i(R);else R.state=E.ATTRIB;continue;case E.CLOSE_TAG:if(!R.tagName)if(L(f))continue;else if(d(O,f))if(R.script)R.script+="")_(R);else if(g(V,f))R.tagName+=f;else if(R.script)R.script+="")_(R);else m(R,"Invalid characters in closing tag");continue;case E.TEXT_ENTITY:case E.ATTRIB_VALUE_ENTITY_Q:case E.ATTRIB_VALUE_ENTITY_U:var e,I;switch(R.state){case E.TEXT_ENTITY:e=E.TEXT,I="textNode";break;case E.ATTRIB_VALUE_ENTITY_Q:e=E.ATTRIB_VALUE_QUOTED,I="attribValue";break;case E.ATTRIB_VALUE_ENTITY_U:e=E.ATTRIB_VALUE_UNQUOTED,I="attribValue";break}if(f===";")R[I]+=r(R),R.entity="",R.state=e;else if(g(R.entity.length?M:j,f))R.entity+=f;else m(R,"Invalid character in entity name"),R[I]+="&"+R.entity+f,R.entity="",R.state=e;continue;default:throw Error(R,"Unknown state: "+R.state)}}if(R.position>=R.bufferCheckPosition)J(R);return R}if(!String.fromCodePoint)(function(){var P=String.fromCharCode,R=Math.floor,c=function(){var f=16384,v=[],b,e,I=-1,t=arguments.length;if(!t)return"";var T="";while(++I1114111||R(K)!==K)throw RangeError("Invalid code point: "+K);if(K<=65535)v.push(K);else K-=65536,b=(K>>10)+55296,e=K%1024+56320,v.push(b,e);if(I+1===t||v.length>f)T+=P.apply(null,v),v.length=0}return T};if(Object.defineProperty)Object.defineProperty(String,"fromCodePoint",{value:c,configurable:!0,writable:!0});else String.fromCodePoint=c})()})($)}(_8),_8}var n6,WZ;function l9(){if(WZ)return n6;return WZ=1,n6={isArray:function($){if(Array.isArray)return Array.isArray($);return Object.prototype.toString.call($)==="[object Array]"}},n6}var o6,HZ;function a9(){if(HZ)return o6;HZ=1;var $=l9().isArray;return o6={copyOptions:function(U){var Y,Z={};for(Y in U)if(U.hasOwnProperty(Y))Z[Y]=U[Y];return Z},ensureFlagExists:function(U,Y){if(!(U in Y)||typeof Y[U]!=="boolean")Y[U]=!1},ensureSpacesExists:function(U){if(!("spaces"in U)||typeof U.spaces!=="number"&&typeof U.spaces!=="string")U.spaces=0},ensureAlwaysArrayExists:function(U){if(!("alwaysArray"in U)||typeof U.alwaysArray!=="boolean"&&!$(U.alwaysArray))U.alwaysArray=!1},ensureKeyExists:function(U,Y){if(!(U+"Key"in Y)||typeof Y[U+"Key"]!=="string")Y[U+"Key"]=Y.compact?"_"+U:U},checkFnExists:function(U,Y){return U+"Fn"in Y}},o6}var t6,jZ;function FQ(){if(jZ)return t6;jZ=1;var $=GX(),U=a9(),Y=l9().isArray,Z,J;function G(V){return Z=U.copyOptions(V),U.ensureFlagExists("ignoreDeclaration",Z),U.ensureFlagExists("ignoreInstruction",Z),U.ensureFlagExists("ignoreAttributes",Z),U.ensureFlagExists("ignoreText",Z),U.ensureFlagExists("ignoreComment",Z),U.ensureFlagExists("ignoreCdata",Z),U.ensureFlagExists("ignoreDoctype",Z),U.ensureFlagExists("compact",Z),U.ensureFlagExists("alwaysChildren",Z),U.ensureFlagExists("addParent",Z),U.ensureFlagExists("trim",Z),U.ensureFlagExists("nativeType",Z),U.ensureFlagExists("nativeTypeAttributes",Z),U.ensureFlagExists("sanitize",Z),U.ensureFlagExists("instructionHasAttributes",Z),U.ensureFlagExists("captureSpacesBetweenElements",Z),U.ensureAlwaysArrayExists(Z),U.ensureKeyExists("declaration",Z),U.ensureKeyExists("instruction",Z),U.ensureKeyExists("attributes",Z),U.ensureKeyExists("text",Z),U.ensureKeyExists("comment",Z),U.ensureKeyExists("cdata",Z),U.ensureKeyExists("doctype",Z),U.ensureKeyExists("type",Z),U.ensureKeyExists("name",Z),U.ensureKeyExists("elements",Z),U.ensureKeyExists("parent",Z),U.checkFnExists("doctype",Z),U.checkFnExists("instruction",Z),U.checkFnExists("cdata",Z),U.checkFnExists("comment",Z),U.checkFnExists("text",Z),U.checkFnExists("instructionName",Z),U.checkFnExists("elementName",Z),U.checkFnExists("attributeName",Z),U.checkFnExists("attributeValue",Z),U.checkFnExists("attributes",Z),Z}function X(V){var j=Number(V);if(!isNaN(j))return j;var M=V.toLowerCase();if(M==="true")return!0;else if(M==="false")return!1;return V}function Q(V,j){var M;if(Z.compact){if(!J[Z[V+"Key"]]&&(Y(Z.alwaysArray)?Z.alwaysArray.indexOf(Z[V+"Key"])!==-1:Z.alwaysArray))J[Z[V+"Key"]]=[];if(J[Z[V+"Key"]]&&!Y(J[Z[V+"Key"]]))J[Z[V+"Key"]]=[J[Z[V+"Key"]]];if(V+"Fn"in Z&&typeof j==="string")j=Z[V+"Fn"](j,J);if(V==="instruction"&&(("instructionFn"in Z)||("instructionNameFn"in Z))){for(M in j)if(j.hasOwnProperty(M))if("instructionFn"in Z)j[M]=Z.instructionFn(j[M],M,J);else{var L=j[M];delete j[M],j[Z.instructionNameFn(M,L,J)]=L}}if(Y(J[Z[V+"Key"]]))J[Z[V+"Key"]].push(j);else J[Z[V+"Key"]]=j}else{if(!J[Z.elementsKey])J[Z.elementsKey]=[];var A={};if(A[Z.typeKey]=V,V==="instruction"){for(M in j)if(j.hasOwnProperty(M))break;if(A[Z.nameKey]="instructionNameFn"in Z?Z.instructionNameFn(M,j,J):M,Z.instructionHasAttributes){if(A[Z.attributesKey]=j[M][Z.attributesKey],"instructionFn"in Z)A[Z.attributesKey]=Z.instructionFn(A[Z.attributesKey],M,J)}else{if("instructionFn"in Z)j[M]=Z.instructionFn(j[M],M,J);A[Z.instructionKey]=j[M]}}else{if(V+"Fn"in Z)j=Z[V+"Fn"](j,J);A[Z[V+"Key"]]=j}if(Z.addParent)A[Z.parentKey]=J;J[Z.elementsKey].push(A)}}function B(V){if("attributesFn"in Z&&V)V=Z.attributesFn(V,J);if((Z.trim||("attributeValueFn"in Z)||("attributeNameFn"in Z)||Z.nativeTypeAttributes)&&V){var j;for(j in V)if(V.hasOwnProperty(j)){if(Z.trim)V[j]=V[j].trim();if(Z.nativeTypeAttributes)V[j]=X(V[j]);if("attributeValueFn"in Z)V[j]=Z.attributeValueFn(V[j],j,J);if("attributeNameFn"in Z){var M=V[j];delete V[j],V[Z.attributeNameFn(j,V[j],J)]=M}}}return V}function F(V){var j={};if(V.body&&(V.name.toLowerCase()==="xml"||Z.instructionHasAttributes)){var M=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g,L;while((L=M.exec(V.body))!==null)j[L[1]]=L[2]||L[3]||L[4];j=B(j)}if(V.name.toLowerCase()==="xml"){if(Z.ignoreDeclaration)return;if(J[Z.declarationKey]={},Object.keys(j).length)J[Z.declarationKey][Z.attributesKey]=j;if(Z.addParent)J[Z.declarationKey][Z.parentKey]=J}else{if(Z.ignoreInstruction)return;if(Z.trim)V.body=V.body.trim();var A={};if(Z.instructionHasAttributes&&Object.keys(j).length)A[V.name]={},A[V.name][Z.attributesKey]=j;else A[V.name]=V.body;Q("instruction",A)}}function z(V,j){var M;if(typeof V==="object")j=V.attributes,V=V.name;if(j=B(j),"elementNameFn"in Z)V=Z.elementNameFn(V,J);if(Z.compact){if(M={},!Z.ignoreAttributes&&j&&Object.keys(j).length){M[Z.attributesKey]={};var L;for(L in j)if(j.hasOwnProperty(L))M[Z.attributesKey][L]=j[L]}if(!(V in J)&&(Y(Z.alwaysArray)?Z.alwaysArray.indexOf(V)!==-1:Z.alwaysArray))J[V]=[];if(J[V]&&!Y(J[V]))J[V]=[J[V]];if(Y(J[V]))J[V].push(M);else J[V]=M}else{if(!J[Z.elementsKey])J[Z.elementsKey]=[];if(M={},M[Z.typeKey]="element",M[Z.nameKey]=V,!Z.ignoreAttributes&&j&&Object.keys(j).length)M[Z.attributesKey]=j;if(Z.alwaysChildren)M[Z.elementsKey]=[];J[Z.elementsKey].push(M)}M[Z.parentKey]=J,J=M}function W(V){if(Z.ignoreText)return;if(!V.trim()&&!Z.captureSpacesBetweenElements)return;if(Z.trim)V=V.trim();if(Z.nativeType)V=X(V);if(Z.sanitize)V=V.replace(/&/g,"&").replace(//g,">");Q("text",V)}function k(V){if(Z.ignoreComment)return;if(Z.trim)V=V.trim();Q("comment",V)}function D(V){var j=J[Z.parentKey];if(!Z.addParent)delete J[Z.parentKey];J=j}function C(V){if(Z.ignoreCdata)return;if(Z.trim)V=V.trim();Q("cdata",V)}function H(V){if(Z.ignoreDoctype)return;if(V=V.replace(/^ /,""),Z.trim)V=V.trim();Q("doctype",V)}function O(V){V.note=V}return t6=function(V,j){var M=$.parser(!0,{}),L={};if(J=L,Z=G(j),M.opt={strictEntities:!0},M.onopentag=z,M.ontext=W,M.oncomment=k,M.onclosetag=D,M.onerror=O,M.oncdata=C,M.ondoctype=H,M.onprocessinginstruction=F,M.write(V).close(),L[Z.elementsKey]){var A=L[Z.elementsKey];delete L[Z.elementsKey],L[Z.elementsKey]=A,delete L.text}return L},t6}var e6,zZ;function KX(){if(zZ)return e6;zZ=1;var $=a9(),U=FQ();function Y(Z){var J=$.copyOptions(Z);return $.ensureSpacesExists(J),J}return e6=function(Z,J){var G,X,Q,B;if(G=Y(J),X=U(Z,G),B="compact"in G&&G.compact?"_parent":"parent","addParent"in G&&G.addParent)Q=JSON.stringify(X,function(F,z){return F===B?"_":z},G.spaces);else Q=JSON.stringify(X,null,G.spaces);return Q.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")},e6}var $9,FZ;function NQ(){if(FZ)return $9;FZ=1;var $=a9(),U=l9().isArray,Y,Z;function J(M){var L=$.copyOptions(M);if($.ensureFlagExists("ignoreDeclaration",L),$.ensureFlagExists("ignoreInstruction",L),$.ensureFlagExists("ignoreAttributes",L),$.ensureFlagExists("ignoreText",L),$.ensureFlagExists("ignoreComment",L),$.ensureFlagExists("ignoreCdata",L),$.ensureFlagExists("ignoreDoctype",L),$.ensureFlagExists("compact",L),$.ensureFlagExists("indentText",L),$.ensureFlagExists("indentCdata",L),$.ensureFlagExists("indentAttributes",L),$.ensureFlagExists("indentInstruction",L),$.ensureFlagExists("fullTagEmptyElement",L),$.ensureFlagExists("noQuotesForNativeAttributes",L),$.ensureSpacesExists(L),typeof L.spaces==="number")L.spaces=Array(L.spaces+1).join(" ");return $.ensureKeyExists("declaration",L),$.ensureKeyExists("instruction",L),$.ensureKeyExists("attributes",L),$.ensureKeyExists("text",L),$.ensureKeyExists("comment",L),$.ensureKeyExists("cdata",L),$.ensureKeyExists("doctype",L),$.ensureKeyExists("type",L),$.ensureKeyExists("name",L),$.ensureKeyExists("elements",L),$.checkFnExists("doctype",L),$.checkFnExists("instruction",L),$.checkFnExists("cdata",L),$.checkFnExists("comment",L),$.checkFnExists("text",L),$.checkFnExists("instructionName",L),$.checkFnExists("elementName",L),$.checkFnExists("attributeName",L),$.checkFnExists("attributeValue",L),$.checkFnExists("attributes",L),$.checkFnExists("fullTagEmptyElement",L),L}function G(M,L,A){return(!A&&M.spaces?` -`:"")+Array(L+1).join(M.spaces)}function X(M,L,A){if(L.ignoreAttributes)return"";if("attributesFn"in L)M=L.attributesFn(M,Z,Y);var y,g,d,E,s=[];for(y in M)if(M.hasOwnProperty(y)&&M[y]!==null&&M[y]!==void 0)E=L.noQuotesForNativeAttributes&&typeof M[y]!=="string"?"":'"',g=""+M[y],g=g.replace(/"/g,"""),d="attributeNameFn"in L?L.attributeNameFn(y,g,Z,Y):y,s.push(L.spaces&&L.indentAttributes?G(L,A+1,!1):" "),s.push(d+"="+E+("attributeValueFn"in L?L.attributeValueFn(g,y,Z,Y):g)+E);if(M&&Object.keys(M).length&&L.spaces&&L.indentAttributes)s.push(G(L,A,!1));return s.join("")}function Q(M,L,A){return Y=M,Z="xml",L.ignoreDeclaration?"":""}function B(M,L,A){if(L.ignoreInstruction)return"";var y;for(y in M)if(M.hasOwnProperty(y))break;var g="instructionNameFn"in L?L.instructionNameFn(y,M[y],Z,Y):y;if(typeof M[y]==="object")return Y=M,Z=g,"";else{var d=M[y]?M[y]:"";if("instructionFn"in L)d=L.instructionFn(d,y,Z,Y);return""}}function F(M,L){return L.ignoreComment?"":""}function z(M,L){return L.ignoreCdata?"":"","]]]]>"))+"]]>"}function W(M,L){return L.ignoreDoctype?"":""}function k(M,L){if(L.ignoreText)return"";return M=""+M,M=M.replace(/&/g,"&"),M=M.replace(/&/g,"&").replace(//g,">"),"textFn"in L?L.textFn(M,Z,Y):M}function D(M,L){var A;if(M.elements&&M.elements.length)for(A=0;A"),M[L.elementsKey]&&M[L.elementsKey].length)y.push(H(M[L.elementsKey],L,A+1)),Y=M,Z=M.name;y.push(L.spaces&&D(M,L)?` -`+Array(A+1).join(L.spaces):""),y.push("")}else y.push("/>");return y.join("")}function H(M,L,A,y){return M.reduce(function(g,d){var E=G(L,A,y&&!g);switch(d.type){case"element":return g+E+C(d,L,A);case"comment":return g+E+F(d[L.commentKey],L);case"doctype":return g+E+W(d[L.doctypeKey],L);case"cdata":return g+(L.indentCdata?E:"")+z(d[L.cdataKey],L);case"text":return g+(L.indentText?E:"")+k(d[L.textKey],L);case"instruction":var s={};return s[d[L.nameKey]]=d[L.attributesKey]?d:d[L.instructionKey],g+(L.indentInstruction?E:"")+B(s,L,A)}},"")}function O(M,L,A){var y;for(y in M)if(M.hasOwnProperty(y))switch(y){case L.parentKey:case L.attributesKey:break;case L.textKey:if(L.indentText||A)return!0;break;case L.cdataKey:if(L.indentCdata||A)return!0;break;case L.instructionKey:if(L.indentInstruction||A)return!0;break;case L.doctypeKey:case L.commentKey:return!0;default:return!0}return!1}function V(M,L,A,y,g){Y=M,Z=L;var d="elementNameFn"in A?A.elementNameFn(L,M):L;if(typeof M>"u"||M===null||M==="")return"fullTagEmptyElementFn"in A&&A.fullTagEmptyElementFn(L,M)||A.fullTagEmptyElement?"<"+d+">":"<"+d+"/>";var E=[];if(L){if(E.push("<"+d),typeof M!=="object")return E.push(">"+k(M,A)+""),E.join("");if(M[A.attributesKey])E.push(X(M[A.attributesKey],A,y));var s=O(M,A,!0)||M[A.attributesKey]&&M[A.attributesKey]["xml:space"]==="preserve";if(!s)if("fullTagEmptyElementFn"in A)s=A.fullTagEmptyElementFn(L,M);else s=A.fullTagEmptyElement;if(s)E.push(">");else return E.push("/>"),E.join("")}if(E.push(j(M,A,y+1,!1)),Y=M,Z=L,L)E.push((g?G(A,y,!1):"")+"");return E.join("")}function j(M,L,A,y){var g,d,E,s=[];for(d in M)if(M.hasOwnProperty(d)){E=U(M[d])?M[d]:[M[d]];for(g=0;g{switch($.type){case void 0:case"element":let U=new p9($.name,$.attributes),Y=$.elements||[];for(let Z of Y){let J=U8(Z);if(J!==void 0)U.push(J)}return U;case"text":return $.text;default:return}};class RQ extends I0{}class p9 extends o{static fromXmlString($){let U=$8.xml2js($,{compact:!1});return U8(U)}constructor($,U){super($);if(U)this.root.push(new RQ(U))}push($){this.root.push($)}}class i9 extends o{constructor($){super("");this._attr=$}prepForXml($){return{_attr:this._attr}}}var VX="";class Y8 extends o{constructor($,U){super($);if(U)this.root=U.root}}var S0=($)=>{if(isNaN($))throw Error(`Invalid value '${$}' specified. Must be an integer.`);return Math.floor($)},W1=($)=>{let U=S0($);if(U<0)throw Error(`Invalid value '${$}' specified. Must be a positive integer.`);return U},Z8=($,U)=>{let Y=U*2;if($.length!==Y||isNaN(Number(`0x${$}`)))throw Error(`Invalid hex value '${$}'. Expected ${Y} digit hex value`);return $},BX=($)=>Z8($,4),DQ=($)=>Z8($,2),D9=($)=>Z8($,1),H1=($)=>{let U=$.slice(-2),Y=$.substring(0,$.length-2);return`${Number(Y)}${U}`},r9=($)=>{let U=H1($);if(parseFloat(U)<0)throw Error(`Invalid value '${U}' specified. Expected a positive number.`);return U},S2=($)=>{if($==="auto")return $;let U=$.charAt(0)==="#"?$.substring(1):$;return Z8(U,3)},e0=($)=>typeof $==="string"?H1($):S0($),AQ=($)=>typeof $==="string"?r9($):W1($),LX=($)=>typeof $==="string"?H1($):S0($),T0=($)=>typeof $==="string"?r9($):W1($),PQ=($)=>{let U=$.substring(0,$.length-1);return`${Number(U)}%`},s9=($)=>{if(typeof $==="number")return S0($);if($.slice(-1)==="%")return PQ($);return H1($)},TQ=W1,CQ=W1,OQ=($)=>$.toISOString();class X0 extends o{constructor($,U=!0){super($);if(U!==!0)this.root.push(new O0({val:U}))}}class q1 extends o{constructor($,U){super($);this.root.push(new O0({val:AQ(U)}))}}class k0 extends o{}class Y2 extends o{constructor($,U){super($);this.root.push(new O0({val:U}))}}var u2=($,U)=>new B0({name:$,attributes:{value:{key:"w:val",value:U}}});class k2 extends o{constructor($,U){super($);this.root.push(new O0({val:U}))}}class kQ extends o{constructor($,U){super($);this.root.push(new O0({val:U}))}}class L2 extends o{constructor($,U){super($);this.root.push(U)}}class B0 extends o{constructor({name:$,attributes:U,children:Y}){super($);if(U)this.root.push(new n1(U));if(Y)this.root.push(...Y)}}var m0={START:"start",CENTER:"center",END:"end",BOTH:"both",MEDIUM_KASHIDA:"mediumKashida",DISTRIBUTE:"distribute",NUM_TAB:"numTab",HIGH_KASHIDA:"highKashida",LOW_KASHIDA:"lowKashida",THAI_DISTRIBUTE:"thaiDistribute",LEFT:"left",RIGHT:"right",JUSTIFIED:"both"},n9=($)=>new B0({name:"w:jc",attributes:{val:{key:"w:val",value:$}}}),N0=($,{color:U,size:Y,space:Z,style:J})=>new B0({name:$,attributes:{style:{key:"w:val",value:J},color:{key:"w:color",value:U===void 0?void 0:S2(U)},size:{key:"w:sz",value:Y===void 0?void 0:TQ(Y)},space:{key:"w:space",value:Z===void 0?void 0:CQ(Z)}}}),Q8={SINGLE:"single",DASH_DOT_STROKED:"dashDotStroked",DASHED:"dashed",DASH_SMALL_GAP:"dashSmallGap",DOT_DASH:"dotDash",DOT_DOT_DASH:"dotDotDash",DOTTED:"dotted",DOUBLE:"double",DOUBLE_WAVE:"doubleWave",INSET:"inset",NIL:"nil",NONE:"none",OUTSET:"outset",THICK:"thick",THICK_THIN_LARGE_GAP:"thickThinLargeGap",THICK_THIN_MEDIUM_GAP:"thickThinMediumGap",THICK_THIN_SMALL_GAP:"thickThinSmallGap",THIN_THICK_LARGE_GAP:"thinThickLargeGap",THIN_THICK_MEDIUM_GAP:"thinThickMediumGap",THIN_THICK_SMALL_GAP:"thinThickSmallGap",THIN_THICK_THIN_LARGE_GAP:"thinThickThinLargeGap",THIN_THICK_THIN_MEDIUM_GAP:"thinThickThinMediumGap",THIN_THICK_THIN_SMALL_GAP:"thinThickThinSmallGap",THREE_D_EMBOSS:"threeDEmboss",THREE_D_ENGRAVE:"threeDEngrave",TRIPLE:"triple",WAVE:"wave"};class o9 extends Q2{constructor($){super("w:pBdr");if($.top)this.root.push(N0("w:top",$.top));if($.bottom)this.root.push(N0("w:bottom",$.bottom));if($.left)this.root.push(N0("w:left",$.left));if($.right)this.root.push(N0("w:right",$.right));if($.between)this.root.push(N0("w:between",$.between))}}class t9 extends o{constructor(){super("w:pBdr");let $=N0("w:bottom",{color:"auto",space:1,style:Q8.SINGLE,size:6});this.root.push($)}}var EQ=({start:$,end:U,left:Y,right:Z,hanging:J,firstLine:G})=>new B0({name:"w:ind",attributes:{start:{key:"w:start",value:$===void 0?void 0:e0($)},end:{key:"w:end",value:U===void 0?void 0:e0(U)},left:{key:"w:left",value:Y===void 0?void 0:e0(Y)},right:{key:"w:right",value:Z===void 0?void 0:e0(Z)},hanging:{key:"w:hanging",value:J===void 0?void 0:T0(J)},firstLine:{key:"w:firstLine",value:G===void 0?void 0:T0(G)}}}),SQ=()=>new B0({name:"w:br"}),e9={BEGIN:"begin",END:"end",SEPARATE:"separate"},$$=($,U)=>new B0({name:"w:fldChar",attributes:{type:{key:"w:fldCharType",value:$},dirty:{key:"w:dirty",value:U}}}),$2=($)=>$$(e9.BEGIN,$),I2=($)=>$$(e9.SEPARATE,$),U2=($)=>$$(e9.END,$),MX={CENTER:"center",INSIDE:"inside",LEFT:"left",OUTSIDE:"outside",RIGHT:"right"},IX={BOTTOM:"bottom",CENTER:"center",INSIDE:"inside",OUTSIDE:"outside",TOP:"top"},wX={DECIMAL:"decimal",UPPER_ROMAN:"upperRoman",LOWER_ROMAN:"lowerRoman",UPPER_LETTER:"upperLetter",LOWER_LETTER:"lowerLetter",ORDINAL:"ordinal",CARDINAL_TEXT:"cardinalText",ORDINAL_TEXT:"ordinalText",HEX:"hex",CHICAGO:"chicago",IDEOGRAPH_DIGITAL:"ideographDigital",JAPANESE_COUNTING:"japaneseCounting",AIUEO:"aiueo",IROHA:"iroha",DECIMAL_FULL_WIDTH:"decimalFullWidth",DECIMAL_HALF_WIDTH:"decimalHalfWidth",JAPANESE_LEGAL:"japaneseLegal",JAPANESE_DIGITAL_TEN_THOUSAND:"japaneseDigitalTenThousand",DECIMAL_ENCLOSED_CIRCLE:"decimalEnclosedCircle",DECIMAL_FULL_WIDTH_2:"decimalFullWidth2",AIUEO_FULL_WIDTH:"aiueoFullWidth",IROHA_FULL_WIDTH:"irohaFullWidth",DECIMAL_ZERO:"decimalZero",BULLET:"bullet",GANADA:"ganada",CHOSUNG:"chosung",DECIMAL_ENCLOSED_FULL_STOP:"decimalEnclosedFullstop",DECIMAL_ENCLOSED_PAREN:"decimalEnclosedParen",DECIMAL_ENCLOSED_CIRCLE_CHINESE:"decimalEnclosedCircleChinese",IDEOGRAPH_ENCLOSED_CIRCLE:"ideographEnclosedCircle",IDEOGRAPH_TRADITIONAL:"ideographTraditional",IDEOGRAPH_ZODIAC:"ideographZodiac",IDEOGRAPH_ZODIAC_TRADITIONAL:"ideographZodiacTraditional",TAIWANESE_COUNTING:"taiwaneseCounting",IDEOGRAPH_LEGAL_TRADITIONAL:"ideographLegalTraditional",TAIWANESE_COUNTING_THOUSAND:"taiwaneseCountingThousand",TAIWANESE_DIGITAL:"taiwaneseDigital",CHINESE_COUNTING:"chineseCounting",CHINESE_LEGAL_SIMPLIFIED:"chineseLegalSimplified",CHINESE_COUNTING_TEN_THOUSAND:"chineseCountingThousand",KOREAN_DIGITAL:"koreanDigital",KOREAN_COUNTING:"koreanCounting",KOREAN_LEGAL:"koreanLegal",KOREAN_DIGITAL_2:"koreanDigital2",VIETNAMESE_COUNTING:"vietnameseCounting",RUSSIAN_LOWER:"russianLower",RUSSIAN_UPPER:"russianUpper",NONE:"none",NUMBER_IN_DASH:"numberInDash",HEBREW_1:"hebrew1",HEBREW_2:"hebrew2",ARABIC_ALPHA:"arabicAlpha",ARABIC_ABJAD:"arabicAbjad",HINDI_VOWELS:"hindiVowels",HINDI_CONSONANTS:"hindiConsonants",HINDI_NUMBERS:"hindiNumbers",HINDI_COUNTING:"hindiCounting",THAI_LETTERS:"thaiLetters",THAI_NUMBERS:"thaiNumbers",THAI_COUNTING:"thaiCounting",BAHT_TEXT:"bahtText",DOLLAR_TEXT:"dollarText"},g0={DEFAULT:"default",PRESERVE:"preserve"};class x0 extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{space:"xml:space"})}}class vQ extends o{constructor(){super("w:instrText");this.root.push(new x0({space:g0.PRESERVE})),this.root.push("PAGE")}}class _Q extends o{constructor(){super("w:instrText");this.root.push(new x0({space:g0.PRESERVE})),this.root.push("NUMPAGES")}}class yQ extends o{constructor(){super("w:instrText");this.root.push(new x0({space:g0.PRESERVE})),this.root.push("SECTIONPAGES")}}class bQ extends o{constructor(){super("w:instrText");this.root.push(new x0({space:g0.PRESERVE})),this.root.push("SECTION")}}var j1=({fill:$,color:U,type:Y})=>new B0({name:"w:shd",attributes:{fill:{key:"w:fill",value:$===void 0?void 0:S2($)},color:{key:"w:color",value:U===void 0?void 0:S2(U)},type:{key:"w:val",value:Y}}}),WX={CLEAR:"clear",DIAGONAL_CROSS:"diagCross",DIAGONAL_STRIPE:"diagStripe",HORIZONTAL_CROSS:"horzCross",HORIZONTAL_STRIPE:"horzStripe",NIL:"nil",PERCENT_5:"pct5",PERCENT_10:"pct10",PERCENT_12:"pct12",PERCENT_15:"pct15",PERCENT_20:"pct20",PERCENT_25:"pct25",PERCENT_30:"pct30",PERCENT_35:"pct35",PERCENT_37:"pct37",PERCENT_40:"pct40",PERCENT_45:"pct45",PERCENT_50:"pct50",PERCENT_55:"pct55",PERCENT_60:"pct60",PERCENT_62:"pct62",PERCENT_65:"pct65",PERCENT_70:"pct70",PERCENT_75:"pct75",PERCENT_80:"pct80",PERCENT_85:"pct85",PERCENT_87:"pct87",PERCENT_90:"pct90",PERCENT_95:"pct95",REVERSE_DIAGONAL_STRIPE:"reverseDiagStripe",SOLID:"solid",THIN_DIAGONAL_CROSS:"thinDiagCross",THIN_DIAGONAL_STRIPE:"thinDiagStripe",THIN_HORIZONTAL_CROSS:"thinHorzCross",THIN_REVERSE_DIAGONAL_STRIPE:"thinReverseDiagStripe",THIN_VERTICAL_STRIPE:"thinVertStripe",VERTICAL_STRIPE:"vertStripe"};class _0 extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{id:"w:id",author:"w:author",date:"w:date"})}}class gQ extends o{constructor($){super("w:del");this.root.push(new _0({id:$.id,author:$.author,date:$.date}))}}class xQ extends o{constructor($){super("w:ins");this.root.push(new _0({id:$.id,author:$.author,date:$.date}))}}var U$={DOT:"dot"},Y$=($=U$.DOT)=>new B0({name:"w:em",attributes:{val:{key:"w:val",value:$}}}),HX=()=>Y$(U$.DOT);class fQ extends o{constructor($){super("w:spacing");this.root.push(new O0({val:e0($)}))}}class hQ extends o{constructor($){super("w:color");this.root.push(new O0({val:S2($)}))}}class uQ extends o{constructor($){super("w:highlight");this.root.push(new O0({val:$}))}}class dQ extends o{constructor($){super("w:highlightCs");this.root.push(new O0({val:$}))}}var jX=($)=>new B0({name:"w:lang",attributes:{value:{key:"w:val",value:$.value},eastAsia:{key:"w:eastAsia",value:$.eastAsia},bidirectional:{key:"w:bidi",value:$.bidirectional}}}),g1=($,U)=>{if(typeof $==="string"){let Z=$;return new B0({name:"w:rFonts",attributes:{ascii:{key:"w:ascii",value:Z},cs:{key:"w:cs",value:Z},eastAsia:{key:"w:eastAsia",value:Z},hAnsi:{key:"w:hAnsi",value:Z},hint:{key:"w:hint",value:U}}})}let Y=$;return new B0({name:"w:rFonts",attributes:{ascii:{key:"w:ascii",value:Y.ascii},cs:{key:"w:cs",value:Y.cs},eastAsia:{key:"w:eastAsia",value:Y.eastAsia},hAnsi:{key:"w:hAnsi",value:Y.hAnsi},hint:{key:"w:hint",value:Y.hint}}})},cQ=($)=>new B0({name:"w:vertAlign",attributes:{val:{key:"w:val",value:$}}}),zX=()=>cQ("superscript"),FX=()=>cQ("subscript"),Z$={SINGLE:"single",WORDS:"words",DOUBLE:"double",THICK:"thick",DOTTED:"dotted",DOTTEDHEAVY:"dottedHeavy",DASH:"dash",DASHEDHEAVY:"dashedHeavy",DASHLONG:"dashLong",DASHLONGHEAVY:"dashLongHeavy",DOTDASH:"dotDash",DASHDOTHEAVY:"dashDotHeavy",DOTDOTDASH:"dotDotDash",DASHDOTDOTHEAVY:"dashDotDotHeavy",WAVE:"wave",WAVYHEAVY:"wavyHeavy",WAVYDOUBLE:"wavyDouble",NONE:"none"},mQ=($=Z$.SINGLE,U)=>new B0({name:"w:u",attributes:{val:{key:"w:val",value:$},color:{key:"w:color",value:U===void 0?void 0:S2(U)}}}),NX={BLINK_BACKGROUND:"blinkBackground",LIGHTS:"lights",ANTS_BLACK:"antsBlack",ANTS_RED:"antsRed",SHIMMER:"shimmer",SPARKLE:"sparkle",NONE:"none"},RX={BLACK:"black",BLUE:"blue",CYAN:"cyan",DARK_BLUE:"darkBlue",DARK_CYAN:"darkCyan",DARK_GRAY:"darkGray",DARK_GREEN:"darkGreen",DARK_MAGENTA:"darkMagenta",DARK_RED:"darkRed",DARK_YELLOW:"darkYellow",GREEN:"green",LIGHT_GRAY:"lightGray",MAGENTA:"magenta",NONE:"none",RED:"red",WHITE:"white",YELLOW:"yellow"};class J2 extends Q2{constructor($){var U,Y;super("w:rPr");if(!$)return;if($.style)this.push(new Y2("w:rStyle",$.style));if($.font)if(typeof $.font==="string")this.push(g1($.font));else if("name"in $.font)this.push(g1($.font.name,$.font.hint));else this.push(g1($.font));if($.bold!==void 0)this.push(new X0("w:b",$.bold));if($.boldComplexScript===void 0&&$.bold!==void 0||$.boldComplexScript)this.push(new X0("w:bCs",(U=$.boldComplexScript)!=null?U:$.bold));if($.italics!==void 0)this.push(new X0("w:i",$.italics));if($.italicsComplexScript===void 0&&$.italics!==void 0||$.italicsComplexScript)this.push(new X0("w:iCs",(Y=$.italicsComplexScript)!=null?Y:$.italics));if($.smallCaps!==void 0)this.push(new X0("w:smallCaps",$.smallCaps));else if($.allCaps!==void 0)this.push(new X0("w:caps",$.allCaps));if($.strike!==void 0)this.push(new X0("w:strike",$.strike));if($.doubleStrike!==void 0)this.push(new X0("w:dstrike",$.doubleStrike));if($.emboss!==void 0)this.push(new X0("w:emboss",$.emboss));if($.imprint!==void 0)this.push(new X0("w:imprint",$.imprint));if($.noProof!==void 0)this.push(new X0("w:noProof",$.noProof));if($.snapToGrid!==void 0)this.push(new X0("w:snapToGrid",$.snapToGrid));if($.vanish)this.push(new X0("w:vanish",$.vanish));if($.color)this.push(new hQ($.color));if($.characterSpacing)this.push(new fQ($.characterSpacing));if($.scale!==void 0)this.push(new k2("w:w",$.scale));if($.kern)this.push(new q1("w:kern",$.kern));if($.position)this.push(new Y2("w:position",$.position));if($.size!==void 0)this.push(new q1("w:sz",$.size));let Z=$.sizeComplexScript===void 0||$.sizeComplexScript===!0?$.size:$.sizeComplexScript;if(Z)this.push(new q1("w:szCs",Z));if($.highlight)this.push(new uQ($.highlight));let J=$.highlightComplexScript===void 0||$.highlightComplexScript===!0?$.highlight:$.highlightComplexScript;if(J)this.push(new dQ(J));if($.underline)this.push(mQ($.underline.type,$.underline.color));if($.effect)this.push(new Y2("w:effect",$.effect));if($.border)this.push(N0("w:bdr",$.border));if($.shading)this.push(j1($.shading));if($.subScript)this.push(FX());if($.superScript)this.push(zX());if($.rightToLeft!==void 0)this.push(new X0("w:rtl",$.rightToLeft));if($.emphasisMark)this.push(Y$($.emphasisMark.type));if($.language)this.push(jX($.language));if($.specVanish)this.push(new X0("w:specVanish",$.vanish));if($.math)this.push(new X0("w:oMath",$.math));if($.revision)this.push(new J$($.revision))}push($){this.root.push($)}}class Q$ extends J2{constructor($){super($);if($==null?void 0:$.insertion)this.push(new xQ($.insertion));if($==null?void 0:$.deletion)this.push(new gQ($.deletion))}}class J$ extends o{constructor($){super("w:rPrChange");this.root.push(new _0({id:$.id,author:$.author,date:$.date})),this.addChildElement(new J2($))}}class a2 extends o{constructor($){var U;super("w:t");if(typeof $==="string")this.root.push(new x0({space:g0.PRESERVE})),this.root.push($);else this.root.push(new x0({space:(U=$.space)!=null?U:g0.DEFAULT})),this.root.push($.text)}}var N2={CURRENT:"CURRENT",TOTAL_PAGES:"TOTAL_PAGES",TOTAL_PAGES_IN_SECTION:"TOTAL_PAGES_IN_SECTION",CURRENT_SECTION:"SECTION"};class C0 extends o{constructor($){super("w:r");if(Y0(this,"properties"),this.properties=new J2($),this.root.push(this.properties),$.break)for(let U=0;U<$.break;U++)this.root.push(SQ());if($.children)for(let U of $.children){if(typeof U==="string"){switch(U){case N2.CURRENT:this.root.push($2()),this.root.push(new vQ),this.root.push(I2()),this.root.push(U2());break;case N2.TOTAL_PAGES:this.root.push($2()),this.root.push(new _Q),this.root.push(I2()),this.root.push(U2());break;case N2.TOTAL_PAGES_IN_SECTION:this.root.push($2()),this.root.push(new yQ),this.root.push(I2()),this.root.push(U2());break;case N2.CURRENT_SECTION:this.root.push($2()),this.root.push(new bQ),this.root.push(I2()),this.root.push(U2());break;default:this.root.push(new a2(U));break}continue}this.root.push(U)}else if($.text!==void 0)this.root.push(new a2($.text))}}class p2 extends C0{constructor($){super(typeof $==="string"?{text:$}:$)}}class lQ extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{char:"w:char",symbolfont:"w:font"})}}var DZ=class extends o{constructor(U="",Y="Wingdings"){super("w:sym");this.root.push(new lQ({char:U,symbolfont:Y}))}};class G$ extends C0{constructor($){if(typeof $==="string"){super({});return this.root.push(new DZ($)),this}super($);this.root.push(new DZ($.char,$.symbolfont))}}var Z9={},z0={},Q9,AZ;function z1(){if(AZ)return Q9;AZ=1,Q9=$;function $(U,Y){if(!U)throw Error(Y||"Assertion failed")}return $.equal=function(Y,Z,J){if(Y!=Z)throw Error(J||"Assertion failed: "+Y+" != "+Z)},Q9}var PZ;function G2(){if(PZ)return z0;PZ=1;var $=z1(),U=R2();z0.inherits=U;function Y(S,h){if((S.charCodeAt(h)&64512)!==55296)return!1;if(h<0||h+1>=S.length)return!1;return(S.charCodeAt(h+1)&64512)===56320}function Z(S,h){if(Array.isArray(S))return S.slice();if(!S)return[];var N=[];if(typeof S==="string"){if(!h){var a=0;for(var $0=0;$0>6|192,N[a++]=m&63|128;else if(Y(S,$0))m=65536+((m&1023)<<10)+(S.charCodeAt(++$0)&1023),N[a++]=m>>18|240,N[a++]=m>>12&63|128,N[a++]=m>>6&63|128,N[a++]=m&63|128;else N[a++]=m>>12|224,N[a++]=m>>6&63|128,N[a++]=m&63|128}}else if(h==="hex"){if(S=S.replace(/[^a-z0-9]+/ig,""),S.length%2!==0)S="0"+S;for($0=0;$0>>24|S>>>8&65280|S<<8&16711680|(S&255)<<24;return h>>>0}z0.htonl=G;function X(S,h){var N="";for(var a=0;a>>0}return m}z0.join32=F;function z(S,h){var N=Array(S.length*4);for(var a=0,$0=0;a>>24,N[$0+1]=m>>>16&255,N[$0+2]=m>>>8&255,N[$0+3]=m&255;else N[$0+3]=m>>>24,N[$0+2]=m>>>16&255,N[$0+1]=m>>>8&255,N[$0]=m&255}return N}z0.split32=z;function W(S,h){return S>>>h|S<<32-h}z0.rotr32=W;function k(S,h){return S<>>32-h}z0.rotl32=k;function D(S,h){return S+h>>>0}z0.sum32=D;function C(S,h,N){return S+h+N>>>0}z0.sum32_3=C;function H(S,h,N,a){return S+h+N+a>>>0}z0.sum32_4=H;function O(S,h,N,a,$0){return S+h+N+a+$0>>>0}z0.sum32_5=O;function V(S,h,N,a){var $0=S[h],m=S[h+1],J0=a+m>>>0,U0=(J0>>0,S[h+1]=J0}z0.sum64=V;function j(S,h,N,a){var $0=h+a>>>0,m=($0>>0}z0.sum64_hi=j;function M(S,h,N,a){var $0=h+a;return $0>>>0}z0.sum64_lo=M;function L(S,h,N,a,$0,m,J0,U0){var L0=0,i=h;i=i+a>>>0,L0+=i>>0,L0+=i>>0,L0+=i>>0}z0.sum64_4_hi=L;function A(S,h,N,a,$0,m,J0,U0){var L0=h+a+m+U0;return L0>>>0}z0.sum64_4_lo=A;function y(S,h,N,a,$0,m,J0,U0,L0,i){var _=0,r=h;r=r+a>>>0,_+=r>>0,_+=r>>0,_+=r>>0,_+=r>>0}z0.sum64_5_hi=y;function g(S,h,N,a,$0,m,J0,U0,L0,i){var _=h+a+m+U0+i;return _>>>0}z0.sum64_5_lo=g;function d(S,h,N){var a=h<<32-N|S>>>N;return a>>>0}z0.rotr64_hi=d;function E(S,h,N){var a=S<<32-N|h>>>N;return a>>>0}z0.rotr64_lo=E;function s(S,h,N){return S>>>N}z0.shr64_hi=s;function V0(S,h,N){var a=S<<32-N|h>>>N;return a>>>0}return z0.shr64_lo=V0,z0}var J9={},TZ;function F1(){if(TZ)return J9;TZ=1;var $=G2(),U=z1();function Y(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return J9.BlockHash=Y,Y.prototype.update=function(J,G){if(J=$.toArray(J,G),!this.pending)this.pending=J;else this.pending=this.pending.concat(J);if(this.pendingTotal+=J.length,this.pending.length>=this._delta8){J=this.pending;var X=J.length%this._delta8;if(this.pending=J.slice(J.length-X,J.length),this.pending.length===0)this.pending=null;J=$.join32(J,0,J.length-X,this.endian);for(var Q=0;Q>>24&255,Q[B++]=J>>>16&255,Q[B++]=J>>>8&255,Q[B++]=J&255}else{Q[B++]=J&255,Q[B++]=J>>>8&255,Q[B++]=J>>>16&255,Q[B++]=J>>>24&255,Q[B++]=0,Q[B++]=0,Q[B++]=0,Q[B++]=0;for(F=8;F>>3}s0.g0_256=B;function F(z){return U(z,17)^U(z,19)^z>>>10}return s0.g1_256=F,s0}var G9,OZ;function DX(){if(OZ)return G9;OZ=1;var $=G2(),U=F1(),Y=aQ(),Z=$.rotl32,J=$.sum32,G=$.sum32_5,X=Y.ft_1,Q=U.BlockHash,B=[1518500249,1859775393,2400959708,3395469782];function F(){if(!(this instanceof F))return new F;Q.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}return $.inherits(F,Q),G9=F,F.blockSize=512,F.outSize=160,F.hmacStrength=80,F.padLength=64,F.prototype._update=function(W,k){var D=this.W;for(var C=0;C<16;C++)D[C]=W[k+C];for(;Cthis.blockSize)J=new this.Hash().update(J).digest();U(J.length<=this.blockSize);for(var G=J.length;G{return(Y=U)=>{let Z="",J=Y|0;while(J--)Z+=$[Math.random()*$.length|0];return Z}},yX=($=21)=>{let U="",Y=$|0;while(Y--)U+=vX[Math.random()*64|0];return U},bX=($)=>Math.floor($/25.4*72*20),d0=($)=>Math.floor($*72*20),N1=($=0)=>{let U=$;return()=>++U},rQ=()=>N1(),sQ=()=>N1(1),nQ=()=>N1(),oQ=()=>N1(),R1=()=>yX().toLowerCase(),A9=($)=>SX.sha1().update($ instanceof ArrayBuffer?new Uint8Array($):$).digest("hex"),Y1=($)=>_X("1234567890abcdef",$)(),tQ=()=>`${Y1(8)}-${Y1(4)}-${Y1(4)}-${Y1(4)}-${Y1(12)}`,X1=($)=>new Uint8Array(new TextEncoder().encode($)),eQ={CHARACTER:"character",COLUMN:"column",INSIDE_MARGIN:"insideMargin",LEFT_MARGIN:"leftMargin",MARGIN:"margin",OUTSIDE_MARGIN:"outsideMargin",PAGE:"page",RIGHT_MARGIN:"rightMargin"},$J={BOTTOM_MARGIN:"bottomMargin",INSIDE_MARGIN:"insideMargin",LINE:"line",MARGIN:"margin",OUTSIDE_MARGIN:"outsideMargin",PAGE:"page",PARAGRAPH:"paragraph",TOP_MARGIN:"topMargin"},UJ=()=>new B0({name:"wp:simplePos",attributes:{x:{key:"x",value:0},y:{key:"y",value:0}}}),YJ=($)=>new B0({name:"wp:align",children:[$]}),ZJ=($)=>new B0({name:"wp:posOffset",children:[$.toString()]}),QJ=({relative:$,align:U,offset:Y})=>new B0({name:"wp:positionH",attributes:{relativeFrom:{key:"relativeFrom",value:$!=null?$:eQ.PAGE}},children:[(()=>{if(U)return YJ(U);else if(Y!==void 0)return ZJ(Y);else throw Error("There is no configuration provided for floating position (Align or offset)")})()]}),JJ=({relative:$,align:U,offset:Y})=>new B0({name:"wp:positionV",attributes:{relativeFrom:{key:"relativeFrom",value:$!=null?$:$J.PAGE}},children:[(()=>{if(U)return YJ(U);else if(Y!==void 0)return ZJ(Y);else throw Error("There is no configuration provided for floating position (Align or offset)")})()]}),GJ=(($)=>{return $.CENTER="ctr",$.TOP="t",$.BOTTOM="b",$})(GJ||{}),KJ=($={})=>{var U,Y,Z,J;return new B0({name:"wps:bodyPr",attributes:{lIns:{key:"lIns",value:(U=$.margins)==null?void 0:U.left},rIns:{key:"rIns",value:(Y=$.margins)==null?void 0:Y.right},tIns:{key:"tIns",value:(Z=$.margins)==null?void 0:Z.top},bIns:{key:"bIns",value:(J=$.margins)==null?void 0:J.bottom},anchor:{key:"anchor",value:$.verticalAnchor}},children:[...$.noAutoFit?[new X0("a:noAutofit",$.noAutoFit)]:[]]})},gX=($={txBox:"1"})=>new B0({name:"wps:cNvSpPr",attributes:{txBox:{key:"txBox",value:$.txBox}}}),xX=($)=>new B0({name:"w:txbxContent",children:[...$]}),fX=($)=>new B0({name:"wps:txbx",children:[xX($)]});class qJ extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{cx:"cx",cy:"cy"})}}class XJ extends o{constructor($,U){super("a:ext");Y0(this,"attributes"),this.attributes=new qJ({cx:$,cy:U}),this.root.push(this.attributes)}}class VJ extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{x:"x",y:"y"})}}class BJ extends o{constructor($,U){super("a:off");this.root.push(new VJ({x:$!=null?$:0,y:U!=null?U:0}))}}class LJ extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{flipVertical:"flipV",flipHorizontal:"flipH",rotation:"rot"})}}class K$ extends o{constructor($){var U,Y,Z,J,G,X;super("a:xfrm");Y0(this,"extents"),Y0(this,"offset"),this.root.push(new LJ({flipVertical:(U=$.flip)==null?void 0:U.vertical,flipHorizontal:(Y=$.flip)==null?void 0:Y.horizontal,rotation:$.rotation})),this.offset=new BJ((J=(Z=$.offset)==null?void 0:Z.emus)==null?void 0:J.x,(X=(G=$.offset)==null?void 0:G.emus)==null?void 0:X.y),this.extents=new XJ($.emus.x,$.emus.y),this.root.push(this.offset),this.root.push(this.extents)}}var MJ=()=>new B0({name:"a:noFill"}),hX=($)=>new B0({name:"a:srgbClr",attributes:{value:{key:"val",value:$.value}}}),uX=($)=>new B0({name:"a:schemeClr",attributes:{value:{key:"val",value:$.value}}}),P9=($)=>new B0({name:"a:solidFill",children:[$.type==="rgb"?hX($):uX($)]}),dX=($)=>new B0({name:"a:ln",attributes:{width:{key:"w",value:$.width},cap:{key:"cap",value:$.cap},compoundLine:{key:"cmpd",value:$.compoundLine},align:{key:"algn",value:$.align}},children:[$.type==="noFill"?MJ():$.solidFillType==="rgb"?P9({type:"rgb",value:$.value}):P9({type:"scheme",value:$.value})]});class IJ extends o{constructor(){super("a:avLst")}}class wJ extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{prst:"prst"})}}class WJ extends o{constructor(){super("a:prstGeom");this.root.push(new wJ({prst:"rect"})),this.root.push(new IJ)}}class HJ extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{bwMode:"bwMode"})}}class q$ extends o{constructor({element:$,outline:U,solidFill:Y,transform:Z}){super(`${$}:spPr`);if(Y0(this,"form"),this.root.push(new HJ({bwMode:"auto"})),this.form=new K$(Z),this.root.push(this.form),this.root.push(new WJ),U)this.root.push(MJ()),this.root.push(dX(U));if(Y)this.root.push(P9(Y))}}var xZ=($)=>new B0({name:"wps:wsp",children:[gX($.nonVisualProperties),new q$({element:"wps",transform:$.transformation,outline:$.outline,solidFill:$.solidFill}),fX($.children),KJ($.bodyProperties)]});class x1 extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{uri:"uri"})}}var cX=($)=>new B0({name:"asvg:svgBlip",attributes:{asvg:{key:"xmlns:asvg",value:"http://schemas.microsoft.com/office/drawing/2016/SVG/main"},embed:{key:"r:embed",value:`rId{${$.fileName}}`}}}),mX=($)=>new B0({name:"a:ext",attributes:{uri:{key:"uri",value:"{96DAC541-7B7A-43D3-8B79-37D633B846F1}"}},children:[cX($)]}),lX=($)=>new B0({name:"a:extLst",children:[mX($)]}),aX=($)=>new B0({name:"a:blip",attributes:{embed:{key:"r:embed",value:`rId{${$.type==="svg"?$.fallback.fileName:$.fileName}}`},cstate:{key:"cstate",value:"none"}},children:$.type==="svg"?[lX($)]:[]});class jJ extends o{constructor(){super("a:srcRect")}}class zJ extends o{constructor(){super("a:fillRect")}}class FJ extends o{constructor(){super("a:stretch");this.root.push(new zJ)}}class NJ extends o{constructor($){super("pic:blipFill");this.root.push(aX($)),this.root.push(new jJ),this.root.push(new FJ)}}class RJ extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{noChangeAspect:"noChangeAspect",noChangeArrowheads:"noChangeArrowheads"})}}class DJ extends o{constructor(){super("a:picLocks");this.root.push(new RJ({noChangeAspect:1,noChangeArrowheads:1}))}}class AJ extends o{constructor(){super("pic:cNvPicPr");this.root.push(new DJ)}}var PJ=($,U)=>new B0({name:"a:hlinkClick",attributes:R0(W0({},U?{xmlns:{key:"xmlns:a",value:"http://schemas.openxmlformats.org/drawingml/2006/main"}}:{}),{id:{key:"r:id",value:`rId${$}`}})});class TJ extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{id:"id",name:"name",descr:"descr"})}}class CJ extends o{constructor(){super("pic:cNvPr");this.root.push(new TJ({id:0,name:"",descr:""}))}prepForXml($){for(let U=$.stack.length-1;U>=0;U--){let Y=$.stack[U];if(!(Y instanceof _2))continue;this.root.push(PJ(Y.linkId,!1));break}return super.prepForXml($)}}class OJ extends o{constructor(){super("pic:nvPicPr");this.root.push(new CJ),this.root.push(new AJ)}}class kJ extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{xmlns:"xmlns:pic"})}}class T9 extends o{constructor({mediaData:$,transform:U,outline:Y}){super("pic:pic");this.root.push(new kJ({xmlns:"http://schemas.openxmlformats.org/drawingml/2006/picture"})),this.root.push(new OJ),this.root.push(new NJ($)),this.root.push(new q$({element:"pic",transform:U,outline:Y}))}}var pX=($)=>new B0({name:"wpg:grpSpPr",children:[new K$($)]}),iX=()=>new B0({name:"wpg:cNvGrpSpPr"}),rX=($)=>new B0({name:"wpg:wgp",children:[iX(),pX($.transformation),...$.children]});class EJ extends o{constructor({mediaData:$,transform:U,outline:Y,solidFill:Z}){super("a:graphicData");if($.type==="wps"){this.root.push(new x1({uri:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"}));let J=xZ(R0(W0({},$.data),{transformation:U,outline:Y,solidFill:Z}));this.root.push(J)}else if($.type==="wpg"){this.root.push(new x1({uri:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"}));let G=$.children.map((Q)=>{if(Q.type==="wps")return xZ(R0(W0({},Q.data),{transformation:Q.transformation,outline:Q.outline,solidFill:Q.solidFill}));else return new T9({mediaData:Q,transform:Q.transformation,outline:Q.outline})}),X=rX({children:G,transformation:U});this.root.push(X)}else{this.root.push(new x1({uri:"http://schemas.openxmlformats.org/drawingml/2006/picture"}));let G=new T9({mediaData:$,transform:U,outline:Y});this.root.push(G)}}}class SJ extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{a:"xmlns:a"})}}class X$ extends o{constructor({mediaData:$,transform:U,outline:Y,solidFill:Z}){super("a:graphic");Y0(this,"data"),this.root.push(new SJ({a:"http://schemas.openxmlformats.org/drawingml/2006/main"})),this.data=new EJ({mediaData:$,transform:U,outline:Y,solidFill:Z}),this.root.push(this.data)}}var G1={NONE:0,SQUARE:1,TIGHT:2,TOP_AND_BOTTOM:3},vJ={BOTH_SIDES:"bothSides",LEFT:"left",RIGHT:"right",LARGEST:"largest"},C9=()=>new B0({name:"wp:wrapNone"}),_J=($,U={top:0,bottom:0,left:0,right:0})=>new B0({name:"wp:wrapSquare",attributes:{wrapText:{key:"wrapText",value:$.side||vJ.BOTH_SIDES},distT:{key:"distT",value:U.top},distB:{key:"distB",value:U.bottom},distL:{key:"distL",value:U.left},distR:{key:"distR",value:U.right}}}),yJ=($={top:0,bottom:0})=>new B0({name:"wp:wrapTight",attributes:{distT:{key:"distT",value:$.top},distB:{key:"distB",value:$.bottom}}}),bJ=($={top:0,bottom:0})=>new B0({name:"wp:wrapTopAndBottom",attributes:{distT:{key:"distT",value:$.top},distB:{key:"distB",value:$.bottom}}});class V$ extends o{constructor({name:$,description:U,title:Y,id:Z}={name:"",description:"",title:""}){super("wp:docPr");Y0(this,"docPropertiesUniqueNumericId",nQ());let J={id:{key:"id",value:Z!=null?Z:this.docPropertiesUniqueNumericId()},name:{key:"name",value:$}};if(U!==null&&U!==void 0)J.description={key:"descr",value:U};if(Y!==null&&Y!==void 0)J.title={key:"title",value:Y};this.root.push(new n1(J))}prepForXml($){for(let U=$.stack.length-1;U>=0;U--){let Y=$.stack[U];if(!(Y instanceof _2))continue;this.root.push(PJ(Y.linkId,!0));break}return super.prepForXml($)}}var gJ=({top:$,right:U,bottom:Y,left:Z})=>new B0({name:"wp:effectExtent",attributes:{top:{key:"t",value:$},right:{key:"r",value:U},bottom:{key:"b",value:Y},left:{key:"l",value:Z}}}),xJ=({x:$,y:U})=>new B0({name:"wp:extent",attributes:{x:{key:"cx",value:$},y:{key:"cy",value:U}}});class fJ extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{xmlns:"xmlns:a",noChangeAspect:"noChangeAspect"})}}class hJ extends o{constructor(){super("a:graphicFrameLocks");this.root.push(new fJ({xmlns:"http://schemas.openxmlformats.org/drawingml/2006/main",noChangeAspect:1}))}}var uJ=()=>new B0({name:"wp:cNvGraphicFramePr",children:[new hJ]});class dJ extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{distT:"distT",distB:"distB",distL:"distL",distR:"distR",allowOverlap:"allowOverlap",behindDoc:"behindDoc",layoutInCell:"layoutInCell",locked:"locked",relativeHeight:"relativeHeight",simplePos:"simplePos"})}}class cJ extends o{constructor({mediaData:$,transform:U,drawingOptions:Y}){super("wp:anchor");let Z=W0({allowOverlap:!0,behindDocument:!1,lockAnchor:!1,layoutInCell:!0,verticalPosition:{},horizontalPosition:{}},Y.floating);if(this.root.push(new dJ({distT:Z.margins?Z.margins.top||0:0,distB:Z.margins?Z.margins.bottom||0:0,distL:Z.margins?Z.margins.left||0:0,distR:Z.margins?Z.margins.right||0:0,simplePos:"0",allowOverlap:Z.allowOverlap===!0?"1":"0",behindDoc:Z.behindDocument===!0?"1":"0",locked:Z.lockAnchor===!0?"1":"0",layoutInCell:Z.layoutInCell===!0?"1":"0",relativeHeight:Z.zIndex?Z.zIndex:U.emus.y})),this.root.push(UJ()),this.root.push(QJ(Z.horizontalPosition)),this.root.push(JJ(Z.verticalPosition)),this.root.push(xJ({x:U.emus.x,y:U.emus.y})),this.root.push(gJ({top:0,right:0,bottom:0,left:0})),Y.floating!==void 0&&Y.floating.wrap!==void 0)switch(Y.floating.wrap.type){case G1.SQUARE:this.root.push(_J(Y.floating.wrap,Y.floating.margins));break;case G1.TIGHT:this.root.push(yJ(Y.floating.margins));break;case G1.TOP_AND_BOTTOM:this.root.push(bJ(Y.floating.margins));break;case G1.NONE:default:this.root.push(C9())}else this.root.push(C9());this.root.push(new V$(Y.docProperties)),this.root.push(uJ()),this.root.push(new X$({mediaData:$,transform:U,outline:Y.outline,solidFill:Y.solidFill}))}}var sX=({mediaData:$,transform:U,docProperties:Y,outline:Z,solidFill:J})=>{var G,X,Q,B;return new B0({name:"wp:inline",attributes:{distanceTop:{key:"distT",value:0},distanceBottom:{key:"distB",value:0},distanceLeft:{key:"distL",value:0},distanceRight:{key:"distR",value:0}},children:[xJ({x:U.emus.x,y:U.emus.y}),gJ(Z?{top:((G=Z.width)!=null?G:9525)*2,right:((X=Z.width)!=null?X:9525)*2,bottom:((Q=Z.width)!=null?Q:9525)*2,left:((B=Z.width)!=null?B:9525)*2}:{top:0,right:0,bottom:0,left:0}),new V$(Y),uJ(),new X$({mediaData:$,transform:U,outline:Z,solidFill:J})]})};class D1 extends o{constructor($,U={}){super("w:drawing");if(!U.floating)this.root.push(sX({mediaData:$,transform:$.transformation,docProperties:U.docProperties,outline:U.outline,solidFill:U.solidFill}));else this.root.push(new cJ({mediaData:$,transform:$.transformation,drawingOptions:U}))}}var nX=($)=>{let Y=$.indexOf(";base64,"),Z=Y===-1?0:Y+8;return new Uint8Array(atob($.substring(Z)).split("").map((J)=>J.charCodeAt(0)))},mJ=($)=>typeof $==="string"?nX($):$,M9=($,U)=>({data:mJ($.data),fileName:U,transformation:{pixels:{x:Math.round($.transformation.width),y:Math.round($.transformation.height)},emus:{x:Math.round($.transformation.width*9525),y:Math.round($.transformation.height*9525)},flip:$.transformation.flip,rotation:$.transformation.rotation?$.transformation.rotation*60000:void 0}});class lJ extends C0{constructor($){super({});Y0(this,"imageData");let Y=`${A9($.data)}.${$.type}`;this.imageData=$.type==="svg"?R0(W0({type:$.type},M9($,Y)),{fallback:W0({type:$.fallback.type},M9(R0(W0({},$.fallback),{transformation:$.transformation}),`${A9($.fallback.data)}.${$.fallback.type}`))}):W0({type:$.type},M9($,Y));let Z=new D1(this.imageData,{floating:$.floating,docProperties:$.altText,outline:$.outline});this.root.push(Z)}prepForXml($){if($.file.Media.addImage(this.imageData.fileName,this.imageData),this.imageData.type==="svg")$.file.Media.addImage(this.imageData.fallback.fileName,this.imageData.fallback);return super.prepForXml($)}}var B$=($)=>{var U,Y,Z,J,G,X,Q,B;return{offset:{pixels:{x:Math.round((Y=(U=$.offset)==null?void 0:U.left)!=null?Y:0),y:Math.round((J=(Z=$.offset)==null?void 0:Z.top)!=null?J:0)},emus:{x:Math.round(((X=(G=$.offset)==null?void 0:G.left)!=null?X:0)*9525),y:Math.round(((B=(Q=$.offset)==null?void 0:Q.top)!=null?B:0)*9525)}},pixels:{x:Math.round($.width),y:Math.round($.height)},emus:{x:Math.round($.width*9525),y:Math.round($.height*9525)},flip:$.flip,rotation:$.rotation?$.rotation*60000:void 0}};class aJ extends C0{constructor($){super({});Y0(this,"wpsShapeData"),this.wpsShapeData={type:$.type,transformation:B$($.transformation),data:W0({},$)};let U=new D1(this.wpsShapeData,{floating:$.floating,docProperties:$.altText,outline:$.outline,solidFill:$.solidFill});this.root.push(U)}}class pJ extends C0{constructor($){super({});Y0(this,"wpgGroupData"),Y0(this,"mediaDatas"),this.wpgGroupData={type:$.type,transformation:B$($.transformation),children:$.children};let U=new D1(this.wpgGroupData,{floating:$.floating,docProperties:$.altText});this.mediaDatas=$.children.filter((Y)=>Y.type!=="wps").map((Y)=>Y),this.root.push(U)}prepForXml($){return this.mediaDatas.forEach((U)=>{if($.file.Media.addImage(U.fileName,U),U.type==="svg")$.file.Media.addImage(U.fallback.fileName,U.fallback)}),super.prepForXml($)}}class iJ extends o{constructor($){super("w:instrText");this.root.push(new x0({space:g0.PRESERVE})),this.root.push(`SEQ ${$}`)}}class rJ extends C0{constructor($){super({});this.root.push($2(!0)),this.root.push(new iJ($)),this.root.push(I2()),this.root.push(U2())}}class sJ extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{instr:"w:instr"})}}class J8 extends o{constructor($,U){super("w:fldSimple");if(this.root.push(new sJ({instr:$})),U!==void 0)this.root.push(new p2(U))}}class nJ extends J8{constructor($){super(` MERGEFIELD ${$} `,`«${$}»`)}}class oJ extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{xmlns:"xmlns"})}}var tJ={EXTERNAL:"External"},oX=($,U,Y,Z)=>new B0({name:"Relationship",attributes:{id:{key:"Id",value:$},type:{key:"Type",value:U},target:{key:"Target",value:Y},targetMode:{key:"TargetMode",value:Z}}});class W2 extends o{constructor(){super("Relationships");this.root.push(new oJ({xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}))}addRelationship($,U,Y,Z){this.root.push(oX(`rId${$}`,U,Y,Z))}get RelationshipCount(){return this.root.length-1}}class eJ extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{id:"w:id",initials:"w:initials",author:"w:author",date:"w:date"})}}class G8 extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{id:"w:id"})}}class $G extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{"xmlns:cx":"xmlns:cx","xmlns:cx1":"xmlns:cx1","xmlns:cx2":"xmlns:cx2","xmlns:cx3":"xmlns:cx3","xmlns:cx4":"xmlns:cx4","xmlns:cx5":"xmlns:cx5","xmlns:cx6":"xmlns:cx6","xmlns:cx7":"xmlns:cx7","xmlns:cx8":"xmlns:cx8","xmlns:mc":"xmlns:mc","xmlns:aink":"xmlns:aink","xmlns:am3d":"xmlns:am3d","xmlns:o":"xmlns:o","xmlns:r":"xmlns:r","xmlns:m":"xmlns:m","xmlns:v":"xmlns:v","xmlns:wp14":"xmlns:wp14","xmlns:wp":"xmlns:wp","xmlns:w10":"xmlns:w10","xmlns:w":"xmlns:w","xmlns:w14":"xmlns:w14","xmlns:w15":"xmlns:w15","xmlns:w16cex":"xmlns:w16cex","xmlns:w16cid":"xmlns:w16cid","xmlns:w16":"xmlns:w16","xmlns:w16sdtdh":"xmlns:w16sdtdh","xmlns:w16se":"xmlns:w16se","xmlns:wpg":"xmlns:wpg","xmlns:wpi":"xmlns:wpi","xmlns:wne":"xmlns:wne","xmlns:wps":"xmlns:wps"})}}class UG extends o{constructor($){super("w:commentRangeStart");this.root.push(new G8({id:$}))}}class YG extends o{constructor($){super("w:commentRangeEnd");this.root.push(new G8({id:$}))}}class ZG extends o{constructor($){super("w:commentReference");this.root.push(new G8({id:$}))}}class L$ extends o{constructor({id:$,initials:U,author:Y,date:Z=new Date,children:J}){super("w:comment");this.root.push(new eJ({id:$,initials:U,author:Y,date:Z.toISOString()}));for(let G of J)this.root.push(G)}}class M$ extends o{constructor({children:$}){super("w:comments");Y0(this,"relationships"),this.root.push(new $G({"xmlns:cx":"http://schemas.microsoft.com/office/drawing/2014/chartex","xmlns:cx1":"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex","xmlns:cx2":"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex","xmlns:cx3":"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex","xmlns:cx4":"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex","xmlns:cx5":"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex","xmlns:cx6":"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex","xmlns:cx7":"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex","xmlns:cx8":"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:aink":"http://schemas.microsoft.com/office/drawing/2016/ink","xmlns:am3d":"http://schemas.microsoft.com/office/drawing/2017/model3d","xmlns:o":"urn:schemas-microsoft-com:office:office","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:m":"http://schemas.openxmlformats.org/officeDocument/2006/math","xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:wp14":"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing","xmlns:wp":"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing","xmlns:w10":"urn:schemas-microsoft-com:office:word","xmlns:w":"http://schemas.openxmlformats.org/wordprocessingml/2006/main","xmlns:w14":"http://schemas.microsoft.com/office/word/2010/wordml","xmlns:w15":"http://schemas.microsoft.com/office/word/2012/wordml","xmlns:w16cex":"http://schemas.microsoft.com/office/word/2018/wordml/cex","xmlns:w16cid":"http://schemas.microsoft.com/office/word/2016/wordml/cid","xmlns:w16":"http://schemas.microsoft.com/office/word/2018/wordml","xmlns:w16sdtdh":"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash","xmlns:w16se":"http://schemas.microsoft.com/office/word/2015/wordml/symex","xmlns:wpg":"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup","xmlns:wpi":"http://schemas.microsoft.com/office/word/2010/wordprocessingInk","xmlns:wne":"http://schemas.microsoft.com/office/word/2006/wordml","xmlns:wps":"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"}));for(let U of $)this.root.push(new L$(U));this.relationships=new W2}get Relationships(){return this.relationships}}class QG extends k0{constructor(){super("w:noBreakHyphen")}}class JG extends k0{constructor(){super("w:softHyphen")}}class GG extends k0{constructor(){super("w:dayShort")}}class KG extends k0{constructor(){super("w:monthShort")}}class qG extends k0{constructor(){super("w:yearShort")}}class XG extends k0{constructor(){super("w:dayLong")}}class VG extends k0{constructor(){super("w:monthLong")}}class BG extends k0{constructor(){super("w:yearLong")}}class LG extends k0{constructor(){super("w:annotationRef")}}class MG extends k0{constructor(){super("w:footnoteRef")}}class I$ extends k0{constructor(){super("w:endnoteRef")}}class IG extends k0{constructor(){super("w:separator")}}class wG extends k0{constructor(){super("w:continuationSeparator")}}class WG extends k0{constructor(){super("w:pgNum")}}class HG extends k0{constructor(){super("w:cr")}}class w$ extends k0{constructor(){super("w:tab")}}class jG extends k0{constructor(){super("w:lastRenderedPageBreak")}}var tX={LEFT:"left",CENTER:"center",RIGHT:"right"},eX={MARGIN:"margin",INDENT:"indent"},$V={NONE:"none",DOT:"dot",HYPHEN:"hyphen",UNDERSCORE:"underscore",MIDDLE_DOT:"middleDot"};class zG extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{alignment:"w:alignment",relativeTo:"w:relativeTo",leader:"w:leader"})}}class FG extends o{constructor($){super("w:ptab");this.root.push(new zG({alignment:$.alignment,relativeTo:$.relativeTo,leader:$.leader}))}}var NG={COLUMN:"column",PAGE:"page"};class W$ extends o{constructor($){super("w:br");this.root.push(new O0({type:$}))}}class RG extends C0{constructor(){super({});this.root.push(new W$(NG.PAGE))}}class DG extends C0{constructor(){super({});this.root.push(new W$(NG.COLUMN))}}class H$ extends o{constructor(){super("w:pageBreakBefore")}}var v2={AT_LEAST:"atLeast",EXACTLY:"exactly",EXACT:"exact",AUTO:"auto"},AG=({after:$,before:U,line:Y,lineRule:Z,beforeAutoSpacing:J,afterAutoSpacing:G})=>new B0({name:"w:spacing",attributes:{after:{key:"w:after",value:$},before:{key:"w:before",value:U},line:{key:"w:line",value:Y},lineRule:{key:"w:lineRule",value:Z},beforeAutoSpacing:{key:"w:beforeAutospacing",value:J},afterAutoSpacing:{key:"w:afterAutospacing",value:G}}}),UV={HEADING_1:"Heading1",HEADING_2:"Heading2",HEADING_3:"Heading3",HEADING_4:"Heading4",HEADING_5:"Heading5",HEADING_6:"Heading6",TITLE:"Title"},K1=($)=>new B0({name:"w:pStyle",attributes:{val:{key:"w:val",value:$}}}),O9={LEFT:"left",RIGHT:"right",CENTER:"center",BAR:"bar",CLEAR:"clear",DECIMAL:"decimal",END:"end",NUM:"num",START:"start"},YV={DOT:"dot",HYPHEN:"hyphen",MIDDLE_DOT:"middleDot",NONE:"none",UNDERSCORE:"underscore"},ZV={MAX:9026},PG=({type:$,position:U,leader:Y})=>new B0({name:"w:tab",attributes:{val:{key:"w:val",value:$},pos:{key:"w:pos",value:U},leader:{key:"w:leader",value:Y}}}),TG=($)=>new B0({name:"w:tabs",children:$.map((U)=>PG(U))});class V1 extends o{constructor($,U){super("w:numPr");this.root.push(new CG(U)),this.root.push(new OG($))}}class CG extends o{constructor($){super("w:ilvl");if($>9)throw Error("Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7");this.root.push(new O0({val:$}))}}class OG extends o{constructor($){super("w:numId");this.root.push(new O0({val:typeof $==="string"?`{${$}}`:$}))}}class r2 extends o{constructor(){super(...arguments);Y0(this,"fileChild",Symbol())}}class kG extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{id:"r:id",history:"w:history",anchor:"w:anchor"})}}var QV={INTERNAL:"INTERNAL",EXTERNAL:"EXTERNAL"};class _2 extends o{constructor($,U,Y){super("w:hyperlink");Y0(this,"linkId"),this.linkId=U;let Z={history:1,anchor:Y?Y:void 0,id:!Y?`rId${this.linkId}`:void 0},J=new kG(Z);this.root.push(J),$.forEach((G)=>{this.root.push(G)})}}class j$ extends _2{constructor($){super($.children,R1(),$.anchor)}}class K8 extends o{constructor($){super("w:externalHyperlink");this.options=$}}class EG extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{id:"w:id",name:"w:name"})}}class SG extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{id:"w:id"})}}class z${constructor($){Y0(this,"bookmarkUniqueNumericId",oQ()),Y0(this,"start"),Y0(this,"children"),Y0(this,"end");let U=this.bookmarkUniqueNumericId();this.start=new F$($.id,U),this.children=$.children,this.end=new N$(U)}}class F$ extends o{constructor($,U){super("w:bookmarkStart");let Y=new EG({name:$,id:U});this.root.push(Y)}}class N$ extends o{constructor($){super("w:bookmarkEnd");let U=new SG({id:$});this.root.push(U)}}var vG=(($)=>{return $.NONE="none",$.RELATIVE="relative",$.NO_CONTEXT="no_context",$.FULL_CONTEXT="full_context",$})(vG||{}),JV={["relative"]:"\\r",["no_context"]:"\\n",["full_context"]:"\\w",["none"]:void 0};class _G extends J8{constructor($,U,Y={}){let{hyperlink:Z=!0,referenceFormat:J="full_context"}=Y,G=`REF ${$}`,X=[...Z?["\\h"]:[],...[JV[J]].filter((B)=>!!B)],Q=`${G} ${X.join(" ")}`;super(Q,U)}}var yG=($)=>new B0({name:"w:outlineLvl",attributes:{val:{key:"w:val",value:$}}});class bG extends o{constructor($,U={}){super("w:instrText");this.root.push(new x0({space:g0.PRESERVE}));let Y=`PAGEREF ${$}`;if(U.hyperlink)Y=`${Y} \\h`;if(U.useRelativePosition)Y=`${Y} \\p`;this.root.push(Y)}}class gG extends C0{constructor($,U={}){super({children:[$2(!0),new bG($,U),U2()]})}}var GV={ANSI:"00",DEFAULT:"01",SYMBOL:"02",MAC:"4D",JIS:"80",HANGUL:"81",JOHAB:"82",GB_2312:"86",CHINESEBIG5:"88",GREEK:"A1",TURKISH:"A2",VIETNAMESE:"A3",HEBREW:"B1",ARABIC:"B2",BALTIC:"BA",RUSSIAN:"CC",THAI:"DE",EASTEUROPE:"EE",OEM:"FF"},_1=({id:$,fontKey:U,subsetted:Y},Z)=>new B0({name:Z,attributes:W0({id:{key:"r:id",value:$}},U?{fontKey:{key:"w:fontKey",value:`{${U}}`}}:{}),children:[...Y?[new X0("w:subsetted",Y)]:[]]}),KV=({name:$,altName:U,panose1:Y,charset:Z,family:J,notTrueType:G,pitch:X,sig:Q,embedRegular:B,embedBold:F,embedItalic:z,embedBoldItalic:W})=>new B0({name:"w:font",attributes:{name:{key:"w:name",value:$}},children:[...U?[u2("w:altName",U)]:[],...Y?[u2("w:panose1",Y)]:[],...Z?[u2("w:charset",Z)]:[],u2("w:family",J),...G?[new X0("w:notTrueType",G)]:[],u2("w:pitch",X),...Q?[new B0({name:"w:sig",attributes:{usb0:{key:"w:usb0",value:Q.usb0},usb1:{key:"w:usb1",value:Q.usb1},usb2:{key:"w:usb2",value:Q.usb2},usb3:{key:"w:usb3",value:Q.usb3},csb0:{key:"w:csb0",value:Q.csb0},csb1:{key:"w:csb1",value:Q.csb1}}})]:[],...B?[_1(B,"w:embedRegular")]:[],...F?[_1(F,"w:embedBold")]:[],...z?[_1(z,"w:embedItalic")]:[],...W?[_1(W,"w:embedBoldItalic")]:[]]}),qV=({name:$,index:U,fontKey:Y,characterSet:Z})=>KV({name:$,sig:{usb0:"E0002AFF",usb1:"C000247B",usb2:"00000009",usb3:"00000000",csb0:"000001FF",csb1:"00000000"},charset:Z,family:"auto",pitch:"variable",embedRegular:{fontKey:Y,id:`rId${U}`}}),XV=($)=>new B0({name:"w:fonts",attributes:{mc:{key:"xmlns:mc",value:"http://schemas.openxmlformats.org/markup-compatibility/2006"},r:{key:"xmlns:r",value:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"},w:{key:"xmlns:w",value:"http://schemas.openxmlformats.org/wordprocessingml/2006/main"},w14:{key:"xmlns:w14",value:"http://schemas.microsoft.com/office/word/2010/wordml"},w15:{key:"xmlns:w15",value:"http://schemas.microsoft.com/office/word/2012/wordml"},w16cex:{key:"xmlns:w16cex",value:"http://schemas.microsoft.com/office/word/2018/wordml/cex"},w16cid:{key:"xmlns:w16cid",value:"http://schemas.microsoft.com/office/word/2016/wordml/cid"},w16:{key:"xmlns:w16",value:"http://schemas.microsoft.com/office/word/2018/wordml"},w16sdtdh:{key:"xmlns:w16sdtdh",value:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash"},w16se:{key:"xmlns:w16se",value:"http://schemas.microsoft.com/office/word/2015/wordml/symex"},Ignorable:{key:"mc:Ignorable",value:"w14 w15 w16se w16cid w16 w16cex w16sdtdh"}},children:$.map((U,Y)=>qV({name:U.name,index:Y+1,fontKey:U.fontKey,characterSet:U.characterSet}))});class R${constructor($){Y0(this,"fontTable"),Y0(this,"relationships"),Y0(this,"fontOptionsWithKey",[]),this.options=$,this.fontOptionsWithKey=$.map((U)=>R0(W0({},U),{fontKey:tQ()})),this.fontTable=XV(this.fontOptionsWithKey),this.relationships=new W2;for(let U=0;U<$.length;U++)this.relationships.addRelationship(U+1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/font",`fonts/${$[U].name}.odttf`)}get View(){return this.fontTable}get Relationships(){return this.relationships}}var VV=()=>new B0({name:"w:wordWrap",attributes:{val:{key:"w:val",value:0}}}),BV={NONE:"none",DROP:"drop",MARGIN:"margin"},LV={MARGIN:"margin",PAGE:"page",TEXT:"text"},MV={AROUND:"around",AUTO:"auto",NONE:"none",NOT_BESIDE:"notBeside",THROUGH:"through",TIGHT:"tight"},xG=($)=>{var U,Y;return new B0({name:"w:framePr",attributes:{anchorLock:{key:"w:anchorLock",value:$.anchorLock},dropCap:{key:"w:dropCap",value:$.dropCap},width:{key:"w:w",value:$.width},height:{key:"w:h",value:$.height},x:{key:"w:x",value:$.position?$.position.x:void 0},y:{key:"w:y",value:$.position?$.position.y:void 0},anchorHorizontal:{key:"w:hAnchor",value:$.anchor.horizontal},anchorVertical:{key:"w:vAnchor",value:$.anchor.vertical},spaceHorizontal:{key:"w:hSpace",value:(U=$.space)==null?void 0:U.horizontal},spaceVertical:{key:"w:vSpace",value:(Y=$.space)==null?void 0:Y.vertical},rule:{key:"w:hRule",value:$.rule},alignmentX:{key:"w:xAlign",value:$.alignment?$.alignment.x:void 0},alignmentY:{key:"w:yAlign",value:$.alignment?$.alignment.y:void 0},lines:{key:"w:lines",value:$.lines},wrap:{key:"w:wrap",value:$.wrap}}})};class Z2 extends Q2{constructor($){var U,Y;super("w:pPr",$==null?void 0:$.includeIfEmpty);if(Y0(this,"numberingReferences",[]),!$)return this;if($.heading)this.push(K1($.heading));if($.bullet)this.push(K1("ListParagraph"));if($.numbering){if(!$.style&&!$.heading){if(!$.numbering.custom)this.push(K1("ListParagraph"))}}if($.style)this.push(K1($.style));if($.keepNext!==void 0)this.push(new X0("w:keepNext",$.keepNext));if($.keepLines!==void 0)this.push(new X0("w:keepLines",$.keepLines));if($.pageBreakBefore)this.push(new H$);if($.frame)this.push(xG($.frame));if($.widowControl!==void 0)this.push(new X0("w:widowControl",$.widowControl));if($.bullet)this.push(new V1(1,$.bullet.level));if($.numbering)this.numberingReferences.push({reference:$.numbering.reference,instance:(U=$.numbering.instance)!=null?U:0}),this.push(new V1(`${$.numbering.reference}-${(Y=$.numbering.instance)!=null?Y:0}`,$.numbering.level));else if($.numbering===!1)this.push(new V1(0,0));if($.border)this.push(new o9($.border));if($.thematicBreak)this.push(new t9);if($.shading)this.push(j1($.shading));if($.wordWrap)this.push(VV());if($.overflowPunctuation)this.push(new X0("w:overflowPunct",$.overflowPunctuation));let Z=[...$.rightTabStop!==void 0?[{type:O9.RIGHT,position:$.rightTabStop}]:[],...$.tabStops?$.tabStops:[],...$.leftTabStop!==void 0?[{type:O9.LEFT,position:$.leftTabStop}]:[]];if(Z.length>0)this.push(TG(Z));if($.bidirectional!==void 0)this.push(new X0("w:bidi",$.bidirectional));if($.spacing)this.push(AG($.spacing));if($.indent)this.push(EQ($.indent));if($.contextualSpacing!==void 0)this.push(new X0("w:contextualSpacing",$.contextualSpacing));if($.alignment)this.push(n9($.alignment));if($.outlineLevel!==void 0)this.push(yG($.outlineLevel));if($.suppressLineNumbers!==void 0)this.push(new X0("w:suppressLineNumbers",$.suppressLineNumbers));if($.autoSpaceEastAsianText!==void 0)this.push(new X0("w:autoSpaceDN",$.autoSpaceEastAsianText));if($.run)this.push(new Q$($.run));if($.revision)this.push(new D$($.revision))}push($){this.root.push($)}prepForXml($){if(!($.viewWrapper instanceof R$))for(let U of this.numberingReferences)$.file.Numbering.createConcreteNumberingInstance(U.reference,U.instance);return super.prepForXml($)}}class D$ extends o{constructor($){super("w:pPrChange");this.root.push(new _0({id:$.id,author:$.author,date:$.date})),this.root.push(new Z2(R0(W0({},$),{includeIfEmpty:!0})))}}class h0 extends r2{constructor($){super("w:p");if(Y0(this,"properties"),typeof $==="string")return this.properties=new Z2({}),this.root.push(this.properties),this.root.push(new p2($)),this;if(this.properties=new Z2($),this.root.push(this.properties),$.text)this.root.push(new p2($.text));if($.children)for(let U of $.children){if(U instanceof z$){this.root.push(U.start);for(let Y of U.children)this.root.push(Y);this.root.push(U.end);continue}this.root.push(U)}}prepForXml($){for(let U of this.root)if(U instanceof K8){let Y=this.root.indexOf(U),Z=new _2(U.options.children,R1());$.viewWrapper.Relationships.addRelationship(Z.linkId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",U.options.link,tJ.EXTERNAL),this.root[Y]=Z}return super.prepForXml($)}addRunToFront($){return this.root.splice(1,0,$),this}}var IV=class extends o{constructor(U){super("m:oMath");for(let Y of U.children)this.root.push(Y)}};class fG extends o{constructor($){super("m:t");this.root.push($)}}class hG extends o{constructor($){super("m:r");this.root.push(new fG($))}}class A$ extends o{constructor($){super("m:den");for(let U of $)this.root.push(U)}}class P$ extends o{constructor($){super("m:num");for(let U of $)this.root.push(U)}}class uG extends o{constructor($){super("m:f");this.root.push(new P$($.numerator)),this.root.push(new A$($.denominator))}}var dG=({accent:$})=>new B0({name:"m:chr",attributes:{accent:{key:"m:val",value:$}}}),y0=({children:$})=>new B0({name:"m:e",children:$}),cG=({value:$})=>new B0({name:"m:limLoc",attributes:{value:{key:"m:val",value:$||"undOvr"}}}),wV=()=>new B0({name:"m:subHide",attributes:{hide:{key:"m:val",value:1}}}),WV=()=>new B0({name:"m:supHide",attributes:{hide:{key:"m:val",value:1}}}),T$=({accent:$,hasSuperScript:U,hasSubScript:Y,limitLocationVal:Z})=>new B0({name:"m:naryPr",children:[...$?[dG({accent:$})]:[],cG({value:Z}),...!U?[WV()]:[],...!Y?[wV()]:[]]}),s2=({children:$})=>new B0({name:"m:sub",children:$}),n2=({children:$})=>new B0({name:"m:sup",children:$});class mG extends o{constructor($){super("m:nary");if(this.root.push(T$({accent:"∑",hasSuperScript:!!$.superScript,hasSubScript:!!$.subScript})),$.subScript)this.root.push(s2({children:$.subScript}));if($.superScript)this.root.push(n2({children:$.superScript}));this.root.push(y0({children:$.children}))}}class lG extends o{constructor($){super("m:nary");if(this.root.push(T$({accent:"",hasSuperScript:!!$.superScript,hasSubScript:!!$.subScript,limitLocationVal:"subSup"})),$.subScript)this.root.push(s2({children:$.subScript}));if($.superScript)this.root.push(n2({children:$.superScript}));this.root.push(y0({children:$.children}))}}class q8 extends o{constructor($){super("m:lim");for(let U of $)this.root.push(U)}}class aG extends o{constructor($){super("m:limUpp");this.root.push(y0({children:$.children})),this.root.push(new q8($.limit))}}class pG extends o{constructor($){super("m:limLow");this.root.push(y0({children:$.children})),this.root.push(new q8($.limit))}}var iG=()=>new B0({name:"m:sSupPr"});class rG extends o{constructor($){super("m:sSup");this.root.push(iG()),this.root.push(y0({children:$.children})),this.root.push(n2({children:$.superScript}))}}var sG=()=>new B0({name:"m:sSubPr"});class nG extends o{constructor($){super("m:sSub");this.root.push(sG()),this.root.push(y0({children:$.children})),this.root.push(s2({children:$.subScript}))}}var oG=()=>new B0({name:"m:sSubSupPr"});class tG extends o{constructor($){super("m:sSubSup");this.root.push(oG()),this.root.push(y0({children:$.children})),this.root.push(s2({children:$.subScript})),this.root.push(n2({children:$.superScript}))}}var eG=()=>new B0({name:"m:sPrePr"});class $K extends B0{constructor({children:$,subScript:U,superScript:Y}){super({name:"m:sPre",children:[eG(),y0({children:$}),s2({children:U}),n2({children:Y})]})}}var HV="";class C$ extends o{constructor($){super("m:deg");if($)for(let U of $)this.root.push(U)}}class UK extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{hide:"m:val"})}}class YK extends o{constructor(){super("m:degHide");this.root.push(new UK({hide:1}))}}class O$ extends o{constructor($){super("m:radPr");if(!$)this.root.push(new YK)}}class ZK extends o{constructor($){super("m:rad");this.root.push(new O$(!!$.degree)),this.root.push(new C$($.degree)),this.root.push(y0({children:$.children}))}}class k$ extends o{constructor($){super("m:fName");for(let U of $)this.root.push(U)}}class E$ extends o{constructor(){super("m:funcPr")}}class QK extends o{constructor($){super("m:func");this.root.push(new E$),this.root.push(new k$($.name)),this.root.push(y0({children:$.children}))}}var jV=({character:$})=>new B0({name:"m:begChr",attributes:{character:{key:"m:val",value:$}}}),zV=({character:$})=>new B0({name:"m:endChr",attributes:{character:{key:"m:val",value:$}}}),X8=({characters:$})=>new B0({name:"m:dPr",children:$?[jV({character:$.beginningCharacter}),zV({character:$.endingCharacter})]:[]});class JK extends o{constructor($){super("m:d");this.root.push(X8({})),this.root.push(y0({children:$.children}))}}class GK extends o{constructor($){super("m:d");this.root.push(X8({characters:{beginningCharacter:"[",endingCharacter:"]"}})),this.root.push(y0({children:$.children}))}}class KK extends o{constructor($){super("m:d");this.root.push(X8({characters:{beginningCharacter:"{",endingCharacter:"}"}})),this.root.push(y0({children:$.children}))}}class qK extends o{constructor($){super("m:d");this.root.push(X8({characters:{beginningCharacter:"〈",endingCharacter:"〉"}})),this.root.push(y0({children:$.children}))}}var FV=($)=>new B0({name:"w:gridCol",attributes:$!==void 0?{width:{key:"w:w",value:T0($)}}:void 0});class S$ extends o{constructor($,U){super("w:tblGrid");for(let Y of $)this.root.push(FV(Y));if(U)this.root.push(new VK(U))}}class XK extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{id:"w:id"})}}class VK extends o{constructor($){super("w:tblGridChange");this.root.push(new XK({id:$.id})),this.root.push(new S$($.columnWidths))}}class BK extends o{constructor($){super("w:ins");this.root.push(new _0({id:$.id,author:$.author,date:$.date})),this.addChildElement(new p2($))}}class LK extends o{constructor(){super("w:delInstrText");this.root.push(new x0({space:g0.PRESERVE})),this.root.push("PAGE")}}class MK extends o{constructor(){super("w:delInstrText");this.root.push(new x0({space:g0.PRESERVE})),this.root.push("NUMPAGES")}}class IK extends o{constructor(){super("w:delInstrText");this.root.push(new x0({space:g0.PRESERVE})),this.root.push("SECTIONPAGES")}}class k9 extends o{constructor($){super("w:delText");this.root.push(new x0({space:g0.PRESERVE})),this.root.push($)}}class wK extends o{constructor($){super("w:del");Y0(this,"deletedTextRunWrapper"),this.root.push(new _0({id:$.id,author:$.author,date:$.date})),this.deletedTextRunWrapper=new WK($),this.addChildElement(this.deletedTextRunWrapper)}}class WK extends o{constructor($){super("w:r");if(this.root.push(new J2($)),$.children)for(let U of $.children){if(typeof U==="string"){switch(U){case N2.CURRENT:this.root.push($2()),this.root.push(new LK),this.root.push(I2()),this.root.push(U2());break;case N2.TOTAL_PAGES:this.root.push($2()),this.root.push(new MK),this.root.push(I2()),this.root.push(U2());break;case N2.TOTAL_PAGES_IN_SECTION:this.root.push($2()),this.root.push(new IK),this.root.push(I2()),this.root.push(U2());break;default:this.root.push(new k9(U));break}continue}this.root.push(U)}else if($.text)this.root.push(new k9($.text));if($.break)for(let U=0;U<$.break;U++)this.root.splice(1,0,SQ())}}class v$ extends o{constructor($){super("w:ins");this.root.push(new _0({id:$.id,author:$.author,date:$.date}))}}class _$ extends o{constructor($){super("w:del");this.root.push(new _0({id:$.id,author:$.author,date:$.date}))}}class y$ extends o{constructor($){super("w:cellIns");this.root.push(new _0({id:$.id,author:$.author,date:$.date}))}}class b$ extends o{constructor($){super("w:cellDel");this.root.push(new _0({id:$.id,author:$.author,date:$.date}))}}var NV={CONTINUE:"cont",RESTART:"rest"};class g$ extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{id:"w:id",author:"w:author",date:"w:date",verticalMerge:"w:vMerge",verticalMergeOriginal:"w:vMergeOrig"})}}class x$ extends o{constructor($){super("w:cellMerge");this.root.push(new g$($))}}var HK={TOP:"top",CENTER:"center",BOTTOM:"bottom"},jK=R0(W0({},HK),{BOTH:"both"}),RV=jK,f$=($)=>new B0({name:"w:vAlign",attributes:{verticalAlign:{key:"w:val",value:$}}}),zK=({marginUnitType:$=l1.DXA,top:U,left:Y,bottom:Z,right:J})=>[{name:"w:top",size:U},{name:"w:left",size:Y},{name:"w:bottom",size:Z},{name:"w:right",size:J}].filter((G)=>G.size!==void 0).map(({name:G,size:X})=>M1(G,{type:$,size:X})),DV=($)=>{let U=zK($);if(U.length===0)return;return new B0({name:"w:tblCellMar",children:U})},AV=($)=>{let U=zK($);if(U.length===0)return;return new B0({name:"w:tcMar",children:U})},l1={AUTO:"auto",DXA:"dxa",NIL:"nil",PERCENTAGE:"pct"},M1=($,{type:U=l1.AUTO,size:Y})=>{let Z=Y;if(U===l1.PERCENTAGE&&typeof Y==="number")Z=`${Y}%`;return new B0({name:$,attributes:{type:{key:"w:type",value:U},size:{key:"w:w",value:s9(Z)}}})};class h$ extends Q2{constructor($){super("w:tcBorders");if($.top)this.root.push(N0("w:top",$.top));if($.start)this.root.push(N0("w:start",$.start));if($.left)this.root.push(N0("w:left",$.left));if($.bottom)this.root.push(N0("w:bottom",$.bottom));if($.end)this.root.push(N0("w:end",$.end));if($.right)this.root.push(N0("w:right",$.right))}}class FK extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{val:"w:val"})}}class u$ extends o{constructor($){super("w:gridSpan");this.root.push(new FK({val:S0($)}))}}var d$={CONTINUE:"continue",RESTART:"restart"};class NK extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{val:"w:val"})}}class a1 extends o{constructor($){super("w:vMerge");this.root.push(new NK({val:$}))}}var PV={BOTTOM_TO_TOP_LEFT_TO_RIGHT:"btLr",LEFT_TO_RIGHT_TOP_TO_BOTTOM:"lrTb",TOP_TO_BOTTOM_RIGHT_TO_LEFT:"tbRl"};class RK extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{val:"w:val"})}}class c$ extends o{constructor($){super("w:textDirection");this.root.push(new RK({val:$}))}}class m$ extends Q2{constructor($){super("w:tcPr",$.includeIfEmpty);if($.width)this.root.push(M1("w:tcW",$.width));if($.columnSpan)this.root.push(new u$($.columnSpan));if($.verticalMerge)this.root.push(new a1($.verticalMerge));else if($.rowSpan&&$.rowSpan>1)this.root.push(new a1(d$.RESTART));if($.borders)this.root.push(new h$($.borders));if($.shading)this.root.push(j1($.shading));if($.margins){let U=AV($.margins);if(U)this.root.push(U)}if($.textDirection)this.root.push(new c$($.textDirection));if($.verticalAlign)this.root.push(f$($.verticalAlign));if($.insertion)this.root.push(new y$($.insertion));if($.deletion)this.root.push(new b$($.deletion));if($.revision)this.root.push(new DK($.revision));if($.cellMerge)this.root.push(new x$($.cellMerge))}}class DK extends o{constructor($){super("w:tcPrChange");this.root.push(new _0({id:$.id,author:$.author,date:$.date})),this.root.push(new m$(R0(W0({},$),{includeIfEmpty:!0})))}}class V8 extends o{constructor($){super("w:tc");this.options=$,this.root.push(new m$($));for(let U of $.children)this.root.push(U)}prepForXml($){if(!(this.root[this.root.length-1]instanceof h0))this.root.push(new h0({}));return super.prepForXml($)}}var x2={style:Q8.NONE,size:0,color:"auto"},f2={style:Q8.SINGLE,size:4,color:"auto"};class B8 extends o{constructor($){var U,Y,Z,J,G,X;super("w:tblBorders");this.root.push(N0("w:top",(U=$.top)!=null?U:f2)),this.root.push(N0("w:left",(Y=$.left)!=null?Y:f2)),this.root.push(N0("w:bottom",(Z=$.bottom)!=null?Z:f2)),this.root.push(N0("w:right",(J=$.right)!=null?J:f2)),this.root.push(N0("w:insideH",(G=$.insideHorizontal)!=null?G:f2)),this.root.push(N0("w:insideV",(X=$.insideVertical)!=null?X:f2))}}Y0(B8,"NONE",{top:x2,bottom:x2,left:x2,right:x2,insideHorizontal:x2,insideVertical:x2});var TV={MARGIN:"margin",PAGE:"page",TEXT:"text"},CV={CENTER:"center",INSIDE:"inside",LEFT:"left",OUTSIDE:"outside",RIGHT:"right"},OV={CENTER:"center",INSIDE:"inside",BOTTOM:"bottom",OUTSIDE:"outside",INLINE:"inline",TOP:"top"},kV={NEVER:"never",OVERLAP:"overlap"},EV=($)=>new B0({name:"w:tblOverlap",attributes:{val:{key:"w:val",value:$}}}),AK=({horizontalAnchor:$,verticalAnchor:U,absoluteHorizontalPosition:Y,relativeHorizontalPosition:Z,absoluteVerticalPosition:J,relativeVerticalPosition:G,bottomFromText:X,topFromText:Q,leftFromText:B,rightFromText:F,overlap:z})=>new B0({name:"w:tblpPr",attributes:{leftFromText:{key:"w:leftFromText",value:B===void 0?void 0:T0(B)},rightFromText:{key:"w:rightFromText",value:F===void 0?void 0:T0(F)},topFromText:{key:"w:topFromText",value:Q===void 0?void 0:T0(Q)},bottomFromText:{key:"w:bottomFromText",value:X===void 0?void 0:T0(X)},absoluteHorizontalPosition:{key:"w:tblpX",value:Y===void 0?void 0:e0(Y)},absoluteVerticalPosition:{key:"w:tblpY",value:J===void 0?void 0:e0(J)},horizontalAnchor:{key:"w:horzAnchor",value:$},relativeHorizontalPosition:{key:"w:tblpXSpec",value:Z},relativeVerticalPosition:{key:"w:tblpYSpec",value:G},verticalAnchor:{key:"w:vertAnchor",value:U}},children:z?[EV(z)]:void 0}),SV={AUTOFIT:"autofit",FIXED:"fixed"},PK=($)=>new B0({name:"w:tblLayout",attributes:{type:{key:"w:type",value:$}}}),vV={DXA:"dxa"},TK=({type:$=vV.DXA,value:U})=>new B0({name:"w:tblCellSpacing",attributes:{type:{key:"w:type",value:$},value:{key:"w:w",value:s9(U)}}}),CK=({firstRow:$,lastRow:U,firstColumn:Y,lastColumn:Z,noHBand:J,noVBand:G})=>new B0({name:"w:tblLook",attributes:{firstRow:{key:"w:firstRow",value:$},lastRow:{key:"w:lastRow",value:U},firstColumn:{key:"w:firstColumn",value:Y},lastColumn:{key:"w:lastColumn",value:Z},noHBand:{key:"w:noHBand",value:J},noVBand:{key:"w:noVBand",value:G}}});class L8 extends Q2{constructor($){super("w:tblPr",$.includeIfEmpty);if($.style)this.root.push(new Y2("w:tblStyle",$.style));if($.float)this.root.push(AK($.float));if($.visuallyRightToLeft!==void 0)this.root.push(new X0("w:bidiVisual",$.visuallyRightToLeft));if($.width)this.root.push(M1("w:tblW",$.width));if($.alignment)this.root.push(n9($.alignment));if($.indent)this.root.push(M1("w:tblInd",$.indent));if($.borders)this.root.push(new B8($.borders));if($.shading)this.root.push(j1($.shading));if($.layout)this.root.push(PK($.layout));if($.cellMargin){let U=DV($.cellMargin);if(U)this.root.push(U)}if($.tableLook)this.root.push(CK($.tableLook));if($.cellSpacing)this.root.push(TK($.cellSpacing));if($.revision)this.root.push(new OK($.revision))}}class OK extends o{constructor($){super("w:tblPrChange");this.root.push(new _0({id:$.id,author:$.author,date:$.date})),this.root.push(new L8(R0(W0({},$),{includeIfEmpty:!0})))}}class kK extends r2{constructor({rows:$,width:U,columnWidths:Y=Array(Math.max(...$.map((H)=>H.CellCount))).fill(100),columnWidthsRevision:Z,margins:J,indent:G,float:X,layout:Q,style:B,borders:F,alignment:z,visuallyRightToLeft:W,tableLook:k,cellSpacing:D,revision:C}){super("w:tbl");this.root.push(new L8({borders:F!=null?F:{},width:U!=null?U:{size:100},indent:G,float:X,layout:Q,style:B,alignment:z,cellMargin:J,visuallyRightToLeft:W,tableLook:k,cellSpacing:D,revision:C})),this.root.push(new S$(Y,Z));for(let H of $)this.root.push(H);$.forEach((H,O)=>{if(O===$.length-1)return;let V=0;H.cells.forEach((j)=>{if(j.options.rowSpan&&j.options.rowSpan>1){let M=new V8({rowSpan:j.options.rowSpan-1,columnSpan:j.options.columnSpan,borders:j.options.borders,children:[],verticalMerge:d$.CONTINUE});$[O+1].addCellToColumnIndex(M,V)}V+=j.options.columnSpan||1})})}}var _V={AUTO:"auto",ATLEAST:"atLeast",EXACT:"exact"},EK=($,U)=>new B0({name:"w:trHeight",attributes:{value:{key:"w:val",value:T0($)},rule:{key:"w:hRule",value:U}}});class M8 extends Q2{constructor($){super("w:trPr",$.includeIfEmpty);if($.cantSplit!==void 0)this.root.push(new X0("w:cantSplit",$.cantSplit));if($.tableHeader!==void 0)this.root.push(new X0("w:tblHeader",$.tableHeader));if($.height)this.root.push(EK($.height.value,$.height.rule));if($.cellSpacing)this.root.push(TK($.cellSpacing));if($.insertion)this.root.push(new v$($.insertion));if($.deletion)this.root.push(new _$($.deletion));if($.revision)this.root.push(new l$($.revision))}}class l$ extends o{constructor($){super("w:trPrChange");this.root.push(new _0({id:$.id,author:$.author,date:$.date})),this.root.push(new M8(R0(W0({},$),{includeIfEmpty:!0})))}}class SK extends o{constructor($){super("w:tr");this.options=$,this.root.push(new M8($));for(let U of $.children)this.root.push(U)}get CellCount(){return this.options.children.length}get cells(){return this.root.filter(($)=>$ instanceof V8)}addCellToIndex($,U){this.root.splice(U+1,0,$)}addCellToColumnIndex($,U){let Y=this.columnIndexToRootIndex(U,!0);this.addCellToIndex($,Y-1)}rootIndexToColumnIndex($){if($<1||$>=this.root.length)throw Error(`cell 'rootIndex' should between 1 to ${this.root.length-1}`);let U=0;for(let Y=1;Y<$;Y++){let Z=this.root[Y];U+=Z.options.columnSpan||1}return U}columnIndexToRootIndex($,U=!1){if($<0)throw Error("cell 'columnIndex' should not less than zero");let Y=0,Z=1;while(Y<=$){if(Z>=this.root.length)if(U)return this.root.length;else throw Error(`cell 'columnIndex' should not great than ${Y-1}`);let J=this.root[Z];Z+=1,Y+=J&&J.options.columnSpan||1}return Z-1}}class vK extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}}class _K extends o{constructor(){super("Properties");this.root.push(new vK({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}))}}class yK extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{xmlns:"xmlns"})}}var B2=($,U)=>new B0({name:"Default",attributes:{contentType:{key:"ContentType",value:$},extension:{key:"Extension",value:U}}}),f0=($,U)=>new B0({name:"Override",attributes:{contentType:{key:"ContentType",value:$},partName:{key:"PartName",value:U}}});class bK extends o{constructor(){super("Types");this.root.push(new yK({xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"})),this.root.push(B2("image/png","png")),this.root.push(B2("image/jpeg","jpeg")),this.root.push(B2("image/jpeg","jpg")),this.root.push(B2("image/bmp","bmp")),this.root.push(B2("image/gif","gif")),this.root.push(B2("image/svg+xml","svg")),this.root.push(B2("application/vnd.openxmlformats-package.relationships+xml","rels")),this.root.push(B2("application/xml","xml")),this.root.push(B2("application/vnd.openxmlformats-officedocument.obfuscatedFont","odttf")),this.root.push(f0("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml","/word/document.xml")),this.root.push(f0("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml","/word/styles.xml")),this.root.push(f0("application/vnd.openxmlformats-package.core-properties+xml","/docProps/core.xml")),this.root.push(f0("application/vnd.openxmlformats-officedocument.custom-properties+xml","/docProps/custom.xml")),this.root.push(f0("application/vnd.openxmlformats-officedocument.extended-properties+xml","/docProps/app.xml")),this.root.push(f0("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml","/word/numbering.xml")),this.root.push(f0("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml","/word/footnotes.xml")),this.root.push(f0("application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml","/word/endnotes.xml")),this.root.push(f0("application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml","/word/settings.xml")),this.root.push(f0("application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml","/word/comments.xml")),this.root.push(f0("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml","/word/fontTable.xml"))}addFooter($){this.root.push(f0("application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",`/word/footer${$}.xml`))}addHeader($){this.root.push(f0("application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",`/word/header${$}.xml`))}}var p1={wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance",cx:"http://schemas.microsoft.com/office/drawing/2014/chartex",cx1:"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",cx2:"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex",cx3:"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex",cx4:"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex",cx5:"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex",cx6:"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex",cx7:"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex",cx8:"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex",aink:"http://schemas.microsoft.com/office/drawing/2016/ink",am3d:"http://schemas.microsoft.com/office/drawing/2017/model3d",w16cex:"http://schemas.microsoft.com/office/word/2018/wordml/cex",w16cid:"http://schemas.microsoft.com/office/word/2016/wordml/cid",w16:"http://schemas.microsoft.com/office/word/2018/wordml",w16sdtdh:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash",w16se:"http://schemas.microsoft.com/office/word/2015/wordml/symex"};class o2 extends I0{constructor($,U){super(W0({Ignorable:U},Object.fromEntries($.map((Y)=>[Y,p1[Y]]))));Y0(this,"xmlKeys",W0({Ignorable:"mc:Ignorable"},Object.fromEntries(Object.keys(p1).map((Y)=>[Y,`xmlns:${Y}`]))))}}class gK extends o{constructor($){super("cp:coreProperties");if(this.root.push(new o2(["cp","dc","dcterms","dcmitype","xsi"])),$.title)this.root.push(new L2("dc:title",$.title));if($.subject)this.root.push(new L2("dc:subject",$.subject));if($.creator)this.root.push(new L2("dc:creator",$.creator));if($.keywords)this.root.push(new L2("cp:keywords",$.keywords));if($.description)this.root.push(new L2("dc:description",$.description));if($.lastModifiedBy)this.root.push(new L2("cp:lastModifiedBy",$.lastModifiedBy));if($.revision)this.root.push(new L2("cp:revision",String($.revision)));this.root.push(new E9("dcterms:created")),this.root.push(new E9("dcterms:modified"))}}class xK extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{type:"xsi:type"})}}class E9 extends o{constructor($){super($);this.root.push(new xK({type:"dcterms:W3CDTF"})),this.root.push(OQ(new Date))}}class fK extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}}class hK extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{formatId:"fmtid",pid:"pid",name:"name"})}}class uK extends o{constructor($,U){super("property");this.root.push(new hK({formatId:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:$.toString(),name:U.name})),this.root.push(new dK(U.value))}}class dK extends o{constructor($){super("vt:lpwstr");this.root.push($)}}class cK extends o{constructor($){super("Properties");Y0(this,"nextId"),Y0(this,"properties",[]),this.root.push(new fK({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"})),this.nextId=2;for(let U of $)this.addCustomProperty(U)}prepForXml($){return this.properties.forEach((U)=>this.root.push(U)),super.prepForXml($)}addCustomProperty($){this.properties.push(new uK(this.nextId++,$))}}var mK=({space:$,count:U,separate:Y,equalWidth:Z,children:J})=>new B0({name:"w:cols",attributes:{space:{key:"w:space",value:$===void 0?void 0:T0($)},count:{key:"w:num",value:U===void 0?void 0:S0(U)},separate:{key:"w:sep",value:Y},equalWidth:{key:"w:equalWidth",value:Z}},children:!Z&&J?J:void 0}),yV={DEFAULT:"default",LINES:"lines",LINES_AND_CHARS:"linesAndChars",SNAP_TO_CHARS:"snapToChars"},lK=({type:$,linePitch:U,charSpace:Y})=>new B0({name:"w:docGrid",attributes:{type:{key:"w:type",value:$},linePitch:{key:"w:linePitch",value:S0(U)},charSpace:{key:"w:charSpace",value:Y?S0(Y):void 0}}}),E2={DEFAULT:"default",FIRST:"first",EVEN:"even"},S9={HEADER:"w:headerReference",FOOTER:"w:footerReference"},f1=($,U)=>new B0({name:$,attributes:{type:{key:"w:type",value:U.type||E2.DEFAULT},id:{key:"r:id",value:`rId${U.id}`}}}),bV={NEW_PAGE:"newPage",NEW_SECTION:"newSection",CONTINUOUS:"continuous"},aK=({countBy:$,start:U,restart:Y,distance:Z})=>new B0({name:"w:lnNumType",attributes:{countBy:{key:"w:countBy",value:$===void 0?void 0:S0($)},start:{key:"w:start",value:U===void 0?void 0:S0(U)},restart:{key:"w:restart",value:Y},distance:{key:"w:distance",value:Z===void 0?void 0:T0(Z)}}}),gV={ALL_PAGES:"allPages",FIRST_PAGE:"firstPage",NOT_FIRST_PAGE:"notFirstPage"},xV={PAGE:"page",TEXT:"text"},fV={BACK:"back",FRONT:"front"};class v9 extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{display:"w:display",offsetFrom:"w:offsetFrom",zOrder:"w:zOrder"})}}class a$ extends Q2{constructor($){super("w:pgBorders");if(!$)return this;if($.pageBorders)this.root.push(new v9({display:$.pageBorders.display,offsetFrom:$.pageBorders.offsetFrom,zOrder:$.pageBorders.zOrder}));else this.root.push(new v9({}));if($.pageBorderTop)this.root.push(N0("w:top",$.pageBorderTop));if($.pageBorderLeft)this.root.push(N0("w:left",$.pageBorderLeft));if($.pageBorderBottom)this.root.push(N0("w:bottom",$.pageBorderBottom));if($.pageBorderRight)this.root.push(N0("w:right",$.pageBorderRight))}}var pK=($,U,Y,Z,J,G,X)=>new B0({name:"w:pgMar",attributes:{top:{key:"w:top",value:e0($)},right:{key:"w:right",value:T0(U)},bottom:{key:"w:bottom",value:e0(Y)},left:{key:"w:left",value:T0(Z)},header:{key:"w:header",value:T0(J)},footer:{key:"w:footer",value:T0(G)},gutter:{key:"w:gutter",value:T0(X)}}}),hV={HYPHEN:"hyphen",PERIOD:"period",COLON:"colon",EM_DASH:"emDash",EN_DASH:"endash"},iK=({start:$,formatType:U,separator:Y})=>new B0({name:"w:pgNumType",attributes:{start:{key:"w:start",value:$===void 0?void 0:S0($)},formatType:{key:"w:fmt",value:U},separator:{key:"w:chapSep",value:Y}}}),i1={PORTRAIT:"portrait",LANDSCAPE:"landscape"},rK=({width:$,height:U,orientation:Y,code:Z})=>{let J=T0($),G=T0(U);return new B0({name:"w:pgSz",attributes:{width:{key:"w:w",value:Y===i1.LANDSCAPE?G:J},height:{key:"w:h",value:Y===i1.LANDSCAPE?J:G},orientation:{key:"w:orient",value:Y},code:{key:"w:code",value:Z}}})},uV={LEFT_TO_RIGHT_TOP_TO_BOTTOM:"lrTb",TOP_TO_BOTTOM_RIGHT_TO_LEFT:"tbRl"};class sK extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{val:"w:val"})}}class p$ extends o{constructor($){super("w:textDirection");this.root.push(new sK({val:$}))}}var dV={NEXT_PAGE:"nextPage",NEXT_COLUMN:"nextColumn",CONTINUOUS:"continuous",EVEN_PAGE:"evenPage",ODD_PAGE:"oddPage"},nK=($)=>new B0({name:"w:type",attributes:{val:{key:"w:val",value:$}}}),F2={TOP:1440,RIGHT:1440,BOTTOM:1440,LEFT:1440,HEADER:708,FOOTER:708,GUTTER:0},h1={WIDTH:11906,HEIGHT:16838,ORIENTATION:i1.PORTRAIT};class I8 extends o{constructor({page:{size:{width:$=h1.WIDTH,height:U=h1.HEIGHT,orientation:Y=h1.ORIENTATION}={},margin:{top:Z=F2.TOP,right:J=F2.RIGHT,bottom:G=F2.BOTTOM,left:X=F2.LEFT,header:Q=F2.HEADER,footer:B=F2.FOOTER,gutter:F=F2.GUTTER}={},pageNumbers:z={},borders:W,textDirection:k}={},grid:{linePitch:D=360,charSpace:C,type:H}={},headerWrapperGroup:O={},footerWrapperGroup:V={},lineNumbers:j,titlePage:M,verticalAlign:L,column:A,type:y,revision:g}={}){super("w:sectPr");if(this.addHeaderFooterGroup(S9.HEADER,O),this.addHeaderFooterGroup(S9.FOOTER,V),y)this.root.push(nK(y));if(this.root.push(rK({width:$,height:U,orientation:Y})),this.root.push(pK(Z,J,G,X,Q,B,F)),W)this.root.push(new a$(W));if(j)this.root.push(aK(j));if(this.root.push(iK(z)),A)this.root.push(mK(A));if(L)this.root.push(f$(L));if(M!==void 0)this.root.push(new X0("w:titlePg",M));if(k)this.root.push(new p$(k));if(g)this.root.push(new i$(g));this.root.push(lK({linePitch:D,charSpace:C,type:H}))}addHeaderFooterGroup($,U){if(U.default)this.root.push(f1($,{type:E2.DEFAULT,id:U.default.View.ReferenceId}));if(U.first)this.root.push(f1($,{type:E2.FIRST,id:U.first.View.ReferenceId}));if(U.even)this.root.push(f1($,{type:E2.EVEN,id:U.even.View.ReferenceId}))}}class i$ extends o{constructor($){super("w:sectPrChange");this.root.push(new _0({id:$.id,author:$.author,date:$.date})),this.root.push(new I8($))}}class oK extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{width:"w:w",space:"w:space"})}}class tK extends o{constructor($){super("w:col");this.root.push(new oK({width:T0($.width),space:$.space===void 0?void 0:T0($.space)}))}}class r$ extends o{constructor(){super("w:body");Y0(this,"sections",[])}addSection($){let U=this.sections.pop();this.root.push(this.createSectionParagraph(U)),this.sections.push(new I8($))}prepForXml($){if(this.sections.length===1)this.root.splice(0,1),this.root.push(this.sections.pop());return super.prepForXml($)}push($){this.root.push($)}createSectionParagraph($){let U=new h0({}),Y=new Z2({});return Y.push($),U.addChildElement(Y),U}}class s$ extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{color:"w:color",themeColor:"w:themeColor",themeShade:"w:themeShade",themeTint:"w:themeTint"})}}class n$ extends o{constructor($){super("w:background");this.root.push(new s$({color:$.color===void 0?void 0:S2($.color),themeColor:$.themeColor,themeShade:$.themeShade===void 0?void 0:D9($.themeShade),themeTint:$.themeTint===void 0?void 0:D9($.themeTint)}))}}class eK extends o{constructor($){super("w:document");if(Y0(this,"body"),this.root.push(new o2(["wpc","mc","o","r","m","v","wp14","wp","w10","w","w14","w15","wpg","wpi","wne","wps","cx","cx1","cx2","cx3","cx4","cx5","cx6","cx7","cx8","aink","am3d","w16cex","w16cid","w16","w16sdtdh","w16se"],"w14 w15 wp14")),this.body=new r$,$.background)this.root.push(new n$($.background));this.root.push(this.body)}add($){return this.body.push($),this}get Body(){return this.body}}class $5{constructor($){Y0(this,"document"),Y0(this,"relationships"),this.document=new eK($),this.relationships=new W2}get View(){return this.document}get Relationships(){return this.relationships}}class U5 extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}}class Y5 extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{type:"w:type",id:"w:id"})}}class Z5 extends C0{constructor(){super({style:"EndnoteReference"});this.root.push(new I$)}}var fZ={SEPARATOR:"separator",CONTINUATION_SEPARATOR:"continuationSeparator"};class u1 extends o{constructor($){super("w:endnote");this.root.push(new Y5({type:$.type,id:$.id}));for(let U=0;U<$.children.length;U++){let Y=$.children[U];if(U===0)Y.addRunToFront(new Z5);this.root.push(Y)}}}class Q5 extends o{constructor(){super("w:continuationSeparator")}}class o$ extends C0{constructor(){super({});this.root.push(new Q5)}}class J5 extends o{constructor(){super("w:separator")}}class t$ extends C0{constructor(){super({});this.root.push(new J5)}}class e$ extends o{constructor(){super("w:endnotes");this.root.push(new U5({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"}));let $=new u1({id:-1,type:fZ.SEPARATOR,children:[new h0({spacing:{after:0,line:240,lineRule:v2.AUTO},children:[new t$]})]});this.root.push($);let U=new u1({id:0,type:fZ.CONTINUATION_SEPARATOR,children:[new h0({spacing:{after:0,line:240,lineRule:v2.AUTO},children:[new o$]})]});this.root.push(U)}createEndnote($,U){let Y=new u1({id:$,children:U});this.root.push(Y)}}class G5{constructor(){Y0(this,"endnotes"),Y0(this,"relationships"),this.endnotes=new e$,this.relationships=new W2}get View(){return this.endnotes}get Relationships(){return this.relationships}}class K5 extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",cp:"xmlns:cp",dc:"xmlns:dc",dcterms:"xmlns:dcterms",dcmitype:"xmlns:dcmitype",xsi:"xmlns:xsi",type:"xsi:type"})}}var cV=class extends Y8{constructor(U,Y){super("w:ftr",Y);if(Y0(this,"refId"),this.refId=U,!Y)this.root.push(new K5({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"}))}get ReferenceId(){return this.refId}add(U){this.root.push(U)}};class $U{constructor($,U,Y){Y0(this,"footer"),Y0(this,"relationships"),this.media=$,this.footer=new cV(U,Y),this.relationships=new W2}add($){this.footer.add($)}addChildElement($){this.footer.addChildElement($)}get View(){return this.footer}get Relationships(){return this.relationships}get Media(){return this.media}}class q5 extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{type:"w:type",id:"w:id"})}}class X5 extends o{constructor(){super("w:footnoteRef")}}class V5 extends C0{constructor(){super({style:"FootnoteReference"});this.root.push(new X5)}}var hZ={SEPERATOR:"separator",CONTINUATION_SEPERATOR:"continuationSeparator"};class d1 extends o{constructor($){super("w:footnote");this.root.push(new q5({type:$.type,id:$.id}));for(let U=0;U<$.children.length;U++){let Y=$.children[U];if(U===0)Y.addRunToFront(new V5);this.root.push(Y)}}}class B5 extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}}class UU extends o{constructor(){super("w:footnotes");this.root.push(new B5({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"}));let $=new d1({id:-1,type:hZ.SEPERATOR,children:[new h0({spacing:{after:0,line:240,lineRule:v2.AUTO},children:[new t$]})]});this.root.push($);let U=new d1({id:0,type:hZ.CONTINUATION_SEPERATOR,children:[new h0({spacing:{after:0,line:240,lineRule:v2.AUTO},children:[new o$]})]});this.root.push(U)}createFootNote($,U){let Y=new d1({id:$,children:U});this.root.push(Y)}}class L5{constructor(){Y0(this,"footnotess"),Y0(this,"relationships"),this.footnotess=new UU,this.relationships=new W2}get View(){return this.footnotess}get Relationships(){return this.relationships}}class M5 extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",cp:"xmlns:cp",dc:"xmlns:dc",dcterms:"xmlns:dcterms",dcmitype:"xmlns:dcmitype",xsi:"xmlns:xsi",type:"xsi:type",cx:"xmlns:cx",cx1:"xmlns:cx1",cx2:"xmlns:cx2",cx3:"xmlns:cx3",cx4:"xmlns:cx4",cx5:"xmlns:cx5",cx6:"xmlns:cx6",cx7:"xmlns:cx7",cx8:"xmlns:cx8",w16cid:"xmlns:w16cid",w16se:"xmlns:w16se"})}}var mV=class extends Y8{constructor(U,Y){super("w:hdr",Y);if(Y0(this,"refId"),this.refId=U,!Y)this.root.push(new M5({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",cx:"http://schemas.microsoft.com/office/drawing/2014/chartex",cx1:"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",cx2:"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex",cx3:"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex",cx4:"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex",cx5:"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex",cx6:"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex",cx7:"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex",cx8:"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex",w16cid:"http://schemas.microsoft.com/office/word/2016/wordml/cid",w16se:"http://schemas.microsoft.com/office/word/2015/wordml/symex"}))}get ReferenceId(){return this.refId}add(U){this.root.push(U)}};class YU{constructor($,U,Y){Y0(this,"header"),Y0(this,"relationships"),this.media=$,this.header=new mV(U,Y),this.relationships=new W2}add($){return this.header.add($),this}addChildElement($){this.header.addChildElement($)}get View(){return this.header}get Relationships(){return this.relationships}get Media(){return this.media}}class w8{constructor(){Y0(this,"map"),this.map=new Map}addImage($,U){this.map.set($,U)}get Array(){return Array.from(this.map.values())}}var lV="",n0={DECIMAL:"decimal",UPPER_ROMAN:"upperRoman",LOWER_ROMAN:"lowerRoman",UPPER_LETTER:"upperLetter",LOWER_LETTER:"lowerLetter",ORDINAL:"ordinal",CARDINAL_TEXT:"cardinalText",ORDINAL_TEXT:"ordinalText",HEX:"hex",CHICAGO:"chicago",IDEOGRAPH__DIGITAL:"ideographDigital",JAPANESE_COUNTING:"japaneseCounting",AIUEO:"aiueo",IROHA:"iroha",DECIMAL_FULL_WIDTH:"decimalFullWidth",DECIMAL_HALF_WIDTH:"decimalHalfWidth",JAPANESE_LEGAL:"japaneseLegal",JAPANESE_DIGITAL_TEN_THOUSAND:"japaneseDigitalTenThousand",DECIMAL_ENCLOSED_CIRCLE:"decimalEnclosedCircle",DECIMAL_FULL_WIDTH2:"decimalFullWidth2",AIUEO_FULL_WIDTH:"aiueoFullWidth",IROHA_FULL_WIDTH:"irohaFullWidth",DECIMAL_ZERO:"decimalZero",BULLET:"bullet",GANADA:"ganada",CHOSUNG:"chosung",DECIMAL_ENCLOSED_FULLSTOP:"decimalEnclosedFullstop",DECIMAL_ENCLOSED_PARENTHESES:"decimalEnclosedParen",DECIMAL_ENCLOSED_CIRCLE_CHINESE:"decimalEnclosedCircleChinese",IDEOGRAPH_ENCLOSED_CIRCLE:"ideographEnclosedCircle",IDEOGRAPH_TRADITIONAL:"ideographTraditional",IDEOGRAPH_ZODIAC:"ideographZodiac",IDEOGRAPH_ZODIAC_TRADITIONAL:"ideographZodiacTraditional",TAIWANESE_COUNTING:"taiwaneseCounting",IDEOGRAPH_LEGAL_TRADITIONAL:"ideographLegalTraditional",TAIWANESE_COUNTING_THOUSAND:"taiwaneseCountingThousand",TAIWANESE_DIGITAL:"taiwaneseDigital",CHINESE_COUNTING:"chineseCounting",CHINESE_LEGAL_SIMPLIFIED:"chineseLegalSimplified",CHINESE_COUNTING_THOUSAND:"chineseCountingThousand",KOREAN_DIGITAL:"koreanDigital",KOREAN_COUNTING:"koreanCounting",KOREAN_LEGAL:"koreanLegal",KOREAN_DIGITAL2:"koreanDigital2",VIETNAMESE_COUNTING:"vietnameseCounting",RUSSIAN_LOWER:"russianLower",RUSSIAN_UPPER:"russianUpper",NONE:"none",NUMBER_IN_DASH:"numberInDash",HEBREW1:"hebrew1",HEBREW2:"hebrew2",ARABIC_ALPHA:"arabicAlpha",ARABIC_ABJAD:"arabicAbjad",HINDI_VOWELS:"hindiVowels",HINDI_CONSONANTS:"hindiConsonants",HINDI_NUMBERS:"hindiNumbers",HINDI_COUNTING:"hindiCounting",THAI_LETTERS:"thaiLetters",THAI_NUMBERS:"thaiNumbers",THAI_COUNTING:"thaiCounting",BAHT_TEXT:"bahtText",DOLLAR_TEXT:"dollarText",CUSTOM:"custom"};class I5 extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{ilvl:"w:ilvl",tentative:"w15:tentative"})}}class w5 extends o{constructor($){super("w:numFmt");this.root.push(new O0({val:$}))}}class W5 extends o{constructor($){super("w:lvlText");this.root.push(new O0({val:$}))}}class H5 extends o{constructor($){super("w:lvlJc");this.root.push(new O0({val:$}))}}var aV={NOTHING:"nothing",SPACE:"space",TAB:"tab"};class j5 extends o{constructor($){super("w:suff");this.root.push(new O0({val:$}))}}class z5 extends o{constructor(){super("w:isLgl")}}class W8 extends o{constructor({level:$,format:U,text:Y,alignment:Z=m0.START,start:J=1,style:G,suffix:X,isLegalNumberingStyle:Q}){super("w:lvl");if(Y0(this,"paragraphProperties"),Y0(this,"runProperties"),this.root.push(new k2("w:start",S0(J))),U)this.root.push(new w5(U));if(X)this.root.push(new j5(X));if(Q)this.root.push(new z5);if(Y)this.root.push(new W5(Y));if(this.root.push(new H5(Z)),this.paragraphProperties=new Z2(G&&G.paragraph),this.runProperties=new J2(G&&G.run),this.root.push(this.paragraphProperties),this.root.push(this.runProperties),$>9)throw Error("Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7");this.root.push(new I5({ilvl:S0($),tentative:1}))}}class ZU extends W8{}class F5 extends W8{}class N5 extends o{constructor($){super("w:multiLevelType");this.root.push(new O0({val:$}))}}class R5 extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{abstractNumId:"w:abstractNumId",restartNumberingAfterBreak:"w15:restartNumberingAfterBreak"})}}class r1 extends o{constructor($,U){super("w:abstractNum");Y0(this,"id"),this.root.push(new R5({abstractNumId:S0($),restartNumberingAfterBreak:0})),this.root.push(new N5("hybridMultilevel")),this.id=$;for(let Y of U)this.root.push(new ZU(Y))}}class D5 extends o{constructor($){super("w:abstractNumId");this.root.push(new O0({val:$}))}}class A5 extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{numId:"w:numId"})}}class s1 extends o{constructor($){super("w:num");if(Y0(this,"numId"),Y0(this,"reference"),Y0(this,"instance"),this.numId=$.numId,this.reference=$.reference,this.instance=$.instance,this.root.push(new A5({numId:S0($.numId)})),this.root.push(new D5(S0($.abstractNumId))),$.overrideLevels&&$.overrideLevels.length)for(let U of $.overrideLevels)this.root.push(new QU(U.num,U.start))}}class P5 extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{ilvl:"w:ilvl"})}}class QU extends o{constructor($,U){super("w:lvlOverride");if(this.root.push(new P5({ilvl:$})),U!==void 0)this.root.push(new C5(U))}}class T5 extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{val:"w:val"})}}class C5 extends o{constructor($){super("w:startOverride");this.root.push(new T5({val:$}))}}class JU extends o{constructor($){super("w:numbering");Y0(this,"abstractNumberingMap",new Map),Y0(this,"concreteNumberingMap",new Map),Y0(this,"referenceConfigMap",new Map),Y0(this,"abstractNumUniqueNumericId",rQ()),Y0(this,"concreteNumUniqueNumericId",sQ()),this.root.push(new o2(["wpc","mc","o","r","m","v","wp14","wp","w10","w","w14","w15","wpg","wpi","wne","wps"],"w14 w15 wp14"));let U=new r1(this.abstractNumUniqueNumericId(),[{level:0,format:n0.BULLET,text:"●",alignment:m0.LEFT,style:{paragraph:{indent:{left:d0(0.5),hanging:d0(0.25)}}}},{level:1,format:n0.BULLET,text:"○",alignment:m0.LEFT,style:{paragraph:{indent:{left:d0(1),hanging:d0(0.25)}}}},{level:2,format:n0.BULLET,text:"■",alignment:m0.LEFT,style:{paragraph:{indent:{left:2160,hanging:d0(0.25)}}}},{level:3,format:n0.BULLET,text:"●",alignment:m0.LEFT,style:{paragraph:{indent:{left:2880,hanging:d0(0.25)}}}},{level:4,format:n0.BULLET,text:"○",alignment:m0.LEFT,style:{paragraph:{indent:{left:3600,hanging:d0(0.25)}}}},{level:5,format:n0.BULLET,text:"■",alignment:m0.LEFT,style:{paragraph:{indent:{left:4320,hanging:d0(0.25)}}}},{level:6,format:n0.BULLET,text:"●",alignment:m0.LEFT,style:{paragraph:{indent:{left:5040,hanging:d0(0.25)}}}},{level:7,format:n0.BULLET,text:"●",alignment:m0.LEFT,style:{paragraph:{indent:{left:5760,hanging:d0(0.25)}}}},{level:8,format:n0.BULLET,text:"●",alignment:m0.LEFT,style:{paragraph:{indent:{left:6480,hanging:d0(0.25)}}}}]);this.concreteNumberingMap.set("default-bullet-numbering",new s1({numId:1,abstractNumId:U.id,reference:"default-bullet-numbering",instance:0,overrideLevels:[{num:0,start:1}]})),this.abstractNumberingMap.set("default-bullet-numbering",U);for(let Y of $.config)this.abstractNumberingMap.set(Y.reference,new r1(this.abstractNumUniqueNumericId(),Y.levels)),this.referenceConfigMap.set(Y.reference,Y.levels)}prepForXml($){for(let U of this.abstractNumberingMap.values())this.root.push(U);for(let U of this.concreteNumberingMap.values())this.root.push(U);return super.prepForXml($)}createConcreteNumberingInstance($,U){let Y=this.abstractNumberingMap.get($);if(!Y)return;let Z=`${$}-${U}`;if(this.concreteNumberingMap.has(Z))return;let J=this.referenceConfigMap.get($),G=J&&J[0].start,X={numId:this.concreteNumUniqueNumericId(),abstractNumId:Y.id,reference:$,instance:U,overrideLevels:[typeof G==="number"&&Number.isInteger(G)?{num:0,start:G}:{num:0,start:1}]};this.concreteNumberingMap.set(Z,new s1(X))}get ConcreteNumbering(){return Array.from(this.concreteNumberingMap.values())}get ReferenceConfig(){return Array.from(this.referenceConfigMap.values())}}var pV=($)=>new B0({name:"w:compatSetting",attributes:{version:{key:"w:val",value:$},name:{key:"w:name",value:"compatibilityMode"},uri:{key:"w:uri",value:"http://schemas.microsoft.com/office/word"}}});class O5 extends o{constructor($){super("w:compat");if($.version)this.root.push(pV($.version));if($.useSingleBorderforContiguousCells)this.root.push(new X0("w:useSingleBorderforContiguousCells",$.useSingleBorderforContiguousCells));if($.wordPerfectJustification)this.root.push(new X0("w:wpJustification",$.wordPerfectJustification));if($.noTabStopForHangingIndent)this.root.push(new X0("w:noTabHangInd",$.noTabStopForHangingIndent));if($.noLeading)this.root.push(new X0("w:noLeading",$.noLeading));if($.spaceForUnderline)this.root.push(new X0("w:spaceForUL",$.spaceForUnderline));if($.noColumnBalance)this.root.push(new X0("w:noColumnBalance",$.noColumnBalance));if($.balanceSingleByteDoubleByteWidth)this.root.push(new X0("w:balanceSingleByteDoubleByteWidth",$.balanceSingleByteDoubleByteWidth));if($.noExtraLineSpacing)this.root.push(new X0("w:noExtraLineSpacing",$.noExtraLineSpacing));if($.doNotLeaveBackslashAlone)this.root.push(new X0("w:doNotLeaveBackslashAlone",$.doNotLeaveBackslashAlone));if($.underlineTrailingSpaces)this.root.push(new X0("w:ulTrailSpace",$.underlineTrailingSpaces));if($.doNotExpandShiftReturn)this.root.push(new X0("w:doNotExpandShiftReturn",$.doNotExpandShiftReturn));if($.spacingInWholePoints)this.root.push(new X0("w:spacingInWholePoints",$.spacingInWholePoints));if($.lineWrapLikeWord6)this.root.push(new X0("w:lineWrapLikeWord6",$.lineWrapLikeWord6));if($.printBodyTextBeforeHeader)this.root.push(new X0("w:printBodyTextBeforeHeader",$.printBodyTextBeforeHeader));if($.printColorsBlack)this.root.push(new X0("w:printColBlack",$.printColorsBlack));if($.spaceWidth)this.root.push(new X0("w:wpSpaceWidth",$.spaceWidth));if($.showBreaksInFrames)this.root.push(new X0("w:showBreaksInFrames",$.showBreaksInFrames));if($.subFontBySize)this.root.push(new X0("w:subFontBySize",$.subFontBySize));if($.suppressBottomSpacing)this.root.push(new X0("w:suppressBottomSpacing",$.suppressBottomSpacing));if($.suppressTopSpacing)this.root.push(new X0("w:suppressTopSpacing",$.suppressTopSpacing));if($.suppressSpacingAtTopOfPage)this.root.push(new X0("w:suppressSpacingAtTopOfPage",$.suppressSpacingAtTopOfPage));if($.suppressTopSpacingWP)this.root.push(new X0("w:suppressTopSpacingWP",$.suppressTopSpacingWP));if($.suppressSpBfAfterPgBrk)this.root.push(new X0("w:suppressSpBfAfterPgBrk",$.suppressSpBfAfterPgBrk));if($.swapBordersFacingPages)this.root.push(new X0("w:swapBordersFacingPages",$.swapBordersFacingPages));if($.convertMailMergeEsc)this.root.push(new X0("w:convMailMergeEsc",$.convertMailMergeEsc));if($.truncateFontHeightsLikeWP6)this.root.push(new X0("w:truncateFontHeightsLikeWP6",$.truncateFontHeightsLikeWP6));if($.macWordSmallCaps)this.root.push(new X0("w:mwSmallCaps",$.macWordSmallCaps));if($.usePrinterMetrics)this.root.push(new X0("w:usePrinterMetrics",$.usePrinterMetrics));if($.doNotSuppressParagraphBorders)this.root.push(new X0("w:doNotSuppressParagraphBorders",$.doNotSuppressParagraphBorders));if($.wrapTrailSpaces)this.root.push(new X0("w:wrapTrailSpaces",$.wrapTrailSpaces));if($.footnoteLayoutLikeWW8)this.root.push(new X0("w:footnoteLayoutLikeWW8",$.footnoteLayoutLikeWW8));if($.shapeLayoutLikeWW8)this.root.push(new X0("w:shapeLayoutLikeWW8",$.shapeLayoutLikeWW8));if($.alignTablesRowByRow)this.root.push(new X0("w:alignTablesRowByRow",$.alignTablesRowByRow));if($.forgetLastTabAlignment)this.root.push(new X0("w:forgetLastTabAlignment",$.forgetLastTabAlignment));if($.adjustLineHeightInTable)this.root.push(new X0("w:adjustLineHeightInTable",$.adjustLineHeightInTable));if($.autoSpaceLikeWord95)this.root.push(new X0("w:autoSpaceLikeWord95",$.autoSpaceLikeWord95));if($.noSpaceRaiseLower)this.root.push(new X0("w:noSpaceRaiseLower",$.noSpaceRaiseLower));if($.doNotUseHTMLParagraphAutoSpacing)this.root.push(new X0("w:doNotUseHTMLParagraphAutoSpacing",$.doNotUseHTMLParagraphAutoSpacing));if($.layoutRawTableWidth)this.root.push(new X0("w:layoutRawTableWidth",$.layoutRawTableWidth));if($.layoutTableRowsApart)this.root.push(new X0("w:layoutTableRowsApart",$.layoutTableRowsApart));if($.useWord97LineBreakRules)this.root.push(new X0("w:useWord97LineBreakRules",$.useWord97LineBreakRules));if($.doNotBreakWrappedTables)this.root.push(new X0("w:doNotBreakWrappedTables",$.doNotBreakWrappedTables));if($.doNotSnapToGridInCell)this.root.push(new X0("w:doNotSnapToGridInCell",$.doNotSnapToGridInCell));if($.selectFieldWithFirstOrLastCharacter)this.root.push(new X0("w:selectFldWithFirstOrLastChar",$.selectFieldWithFirstOrLastCharacter));if($.applyBreakingRules)this.root.push(new X0("w:applyBreakingRules",$.applyBreakingRules));if($.doNotWrapTextWithPunctuation)this.root.push(new X0("w:doNotWrapTextWithPunct",$.doNotWrapTextWithPunctuation));if($.doNotUseEastAsianBreakRules)this.root.push(new X0("w:doNotUseEastAsianBreakRules",$.doNotUseEastAsianBreakRules));if($.useWord2002TableStyleRules)this.root.push(new X0("w:useWord2002TableStyleRules",$.useWord2002TableStyleRules));if($.growAutofit)this.root.push(new X0("w:growAutofit",$.growAutofit));if($.useFELayout)this.root.push(new X0("w:useFELayout",$.useFELayout));if($.useNormalStyleForList)this.root.push(new X0("w:useNormalStyleForList",$.useNormalStyleForList));if($.doNotUseIndentAsNumberingTabStop)this.root.push(new X0("w:doNotUseIndentAsNumberingTabStop",$.doNotUseIndentAsNumberingTabStop));if($.useAlternateEastAsianLineBreakRules)this.root.push(new X0("w:useAltKinsokuLineBreakRules",$.useAlternateEastAsianLineBreakRules));if($.allowSpaceOfSameStyleInTable)this.root.push(new X0("w:allowSpaceOfSameStyleInTable",$.allowSpaceOfSameStyleInTable));if($.doNotSuppressIndentation)this.root.push(new X0("w:doNotSuppressIndentation",$.doNotSuppressIndentation));if($.doNotAutofitConstrainedTables)this.root.push(new X0("w:doNotAutofitConstrainedTables",$.doNotAutofitConstrainedTables));if($.autofitToFirstFixedWidthCell)this.root.push(new X0("w:autofitToFirstFixedWidthCell",$.autofitToFirstFixedWidthCell));if($.underlineTabInNumberingList)this.root.push(new X0("w:underlineTabInNumList",$.underlineTabInNumberingList));if($.displayHangulFixedWidth)this.root.push(new X0("w:displayHangulFixedWidth",$.displayHangulFixedWidth));if($.splitPgBreakAndParaMark)this.root.push(new X0("w:splitPgBreakAndParaMark",$.splitPgBreakAndParaMark));if($.doNotVerticallyAlignCellWithSp)this.root.push(new X0("w:doNotVertAlignCellWithSp",$.doNotVerticallyAlignCellWithSp));if($.doNotBreakConstrainedForcedTable)this.root.push(new X0("w:doNotBreakConstrainedForcedTable",$.doNotBreakConstrainedForcedTable));if($.ignoreVerticalAlignmentInTextboxes)this.root.push(new X0("w:doNotVertAlignInTxbx",$.ignoreVerticalAlignmentInTextboxes));if($.useAnsiKerningPairs)this.root.push(new X0("w:useAnsiKerningPairs",$.useAnsiKerningPairs));if($.cachedColumnBalance)this.root.push(new X0("w:cachedColBalance",$.cachedColumnBalance))}}class k5 extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}}class E5 extends o{constructor($){var U,Y,Z,J,G,X,Q,B;super("w:settings");if(this.root.push(new k5({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"})),this.root.push(new X0("w:displayBackgroundShape",!0)),$.trackRevisions!==void 0)this.root.push(new X0("w:trackRevisions",$.trackRevisions));if($.evenAndOddHeaders!==void 0)this.root.push(new X0("w:evenAndOddHeaders",$.evenAndOddHeaders));if($.updateFields!==void 0)this.root.push(new X0("w:updateFields",$.updateFields));if($.defaultTabStop!==void 0)this.root.push(new k2("w:defaultTabStop",$.defaultTabStop));if(((U=$.hyphenation)==null?void 0:U.autoHyphenation)!==void 0)this.root.push(new X0("w:autoHyphenation",$.hyphenation.autoHyphenation));if(((Y=$.hyphenation)==null?void 0:Y.hyphenationZone)!==void 0)this.root.push(new k2("w:hyphenationZone",$.hyphenation.hyphenationZone));if(((Z=$.hyphenation)==null?void 0:Z.consecutiveHyphenLimit)!==void 0)this.root.push(new k2("w:consecutiveHyphenLimit",$.hyphenation.consecutiveHyphenLimit));if(((J=$.hyphenation)==null?void 0:J.doNotHyphenateCaps)!==void 0)this.root.push(new X0("w:doNotHyphenateCaps",$.hyphenation.doNotHyphenateCaps));this.root.push(new O5(R0(W0({},(G=$.compatibility)!=null?G:{}),{version:(B=(Q=(X=$.compatibility)==null?void 0:X.version)!=null?Q:$.compatibilityModeVersion)!=null?B:15})))}}class GU extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{val:"w:val"})}}class S5 extends o{constructor($){super("w:name");this.root.push(new GU({val:$}))}}class v5 extends o{constructor($){super("w:uiPriority");this.root.push(new GU({val:S0($)}))}}class _5 extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{type:"w:type",styleId:"w:styleId",default:"w:default",customStyle:"w:customStyle"})}}class KU extends o{constructor($,U){super("w:style");if(this.root.push(new _5($)),U.name)this.root.push(new S5(U.name));if(U.basedOn)this.root.push(new Y2("w:basedOn",U.basedOn));if(U.next)this.root.push(new Y2("w:next",U.next));if(U.link)this.root.push(new Y2("w:link",U.link));if(U.uiPriority!==void 0)this.root.push(new v5(U.uiPriority));if(U.semiHidden!==void 0)this.root.push(new X0("w:semiHidden",U.semiHidden));if(U.unhideWhenUsed!==void 0)this.root.push(new X0("w:unhideWhenUsed",U.unhideWhenUsed));if(U.quickFormat!==void 0)this.root.push(new X0("w:qFormat",U.quickFormat))}}class y2 extends KU{constructor($){super({type:"paragraph",styleId:$.id},$);Y0(this,"paragraphProperties"),Y0(this,"runProperties"),this.paragraphProperties=new Z2($.paragraph),this.runProperties=new J2($.run),this.root.push(this.paragraphProperties),this.root.push(this.runProperties)}}class D2 extends KU{constructor($){super({type:"character",styleId:$.id},W0({uiPriority:99,unhideWhenUsed:!0},$));Y0(this,"runProperties"),this.runProperties=new J2($.run),this.root.push(this.runProperties)}}class H2 extends y2{constructor($){super(W0({basedOn:"Normal",next:"Normal",quickFormat:!0},$))}}class y5 extends H2{constructor($){super(W0({id:"Title",name:"Title"},$))}}class b5 extends H2{constructor($){super(W0({id:"Heading1",name:"Heading 1"},$))}}class g5 extends H2{constructor($){super(W0({id:"Heading2",name:"Heading 2"},$))}}class x5 extends H2{constructor($){super(W0({id:"Heading3",name:"Heading 3"},$))}}class f5 extends H2{constructor($){super(W0({id:"Heading4",name:"Heading 4"},$))}}class h5 extends H2{constructor($){super(W0({id:"Heading5",name:"Heading 5"},$))}}class u5 extends H2{constructor($){super(W0({id:"Heading6",name:"Heading 6"},$))}}class d5 extends H2{constructor($){super(W0({id:"Strong",name:"Strong"},$))}}class c5 extends y2{constructor($){super(W0({id:"ListParagraph",name:"List Paragraph",basedOn:"Normal",quickFormat:!0},$))}}class m5 extends y2{constructor($){super(W0({id:"FootnoteText",name:"footnote text",link:"FootnoteTextChar",basedOn:"Normal",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0,paragraph:{spacing:{after:0,line:240,lineRule:v2.AUTO}},run:{size:20}},$))}}class l5 extends D2{constructor($){super(W0({id:"FootnoteReference",name:"footnote reference",basedOn:"DefaultParagraphFont",semiHidden:!0,run:{superScript:!0}},$))}}class a5 extends D2{constructor($){super(W0({id:"FootnoteTextChar",name:"Footnote Text Char",basedOn:"DefaultParagraphFont",link:"FootnoteText",semiHidden:!0,run:{size:20}},$))}}class p5 extends y2{constructor($){super(W0({id:"EndnoteText",name:"endnote text",link:"EndnoteTextChar",basedOn:"Normal",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0,paragraph:{spacing:{after:0,line:240,lineRule:v2.AUTO}},run:{size:20}},$))}}class i5 extends D2{constructor($){super(W0({id:"EndnoteReference",name:"endnote reference",basedOn:"DefaultParagraphFont",semiHidden:!0,run:{superScript:!0}},$))}}class r5 extends D2{constructor($){super(W0({id:"EndnoteTextChar",name:"Endnote Text Char",basedOn:"DefaultParagraphFont",link:"EndnoteText",semiHidden:!0,run:{size:20}},$))}}class s5 extends D2{constructor($){super(W0({id:"Hyperlink",name:"Hyperlink",basedOn:"DefaultParagraphFont",run:{color:"0563C1",underline:{type:Z$.SINGLE}}},$))}}class B1 extends o{constructor($){super("w:styles");if($.initialStyles)this.root.push($.initialStyles);if($.importedStyles)for(let U of $.importedStyles)this.root.push(U);if($.paragraphStyles)for(let U of $.paragraphStyles)this.root.push(new y2(U));if($.characterStyles)for(let U of $.characterStyles)this.root.push(new D2(U))}}class qU extends o{constructor($){super("w:pPrDefault");this.root.push(new Z2($))}}class XU extends o{constructor($){super("w:rPrDefault");this.root.push(new J2($))}}class VU extends o{constructor($){super("w:docDefaults");Y0(this,"runPropertiesDefaults"),Y0(this,"paragraphPropertiesDefaults"),this.runPropertiesDefaults=new XU($.run),this.paragraphPropertiesDefaults=new qU($.paragraph),this.root.push(this.runPropertiesDefaults),this.root.push(this.paragraphPropertiesDefaults)}}class n5{newInstance($){let U=$8.xml2js($,{compact:!1}),Y;for(let J of U.elements||[])if(J.name==="w:styles")Y=J;if(Y===void 0)throw Error("can not find styles element");let Z=Y.elements||[];return{initialStyles:new i9(Y.attributes),importedStyles:Z.map((J)=>U8(J))}}}class c1{newInstance($={}){var U;return{initialStyles:new o2(["mc","r","w","w14","w15"],"w14 w15"),importedStyles:[new VU((U=$.document)!=null?U:{}),new y5(W0({run:{size:56}},$.title)),new b5(W0({run:{color:"2E74B5",size:32}},$.heading1)),new g5(W0({run:{color:"2E74B5",size:26}},$.heading2)),new x5(W0({run:{color:"1F4D78",size:24}},$.heading3)),new f5(W0({run:{color:"2E74B5",italics:!0}},$.heading4)),new h5(W0({run:{color:"2E74B5"}},$.heading5)),new u5(W0({run:{color:"1F4D78"}},$.heading6)),new d5(W0({run:{bold:!0}},$.strong)),new c5($.listParagraph||{}),new s5($.hyperlink||{}),new l5($.footnoteReference||{}),new m5($.footnoteText||{}),new a5($.footnoteTextChar||{}),new i5($.endnoteReference||{}),new p5($.endnoteText||{}),new r5($.endnoteTextChar||{})]}}}class o5{constructor($){Y0(this,"currentRelationshipId",1),Y0(this,"documentWrapper"),Y0(this,"headers",[]),Y0(this,"footers",[]),Y0(this,"coreProperties"),Y0(this,"numbering"),Y0(this,"media"),Y0(this,"fileRelationships"),Y0(this,"footnotesWrapper"),Y0(this,"endnotesWrapper"),Y0(this,"settings"),Y0(this,"contentTypes"),Y0(this,"customProperties"),Y0(this,"appProperties"),Y0(this,"styles"),Y0(this,"comments"),Y0(this,"fontWrapper");var U,Y,Z,J,G,X,Q,B,F,z,W,k,D;if(this.coreProperties=new gK(R0(W0({},$),{creator:(U=$.creator)!=null?U:"Un-named",revision:(Y=$.revision)!=null?Y:1,lastModifiedBy:(Z=$.lastModifiedBy)!=null?Z:"Un-named"})),this.numbering=new JU($.numbering?$.numbering:{config:[]}),this.comments=new M$((J=$.comments)!=null?J:{children:[]}),this.fileRelationships=new W2,this.customProperties=new cK((G=$.customProperties)!=null?G:[]),this.appProperties=new _K,this.footnotesWrapper=new L5,this.endnotesWrapper=new G5,this.contentTypes=new bK,this.documentWrapper=new $5({background:$.background}),this.settings=new E5({compatibilityModeVersion:$.compatabilityModeVersion,compatibility:$.compatibility,evenAndOddHeaders:$.evenAndOddHeaderAndFooters?!0:!1,trackRevisions:(X=$.features)==null?void 0:X.trackRevisions,updateFields:(Q=$.features)==null?void 0:Q.updateFields,defaultTabStop:$.defaultTabStop,hyphenation:{autoHyphenation:(B=$.hyphenation)==null?void 0:B.autoHyphenation,hyphenationZone:(F=$.hyphenation)==null?void 0:F.hyphenationZone,consecutiveHyphenLimit:(z=$.hyphenation)==null?void 0:z.consecutiveHyphenLimit,doNotHyphenateCaps:(W=$.hyphenation)==null?void 0:W.doNotHyphenateCaps}}),this.media=new w8,$.externalStyles!==void 0){let H=new c1().newInstance((k=$.styles)==null?void 0:k.default),V=new n5().newInstance($.externalStyles);this.styles=new B1(R0(W0({},V),{importedStyles:[...H.importedStyles,...V.importedStyles]}))}else if($.styles){let H=new c1().newInstance($.styles.default);this.styles=new B1(W0(W0({},H),$.styles))}else{let C=new c1;this.styles=new B1(C.newInstance())}this.addDefaultRelationships();for(let C of $.sections)this.addSection(C);if($.footnotes)for(let C in $.footnotes)this.footnotesWrapper.View.createFootNote(parseFloat(C),$.footnotes[C].children);if($.endnotes)for(let C in $.endnotes)this.endnotesWrapper.View.createEndnote(parseFloat(C),$.endnotes[C].children);this.fontWrapper=new R$((D=$.fonts)!=null?D:[])}addSection({headers:$={},footers:U={},children:Y,properties:Z}){this.documentWrapper.View.Body.addSection(R0(W0({},Z),{headerWrapperGroup:{default:$.default?this.createHeader($.default):void 0,first:$.first?this.createHeader($.first):void 0,even:$.even?this.createHeader($.even):void 0},footerWrapperGroup:{default:U.default?this.createFooter(U.default):void 0,first:U.first?this.createFooter(U.first):void 0,even:U.even?this.createFooter(U.even):void 0}}));for(let J of Y)this.documentWrapper.View.add(J)}createHeader($){let U=new YU(this.media,this.currentRelationshipId++);for(let Y of $.options.children)U.add(Y);return this.addHeaderToDocument(U),U}createFooter($){let U=new $U(this.media,this.currentRelationshipId++);for(let Y of $.options.children)U.add(Y);return this.addFooterToDocument(U),U}addHeaderToDocument($,U=E2.DEFAULT){this.headers.push({header:$,type:U}),this.documentWrapper.Relationships.addRelationship($.View.ReferenceId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",`header${this.headers.length}.xml`),this.contentTypes.addHeader(this.headers.length)}addFooterToDocument($,U=E2.DEFAULT){this.footers.push({footer:$,type:U}),this.documentWrapper.Relationships.addRelationship($.View.ReferenceId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",`footer${this.footers.length}.xml`),this.contentTypes.addFooter(this.footers.length)}addDefaultRelationships(){this.fileRelationships.addRelationship(1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument","word/document.xml"),this.fileRelationships.addRelationship(2,"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties","docProps/core.xml"),this.fileRelationships.addRelationship(3,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties","docProps/app.xml"),this.fileRelationships.addRelationship(4,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties","docProps/custom.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles","styles.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering","numbering.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes","footnotes.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes","endnotes.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings","settings.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments","comments.xml")}get Document(){return this.documentWrapper}get Styles(){return this.styles}get CoreProperties(){return this.coreProperties}get Numbering(){return this.numbering}get Media(){return this.media}get FileRelationships(){return this.fileRelationships}get Headers(){return this.headers.map(($)=>$.header)}get Footers(){return this.footers.map(($)=>$.footer)}get ContentTypes(){return this.contentTypes}get CustomProperties(){return this.customProperties}get AppProperties(){return this.appProperties}get FootNotes(){return this.footnotesWrapper}get Endnotes(){return this.endnotesWrapper}get Settings(){return this.settings}get Comments(){return this.comments}get FontTable(){return this.fontWrapper}}class t5 extends o{constructor($={}){super("w:instrText");Y0(this,"properties"),this.properties=$,this.root.push(new x0({space:g0.PRESERVE}));let U="TOC";if(this.properties.captionLabel)U=`${U} \\a "${this.properties.captionLabel}"`;if(this.properties.entriesFromBookmark)U=`${U} \\b "${this.properties.entriesFromBookmark}"`;if(this.properties.captionLabelIncludingNumbers)U=`${U} \\c "${this.properties.captionLabelIncludingNumbers}"`;if(this.properties.sequenceAndPageNumbersSeparator)U=`${U} \\d "${this.properties.sequenceAndPageNumbersSeparator}"`;if(this.properties.tcFieldIdentifier)U=`${U} \\f "${this.properties.tcFieldIdentifier}"`;if(this.properties.hyperlink)U=`${U} \\h`;if(this.properties.tcFieldLevelRange)U=`${U} \\l "${this.properties.tcFieldLevelRange}"`;if(this.properties.pageNumbersEntryLevelsRange)U=`${U} \\n "${this.properties.pageNumbersEntryLevelsRange}"`;if(this.properties.headingStyleRange)U=`${U} \\o "${this.properties.headingStyleRange}"`;if(this.properties.entryAndPageNumberSeparator)U=`${U} \\p "${this.properties.entryAndPageNumberSeparator}"`;if(this.properties.seqFieldIdentifierForPrefix)U=`${U} \\s "${this.properties.seqFieldIdentifierForPrefix}"`;if(this.properties.stylesWithLevels&&this.properties.stylesWithLevels.length){let Y=this.properties.stylesWithLevels.map((Z)=>`${Z.styleName},${Z.level}`).join(",");U=`${U} \\t "${Y}"`}if(this.properties.useAppliedParagraphOutlineLevel)U=`${U} \\u`;if(this.properties.preserveTabInEntries)U=`${U} \\w`;if(this.properties.preserveNewLineInEntries)U=`${U} \\x`;if(this.properties.hideTabAndPageNumbersInWebView)U=`${U} \\z`;this.root.push(U)}}class BU extends o{constructor(){super("w:sdtContent")}}class LU extends o{constructor($){super("w:sdtPr");if($)this.root.push(new Y2("w:alias",$))}}class e5 extends r2{constructor($="Table of Contents",U={}){var Y=U,{contentChildren:Z=[],cachedEntries:J=[],beginDirty:G=!0}=Y,X=oZ(Y,["contentChildren","cachedEntries","beginDirty"]);super("w:sdt");this.root.push(new LU($));let Q=new BU,B=[new C0({children:[$2(G),new t5(X),I2()]})],F=[new C0({children:[U2()]})];if(J!==void 0&&J.length>0){let{stylesWithLevels:W}=X,k=J.map((C,H)=>{var O,V;let j=this.buildCachedContentParagraphChild(C,X),M=(V=(O=W==null?void 0:W.find((A)=>A.level===C.level))==null?void 0:O.styleName)!=null?V:`TOC${C.level}`,L=H===0?[...B,j]:H===J.length-1?[j,...F]:[j];return new h0({style:M,tabStops:this.getTabStopsForLevel(C.level),children:L})}),D=k;if(J.length<=1)D=[...k,new h0({children:F})];for(let C of D)Q.addChildElement(C)}else{let W=new h0({children:B});Q.addChildElement(W);for(let D of Z)Q.addChildElement(D);let k=new h0({children:F});Q.addChildElement(k)}this.root.push(Q)}getTabStopsForLevel($,U=9025){return[{type:"clear",position:U+1-($-1)*240},{type:"right",position:U,leader:"dot"}]}buildCachedContentRun($,U){var Y,Z;return new C0({style:(U==null?void 0:U.hyperlink)&&$.href!==void 0?"IndexLink":void 0,children:[new a2({text:$.title}),new w$,new a2({text:(Z=(Y=$.page)==null?void 0:Y.toString())!=null?Z:""})]})}buildCachedContentParagraphChild($,U){let Y=this.buildCachedContentRun($,U);if((U==null?void 0:U.hyperlink)&&$.href!==void 0)return new j$({anchor:$.href,children:[Y]});return Y}}class $7{constructor($,U){Y0(this,"styleName"),Y0(this,"level"),this.styleName=$,this.level=U}}class U7{constructor($={children:[]}){Y0(this,"options"),this.options=$}}class Y7{constructor($={children:[]}){Y0(this,"options"),this.options=$}}class MU extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{id:"w:id"})}}class IU extends o{constructor($){super("w:footnoteReference");this.root.push(new MU({id:$}))}}class Z7 extends C0{constructor($){super({style:"FootnoteReference"});this.root.push(new IU($))}}class wU extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{id:"w:id"})}}class WU extends o{constructor($){super("w:endnoteReference");this.root.push(new wU({id:$}))}}class Q7 extends C0{constructor($){super({style:"EndnoteReference"});this.root.push(new WU($))}}class _9 extends I0{constructor(){super(...arguments);Y0(this,"xmlKeys",{val:"w14:val",symbolfont:"w14:font"})}}class L1 extends o{constructor($,U,Y){super($);if(Y)this.root.push(new _9({val:DQ(U),symbolfont:Y}));else this.root.push(new _9({val:U}))}}class HU extends o{constructor($){var U,Y,Z,J,G,X,Q,B;super("w14:checkbox");Y0(this,"DEFAULT_UNCHECKED_SYMBOL","2610"),Y0(this,"DEFAULT_CHECKED_SYMBOL","2612"),Y0(this,"DEFAULT_FONT","MS Gothic");let F=($==null?void 0:$.checked)?"1":"0",z,W;this.root.push(new L1("w14:checked",F)),z=((U=$==null?void 0:$.checkedState)==null?void 0:U.value)?(Y=$==null?void 0:$.checkedState)==null?void 0:Y.value:this.DEFAULT_CHECKED_SYMBOL,W=((Z=$==null?void 0:$.checkedState)==null?void 0:Z.font)?(J=$==null?void 0:$.checkedState)==null?void 0:J.font:this.DEFAULT_FONT,this.root.push(new L1("w14:checkedState",z,W)),z=((G=$==null?void 0:$.uncheckedState)==null?void 0:G.value)?(X=$==null?void 0:$.uncheckedState)==null?void 0:X.value:this.DEFAULT_UNCHECKED_SYMBOL,W=((Q=$==null?void 0:$.uncheckedState)==null?void 0:Q.font)?(B=$==null?void 0:$.uncheckedState)==null?void 0:B.font:this.DEFAULT_FONT,this.root.push(new L1("w14:uncheckedState",z,W))}}class J7 extends o{constructor($){var U,Y,Z,J;super("w:sdt");Y0(this,"DEFAULT_UNCHECKED_SYMBOL","2610"),Y0(this,"DEFAULT_CHECKED_SYMBOL","2612"),Y0(this,"DEFAULT_FONT","MS Gothic");let G=new LU($==null?void 0:$.alias);G.addChildElement(new HU($)),this.root.push(G);let X=new BU,Q=(U=$==null?void 0:$.checkedState)==null?void 0:U.font,B=(Y=$==null?void 0:$.checkedState)==null?void 0:Y.value,F=(Z=$==null?void 0:$.uncheckedState)==null?void 0:Z.font,z=(J=$==null?void 0:$.uncheckedState)==null?void 0:J.value,W,k;if($==null?void 0:$.checked)W=Q?Q:this.DEFAULT_FONT,k=B?B:this.DEFAULT_CHECKED_SYMBOL;else W=F?F:this.DEFAULT_FONT,k=z?z:this.DEFAULT_UNCHECKED_SYMBOL;let D=new G$({char:k,symbolfont:W});X.addChildElement(D),this.root.push(X)}}var iV=({shape:$})=>new B0({name:"w:pict",children:[$]}),rV=({children:$=[]})=>new B0({name:"w:txbxContent",children:$}),sV=({style:$,children:U,inset:Y})=>new B0({name:"v:textbox",attributes:{style:{key:"style",value:$},insetMode:{key:"insetmode",value:Y?"custom":"auto"},inset:{key:"inset",value:Y?`${Y.left}, ${Y.top}, ${Y.right}, ${Y.bottom}`:void 0}},children:[rV({children:U})]}),nV="#_x0000_t202",oV={flip:"flip",height:"height",left:"left",marginBottom:"margin-bottom",marginLeft:"margin-left",marginRight:"margin-right",marginTop:"margin-top",positionHorizontal:"mso-position-horizontal",positionHorizontalRelative:"mso-position-horizontal-relative",positionVertical:"mso-position-vertical",positionVerticalRelative:"mso-position-vertical-relative",wrapDistanceBottom:"mso-wrap-distance-bottom",wrapDistanceLeft:"mso-wrap-distance-left",wrapDistanceRight:"mso-wrap-distance-right",wrapDistanceTop:"mso-wrap-distance-top",wrapEdited:"mso-wrap-edited",wrapStyle:"mso-wrap-style",position:"position",rotation:"rotation",top:"top",visibility:"visibility",width:"width",zIndex:"z-index"},tV=($)=>$?Object.entries($).map(([U,Y])=>`${oV[U]}:${Y}`).join(";"):void 0,eV=({id:$,children:U,type:Y=nV,style:Z})=>new B0({name:"v:shape",attributes:{id:{key:"id",value:$},type:{key:"type",value:Y},style:{key:"style",value:tV(Z)}},children:[sV({style:"mso-fit-shape-to-text:t;",children:U})]});class G7 extends r2{constructor($){var U=$,{style:Y,children:Z}=U,J=oZ(U,["style","children"]);super("w:p");this.root.push(new Z2(J)),this.root.push(iV({shape:eV({children:Z,id:R1(),style:Y})}))}}var $B=m9();function y1($){throw Error('Could not dynamically require "'+$+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var I9={exports:{}},uZ;function UB(){if(uZ)return I9.exports;return uZ=1,function($,U){(function(Y){$.exports=Y()})(function(){return function Y(Z,J,G){function X(F,z){if(!J[F]){if(!Z[F]){var W=typeof y1=="function"&&y1;if(!z&&W)return W(F,!0);if(Q)return Q(F,!0);var k=Error("Cannot find module '"+F+"'");throw k.code="MODULE_NOT_FOUND",k}var D=J[F]={exports:{}};Z[F][0].call(D.exports,function(C){var H=Z[F][1][C];return X(H||C)},D,D.exports,Y,Z,J,G)}return J[F].exports}for(var Q=typeof y1=="function"&&y1,B=0;B>2,D=(3&F)<<4|z>>4,C=1>6:64,H=2>4,z=(15&k)<<4|(D=Q.indexOf(B.charAt(H++)))>>2,W=(3&D)<<6|(C=Q.indexOf(B.charAt(H++))),j[O++]=F,D!==64&&(j[O++]=z),C!==64&&(j[O++]=W);return j}},{"./support":30,"./utils":32}],2:[function(Y,Z,J){var G=Y("./external"),X=Y("./stream/DataWorker"),Q=Y("./stream/Crc32Probe"),B=Y("./stream/DataLengthProbe");function F(z,W,k,D,C){this.compressedSize=z,this.uncompressedSize=W,this.crc32=k,this.compression=D,this.compressedContent=C}F.prototype={getContentWorker:function(){var z=new X(G.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new B("data_length")),W=this;return z.on("end",function(){if(this.streamInfo.data_length!==W.uncompressedSize)throw Error("Bug : uncompressed data size mismatch")}),z},getCompressedWorker:function(){return new X(G.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},F.createWorkerFrom=function(z,W,k){return z.pipe(new Q).pipe(new B("uncompressedSize")).pipe(W.compressWorker(k)).pipe(new B("compressedSize")).withStreamInfo("compression",W)},Z.exports=F},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(Y,Z,J){var G=Y("./stream/GenericWorker");J.STORE={magic:"\x00\x00",compressWorker:function(){return new G("STORE compression")},uncompressWorker:function(){return new G("STORE decompression")}},J.DEFLATE=Y("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(Y,Z,J){var G=Y("./utils"),X=function(){for(var Q,B=[],F=0;F<256;F++){Q=F;for(var z=0;z<8;z++)Q=1&Q?3988292384^Q>>>1:Q>>>1;B[F]=Q}return B}();Z.exports=function(Q,B){return Q!==void 0&&Q.length?G.getTypeOf(Q)!=="string"?function(F,z,W,k){var D=X,C=k+W;F^=-1;for(var H=k;H>>8^D[255&(F^z[H])];return-1^F}(0|B,Q,Q.length,0):function(F,z,W,k){var D=X,C=k+W;F^=-1;for(var H=k;H>>8^D[255&(F^z.charCodeAt(H))];return-1^F}(0|B,Q,Q.length,0):0}},{"./utils":32}],5:[function(Y,Z,J){J.base64=!1,J.binary=!1,J.dir=!1,J.createFolders=!0,J.date=null,J.compression=null,J.compressionOptions=null,J.comment=null,J.unixPermissions=null,J.dosPermissions=null},{}],6:[function(Y,Z,J){var G=null;G=typeof Promise<"u"?Promise:Y("lie"),Z.exports={Promise:G}},{lie:37}],7:[function(Y,Z,J){var G=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",X=Y("pako"),Q=Y("./utils"),B=Y("./stream/GenericWorker"),F=G?"uint8array":"array";function z(W,k){B.call(this,"FlateWorker/"+W),this._pako=null,this._pakoAction=W,this._pakoOptions=k,this.meta={}}J.magic="\b\x00",Q.inherits(z,B),z.prototype.processChunk=function(W){this.meta=W.meta,this._pako===null&&this._createPako(),this._pako.push(Q.transformTo(F,W.data),!1)},z.prototype.flush=function(){B.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},z.prototype.cleanUp=function(){B.prototype.cleanUp.call(this),this._pako=null},z.prototype._createPako=function(){this._pako=new X[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var W=this;this._pako.onData=function(k){W.push({data:k,meta:W.meta})}},J.compressWorker=function(W){return new z("Deflate",W)},J.uncompressWorker=function(){return new z("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(Y,Z,J){function G(D,C){var H,O="";for(H=0;H>>=8;return O}function X(D,C,H,O,V,j){var M,L,A=D.file,y=D.compression,g=j!==F.utf8encode,d=Q.transformTo("string",j(A.name)),E=Q.transformTo("string",F.utf8encode(A.name)),s=A.comment,V0=Q.transformTo("string",j(s)),S=Q.transformTo("string",F.utf8encode(s)),h=E.length!==A.name.length,N=S.length!==s.length,a="",$0="",m="",J0=A.dir,U0=A.date,L0={crc32:0,compressedSize:0,uncompressedSize:0};C&&!H||(L0.crc32=D.crc32,L0.compressedSize=D.compressedSize,L0.uncompressedSize=D.uncompressedSize);var i=0;C&&(i|=8),g||!h&&!N||(i|=2048);var _=0,r=0;J0&&(_|=16),V==="UNIX"?(r=798,_|=function(Z0,p){var P=Z0;return Z0||(P=p?16893:33204),(65535&P)<<16}(A.unixPermissions,J0)):(r=20,_|=function(Z0){return 63&(Z0||0)}(A.dosPermissions)),M=U0.getUTCHours(),M<<=6,M|=U0.getUTCMinutes(),M<<=5,M|=U0.getUTCSeconds()/2,L=U0.getUTCFullYear()-1980,L<<=4,L|=U0.getUTCMonth()+1,L<<=5,L|=U0.getUTCDate(),h&&($0=G(1,1)+G(z(d),4)+E,a+="up"+G($0.length,2)+$0),N&&(m=G(1,1)+G(z(V0),4)+S,a+="uc"+G(m.length,2)+m);var n="";return n+=` -\x00`,n+=G(i,2),n+=y.magic,n+=G(M,2),n+=G(L,2),n+=G(L0.crc32,4),n+=G(L0.compressedSize,4),n+=G(L0.uncompressedSize,4),n+=G(d.length,2),n+=G(a.length,2),{fileRecord:W.LOCAL_FILE_HEADER+n+d+a,dirRecord:W.CENTRAL_FILE_HEADER+G(r,2)+n+G(V0.length,2)+"\x00\x00\x00\x00"+G(_,4)+G(O,4)+d+a+V0}}var Q=Y("../utils"),B=Y("../stream/GenericWorker"),F=Y("../utf8"),z=Y("../crc32"),W=Y("../signature");function k(D,C,H,O){B.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=C,this.zipPlatform=H,this.encodeFileName=O,this.streamFiles=D,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}Q.inherits(k,B),k.prototype.push=function(D){var C=D.meta.percent||0,H=this.entriesCount,O=this._sources.length;this.accumulate?this.contentBuffer.push(D):(this.bytesWritten+=D.data.length,B.prototype.push.call(this,{data:D.data,meta:{currentFile:this.currentFile,percent:H?(C+100*(H-O-1))/H:100}}))},k.prototype.openedSource=function(D){this.currentSourceOffset=this.bytesWritten,this.currentFile=D.file.name;var C=this.streamFiles&&!D.file.dir;if(C){var H=X(D,C,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:H.fileRecord,meta:{percent:0}})}else this.accumulate=!0},k.prototype.closedSource=function(D){this.accumulate=!1;var C=this.streamFiles&&!D.file.dir,H=X(D,C,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(H.dirRecord),C)this.push({data:function(O){return W.DATA_DESCRIPTOR+G(O.crc32,4)+G(O.compressedSize,4)+G(O.uncompressedSize,4)}(D),meta:{percent:100}});else for(this.push({data:H.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},k.prototype.flush=function(){for(var D=this.bytesWritten,C=0;C=this.index;B--)F=(F<<8)+this.byteAt(B);return this.index+=Q,F},readString:function(Q){return G.transformTo("string",this.readData(Q))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var Q=this.readInt(4);return new Date(Date.UTC(1980+(Q>>25&127),(Q>>21&15)-1,Q>>16&31,Q>>11&31,Q>>5&63,(31&Q)<<1))}},Z.exports=X},{"../utils":32}],19:[function(Y,Z,J){var G=Y("./Uint8ArrayReader");function X(Q){G.call(this,Q)}Y("../utils").inherits(X,G),X.prototype.readData=function(Q){this.checkOffset(Q);var B=this.data.slice(this.zero+this.index,this.zero+this.index+Q);return this.index+=Q,B},Z.exports=X},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(Y,Z,J){var G=Y("./DataReader");function X(Q){G.call(this,Q)}Y("../utils").inherits(X,G),X.prototype.byteAt=function(Q){return this.data.charCodeAt(this.zero+Q)},X.prototype.lastIndexOfSignature=function(Q){return this.data.lastIndexOf(Q)-this.zero},X.prototype.readAndCheckSignature=function(Q){return Q===this.readData(4)},X.prototype.readData=function(Q){this.checkOffset(Q);var B=this.data.slice(this.zero+this.index,this.zero+this.index+Q);return this.index+=Q,B},Z.exports=X},{"../utils":32,"./DataReader":18}],21:[function(Y,Z,J){var G=Y("./ArrayReader");function X(Q){G.call(this,Q)}Y("../utils").inherits(X,G),X.prototype.readData=function(Q){if(this.checkOffset(Q),Q===0)return new Uint8Array(0);var B=this.data.subarray(this.zero+this.index,this.zero+this.index+Q);return this.index+=Q,B},Z.exports=X},{"../utils":32,"./ArrayReader":17}],22:[function(Y,Z,J){var G=Y("../utils"),X=Y("../support"),Q=Y("./ArrayReader"),B=Y("./StringReader"),F=Y("./NodeBufferReader"),z=Y("./Uint8ArrayReader");Z.exports=function(W){var k=G.getTypeOf(W);return G.checkSupport(k),k!=="string"||X.uint8array?k==="nodebuffer"?new F(W):X.uint8array?new z(G.transformTo("uint8array",W)):new Q(G.transformTo("array",W)):new B(W)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(Y,Z,J){J.LOCAL_FILE_HEADER="PK\x03\x04",J.CENTRAL_FILE_HEADER="PK\x01\x02",J.CENTRAL_DIRECTORY_END="PK\x05\x06",J.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07",J.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06",J.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(Y,Z,J){var G=Y("./GenericWorker"),X=Y("../utils");function Q(B){G.call(this,"ConvertWorker to "+B),this.destType=B}X.inherits(Q,G),Q.prototype.processChunk=function(B){this.push({data:X.transformTo(this.destType,B.data),meta:B.meta})},Z.exports=Q},{"../utils":32,"./GenericWorker":28}],25:[function(Y,Z,J){var G=Y("./GenericWorker"),X=Y("../crc32");function Q(){G.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}Y("../utils").inherits(Q,G),Q.prototype.processChunk=function(B){this.streamInfo.crc32=X(B.data,this.streamInfo.crc32||0),this.push(B)},Z.exports=Q},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(Y,Z,J){var G=Y("../utils"),X=Y("./GenericWorker");function Q(B){X.call(this,"DataLengthProbe for "+B),this.propName=B,this.withStreamInfo(B,0)}G.inherits(Q,X),Q.prototype.processChunk=function(B){if(B){var F=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=F+B.data.length}X.prototype.processChunk.call(this,B)},Z.exports=Q},{"../utils":32,"./GenericWorker":28}],27:[function(Y,Z,J){var G=Y("../utils"),X=Y("./GenericWorker");function Q(B){X.call(this,"DataWorker");var F=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,B.then(function(z){F.dataIsReady=!0,F.data=z,F.max=z&&z.length||0,F.type=G.getTypeOf(z),F.isPaused||F._tickAndRepeat()},function(z){F.error(z)})}G.inherits(Q,X),Q.prototype.cleanUp=function(){X.prototype.cleanUp.call(this),this.data=null},Q.prototype.resume=function(){return!!X.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,G.delay(this._tickAndRepeat,[],this)),!0)},Q.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(G.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},Q.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var B=null,F=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":B=this.data.substring(this.index,F);break;case"uint8array":B=this.data.subarray(this.index,F);break;case"array":case"nodebuffer":B=this.data.slice(this.index,F)}return this.index=F,this.push({data:B,meta:{percent:this.max?this.index/this.max*100:0}})},Z.exports=Q},{"../utils":32,"./GenericWorker":28}],28:[function(Y,Z,J){function G(X){this.name=X||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}G.prototype={push:function(X){this.emit("data",X)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(X){this.emit("error",X)}return!0},error:function(X){return!this.isFinished&&(this.isPaused?this.generatedError=X:(this.isFinished=!0,this.emit("error",X),this.previous&&this.previous.error(X),this.cleanUp()),!0)},on:function(X,Q){return this._listeners[X].push(Q),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(X,Q){if(this._listeners[X])for(var B=0;B "+X:X}},Z.exports=G},{}],29:[function(Y,Z,J){var G=Y("../utils"),X=Y("./ConvertWorker"),Q=Y("./GenericWorker"),B=Y("../base64"),F=Y("../support"),z=Y("../external"),W=null;if(F.nodestream)try{W=Y("../nodejs/NodejsStreamOutputAdapter")}catch(C){}function k(C,H){return new z.Promise(function(O,V){var j=[],M=C._internalType,L=C._outputType,A=C._mimeType;C.on("data",function(y,g){j.push(y),H&&H(g)}).on("error",function(y){j=[],V(y)}).on("end",function(){try{var y=function(g,d,E){switch(g){case"blob":return G.newBlob(G.transformTo("arraybuffer",d),E);case"base64":return B.encode(d);default:return G.transformTo(g,d)}}(L,function(g,d){var E,s=0,V0=null,S=0;for(E=0;E"u")J.blob=!1;else{var G=new ArrayBuffer(0);try{J.blob=new Blob([G],{type:"application/zip"}).size===0}catch(Q){try{var X=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);X.append(G),J.blob=X.getBlob("application/zip").size===0}catch(B){J.blob=!1}}}try{J.nodestream=!!Y("readable-stream").Readable}catch(Q){J.nodestream=!1}},{"readable-stream":16}],31:[function(Y,Z,J){for(var G=Y("./utils"),X=Y("./support"),Q=Y("./nodejsUtils"),B=Y("./stream/GenericWorker"),F=Array(256),z=0;z<256;z++)F[z]=252<=z?6:248<=z?5:240<=z?4:224<=z?3:192<=z?2:1;F[254]=F[254]=1;function W(){B.call(this,"utf-8 decode"),this.leftOver=null}function k(){B.call(this,"utf-8 encode")}J.utf8encode=function(D){return X.nodebuffer?Q.newBufferFrom(D,"utf-8"):function(C){var H,O,V,j,M,L=C.length,A=0;for(j=0;j>>6:(O<65536?H[M++]=224|O>>>12:(H[M++]=240|O>>>18,H[M++]=128|O>>>12&63),H[M++]=128|O>>>6&63),H[M++]=128|63&O);return H}(D)},J.utf8decode=function(D){return X.nodebuffer?G.transformTo("nodebuffer",D).toString("utf-8"):function(C){var H,O,V,j,M=C.length,L=Array(2*M);for(H=O=0;H>10&1023,L[O++]=56320|1023&V)}return L.length!==O&&(L.subarray?L=L.subarray(0,O):L.length=O),G.applyFromCharCode(L)}(D=G.transformTo(X.uint8array?"uint8array":"array",D))},G.inherits(W,B),W.prototype.processChunk=function(D){var C=G.transformTo(X.uint8array?"uint8array":"array",D.data);if(this.leftOver&&this.leftOver.length){if(X.uint8array){var H=C;(C=new Uint8Array(H.length+this.leftOver.length)).set(this.leftOver,0),C.set(H,this.leftOver.length)}else C=this.leftOver.concat(C);this.leftOver=null}var O=function(j,M){var L;for((M=M||j.length)>j.length&&(M=j.length),L=M-1;0<=L&&(192&j[L])==128;)L--;return L<0?M:L===0?M:L+F[j[L]]>M?L:M}(C),V=C;O!==C.length&&(X.uint8array?(V=C.subarray(0,O),this.leftOver=C.subarray(O,C.length)):(V=C.slice(0,O),this.leftOver=C.slice(O,C.length))),this.push({data:J.utf8decode(V),meta:D.meta})},W.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:J.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},J.Utf8DecodeWorker=W,G.inherits(k,B),k.prototype.processChunk=function(D){this.push({data:J.utf8encode(D.data),meta:D.meta})},J.Utf8EncodeWorker=k},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(Y,Z,J){var G=Y("./support"),X=Y("./base64"),Q=Y("./nodejsUtils"),B=Y("./external");function F(H){return H}function z(H,O){for(var V=0;V>8;this.dir=!!(16&this.externalFileAttributes),D==0&&(this.dosPermissions=63&this.externalFileAttributes),D==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var D=G(this.extraFields[1].value);this.uncompressedSize===X.MAX_VALUE_32BITS&&(this.uncompressedSize=D.readInt(8)),this.compressedSize===X.MAX_VALUE_32BITS&&(this.compressedSize=D.readInt(8)),this.localHeaderOffset===X.MAX_VALUE_32BITS&&(this.localHeaderOffset=D.readInt(8)),this.diskNumberStart===X.MAX_VALUE_32BITS&&(this.diskNumberStart=D.readInt(4))}},readExtraFields:function(D){var C,H,O,V=D.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});D.index+4>>6:(D<65536?k[O++]=224|D>>>12:(k[O++]=240|D>>>18,k[O++]=128|D>>>12&63),k[O++]=128|D>>>6&63),k[O++]=128|63&D);return k},J.buf2binstring=function(W){return z(W,W.length)},J.binstring2buf=function(W){for(var k=new G.Buf8(W.length),D=0,C=k.length;D>10&1023,j[C++]=56320|1023&H)}return z(j,C)},J.utf8border=function(W,k){var D;for((k=k||W.length)>W.length&&(k=W.length),D=k-1;0<=D&&(192&W[D])==128;)D--;return D<0?k:D===0?k:D+B[W[D]]>k?D:k}},{"./common":41}],43:[function(Y,Z,J){Z.exports=function(G,X,Q,B){for(var F=65535&G|0,z=G>>>16&65535|0,W=0;Q!==0;){for(Q-=W=2000>>1:X>>>1;Q[B]=X}return Q}();Z.exports=function(X,Q,B,F){var z=G,W=F+B;X^=-1;for(var k=F;k>>8^z[255&(X^Q[k])];return-1^X}},{}],46:[function(Y,Z,J){var G,X=Y("../utils/common"),Q=Y("./trees"),B=Y("./adler32"),F=Y("./crc32"),z=Y("./messages"),W=0,k=4,D=0,C=-2,H=-1,O=4,V=2,j=8,M=9,L=286,A=30,y=19,g=2*L+1,d=15,E=3,s=258,V0=s+E+1,S=42,h=113,N=1,a=2,$0=3,m=4;function J0(I,t){return I.msg=z[t],t}function U0(I){return(I<<1)-(4I.avail_out&&(T=I.avail_out),T!==0&&(X.arraySet(I.output,t.pending_buf,t.pending_out,T,I.next_out),I.next_out+=T,t.pending_out+=T,I.total_out+=T,I.avail_out-=T,t.pending-=T,t.pending===0&&(t.pending_out=0))}function _(I,t){Q._tr_flush_block(I,0<=I.block_start?I.block_start:-1,I.strstart-I.block_start,t),I.block_start=I.strstart,i(I.strm)}function r(I,t){I.pending_buf[I.pending++]=t}function n(I,t){I.pending_buf[I.pending++]=t>>>8&255,I.pending_buf[I.pending++]=255&t}function Z0(I,t){var T,K,q=I.max_chain_length,w=I.strstart,x=I.prev_length,l=I.nice_match,u=I.strstart>I.w_size-V0?I.strstart-(I.w_size-V0):0,Q0=I.window,q0=I.w_mask,K0=I.prev,M0=I.strstart+s,w0=Q0[w+x-1],H0=Q0[w+x];I.prev_length>=I.good_match&&(q>>=2),l>I.lookahead&&(l=I.lookahead);do if(Q0[(T=t)+x]===H0&&Q0[T+x-1]===w0&&Q0[T]===Q0[w]&&Q0[++T]===Q0[w+1]){w+=2,T++;do;while(Q0[++w]===Q0[++T]&&Q0[++w]===Q0[++T]&&Q0[++w]===Q0[++T]&&Q0[++w]===Q0[++T]&&Q0[++w]===Q0[++T]&&Q0[++w]===Q0[++T]&&Q0[++w]===Q0[++T]&&Q0[++w]===Q0[++T]&&wu&&--q!=0);return x<=I.lookahead?x:I.lookahead}function p(I){var t,T,K,q,w,x,l,u,Q0,q0,K0=I.w_size;do{if(q=I.window_size-I.lookahead-I.strstart,I.strstart>=K0+(K0-V0)){for(X.arraySet(I.window,I.window,K0,K0,0),I.match_start-=K0,I.strstart-=K0,I.block_start-=K0,t=T=I.hash_size;K=I.head[--t],I.head[t]=K0<=K?K-K0:0,--T;);for(t=T=K0;K=I.prev[--t],I.prev[t]=K0<=K?K-K0:0,--T;);q+=K0}if(I.strm.avail_in===0)break;if(x=I.strm,l=I.window,u=I.strstart+I.lookahead,Q0=q,q0=void 0,q0=x.avail_in,Q0=E)for(w=I.strstart-I.insert,I.ins_h=I.window[w],I.ins_h=(I.ins_h<=E&&(I.ins_h=(I.ins_h<=E)if(K=Q._tr_tally(I,I.strstart-I.match_start,I.match_length-E),I.lookahead-=I.match_length,I.match_length<=I.max_lazy_match&&I.lookahead>=E){for(I.match_length--;I.strstart++,I.ins_h=(I.ins_h<=E&&(I.ins_h=(I.ins_h<=E&&I.match_length<=I.prev_length){for(q=I.strstart+I.lookahead-E,K=Q._tr_tally(I,I.strstart-1-I.prev_match,I.prev_length-E),I.lookahead-=I.prev_length-1,I.prev_length-=2;++I.strstart<=q&&(I.ins_h=(I.ins_h<I.pending_buf_size-5&&(T=I.pending_buf_size-5);;){if(I.lookahead<=1){if(p(I),I.lookahead===0&&t===W)return N;if(I.lookahead===0)break}I.strstart+=I.lookahead,I.lookahead=0;var K=I.block_start+T;if((I.strstart===0||I.strstart>=K)&&(I.lookahead=I.strstart-K,I.strstart=K,_(I,!1),I.strm.avail_out===0))return N;if(I.strstart-I.block_start>=I.w_size-V0&&(_(I,!1),I.strm.avail_out===0))return N}return I.insert=0,t===k?(_(I,!0),I.strm.avail_out===0?$0:m):(I.strstart>I.block_start&&(_(I,!1),I.strm.avail_out),N)}),new c(4,4,8,4,P),new c(4,5,16,8,P),new c(4,6,32,32,P),new c(4,4,16,16,R),new c(8,16,32,32,R),new c(8,16,128,128,R),new c(8,32,128,256,R),new c(32,128,258,1024,R),new c(32,258,258,4096,R)],J.deflateInit=function(I,t){return e(I,t,j,15,8,0)},J.deflateInit2=e,J.deflateReset=b,J.deflateResetKeep=v,J.deflateSetHeader=function(I,t){return I&&I.state?I.state.wrap!==2?C:(I.state.gzhead=t,D):C},J.deflate=function(I,t){var T,K,q,w;if(!I||!I.state||5>8&255),r(K,K.gzhead.time>>16&255),r(K,K.gzhead.time>>24&255),r(K,K.level===9?2:2<=K.strategy||K.level<2?4:0),r(K,255&K.gzhead.os),K.gzhead.extra&&K.gzhead.extra.length&&(r(K,255&K.gzhead.extra.length),r(K,K.gzhead.extra.length>>8&255)),K.gzhead.hcrc&&(I.adler=F(I.adler,K.pending_buf,K.pending,0)),K.gzindex=0,K.status=69):(r(K,0),r(K,0),r(K,0),r(K,0),r(K,0),r(K,K.level===9?2:2<=K.strategy||K.level<2?4:0),r(K,3),K.status=h);else{var x=j+(K.w_bits-8<<4)<<8;x|=(2<=K.strategy||K.level<2?0:K.level<6?1:K.level===6?2:3)<<6,K.strstart!==0&&(x|=32),x+=31-x%31,K.status=h,n(K,x),K.strstart!==0&&(n(K,I.adler>>>16),n(K,65535&I.adler)),I.adler=1}if(K.status===69)if(K.gzhead.extra){for(q=K.pending;K.gzindex<(65535&K.gzhead.extra.length)&&(K.pending!==K.pending_buf_size||(K.gzhead.hcrc&&K.pending>q&&(I.adler=F(I.adler,K.pending_buf,K.pending-q,q)),i(I),q=K.pending,K.pending!==K.pending_buf_size));)r(K,255&K.gzhead.extra[K.gzindex]),K.gzindex++;K.gzhead.hcrc&&K.pending>q&&(I.adler=F(I.adler,K.pending_buf,K.pending-q,q)),K.gzindex===K.gzhead.extra.length&&(K.gzindex=0,K.status=73)}else K.status=73;if(K.status===73)if(K.gzhead.name){q=K.pending;do{if(K.pending===K.pending_buf_size&&(K.gzhead.hcrc&&K.pending>q&&(I.adler=F(I.adler,K.pending_buf,K.pending-q,q)),i(I),q=K.pending,K.pending===K.pending_buf_size)){w=1;break}w=K.gzindexq&&(I.adler=F(I.adler,K.pending_buf,K.pending-q,q)),w===0&&(K.gzindex=0,K.status=91)}else K.status=91;if(K.status===91)if(K.gzhead.comment){q=K.pending;do{if(K.pending===K.pending_buf_size&&(K.gzhead.hcrc&&K.pending>q&&(I.adler=F(I.adler,K.pending_buf,K.pending-q,q)),i(I),q=K.pending,K.pending===K.pending_buf_size)){w=1;break}w=K.gzindexq&&(I.adler=F(I.adler,K.pending_buf,K.pending-q,q)),w===0&&(K.status=103)}else K.status=103;if(K.status===103&&(K.gzhead.hcrc?(K.pending+2>K.pending_buf_size&&i(I),K.pending+2<=K.pending_buf_size&&(r(K,255&I.adler),r(K,I.adler>>8&255),I.adler=0,K.status=h)):K.status=h),K.pending!==0){if(i(I),I.avail_out===0)return K.last_flush=-1,D}else if(I.avail_in===0&&U0(t)<=U0(T)&&t!==k)return J0(I,-5);if(K.status===666&&I.avail_in!==0)return J0(I,-5);if(I.avail_in!==0||K.lookahead!==0||t!==W&&K.status!==666){var l=K.strategy===2?function(u,Q0){for(var q0;;){if(u.lookahead===0&&(p(u),u.lookahead===0)){if(Q0===W)return N;break}if(u.match_length=0,q0=Q._tr_tally(u,0,u.window[u.strstart]),u.lookahead--,u.strstart++,q0&&(_(u,!1),u.strm.avail_out===0))return N}return u.insert=0,Q0===k?(_(u,!0),u.strm.avail_out===0?$0:m):u.last_lit&&(_(u,!1),u.strm.avail_out===0)?N:a}(K,t):K.strategy===3?function(u,Q0){for(var q0,K0,M0,w0,H0=u.window;;){if(u.lookahead<=s){if(p(u),u.lookahead<=s&&Q0===W)return N;if(u.lookahead===0)break}if(u.match_length=0,u.lookahead>=E&&0u.lookahead&&(u.match_length=u.lookahead)}if(u.match_length>=E?(q0=Q._tr_tally(u,1,u.match_length-E),u.lookahead-=u.match_length,u.strstart+=u.match_length,u.match_length=0):(q0=Q._tr_tally(u,0,u.window[u.strstart]),u.lookahead--,u.strstart++),q0&&(_(u,!1),u.strm.avail_out===0))return N}return u.insert=0,Q0===k?(_(u,!0),u.strm.avail_out===0?$0:m):u.last_lit&&(_(u,!1),u.strm.avail_out===0)?N:a}(K,t):G[K.level].func(K,t);if(l!==$0&&l!==m||(K.status=666),l===N||l===$0)return I.avail_out===0&&(K.last_flush=-1),D;if(l===a&&(t===1?Q._tr_align(K):t!==5&&(Q._tr_stored_block(K,0,0,!1),t===3&&(L0(K.head),K.lookahead===0&&(K.strstart=0,K.block_start=0,K.insert=0))),i(I),I.avail_out===0))return K.last_flush=-1,D}return t!==k?D:K.wrap<=0?1:(K.wrap===2?(r(K,255&I.adler),r(K,I.adler>>8&255),r(K,I.adler>>16&255),r(K,I.adler>>24&255),r(K,255&I.total_in),r(K,I.total_in>>8&255),r(K,I.total_in>>16&255),r(K,I.total_in>>24&255)):(n(K,I.adler>>>16),n(K,65535&I.adler)),i(I),0=T.w_size&&(w===0&&(L0(T.head),T.strstart=0,T.block_start=0,T.insert=0),Q0=new X.Buf8(T.w_size),X.arraySet(Q0,t,q0-T.w_size,T.w_size,0),t=Q0,q0=T.w_size),x=I.avail_in,l=I.next_in,u=I.input,I.avail_in=q0,I.next_in=0,I.input=t,p(T);T.lookahead>=E;){for(K=T.strstart,q=T.lookahead-(E-1);T.ins_h=(T.ins_h<>>=E=d>>>24,M-=E,(E=d>>>16&255)===0)a[z++]=65535&d;else{if(!(16&E)){if((64&E)==0){d=L[(65535&d)+(j&(1<>>=E,M-=E),M<15&&(j+=N[B++]<>>=E=d>>>24,M-=E,!(16&(E=d>>>16&255))){if((64&E)==0){d=A[(65535&d)+(j&(1<>>=E,M-=E,(E=z-W)>3,j&=(1<<(M-=s<<3))-1,G.next_in=B,G.next_out=z,G.avail_in=B>>24&255)+(S>>>8&65280)+((65280&S)<<8)+((255&S)<<24)}function j(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new G.Buf16(320),this.work=new G.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function M(S){var h;return S&&S.state?(h=S.state,S.total_in=S.total_out=h.total=0,S.msg="",h.wrap&&(S.adler=1&h.wrap),h.mode=C,h.last=0,h.havedict=0,h.dmax=32768,h.head=null,h.hold=0,h.bits=0,h.lencode=h.lendyn=new G.Buf32(H),h.distcode=h.distdyn=new G.Buf32(O),h.sane=1,h.back=-1,k):D}function L(S){var h;return S&&S.state?((h=S.state).wsize=0,h.whave=0,h.wnext=0,M(S)):D}function A(S,h){var N,a;return S&&S.state?(a=S.state,h<0?(N=0,h=-h):(N=1+(h>>4),h<48&&(h&=15)),h&&(h<8||15=m.wsize?(G.arraySet(m.window,h,N-m.wsize,m.wsize,0),m.wnext=0,m.whave=m.wsize):(a<($0=m.wsize-m.wnext)&&($0=a),G.arraySet(m.window,h,N-a,$0,m.wnext),(a-=$0)?(G.arraySet(m.window,h,N-a,a,0),m.wnext=a,m.whave=m.wsize):(m.wnext+=$0,m.wnext===m.wsize&&(m.wnext=0),m.whave>>8&255,N.check=Q(N.check,w,2,0),_=i=0,N.mode=2;break}if(N.flags=0,N.head&&(N.head.done=!1),!(1&N.wrap)||(((255&i)<<8)+(i>>8))%31){S.msg="incorrect header check",N.mode=30;break}if((15&i)!=8){S.msg="unknown compression method",N.mode=30;break}if(_-=4,I=8+(15&(i>>>=4)),N.wbits===0)N.wbits=I;else if(I>N.wbits){S.msg="invalid window size",N.mode=30;break}N.dmax=1<>8&1),512&N.flags&&(w[0]=255&i,w[1]=i>>>8&255,N.check=Q(N.check,w,2,0)),_=i=0,N.mode=3;case 3:for(;_<32;){if(U0===0)break $;U0--,i+=a[m++]<<_,_+=8}N.head&&(N.head.time=i),512&N.flags&&(w[0]=255&i,w[1]=i>>>8&255,w[2]=i>>>16&255,w[3]=i>>>24&255,N.check=Q(N.check,w,4,0)),_=i=0,N.mode=4;case 4:for(;_<16;){if(U0===0)break $;U0--,i+=a[m++]<<_,_+=8}N.head&&(N.head.xflags=255&i,N.head.os=i>>8),512&N.flags&&(w[0]=255&i,w[1]=i>>>8&255,N.check=Q(N.check,w,2,0)),_=i=0,N.mode=5;case 5:if(1024&N.flags){for(;_<16;){if(U0===0)break $;U0--,i+=a[m++]<<_,_+=8}N.length=i,N.head&&(N.head.extra_len=i),512&N.flags&&(w[0]=255&i,w[1]=i>>>8&255,N.check=Q(N.check,w,2,0)),_=i=0}else N.head&&(N.head.extra=null);N.mode=6;case 6:if(1024&N.flags&&(U0<(Z0=N.length)&&(Z0=U0),Z0&&(N.head&&(I=N.head.extra_len-N.length,N.head.extra||(N.head.extra=Array(N.head.extra_len)),G.arraySet(N.head.extra,a,m,Z0,I)),512&N.flags&&(N.check=Q(N.check,a,Z0,m)),U0-=Z0,m+=Z0,N.length-=Z0),N.length))break $;N.length=0,N.mode=7;case 7:if(2048&N.flags){if(U0===0)break $;for(Z0=0;I=a[m+Z0++],N.head&&I&&N.length<65536&&(N.head.name+=String.fromCharCode(I)),I&&Z0>9&1,N.head.done=!0),S.adler=N.check=0,N.mode=12;break;case 10:for(;_<32;){if(U0===0)break $;U0--,i+=a[m++]<<_,_+=8}S.adler=N.check=V(i),_=i=0,N.mode=11;case 11:if(N.havedict===0)return S.next_out=J0,S.avail_out=L0,S.next_in=m,S.avail_in=U0,N.hold=i,N.bits=_,2;S.adler=N.check=1,N.mode=12;case 12:if(h===5||h===6)break $;case 13:if(N.last){i>>>=7&_,_-=7&_,N.mode=27;break}for(;_<3;){if(U0===0)break $;U0--,i+=a[m++]<<_,_+=8}switch(N.last=1&i,_-=1,3&(i>>>=1)){case 0:N.mode=14;break;case 1:if(s(N),N.mode=20,h!==6)break;i>>>=2,_-=2;break $;case 2:N.mode=17;break;case 3:S.msg="invalid block type",N.mode=30}i>>>=2,_-=2;break;case 14:for(i>>>=7&_,_-=7&_;_<32;){if(U0===0)break $;U0--,i+=a[m++]<<_,_+=8}if((65535&i)!=(i>>>16^65535)){S.msg="invalid stored block lengths",N.mode=30;break}if(N.length=65535&i,_=i=0,N.mode=15,h===6)break $;case 15:N.mode=16;case 16:if(Z0=N.length){if(U0>>=5,_-=5,N.ndist=1+(31&i),i>>>=5,_-=5,N.ncode=4+(15&i),i>>>=4,_-=4,286>>=3,_-=3}for(;N.have<19;)N.lens[x[N.have++]]=0;if(N.lencode=N.lendyn,N.lenbits=7,T={bits:N.lenbits},t=F(0,N.lens,0,19,N.lencode,0,N.work,T),N.lenbits=T.bits,t){S.msg="invalid code lengths set",N.mode=30;break}N.have=0,N.mode=19;case 19:for(;N.have>>16&255,f=65535&q,!((R=q>>>24)<=_);){if(U0===0)break $;U0--,i+=a[m++]<<_,_+=8}if(f<16)i>>>=R,_-=R,N.lens[N.have++]=f;else{if(f===16){for(K=R+2;_>>=R,_-=R,N.have===0){S.msg="invalid bit length repeat",N.mode=30;break}I=N.lens[N.have-1],Z0=3+(3&i),i>>>=2,_-=2}else if(f===17){for(K=R+3;_>>=R)),i>>>=3,_-=3}else{for(K=R+7;_>>=R)),i>>>=7,_-=7}if(N.have+Z0>N.nlen+N.ndist){S.msg="invalid bit length repeat",N.mode=30;break}for(;Z0--;)N.lens[N.have++]=I}}if(N.mode===30)break;if(N.lens[256]===0){S.msg="invalid code -- missing end-of-block",N.mode=30;break}if(N.lenbits=9,T={bits:N.lenbits},t=F(z,N.lens,0,N.nlen,N.lencode,0,N.work,T),N.lenbits=T.bits,t){S.msg="invalid literal/lengths set",N.mode=30;break}if(N.distbits=6,N.distcode=N.distdyn,T={bits:N.distbits},t=F(W,N.lens,N.nlen,N.ndist,N.distcode,0,N.work,T),N.distbits=T.bits,t){S.msg="invalid distances set",N.mode=30;break}if(N.mode=20,h===6)break $;case 20:N.mode=21;case 21:if(6<=U0&&258<=L0){S.next_out=J0,S.avail_out=L0,S.next_in=m,S.avail_in=U0,N.hold=i,N.bits=_,B(S,n),J0=S.next_out,$0=S.output,L0=S.avail_out,m=S.next_in,a=S.input,U0=S.avail_in,i=N.hold,_=N.bits,N.mode===12&&(N.back=-1);break}for(N.back=0;c=(q=N.lencode[i&(1<>>16&255,f=65535&q,!((R=q>>>24)<=_);){if(U0===0)break $;U0--,i+=a[m++]<<_,_+=8}if(c&&(240&c)==0){for(v=R,b=c,e=f;c=(q=N.lencode[e+((i&(1<>v)])>>>16&255,f=65535&q,!(v+(R=q>>>24)<=_);){if(U0===0)break $;U0--,i+=a[m++]<<_,_+=8}i>>>=v,_-=v,N.back+=v}if(i>>>=R,_-=R,N.back+=R,N.length=f,c===0){N.mode=26;break}if(32&c){N.back=-1,N.mode=12;break}if(64&c){S.msg="invalid literal/length code",N.mode=30;break}N.extra=15&c,N.mode=22;case 22:if(N.extra){for(K=N.extra;_>>=N.extra,_-=N.extra,N.back+=N.extra}N.was=N.length,N.mode=23;case 23:for(;c=(q=N.distcode[i&(1<>>16&255,f=65535&q,!((R=q>>>24)<=_);){if(U0===0)break $;U0--,i+=a[m++]<<_,_+=8}if((240&c)==0){for(v=R,b=c,e=f;c=(q=N.distcode[e+((i&(1<>v)])>>>16&255,f=65535&q,!(v+(R=q>>>24)<=_);){if(U0===0)break $;U0--,i+=a[m++]<<_,_+=8}i>>>=v,_-=v,N.back+=v}if(i>>>=R,_-=R,N.back+=R,64&c){S.msg="invalid distance code",N.mode=30;break}N.offset=f,N.extra=15&c,N.mode=24;case 24:if(N.extra){for(K=N.extra;_>>=N.extra,_-=N.extra,N.back+=N.extra}if(N.offset>N.dmax){S.msg="invalid distance too far back",N.mode=30;break}N.mode=25;case 25:if(L0===0)break $;if(Z0=n-L0,N.offset>Z0){if((Z0=N.offset-Z0)>N.whave&&N.sane){S.msg="invalid distance too far back",N.mode=30;break}p=Z0>N.wnext?(Z0-=N.wnext,N.wsize-Z0):N.wnext-Z0,Z0>N.length&&(Z0=N.length),P=N.window}else P=$0,p=J0-N.offset,Z0=N.length;for(L0g?(E=p[P+O[h]],_[r+O[h]]):(E=96,0),j=1<>J0)+(M-=j)]=d<<24|E<<16|s|0,M!==0;);for(j=1<>=1;if(j!==0?(i&=j-1,i+=j):i=0,h++,--n[S]==0){if(S===a)break;S=W[k+O[h]]}if($0>>7)]}function r(q,w){q.pending_buf[q.pending++]=255&w,q.pending_buf[q.pending++]=w>>>8&255}function n(q,w,x){q.bi_valid>V-x?(q.bi_buf|=w<>V-q.bi_valid,q.bi_valid+=x-V):(q.bi_buf|=w<>>=1,x<<=1,0<--w;);return x>>>1}function P(q,w,x){var l,u,Q0=Array(O+1),q0=0;for(l=1;l<=O;l++)Q0[l]=q0=q0+x[l-1]<<1;for(u=0;u<=w;u++){var K0=q[2*u+1];K0!==0&&(q[2*u]=p(Q0[K0]++,K0))}}function R(q){var w;for(w=0;w>1;1<=x;x--)v(q,Q0,x);for(u=M0;x=q.heap[1],q.heap[1]=q.heap[q.heap_len--],v(q,Q0,1),l=q.heap[1],q.heap[--q.heap_max]=x,q.heap[--q.heap_max]=l,Q0[2*u]=Q0[2*x]+Q0[2*l],q.depth[u]=(q.depth[x]>=q.depth[l]?q.depth[x]:q.depth[l])+1,Q0[2*x+1]=Q0[2*l+1]=u,q.heap[1]=u++,v(q,Q0,1),2<=q.heap_len;);q.heap[--q.heap_max]=q.heap[1],function(H0,v0){var j2,l0,t2,D0,A1,z8,K2=v0.dyn_tree,NU=v0.max_code,H7=v0.stat_desc.static_tree,j7=v0.stat_desc.has_stree,z7=v0.stat_desc.extra_bits,RU=v0.stat_desc.extra_base,e2=v0.stat_desc.max_length,P1=0;for(D0=0;D0<=O;D0++)H0.bl_count[D0]=0;for(K2[2*H0.heap[H0.heap_max]+1]=0,j2=H0.heap_max+1;j2>=7;u>>=1)if(1&w0&&K0.dyn_ltree[2*M0]!==0)return X;if(K0.dyn_ltree[18]!==0||K0.dyn_ltree[20]!==0||K0.dyn_ltree[26]!==0)return Q;for(M0=32;M0>>3,(Q0=q.static_len+3+7>>>3)<=u&&(u=Q0)):u=Q0=x+5,x+4<=u&&w!==-1?K(q,w,x,l):q.strategy===4||Q0===u?(n(q,2+(l?1:0),3),b(q,V0,S)):(n(q,4+(l?1:0),3),function(K0,M0,w0,H0){var v0;for(n(K0,M0-257,5),n(K0,w0-1,5),n(K0,H0-4,4),v0=0;v0>>8&255,q.pending_buf[q.d_buf+2*q.last_lit+1]=255&w,q.pending_buf[q.l_buf+q.last_lit]=255&x,q.last_lit++,w===0?q.dyn_ltree[2*x]++:(q.matches++,w--,q.dyn_ltree[2*(N[x]+W+1)]++,q.dyn_dtree[2*_(w)]++),q.last_lit===q.lit_bufsize-1},J._tr_align=function(q){n(q,2,3),Z0(q,M,V0),function(w){w.bi_valid===16?(r(w,w.bi_buf),w.bi_buf=0,w.bi_valid=0):8<=w.bi_valid&&(w.pending_buf[w.pending++]=255&w.bi_buf,w.bi_buf>>=8,w.bi_valid-=8)}(q)}},{"../utils/common":41}],53:[function(Y,Z,J){Z.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(Y,Z,J){(function(G){(function(X,Q){if(!X.setImmediate){var B,F,z,W,k=1,D={},C=!1,H=X.document,O=Object.getPrototypeOf&&Object.getPrototypeOf(X);O=O&&O.setTimeout?O:X,B={}.toString.call(X.process)==="[object process]"?function(L){j0.nextTick(function(){j(L)})}:function(){if(X.postMessage&&!X.importScripts){var L=!0,A=X.onmessage;return X.onmessage=function(){L=!1},X.postMessage("","*"),X.onmessage=A,L}}()?(W="setImmediate$"+Math.random()+"$",X.addEventListener?X.addEventListener("message",M,!1):X.attachEvent("onmessage",M),function(L){X.postMessage(W+L,"*")}):X.MessageChannel?((z=new MessageChannel).port1.onmessage=function(L){j(L.data)},function(L){z.port2.postMessage(L)}):H&&("onreadystatechange"in H.createElement("script"))?(F=H.documentElement,function(L){var A=H.createElement("script");A.onreadystatechange=function(){j(L),A.onreadystatechange=null,F.removeChild(A),A=null},F.appendChild(A)}):function(L){setTimeout(j,0,L)},O.setImmediate=function(L){typeof L!="function"&&(L=Function(""+L));for(var A=Array(arguments.length-1),y=0;y"u"?G===void 0?this:G:self)}).call(this,typeof c0<"u"?c0:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})}(I9),I9.exports}var YB=UB(),c2=g9(YB),Z1={exports:{}},w9,dZ;function ZB(){if(dZ)return w9;dZ=1;var $={"&":"&",'"':""","'":"'","<":"<",">":">"};function U(Y){return Y&&Y.replace?Y.replace(/([&"<>'])/g,function(Z,J){return $[J]}):Y}return w9=U,w9}var cZ;function QB(){if(cZ)return Z1.exports;cZ=1;var $=ZB(),U=m9().Stream,Y=" ";function Z(F,z){if(typeof z!=="object")z={indent:z};var W=z.stream?new U:null,k="",D=!1,C=!z.indent?"":z.indent===!0?Y:z.indent,H=!0;function O(A){if(!H)A();else j0.nextTick(A)}function V(A,y){if(y!==void 0)k+=y;if(A&&!D)W=W||new U,D=!0;if(A&&D){var g=k;O(function(){W.emit("data",g)}),k=""}}function j(A,y){Q(V,X(A,C,C?1:0),y)}function M(){if(W){var A=k;O(function(){W.emit("data",A),W.emit("end"),W.readable=!1,W.emit("close")})}}function L(A){var y=A.encoding||"UTF-8",g={version:"1.0",encoding:y};if(A.standalone)g.standalone=A.standalone;j({"?xml":{_attr:g}}),k=k.replace("/>","?>")}if(O(function(){H=!1}),z.declaration)L(z.declaration);if(F&&F.forEach)F.forEach(function(A,y){var g;if(y+1===F.length)g=M;j(A,g)});else j(F,M);if(W)return W.readable=!0,W;return k}function J(){var F=Array.prototype.slice.call(arguments),z={_elem:X(F)};return z.push=function(W){if(!this.append)throw Error("not assigned to a parent!");var k=this,D=this._elem.indent;Q(this.append,X(W,D,this._elem.icount+(D?1:0)),function(){k.append(!0)})},z.close=function(W){if(W!==void 0)this.push(W);if(this.end)this.end()},z}function G(F,z){return Array(z||0).join(F||"")}function X(F,z,W){W=W||0;var k=G(z,W),D,C=F,H=!1;if(typeof F==="object"){var O=Object.keys(F);if(D=O[0],C=F[D],C&&C._elem)return C._elem.name=D,C._elem.icount=W,C._elem.indent=z,C._elem.indents=k,C._elem.interrupt=C,C._elem}var V=[],j=[],M;function L(A){var y=Object.keys(A);y.forEach(function(g){V.push(B(g,A[g]))})}switch(typeof C){case"object":if(C===null)break;if(C._attr)L(C._attr);if(C._cdata)j.push(("/g,"]]]]>")+"]]>");if(C.forEach){if(M=!1,j.push(""),C.forEach(function(A){if(typeof A=="object"){var y=Object.keys(A)[0];if(y=="_attr")L(A._attr);else j.push(X(A,z,W+1))}else j.pop(),M=!0,j.push($(A))}),!M)j.push("")}break;default:j.push($(C))}return{name:D,interrupt:H,attributes:V,content:j,icount:W,indents:k,indent:z}}function Q(F,z,W){if(typeof z!="object")return F(!1,z);var k=z.interrupt?1:z.content.length;function D(){while(z.content.length){var H=z.content.shift();if(H===void 0)continue;if(C(H))return;Q(F,H)}if(F(!1,(k>1?z.indents:"")+(z.name?"":"")+(z.indent&&!W?` -`:"")),W)W()}function C(H){if(H.interrupt)return H.interrupt.append=F,H.interrupt.end=D,H.interrupt=!1,F(!0),!0;return!1}if(F(!1,z.indents+(z.name?"<"+z.name:"")+(z.attributes.length?" "+z.attributes.join(" "):"")+(k?z.name?">":"":z.name?"/>":"")+(z.indent&&k>1?` -`:"")),!k)return F(!1,z.indent?` -`:"");if(!C(z))D()}function B(F,z){return F+'="'+$(z)+'"'}return Z1.exports=Z,Z1.exports.element=Z1.exports.Element=J,Z1.exports}var JB=QB(),F0=g9(JB),Q1=0,W9=32,GB=32,KB=($,U)=>{let Y=U.replace(/-/g,"");if(Y.length!==GB)throw Error(`Error: Cannot extract GUID from font filename: ${U}`);let J=Y.replace(/(..)/g,"$1 ").trim().split(" ").map((B)=>parseInt(B,16));J.reverse();let X=$.slice(Q1,W9).map((B,F)=>B^J[F%J.length]),Q=new Uint8Array(Q1+X.length+Math.max(0,$.length-W9));return Q.set($.slice(0,Q1)),Q.set(X,Q1),Q.set($.slice(W9),Q1+X.length),Q};class H8{format($,U={stack:[]}){let Y=$.prepForXml(U);if(Y)return Y;else throw Error("XMLComponent did not format correctly")}}class jU{replace($,U,Y){let Z=$;return U.forEach((J,G)=>{Z=Z.replace(new RegExp(`{${J.fileName}}`,"g"),(Y+G).toString())}),Z}getMediaData($,U){return U.Array.filter((Y)=>$.search(`{${Y.fileName}}`)>0)}}class K7{replace($,U){let Y=$;for(let Z of U)Y=Y.replace(new RegExp(`{${Z.reference}-${Z.instance}}`,"g"),Z.numId.toString());return Y}}class q7{constructor(){Y0(this,"formatter"),Y0(this,"imageReplacer"),Y0(this,"numberingReplacer"),this.formatter=new H8,this.imageReplacer=new jU,this.numberingReplacer=new K7}compile($,U,Y=[]){let Z=new c2,J=this.xmlifyFile($,U),G=new Map(Object.entries(J));for(let[,X]of G)if(Array.isArray(X))for(let Q of X)Z.file(Q.path,X1(Q.data));else Z.file(X.path,X1(X.data));for(let X of Y)Z.file(X.path,X1(X.data));for(let X of $.Media.Array)if(X.type!=="svg")Z.file(`word/media/${X.fileName}`,X.data);else Z.file(`word/media/${X.fileName}`,X.data),Z.file(`word/media/${X.fallback.fileName}`,X.fallback.data);for(let{data:X,name:Q,fontKey:B}of $.FontTable.fontOptionsWithKey){let[F]=Q.split(".");Z.file(`word/fonts/${F}.odttf`,KB(X,B))}return Z}xmlifyFile($,U){let Y=$.Document.Relationships.RelationshipCount+1,Z=F0(this.formatter.format($.Document.View,{viewWrapper:$.Document,file:$,stack:[]}),{indent:U,declaration:{standalone:"yes",encoding:"UTF-8"}}),J=$.Comments.Relationships.RelationshipCount+1,G=F0(this.formatter.format($.Comments,{viewWrapper:{View:$.Comments,Relationships:$.Comments.Relationships},file:$,stack:[]}),{indent:U,declaration:{standalone:"yes",encoding:"UTF-8"}}),X=$.FootNotes.Relationships.RelationshipCount+1,Q=F0(this.formatter.format($.FootNotes.View,{viewWrapper:$.FootNotes,file:$,stack:[]}),{indent:U,declaration:{standalone:"yes",encoding:"UTF-8"}}),B=this.imageReplacer.getMediaData(Z,$.Media),F=this.imageReplacer.getMediaData(G,$.Media),z=this.imageReplacer.getMediaData(Q,$.Media);return{Relationships:{data:(()=>{return B.forEach((W,k)=>{$.Document.Relationships.addRelationship(Y+k,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${W.fileName}`)}),$.Document.Relationships.addRelationship($.Document.Relationships.RelationshipCount+1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable","fontTable.xml"),F0(this.formatter.format($.Document.Relationships,{viewWrapper:$.Document,file:$,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/document.xml.rels"},Document:{data:(()=>{let W=this.imageReplacer.replace(Z,B,Y);return this.numberingReplacer.replace(W,$.Numbering.ConcreteNumbering)})(),path:"word/document.xml"},Styles:{data:(()=>{let W=F0(this.formatter.format($.Styles,{viewWrapper:$.Document,file:$,stack:[]}),{indent:U,declaration:{standalone:"yes",encoding:"UTF-8"}});return this.numberingReplacer.replace(W,$.Numbering.ConcreteNumbering)})(),path:"word/styles.xml"},Properties:{data:F0(this.formatter.format($.CoreProperties,{viewWrapper:$.Document,file:$,stack:[]}),{indent:U,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/core.xml"},Numbering:{data:F0(this.formatter.format($.Numbering,{viewWrapper:$.Document,file:$,stack:[]}),{indent:U,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/numbering.xml"},FileRelationships:{data:F0(this.formatter.format($.FileRelationships,{viewWrapper:$.Document,file:$,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}}),path:"_rels/.rels"},HeaderRelationships:$.Headers.map((W,k)=>{let D=F0(this.formatter.format(W.View,{viewWrapper:W,file:$,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}});return this.imageReplacer.getMediaData(D,$.Media).forEach((H,O)=>{W.Relationships.addRelationship(O,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${H.fileName}`)}),{data:F0(this.formatter.format(W.Relationships,{viewWrapper:W,file:$,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}}),path:`word/_rels/header${k+1}.xml.rels`}}),FooterRelationships:$.Footers.map((W,k)=>{let D=F0(this.formatter.format(W.View,{viewWrapper:W,file:$,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}});return this.imageReplacer.getMediaData(D,$.Media).forEach((H,O)=>{W.Relationships.addRelationship(O,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${H.fileName}`)}),{data:F0(this.formatter.format(W.Relationships,{viewWrapper:W,file:$,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}}),path:`word/_rels/footer${k+1}.xml.rels`}}),Headers:$.Headers.map((W,k)=>{let D=F0(this.formatter.format(W.View,{viewWrapper:W,file:$,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}}),C=this.imageReplacer.getMediaData(D,$.Media),H=this.imageReplacer.replace(D,C,0);return{data:this.numberingReplacer.replace(H,$.Numbering.ConcreteNumbering),path:`word/header${k+1}.xml`}}),Footers:$.Footers.map((W,k)=>{let D=F0(this.formatter.format(W.View,{viewWrapper:W,file:$,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}}),C=this.imageReplacer.getMediaData(D,$.Media),H=this.imageReplacer.replace(D,C,0);return{data:this.numberingReplacer.replace(H,$.Numbering.ConcreteNumbering),path:`word/footer${k+1}.xml`}}),ContentTypes:{data:F0(this.formatter.format($.ContentTypes,{viewWrapper:$.Document,file:$,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}}),path:"[Content_Types].xml"},CustomProperties:{data:F0(this.formatter.format($.CustomProperties,{viewWrapper:$.Document,file:$,stack:[]}),{indent:U,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/custom.xml"},AppProperties:{data:F0(this.formatter.format($.AppProperties,{viewWrapper:$.Document,file:$,stack:[]}),{indent:U,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/app.xml"},FootNotes:{data:(()=>{let W=this.imageReplacer.replace(Q,z,X);return this.numberingReplacer.replace(W,$.Numbering.ConcreteNumbering)})(),path:"word/footnotes.xml"},FootNotesRelationships:{data:(()=>{return z.forEach((W,k)=>{$.FootNotes.Relationships.addRelationship(X+k,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${W.fileName}`)}),F0(this.formatter.format($.FootNotes.Relationships,{viewWrapper:$.FootNotes,file:$,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/footnotes.xml.rels"},Endnotes:{data:F0(this.formatter.format($.Endnotes.View,{viewWrapper:$.Endnotes,file:$,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}}),path:"word/endnotes.xml"},EndnotesRelationships:{data:F0(this.formatter.format($.Endnotes.Relationships,{viewWrapper:$.Endnotes,file:$,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}}),path:"word/_rels/endnotes.xml.rels"},Settings:{data:F0(this.formatter.format($.Settings,{viewWrapper:$.Document,file:$,stack:[]}),{indent:U,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/settings.xml"},Comments:{data:(()=>{let W=this.imageReplacer.replace(G,F,J);return this.numberingReplacer.replace(W,$.Numbering.ConcreteNumbering)})(),path:"word/comments.xml"},CommentsRelationships:{data:(()=>{return F.forEach((W,k)=>{$.Comments.Relationships.addRelationship(J+k,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${W.fileName}`)}),F0(this.formatter.format($.Comments.Relationships,{viewWrapper:{View:$.Comments,Relationships:$.Comments.Relationships},file:$,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/comments.xml.rels"},FontTable:{data:F0(this.formatter.format($.FontTable.View,{viewWrapper:$.Document,file:$,stack:[]}),{indent:U,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/fontTable.xml"},FontTableRelationships:{data:(()=>F0(this.formatter.format($.FontTable.Relationships,{viewWrapper:$.Document,file:$,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}}))(),path:"word/_rels/fontTable.xml.rels"}}}}var X7={NONE:"",WITH_2_BLANKS:" ",WITH_4_BLANKS:" ",WITH_TAB:"\t"},mZ=($)=>$===!0?X7.WITH_2_BLANKS:$===!1?void 0:$,V7=class ${static pack(U,Y,Z){return b9(this,arguments,function*(J,G,X,Q=[]){return this.compiler.compile(J,mZ(X),Q).generateAsync({type:G,mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"})})}static toString(U,Y,Z=[]){return $.pack(U,"string",Y,Z)}static toBuffer(U,Y,Z=[]){return $.pack(U,"nodebuffer",Y,Z)}static toBase64String(U,Y,Z=[]){return $.pack(U,"base64",Y,Z)}static toBlob(U,Y,Z=[]){return $.pack(U,"blob",Y,Z)}static toArrayBuffer(U,Y,Z=[]){return $.pack(U,"arraybuffer",Y,Z)}static toStream(U,Y,Z=[]){let J=new $B.Stream;return this.compiler.compile(U,mZ(Y),Z).generateAsync({type:"nodebuffer",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"}).then((X)=>{J.emit("data",X),J.emit("end")}),J}};Y0(V7,"compiler",new q7);var qB=V7,XB=new H8,j8=($)=>{return $8.xml2js($,{compact:!1,captureSpacesBetweenElements:!0})},B7=($)=>{var U;return(U=j8(F0(XB.format(new a2({text:$})))).elements[0].elements)!=null?U:[]},L7=($)=>R0(W0({},$),{attributes:{"xml:space":"preserve"}}),zU=($,U)=>{var Y,Z;return(Z=(Y=$.elements)==null?void 0:Y.filter((J)=>J.name===U)[0].elements)!=null?Z:[]},h2=($,U,Y)=>{let Z=zU($,"Types");if(Z.some((G)=>{var X,Q;return G.type==="element"&&G.name==="Default"&&((X=G==null?void 0:G.attributes)==null?void 0:X.ContentType)===U&&((Q=G==null?void 0:G.attributes)==null?void 0:Q.Extension)===Y}))return;Z.push({attributes:{ContentType:U,Extension:Y},name:"Default",type:"element"})},VB=($)=>{let U=parseInt($.substring(3),10);return isNaN(U)?0:U},BB=($)=>{return zU($,"Relationships").map((Y)=>{var Z,J,G;return VB((G=(J=(Z=Y.attributes)==null?void 0:Z.Id)==null?void 0:J.toString())!=null?G:"")}).reduce((Y,Z)=>Math.max(Y,Z),0)+1},lZ=($,U,Y,Z,J)=>{let G=zU($,"Relationships");return G.push({attributes:{Id:`rId${U}`,Type:Y,Target:Z,TargetMode:J},name:"Relationship",type:"element"}),G};class M7 extends Error{constructor($){super(`Token ${$} not found`);this.name="TokenNotFoundError"}}var LB=($,U)=>{var Y,Z,J,G;for(let X=0;X<((Y=$.elements)!=null?Y:[]).length;X++){let Q=$.elements[X];if(Q.type==="element"&&Q.name==="w:r"){let B=((Z=Q.elements)!=null?Z:[]).filter((F)=>F.type==="element"&&F.name==="w:t");for(let F of B){if(!((J=F.elements)==null?void 0:J[0]))continue;if((G=F.elements[0].text)==null?void 0:G.includes(U))return X}}}throw new M7(U)},MB=($,U)=>{var Y,Z;let J=-1,G=(Z=(Y=$.elements)==null?void 0:Y.map((B,F)=>{var z,W,k;if(J!==-1)return B;if(B.type==="element"&&B.name==="w:t"){let C=((k=(W=(z=B.elements)==null?void 0:z[0])==null?void 0:W.text)!=null?k:"").split(U),H=C.map((O)=>R0(W0(W0({},B),L7(B)),{elements:B7(O)}));if(C.length>1)J=F;return H}else return B}).flat())!=null?Z:[],X=R0(W0({},JSON.parse(JSON.stringify($))),{elements:G.slice(0,J+1)}),Q=R0(W0({},JSON.parse(JSON.stringify($))),{elements:G.slice(J+1)});return{left:X,right:Q}},J1={START:0,MIDDLE:1,END:2},IB=({paragraphElement:$,renderedParagraph:U,originalText:Y,replacementText:Z})=>{let J=U.text.indexOf(Y),G=J+Y.length-1,X=J1.START;for(let Q of U.runs)for(let{text:B,index:F,start:z,end:W}of Q.parts)switch(X){case J1.START:if(J>=z&&J<=W){let k=J-z,D=Math.min(G,W)-z,C=Q.text.substring(k,D+1);if(C==="")continue;let H=B.replace(C,Z);H9($.elements[Q.index].elements[F],H),X=J1.MIDDLE;continue}break;case J1.MIDDLE:if(G<=W){let k=B.substring(G-z+1);H9($.elements[Q.index].elements[F],k);let D=$.elements[Q.index].elements[F];$.elements[Q.index].elements[F]=L7(D),X=J1.END}else H9($.elements[Q.index].elements[F],"");break}return $},H9=($,U)=>{return $.elements=B7(U),$},wB=($)=>{if($.element.name!=="w:p")throw Error(`Invalid node type: ${$.element.name}`);if(!$.element.elements)return{text:"",runs:[],index:-1,pathToParagraph:[]};let U=0,Y=$.element.elements.map((J,G)=>({element:J,i:G})).filter(({element:J})=>J.name==="w:r").map(({element:J,i:G})=>{let X=WB(J,G,U);return U+=X.text.length,X}).filter((J)=>!!J);return{text:Y.reduce((J,G)=>J+G.text,""),runs:Y,index:$.index,pathToParagraph:I7($)}},WB=($,U,Y)=>{if(!$.elements)return{text:"",parts:[],index:-1,start:Y,end:Y};let Z=Y,J=$.elements.map((X,Q)=>{var B,F;return X.name==="w:t"&&X.elements&&X.elements.length>0?{text:(F=(B=X.elements[0].text)==null?void 0:B.toString())!=null?F:"",index:Q,start:Z,end:(()=>{var z,W;return Z+=((W=(z=X.elements[0].text)==null?void 0:z.toString())!=null?W:"").length-1,Z})()}:void 0}).filter((X)=>!!X).map((X)=>X);return{text:J.reduce((X,Q)=>X+Q.text,""),parts:J,index:U,start:Y,end:Z}},I7=($)=>$.parent?[...I7($.parent),$.index]:[$.index],aZ=($)=>{var U,Y;return(Y=(U=$.element.elements)==null?void 0:U.map((Z,J)=>({element:Z,index:J,parent:$})))!=null?Y:[]},w7=($)=>{let U=[],Y=[...aZ({element:$,index:0,parent:void 0})],Z;while(Y.length>0){if(Z=Y.shift(),Z.element.name==="w:p")U=[...U,wB(Z)];Y.push(...aZ(Z))}return U},HB=($,U)=>w7($).filter((Y)=>Y.text.includes(U)),jB=new H8,j9="ɵ",zB=({json:$,patch:U,patchText:Y,context:Z,keepOriginalStyles:J=!0})=>{let G=HB($,Y);if(G.length===0)return{element:$,didFindOccurrence:!1};for(let X of G){let Q=U.children.map((B)=>j8(F0(jB.format(B,Z)))).map((B)=>B.elements[0]);switch(U.type){case y9.DOCUMENT:{let B=FB($,X.pathToParagraph),F=NB(X.pathToParagraph);B.elements.splice(F,1,...Q);break}case y9.PARAGRAPH:default:{let B=W7($,X.pathToParagraph);IB({paragraphElement:B,renderedParagraph:X,originalText:Y,replacementText:j9});let F=LB(B,j9),z=B.elements[F],{left:W,right:k}=MB(z,j9),D=Q,C=k;if(J){let H=z.elements.filter((O)=>O.type==="element"&&O.name==="w:rPr");D=Q.map((O)=>{var V;return R0(W0({},O),{elements:[...H,...(V=O.elements)!=null?V:[]]})}),C=R0(W0({},k),{elements:[...H,...k.elements]})}B.elements.splice(F,1,W,...D,C);break}}}return{element:$,didFindOccurrence:!0}},W7=($,U)=>{let Y=$;for(let Z=1;ZW7($,U.slice(0,U.length-1)),NB=($)=>$[$.length-1],y9={DOCUMENT:"file",PARAGRAPH:"paragraph"},pZ=new jU,RB=new Uint8Array([255,254]),DB=new Uint8Array([254,255]),iZ=($,U)=>{if($.length!==U.length)return!1;for(let Y=0;Y<$.length;Y++)if($[Y]!==U[Y])return!1;return!0},AB=($)=>b9(null,[$],function*({outputType:U,data:Y,patches:Z,keepOriginalStyles:J,placeholderDelimiters:G={start:"{{",end:"}}"},recursive:X=!0}){var Q,B,F;let z=Y instanceof c2?Y:yield c2.loadAsync(Y),W=new Map,k={Media:new w8},D=new Map,C=[],H=[],O=!1,V=new Map;for(let[M,L]of Object.entries(z.files)){let A=yield L.async("uint8array"),y=A.slice(0,2);if(iZ(y,RB)||iZ(y,DB)){V.set(M,A);continue}if(!M.endsWith(".xml")&&!M.endsWith(".rels")){V.set(M,A);continue}let g=j8(yield L.async("text"));if(M==="word/document.xml"){let d=(Q=g.elements)==null?void 0:Q.find((E)=>E.name==="w:document");if(d&&d.attributes){for(let E of["mc","wp","r","w15","m"])d.attributes[`xmlns:${E}`]=p1[E];d.attributes["mc:Ignorable"]=`${d.attributes["mc:Ignorable"]||""} w15`.trim()}}if(M.startsWith("word/")&&!M.endsWith(".xml.rels")){let d={file:k,viewWrapper:{Relationships:{addRelationship:(S,h,N,a)=>{H.push({key:M,hyperlink:{id:S,link:N}})}}},stack:[]};if(W.set(M,d),!(G==null?void 0:G.start.trim())||!(G==null?void 0:G.end.trim()))throw Error("Both start and end delimiters must be non-empty strings.");let{start:E,end:s}=G;for(let[S,h]of Object.entries(Z)){let N=`${E}${S}${s}`;while(!0){let{didFindOccurrence:a}=zB({json:g,patch:R0(W0({},h),{children:h.children.map(($0)=>{if($0 instanceof K8){let m=new _2($0.options.children,R1());return H.push({key:M,hyperlink:{id:m.linkId,link:$0.options.link}}),m}else return $0})}),patchText:N,context:d,keepOriginalStyles:J});if(!X||!a)break}}let V0=pZ.getMediaData(JSON.stringify(g),d.file.Media);if(V0.length>0)O=!0,C.push({key:M,mediaDatas:V0})}D.set(M,g)}for(let{key:M,mediaDatas:L}of C){let A=`word/_rels/${M.split("/").pop()}.rels`,y=(B=D.get(A))!=null?B:rZ();D.set(A,y);let g=BB(y),d=pZ.replace(JSON.stringify(D.get(M)),L,g);D.set(M,JSON.parse(d));for(let E=0;E{return $8.js2xml($,{attributeValueFn:(Y)=>String(Y).replace(/&(?!amp;|lt;|gt;|quot;|apos;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")})},rZ=()=>({declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"Relationships",attributes:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},elements:[]}]}),TB=($)=>b9(null,[$],function*({data:U}){let Y=U instanceof c2?U:yield c2.loadAsync(U),Z=new Set;for(let[J,G]of Object.entries(Y.files)){if(!J.endsWith(".xml")&&!J.endsWith(".rels"))continue;if(J.startsWith("word/")&&!J.endsWith(".xml.rels")){let X=j8(yield G.async("text"));w7(X).forEach((Q)=>CB(Q.text).forEach((B)=>Z.add(B)))}}return Array.from(Z)}),CB=($)=>{var U;let Y=new RegExp("(?<=\\{\\{).+?(?=\\}\\})","gs");return(U=$.match(Y))!=null?U:[]};if(typeof globalThis.Buffer>"u")globalThis.Buffer=G0;if(typeof globalThis.process>"u")globalThis.process=OB;globalThis.__bundles=globalThis.__bundles||{};globalThis.__bundles.docx=FU;})(); +(()=>{var R5=Object.create;var{getPrototypeOf:L5,defineProperty:p1,getOwnPropertyNames:I5}=Object;var O5=Object.prototype.hasOwnProperty;function F5(B){return this[B]}var H5,W5,P5=(B,U,G)=>{var Y=B!=null&&typeof B==="object";if(Y){var Q=U?H5??=new WeakMap:W5??=new WeakMap,K=Q.get(B);if(K)return K}G=B!=null?R5(L5(B)):{};let Z=U||!B||!B.__esModule?p1(G,"default",{value:B,enumerable:!0}):G;for(let J of I5(B))if(!O5.call(Z,J))p1(Z,J,{get:F5.bind(B,J),enumerable:!0});if(Y)Q.set(B,Z);return Z};var w5=(B,U)=>()=>(U||B((U={exports:{}}).exports,U),U.exports);var A5=(B)=>B;function j5(B,U){this[B]=A5.bind(null,U)}var N5=(B,U)=>{for(var G in U)p1(B,G,{get:U[G],enumerable:!0,configurable:!0,set:j5.bind(U,G)})};var h6=w5((L7,_6)=>{var z0=_6.exports={},p0,r0;function Y8(){throw Error("setTimeout has not been defined")}function Z8(){throw Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function")p0=setTimeout;else p0=Y8}catch(B){p0=Y8}try{if(typeof clearTimeout==="function")r0=clearTimeout;else r0=Z8}catch(B){r0=Z8}})();function g6(B){if(p0===setTimeout)return setTimeout(B,0);if((p0===Y8||!p0)&&setTimeout)return p0=setTimeout,setTimeout(B,0);try{return p0(B,0)}catch(U){try{return p0.call(null,B,0)}catch(G){return p0.call(this,B,0)}}}function UU(B){if(r0===clearTimeout)return clearTimeout(B);if((r0===Z8||!r0)&&clearTimeout)return r0=clearTimeout,clearTimeout(B);try{return r0(B)}catch(U){try{return r0.call(null,B)}catch(G){return r0.call(this,B)}}}var Q2=[],b2=!1,z2,j1=-1;function GU(){if(!b2||!z2)return;if(b2=!1,z2.length)Q2=z2.concat(Q2);else j1=-1;if(Q2.length)f6()}function f6(){if(b2)return;var B=g6(GU);b2=!0;var U=Q2.length;while(U){z2=Q2,Q2=[];while(++j11)for(var G=1;G"u")O6.global=globalThis;var l0=[],h0=[],r1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(j2=0,F6=r1.length;j20)throw Error("Invalid string. Length must be a multiple of 4");var G=B.indexOf("=");if(G===-1)G=U;var Y=G===U?0:4-G%4;return[G,Y]}function E5(B,U){return(B+U)*3/4-U}function T5(B){var U,G=z5(B),Y=G[0],Q=G[1],K=new Uint8Array(E5(Y,Q)),Z=0,J=Q>0?Y-4:Y,M;for(M=0;M>16&255,K[Z++]=U>>8&255,K[Z++]=U&255;if(Q===2)U=h0[B.charCodeAt(M)]<<2|h0[B.charCodeAt(M+1)]>>4,K[Z++]=U&255;if(Q===1)U=h0[B.charCodeAt(M)]<<10|h0[B.charCodeAt(M+1)]<<4|h0[B.charCodeAt(M+2)]>>2,K[Z++]=U>>8&255,K[Z++]=U&255;return K}function D5(B){return l0[B>>18&63]+l0[B>>12&63]+l0[B>>6&63]+l0[B&63]}function C5(B,U,G){var Y,Q=[];for(var K=U;KJ?J:Z+K));if(Y===1)U=B[G-1],Q.push(l0[U>>2]+l0[U<<4&63]+"==");else if(Y===2)U=(B[G-2]<<8)+B[G-1],Q.push(l0[U>>10]+l0[U>>4&63]+l0[U<<2&63]+"=");return Q.join("")}function w1(B,U,G,Y,Q){var K,Z,J=Q*8-Y-1,M=(1<>1,I=-7,F=G?Q-1:0,D=G?-1:1,w=B[U+F];F+=D,K=w&(1<<-I)-1,w>>=-I,I+=J;for(;I>0;K=K*256+B[U+F],F+=D,I-=8);Z=K&(1<<-I)-1,K>>=-I,I+=Y;for(;I>0;Z=Z*256+B[U+F],F+=D,I-=8);if(K===0)K=1-W;else if(K===M)return Z?NaN:(w?-1:1)*(1/0);else Z=Z+Math.pow(2,Y),K=K-W;return(w?-1:1)*Z*Math.pow(2,K-Y)}function j6(B,U,G,Y,Q,K){var Z,J,M,W=K*8-Q-1,I=(1<>1,D=Q===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=Y?0:K-1,P=Y?1:-1,A=U<0||U===0&&1/U<0?1:0;if(U=Math.abs(U),isNaN(U)||U===1/0)J=isNaN(U)?1:0,Z=I;else{if(Z=Math.floor(Math.log(U)/Math.LN2),U*(M=Math.pow(2,-Z))<1)Z--,M*=2;if(Z+F>=1)U+=D/M;else U+=D*Math.pow(2,1-F);if(U*M>=2)Z++,M/=2;if(Z+F>=I)J=0,Z=I;else if(Z+F>=1)J=(U*M-1)*Math.pow(2,Q),Z=Z+F;else J=U*Math.pow(2,F-1)*Math.pow(2,Q),Z=0}for(;Q>=8;B[G+w]=J&255,w+=P,J/=256,Q-=8);Z=Z<0;B[G+w]=Z&255,w+=P,Z/=256,W-=8);B[G+w-P]|=A*128}var W6=typeof Symbol==="function"&&typeof Symbol.for==="function"?Symbol.for("nodejs.util.inspect.custom"):null,k5=50,i1=2147483647;var{btoa:Z7,atob:Q7,File:J7,Blob:K7}=globalThis;function Z2(B){if(B>i1)throw RangeError('The value "'+B+'" is invalid for option "size"');let U=new Uint8Array(B);return Object.setPrototypeOf(U,J0.prototype),U}function e1(B,U,G){return class extends G{constructor(){super();Object.defineProperty(this,"message",{value:U.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${B}]`,this.stack,delete this.name}get code(){return B}set code(Y){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Y,writable:!0})}toString(){return`${this.name} [${B}]: ${this.message}`}}}var $5=e1("ERR_BUFFER_OUT_OF_BOUNDS",function(B){if(B)return`${B} is outside of buffer bounds`;return"Attempt to access memory outside buffer bounds"},RangeError),S5=e1("ERR_INVALID_ARG_TYPE",function(B,U){return`The "${B}" argument must be of type number. Received type ${typeof U}`},TypeError),n1=e1("ERR_OUT_OF_RANGE",function(B,U,G){let Y=`The value of "${B}" is out of range.`,Q=G;if(Number.isInteger(G)&&Math.abs(G)>4294967296)Q=A6(String(G));else if(typeof G==="bigint"){if(Q=String(G),G>BigInt(2)**BigInt(32)||G<-(BigInt(2)**BigInt(32)))Q=A6(Q);Q+="n"}return Y+=` It must be ${U}. Received ${Q}`,Y},RangeError);function J0(B,U,G){if(typeof B==="number"){if(typeof U==="string")throw TypeError('The "string" argument must be of type string. Received type number');return B8(B)}return N6(B,U,G)}Object.defineProperty(J0.prototype,"parent",{enumerable:!0,get:function(){if(!J0.isBuffer(this))return;return this.buffer}});Object.defineProperty(J0.prototype,"offset",{enumerable:!0,get:function(){if(!J0.isBuffer(this))return;return this.byteOffset}});J0.poolSize=8192;function N6(B,U,G){if(typeof B==="string")return v5(B,U);if(ArrayBuffer.isView(B))return y5(B);if(B==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof B);if(a0(B,ArrayBuffer)||B&&a0(B.buffer,ArrayBuffer))return o1(B,U,G);if(typeof SharedArrayBuffer<"u"&&(a0(B,SharedArrayBuffer)||B&&a0(B.buffer,SharedArrayBuffer)))return o1(B,U,G);if(typeof B==="number")throw TypeError('The "value" argument must not be of type number. Received type number');let Y=B.valueOf&&B.valueOf();if(Y!=null&&Y!==B)return J0.from(Y,U,G);let Q=g5(B);if(Q)return Q;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof B[Symbol.toPrimitive]==="function")return J0.from(B[Symbol.toPrimitive]("string"),U,G);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof B)}J0.from=function(B,U,G){return N6(B,U,G)};Object.setPrototypeOf(J0.prototype,Uint8Array.prototype);Object.setPrototypeOf(J0,Uint8Array);function z6(B){if(typeof B!=="number")throw TypeError('"size" argument must be of type number');else if(B<0)throw RangeError('The value "'+B+'" is invalid for option "size"')}function b5(B,U,G){if(z6(B),B<=0)return Z2(B);if(U!==void 0)return typeof G==="string"?Z2(B).fill(U,G):Z2(B).fill(U);return Z2(B)}J0.alloc=function(B,U,G){return b5(B,U,G)};function B8(B){return z6(B),Z2(B<0?0:U8(B)|0)}J0.allocUnsafe=function(B){return B8(B)};J0.allocUnsafeSlow=function(B){return B8(B)};function v5(B,U){if(typeof U!=="string"||U==="")U="utf8";if(!J0.isEncoding(U))throw TypeError("Unknown encoding: "+U);let G=E6(B,U)|0,Y=Z2(G),Q=Y.write(B,U);if(Q!==G)Y=Y.slice(0,Q);return Y}function s1(B){let U=B.length<0?0:U8(B.length)|0,G=Z2(U);for(let Y=0;Y=i1)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i1.toString(16)+" bytes");return B|0}J0.isBuffer=function(B){return B!=null&&B._isBuffer===!0&&B!==J0.prototype};J0.compare=function(B,U){if(a0(B,Uint8Array))B=J0.from(B,B.offset,B.byteLength);if(a0(U,Uint8Array))U=J0.from(U,U.offset,U.byteLength);if(!J0.isBuffer(B)||!J0.isBuffer(U))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(B===U)return 0;let G=B.length,Y=U.length;for(let Q=0,K=Math.min(G,Y);QY.length){if(!J0.isBuffer(K))K=J0.from(K);K.copy(Y,Q)}else Uint8Array.prototype.set.call(Y,K,Q);else if(!J0.isBuffer(K))throw TypeError('"list" argument must be an Array of Buffers');else K.copy(Y,Q);Q+=K.length}return Y};function E6(B,U){if(J0.isBuffer(B))return B.length;if(ArrayBuffer.isView(B)||a0(B,ArrayBuffer))return B.byteLength;if(typeof B!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof B);let G=B.length,Y=arguments.length>2&&arguments[2]===!0;if(!Y&&G===0)return 0;let Q=!1;for(;;)switch(U){case"ascii":case"latin1":case"binary":return G;case"utf8":case"utf-8":return t1(B).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G*2;case"hex":return G>>>1;case"base64":return y6(B).length;default:if(Q)return Y?-1:t1(B).length;U=(""+U).toLowerCase(),Q=!0}}J0.byteLength=E6;function f5(B,U,G){let Y=!1;if(U===void 0||U<0)U=0;if(U>this.length)return"";if(G===void 0||G>this.length)G=this.length;if(G<=0)return"";if(G>>>=0,U>>>=0,G<=U)return"";if(!B)B="utf8";while(!0)switch(B){case"hex":return p5(this,U,G);case"utf8":case"utf-8":return D6(this,U,G);case"ascii":return l5(this,U,G);case"latin1":case"binary":return a5(this,U,G);case"base64":return c5(this,U,G);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r5(this,U,G);default:if(Y)throw TypeError("Unknown encoding: "+B);B=(B+"").toLowerCase(),Y=!0}}J0.prototype._isBuffer=!0;function N2(B,U,G){let Y=B[U];B[U]=B[G],B[G]=Y}J0.prototype.swap16=function(){let B=this.length;if(B%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let U=0;UU)B+=" ... ";return""};if(W6)J0.prototype[W6]=J0.prototype.inspect;J0.prototype.compare=function(B,U,G,Y,Q){if(a0(B,Uint8Array))B=J0.from(B,B.offset,B.byteLength);if(!J0.isBuffer(B))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof B);if(U===void 0)U=0;if(G===void 0)G=B?B.length:0;if(Y===void 0)Y=0;if(Q===void 0)Q=this.length;if(U<0||G>B.length||Y<0||Q>this.length)throw RangeError("out of range index");if(Y>=Q&&U>=G)return 0;if(Y>=Q)return-1;if(U>=G)return 1;if(U>>>=0,G>>>=0,Y>>>=0,Q>>>=0,this===B)return 0;let K=Q-Y,Z=G-U,J=Math.min(K,Z),M=this.slice(Y,Q),W=B.slice(U,G);for(let I=0;I2147483647)G=2147483647;else if(G<-2147483648)G=-2147483648;if(G=+G,Number.isNaN(G))G=Q?0:B.length-1;if(G<0)G=B.length+G;if(G>=B.length)if(Q)return-1;else G=B.length-1;else if(G<0)if(Q)G=0;else return-1;if(typeof U==="string")U=J0.from(U,Y);if(J0.isBuffer(U)){if(U.length===0)return-1;return P6(B,U,G,Y,Q)}else if(typeof U==="number"){if(U=U&255,typeof Uint8Array.prototype.indexOf==="function")if(Q)return Uint8Array.prototype.indexOf.call(B,U,G);else return Uint8Array.prototype.lastIndexOf.call(B,U,G);return P6(B,[U],G,Y,Q)}throw TypeError("val must be string, number or Buffer")}function P6(B,U,G,Y,Q){let K=1,Z=B.length,J=U.length;if(Y!==void 0){if(Y=String(Y).toLowerCase(),Y==="ucs2"||Y==="ucs-2"||Y==="utf16le"||Y==="utf-16le"){if(B.length<2||U.length<2)return-1;K=2,Z/=2,J/=2,G/=2}}function M(I,F){if(K===1)return I[F];else return I.readUInt16BE(F*K)}let W;if(Q){let I=-1;for(W=G;WZ)G=Z-J;for(W=G;W>=0;W--){let I=!0;for(let F=0;FQ)Y=Q;let K=U.length;if(Y>K/2)Y=K/2;let Z;for(Z=0;Z>>0,isFinite(G)){if(G=G>>>0,Y===void 0)Y="utf8"}else Y=G,G=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let Q=this.length-U;if(G===void 0||G>Q)G=Q;if(B.length>0&&(G<0||U<0)||U>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!Y)Y="utf8";let K=!1;for(;;)switch(Y){case"hex":return x5(this,B,U,G);case"utf8":case"utf-8":return _5(this,B,U,G);case"ascii":case"latin1":case"binary":return h5(this,B,U,G);case"base64":return u5(this,B,U,G);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d5(this,B,U,G);default:if(K)throw TypeError("Unknown encoding: "+Y);Y=(""+Y).toLowerCase(),K=!0}};J0.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function c5(B,U,G){if(U===0&&G===B.length)return H6(B);else return H6(B.slice(U,G))}function D6(B,U,G){G=Math.min(B.length,G);let Y=[],Q=U;while(Q239?4:K>223?3:K>191?2:1;if(Q+J<=G){let M,W,I,F;switch(J){case 1:if(K<128)Z=K;break;case 2:if(M=B[Q+1],(M&192)===128){if(F=(K&31)<<6|M&63,F>127)Z=F}break;case 3:if(M=B[Q+1],W=B[Q+2],(M&192)===128&&(W&192)===128){if(F=(K&15)<<12|(M&63)<<6|W&63,F>2047&&(F<55296||F>57343))Z=F}break;case 4:if(M=B[Q+1],W=B[Q+2],I=B[Q+3],(M&192)===128&&(W&192)===128&&(I&192)===128){if(F=(K&15)<<18|(M&63)<<12|(W&63)<<6|I&63,F>65535&&F<1114112)Z=F}}}if(Z===null)Z=65533,J=1;else if(Z>65535)Z-=65536,Y.push(Z>>>10&1023|55296),Z=56320|Z&1023;Y.push(Z),Q+=J}return m5(Y)}var w6=4096;function m5(B){let U=B.length;if(U<=w6)return String.fromCharCode.apply(String,B);let G="",Y=0;while(YY)G=Y;let Q="";for(let K=U;KG)B=G;if(U<0){if(U+=G,U<0)U=0}else if(U>G)U=G;if(UG)throw RangeError("Trying to access beyond buffer length")}J0.prototype.readUintLE=J0.prototype.readUIntLE=function(B,U,G){if(B=B>>>0,U=U>>>0,!G)$0(B,U,this.length);let Y=this[B],Q=1,K=0;while(++K>>0,U=U>>>0,!G)$0(B,U,this.length);let Y=this[B+--U],Q=1;while(U>0&&(Q*=256))Y+=this[B+--U]*Q;return Y};J0.prototype.readUint8=J0.prototype.readUInt8=function(B,U){if(B=B>>>0,!U)$0(B,1,this.length);return this[B]};J0.prototype.readUint16LE=J0.prototype.readUInt16LE=function(B,U){if(B=B>>>0,!U)$0(B,2,this.length);return this[B]|this[B+1]<<8};J0.prototype.readUint16BE=J0.prototype.readUInt16BE=function(B,U){if(B=B>>>0,!U)$0(B,2,this.length);return this[B]<<8|this[B+1]};J0.prototype.readUint32LE=J0.prototype.readUInt32LE=function(B,U){if(B=B>>>0,!U)$0(B,4,this.length);return(this[B]|this[B+1]<<8|this[B+2]<<16)+this[B+3]*16777216};J0.prototype.readUint32BE=J0.prototype.readUInt32BE=function(B,U){if(B=B>>>0,!U)$0(B,4,this.length);return this[B]*16777216+(this[B+1]<<16|this[B+2]<<8|this[B+3])};J0.prototype.readBigUInt64LE=I2(function(B){B=B>>>0,S2(B,"offset");let U=this[B],G=this[B+7];if(U===void 0||G===void 0)n2(B,this.length-8);let Y=U+this[++B]*256+this[++B]*65536+this[++B]*16777216,Q=this[++B]+this[++B]*256+this[++B]*65536+G*16777216;return BigInt(Y)+(BigInt(Q)<>>0,S2(B,"offset");let U=this[B],G=this[B+7];if(U===void 0||G===void 0)n2(B,this.length-8);let Y=U*16777216+this[++B]*65536+this[++B]*256+this[++B],Q=this[++B]*16777216+this[++B]*65536+this[++B]*256+G;return(BigInt(Y)<>>0,U=U>>>0,!G)$0(B,U,this.length);let Y=this[B],Q=1,K=0;while(++K=Q)Y-=Math.pow(2,8*U);return Y};J0.prototype.readIntBE=function(B,U,G){if(B=B>>>0,U=U>>>0,!G)$0(B,U,this.length);let Y=U,Q=1,K=this[B+--Y];while(Y>0&&(Q*=256))K+=this[B+--Y]*Q;if(Q*=128,K>=Q)K-=Math.pow(2,8*U);return K};J0.prototype.readInt8=function(B,U){if(B=B>>>0,!U)$0(B,1,this.length);if(!(this[B]&128))return this[B];return(255-this[B]+1)*-1};J0.prototype.readInt16LE=function(B,U){if(B=B>>>0,!U)$0(B,2,this.length);let G=this[B]|this[B+1]<<8;return G&32768?G|4294901760:G};J0.prototype.readInt16BE=function(B,U){if(B=B>>>0,!U)$0(B,2,this.length);let G=this[B+1]|this[B]<<8;return G&32768?G|4294901760:G};J0.prototype.readInt32LE=function(B,U){if(B=B>>>0,!U)$0(B,4,this.length);return this[B]|this[B+1]<<8|this[B+2]<<16|this[B+3]<<24};J0.prototype.readInt32BE=function(B,U){if(B=B>>>0,!U)$0(B,4,this.length);return this[B]<<24|this[B+1]<<16|this[B+2]<<8|this[B+3]};J0.prototype.readBigInt64LE=I2(function(B){B=B>>>0,S2(B,"offset");let U=this[B],G=this[B+7];if(U===void 0||G===void 0)n2(B,this.length-8);let Y=this[B+4]+this[B+5]*256+this[B+6]*65536+(G<<24);return(BigInt(Y)<>>0,S2(B,"offset");let U=this[B],G=this[B+7];if(U===void 0||G===void 0)n2(B,this.length-8);let Y=(U<<24)+this[++B]*65536+this[++B]*256+this[++B];return(BigInt(Y)<>>0,!U)$0(B,4,this.length);return w1(this,B,!0,23,4)};J0.prototype.readFloatBE=function(B,U){if(B=B>>>0,!U)$0(B,4,this.length);return w1(this,B,!1,23,4)};J0.prototype.readDoubleLE=function(B,U){if(B=B>>>0,!U)$0(B,8,this.length);return w1(this,B,!0,52,8)};J0.prototype.readDoubleBE=function(B,U){if(B=B>>>0,!U)$0(B,8,this.length);return w1(this,B,!1,52,8)};function g0(B,U,G,Y,Q,K){if(!J0.isBuffer(B))throw TypeError('"buffer" argument must be a Buffer instance');if(U>Q||UB.length)throw RangeError("Index out of range")}J0.prototype.writeUintLE=J0.prototype.writeUIntLE=function(B,U,G,Y){if(B=+B,U=U>>>0,G=G>>>0,!Y){let Z=Math.pow(2,8*G)-1;g0(this,B,U,G,Z,0)}let Q=1,K=0;this[U]=B&255;while(++K>>0,G=G>>>0,!Y){let Z=Math.pow(2,8*G)-1;g0(this,B,U,G,Z,0)}let Q=G-1,K=1;this[U+Q]=B&255;while(--Q>=0&&(K*=256))this[U+Q]=B/K&255;return U+G};J0.prototype.writeUint8=J0.prototype.writeUInt8=function(B,U,G){if(B=+B,U=U>>>0,!G)g0(this,B,U,1,255,0);return this[U]=B&255,U+1};J0.prototype.writeUint16LE=J0.prototype.writeUInt16LE=function(B,U,G){if(B=+B,U=U>>>0,!G)g0(this,B,U,2,65535,0);return this[U]=B&255,this[U+1]=B>>>8,U+2};J0.prototype.writeUint16BE=J0.prototype.writeUInt16BE=function(B,U,G){if(B=+B,U=U>>>0,!G)g0(this,B,U,2,65535,0);return this[U]=B>>>8,this[U+1]=B&255,U+2};J0.prototype.writeUint32LE=J0.prototype.writeUInt32LE=function(B,U,G){if(B=+B,U=U>>>0,!G)g0(this,B,U,4,4294967295,0);return this[U+3]=B>>>24,this[U+2]=B>>>16,this[U+1]=B>>>8,this[U]=B&255,U+4};J0.prototype.writeUint32BE=J0.prototype.writeUInt32BE=function(B,U,G){if(B=+B,U=U>>>0,!G)g0(this,B,U,4,4294967295,0);return this[U]=B>>>24,this[U+1]=B>>>16,this[U+2]=B>>>8,this[U+3]=B&255,U+4};function C6(B,U,G,Y,Q){v6(U,Y,Q,B,G,7);let K=Number(U&BigInt(4294967295));B[G++]=K,K=K>>8,B[G++]=K,K=K>>8,B[G++]=K,K=K>>8,B[G++]=K;let Z=Number(U>>BigInt(32)&BigInt(4294967295));return B[G++]=Z,Z=Z>>8,B[G++]=Z,Z=Z>>8,B[G++]=Z,Z=Z>>8,B[G++]=Z,G}function k6(B,U,G,Y,Q){v6(U,Y,Q,B,G,7);let K=Number(U&BigInt(4294967295));B[G+7]=K,K=K>>8,B[G+6]=K,K=K>>8,B[G+5]=K,K=K>>8,B[G+4]=K;let Z=Number(U>>BigInt(32)&BigInt(4294967295));return B[G+3]=Z,Z=Z>>8,B[G+2]=Z,Z=Z>>8,B[G+1]=Z,Z=Z>>8,B[G]=Z,G+8}J0.prototype.writeBigUInt64LE=I2(function(B,U=0){return C6(this,B,U,BigInt(0),BigInt("0xffffffffffffffff"))});J0.prototype.writeBigUInt64BE=I2(function(B,U=0){return k6(this,B,U,BigInt(0),BigInt("0xffffffffffffffff"))});J0.prototype.writeIntLE=function(B,U,G,Y){if(B=+B,U=U>>>0,!Y){let J=Math.pow(2,8*G-1);g0(this,B,U,G,J-1,-J)}let Q=0,K=1,Z=0;this[U]=B&255;while(++Q>0)-Z&255}return U+G};J0.prototype.writeIntBE=function(B,U,G,Y){if(B=+B,U=U>>>0,!Y){let J=Math.pow(2,8*G-1);g0(this,B,U,G,J-1,-J)}let Q=G-1,K=1,Z=0;this[U+Q]=B&255;while(--Q>=0&&(K*=256)){if(B<0&&Z===0&&this[U+Q+1]!==0)Z=1;this[U+Q]=(B/K>>0)-Z&255}return U+G};J0.prototype.writeInt8=function(B,U,G){if(B=+B,U=U>>>0,!G)g0(this,B,U,1,127,-128);if(B<0)B=255+B+1;return this[U]=B&255,U+1};J0.prototype.writeInt16LE=function(B,U,G){if(B=+B,U=U>>>0,!G)g0(this,B,U,2,32767,-32768);return this[U]=B&255,this[U+1]=B>>>8,U+2};J0.prototype.writeInt16BE=function(B,U,G){if(B=+B,U=U>>>0,!G)g0(this,B,U,2,32767,-32768);return this[U]=B>>>8,this[U+1]=B&255,U+2};J0.prototype.writeInt32LE=function(B,U,G){if(B=+B,U=U>>>0,!G)g0(this,B,U,4,2147483647,-2147483648);return this[U]=B&255,this[U+1]=B>>>8,this[U+2]=B>>>16,this[U+3]=B>>>24,U+4};J0.prototype.writeInt32BE=function(B,U,G){if(B=+B,U=U>>>0,!G)g0(this,B,U,4,2147483647,-2147483648);if(B<0)B=4294967295+B+1;return this[U]=B>>>24,this[U+1]=B>>>16,this[U+2]=B>>>8,this[U+3]=B&255,U+4};J0.prototype.writeBigInt64LE=I2(function(B,U=0){return C6(this,B,U,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});J0.prototype.writeBigInt64BE=I2(function(B,U=0){return k6(this,B,U,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function $6(B,U,G,Y,Q,K){if(G+Y>B.length)throw RangeError("Index out of range");if(G<0)throw RangeError("Index out of range")}function S6(B,U,G,Y,Q){if(U=+U,G=G>>>0,!Q)$6(B,U,G,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return j6(B,U,G,Y,23,4),G+4}J0.prototype.writeFloatLE=function(B,U,G){return S6(this,B,U,!0,G)};J0.prototype.writeFloatBE=function(B,U,G){return S6(this,B,U,!1,G)};function b6(B,U,G,Y,Q){if(U=+U,G=G>>>0,!Q)$6(B,U,G,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return j6(B,U,G,Y,52,8),G+8}J0.prototype.writeDoubleLE=function(B,U,G){return b6(this,B,U,!0,G)};J0.prototype.writeDoubleBE=function(B,U,G){return b6(this,B,U,!1,G)};J0.prototype.copy=function(B,U,G,Y){if(!J0.isBuffer(B))throw TypeError("argument should be a Buffer");if(!G)G=0;if(!Y&&Y!==0)Y=this.length;if(U>=B.length)U=B.length;if(!U)U=0;if(Y>0&&Y=this.length)throw RangeError("Index out of range");if(Y<0)throw RangeError("sourceEnd out of bounds");if(Y>this.length)Y=this.length;if(B.length-U>>0,G=G===void 0?this.length:G>>>0,!B)B=0;let Q;if(typeof B==="number")for(Q=U;Q=Y+4;G-=3)U=`_${B.slice(G-3,G)}${U}`;return`${B.slice(0,G)}${U}`}function i5(B,U,G){if(S2(U,"offset"),B[U]===void 0||B[U+G]===void 0)n2(U,B.length-(G+1))}function v6(B,U,G,Y,Q,K){if(B>G||B3)if(U===0||U===BigInt(0))J=`>= 0${Z} and < 2${Z} ** ${(K+1)*8}${Z}`;else J=`>= -(2${Z} ** ${(K+1)*8-1}${Z}) and < 2 ** ${(K+1)*8-1}${Z}`;else J=`>= ${U}${Z} and <= ${G}${Z}`;throw new n1("value",J,B)}i5(Y,Q,K)}function S2(B,U){if(typeof B!=="number")throw new S5(U,"number",B)}function n2(B,U,G){if(Math.floor(B)!==B)throw S2(B,G),new n1(G||"offset","an integer",B);if(U<0)throw new $5;throw new n1(G||"offset",`>= ${G?1:0} and <= ${U}`,B)}var n5=/[^+/0-9A-Za-z-_]/g;function s5(B){if(B=B.split("=")[0],B=B.trim().replace(n5,""),B.length<2)return"";while(B.length%4!==0)B=B+"=";return B}function t1(B,U){U=U||1/0;let G,Y=B.length,Q=null,K=[];for(let Z=0;Z55295&&G<57344){if(!Q){if(G>56319){if((U-=3)>-1)K.push(239,191,189);continue}else if(Z+1===Y){if((U-=3)>-1)K.push(239,191,189);continue}Q=G;continue}if(G<56320){if((U-=3)>-1)K.push(239,191,189);Q=G;continue}G=(Q-55296<<10|G-56320)+65536}else if(Q){if((U-=3)>-1)K.push(239,191,189)}if(Q=null,G<128){if((U-=1)<0)break;K.push(G)}else if(G<2048){if((U-=2)<0)break;K.push(G>>6|192,G&63|128)}else if(G<65536){if((U-=3)<0)break;K.push(G>>12|224,G>>6&63|128,G&63|128)}else if(G<1114112){if((U-=4)<0)break;K.push(G>>18|240,G>>12&63|128,G>>6&63|128,G&63|128)}else throw Error("Invalid code point")}return K}function o5(B){let U=[];for(let G=0;G>8,Q=G%256,K.push(Q),K.push(Y)}return K}function y6(B){return T5(s5(B))}function A1(B,U,G,Y){let Q;for(Q=0;Q=U.length||Q>=B.length)break;U[Q+G]=B[Q]}return Q}function a0(B,U){return B instanceof U||B!=null&&B.constructor!=null&&B.constructor.name!=null&&B.constructor.name===U.name}var e5=function(){let B=Array(256);for(let U=0;U<16;++U){let G=U*16;for(let Y=0;Y<16;++Y)B[G+Y]="0123456789abcdef"[U]+"0123456789abcdef"[Y]}return B}();function I2(B){return typeof BigInt>"u"?BU:B}function BU(){throw Error("BigInt not supported")}function G8(B){return()=>{throw Error(B+" is not implemented for node:buffer browser polyfill")}}var V7=G8("resolveObjectURL"),q7=G8("isUtf8");var M7=G8("transcode");var G7=P5(h6(),1);var R6={};N5(R6,{unsignedDecimalNumber:()=>q1,universalMeasureValue:()=>M1,uniqueUuid:()=>eB,uniqueNumericIdCreator:()=>I1,uniqueId:()=>O1,uCharHexNumber:()=>H8,twipsMeasureValue:()=>E0,standardizeData:()=>A4,signedTwipsMeasureValue:()=>t0,signedHpsMeasureValue:()=>VG,shortHexNumber:()=>SB,sectionPageSizeDefaults:()=>k1,sectionMarginDefaults:()=>F2,positiveUniversalMeasureValue:()=>u8,pointMeasureValue:()=>gB,percentageValue:()=>vB,patchDocument:()=>tK,patchDetector:()=>B7,measurementOrPercentValue:()=>d8,longHexNumber:()=>KG,hpsMeasureValue:()=>bB,hexColorValue:()=>C2,hashedId:()=>W8,encodeUtf8:()=>U1,eighthPointMeasureValue:()=>yB,docPropertiesUniqueNumericIdGen:()=>oB,decimalNumber:()=>D0,dateTimeValue:()=>fB,createWrapTopAndBottom:()=>F4,createWrapTight:()=>O4,createWrapSquare:()=>I4,createWrapNone:()=>w8,createVerticalPosition:()=>J4,createVerticalAlign:()=>B6,createUnderline:()=>cB,createTransformation:()=>i8,createTableWidthElement:()=>J1,createTableRowHeight:()=>W9,createTableLook:()=>H9,createTableLayout:()=>O9,createTableFloatProperties:()=>I9,createTabStopItem:()=>b4,createTabStop:()=>v4,createStringElement:()=>f2,createSpacing:()=>S4,createSimplePos:()=>G4,createShading:()=>X1,createSectionType:()=>C9,createRunFonts:()=>T1,createParagraphStyle:()=>x2,createPageSize:()=>T9,createPageNumberType:()=>E9,createPageMargin:()=>z9,createOutlineLevel:()=>_4,createMathSuperScriptProperties:()=>p4,createMathSuperScriptElement:()=>a2,createMathSubSuperScriptProperties:()=>i4,createMathSubScriptProperties:()=>r4,createMathSubScriptElement:()=>l2,createMathPreSubSuperScriptProperties:()=>n4,createMathNAryProperties:()=>t8,createMathLimitLocation:()=>a4,createMathBase:()=>y0,createMathAccentCharacter:()=>l4,createLineNumberType:()=>j9,createIndent:()=>hB,createHorizontalPosition:()=>Q4,createHeaderFooterReference:()=>C1,createFrameProperties:()=>u4,createEmphasisMark:()=>p8,createDotEmphasisMark:()=>wG,createDocumentGrid:()=>A9,createColumns:()=>w9,createBorderElement:()=>A0,createBodyProperties:()=>K4,createAlignment:()=>c8,convertToXmlComponent:()=>h1,convertMillimetersToTwip:()=>dG,convertInchesToTwip:()=>u0,concreteNumUniqueNumericIdGen:()=>sB,commentIdToParaId:()=>N4,bookmarkUniqueNumericIdGen:()=>tB,abstractNumUniqueNumericIdGen:()=>nB,YearShort:()=>oY,YearLong:()=>BZ,XmlComponent:()=>t,XmlAttributeComponent:()=>F0,WpsShapeRun:()=>SY,WpgGroupRun:()=>bY,WidthType:()=>b1,WORKAROUND4:()=>oZ,WORKAROUND3:()=>JG,WORKAROUND2:()=>jJ,VerticalPositionRelativeFrom:()=>U4,VerticalPositionAlign:()=>XG,VerticalMergeType:()=>U6,VerticalMergeRevisionType:()=>HQ,VerticalMerge:()=>N8,VerticalAnchor:()=>cG,VerticalAlignTable:()=>K9,VerticalAlignSection:()=>V9,VerticalAlign:()=>WQ,UnderlineType:()=>r8,ThematicBreak:()=>_B,Textbox:()=>DK,TextWrappingType:()=>e2,TextWrappingSide:()=>L4,TextRun:()=>Q1,TextEffect:()=>CG,TextDirection:()=>NQ,TableRowPropertiesChange:()=>P9,TableRowProperties:()=>Q6,TableRow:()=>fQ,TableProperties:()=>Z6,TableOfContents:()=>RK,TableLayoutType:()=>SQ,TableCellBorders:()=>M9,TableCell:()=>G6,TableBorders:()=>Y6,TableAnchorType:()=>TQ,Table:()=>yQ,TabStopType:()=>j8,TabStopPosition:()=>HZ,Tab:()=>D4,TDirection:()=>R9,SymbolRun:()=>aB,Styles:()=>$1,StyleLevel:()=>LK,StyleForParagraph:()=>p2,StyleForCharacter:()=>$2,StringValueElement:()=>M2,StringEnumValueElement:()=>qG,StringContainer:()=>O2,SpaceType:()=>x0,SoftHyphen:()=>iY,SimpleMailMergeField:()=>fY,SimpleField:()=>n8,ShadingType:()=>HG,SequentialIdentifier:()=>yY,Separator:()=>YZ,SectionType:()=>GJ,SectionPropertiesChange:()=>k9,SectionProperties:()=>J6,RunPropertiesDefaults:()=>a9,RunPropertiesChange:()=>lB,RunProperties:()=>U2,Run:()=>T0,RelativeVerticalPosition:()=>CQ,RelativeHorizontalPosition:()=>DQ,PrettifyType:()=>G5,PositionalTabRelativeTo:()=>qZ,PositionalTabLeader:()=>MZ,PositionalTabAlignment:()=>VZ,PositionalTab:()=>RZ,PatchType:()=>D8,ParagraphRunProperties:()=>mB,ParagraphPropertiesDefaults:()=>l9,ParagraphPropertiesChange:()=>d4,ParagraphProperties:()=>X2,Paragraph:()=>d0,PageTextDirectionType:()=>BJ,PageTextDirection:()=>D9,PageReference:()=>CZ,PageOrientation:()=>y1,PageNumberSeparator:()=>eQ,PageNumberElement:()=>QZ,PageNumber:()=>H2,PageBreakBefore:()=>$4,PageBreak:()=>LZ,PageBorders:()=>N9,PageBorderZOrder:()=>tQ,PageBorderOffsetFrom:()=>oQ,PageBorderDisplay:()=>sQ,Packer:()=>Y5,OverlapType:()=>kQ,OnOffElement:()=>M0,Numbering:()=>d9,NumberedItemReferenceFormat:()=>zZ,NumberedItemReference:()=>TZ,NumberValueElement:()=>_2,NumberProperties:()=>D1,NumberFormat:()=>RG,NoBreakHyphen:()=>rY,NextAttributeComponent:()=>k8,MonthShort:()=>sY,MonthLong:()=>eY,Media:()=>K6,MathSuperScript:()=>rZ,MathSum:()=>mZ,MathSubSuperScript:()=>nZ,MathSubScript:()=>iZ,MathSquareBrackets:()=>QQ,MathRun:()=>hZ,MathRoundBrackets:()=>ZQ,MathRadicalProperties:()=>o4,MathRadical:()=>BQ,MathPreSubSuperScript:()=>sZ,MathNumerator:()=>m4,MathLimitUpper:()=>aZ,MathLimitLower:()=>pZ,MathLimit:()=>e8,MathIntegral:()=>lZ,MathFunctionProperties:()=>e4,MathFunctionName:()=>t4,MathFunction:()=>UQ,MathFraction:()=>uZ,MathDenominator:()=>c4,MathDegree:()=>s4,MathCurlyBrackets:()=>JQ,MathAngledBrackets:()=>KQ,Math:()=>xZ,LineRuleType:()=>k2,LineNumberRestartFormat:()=>nQ,LevelSuffix:()=>DJ,LevelOverride:()=>u9,LevelFormat:()=>i0,LevelForOverride:()=>$J,LevelBase:()=>V6,Level:()=>h9,LeaderType:()=>FZ,LastRenderedPageBreak:()=>KZ,InternalHyperlink:()=>y4,InsertedTextRun:()=>XQ,InsertedTableRow:()=>U9,InsertedTableCell:()=>Y9,InitializableXmlComponent:()=>h8,ImportedXmlComponent:()=>kB,ImportedRootElementAttributes:()=>$B,ImageRun:()=>$Y,IgnoreIfEmptyXmlComponent:()=>R2,HyperlinkType:()=>AZ,HpsMeasureElement:()=>E1,HorizontalPositionRelativeFrom:()=>B4,HorizontalPositionAlign:()=>MG,HighlightColor:()=>kG,HeightRule:()=>gQ,HeadingLevel:()=>OZ,HeaderWrapper:()=>_9,HeaderFooterType:()=>z8,HeaderFooterReferenceType:()=>D2,Header:()=>IK,GridSpan:()=>X9,FrameWrap:()=>fZ,FrameAnchorType:()=>gZ,FootnoteReferenceRun:()=>FK,FootnoteReferenceElement:()=>GZ,FootnoteReference:()=>o9,FooterWrapper:()=>f9,Footer:()=>OK,FootNotes:()=>x9,FootNoteReferenceRunAttributes:()=>s9,FileChild:()=>F1,File:()=>VK,ExternalHyperlink:()=>o8,Endnotes:()=>g9,EndnoteReferenceRunAttributes:()=>t9,EndnoteReferenceRun:()=>HK,EndnoteReference:()=>T4,EndnoteIdReference:()=>e9,EmptyElement:()=>S0,EmphasisMarkType:()=>a8,EMPTY_OBJECT:()=>KB,DropCapType:()=>yZ,Drawing:()=>c1,DocumentGridType:()=>iQ,DocumentDefaults:()=>p9,DocumentBackgroundAttributes:()=>S9,DocumentBackground:()=>b9,DocumentAttributes:()=>H1,DocumentAttributeNamespaces:()=>v1,Document:()=>VK,DeletedTextRun:()=>OQ,DeletedTableRow:()=>G9,DeletedTableCell:()=>Z9,DayShort:()=>nY,DayLong:()=>tY,ContinuationSeparator:()=>ZZ,ConcreteNumbering:()=>T8,ConcreteHyperlink:()=>m2,CommentsExtended:()=>E4,Comments:()=>z4,CommentReference:()=>mY,CommentRangeStart:()=>dY,CommentRangeEnd:()=>cY,Comment:()=>A8,ColumnBreak:()=>IZ,Column:()=>ZJ,CheckBoxUtil:()=>B5,CheckBoxSymbolElement:()=>S1,CheckBox:()=>WK,CharacterSet:()=>kZ,CellMergeAttributes:()=>Q9,CellMerge:()=>J9,CarriageReturn:()=>JZ,BuilderElement:()=>X0,BorderStyle:()=>d1,Border:()=>xB,BookmarkStart:()=>f4,BookmarkEnd:()=>x4,Bookmark:()=>g4,Body:()=>$9,BaseXmlComponent:()=>Y1,Attributes:()=>C0,AnnotationReference:()=>UZ,AlignmentType:()=>c0,AbstractNumbering:()=>E8});var{create:YU,defineProperty:QB,getOwnPropertyDescriptor:ZU,getOwnPropertyNames:QU,getPrototypeOf:JU}=Object,KU=Object.prototype.hasOwnProperty,JB=(B,U)=>()=>(B&&(U=B(B=0)),U),R0=(B,U)=>()=>(U||(B((U={exports:{}}).exports,U),B=null),U.exports),VU=(B,U,G,Y)=>{if(U&&typeof U==="object"||typeof U==="function"){for(var Q=QU(U),K=0,Z=Q.length,J;KU[M]).bind(null,J),enumerable:!(Y=ZU(U,J))||Y.enumerable})}return B},C8=(B,U,G)=>(G=B!=null?YU(JU(B)):{},VU(U||!B||!B.__esModule?QB(G,"default",{value:B,enumerable:!0}):G,B)),N1=((B)=>__require)(function(B){return __require.apply(this,arguments)});function G1(B){return G1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(U){return typeof U}:function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U},G1(B)}function qU(B,U){if(G1(B)!="object"||!B)return B;var G=B[Symbol.toPrimitive];if(G!==void 0){var Y=G.call(B,U||"default");if(G1(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return(U==="string"?String:Number)(B)}function MU(B){var U=qU(B,"string");return G1(U)=="symbol"?U:U+""}function e(B,U,G){return(U=MU(U))in B?Object.defineProperty(B,U,{value:G,enumerable:!0,configurable:!0,writable:!0}):B[U]=G,B}var Y1=class{constructor(B){e(this,"rootKey",void 0),this.rootKey=B}},KB=Object.seal({}),t=class extends Y1{constructor(B){super(B);e(this,"root",void 0),this.root=[]}prepForXml(B){var U;B.stack.push(this);let G=this.root.map((Y)=>{if(Y instanceof Y1)return Y.prepForXml(B);return Y}).filter((Y)=>Y!==void 0);return B.stack.pop(),{[this.rootKey]:G.length?G.length===1&&((U=G[0])===null||U===void 0?void 0:U._attr)?G[0]:G:KB}}addChildElement(B){return this.root.push(B),this}},R2=class extends t{constructor(B,U){super(B);e(this,"includeIfEmpty",void 0),this.includeIfEmpty=U}prepForXml(B){let U=super.prepForXml(B);if(this.includeIfEmpty)return U;if(U&&(typeof U[this.rootKey]!=="object"||Object.keys(U[this.rootKey]).length))return U}};function u6(B,U){var G=Object.keys(B);if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(B);U&&(Y=Y.filter(function(Q){return Object.getOwnPropertyDescriptor(B,Q).enumerable})),G.push.apply(G,Y)}return G}function L0(B){for(var U=1;U{if(Y!==void 0){let Q=this.xmlKeys&&this.xmlKeys[G]||G;U[Q]=Y}}),{_attr:U}}},k8=class extends Y1{constructor(B){super("_attr");e(this,"root",void 0),this.root=B}prepForXml(B){return{_attr:Object.values(this.root).filter(({value:U})=>U!==void 0).reduce((U,{key:G,value:Y})=>L0(L0({},U),{},{[G]:Y}),{})}}},C0=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{val:"w:val",color:"w:color",fill:"w:fill",space:"w:space",sz:"w:sz",type:"w:type",rsidR:"w:rsidR",rsidRPr:"w:rsidRPr",rsidSect:"w:rsidSect",w:"w:w",h:"w:h",top:"w:top",right:"w:right",bottom:"w:bottom",left:"w:left",header:"w:header",footer:"w:footer",gutter:"w:gutter",linePitch:"w:linePitch",pos:"w:pos"})}},$8=R0((B,U)=>{var G=typeof Reflect==="object"?Reflect:null,Y=G&&typeof G.apply==="function"?G.apply:function($,x,N){return Function.prototype.apply.call($,x,N)},Q;if(G&&typeof G.ownKeys==="function")Q=G.ownKeys;else if(Object.getOwnPropertySymbols)Q=function($){return Object.getOwnPropertyNames($).concat(Object.getOwnPropertySymbols($))};else Q=function($){return Object.getOwnPropertyNames($)};function K(X){if(console&&console.warn)console.warn(X)}var Z=Number.isNaN||function($){return $!==$};function J(){J.init.call(this)}U.exports=J,U.exports.once=v,J.EventEmitter=J,J.prototype._events=void 0,J.prototype._eventsCount=0,J.prototype._maxListeners=void 0;var M=10;function W(X){if(typeof X!=="function")throw TypeError('The "listener" argument must be of type Function. Received type '+typeof X)}Object.defineProperty(J,"defaultMaxListeners",{enumerable:!0,get:function(){return M},set:function(X){if(typeof X!=="number"||X<0||Z(X))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+X+".");M=X}}),J.init=function(){if(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)this._events=Object.create(null),this._eventsCount=0;this._maxListeners=this._maxListeners||void 0},J.prototype.setMaxListeners=function($){if(typeof $!=="number"||$<0||Z($))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+$+".");return this._maxListeners=$,this};function I(X){if(X._maxListeners===void 0)return J.defaultMaxListeners;return X._maxListeners}J.prototype.getMaxListeners=function(){return I(this)},J.prototype.emit=function($){var x=[];for(var N=1;N0)b=x[0];if(b instanceof Error)throw b;var c=Error("Unhandled error."+(b?" ("+b.message+")":""));throw c.context=b,c}var T=U0[$];if(T===void 0)return!1;if(typeof T==="function")Y(T,this,x);else{var m=T.length,B0=E(T,m);for(var N=0;N0&&b.length>a&&!b.warned){b.warned=!0;var c=Error("Possible EventEmitter memory leak detected. "+b.length+" "+String($)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=X,c.type=$,c.count=b.length,K(c)}}return X}J.prototype.addListener=function($,x){return F(this,$,x,!1)},J.prototype.on=J.prototype.addListener,J.prototype.prependListener=function($,x){return F(this,$,x,!0)};function D(){if(!this.fired){if(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0)return this.listener.call(this.target);return this.listener.apply(this.target,arguments)}}function w(X,$,x){var N={fired:!1,wrapFn:void 0,target:X,type:$,listener:x},a=D.bind(N);return a.listener=x,N.wrapFn=a,a}J.prototype.once=function($,x){return W(x),this.on($,w(this,$,x)),this},J.prototype.prependOnceListener=function($,x){return W(x),this.prependListener($,w(this,$,x)),this},J.prototype.removeListener=function($,x){var N,a,U0,b,c;if(W(x),a=this._events,a===void 0)return this;if(N=a[$],N===void 0)return this;if(N===x||N.listener===x){if(--this._eventsCount===0)this._events=Object.create(null);else if(delete a[$],a.removeListener)this.emit("removeListener",$,N.listener||x)}else if(typeof N!=="function"){U0=-1;for(b=N.length-1;b>=0;b--)if(N[b]===x||N[b].listener===x){c=N[b].listener,U0=b;break}if(U0<0)return this;if(U0===0)N.shift();else C(N,U0);if(N.length===1)a[$]=N[0];if(a.removeListener!==void 0)this.emit("removeListener",$,c||x)}return this},J.prototype.off=J.prototype.removeListener,J.prototype.removeAllListeners=function($){var x,N=this._events,a;if(N===void 0)return this;if(N.removeListener===void 0){if(arguments.length===0)this._events=Object.create(null),this._eventsCount=0;else if(N[$]!==void 0)if(--this._eventsCount===0)this._events=Object.create(null);else delete N[$];return this}if(arguments.length===0){var U0=Object.keys(N),b;for(a=0;a=0;a--)this.removeListener($,x[a]);return this};function P(X,$,x){var N=X._events;if(N===void 0)return[];var a=N[$];if(a===void 0)return[];if(typeof a==="function")return x?[a.listener||a]:[a];return x?j(a):E(a,a.length)}J.prototype.listeners=function($){return P(this,$,!0)},J.prototype.rawListeners=function($){return P(this,$,!1)},J.listenerCount=function(X,$){if(typeof X.listenerCount==="function")return X.listenerCount($);else return A.call(X,$)},J.prototype.listenerCount=A;function A(X){var $=this._events;if($!==void 0){var x=$[X];if(typeof x==="function")return 1;else if(x!==void 0)return x.length}return 0}J.prototype.eventNames=function(){return this._eventsCount>0?Q(this._events):[]};function E(X,$){var x=Array($);for(var N=0;N<$;++N)x[N]=X[N];return x}function C(X,$){for(;$+1{if(typeof Object.create==="function")U.exports=function(Y,Q){if(Q)Y.super_=Q,Y.prototype=Object.create(Q.prototype,{constructor:{value:Y,enumerable:!1,writable:!0,configurable:!0}})};else U.exports=function(Y,Q){if(Q){Y.super_=Q;var K=function(){};K.prototype=Q.prototype,Y.prototype=new K,Y.prototype.constructor=Y}}}),v0,d2=JB(()=>{v0=globalThis||self});function XU(B){return B&&B.__esModule&&Object.prototype.hasOwnProperty.call(B,"default")?B.default:B}function I8(){throw Error("setTimeout has not been defined")}function O8(){throw Error("clearTimeout has not been defined")}function VB(B){if(n0===setTimeout)return setTimeout(B,0);if((n0===I8||!n0)&&setTimeout)return n0=setTimeout,setTimeout(B,0);try{return n0(B,0)}catch(U){try{return n0.call(null,B,0)}catch(G){return n0.call(this,B,0)}}}function RU(B){if(s0===clearTimeout)return clearTimeout(B);if((s0===O8||!s0)&&clearTimeout)return s0=clearTimeout,clearTimeout(B);try{return s0(B)}catch(U){try{return s0.call(null,B)}catch(G){return s0.call(this,B)}}}function LU(){if(!T2||!E2)return;if(T2=!1,E2.length)o0=E2.concat(o0);else B1=-1;if(o0.length)qB()}function qB(){if(T2)return;var B=VB(LU);T2=!0;var U=o0.length;while(U){E2=o0,o0=[];while(++B1{Q8={exports:{}},j0=Q8.exports={},function(){try{if(typeof setTimeout==="function")n0=setTimeout;else n0=I8}catch(B){n0=I8}try{if(typeof clearTimeout==="function")s0=clearTimeout;else s0=O8}catch(B){s0=O8}}(),o0=[],T2=!1,B1=-1,j0.nextTick=function(B){var U=Array(arguments.length-1);if(arguments.length>1)for(var G=1;G{U.exports=$8().EventEmitter}),IU=R0((B)=>{B.byteLength=M,B.toByteArray=I,B.fromByteArray=w;var U=[],G=[],Y=typeof Uint8Array<"u"?Uint8Array:Array,Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var K=0,Z=Q.length;K0)throw Error("Invalid string. Length must be a multiple of 4");var E=P.indexOf("=");if(E===-1)E=A;var C=E===A?0:4-E%4;return[E,C]}function M(P){var A=J(P),E=A[0],C=A[1];return(E+C)*3/4-C}function W(P,A,E){return(A+E)*3/4-E}function I(P){var A,E=J(P),C=E[0],j=E[1],v=new Y(W(P,C,j)),S=0,H=j>0?C-4:C,X;for(X=0;X>16&255,v[S++]=A>>8&255,v[S++]=A&255;if(j===2)A=G[P.charCodeAt(X)]<<2|G[P.charCodeAt(X+1)]>>4,v[S++]=A&255;if(j===1)A=G[P.charCodeAt(X)]<<10|G[P.charCodeAt(X+1)]<<4|G[P.charCodeAt(X+2)]>>2,v[S++]=A>>8&255,v[S++]=A&255;return v}function F(P){return U[P>>18&63]+U[P>>12&63]+U[P>>6&63]+U[P&63]}function D(P,A,E){var C,j=[];for(var v=A;vH?H:S+v));if(C===1)A=P[E-1],j.push(U[A>>2]+U[A<<4&63]+"==");else if(C===2)A=(P[E-2]<<8)+P[E-1],j.push(U[A>>10]+U[A>>4&63]+U[A<<2&63]+"=");return j.join("")}}),OU=R0((B)=>{/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */B.read=function(U,G,Y,Q,K){var Z,J,M=K*8-Q-1,W=(1<>1,F=-7,D=Y?K-1:0,w=Y?-1:1,P=U[G+D];D+=w,Z=P&(1<<-F)-1,P>>=-F,F+=M;for(;F>0;Z=Z*256+U[G+D],D+=w,F-=8);J=Z&(1<<-F)-1,Z>>=-F,F+=Q;for(;F>0;J=J*256+U[G+D],D+=w,F-=8);if(Z===0)Z=1-I;else if(Z===W)return J?NaN:(P?-1:1)*(1/0);else J=J+Math.pow(2,Q),Z=Z-I;return(P?-1:1)*J*Math.pow(2,Z-Q)},B.write=function(U,G,Y,Q,K,Z){var J,M,W,I=Z*8-K-1,F=(1<>1,w=K===23?Math.pow(2,-24)-Math.pow(2,-77):0,P=Q?0:Z-1,A=Q?1:-1,E=G<0||G===0&&1/G<0?1:0;if(G=Math.abs(G),isNaN(G)||G===1/0)M=isNaN(G)?1:0,J=F;else{if(J=Math.floor(Math.log(G)/Math.LN2),G*(W=Math.pow(2,-J))<1)J--,W*=2;if(J+D>=1)G+=w/W;else G+=w*Math.pow(2,1-D);if(G*W>=2)J++,W/=2;if(J+D>=F)M=0,J=F;else if(J+D>=1)M=(G*W-1)*Math.pow(2,K),J=J+D;else M=G*Math.pow(2,D-1)*Math.pow(2,K),J=0}for(;K>=8;U[Y+P]=M&255,P+=A,M/=256,K-=8);J=J<0;U[Y+P]=J&255,P+=A,J/=256,I-=8);U[Y+P-A]|=E*128}});/*! +* The buffer module from node.js, for the browser. +* +* @author Feross Aboukhadijeh +* @license MIT +*/var g1=R0((B)=>{var U=IU(),G=OU(),Y=typeof Symbol==="function"&&typeof Symbol.for==="function"?Symbol.for("nodejs.util.inspect.custom"):null;B.Buffer=J,B.SlowBuffer=j,B.INSPECT_MAX_BYTES=50;var Q=2147483647;if(B.kMaxLength=Q,J.TYPED_ARRAY_SUPPORT=K(),!J.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error==="function")console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function K(){try{var k=new Uint8Array(1),V={foo:function(){return 42}};return Object.setPrototypeOf(V,Uint8Array.prototype),Object.setPrototypeOf(k,V),k.foo()===42}catch(q){return!1}}Object.defineProperty(J.prototype,"parent",{enumerable:!0,get:function(){if(!J.isBuffer(this))return;return this.buffer}}),Object.defineProperty(J.prototype,"offset",{enumerable:!0,get:function(){if(!J.isBuffer(this))return;return this.byteOffset}});function Z(k){if(k>Q)throw RangeError('The value "'+k+'" is invalid for option "size"');var V=new Uint8Array(k);return Object.setPrototypeOf(V,J.prototype),V}function J(k,V,q){if(typeof k==="number"){if(typeof V==="string")throw TypeError('The "string" argument must be of type string. Received type number');return F(k)}return M(k,V,q)}J.poolSize=8192;function M(k,V,q){if(typeof k==="string")return D(k,V);if(ArrayBuffer.isView(k))return P(k);if(k==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof k);if(f(k,ArrayBuffer)||k&&f(k.buffer,ArrayBuffer))return A(k,V,q);if(typeof SharedArrayBuffer<"u"&&(f(k,SharedArrayBuffer)||k&&f(k.buffer,SharedArrayBuffer)))return A(k,V,q);if(typeof k==="number")throw TypeError('The "value" argument must not be of type number. Received type number');var O=k.valueOf&&k.valueOf();if(O!=null&&O!==k)return J.from(O,V,q);var _=E(k);if(_)return _;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof k[Symbol.toPrimitive]==="function")return J.from(k[Symbol.toPrimitive]("string"),V,q);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof k)}J.from=function(k,V,q){return M(k,V,q)},Object.setPrototypeOf(J.prototype,Uint8Array.prototype),Object.setPrototypeOf(J,Uint8Array);function W(k){if(typeof k!=="number")throw TypeError('"size" argument must be of type number');else if(k<0)throw RangeError('The value "'+k+'" is invalid for option "size"')}function I(k,V,q){if(W(k),k<=0)return Z(k);if(V!==void 0)return typeof q==="string"?Z(k).fill(V,q):Z(k).fill(V);return Z(k)}J.alloc=function(k,V,q){return I(k,V,q)};function F(k){return W(k),Z(k<0?0:C(k)|0)}J.allocUnsafe=function(k){return F(k)},J.allocUnsafeSlow=function(k){return F(k)};function D(k,V){if(typeof V!=="string"||V==="")V="utf8";if(!J.isEncoding(V))throw TypeError("Unknown encoding: "+V);var q=v(k,V)|0,O=Z(q),_=O.write(k,V);if(_!==q)O=O.slice(0,_);return O}function w(k){var V=k.length<0?0:C(k.length)|0,q=Z(V);for(var O=0;O=Q)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Q.toString(16)+" bytes");return k|0}function j(k){if(+k!=k)k=0;return J.alloc(+k)}J.isBuffer=function(V){return V!=null&&V._isBuffer===!0&&V!==J.prototype},J.compare=function(V,q){if(f(V,Uint8Array))V=J.from(V,V.offset,V.byteLength);if(f(q,Uint8Array))q=J.from(q,q.offset,q.byteLength);if(!J.isBuffer(V)||!J.isBuffer(q))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(V===q)return 0;var O=V.length,_=q.length;for(var l=0,d=Math.min(O,_);l_.length)J.from(d).copy(_,l);else Uint8Array.prototype.set.call(_,d,l);else if(!J.isBuffer(d))throw TypeError('"list" argument must be an Array of Buffers');else d.copy(_,l);l+=d.length}return _};function v(k,V){if(J.isBuffer(k))return k.length;if(ArrayBuffer.isView(k)||f(k,ArrayBuffer))return k.byteLength;if(typeof k!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof k);var q=k.length,O=arguments.length>2&&arguments[2]===!0;if(!O&&q===0)return 0;var _=!1;for(;;)switch(V){case"ascii":case"latin1":case"binary":return q;case"utf8":case"utf-8":return L(k).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q*2;case"hex":return q>>>1;case"base64":return Z0(k).length;default:if(_)return O?-1:L(k).length;V=(""+V).toLowerCase(),_=!0}}J.byteLength=v;function S(k,V,q){var O=!1;if(V===void 0||V<0)V=0;if(V>this.length)return"";if(q===void 0||q>this.length)q=this.length;if(q<=0)return"";if(q>>>=0,V>>>=0,q<=V)return"";if(!k)k="utf8";while(!0)switch(k){case"hex":return s(this,V,q);case"utf8":case"utf-8":return T(this,V,q);case"ascii":return i(this,V,q);case"latin1":case"binary":return V0(this,V,q);case"base64":return c(this,V,q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G0(this,V,q);default:if(O)throw TypeError("Unknown encoding: "+k);k=(k+"").toLowerCase(),O=!0}}J.prototype._isBuffer=!0;function H(k,V,q){var O=k[V];k[V]=k[q],k[q]=O}if(J.prototype.swap16=function(){var V=this.length;if(V%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var q=0;qq)V+=" ... ";return""},Y)J.prototype[Y]=J.prototype.inspect;J.prototype.compare=function(V,q,O,_,l){if(f(V,Uint8Array))V=J.from(V,V.offset,V.byteLength);if(!J.isBuffer(V))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof V);if(q===void 0)q=0;if(O===void 0)O=V?V.length:0;if(_===void 0)_=0;if(l===void 0)l=this.length;if(q<0||O>V.length||_<0||l>this.length)throw RangeError("out of range index");if(_>=l&&q>=O)return 0;if(_>=l)return-1;if(q>=O)return 1;if(q>>>=0,O>>>=0,_>>>=0,l>>>=0,this===V)return 0;var d=l-_,Q0=O-q,q0=Math.min(d,Q0),K0=this.slice(_,l),I0=V.slice(q,O);for(var H0=0;H02147483647)q=2147483647;else if(q<-2147483648)q=-2147483648;if(q=+q,R(q))q=_?0:k.length-1;if(q<0)q=k.length+q;if(q>=k.length)if(_)return-1;else q=k.length-1;else if(q<0)if(_)q=0;else return-1;if(typeof V==="string")V=J.from(V,O);if(J.isBuffer(V)){if(V.length===0)return-1;return $(k,V,q,O,_)}else if(typeof V==="number"){if(V=V&255,typeof Uint8Array.prototype.indexOf==="function")if(_)return Uint8Array.prototype.indexOf.call(k,V,q);else return Uint8Array.prototype.lastIndexOf.call(k,V,q);return $(k,[V],q,O,_)}throw TypeError("val must be string, number or Buffer")}function $(k,V,q,O,_){var l=1,d=k.length,Q0=V.length;if(O!==void 0){if(O=String(O).toLowerCase(),O==="ucs2"||O==="ucs-2"||O==="utf16le"||O==="utf-16le"){if(k.length<2||V.length<2)return-1;l=2,d/=2,Q0/=2,q/=2}}function q0(k0,L2){if(l===1)return k0[L2];else return k0.readUInt16BE(L2*l)}var K0;if(_){var I0=-1;for(K0=q;K0d)q=d-Q0;for(K0=q;K0>=0;K0--){var H0=!0;for(var W0=0;W0_)O=_;var l=V.length;if(O>l/2)O=l/2;for(var d=0;d>>0,isFinite(O)){if(O=O>>>0,_===void 0)_="utf8"}else _=O,O=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var l=this.length-q;if(O===void 0||O>l)O=l;if(V.length>0&&(O<0||q<0)||q>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!_)_="utf8";var d=!1;for(;;)switch(_){case"hex":return x(this,V,q,O);case"utf8":case"utf-8":return N(this,V,q,O);case"ascii":case"latin1":case"binary":return a(this,V,q,O);case"base64":return U0(this,V,q,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,V,q,O);default:if(d)throw TypeError("Unknown encoding: "+_);_=(""+_).toLowerCase(),d=!0}},J.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function c(k,V,q){if(V===0&&q===k.length)return U.fromByteArray(k);else return U.fromByteArray(k.slice(V,q))}function T(k,V,q){q=Math.min(k.length,q);var O=[],_=V;while(_239?4:l>223?3:l>191?2:1;if(_+Q0<=q){var q0,K0,I0,H0;switch(Q0){case 1:if(l<128)d=l;break;case 2:if(q0=k[_+1],(q0&192)===128){if(H0=(l&31)<<6|q0&63,H0>127)d=H0}break;case 3:if(q0=k[_+1],K0=k[_+2],(q0&192)===128&&(K0&192)===128){if(H0=(l&15)<<12|(q0&63)<<6|K0&63,H0>2047&&(H0<55296||H0>57343))d=H0}break;case 4:if(q0=k[_+1],K0=k[_+2],I0=k[_+3],(q0&192)===128&&(K0&192)===128&&(I0&192)===128){if(H0=(l&15)<<18|(q0&63)<<12|(K0&63)<<6|I0&63,H0>65535&&H0<1114112)d=H0}}}if(d===null)d=65533,Q0=1;else if(d>65535)d-=65536,O.push(d>>>10&1023|55296),d=56320|d&1023;O.push(d),_+=Q0}return B0(O)}var m=4096;function B0(k){var V=k.length;if(V<=m)return String.fromCharCode.apply(String,k);var q="",O=0;while(OO)q=O;var _="";for(var l=V;lO)V=O;if(q<0){if(q+=O,q<0)q=0}else if(q>O)q=O;if(qq)throw RangeError("Trying to access beyond buffer length")}J.prototype.readUintLE=J.prototype.readUIntLE=function(V,q,O){if(V=V>>>0,q=q>>>0,!O)r(V,q,this.length);var _=this[V],l=1,d=0;while(++d>>0,q=q>>>0,!O)r(V,q,this.length);var _=this[V+--q],l=1;while(q>0&&(l*=256))_+=this[V+--q]*l;return _},J.prototype.readUint8=J.prototype.readUInt8=function(V,q){if(V=V>>>0,!q)r(V,1,this.length);return this[V]},J.prototype.readUint16LE=J.prototype.readUInt16LE=function(V,q){if(V=V>>>0,!q)r(V,2,this.length);return this[V]|this[V+1]<<8},J.prototype.readUint16BE=J.prototype.readUInt16BE=function(V,q){if(V=V>>>0,!q)r(V,2,this.length);return this[V]<<8|this[V+1]},J.prototype.readUint32LE=J.prototype.readUInt32LE=function(V,q){if(V=V>>>0,!q)r(V,4,this.length);return(this[V]|this[V+1]<<8|this[V+2]<<16)+this[V+3]*16777216},J.prototype.readUint32BE=J.prototype.readUInt32BE=function(V,q){if(V=V>>>0,!q)r(V,4,this.length);return this[V]*16777216+(this[V+1]<<16|this[V+2]<<8|this[V+3])},J.prototype.readIntLE=function(V,q,O){if(V=V>>>0,q=q>>>0,!O)r(V,q,this.length);var _=this[V],l=1,d=0;while(++d=l)_-=Math.pow(2,8*q);return _},J.prototype.readIntBE=function(V,q,O){if(V=V>>>0,q=q>>>0,!O)r(V,q,this.length);var _=q,l=1,d=this[V+--_];while(_>0&&(l*=256))d+=this[V+--_]*l;if(l*=128,d>=l)d-=Math.pow(2,8*q);return d},J.prototype.readInt8=function(V,q){if(V=V>>>0,!q)r(V,1,this.length);if(!(this[V]&128))return this[V];return(255-this[V]+1)*-1},J.prototype.readInt16LE=function(V,q){if(V=V>>>0,!q)r(V,2,this.length);var O=this[V]|this[V+1]<<8;return O&32768?O|4294901760:O},J.prototype.readInt16BE=function(V,q){if(V=V>>>0,!q)r(V,2,this.length);var O=this[V+1]|this[V]<<8;return O&32768?O|4294901760:O},J.prototype.readInt32LE=function(V,q){if(V=V>>>0,!q)r(V,4,this.length);return this[V]|this[V+1]<<8|this[V+2]<<16|this[V+3]<<24},J.prototype.readInt32BE=function(V,q){if(V=V>>>0,!q)r(V,4,this.length);return this[V]<<24|this[V+1]<<16|this[V+2]<<8|this[V+3]},J.prototype.readFloatLE=function(V,q){if(V=V>>>0,!q)r(V,4,this.length);return G.read(this,V,!0,23,4)},J.prototype.readFloatBE=function(V,q){if(V=V>>>0,!q)r(V,4,this.length);return G.read(this,V,!1,23,4)},J.prototype.readDoubleLE=function(V,q){if(V=V>>>0,!q)r(V,8,this.length);return G.read(this,V,!0,52,8)},J.prototype.readDoubleBE=function(V,q){if(V=V>>>0,!q)r(V,8,this.length);return G.read(this,V,!1,52,8)};function y(k,V,q,O,_,l){if(!J.isBuffer(k))throw TypeError('"buffer" argument must be a Buffer instance');if(V>_||Vk.length)throw RangeError("Index out of range")}J.prototype.writeUintLE=J.prototype.writeUIntLE=function(V,q,O,_){if(V=+V,q=q>>>0,O=O>>>0,!_){var l=Math.pow(2,8*O)-1;y(this,V,q,O,l,0)}var d=1,Q0=0;this[q]=V&255;while(++Q0>>0,O=O>>>0,!_){var l=Math.pow(2,8*O)-1;y(this,V,q,O,l,0)}var d=O-1,Q0=1;this[q+d]=V&255;while(--d>=0&&(Q0*=256))this[q+d]=V/Q0&255;return q+O},J.prototype.writeUint8=J.prototype.writeUInt8=function(V,q,O){if(V=+V,q=q>>>0,!O)y(this,V,q,1,255,0);return this[q]=V&255,q+1},J.prototype.writeUint16LE=J.prototype.writeUInt16LE=function(V,q,O){if(V=+V,q=q>>>0,!O)y(this,V,q,2,65535,0);return this[q]=V&255,this[q+1]=V>>>8,q+2},J.prototype.writeUint16BE=J.prototype.writeUInt16BE=function(V,q,O){if(V=+V,q=q>>>0,!O)y(this,V,q,2,65535,0);return this[q]=V>>>8,this[q+1]=V&255,q+2},J.prototype.writeUint32LE=J.prototype.writeUInt32LE=function(V,q,O){if(V=+V,q=q>>>0,!O)y(this,V,q,4,4294967295,0);return this[q+3]=V>>>24,this[q+2]=V>>>16,this[q+1]=V>>>8,this[q]=V&255,q+4},J.prototype.writeUint32BE=J.prototype.writeUInt32BE=function(V,q,O){if(V=+V,q=q>>>0,!O)y(this,V,q,4,4294967295,0);return this[q]=V>>>24,this[q+1]=V>>>16,this[q+2]=V>>>8,this[q+3]=V&255,q+4},J.prototype.writeIntLE=function(V,q,O,_){if(V=+V,q=q>>>0,!_){var l=Math.pow(2,8*O-1);y(this,V,q,O,l-1,-l)}var d=0,Q0=1,q0=0;this[q]=V&255;while(++d>0)-q0&255}return q+O},J.prototype.writeIntBE=function(V,q,O,_){if(V=+V,q=q>>>0,!_){var l=Math.pow(2,8*O-1);y(this,V,q,O,l-1,-l)}var d=O-1,Q0=1,q0=0;this[q+d]=V&255;while(--d>=0&&(Q0*=256)){if(V<0&&q0===0&&this[q+d+1]!==0)q0=1;this[q+d]=(V/Q0>>0)-q0&255}return q+O},J.prototype.writeInt8=function(V,q,O){if(V=+V,q=q>>>0,!O)y(this,V,q,1,127,-128);if(V<0)V=255+V+1;return this[q]=V&255,q+1},J.prototype.writeInt16LE=function(V,q,O){if(V=+V,q=q>>>0,!O)y(this,V,q,2,32767,-32768);return this[q]=V&255,this[q+1]=V>>>8,q+2},J.prototype.writeInt16BE=function(V,q,O){if(V=+V,q=q>>>0,!O)y(this,V,q,2,32767,-32768);return this[q]=V>>>8,this[q+1]=V&255,q+2},J.prototype.writeInt32LE=function(V,q,O){if(V=+V,q=q>>>0,!O)y(this,V,q,4,2147483647,-2147483648);return this[q]=V&255,this[q+1]=V>>>8,this[q+2]=V>>>16,this[q+3]=V>>>24,q+4},J.prototype.writeInt32BE=function(V,q,O){if(V=+V,q=q>>>0,!O)y(this,V,q,4,2147483647,-2147483648);if(V<0)V=4294967295+V+1;return this[q]=V>>>24,this[q+1]=V>>>16,this[q+2]=V>>>8,this[q+3]=V&255,q+4};function n(k,V,q,O,_,l){if(q+O>k.length)throw RangeError("Index out of range");if(q<0)throw RangeError("Index out of range")}function o(k,V,q,O,_){if(V=+V,q=q>>>0,!_)n(k,V,q,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return G.write(k,V,q,O,23,4),q+4}J.prototype.writeFloatLE=function(V,q,O){return o(this,V,q,!0,O)},J.prototype.writeFloatBE=function(V,q,O){return o(this,V,q,!1,O)};function Y0(k,V,q,O,_){if(V=+V,q=q>>>0,!_)n(k,V,q,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return G.write(k,V,q,O,52,8),q+8}J.prototype.writeDoubleLE=function(V,q,O){return Y0(this,V,q,!0,O)},J.prototype.writeDoubleBE=function(V,q,O){return Y0(this,V,q,!1,O)},J.prototype.copy=function(V,q,O,_){if(!J.isBuffer(V))throw TypeError("argument should be a Buffer");if(!O)O=0;if(!_&&_!==0)_=this.length;if(q>=V.length)q=V.length;if(!q)q=0;if(_>0&&_=this.length)throw RangeError("Index out of range");if(_<0)throw RangeError("sourceEnd out of bounds");if(_>this.length)_=this.length;if(V.length-q<_-O)_=V.length-q+O;var l=_-O;if(this===V&&typeof Uint8Array.prototype.copyWithin==="function")this.copyWithin(q,O,_);else Uint8Array.prototype.set.call(V,this.subarray(O,_),q);return l},J.prototype.fill=function(V,q,O,_){if(typeof V==="string"){if(typeof q==="string")_=q,q=0,O=this.length;else if(typeof O==="string")_=O,O=this.length;if(_!==void 0&&typeof _!=="string")throw TypeError("encoding must be a string");if(typeof _==="string"&&!J.isEncoding(_))throw TypeError("Unknown encoding: "+_);if(V.length===1){var l=V.charCodeAt(0);if(_==="utf8"&&l<128||_==="latin1")V=l}}else if(typeof V==="number")V=V&255;else if(typeof V==="boolean")V=Number(V);if(q<0||this.length>>0,O=O===void 0?this.length:O>>>0,!V)V=0;var d;if(typeof V==="number")for(d=q;d55295&&q<57344){if(!_){if(q>56319){if((V-=3)>-1)l.push(239,191,189);continue}else if(d+1===O){if((V-=3)>-1)l.push(239,191,189);continue}_=q;continue}if(q<56320){if((V-=3)>-1)l.push(239,191,189);_=q;continue}q=(_-55296<<10|q-56320)+65536}else if(_){if((V-=3)>-1)l.push(239,191,189)}if(_=null,q<128){if((V-=1)<0)break;l.push(q)}else if(q<2048){if((V-=2)<0)break;l.push(q>>6|192,q&63|128)}else if(q<65536){if((V-=3)<0)break;l.push(q>>12|224,q>>6&63|128,q&63|128)}else if(q<1114112){if((V-=4)<0)break;l.push(q>>18|240,q>>12&63|128,q>>6&63|128,q&63|128)}else throw Error("Invalid code point")}return l}function u(k){var V=[];for(var q=0;q>8,_=q%256,l.push(_),l.push(O)}return l}function Z0(k){return U.toByteArray(z(k))}function g(k,V,q,O){for(var _=0;_=V.length||_>=k.length)break;V[_+q]=k[_]}return _}function f(k,V){return k instanceof V||k!=null&&k.constructor!=null&&k.constructor.name!=null&&k.constructor.name===V.name}function R(k){return k!==k}var p=function(){var k="0123456789abcdef",V=Array(256);for(var q=0;q<16;++q){var O=q*16;for(var _=0;_<16;++_)V[O+_]=k[q]+k[_]}return V}()}),XB=R0((B,U)=>{U.exports=function(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function")return!1;if(typeof Symbol.iterator==="symbol")return!0;var Y={},Q=Symbol("test"),K=Object(Q);if(typeof Q==="string")return!1;if(Object.prototype.toString.call(Q)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(K)!=="[object Symbol]")return!1;var Z=42;Y[Q]=Z;for(var J in Y)return!1;if(typeof Object.keys==="function"&&Object.keys(Y).length!==0)return!1;if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(Y).length!==0)return!1;var M=Object.getOwnPropertySymbols(Y);if(M.length!==1||M[0]!==Q)return!1;if(!Object.prototype.propertyIsEnumerable.call(Y,Q))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var W=Object.getOwnPropertyDescriptor(Y,Q);if(W.value!==Z||W.enumerable!==!0)return!1}return!0}}),S8=R0((B,U)=>{var G=XB();U.exports=function(){return G()&&!!Symbol.toStringTag}}),RB=R0((B,U)=>{U.exports=Object}),FU=R0((B,U)=>{U.exports=Error}),HU=R0((B,U)=>{U.exports=EvalError}),WU=R0((B,U)=>{U.exports=RangeError}),PU=R0((B,U)=>{U.exports=ReferenceError}),LB=R0((B,U)=>{U.exports=SyntaxError}),f1=R0((B,U)=>{U.exports=TypeError}),wU=R0((B,U)=>{U.exports=URIError}),AU=R0((B,U)=>{U.exports=Math.abs}),jU=R0((B,U)=>{U.exports=Math.floor}),NU=R0((B,U)=>{U.exports=Math.max}),zU=R0((B,U)=>{U.exports=Math.min}),EU=R0((B,U)=>{U.exports=Math.pow}),TU=R0((B,U)=>{U.exports=Math.round}),DU=R0((B,U)=>{U.exports=Number.isNaN||function(Y){return Y!==Y}}),CU=R0((B,U)=>{var G=DU();U.exports=function(Q){if(G(Q)||Q===0)return Q;return Q<0?-1:1}}),kU=R0((B,U)=>{U.exports=Object.getOwnPropertyDescriptor}),K1=R0((B,U)=>{var G=kU();if(G)try{G([],"length")}catch(Y){G=null}U.exports=G}),x1=R0((B,U)=>{var G=Object.defineProperty||!1;if(G)try{G({},"a",{value:1})}catch(Y){G=!1}U.exports=G}),$U=R0((B,U)=>{var G=typeof Symbol<"u"&&Symbol,Y=XB();U.exports=function(){if(typeof G!=="function")return!1;if(typeof Symbol!=="function")return!1;if(typeof G("foo")!=="symbol")return!1;if(typeof Symbol("bar")!=="symbol")return!1;return Y()}}),IB=R0((B,U)=>{U.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),OB=R0((B,U)=>{U.exports=RB().getPrototypeOf||null}),SU=R0((B,U)=>{var G="Function.prototype.bind called on incompatible ",Y=Object.prototype.toString,Q=Math.max,K="[object Function]",Z=function(I,F){var D=[];for(var w=0;w{var G=SU();U.exports=Function.prototype.bind||G}),b8=R0((B,U)=>{U.exports=Function.prototype.call}),v8=R0((B,U)=>{U.exports=Function.prototype.apply}),bU=R0((B,U)=>{U.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),FB=R0((B,U)=>{var G=V1(),Y=v8(),Q=b8();U.exports=bU()||G.call(Q,Y)}),y8=R0((B,U)=>{var G=V1(),Y=f1(),Q=b8(),K=FB();U.exports=function(J){if(J.length<1||typeof J[0]!=="function")throw new Y("a function is required");return K(G,Q,J)}}),vU=R0((B,U)=>{var G=y8(),Y=K1(),Q;try{Q=[].__proto__===Array.prototype}catch(M){if(!M||typeof M!=="object"||!("code"in M)||M.code!=="ERR_PROTO_ACCESS")throw M}var K=!!Q&&Y&&Y(Object.prototype,"__proto__"),Z=Object,J=Z.getPrototypeOf;U.exports=K&&typeof K.get==="function"?G([K.get]):typeof J==="function"?function(W){return J(W==null?W:Z(W))}:!1}),HB=R0((B,U)=>{var G=IB(),Y=OB(),Q=vU();U.exports=G?function(Z){return G(Z)}:Y?function(Z){if(!Z||typeof Z!=="object"&&typeof Z!=="function")throw TypeError("getProto: not an object");return Y(Z)}:Q?function(Z){return Q(Z)}:null}),yU=R0((B,U)=>{var G=Function.prototype.call,Y=Object.prototype.hasOwnProperty;U.exports=V1().call(G,Y)}),WB=R0((B,U)=>{var G,Y=RB(),Q=FU(),K=HU(),Z=WU(),J=PU(),M=LB(),W=f1(),I=wU(),F=AU(),D=jU(),w=NU(),P=zU(),A=EU(),E=TU(),C=CU(),j=Function,v=function(h){try{return j('"use strict"; return ('+h+").constructor;")()}catch(Z0){}},S=K1(),H=x1(),X=function(){throw new W},$=S?function(){try{return arguments.callee,X}catch(h){try{return S(arguments,"callee").get}catch(Z0){return X}}}():X,x=$U()(),N=HB(),a=OB(),U0=IB(),b=v8(),c=b8(),T={},m=typeof Uint8Array>"u"||!N?G:N(Uint8Array),B0={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?G:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?G:ArrayBuffer,"%ArrayIteratorPrototype%":x&&N?N([][Symbol.iterator]()):G,"%AsyncFromSyncIteratorPrototype%":G,"%AsyncFunction%":T,"%AsyncGenerator%":T,"%AsyncGeneratorFunction%":T,"%AsyncIteratorPrototype%":T,"%Atomics%":typeof Atomics>"u"?G:Atomics,"%BigInt%":typeof BigInt>"u"?G:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?G:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?G:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?G:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Q,"%eval%":eval,"%EvalError%":K,"%Float16Array%":typeof Float16Array>"u"?G:Float16Array,"%Float32Array%":typeof Float32Array>"u"?G:Float32Array,"%Float64Array%":typeof Float64Array>"u"?G:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?G:FinalizationRegistry,"%Function%":j,"%GeneratorFunction%":T,"%Int8Array%":typeof Int8Array>"u"?G:Int8Array,"%Int16Array%":typeof Int16Array>"u"?G:Int16Array,"%Int32Array%":typeof Int32Array>"u"?G:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":x&&N?N(N([][Symbol.iterator]())):G,"%JSON%":typeof JSON==="object"?JSON:G,"%Map%":typeof Map>"u"?G:Map,"%MapIteratorPrototype%":typeof Map>"u"||!x||!N?G:N(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Y,"%Object.getOwnPropertyDescriptor%":S,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?G:Promise,"%Proxy%":typeof Proxy>"u"?G:Proxy,"%RangeError%":Z,"%ReferenceError%":J,"%Reflect%":typeof Reflect>"u"?G:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?G:Set,"%SetIteratorPrototype%":typeof Set>"u"||!x||!N?G:N(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?G:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":x&&N?N(""[Symbol.iterator]()):G,"%Symbol%":x?Symbol:G,"%SyntaxError%":M,"%ThrowTypeError%":$,"%TypedArray%":m,"%TypeError%":W,"%Uint8Array%":typeof Uint8Array>"u"?G:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?G:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?G:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?G:Uint32Array,"%URIError%":I,"%WeakMap%":typeof WeakMap>"u"?G:WeakMap,"%WeakRef%":typeof WeakRef>"u"?G:WeakRef,"%WeakSet%":typeof WeakSet>"u"?G:WeakSet,"%Function.prototype.call%":c,"%Function.prototype.apply%":b,"%Object.defineProperty%":H,"%Object.getPrototypeOf%":a,"%Math.abs%":F,"%Math.floor%":D,"%Math.max%":w,"%Math.min%":P,"%Math.pow%":A,"%Math.round%":E,"%Math.sign%":C,"%Reflect.getPrototypeOf%":U0};if(N)try{null.error}catch(h){B0["%Error.prototype%"]=N(N(h))}var i=function h(Z0){var g;if(Z0==="%AsyncFunction%")g=v("async function () {}");else if(Z0==="%GeneratorFunction%")g=v("function* () {}");else if(Z0==="%AsyncGeneratorFunction%")g=v("async function* () {}");else if(Z0==="%AsyncGenerator%"){var f=h("%AsyncGeneratorFunction%");if(f)g=f.prototype}else if(Z0==="%AsyncIteratorPrototype%"){var R=h("%AsyncGenerator%");if(R&&N)g=N(R.prototype)}return B0[Z0]=g,g},V0={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},s=V1(),G0=yU(),r=s.call(c,Array.prototype.concat),y=s.call(b,Array.prototype.splice),n=s.call(c,String.prototype.replace),o=s.call(c,String.prototype.slice),Y0=s.call(c,RegExp.prototype.exec),O0=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,z=/\\(\\)?/g,L=function(Z0){var g=o(Z0,0,1),f=o(Z0,-1);if(g==="%"&&f!=="%")throw new M("invalid intrinsic syntax, expected closing `%`");else if(f==="%"&&g!=="%")throw new M("invalid intrinsic syntax, expected opening `%`");var R=[];return n(Z0,O0,function(p,k,V,q){R[R.length]=V?n(q,z,"$1"):k||p}),R},u=function(Z0,g){var f=Z0,R;if(G0(V0,f))R=V0[f],f="%"+R[0]+"%";if(G0(B0,f)){var p=B0[f];if(p===T)p=i(f);if(typeof p>"u"&&!g)throw new W("intrinsic "+Z0+" exists, but is not available. Please file an issue!");return{alias:R,name:f,value:p}}throw new M("intrinsic "+Z0+" does not exist!")};U.exports=function(Z0,g){if(typeof Z0!=="string"||Z0.length===0)throw new W("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof g!=="boolean")throw new W('"allowMissing" argument must be a boolean');if(Y0(/^%?[^%]*%?$/,Z0)===null)throw new M("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var f=L(Z0),R=f.length>0?f[0]:"",p=u("%"+R+"%",g),k=p.name,V=p.value,q=!1,O=p.alias;if(O)R=O[0],y(f,r([0,1],O));for(var _=1,l=!0;_=f.length){var K0=S(V,d);if(l=!!K0,l&&"get"in K0&&!("originalValue"in K0.get))V=K0.get;else V=V[d]}else l=G0(V,d),V=V[d];if(l&&!q)B0[k]=V}}return V}}),PB=R0((B,U)=>{var G=WB(),Y=y8(),Q=Y([G("%String.prototype.indexOf%")]);U.exports=function(Z,J){var M=G(Z,!!J);if(typeof M==="function"&&Q(Z,".prototype.")>-1)return Y([M]);return M}}),gU=R0((B,U)=>{var G=S8()(),Y=PB()("Object.prototype.toString"),Q=function(M){if(G&&M&&typeof M==="object"&&Symbol.toStringTag in M)return!1;return Y(M)==="[object Arguments]"},K=function(M){if(Q(M))return!0;return M!==null&&typeof M==="object"&&"length"in M&&typeof M.length==="number"&&M.length>=0&&Y(M)!=="[object Array]"&&"callee"in M&&Y(M.callee)==="[object Function]"},Z=function(){return Q(arguments)}();Q.isLegacyArguments=K,U.exports=Z?Q:K}),fU=R0((B,U)=>{var G=Object.prototype.toString,Y=Function.prototype.toString,Q=/^\s*(?:function)?\*/,K=S8()(),Z=Object.getPrototypeOf,J=function(){if(!K)return!1;try{return Function("return function*() {}")()}catch(W){}},M;U.exports=function(I){if(typeof I!=="function")return!1;if(Q.test(Y.call(I)))return!0;if(!K)return G.call(I)==="[object GeneratorFunction]";if(!Z)return!1;if(typeof M>"u"){var F=J();M=F?Z(F):!1}return Z(I)===M}}),xU=R0((B,U)=>{var G=Function.prototype.toString,Y=typeof Reflect==="object"&&Reflect!==null&&Reflect.apply,Q,K;if(typeof Y==="function"&&typeof Object.defineProperty==="function")try{Q=Object.defineProperty({},"length",{get:function(){throw K}}),K={},Y(function(){throw 42},null,Q)}catch(S){if(S!==K)Y=null}else Y=null;var Z=/^\s*class\b/,J=function(H){try{var X=G.call(H);return Z.test(X)}catch($){return!1}},M=function(H){try{if(J(H))return!1;return G.call(H),!0}catch(X){return!1}},W=Object.prototype.toString,I="[object Object]",F="[object Function]",D="[object GeneratorFunction]",w="[object HTMLAllCollection]",P="[object HTML document.all class]",A="[object HTMLCollection]",E=typeof Symbol==="function"&&!!Symbol.toStringTag,C=!(0 in[,]),j=function(){return!1};if(typeof document==="object"){var v=document.all;if(W.call(v)===W.call(document.all))j=function(H){if((C||!H)&&(typeof H>"u"||typeof H==="object"))try{var X=W.call(H);return(X===w||X===P||X===A||X===I)&&H("")==null}catch($){}return!1}}U.exports=Y?function(H){if(j(H))return!0;if(!H)return!1;if(typeof H!=="function"&&typeof H!=="object")return!1;try{Y(H,null,Q)}catch(X){if(X!==K)return!1}return!J(H)&&M(H)}:function(H){if(j(H))return!0;if(!H)return!1;if(typeof H!=="function"&&typeof H!=="object")return!1;if(E)return M(H);if(J(H))return!1;var X=W.call(H);if(X!==F&&X!==D&&!/^\[object HTML/.test(X))return!1;return M(H)}}),_U=R0((B,U)=>{var G=xU(),Y=Object.prototype.toString,Q=Object.prototype.hasOwnProperty,K=function(I,F,D){for(var w=0,P=I.length;w=3)w=D;if(M(I))K(I,F,w);else if(typeof I==="string")Z(I,F,w);else J(I,F,w)}}),hU=R0((B,U)=>{U.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]}),uU=R0((B,U)=>{d2();var G=hU(),Y=typeof globalThis>"u"?v0:globalThis;U.exports=function(){var K=[];for(var Z=0;Z{var G=x1(),Y=LB(),Q=f1(),K=K1();U.exports=function(J,M,W){if(!J||typeof J!=="object"&&typeof J!=="function")throw new Q("`obj` must be an object or a function`");if(typeof M!=="string"&&typeof M!=="symbol")throw new Q("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=="boolean"&&arguments[3]!==null)throw new Q("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=="boolean"&&arguments[4]!==null)throw new Q("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=="boolean"&&arguments[5]!==null)throw new Q("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=="boolean")throw new Q("`loose`, if provided, must be a boolean");var I=arguments.length>3?arguments[3]:null,F=arguments.length>4?arguments[4]:null,D=arguments.length>5?arguments[5]:null,w=arguments.length>6?arguments[6]:!1,P=!!K&&K(J,M);if(G)G(J,M,{configurable:D===null&&P?P.configurable:!D,enumerable:I===null&&P?P.enumerable:!I,value:W,writable:F===null&&P?P.writable:!F});else if(w||!I&&!F&&!D)J[M]=W;else throw new Y("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),cU=R0((B,U)=>{var G=x1(),Y=function(){return!!G};Y.hasArrayLengthDefineBug=function(){if(!G)return null;try{return G([],"length",{value:1}).length!==1}catch(K){return!0}},U.exports=Y}),mU=R0((B,U)=>{var G=WB(),Y=dU(),Q=cU()(),K=K1(),Z=f1(),J=G("%Math.floor%");U.exports=function(W,I){if(typeof W!=="function")throw new Z("`fn` is not a function");if(typeof I!=="number"||I<0||I>4294967295||J(I)!==I)throw new Z("`length` must be a positive 32-bit integer");var F=arguments.length>2&&!!arguments[2],D=!0,w=!0;if("length"in W&&K){var P=K(W,"length");if(P&&!P.configurable)D=!1;if(P&&!P.writable)w=!1}if(D||w||!F)if(Q)Y(W,"length",I,!0,!0);else Y(W,"length",I);return W}}),lU=R0((B,U)=>{var G=V1(),Y=v8(),Q=FB();U.exports=function(){return Q(G,Y,arguments)}}),aU=R0((B,U)=>{var G=mU(),Y=x1(),Q=y8(),K=lU();if(U.exports=function(J){var M=Q(arguments),W=J.length-(arguments.length-1);return G(M,1+(W>0?W:0),!0)},Y)Y(U.exports,"apply",{value:K});else U.exports.apply=K}),wB=R0((B,U)=>{d2();var G=_U(),Y=uU(),Q=aU(),K=PB(),Z=K1(),J=HB(),M=K("Object.prototype.toString"),W=S8()(),I=typeof globalThis>"u"?v0:globalThis,F=Y(),D=K("String.prototype.slice"),w=K("Array.prototype.indexOf",!0)||function(j,v){for(var S=0;S-1)return v;if(v!=="Object")return!1;return E(j)}if(!Z)return null;return A(j)}}),pU=R0((B,U)=>{var G=wB();U.exports=function(Q){return!!G(Q)}}),rU=R0((B)=>{var U=gU(),G=fU(),Y=wB(),Q=pU();function K(O){return O.call.bind(O)}var Z=typeof BigInt<"u",J=typeof Symbol<"u",M=K(Object.prototype.toString),W=K(Number.prototype.valueOf),I=K(String.prototype.valueOf),F=K(Boolean.prototype.valueOf);if(Z)var D=K(BigInt.prototype.valueOf);if(J)var w=K(Symbol.prototype.valueOf);function P(O,_){if(typeof O!=="object")return!1;try{return _(O),!0}catch(l){return!1}}B.isArgumentsObject=U,B.isGeneratorFunction=G,B.isTypedArray=Q;function A(O){return typeof Promise<"u"&&O instanceof Promise||O!==null&&typeof O==="object"&&typeof O.then==="function"&&typeof O.catch==="function"}B.isPromise=A;function E(O){if(typeof ArrayBuffer<"u"&&ArrayBuffer.isView)return ArrayBuffer.isView(O);return Q(O)||n(O)}B.isArrayBufferView=E;function C(O){return Y(O)==="Uint8Array"}B.isUint8Array=C;function j(O){return Y(O)==="Uint8ClampedArray"}B.isUint8ClampedArray=j;function v(O){return Y(O)==="Uint16Array"}B.isUint16Array=v;function S(O){return Y(O)==="Uint32Array"}B.isUint32Array=S;function H(O){return Y(O)==="Int8Array"}B.isInt8Array=H;function X(O){return Y(O)==="Int16Array"}B.isInt16Array=X;function $(O){return Y(O)==="Int32Array"}B.isInt32Array=$;function x(O){return Y(O)==="Float32Array"}B.isFloat32Array=x;function N(O){return Y(O)==="Float64Array"}B.isFloat64Array=N;function a(O){return Y(O)==="BigInt64Array"}B.isBigInt64Array=a;function U0(O){return Y(O)==="BigUint64Array"}B.isBigUint64Array=U0;function b(O){return M(O)==="[object Map]"}b.working=typeof Map<"u"&&b(new Map);function c(O){if(typeof Map>"u")return!1;return b.working?b(O):O instanceof Map}B.isMap=c;function T(O){return M(O)==="[object Set]"}T.working=typeof Set<"u"&&T(new Set);function m(O){if(typeof Set>"u")return!1;return T.working?T(O):O instanceof Set}B.isSet=m;function B0(O){return M(O)==="[object WeakMap]"}B0.working=typeof WeakMap<"u"&&B0(new WeakMap);function i(O){if(typeof WeakMap>"u")return!1;return B0.working?B0(O):O instanceof WeakMap}B.isWeakMap=i;function V0(O){return M(O)==="[object WeakSet]"}V0.working=typeof WeakSet<"u"&&V0(new WeakSet);function s(O){return V0(O)}B.isWeakSet=s;function G0(O){return M(O)==="[object ArrayBuffer]"}G0.working=typeof ArrayBuffer<"u"&&G0(new ArrayBuffer);function r(O){if(typeof ArrayBuffer>"u")return!1;return G0.working?G0(O):O instanceof ArrayBuffer}B.isArrayBuffer=r;function y(O){return M(O)==="[object DataView]"}y.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&y(new DataView(new ArrayBuffer(1),0,1));function n(O){if(typeof DataView>"u")return!1;return y.working?y(O):O instanceof DataView}B.isDataView=n;var o=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Y0(O){return M(O)==="[object SharedArrayBuffer]"}function O0(O){if(typeof o>"u")return!1;if(typeof Y0.working>"u")Y0.working=Y0(new o);return Y0.working?Y0(O):O instanceof o}B.isSharedArrayBuffer=O0;function z(O){return M(O)==="[object AsyncFunction]"}B.isAsyncFunction=z;function L(O){return M(O)==="[object Map Iterator]"}B.isMapIterator=L;function u(O){return M(O)==="[object Set Iterator]"}B.isSetIterator=u;function h(O){return M(O)==="[object Generator]"}B.isGeneratorObject=h;function Z0(O){return M(O)==="[object WebAssembly.Module]"}B.isWebAssemblyCompiledModule=Z0;function g(O){return P(O,W)}B.isNumberObject=g;function f(O){return P(O,I)}B.isStringObject=f;function R(O){return P(O,F)}B.isBooleanObject=R;function p(O){return Z&&P(O,D)}B.isBigIntObject=p;function k(O){return J&&P(O,w)}B.isSymbolObject=k;function V(O){return g(O)||f(O)||R(O)||p(O)||k(O)}B.isBoxedPrimitive=V;function q(O){return typeof Uint8Array<"u"&&(r(O)||O0(O))}B.isAnyArrayBuffer=q,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(O){Object.defineProperty(B,O,{enumerable:!1,value:function(){throw Error(O+" is not supported in userland")}})})}),iU=R0((B,U)=>{U.exports=function(Y){return Y&&typeof Y==="object"&&typeof Y.copy==="function"&&typeof Y.fill==="function"&&typeof Y.readUInt8==="function"}}),AB=R0((B)=>{P2();var U=Object.getOwnPropertyDescriptors||function(n){var o=Object.keys(n),Y0={};for(var O0=0;O0=O0)return u;switch(u){case"%s":return String(Y0[o++]);case"%d":return Number(Y0[o++]);case"%j":try{return JSON.stringify(Y0[o++])}catch(h){return"[Circular]"}default:return u}});for(var L=Y0[o];o"u")return function(){return B.deprecate(y,n).apply(this,arguments)};var o=!1;function Y0(){if(!o){if(P0.throwDeprecation)throw Error(n);else if(P0.traceDeprecation)console.trace(n);else console.error(n);o=!0}return y.apply(this,arguments)}return Y0};var Y={},Q=/^$/;if(P0.env.NODE_DEBUG){var K=P0.env.NODE_DEBUG;K=K.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),Q=new RegExp("^"+K+"$","i")}B.debuglog=function(y){if(y=y.toUpperCase(),!Y[y])if(Q.test(y)){var n=P0.pid;Y[y]=function(){var o=B.format.apply(B,arguments);console.error("%s %d: %s",y,n,o)}}else Y[y]=function(){};return Y[y]};function Z(y,n){var o={seen:[],stylize:M};if(arguments.length>=3)o.depth=arguments[2];if(arguments.length>=4)o.colors=arguments[3];if(C(n))o.showHidden=n;else if(n)B._extend(o,n);if($(o.showHidden))o.showHidden=!1;if($(o.depth))o.depth=2;if($(o.colors))o.colors=!1;if($(o.customInspect))o.customInspect=!0;if(o.colors)o.stylize=J;return I(o,y,o.depth)}B.inspect=Z,Z.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Z.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function J(y,n){var o=Z.styles[n];if(o)return"\x1B["+Z.colors[o][0]+"m"+y+"\x1B["+Z.colors[o][1]+"m";else return y}function M(y,n){return y}function W(y){var n={};return y.forEach(function(o,Y0){n[o]=!0}),n}function I(y,n,o){if(y.customInspect&&n&&b(n.inspect)&&n.inspect!==B.inspect&&!(n.constructor&&n.constructor.prototype===n)){var Y0=n.inspect(o,y);if(!H(Y0))Y0=I(y,Y0,o);return Y0}var O0=F(y,n);if(O0)return O0;var z=Object.keys(n),L=W(z);if(y.showHidden)z=Object.getOwnPropertyNames(n);if(U0(n)&&(z.indexOf("message")>=0||z.indexOf("description")>=0))return D(n);if(z.length===0){if(b(n)){var u=n.name?": "+n.name:"";return y.stylize("[Function"+u+"]","special")}if(x(n))return y.stylize(RegExp.prototype.toString.call(n),"regexp");if(a(n))return y.stylize(Date.prototype.toString.call(n),"date");if(U0(n))return D(n)}var h="",Z0=!1,g=["{","}"];if(E(n))Z0=!0,g=["[","]"];if(b(n))h=" [Function"+(n.name?": "+n.name:"")+"]";if(x(n))h=" "+RegExp.prototype.toString.call(n);if(a(n))h=" "+Date.prototype.toUTCString.call(n);if(U0(n))h=" "+D(n);if(z.length===0&&(!Z0||n.length==0))return g[0]+h+g[1];if(o<0)if(x(n))return y.stylize(RegExp.prototype.toString.call(n),"regexp");else return y.stylize("[Object]","special");y.seen.push(n);var f;if(Z0)f=w(y,n,o,L,z);else f=z.map(function(R){return P(y,n,o,L,R,Z0)});return y.seen.pop(),A(f,h,g)}function F(y,n){if($(n))return y.stylize("undefined","undefined");if(H(n)){var o="'"+JSON.stringify(n).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return y.stylize(o,"string")}if(S(n))return y.stylize(""+n,"number");if(C(n))return y.stylize(""+n,"boolean");if(j(n))return y.stylize("null","null")}function D(y){return"["+Error.prototype.toString.call(y)+"]"}function w(y,n,o,Y0,O0){var z=[];for(var L=0,u=n.length;L-1)if(z)u=u.split(` +`).map(function(Z0){return" "+Z0}).join(` +`).slice(2);else u=` +`+u.split(` +`).map(function(Z0){return" "+Z0}).join(` +`)}else u=y.stylize("[Circular]","special");if($(L)){if(z&&O0.match(/^\d+$/))return u;if(L=JSON.stringify(""+O0),L.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/))L=L.slice(1,-1),L=y.stylize(L,"name");else L=L.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),L=y.stylize(L,"string")}return L+": "+u}function A(y,n,o){var Y0=0;if(y.reduce(function(O0,z){if(Y0++,z.indexOf(` +`)>=0)Y0++;return O0+z.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return o[0]+(n===""?"":n+` + `)+" "+y.join(`, + `)+" "+o[1];return o[0]+n+" "+y.join(", ")+" "+o[1]}B.types=rU();function E(y){return Array.isArray(y)}B.isArray=E;function C(y){return typeof y==="boolean"}B.isBoolean=C;function j(y){return y===null}B.isNull=j;function v(y){return y==null}B.isNullOrUndefined=v;function S(y){return typeof y==="number"}B.isNumber=S;function H(y){return typeof y==="string"}B.isString=H;function X(y){return typeof y==="symbol"}B.isSymbol=X;function $(y){return y===void 0}B.isUndefined=$;function x(y){return N(y)&&T(y)==="[object RegExp]"}B.isRegExp=x,B.types.isRegExp=x;function N(y){return typeof y==="object"&&y!==null}B.isObject=N;function a(y){return N(y)&&T(y)==="[object Date]"}B.isDate=a,B.types.isDate=a;function U0(y){return N(y)&&(T(y)==="[object Error]"||y instanceof Error)}B.isError=U0,B.types.isNativeError=U0;function b(y){return typeof y==="function"}B.isFunction=b;function c(y){return y===null||typeof y==="boolean"||typeof y==="number"||typeof y==="string"||typeof y==="symbol"||typeof y>"u"}B.isPrimitive=c,B.isBuffer=iU();function T(y){return Object.prototype.toString.call(y)}function m(y){return y<10?"0"+y.toString(10):y.toString(10)}var B0=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function i(){var y=new Date,n=[m(y.getHours()),m(y.getMinutes()),m(y.getSeconds())].join(":");return[y.getDate(),B0[y.getMonth()],n].join(" ")}B.log=function(){console.log("%s - %s",i(),B.format.apply(B,arguments))},B.inherits=W2(),B._extend=function(y,n){if(!n||!N(n))return y;var o=Object.keys(n),Y0=o.length;while(Y0--)y[o[Y0]]=n[o[Y0]];return y};function V0(y,n){return Object.prototype.hasOwnProperty.call(y,n)}var s=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;B.promisify=function(n){if(typeof n!=="function")throw TypeError('The "original" argument must be of type Function');if(s&&n[s]){var o=n[s];if(typeof o!=="function")throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(o,s,{value:o,enumerable:!1,writable:!1,configurable:!0}),o}function o(){var Y0,O0,z=new Promise(function(h,Z0){Y0=h,O0=Z0}),L=[];for(var u=0;u{function G(P,A){var E=Object.keys(P);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(P);A&&(C=C.filter(function(j){return Object.getOwnPropertyDescriptor(P,j).enumerable})),E.push.apply(E,C)}return E}function Y(P){for(var A=1;A0)this.tail.next=C;else this.head=C;this.tail=C,++this.length}},{key:"unshift",value:function(E){var C={data:E,next:this.head};if(this.length===0)this.tail=C;this.head=C,++this.length}},{key:"shift",value:function(){if(this.length===0)return;var E=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,E}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(E){if(this.length===0)return"";var C=this.head,j=""+C.data;while(C=C.next)j+=E+C.data;return j}},{key:"concat",value:function(E){if(this.length===0)return I.alloc(0);var C=I.allocUnsafe(E>>>0),j=this.head,v=0;while(j)w(j.data,C,v),v+=j.data.length,j=j.next;return C}},{key:"consume",value:function(E,C){var j;if(ES.length?S.length:E;if(H===S.length)v+=S;else v+=S.slice(0,E);if(E-=H,E===0){if(H===S.length)if(++j,C.next)this.head=C.next;else this.head=this.tail=null;else this.head=C,C.data=S.slice(H);break}++j}return this.length-=j,v}},{key:"_getBuffer",value:function(E){var C=I.allocUnsafe(E),j=this.head,v=1;j.data.copy(C),E-=j.data.length;while(j=j.next){var S=j.data,H=E>S.length?S.length:E;if(S.copy(C,C.length-E,0,H),E-=H,E===0){if(H===S.length)if(++v,j.next)this.head=j.next;else this.head=this.tail=null;else this.head=j,j.data=S.slice(H);break}++v}return this.length-=v,C}},{key:D,value:function(E,C){return F(this,Y(Y({},C),{},{depth:0,customInspect:!1}))}}]),P}()}),jB=R0((B,U)=>{P2();function G(M,W){var I=this,F=this._readableState&&this._readableState.destroyed,D=this._writableState&&this._writableState.destroyed;if(F||D){if(W)W(M);else if(M){if(!this._writableState)P0.nextTick(Z,this,M);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,P0.nextTick(Z,this,M)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy(M||null,function(w){if(!W&&w)if(!I._writableState)P0.nextTick(Y,I,w);else if(!I._writableState.errorEmitted)I._writableState.errorEmitted=!0,P0.nextTick(Y,I,w);else P0.nextTick(Q,I);else if(W)P0.nextTick(Q,I),W(w);else P0.nextTick(Q,I)}),this}function Y(M,W){Z(M,W),Q(M)}function Q(M){if(M._writableState&&!M._writableState.emitClose)return;if(M._readableState&&!M._readableState.emitClose)return;M.emit("close")}function K(){if(this._readableState)this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1;if(this._writableState)this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1}function Z(M,W){M.emit("error",W)}function J(M,W){var{_readableState:I,_writableState:F}=M;if(I&&I.autoDestroy||F&&F.autoDestroy)M.destroy(W);else M.emit("error",W)}U.exports={destroy:G,undestroy:K,errorOrDestroy:J}}),c2=R0((B,U)=>{function G(W,I){W.prototype=Object.create(I.prototype),W.prototype.constructor=W,W.__proto__=I}var Y={};function Q(W,I,F){if(!F)F=Error;function D(P,A,E){if(typeof I==="string")return I;else return I(P,A,E)}var w=function(P){G(A,P);function A(E,C,j){return P.call(this,D(E,C,j))||this}return A}(F);w.prototype.name=F.name,w.prototype.code=W,Y[W]=w}function K(W,I){if(Array.isArray(W)){var F=W.length;if(W=W.map(function(D){return String(D)}),F>2)return"one of ".concat(I," ").concat(W.slice(0,F-1).join(", "),", or ")+W[F-1];else if(F===2)return"one of ".concat(I," ").concat(W[0]," or ").concat(W[1]);else return"of ".concat(I," ").concat(W[0])}else return"of ".concat(I," ").concat(String(W))}function Z(W,I,F){return W.substr(!F||F<0?0:+F,I.length)===I}function J(W,I,F){if(F===void 0||F>W.length)F=W.length;return W.substring(F-I.length,F)===I}function M(W,I,F){if(typeof F!=="number")F=0;if(F+I.length>W.length)return!1;else return W.indexOf(I,F)!==-1}Q("ERR_INVALID_OPT_VALUE",function(W,I){return'The value "'+I+'" is invalid for option "'+W+'"'},TypeError),Q("ERR_INVALID_ARG_TYPE",function(W,I,F){var D;if(typeof I==="string"&&Z(I,"not "))D="must not be",I=I.replace(/^not /,"");else D="must be";var w;if(J(W," argument"))w="The ".concat(W," ").concat(D," ").concat(K(I,"type"));else{var P=M(W,".")?"property":"argument";w='The "'.concat(W,'" ').concat(P," ").concat(D," ").concat(K(I,"type"))}return w+=". Received type ".concat(typeof F),w},TypeError),Q("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),Q("ERR_METHOD_NOT_IMPLEMENTED",function(W){return"The "+W+" method is not implemented"}),Q("ERR_STREAM_PREMATURE_CLOSE","Premature close"),Q("ERR_STREAM_DESTROYED",function(W){return"Cannot call "+W+" after a stream was destroyed"}),Q("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),Q("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),Q("ERR_STREAM_WRITE_AFTER_END","write after end"),Q("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),Q("ERR_UNKNOWN_ENCODING",function(W){return"Unknown encoding: "+W},TypeError),Q("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),U.exports.codes=Y}),NB=R0((B,U)=>{var G=c2().codes.ERR_INVALID_OPT_VALUE;function Y(K,Z,J){return K.highWaterMark!=null?K.highWaterMark:Z?K[J]:null}function Q(K,Z,J,M){var W=Y(Z,M,J);if(W!=null){if(!(isFinite(W)&&Math.floor(W)===W)||W<0)throw new G(M?J:"highWaterMark",W);return Math.floor(W)}return K.objectMode?16:16384}U.exports={getHighWaterMark:Q}}),sU=R0((B,U)=>{d2(),U.exports=G;function G(Q,K){if(Y("noDeprecation"))return Q;var Z=!1;function J(){if(!Z){if(Y("throwDeprecation"))throw Error(K);else if(Y("traceDeprecation"))console.trace(K);else console.warn(K);Z=!0}return Q.apply(this,arguments)}return J}function Y(Q){try{if(!v0.localStorage)return!1}catch(Z){return!1}var K=v0.localStorage[Q];if(K==null)return!1;return String(K).toLowerCase()==="true"}}),zB=R0((B,U)=>{d2(),P2(),U.exports=N;function G(z){var L=this;this.next=null,this.entry=null,this.finish=function(){O0(L,z)}}var Y;N.WritableState=$;var Q={deprecate:sU()},K=MB(),Z=g1().Buffer,J=(typeof v0<"u"?v0:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function M(z){return Z.from(z)}function W(z){return Z.isBuffer(z)||z instanceof J}var I=jB(),F=NB().getHighWaterMark,D=c2().codes,w=D.ERR_INVALID_ARG_TYPE,P=D.ERR_METHOD_NOT_IMPLEMENTED,A=D.ERR_MULTIPLE_CALLBACK,E=D.ERR_STREAM_CANNOT_PIPE,C=D.ERR_STREAM_DESTROYED,j=D.ERR_STREAM_NULL_VALUES,v=D.ERR_STREAM_WRITE_AFTER_END,S=D.ERR_UNKNOWN_ENCODING,H=I.errorOrDestroy;W2()(N,K);function X(){}function $(z,L,u){if(Y=Y||u2(),z=z||{},typeof u!=="boolean")u=L instanceof Y;if(this.objectMode=!!z.objectMode,u)this.objectMode=this.objectMode||!!z.writableObjectMode;this.highWaterMark=F(this,z,"writableHighWaterMark",u),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=z.decodeStrings===!1;this.decodeStrings=!h,this.defaultEncoding=z.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Z0){i(L,Z0)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=z.emitClose!==!1,this.autoDestroy=!!z.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new G(this)}$.prototype.getBuffer=function(){var L=this.bufferedRequest,u=[];while(L)u.push(L),L=L.next;return u},function(){try{Object.defineProperty($.prototype,"buffer",{get:Q.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(z){}}();var x;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")x=Function.prototype[Symbol.hasInstance],Object.defineProperty(N,Symbol.hasInstance,{value:function(L){if(x.call(this,L))return!0;if(this!==N)return!1;return L&&L._writableState instanceof $}});else x=function(L){return L instanceof this};function N(z){Y=Y||u2();var L=this instanceof Y;if(!L&&!x.call(N,this))return new N(z);if(this._writableState=new $(z,this,L),this.writable=!0,z){if(typeof z.write==="function")this._write=z.write;if(typeof z.writev==="function")this._writev=z.writev;if(typeof z.destroy==="function")this._destroy=z.destroy;if(typeof z.final==="function")this._final=z.final}K.call(this)}N.prototype.pipe=function(){H(this,new E)};function a(z,L){var u=new v;H(z,u),P0.nextTick(L,u)}function U0(z,L,u,h){var Z0;if(u===null)Z0=new j;else if(typeof u!=="string"&&!L.objectMode)Z0=new w("chunk",["string","Buffer"],u);if(Z0)return H(z,Z0),P0.nextTick(h,Z0),!1;return!0}N.prototype.write=function(z,L,u){var h=this._writableState,Z0=!1,g=!h.objectMode&&W(z);if(g&&!Z.isBuffer(z))z=M(z);if(typeof L==="function")u=L,L=null;if(g)L="buffer";else if(!L)L=h.defaultEncoding;if(typeof u!=="function")u=X;if(h.ending)a(this,u);else if(g||U0(this,h,z,u))h.pendingcb++,Z0=c(this,h,g,z,L,u);return Z0},N.prototype.cork=function(){this._writableState.corked++},N.prototype.uncork=function(){var z=this._writableState;if(z.corked){if(z.corked--,!z.writing&&!z.corked&&!z.bufferProcessing&&z.bufferedRequest)G0(this,z)}},N.prototype.setDefaultEncoding=function(L){if(typeof L==="string")L=L.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((L+"").toLowerCase())>-1))throw new S(L);return this._writableState.defaultEncoding=L,this},Object.defineProperty(N.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function b(z,L,u){if(!z.objectMode&&z.decodeStrings!==!1&&typeof L==="string")L=Z.from(L,u);return L}Object.defineProperty(N.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function c(z,L,u,h,Z0,g){if(!u){var f=b(L,h,Z0);if(h!==f)u=!0,Z0="buffer",h=f}var R=L.objectMode?1:h.length;L.length+=R;var p=L.length{P2();var G=Object.keys||function(F){var D=[];for(var w in F)D.push(w);return D};U.exports=M;var Y=EB(),Q=zB();W2()(M,Y);var K=G(Q.prototype);for(var Z=0;Z{var G=g1(),Y=G.Buffer;function Q(Z,J){for(var M in Z)J[M]=Z[M]}if(Y.from&&Y.alloc&&Y.allocUnsafe&&Y.allocUnsafeSlow)U.exports=G;else Q(G,B),B.Buffer=K;function K(Z,J,M){return Y(Z,J,M)}Q(Y,K),K.from=function(Z,J,M){if(typeof Z==="number")throw TypeError("Argument must not be a number");return Y(Z,J,M)},K.alloc=function(Z,J,M){if(typeof Z!=="number")throw TypeError("Argument must be a number");var W=Y(Z);if(J!==void 0)if(typeof M==="string")W.fill(J,M);else W.fill(J);else W.fill(0);return W},K.allocUnsafe=function(Z){if(typeof Z!=="number")throw TypeError("Argument must be a number");return Y(Z)},K.allocUnsafeSlow=function(Z){if(typeof Z!=="number")throw TypeError("Argument must be a number");return G.SlowBuffer(Z)}}),F8=R0((B)=>{var U=oU().Buffer,G=U.isEncoding||function(j){switch(j=""+j,j&&j.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Y(j){if(!j)return"utf8";var v;while(!0)switch(j){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return j;default:if(v)return;j=(""+j).toLowerCase(),v=!0}}function Q(j){var v=Y(j);if(typeof v!=="string"&&(U.isEncoding===G||!G(j)))throw Error("Unknown encoding: "+j);return v||j}B.StringDecoder=K;function K(j){this.encoding=Q(j);var v;switch(this.encoding){case"utf16le":this.text=D,this.end=w,v=4;break;case"utf8":this.fillLast=W,v=4;break;case"base64":this.text=P,this.end=A,v=3;break;default:this.write=E,this.end=C;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=U.allocUnsafe(v)}K.prototype.write=function(j){if(j.length===0)return"";var v,S;if(this.lastNeed){if(v=this.fillLast(j),v===void 0)return"";S=this.lastNeed,this.lastNeed=0}else S=0;if(S>5===6)return 2;else if(j>>4===14)return 3;else if(j>>3===30)return 4;return j>>6===2?-1:-2}function J(j,v,S){var H=v.length-1;if(H=0){if(X>0)j.lastNeed=X-1;return X}if(--H=0){if(X>0)j.lastNeed=X-2;return X}if(--H=0){if(X>0)if(X===2)X=0;else j.lastNeed=X-3;return X}return 0}function M(j,v,S){if((v[0]&192)!==128)return j.lastNeed=0,"�";if(j.lastNeed>1&&v.length>1){if((v[1]&192)!==128)return j.lastNeed=1,"�";if(j.lastNeed>2&&v.length>2){if((v[2]&192)!==128)return j.lastNeed=2,"�"}}}function W(j){var v=this.lastTotal-this.lastNeed,S=M(this,j,v);if(S!==void 0)return S;if(this.lastNeed<=j.length)return j.copy(this.lastChar,v,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);j.copy(this.lastChar,v,0,j.length),this.lastNeed-=j.length}function I(j,v){var S=J(this,j,v);if(!this.lastNeed)return j.toString("utf8",v);this.lastTotal=S;var H=j.length-(S-this.lastNeed);return j.copy(this.lastChar,0,H),j.toString("utf8",v,H)}function F(j){var v=j&&j.length?this.write(j):"";if(this.lastNeed)return v+"�";return v}function D(j,v){if((j.length-v)%2===0){var S=j.toString("utf16le",v);if(S){var H=S.charCodeAt(S.length-1);if(H>=55296&&H<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=j[j.length-2],this.lastChar[1]=j[j.length-1],S.slice(0,-1)}return S}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=j[j.length-1],j.toString("utf16le",v,j.length-1)}function w(j){var v=j&&j.length?this.write(j):"";if(this.lastNeed){var S=this.lastTotal-this.lastNeed;return v+this.lastChar.toString("utf16le",0,S)}return v}function P(j,v){var S=(j.length-v)%3;if(S===0)return j.toString("base64",v);if(this.lastNeed=3-S,this.lastTotal=3,S===1)this.lastChar[0]=j[j.length-1];else this.lastChar[0]=j[j.length-2],this.lastChar[1]=j[j.length-1];return j.toString("base64",v,j.length-S)}function A(j){var v=j&&j.length?this.write(j):"";if(this.lastNeed)return v+this.lastChar.toString("base64",0,3-this.lastNeed);return v}function E(j){return j.toString(this.encoding)}function C(j){return j&&j.length?this.write(j):""}}),g8=R0((B,U)=>{var G=c2().codes.ERR_STREAM_PREMATURE_CLOSE;function Y(J){var M=!1;return function(){if(M)return;M=!0;for(var W=arguments.length,I=Array(W),F=0;F{P2();var G;function Y(S,H,X){if(H=Q(H),H in S)Object.defineProperty(S,H,{value:X,enumerable:!0,configurable:!0,writable:!0});else S[H]=X;return S}function Q(S){var H=K(S,"string");return typeof H==="symbol"?H:String(H)}function K(S,H){if(typeof S!=="object"||S===null)return S;var X=S[Symbol.toPrimitive];if(X!==void 0){var $=X.call(S,H||"default");if(typeof $!=="object")return $;throw TypeError("@@toPrimitive must return a primitive value.")}return(H==="string"?String:Number)(S)}var Z=g8(),J=Symbol("lastResolve"),M=Symbol("lastReject"),W=Symbol("error"),I=Symbol("ended"),F=Symbol("lastPromise"),D=Symbol("handlePromise"),w=Symbol("stream");function P(S,H){return{value:S,done:H}}function A(S){var H=S[J];if(H!==null){var X=S[w].read();if(X!==null)S[F]=null,S[J]=null,S[M]=null,H(P(X,!1))}}function E(S){P0.nextTick(A,S)}function C(S,H){return function(X,$){S.then(function(){if(H[I]){X(P(void 0,!0));return}H[D](X,$)},$)}}var j=Object.getPrototypeOf(function(){}),v=Object.setPrototypeOf((G={get stream(){return this[w]},next:function(){var H=this,X=this[W];if(X!==null)return Promise.reject(X);if(this[I])return Promise.resolve(P(void 0,!0));if(this[w].destroyed)return new Promise(function(a,U0){P0.nextTick(function(){if(H[W])U0(H[W]);else a(P(void 0,!0))})});var $=this[F],x;if($)x=new Promise(C($,this));else{var N=this[w].read();if(N!==null)return Promise.resolve(P(N,!1));x=new Promise(this[D])}return this[F]=x,x}},Y(G,Symbol.asyncIterator,function(){return this}),Y(G,"return",function(){var H=this;return new Promise(function(X,$){H[w].destroy(null,function(x){if(x){$(x);return}X(P(void 0,!0))})})}),G),j);U.exports=function(H){var X,$=Object.create(v,(X={},Y(X,w,{value:H,writable:!0}),Y(X,J,{value:null,writable:!0}),Y(X,M,{value:null,writable:!0}),Y(X,W,{value:null,writable:!0}),Y(X,I,{value:H._readableState.endEmitted,writable:!0}),Y(X,D,{value:function(N,a){var U0=$[w].read();if(U0)$[F]=null,$[J]=null,$[M]=null,N(P(U0,!1));else $[J]=N,$[M]=a},writable:!0}),X));return $[F]=null,Z(H,function(x){if(x&&x.code!=="ERR_STREAM_PREMATURE_CLOSE"){var N=$[M];if(N!==null)$[F]=null,$[J]=null,$[M]=null,N(x);$[W]=x;return}var a=$[J];if(a!==null)$[F]=null,$[J]=null,$[M]=null,a(P(void 0,!0));$[I]=!0}),H.on("readable",E.bind(null,$)),$}}),eU=R0((B,U)=>{U.exports=function(){throw Error("Readable.from is not available in the browser")}}),EB=R0((B,U)=>{d2(),P2(),U.exports=a;var G;a.ReadableState=N,$8().EventEmitter;var Y=function(f,R){return f.listeners(R).length},Q=MB(),K=g1().Buffer,Z=(typeof v0<"u"?v0:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function J(g){return K.from(g)}function M(g){return K.isBuffer(g)||g instanceof Z}var W=AB(),I;if(W&&W.debuglog)I=W.debuglog("stream");else I=function(){};var F=nU(),D=jB(),w=NB().getHighWaterMark,P=c2().codes,A=P.ERR_INVALID_ARG_TYPE,E=P.ERR_STREAM_PUSH_AFTER_EOF,C=P.ERR_METHOD_NOT_IMPLEMENTED,j=P.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,v,S,H;W2()(a,Q);var X=D.errorOrDestroy,$=["error","close","destroy","pause","resume"];function x(g,f,R){if(typeof g.prependListener==="function")return g.prependListener(f,R);if(!g._events||!g._events[f])g.on(f,R);else if(Array.isArray(g._events[f]))g._events[f].unshift(R);else g._events[f]=[R,g._events[f]]}function N(g,f,R){if(G=G||u2(),g=g||{},typeof R!=="boolean")R=f instanceof G;if(this.objectMode=!!g.objectMode,R)this.objectMode=this.objectMode||!!g.readableObjectMode;if(this.highWaterMark=w(this,g,"readableHighWaterMark",R),this.buffer=new F,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=g.emitClose!==!1,this.autoDestroy=!!g.autoDestroy,this.destroyed=!1,this.defaultEncoding=g.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,g.encoding){if(!v)v=F8().StringDecoder;this.decoder=new v(g.encoding),this.encoding=g.encoding}}function a(g){if(G=G||u2(),!(this instanceof a))return new a(g);var f=this instanceof G;if(this._readableState=new N(g,this,f),this.readable=!0,g){if(typeof g.read==="function")this._read=g.read;if(typeof g.destroy==="function")this._destroy=g.destroy}Q.call(this)}Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){if(this._readableState===void 0)return!1;return this._readableState.destroyed},set:function(f){if(!this._readableState)return;this._readableState.destroyed=f}}),a.prototype.destroy=D.destroy,a.prototype._undestroy=D.undestroy,a.prototype._destroy=function(g,f){f(g)},a.prototype.push=function(g,f){var R=this._readableState,p;if(!R.objectMode){if(typeof g==="string"){if(f=f||R.defaultEncoding,f!==R.encoding)g=K.from(g,f),f="";p=!0}}else p=!0;return U0(this,g,f,!1,p)},a.prototype.unshift=function(g){return U0(this,g,null,!0,!1)};function U0(g,f,R,p,k){I("readableAddChunk",f);var V=g._readableState;if(f===null)V.reading=!1,i(g,V);else{var q;if(!k)q=c(V,f);if(q)X(g,q);else if(V.objectMode||f&&f.length>0){if(typeof f!=="string"&&!V.objectMode&&Object.getPrototypeOf(f)!==K.prototype)f=J(f);if(p)if(V.endEmitted)X(g,new j);else b(g,V,f,!0);else if(V.ended)X(g,new E);else if(V.destroyed)return!1;else if(V.reading=!1,V.decoder&&!R)if(f=V.decoder.write(f),V.objectMode||f.length!==0)b(g,V,f,!1);else G0(g,V);else b(g,V,f,!1)}else if(!p)V.reading=!1,G0(g,V)}return!V.ended&&(V.length=T)g=T;else g--,g|=g>>>1,g|=g>>>2,g|=g>>>4,g|=g>>>8,g|=g>>>16,g++;return g}function B0(g,f){if(g<=0||f.length===0&&f.ended)return 0;if(f.objectMode)return 1;if(g!==g)if(f.flowing&&f.length)return f.buffer.head.data.length;else return f.length;if(g>f.highWaterMark)f.highWaterMark=m(g);if(g<=f.length)return g;if(!f.ended)return f.needReadable=!0,0;return f.length}a.prototype.read=function(g){I("read",g),g=parseInt(g,10);var f=this._readableState,R=g;if(g!==0)f.emittedReadable=!1;if(g===0&&f.needReadable&&((f.highWaterMark!==0?f.length>=f.highWaterMark:f.length>0)||f.ended)){if(I("read: emitReadable",f.length,f.ended),f.length===0&&f.ended)u(this);else V0(this);return null}if(g=B0(g,f),g===0&&f.ended){if(f.length===0)u(this);return null}var p=f.needReadable;if(I("need readable",p),f.length===0||f.length-g0)k=L(g,f);else k=null;if(k===null)f.needReadable=f.length<=f.highWaterMark,g=0;else f.length-=g,f.awaitDrain=0;if(f.length===0){if(!f.ended)f.needReadable=!0;if(R!==g&&f.ended)u(this)}if(k!==null)this.emit("data",k);return k};function i(g,f){if(I("onEofChunk"),f.ended)return;if(f.decoder){var R=f.decoder.end();if(R&&R.length)f.buffer.push(R),f.length+=f.objectMode?1:R.length}if(f.ended=!0,f.sync)V0(g);else if(f.needReadable=!1,!f.emittedReadable)f.emittedReadable=!0,s(g)}function V0(g){var f=g._readableState;if(I("emitReadable",f.needReadable,f.emittedReadable),f.needReadable=!1,!f.emittedReadable)I("emitReadable",f.flowing),f.emittedReadable=!0,P0.nextTick(s,g)}function s(g){var f=g._readableState;if(I("emitReadable_",f.destroyed,f.length,f.ended),!f.destroyed&&(f.length||f.ended))g.emit("readable"),f.emittedReadable=!1;f.needReadable=!f.flowing&&!f.ended&&f.length<=f.highWaterMark,z(g)}function G0(g,f){if(!f.readingMore)f.readingMore=!0,P0.nextTick(r,g,f)}function r(g,f){while(!f.reading&&!f.ended&&(f.length1&&Z0(p.pipes,g)!==-1)&&!_)I("false write response, pause",p.awaitDrain),p.awaitDrain++;R.pause()}}function Q0(H0){if(I("onerror",H0),I0(),g.removeListener("error",Q0),Y(g,"error")===0)X(g,H0)}x(g,"error",Q0);function q0(){g.removeListener("finish",K0),I0()}g.once("close",q0);function K0(){I("onfinish"),g.removeListener("close",q0),I0()}g.once("finish",K0);function I0(){I("unpipe"),R.unpipe(g)}if(g.emit("pipe",R),!p.flowing)I("pipe resume"),R.resume();return g};function y(g){return function(){var R=g._readableState;if(I("pipeOnDrain",R.awaitDrain),R.awaitDrain)R.awaitDrain--;if(R.awaitDrain===0&&Y(g,"data"))R.flowing=!0,z(g)}}a.prototype.unpipe=function(g){var f=this._readableState,R={hasUnpiped:!1};if(f.pipesCount===0)return this;if(f.pipesCount===1){if(g&&g!==f.pipes)return this;if(!g)g=f.pipes;if(f.pipes=null,f.pipesCount=0,f.flowing=!1,g)g.emit("unpipe",this,R);return this}if(!g){var{pipes:p,pipesCount:k}=f;f.pipes=null,f.pipesCount=0,f.flowing=!1;for(var V=0;V0,p.flowing!==!1)this.resume()}else if(g==="readable"){if(!p.endEmitted&&!p.readableListening){if(p.readableListening=p.needReadable=!0,p.flowing=!1,p.emittedReadable=!1,I("on readable",p.length,p.reading),p.length)V0(this);else if(!p.reading)P0.nextTick(o,this)}}return R},a.prototype.addListener=a.prototype.on,a.prototype.removeListener=function(g,f){var R=Q.prototype.removeListener.call(this,g,f);if(g==="readable")P0.nextTick(n,this);return R},a.prototype.removeAllListeners=function(g){var f=Q.prototype.removeAllListeners.apply(this,arguments);if(g==="readable"||g===void 0)P0.nextTick(n,this);return f};function n(g){var f=g._readableState;if(f.readableListening=g.listenerCount("readable")>0,f.resumeScheduled&&!f.paused)f.flowing=!0;else if(g.listenerCount("data")>0)g.resume()}function o(g){I("readable nexttick read 0"),g.read(0)}a.prototype.resume=function(){var g=this._readableState;if(!g.flowing)I("resume"),g.flowing=!g.readableListening,Y0(this,g);return g.paused=!1,this};function Y0(g,f){if(!f.resumeScheduled)f.resumeScheduled=!0,P0.nextTick(O0,g,f)}function O0(g,f){if(I("resume",f.reading),!f.reading)g.read(0);if(f.resumeScheduled=!1,g.emit("resume"),z(g),f.flowing&&!f.reading)g.read(0)}a.prototype.pause=function(){if(I("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)I("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState.paused=!0,this};function z(g){var f=g._readableState;I("flow",f.flowing);while(f.flowing&&g.read()!==null);}if(a.prototype.wrap=function(g){var f=this,R=this._readableState,p=!1;g.on("end",function(){if(I("wrapped end"),R.decoder&&!R.ended){var q=R.decoder.end();if(q&&q.length)f.push(q)}f.push(null)}),g.on("data",function(q){if(I("wrapped data"),R.decoder)q=R.decoder.write(q);if(R.objectMode&&(q===null||q===void 0))return;else if(!R.objectMode&&(!q||!q.length))return;if(!f.push(q))p=!0,g.pause()});for(var k in g)if(this[k]===void 0&&typeof g[k]==="function")this[k]=function(O){return function(){return g[O].apply(g,arguments)}}(k);for(var V=0;V<$.length;V++)g.on($[V],this.emit.bind(this,$[V]));return this._read=function(q){if(I("wrapped _read",q),p)p=!1,g.resume()},this},typeof Symbol==="function")a.prototype[Symbol.asyncIterator]=function(){if(S===void 0)S=tU();return S(this)};Object.defineProperty(a.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(a.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(a.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(f){if(this._readableState)this._readableState.flowing=f}}),a._fromList=L,Object.defineProperty(a.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function L(g,f){if(f.length===0)return null;var R;if(f.objectMode)R=f.buffer.shift();else if(!g||g>=f.length){if(f.decoder)R=f.buffer.join("");else if(f.buffer.length===1)R=f.buffer.first();else R=f.buffer.concat(f.length);f.buffer.clear()}else R=f.buffer.consume(g,f.decoder);return R}function u(g){var f=g._readableState;if(I("endReadable",f.endEmitted),!f.endEmitted)f.ended=!0,P0.nextTick(h,f,g)}function h(g,f){if(I("endReadableNT",g.endEmitted,g.length),!g.endEmitted&&g.length===0){if(g.endEmitted=!0,f.readable=!1,f.emit("end"),g.autoDestroy){var R=f._writableState;if(!R||R.autoDestroy&&R.finished)f.destroy()}}}if(typeof Symbol==="function")a.from=function(g,f){if(H===void 0)H=eU();return H(a,g,f)};function Z0(g,f){for(var R=0,p=g.length;R{U.exports=W;var G=c2().codes,Y=G.ERR_METHOD_NOT_IMPLEMENTED,Q=G.ERR_MULTIPLE_CALLBACK,K=G.ERR_TRANSFORM_ALREADY_TRANSFORMING,Z=G.ERR_TRANSFORM_WITH_LENGTH_0,J=u2();W2()(W,J);function M(D,w){var P=this._transformState;P.transforming=!1;var A=P.writecb;if(A===null)return this.emit("error",new Q);if(P.writechunk=null,P.writecb=null,w!=null)this.push(w);A(D);var E=this._readableState;if(E.reading=!1,E.needReadable||E.length{U.exports=Y;var G=TB();W2()(Y,G);function Y(Q){if(!(this instanceof Y))return new Y(Q);G.call(this,Q)}Y.prototype._transform=function(Q,K,Z){Z(null,Q)}}),UG=R0((B,U)=>{var G;function Y(P){var A=!1;return function(){if(A)return;A=!0,P.apply(void 0,arguments)}}var Q=c2().codes,K=Q.ERR_MISSING_ARGS,Z=Q.ERR_STREAM_DESTROYED;function J(P){if(P)throw P}function M(P){return P.setHeader&&typeof P.abort==="function"}function W(P,A,E,C){C=Y(C);var j=!1;if(P.on("close",function(){j=!0}),G===void 0)G=g8();G(P,{readable:A,writable:E},function(S){if(S)return C(S);j=!0,C()});var v=!1;return function(S){if(j)return;if(v)return;if(v=!0,M(P))return P.abort();if(typeof P.destroy==="function")return P.destroy();C(S||new Z("pipe"))}}function I(P){P()}function F(P,A){return P.pipe(A)}function D(P){if(!P.length)return J;if(typeof P[P.length-1]!=="function")return J;return P.pop()}function w(){for(var P=arguments.length,A=Array(P),E=0;E0,function($){if(!j)j=$;if($)v.forEach(I);if(X)return;v.forEach(I),C(j)})});return A.reduce(F)}U.exports=w}),f8=R0((B,U)=>{U.exports=Y;var G=$8().EventEmitter;W2()(Y,G),Y.Readable=EB(),Y.Writable=zB(),Y.Duplex=u2(),Y.Transform=TB(),Y.PassThrough=BG(),Y.finished=g8(),Y.pipeline=UG(),Y.Stream=Y;function Y(){G.call(this)}Y.prototype.pipe=function(Q,K){var Z=this;function J(P){if(Q.writable){if(Q.write(P)===!1&&Z.pause)Z.pause()}}Z.on("data",J);function M(){if(Z.readable&&Z.resume)Z.resume()}if(Q.on("drain",M),!Q._isStdio&&(!K||K.end!==!1))Z.on("end",I),Z.on("close",F);var W=!1;function I(){if(W)return;W=!0,Q.end()}function F(){if(W)return;if(W=!0,typeof Q.destroy==="function")Q.destroy()}function D(P){if(w(),G.listenerCount(this,"error")===0)throw P}Z.on("error",D),Q.on("error",D);function w(){Z.removeListener("data",J),Q.removeListener("drain",M),Z.removeListener("end",I),Z.removeListener("close",F),Z.removeListener("error",D),Q.removeListener("error",D),Z.removeListener("end",w),Z.removeListener("close",w),Q.removeListener("close",w)}return Z.on("end",w),Z.on("close",w),Q.on("close",w),Q.emit("pipe",Z),Q}}),GG=R0((B)=>{(function(U){U.parser=function(z,L){return new Y(z,L)},U.SAXParser=Y,U.SAXStream=I,U.createStream=W,U.MAX_BUFFER_LENGTH=65536;var G=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];U.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function Y(z,L){if(!(this instanceof Y))return new Y(z,L);var u=this;if(K(u),u.q=u.c="",u.bufferCheckPosition=U.MAX_BUFFER_LENGTH,u.opt=L||{},u.opt.lowercase=u.opt.lowercase||u.opt.lowercasetags,u.looseCase=u.opt.lowercase?"toLowerCase":"toUpperCase",u.tags=[],u.closed=u.closedRoot=u.sawRoot=!1,u.tag=u.error=null,u.strict=!!z,u.noscript=!!(z||u.opt.noscript),u.state=N.BEGIN,u.strictEntities=u.opt.strictEntities,u.ENTITIES=u.strictEntities?Object.create(U.XML_ENTITIES):Object.create(U.ENTITIES),u.attribList=[],u.opt.xmlns)u.ns=Object.create(A);if(u.trackPosition=u.opt.position!==!1,u.trackPosition)u.position=u.line=u.column=0;U0(u,"onready")}if(!Object.create)Object.create=function(z){function L(){}return L.prototype=z,new L};if(!Object.keys)Object.keys=function(z){var L=[];for(var u in z)if(z.hasOwnProperty(u))L.push(u);return L};function Q(z){var L=Math.max(U.MAX_BUFFER_LENGTH,10),u=0;for(var h=0,Z0=G.length;hL)switch(G[h]){case"textNode":c(z);break;case"cdata":b(z,"oncdata",z.cdata),z.cdata="";break;case"script":b(z,"onscript",z.script),z.script="";break;default:m(z,"Max buffer length exceeded: "+G[h])}u=Math.max(u,g)}z.bufferCheckPosition=U.MAX_BUFFER_LENGTH-u+z.position}function K(z){for(var L=0,u=G.length;L"||S(z)}function $(z,L){return z.test(L)}function x(z,L){return!$(z,L)}var N=0;U.STATE={BEGIN:N++,BEGIN_WHITESPACE:N++,TEXT:N++,TEXT_ENTITY:N++,OPEN_WAKA:N++,SGML_DECL:N++,SGML_DECL_QUOTED:N++,DOCTYPE:N++,DOCTYPE_QUOTED:N++,DOCTYPE_DTD:N++,DOCTYPE_DTD_QUOTED:N++,COMMENT_STARTING:N++,COMMENT:N++,COMMENT_ENDING:N++,COMMENT_ENDED:N++,CDATA:N++,CDATA_ENDING:N++,CDATA_ENDING_2:N++,PROC_INST:N++,PROC_INST_BODY:N++,PROC_INST_ENDING:N++,OPEN_TAG:N++,OPEN_TAG_SLASH:N++,ATTRIB:N++,ATTRIB_NAME:N++,ATTRIB_NAME_SAW_WHITE:N++,ATTRIB_VALUE:N++,ATTRIB_VALUE_QUOTED:N++,ATTRIB_VALUE_CLOSED:N++,ATTRIB_VALUE_UNQUOTED:N++,ATTRIB_VALUE_ENTITY_Q:N++,ATTRIB_VALUE_ENTITY_U:N++,CLOSE_TAG:N++,CLOSE_TAG_SAW_WHITE:N++,SCRIPT:N++,SCRIPT_ENDING:N++},U.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},U.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(U.ENTITIES).forEach(function(z){var L=U.ENTITIES[z],u=typeof L==="number"?String.fromCharCode(L):L;U.ENTITIES[z]=u});for(var a in U.STATE)U.STATE[U.STATE[a]]=a;N=U.STATE;function U0(z,L,u){z[L]&&z[L](u)}function b(z,L,u){if(z.textNode)c(z);U0(z,L,u)}function c(z){if(z.textNode=T(z.opt,z.textNode),z.textNode)U0(z,"ontext",z.textNode);z.textNode=""}function T(z,L){if(z.trim)L=L.trim();if(z.normalize)L=L.replace(/\s+/g," ");return L}function m(z,L){if(c(z),z.trackPosition)L+=` +Line: `+z.line+` +Column: `+z.column+` +Char: `+z.c;return L=Error(L),z.error=L,U0(z,"onerror",L),z}function B0(z){if(z.sawRoot&&!z.closedRoot)i(z,"Unclosed root tag");if(z.state!==N.BEGIN&&z.state!==N.BEGIN_WHITESPACE&&z.state!==N.TEXT)m(z,"Unexpected end");return c(z),z.c="",z.closed=!0,U0(z,"onend"),Y.call(z,z.strict,z.opt),z}function i(z,L){if(typeof z!=="object"||!(z instanceof Y))throw Error("bad call to strictFail");if(z.strict)m(z,L)}function V0(z){if(!z.strict)z.tagName=z.tagName[z.looseCase]();var L=z.tags[z.tags.length-1]||z,u=z.tag={name:z.tagName,attributes:{}};if(z.opt.xmlns)u.ns=L.ns;z.attribList.length=0,b(z,"onopentagstart",u)}function s(z,L){var u=z.indexOf(":")<0?["",z]:z.split(":"),h=u[0],Z0=u[1];if(L&&z==="xmlns")h="xmlns",Z0="";return{prefix:h,local:Z0}}function G0(z){if(!z.strict)z.attribName=z.attribName[z.looseCase]();if(z.attribList.indexOf(z.attribName)!==-1||z.tag.attributes.hasOwnProperty(z.attribName)){z.attribName=z.attribValue="";return}if(z.opt.xmlns){var L=s(z.attribName,!0),u=L.prefix,h=L.local;if(u==="xmlns")if(h==="xml"&&z.attribValue!==w)i(z,"xml: prefix must be bound to "+w+` +Actual: `+z.attribValue);else if(h==="xmlns"&&z.attribValue!==P)i(z,"xmlns: prefix must be bound to "+P+` +Actual: `+z.attribValue);else{var Z0=z.tag,g=z.tags[z.tags.length-1]||z;if(Z0.ns===g.ns)Z0.ns=Object.create(g.ns);Z0.ns[h]=z.attribValue}z.attribList.push([z.attribName,z.attribValue])}else z.tag.attributes[z.attribName]=z.attribValue,b(z,"onattribute",{name:z.attribName,value:z.attribValue});z.attribName=z.attribValue=""}function r(z,L){if(z.opt.xmlns){var u=z.tag,h=s(z.tagName);if(u.prefix=h.prefix,u.local=h.local,u.uri=u.ns[h.prefix]||"",u.prefix&&!u.uri)i(z,"Unbound namespace prefix: "+JSON.stringify(z.tagName)),u.uri=h.prefix;var Z0=z.tags[z.tags.length-1]||z;if(u.ns&&Z0.ns!==u.ns)Object.keys(u.ns).forEach(function(d){b(z,"onopennamespace",{prefix:d,uri:u.ns[d]})});for(var g=0,f=z.attribList.length;g",z.tagName="",z.state=N.SCRIPT;return}b(z,"onscript",z.script),z.script=""}var L=z.tags.length,u=z.tagName;if(!z.strict)u=u[z.looseCase]();var h=u;while(L--)if(z.tags[L].name!==h)i(z,"Unexpected close tag");else break;if(L<0){i(z,"Unmatched closing tag: "+z.tagName),z.textNode+="",z.state=N.TEXT;return}z.tagName=u;var Z0=z.tags.length;while(Z0-- >L){var g=z.tag=z.tags.pop();z.tagName=z.tag.name,b(z,"onclosetag",z.tagName);var f={};for(var R in g.ns)f[R]=g.ns[R];var p=z.tags[z.tags.length-1]||z;if(z.opt.xmlns&&g.ns!==p.ns)Object.keys(g.ns).forEach(function(k){var V=g.ns[k];b(z,"onclosenamespace",{prefix:k,uri:V})})}if(L===0)z.closedRoot=!0;z.tagName=z.attribValue=z.attribName="",z.attribList.length=0,z.state=N.TEXT}function n(z){var L=z.entity,u=L.toLowerCase(),h,Z0="";if(z.ENTITIES[L])return z.ENTITIES[L];if(z.ENTITIES[u])return z.ENTITIES[u];if(L=u,L.charAt(0)==="#")if(L.charAt(1)==="x")L=L.slice(2),h=parseInt(L,16),Z0=h.toString(16);else L=L.slice(1),h=parseInt(L,10),Z0=h.toString(10);if(L=L.replace(/^0+/,""),isNaN(h)||Z0.toLowerCase()!==L)return i(z,"Invalid character entity"),"&"+z.entity+";";return String.fromCodePoint(h)}function o(z,L){if(L==="<")z.state=N.OPEN_WAKA,z.startTagPosition=z.position;else if(!S(L))i(z,"Non-whitespace before first tag."),z.textNode=L,z.state=N.TEXT}function Y0(z,L){var u="";if(L")b(L,"onsgmldeclaration",L.sgmlDecl),L.sgmlDecl="",L.state=N.TEXT;else if(H(h))L.state=N.SGML_DECL_QUOTED,L.sgmlDecl+=h;else L.sgmlDecl+=h;continue;case N.SGML_DECL_QUOTED:if(h===L.q)L.state=N.SGML_DECL,L.q="";L.sgmlDecl+=h;continue;case N.DOCTYPE:if(h===">")L.state=N.TEXT,b(L,"ondoctype",L.doctype),L.doctype=!0;else if(L.doctype+=h,h==="[")L.state=N.DOCTYPE_DTD;else if(H(h))L.state=N.DOCTYPE_QUOTED,L.q=h;continue;case N.DOCTYPE_QUOTED:if(L.doctype+=h,h===L.q)L.q="",L.state=N.DOCTYPE;continue;case N.DOCTYPE_DTD:if(L.doctype+=h,h==="]")L.state=N.DOCTYPE;else if(H(h))L.state=N.DOCTYPE_DTD_QUOTED,L.q=h;continue;case N.DOCTYPE_DTD_QUOTED:if(L.doctype+=h,h===L.q)L.state=N.DOCTYPE_DTD,L.q="";continue;case N.COMMENT:if(h==="-")L.state=N.COMMENT_ENDING;else L.comment+=h;continue;case N.COMMENT_ENDING:if(h==="-"){if(L.state=N.COMMENT_ENDED,L.comment=T(L.opt,L.comment),L.comment)b(L,"oncomment",L.comment);L.comment=""}else L.comment+="-"+h,L.state=N.COMMENT;continue;case N.COMMENT_ENDED:if(h!==">")i(L,"Malformed comment"),L.comment+="--"+h,L.state=N.COMMENT;else L.state=N.TEXT;continue;case N.CDATA:if(h==="]")L.state=N.CDATA_ENDING;else L.cdata+=h;continue;case N.CDATA_ENDING:if(h==="]")L.state=N.CDATA_ENDING_2;else L.cdata+="]"+h,L.state=N.CDATA;continue;case N.CDATA_ENDING_2:if(h===">"){if(L.cdata)b(L,"oncdata",L.cdata);b(L,"onclosecdata"),L.cdata="",L.state=N.TEXT}else if(h==="]")L.cdata+="]";else L.cdata+="]]"+h,L.state=N.CDATA;continue;case N.PROC_INST:if(h==="?")L.state=N.PROC_INST_ENDING;else if(S(h))L.state=N.PROC_INST_BODY;else L.procInstName+=h;continue;case N.PROC_INST_BODY:if(!L.procInstBody&&S(h))continue;else if(h==="?")L.state=N.PROC_INST_ENDING;else L.procInstBody+=h;continue;case N.PROC_INST_ENDING:if(h===">")b(L,"onprocessinginstruction",{name:L.procInstName,body:L.procInstBody}),L.procInstName=L.procInstBody="",L.state=N.TEXT;else L.procInstBody+="?"+h,L.state=N.PROC_INST_BODY;continue;case N.OPEN_TAG:if($(C,h))L.tagName+=h;else if(V0(L),h===">")r(L);else if(h==="/")L.state=N.OPEN_TAG_SLASH;else{if(!S(h))i(L,"Invalid character in tag name");L.state=N.ATTRIB}continue;case N.OPEN_TAG_SLASH:if(h===">")r(L,!0),y(L);else i(L,"Forward-slash in opening tag not followed by >"),L.state=N.ATTRIB;continue;case N.ATTRIB:if(S(h))continue;else if(h===">")r(L);else if(h==="/")L.state=N.OPEN_TAG_SLASH;else if($(E,h))L.attribName=h,L.attribValue="",L.state=N.ATTRIB_NAME;else i(L,"Invalid attribute name");continue;case N.ATTRIB_NAME:if(h==="=")L.state=N.ATTRIB_VALUE;else if(h===">")i(L,"Attribute without value"),L.attribValue=L.attribName,G0(L),r(L);else if(S(h))L.state=N.ATTRIB_NAME_SAW_WHITE;else if($(C,h))L.attribName+=h;else i(L,"Invalid attribute name");continue;case N.ATTRIB_NAME_SAW_WHITE:if(h==="=")L.state=N.ATTRIB_VALUE;else if(S(h))continue;else if(i(L,"Attribute without value"),L.tag.attributes[L.attribName]="",L.attribValue="",b(L,"onattribute",{name:L.attribName,value:""}),L.attribName="",h===">")r(L);else if($(E,h))L.attribName=h,L.state=N.ATTRIB_NAME;else i(L,"Invalid attribute name"),L.state=N.ATTRIB;continue;case N.ATTRIB_VALUE:if(S(h))continue;else if(H(h))L.q=h,L.state=N.ATTRIB_VALUE_QUOTED;else i(L,"Unquoted attribute value"),L.state=N.ATTRIB_VALUE_UNQUOTED,L.attribValue=h;continue;case N.ATTRIB_VALUE_QUOTED:if(h!==L.q){if(h==="&")L.state=N.ATTRIB_VALUE_ENTITY_Q;else L.attribValue+=h;continue}G0(L),L.q="",L.state=N.ATTRIB_VALUE_CLOSED;continue;case N.ATTRIB_VALUE_CLOSED:if(S(h))L.state=N.ATTRIB;else if(h===">")r(L);else if(h==="/")L.state=N.OPEN_TAG_SLASH;else if($(E,h))i(L,"No whitespace between attributes"),L.attribName=h,L.attribValue="",L.state=N.ATTRIB_NAME;else i(L,"Invalid attribute name");continue;case N.ATTRIB_VALUE_UNQUOTED:if(!X(h)){if(h==="&")L.state=N.ATTRIB_VALUE_ENTITY_U;else L.attribValue+=h;continue}if(G0(L),h===">")r(L);else L.state=N.ATTRIB;continue;case N.CLOSE_TAG:if(!L.tagName)if(S(h))continue;else if(x(E,h))if(L.script)L.script+="")y(L);else if($(C,h))L.tagName+=h;else if(L.script)L.script+="")y(L);else i(L,"Invalid characters in closing tag");continue;case N.TEXT_ENTITY:case N.ATTRIB_VALUE_ENTITY_Q:case N.ATTRIB_VALUE_ENTITY_U:var f,R;switch(L.state){case N.TEXT_ENTITY:f=N.TEXT,R="textNode";break;case N.ATTRIB_VALUE_ENTITY_Q:f=N.ATTRIB_VALUE_QUOTED,R="attribValue";break;case N.ATTRIB_VALUE_ENTITY_U:f=N.ATTRIB_VALUE_UNQUOTED,R="attribValue";break}if(h===";")L[R]+=n(L),L.entity="",L.state=f;else if($(L.entity.length?v:j,h))L.entity+=h;else i(L,"Invalid character in entity name"),L[R]+="&"+L.entity+h,L.entity="",L.state=f;continue;default:throw Error(L,"Unknown state: "+L.state)}}if(L.position>=L.bufferCheckPosition)Q(L);return L}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */if(!String.fromCodePoint)(function(){var z=String.fromCharCode,L=Math.floor,u=function(){var h=16384,Z0=[],g,f,R=-1,p=arguments.length;if(!p)return"";var k="";while(++R1114111||L(V)!==V)throw RangeError("Invalid code point: "+V);if(V<=65535)Z0.push(V);else V-=65536,g=(V>>10)+55296,f=V%1024+56320,Z0.push(g,f);if(R+1===p||Z0.length>h)k+=z.apply(null,Z0),Z0.length=0}return k};if(Object.defineProperty)Object.defineProperty(String,"fromCodePoint",{value:u,configurable:!0,writable:!0});else String.fromCodePoint=u})()})(typeof B>"u"?B.sax={}:B)}),x8=R0((B,U)=>{U.exports={isArray:function(G){if(Array.isArray)return Array.isArray(G);return Object.prototype.toString.call(G)==="[object Array]"}}}),_8=R0((B,U)=>{var G=x8().isArray;U.exports={copyOptions:function(Y){var Q,K={};for(Q in Y)if(Y.hasOwnProperty(Q))K[Q]=Y[Q];return K},ensureFlagExists:function(Y,Q){if(!(Y in Q)||typeof Q[Y]!=="boolean")Q[Y]=!1},ensureSpacesExists:function(Y){if(!("spaces"in Y)||typeof Y.spaces!=="number"&&typeof Y.spaces!=="string")Y.spaces=0},ensureAlwaysArrayExists:function(Y){if(!("alwaysArray"in Y)||typeof Y.alwaysArray!=="boolean"&&!G(Y.alwaysArray))Y.alwaysArray=!1},ensureKeyExists:function(Y,Q){if(!(Y+"Key"in Q)||typeof Q[Y+"Key"]!=="string")Q[Y+"Key"]=Q.compact?"_"+Y:Y},checkFnExists:function(Y,Q){return Y+"Fn"in Q}}}),DB=R0((B,U)=>{var G=GG(),Y={on:function(){},parse:function(){}},Q=_8(),K=x8().isArray,Z,J=!0,M;function W(H){return Z=Q.copyOptions(H),Q.ensureFlagExists("ignoreDeclaration",Z),Q.ensureFlagExists("ignoreInstruction",Z),Q.ensureFlagExists("ignoreAttributes",Z),Q.ensureFlagExists("ignoreText",Z),Q.ensureFlagExists("ignoreComment",Z),Q.ensureFlagExists("ignoreCdata",Z),Q.ensureFlagExists("ignoreDoctype",Z),Q.ensureFlagExists("compact",Z),Q.ensureFlagExists("alwaysChildren",Z),Q.ensureFlagExists("addParent",Z),Q.ensureFlagExists("trim",Z),Q.ensureFlagExists("nativeType",Z),Q.ensureFlagExists("nativeTypeAttributes",Z),Q.ensureFlagExists("sanitize",Z),Q.ensureFlagExists("instructionHasAttributes",Z),Q.ensureFlagExists("captureSpacesBetweenElements",Z),Q.ensureAlwaysArrayExists(Z),Q.ensureKeyExists("declaration",Z),Q.ensureKeyExists("instruction",Z),Q.ensureKeyExists("attributes",Z),Q.ensureKeyExists("text",Z),Q.ensureKeyExists("comment",Z),Q.ensureKeyExists("cdata",Z),Q.ensureKeyExists("doctype",Z),Q.ensureKeyExists("type",Z),Q.ensureKeyExists("name",Z),Q.ensureKeyExists("elements",Z),Q.ensureKeyExists("parent",Z),Q.checkFnExists("doctype",Z),Q.checkFnExists("instruction",Z),Q.checkFnExists("cdata",Z),Q.checkFnExists("comment",Z),Q.checkFnExists("text",Z),Q.checkFnExists("instructionName",Z),Q.checkFnExists("elementName",Z),Q.checkFnExists("attributeName",Z),Q.checkFnExists("attributeValue",Z),Q.checkFnExists("attributes",Z),Z}function I(H){var X=Number(H);if(!isNaN(X))return X;var $=H.toLowerCase();if($==="true")return!0;else if($==="false")return!1;return H}function F(H,X){var $;if(Z.compact){if(!M[Z[H+"Key"]]&&(K(Z.alwaysArray)?Z.alwaysArray.indexOf(Z[H+"Key"])!==-1:Z.alwaysArray))M[Z[H+"Key"]]=[];if(M[Z[H+"Key"]]&&!K(M[Z[H+"Key"]]))M[Z[H+"Key"]]=[M[Z[H+"Key"]]];if(H+"Fn"in Z&&typeof X==="string")X=Z[H+"Fn"](X,M);if(H==="instruction"&&(("instructionFn"in Z)||("instructionNameFn"in Z))){for($ in X)if(X.hasOwnProperty($))if("instructionFn"in Z)X[$]=Z.instructionFn(X[$],$,M);else{var x=X[$];delete X[$],X[Z.instructionNameFn($,x,M)]=x}}if(K(M[Z[H+"Key"]]))M[Z[H+"Key"]].push(X);else M[Z[H+"Key"]]=X}else{if(!M[Z.elementsKey])M[Z.elementsKey]=[];var N={};if(N[Z.typeKey]=H,H==="instruction"){for($ in X)if(X.hasOwnProperty($))break;if(N[Z.nameKey]="instructionNameFn"in Z?Z.instructionNameFn($,X,M):$,Z.instructionHasAttributes){if(N[Z.attributesKey]=X[$][Z.attributesKey],"instructionFn"in Z)N[Z.attributesKey]=Z.instructionFn(N[Z.attributesKey],$,M)}else{if("instructionFn"in Z)X[$]=Z.instructionFn(X[$],$,M);N[Z.instructionKey]=X[$]}}else{if(H+"Fn"in Z)X=Z[H+"Fn"](X,M);N[Z[H+"Key"]]=X}if(Z.addParent)N[Z.parentKey]=M;M[Z.elementsKey].push(N)}}function D(H){if("attributesFn"in Z&&H)H=Z.attributesFn(H,M);if((Z.trim||("attributeValueFn"in Z)||("attributeNameFn"in Z)||Z.nativeTypeAttributes)&&H){var X;for(X in H)if(H.hasOwnProperty(X)){if(Z.trim)H[X]=H[X].trim();if(Z.nativeTypeAttributes)H[X]=I(H[X]);if("attributeValueFn"in Z)H[X]=Z.attributeValueFn(H[X],X,M);if("attributeNameFn"in Z){var $=H[X];delete H[X],H[Z.attributeNameFn(X,H[X],M)]=$}}}return H}function w(H){var X={};if(H.body&&(H.name.toLowerCase()==="xml"||Z.instructionHasAttributes)){var $=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g,x;while((x=$.exec(H.body))!==null)X[x[1]]=x[2]||x[3]||x[4];X=D(X)}if(H.name.toLowerCase()==="xml"){if(Z.ignoreDeclaration)return;if(M[Z.declarationKey]={},Object.keys(X).length)M[Z.declarationKey][Z.attributesKey]=X;if(Z.addParent)M[Z.declarationKey][Z.parentKey]=M}else{if(Z.ignoreInstruction)return;if(Z.trim)H.body=H.body.trim();var N={};if(Z.instructionHasAttributes&&Object.keys(X).length)N[H.name]={},N[H.name][Z.attributesKey]=X;else N[H.name]=H.body;F("instruction",N)}}function P(H,X){var $;if(typeof H==="object")X=H.attributes,H=H.name;if(X=D(X),"elementNameFn"in Z)H=Z.elementNameFn(H,M);if(Z.compact){if($={},!Z.ignoreAttributes&&X&&Object.keys(X).length){$[Z.attributesKey]={};var x;for(x in X)if(X.hasOwnProperty(x))$[Z.attributesKey][x]=X[x]}if(!(H in M)&&(K(Z.alwaysArray)?Z.alwaysArray.indexOf(H)!==-1:Z.alwaysArray))M[H]=[];if(M[H]&&!K(M[H]))M[H]=[M[H]];if(K(M[H]))M[H].push($);else M[H]=$}else{if(!M[Z.elementsKey])M[Z.elementsKey]=[];if($={},$[Z.typeKey]="element",$[Z.nameKey]=H,!Z.ignoreAttributes&&X&&Object.keys(X).length)$[Z.attributesKey]=X;if(Z.alwaysChildren)$[Z.elementsKey]=[];M[Z.elementsKey].push($)}$[Z.parentKey]=M,M=$}function A(H){if(Z.ignoreText)return;if(!H.trim()&&!Z.captureSpacesBetweenElements)return;if(Z.trim)H=H.trim();if(Z.nativeType)H=I(H);if(Z.sanitize)H=H.replace(/&/g,"&").replace(//g,">");F("text",H)}function E(H){if(Z.ignoreComment)return;if(Z.trim)H=H.trim();F("comment",H)}function C(H){var X=M[Z.parentKey];if(!Z.addParent)delete M[Z.parentKey];M=X}function j(H){if(Z.ignoreCdata)return;if(Z.trim)H=H.trim();F("cdata",H)}function v(H){if(Z.ignoreDoctype)return;if(H=H.replace(/^ /,""),Z.trim)H=H.trim();F("doctype",H)}function S(H){H.note=H}U.exports=function(H,X){var $=J?G.parser(!0,{}):$=new Y.Parser("UTF-8"),x={};if(M=x,Z=W(X),J)$.opt={strictEntities:!0},$.onopentag=P,$.ontext=A,$.oncomment=E,$.onclosetag=C,$.onerror=S,$.oncdata=j,$.ondoctype=v,$.onprocessinginstruction=w;else $.on("startElement",P),$.on("text",A),$.on("comment",E),$.on("endElement",C),$.on("error",S);if(J)$.write(H).close();else if(!$.parse(H))throw Error("XML parsing error: "+$.getError());if(x[Z.elementsKey]){var N=x[Z.elementsKey];delete x[Z.elementsKey],x[Z.elementsKey]=N,delete x.text}return x}}),YG=R0((B,U)=>{var G=_8(),Y=DB();function Q(K){var Z=G.copyOptions(K);return G.ensureSpacesExists(Z),Z}U.exports=function(K,Z){var J=Q(Z),M=Y(K,J),W,I="compact"in J&&J.compact?"_parent":"parent";if("addParent"in J&&J.addParent)W=JSON.stringify(M,function(F,D){return F===I?"_":D},J.spaces);else W=JSON.stringify(M,null,J.spaces);return W.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}}),CB=R0((B,U)=>{var G=_8(),Y=x8().isArray,Q,K;function Z(H){var X=G.copyOptions(H);if(G.ensureFlagExists("ignoreDeclaration",X),G.ensureFlagExists("ignoreInstruction",X),G.ensureFlagExists("ignoreAttributes",X),G.ensureFlagExists("ignoreText",X),G.ensureFlagExists("ignoreComment",X),G.ensureFlagExists("ignoreCdata",X),G.ensureFlagExists("ignoreDoctype",X),G.ensureFlagExists("compact",X),G.ensureFlagExists("indentText",X),G.ensureFlagExists("indentCdata",X),G.ensureFlagExists("indentAttributes",X),G.ensureFlagExists("indentInstruction",X),G.ensureFlagExists("fullTagEmptyElement",X),G.ensureFlagExists("noQuotesForNativeAttributes",X),G.ensureSpacesExists(X),typeof X.spaces==="number")X.spaces=Array(X.spaces+1).join(" ");return G.ensureKeyExists("declaration",X),G.ensureKeyExists("instruction",X),G.ensureKeyExists("attributes",X),G.ensureKeyExists("text",X),G.ensureKeyExists("comment",X),G.ensureKeyExists("cdata",X),G.ensureKeyExists("doctype",X),G.ensureKeyExists("type",X),G.ensureKeyExists("name",X),G.ensureKeyExists("elements",X),G.checkFnExists("doctype",X),G.checkFnExists("instruction",X),G.checkFnExists("cdata",X),G.checkFnExists("comment",X),G.checkFnExists("text",X),G.checkFnExists("instructionName",X),G.checkFnExists("elementName",X),G.checkFnExists("attributeName",X),G.checkFnExists("attributeValue",X),G.checkFnExists("attributes",X),G.checkFnExists("fullTagEmptyElement",X),X}function J(H,X,$){return(!$&&H.spaces?` +`:"")+Array(X+1).join(H.spaces)}function M(H,X,$){if(X.ignoreAttributes)return"";if("attributesFn"in X)H=X.attributesFn(H,K,Q);var x,N,a,U0,b=[];for(x in H)if(H.hasOwnProperty(x)&&H[x]!==null&&H[x]!==void 0)U0=X.noQuotesForNativeAttributes&&typeof H[x]!=="string"?"":'"',N=""+H[x],N=N.replace(/"/g,"""),a="attributeNameFn"in X?X.attributeNameFn(x,N,K,Q):x,b.push(X.spaces&&X.indentAttributes?J(X,$+1,!1):" "),b.push(a+"="+U0+("attributeValueFn"in X?X.attributeValueFn(N,x,K,Q):N)+U0);if(H&&Object.keys(H).length&&X.spaces&&X.indentAttributes)b.push(J(X,$,!1));return b.join("")}function W(H,X,$){return Q=H,K="xml",X.ignoreDeclaration?"":""}function I(H,X,$){if(X.ignoreInstruction)return"";var x;for(x in H)if(H.hasOwnProperty(x))break;var N="instructionNameFn"in X?X.instructionNameFn(x,H[x],K,Q):x;if(typeof H[x]==="object")return Q=H,K=N,"";else{var a=H[x]?H[x]:"";if("instructionFn"in X)a=X.instructionFn(a,x,K,Q);return""}}function F(H,X){return X.ignoreComment?"":""}function D(H,X){return X.ignoreCdata?"":"","]]]]>"))+"]]>"}function w(H,X){return X.ignoreDoctype?"":""}function P(H,X){if(X.ignoreText)return"";return H=""+H,H=H.replace(/&/g,"&"),H=H.replace(/&/g,"&").replace(//g,">"),"textFn"in X?X.textFn(H,K,Q):H}function A(H,X){var $;if(H.elements&&H.elements.length)for($=0;$"),H[X.elementsKey]&&H[X.elementsKey].length)x.push(C(H[X.elementsKey],X,$+1)),Q=H,K=H.name;x.push(X.spaces&&A(H,X)?` +`+Array($+1).join(X.spaces):""),x.push("")}else x.push("/>");return x.join("")}function C(H,X,$,x){return H.reduce(function(N,a){var U0=J(X,$,x&&!N);switch(a.type){case"element":return N+U0+E(a,X,$);case"comment":return N+U0+F(a[X.commentKey],X);case"doctype":return N+U0+w(a[X.doctypeKey],X);case"cdata":return N+(X.indentCdata?U0:"")+D(a[X.cdataKey],X);case"text":return N+(X.indentText?U0:"")+P(a[X.textKey],X);case"instruction":var b={};return b[a[X.nameKey]]=a[X.attributesKey]?a:a[X.instructionKey],N+(X.indentInstruction?U0:"")+I(b,X,$)}},"")}function j(H,X,$){var x;for(x in H)if(H.hasOwnProperty(x))switch(x){case X.parentKey:case X.attributesKey:break;case X.textKey:if(X.indentText||$)return!0;break;case X.cdataKey:if(X.indentCdata||$)return!0;break;case X.instructionKey:if(X.indentInstruction||$)return!0;break;case X.doctypeKey:case X.commentKey:return!0;default:return!0}return!1}function v(H,X,$,x,N){Q=H,K=X;var a="elementNameFn"in $?$.elementNameFn(X,H):X;if(typeof H>"u"||H===null||H==="")return"fullTagEmptyElementFn"in $&&$.fullTagEmptyElementFn(X,H)||$.fullTagEmptyElement?"<"+a+">":"<"+a+"/>";var U0=[];if(X){if(U0.push("<"+a),typeof H!=="object")return U0.push(">"+P(H,$)+""),U0.join("");if(H[$.attributesKey])U0.push(M(H[$.attributesKey],$,x));var b=j(H,$,!0)||H[$.attributesKey]&&H[$.attributesKey]["xml:space"]==="preserve";if(!b)if("fullTagEmptyElementFn"in $)b=$.fullTagEmptyElementFn(X,H);else b=$.fullTagEmptyElement;if(b)U0.push(">");else return U0.push("/>"),U0.join("")}if(U0.push(S(H,$,x+1,!1)),Q=H,K=X,X)U0.push((N?J($,x,!1):"")+"");return U0.join("")}function S(H,X,$,x){var N,a,U0,b=[];for(a in H)if(H.hasOwnProperty(a)){U0=Y(H[a])?H[a]:[H[a]];for(N=0;N{var G=CB();U.exports=function(Y,Q){if(Y instanceof Buffer)Y=Y.toString();var K=null;if(typeof Y==="string")try{K=JSON.parse(Y)}catch(Z){throw Error("The JSON structure is invalid")}else K=Y;return G(K,Q)}}),_1=R0((B,U)=>{U.exports={xml2js:DB(),xml2json:YG(),js2xml:CB(),json2xml:ZG()}})(),h1=(B)=>{switch(B.type){case void 0:case"element":let U=new kB(B.name,B.attributes),G=B.elements||[];for(let Y of G){let Q=h1(Y);if(Q!==void 0)U.push(Q)}return U;case"text":return B.text;default:return}},QG=class extends F0{},kB=class extends t{static fromXmlString(B){return h1((0,_1.xml2js)(B,{compact:!1}))}constructor(B,U){super(B);if(U)this.root.push(new QG(U))}push(B){this.root.push(B)}},$B=class extends t{constructor(B){super("");e(this,"_attr",void 0),this._attr=B}prepForXml(B){return{_attr:this._attr}}},JG="",h8=class extends t{constructor(B,U){super(B);if(U)this.root=U.root}},D0=(B)=>{if(isNaN(B))throw Error(`Invalid value '${B}' specified. Must be an integer.`);return Math.floor(B)},q1=(B)=>{let U=D0(B);if(U<0)throw Error(`Invalid value '${B}' specified. Must be a positive integer.`);return U},u1=(B,U)=>{let G=U*2;if(B.length!==G||isNaN(Number(`0x${B}`)))throw Error(`Invalid hex value '${B}'. Expected ${G} digit hex value`);return B},KG=(B)=>u1(B,4),SB=(B)=>u1(B,2),H8=(B)=>u1(B,1),M1=(B)=>{let U=B.slice(-2),G=B.substring(0,B.length-2);return`${Number(G)}${U}`},u8=(B)=>{let U=M1(B);if(parseFloat(U)<0)throw Error(`Invalid value '${U}' specified. Expected a positive number.`);return U},C2=(B)=>{if(B==="auto")return B;return u1(B.charAt(0)==="#"?B.substring(1):B,3)},t0=(B)=>typeof B==="string"?M1(B):D0(B),bB=(B)=>typeof B==="string"?u8(B):q1(B),VG=(B)=>typeof B==="string"?M1(B):D0(B),E0=(B)=>typeof B==="string"?u8(B):q1(B),vB=(B)=>{let U=B.substring(0,B.length-1);return`${Number(U)}%`},d8=(B)=>{if(typeof B==="number")return D0(B);if(B.slice(-1)==="%")return vB(B);return M1(B)},yB=q1,gB=q1,fB=(B)=>B.toISOString(),M0=class extends t{constructor(B,U=!0){super(B);if(U!==!0)this.root.push(new C0({val:U}))}},E1=class extends t{constructor(B,U){super(B);this.root.push(new C0({val:bB(U)}))}},S0=class extends t{},M2=class extends t{constructor(B,U){super(B);this.root.push(new C0({val:U}))}},f2=(B,U)=>new X0({name:B,attributes:{value:{key:"w:val",value:U}}}),_2=class extends t{constructor(B,U){super(B);this.root.push(new C0({val:U}))}},qG=class extends t{constructor(B,U){super(B);this.root.push(new C0({val:U}))}},O2=class extends t{constructor(B,U){super(B);this.root.push(U)}},X0=class extends t{constructor({name:B,attributes:U,children:G}){super(B);if(U)this.root.push(new k8(U));if(G)this.root.push(...G)}},c0={START:"start",CENTER:"center",END:"end",BOTH:"both",MEDIUM_KASHIDA:"mediumKashida",DISTRIBUTE:"distribute",NUM_TAB:"numTab",HIGH_KASHIDA:"highKashida",LOW_KASHIDA:"lowKashida",THAI_DISTRIBUTE:"thaiDistribute",LEFT:"left",RIGHT:"right",JUSTIFIED:"both"},c8=(B)=>new X0({name:"w:jc",attributes:{val:{key:"w:val",value:B}}}),A0=(B,{color:U,size:G,space:Y,style:Q})=>new X0({name:B,attributes:{style:{key:"w:val",value:Q},color:{key:"w:color",value:U===void 0?void 0:C2(U)},size:{key:"w:sz",value:G===void 0?void 0:yB(G)},space:{key:"w:space",value:Y===void 0?void 0:gB(Y)}}}),d1={SINGLE:"single",DASH_DOT_STROKED:"dashDotStroked",DASHED:"dashed",DASH_SMALL_GAP:"dashSmallGap",DOT_DASH:"dotDash",DOT_DOT_DASH:"dotDotDash",DOTTED:"dotted",DOUBLE:"double",DOUBLE_WAVE:"doubleWave",INSET:"inset",NIL:"nil",NONE:"none",OUTSET:"outset",THICK:"thick",THICK_THIN_LARGE_GAP:"thickThinLargeGap",THICK_THIN_MEDIUM_GAP:"thickThinMediumGap",THICK_THIN_SMALL_GAP:"thickThinSmallGap",THIN_THICK_LARGE_GAP:"thinThickLargeGap",THIN_THICK_MEDIUM_GAP:"thinThickMediumGap",THIN_THICK_SMALL_GAP:"thinThickSmallGap",THIN_THICK_THIN_LARGE_GAP:"thinThickThinLargeGap",THIN_THICK_THIN_MEDIUM_GAP:"thinThickThinMediumGap",THIN_THICK_THIN_SMALL_GAP:"thinThickThinSmallGap",THREE_D_EMBOSS:"threeDEmboss",THREE_D_ENGRAVE:"threeDEngrave",TRIPLE:"triple",WAVE:"wave"},xB=class extends R2{constructor(B){super("w:pBdr");if(B.top)this.root.push(A0("w:top",B.top));if(B.bottom)this.root.push(A0("w:bottom",B.bottom));if(B.left)this.root.push(A0("w:left",B.left));if(B.right)this.root.push(A0("w:right",B.right));if(B.between)this.root.push(A0("w:between",B.between))}},_B=class extends t{constructor(){super("w:pBdr");let B=A0("w:bottom",{color:"auto",space:1,style:d1.SINGLE,size:6});this.root.push(B)}},hB=({start:B,end:U,left:G,right:Y,hanging:Q,firstLine:K,firstLineChars:Z})=>new X0({name:"w:ind",attributes:{start:{key:"w:start",value:B===void 0?void 0:t0(B)},end:{key:"w:end",value:U===void 0?void 0:t0(U)},left:{key:"w:left",value:G===void 0?void 0:t0(G)},right:{key:"w:right",value:Y===void 0?void 0:t0(Y)},hanging:{key:"w:hanging",value:Q===void 0?void 0:E0(Q)},firstLine:{key:"w:firstLine",value:K===void 0?void 0:E0(K)},firstLineChars:{key:"w:firstLineChars",value:Z===void 0?void 0:D0(Z)}}}),uB=()=>new X0({name:"w:br"}),m8={BEGIN:"begin",END:"end",SEPARATE:"separate"},l8=(B,U)=>new X0({name:"w:fldChar",attributes:{type:{key:"w:fldCharType",value:B},dirty:{key:"w:dirty",value:U}}}),e0=(B)=>l8(m8.BEGIN,B),q2=(B)=>l8(m8.SEPARATE,B),B2=(B)=>l8(m8.END,B),MG={CENTER:"center",INSIDE:"inside",LEFT:"left",OUTSIDE:"outside",RIGHT:"right"},XG={BOTTOM:"bottom",CENTER:"center",INSIDE:"inside",OUTSIDE:"outside",TOP:"top"},RG={DECIMAL:"decimal",UPPER_ROMAN:"upperRoman",LOWER_ROMAN:"lowerRoman",UPPER_LETTER:"upperLetter",LOWER_LETTER:"lowerLetter",ORDINAL:"ordinal",CARDINAL_TEXT:"cardinalText",ORDINAL_TEXT:"ordinalText",HEX:"hex",CHICAGO:"chicago",IDEOGRAPH_DIGITAL:"ideographDigital",JAPANESE_COUNTING:"japaneseCounting",AIUEO:"aiueo",IROHA:"iroha",DECIMAL_FULL_WIDTH:"decimalFullWidth",DECIMAL_HALF_WIDTH:"decimalHalfWidth",JAPANESE_LEGAL:"japaneseLegal",JAPANESE_DIGITAL_TEN_THOUSAND:"japaneseDigitalTenThousand",DECIMAL_ENCLOSED_CIRCLE:"decimalEnclosedCircle",DECIMAL_FULL_WIDTH_2:"decimalFullWidth2",AIUEO_FULL_WIDTH:"aiueoFullWidth",IROHA_FULL_WIDTH:"irohaFullWidth",DECIMAL_ZERO:"decimalZero",BULLET:"bullet",GANADA:"ganada",CHOSUNG:"chosung",DECIMAL_ENCLOSED_FULL_STOP:"decimalEnclosedFullstop",DECIMAL_ENCLOSED_PAREN:"decimalEnclosedParen",DECIMAL_ENCLOSED_CIRCLE_CHINESE:"decimalEnclosedCircleChinese",IDEOGRAPH_ENCLOSED_CIRCLE:"ideographEnclosedCircle",IDEOGRAPH_TRADITIONAL:"ideographTraditional",IDEOGRAPH_ZODIAC:"ideographZodiac",IDEOGRAPH_ZODIAC_TRADITIONAL:"ideographZodiacTraditional",TAIWANESE_COUNTING:"taiwaneseCounting",IDEOGRAPH_LEGAL_TRADITIONAL:"ideographLegalTraditional",TAIWANESE_COUNTING_THOUSAND:"taiwaneseCountingThousand",TAIWANESE_DIGITAL:"taiwaneseDigital",CHINESE_COUNTING:"chineseCounting",CHINESE_LEGAL_SIMPLIFIED:"chineseLegalSimplified",CHINESE_COUNTING_TEN_THOUSAND:"chineseCountingThousand",KOREAN_DIGITAL:"koreanDigital",KOREAN_COUNTING:"koreanCounting",KOREAN_LEGAL:"koreanLegal",KOREAN_DIGITAL_2:"koreanDigital2",VIETNAMESE_COUNTING:"vietnameseCounting",RUSSIAN_LOWER:"russianLower",RUSSIAN_UPPER:"russianUpper",NONE:"none",NUMBER_IN_DASH:"numberInDash",HEBREW_1:"hebrew1",HEBREW_2:"hebrew2",ARABIC_ALPHA:"arabicAlpha",ARABIC_ABJAD:"arabicAbjad",HINDI_VOWELS:"hindiVowels",HINDI_CONSONANTS:"hindiConsonants",HINDI_NUMBERS:"hindiNumbers",HINDI_COUNTING:"hindiCounting",THAI_LETTERS:"thaiLetters",THAI_NUMBERS:"thaiNumbers",THAI_COUNTING:"thaiCounting",BAHT_TEXT:"bahtText",DOLLAR_TEXT:"dollarText"},x0={DEFAULT:"default",PRESERVE:"preserve"},_0=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{space:"xml:space"})}},LG=class extends t{constructor(){super("w:instrText");this.root.push(new _0({space:x0.PRESERVE})),this.root.push("PAGE")}},IG=class extends t{constructor(){super("w:instrText");this.root.push(new _0({space:x0.PRESERVE})),this.root.push("NUMPAGES")}},OG=class extends t{constructor(){super("w:instrText");this.root.push(new _0({space:x0.PRESERVE})),this.root.push("SECTIONPAGES")}},FG=class extends t{constructor(){super("w:instrText");this.root.push(new _0({space:x0.PRESERVE})),this.root.push("SECTION")}},X1=({fill:B,color:U,type:G})=>new X0({name:"w:shd",attributes:{fill:{key:"w:fill",value:B===void 0?void 0:C2(B)},color:{key:"w:color",value:U===void 0?void 0:C2(U)},type:{key:"w:val",value:G}}}),HG={CLEAR:"clear",DIAGONAL_CROSS:"diagCross",DIAGONAL_STRIPE:"diagStripe",HORIZONTAL_CROSS:"horzCross",HORIZONTAL_STRIPE:"horzStripe",NIL:"nil",PERCENT_5:"pct5",PERCENT_10:"pct10",PERCENT_12:"pct12",PERCENT_15:"pct15",PERCENT_20:"pct20",PERCENT_25:"pct25",PERCENT_30:"pct30",PERCENT_35:"pct35",PERCENT_37:"pct37",PERCENT_40:"pct40",PERCENT_45:"pct45",PERCENT_50:"pct50",PERCENT_55:"pct55",PERCENT_60:"pct60",PERCENT_62:"pct62",PERCENT_65:"pct65",PERCENT_70:"pct70",PERCENT_75:"pct75",PERCENT_80:"pct80",PERCENT_85:"pct85",PERCENT_87:"pct87",PERCENT_90:"pct90",PERCENT_95:"pct95",REVERSE_DIAGONAL_STRIPE:"reverseDiagStripe",SOLID:"solid",THIN_DIAGONAL_CROSS:"thinDiagCross",THIN_DIAGONAL_STRIPE:"thinDiagStripe",THIN_HORIZONTAL_CROSS:"thinHorzCross",THIN_REVERSE_DIAGONAL_STRIPE:"thinReverseDiagStripe",THIN_VERTICAL_STRIPE:"thinVertStripe",VERTICAL_STRIPE:"vertStripe"},b0=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{id:"w:id",author:"w:author",date:"w:date"})}},WG=class extends t{constructor(B){super("w:del");this.root.push(new b0({id:B.id,author:B.author,date:B.date}))}},PG=class extends t{constructor(B){super("w:ins");this.root.push(new b0({id:B.id,author:B.author,date:B.date}))}},a8={DOT:"dot"},p8=(B=a8.DOT)=>new X0({name:"w:em",attributes:{val:{key:"w:val",value:B}}}),wG=()=>p8(a8.DOT),AG=class extends t{constructor(B){super("w:spacing");this.root.push(new C0({val:t0(B)}))}},jG=class extends t{constructor(B){super("w:color");this.root.push(new C0({val:C2(B)}))}},NG=class extends t{constructor(B){super("w:highlight");this.root.push(new C0({val:B}))}},zG=class extends t{constructor(B){super("w:highlightCs");this.root.push(new C0({val:B}))}},EG=(B)=>new X0({name:"w:lang",attributes:{value:{key:"w:val",value:B.value},eastAsia:{key:"w:eastAsia",value:B.eastAsia},bidirectional:{key:"w:bidi",value:B.bidirectional}}}),T1=(B,U)=>{if(typeof B==="string"){let Y=B;return new X0({name:"w:rFonts",attributes:{ascii:{key:"w:ascii",value:Y},cs:{key:"w:cs",value:Y},eastAsia:{key:"w:eastAsia",value:Y},hAnsi:{key:"w:hAnsi",value:Y},hint:{key:"w:hint",value:U}}})}let G=B;return new X0({name:"w:rFonts",attributes:{ascii:{key:"w:ascii",value:G.ascii},cs:{key:"w:cs",value:G.cs},eastAsia:{key:"w:eastAsia",value:G.eastAsia},hAnsi:{key:"w:hAnsi",value:G.hAnsi},hint:{key:"w:hint",value:G.hint}}})},dB=(B)=>new X0({name:"w:vertAlign",attributes:{val:{key:"w:val",value:B}}}),TG=()=>dB("superscript"),DG=()=>dB("subscript"),r8={SINGLE:"single",WORDS:"words",DOUBLE:"double",THICK:"thick",DOTTED:"dotted",DOTTEDHEAVY:"dottedHeavy",DASH:"dash",DASHEDHEAVY:"dashedHeavy",DASHLONG:"dashLong",DASHLONGHEAVY:"dashLongHeavy",DOTDASH:"dotDash",DASHDOTHEAVY:"dashDotHeavy",DOTDOTDASH:"dotDotDash",DASHDOTDOTHEAVY:"dashDotDotHeavy",WAVE:"wave",WAVYHEAVY:"wavyHeavy",WAVYDOUBLE:"wavyDouble",NONE:"none"},cB=(B=r8.SINGLE,U)=>new X0({name:"w:u",attributes:{val:{key:"w:val",value:B},color:{key:"w:color",value:U===void 0?void 0:C2(U)}}}),CG={BLINK_BACKGROUND:"blinkBackground",LIGHTS:"lights",ANTS_BLACK:"antsBlack",ANTS_RED:"antsRed",SHIMMER:"shimmer",SPARKLE:"sparkle",NONE:"none"},kG={BLACK:"black",BLUE:"blue",CYAN:"cyan",DARK_BLUE:"darkBlue",DARK_CYAN:"darkCyan",DARK_GRAY:"darkGray",DARK_GREEN:"darkGreen",DARK_MAGENTA:"darkMagenta",DARK_RED:"darkRed",DARK_YELLOW:"darkYellow",GREEN:"green",LIGHT_GRAY:"lightGray",MAGENTA:"magenta",NONE:"none",RED:"red",WHITE:"white",YELLOW:"yellow"},U2=class extends R2{constructor(B){super("w:rPr");if(!B)return;if(B.style)this.push(new M2("w:rStyle",B.style));if(B.font)if(typeof B.font==="string")this.push(T1(B.font));else if("name"in B.font)this.push(T1(B.font.name,B.font.hint));else this.push(T1(B.font));if(B.bold!==void 0)this.push(new M0("w:b",B.bold));if(B.boldComplexScript===void 0&&B.bold!==void 0||B.boldComplexScript){var U;this.push(new M0("w:bCs",(U=B.boldComplexScript)!==null&&U!==void 0?U:B.bold))}if(B.italics!==void 0)this.push(new M0("w:i",B.italics));if(B.italicsComplexScript===void 0&&B.italics!==void 0||B.italicsComplexScript){var G;this.push(new M0("w:iCs",(G=B.italicsComplexScript)!==null&&G!==void 0?G:B.italics))}if(B.smallCaps!==void 0)this.push(new M0("w:smallCaps",B.smallCaps));else if(B.allCaps!==void 0)this.push(new M0("w:caps",B.allCaps));if(B.strike!==void 0)this.push(new M0("w:strike",B.strike));if(B.doubleStrike!==void 0)this.push(new M0("w:dstrike",B.doubleStrike));if(B.emboss!==void 0)this.push(new M0("w:emboss",B.emboss));if(B.imprint!==void 0)this.push(new M0("w:imprint",B.imprint));if(B.noProof!==void 0)this.push(new M0("w:noProof",B.noProof));if(B.snapToGrid!==void 0)this.push(new M0("w:snapToGrid",B.snapToGrid));if(B.vanish)this.push(new M0("w:vanish",B.vanish));if(B.color)this.push(new jG(B.color));if(B.characterSpacing)this.push(new AG(B.characterSpacing));if(B.scale!==void 0)this.push(new _2("w:w",B.scale));if(B.kern)this.push(new E1("w:kern",B.kern));if(B.position)this.push(new M2("w:position",B.position));if(B.size!==void 0)this.push(new E1("w:sz",B.size));let Y=B.sizeComplexScript===void 0||B.sizeComplexScript===!0?B.size:B.sizeComplexScript;if(Y)this.push(new E1("w:szCs",Y));if(B.highlight)this.push(new NG(B.highlight));let Q=B.highlightComplexScript===void 0||B.highlightComplexScript===!0?B.highlight:B.highlightComplexScript;if(Q)this.push(new zG(Q));if(B.underline)this.push(cB(B.underline.type,B.underline.color));if(B.effect)this.push(new M2("w:effect",B.effect));if(B.border)this.push(A0("w:bdr",B.border));if(B.shading)this.push(X1(B.shading));if(B.subScript)this.push(DG());if(B.superScript)this.push(TG());if(B.rightToLeft!==void 0)this.push(new M0("w:rtl",B.rightToLeft));if(B.emphasisMark)this.push(p8(B.emphasisMark.type));if(B.language)this.push(EG(B.language));if(B.specVanish)this.push(new M0("w:specVanish",B.vanish));if(B.math)this.push(new M0("w:oMath",B.math));if(B.revision)this.push(new lB(B.revision))}push(B){this.root.push(B)}},mB=class extends U2{constructor(B){super(B);if(B===null||B===void 0?void 0:B.insertion)this.push(new PG(B.insertion));if(B===null||B===void 0?void 0:B.deletion)this.push(new WG(B.deletion))}},lB=class extends t{constructor(B){super("w:rPrChange");this.root.push(new b0({id:B.id,author:B.author,date:B.date})),this.addChildElement(new U2(B))}},Z1=class extends t{constructor(B){super("w:t");if(typeof B==="string")this.root.push(new _0({space:x0.PRESERVE})),this.root.push(B);else{var U;this.root.push(new _0({space:(U=B.space)!==null&&U!==void 0?U:x0.DEFAULT})),this.root.push(B.text)}}},H2={CURRENT:"CURRENT",TOTAL_PAGES:"TOTAL_PAGES",TOTAL_PAGES_IN_SECTION:"TOTAL_PAGES_IN_SECTION",CURRENT_SECTION:"SECTION"},T0=class extends t{constructor(B){super("w:r");if(e(this,"properties",void 0),this.properties=new U2(B),this.root.push(this.properties),B.break)for(let U=0;U{U.exports=G;function G(Y,Q){if(!Y)throw Error(Q||"Assertion failed")}G.equal=function(Q,K,Z){if(Q!=K)throw Error(Z||"Assertion failed: "+Q+" != "+K)}}),G2=R0((B)=>{var U=R1();B.inherits=W2();function G(b,c){if((b.charCodeAt(c)&64512)!==55296)return!1;if(c<0||c+1>=b.length)return!1;return(b.charCodeAt(c+1)&64512)===56320}function Y(b,c){if(Array.isArray(b))return b.slice();if(!b)return[];var T=[];if(typeof b==="string"){if(!c){var m=0;for(var B0=0;B0>6|192,T[m++]=i&63|128;else if(G(b,B0))i=65536+((i&1023)<<10)+(b.charCodeAt(++B0)&1023),T[m++]=i>>18|240,T[m++]=i>>12&63|128,T[m++]=i>>6&63|128,T[m++]=i&63|128;else T[m++]=i>>12|224,T[m++]=i>>6&63|128,T[m++]=i&63|128}}else if(c==="hex"){if(b=b.replace(/[^a-z0-9]+/gi,""),b.length%2!==0)b="0"+b;for(B0=0;B0>>24|b>>>8&65280|b<<8&16711680|(b&255)<<24)>>>0}B.htonl=K;function Z(b,c){var T="";for(var m=0;m>>0}return i}B.join32=W;function I(b,c){var T=Array(b.length*4);for(var m=0,B0=0;m>>24,T[B0+1]=i>>>16&255,T[B0+2]=i>>>8&255,T[B0+3]=i&255;else T[B0+3]=i>>>24,T[B0+2]=i>>>16&255,T[B0+1]=i>>>8&255,T[B0]=i&255}return T}B.split32=I;function F(b,c){return b>>>c|b<<32-c}B.rotr32=F;function D(b,c){return b<>>32-c}B.rotl32=D;function w(b,c){return b+c>>>0}B.sum32=w;function P(b,c,T){return b+c+T>>>0}B.sum32_3=P;function A(b,c,T,m){return b+c+T+m>>>0}B.sum32_4=A;function E(b,c,T,m,B0){return b+c+T+m+B0>>>0}B.sum32_5=E;function C(b,c,T,m){var B0=b[c],i=m+b[c+1]>>>0;b[c]=(i>>0,b[c+1]=i}B.sum64=C;function j(b,c,T,m){return(c+m>>>0>>0}B.sum64_hi=j;function v(b,c,T,m){return c+m>>>0}B.sum64_lo=v;function S(b,c,T,m,B0,i,V0,s){var G0=0,r=c;return r=r+m>>>0,G0+=r>>0,G0+=r>>0,G0+=r>>0}B.sum64_4_hi=S;function H(b,c,T,m,B0,i,V0,s){return c+m+i+s>>>0}B.sum64_4_lo=H;function X(b,c,T,m,B0,i,V0,s,G0,r){var y=0,n=c;return n=n+m>>>0,y+=n>>0,y+=n>>0,y+=n>>0,y+=n>>0}B.sum64_5_hi=X;function $(b,c,T,m,B0,i,V0,s,G0,r){return c+m+i+s+r>>>0}B.sum64_5_lo=$;function x(b,c,T){return(c<<32-T|b>>>T)>>>0}B.rotr64_hi=x;function N(b,c,T){return(b<<32-T|c>>>T)>>>0}B.rotr64_lo=N;function a(b,c,T){return b>>>T}B.shr64_hi=a;function U0(b,c,T){return(b<<32-T|c>>>T)>>>0}B.shr64_lo=U0}),L1=R0((B)=>{var U=G2(),G=R1();function Y(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}B.BlockHash=Y,Y.prototype.update=function(K,Z){if(K=U.toArray(K,Z),!this.pending)this.pending=K;else this.pending=this.pending.concat(K);if(this.pendingTotal+=K.length,this.pending.length>=this._delta8){K=this.pending;var J=K.length%this._delta8;if(this.pending=K.slice(K.length-J,K.length),this.pending.length===0)this.pending=null;K=U.join32(K,0,K.length-J,this.endian);for(var M=0;M>>24&255,M[W++]=K>>>16&255,M[W++]=K>>>8&255,M[W++]=K&255}else{M[W++]=K&255,M[W++]=K>>>8&255,M[W++]=K>>>16&255,M[W++]=K>>>24&255,M[W++]=0,M[W++]=0,M[W++]=0,M[W++]=0;for(I=8;I{var U=G2().rotr32;function G(I,F,D,w){if(I===0)return Y(F,D,w);if(I===1||I===3)return K(F,D,w);if(I===2)return Q(F,D,w)}B.ft_1=G;function Y(I,F,D){return I&F^~I&D}B.ch32=Y;function Q(I,F,D){return I&F^I&D^F&D}B.maj32=Q;function K(I,F,D){return I^F^D}B.p32=K;function Z(I){return U(I,2)^U(I,13)^U(I,22)}B.s0_256=Z;function J(I){return U(I,6)^U(I,11)^U(I,25)}B.s1_256=J;function M(I){return U(I,7)^U(I,18)^I>>>3}B.g0_256=M;function W(I){return U(I,17)^U(I,19)^I>>>10}B.g1_256=W}),SG=R0((B,U)=>{var G=G2(),Y=L1(),Q=pB(),K=G.rotl32,Z=G.sum32,J=G.sum32_5,M=Q.ft_1,W=Y.BlockHash,I=[1518500249,1859775393,2400959708,3395469782];function F(){if(!(this instanceof F))return new F;W.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}G.inherits(F,W),U.exports=F,F.blockSize=512,F.outSize=160,F.hmacStrength=80,F.padLength=64,F.prototype._update=function(w,P){var A=this.W;for(var E=0;E<16;E++)A[E]=w[P+E];for(;E{var G=G2(),Y=L1(),Q=pB(),K=R1(),Z=G.sum32,J=G.sum32_4,M=G.sum32_5,W=Q.ch32,I=Q.maj32,F=Q.s0_256,D=Q.s1_256,w=Q.g0_256,P=Q.g1_256,A=Y.BlockHash,E=[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 C(){if(!(this instanceof C))return new C;A.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=E,this.W=Array(64)}G.inherits(C,A),U.exports=C,C.blockSize=512,C.outSize=256,C.hmacStrength=192,C.padLength=64,C.prototype._update=function(v,S){var H=this.W;for(var X=0;X<16;X++)H[X]=v[S+X];for(;X{var G=G2(),Y=rB();function Q(){if(!(this instanceof Q))return new Q;Y.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}G.inherits(Q,Y),U.exports=Q,Q.blockSize=512,Q.outSize=224,Q.hmacStrength=192,Q.padLength=64,Q.prototype._digest=function(Z){if(Z==="hex")return G.toHex32(this.h.slice(0,7),"big");else return G.split32(this.h.slice(0,7),"big")}}),iB=R0((B,U)=>{var G=G2(),Y=L1(),Q=R1(),K=G.rotr64_hi,Z=G.rotr64_lo,J=G.shr64_hi,M=G.shr64_lo,W=G.sum64,I=G.sum64_hi,F=G.sum64_lo,D=G.sum64_4_hi,w=G.sum64_4_lo,P=G.sum64_5_hi,A=G.sum64_5_lo,E=Y.BlockHash,C=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function j(){if(!(this instanceof j))return new j;E.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=C,this.W=Array(160)}G.inherits(j,E),U.exports=j,j.blockSize=1024,j.outSize=512,j.hmacStrength=192,j.padLength=128,j.prototype._prepareBlock=function(B0,i){var V0=this.W;for(var s=0;s<32;s++)V0[s]=B0[i+s];for(;s{var G=G2(),Y=iB();function Q(){if(!(this instanceof Q))return new Q;Y.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}G.inherits(Q,Y),U.exports=Q,Q.blockSize=1024,Q.outSize=384,Q.hmacStrength=192,Q.padLength=128,Q.prototype._digest=function(Z){if(Z==="hex")return G.toHex32(this.h.slice(0,12),"big");else return G.split32(this.h.slice(0,12),"big")}}),yG=R0((B)=>{B.sha1=SG(),B.sha224=bG(),B.sha256=rB(),B.sha384=vG(),B.sha512=iB()}),gG=R0((B)=>{var U=G2(),G=L1(),Y=U.rotl32,Q=U.sum32,K=U.sum32_3,Z=U.sum32_4,J=G.BlockHash;function M(){if(!(this instanceof M))return new M;J.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}U.inherits(M,J),B.ripemd160=M,M.blockSize=512,M.outSize=160,M.hmacStrength=192,M.padLength=64,M.prototype._update=function(C,j){var v=this.h[0],S=this.h[1],H=this.h[2],X=this.h[3],$=this.h[4],x=v,N=S,a=H,U0=X,b=$;for(var c=0;c<80;c++){var T=Q(Y(Z(v,W(c,S,H,X),C[D[c]+j],I(c)),P[c]),$);v=$,$=X,X=Y(H,10),H=S,S=T,T=Q(Y(Z(x,W(79-c,N,a,U0),C[w[c]+j],F(c)),A[c]),b),x=b,b=U0,U0=Y(a,10),a=N,N=T}T=K(this.h[1],H,U0),this.h[1]=K(this.h[2],X,b),this.h[2]=K(this.h[3],$,x),this.h[3]=K(this.h[4],v,N),this.h[4]=K(this.h[0],S,a),this.h[0]=T},M.prototype._digest=function(C){if(C==="hex")return U.toHex32(this.h,"little");else return U.split32(this.h,"little")};function W(E,C,j,v){if(E<=15)return C^j^v;else if(E<=31)return C&j|~C&v;else if(E<=47)return(C|~j)^v;else if(E<=63)return C&v|j&~v;else return C^(j|~v)}function I(E){if(E<=15)return 0;else if(E<=31)return 1518500249;else if(E<=47)return 1859775393;else if(E<=63)return 2400959708;else return 2840853838}function F(E){if(E<=15)return 1352829926;else if(E<=31)return 1548603684;else if(E<=47)return 1836072691;else if(E<=63)return 2053994217;else return 0}var D=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],w=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],P=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],A=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]}),fG=R0((B,U)=>{var G=G2(),Y=R1();function Q(K,Z,J){if(!(this instanceof Q))return new Q(K,Z,J);this.Hash=K,this.blockSize=K.blockSize/8,this.outSize=K.outSize/8,this.inner=null,this.outer=null,this._init(G.toArray(Z,J))}U.exports=Q,Q.prototype._init=function(Z){if(Z.length>this.blockSize)Z=new this.Hash().update(Z).digest();Y(Z.length<=this.blockSize);for(var J=Z.length;J{var U=B;U.utils=G2(),U.common=L1(),U.sha=yG(),U.ripemd=gG(),U.hmac=fG(),U.sha1=U.sha.sha1,U.sha256=U.sha.sha256,U.sha224=U.sha.sha224,U.sha384=U.sha.sha384,U.sha512=U.sha.sha512,U.ripemd160=U.ripemd.ripemd160})(),1),_G="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",hG=(B,U=21)=>{return(G=U)=>{let Y="",Q=G|0;while(Q--)Y+=B[Math.random()*B.length|0];return Y}},uG=(B=21)=>{let U="",G=B|0;while(G--)U+=_G[Math.random()*64|0];return U},dG=(B)=>Math.floor(B/25.4*72*20),u0=(B)=>Math.floor(B*72*20),I1=(B=0)=>{let U=B;return()=>++U},nB=()=>I1(),sB=()=>I1(1),oB=()=>I1(),tB=()=>I1(),O1=()=>uG().toLowerCase(),W8=(B)=>xG.default.sha1().update(B instanceof ArrayBuffer?new Uint8Array(B):B).digest("hex"),s2=(B)=>hG("1234567890abcdef",B)(),eB=()=>`${s2(8)}-${s2(4)}-${s2(4)}-${s2(4)}-${s2(12)}`,U1=(B)=>new Uint8Array(new TextEncoder().encode(B)),B4={CHARACTER:"character",COLUMN:"column",INSIDE_MARGIN:"insideMargin",LEFT_MARGIN:"leftMargin",MARGIN:"margin",OUTSIDE_MARGIN:"outsideMargin",PAGE:"page",RIGHT_MARGIN:"rightMargin"},U4={BOTTOM_MARGIN:"bottomMargin",INSIDE_MARGIN:"insideMargin",LINE:"line",MARGIN:"margin",OUTSIDE_MARGIN:"outsideMargin",PAGE:"page",PARAGRAPH:"paragraph",TOP_MARGIN:"topMargin"},G4=()=>new X0({name:"wp:simplePos",attributes:{x:{key:"x",value:0},y:{key:"y",value:0}}}),Y4=(B)=>new X0({name:"wp:align",children:[B]}),Z4=(B)=>new X0({name:"wp:posOffset",children:[B.toString()]}),Q4=({relative:B,align:U,offset:G})=>new X0({name:"wp:positionH",attributes:{relativeFrom:{key:"relativeFrom",value:B!==null&&B!==void 0?B:B4.PAGE}},children:[(()=>{if(U)return Y4(U);else if(G!==void 0)return Z4(G);else throw Error("There is no configuration provided for floating position (Align or offset)")})()]}),J4=({relative:B,align:U,offset:G})=>new X0({name:"wp:positionV",attributes:{relativeFrom:{key:"relativeFrom",value:B!==null&&B!==void 0?B:U4.PAGE}},children:[(()=>{if(U)return Y4(U);else if(G!==void 0)return Z4(G);else throw Error("There is no configuration provided for floating position (Align or offset)")})()]}),cG=function(B){return B.CENTER="ctr",B.TOP="t",B.BOTTOM="b",B}({}),K4=(B={})=>{var U,G,Y,Q;return new X0({name:"wps:bodyPr",attributes:{lIns:{key:"lIns",value:(U=B.margins)===null||U===void 0?void 0:U.left},rIns:{key:"rIns",value:(G=B.margins)===null||G===void 0?void 0:G.right},tIns:{key:"tIns",value:(Y=B.margins)===null||Y===void 0?void 0:Y.top},bIns:{key:"bIns",value:(Q=B.margins)===null||Q===void 0?void 0:Q.bottom},anchor:{key:"anchor",value:B.verticalAnchor}},children:[...B.noAutoFit?[new M0("a:noAutofit",B.noAutoFit)]:[]]})},mG=(B={txBox:"1"})=>new X0({name:"wps:cNvSpPr",attributes:{txBox:{key:"txBox",value:B.txBox}}}),lG=(B)=>new X0({name:"w:txbxContent",children:[...B]}),aG=(B)=>new X0({name:"wps:txbx",children:[lG(B)]}),pG=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{cx:"cx",cy:"cy"})}},rG=class extends t{constructor(B,U){super("a:ext");e(this,"attributes",void 0),this.attributes=new pG({cx:B,cy:U}),this.root.push(this.attributes)}},iG=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{x:"x",y:"y"})}},nG=class extends t{constructor(B,U){super("a:off");this.root.push(new iG({x:B!==null&&B!==void 0?B:0,y:U!==null&&U!==void 0?U:0}))}},sG=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{flipVertical:"flipV",flipHorizontal:"flipH",rotation:"rot"})}},V4=class extends t{constructor(B){var U,G,Y,Q;super("a:xfrm");e(this,"extents",void 0),e(this,"offset",void 0),this.root.push(new sG({flipVertical:(U=B.flip)===null||U===void 0?void 0:U.vertical,flipHorizontal:(G=B.flip)===null||G===void 0?void 0:G.horizontal,rotation:B.rotation})),this.offset=new nG((Y=B.offset)===null||Y===void 0||(Y=Y.emus)===null||Y===void 0?void 0:Y.x,(Q=B.offset)===null||Q===void 0||(Q=Q.emus)===null||Q===void 0?void 0:Q.y),this.extents=new rG(B.emus.x,B.emus.y),this.root.push(this.offset),this.root.push(this.extents)}},q4=()=>new X0({name:"a:noFill"}),oG=(B)=>new X0({name:"a:srgbClr",attributes:{value:{key:"val",value:B.value}}}),tG=(B)=>new X0({name:"a:schemeClr",attributes:{value:{key:"val",value:B.value}}}),P8=(B)=>new X0({name:"a:solidFill",children:[B.type==="rgb"?oG(B):tG(B)]}),eG=(B)=>new X0({name:"a:ln",attributes:{width:{key:"w",value:B.width},cap:{key:"cap",value:B.cap},compoundLine:{key:"cmpd",value:B.compoundLine},align:{key:"algn",value:B.align}},children:[B.type==="noFill"?q4():B.solidFillType==="rgb"?P8({type:"rgb",value:B.value}):P8({type:"scheme",value:B.value})]}),BY=class extends t{constructor(){super("a:avLst")}},UY=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{prst:"prst"})}},GY=class extends t{constructor(){super("a:prstGeom");this.root.push(new UY({prst:"rect"})),this.root.push(new BY)}},YY=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{bwMode:"bwMode"})}},M4=class extends t{constructor({element:B,outline:U,solidFill:G,transform:Y}){super(`${B}:spPr`);if(e(this,"form",void 0),this.root.push(new YY({bwMode:"auto"})),this.form=new V4(Y),this.root.push(this.form),this.root.push(new GY),U)this.root.push(q4()),this.root.push(eG(U));if(G)this.root.push(P8(G))}},l6=(B)=>new X0({name:"wps:wsp",children:[mG(B.nonVisualProperties),new M4({element:"wps",transform:B.transformation,outline:B.outline,solidFill:B.solidFill}),aG(B.children),K4(B.bodyProperties)]}),J8=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{uri:"uri"})}},ZY=(B)=>new X0({name:"asvg:svgBlip",attributes:{asvg:{key:"xmlns:asvg",value:"http://schemas.microsoft.com/office/drawing/2016/SVG/main"},embed:{key:"r:embed",value:`rId{${B.fileName}}`}}}),QY=(B)=>new X0({name:"a:ext",attributes:{uri:{key:"uri",value:"{96DAC541-7B7A-43D3-8B79-37D633B846F1}"}},children:[ZY(B)]}),JY=(B)=>new X0({name:"a:extLst",children:[QY(B)]}),KY=(B)=>new X0({name:"a:blip",attributes:{embed:{key:"r:embed",value:`rId{${B.type==="svg"?B.fallback.fileName:B.fileName}}`},cstate:{key:"cstate",value:"none"}},children:B.type==="svg"?[JY(B)]:[]}),VY=class extends t{constructor(){super("a:srcRect")}},qY=class extends t{constructor(){super("a:fillRect")}},MY=class extends t{constructor(){super("a:stretch");this.root.push(new qY)}},XY=class extends t{constructor(B){super("pic:blipFill");this.root.push(KY(B)),this.root.push(new VY),this.root.push(new MY)}},RY=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{noChangeAspect:"noChangeAspect",noChangeArrowheads:"noChangeArrowheads"})}},LY=class extends t{constructor(){super("a:picLocks");this.root.push(new RY({noChangeAspect:1,noChangeArrowheads:1}))}},IY=class extends t{constructor(){super("pic:cNvPicPr");this.root.push(new LY)}},X4=(B,U)=>new X0({name:"a:hlinkClick",attributes:L0(L0({},U?{xmlns:{key:"xmlns:a",value:"http://schemas.openxmlformats.org/drawingml/2006/main"}}:{}),{},{id:{key:"r:id",value:`rId${B}`}})}),OY=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{id:"id",name:"name",descr:"descr"})}},FY=class extends t{constructor(){super("pic:cNvPr");this.root.push(new OY({id:0,name:"",descr:""}))}prepForXml(B){for(let U=B.stack.length-1;U>=0;U--){let G=B.stack[U];if(!(G instanceof m2))continue;this.root.push(X4(G.linkId,!1));break}return super.prepForXml(B)}},HY=class extends t{constructor(){super("pic:nvPicPr");this.root.push(new FY),this.root.push(new IY)}},WY=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{xmlns:"xmlns:pic"})}},a6=class extends t{constructor({mediaData:B,transform:U,outline:G}){super("pic:pic");this.root.push(new WY({xmlns:"http://schemas.openxmlformats.org/drawingml/2006/picture"})),this.root.push(new HY),this.root.push(new XY(B)),this.root.push(new M4({element:"pic",transform:U,outline:G}))}},PY=(B)=>new X0({name:"wpg:grpSpPr",children:[new V4(B)]}),wY=()=>new X0({name:"wpg:cNvGrpSpPr"}),AY=(B)=>new X0({name:"wpg:wgp",children:[wY(),PY(B.transformation),...B.children]}),jY=class extends t{constructor({mediaData:B,transform:U,outline:G,solidFill:Y}){super("a:graphicData");if(B.type==="wps"){this.root.push(new J8({uri:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"}));let Q=l6(L0(L0({},B.data),{},{transformation:U,outline:G,solidFill:Y}));this.root.push(Q)}else if(B.type==="wpg"){this.root.push(new J8({uri:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"}));let Q=AY({children:B.children.map((K)=>{if(K.type==="wps")return l6(L0(L0({},K.data),{},{transformation:K.transformation,outline:K.outline,solidFill:K.solidFill}));else return new a6({mediaData:K,transform:K.transformation,outline:K.outline})}),transformation:U});this.root.push(Q)}else{this.root.push(new J8({uri:"http://schemas.openxmlformats.org/drawingml/2006/picture"}));let Q=new a6({mediaData:B,transform:U,outline:G});this.root.push(Q)}}},NY=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{a:"xmlns:a"})}},R4=class extends t{constructor({mediaData:B,transform:U,outline:G,solidFill:Y}){super("a:graphic");e(this,"data",void 0),this.root.push(new NY({a:"http://schemas.openxmlformats.org/drawingml/2006/main"})),this.data=new jY({mediaData:B,transform:U,outline:G,solidFill:Y}),this.root.push(this.data)}},e2={NONE:0,SQUARE:1,TIGHT:2,TOP_AND_BOTTOM:3},L4={BOTH_SIDES:"bothSides",LEFT:"left",RIGHT:"right",LARGEST:"largest"},w8=()=>new X0({name:"wp:wrapNone"}),I4=(B,U={top:0,bottom:0,left:0,right:0})=>new X0({name:"wp:wrapSquare",attributes:{wrapText:{key:"wrapText",value:B.side||L4.BOTH_SIDES},distT:{key:"distT",value:U.top},distB:{key:"distB",value:U.bottom},distL:{key:"distL",value:U.left},distR:{key:"distR",value:U.right}}}),O4=(B={top:0,bottom:0})=>new X0({name:"wp:wrapTight",attributes:{distT:{key:"distT",value:B.top},distB:{key:"distB",value:B.bottom}}}),F4=(B={top:0,bottom:0})=>new X0({name:"wp:wrapTopAndBottom",attributes:{distT:{key:"distT",value:B.top},distB:{key:"distB",value:B.bottom}}}),H4=class extends t{constructor({name:B,description:U,title:G,id:Y}={name:"",description:"",title:""}){super("wp:docPr");e(this,"docPropertiesUniqueNumericId",oB());let Q={id:{key:"id",value:Y!==null&&Y!==void 0?Y:this.docPropertiesUniqueNumericId()},name:{key:"name",value:B}};if(U!==null&&U!==void 0)Q.description={key:"descr",value:U};if(G!==null&&G!==void 0)Q.title={key:"title",value:G};this.root.push(new k8(Q))}prepForXml(B){for(let U=B.stack.length-1;U>=0;U--){let G=B.stack[U];if(!(G instanceof m2))continue;this.root.push(X4(G.linkId,!0));break}return super.prepForXml(B)}},W4=({top:B,right:U,bottom:G,left:Y})=>new X0({name:"wp:effectExtent",attributes:{top:{key:"t",value:B},right:{key:"r",value:U},bottom:{key:"b",value:G},left:{key:"l",value:Y}}}),P4=({x:B,y:U})=>new X0({name:"wp:extent",attributes:{x:{key:"cx",value:B},y:{key:"cy",value:U}}}),zY=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{xmlns:"xmlns:a",noChangeAspect:"noChangeAspect"})}},EY=class extends t{constructor(){super("a:graphicFrameLocks");this.root.push(new zY({xmlns:"http://schemas.openxmlformats.org/drawingml/2006/main",noChangeAspect:1}))}},w4=()=>new X0({name:"wp:cNvGraphicFramePr",children:[new EY]}),TY=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{distT:"distT",distB:"distB",distL:"distL",distR:"distR",allowOverlap:"allowOverlap",behindDoc:"behindDoc",layoutInCell:"layoutInCell",locked:"locked",relativeHeight:"relativeHeight",simplePos:"simplePos"})}},DY=class extends t{constructor({mediaData:B,transform:U,drawingOptions:G}){super("wp:anchor");let Y=L0({allowOverlap:!0,behindDocument:!1,lockAnchor:!1,layoutInCell:!0,verticalPosition:{},horizontalPosition:{}},G.floating);if(this.root.push(new TY({distT:Y.margins?Y.margins.top||0:0,distB:Y.margins?Y.margins.bottom||0:0,distL:Y.margins?Y.margins.left||0:0,distR:Y.margins?Y.margins.right||0:0,simplePos:"0",allowOverlap:Y.allowOverlap===!0?"1":"0",behindDoc:Y.behindDocument===!0?"1":"0",locked:Y.lockAnchor===!0?"1":"0",layoutInCell:Y.layoutInCell===!0?"1":"0",relativeHeight:Y.zIndex?Y.zIndex:U.emus.y})),this.root.push(G4()),this.root.push(Q4(Y.horizontalPosition)),this.root.push(J4(Y.verticalPosition)),this.root.push(P4({x:U.emus.x,y:U.emus.y})),this.root.push(W4({top:0,right:0,bottom:0,left:0})),G.floating!==void 0&&G.floating.wrap!==void 0)switch(G.floating.wrap.type){case e2.SQUARE:this.root.push(I4(G.floating.wrap,G.floating.margins));break;case e2.TIGHT:this.root.push(O4(G.floating.margins));break;case e2.TOP_AND_BOTTOM:this.root.push(F4(G.floating.margins));break;case e2.NONE:default:this.root.push(w8())}else this.root.push(w8());this.root.push(new H4(G.docProperties)),this.root.push(w4()),this.root.push(new R4({mediaData:B,transform:U,outline:G.outline,solidFill:G.solidFill}))}},CY=({mediaData:B,transform:U,docProperties:G,outline:Y,solidFill:Q})=>{var K,Z,J,M;return new X0({name:"wp:inline",attributes:{distanceTop:{key:"distT",value:0},distanceBottom:{key:"distB",value:0},distanceLeft:{key:"distL",value:0},distanceRight:{key:"distR",value:0}},children:[P4({x:U.emus.x,y:U.emus.y}),W4(Y?{top:((K=Y.width)!==null&&K!==void 0?K:9525)*2,right:((Z=Y.width)!==null&&Z!==void 0?Z:9525)*2,bottom:((J=Y.width)!==null&&J!==void 0?J:9525)*2,left:((M=Y.width)!==null&&M!==void 0?M:9525)*2}:{top:0,right:0,bottom:0,left:0}),new H4(G),w4(),new R4({mediaData:B,transform:U,outline:Y,solidFill:Q})]})},c1=class extends t{constructor(B,U={}){super("w:drawing");if(!U.floating)this.root.push(CY({mediaData:B,transform:B.transformation,docProperties:U.docProperties,outline:U.outline,solidFill:U.solidFill}));else this.root.push(new DY({mediaData:B,transform:B.transformation,drawingOptions:U}))}},kY=(B)=>{let U=B.indexOf(";base64,"),G=U===-1?0:U+8;return new Uint8Array(atob(B.substring(G)).split("").map((Y)=>Y.charCodeAt(0)))},A4=(B)=>typeof B==="string"?kY(B):B,K8=(B,U)=>({data:A4(B.data),fileName:U,transformation:{pixels:{x:Math.round(B.transformation.width),y:Math.round(B.transformation.height)},emus:{x:Math.round(B.transformation.width*9525),y:Math.round(B.transformation.height*9525)},flip:B.transformation.flip,rotation:B.transformation.rotation?B.transformation.rotation*60000:void 0}}),$Y=class extends t{constructor(B){var U=(...Z)=>(super(...Z),e(this,"imageData",void 0),this);let G=`${W8(B.data)}.${B.type}`,Y=B.type==="svg"?L0(L0({type:B.type},K8(B,G)),{},{fallback:L0({type:B.fallback.type},K8(L0(L0({},B.fallback),{},{transformation:B.transformation}),`${W8(B.fallback.data)}.${B.fallback.type}`))}):L0({type:B.type},K8(B,G)),Q=new c1(Y,{floating:B.floating,docProperties:B.altText,outline:B.outline}),K=new T0({children:[Q]});if(B.insertion)U("w:ins"),this.root.push(new b0({id:B.insertion.id,author:B.insertion.author,date:B.insertion.date})),this.addChildElement(K);else if(B.deletion)U("w:del"),this.root.push(new b0({id:B.deletion.id,author:B.deletion.author,date:B.deletion.date})),this.addChildElement(K);else U("w:r"),this.root.push(new U2({})),this.root.push(Q);this.imageData=Y}prepForXml(B){if(B.file.Media.addImage(this.imageData.fileName,this.imageData),this.imageData.type==="svg")B.file.Media.addImage(this.imageData.fallback.fileName,this.imageData.fallback);return super.prepForXml(B)}},i8=(B)=>{var U,G,Y,Q,K,Z,J,M;return{offset:{pixels:{x:Math.round((U=(G=B.offset)===null||G===void 0?void 0:G.left)!==null&&U!==void 0?U:0),y:Math.round((Y=(Q=B.offset)===null||Q===void 0?void 0:Q.top)!==null&&Y!==void 0?Y:0)},emus:{x:Math.round(((K=(Z=B.offset)===null||Z===void 0?void 0:Z.left)!==null&&K!==void 0?K:0)*9525),y:Math.round(((J=(M=B.offset)===null||M===void 0?void 0:M.top)!==null&&J!==void 0?J:0)*9525)}},pixels:{x:Math.round(B.width),y:Math.round(B.height)},emus:{x:Math.round(B.width*9525),y:Math.round(B.height*9525)},flip:B.flip,rotation:B.rotation?B.rotation*60000:void 0}},SY=class extends T0{constructor(B){super({});e(this,"wpsShapeData",void 0),this.wpsShapeData={type:B.type,transformation:i8(B.transformation),data:L0({},B)};let U=new c1(this.wpsShapeData,{floating:B.floating,docProperties:B.altText,outline:B.outline,solidFill:B.solidFill});this.root.push(U)}},bY=class extends T0{constructor(B){super({});e(this,"wpgGroupData",void 0),e(this,"mediaDatas",void 0),this.wpgGroupData={type:B.type,transformation:i8(B.transformation),children:B.children};let U=new c1(this.wpgGroupData,{floating:B.floating,docProperties:B.altText});this.mediaDatas=B.children.filter((G)=>G.type!=="wps").map((G)=>G),this.root.push(U)}prepForXml(B){return this.mediaDatas.forEach((U)=>{if(B.file.Media.addImage(U.fileName,U),U.type==="svg")B.file.Media.addImage(U.fallback.fileName,U.fallback)}),super.prepForXml(B)}},vY=class extends t{constructor(B){super("w:instrText");this.root.push(new _0({space:x0.PRESERVE})),this.root.push(`SEQ ${B}`)}},yY=class extends T0{constructor(B){super({});this.root.push(e0(!0)),this.root.push(new vY(B)),this.root.push(q2()),this.root.push(B2())}},gY=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{instr:"w:instr"})}},n8=class extends t{constructor(B,U){super("w:fldSimple");if(this.root.push(new gY({instr:B})),U!==void 0)this.root.push(new Q1(U))}},fY=class extends n8{constructor(B){super(` MERGEFIELD ${B} `,`«${B}»`)}},xY=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{xmlns:"xmlns"})}},j4={EXTERNAL:"External"},_Y=(B,U,G,Y)=>new X0({name:"Relationship",attributes:{id:{key:"Id",value:B},type:{key:"Type",value:U},target:{key:"Target",value:G},targetMode:{key:"TargetMode",value:Y}}}),w2=class extends t{constructor(){super("Relationships");this.root.push(new xY({xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}))}addRelationship(B,U,G,Y){this.root.push(_Y(`rId${B}`,U,G,Y))}get RelationshipCount(){return this.root.length-1}},hY=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{id:"w:id",initials:"w:initials",author:"w:author",date:"w:date"})}},s8=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{id:"w:id"})}},uY=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{"xmlns:cx":"xmlns:cx","xmlns:cx1":"xmlns:cx1","xmlns:cx2":"xmlns:cx2","xmlns:cx3":"xmlns:cx3","xmlns:cx4":"xmlns:cx4","xmlns:cx5":"xmlns:cx5","xmlns:cx6":"xmlns:cx6","xmlns:cx7":"xmlns:cx7","xmlns:cx8":"xmlns:cx8","xmlns:mc":"xmlns:mc","xmlns:aink":"xmlns:aink","xmlns:am3d":"xmlns:am3d","xmlns:o":"xmlns:o","xmlns:r":"xmlns:r","xmlns:m":"xmlns:m","xmlns:v":"xmlns:v","xmlns:wp14":"xmlns:wp14","xmlns:wp":"xmlns:wp","xmlns:w10":"xmlns:w10","xmlns:w":"xmlns:w","xmlns:w14":"xmlns:w14","xmlns:w15":"xmlns:w15","xmlns:w16cex":"xmlns:w16cex","xmlns:w16cid":"xmlns:w16cid","xmlns:w16":"xmlns:w16","xmlns:w16sdtdh":"xmlns:w16sdtdh","xmlns:w16se":"xmlns:w16se","xmlns:wpg":"xmlns:wpg","xmlns:wpi":"xmlns:wpi","xmlns:wne":"xmlns:wne","xmlns:wps":"xmlns:wps"})}},dY=class extends t{constructor(B){super("w:commentRangeStart");this.root.push(new s8({id:B}))}},cY=class extends t{constructor(B){super("w:commentRangeEnd");this.root.push(new s8({id:B}))}},mY=class extends t{constructor(B){super("w:commentReference");this.root.push(new s8({id:B}))}},A8=class extends t{constructor({id:B,initials:U,author:G,date:Y=new Date,children:Q},K){super("w:comment");e(this,"paraId",void 0),this.paraId=K,this.root.push(new hY({id:B,initials:U,author:G,date:Y.toISOString()}));for(let Z of Q)this.root.push(Z)}prepForXml(B){let U=super.prepForXml(B);if(!U||!this.paraId)return U;let G=U["w:comment"];if(!Array.isArray(G))return U;for(let Y=G.length-1;Y>=0;Y--){let Q=G[Y];if(Q&&typeof Q==="object"&&"w:p"in Q){let K=Q["w:p"];if(Array.isArray(K))K.unshift({_attr:{"w14:paraId":this.paraId,"w14:textId":this.paraId}});break}}return U}},N4=(B)=>(B+1).toString(16).toUpperCase().padStart(8,"0"),z4=class extends t{constructor({children:B}){super("w:comments");if(e(this,"relationships",void 0),e(this,"threadData",void 0),this.root.push(new uY({"xmlns:cx":"http://schemas.microsoft.com/office/drawing/2014/chartex","xmlns:cx1":"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex","xmlns:cx2":"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex","xmlns:cx3":"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex","xmlns:cx4":"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex","xmlns:cx5":"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex","xmlns:cx6":"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex","xmlns:cx7":"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex","xmlns:cx8":"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:aink":"http://schemas.microsoft.com/office/drawing/2016/ink","xmlns:am3d":"http://schemas.microsoft.com/office/drawing/2017/model3d","xmlns:o":"urn:schemas-microsoft-com:office:office","xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships","xmlns:m":"http://schemas.openxmlformats.org/officeDocument/2006/math","xmlns:v":"urn:schemas-microsoft-com:vml","xmlns:wp14":"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing","xmlns:wp":"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing","xmlns:w10":"urn:schemas-microsoft-com:office:word","xmlns:w":"http://schemas.openxmlformats.org/wordprocessingml/2006/main","xmlns:w14":"http://schemas.microsoft.com/office/word/2010/wordml","xmlns:w15":"http://schemas.microsoft.com/office/word/2012/wordml","xmlns:w16cex":"http://schemas.microsoft.com/office/word/2018/wordml/cex","xmlns:w16cid":"http://schemas.microsoft.com/office/word/2016/wordml/cid","xmlns:w16":"http://schemas.microsoft.com/office/word/2018/wordml","xmlns:w16sdtdh":"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash","xmlns:w16se":"http://schemas.microsoft.com/office/word/2015/wordml/symex","xmlns:wpg":"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup","xmlns:wpi":"http://schemas.microsoft.com/office/word/2010/wordprocessingInk","xmlns:wne":"http://schemas.microsoft.com/office/word/2006/wordml","xmlns:wps":"http://schemas.microsoft.com/office/word/2010/wordprocessingShape"})),B.some((U)=>U.parentId!==void 0)){let U=new Map(B.map((G)=>[G.id,N4(G.id)]));for(let G of B)this.root.push(new A8(G,U.get(G.id)));this.threadData=B.map((G)=>({paraId:U.get(G.id),parentParaId:G.parentId!==void 0?U.get(G.parentId):void 0,done:G.resolved}))}else for(let U of B)this.root.push(new A8(U));this.relationships=new w2}get Relationships(){return this.relationships}get ThreadData(){return this.threadData}},lY=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{"xmlns:wpc":"xmlns:wpc","xmlns:mc":"xmlns:mc","xmlns:w15":"xmlns:w15","mc:Ignorable":"mc:Ignorable"})}},aY=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{paraId:"w15:paraId",paraIdParent:"w15:paraIdParent",done:"w15:done"})}},pY=class extends t{constructor(B){super("w15:commentEx");this.root.push(new aY({paraId:B.paraId,paraIdParent:B.parentParaId,done:B.done!==void 0?B.done?"1":"0":void 0}))}},E4=class extends t{constructor(B){super("w15:commentsEx");this.root.push(new lY({"xmlns:wpc":"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas","xmlns:mc":"http://schemas.openxmlformats.org/markup-compatibility/2006","xmlns:w15":"http://schemas.microsoft.com/office/word/2012/wordml","mc:Ignorable":"w15"}));for(let U of B)this.root.push(new pY(U))}},rY=class extends S0{constructor(){super("w:noBreakHyphen")}},iY=class extends S0{constructor(){super("w:softHyphen")}},nY=class extends S0{constructor(){super("w:dayShort")}},sY=class extends S0{constructor(){super("w:monthShort")}},oY=class extends S0{constructor(){super("w:yearShort")}},tY=class extends S0{constructor(){super("w:dayLong")}},eY=class extends S0{constructor(){super("w:monthLong")}},BZ=class extends S0{constructor(){super("w:yearLong")}},UZ=class extends S0{constructor(){super("w:annotationRef")}},GZ=class extends S0{constructor(){super("w:footnoteRef")}},T4=class extends S0{constructor(){super("w:endnoteRef")}},YZ=class extends S0{constructor(){super("w:separator")}},ZZ=class extends S0{constructor(){super("w:continuationSeparator")}},QZ=class extends S0{constructor(){super("w:pgNum")}},JZ=class extends S0{constructor(){super("w:cr")}},D4=class extends S0{constructor(){super("w:tab")}},KZ=class extends S0{constructor(){super("w:lastRenderedPageBreak")}},VZ={LEFT:"left",CENTER:"center",RIGHT:"right"},qZ={MARGIN:"margin",INDENT:"indent"},MZ={NONE:"none",DOT:"dot",HYPHEN:"hyphen",UNDERSCORE:"underscore",MIDDLE_DOT:"middleDot"},XZ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{alignment:"w:alignment",relativeTo:"w:relativeTo",leader:"w:leader"})}},RZ=class extends t{constructor(B){super("w:ptab");this.root.push(new XZ({alignment:B.alignment,relativeTo:B.relativeTo,leader:B.leader}))}},C4={COLUMN:"column",PAGE:"page"},k4=class extends t{constructor(B){super("w:br");this.root.push(new C0({type:B}))}},LZ=class extends T0{constructor(){super({});this.root.push(new k4(C4.PAGE))}},IZ=class extends T0{constructor(){super({});this.root.push(new k4(C4.COLUMN))}},$4=class extends t{constructor(){super("w:pageBreakBefore")}},k2={AT_LEAST:"atLeast",EXACTLY:"exactly",EXACT:"exact",AUTO:"auto"},S4=({after:B,before:U,line:G,lineRule:Y,beforeAutoSpacing:Q,afterAutoSpacing:K})=>new X0({name:"w:spacing",attributes:{after:{key:"w:after",value:B},before:{key:"w:before",value:U},line:{key:"w:line",value:G},lineRule:{key:"w:lineRule",value:Y},beforeAutoSpacing:{key:"w:beforeAutospacing",value:Q},afterAutoSpacing:{key:"w:afterAutospacing",value:K}}}),OZ={HEADING_1:"Heading1",HEADING_2:"Heading2",HEADING_3:"Heading3",HEADING_4:"Heading4",HEADING_5:"Heading5",HEADING_6:"Heading6",TITLE:"Title"},x2=(B)=>new X0({name:"w:pStyle",attributes:{val:{key:"w:val",value:B}}}),j8={LEFT:"left",RIGHT:"right",CENTER:"center",BAR:"bar",CLEAR:"clear",DECIMAL:"decimal",END:"end",NUM:"num",START:"start"},FZ={DOT:"dot",HYPHEN:"hyphen",MIDDLE_DOT:"middleDot",NONE:"none",UNDERSCORE:"underscore"},HZ={MAX:9026},b4=({type:B,position:U,leader:G})=>new X0({name:"w:tab",attributes:{val:{key:"w:val",value:B},pos:{key:"w:pos",value:U},leader:{key:"w:leader",value:G}}}),v4=(B)=>new X0({name:"w:tabs",children:B.map((U)=>b4(U))}),D1=class extends t{constructor(B,U){super("w:numPr");this.root.push(new WZ(U)),this.root.push(new PZ(B))}},WZ=class extends t{constructor(B){super("w:ilvl");if(B>9)throw Error("Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7");this.root.push(new C0({val:B}))}},PZ=class extends t{constructor(B){super("w:numId");this.root.push(new C0({val:typeof B==="string"?`{${B}}`:B}))}},F1=class extends t{constructor(...B){super(...B);e(this,"fileChild",Symbol())}},wZ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{id:"r:id",history:"w:history",anchor:"w:anchor"})}},AZ={INTERNAL:"INTERNAL",EXTERNAL:"EXTERNAL"},m2=class extends t{constructor(B,U,G){super("w:hyperlink");e(this,"linkId",void 0),this.linkId=U;let Y=new wZ({history:1,anchor:G?G:void 0,id:!G?`rId${this.linkId}`:void 0});this.root.push(Y),B.forEach((Q)=>{this.root.push(Q)})}},y4=class extends m2{constructor(B){super(B.children,O1(),B.anchor)}},o8=class extends t{constructor(B){super("w:externalHyperlink");e(this,"options",void 0),this.options=B}},jZ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{id:"w:id",name:"w:name"})}},NZ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{id:"w:id"})}},g4=class{constructor(B){e(this,"bookmarkUniqueNumericId",tB()),e(this,"start",void 0),e(this,"children",void 0),e(this,"end",void 0);let U=this.bookmarkUniqueNumericId();this.start=new f4(B.id,U),this.children=B.children,this.end=new x4(U)}},f4=class extends t{constructor(B,U){super("w:bookmarkStart");let G=new jZ({name:B,id:U});this.root.push(G)}},x4=class extends t{constructor(B){super("w:bookmarkEnd");let U=new NZ({id:B});this.root.push(U)}},zZ=function(B){return B.NONE="none",B.RELATIVE="relative",B.NO_CONTEXT="no_context",B.FULL_CONTEXT="full_context",B}({}),EZ={["relative"]:"\\r",["no_context"]:"\\n",["full_context"]:"\\w",["none"]:void 0},TZ=class extends n8{constructor(B,U,G={}){let{hyperlink:Y=!0,referenceFormat:Q="full_context"}=G,K=`${`REF ${B}`} ${[...Y?["\\h"]:[],...[EZ[Q]].filter((Z)=>!!Z)].join(" ")}`;super(K,U)}},_4=(B)=>new X0({name:"w:outlineLvl",attributes:{val:{key:"w:val",value:B}}}),DZ=class extends t{constructor(B,U={}){super("w:instrText");this.root.push(new _0({space:x0.PRESERVE}));let G=`PAGEREF ${B}`;if(U.hyperlink)G=`${G} \\h`;if(U.useRelativePosition)G=`${G} \\p`;this.root.push(G)}},CZ=class extends T0{constructor(B,U={}){super({children:[e0(!0),new DZ(B,U),B2()]})}},kZ={ANSI:"00",DEFAULT:"01",SYMBOL:"02",MAC:"4D",JIS:"80",HANGUL:"81",JOHAB:"82",GB_2312:"86",CHINESEBIG5:"88",GREEK:"A1",TURKISH:"A2",VIETNAMESE:"A3",HEBREW:"B1",ARABIC:"B2",BALTIC:"BA",RUSSIAN:"CC",THAI:"DE",EASTEUROPE:"EE",OEM:"FF"},z1=({id:B,fontKey:U,subsetted:G},Y)=>new X0({name:Y,attributes:L0({id:{key:"r:id",value:B}},U?{fontKey:{key:"w:fontKey",value:`{${U}}`}}:{}),children:[...G?[new M0("w:subsetted",G)]:[]]}),$Z=({name:B,altName:U,panose1:G,charset:Y,family:Q,notTrueType:K,pitch:Z,sig:J,embedRegular:M,embedBold:W,embedItalic:I,embedBoldItalic:F})=>new X0({name:"w:font",attributes:{name:{key:"w:name",value:B}},children:[...U?[f2("w:altName",U)]:[],...G?[f2("w:panose1",G)]:[],...Y?[f2("w:charset",Y)]:[],...Q?[f2("w:family",Q)]:[],...K?[new M0("w:notTrueType",K)]:[],...Z?[f2("w:pitch",Z)]:[],...J?[new X0({name:"w:sig",attributes:{usb0:{key:"w:usb0",value:J.usb0},usb1:{key:"w:usb1",value:J.usb1},usb2:{key:"w:usb2",value:J.usb2},usb3:{key:"w:usb3",value:J.usb3},csb0:{key:"w:csb0",value:J.csb0},csb1:{key:"w:csb1",value:J.csb1}}})]:[],...M?[z1(M,"w:embedRegular")]:[],...W?[z1(W,"w:embedBold")]:[],...I?[z1(I,"w:embedItalic")]:[],...F?[z1(F,"w:embedBoldItalic")]:[]]}),SZ=({name:B,index:U,fontKey:G,characterSet:Y})=>$Z({name:B,sig:{usb0:"E0002AFF",usb1:"C000247B",usb2:"00000009",usb3:"00000000",csb0:"000001FF",csb1:"00000000"},charset:Y,family:"auto",pitch:"variable",embedRegular:{fontKey:G,id:`rId${U}`}}),bZ=(B)=>new X0({name:"w:fonts",attributes:{mc:{key:"xmlns:mc",value:"http://schemas.openxmlformats.org/markup-compatibility/2006"},r:{key:"xmlns:r",value:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"},w:{key:"xmlns:w",value:"http://schemas.openxmlformats.org/wordprocessingml/2006/main"},w14:{key:"xmlns:w14",value:"http://schemas.microsoft.com/office/word/2010/wordml"},w15:{key:"xmlns:w15",value:"http://schemas.microsoft.com/office/word/2012/wordml"},w16cex:{key:"xmlns:w16cex",value:"http://schemas.microsoft.com/office/word/2018/wordml/cex"},w16cid:{key:"xmlns:w16cid",value:"http://schemas.microsoft.com/office/word/2016/wordml/cid"},w16:{key:"xmlns:w16",value:"http://schemas.microsoft.com/office/word/2018/wordml"},w16sdtdh:{key:"xmlns:w16sdtdh",value:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash"},w16se:{key:"xmlns:w16se",value:"http://schemas.microsoft.com/office/word/2015/wordml/symex"},Ignorable:{key:"mc:Ignorable",value:"w14 w15 w16se w16cid w16 w16cex w16sdtdh"}},children:B.map((U,G)=>SZ({name:U.name,index:G+1,fontKey:U.fontKey,characterSet:U.characterSet}))}),h4=class{constructor(B){e(this,"options",void 0),e(this,"fontTable",void 0),e(this,"relationships",void 0),e(this,"fontOptionsWithKey",[]),this.options=B,this.fontOptionsWithKey=B.map((U)=>L0(L0({},U),{},{fontKey:eB()})),this.fontTable=bZ(this.fontOptionsWithKey),this.relationships=new w2;for(let U=0;Unew X0({name:"w:wordWrap",attributes:{val:{key:"w:val",value:0}}}),yZ={NONE:"none",DROP:"drop",MARGIN:"margin"},gZ={MARGIN:"margin",PAGE:"page",TEXT:"text"},fZ={AROUND:"around",AUTO:"auto",NONE:"none",NOT_BESIDE:"notBeside",THROUGH:"through",TIGHT:"tight"},u4=(B)=>{var U,G;return new X0({name:"w:framePr",attributes:{anchorLock:{key:"w:anchorLock",value:B.anchorLock},dropCap:{key:"w:dropCap",value:B.dropCap},width:{key:"w:w",value:B.width},height:{key:"w:h",value:B.height},x:{key:"w:x",value:B.position?B.position.x:void 0},y:{key:"w:y",value:B.position?B.position.y:void 0},anchorHorizontal:{key:"w:hAnchor",value:B.anchor.horizontal},anchorVertical:{key:"w:vAnchor",value:B.anchor.vertical},spaceHorizontal:{key:"w:hSpace",value:(U=B.space)===null||U===void 0?void 0:U.horizontal},spaceVertical:{key:"w:vSpace",value:(G=B.space)===null||G===void 0?void 0:G.vertical},rule:{key:"w:hRule",value:B.rule},alignmentX:{key:"w:xAlign",value:B.alignment?B.alignment.x:void 0},alignmentY:{key:"w:yAlign",value:B.alignment?B.alignment.y:void 0},lines:{key:"w:lines",value:B.lines},wrap:{key:"w:wrap",value:B.wrap}}})},X2=class extends R2{constructor(B){super("w:pPr",B===null||B===void 0?void 0:B.includeIfEmpty);if(e(this,"numberingReferences",[]),!B)return this;if(B.heading)this.push(x2(B.heading));if(B.bullet)this.push(x2("ListParagraph"));if(B.numbering){if(!B.style&&!B.heading){if(!B.numbering.custom)this.push(x2("ListParagraph"))}}if(B.style)this.push(x2(B.style));if(B.keepNext!==void 0)this.push(new M0("w:keepNext",B.keepNext));if(B.keepLines!==void 0)this.push(new M0("w:keepLines",B.keepLines));if(B.pageBreakBefore)this.push(new $4);if(B.frame)this.push(u4(B.frame));if(B.widowControl!==void 0)this.push(new M0("w:widowControl",B.widowControl));if(B.bullet)this.push(new D1(1,B.bullet.level));if(B.numbering){var U,G;this.numberingReferences.push({reference:B.numbering.reference,instance:(U=B.numbering.instance)!==null&&U!==void 0?U:0}),this.push(new D1(`${B.numbering.reference}-${(G=B.numbering.instance)!==null&&G!==void 0?G:0}`,B.numbering.level))}else if(B.numbering===!1)this.push(new D1(0,0));if(B.border)this.push(new xB(B.border));if(B.thematicBreak)this.push(new _B);if(B.shading)this.push(X1(B.shading));if(B.wordWrap)this.push(vZ());if(B.overflowPunctuation)this.push(new M0("w:overflowPunct",B.overflowPunctuation));let Y=[...B.rightTabStop!==void 0?[{type:j8.RIGHT,position:B.rightTabStop}]:[],...B.tabStops?B.tabStops:[],...B.leftTabStop!==void 0?[{type:j8.LEFT,position:B.leftTabStop}]:[]];if(Y.length>0)this.push(v4(Y));if(B.bidirectional!==void 0)this.push(new M0("w:bidi",B.bidirectional));if(B.spacing)this.push(S4(B.spacing));if(B.indent)this.push(hB(B.indent));if(B.contextualSpacing!==void 0)this.push(new M0("w:contextualSpacing",B.contextualSpacing));if(B.alignment)this.push(c8(B.alignment));if(B.outlineLevel!==void 0)this.push(_4(B.outlineLevel));if(B.suppressLineNumbers!==void 0)this.push(new M0("w:suppressLineNumbers",B.suppressLineNumbers));if(B.autoSpaceEastAsianText!==void 0)this.push(new M0("w:autoSpaceDN",B.autoSpaceEastAsianText));if(B.run)this.push(new mB(B.run));if(B.revision)this.push(new d4(B.revision))}push(B){this.root.push(B)}prepForXml(B){if(!(B.viewWrapper instanceof h4))for(let U of this.numberingReferences)B.file.Numbering.createConcreteNumberingInstance(U.reference,U.instance);return super.prepForXml(B)}},d4=class extends t{constructor(B){super("w:pPrChange");this.root.push(new b0({id:B.id,author:B.author,date:B.date})),this.root.push(new X2(L0(L0({},B),{},{includeIfEmpty:!0})))}},d0=class extends F1{constructor(B){super("w:p");if(e(this,"properties",void 0),typeof B==="string")return this.properties=new X2({}),this.root.push(this.properties),this.root.push(new Q1(B)),this;if(this.properties=new X2(B),this.root.push(this.properties),B.text)this.root.push(new Q1(B.text));if(B.children)for(let U of B.children){if(U instanceof g4){this.root.push(U.start);for(let G of U.children)this.root.push(G);this.root.push(U.end);continue}this.root.push(U)}}prepForXml(B){for(let U of this.root)if(U instanceof o8){let G=this.root.indexOf(U),Y=new m2(U.options.children,O1());B.viewWrapper.Relationships.addRelationship(Y.linkId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",U.options.link,j4.EXTERNAL),this.root[G]=Y}return super.prepForXml(B)}addRunToFront(B){return this.root.splice(1,0,B),this}},xZ=class extends t{constructor(B){super("m:oMath");for(let U of B.children)this.root.push(U)}},_Z=class extends t{constructor(B){super("m:t");this.root.push(B)}},hZ=class extends t{constructor(B){super("m:r");this.root.push(new _Z(B))}},c4=class extends t{constructor(B){super("m:den");for(let U of B)this.root.push(U)}},m4=class extends t{constructor(B){super("m:num");for(let U of B)this.root.push(U)}},uZ=class extends t{constructor(B){super("m:f");this.root.push(new m4(B.numerator)),this.root.push(new c4(B.denominator))}},l4=({accent:B})=>new X0({name:"m:chr",attributes:{accent:{key:"m:val",value:B}}}),y0=({children:B})=>new X0({name:"m:e",children:B}),a4=({value:B})=>new X0({name:"m:limLoc",attributes:{value:{key:"m:val",value:B||"undOvr"}}}),dZ=()=>new X0({name:"m:subHide",attributes:{hide:{key:"m:val",value:1}}}),cZ=()=>new X0({name:"m:supHide",attributes:{hide:{key:"m:val",value:1}}}),t8=({accent:B,hasSuperScript:U,hasSubScript:G,limitLocationVal:Y})=>new X0({name:"m:naryPr",children:[...B?[l4({accent:B})]:[],a4({value:Y}),...!U?[cZ()]:[],...!G?[dZ()]:[]]}),l2=({children:B})=>new X0({name:"m:sub",children:B}),a2=({children:B})=>new X0({name:"m:sup",children:B}),mZ=class extends t{constructor(B){super("m:nary");if(this.root.push(t8({accent:"∑",hasSuperScript:!!B.superScript,hasSubScript:!!B.subScript})),B.subScript)this.root.push(l2({children:B.subScript}));if(B.superScript)this.root.push(a2({children:B.superScript}));this.root.push(y0({children:B.children}))}},lZ=class extends t{constructor(B){super("m:nary");if(this.root.push(t8({accent:"",hasSuperScript:!!B.superScript,hasSubScript:!!B.subScript,limitLocationVal:"subSup"})),B.subScript)this.root.push(l2({children:B.subScript}));if(B.superScript)this.root.push(a2({children:B.superScript}));this.root.push(y0({children:B.children}))}},e8=class extends t{constructor(B){super("m:lim");for(let U of B)this.root.push(U)}},aZ=class extends t{constructor(B){super("m:limUpp");this.root.push(y0({children:B.children})),this.root.push(new e8(B.limit))}},pZ=class extends t{constructor(B){super("m:limLow");this.root.push(y0({children:B.children})),this.root.push(new e8(B.limit))}},p4=()=>new X0({name:"m:sSupPr"}),rZ=class extends t{constructor(B){super("m:sSup");this.root.push(p4()),this.root.push(y0({children:B.children})),this.root.push(a2({children:B.superScript}))}},r4=()=>new X0({name:"m:sSubPr"}),iZ=class extends t{constructor(B){super("m:sSub");this.root.push(r4()),this.root.push(y0({children:B.children})),this.root.push(l2({children:B.subScript}))}},i4=()=>new X0({name:"m:sSubSupPr"}),nZ=class extends t{constructor(B){super("m:sSubSup");this.root.push(i4()),this.root.push(y0({children:B.children})),this.root.push(l2({children:B.subScript})),this.root.push(a2({children:B.superScript}))}},n4=()=>new X0({name:"m:sPrePr"}),sZ=class extends X0{constructor({children:B,subScript:U,superScript:G}){super({name:"m:sPre",children:[n4(),y0({children:B}),l2({children:U}),a2({children:G})]})}},oZ="",s4=class extends t{constructor(B){super("m:deg");if(B)for(let U of B)this.root.push(U)}},tZ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{hide:"m:val"})}},eZ=class extends t{constructor(){super("m:degHide");this.root.push(new tZ({hide:1}))}},o4=class extends t{constructor(B){super("m:radPr");if(!B)this.root.push(new eZ)}},BQ=class extends t{constructor(B){super("m:rad");this.root.push(new o4(!!B.degree)),this.root.push(new s4(B.degree)),this.root.push(y0({children:B.children}))}},t4=class extends t{constructor(B){super("m:fName");for(let U of B)this.root.push(U)}},e4=class extends t{constructor(){super("m:funcPr")}},UQ=class extends t{constructor(B){super("m:func");this.root.push(new e4),this.root.push(new t4(B.name)),this.root.push(y0({children:B.children}))}},GQ=({character:B})=>new X0({name:"m:begChr",attributes:{character:{key:"m:val",value:B}}}),YQ=({character:B})=>new X0({name:"m:endChr",attributes:{character:{key:"m:val",value:B}}}),m1=({characters:B})=>new X0({name:"m:dPr",children:B?[GQ({character:B.beginningCharacter}),YQ({character:B.endingCharacter})]:[]}),ZQ=class extends t{constructor(B){super("m:d");this.root.push(m1({})),this.root.push(y0({children:B.children}))}},QQ=class extends t{constructor(B){super("m:d");this.root.push(m1({characters:{beginningCharacter:"[",endingCharacter:"]"}})),this.root.push(y0({children:B.children}))}},JQ=class extends t{constructor(B){super("m:d");this.root.push(m1({characters:{beginningCharacter:"{",endingCharacter:"}"}})),this.root.push(y0({children:B.children}))}},KQ=class extends t{constructor(B){super("m:d");this.root.push(m1({characters:{beginningCharacter:"〈",endingCharacter:"〉"}})),this.root.push(y0({children:B.children}))}},VQ=(B)=>new X0({name:"w:gridCol",attributes:B!==void 0?{width:{key:"w:w",value:E0(B)}}:void 0}),B9=class extends t{constructor(B,U){super("w:tblGrid");for(let G of B)this.root.push(VQ(G));if(U)this.root.push(new MQ(U))}},qQ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{id:"w:id"})}},MQ=class extends t{constructor(B){super("w:tblGridChange");this.root.push(new qQ({id:B.id})),this.root.push(new B9(B.columnWidths))}},XQ=class extends t{constructor(B){super("w:ins");this.root.push(new b0({id:B.id,author:B.author,date:B.date})),this.addChildElement(new Q1(B))}},RQ=class extends t{constructor(){super("w:delInstrText");this.root.push(new _0({space:x0.PRESERVE})),this.root.push("PAGE")}},LQ=class extends t{constructor(){super("w:delInstrText");this.root.push(new _0({space:x0.PRESERVE})),this.root.push("NUMPAGES")}},IQ=class extends t{constructor(){super("w:delInstrText");this.root.push(new _0({space:x0.PRESERVE})),this.root.push("SECTIONPAGES")}},p6=class extends t{constructor(B){super("w:delText");this.root.push(new _0({space:x0.PRESERVE})),this.root.push(B)}},OQ=class extends t{constructor(B){super("w:del");e(this,"deletedTextRunWrapper",void 0),this.root.push(new b0({id:B.id,author:B.author,date:B.date})),this.deletedTextRunWrapper=new FQ(B),this.addChildElement(this.deletedTextRunWrapper)}},FQ=class extends t{constructor(B){super("w:r");if(this.root.push(new U2(B)),B.children)for(let U of B.children){if(typeof U==="string"){switch(U){case H2.CURRENT:this.root.push(e0()),this.root.push(new RQ),this.root.push(q2()),this.root.push(B2());break;case H2.TOTAL_PAGES:this.root.push(e0()),this.root.push(new LQ),this.root.push(q2()),this.root.push(B2());break;case H2.TOTAL_PAGES_IN_SECTION:this.root.push(e0()),this.root.push(new IQ),this.root.push(q2()),this.root.push(B2());break;default:this.root.push(new p6(U));break}continue}this.root.push(U)}else if(B.text)this.root.push(new p6(B.text));if(B.break)for(let U=0;Unew X0({name:"w:vAlign",attributes:{verticalAlign:{key:"w:val",value:B}}}),q9=({marginUnitType:B=b1.DXA,top:U,left:G,bottom:Y,right:Q})=>[{name:"w:top",size:U},{name:"w:left",size:G},{name:"w:bottom",size:Y},{name:"w:right",size:Q}].filter((K)=>K.size!==void 0).map(({name:K,size:Z})=>J1(K,{type:B,size:Z})),PQ=(B)=>{let U=q9(B);if(U.length===0)return;return new X0({name:"w:tblCellMar",children:U})},wQ=(B)=>{let U=q9(B);if(U.length===0)return;return new X0({name:"w:tcMar",children:U})},b1={AUTO:"auto",DXA:"dxa",NIL:"nil",PERCENTAGE:"pct"},J1=(B,{type:U=b1.AUTO,size:G})=>{let Y=G;if(U===b1.PERCENTAGE&&typeof G==="number")Y=`${G}%`;return new X0({name:B,attributes:{type:{key:"w:type",value:U},size:{key:"w:w",value:d8(Y)}}})},M9=class extends R2{constructor(B){super("w:tcBorders");if(B.top)this.root.push(A0("w:top",B.top));if(B.start)this.root.push(A0("w:start",B.start));if(B.left)this.root.push(A0("w:left",B.left));if(B.bottom)this.root.push(A0("w:bottom",B.bottom));if(B.end)this.root.push(A0("w:end",B.end));if(B.right)this.root.push(A0("w:right",B.right))}},AQ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{val:"w:val"})}},X9=class extends t{constructor(B){super("w:gridSpan");this.root.push(new AQ({val:D0(B)}))}},U6={CONTINUE:"continue",RESTART:"restart"},jQ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{val:"w:val"})}},N8=class extends t{constructor(B){super("w:vMerge");this.root.push(new jQ({val:B}))}},NQ={BOTTOM_TO_TOP_LEFT_TO_RIGHT:"btLr",LEFT_TO_RIGHT_TOP_TO_BOTTOM:"lrTb",TOP_TO_BOTTOM_RIGHT_TO_LEFT:"tbRl"},zQ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{val:"w:val"})}},R9=class extends t{constructor(B){super("w:textDirection");this.root.push(new zQ({val:B}))}},L9=class extends R2{constructor(B){super("w:tcPr",B.includeIfEmpty);if(B.width)this.root.push(J1("w:tcW",B.width));if(B.columnSpan)this.root.push(new X9(B.columnSpan));if(B.verticalMerge)this.root.push(new N8(B.verticalMerge));else if(B.rowSpan&&B.rowSpan>1)this.root.push(new N8(U6.RESTART));if(B.borders)this.root.push(new M9(B.borders));if(B.shading)this.root.push(X1(B.shading));if(B.margins){let U=wQ(B.margins);if(U)this.root.push(U)}if(B.textDirection)this.root.push(new R9(B.textDirection));if(B.verticalAlign)this.root.push(B6(B.verticalAlign));if(B.insertion)this.root.push(new Y9(B.insertion));if(B.deletion)this.root.push(new Z9(B.deletion));if(B.revision)this.root.push(new EQ(B.revision));if(B.cellMerge)this.root.push(new J9(B.cellMerge))}},EQ=class extends t{constructor(B){super("w:tcPrChange");this.root.push(new b0({id:B.id,author:B.author,date:B.date})),this.root.push(new L9(L0(L0({},B),{},{includeIfEmpty:!0})))}},G6=class extends t{constructor(B){super("w:tc");e(this,"options",void 0),this.options=B,this.root.push(new L9(B));for(let U of B.children)this.root.push(U)}prepForXml(B){if(!(this.root[this.root.length-1]instanceof d0))this.root.push(new d0({}));return super.prepForXml(B)}},v2={style:d1.NONE,size:0,color:"auto"},y2={style:d1.SINGLE,size:4,color:"auto"},Y6=class extends t{constructor(B){var U,G,Y,Q,K,Z;super("w:tblBorders");this.root.push(A0("w:top",(U=B.top)!==null&&U!==void 0?U:y2)),this.root.push(A0("w:left",(G=B.left)!==null&&G!==void 0?G:y2)),this.root.push(A0("w:bottom",(Y=B.bottom)!==null&&Y!==void 0?Y:y2)),this.root.push(A0("w:right",(Q=B.right)!==null&&Q!==void 0?Q:y2)),this.root.push(A0("w:insideH",(K=B.insideHorizontal)!==null&&K!==void 0?K:y2)),this.root.push(A0("w:insideV",(Z=B.insideVertical)!==null&&Z!==void 0?Z:y2))}};e(Y6,"NONE",{top:v2,bottom:v2,left:v2,right:v2,insideHorizontal:v2,insideVertical:v2});var TQ={MARGIN:"margin",PAGE:"page",TEXT:"text"},DQ={CENTER:"center",INSIDE:"inside",LEFT:"left",OUTSIDE:"outside",RIGHT:"right"},CQ={CENTER:"center",INSIDE:"inside",BOTTOM:"bottom",OUTSIDE:"outside",INLINE:"inline",TOP:"top"},kQ={NEVER:"never",OVERLAP:"overlap"},$Q=(B)=>new X0({name:"w:tblOverlap",attributes:{val:{key:"w:val",value:B}}}),I9=({horizontalAnchor:B,verticalAnchor:U,absoluteHorizontalPosition:G,relativeHorizontalPosition:Y,absoluteVerticalPosition:Q,relativeVerticalPosition:K,bottomFromText:Z,topFromText:J,leftFromText:M,rightFromText:W,overlap:I})=>new X0({name:"w:tblpPr",attributes:{leftFromText:{key:"w:leftFromText",value:M===void 0?void 0:E0(M)},rightFromText:{key:"w:rightFromText",value:W===void 0?void 0:E0(W)},topFromText:{key:"w:topFromText",value:J===void 0?void 0:E0(J)},bottomFromText:{key:"w:bottomFromText",value:Z===void 0?void 0:E0(Z)},absoluteHorizontalPosition:{key:"w:tblpX",value:G===void 0?void 0:t0(G)},absoluteVerticalPosition:{key:"w:tblpY",value:Q===void 0?void 0:t0(Q)},horizontalAnchor:{key:"w:horzAnchor",value:B},relativeHorizontalPosition:{key:"w:tblpXSpec",value:Y},relativeVerticalPosition:{key:"w:tblpYSpec",value:K},verticalAnchor:{key:"w:vertAnchor",value:U}},children:I?[$Q(I)]:void 0}),SQ={AUTOFIT:"autofit",FIXED:"fixed"},O9=(B)=>new X0({name:"w:tblLayout",attributes:{type:{key:"w:type",value:B}}}),bQ={DXA:"dxa",NIL:"nil"},F9=({type:B=bQ.DXA,value:U})=>new X0({name:"w:tblCellSpacing",attributes:{type:{key:"w:type",value:B},value:{key:"w:w",value:d8(U)}}}),H9=({firstRow:B,lastRow:U,firstColumn:G,lastColumn:Y,noHBand:Q,noVBand:K})=>new X0({name:"w:tblLook",attributes:{firstRow:{key:"w:firstRow",value:B},lastRow:{key:"w:lastRow",value:U},firstColumn:{key:"w:firstColumn",value:G},lastColumn:{key:"w:lastColumn",value:Y},noHBand:{key:"w:noHBand",value:Q},noVBand:{key:"w:noVBand",value:K}}}),Z6=class extends R2{constructor(B){super("w:tblPr",B.includeIfEmpty);if(B.style)this.root.push(new M2("w:tblStyle",B.style));if(B.float)this.root.push(I9(B.float));if(B.visuallyRightToLeft!==void 0)this.root.push(new M0("w:bidiVisual",B.visuallyRightToLeft));if(B.width)this.root.push(J1("w:tblW",B.width));if(B.alignment)this.root.push(c8(B.alignment));if(B.indent)this.root.push(J1("w:tblInd",B.indent));if(B.borders)this.root.push(new Y6(B.borders));if(B.shading)this.root.push(X1(B.shading));if(B.layout)this.root.push(O9(B.layout));if(B.cellMargin){let U=PQ(B.cellMargin);if(U)this.root.push(U)}if(B.tableLook)this.root.push(H9(B.tableLook));if(B.cellSpacing)this.root.push(F9(B.cellSpacing));if(B.revision)this.root.push(new vQ(B.revision))}},vQ=class extends t{constructor(B){super("w:tblPrChange");this.root.push(new b0({id:B.id,author:B.author,date:B.date})),this.root.push(new Z6(L0(L0({},B),{},{includeIfEmpty:!0})))}},yQ=class extends F1{constructor({rows:B,width:U,columnWidths:G=Array(Math.max(...B.map((A)=>A.CellCount))).fill(100),columnWidthsRevision:Y,margins:Q,indent:K,float:Z,layout:J,style:M,borders:W,alignment:I,visuallyRightToLeft:F,tableLook:D,cellSpacing:w,revision:P}){super("w:tbl");this.root.push(new Z6({borders:W!==null&&W!==void 0?W:{},width:U!==null&&U!==void 0?U:{size:100},indent:K,float:Z,layout:J,style:M,alignment:I,cellMargin:Q,visuallyRightToLeft:F,tableLook:D,cellSpacing:w,revision:P})),this.root.push(new B9(G,Y));for(let A of B)this.root.push(A);B.forEach((A,E)=>{if(E===B.length-1)return;let C=0;A.cells.forEach((j)=>{if(j.options.rowSpan&&j.options.rowSpan>1){let v=new G6({rowSpan:j.options.rowSpan-1,columnSpan:j.options.columnSpan,borders:j.options.borders,children:[],verticalMerge:U6.CONTINUE});B[E+1].addCellToColumnIndex(v,C)}C+=j.options.columnSpan||1})})}},gQ={AUTO:"auto",ATLEAST:"atLeast",EXACT:"exact"},W9=(B,U)=>new X0({name:"w:trHeight",attributes:{value:{key:"w:val",value:E0(B)},rule:{key:"w:hRule",value:U}}}),Q6=class extends R2{constructor(B){super("w:trPr",B.includeIfEmpty);if(B.cantSplit!==void 0)this.root.push(new M0("w:cantSplit",B.cantSplit));if(B.tableHeader!==void 0)this.root.push(new M0("w:tblHeader",B.tableHeader));if(B.height)this.root.push(W9(B.height.value,B.height.rule));if(B.cellSpacing)this.root.push(F9(B.cellSpacing));if(B.insertion)this.root.push(new U9(B.insertion));if(B.deletion)this.root.push(new G9(B.deletion));if(B.revision)this.root.push(new P9(B.revision))}},P9=class extends t{constructor(B){super("w:trPrChange");this.root.push(new b0({id:B.id,author:B.author,date:B.date})),this.root.push(new Q6(L0(L0({},B),{},{includeIfEmpty:!0})))}},fQ=class extends t{constructor(B){super("w:tr");e(this,"options",void 0),this.options=B,this.root.push(new Q6(B));for(let U of B.children)this.root.push(U)}get CellCount(){return this.options.children.length}get cells(){return this.root.filter((B)=>B instanceof G6)}addCellToIndex(B,U){this.root.splice(U+1,0,B)}addCellToColumnIndex(B,U){let G=this.columnIndexToRootIndex(U,!0);this.addCellToIndex(B,G-1)}rootIndexToColumnIndex(B){if(B<1||B>=this.root.length)throw Error(`cell 'rootIndex' should between 1 to ${this.root.length-1}`);let U=0;for(let G=1;G=this.root.length)if(U)return this.root.length;else throw Error(`cell 'columnIndex' should not great than ${G-1}`);let Q=this.root[Y];Y+=1,G+=Q&&Q.options.columnSpan||1}return Y-1}},xQ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}},_Q=class extends t{constructor(){super("Properties");this.root.push(new xQ({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"}))}},hQ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{xmlns:"xmlns"})}},V2=(B,U)=>new X0({name:"Default",attributes:{contentType:{key:"ContentType",value:B},extension:{key:"Extension",value:U}}}),f0=(B,U)=>new X0({name:"Override",attributes:{contentType:{key:"ContentType",value:B},partName:{key:"PartName",value:U}}}),uQ=class extends t{constructor(){super("Types");this.root.push(new hQ({xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"})),this.root.push(V2("image/png","png")),this.root.push(V2("image/jpeg","jpeg")),this.root.push(V2("image/jpeg","jpg")),this.root.push(V2("image/bmp","bmp")),this.root.push(V2("image/gif","gif")),this.root.push(V2("image/svg+xml","svg")),this.root.push(V2("application/vnd.openxmlformats-package.relationships+xml","rels")),this.root.push(V2("application/xml","xml")),this.root.push(V2("application/vnd.openxmlformats-officedocument.obfuscatedFont","odttf")),this.root.push(f0("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml","/word/document.xml")),this.root.push(f0("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml","/word/styles.xml")),this.root.push(f0("application/vnd.openxmlformats-package.core-properties+xml","/docProps/core.xml")),this.root.push(f0("application/vnd.openxmlformats-officedocument.custom-properties+xml","/docProps/custom.xml")),this.root.push(f0("application/vnd.openxmlformats-officedocument.extended-properties+xml","/docProps/app.xml")),this.root.push(f0("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml","/word/numbering.xml")),this.root.push(f0("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml","/word/footnotes.xml")),this.root.push(f0("application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml","/word/endnotes.xml")),this.root.push(f0("application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml","/word/settings.xml")),this.root.push(f0("application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml","/word/comments.xml")),this.root.push(f0("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml","/word/fontTable.xml"))}addCommentsExtended(){this.root.push(f0("application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml","/word/commentsExtended.xml"))}addFooter(B){this.root.push(f0("application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml",`/word/footer${B}.xml`))}addHeader(B){this.root.push(f0("application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml",`/word/header${B}.xml`))}},v1={wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",xsi:"http://www.w3.org/2001/XMLSchema-instance",cx:"http://schemas.microsoft.com/office/drawing/2014/chartex",cx1:"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex",cx2:"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex",cx3:"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex",cx4:"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex",cx5:"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex",cx6:"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex",cx7:"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex",cx8:"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex",aink:"http://schemas.microsoft.com/office/drawing/2016/ink",am3d:"http://schemas.microsoft.com/office/drawing/2017/model3d",w16cex:"http://schemas.microsoft.com/office/word/2018/wordml/cex",w16cid:"http://schemas.microsoft.com/office/word/2016/wordml/cid",w16:"http://schemas.microsoft.com/office/word/2018/wordml",w16sdtdh:"http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash",w16se:"http://schemas.microsoft.com/office/word/2015/wordml/symex"},H1=class extends F0{constructor(B,U){super(L0({Ignorable:U},Object.fromEntries(B.map((G)=>[G,v1[G]]))));e(this,"xmlKeys",L0({Ignorable:"mc:Ignorable"},Object.fromEntries(Object.keys(v1).map((G)=>[G,`xmlns:${G}`]))))}},dQ=class extends t{constructor(B){super("cp:coreProperties");if(this.root.push(new H1(["cp","dc","dcterms","dcmitype","xsi"])),B.title)this.root.push(new O2("dc:title",B.title));if(B.subject)this.root.push(new O2("dc:subject",B.subject));if(B.creator)this.root.push(new O2("dc:creator",B.creator));if(B.keywords)this.root.push(new O2("cp:keywords",B.keywords));if(B.description)this.root.push(new O2("dc:description",B.description));if(B.lastModifiedBy)this.root.push(new O2("cp:lastModifiedBy",B.lastModifiedBy));if(B.revision)this.root.push(new O2("cp:revision",String(B.revision)));this.root.push(new r6("dcterms:created")),this.root.push(new r6("dcterms:modified"))}},cQ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{type:"xsi:type"})}},r6=class extends t{constructor(B){super(B);this.root.push(new cQ({type:"dcterms:W3CDTF"})),this.root.push(fB(new Date))}},mQ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{xmlns:"xmlns",vt:"xmlns:vt"})}},lQ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{formatId:"fmtid",pid:"pid",name:"name"})}},aQ=class extends t{constructor(B,U){super("property");this.root.push(new lQ({formatId:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:B.toString(),name:U.name})),this.root.push(new pQ(U.value))}},pQ=class extends t{constructor(B){super("vt:lpwstr");this.root.push(B)}},rQ=class extends t{constructor(B){super("Properties");e(this,"nextId",void 0),e(this,"properties",[]),this.root.push(new mQ({xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"})),this.nextId=2;for(let U of B)this.addCustomProperty(U)}prepForXml(B){return this.properties.forEach((U)=>this.root.push(U)),super.prepForXml(B)}addCustomProperty(B){this.properties.push(new aQ(this.nextId++,B))}},w9=({space:B,count:U,separate:G,equalWidth:Y,children:Q})=>new X0({name:"w:cols",attributes:{space:{key:"w:space",value:B===void 0?void 0:E0(B)},count:{key:"w:num",value:U===void 0?void 0:D0(U)},separate:{key:"w:sep",value:G},equalWidth:{key:"w:equalWidth",value:Y}},children:!Y&&Q?Q:void 0}),iQ={DEFAULT:"default",LINES:"lines",LINES_AND_CHARS:"linesAndChars",SNAP_TO_CHARS:"snapToChars"},A9=({type:B,linePitch:U,charSpace:G})=>new X0({name:"w:docGrid",attributes:{type:{key:"w:type",value:B},linePitch:{key:"w:linePitch",value:D0(U)},charSpace:{key:"w:charSpace",value:G?D0(G):void 0}}}),D2={DEFAULT:"default",FIRST:"first",EVEN:"even"},z8={HEADER:"w:headerReference",FOOTER:"w:footerReference"},C1=(B,U)=>new X0({name:B,attributes:{type:{key:"w:type",value:U.type||D2.DEFAULT},id:{key:"r:id",value:`rId${U.id}`}}}),nQ={NEW_PAGE:"newPage",NEW_SECTION:"newSection",CONTINUOUS:"continuous"},j9=({countBy:B,start:U,restart:G,distance:Y})=>new X0({name:"w:lnNumType",attributes:{countBy:{key:"w:countBy",value:B===void 0?void 0:D0(B)},start:{key:"w:start",value:U===void 0?void 0:D0(U)},restart:{key:"w:restart",value:G},distance:{key:"w:distance",value:Y===void 0?void 0:E0(Y)}}}),sQ={ALL_PAGES:"allPages",FIRST_PAGE:"firstPage",NOT_FIRST_PAGE:"notFirstPage"},oQ={PAGE:"page",TEXT:"text"},tQ={BACK:"back",FRONT:"front"},i6=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{display:"w:display",offsetFrom:"w:offsetFrom",zOrder:"w:zOrder"})}},N9=class extends R2{constructor(B){super("w:pgBorders");if(!B)return this;if(B.pageBorders)this.root.push(new i6({display:B.pageBorders.display,offsetFrom:B.pageBorders.offsetFrom,zOrder:B.pageBorders.zOrder}));else this.root.push(new i6({}));if(B.pageBorderTop)this.root.push(A0("w:top",B.pageBorderTop));if(B.pageBorderLeft)this.root.push(A0("w:left",B.pageBorderLeft));if(B.pageBorderBottom)this.root.push(A0("w:bottom",B.pageBorderBottom));if(B.pageBorderRight)this.root.push(A0("w:right",B.pageBorderRight))}},z9=(B,U,G,Y,Q,K,Z)=>new X0({name:"w:pgMar",attributes:{top:{key:"w:top",value:t0(B)},right:{key:"w:right",value:E0(U)},bottom:{key:"w:bottom",value:t0(G)},left:{key:"w:left",value:E0(Y)},header:{key:"w:header",value:E0(Q)},footer:{key:"w:footer",value:E0(K)},gutter:{key:"w:gutter",value:E0(Z)}}}),eQ={HYPHEN:"hyphen",PERIOD:"period",COLON:"colon",EM_DASH:"emDash",EN_DASH:"endash"},E9=({start:B,formatType:U,separator:G})=>new X0({name:"w:pgNumType",attributes:{start:{key:"w:start",value:B===void 0?void 0:D0(B)},formatType:{key:"w:fmt",value:U},separator:{key:"w:chapSep",value:G}}}),y1={PORTRAIT:"portrait",LANDSCAPE:"landscape"},T9=({width:B,height:U,orientation:G,code:Y})=>{let Q=E0(B),K=E0(U);return new X0({name:"w:pgSz",attributes:{width:{key:"w:w",value:G===y1.LANDSCAPE?K:Q},height:{key:"w:h",value:G===y1.LANDSCAPE?Q:K},orientation:{key:"w:orient",value:G},code:{key:"w:code",value:Y}}})},BJ={LEFT_TO_RIGHT_TOP_TO_BOTTOM:"lrTb",TOP_TO_BOTTOM_RIGHT_TO_LEFT:"tbRl"},UJ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{val:"w:val"})}},D9=class extends t{constructor(B){super("w:textDirection");this.root.push(new UJ({val:B}))}},GJ={NEXT_PAGE:"nextPage",NEXT_COLUMN:"nextColumn",CONTINUOUS:"continuous",EVEN_PAGE:"evenPage",ODD_PAGE:"oddPage"},C9=(B)=>new X0({name:"w:type",attributes:{val:{key:"w:val",value:B}}}),F2={TOP:1440,RIGHT:1440,BOTTOM:1440,LEFT:1440,HEADER:708,FOOTER:708,GUTTER:0},k1={WIDTH:11906,HEIGHT:16838,ORIENTATION:y1.PORTRAIT},J6=class extends t{constructor({page:{size:{width:B=k1.WIDTH,height:U=k1.HEIGHT,orientation:G=k1.ORIENTATION,code:Y}={},margin:{top:Q=F2.TOP,right:K=F2.RIGHT,bottom:Z=F2.BOTTOM,left:J=F2.LEFT,header:M=F2.HEADER,footer:W=F2.FOOTER,gutter:I=F2.GUTTER}={},pageNumbers:F={},borders:D,textDirection:w}={},grid:{linePitch:P=360,charSpace:A,type:E}={},headerWrapperGroup:C={},footerWrapperGroup:j={},lineNumbers:v,titlePage:S,verticalAlign:H,column:X,type:$,revision:x}={}){super("w:sectPr");if(this.addHeaderFooterGroup(z8.HEADER,C),this.addHeaderFooterGroup(z8.FOOTER,j),$)this.root.push(C9($));if(this.root.push(T9({width:B,height:U,orientation:G,code:Y})),this.root.push(z9(Q,K,Z,J,M,W,I)),D)this.root.push(new N9(D));if(v)this.root.push(j9(v));if(this.root.push(E9(F)),X)this.root.push(w9(X));if(H)this.root.push(B6(H));if(S!==void 0)this.root.push(new M0("w:titlePg",S));if(w)this.root.push(new D9(w));if(x)this.root.push(new k9(x));this.root.push(A9({linePitch:P,charSpace:A,type:E}))}addHeaderFooterGroup(B,U){if(U.default)this.root.push(C1(B,{type:D2.DEFAULT,id:U.default.View.ReferenceId}));if(U.first)this.root.push(C1(B,{type:D2.FIRST,id:U.first.View.ReferenceId}));if(U.even)this.root.push(C1(B,{type:D2.EVEN,id:U.even.View.ReferenceId}))}},k9=class extends t{constructor(B){super("w:sectPrChange");this.root.push(new b0({id:B.id,author:B.author,date:B.date})),this.root.push(new J6(B))}},YJ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{width:"w:w",space:"w:space"})}},ZJ=class extends t{constructor(B){super("w:col");this.root.push(new YJ({width:E0(B.width),space:B.space===void 0?void 0:E0(B.space)}))}},$9=class extends t{constructor(){super("w:body");e(this,"sections",[])}addSection(B){let U=this.sections.pop();this.root.push(this.createSectionParagraph(U)),this.sections.push(new J6(B))}prepForXml(B){if(this.sections.length===1)this.root.splice(0,1),this.root.push(this.sections.pop());return super.prepForXml(B)}push(B){this.root.push(B)}createSectionParagraph(B){let U=new d0({}),G=new X2({});return G.push(B),U.addChildElement(G),U}},S9=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{color:"w:color",themeColor:"w:themeColor",themeShade:"w:themeShade",themeTint:"w:themeTint"})}},b9=class extends t{constructor(B){super("w:background");this.root.push(new S9({color:B.color===void 0?void 0:C2(B.color),themeColor:B.themeColor,themeShade:B.themeShade===void 0?void 0:H8(B.themeShade),themeTint:B.themeTint===void 0?void 0:H8(B.themeTint)}))}},QJ=class extends t{constructor(B){super("w:document");if(e(this,"body",void 0),this.root.push(new H1(["wpc","mc","o","r","m","v","wp14","wp","w10","w","w14","w15","wpg","wpi","wne","wps","cx","cx1","cx2","cx3","cx4","cx5","cx6","cx7","cx8","aink","am3d","w16cex","w16cid","w16","w16sdtdh","w16se"],"w14 w15 wp14")),this.body=new $9,B.background)this.root.push(new b9(B.background));this.root.push(this.body)}add(B){return this.body.push(B),this}get Body(){return this.body}},JJ=class{constructor(B){e(this,"document",void 0),e(this,"relationships",void 0),this.document=new QJ(B),this.relationships=new w2}get View(){return this.document}get Relationships(){return this.relationships}},KJ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}},VJ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{type:"w:type",id:"w:id"})}},qJ=class extends T0{constructor(){super({style:"EndnoteReference"});this.root.push(new T4)}},n6={SEPARATOR:"separator",CONTINUATION_SEPARATOR:"continuationSeparator"},V8=class extends t{constructor(B){super("w:endnote");this.root.push(new VJ({type:B.type,id:B.id}));for(let U=0;U9)throw Error("Level cannot be greater than 9. Read more here: https://answers.microsoft.com/en-us/msoffice/forum/all/does-word-support-more-than-9-list-levels/d130fdcd-1781-446d-8c84-c6c79124e4d7");this.root.push(new NJ({ilvl:D0(B),tentative:1}))}},h9=class extends V6{},$J=class extends V6{},SJ=class extends t{constructor(B){super("w:multiLevelType");this.root.push(new C0({val:B}))}},bJ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{abstractNumId:"w:abstractNumId",restartNumberingAfterBreak:"w15:restartNumberingAfterBreak"})}},E8=class extends t{constructor(B,U){super("w:abstractNum");e(this,"id",void 0),this.root.push(new bJ({abstractNumId:D0(B),restartNumberingAfterBreak:0})),this.root.push(new SJ("hybridMultilevel")),this.id=B;for(let G of U)this.root.push(new h9(G))}},vJ=class extends t{constructor(B){super("w:abstractNumId");this.root.push(new C0({val:B}))}},yJ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{numId:"w:numId"})}},T8=class extends t{constructor(B){super("w:num");if(e(this,"numId",void 0),e(this,"reference",void 0),e(this,"instance",void 0),this.numId=B.numId,this.reference=B.reference,this.instance=B.instance,this.root.push(new yJ({numId:D0(B.numId)})),this.root.push(new vJ(D0(B.abstractNumId))),B.overrideLevels&&B.overrideLevels.length)for(let U of B.overrideLevels)this.root.push(new u9(U.num,U.start))}},gJ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{ilvl:"w:ilvl"})}},u9=class extends t{constructor(B,U){super("w:lvlOverride");if(this.root.push(new gJ({ilvl:B})),U!==void 0)this.root.push(new xJ(U))}},fJ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{val:"w:val"})}},xJ=class extends t{constructor(B){super("w:startOverride");this.root.push(new fJ({val:B}))}},d9=class extends t{constructor(B){super("w:numbering");e(this,"abstractNumberingMap",new Map),e(this,"concreteNumberingMap",new Map),e(this,"referenceConfigMap",new Map),e(this,"abstractNumUniqueNumericId",nB()),e(this,"concreteNumUniqueNumericId",sB()),this.root.push(new H1(["wpc","mc","o","r","m","v","wp14","wp","w10","w","w14","w15","wpg","wpi","wne","wps"],"w14 w15 wp14"));let U=new E8(this.abstractNumUniqueNumericId(),[{level:0,format:i0.BULLET,text:"●",alignment:c0.LEFT,style:{paragraph:{indent:{left:u0(0.5),hanging:u0(0.25)}}}},{level:1,format:i0.BULLET,text:"○",alignment:c0.LEFT,style:{paragraph:{indent:{left:u0(1),hanging:u0(0.25)}}}},{level:2,format:i0.BULLET,text:"■",alignment:c0.LEFT,style:{paragraph:{indent:{left:2160,hanging:u0(0.25)}}}},{level:3,format:i0.BULLET,text:"●",alignment:c0.LEFT,style:{paragraph:{indent:{left:2880,hanging:u0(0.25)}}}},{level:4,format:i0.BULLET,text:"○",alignment:c0.LEFT,style:{paragraph:{indent:{left:3600,hanging:u0(0.25)}}}},{level:5,format:i0.BULLET,text:"■",alignment:c0.LEFT,style:{paragraph:{indent:{left:4320,hanging:u0(0.25)}}}},{level:6,format:i0.BULLET,text:"●",alignment:c0.LEFT,style:{paragraph:{indent:{left:5040,hanging:u0(0.25)}}}},{level:7,format:i0.BULLET,text:"●",alignment:c0.LEFT,style:{paragraph:{indent:{left:5760,hanging:u0(0.25)}}}},{level:8,format:i0.BULLET,text:"●",alignment:c0.LEFT,style:{paragraph:{indent:{left:6480,hanging:u0(0.25)}}}}]);this.concreteNumberingMap.set("default-bullet-numbering",new T8({numId:1,abstractNumId:U.id,reference:"default-bullet-numbering",instance:0,overrideLevels:[{num:0,start:1}]})),this.abstractNumberingMap.set("default-bullet-numbering",U);for(let G of B.config)this.abstractNumberingMap.set(G.reference,new E8(this.abstractNumUniqueNumericId(),G.levels)),this.referenceConfigMap.set(G.reference,G.levels)}prepForXml(B){for(let U of this.abstractNumberingMap.values())this.root.push(U);for(let U of this.concreteNumberingMap.values())this.root.push(U);return super.prepForXml(B)}createConcreteNumberingInstance(B,U){let G=this.abstractNumberingMap.get(B);if(!G)return;let Y=`${B}-${U}`;if(this.concreteNumberingMap.has(Y))return;let Q=this.referenceConfigMap.get(B),K=Q&&Q[0].start,Z={numId:this.concreteNumUniqueNumericId(),abstractNumId:G.id,reference:B,instance:U,overrideLevels:[typeof K==="number"&&Number.isInteger(K)?{num:0,start:K}:{num:0,start:1}]};this.concreteNumberingMap.set(Y,new T8(Z))}get ConcreteNumbering(){return Array.from(this.concreteNumberingMap.values())}get ReferenceConfig(){return Array.from(this.referenceConfigMap.values())}},_J=(B)=>new X0({name:"w:compatSetting",attributes:{version:{key:"w:val",value:B},name:{key:"w:name",value:"compatibilityMode"},uri:{key:"w:uri",value:"http://schemas.microsoft.com/office/word"}}}),hJ=class extends t{constructor(B){super("w:compat");if(B.version)this.root.push(_J(B.version));if(B.useSingleBorderforContiguousCells)this.root.push(new M0("w:useSingleBorderforContiguousCells",B.useSingleBorderforContiguousCells));if(B.wordPerfectJustification)this.root.push(new M0("w:wpJustification",B.wordPerfectJustification));if(B.noTabStopForHangingIndent)this.root.push(new M0("w:noTabHangInd",B.noTabStopForHangingIndent));if(B.noLeading)this.root.push(new M0("w:noLeading",B.noLeading));if(B.spaceForUnderline)this.root.push(new M0("w:spaceForUL",B.spaceForUnderline));if(B.noColumnBalance)this.root.push(new M0("w:noColumnBalance",B.noColumnBalance));if(B.balanceSingleByteDoubleByteWidth)this.root.push(new M0("w:balanceSingleByteDoubleByteWidth",B.balanceSingleByteDoubleByteWidth));if(B.noExtraLineSpacing)this.root.push(new M0("w:noExtraLineSpacing",B.noExtraLineSpacing));if(B.doNotLeaveBackslashAlone)this.root.push(new M0("w:doNotLeaveBackslashAlone",B.doNotLeaveBackslashAlone));if(B.underlineTrailingSpaces)this.root.push(new M0("w:ulTrailSpace",B.underlineTrailingSpaces));if(B.doNotExpandShiftReturn)this.root.push(new M0("w:doNotExpandShiftReturn",B.doNotExpandShiftReturn));if(B.spacingInWholePoints)this.root.push(new M0("w:spacingInWholePoints",B.spacingInWholePoints));if(B.lineWrapLikeWord6)this.root.push(new M0("w:lineWrapLikeWord6",B.lineWrapLikeWord6));if(B.printBodyTextBeforeHeader)this.root.push(new M0("w:printBodyTextBeforeHeader",B.printBodyTextBeforeHeader));if(B.printColorsBlack)this.root.push(new M0("w:printColBlack",B.printColorsBlack));if(B.spaceWidth)this.root.push(new M0("w:wpSpaceWidth",B.spaceWidth));if(B.showBreaksInFrames)this.root.push(new M0("w:showBreaksInFrames",B.showBreaksInFrames));if(B.subFontBySize)this.root.push(new M0("w:subFontBySize",B.subFontBySize));if(B.suppressBottomSpacing)this.root.push(new M0("w:suppressBottomSpacing",B.suppressBottomSpacing));if(B.suppressTopSpacing)this.root.push(new M0("w:suppressTopSpacing",B.suppressTopSpacing));if(B.suppressSpacingAtTopOfPage)this.root.push(new M0("w:suppressSpacingAtTopOfPage",B.suppressSpacingAtTopOfPage));if(B.suppressTopSpacingWP)this.root.push(new M0("w:suppressTopSpacingWP",B.suppressTopSpacingWP));if(B.suppressSpBfAfterPgBrk)this.root.push(new M0("w:suppressSpBfAfterPgBrk",B.suppressSpBfAfterPgBrk));if(B.swapBordersFacingPages)this.root.push(new M0("w:swapBordersFacingPages",B.swapBordersFacingPages));if(B.convertMailMergeEsc)this.root.push(new M0("w:convMailMergeEsc",B.convertMailMergeEsc));if(B.truncateFontHeightsLikeWP6)this.root.push(new M0("w:truncateFontHeightsLikeWP6",B.truncateFontHeightsLikeWP6));if(B.macWordSmallCaps)this.root.push(new M0("w:mwSmallCaps",B.macWordSmallCaps));if(B.usePrinterMetrics)this.root.push(new M0("w:usePrinterMetrics",B.usePrinterMetrics));if(B.doNotSuppressParagraphBorders)this.root.push(new M0("w:doNotSuppressParagraphBorders",B.doNotSuppressParagraphBorders));if(B.wrapTrailSpaces)this.root.push(new M0("w:wrapTrailSpaces",B.wrapTrailSpaces));if(B.footnoteLayoutLikeWW8)this.root.push(new M0("w:footnoteLayoutLikeWW8",B.footnoteLayoutLikeWW8));if(B.shapeLayoutLikeWW8)this.root.push(new M0("w:shapeLayoutLikeWW8",B.shapeLayoutLikeWW8));if(B.alignTablesRowByRow)this.root.push(new M0("w:alignTablesRowByRow",B.alignTablesRowByRow));if(B.forgetLastTabAlignment)this.root.push(new M0("w:forgetLastTabAlignment",B.forgetLastTabAlignment));if(B.adjustLineHeightInTable)this.root.push(new M0("w:adjustLineHeightInTable",B.adjustLineHeightInTable));if(B.autoSpaceLikeWord95)this.root.push(new M0("w:autoSpaceLikeWord95",B.autoSpaceLikeWord95));if(B.noSpaceRaiseLower)this.root.push(new M0("w:noSpaceRaiseLower",B.noSpaceRaiseLower));if(B.doNotUseHTMLParagraphAutoSpacing)this.root.push(new M0("w:doNotUseHTMLParagraphAutoSpacing",B.doNotUseHTMLParagraphAutoSpacing));if(B.layoutRawTableWidth)this.root.push(new M0("w:layoutRawTableWidth",B.layoutRawTableWidth));if(B.layoutTableRowsApart)this.root.push(new M0("w:layoutTableRowsApart",B.layoutTableRowsApart));if(B.useWord97LineBreakRules)this.root.push(new M0("w:useWord97LineBreakRules",B.useWord97LineBreakRules));if(B.doNotBreakWrappedTables)this.root.push(new M0("w:doNotBreakWrappedTables",B.doNotBreakWrappedTables));if(B.doNotSnapToGridInCell)this.root.push(new M0("w:doNotSnapToGridInCell",B.doNotSnapToGridInCell));if(B.selectFieldWithFirstOrLastCharacter)this.root.push(new M0("w:selectFldWithFirstOrLastChar",B.selectFieldWithFirstOrLastCharacter));if(B.applyBreakingRules)this.root.push(new M0("w:applyBreakingRules",B.applyBreakingRules));if(B.doNotWrapTextWithPunctuation)this.root.push(new M0("w:doNotWrapTextWithPunct",B.doNotWrapTextWithPunctuation));if(B.doNotUseEastAsianBreakRules)this.root.push(new M0("w:doNotUseEastAsianBreakRules",B.doNotUseEastAsianBreakRules));if(B.useWord2002TableStyleRules)this.root.push(new M0("w:useWord2002TableStyleRules",B.useWord2002TableStyleRules));if(B.growAutofit)this.root.push(new M0("w:growAutofit",B.growAutofit));if(B.useFELayout)this.root.push(new M0("w:useFELayout",B.useFELayout));if(B.useNormalStyleForList)this.root.push(new M0("w:useNormalStyleForList",B.useNormalStyleForList));if(B.doNotUseIndentAsNumberingTabStop)this.root.push(new M0("w:doNotUseIndentAsNumberingTabStop",B.doNotUseIndentAsNumberingTabStop));if(B.useAlternateEastAsianLineBreakRules)this.root.push(new M0("w:useAltKinsokuLineBreakRules",B.useAlternateEastAsianLineBreakRules));if(B.allowSpaceOfSameStyleInTable)this.root.push(new M0("w:allowSpaceOfSameStyleInTable",B.allowSpaceOfSameStyleInTable));if(B.doNotSuppressIndentation)this.root.push(new M0("w:doNotSuppressIndentation",B.doNotSuppressIndentation));if(B.doNotAutofitConstrainedTables)this.root.push(new M0("w:doNotAutofitConstrainedTables",B.doNotAutofitConstrainedTables));if(B.autofitToFirstFixedWidthCell)this.root.push(new M0("w:autofitToFirstFixedWidthCell",B.autofitToFirstFixedWidthCell));if(B.underlineTabInNumberingList)this.root.push(new M0("w:underlineTabInNumList",B.underlineTabInNumberingList));if(B.displayHangulFixedWidth)this.root.push(new M0("w:displayHangulFixedWidth",B.displayHangulFixedWidth));if(B.splitPgBreakAndParaMark)this.root.push(new M0("w:splitPgBreakAndParaMark",B.splitPgBreakAndParaMark));if(B.doNotVerticallyAlignCellWithSp)this.root.push(new M0("w:doNotVertAlignCellWithSp",B.doNotVerticallyAlignCellWithSp));if(B.doNotBreakConstrainedForcedTable)this.root.push(new M0("w:doNotBreakConstrainedForcedTable",B.doNotBreakConstrainedForcedTable));if(B.ignoreVerticalAlignmentInTextboxes)this.root.push(new M0("w:doNotVertAlignInTxbx",B.ignoreVerticalAlignmentInTextboxes));if(B.useAnsiKerningPairs)this.root.push(new M0("w:useAnsiKerningPairs",B.useAnsiKerningPairs));if(B.cachedColumnBalance)this.root.push(new M0("w:cachedColBalance",B.cachedColumnBalance))}},uJ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{wpc:"xmlns:wpc",mc:"xmlns:mc",o:"xmlns:o",r:"xmlns:r",m:"xmlns:m",v:"xmlns:v",wp14:"xmlns:wp14",wp:"xmlns:wp",w10:"xmlns:w10",w:"xmlns:w",w14:"xmlns:w14",w15:"xmlns:w15",wpg:"xmlns:wpg",wpi:"xmlns:wpi",wne:"xmlns:wne",wps:"xmlns:wps",Ignorable:"mc:Ignorable"})}},dJ=class extends t{constructor(B){var U,G,Y,Q,K,Z,J,M;super("w:settings");if(this.root.push(new uJ({wpc:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",mc:"http://schemas.openxmlformats.org/markup-compatibility/2006",o:"urn:schemas-microsoft-com:office:office",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",m:"http://schemas.openxmlformats.org/officeDocument/2006/math",v:"urn:schemas-microsoft-com:vml",wp14:"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",w10:"urn:schemas-microsoft-com:office:word",w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",w14:"http://schemas.microsoft.com/office/word/2010/wordml",w15:"http://schemas.microsoft.com/office/word/2012/wordml",wpg:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wpi:"http://schemas.microsoft.com/office/word/2010/wordprocessingInk",wne:"http://schemas.microsoft.com/office/word/2006/wordml",wps:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",Ignorable:"w14 w15 wp14"})),this.root.push(new M0("w:displayBackgroundShape",!0)),B.trackRevisions!==void 0)this.root.push(new M0("w:trackRevisions",B.trackRevisions));if(B.evenAndOddHeaders!==void 0)this.root.push(new M0("w:evenAndOddHeaders",B.evenAndOddHeaders));if(B.updateFields!==void 0)this.root.push(new M0("w:updateFields",B.updateFields));if(B.defaultTabStop!==void 0)this.root.push(new _2("w:defaultTabStop",B.defaultTabStop));if(((U=B.hyphenation)===null||U===void 0?void 0:U.autoHyphenation)!==void 0)this.root.push(new M0("w:autoHyphenation",B.hyphenation.autoHyphenation));if(((G=B.hyphenation)===null||G===void 0?void 0:G.hyphenationZone)!==void 0)this.root.push(new _2("w:hyphenationZone",B.hyphenation.hyphenationZone));if(((Y=B.hyphenation)===null||Y===void 0?void 0:Y.consecutiveHyphenLimit)!==void 0)this.root.push(new _2("w:consecutiveHyphenLimit",B.hyphenation.consecutiveHyphenLimit));if(((Q=B.hyphenation)===null||Q===void 0?void 0:Q.doNotHyphenateCaps)!==void 0)this.root.push(new M0("w:doNotHyphenateCaps",B.hyphenation.doNotHyphenateCaps));this.root.push(new hJ(L0(L0({},(K=B.compatibility)!==null&&K!==void 0?K:{}),{},{version:(Z=(J=(M=B.compatibility)===null||M===void 0?void 0:M.version)!==null&&J!==void 0?J:B.compatibilityModeVersion)!==null&&Z!==void 0?Z:15})))}},c9=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{val:"w:val"})}},cJ=class extends t{constructor(B){super("w:name");this.root.push(new c9({val:B}))}},mJ=class extends t{constructor(B){super("w:uiPriority");this.root.push(new c9({val:D0(B)}))}},lJ=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{type:"w:type",styleId:"w:styleId",default:"w:default",customStyle:"w:customStyle"})}},m9=class extends t{constructor(B,U){super("w:style");if(this.root.push(new lJ(B)),U.name)this.root.push(new cJ(U.name));if(U.basedOn)this.root.push(new M2("w:basedOn",U.basedOn));if(U.next)this.root.push(new M2("w:next",U.next));if(U.link)this.root.push(new M2("w:link",U.link));if(U.uiPriority!==void 0)this.root.push(new mJ(U.uiPriority));if(U.semiHidden!==void 0)this.root.push(new M0("w:semiHidden",U.semiHidden));if(U.unhideWhenUsed!==void 0)this.root.push(new M0("w:unhideWhenUsed",U.unhideWhenUsed));if(U.quickFormat!==void 0)this.root.push(new M0("w:qFormat",U.quickFormat))}},p2=class extends m9{constructor(B){super({type:"paragraph",styleId:B.id},B);e(this,"paragraphProperties",void 0),e(this,"runProperties",void 0),this.paragraphProperties=new X2(B.paragraph),this.runProperties=new U2(B.run),this.root.push(this.paragraphProperties),this.root.push(this.runProperties)}},$2=class extends m9{constructor(B){super({type:"character",styleId:B.id},L0({uiPriority:99,unhideWhenUsed:!0},B));e(this,"runProperties",void 0),this.runProperties=new U2(B.run),this.root.push(this.runProperties)}},A2=class extends p2{constructor(B){super(L0({basedOn:"Normal",next:"Normal",quickFormat:!0},B))}},aJ=class extends A2{constructor(B){super(L0({id:"Title",name:"Title"},B))}},pJ=class extends A2{constructor(B){super(L0({id:"Heading1",name:"Heading 1"},B))}},rJ=class extends A2{constructor(B){super(L0({id:"Heading2",name:"Heading 2"},B))}},iJ=class extends A2{constructor(B){super(L0({id:"Heading3",name:"Heading 3"},B))}},nJ=class extends A2{constructor(B){super(L0({id:"Heading4",name:"Heading 4"},B))}},sJ=class extends A2{constructor(B){super(L0({id:"Heading5",name:"Heading 5"},B))}},oJ=class extends A2{constructor(B){super(L0({id:"Heading6",name:"Heading 6"},B))}},tJ=class extends A2{constructor(B){super(L0({id:"Strong",name:"Strong"},B))}},eJ=class extends p2{constructor(B){super(L0({id:"ListParagraph",name:"List Paragraph",basedOn:"Normal",quickFormat:!0},B))}},BK=class extends p2{constructor(B){super(L0({id:"FootnoteText",name:"footnote text",link:"FootnoteTextChar",basedOn:"Normal",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0,paragraph:{spacing:{after:0,line:240,lineRule:k2.AUTO}},run:{size:20}},B))}},UK=class extends $2{constructor(B){super(L0({id:"FootnoteReference",name:"footnote reference",basedOn:"DefaultParagraphFont",semiHidden:!0,run:{superScript:!0}},B))}},GK=class extends $2{constructor(B){super(L0({id:"FootnoteTextChar",name:"Footnote Text Char",basedOn:"DefaultParagraphFont",link:"FootnoteText",semiHidden:!0,run:{size:20}},B))}},YK=class extends p2{constructor(B){super(L0({id:"EndnoteText",name:"endnote text",link:"EndnoteTextChar",basedOn:"Normal",uiPriority:99,semiHidden:!0,unhideWhenUsed:!0,paragraph:{spacing:{after:0,line:240,lineRule:k2.AUTO}},run:{size:20}},B))}},ZK=class extends $2{constructor(B){super(L0({id:"EndnoteReference",name:"endnote reference",basedOn:"DefaultParagraphFont",semiHidden:!0,run:{superScript:!0}},B))}},QK=class extends $2{constructor(B){super(L0({id:"EndnoteTextChar",name:"Endnote Text Char",basedOn:"DefaultParagraphFont",link:"EndnoteText",semiHidden:!0,run:{size:20}},B))}},JK=class extends $2{constructor(B){super(L0({id:"Hyperlink",name:"Hyperlink",basedOn:"DefaultParagraphFont",run:{color:"0563C1",underline:{type:r8.SINGLE}}},B))}},$1=class extends t{constructor(B){super("w:styles");if(B.initialStyles)this.root.push(B.initialStyles);if(B.importedStyles)for(let U of B.importedStyles)this.root.push(U);if(B.paragraphStyles)for(let U of B.paragraphStyles)this.root.push(new p2(U));if(B.characterStyles)for(let U of B.characterStyles)this.root.push(new $2(U))}},l9=class extends t{constructor(B){super("w:pPrDefault");this.root.push(new X2(B))}},a9=class extends t{constructor(B){super("w:rPrDefault");this.root.push(new U2(B))}},p9=class extends t{constructor(B){super("w:docDefaults");e(this,"runPropertiesDefaults",void 0),e(this,"paragraphPropertiesDefaults",void 0),this.runPropertiesDefaults=new a9(B.run),this.paragraphPropertiesDefaults=new l9(B.paragraph),this.root.push(this.runPropertiesDefaults),this.root.push(this.paragraphPropertiesDefaults)}},KK=class{newInstance(B){let U=(0,_1.xml2js)(B,{compact:!1}),G;for(let Q of U.elements||[])if(Q.name==="w:styles")G=Q;if(G===void 0)throw Error("can not find styles element");let Y=G.elements||[];return{initialStyles:new $B(G.attributes),importedStyles:Y.map((Q)=>h1(Q))}}},M8=class{newInstance(B={}){var U;return{initialStyles:new H1(["mc","r","w","w14","w15"],"w14 w15"),importedStyles:[new p9((U=B.document)!==null&&U!==void 0?U:{}),new aJ(L0({run:{size:56}},B.title)),new pJ(L0({run:{color:"2E74B5",size:32}},B.heading1)),new rJ(L0({run:{color:"2E74B5",size:26}},B.heading2)),new iJ(L0({run:{color:"1F4D78",size:24}},B.heading3)),new nJ(L0({run:{color:"2E74B5",italics:!0}},B.heading4)),new sJ(L0({run:{color:"2E74B5"}},B.heading5)),new oJ(L0({run:{color:"1F4D78"}},B.heading6)),new tJ(L0({run:{bold:!0}},B.strong)),new eJ(B.listParagraph||{}),new JK(B.hyperlink||{}),new UK(B.footnoteReference||{}),new BK(B.footnoteText||{}),new GK(B.footnoteTextChar||{}),new ZK(B.endnoteReference||{}),new YK(B.endnoteText||{}),new QK(B.endnoteTextChar||{})]}}},VK=class{constructor(B){var U,G,Y,Q,K,Z,J,M,W,I,F,D;if(e(this,"currentRelationshipId",1),e(this,"documentWrapper",void 0),e(this,"headers",[]),e(this,"footers",[]),e(this,"coreProperties",void 0),e(this,"numbering",void 0),e(this,"media",void 0),e(this,"fileRelationships",void 0),e(this,"footnotesWrapper",void 0),e(this,"endnotesWrapper",void 0),e(this,"settings",void 0),e(this,"contentTypes",void 0),e(this,"customProperties",void 0),e(this,"appProperties",void 0),e(this,"styles",void 0),e(this,"comments",void 0),e(this,"commentsExtended",void 0),e(this,"fontWrapper",void 0),this.coreProperties=new dQ(L0(L0({},B),{},{creator:(U=B.creator)!==null&&U!==void 0?U:"Un-named",revision:(G=B.revision)!==null&&G!==void 0?G:1,lastModifiedBy:(Y=B.lastModifiedBy)!==null&&Y!==void 0?Y:"Un-named"})),this.numbering=new d9(B.numbering?B.numbering:{config:[]}),this.comments=new z4((Q=B.comments)!==null&&Q!==void 0?Q:{children:[]}),this.comments.ThreadData)this.commentsExtended=new E4(this.comments.ThreadData);if(this.fileRelationships=new w2,this.customProperties=new rQ((K=B.customProperties)!==null&&K!==void 0?K:[]),this.appProperties=new _Q,this.footnotesWrapper=new PJ,this.endnotesWrapper=new RJ,this.contentTypes=new uQ,this.documentWrapper=new JJ({background:B.background}),this.settings=new dJ({compatibilityModeVersion:B.compatabilityModeVersion,compatibility:B.compatibility,evenAndOddHeaders:B.evenAndOddHeaderAndFooters?!0:!1,trackRevisions:(Z=B.features)===null||Z===void 0?void 0:Z.trackRevisions,updateFields:(J=B.features)===null||J===void 0?void 0:J.updateFields,defaultTabStop:B.defaultTabStop,hyphenation:{autoHyphenation:(M=B.hyphenation)===null||M===void 0?void 0:M.autoHyphenation,hyphenationZone:(W=B.hyphenation)===null||W===void 0?void 0:W.hyphenationZone,consecutiveHyphenLimit:(I=B.hyphenation)===null||I===void 0?void 0:I.consecutiveHyphenLimit,doNotHyphenateCaps:(F=B.hyphenation)===null||F===void 0?void 0:F.doNotHyphenateCaps}}),this.media=new K6,B.externalStyles!==void 0){var w;let P=new M8().newInstance((w=B.styles)===null||w===void 0?void 0:w.default),A=new KK().newInstance(B.externalStyles);this.styles=new $1(L0(L0({},A),{},{importedStyles:[...P.importedStyles,...A.importedStyles]}))}else if(B.styles){let P=new M8().newInstance(B.styles.default);this.styles=new $1(L0(L0({},P),B.styles))}else{let P=new M8;this.styles=new $1(P.newInstance())}this.addDefaultRelationships();for(let P of B.sections)this.addSection(P);if(B.footnotes)for(let P in B.footnotes)this.footnotesWrapper.View.createFootNote(parseFloat(P),B.footnotes[P].children);if(B.endnotes)for(let P in B.endnotes)this.endnotesWrapper.View.createEndnote(parseFloat(P),B.endnotes[P].children);this.fontWrapper=new h4((D=B.fonts)!==null&&D!==void 0?D:[])}addSection({headers:B={},footers:U={},children:G,properties:Y}){this.documentWrapper.View.Body.addSection(L0(L0({},Y),{},{headerWrapperGroup:{default:B.default?this.createHeader(B.default):void 0,first:B.first?this.createHeader(B.first):void 0,even:B.even?this.createHeader(B.even):void 0},footerWrapperGroup:{default:U.default?this.createFooter(U.default):void 0,first:U.first?this.createFooter(U.first):void 0,even:U.even?this.createFooter(U.even):void 0}}));for(let Q of G)this.documentWrapper.View.add(Q)}createHeader(B){let U=new _9(this.media,this.currentRelationshipId++);for(let G of B.options.children)U.add(G);return this.addHeaderToDocument(U),U}createFooter(B){let U=new f9(this.media,this.currentRelationshipId++);for(let G of B.options.children)U.add(G);return this.addFooterToDocument(U),U}addHeaderToDocument(B,U=D2.DEFAULT){this.headers.push({header:B,type:U}),this.documentWrapper.Relationships.addRelationship(B.View.ReferenceId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",`header${this.headers.length}.xml`),this.contentTypes.addHeader(this.headers.length)}addFooterToDocument(B,U=D2.DEFAULT){this.footers.push({footer:B,type:U}),this.documentWrapper.Relationships.addRelationship(B.View.ReferenceId,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",`footer${this.footers.length}.xml`),this.contentTypes.addFooter(this.footers.length)}addDefaultRelationships(){if(this.fileRelationships.addRelationship(1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument","word/document.xml"),this.fileRelationships.addRelationship(2,"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties","docProps/core.xml"),this.fileRelationships.addRelationship(3,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties","docProps/app.xml"),this.fileRelationships.addRelationship(4,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties","docProps/custom.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles","styles.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering","numbering.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes","footnotes.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes","endnotes.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings","settings.xml"),this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments","comments.xml"),this.commentsExtended)this.documentWrapper.Relationships.addRelationship(this.currentRelationshipId++,"http://schemas.microsoft.com/office/2011/relationships/commentsExtended","commentsExtended.xml"),this.contentTypes.addCommentsExtended()}get Document(){return this.documentWrapper}get Styles(){return this.styles}get CoreProperties(){return this.coreProperties}get Numbering(){return this.numbering}get Media(){return this.media}get FileRelationships(){return this.fileRelationships}get Headers(){return this.headers.map((B)=>B.header)}get Footers(){return this.footers.map((B)=>B.footer)}get ContentTypes(){return this.contentTypes}get CustomProperties(){return this.customProperties}get AppProperties(){return this.appProperties}get FootNotes(){return this.footnotesWrapper}get Endnotes(){return this.endnotesWrapper}get Settings(){return this.settings}get Comments(){return this.comments}get CommentsExtended(){return this.commentsExtended}get FontTable(){return this.fontWrapper}},qK=class extends t{constructor(B={}){super("w:instrText");e(this,"properties",void 0),this.properties=B,this.root.push(new _0({space:x0.PRESERVE}));let U="TOC";if(this.properties.captionLabel)U=`${U} \\a "${this.properties.captionLabel}"`;if(this.properties.entriesFromBookmark)U=`${U} \\b "${this.properties.entriesFromBookmark}"`;if(this.properties.captionLabelIncludingNumbers)U=`${U} \\c "${this.properties.captionLabelIncludingNumbers}"`;if(this.properties.sequenceAndPageNumbersSeparator)U=`${U} \\d "${this.properties.sequenceAndPageNumbersSeparator}"`;if(this.properties.tcFieldIdentifier)U=`${U} \\f "${this.properties.tcFieldIdentifier}"`;if(this.properties.hyperlink)U=`${U} \\h`;if(this.properties.tcFieldLevelRange)U=`${U} \\l "${this.properties.tcFieldLevelRange}"`;if(this.properties.pageNumbersEntryLevelsRange)U=`${U} \\n "${this.properties.pageNumbersEntryLevelsRange}"`;if(this.properties.headingStyleRange)U=`${U} \\o "${this.properties.headingStyleRange}"`;if(this.properties.entryAndPageNumberSeparator)U=`${U} \\p "${this.properties.entryAndPageNumberSeparator}"`;if(this.properties.seqFieldIdentifierForPrefix)U=`${U} \\s "${this.properties.seqFieldIdentifierForPrefix}"`;if(this.properties.stylesWithLevels&&this.properties.stylesWithLevels.length){let G=this.properties.stylesWithLevels.map((Y)=>`${Y.styleName},${Y.level}`).join(",");U=`${U} \\t "${G}"`}if(this.properties.useAppliedParagraphOutlineLevel)U=`${U} \\u`;if(this.properties.preserveTabInEntries)U=`${U} \\w`;if(this.properties.preserveNewLineInEntries)U=`${U} \\x`;if(this.properties.hideTabAndPageNumbersInWebView)U=`${U} \\z`;this.root.push(U)}},r9=class extends t{constructor(){super("w:sdtContent")}},i9=class extends t{constructor(B){super("w:sdtPr");if(B)this.root.push(new M2("w:alias",B))}};function MK(B,U){if(B==null)return{};var G={};for(var Y in B)if({}.hasOwnProperty.call(B,Y)){if(U.includes(Y))continue;G[Y]=B[Y]}return G}function n9(B,U){if(B==null)return{};var G,Y,Q=MK(B,U);if(Object.getOwnPropertySymbols){var K=Object.getOwnPropertySymbols(B);for(Y=0;Y0){let{stylesWithLevels:W}=K,I=Y.map((D,w)=>{var P,A;let E=this.buildCachedContentParagraphChild(D,K),C=(P=W===null||W===void 0||(A=W.find((v)=>v.level===D.level))===null||A===void 0?void 0:A.styleName)!==null&&P!==void 0?P:`TOC${D.level}`,j=w===0?[...J,E]:w===Y.length-1?[E,...M]:[E];return new d0({style:C,tabStops:this.getTabStopsForLevel(D.level),children:j})}),F=I;if(Y.length<=1)F=[...I,new d0({children:M})];for(let D of F)Z.addChildElement(D)}else{let W=new d0({children:J});Z.addChildElement(W);for(let F of G)Z.addChildElement(F);let I=new d0({children:M});Z.addChildElement(I)}this.root.push(Z)}getTabStopsForLevel(B,U=9025){return[{type:"clear",position:U+1-(B-1)*240},{type:"right",position:U,leader:"dot"}]}buildCachedContentRun(B,U){var G,Y;return new T0({style:(U===null||U===void 0?void 0:U.hyperlink)&&B.href!==void 0?"IndexLink":void 0,children:[new Z1({text:B.title}),new D4,new Z1({text:(G=(Y=B.page)===null||Y===void 0?void 0:Y.toString())!==null&&G!==void 0?G:""})]})}buildCachedContentParagraphChild(B,U){let G=this.buildCachedContentRun(B,U);if((U===null||U===void 0?void 0:U.hyperlink)&&B.href!==void 0)return new y4({anchor:B.href,children:[G]});return G}},LK=class{constructor(B,U){e(this,"styleName",void 0),e(this,"level",void 0),this.styleName=B,this.level=U}},IK=class{constructor(B={children:[]}){e(this,"options",void 0),this.options=B}},OK=class{constructor(B={children:[]}){e(this,"options",void 0),this.options=B}},s9=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{id:"w:id"})}},o9=class extends t{constructor(B){super("w:footnoteReference");this.root.push(new s9({id:B}))}},FK=class extends T0{constructor(B){super({style:"FootnoteReference"});this.root.push(new o9(B))}},t9=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{id:"w:id"})}},e9=class extends t{constructor(B){super("w:endnoteReference");this.root.push(new t9({id:B}))}},HK=class extends T0{constructor(B){super({style:"EndnoteReference"});this.root.push(new e9(B))}},o6=class extends F0{constructor(...B){super(...B);e(this,"xmlKeys",{val:"w14:val",symbolfont:"w14:font"})}},S1=class extends t{constructor(B,U,G){super(B);if(G)this.root.push(new o6({val:SB(U),symbolfont:G}));else this.root.push(new o6({val:U}))}},B5=class extends t{constructor(B){var U,G,Y,Q,K,Z,J,M;super("w14:checkbox");e(this,"DEFAULT_UNCHECKED_SYMBOL","2610"),e(this,"DEFAULT_CHECKED_SYMBOL","2612"),e(this,"DEFAULT_FONT","MS Gothic");let W=(B===null||B===void 0?void 0:B.checked)?"1":"0",I,F;this.root.push(new S1("w14:checked",W)),I=(B===null||B===void 0||(U=B.checkedState)===null||U===void 0?void 0:U.value)?B===null||B===void 0||(G=B.checkedState)===null||G===void 0?void 0:G.value:this.DEFAULT_CHECKED_SYMBOL,F=(B===null||B===void 0||(Y=B.checkedState)===null||Y===void 0?void 0:Y.font)?B===null||B===void 0||(Q=B.checkedState)===null||Q===void 0?void 0:Q.font:this.DEFAULT_FONT,this.root.push(new S1("w14:checkedState",I,F)),I=(B===null||B===void 0||(K=B.uncheckedState)===null||K===void 0?void 0:K.value)?B===null||B===void 0||(Z=B.uncheckedState)===null||Z===void 0?void 0:Z.value:this.DEFAULT_UNCHECKED_SYMBOL,F=(B===null||B===void 0||(J=B.uncheckedState)===null||J===void 0?void 0:J.font)?B===null||B===void 0||(M=B.uncheckedState)===null||M===void 0?void 0:M.font:this.DEFAULT_FONT,this.root.push(new S1("w14:uncheckedState",I,F))}},WK=class extends t{constructor(B){var U,G,Y,Q;super("w:sdt");e(this,"DEFAULT_UNCHECKED_SYMBOL","2610"),e(this,"DEFAULT_CHECKED_SYMBOL","2612"),e(this,"DEFAULT_FONT","MS Gothic");let K=new i9(B===null||B===void 0?void 0:B.alias);K.addChildElement(new B5(B)),this.root.push(K);let Z=new r9,J=B===null||B===void 0||(U=B.checkedState)===null||U===void 0?void 0:U.font,M=B===null||B===void 0||(G=B.checkedState)===null||G===void 0?void 0:G.value,W=B===null||B===void 0||(Y=B.uncheckedState)===null||Y===void 0?void 0:Y.font,I=B===null||B===void 0||(Q=B.uncheckedState)===null||Q===void 0?void 0:Q.value,F,D;if(B===null||B===void 0?void 0:B.checked)F=J?J:this.DEFAULT_FONT,D=M?M:this.DEFAULT_CHECKED_SYMBOL;else F=W?W:this.DEFAULT_FONT,D=I?I:this.DEFAULT_UNCHECKED_SYMBOL;let w=new aB({char:D,symbolfont:F});Z.addChildElement(w),this.root.push(Z)}},PK=({shape:B})=>new X0({name:"w:pict",children:[B]}),wK=({children:B=[]})=>new X0({name:"w:txbxContent",children:B}),AK=({style:B,children:U,inset:G})=>new X0({name:"v:textbox",attributes:{style:{key:"style",value:B},insetMode:{key:"insetmode",value:G?"custom":"auto"},inset:{key:"inset",value:G?`${G.left}, ${G.top}, ${G.right}, ${G.bottom}`:void 0}},children:[wK({children:U})]}),jK="#_x0000_t202",NK={flip:"flip",height:"height",left:"left",marginBottom:"margin-bottom",marginLeft:"margin-left",marginRight:"margin-right",marginTop:"margin-top",positionHorizontal:"mso-position-horizontal",positionHorizontalRelative:"mso-position-horizontal-relative",positionVertical:"mso-position-vertical",positionVerticalRelative:"mso-position-vertical-relative",wrapDistanceBottom:"mso-wrap-distance-bottom",wrapDistanceLeft:"mso-wrap-distance-left",wrapDistanceRight:"mso-wrap-distance-right",wrapDistanceTop:"mso-wrap-distance-top",wrapEdited:"mso-wrap-edited",wrapStyle:"mso-wrap-style",position:"position",rotation:"rotation",top:"top",visibility:"visibility",width:"width",zIndex:"z-index"},zK=(B)=>B?Object.entries(B).map(([U,G])=>`${NK[U]}:${G}`).join(";"):void 0,EK=({id:B,children:U,type:G=jK,style:Y})=>new X0({name:"v:shape",attributes:{id:{key:"id",value:B},type:{key:"type",value:G},style:{key:"style",value:zK(Y)}},children:[AK({style:"mso-fit-shape-to-text:t;",children:U})]}),TK=["style","children"],DK=class extends F1{constructor(B){let{style:U,children:G}=B,Y=n9(B,TK);super("w:p");this.root.push(new X2(Y)),this.root.push(PK({shape:EK({children:G,id:O1(),style:U})}))}},CK=R0((B,U)=>{d2(),P2();/*! + + JSZip v3.10.1 - A JavaScript class for generating and reading zip files + + + (c) 2009-2016 Stuart Knightley + Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. + + JSZip uses the library pako released under the MIT license : + https://github.com/nodeca/pako/blob/main/LICENSE + */(function(G){if(typeof B=="object"&&typeof U<"u")U.exports=G();else if(typeof define=="function"&&define.amd)define([],G);else(typeof window<"u"?window:typeof v0<"u"?v0:typeof self<"u"?self:this).JSZip=G()})(function(){return function G(Y,Q,K){function Z(W,I){if(!Q[W]){if(!Y[W]){var F=typeof N1=="function"&&N1;if(!I&&F)return F(W,!0);if(J)return J(W,!0);var D=Error("Cannot find module '"+W+"'");throw D.code="MODULE_NOT_FOUND",D}var w=Q[W]={exports:{}};Y[W][0].call(w.exports,function(P){var A=Y[W][1][P];return Z(A||P)},w,w.exports,G,Y,Q,K)}return Q[W].exports}for(var J=typeof N1=="function"&&N1,M=0;M>2,w=(3&W)<<4|I>>4,P=1>6:64,A=2>4,I=(15&D)<<4|(w=J.indexOf(M.charAt(A++)))>>2,F=(3&w)<<6|(P=J.indexOf(M.charAt(A++))),j[E++]=W,w!==64&&(j[E++]=I),P!==64&&(j[E++]=F);return j}},{"./support":30,"./utils":32}],2:[function(G,Y,Q){var K=G("./external"),Z=G("./stream/DataWorker"),J=G("./stream/Crc32Probe"),M=G("./stream/DataLengthProbe");function W(I,F,D,w,P){this.compressedSize=I,this.uncompressedSize=F,this.crc32=D,this.compression=w,this.compressedContent=P}W.prototype={getContentWorker:function(){var I=new Z(K.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new M("data_length")),F=this;return I.on("end",function(){if(this.streamInfo.data_length!==F.uncompressedSize)throw Error("Bug : uncompressed data size mismatch")}),I},getCompressedWorker:function(){return new Z(K.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},W.createWorkerFrom=function(I,F,D){return I.pipe(new J).pipe(new M("uncompressedSize")).pipe(F.compressWorker(D)).pipe(new M("compressedSize")).withStreamInfo("compression",F)},Y.exports=W},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(G,Y,Q){var K=G("./stream/GenericWorker");Q.STORE={magic:"\x00\x00",compressWorker:function(){return new K("STORE compression")},uncompressWorker:function(){return new K("STORE decompression")}},Q.DEFLATE=G("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(G,Y,Q){var K=G("./utils"),Z=function(){for(var J,M=[],W=0;W<256;W++){J=W;for(var I=0;I<8;I++)J=1&J?3988292384^J>>>1:J>>>1;M[W]=J}return M}();Y.exports=function(J,M){return J!==void 0&&J.length?K.getTypeOf(J)!=="string"?function(W,I,F,D){var w=Z,P=D+F;W^=-1;for(var A=D;A>>8^w[255&(W^I[A])];return-1^W}(0|M,J,J.length,0):function(W,I,F,D){var w=Z,P=D+F;W^=-1;for(var A=D;A>>8^w[255&(W^I.charCodeAt(A))];return-1^W}(0|M,J,J.length,0):0}},{"./utils":32}],5:[function(G,Y,Q){Q.base64=!1,Q.binary=!1,Q.dir=!1,Q.createFolders=!0,Q.date=null,Q.compression=null,Q.compressionOptions=null,Q.comment=null,Q.unixPermissions=null,Q.dosPermissions=null},{}],6:[function(G,Y,Q){var K=null;K=typeof Promise<"u"?Promise:G("lie"),Y.exports={Promise:K}},{lie:37}],7:[function(G,Y,Q){var K=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",Z=G("pako"),J=G("./utils"),M=G("./stream/GenericWorker"),W=K?"uint8array":"array";function I(F,D){M.call(this,"FlateWorker/"+F),this._pako=null,this._pakoAction=F,this._pakoOptions=D,this.meta={}}Q.magic="\b\x00",J.inherits(I,M),I.prototype.processChunk=function(F){this.meta=F.meta,this._pako===null&&this._createPako(),this._pako.push(J.transformTo(W,F.data),!1)},I.prototype.flush=function(){M.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},I.prototype.cleanUp=function(){M.prototype.cleanUp.call(this),this._pako=null},I.prototype._createPako=function(){this._pako=new Z[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var F=this;this._pako.onData=function(D){F.push({data:D,meta:F.meta})}},Q.compressWorker=function(F){return new I("Deflate",F)},Q.uncompressWorker=function(){return new I("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(G,Y,Q){function K(w,P){var A,E="";for(A=0;A>>=8;return E}function Z(w,P,A,E,C,j){var v,S,H=w.file,X=w.compression,$=j!==W.utf8encode,x=J.transformTo("string",j(H.name)),N=J.transformTo("string",W.utf8encode(H.name)),a=H.comment,U0=J.transformTo("string",j(a)),b=J.transformTo("string",W.utf8encode(a)),c=N.length!==H.name.length,T=b.length!==a.length,m="",B0="",i="",V0=H.dir,s=H.date,G0={crc32:0,compressedSize:0,uncompressedSize:0};P&&!A||(G0.crc32=w.crc32,G0.compressedSize=w.compressedSize,G0.uncompressedSize=w.uncompressedSize);var r=0;P&&(r|=8),$||!c&&!T||(r|=2048);var y=0,n=0;V0&&(y|=16),C==="UNIX"?(n=798,y|=function(Y0,O0){var z=Y0;return Y0||(z=O0?16893:33204),(65535&z)<<16}(H.unixPermissions,V0)):(n=20,y|=function(Y0){return 63&(Y0||0)}(H.dosPermissions)),v=s.getUTCHours(),v<<=6,v|=s.getUTCMinutes(),v<<=5,v|=s.getUTCSeconds()/2,S=s.getUTCFullYear()-1980,S<<=4,S|=s.getUTCMonth()+1,S<<=5,S|=s.getUTCDate(),c&&(B0=K(1,1)+K(I(x),4)+N,m+="up"+K(B0.length,2)+B0),T&&(i=K(1,1)+K(I(U0),4)+b,m+="uc"+K(i.length,2)+i);var o="";return o+=` +\x00`,o+=K(r,2),o+=X.magic,o+=K(v,2),o+=K(S,2),o+=K(G0.crc32,4),o+=K(G0.compressedSize,4),o+=K(G0.uncompressedSize,4),o+=K(x.length,2),o+=K(m.length,2),{fileRecord:F.LOCAL_FILE_HEADER+o+x+m,dirRecord:F.CENTRAL_FILE_HEADER+K(n,2)+o+K(U0.length,2)+"\x00\x00\x00\x00"+K(y,4)+K(E,4)+x+m+U0}}var J=G("../utils"),M=G("../stream/GenericWorker"),W=G("../utf8"),I=G("../crc32"),F=G("../signature");function D(w,P,A,E){M.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=P,this.zipPlatform=A,this.encodeFileName=E,this.streamFiles=w,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}J.inherits(D,M),D.prototype.push=function(w){var P=w.meta.percent||0,A=this.entriesCount,E=this._sources.length;this.accumulate?this.contentBuffer.push(w):(this.bytesWritten+=w.data.length,M.prototype.push.call(this,{data:w.data,meta:{currentFile:this.currentFile,percent:A?(P+100*(A-E-1))/A:100}}))},D.prototype.openedSource=function(w){this.currentSourceOffset=this.bytesWritten,this.currentFile=w.file.name;var P=this.streamFiles&&!w.file.dir;if(P){var A=Z(w,P,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:A.fileRecord,meta:{percent:0}})}else this.accumulate=!0},D.prototype.closedSource=function(w){this.accumulate=!1;var P=this.streamFiles&&!w.file.dir,A=Z(w,P,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(A.dirRecord),P)this.push({data:function(E){return F.DATA_DESCRIPTOR+K(E.crc32,4)+K(E.compressedSize,4)+K(E.uncompressedSize,4)}(w),meta:{percent:100}});else for(this.push({data:A.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},D.prototype.flush=function(){for(var w=this.bytesWritten,P=0;P=this.index;M--)W=(W<<8)+this.byteAt(M);return this.index+=J,W},readString:function(J){return K.transformTo("string",this.readData(J))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var J=this.readInt(4);return new Date(Date.UTC(1980+(J>>25&127),(J>>21&15)-1,J>>16&31,J>>11&31,J>>5&63,(31&J)<<1))}},Y.exports=Z},{"../utils":32}],19:[function(G,Y,Q){var K=G("./Uint8ArrayReader");function Z(J){K.call(this,J)}G("../utils").inherits(Z,K),Z.prototype.readData=function(J){this.checkOffset(J);var M=this.data.slice(this.zero+this.index,this.zero+this.index+J);return this.index+=J,M},Y.exports=Z},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(G,Y,Q){var K=G("./DataReader");function Z(J){K.call(this,J)}G("../utils").inherits(Z,K),Z.prototype.byteAt=function(J){return this.data.charCodeAt(this.zero+J)},Z.prototype.lastIndexOfSignature=function(J){return this.data.lastIndexOf(J)-this.zero},Z.prototype.readAndCheckSignature=function(J){return J===this.readData(4)},Z.prototype.readData=function(J){this.checkOffset(J);var M=this.data.slice(this.zero+this.index,this.zero+this.index+J);return this.index+=J,M},Y.exports=Z},{"../utils":32,"./DataReader":18}],21:[function(G,Y,Q){var K=G("./ArrayReader");function Z(J){K.call(this,J)}G("../utils").inherits(Z,K),Z.prototype.readData=function(J){if(this.checkOffset(J),J===0)return new Uint8Array(0);var M=this.data.subarray(this.zero+this.index,this.zero+this.index+J);return this.index+=J,M},Y.exports=Z},{"../utils":32,"./ArrayReader":17}],22:[function(G,Y,Q){var K=G("../utils"),Z=G("../support"),J=G("./ArrayReader"),M=G("./StringReader"),W=G("./NodeBufferReader"),I=G("./Uint8ArrayReader");Y.exports=function(F){var D=K.getTypeOf(F);return K.checkSupport(D),D!=="string"||Z.uint8array?D==="nodebuffer"?new W(F):Z.uint8array?new I(K.transformTo("uint8array",F)):new J(K.transformTo("array",F)):new M(F)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(G,Y,Q){Q.LOCAL_FILE_HEADER="PK\x03\x04",Q.CENTRAL_FILE_HEADER="PK\x01\x02",Q.CENTRAL_DIRECTORY_END="PK\x05\x06",Q.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07",Q.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06",Q.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(G,Y,Q){var K=G("./GenericWorker"),Z=G("../utils");function J(M){K.call(this,"ConvertWorker to "+M),this.destType=M}Z.inherits(J,K),J.prototype.processChunk=function(M){this.push({data:Z.transformTo(this.destType,M.data),meta:M.meta})},Y.exports=J},{"../utils":32,"./GenericWorker":28}],25:[function(G,Y,Q){var K=G("./GenericWorker"),Z=G("../crc32");function J(){K.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}G("../utils").inherits(J,K),J.prototype.processChunk=function(M){this.streamInfo.crc32=Z(M.data,this.streamInfo.crc32||0),this.push(M)},Y.exports=J},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(G,Y,Q){var K=G("../utils"),Z=G("./GenericWorker");function J(M){Z.call(this,"DataLengthProbe for "+M),this.propName=M,this.withStreamInfo(M,0)}K.inherits(J,Z),J.prototype.processChunk=function(M){if(M){var W=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=W+M.data.length}Z.prototype.processChunk.call(this,M)},Y.exports=J},{"../utils":32,"./GenericWorker":28}],27:[function(G,Y,Q){var K=G("../utils"),Z=G("./GenericWorker");function J(M){Z.call(this,"DataWorker");var W=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,M.then(function(I){W.dataIsReady=!0,W.data=I,W.max=I&&I.length||0,W.type=K.getTypeOf(I),W.isPaused||W._tickAndRepeat()},function(I){W.error(I)})}K.inherits(J,Z),J.prototype.cleanUp=function(){Z.prototype.cleanUp.call(this),this.data=null},J.prototype.resume=function(){return!!Z.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,K.delay(this._tickAndRepeat,[],this)),!0)},J.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(K.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},J.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var M=null,W=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":M=this.data.substring(this.index,W);break;case"uint8array":M=this.data.subarray(this.index,W);break;case"array":case"nodebuffer":M=this.data.slice(this.index,W)}return this.index=W,this.push({data:M,meta:{percent:this.max?this.index/this.max*100:0}})},Y.exports=J},{"../utils":32,"./GenericWorker":28}],28:[function(G,Y,Q){function K(Z){this.name=Z||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}K.prototype={push:function(Z){this.emit("data",Z)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(Z){this.emit("error",Z)}return!0},error:function(Z){return!this.isFinished&&(this.isPaused?this.generatedError=Z:(this.isFinished=!0,this.emit("error",Z),this.previous&&this.previous.error(Z),this.cleanUp()),!0)},on:function(Z,J){return this._listeners[Z].push(J),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(Z,J){if(this._listeners[Z])for(var M=0;M "+Z:Z}},Y.exports=K},{}],29:[function(G,Y,Q){var K=G("../utils"),Z=G("./ConvertWorker"),J=G("./GenericWorker"),M=G("../base64"),W=G("../support"),I=G("../external"),F=null;if(W.nodestream)try{F=G("../nodejs/NodejsStreamOutputAdapter")}catch(P){}function D(P,A){return new I.Promise(function(E,C){var j=[],v=P._internalType,S=P._outputType,H=P._mimeType;P.on("data",function(X,$){j.push(X),A&&A($)}).on("error",function(X){j=[],C(X)}).on("end",function(){try{E(function(X,$,x){switch(X){case"blob":return K.newBlob(K.transformTo("arraybuffer",$),x);case"base64":return M.encode($);default:return K.transformTo(X,$)}}(S,function(X,$){var x,N=0,a=null,U0=0;for(x=0;x<$.length;x++)U0+=$[x].length;switch(X){case"string":return $.join("");case"array":return Array.prototype.concat.apply([],$);case"uint8array":for(a=new Uint8Array(U0),x=0;x<$.length;x++)a.set($[x],N),N+=$[x].length;return a;case"nodebuffer":return Buffer.concat($);default:throw Error("concat : unsupported type '"+X+"'")}}(v,j),H))}catch(X){C(X)}j=[]}).resume()})}function w(P,A,E){var C=A;switch(A){case"blob":case"arraybuffer":C="uint8array";break;case"base64":C="string"}try{this._internalType=C,this._outputType=A,this._mimeType=E,K.checkSupport(C),this._worker=P.pipe(new Z(C)),P.lock()}catch(j){this._worker=new J("error"),this._worker.error(j)}}w.prototype={accumulate:function(P){return D(this,P)},on:function(P,A){var E=this;return P==="data"?this._worker.on(P,function(C){A.call(E,C.data,C.meta)}):this._worker.on(P,function(){K.delay(A,arguments,E)}),this},resume:function(){return K.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(P){if(K.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw Error(this._outputType+" is not supported by this method");return new F(this,{objectMode:this._outputType!=="nodebuffer"},P)}},Y.exports=w},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(G,Y,Q){if(Q.base64=!0,Q.array=!0,Q.string=!0,Q.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",Q.nodebuffer=typeof Buffer<"u",Q.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")Q.blob=!1;else{var K=new ArrayBuffer(0);try{Q.blob=new Blob([K],{type:"application/zip"}).size===0}catch(J){try{var Z=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);Z.append(K),Q.blob=Z.getBlob("application/zip").size===0}catch(M){Q.blob=!1}}}try{Q.nodestream=!!G("readable-stream").Readable}catch(J){Q.nodestream=!1}},{"readable-stream":16}],31:[function(G,Y,Q){for(var K=G("./utils"),Z=G("./support"),J=G("./nodejsUtils"),M=G("./stream/GenericWorker"),W=Array(256),I=0;I<256;I++)W[I]=252<=I?6:248<=I?5:240<=I?4:224<=I?3:192<=I?2:1;W[254]=W[254]=1;function F(){M.call(this,"utf-8 decode"),this.leftOver=null}function D(){M.call(this,"utf-8 encode")}Q.utf8encode=function(w){return Z.nodebuffer?J.newBufferFrom(w,"utf-8"):function(P){var A,E,C,j,v,S=P.length,H=0;for(j=0;j>>6:(E<65536?A[v++]=224|E>>>12:(A[v++]=240|E>>>18,A[v++]=128|E>>>12&63),A[v++]=128|E>>>6&63),A[v++]=128|63&E);return A}(w)},Q.utf8decode=function(w){return Z.nodebuffer?K.transformTo("nodebuffer",w).toString("utf-8"):function(P){var A,E,C,j,v=P.length,S=Array(2*v);for(A=E=0;A>10&1023,S[E++]=56320|1023&C)}return S.length!==E&&(S.subarray?S=S.subarray(0,E):S.length=E),K.applyFromCharCode(S)}(w=K.transformTo(Z.uint8array?"uint8array":"array",w))},K.inherits(F,M),F.prototype.processChunk=function(w){var P=K.transformTo(Z.uint8array?"uint8array":"array",w.data);if(this.leftOver&&this.leftOver.length){if(Z.uint8array){var A=P;(P=new Uint8Array(A.length+this.leftOver.length)).set(this.leftOver,0),P.set(A,this.leftOver.length)}else P=this.leftOver.concat(P);this.leftOver=null}var E=function(j,v){var S;for((v=v||j.length)>j.length&&(v=j.length),S=v-1;0<=S&&(192&j[S])==128;)S--;return S<0?v:S===0?v:S+W[j[S]]>v?S:v}(P),C=P;E!==P.length&&(Z.uint8array?(C=P.subarray(0,E),this.leftOver=P.subarray(E,P.length)):(C=P.slice(0,E),this.leftOver=P.slice(E,P.length))),this.push({data:Q.utf8decode(C),meta:w.meta})},F.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:Q.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},Q.Utf8DecodeWorker=F,K.inherits(D,M),D.prototype.processChunk=function(w){this.push({data:Q.utf8encode(w.data),meta:w.meta})},Q.Utf8EncodeWorker=D},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(G,Y,Q){var K=G("./support"),Z=G("./base64"),J=G("./nodejsUtils"),M=G("./external");function W(A){return A}function I(A,E){for(var C=0;C>8;this.dir=!!(16&this.externalFileAttributes),w==0&&(this.dosPermissions=63&this.externalFileAttributes),w==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var w=K(this.extraFields[1].value);this.uncompressedSize===Z.MAX_VALUE_32BITS&&(this.uncompressedSize=w.readInt(8)),this.compressedSize===Z.MAX_VALUE_32BITS&&(this.compressedSize=w.readInt(8)),this.localHeaderOffset===Z.MAX_VALUE_32BITS&&(this.localHeaderOffset=w.readInt(8)),this.diskNumberStart===Z.MAX_VALUE_32BITS&&(this.diskNumberStart=w.readInt(4))}},readExtraFields:function(w){var P,A,E,C=w.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});w.index+4>>6:(w<65536?D[E++]=224|w>>>12:(D[E++]=240|w>>>18,D[E++]=128|w>>>12&63),D[E++]=128|w>>>6&63),D[E++]=128|63&w);return D},Q.buf2binstring=function(F){return I(F,F.length)},Q.binstring2buf=function(F){for(var D=new K.Buf8(F.length),w=0,P=D.length;w>10&1023,j[P++]=56320|1023&A)}return I(j,P)},Q.utf8border=function(F,D){var w;for((D=D||F.length)>F.length&&(D=F.length),w=D-1;0<=w&&(192&F[w])==128;)w--;return w<0?D:w===0?D:w+M[F[w]]>D?w:D}},{"./common":41}],43:[function(G,Y,Q){Y.exports=function(K,Z,J,M){for(var W=65535&K|0,I=K>>>16&65535|0,F=0;J!==0;){for(J-=F=2000>>1:Z>>>1;J[M]=Z}return J}();Y.exports=function(Z,J,M,W){var I=K,F=W+M;Z^=-1;for(var D=W;D>>8^I[255&(Z^J[D])];return-1^Z}},{}],46:[function(G,Y,Q){var K,Z=G("../utils/common"),J=G("./trees"),M=G("./adler32"),W=G("./crc32"),I=G("./messages"),F=0,D=4,w=0,P=-2,A=-1,E=4,C=2,j=8,v=9,S=286,H=30,X=19,$=2*S+1,x=15,N=3,a=258,U0=a+N+1,b=42,c=113,T=1,m=2,B0=3,i=4;function V0(R,p){return R.msg=I[p],p}function s(R){return(R<<1)-(4R.avail_out&&(k=R.avail_out),k!==0&&(Z.arraySet(R.output,p.pending_buf,p.pending_out,k,R.next_out),R.next_out+=k,p.pending_out+=k,R.total_out+=k,R.avail_out-=k,p.pending-=k,p.pending===0&&(p.pending_out=0))}function y(R,p){J._tr_flush_block(R,0<=R.block_start?R.block_start:-1,R.strstart-R.block_start,p),R.block_start=R.strstart,r(R.strm)}function n(R,p){R.pending_buf[R.pending++]=p}function o(R,p){R.pending_buf[R.pending++]=p>>>8&255,R.pending_buf[R.pending++]=255&p}function Y0(R,p){var k,V,q=R.max_chain_length,O=R.strstart,_=R.prev_length,l=R.nice_match,d=R.strstart>R.w_size-U0?R.strstart-(R.w_size-U0):0,Q0=R.window,q0=R.w_mask,K0=R.prev,I0=R.strstart+a,H0=Q0[O+_-1],W0=Q0[O+_];R.prev_length>=R.good_match&&(q>>=2),l>R.lookahead&&(l=R.lookahead);do if(Q0[(k=p)+_]===W0&&Q0[k+_-1]===H0&&Q0[k]===Q0[O]&&Q0[++k]===Q0[O+1]){O+=2,k++;do;while(Q0[++O]===Q0[++k]&&Q0[++O]===Q0[++k]&&Q0[++O]===Q0[++k]&&Q0[++O]===Q0[++k]&&Q0[++O]===Q0[++k]&&Q0[++O]===Q0[++k]&&Q0[++O]===Q0[++k]&&Q0[++O]===Q0[++k]&&Od&&--q!=0);return _<=R.lookahead?_:R.lookahead}function O0(R){var p,k,V,q,O,_,l,d,Q0,q0,K0=R.w_size;do{if(q=R.window_size-R.lookahead-R.strstart,R.strstart>=K0+(K0-U0)){for(Z.arraySet(R.window,R.window,K0,K0,0),R.match_start-=K0,R.strstart-=K0,R.block_start-=K0,p=k=R.hash_size;V=R.head[--p],R.head[p]=K0<=V?V-K0:0,--k;);for(p=k=K0;V=R.prev[--p],R.prev[p]=K0<=V?V-K0:0,--k;);q+=K0}if(R.strm.avail_in===0)break;if(_=R.strm,l=R.window,d=R.strstart+R.lookahead,Q0=q,q0=void 0,q0=_.avail_in,Q0=N)for(O=R.strstart-R.insert,R.ins_h=R.window[O],R.ins_h=(R.ins_h<=N&&(R.ins_h=(R.ins_h<=N)if(V=J._tr_tally(R,R.strstart-R.match_start,R.match_length-N),R.lookahead-=R.match_length,R.match_length<=R.max_lazy_match&&R.lookahead>=N){for(R.match_length--;R.strstart++,R.ins_h=(R.ins_h<=N&&(R.ins_h=(R.ins_h<=N&&R.match_length<=R.prev_length){for(q=R.strstart+R.lookahead-N,V=J._tr_tally(R,R.strstart-1-R.prev_match,R.prev_length-N),R.lookahead-=R.prev_length-1,R.prev_length-=2;++R.strstart<=q&&(R.ins_h=(R.ins_h<R.pending_buf_size-5&&(k=R.pending_buf_size-5);;){if(R.lookahead<=1){if(O0(R),R.lookahead===0&&p===F)return T;if(R.lookahead===0)break}R.strstart+=R.lookahead,R.lookahead=0;var V=R.block_start+k;if((R.strstart===0||R.strstart>=V)&&(R.lookahead=R.strstart-V,R.strstart=V,y(R,!1),R.strm.avail_out===0))return T;if(R.strstart-R.block_start>=R.w_size-U0&&(y(R,!1),R.strm.avail_out===0))return T}return R.insert=0,p===D?(y(R,!0),R.strm.avail_out===0?B0:i):(R.strstart>R.block_start&&(y(R,!1),R.strm.avail_out),T)}),new u(4,4,8,4,z),new u(4,5,16,8,z),new u(4,6,32,32,z),new u(4,4,16,16,L),new u(8,16,32,32,L),new u(8,16,128,128,L),new u(8,32,128,256,L),new u(32,128,258,1024,L),new u(32,258,258,4096,L)],Q.deflateInit=function(R,p){return f(R,p,j,15,8,0)},Q.deflateInit2=f,Q.deflateReset=g,Q.deflateResetKeep=Z0,Q.deflateSetHeader=function(R,p){return R&&R.state?R.state.wrap!==2?P:(R.state.gzhead=p,w):P},Q.deflate=function(R,p){var k,V,q,O;if(!R||!R.state||5>8&255),n(V,V.gzhead.time>>16&255),n(V,V.gzhead.time>>24&255),n(V,V.level===9?2:2<=V.strategy||V.level<2?4:0),n(V,255&V.gzhead.os),V.gzhead.extra&&V.gzhead.extra.length&&(n(V,255&V.gzhead.extra.length),n(V,V.gzhead.extra.length>>8&255)),V.gzhead.hcrc&&(R.adler=W(R.adler,V.pending_buf,V.pending,0)),V.gzindex=0,V.status=69):(n(V,0),n(V,0),n(V,0),n(V,0),n(V,0),n(V,V.level===9?2:2<=V.strategy||V.level<2?4:0),n(V,3),V.status=c);else{var _=j+(V.w_bits-8<<4)<<8;_|=(2<=V.strategy||V.level<2?0:V.level<6?1:V.level===6?2:3)<<6,V.strstart!==0&&(_|=32),_+=31-_%31,V.status=c,o(V,_),V.strstart!==0&&(o(V,R.adler>>>16),o(V,65535&R.adler)),R.adler=1}if(V.status===69)if(V.gzhead.extra){for(q=V.pending;V.gzindex<(65535&V.gzhead.extra.length)&&(V.pending!==V.pending_buf_size||(V.gzhead.hcrc&&V.pending>q&&(R.adler=W(R.adler,V.pending_buf,V.pending-q,q)),r(R),q=V.pending,V.pending!==V.pending_buf_size));)n(V,255&V.gzhead.extra[V.gzindex]),V.gzindex++;V.gzhead.hcrc&&V.pending>q&&(R.adler=W(R.adler,V.pending_buf,V.pending-q,q)),V.gzindex===V.gzhead.extra.length&&(V.gzindex=0,V.status=73)}else V.status=73;if(V.status===73)if(V.gzhead.name){q=V.pending;do{if(V.pending===V.pending_buf_size&&(V.gzhead.hcrc&&V.pending>q&&(R.adler=W(R.adler,V.pending_buf,V.pending-q,q)),r(R),q=V.pending,V.pending===V.pending_buf_size)){O=1;break}O=V.gzindexq&&(R.adler=W(R.adler,V.pending_buf,V.pending-q,q)),O===0&&(V.gzindex=0,V.status=91)}else V.status=91;if(V.status===91)if(V.gzhead.comment){q=V.pending;do{if(V.pending===V.pending_buf_size&&(V.gzhead.hcrc&&V.pending>q&&(R.adler=W(R.adler,V.pending_buf,V.pending-q,q)),r(R),q=V.pending,V.pending===V.pending_buf_size)){O=1;break}O=V.gzindexq&&(R.adler=W(R.adler,V.pending_buf,V.pending-q,q)),O===0&&(V.status=103)}else V.status=103;if(V.status===103&&(V.gzhead.hcrc?(V.pending+2>V.pending_buf_size&&r(R),V.pending+2<=V.pending_buf_size&&(n(V,255&R.adler),n(V,R.adler>>8&255),R.adler=0,V.status=c)):V.status=c),V.pending!==0){if(r(R),R.avail_out===0)return V.last_flush=-1,w}else if(R.avail_in===0&&s(p)<=s(k)&&p!==D)return V0(R,-5);if(V.status===666&&R.avail_in!==0)return V0(R,-5);if(R.avail_in!==0||V.lookahead!==0||p!==F&&V.status!==666){var l=V.strategy===2?function(d,Q0){for(var q0;;){if(d.lookahead===0&&(O0(d),d.lookahead===0)){if(Q0===F)return T;break}if(d.match_length=0,q0=J._tr_tally(d,0,d.window[d.strstart]),d.lookahead--,d.strstart++,q0&&(y(d,!1),d.strm.avail_out===0))return T}return d.insert=0,Q0===D?(y(d,!0),d.strm.avail_out===0?B0:i):d.last_lit&&(y(d,!1),d.strm.avail_out===0)?T:m}(V,p):V.strategy===3?function(d,Q0){for(var q0,K0,I0,H0,W0=d.window;;){if(d.lookahead<=a){if(O0(d),d.lookahead<=a&&Q0===F)return T;if(d.lookahead===0)break}if(d.match_length=0,d.lookahead>=N&&0d.lookahead&&(d.match_length=d.lookahead)}if(d.match_length>=N?(q0=J._tr_tally(d,1,d.match_length-N),d.lookahead-=d.match_length,d.strstart+=d.match_length,d.match_length=0):(q0=J._tr_tally(d,0,d.window[d.strstart]),d.lookahead--,d.strstart++),q0&&(y(d,!1),d.strm.avail_out===0))return T}return d.insert=0,Q0===D?(y(d,!0),d.strm.avail_out===0?B0:i):d.last_lit&&(y(d,!1),d.strm.avail_out===0)?T:m}(V,p):K[V.level].func(V,p);if(l!==B0&&l!==i||(V.status=666),l===T||l===B0)return R.avail_out===0&&(V.last_flush=-1),w;if(l===m&&(p===1?J._tr_align(V):p!==5&&(J._tr_stored_block(V,0,0,!1),p===3&&(G0(V.head),V.lookahead===0&&(V.strstart=0,V.block_start=0,V.insert=0))),r(R),R.avail_out===0))return V.last_flush=-1,w}return p!==D?w:V.wrap<=0?1:(V.wrap===2?(n(V,255&R.adler),n(V,R.adler>>8&255),n(V,R.adler>>16&255),n(V,R.adler>>24&255),n(V,255&R.total_in),n(V,R.total_in>>8&255),n(V,R.total_in>>16&255),n(V,R.total_in>>24&255)):(o(V,R.adler>>>16),o(V,65535&R.adler)),r(R),0=k.w_size&&(O===0&&(G0(k.head),k.strstart=0,k.block_start=0,k.insert=0),Q0=new Z.Buf8(k.w_size),Z.arraySet(Q0,p,q0-k.w_size,k.w_size,0),p=Q0,q0=k.w_size),_=R.avail_in,l=R.next_in,d=R.input,R.avail_in=q0,R.next_in=0,R.input=p,O0(k);k.lookahead>=N;){for(V=k.strstart,q=k.lookahead-(N-1);k.ins_h=(k.ins_h<>>=N=x>>>24,v-=N,(N=x>>>16&255)===0)m[I++]=65535&x;else{if(!(16&N)){if((64&N)==0){x=S[(65535&x)+(j&(1<>>=N,v-=N),v<15&&(j+=T[M++]<>>=N=x>>>24,v-=N,!(16&(N=x>>>16&255))){if((64&N)==0){x=H[(65535&x)+(j&(1<>>=N,v-=N,(N=I-F)>3,j&=(1<<(v-=a<<3))-1,K.next_in=M,K.next_out=I,K.avail_in=M>>24&255)+(b>>>8&65280)+((65280&b)<<8)+((255&b)<<24)}function j(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new K.Buf16(320),this.work=new K.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function v(b){var c;return b&&b.state?(c=b.state,b.total_in=b.total_out=c.total=0,b.msg="",c.wrap&&(b.adler=1&c.wrap),c.mode=P,c.last=0,c.havedict=0,c.dmax=32768,c.head=null,c.hold=0,c.bits=0,c.lencode=c.lendyn=new K.Buf32(A),c.distcode=c.distdyn=new K.Buf32(E),c.sane=1,c.back=-1,D):w}function S(b){var c;return b&&b.state?((c=b.state).wsize=0,c.whave=0,c.wnext=0,v(b)):w}function H(b,c){var T,m;return b&&b.state?(m=b.state,c<0?(T=0,c=-c):(T=1+(c>>4),c<48&&(c&=15)),c&&(c<8||15=i.wsize?(K.arraySet(i.window,c,T-i.wsize,i.wsize,0),i.wnext=0,i.whave=i.wsize):(m<(B0=i.wsize-i.wnext)&&(B0=m),K.arraySet(i.window,c,T-m,B0,i.wnext),(m-=B0)?(K.arraySet(i.window,c,T-m,m,0),i.wnext=m,i.whave=i.wsize):(i.wnext+=B0,i.wnext===i.wsize&&(i.wnext=0),i.whave>>8&255,T.check=J(T.check,O,2,0),y=r=0,T.mode=2;break}if(T.flags=0,T.head&&(T.head.done=!1),!(1&T.wrap)||(((255&r)<<8)+(r>>8))%31){b.msg="incorrect header check",T.mode=30;break}if((15&r)!=8){b.msg="unknown compression method",T.mode=30;break}if(y-=4,R=8+(15&(r>>>=4)),T.wbits===0)T.wbits=R;else if(R>T.wbits){b.msg="invalid window size",T.mode=30;break}T.dmax=1<>8&1),512&T.flags&&(O[0]=255&r,O[1]=r>>>8&255,T.check=J(T.check,O,2,0)),y=r=0,T.mode=3;case 3:for(;y<32;){if(s===0)break B;s--,r+=m[i++]<>>8&255,O[2]=r>>>16&255,O[3]=r>>>24&255,T.check=J(T.check,O,4,0)),y=r=0,T.mode=4;case 4:for(;y<16;){if(s===0)break B;s--,r+=m[i++]<>8),512&T.flags&&(O[0]=255&r,O[1]=r>>>8&255,T.check=J(T.check,O,2,0)),y=r=0,T.mode=5;case 5:if(1024&T.flags){for(;y<16;){if(s===0)break B;s--,r+=m[i++]<>>8&255,T.check=J(T.check,O,2,0)),y=r=0}else T.head&&(T.head.extra=null);T.mode=6;case 6:if(1024&T.flags&&(s<(Y0=T.length)&&(Y0=s),Y0&&(T.head&&(R=T.head.extra_len-T.length,T.head.extra||(T.head.extra=Array(T.head.extra_len)),K.arraySet(T.head.extra,m,i,Y0,R)),512&T.flags&&(T.check=J(T.check,m,Y0,i)),s-=Y0,i+=Y0,T.length-=Y0),T.length))break B;T.length=0,T.mode=7;case 7:if(2048&T.flags){if(s===0)break B;for(Y0=0;R=m[i+Y0++],T.head&&R&&T.length<65536&&(T.head.name+=String.fromCharCode(R)),R&&Y0>9&1,T.head.done=!0),b.adler=T.check=0,T.mode=12;break;case 10:for(;y<32;){if(s===0)break B;s--,r+=m[i++]<>>=7&y,y-=7&y,T.mode=27;break}for(;y<3;){if(s===0)break B;s--,r+=m[i++]<>>=1)){case 0:T.mode=14;break;case 1:if(a(T),T.mode=20,c!==6)break;r>>>=2,y-=2;break B;case 2:T.mode=17;break;case 3:b.msg="invalid block type",T.mode=30}r>>>=2,y-=2;break;case 14:for(r>>>=7&y,y-=7&y;y<32;){if(s===0)break B;s--,r+=m[i++]<>>16^65535)){b.msg="invalid stored block lengths",T.mode=30;break}if(T.length=65535&r,y=r=0,T.mode=15,c===6)break B;case 15:T.mode=16;case 16:if(Y0=T.length){if(s>>=5,y-=5,T.ndist=1+(31&r),r>>>=5,y-=5,T.ncode=4+(15&r),r>>>=4,y-=4,286>>=3,y-=3}for(;T.have<19;)T.lens[_[T.have++]]=0;if(T.lencode=T.lendyn,T.lenbits=7,k={bits:T.lenbits},p=W(0,T.lens,0,19,T.lencode,0,T.work,k),T.lenbits=k.bits,p){b.msg="invalid code lengths set",T.mode=30;break}T.have=0,T.mode=19;case 19:for(;T.have>>16&255,h=65535&q,!((L=q>>>24)<=y);){if(s===0)break B;s--,r+=m[i++]<>>=L,y-=L,T.lens[T.have++]=h;else{if(h===16){for(V=L+2;y>>=L,y-=L,T.have===0){b.msg="invalid bit length repeat",T.mode=30;break}R=T.lens[T.have-1],Y0=3+(3&r),r>>>=2,y-=2}else if(h===17){for(V=L+3;y>>=L)),r>>>=3,y-=3}else{for(V=L+7;y>>=L)),r>>>=7,y-=7}if(T.have+Y0>T.nlen+T.ndist){b.msg="invalid bit length repeat",T.mode=30;break}for(;Y0--;)T.lens[T.have++]=R}}if(T.mode===30)break;if(T.lens[256]===0){b.msg="invalid code -- missing end-of-block",T.mode=30;break}if(T.lenbits=9,k={bits:T.lenbits},p=W(I,T.lens,0,T.nlen,T.lencode,0,T.work,k),T.lenbits=k.bits,p){b.msg="invalid literal/lengths set",T.mode=30;break}if(T.distbits=6,T.distcode=T.distdyn,k={bits:T.distbits},p=W(F,T.lens,T.nlen,T.ndist,T.distcode,0,T.work,k),T.distbits=k.bits,p){b.msg="invalid distances set",T.mode=30;break}if(T.mode=20,c===6)break B;case 20:T.mode=21;case 21:if(6<=s&&258<=G0){b.next_out=V0,b.avail_out=G0,b.next_in=i,b.avail_in=s,T.hold=r,T.bits=y,M(b,o),V0=b.next_out,B0=b.output,G0=b.avail_out,i=b.next_in,m=b.input,s=b.avail_in,r=T.hold,y=T.bits,T.mode===12&&(T.back=-1);break}for(T.back=0;u=(q=T.lencode[r&(1<>>16&255,h=65535&q,!((L=q>>>24)<=y);){if(s===0)break B;s--,r+=m[i++]<>Z0)])>>>16&255,h=65535&q,!(Z0+(L=q>>>24)<=y);){if(s===0)break B;s--,r+=m[i++]<>>=Z0,y-=Z0,T.back+=Z0}if(r>>>=L,y-=L,T.back+=L,T.length=h,u===0){T.mode=26;break}if(32&u){T.back=-1,T.mode=12;break}if(64&u){b.msg="invalid literal/length code",T.mode=30;break}T.extra=15&u,T.mode=22;case 22:if(T.extra){for(V=T.extra;y>>=T.extra,y-=T.extra,T.back+=T.extra}T.was=T.length,T.mode=23;case 23:for(;u=(q=T.distcode[r&(1<>>16&255,h=65535&q,!((L=q>>>24)<=y);){if(s===0)break B;s--,r+=m[i++]<>Z0)])>>>16&255,h=65535&q,!(Z0+(L=q>>>24)<=y);){if(s===0)break B;s--,r+=m[i++]<>>=Z0,y-=Z0,T.back+=Z0}if(r>>>=L,y-=L,T.back+=L,64&u){b.msg="invalid distance code",T.mode=30;break}T.offset=h,T.extra=15&u,T.mode=24;case 24:if(T.extra){for(V=T.extra;y>>=T.extra,y-=T.extra,T.back+=T.extra}if(T.offset>T.dmax){b.msg="invalid distance too far back",T.mode=30;break}T.mode=25;case 25:if(G0===0)break B;if(Y0=o-G0,T.offset>Y0){if((Y0=T.offset-Y0)>T.whave&&T.sane){b.msg="invalid distance too far back",T.mode=30;break}O0=Y0>T.wnext?(Y0-=T.wnext,T.wsize-Y0):T.wnext-Y0,Y0>T.length&&(Y0=T.length),z=T.window}else z=B0,O0=V0-T.offset,Y0=T.length;for(G0$?(N=O0[z+E[c]],y[n+E[c]]):(N=96,0),j=1<>V0)+(v-=j)]=x<<24|N<<16|a|0,v!==0;);for(j=1<>=1;if(j!==0?(r&=j-1,r+=j):r=0,c++,--o[b]==0){if(b===m)break;b=F[D+E[c]]}if(B0>>7)]}function n(q,O){q.pending_buf[q.pending++]=255&O,q.pending_buf[q.pending++]=O>>>8&255}function o(q,O,_){q.bi_valid>C-_?(q.bi_buf|=O<>C-q.bi_valid,q.bi_valid+=_-C):(q.bi_buf|=O<>>=1,_<<=1,0<--O;);return _>>>1}function z(q,O,_){var l,d,Q0=Array(E+1),q0=0;for(l=1;l<=E;l++)Q0[l]=q0=q0+_[l-1]<<1;for(d=0;d<=O;d++){var K0=q[2*d+1];K0!==0&&(q[2*d]=O0(Q0[K0]++,K0))}}function L(q){var O;for(O=0;O>1;1<=_;_--)Z0(q,Q0,_);for(d=I0;_=q.heap[1],q.heap[1]=q.heap[q.heap_len--],Z0(q,Q0,1),l=q.heap[1],q.heap[--q.heap_max]=_,q.heap[--q.heap_max]=l,Q0[2*d]=Q0[2*_]+Q0[2*l],q.depth[d]=(q.depth[_]>=q.depth[l]?q.depth[_]:q.depth[l])+1,Q0[2*_+1]=Q0[2*l+1]=d,q.heap[1]=d++,Z0(q,Q0,1),2<=q.heap_len;);q.heap[--q.heap_max]=q.heap[1],function(W0,k0){var L2,m0,r2,N0,W1,a1,Y2=k0.dyn_tree,L6=k0.max_code,q5=k0.stat_desc.static_tree,M5=k0.stat_desc.has_stree,X5=k0.stat_desc.extra_bits,I6=k0.stat_desc.extra_base,i2=k0.stat_desc.max_length,P1=0;for(N0=0;N0<=E;N0++)W0.bl_count[N0]=0;for(Y2[2*W0.heap[W0.heap_max]+1]=0,L2=W0.heap_max+1;L2>=7;d>>=1)if(1&H0&&K0.dyn_ltree[2*I0]!==0)return Z;if(K0.dyn_ltree[18]!==0||K0.dyn_ltree[20]!==0||K0.dyn_ltree[26]!==0)return J;for(I0=32;I0>>3,(Q0=q.static_len+3+7>>>3)<=d&&(d=Q0)):d=Q0=_+5,_+4<=d&&O!==-1?V(q,O,_,l):q.strategy===4||Q0===d?(o(q,2+(l?1:0),3),g(q,U0,b)):(o(q,4+(l?1:0),3),function(K0,I0,H0,W0){var k0;for(o(K0,I0-257,5),o(K0,H0-1,5),o(K0,W0-4,4),k0=0;k0>>8&255,q.pending_buf[q.d_buf+2*q.last_lit+1]=255&O,q.pending_buf[q.l_buf+q.last_lit]=255&_,q.last_lit++,O===0?q.dyn_ltree[2*_]++:(q.matches++,O--,q.dyn_ltree[2*(T[_]+F+1)]++,q.dyn_dtree[2*y(O)]++),q.last_lit===q.lit_bufsize-1},Q._tr_align=function(q){o(q,2,3),Y0(q,v,U0),function(O){O.bi_valid===16?(n(O,O.bi_buf),O.bi_buf=0,O.bi_valid=0):8<=O.bi_valid&&(O.pending_buf[O.pending++]=255&O.bi_buf,O.bi_buf>>=8,O.bi_valid-=8)}(q)}},{"../utils/common":41}],53:[function(G,Y,Q){Y.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(G,Y,Q){(function(K){(function(Z,J){if(!Z.setImmediate){var M,W,I,F,D=1,w={},P=!1,A=Z.document,E=Object.getPrototypeOf&&Object.getPrototypeOf(Z);E=E&&E.setTimeout?E:Z,M={}.toString.call(Z.process)==="[object process]"?function(S){P0.nextTick(function(){j(S)})}:function(){if(Z.postMessage&&!Z.importScripts){var S=!0,H=Z.onmessage;return Z.onmessage=function(){S=!1},Z.postMessage("","*"),Z.onmessage=H,S}}()?(F="setImmediate$"+Math.random()+"$",Z.addEventListener?Z.addEventListener("message",v,!1):Z.attachEvent("onmessage",v),function(S){Z.postMessage(F+S,"*")}):Z.MessageChannel?((I=new MessageChannel).port1.onmessage=function(S){j(S.data)},function(S){I.port2.postMessage(S)}):A&&("onreadystatechange"in A.createElement("script"))?(W=A.documentElement,function(S){var H=A.createElement("script");H.onreadystatechange=function(){j(S),H.onreadystatechange=null,W.removeChild(H),H=null},W.appendChild(H)}):function(S){setTimeout(j,0,S)},E.setImmediate=function(S){typeof S!="function"&&(S=Function(""+S));for(var H=Array(arguments.length-1),X=0;X"u"?K===void 0?this:K:self)}).call(this,typeof v0<"u"?v0:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})}),kK=R0((B,U)=>{var G={"&":"&",'"':""","'":"'","<":"<",">":">"};function Y(Q){return Q&&Q.replace?Q.replace(/([&"<>'])/g,function(K,Z){return G[Z]}):Q}U.exports=Y}),$K=R0((B,U)=>{P2();var G=kK(),Y=f8().Stream,Q=" ";function K(F,D){if(typeof D!=="object")D={indent:D};var w=D.stream?new Y:null,P="",A=!1,E=!D.indent?"":D.indent===!0?Q:D.indent,C=!0;function j($){if(!C)$();else P0.nextTick($)}function v($,x){if(x!==void 0)P+=x;if($&&!A)w=w||new Y,A=!0;if($&&A){var N=P;j(function(){w.emit("data",N)}),P=""}}function S($,x){W(v,M($,E,E?1:0),x)}function H(){if(w){var $=P;j(function(){w.emit("data",$),w.emit("end"),w.readable=!1,w.emit("close")})}}function X($){var x={version:"1.0",encoding:$.encoding||"UTF-8"};if($.standalone)x.standalone=$.standalone;S({"?xml":{_attr:x}}),P=P.replace("/>","?>")}if(j(function(){C=!1}),D.declaration)X(D.declaration);if(F&&F.forEach)F.forEach(function($,x){var N;if(x+1===F.length)N=H;S($,N)});else S(F,H);if(w)return w.readable=!0,w;return P}function Z(){var F={_elem:M(Array.prototype.slice.call(arguments))};return F.push=function(D){if(!this.append)throw Error("not assigned to a parent!");var w=this,P=this._elem.indent;W(this.append,M(D,P,this._elem.icount+(P?1:0)),function(){w.append(!0)})},F.close=function(D){if(D!==void 0)this.push(D);if(this.end)this.end()},F}function J(F,D){return Array(D||0).join(F||"")}function M(F,D,w){w=w||0;var P=J(D,w),A,E=F,C=!1;if(typeof F==="object"){if(A=Object.keys(F)[0],E=F[A],E&&E._elem)return E._elem.name=A,E._elem.icount=w,E._elem.indent=D,E._elem.indents=P,E._elem.interrupt=E,E._elem}var j=[],v=[],S;function H(X){Object.keys(X).forEach(function($){j.push(I($,X[$]))})}switch(typeof E){case"object":if(E===null)break;if(E._attr)H(E._attr);if(E._cdata)v.push(("/g,"]]]]>")+"]]>");if(E.forEach){if(S=!1,v.push(""),E.forEach(function(X){if(typeof X=="object")if(Object.keys(X)[0]=="_attr")H(X._attr);else v.push(M(X,D,w+1));else v.pop(),S=!0,v.push(G(X))}),!S)v.push("")}break;default:v.push(G(E))}return{name:A,interrupt:C,attributes:j,content:v,icount:w,indents:P,indent:D}}function W(F,D,w){if(typeof D!="object")return F(!1,D);var P=D.interrupt?1:D.content.length;function A(){while(D.content.length){var C=D.content.shift();if(C===void 0)continue;if(E(C))return;W(F,C)}if(F(!1,(P>1?D.indents:"")+(D.name?"":"")+(D.indent&&!w?` +`:"")),w)w()}function E(C){if(C.interrupt)return C.interrupt.append=F,C.interrupt.end=A,C.interrupt=!1,F(!0),!0;return!1}if(F(!1,D.indents+(D.name?"<"+D.name:"")+(D.attributes.length?" "+D.attributes.join(" "):"")+(P?D.name?">":"":D.name?"/>":"")+(D.indent&&P>1?` +`:"")),!P)return F(!1,D.indent?` +`:"");if(!E(D))A()}function I(F,D){return F+'="'+G(D)+'"'}U.exports=K,U.exports.element=U.exports.Element=Z}),SK=f8(),h2=C8(CK(),1),w0=C8($K(),1),o2=0,X8=32,bK=32,vK=(B,U)=>{let G=U.replace(/-/g,"");if(G.length!==bK)throw Error(`Error: Cannot extract GUID from font filename: ${U}`);let Y=G.replace(/(..)/g,"$1 ").trim().split(" ").map((Z)=>parseInt(Z,16));Y.reverse();let Q=B.slice(o2,X8).map((Z,J)=>Z^Y[J%Y.length]),K=new Uint8Array(o2+Q.length+Math.max(0,B.length-X8));return K.set(B.slice(0,o2)),K.set(Q,o2),K.set(B.slice(X8),o2+Q.length),K},q6=class{format(B,U={stack:[]}){let G=B.prepForXml(U);if(G)return G;else throw Error("XMLComponent did not format correctly")}},U5=class{replace(B,U,G){let Y=B;return U.forEach((Q,K)=>{Y=Y.replace(new RegExp(`{${Q.fileName}}`,"g"),(G+K).toString())}),Y}getMediaData(B,U){return U.Array.filter((G)=>B.search(`{${G.fileName}}`)>0)}},yK=class{replace(B,U){let G=B;for(let Y of U)G=G.replace(new RegExp(`{${Y.reference}-${Y.instance}}`,"g"),Y.numId.toString());return G}},gK=class{constructor(){e(this,"formatter",void 0),e(this,"imageReplacer",void 0),e(this,"numberingReplacer",void 0),this.formatter=new q6,this.imageReplacer=new U5,this.numberingReplacer=new yK}compile(B,U,G=[]){let Y=new h2.default,Q=this.xmlifyFile(B,U),K=new Map(Object.entries(Q));for(let[,Z]of K)if(Array.isArray(Z))for(let J of Z)Y.file(J.path,U1(J.data));else Y.file(Z.path,U1(Z.data));for(let Z of G)Y.file(Z.path,U1(Z.data));for(let Z of B.Media.Array)if(Z.type!=="svg")Y.file(`word/media/${Z.fileName}`,Z.data);else Y.file(`word/media/${Z.fileName}`,Z.data),Y.file(`word/media/${Z.fallback.fileName}`,Z.fallback.data);for(let[Z,{data:J,fontKey:M}]of B.FontTable.fontOptionsWithKey.entries())Y.file(`word/fonts/font${Z+1}.odttf`,vK(J,M));return Y}xmlifyFile(B,U){let G=B.Document.Relationships.RelationshipCount+1,Y=(0,w0.default)(this.formatter.format(B.Document.View,{viewWrapper:B.Document,file:B,stack:[]}),{indent:U,declaration:{standalone:"yes",encoding:"UTF-8"}}),Q=B.Comments.Relationships.RelationshipCount+1,K=(0,w0.default)(this.formatter.format(B.Comments,{viewWrapper:{View:B.Comments,Relationships:B.Comments.Relationships},file:B,stack:[]}),{indent:U,declaration:{standalone:"yes",encoding:"UTF-8"}}),Z=B.FootNotes.Relationships.RelationshipCount+1,J=(0,w0.default)(this.formatter.format(B.FootNotes.View,{viewWrapper:B.FootNotes,file:B,stack:[]}),{indent:U,declaration:{standalone:"yes",encoding:"UTF-8"}}),M=this.imageReplacer.getMediaData(Y,B.Media),W=this.imageReplacer.getMediaData(K,B.Media),I=this.imageReplacer.getMediaData(J,B.Media);return L0(L0({Relationships:{data:(()=>{return M.forEach((F,D)=>{B.Document.Relationships.addRelationship(G+D,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${F.fileName}`)}),B.Document.Relationships.addRelationship(B.Document.Relationships.RelationshipCount+1,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable","fontTable.xml"),(0,w0.default)(this.formatter.format(B.Document.Relationships,{viewWrapper:B.Document,file:B,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/document.xml.rels"},Document:{data:(()=>{let F=this.imageReplacer.replace(Y,M,G);return this.numberingReplacer.replace(F,B.Numbering.ConcreteNumbering)})(),path:"word/document.xml"},Styles:{data:(()=>{let F=(0,w0.default)(this.formatter.format(B.Styles,{viewWrapper:B.Document,file:B,stack:[]}),{indent:U,declaration:{standalone:"yes",encoding:"UTF-8"}});return this.numberingReplacer.replace(F,B.Numbering.ConcreteNumbering)})(),path:"word/styles.xml"},Properties:{data:(0,w0.default)(this.formatter.format(B.CoreProperties,{viewWrapper:B.Document,file:B,stack:[]}),{indent:U,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/core.xml"},Numbering:{data:(0,w0.default)(this.formatter.format(B.Numbering,{viewWrapper:B.Document,file:B,stack:[]}),{indent:U,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/numbering.xml"},FileRelationships:{data:(0,w0.default)(this.formatter.format(B.FileRelationships,{viewWrapper:B.Document,file:B,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}}),path:"_rels/.rels"},HeaderRelationships:B.Headers.map((F,D)=>{let w=(0,w0.default)(this.formatter.format(F.View,{viewWrapper:F,file:B,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}});return this.imageReplacer.getMediaData(w,B.Media).forEach((P,A)=>{F.Relationships.addRelationship(A,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${P.fileName}`)}),{data:(0,w0.default)(this.formatter.format(F.Relationships,{viewWrapper:F,file:B,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}}),path:`word/_rels/header${D+1}.xml.rels`}}),FooterRelationships:B.Footers.map((F,D)=>{let w=(0,w0.default)(this.formatter.format(F.View,{viewWrapper:F,file:B,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}});return this.imageReplacer.getMediaData(w,B.Media).forEach((P,A)=>{F.Relationships.addRelationship(A,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${P.fileName}`)}),{data:(0,w0.default)(this.formatter.format(F.Relationships,{viewWrapper:F,file:B,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}}),path:`word/_rels/footer${D+1}.xml.rels`}}),Headers:B.Headers.map((F,D)=>{let w=(0,w0.default)(this.formatter.format(F.View,{viewWrapper:F,file:B,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}}),P=this.imageReplacer.getMediaData(w,B.Media),A=this.imageReplacer.replace(w,P,0);return{data:this.numberingReplacer.replace(A,B.Numbering.ConcreteNumbering),path:`word/header${D+1}.xml`}}),Footers:B.Footers.map((F,D)=>{let w=(0,w0.default)(this.formatter.format(F.View,{viewWrapper:F,file:B,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}}),P=this.imageReplacer.getMediaData(w,B.Media),A=this.imageReplacer.replace(w,P,0);return{data:this.numberingReplacer.replace(A,B.Numbering.ConcreteNumbering),path:`word/footer${D+1}.xml`}}),ContentTypes:{data:(0,w0.default)(this.formatter.format(B.ContentTypes,{viewWrapper:B.Document,file:B,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}}),path:"[Content_Types].xml"},CustomProperties:{data:(0,w0.default)(this.formatter.format(B.CustomProperties,{viewWrapper:B.Document,file:B,stack:[]}),{indent:U,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/custom.xml"},AppProperties:{data:(0,w0.default)(this.formatter.format(B.AppProperties,{viewWrapper:B.Document,file:B,stack:[]}),{indent:U,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"docProps/app.xml"},FootNotes:{data:(()=>{let F=this.imageReplacer.replace(J,I,Z);return this.numberingReplacer.replace(F,B.Numbering.ConcreteNumbering)})(),path:"word/footnotes.xml"},FootNotesRelationships:{data:(()=>{return I.forEach((F,D)=>{B.FootNotes.Relationships.addRelationship(Z+D,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${F.fileName}`)}),(0,w0.default)(this.formatter.format(B.FootNotes.Relationships,{viewWrapper:B.FootNotes,file:B,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/footnotes.xml.rels"},Endnotes:{data:(0,w0.default)(this.formatter.format(B.Endnotes.View,{viewWrapper:B.Endnotes,file:B,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}}),path:"word/endnotes.xml"},EndnotesRelationships:{data:(0,w0.default)(this.formatter.format(B.Endnotes.Relationships,{viewWrapper:B.Endnotes,file:B,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}}),path:"word/_rels/endnotes.xml.rels"},Settings:{data:(0,w0.default)(this.formatter.format(B.Settings,{viewWrapper:B.Document,file:B,stack:[]}),{indent:U,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/settings.xml"},Comments:{data:(()=>{let F=this.imageReplacer.replace(K,W,Q);return this.numberingReplacer.replace(F,B.Numbering.ConcreteNumbering)})(),path:"word/comments.xml"},CommentsRelationships:{data:(()=>{return W.forEach((F,D)=>{B.Comments.Relationships.addRelationship(Q+D,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",`media/${F.fileName}`)}),(0,w0.default)(this.formatter.format(B.Comments.Relationships,{viewWrapper:{View:B.Comments,Relationships:B.Comments.Relationships},file:B,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}})})(),path:"word/_rels/comments.xml.rels"}},B.CommentsExtended?{CommentsExtended:{data:(0,w0.default)(this.formatter.format(B.CommentsExtended,{viewWrapper:{View:B.CommentsExtended,Relationships:B.Comments.Relationships},file:B,stack:[]}),{indent:U,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/commentsExtended.xml"}}:{}),{},{FontTable:{data:(0,w0.default)(this.formatter.format(B.FontTable.View,{viewWrapper:B.Document,file:B,stack:[]}),{indent:U,declaration:{standalone:"yes",encoding:"UTF-8"}}),path:"word/fontTable.xml"},FontTableRelationships:{data:(0,w0.default)(this.formatter.format(B.FontTable.Relationships,{viewWrapper:B.Document,file:B,stack:[]}),{indent:U,declaration:{encoding:"UTF-8"}}),path:"word/_rels/fontTable.xml.rels"}})}};function t6(B,U,G,Y,Q,K,Z){try{var J=B[K](Z),M=J.value}catch(W){G(W);return}J.done?U(M):Promise.resolve(M).then(Y,Q)}function M6(B){return function(){var U=this,G=arguments;return new Promise(function(Y,Q){var K=B.apply(U,G);function Z(M){t6(K,Y,Q,Z,J,"next",M)}function J(M){t6(K,Y,Q,Z,J,"throw",M)}Z(void 0)})}}var G5={NONE:"",WITH_2_BLANKS:" ",WITH_4_BLANKS:" ",WITH_TAB:"\t"},e6=(B)=>B===!0?G5.WITH_2_BLANKS:B===!1?void 0:B,Y5=class B{static pack(U,G,Y){var Q=this;return M6(function*(K,Z,J,M=[]){return Q.compiler.compile(K,e6(J),M).generateAsync({type:Z,mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"})}).apply(this,arguments)}static toString(U,G,Y=[]){return B.pack(U,"string",G,Y)}static toBuffer(U,G,Y=[]){return B.pack(U,"nodebuffer",G,Y)}static toBase64String(U,G,Y=[]){return B.pack(U,"base64",G,Y)}static toBlob(U,G,Y=[]){return B.pack(U,"blob",G,Y)}static toArrayBuffer(U,G,Y=[]){return B.pack(U,"arraybuffer",G,Y)}static toStream(U,G,Y=[]){let Q=new SK.Stream;return this.compiler.compile(U,e6(G),Y).generateAsync({type:"nodebuffer",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",compression:"DEFLATE"}).then((K)=>{Q.emit("data",K),Q.emit("end")}),Q}};e(Y5,"compiler",new gK);var fK=new q6,l1=(B)=>{return(0,_1.xml2js)(B,{compact:!1,captureSpacesBetweenElements:!0})},Z5=(B)=>{var U;return(U=l1((0,w0.default)(fK.format(new Z1({text:B})))).elements[0].elements)!==null&&U!==void 0?U:[]},Q5=(B)=>L0(L0({},B),{},{attributes:{"xml:space":"preserve"}}),X6=(B,U)=>{var G,Y;return(G=(Y=B.elements)===null||Y===void 0?void 0:Y.filter((Q)=>Q.name===U)[0].elements)!==null&&G!==void 0?G:[]},g2=(B,U,G)=>{let Y=X6(B,"Types");if(Y.some((Q)=>{var K,Z;return Q.type==="element"&&Q.name==="Default"&&(Q===null||Q===void 0||(K=Q.attributes)===null||K===void 0?void 0:K.ContentType)===U&&(Q===null||Q===void 0||(Z=Q.attributes)===null||Z===void 0?void 0:Z.Extension)===G}))return;Y.push({attributes:{ContentType:U,Extension:G},name:"Default",type:"element"})},xK=(B)=>{let U=parseInt(B.substring(3),10);return isNaN(U)?0:U},_K=(B)=>{return X6(B,"Relationships").map((U)=>{var G,Y;return xK((G=(Y=U.attributes)===null||Y===void 0||(Y=Y.Id)===null||Y===void 0?void 0:Y.toString())!==null&&G!==void 0?G:"")}).reduce((U,G)=>Math.max(U,G),0)+1},BB=(B,U,G,Y,Q)=>{let K=X6(B,"Relationships");return K.push({attributes:{Id:`rId${U}`,Type:G,Target:Y,TargetMode:Q},name:"Relationship",type:"element"}),K},hK=class extends Error{constructor(B){super(`Token ${B} not found`);this.name="TokenNotFoundError"}},uK=(B,U)=>{var G;for(let Z=0;Z<((G=B.elements)!==null&&G!==void 0?G:[]).length;Z++){let J=B.elements[Z];if(J.type==="element"&&J.name==="w:r"){var Y;let M=((Y=J.elements)!==null&&Y!==void 0?Y:[]).filter((W)=>W.type==="element"&&W.name==="w:t");for(let W of M){var Q,K;if(!((Q=W.elements)===null||Q===void 0?void 0:Q[0]))continue;if((K=W.elements[0].text)===null||K===void 0?void 0:K.includes(U))return Z}}}throw new hK(U)},dK=(B,U)=>{var G,Y;let Q=-1,K=(G=(Y=B.elements)===null||Y===void 0?void 0:Y.map((Z,J)=>{if(Q!==-1)return Z;if(Z.type==="element"&&Z.name==="w:t"){var M,W;let I=((M=(W=Z.elements)===null||W===void 0||(W=W[0])===null||W===void 0?void 0:W.text)!==null&&M!==void 0?M:"").split(U),F=I.map((D)=>L0(L0(L0({},Z),Q5(Z)),{},{elements:Z5(D)}));if(I.length>1)Q=J;return F}else return Z}).flat())!==null&&G!==void 0?G:[];return{left:L0(L0({},JSON.parse(JSON.stringify(B))),{},{elements:K.slice(0,Q+1)}),right:L0(L0({},JSON.parse(JSON.stringify(B))),{},{elements:K.slice(Q+1)})}},t2={START:0,MIDDLE:1,END:2},cK=({paragraphElement:B,renderedParagraph:U,originalText:G,replacementText:Y})=>{let Q=U.text.indexOf(G),K=Q+G.length-1,Z=t2.START;for(let J of U.runs)for(let{text:M,index:W,start:I,end:F}of J.parts)switch(Z){case t2.START:if(Q>=I&&Q<=F){let D=Q-I,w=Math.min(K,F)-I,P=J.text.substring(D,w+1);if(P==="")continue;let A=M.replace(P,Y);R8(B.elements[J.index].elements[W],A),Z=t2.MIDDLE;continue}break;case t2.MIDDLE:if(K<=F){let D=M.substring(K-I+1);R8(B.elements[J.index].elements[W],D);let w=B.elements[J.index].elements[W];B.elements[J.index].elements[W]=Q5(w),Z=t2.END}else R8(B.elements[J.index].elements[W],"");break;default:}return B},R8=(B,U)=>{return B.elements=Z5(U),B},mK=(B)=>{if(B.element.name!=="w:p")throw Error(`Invalid node type: ${B.element.name}`);if(!B.element.elements)return{text:"",runs:[],index:-1,pathToParagraph:[]};let U=0,G=B.element.elements.map((Y,Q)=>({element:Y,i:Q})).filter(({element:Y})=>Y.name==="w:r").map(({element:Y,i:Q})=>{let K=lK(Y,Q,U);return U+=K.text.length,K}).filter((Y)=>!!Y);return{text:G.reduce((Y,Q)=>Y+Q.text,""),runs:G,index:B.index,pathToParagraph:J5(B)}},lK=(B,U,G)=>{if(!B.elements)return{text:"",parts:[],index:-1,start:G,end:G};let Y=G,Q=B.elements.map((K,Z)=>{var J,M;return K.name==="w:t"&&K.elements&&K.elements.length>0?{text:(J=(M=K.elements[0].text)===null||M===void 0?void 0:M.toString())!==null&&J!==void 0?J:"",index:Z,start:Y,end:(()=>{var W,I;return Y+=((W=(I=K.elements[0].text)===null||I===void 0?void 0:I.toString())!==null&&W!==void 0?W:"").length-1,Y})()}:void 0}).filter((K)=>!!K).map((K)=>K);return{text:Q.reduce((K,Z)=>K+Z.text,""),parts:Q,index:U,start:G,end:Y}},J5=(B)=>B.parent?[...J5(B.parent),B.index]:[B.index],UB=(B)=>{var U,G;return(U=(G=B.element.elements)===null||G===void 0?void 0:G.map((Y,Q)=>({element:Y,index:Q,parent:B})))!==null&&U!==void 0?U:[]},K5=(B)=>{let U=[],G=[...UB({element:B,index:0,parent:void 0})],Y;while(G.length>0){if(Y=G.shift(),Y.element.name==="w:p")U=[...U,mK(Y)];G.push(...UB(Y))}return U},aK=(B,U)=>K5(B).filter((G)=>G.text.includes(U)),pK=new q6,L8="ɵ",rK=({json:B,patch:U,patchText:G,context:Y,keepOriginalStyles:Q=!0})=>{let K=aK(B,G);if(K.length===0)return{element:B,didFindOccurrence:!1};for(let Z of K){let J=U.children.map((M)=>l1((0,w0.default)(pK.format(M,Y)))).map((M)=>M.elements[0]);switch(U.type){case D8.DOCUMENT:{let M=iK(B,Z.pathToParagraph),W=nK(Z.pathToParagraph);M.elements.splice(W,1,...J);break}case D8.PARAGRAPH:default:{let M=V5(B,Z.pathToParagraph);cK({paragraphElement:M,renderedParagraph:Z,originalText:G,replacementText:L8});let W=uK(M,L8),I=M.elements[W],{left:F,right:D}=dK(I,L8),w=J,P=D;if(Q){let A=I.elements.filter((E)=>E.type==="element"&&E.name==="w:rPr");w=J.map((E)=>{var C;return L0(L0({},E),{},{elements:[...A,...(C=E.elements)!==null&&C!==void 0?C:[]]})}),P=L0(L0({},D),{},{elements:[...A,...D.elements]})}M.elements.splice(W,1,F,...w,P);break}}}return{element:B,didFindOccurrence:!0}},V5=(B,U)=>{let G=B;for(let Y=1;YV5(B,U.slice(0,U.length-1)),nK=(B)=>B[B.length-1],D8={DOCUMENT:"file",PARAGRAPH:"paragraph"},GB=new U5,sK=new Uint8Array([255,254]),oK=new Uint8Array([254,255]),YB=(B,U)=>{if(B.length!==U.length)return!1;for(let G=0;GN.name==="w:document");if(x&&x.attributes){for(let N of["mc","wp","r","w15","m"])x.attributes[`xmlns:${N}`]=v1[N];x.attributes["mc:Ignorable"]=`${x.attributes["mc:Ignorable"]||""} w15`.trim()}}if(v.startsWith("word/")&&!v.endsWith(".xml.rels")){let x={file:W,viewWrapper:{Relationships:{addRelationship:(b,c,T,m)=>{D.push({key:v,hyperlink:{id:b,link:T}})}}},stack:[]};if(M.set(v,x),!(K===null||K===void 0?void 0:K.start.trim())||!(K===null||K===void 0?void 0:K.end.trim()))throw Error("Both start and end delimiters must be non-empty strings.");let{start:N,end:a}=K;for(let[b,c]of Object.entries(Y)){let T=`${N}${b}${a}`;while(!0){let{didFindOccurrence:m}=rK({json:$,patch:L0(L0({},c),{},{children:c.children.map((B0)=>{if(B0 instanceof o8){let i=new m2(B0.options.children,O1());return D.push({key:v,hyperlink:{id:i.linkId,link:B0.options.link}}),i}else return B0})}),patchText:T,context:x,keepOriginalStyles:Q});if(!Z||!m)break}}let U0=GB.getMediaData(JSON.stringify($),x.file.Media);if(U0.length>0)w=!0,F.push({key:v,mediaDatas:U0})}I.set(v,$)}for(let{key:v,mediaDatas:S}of F){var E;let H=`word/_rels/${v.split("/").pop()}.rels`,X=(E=I.get(H))!==null&&E!==void 0?E:ZB();I.set(H,X);let $=_K(X),x=GB.replace(JSON.stringify(I.get(v)),S,$);I.set(v,JSON.parse(x));for(let N=0;N{return(0,_1.js2xml)(B,{attributeValueFn:(U)=>String(U).replace(/&(?!amp;|lt;|gt;|quot;|apos;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")})},ZB=()=>({declaration:{attributes:{version:"1.0",encoding:"UTF-8",standalone:"yes"}},elements:[{type:"element",name:"Relationships",attributes:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},elements:[]}]}),B7=function(){var B=M6(function*({data:U}){let G=U instanceof h2.default?U:yield h2.default.loadAsync(U),Y=new Set;for(let[Q,K]of Object.entries(G.files)){if(!Q.endsWith(".xml")&&!Q.endsWith(".rels"))continue;if(Q.startsWith("word/")&&!Q.endsWith(".xml.rels"))K5(l1(yield K.async("text"))).forEach((Z)=>U7(Z.text).forEach((J)=>Y.add(J)))}return Array.from(Y)});return function(G){return B.apply(this,arguments)}}(),U7=(B)=>{var U;let G=new RegExp("(?<=\\{\\{).+?(?=\\}\\})","gs");return(U=B.match(G))!==null&&U!==void 0?U:[]};if(typeof globalThis.Buffer>"u")globalThis.Buffer=J0;if(typeof globalThis.process>"u")globalThis.process=G7;globalThis.__bundles=globalThis.__bundles||{};globalThis.__bundles.docx=R6;})(); diff --git a/apps/sim/lib/execution/sandbox/bundles/pptxgenjs.cjs b/apps/sim/lib/execution/sandbox/bundles/pptxgenjs.cjs index e94399f1d4a..2de5cfcc238 100644 --- a/apps/sim/lib/execution/sandbox/bundles/pptxgenjs.cjs +++ b/apps/sim/lib/execution/sandbox/bundles/pptxgenjs.cjs @@ -1,35 +1,35 @@ // sandbox bundle: pptxgenjs // generated by apps/sim/lib/execution/sandbox/bundles/build.ts // do not edit by hand. run `bun run build:sandbox-bundles` to regenerate. -(()=>{var vJ=Object.create;var{getPrototypeOf:fJ,defineProperty:X6,getOwnPropertyNames:$9,getOwnPropertyDescriptor:RJ}=Object,Q9=Object.prototype.hasOwnProperty;var q9=($,q,Q)=>{Q=$!=null?vJ(fJ($)):{};let K=q||!$||!$.__esModule?X6(Q,"default",{value:$,enumerable:!0}):Q;for(let J of $9($))if(!Q9.call(K,J))X6(K,J,{get:()=>$[J],enumerable:!0});return K},e7=new WeakMap,X0=($)=>{var q=e7.get($),Q;if(q)return q;if(q=X6({},"__esModule",{value:!0}),$&&typeof $==="object"||typeof $==="function")$9($).map((K)=>!Q9.call(q,K)&&X6(q,K,{get:()=>$[K],enumerable:!(Q=RJ($,K))||Q.enumerable}));return e7.set($,q),q},N0=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports);var c1=($,q)=>{for(var Q in q)X6($,Q,{get:q[Q],enumerable:!0,configurable:!0,set:(K)=>q[Q]=()=>K})};var b1=($,q)=>()=>($&&(q=$($=0)),q);var K9=(($)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy($,{get:(q,Q)=>(typeof require<"u"?require:q)[Q]}):$)(function($){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+$+'" is not supported')});var K2={};c1(K2,{transcode:()=>GV,resolveObjectURL:()=>VV,kStringMaxLength:()=>M9,kMaxLength:()=>y6,isUtf8:()=>UV,isAscii:()=>ZV,default:()=>WV,constants:()=>OJ,btoa:()=>XJ,atob:()=>yJ,INSPECT_MAX_BYTES:()=>F9,File:()=>hJ,Buffer:()=>o,Blob:()=>xJ});function IJ($){var q=$.length;if(q%4>0)throw Error("Invalid string. Length must be a multiple of 4");var Q=$.indexOf("=");if(Q===-1)Q=q;var K=Q===q?0:4-Q%4;return[Q,K]}function CJ($,q){return($+q)*3/4-q}function jJ($){var q,Q=IJ($),K=Q[0],J=Q[1],Z=new Uint8Array(CJ(K,J)),G=0,W=J>0?K-4:K,B;for(B=0;B>16&255,Z[G++]=q>>8&255,Z[G++]=q&255;if(J===2)q=F2[$.charCodeAt(B)]<<2|F2[$.charCodeAt(B+1)]>>4,Z[G++]=q&255;if(J===1)q=F2[$.charCodeAt(B)]<<10|F2[$.charCodeAt(B+1)]<<4|F2[$.charCodeAt(B+2)]>>2,Z[G++]=q>>8&255,Z[G++]=q&255;return Z}function gJ($){return I2[$>>18&63]+I2[$>>12&63]+I2[$>>6&63]+I2[$&63]}function AJ($,q,Q){var K,J=[];for(var Z=q;ZW?W:G+Z));if(K===1)q=$[Q-1],J.push(I2[q>>2]+I2[q<<4&63]+"==");else if(K===2)q=($[Q-2]<<8)+$[Q-1],J.push(I2[q>>10]+I2[q>>4&63]+I2[q<<2&63]+"=");return J.join("")}function N8($,q,Q,K,J){var Z,G,W=J*8-K-1,B=(1<>1,U=-7,w=Q?J-1:0,F=Q?-1:1,M=$[q+w];w+=F,Z=M&(1<<-U)-1,M>>=-U,U+=W;for(;U>0;Z=Z*256+$[q+w],w+=F,U-=8);G=Z&(1<<-U)-1,Z>>=-U,U+=K;for(;U>0;G=G*256+$[q+w],w+=F,U-=8);if(Z===0)Z=1-V;else if(Z===B)return G?NaN:(M?-1:1)*(1/0);else G=G+Math.pow(2,K),Z=Z-V;return(M?-1:1)*G*Math.pow(2,Z-K)}function z9($,q,Q,K,J,Z){var G,W,B,V=Z*8-J-1,U=(1<>1,F=J===23?Math.pow(2,-24)-Math.pow(2,-77):0,M=K?0:Z-1,k=K?1:-1,f=q<0||q===0&&1/q<0?1:0;if(q=Math.abs(q),isNaN(q)||q===1/0)W=isNaN(q)?1:0,G=U;else{if(G=Math.floor(Math.log(q)/Math.LN2),q*(B=Math.pow(2,-G))<1)G--,B*=2;if(G+w>=1)q+=F/B;else q+=F*Math.pow(2,1-w);if(q*B>=2)G++,B/=2;if(G+w>=U)W=0,G=U;else if(G+w>=1)W=(q*B-1)*Math.pow(2,J),G=G+w;else W=q*Math.pow(2,w-1)*Math.pow(2,J),G=0}for(;J>=8;$[Q+M]=W&255,M+=k,W/=256,J-=8);G=G<0;$[Q+M]=G&255,M+=k,G/=256,V-=8);$[Q+M-k]|=f*128}function S2($){if($>y6)throw RangeError('The value "'+$+'" is invalid for option "size"');let q=new Uint8Array($);return Object.setPrototypeOf(q,o.prototype),q}function h5($,q,Q){return class extends Q{constructor(){super();Object.defineProperty(this,"message",{value:q.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${$}]`,this.stack,delete this.name}get code(){return $}set code(K){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:K,writable:!0})}toString(){return`${this.name} [${$}]: ${this.message}`}}}function o($,q,Q){if(typeof $==="number"){if(typeof q==="string")throw TypeError('The "string" argument must be of type string. Received type number');return x5($)}return w9($,q,Q)}function w9($,q,Q){if(typeof $==="string")return SJ($,q);if(ArrayBuffer.isView($))return EJ($);if($==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof $);if(C2($,ArrayBuffer)||$&&C2($.buffer,ArrayBuffer))return X5($,q,Q);if(typeof SharedArrayBuffer<"u"&&(C2($,SharedArrayBuffer)||$&&C2($.buffer,SharedArrayBuffer)))return X5($,q,Q);if(typeof $==="number")throw TypeError('The "value" argument must not be of type number. Received type number');let K=$.valueOf&&$.valueOf();if(K!=null&&K!==$)return o.from(K,q,Q);let J=_J($);if(J)return J;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof $[Symbol.toPrimitive]==="function")return o.from($[Symbol.toPrimitive]("string"),q,Q);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof $)}function N9($){if(typeof $!=="number")throw TypeError('"size" argument must be of type number');else if($<0)throw RangeError('The value "'+$+'" is invalid for option "size"')}function uJ($,q,Q){if(N9($),$<=0)return S2($);if(q!==void 0)return typeof Q==="string"?S2($).fill(q,Q):S2($).fill(q);return S2($)}function x5($){return N9($),S2($<0?0:O5($)|0)}function SJ($,q){if(typeof q!=="string"||q==="")q="utf8";if(!o.isEncoding(q))throw TypeError("Unknown encoding: "+q);let Q=Y9($,q)|0,K=S2(Q),J=K.write($,q);if(J!==Q)K=K.slice(0,J);return K}function A5($){let q=$.length<0?0:O5($.length)|0,Q=S2(q);for(let K=0;K=y6)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+y6.toString(16)+" bytes");return $|0}function Y9($,q){if(o.isBuffer($))return $.length;if(ArrayBuffer.isView($)||C2($,ArrayBuffer))return $.byteLength;if(typeof $!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof $);let Q=$.length,K=arguments.length>2&&arguments[2]===!0;if(!K&&Q===0)return 0;let J=!1;for(;;)switch(q){case"ascii":case"latin1":case"binary":return Q;case"utf8":case"utf-8":return y5($).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q*2;case"hex":return Q>>>1;case"base64":return C9($).length;default:if(J)return K?-1:y5($).length;q=(""+q).toLowerCase(),J=!0}}function cJ($,q,Q){let K=!1;if(q===void 0||q<0)q=0;if(q>this.length)return"";if(Q===void 0||Q>this.length)Q=this.length;if(Q<=0)return"";if(Q>>>=0,q>>>=0,Q<=q)return"";if(!$)$="utf8";while(!0)switch($){case"hex":return rJ(this,q,Q);case"utf8":case"utf-8":return D9(this,q,Q);case"ascii":return aJ(this,q,Q);case"latin1":case"binary":return lJ(this,q,Q);case"base64":return iJ(this,q,Q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return sJ(this,q,Q);default:if(K)throw TypeError("Unknown encoding: "+$);$=($+"").toLowerCase(),K=!0}}function w1($,q,Q){let K=$[q];$[q]=$[Q],$[Q]=K}function k9($,q,Q,K,J){if($.length===0)return-1;if(typeof Q==="string")K=Q,Q=0;else if(Q>2147483647)Q=2147483647;else if(Q<-2147483648)Q=-2147483648;if(Q=+Q,Number.isNaN(Q))Q=J?0:$.length-1;if(Q<0)Q=$.length+Q;if(Q>=$.length)if(J)return-1;else Q=$.length-1;else if(Q<0)if(J)Q=0;else return-1;if(typeof q==="string")q=o.from(q,K);if(o.isBuffer(q)){if(q.length===0)return-1;return G9($,q,Q,K,J)}else if(typeof q==="number"){if(q=q&255,typeof Uint8Array.prototype.indexOf==="function")if(J)return Uint8Array.prototype.indexOf.call($,q,Q);else return Uint8Array.prototype.lastIndexOf.call($,q,Q);return G9($,[q],Q,K,J)}throw TypeError("val must be string, number or Buffer")}function G9($,q,Q,K,J){let Z=1,G=$.length,W=q.length;if(K!==void 0){if(K=String(K).toLowerCase(),K==="ucs2"||K==="ucs-2"||K==="utf16le"||K==="utf-16le"){if($.length<2||q.length<2)return-1;Z=2,G/=2,W/=2,Q/=2}}function B(U,w){if(Z===1)return U[w];else return U.readUInt16BE(w*Z)}let V;if(J){let U=-1;for(V=Q;VG)Q=G-W;for(V=Q;V>=0;V--){let U=!0;for(let w=0;wJ)K=J;let Z=q.length;if(K>Z/2)K=Z/2;let G;for(G=0;G239?4:Z>223?3:Z>191?2:1;if(J+W<=Q){let B,V,U,w;switch(W){case 1:if(Z<128)G=Z;break;case 2:if(B=$[J+1],(B&192)===128){if(w=(Z&31)<<6|B&63,w>127)G=w}break;case 3:if(B=$[J+1],V=$[J+2],(B&192)===128&&(V&192)===128){if(w=(Z&15)<<12|(B&63)<<6|V&63,w>2047&&(w<55296||w>57343))G=w}break;case 4:if(B=$[J+1],V=$[J+2],U=$[J+3],(B&192)===128&&(V&192)===128&&(U&192)===128){if(w=(Z&15)<<18|(B&63)<<12|(V&63)<<6|U&63,w>65535&&w<1114112)G=w}}}if(G===null)G=65533,W=1;else if(G>65535)G-=65536,K.push(G>>>10&1023|55296),G=56320|G&1023;K.push(G),J+=W}return oJ(K)}function oJ($){let q=$.length;if(q<=W9)return String.fromCharCode.apply(String,$);let Q="",K=0;while(KK)Q=K;let J="";for(let Z=q;ZQ)throw RangeError("Trying to access beyond buffer length")}function s0($,q,Q,K,J,Z){if(!o.isBuffer($))throw TypeError('"buffer" argument must be a Buffer instance');if(q>J||q$.length)throw RangeError("Index out of range")}function L9($,q,Q,K,J){I9(q,K,J,$,Q,7);let Z=Number(q&BigInt(4294967295));$[Q++]=Z,Z=Z>>8,$[Q++]=Z,Z=Z>>8,$[Q++]=Z,Z=Z>>8,$[Q++]=Z;let G=Number(q>>BigInt(32)&BigInt(4294967295));return $[Q++]=G,G=G>>8,$[Q++]=G,G=G>>8,$[Q++]=G,G=G>>8,$[Q++]=G,Q}function H9($,q,Q,K,J){I9(q,K,J,$,Q,7);let Z=Number(q&BigInt(4294967295));$[Q+7]=Z,Z=Z>>8,$[Q+6]=Z,Z=Z>>8,$[Q+5]=Z,Z=Z>>8,$[Q+4]=Z;let G=Number(q>>BigInt(32)&BigInt(4294967295));return $[Q+3]=G,G=G>>8,$[Q+2]=G,G=G>>8,$[Q+1]=G,G=G>>8,$[Q]=G,Q+8}function v9($,q,Q,K,J,Z){if(Q+K>$.length)throw RangeError("Index out of range");if(Q<0)throw RangeError("Index out of range")}function f9($,q,Q,K,J){if(q=+q,Q=Q>>>0,!J)v9($,q,Q,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return z9($,q,Q,K,23,4),Q+4}function R9($,q,Q,K,J){if(q=+q,Q=Q>>>0,!J)v9($,q,Q,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return z9($,q,Q,K,52,8),Q+8}function B9($){let q="",Q=$.length,K=$[0]==="-"?1:0;for(;Q>=K+4;Q-=3)q=`_${$.slice(Q-3,Q)}${q}`;return`${$.slice(0,Q)}${q}`}function tJ($,q,Q){if(n1(q,"offset"),$[q]===void 0||$[q+Q]===void 0)h6(q,$.length-(Q+1))}function I9($,q,Q,K,J,Z){if($>Q||$3)if(q===0||q===BigInt(0))W=`>= 0${G} and < 2${G} ** ${(Z+1)*8}${G}`;else W=`>= -(2${G} ** ${(Z+1)*8-1}${G}) and < 2 ** ${(Z+1)*8-1}${G}`;else W=`>= ${q}${G} and <= ${Q}${G}`;throw new g5("value",W,$)}tJ(K,J,Z)}function n1($,q){if(typeof $!=="number")throw new TJ(q,"number",$)}function h6($,q,Q){if(Math.floor($)!==$)throw n1($,Q),new g5(Q||"offset","an integer",$);if(q<0)throw new PJ;throw new g5(Q||"offset",`>= ${Q?1:0} and <= ${q}`,$)}function $V($){if($=$.split("=")[0],$=$.trim().replace(eJ,""),$.length<2)return"";while($.length%4!==0)$=$+"=";return $}function y5($,q){q=q||1/0;let Q,K=$.length,J=null,Z=[];for(let G=0;G55295&&Q<57344){if(!J){if(Q>56319){if((q-=3)>-1)Z.push(239,191,189);continue}else if(G+1===K){if((q-=3)>-1)Z.push(239,191,189);continue}J=Q;continue}if(Q<56320){if((q-=3)>-1)Z.push(239,191,189);J=Q;continue}Q=(J-55296<<10|Q-56320)+65536}else if(J){if((q-=3)>-1)Z.push(239,191,189)}if(J=null,Q<128){if((q-=1)<0)break;Z.push(Q)}else if(Q<2048){if((q-=2)<0)break;Z.push(Q>>6|192,Q&63|128)}else if(Q<65536){if((q-=3)<0)break;Z.push(Q>>12|224,Q>>6&63|128,Q&63|128)}else if(Q<1114112){if((q-=4)<0)break;Z.push(Q>>18|240,Q>>12&63|128,Q>>6&63|128,Q&63|128)}else throw Error("Invalid code point")}return Z}function QV($){let q=[];for(let Q=0;Q<$.length;++Q)q.push($.charCodeAt(Q)&255);return q}function qV($,q){let Q,K,J,Z=[];for(let G=0;G<$.length;++G){if((q-=2)<0)break;Q=$.charCodeAt(G),K=Q>>8,J=Q%256,Z.push(J),Z.push(K)}return Z}function C9($){return jJ($V($))}function Y8($,q,Q,K){let J;for(J=0;J=q.length||J>=$.length)break;q[J+Q]=$[J]}return J}function C2($,q){return $ instanceof q||$!=null&&$.constructor!=null&&$.constructor.name!=null&&$.constructor.name===q.name}function l2($){return typeof BigInt>"u"?JV:$}function JV(){throw Error("BigInt not supported")}function P5($){return()=>{throw Error($+" is not implemented for node:buffer browser polyfill")}}var I2,F2,j5="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",M1,V9,Z9,F9=50,y6=2147483647,M9=536870888,XJ,yJ,hJ,xJ,OJ,PJ,TJ,g5,W9=4096,eJ,KV,VV,UV,ZV=($)=>{for(let q of $)if(q.charCodeAt(0)>127)return!1;return!0},GV,WV;var t0=b1(()=>{I2=[],F2=[];for(M1=0,V9=j5.length;M14294967296)J=B9(String(Q));else if(typeof Q==="bigint"){if(J=String(Q),Q>BigInt(2)**BigInt(32)||Q<-(BigInt(2)**BigInt(32)))J=B9(J);J+="n"}return K+=` It must be ${q}. Received ${J}`,K},RangeError);Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(!o.isBuffer(this))return;return this.buffer}});Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(!o.isBuffer(this))return;return this.byteOffset}});o.poolSize=8192;o.from=function($,q,Q){return w9($,q,Q)};Object.setPrototypeOf(o.prototype,Uint8Array.prototype);Object.setPrototypeOf(o,Uint8Array);o.alloc=function($,q,Q){return uJ($,q,Q)};o.allocUnsafe=function($){return x5($)};o.allocUnsafeSlow=function($){return x5($)};o.isBuffer=function($){return $!=null&&$._isBuffer===!0&&$!==o.prototype};o.compare=function($,q){if(C2($,Uint8Array))$=o.from($,$.offset,$.byteLength);if(C2(q,Uint8Array))q=o.from(q,q.offset,q.byteLength);if(!o.isBuffer($)||!o.isBuffer(q))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if($===q)return 0;let Q=$.length,K=q.length;for(let J=0,Z=Math.min(Q,K);JK.length){if(!o.isBuffer(Z))Z=o.from(Z);Z.copy(K,J)}else Uint8Array.prototype.set.call(K,Z,J);else if(!o.isBuffer(Z))throw TypeError('"list" argument must be an Array of Buffers');else Z.copy(K,J);J+=Z.length}return K};o.byteLength=Y9;o.prototype._isBuffer=!0;o.prototype.swap16=function(){let $=this.length;if($%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let q=0;q<$;q+=2)w1(this,q,q+1);return this};o.prototype.swap32=function(){let $=this.length;if($%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let q=0;q<$;q+=4)w1(this,q,q+3),w1(this,q+1,q+2);return this};o.prototype.swap64=function(){let $=this.length;if($%8!==0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let q=0;q<$;q+=8)w1(this,q,q+7),w1(this,q+1,q+6),w1(this,q+2,q+5),w1(this,q+3,q+4);return this};o.prototype.toString=function(){let $=this.length;if($===0)return"";if(arguments.length===0)return D9(this,0,$);return cJ.apply(this,arguments)};o.prototype.toLocaleString=o.prototype.toString;o.prototype.equals=function($){if(!o.isBuffer($))throw TypeError("Argument must be a Buffer");if(this===$)return!0;return o.compare(this,$)===0};o.prototype.inspect=function(){let $="",q=F9;if($=this.toString("hex",0,q).replace(/(.{2})/g,"$1 ").trim(),this.length>q)$+=" ... ";return""};if(Z9)o.prototype[Z9]=o.prototype.inspect;o.prototype.compare=function($,q,Q,K,J){if(C2($,Uint8Array))$=o.from($,$.offset,$.byteLength);if(!o.isBuffer($))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof $);if(q===void 0)q=0;if(Q===void 0)Q=$?$.length:0;if(K===void 0)K=0;if(J===void 0)J=this.length;if(q<0||Q>$.length||K<0||J>this.length)throw RangeError("out of range index");if(K>=J&&q>=Q)return 0;if(K>=J)return-1;if(q>=Q)return 1;if(q>>>=0,Q>>>=0,K>>>=0,J>>>=0,this===$)return 0;let Z=J-K,G=Q-q,W=Math.min(Z,G),B=this.slice(K,J),V=$.slice(q,Q);for(let U=0;U>>0,isFinite(Q)){if(Q=Q>>>0,K===void 0)K="utf8"}else K=Q,Q=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let J=this.length-q;if(Q===void 0||Q>J)Q=J;if($.length>0&&(Q<0||q<0)||q>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!K)K="utf8";let Z=!1;for(;;)switch(K){case"hex":return bJ(this,$,q,Q);case"utf8":case"utf-8":return nJ(this,$,q,Q);case"ascii":case"latin1":case"binary":return dJ(this,$,q,Q);case"base64":return mJ(this,$,q,Q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pJ(this,$,q,Q);default:if(Z)throw TypeError("Unknown encoding: "+K);K=(""+K).toLowerCase(),Z=!0}};o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};o.prototype.slice=function($,q){let Q=this.length;if($=~~$,q=q===void 0?Q:~~q,$<0){if($+=Q,$<0)$=0}else if($>Q)$=Q;if(q<0){if(q+=Q,q<0)q=0}else if(q>Q)q=Q;if(q<$)q=$;let K=this.subarray($,q);return Object.setPrototypeOf(K,o.prototype),K};o.prototype.readUintLE=o.prototype.readUIntLE=function($,q,Q){if($=$>>>0,q=q>>>0,!Q)b0($,q,this.length);let K=this[$],J=1,Z=0;while(++Z>>0,q=q>>>0,!Q)b0($,q,this.length);let K=this[$+--q],J=1;while(q>0&&(J*=256))K+=this[$+--q]*J;return K};o.prototype.readUint8=o.prototype.readUInt8=function($,q){if($=$>>>0,!q)b0($,1,this.length);return this[$]};o.prototype.readUint16LE=o.prototype.readUInt16LE=function($,q){if($=$>>>0,!q)b0($,2,this.length);return this[$]|this[$+1]<<8};o.prototype.readUint16BE=o.prototype.readUInt16BE=function($,q){if($=$>>>0,!q)b0($,2,this.length);return this[$]<<8|this[$+1]};o.prototype.readUint32LE=o.prototype.readUInt32LE=function($,q){if($=$>>>0,!q)b0($,4,this.length);return(this[$]|this[$+1]<<8|this[$+2]<<16)+this[$+3]*16777216};o.prototype.readUint32BE=o.prototype.readUInt32BE=function($,q){if($=$>>>0,!q)b0($,4,this.length);return this[$]*16777216+(this[$+1]<<16|this[$+2]<<8|this[$+3])};o.prototype.readBigUInt64LE=l2(function($){$=$>>>0,n1($,"offset");let q=this[$],Q=this[$+7];if(q===void 0||Q===void 0)h6($,this.length-8);let K=q+this[++$]*256+this[++$]*65536+this[++$]*16777216,J=this[++$]+this[++$]*256+this[++$]*65536+Q*16777216;return BigInt(K)+(BigInt(J)<>>0,n1($,"offset");let q=this[$],Q=this[$+7];if(q===void 0||Q===void 0)h6($,this.length-8);let K=q*16777216+this[++$]*65536+this[++$]*256+this[++$],J=this[++$]*16777216+this[++$]*65536+this[++$]*256+Q;return(BigInt(K)<>>0,q=q>>>0,!Q)b0($,q,this.length);let K=this[$],J=1,Z=0;while(++Z=J)K-=Math.pow(2,8*q);return K};o.prototype.readIntBE=function($,q,Q){if($=$>>>0,q=q>>>0,!Q)b0($,q,this.length);let K=q,J=1,Z=this[$+--K];while(K>0&&(J*=256))Z+=this[$+--K]*J;if(J*=128,Z>=J)Z-=Math.pow(2,8*q);return Z};o.prototype.readInt8=function($,q){if($=$>>>0,!q)b0($,1,this.length);if(!(this[$]&128))return this[$];return(255-this[$]+1)*-1};o.prototype.readInt16LE=function($,q){if($=$>>>0,!q)b0($,2,this.length);let Q=this[$]|this[$+1]<<8;return Q&32768?Q|4294901760:Q};o.prototype.readInt16BE=function($,q){if($=$>>>0,!q)b0($,2,this.length);let Q=this[$+1]|this[$]<<8;return Q&32768?Q|4294901760:Q};o.prototype.readInt32LE=function($,q){if($=$>>>0,!q)b0($,4,this.length);return this[$]|this[$+1]<<8|this[$+2]<<16|this[$+3]<<24};o.prototype.readInt32BE=function($,q){if($=$>>>0,!q)b0($,4,this.length);return this[$]<<24|this[$+1]<<16|this[$+2]<<8|this[$+3]};o.prototype.readBigInt64LE=l2(function($){$=$>>>0,n1($,"offset");let q=this[$],Q=this[$+7];if(q===void 0||Q===void 0)h6($,this.length-8);let K=this[$+4]+this[$+5]*256+this[$+6]*65536+(Q<<24);return(BigInt(K)<>>0,n1($,"offset");let q=this[$],Q=this[$+7];if(q===void 0||Q===void 0)h6($,this.length-8);let K=(q<<24)+this[++$]*65536+this[++$]*256+this[++$];return(BigInt(K)<>>0,!q)b0($,4,this.length);return N8(this,$,!0,23,4)};o.prototype.readFloatBE=function($,q){if($=$>>>0,!q)b0($,4,this.length);return N8(this,$,!1,23,4)};o.prototype.readDoubleLE=function($,q){if($=$>>>0,!q)b0($,8,this.length);return N8(this,$,!0,52,8)};o.prototype.readDoubleBE=function($,q){if($=$>>>0,!q)b0($,8,this.length);return N8(this,$,!1,52,8)};o.prototype.writeUintLE=o.prototype.writeUIntLE=function($,q,Q,K){if($=+$,q=q>>>0,Q=Q>>>0,!K){let G=Math.pow(2,8*Q)-1;s0(this,$,q,Q,G,0)}let J=1,Z=0;this[q]=$&255;while(++Z>>0,Q=Q>>>0,!K){let G=Math.pow(2,8*Q)-1;s0(this,$,q,Q,G,0)}let J=Q-1,Z=1;this[q+J]=$&255;while(--J>=0&&(Z*=256))this[q+J]=$/Z&255;return q+Q};o.prototype.writeUint8=o.prototype.writeUInt8=function($,q,Q){if($=+$,q=q>>>0,!Q)s0(this,$,q,1,255,0);return this[q]=$&255,q+1};o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function($,q,Q){if($=+$,q=q>>>0,!Q)s0(this,$,q,2,65535,0);return this[q]=$&255,this[q+1]=$>>>8,q+2};o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function($,q,Q){if($=+$,q=q>>>0,!Q)s0(this,$,q,2,65535,0);return this[q]=$>>>8,this[q+1]=$&255,q+2};o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function($,q,Q){if($=+$,q=q>>>0,!Q)s0(this,$,q,4,4294967295,0);return this[q+3]=$>>>24,this[q+2]=$>>>16,this[q+1]=$>>>8,this[q]=$&255,q+4};o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function($,q,Q){if($=+$,q=q>>>0,!Q)s0(this,$,q,4,4294967295,0);return this[q]=$>>>24,this[q+1]=$>>>16,this[q+2]=$>>>8,this[q+3]=$&255,q+4};o.prototype.writeBigUInt64LE=l2(function($,q=0){return L9(this,$,q,BigInt(0),BigInt("0xffffffffffffffff"))});o.prototype.writeBigUInt64BE=l2(function($,q=0){return H9(this,$,q,BigInt(0),BigInt("0xffffffffffffffff"))});o.prototype.writeIntLE=function($,q,Q,K){if($=+$,q=q>>>0,!K){let W=Math.pow(2,8*Q-1);s0(this,$,q,Q,W-1,-W)}let J=0,Z=1,G=0;this[q]=$&255;while(++J>0)-G&255}return q+Q};o.prototype.writeIntBE=function($,q,Q,K){if($=+$,q=q>>>0,!K){let W=Math.pow(2,8*Q-1);s0(this,$,q,Q,W-1,-W)}let J=Q-1,Z=1,G=0;this[q+J]=$&255;while(--J>=0&&(Z*=256)){if($<0&&G===0&&this[q+J+1]!==0)G=1;this[q+J]=($/Z>>0)-G&255}return q+Q};o.prototype.writeInt8=function($,q,Q){if($=+$,q=q>>>0,!Q)s0(this,$,q,1,127,-128);if($<0)$=255+$+1;return this[q]=$&255,q+1};o.prototype.writeInt16LE=function($,q,Q){if($=+$,q=q>>>0,!Q)s0(this,$,q,2,32767,-32768);return this[q]=$&255,this[q+1]=$>>>8,q+2};o.prototype.writeInt16BE=function($,q,Q){if($=+$,q=q>>>0,!Q)s0(this,$,q,2,32767,-32768);return this[q]=$>>>8,this[q+1]=$&255,q+2};o.prototype.writeInt32LE=function($,q,Q){if($=+$,q=q>>>0,!Q)s0(this,$,q,4,2147483647,-2147483648);return this[q]=$&255,this[q+1]=$>>>8,this[q+2]=$>>>16,this[q+3]=$>>>24,q+4};o.prototype.writeInt32BE=function($,q,Q){if($=+$,q=q>>>0,!Q)s0(this,$,q,4,2147483647,-2147483648);if($<0)$=4294967295+$+1;return this[q]=$>>>24,this[q+1]=$>>>16,this[q+2]=$>>>8,this[q+3]=$&255,q+4};o.prototype.writeBigInt64LE=l2(function($,q=0){return L9(this,$,q,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});o.prototype.writeBigInt64BE=l2(function($,q=0){return H9(this,$,q,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});o.prototype.writeFloatLE=function($,q,Q){return f9(this,$,q,!0,Q)};o.prototype.writeFloatBE=function($,q,Q){return f9(this,$,q,!1,Q)};o.prototype.writeDoubleLE=function($,q,Q){return R9(this,$,q,!0,Q)};o.prototype.writeDoubleBE=function($,q,Q){return R9(this,$,q,!1,Q)};o.prototype.copy=function($,q,Q,K){if(!o.isBuffer($))throw TypeError("argument should be a Buffer");if(!Q)Q=0;if(!K&&K!==0)K=this.length;if(q>=$.length)q=$.length;if(!q)q=0;if(K>0&&K=this.length)throw RangeError("Index out of range");if(K<0)throw RangeError("sourceEnd out of bounds");if(K>this.length)K=this.length;if($.length-q>>0,Q=Q===void 0?this.length:Q>>>0,!$)$=0;let J;if(typeof $==="number")for(J=q;J{var S0=X9.exports={},j2,g2;function T5(){throw Error("setTimeout has not been defined")}function u5(){throw Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function")j2=setTimeout;else j2=T5}catch($){j2=T5}try{if(typeof clearTimeout==="function")g2=clearTimeout;else g2=u5}catch($){g2=u5}})();function j9($){if(j2===setTimeout)return setTimeout($,0);if((j2===T5||!j2)&&setTimeout)return j2=setTimeout,setTimeout($,0);try{return j2($,0)}catch(q){try{return j2.call(null,$,0)}catch(Q){return j2.call(this,$,0)}}}function BV($){if(g2===clearTimeout)return clearTimeout($);if((g2===u5||!g2)&&clearTimeout)return g2=clearTimeout,clearTimeout($);try{return g2($)}catch(q){try{return g2.call(null,$)}catch(Q){return g2.call(this,$)}}}var E2=[],d1=!1,N1,k8=-1;function zV(){if(!d1||!N1)return;if(d1=!1,N1.length)E2=N1.concat(E2);else k8=-1;if(E2.length)g9()}function g9(){if(d1)return;var $=j9(zV);d1=!0;var q=E2.length;while(q){N1=E2,E2=[];while(++k81)for(var Q=1;Qb9,once:()=>_9,listenerCount:()=>n9,init:()=>r2,getMaxListeners:()=>m9,getEventListeners:()=>c9,default:()=>HV,captureRejectionSymbol:()=>T9,addAbortListener:()=>p9,EventEmitter:()=>r2});function u9($,q){var{_events:Q}=$;if(q[0]??=Error("Unhandled error."),!Q)throw q[0];var K=Q[P9];if(K)for(var J of x9.call(K))J.apply($,q);var Z=Q.error;if(!Z)throw q[0];for(var J of x9.call(Z))J.apply($,q);return!0}function wV($,q,Q,K){q.then(void 0,function(J){queueMicrotask(()=>NV($,J,Q,K))})}function NV($,q,Q,K){if(typeof $[h9]==="function")$[h9](q,Q,...K);else try{$[Y1]=!1,$.emit("error",q)}finally{$[Y1]=!0}}function S9($,q,Q){Q.warned=!0;let K=Error(`Possible EventEmitter memory leak detected. ${Q.length} ${String(q)} listeners added to [${$.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);K.name="MaxListenersExceededWarning",K.emitter=$,K.type=q,K.count=Q.length,console.warn(K)}function E9($,q,...Q){this.removeListener($,q),q.apply(this,Q)}function _9($,q,Q){var K=Q?.signal;if(d9(K,"options.signal"),K?.aborted)throw new S5(void 0,{cause:K?.reason});let{resolve:J,reject:Z,promise:G}=$newPromiseCapability(Promise),W=(U)=>{if($.removeListener(q,B),K!=null)D8(K,"abort",V);Z(U)},B=(...U)=>{if(typeof $.removeListener==="function")$.removeListener("error",W);if(K!=null)D8(K,"abort",V);J(U)};if(O9($,q,B,{once:!0}),q!=="error"&&typeof $.once==="function")$.once("error",W);function V(){D8($,q,B),D8($,"error",W),Z(new S5(void 0,{cause:K?.reason}))}if(K!=null)O9(K,"abort",V,{once:!0});return G}function c9($,q){return $.listeners(q)}function b9($,...q){_5($,"setMaxListeners",0);var Q;if(q&&(Q=q.length))for(let K=0;KK||(Q!=null||K!=null)&&Number.isNaN($))throw DV(q,`${Q!=null?`>= ${Q}`:""}${Q!=null&&K!=null?" && ":""}${K!=null?`<= ${K}`:""}`,$)}function x6($){if(typeof $!=="function")throw TypeError("The listener must be a function")}function LV($,q){if(typeof $!=="boolean")throw m1(q,"boolean",$)}function m9($){return $?._maxListeners??k1}function p9($,q){if($===void 0)throw m1("signal","AbortSignal",$);if(d9($,"signal"),typeof q!=="function")throw m1("listener","function",q);let Q;if($.aborted)queueMicrotask(()=>q());else $.addEventListener("abort",q,{__proto__:null,once:!0}),Q=()=>{$.removeEventListener("abort",q)};return{__proto__:null,[Symbol.dispose](){Q?.()}}}var E5,Y1,P9,FV,MV,h9,T9,x9,k1=10,r2=function($){if(this._events===void 0||this._events===this.__proto__._events)this._events={__proto__:null},this._eventsCount=0;if(this._maxListeners??=void 0,this[Y1]=$?.captureRejections?Boolean($?.captureRejections):y0[Y1])this.emit=kV},y0,YV=function($,...q){if($==="error")return u9(this,q);var{_events:Q}=this;if(Q===void 0)return!1;var K=Q[$];if(K===void 0)return!1;let J=K.length>1?K.slice():K;for(let Z=0,{length:G}=J;Z1?K.slice():K;for(let Z=0,{length:G}=J;Z{E5=Symbol.for,Y1=Symbol("kCapture"),P9=E5("events.errorMonitor"),FV=Symbol("events.maxEventTargetListeners"),MV=Symbol("events.maxEventTargetListenersWarned"),h9=E5("nodejs.rejection"),T9=E5("nodejs.rejection"),x9=Array.prototype.slice,y0=r2.prototype={};y0._events=void 0;y0._eventsCount=0;y0._maxListeners=void 0;y0.setMaxListeners=function($){return _5($,"setMaxListeners",0),this._maxListeners=$,this};y0.constructor=r2;y0.getMaxListeners=function(){return this?._maxListeners??k1};y0.emit=YV;y0.addListener=function($,q){x6(q);var Q=this._events;if(!Q)Q=this._events={__proto__:null},this._eventsCount=0;else if(Q.newListener)this.emit("newListener",$,q.listener??q);var K=Q[$];if(!K)Q[$]=[q],this._eventsCount++;else{K.push(q);var J=this._maxListeners??k1;if(J>0&&K.length>J&&!K.warned)S9(this,$,K)}return this};y0.on=y0.addListener;y0.prependListener=function($,q){x6(q);var Q=this._events;if(!Q)Q=this._events={__proto__:null},this._eventsCount=0;else if(Q.newListener)this.emit("newListener",$,q.listener??q);var K=Q[$];if(!K)Q[$]=[q],this._eventsCount++;else{K.unshift(q);var J=this._maxListeners??k1;if(J>0&&K.length>J&&!K.warned)S9(this,$,K)}return this};y0.once=function($,q){x6(q);let Q=E9.bind(this,$,q);return Q.listener=q,this.addListener($,Q),this};y0.prependOnceListener=function($,q){x6(q);let Q=E9.bind(this,$,q);return Q.listener=q,this.prependListener($,Q),this};y0.removeListener=function($,q){x6(q);var{_events:Q}=this;if(!Q)return this;var K=Q[$];if(!K)return this;var J=K.length;let Z=-1;for(let G=J-1;G>=0;G--)if(K[G]===q||K[G].listener===q){Z=G;break}if(Z<0)return this;if(Z===0)K.shift();else K.splice(Z,1);if(K.length===0)delete Q[$],this._eventsCount--;return this};y0.off=y0.removeListener;y0.removeAllListeners=function($){var{_events:q}=this;if($&&q){if(q[$])delete q[$],this._eventsCount--}else this._events={__proto__:null};return this};y0.listeners=function($){var{_events:q}=this;if(!q)return[];var Q=q[$];if(!Q)return[];return Q.map((K)=>K.listener??K)};y0.rawListeners=function($){var{_events:q}=this;if(!q)return[];var Q=q[$];if(!Q)return[];return Q.slice()};y0.listenerCount=function($){var{_events:q}=this;if(!q)return 0;return q[$]?.length??0};y0.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};y0[Y1]=!1;S5=class S5 extends Error{constructor($="The operation was aborted",q=void 0){if(q!==void 0&&typeof q!=="object")throw m1("options","Object",q);super($,q);this.code="ABORT_ERR",this.name="AbortError"}};Object.defineProperties(r2,{captureRejections:{get(){return y0[Y1]},set($){LV($,"EventEmitter.captureRejections"),y0[Y1]=$},enumerable:!0},defaultMaxListeners:{enumerable:!0,get:()=>{return k1},set:($)=>{_5($,"defaultMaxListeners",0),k1=$}},kMaxEventTargetListeners:{value:FV,enumerable:!1,configurable:!1,writable:!1},kMaxEventTargetListenersWarned:{value:MV,enumerable:!1,configurable:!1,writable:!1}});Object.assign(r2,{once:_9,getEventListeners:c9,getMaxListeners:m9,setMaxListeners:b9,EventEmitter:r2,usingDomains:!1,captureRejectionSymbol:T9,errorMonitor:P9,addAbortListener:p9,init:r2,listenerCount:n9});HV=r2});var a1=N0((Vz,e9)=>{var g0=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports),P0=g0(($,q)=>{class Q extends Error{constructor(K){if(!Array.isArray(K))throw TypeError(`Expected input to be an Array, got ${typeof K}`);let J="";for(let Z=0;Z{q.exports={format(Q,...K){return Q.replace(/%([sdifj])/g,function(...[J,Z]){let G=K.shift();if(Z==="f")return G.toFixed(6);else if(Z==="j")return JSON.stringify(G);else if(Z==="s"&&typeof G==="object")return`${G.constructor!==Object?G.constructor.name:""} {}`.trim();else return G.toString()})},inspect(Q){switch(typeof Q){case"string":if(Q.includes("'")){if(!Q.includes('"'))return`"${Q}"`;else if(!Q.includes("`")&&!Q.includes("${"))return`\`${Q}\``}return`'${Q}'`;case"number":if(isNaN(Q))return"NaN";else if(Object.is(Q,-0))return String(Q);return Q;case"bigint":return`${String(Q)}n`;case"boolean":case"undefined":return String(Q);case"object":return"{}"}}}}),a0=g0(($,q)=>{var{format:Q,inspect:K}=i9(),{AggregateError:J}=P0(),Z=globalThis.AggregateError||J,G=Symbol("kIsNodeError"),W=["string","function","number","object","Function","Object","boolean","bigint","symbol"],B=/^([A-Z][a-z0-9]*)+$/,V={};function U(D,z){if(!D)throw new V.ERR_INTERNAL_ASSERTION(z)}function w(D){let z="",N=D.length,H=D[0]==="-"?1:0;for(;N>=H+4;N-=3)z=`_${D.slice(N-3,N)}${z}`;return`${D.slice(0,N)}${z}`}function F(D,z,N){if(typeof z==="function")return U(z.length<=N.length,`Code: ${D}; The provided arguments length (${N.length}) does not match the required ones (${z.length}).`),z(...N);let H=(z.match(/%[dfijoOs]/g)||[]).length;if(U(H===N.length,`Code: ${D}; The provided arguments length (${N.length}) does not match the required ones (${H}).`),N.length===0)return z;return Q(z,...N)}function M(D,z,N){if(!N)N=Error;class H extends N{constructor(...v){super(F(D,z,v))}toString(){return`${this.name} [${D}]: ${this.message}`}}Object.defineProperties(H.prototype,{name:{value:N.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${D}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),H.prototype.code=D,H.prototype[G]=!0,V[D]=H}function k(D){let z="__node_internal_"+D.name;return Object.defineProperty(D,"name",{value:z}),D}function f(D,z){if(D&&z&&D!==z){if(Array.isArray(z.errors))return z.errors.push(D),z;let N=new Z([z,D],z.message);return N.code=z.code,N}return D||z}class L extends Error{constructor(D="The operation was aborted",z=void 0){if(z!==void 0&&typeof z!=="object")throw new V.ERR_INVALID_ARG_TYPE("options","Object",z);super(D,z);this.code="ABORT_ERR",this.name="AbortError"}}M("ERR_ASSERTION","%s",Error),M("ERR_INVALID_ARG_TYPE",(D,z,N)=>{if(U(typeof D==="string","'name' must be a string"),!Array.isArray(z))z=[z];let H="The ";if(D.endsWith(" argument"))H+=`${D} `;else H+=`"${D}" ${D.includes(".")?"property":"argument"} `;H+="must be ";let v=[],j=[],n=[];for(let _ of z)if(U(typeof _==="string","All expected entries have to be of type string"),W.includes(_))v.push(_.toLowerCase());else if(B.test(_))j.push(_);else U(_!=="object",'The value "object" should be written as "Object"'),n.push(_);if(j.length>0){let _=v.indexOf("object");if(_!==-1)v.splice(v,_,1),j.push("Object")}if(v.length>0){switch(v.length){case 1:H+=`of type ${v[0]}`;break;case 2:H+=`one of type ${v[0]} or ${v[1]}`;break;default:{let _=v.pop();H+=`one of type ${v.join(", ")}, or ${_}`}}if(j.length>0||n.length>0)H+=" or "}if(j.length>0){switch(j.length){case 1:H+=`an instance of ${j[0]}`;break;case 2:H+=`an instance of ${j[0]} or ${j[1]}`;break;default:{let _=j.pop();H+=`an instance of ${j.join(", ")}, or ${_}`}}if(n.length>0)H+=" or "}switch(n.length){case 0:break;case 1:if(n[0].toLowerCase()!==n[0])H+="an ";H+=`${n[0]}`;break;case 2:H+=`one of ${n[0]} or ${n[1]}`;break;default:{let _=n.pop();H+=`one of ${n.join(", ")}, or ${_}`}}if(N==null)H+=`. Received ${N}`;else if(typeof N==="function"&&N.name)H+=`. Received function ${N.name}`;else if(typeof N==="object"){var d;if((d=N.constructor)!==null&&d!==void 0&&d.name)H+=`. Received an instance of ${N.constructor.name}`;else{let _=K(N,{depth:-1});H+=`. Received ${_}`}}else{let _=K(N,{colors:!1});if(_.length>25)_=`${_.slice(0,25)}...`;H+=`. Received type ${typeof N} (${_})`}return H},TypeError),M("ERR_INVALID_ARG_VALUE",(D,z,N="is invalid")=>{let H=K(z);if(H.length>128)H=H.slice(0,128)+"...";return`The ${D.includes(".")?"property":"argument"} '${D}' ${N}. Received ${H}`},TypeError),M("ERR_INVALID_RETURN_VALUE",(D,z,N)=>{var H;let v=N!==null&&N!==void 0&&(H=N.constructor)!==null&&H!==void 0&&H.name?`instance of ${N.constructor.name}`:`type ${typeof N}`;return`Expected ${D} to be returned from the "${z}" function but got ${v}.`},TypeError),M("ERR_MISSING_ARGS",(...D)=>{U(D.length>0,"At least one arg needs to be specified");let z,N=D.length;switch(D=(Array.isArray(D)?D:[D]).map((H)=>`"${H}"`).join(" or "),N){case 1:z+=`The ${D[0]} argument`;break;case 2:z+=`The ${D[0]} and ${D[1]} arguments`;break;default:{let H=D.pop();z+=`The ${D.join(", ")}, and ${H} arguments`}break}return`${z} must be specified`},TypeError),M("ERR_OUT_OF_RANGE",(D,z,N)=>{U(z,'Missing "range" argument');let H;if(Number.isInteger(N)&&Math.abs(N)>4294967296)H=w(String(N));else if(typeof N==="bigint"){H=String(N);let v=BigInt(2)**BigInt(32);if(N>v||N<-v)H=w(H);H+="n"}else H=K(N);return`The value of "${D}" is out of range. It must be ${z}. Received ${H}`},RangeError),M("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),M("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),M("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),M("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),M("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),M("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),M("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),M("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),M("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),M("ERR_STREAM_WRITE_AFTER_END","write after end",Error),M("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),q.exports={AbortError:L,aggregateTwoErrors:k(f),hideStackFrames:k,codes:V}}),vV=g0(($,q)=>{Object.defineProperty($,"__esModule",{value:!0});var Q=new WeakMap,K=new WeakMap;function J(X){let P=Q.get(X);return console.assert(P!=null,"'this' is expected an Event object, but got",X),P}function Z(X){if(X.passiveListener!=null){if(typeof console<"u"&&typeof console.error==="function")console.error("Unable to preventDefault inside passive event listener invocation.",X.passiveListener);return}if(!X.event.cancelable)return;if(X.canceled=!0,typeof X.event.preventDefault==="function")X.event.preventDefault()}function G(X,P){Q.set(this,{eventTarget:X,event:P,eventPhase:2,currentTarget:X,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:P.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let g=Object.keys(P);for(let c=0;c0){let X=Array(arguments.length);for(let P=0;P{Object.defineProperty($,"__esModule",{value:!0});var Q=vV();class K extends Q.EventTarget{constructor(){super();throw TypeError("AbortSignal cannot be constructed directly")}get aborted(){let U=G.get(this);if(typeof U!=="boolean")throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return U}}Q.defineEventAttribute(K.prototype,"abort");function J(){let U=Object.create(K.prototype);return Q.EventTarget.call(U),G.set(U,!1),U}function Z(U){if(G.get(U)!==!1)return;G.set(U,!0),U.dispatchEvent({type:"abort"})}var G=new WeakMap;if(Object.defineProperties(K.prototype,{aborted:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(K.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class W{constructor(){B.set(this,J())}get signal(){return V(this)}abort(){Z(V(this))}}var B=new WeakMap;function V(U){let w=B.get(U);if(w==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${U===null?"null":typeof U}`);return w}if(Object.defineProperties(W.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(W.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});$.AbortController=W,$.AbortSignal=K,$.default=W,q.exports=W,q.exports.AbortController=q.exports.default=W,q.exports.AbortSignal=K}),e0=g0(($,q)=>{var Q=(t0(),X0(K2)),{format:K,inspect:J}=i9(),{codes:{ERR_INVALID_ARG_TYPE:Z}}=a0(),{kResistStopPropagation:G,AggregateError:W,SymbolDispose:B}=P0(),V=globalThis.AbortSignal||O6().AbortSignal,U=globalThis.AbortController||O6().AbortController,w=Object.getPrototypeOf(async function(){}).constructor,F=globalThis.Blob||Q.Blob,M=typeof F<"u"?function(L){return L instanceof F}:function(L){return!1},k=(L,D)=>{if(L!==void 0&&(L===null||typeof L!=="object"||!("aborted"in L)))throw new Z(D,"AbortSignal",L)},f=(L,D)=>{if(typeof L!=="function")throw new Z(D,"Function",L)};q.exports={AggregateError:W,kEmptyObject:Object.freeze({}),once(L){let D=!1;return function(...z){if(D)return;D=!0,L.apply(this,z)}},createDeferredPromise:function(){let L,D;return{promise:new Promise((z,N)=>{L=z,D=N}),resolve:L,reject:D}},promisify(L){return new Promise((D,z)=>{L((N,...H)=>{if(N)return z(N);return D(...H)})})},debuglog(){return function(){}},format:K,inspect:J,types:{isAsyncFunction(L){return L instanceof w},isArrayBufferView(L){return ArrayBuffer.isView(L)}},isBlob:M,deprecate(L,D){return L},addAbortListener:(i1(),X0(p1)).addAbortListener||function(L,D){if(L===void 0)throw new Z("signal","AbortSignal",L);k(L,"signal"),f(D,"listener");let z;if(L.aborted)queueMicrotask(()=>D());else L.addEventListener("abort",D,{__proto__:null,once:!0,[G]:!0}),z=()=>{L.removeEventListener("abort",D)};return{__proto__:null,[B](){var N;(N=z)===null||N===void 0||N()}}},AbortSignalAny:V.any||function(L){if(L.length===1)return L[0];let D=new U,z=()=>D.abort();return L.forEach((N)=>{k(N,"signals"),N.addEventListener("abort",z,{once:!0})}),D.signal.addEventListener("abort",()=>{L.forEach((N)=>N.removeEventListener("abort",z))},{once:!0}),D.signal}},q.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),P6=g0(($,q)=>{var{ArrayIsArray:Q,ArrayPrototypeIncludes:K,ArrayPrototypeJoin:J,ArrayPrototypeMap:Z,NumberIsInteger:G,NumberIsNaN:W,NumberMAX_SAFE_INTEGER:B,NumberMIN_SAFE_INTEGER:V,NumberParseInt:U,ObjectPrototypeHasOwnProperty:w,RegExpPrototypeExec:F,String:M,StringPrototypeToUpperCase:k,StringPrototypeTrim:f}=P0(),{hideStackFrames:L,codes:{ERR_SOCKET_BAD_PORT:D,ERR_INVALID_ARG_TYPE:z,ERR_INVALID_ARG_VALUE:N,ERR_OUT_OF_RANGE:H,ERR_UNKNOWN_SIGNAL:v}}=a0(),{normalizeEncoding:j}=e0(),{isAsyncFunction:n,isArrayBufferView:d}=e0().types,_={};function X(T){return T===(T|0)}function P(T){return T===T>>>0}var g=/^[0-7]+$/,c="must be a 32-bit unsigned integer or an octal string";function h(T,t,G0){if(typeof T>"u")T=G0;if(typeof T==="string"){if(F(g,T)===null)throw new N(t,T,c);T=U(T,8)}return $0(T,t),T}var x=L((T,t,G0=V,Q0=B)=>{if(typeof T!=="number")throw new z(t,"number",T);if(!G(T))throw new H(t,"an integer",T);if(TQ0)throw new H(t,`>= ${G0} && <= ${Q0}`,T)}),l=L((T,t,G0=-2147483648,Q0=2147483647)=>{if(typeof T!=="number")throw new z(t,"number",T);if(!G(T))throw new H(t,"an integer",T);if(TQ0)throw new H(t,`>= ${G0} && <= ${Q0}`,T)}),$0=L((T,t,G0=!1)=>{if(typeof T!=="number")throw new z(t,"number",T);if(!G(T))throw new H(t,"an integer",T);let Q0=G0?1:0,M0=4294967295;if(TM0)throw new H(t,`>= ${Q0} && <= ${M0}`,T)});function Z0(T,t){if(typeof T!=="string")throw new z(t,"string",T)}function F0(T,t,G0=void 0,Q0){if(typeof T!=="number")throw new z(t,"number",T);if(G0!=null&&TQ0||(G0!=null||Q0!=null)&&W(T))throw new H(t,`${G0!=null?`>= ${G0}`:""}${G0!=null&&Q0!=null?" && ":""}${Q0!=null?`<= ${Q0}`:""}`,T)}var p=L((T,t,G0)=>{if(!K(G0,T)){let Q0="must be one of: "+J(Z(G0,(M0)=>typeof M0==="string"?`'${M0}'`:M(M0)),", ");throw new N(t,T,Q0)}});function W0(T,t){if(typeof T!=="boolean")throw new z(t,"boolean",T)}function y(T,t,G0){return T==null||!w(T,t)?G0:T[t]}var i=L((T,t,G0=null)=>{let Q0=y(G0,"allowArray",!1),M0=y(G0,"allowFunction",!1);if(!y(G0,"nullable",!1)&&T===null||!Q0&&Q(T)||typeof T!=="object"&&(!M0||typeof T!=="function"))throw new z(t,"Object",T)}),U0=L((T,t)=>{if(T!=null&&typeof T!=="object"&&typeof T!=="function")throw new z(t,"a dictionary",T)}),m=L((T,t,G0=0)=>{if(!Q(T))throw new z(t,"Array",T);if(T.length{if(!d(T))throw new z(t,["Buffer","TypedArray","DataView"],T)});function E(T,t){let G0=j(t),Q0=T.length;if(G0==="hex"&&Q0%2!==0)throw new N("encoding",t,`is invalid for data of length ${Q0}`)}function a(T,t="Port",G0=!0){if(typeof T!=="number"&&typeof T!=="string"||typeof T==="string"&&f(T).length===0||+T!==+T>>>0||T>65535||T===0&&!G0)throw new D(t,T,G0);return T|0}var K0=L((T,t)=>{if(T!==void 0&&(T===null||typeof T!=="object"||!("aborted"in T)))throw new z(t,"AbortSignal",T)}),R=L((T,t)=>{if(typeof T!=="function")throw new z(t,"Function",T)}),Y=L((T,t)=>{if(typeof T!=="function"||n(T))throw new z(t,"Function",T)}),C=L((T,t)=>{if(T!==void 0)throw new z(t,"undefined",T)});function u(T,t,G0){if(!K(G0,T))throw new z(t,`('${J(G0,"|")}')`,T)}var e=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function r(T,t){if(typeof T>"u"||!F(e,T))throw new N(t,T,'must be an array or string of format "; rel=preload; as=style"')}function s(T){if(typeof T==="string")return r(T,"hints"),T;else if(Q(T)){let t=T.length,G0="";if(t===0)return G0;for(let Q0=0;Q0; rel=preload; as=style"')}q.exports={isInt32:X,isUint32:P,parseFileMode:h,validateArray:m,validateStringArray:V0,validateBooleanArray:w0,validateAbortSignalArray:S,validateBoolean:W0,validateBuffer:O,validateDictionary:U0,validateEncoding:E,validateFunction:R,validateInt32:l,validateInteger:x,validateNumber:F0,validateObject:i,validateOneOf:p,validatePlainFunction:Y,validatePort:a,validateSignalName:b,validateString:Z0,validateUint32:$0,validateUndefined:C,validateUnion:u,validateAbortSignal:K0,validateLinkHeaderValue:s}}),D1=g0(($,q)=>{q.exports=globalThis.process}),b2=g0(($,q)=>{var{SymbolAsyncIterator:Q,SymbolIterator:K,SymbolFor:J}=P0(),Z=J("nodejs.stream.destroyed"),G=J("nodejs.stream.errored"),W=J("nodejs.stream.readable"),B=J("nodejs.stream.writable"),V=J("nodejs.stream.disturbed"),U=J("nodejs.webstream.isClosedPromise"),w=J("nodejs.webstream.controllerErrorFunction");function F(y,i=!1){var U0;return!!(y&&typeof y.pipe==="function"&&typeof y.on==="function"&&(!i||typeof y.pause==="function"&&typeof y.resume==="function")&&(!y._writableState||((U0=y._readableState)===null||U0===void 0?void 0:U0.readable)!==!1)&&(!y._writableState||y._readableState))}function M(y){var i;return!!(y&&typeof y.write==="function"&&typeof y.on==="function"&&(!y._readableState||((i=y._writableState)===null||i===void 0?void 0:i.writable)!==!1))}function k(y){return!!(y&&typeof y.pipe==="function"&&y._readableState&&typeof y.on==="function"&&typeof y.write==="function")}function f(y){return y&&(y._readableState||y._writableState||typeof y.write==="function"&&typeof y.on==="function"||typeof y.pipe==="function"&&typeof y.on==="function")}function L(y){return!!(y&&!f(y)&&typeof y.pipeThrough==="function"&&typeof y.getReader==="function"&&typeof y.cancel==="function")}function D(y){return!!(y&&!f(y)&&typeof y.getWriter==="function"&&typeof y.abort==="function")}function z(y){return!!(y&&!f(y)&&typeof y.readable==="object"&&typeof y.writable==="object")}function N(y){return L(y)||D(y)||z(y)}function H(y,i){if(y==null)return!1;if(i===!0)return typeof y[Q]==="function";if(i===!1)return typeof y[K]==="function";return typeof y[Q]==="function"||typeof y[K]==="function"}function v(y){if(!f(y))return null;let{_writableState:i,_readableState:U0}=y,m=i||U0;return!!(y.destroyed||y[Z]||m!==null&&m!==void 0&&m.destroyed)}function j(y){if(!M(y))return null;if(y.writableEnded===!0)return!0;let i=y._writableState;if(i!==null&&i!==void 0&&i.errored)return!1;if(typeof(i===null||i===void 0?void 0:i.ended)!=="boolean")return null;return i.ended}function n(y,i){if(!M(y))return null;if(y.writableFinished===!0)return!0;let U0=y._writableState;if(U0!==null&&U0!==void 0&&U0.errored)return!1;if(typeof(U0===null||U0===void 0?void 0:U0.finished)!=="boolean")return null;return!!(U0.finished||i===!1&&U0.ended===!0&&U0.length===0)}function d(y){if(!F(y))return null;if(y.readableEnded===!0)return!0;let i=y._readableState;if(!i||i.errored)return!1;if(typeof(i===null||i===void 0?void 0:i.ended)!=="boolean")return null;return i.ended}function _(y,i){if(!F(y))return null;let U0=y._readableState;if(U0!==null&&U0!==void 0&&U0.errored)return!1;if(typeof(U0===null||U0===void 0?void 0:U0.endEmitted)!=="boolean")return null;return!!(U0.endEmitted||i===!1&&U0.ended===!0&&U0.length===0)}function X(y){if(y&&y[W]!=null)return y[W];if(typeof(y===null||y===void 0?void 0:y.readable)!=="boolean")return null;if(v(y))return!1;return F(y)&&y.readable&&!_(y)}function P(y){if(y&&y[B]!=null)return y[B];if(typeof(y===null||y===void 0?void 0:y.writable)!=="boolean")return null;if(v(y))return!1;return M(y)&&y.writable&&!j(y)}function g(y,i){if(!f(y))return null;if(v(y))return!0;if((i===null||i===void 0?void 0:i.readable)!==!1&&X(y))return!1;if((i===null||i===void 0?void 0:i.writable)!==!1&&P(y))return!1;return!0}function c(y){var i,U0;if(!f(y))return null;if(y.writableErrored)return y.writableErrored;return(i=(U0=y._writableState)===null||U0===void 0?void 0:U0.errored)!==null&&i!==void 0?i:null}function h(y){var i,U0;if(!f(y))return null;if(y.readableErrored)return y.readableErrored;return(i=(U0=y._readableState)===null||U0===void 0?void 0:U0.errored)!==null&&i!==void 0?i:null}function x(y){if(!f(y))return null;if(typeof y.closed==="boolean")return y.closed;let{_writableState:i,_readableState:U0}=y;if(typeof(i===null||i===void 0?void 0:i.closed)==="boolean"||typeof(U0===null||U0===void 0?void 0:U0.closed)==="boolean")return(i===null||i===void 0?void 0:i.closed)||(U0===null||U0===void 0?void 0:U0.closed);if(typeof y._closed==="boolean"&&l(y))return y._closed;return null}function l(y){return typeof y._closed==="boolean"&&typeof y._defaultKeepAlive==="boolean"&&typeof y._removedConnection==="boolean"&&typeof y._removedContLen==="boolean"}function $0(y){return typeof y._sent100==="boolean"&&l(y)}function Z0(y){var i;return typeof y._consuming==="boolean"&&typeof y._dumped==="boolean"&&((i=y.req)===null||i===void 0?void 0:i.upgradeOrConnect)===void 0}function F0(y){if(!f(y))return null;let{_writableState:i,_readableState:U0}=y,m=i||U0;return!m&&$0(y)||!!(m&&m.autoDestroy&&m.emitClose&&m.closed===!1)}function p(y){var i;return!!(y&&((i=y[V])!==null&&i!==void 0?i:y.readableDidRead||y.readableAborted))}function W0(y){var i,U0,m,V0,w0,S,b,O,E,a;return!!(y&&((i=(U0=(m=(V0=(w0=(S=y[G])!==null&&S!==void 0?S:y.readableErrored)!==null&&w0!==void 0?w0:y.writableErrored)!==null&&V0!==void 0?V0:(b=y._readableState)===null||b===void 0?void 0:b.errorEmitted)!==null&&m!==void 0?m:(O=y._writableState)===null||O===void 0?void 0:O.errorEmitted)!==null&&U0!==void 0?U0:(E=y._readableState)===null||E===void 0?void 0:E.errored)!==null&&i!==void 0?i:(a=y._writableState)===null||a===void 0?void 0:a.errored))}q.exports={isDestroyed:v,kIsDestroyed:Z,isDisturbed:p,kIsDisturbed:V,isErrored:W0,kIsErrored:G,isReadable:X,kIsReadable:W,kIsClosedPromise:U,kControllerErrorFunction:w,kIsWritable:B,isClosed:x,isDuplexNodeStream:k,isFinished:g,isIterable:H,isReadableNodeStream:F,isReadableStream:L,isReadableEnded:d,isReadableFinished:_,isReadableErrored:h,isNodeStream:f,isWebStream:N,isWritable:P,isWritableNodeStream:M,isWritableStream:D,isWritableEnded:j,isWritableFinished:n,isWritableErrored:c,isServerRequest:Z0,isServerResponse:$0,willEmitClose:F0,isTransformStream:z}}),s2=g0(($,q)=>{var Q=D1(),{AbortError:K,codes:J}=a0(),{ERR_INVALID_ARG_TYPE:Z,ERR_STREAM_PREMATURE_CLOSE:G}=J,{kEmptyObject:W,once:B}=e0(),{validateAbortSignal:V,validateFunction:U,validateObject:w,validateBoolean:F}=P6(),{Promise:M,PromisePrototypeThen:k,SymbolDispose:f}=P0(),{isClosed:L,isReadable:D,isReadableNodeStream:z,isReadableStream:N,isReadableFinished:H,isReadableErrored:v,isWritable:j,isWritableNodeStream:n,isWritableStream:d,isWritableFinished:_,isWritableErrored:X,isNodeStream:P,willEmitClose:g,kIsClosedPromise:c}=b2(),h;function x(p){return p.setHeader&&typeof p.abort==="function"}var l=()=>{};function $0(p,W0,y){var i,U0;if(arguments.length===2)y=W0,W0=W;else if(W0==null)W0=W;else w(W0,"options");if(U(y,"callback"),V(W0.signal,"options.signal"),y=B(y),N(p)||d(p))return Z0(p,W0,y);if(!P(p))throw new Z("stream",["ReadableStream","WritableStream","Stream"],p);let m=(i=W0.readable)!==null&&i!==void 0?i:z(p),V0=(U0=W0.writable)!==null&&U0!==void 0?U0:n(p),w0=p._writableState,S=p._readableState,b=()=>{if(!p.writable)a()},O=g(p)&&z(p)===m&&n(p)===V0,E=_(p,!1),a=()=>{if(E=!0,p.destroyed)O=!1;if(O&&(!p.readable||m))return;if(!m||K0)y.call(p)},K0=H(p,!1),R=()=>{if(K0=!0,p.destroyed)O=!1;if(O&&(!p.writable||V0))return;if(!V0||E)y.call(p)},Y=(T)=>{y.call(p,T)},C=L(p),u=()=>{C=!0;let T=X(p)||v(p);if(T&&typeof T!=="boolean")return y.call(p,T);if(m&&!K0&&z(p,!0)){if(!H(p,!1))return y.call(p,new G)}if(V0&&!E){if(!_(p,!1))return y.call(p,new G)}y.call(p)},e=()=>{C=!0;let T=X(p)||v(p);if(T&&typeof T!=="boolean")return y.call(p,T);y.call(p)},r=()=>{p.req.on("finish",a)};if(x(p)){if(p.on("complete",a),!O)p.on("abort",u);if(p.req)r();else p.on("request",r)}else if(V0&&!w0)p.on("end",b),p.on("close",b);if(!O&&typeof p.aborted==="boolean")p.on("aborted",u);if(p.on("end",R),p.on("finish",a),W0.error!==!1)p.on("error",Y);if(p.on("close",u),C)Q.nextTick(u);else if(w0!==null&&w0!==void 0&&w0.errorEmitted||S!==null&&S!==void 0&&S.errorEmitted){if(!O)Q.nextTick(e)}else if(!m&&(!O||D(p))&&(E||j(p)===!1))Q.nextTick(e);else if(!V0&&(!O||j(p))&&(K0||D(p)===!1))Q.nextTick(e);else if(S&&p.req&&p.aborted)Q.nextTick(e);let s=()=>{if(y=l,p.removeListener("aborted",u),p.removeListener("complete",a),p.removeListener("abort",u),p.removeListener("request",r),p.req)p.req.removeListener("finish",a);p.removeListener("end",b),p.removeListener("close",b),p.removeListener("finish",a),p.removeListener("end",R),p.removeListener("error",Y),p.removeListener("close",u)};if(W0.signal&&!C){let T=()=>{let t=y;s(),t.call(p,new K(void 0,{cause:W0.signal.reason}))};if(W0.signal.aborted)Q.nextTick(T);else{h=h||e0().addAbortListener;let t=h(W0.signal,T),G0=y;y=B((...Q0)=>{t[f](),G0.apply(p,Q0)})}}return s}function Z0(p,W0,y){let i=!1,U0=l;if(W0.signal)if(U0=()=>{i=!0,y.call(p,new K(void 0,{cause:W0.signal.reason}))},W0.signal.aborted)Q.nextTick(U0);else{h=h||e0().addAbortListener;let V0=h(W0.signal,U0),w0=y;y=B((...S)=>{V0[f](),w0.apply(p,S)})}let m=(...V0)=>{if(!i)Q.nextTick(()=>y.apply(p,V0))};return k(p[c].promise,m,m),l}function F0(p,W0){var y;let i=!1;if(W0===null)W0=W;if((y=W0)!==null&&y!==void 0&&y.cleanup)F(W0.cleanup,"cleanup"),i=W0.cleanup;return new M((U0,m)=>{let V0=$0(p,W0,(w0)=>{if(i)V0();if(w0)m(w0);else U0()})})}q.exports=$0,q.exports.finished=F0}),o1=g0(($,q)=>{var Q=D1(),{aggregateTwoErrors:K,codes:{ERR_MULTIPLE_CALLBACK:J},AbortError:Z}=a0(),{Symbol:G}=P0(),{kIsDestroyed:W,isDestroyed:B,isFinished:V,isServerRequest:U}=b2(),w=G("kDestroy"),F=G("kConstruct");function M(g,c,h){if(g){if(g.stack,c&&!c.errored)c.errored=g;if(h&&!h.errored)h.errored=g}}function k(g,c){let h=this._readableState,x=this._writableState,l=x||h;if(x!==null&&x!==void 0&&x.destroyed||h!==null&&h!==void 0&&h.destroyed){if(typeof c==="function")c();return this}if(M(g,x,h),x)x.destroyed=!0;if(h)h.destroyed=!0;if(!l.constructed)this.once(w,function($0){f(this,K($0,g),c)});else f(this,g,c);return this}function f(g,c,h){let x=!1;function l($0){if(x)return;x=!0;let{_readableState:Z0,_writableState:F0}=g;if(M($0,F0,Z0),F0)F0.closed=!0;if(Z0)Z0.closed=!0;if(typeof h==="function")h($0);if($0)Q.nextTick(L,g,$0);else Q.nextTick(D,g)}try{g._destroy(c||null,l)}catch($0){l($0)}}function L(g,c){z(g,c),D(g)}function D(g){let{_readableState:c,_writableState:h}=g;if(h)h.closeEmitted=!0;if(c)c.closeEmitted=!0;if(h!==null&&h!==void 0&&h.emitClose||c!==null&&c!==void 0&&c.emitClose)g.emit("close")}function z(g,c){let{_readableState:h,_writableState:x}=g;if(x!==null&&x!==void 0&&x.errorEmitted||h!==null&&h!==void 0&&h.errorEmitted)return;if(x)x.errorEmitted=!0;if(h)h.errorEmitted=!0;g.emit("error",c)}function N(){let g=this._readableState,c=this._writableState;if(g)g.constructed=!0,g.closed=!1,g.closeEmitted=!1,g.destroyed=!1,g.errored=null,g.errorEmitted=!1,g.reading=!1,g.ended=g.readable===!1,g.endEmitted=g.readable===!1;if(c)c.constructed=!0,c.destroyed=!1,c.closed=!1,c.closeEmitted=!1,c.errored=null,c.errorEmitted=!1,c.finalCalled=!1,c.prefinished=!1,c.ended=c.writable===!1,c.ending=c.writable===!1,c.finished=c.writable===!1}function H(g,c,h){let{_readableState:x,_writableState:l}=g;if(l!==null&&l!==void 0&&l.destroyed||x!==null&&x!==void 0&&x.destroyed)return this;if(x!==null&&x!==void 0&&x.autoDestroy||l!==null&&l!==void 0&&l.autoDestroy)g.destroy(c);else if(c){if(c.stack,l&&!l.errored)l.errored=c;if(x&&!x.errored)x.errored=c;if(h)Q.nextTick(z,g,c);else z(g,c)}}function v(g,c){if(typeof g._construct!=="function")return;let{_readableState:h,_writableState:x}=g;if(h)h.constructed=!1;if(x)x.constructed=!1;if(g.once(F,c),g.listenerCount(F)>1)return;Q.nextTick(j,g)}function j(g){let c=!1;function h(x){if(c){H(g,x!==null&&x!==void 0?x:new J);return}c=!0;let{_readableState:l,_writableState:$0}=g,Z0=$0||l;if(l)l.constructed=!0;if($0)$0.constructed=!0;if(Z0.destroyed)g.emit(w,x);else if(x)H(g,x,!0);else Q.nextTick(n,g)}try{g._construct((x)=>{Q.nextTick(h,x)})}catch(x){Q.nextTick(h,x)}}function n(g){g.emit(F)}function d(g){return(g===null||g===void 0?void 0:g.setHeader)&&typeof g.abort==="function"}function _(g){g.emit("close")}function X(g,c){g.emit("error",c),Q.nextTick(_,g)}function P(g,c){if(!g||B(g))return;if(!c&&!V(g))c=new Z;if(U(g))g.socket=null,g.destroy(c);else if(d(g))g.abort();else if(d(g.req))g.req.abort();else if(typeof g.destroy==="function")g.destroy(c);else if(typeof g.close==="function")g.close();else if(c)Q.nextTick(X,g,c);else Q.nextTick(_,g);if(!g.destroyed)g[W]=!0}q.exports={construct:v,destroyer:P,destroy:k,undestroy:N,errorOrDestroy:H}}),c5=g0(($,q)=>{var{ArrayIsArray:Q,ObjectSetPrototypeOf:K}=P0(),{EventEmitter:J}=(i1(),X0(p1));function Z(W){J.call(this,W)}K(Z.prototype,J.prototype),K(Z,J),Z.prototype.pipe=function(W,B){let V=this;function U(D){if(W.writable&&W.write(D)===!1&&V.pause)V.pause()}V.on("data",U);function w(){if(V.readable&&V.resume)V.resume()}if(W.on("drain",w),!W._isStdio&&(!B||B.end!==!1))V.on("end",M),V.on("close",k);let F=!1;function M(){if(F)return;F=!0,W.end()}function k(){if(F)return;if(F=!0,typeof W.destroy==="function")W.destroy()}function f(D){if(L(),J.listenerCount(this,"error")===0)this.emit("error",D)}G(V,"error",f),G(W,"error",f);function L(){V.removeListener("data",U),W.removeListener("drain",w),V.removeListener("end",M),V.removeListener("close",k),V.removeListener("error",f),W.removeListener("error",f),V.removeListener("end",L),V.removeListener("close",L),W.removeListener("close",L)}return V.on("end",L),V.on("close",L),W.on("close",L),W.emit("pipe",V),W};function G(W,B,V){if(typeof W.prependListener==="function")return W.prependListener(B,V);if(!W._events||!W._events[B])W.on(B,V);else if(Q(W._events[B]))W._events[B].unshift(V);else W._events[B]=[V,W._events[B]]}q.exports={Stream:Z,prependListener:G}}),L8=g0(($,q)=>{var{SymbolDispose:Q}=P0(),{AbortError:K,codes:J}=a0(),{isNodeStream:Z,isWebStream:G,kControllerErrorFunction:W}=b2(),B=s2(),{ERR_INVALID_ARG_TYPE:V}=J,U,w=(F,M)=>{if(typeof F!=="object"||!("aborted"in F))throw new V(M,"AbortSignal",F)};q.exports.addAbortSignal=function(F,M){if(w(F,"signal"),!Z(M)&&!G(M))throw new V("stream",["ReadableStream","WritableStream","Stream"],M);return q.exports.addAbortSignalNoValidate(F,M)},q.exports.addAbortSignalNoValidate=function(F,M){if(typeof F!=="object"||!("aborted"in F))return M;let k=Z(M)?()=>{M.destroy(new K(void 0,{cause:F.reason}))}:()=>{M[W](new K(void 0,{cause:F.reason}))};if(F.aborted)k();else{U=U||e0().addAbortListener;let f=U(F,k);B(M,f[Q])}return M}}),fV=g0(($,q)=>{var{StringPrototypeSlice:Q,SymbolIterator:K,TypedArrayPrototypeSet:J,Uint8Array:Z}=P0(),{Buffer:G}=(t0(),X0(K2)),{inspect:W}=e0();q.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(B){let V={data:B,next:null};if(this.length>0)this.tail.next=V;else this.head=V;this.tail=V,++this.length}unshift(B){let V={data:B,next:this.head};if(this.length===0)this.tail=V;this.head=V,++this.length}shift(){if(this.length===0)return;let B=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,B}clear(){this.head=this.tail=null,this.length=0}join(B){if(this.length===0)return"";let V=this.head,U=""+V.data;while((V=V.next)!==null)U+=B+V.data;return U}concat(B){if(this.length===0)return G.alloc(0);let V=G.allocUnsafe(B>>>0),U=this.head,w=0;while(U)J(V,U.data,w),w+=U.data.length,U=U.next;return V}consume(B,V){let U=this.head.data;if(BF.length)V+=F,B-=F.length;else{if(B===F.length)if(V+=F,++w,U.next)this.head=U.next;else this.head=this.tail=null;else V+=Q(F,0,B),this.head=U,U.data=Q(F,B);break}++w}while((U=U.next)!==null);return this.length-=w,V}_getBuffer(B){let V=G.allocUnsafe(B),U=B,w=this.head,F=0;do{let M=w.data;if(B>M.length)J(V,M,U-B),B-=M.length;else{if(B===M.length)if(J(V,M,U-B),++F,w.next)this.head=w.next;else this.head=this.tail=null;else J(V,new Z(M.buffer,M.byteOffset,B),U-B),this.head=w,w.data=M.slice(B);break}++F}while((w=w.next)!==null);return this.length-=F,V}[Symbol.for("nodejs.util.inspect.custom")](B,V){return W(this,{...V,depth:0,customInspect:!1})}}}),H8=g0(($,q)=>{var{MathFloor:Q,NumberIsInteger:K}=P0(),{validateInteger:J}=P6(),{ERR_INVALID_ARG_VALUE:Z}=a0().codes,G=16384,W=16;function B(F,M,k){return F.highWaterMark!=null?F.highWaterMark:M?F[k]:null}function V(F){return F?W:G}function U(F,M){if(J(M,"value",0),F)W=M;else G=M}function w(F,M,k,f){let L=B(M,f,k);if(L!=null){if(!K(L)||L<0){let D=f?`options.${k}`:"options.highWaterMark";throw new Z(D,L)}return Q(L)}return V(F.objectMode)}q.exports={getHighWaterMark:w,getDefaultHighWaterMark:V,setDefaultHighWaterMark:U}}),RV=g0(($,q)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh */var Q=(t0(),X0(K2)),K=Q.Buffer;function J(G,W){for(var B in G)W[B]=G[B]}if(K.from&&K.alloc&&K.allocUnsafe&&K.allocUnsafeSlow)q.exports=Q;else J(Q,$),$.Buffer=Z;function Z(G,W,B){return K(G,W,B)}Z.prototype=Object.create(K.prototype),J(K,Z),Z.from=function(G,W,B){if(typeof G==="number")throw TypeError("Argument must not be a number");return K(G,W,B)},Z.alloc=function(G,W,B){if(typeof G!=="number")throw TypeError("Argument must be a number");var V=K(G);if(W!==void 0)if(typeof B==="string")V.fill(W,B);else V.fill(W);else V.fill(0);return V},Z.allocUnsafe=function(G){if(typeof G!=="number")throw TypeError("Argument must be a number");return K(G)},Z.allocUnsafeSlow=function(G){if(typeof G!=="number")throw TypeError("Argument must be a number");return Q.SlowBuffer(G)}}),IV=g0(($)=>{var q=RV().Buffer,Q=q.isEncoding||function(z){switch(z=""+z,z&&z.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function K(z){if(!z)return"utf8";var N;while(!0)switch(z){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return z;default:if(N)return;z=(""+z).toLowerCase(),N=!0}}function J(z){var N=K(z);if(typeof N!=="string"&&(q.isEncoding===Q||!Q(z)))throw Error("Unknown encoding: "+z);return N||z}$.StringDecoder=Z;function Z(z){this.encoding=J(z);var N;switch(this.encoding){case"utf16le":this.text=F,this.end=M,N=4;break;case"utf8":this.fillLast=V,N=4;break;case"base64":this.text=k,this.end=f,N=3;break;default:this.write=L,this.end=D;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=q.allocUnsafe(N)}Z.prototype.write=function(z){if(z.length===0)return"";var N,H;if(this.lastNeed){if(N=this.fillLast(z),N===void 0)return"";H=this.lastNeed,this.lastNeed=0}else H=0;if(H>5===6)return 2;else if(z>>4===14)return 3;else if(z>>3===30)return 4;return z>>6===2?-1:-2}function W(z,N,H){var v=N.length-1;if(v=0){if(j>0)z.lastNeed=j-1;return j}if(--v=0){if(j>0)z.lastNeed=j-2;return j}if(--v=0){if(j>0)if(j===2)j=0;else z.lastNeed=j-3;return j}return 0}function B(z,N,H){if((N[0]&192)!==128)return z.lastNeed=0,"�";if(z.lastNeed>1&&N.length>1){if((N[1]&192)!==128)return z.lastNeed=1,"�";if(z.lastNeed>2&&N.length>2){if((N[2]&192)!==128)return z.lastNeed=2,"�"}}}function V(z){var N=this.lastTotal-this.lastNeed,H=B(this,z,N);if(H!==void 0)return H;if(this.lastNeed<=z.length)return z.copy(this.lastChar,N,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);z.copy(this.lastChar,N,0,z.length),this.lastNeed-=z.length}function U(z,N){var H=W(this,z,N);if(!this.lastNeed)return z.toString("utf8",N);this.lastTotal=H;var v=z.length-(H-this.lastNeed);return z.copy(this.lastChar,0,v),z.toString("utf8",N,v)}function w(z){var N=z&&z.length?this.write(z):"";if(this.lastNeed)return N+"�";return N}function F(z,N){if((z.length-N)%2===0){var H=z.toString("utf16le",N);if(H){var v=H.charCodeAt(H.length-1);if(v>=55296&&v<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=z[z.length-2],this.lastChar[1]=z[z.length-1],H.slice(0,-1)}return H}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=z[z.length-1],z.toString("utf16le",N,z.length-1)}function M(z){var N=z&&z.length?this.write(z):"";if(this.lastNeed){var H=this.lastTotal-this.lastNeed;return N+this.lastChar.toString("utf16le",0,H)}return N}function k(z,N){var H=(z.length-N)%3;if(H===0)return z.toString("base64",N);if(this.lastNeed=3-H,this.lastTotal=3,H===1)this.lastChar[0]=z[z.length-1];else this.lastChar[0]=z[z.length-2],this.lastChar[1]=z[z.length-1];return z.toString("base64",N,z.length-H)}function f(z){var N=z&&z.length?this.write(z):"";if(this.lastNeed)return N+this.lastChar.toString("base64",0,3-this.lastNeed);return N}function L(z){return z.toString(this.encoding)}function D(z){return z&&z.length?this.write(z):""}}),o9=g0(($,q)=>{var Q=D1(),{PromisePrototypeThen:K,SymbolAsyncIterator:J,SymbolIterator:Z}=P0(),{Buffer:G}=(t0(),X0(K2)),{ERR_INVALID_ARG_TYPE:W,ERR_STREAM_NULL_VALUES:B}=a0().codes;function V(U,w,F){let M;if(typeof w==="string"||w instanceof G)return new U({objectMode:!0,...F,read(){this.push(w),this.push(null)}});let k;if(w&&w[J])k=!0,M=w[J]();else if(w&&w[Z])k=!1,M=w[Z]();else throw new W("iterable",["Iterable"],w);let f=new U({objectMode:!0,highWaterMark:1,...F}),L=!1;f._read=function(){if(!L)L=!0,z()},f._destroy=function(N,H){K(D(N),()=>Q.nextTick(H,N),(v)=>Q.nextTick(H,v||N))};async function D(N){let H=N!==void 0&&N!==null,v=typeof M.throw==="function";if(H&&v){let{value:j,done:n}=await M.throw(N);if(await j,n)return}if(typeof M.return==="function"){let{value:j}=await M.return();await j}}async function z(){for(;;){try{let{value:N,done:H}=k?await M.next():M.next();if(H)f.push(null);else{let v=N&&typeof N.then==="function"?await N:N;if(v===null)throw L=!1,new B;else if(f.push(v))continue;else L=!1}}catch(N){f.destroy(N)}break}}return f}q.exports=V}),v8=g0(($,q)=>{var Q=D1(),{ArrayPrototypeIndexOf:K,NumberIsInteger:J,NumberIsNaN:Z,NumberParseInt:G,ObjectDefineProperties:W,ObjectKeys:B,ObjectSetPrototypeOf:V,Promise:U,SafeSet:w,SymbolAsyncDispose:F,SymbolAsyncIterator:M,Symbol:k}=P0();q.exports=Q0,Q0.ReadableState=G0;var{EventEmitter:f}=(i1(),X0(p1)),{Stream:L,prependListener:D}=c5(),{Buffer:z}=(t0(),X0(K2)),{addAbortSignal:N}=L8(),H=s2(),v=e0().debuglog("stream",(I)=>{v=I}),j=fV(),n=o1(),{getHighWaterMark:d,getDefaultHighWaterMark:_}=H8(),{aggregateTwoErrors:X,codes:{ERR_INVALID_ARG_TYPE:P,ERR_METHOD_NOT_IMPLEMENTED:g,ERR_OUT_OF_RANGE:c,ERR_STREAM_PUSH_AFTER_EOF:h,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:x},AbortError:l}=a0(),{validateObject:$0}=P6(),Z0=k("kPaused"),{StringDecoder:F0}=IV(),p=o9();V(Q0.prototype,L.prototype),V(Q0,L);var W0=()=>{},{errorOrDestroy:y}=n,i=1,U0=2,m=4,V0=8,w0=16,S=32,b=64,O=128,E=256,a=512,K0=1024,R=2048,Y=4096,C=8192,u=16384,e=32768,r=65536,s=131072,T=262144;function t(I){return{enumerable:!1,get(){return(this.state&I)!==0},set(A){if(A)this.state|=I;else this.state&=~I}}}W(G0.prototype,{objectMode:t(i),ended:t(U0),endEmitted:t(m),reading:t(V0),constructed:t(w0),sync:t(S),needReadable:t(b),emittedReadable:t(O),readableListening:t(E),resumeScheduled:t(a),errorEmitted:t(K0),emitClose:t(R),autoDestroy:t(Y),destroyed:t(C),closed:t(u),closeEmitted:t(e),multiAwaitDrain:t(r),readingMore:t(s),dataEmitted:t(T)});function G0(I,A,J0){if(typeof J0!=="boolean")J0=A instanceof c2();if(this.state=R|Y|w0|S,I&&I.objectMode)this.state|=i;if(J0&&I&&I.readableObjectMode)this.state|=i;if(this.highWaterMark=I?d(this,I,"readableHighWaterMark",J0):_(!1),this.buffer=new j,this.length=0,this.pipes=[],this.flowing=null,this[Z0]=null,I&&I.emitClose===!1)this.state&=~R;if(I&&I.autoDestroy===!1)this.state&=~Y;if(this.errored=null,this.defaultEncoding=I&&I.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,I&&I.encoding)this.decoder=new F0(I.encoding),this.encoding=I.encoding}function Q0(I){if(!(this instanceof Q0))return new Q0(I);let A=this instanceof c2();if(this._readableState=new G0(I,this,A),I){if(typeof I.read==="function")this._read=I.read;if(typeof I.destroy==="function")this._destroy=I.destroy;if(typeof I.construct==="function")this._construct=I.construct;if(I.signal&&!A)N(I.signal,this)}L.call(this,I),n.construct(this,()=>{if(this._readableState.needReadable)_1(this,this._readableState)})}Q0.prototype.destroy=n.destroy,Q0.prototype._undestroy=n.undestroy,Q0.prototype._destroy=function(I,A){A(I)},Q0.prototype[f.captureRejectionSymbol]=function(I){this.destroy(I)},Q0.prototype[F]=function(){let I;if(!this.destroyed)I=this.readableEnded?null:new l,this.destroy(I);return new U((A,J0)=>H(this,(B0)=>B0&&B0!==I?J0(B0):A(null)))},Q0.prototype.push=function(I,A){return M0(this,I,A,!1)},Q0.prototype.unshift=function(I,A){return M0(this,I,A,!0)};function M0(I,A,J0,B0){v("readableAddChunk",A);let z0=I._readableState,i0;if((z0.state&i)===0){if(typeof A==="string"){if(J0=J0||z0.defaultEncoding,z0.encoding!==J0)if(B0&&z0.encoding)A=z.from(A,J0).toString(z0.encoding);else A=z.from(A,J0),J0=""}else if(A instanceof z)J0="";else if(L._isUint8Array(A))A=L._uint8ArrayToBuffer(A),J0="";else if(A!=null)i0=new P("chunk",["string","Buffer","Uint8Array"],A)}if(i0)y(I,i0);else if(A===null)z0.state&=~V0,O0(I,z0);else if((z0.state&i)!==0||A&&A.length>0)if(B0)if((z0.state&m)!==0)y(I,new x);else if(z0.destroyed||z0.errored)return!1;else I0(I,z0,A,!0);else if(z0.ended)y(I,new h);else if(z0.destroyed||z0.errored)return!1;else if(z0.state&=~V0,z0.decoder&&!J0)if(A=z0.decoder.write(A),z0.objectMode||A.length!==0)I0(I,z0,A,!1);else _1(I,z0);else I0(I,z0,A,!1);else if(!B0)z0.state&=~V0,_1(I,z0);return!z0.ended&&(z0.length0){if((A.state&r)!==0)A.awaitDrainWriters.clear();else A.awaitDrainWriters=null;A.dataEmitted=!0,I.emit("data",J0)}else{if(A.length+=A.objectMode?1:J0.length,B0)A.buffer.unshift(J0);else A.buffer.push(J0);if((A.state&b)!==0)u0(I)}_1(I,A)}Q0.prototype.isPaused=function(){let I=this._readableState;return I[Z0]===!0||I.flowing===!1},Q0.prototype.setEncoding=function(I){let A=new F0(I);this._readableState.decoder=A,this._readableState.encoding=this._readableState.decoder.encoding;let J0=this._readableState.buffer,B0="";for(let z0 of J0)B0+=A.write(z0);if(J0.clear(),B0!=="")J0.push(B0);return this._readableState.length=B0.length,this};var m0=1073741824;function p0(I){if(I>m0)throw new c("size","<= 1GiB",I);else I--,I|=I>>>1,I|=I>>>2,I|=I>>>4,I|=I>>>8,I|=I>>>16,I++;return I}function q2(I,A){if(I<=0||A.length===0&&A.ended)return 0;if((A.state&i)!==0)return 1;if(Z(I)){if(A.flowing&&A.length)return A.buffer.first().length;return A.length}if(I<=A.length)return I;return A.ended?A.length:0}Q0.prototype.read=function(I){if(v("read",I),I===void 0)I=NaN;else if(!J(I))I=G(I,10);let A=this._readableState,J0=I;if(I>A.highWaterMark)A.highWaterMark=p0(I);if(I!==0)A.state&=~O;if(I===0&&A.needReadable&&((A.highWaterMark!==0?A.length>=A.highWaterMark:A.length>0)||A.ended)){if(v("read: emitReadable",A.length,A.ended),A.length===0&&A.ended)v5(this);else u0(this);return null}if(I=q2(I,A),I===0&&A.ended){if(A.length===0)v5(this);return null}let B0=(A.state&b)!==0;if(v("need readable",B0),A.length===0||A.length-I0)z0=a7(I,A);else z0=null;if(z0===null)A.needReadable=A.length<=A.highWaterMark,I=0;else if(A.length-=I,A.multiAwaitDrain)A.awaitDrainWriters.clear();else A.awaitDrainWriters=null;if(A.length===0){if(!A.ended)A.needReadable=!0;if(J0!==I&&A.ended)v5(this)}if(z0!==null&&!A.errorEmitted&&!A.closeEmitted)A.dataEmitted=!0,this.emit("data",z0);return z0};function O0(I,A){if(v("onEofChunk"),A.ended)return;if(A.decoder){let J0=A.decoder.end();if(J0&&J0.length)A.buffer.push(J0),A.length+=A.objectMode?1:J0.length}if(A.ended=!0,A.sync)u0(I);else A.needReadable=!1,A.emittedReadable=!0,E1(I)}function u0(I){let A=I._readableState;if(v("emitReadable",A.needReadable,A.emittedReadable),A.needReadable=!1,!A.emittedReadable)v("emitReadable",A.flowing),A.emittedReadable=!0,Q.nextTick(E1,I)}function E1(I){let A=I._readableState;if(v("emitReadable_",A.destroyed,A.length,A.ended),!A.destroyed&&!A.errored&&(A.length||A.ended))I.emit("readable"),A.emittedReadable=!1;A.needReadable=!A.flowing&&!A.ended&&A.length<=A.highWaterMark,i7(I)}function _1(I,A){if(!A.readingMore&&A.constructed)A.readingMore=!0,Q.nextTick(R2,I,A)}function R2(I,A){while(!A.reading&&!A.ended&&(A.length1&&B0.pipes.includes(I))v("false write response, pause",B0.awaitDrainWriters.size),B0.awaitDrainWriters.add(I);J0.pause()}if(!z1)z1=MJ(J0,I),I.on("drain",z1)}J0.on("data",t7);function t7(F1){v("ondata");let u2=I.write(F1);if(v("dest.write",u2),u2===!1)s7()}function R5(F1){if(v("onerror",F1),A6(),I.removeListener("error",R5),I.listenerCount("error")===0){let u2=I._writableState||I._readableState;if(u2&&!u2.errorEmitted)y(I,F1);else I.emit("error",F1)}}D(I,"error",R5);function I5(){I.removeListener("finish",C5),A6()}I.once("close",I5);function C5(){v("onfinish"),I.removeListener("close",I5),A6()}I.once("finish",C5);function A6(){v("unpipe"),J0.unpipe(I)}if(I.emit("pipe",J0),I.writableNeedDrain===!0)s7();else if(!B0.flowing)v("pipe resume"),J0.resume();return I};function MJ(I,A){return function(){let J0=I._readableState;if(J0.awaitDrainWriters===A)v("pipeOnDrain",1),J0.awaitDrainWriters=null;else if(J0.multiAwaitDrain)v("pipeOnDrain",J0.awaitDrainWriters.size),J0.awaitDrainWriters.delete(A);if((!J0.awaitDrainWriters||J0.awaitDrainWriters.size===0)&&I.listenerCount("data"))I.resume()}}Q0.prototype.unpipe=function(I){let A=this._readableState,J0={hasUnpiped:!1};if(A.pipes.length===0)return this;if(!I){let z0=A.pipes;A.pipes=[],this.pause();for(let i0=0;i00,B0.flowing!==!1)this.resume()}else if(I==="readable"){if(!B0.endEmitted&&!B0.readableListening){if(B0.readableListening=B0.needReadable=!0,B0.flowing=!1,B0.emittedReadable=!1,v("on readable",B0.length,B0.reading),B0.length)u0(this);else if(!B0.reading)Q.nextTick(wJ,this)}}return J0},Q0.prototype.addListener=Q0.prototype.on,Q0.prototype.removeListener=function(I,A){let J0=L.prototype.removeListener.call(this,I,A);if(I==="readable")Q.nextTick(p7,this);return J0},Q0.prototype.off=Q0.prototype.removeListener,Q0.prototype.removeAllListeners=function(I){let A=L.prototype.removeAllListeners.apply(this,arguments);if(I==="readable"||I===void 0)Q.nextTick(p7,this);return A};function p7(I){let A=I._readableState;if(A.readableListening=I.listenerCount("readable")>0,A.resumeScheduled&&A[Z0]===!1)A.flowing=!0;else if(I.listenerCount("data")>0)I.resume();else if(!A.readableListening)A.flowing=null}function wJ(I){v("readable nexttick read 0"),I.read(0)}Q0.prototype.resume=function(){let I=this._readableState;if(!I.flowing)v("resume"),I.flowing=!I.readableListening,NJ(this,I);return I[Z0]=!1,this};function NJ(I,A){if(!A.resumeScheduled)A.resumeScheduled=!0,Q.nextTick(YJ,I,A)}function YJ(I,A){if(v("resume",A.reading),!A.reading)I.read(0);if(A.resumeScheduled=!1,I.emit("resume"),i7(I),A.flowing&&!A.reading)I.read(0)}Q0.prototype.pause=function(){if(v("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)v("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState[Z0]=!0,this};function i7(I){let A=I._readableState;v("flow",A.flowing);while(A.flowing&&I.read()!==null);}Q0.prototype.wrap=function(I){let A=!1;I.on("data",(B0)=>{if(!this.push(B0)&&I.pause)A=!0,I.pause()}),I.on("end",()=>{this.push(null)}),I.on("error",(B0)=>{y(this,B0)}),I.on("close",()=>{this.destroy()}),I.on("destroy",()=>{this.destroy()}),this._read=()=>{if(A&&I.resume)A=!1,I.resume()};let J0=B(I);for(let B0=1;B0{z0=z2?X(z0,z2):null,J0(),J0=W0});try{while(!0){let z2=I.destroyed?null:I.read();if(z2!==null)yield z2;else if(z0)throw z0;else if(z0===null)return;else await new U(B0)}}catch(z2){throw z0=X(z0,z2),z0}finally{if((z0||(A===null||A===void 0?void 0:A.destroyOnReturn)!==!1)&&(z0===void 0||I._readableState.autoDestroy))n.destroyer(I,null);else I.off("readable",B0),i0()}}W(Q0.prototype,{readable:{__proto__:null,get(){let I=this._readableState;return!!I&&I.readable!==!1&&!I.destroyed&&!I.errorEmitted&&!I.endEmitted},set(I){if(this._readableState)this._readableState.readable=!!I}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(I){if(this._readableState)this._readableState.flowing=I}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(I){if(!this._readableState)return;this._readableState.destroyed=I}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),W(G0.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Z0]!==!1},set(I){this[Z0]=!!I}}}),Q0._fromList=a7;function a7(I,A){if(A.length===0)return null;let J0;if(A.objectMode)J0=A.buffer.shift();else if(!I||I>=A.length){if(A.decoder)J0=A.buffer.join("");else if(A.buffer.length===1)J0=A.buffer.first();else J0=A.buffer.concat(A.length);A.buffer.clear()}else J0=A.buffer.consume(I,A.decoder);return J0}function v5(I){let A=I._readableState;if(v("endReadable",A.endEmitted),!A.endEmitted)A.ended=!0,Q.nextTick(DJ,A,I)}function DJ(I,A){if(v("endReadableNT",I.endEmitted,I.length),!I.errored&&!I.closeEmitted&&!I.endEmitted&&I.length===0){if(I.endEmitted=!0,A.emit("end"),A.writable&&A.allowHalfOpen===!1)Q.nextTick(LJ,A);else if(I.autoDestroy){let J0=A._writableState;if(!J0||J0.autoDestroy&&(J0.finished||J0.writable===!1))A.destroy()}}}function LJ(I){if(I.writable&&!I.writableEnded&&!I.destroyed)I.end()}Q0.from=function(I,A){return p(Q0,I,A)};var f5;function l7(){if(f5===void 0)f5={};return f5}Q0.fromWeb=function(I,A){return l7().newStreamReadableFromReadableStream(I,A)},Q0.toWeb=function(I,A){return l7().newReadableStreamFromStreamReadable(I,A)},Q0.wrap=function(I,A){var J0,B0;return new Q0({objectMode:(J0=(B0=I.readableObjectMode)!==null&&B0!==void 0?B0:I.objectMode)!==null&&J0!==void 0?J0:!0,...A,destroy(z0,i0){n.destroyer(I,z0),i0(z0)}}).wrap(I)}}),b5=g0(($,q)=>{var Q=D1(),{ArrayPrototypeSlice:K,Error:J,FunctionPrototypeSymbolHasInstance:Z,ObjectDefineProperty:G,ObjectDefineProperties:W,ObjectSetPrototypeOf:B,StringPrototypeToLowerCase:V,Symbol:U,SymbolHasInstance:w}=P0();q.exports=$0,$0.WritableState=x;var{EventEmitter:F}=(i1(),X0(p1)),M=c5().Stream,{Buffer:k}=(t0(),X0(K2)),f=o1(),{addAbortSignal:L}=L8(),{getHighWaterMark:D,getDefaultHighWaterMark:z}=H8(),{ERR_INVALID_ARG_TYPE:N,ERR_METHOD_NOT_IMPLEMENTED:H,ERR_MULTIPLE_CALLBACK:v,ERR_STREAM_CANNOT_PIPE:j,ERR_STREAM_DESTROYED:n,ERR_STREAM_ALREADY_FINISHED:d,ERR_STREAM_NULL_VALUES:_,ERR_STREAM_WRITE_AFTER_END:X,ERR_UNKNOWN_ENCODING:P}=a0().codes,{errorOrDestroy:g}=f;B($0.prototype,M.prototype),B($0,M);function c(){}var h=U("kOnFinished");function x(Y,C,u){if(typeof u!=="boolean")u=C instanceof c2();if(this.objectMode=!!(Y&&Y.objectMode),u)this.objectMode=this.objectMode||!!(Y&&Y.writableObjectMode);this.highWaterMark=Y?D(this,Y,"writableHighWaterMark",u):z(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let e=!!(Y&&Y.decodeStrings===!1);this.decodeStrings=!e,this.defaultEncoding=Y&&Y.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=y.bind(void 0,C),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,l(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!Y||Y.emitClose!==!1,this.autoDestroy=!Y||Y.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[h]=[]}function l(Y){Y.buffered=[],Y.bufferedIndex=0,Y.allBuffers=!0,Y.allNoop=!0}x.prototype.getBuffer=function(){return K(this.buffered,this.bufferedIndex)},G(x.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function $0(Y){let C=this instanceof c2();if(!C&&!Z($0,this))return new $0(Y);if(this._writableState=new x(Y,this,C),Y){if(typeof Y.write==="function")this._write=Y.write;if(typeof Y.writev==="function")this._writev=Y.writev;if(typeof Y.destroy==="function")this._destroy=Y.destroy;if(typeof Y.final==="function")this._final=Y.final;if(typeof Y.construct==="function")this._construct=Y.construct;if(Y.signal)L(Y.signal,this)}M.call(this,Y),f.construct(this,()=>{let u=this._writableState;if(!u.writing)V0(this,u);O(this,u)})}G($0,w,{__proto__:null,value:function(Y){if(Z(this,Y))return!0;if(this!==$0)return!1;return Y&&Y._writableState instanceof x}}),$0.prototype.pipe=function(){g(this,new j)};function Z0(Y,C,u,e){let r=Y._writableState;if(typeof u==="function")e=u,u=r.defaultEncoding;else{if(!u)u=r.defaultEncoding;else if(u!=="buffer"&&!k.isEncoding(u))throw new P(u);if(typeof e!=="function")e=c}if(C===null)throw new _;else if(!r.objectMode)if(typeof C==="string"){if(r.decodeStrings!==!1)C=k.from(C,u),u="buffer"}else if(C instanceof k)u="buffer";else if(M._isUint8Array(C))C=M._uint8ArrayToBuffer(C),u="buffer";else throw new N("chunk",["string","Buffer","Uint8Array"],C);let s;if(r.ending)s=new X;else if(r.destroyed)s=new n("write");if(s)return Q.nextTick(e,s),g(Y,s,!0),s;return r.pendingcb++,F0(Y,r,C,u,e)}$0.prototype.write=function(Y,C,u){return Z0(this,Y,C,u)===!0},$0.prototype.cork=function(){this._writableState.corked++},$0.prototype.uncork=function(){let Y=this._writableState;if(Y.corked){if(Y.corked--,!Y.writing)V0(this,Y)}},$0.prototype.setDefaultEncoding=function(Y){if(typeof Y==="string")Y=V(Y);if(!k.isEncoding(Y))throw new P(Y);return this._writableState.defaultEncoding=Y,this};function F0(Y,C,u,e,r){let s=C.objectMode?1:u.length;C.length+=s;let T=C.lengthu.bufferedIndex)V0(Y,u);if(e)if(u.afterWriteTickInfo!==null&&u.afterWriteTickInfo.cb===r)u.afterWriteTickInfo.count++;else u.afterWriteTickInfo={count:1,cb:r,stream:Y,state:u},Q.nextTick(i,u.afterWriteTickInfo);else U0(Y,u,1,r)}}function i({stream:Y,state:C,count:u,cb:e}){return C.afterWriteTickInfo=null,U0(Y,C,u,e)}function U0(Y,C,u,e){if(!C.ending&&!Y.destroyed&&C.length===0&&C.needDrain)C.needDrain=!1,Y.emit("drain");while(u-- >0)C.pendingcb--,e();if(C.destroyed)m(C);O(Y,C)}function m(Y){if(Y.writing)return;for(let r=Y.bufferedIndex;r1&&Y._writev){C.pendingcb-=s-1;let t=C.allNoop?c:(Q0)=>{for(let M0=T;M0256)u.splice(0,T),C.bufferedIndex=0;else C.bufferedIndex=T}C.bufferProcessing=!1}$0.prototype._write=function(Y,C,u){if(this._writev)this._writev([{chunk:Y,encoding:C}],u);else throw new H("_write()")},$0.prototype._writev=null,$0.prototype.end=function(Y,C,u){let e=this._writableState;if(typeof Y==="function")u=Y,Y=null,C=null;else if(typeof C==="function")u=C,C=null;let r;if(Y!==null&&Y!==void 0){let s=Z0(this,Y,C);if(s instanceof J)r=s}if(e.corked)e.corked=1,this.uncork();if(r);else if(!e.errored&&!e.ending)e.ending=!0,O(this,e,!0),e.ended=!0;else if(e.finished)r=new d("end");else if(e.destroyed)r=new n("end");if(typeof u==="function")if(r||e.finished)Q.nextTick(u,r);else e[h].push(u);return this};function w0(Y){return Y.ending&&!Y.destroyed&&Y.constructed&&Y.length===0&&!Y.errored&&Y.buffered.length===0&&!Y.finished&&!Y.writing&&!Y.errorEmitted&&!Y.closeEmitted}function S(Y,C){let u=!1;function e(r){if(u){g(Y,r!==null&&r!==void 0?r:v());return}if(u=!0,C.pendingcb--,r){let s=C[h].splice(0);for(let T=0;T{if(w0(r))E(e,r);else r.pendingcb--},Y,C);else if(w0(C))C.pendingcb++,E(Y,C)}}}function E(Y,C){C.pendingcb--,C.finished=!0;let u=C[h].splice(0);for(let e=0;e{var Q=D1(),K=(t0(),X0(K2)),{isReadable:J,isWritable:Z,isIterable:G,isNodeStream:W,isReadableNodeStream:B,isWritableNodeStream:V,isDuplexNodeStream:U,isReadableStream:w,isWritableStream:F}=b2(),M=s2(),{AbortError:k,codes:{ERR_INVALID_ARG_TYPE:f,ERR_INVALID_RETURN_VALUE:L}}=a0(),{destroyer:D}=o1(),z=c2(),N=v8(),H=b5(),{createDeferredPromise:v}=e0(),j=o9(),n=globalThis.Blob||K.Blob,d=typeof n<"u"?function(h){return h instanceof n}:function(h){return!1},_=globalThis.AbortController||O6().AbortController,{FunctionPrototypeCall:X}=P0();class P extends z{constructor(h){super(h);if((h===null||h===void 0?void 0:h.readable)===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if((h===null||h===void 0?void 0:h.writable)===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}}q.exports=function h(x,l){if(U(x))return x;if(B(x))return c({readable:x});if(V(x))return c({writable:x});if(W(x))return c({writable:!1,readable:!1});if(w(x))return c({readable:N.fromWeb(x)});if(F(x))return c({writable:H.fromWeb(x)});if(typeof x==="function"){let{value:Z0,write:F0,final:p,destroy:W0}=g(x);if(G(Z0))return j(P,Z0,{objectMode:!0,write:F0,final:p,destroy:W0});let y=Z0===null||Z0===void 0?void 0:Z0.then;if(typeof y==="function"){let i,U0=X(y,Z0,(m)=>{if(m!=null)throw new L("nully","body",m)},(m)=>{D(i,m)});return i=new P({objectMode:!0,readable:!1,write:F0,final(m){p(async()=>{try{await U0,Q.nextTick(m,null)}catch(V0){Q.nextTick(m,V0)}})},destroy:W0})}throw new L("Iterable, AsyncIterable or AsyncFunction",l,Z0)}if(d(x))return h(x.arrayBuffer());if(G(x))return j(P,x,{objectMode:!0,writable:!1});if(w(x===null||x===void 0?void 0:x.readable)&&F(x===null||x===void 0?void 0:x.writable))return P.fromWeb(x);if(typeof(x===null||x===void 0?void 0:x.writable)==="object"||typeof(x===null||x===void 0?void 0:x.readable)==="object"){let Z0=x!==null&&x!==void 0&&x.readable?B(x===null||x===void 0?void 0:x.readable)?x===null||x===void 0?void 0:x.readable:h(x.readable):void 0,F0=x!==null&&x!==void 0&&x.writable?V(x===null||x===void 0?void 0:x.writable)?x===null||x===void 0?void 0:x.writable:h(x.writable):void 0;return c({readable:Z0,writable:F0})}let $0=x===null||x===void 0?void 0:x.then;if(typeof $0==="function"){let Z0;return X($0,x,(F0)=>{if(F0!=null)Z0.push(F0);Z0.push(null)},(F0)=>{D(Z0,F0)}),Z0=new P({objectMode:!0,writable:!1,read(){}})}throw new f(l,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],x)};function g(h){let{promise:x,resolve:l}=v(),$0=new _,Z0=$0.signal;return{value:h(async function*(){while(!0){let F0=x;x=null;let{chunk:p,done:W0,cb:y}=await F0;if(Q.nextTick(y),W0)return;if(Z0.aborted)throw new k(void 0,{cause:Z0.reason});({promise:x,resolve:l}=v()),yield p}}(),{signal:Z0}),write(F0,p,W0){let y=l;l=null,y({chunk:F0,done:!1,cb:W0})},final(F0){let p=l;l=null,p({done:!0,cb:F0})},destroy(F0,p){$0.abort(),p(F0)}}}function c(h){let x=h.readable&&typeof h.readable.read!=="function"?N.wrap(h.readable):h.readable,l=h.writable,$0=!!J(x),Z0=!!Z(l),F0,p,W0,y,i;function U0(m){let V0=y;if(y=null,V0)V0(m);else if(m)i.destroy(m)}if(i=new P({readableObjectMode:!!(x!==null&&x!==void 0&&x.readableObjectMode),writableObjectMode:!!(l!==null&&l!==void 0&&l.writableObjectMode),readable:$0,writable:Z0}),Z0)M(l,(m)=>{if(Z0=!1,m)D(x,m);U0(m)}),i._write=function(m,V0,w0){if(l.write(m,V0))w0();else F0=w0},i._final=function(m){l.end(),p=m},l.on("drain",function(){if(F0){let m=F0;F0=null,m()}}),l.on("finish",function(){if(p){let m=p;p=null,m()}});if($0)M(x,(m)=>{if($0=!1,m)D(x,m);U0(m)}),x.on("readable",function(){if(W0){let m=W0;W0=null,m()}}),x.on("end",function(){i.push(null)}),i._read=function(){while(!0){let m=x.read();if(m===null){W0=i._read;return}if(!i.push(m))return}};return i._destroy=function(m,V0){if(!m&&y!==null)m=new k;if(W0=null,F0=null,p=null,y===null)V0(m);else y=V0,D(l,m),D(x,m)},i}}),c2=g0(($,q)=>{var{ObjectDefineProperties:Q,ObjectGetOwnPropertyDescriptor:K,ObjectKeys:J,ObjectSetPrototypeOf:Z}=P0();q.exports=B;var G=v8(),W=b5();Z(B.prototype,G.prototype),Z(B,G);{let F=J(W.prototype);for(let M=0;M{var{ObjectSetPrototypeOf:Q,Symbol:K}=P0();q.exports=B;var{ERR_METHOD_NOT_IMPLEMENTED:J}=a0().codes,Z=c2(),{getHighWaterMark:G}=H8();Q(B.prototype,Z.prototype),Q(B,Z);var W=K("kCallback");function B(w){if(!(this instanceof B))return new B(w);let F=w?G(this,w,"readableHighWaterMark",!0):null;if(F===0)w={...w,highWaterMark:null,readableHighWaterMark:F,writableHighWaterMark:w.writableHighWaterMark||0};if(Z.call(this,w),this._readableState.sync=!1,this[W]=null,w){if(typeof w.transform==="function")this._transform=w.transform;if(typeof w.flush==="function")this._flush=w.flush}this.on("prefinish",U)}function V(w){if(typeof this._flush==="function"&&!this.destroyed)this._flush((F,M)=>{if(F){if(w)w(F);else this.destroy(F);return}if(M!=null)this.push(M);if(this.push(null),w)w()});else if(this.push(null),w)w()}function U(){if(this._final!==V)V.call(this)}B.prototype._final=V,B.prototype._transform=function(w,F,M){throw new J("_transform()")},B.prototype._write=function(w,F,M){let k=this._readableState,f=this._writableState,L=k.length;this._transform(w,F,(D,z)=>{if(D){M(D);return}if(z!=null)this.push(z);if(f.ended||L===k.length||k.length{var{ObjectSetPrototypeOf:Q}=P0();q.exports=J;var K=a9();Q(J.prototype,K.prototype),Q(J,K);function J(Z){if(!(this instanceof J))return new J(Z);K.call(this,Z)}J.prototype._transform=function(Z,G,W){W(null,Z)}}),n5=g0(($,q)=>{var Q=D1(),{ArrayIsArray:K,Promise:J,SymbolAsyncIterator:Z,SymbolDispose:G}=P0(),W=s2(),{once:B}=e0(),V=o1(),U=c2(),{aggregateTwoErrors:w,codes:{ERR_INVALID_ARG_TYPE:F,ERR_INVALID_RETURN_VALUE:M,ERR_MISSING_ARGS:k,ERR_STREAM_DESTROYED:f,ERR_STREAM_PREMATURE_CLOSE:L},AbortError:D}=a0(),{validateFunction:z,validateAbortSignal:N}=P6(),{isIterable:H,isReadable:v,isReadableNodeStream:j,isNodeStream:n,isTransformStream:d,isWebStream:_,isReadableStream:X,isReadableFinished:P}=b2(),g=globalThis.AbortController||O6().AbortController,c,h,x;function l(m,V0,w0){let S=!1;m.on("close",()=>{S=!0});let b=W(m,{readable:V0,writable:w0},(O)=>{S=!O});return{destroy:(O)=>{if(S)return;S=!0,V.destroyer(m,O||new f("pipe"))},cleanup:b}}function $0(m){return z(m[m.length-1],"streams[stream.length - 1]"),m.pop()}function Z0(m){if(H(m))return m;else if(j(m))return F0(m);throw new F("val",["Readable","Iterable","AsyncIterable"],m)}async function*F0(m){if(!h)h=v8();yield*h.prototype[Z].call(m)}async function p(m,V0,w0,{end:S}){let b,O=null,E=(R)=>{if(R)b=R;if(O){let Y=O;O=null,Y()}},a=()=>new J((R,Y)=>{if(b)Y(b);else O=()=>{if(b)Y(b);else R()}});V0.on("drain",E);let K0=W(V0,{readable:!1},E);try{if(V0.writableNeedDrain)await a();for await(let R of m)if(!V0.write(R))await a();if(S)V0.end(),await a();w0()}catch(R){w0(b!==R?w(b,R):R)}finally{K0(),V0.off("drain",E)}}async function W0(m,V0,w0,{end:S}){if(d(V0))V0=V0.writable;let b=V0.getWriter();try{for await(let O of m)await b.ready,b.write(O).catch(()=>{});if(await b.ready,S)await b.close();w0()}catch(O){try{await b.abort(O),w0(O)}catch(E){w0(E)}}}function y(...m){return i(m,B($0(m)))}function i(m,V0,w0){if(m.length===1&&K(m[0]))m=m[0];if(m.length<2)throw new k("streams");let S=new g,b=S.signal,O=w0===null||w0===void 0?void 0:w0.signal,E=[];N(O,"options.signal");function a(){r(new D)}x=x||e0().addAbortListener;let K0;if(O)K0=x(O,a);let R,Y,C=[],u=0;function e(Q0){r(Q0,--u===0)}function r(Q0,M0){var I0;if(Q0&&(!R||R.code==="ERR_STREAM_PREMATURE_CLOSE"))R=Q0;if(!R&&!M0)return;while(C.length)C.shift()(R);if((I0=K0)===null||I0===void 0||I0[G](),S.abort(),M0){if(!R)E.forEach((m0)=>m0());Q.nextTick(V0,R,Y)}}let s;for(let Q0=0;Q00,p0=I0||(w0===null||w0===void 0?void 0:w0.end)!==!1,q2=Q0===m.length-1;if(n(M0)){let O0=function(u0){if(u0&&u0.name!=="AbortError"&&u0.code!=="ERR_STREAM_PREMATURE_CLOSE")e(u0)};var T=O0;if(p0){let{destroy:u0,cleanup:E1}=l(M0,I0,m0);if(C.push(u0),v(M0)&&q2)E.push(E1)}if(M0.on("error",O0),v(M0)&&q2)E.push(()=>{M0.removeListener("error",O0)})}if(Q0===0)if(typeof M0==="function"){if(s=M0({signal:b}),!H(s))throw new M("Iterable, AsyncIterable or Stream","source",s)}else if(H(M0)||j(M0)||d(M0))s=M0;else s=U.from(M0);else if(typeof M0==="function"){if(d(s)){var t;s=Z0((t=s)===null||t===void 0?void 0:t.readable)}else s=Z0(s);if(s=M0(s,{signal:b}),I0){if(!H(s,!0))throw new M("AsyncIterable",`transform[${Q0-1}]`,s)}else{var G0;if(!c)c=l9();let O0=new c({objectMode:!0}),u0=(G0=s)===null||G0===void 0?void 0:G0.then;if(typeof u0==="function")u++,u0.call(s,(R2)=>{if(Y=R2,R2!=null)O0.write(R2);if(p0)O0.end();Q.nextTick(e)},(R2)=>{O0.destroy(R2),Q.nextTick(e,R2)});else if(H(s,!0))u++,p(s,O0,e,{end:p0});else if(X(s)||d(s)){let R2=s.readable||s;u++,p(R2,O0,e,{end:p0})}else throw new M("AsyncIterable or Promise","destination",s);s=O0;let{destroy:E1,cleanup:_1}=l(s,!1,!0);if(C.push(E1),q2)E.push(_1)}}else if(n(M0)){if(j(s)){u+=2;let O0=U0(s,M0,e,{end:p0});if(v(M0)&&q2)E.push(O0)}else if(d(s)||X(s)){let O0=s.readable||s;u++,p(O0,M0,e,{end:p0})}else if(H(s))u++,p(s,M0,e,{end:p0});else throw new F("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],s);s=M0}else if(_(M0)){if(j(s))u++,W0(Z0(s),M0,e,{end:p0});else if(X(s)||H(s))u++,W0(s,M0,e,{end:p0});else if(d(s))u++,W0(s.readable,M0,e,{end:p0});else throw new F("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],s);s=M0}else s=U.from(M0)}if(b!==null&&b!==void 0&&b.aborted||O!==null&&O!==void 0&&O.aborted)Q.nextTick(a);return s}function U0(m,V0,w0,{end:S}){let b=!1;if(V0.on("close",()=>{if(!b)w0(new L)}),m.pipe(V0,{end:!1}),S){let E=function(){b=!0,V0.end()};var O=E;if(P(m))Q.nextTick(E);else m.once("end",E)}else w0();return W(m,{readable:!0,writable:!1},(E)=>{let a=m._readableState;if(E&&E.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted)m.once("end",w0).once("error",w0);else w0(E)}),W(V0,{readable:!1,writable:!0},w0)}q.exports={pipelineImpl:i,pipeline:y}}),r9=g0(($,q)=>{var{pipeline:Q}=n5(),K=c2(),{destroyer:J}=o1(),{isNodeStream:Z,isReadable:G,isWritable:W,isWebStream:B,isTransformStream:V,isWritableStream:U,isReadableStream:w}=b2(),{AbortError:F,codes:{ERR_INVALID_ARG_VALUE:M,ERR_MISSING_ARGS:k}}=a0(),f=s2();q.exports=function(...L){if(L.length===0)throw new k("streams");if(L.length===1)return K.from(L[0]);let D=[...L];if(typeof L[0]==="function")L[0]=K.from(L[0]);if(typeof L[L.length-1]==="function"){let g=L.length-1;L[g]=K.from(L[g])}for(let g=0;g0&&!(W(L[g])||U(L[g])||V(L[g])))throw new M(`streams[${g}]`,D[g],"must be writable")}let z,N,H,v,j;function n(g){let c=v;if(v=null,c)c(g);else if(g)j.destroy(g);else if(!P&&!X)j.destroy()}let d=L[0],_=Q(L,n),X=!!(W(d)||U(d)||V(d)),P=!!(G(_)||w(_)||V(_));if(j=new K({writableObjectMode:!!(d!==null&&d!==void 0&&d.writableObjectMode),readableObjectMode:!!(_!==null&&_!==void 0&&_.readableObjectMode),writable:X,readable:P}),X){if(Z(d))j._write=function(c,h,x){if(d.write(c,h))x();else z=x},j._final=function(c){d.end(),N=c},d.on("drain",function(){if(z){let c=z;z=null,c()}});else if(B(d)){let c=(V(d)?d.writable:d).getWriter();j._write=async function(h,x,l){try{await c.ready,c.write(h).catch(()=>{}),l()}catch($0){l($0)}},j._final=async function(h){try{await c.ready,c.close().catch(()=>{}),N=h}catch(x){h(x)}}}let g=V(_)?_.readable:_;f(g,()=>{if(N){let c=N;N=null,c()}})}if(P){if(Z(_))_.on("readable",function(){if(H){let g=H;H=null,g()}}),_.on("end",function(){j.push(null)}),j._read=function(){while(!0){let g=_.read();if(g===null){H=j._read;return}if(!j.push(g))return}};else if(B(_)){let g=(V(_)?_.readable:_).getReader();j._read=async function(){while(!0)try{let{value:c,done:h}=await g.read();if(!j.push(c))return;if(h){j.push(null);return}}catch{return}}}}return j._destroy=function(g,c){if(!g&&v!==null)g=new F;if(H=null,z=null,N=null,v===null)c(g);else if(v=c,Z(_))J(_,g)},j}}),jV=g0(($,q)=>{var Q=globalThis.AbortController||O6().AbortController,{codes:{ERR_INVALID_ARG_VALUE:K,ERR_INVALID_ARG_TYPE:J,ERR_MISSING_ARGS:Z,ERR_OUT_OF_RANGE:G},AbortError:W}=a0(),{validateAbortSignal:B,validateInteger:V,validateObject:U}=P6(),w=P0().Symbol("kWeak"),F=P0().Symbol("kResistStopPropagation"),{finished:M}=s2(),k=r9(),{addAbortSignalNoValidate:f}=L8(),{isWritable:L,isNodeStream:D}=b2(),{deprecate:z}=e0(),{ArrayPrototypePush:N,Boolean:H,MathFloor:v,Number:j,NumberIsNaN:n,Promise:d,PromiseReject:_,PromiseResolve:X,PromisePrototypeThen:P,Symbol:g}=P0(),c=g("kEmpty"),h=g("kEof");function x(O,E){if(E!=null)U(E,"options");if((E===null||E===void 0?void 0:E.signal)!=null)B(E.signal,"options.signal");if(D(O)&&!L(O))throw new K("stream",O,"must be writable");let a=k(this,O);if(E!==null&&E!==void 0&&E.signal)f(E.signal,a);return a}function l(O,E){if(typeof O!=="function")throw new J("fn",["Function","AsyncFunction"],O);if(E!=null)U(E,"options");if((E===null||E===void 0?void 0:E.signal)!=null)B(E.signal,"options.signal");let a=1;if((E===null||E===void 0?void 0:E.concurrency)!=null)a=v(E.concurrency);let K0=a-1;if((E===null||E===void 0?void 0:E.highWaterMark)!=null)K0=v(E.highWaterMark);return V(a,"options.concurrency",1),V(K0,"options.highWaterMark",0),K0+=a,async function*(){let R=e0().AbortSignalAny([E===null||E===void 0?void 0:E.signal].filter(H)),Y=this,C=[],u={signal:R},e,r,s=!1,T=0;function t(){s=!0,G0()}function G0(){T-=1,Q0()}function Q0(){if(r&&!s&&T=K0||T>=a))await new d((m0)=>{r=m0})}C.push(h)}catch(I0){let m0=_(I0);P(m0,G0,t),C.push(m0)}finally{if(s=!0,e)e(),e=null}}M0();try{while(!0){while(C.length>0){let I0=await C[0];if(I0===h)return;if(R.aborted)throw new W;if(I0!==c)yield I0;C.shift(),Q0()}await new d((I0)=>{e=I0})}}finally{if(s=!0,r)r(),r=null}}.call(this)}function $0(O=void 0){if(O!=null)U(O,"options");if((O===null||O===void 0?void 0:O.signal)!=null)B(O.signal,"options.signal");return async function*(){let E=0;for await(let K0 of this){var a;if(O!==null&&O!==void 0&&(a=O.signal)!==null&&a!==void 0&&a.aborted)throw new W({cause:O.signal.reason});yield[E++,K0]}}.call(this)}async function Z0(O,E=void 0){for await(let a of y.call(this,O,E))return!0;return!1}async function F0(O,E=void 0){if(typeof O!=="function")throw new J("fn",["Function","AsyncFunction"],O);return!await Z0.call(this,async(...a)=>{return!await O(...a)},E)}async function p(O,E){for await(let a of y.call(this,O,E))return a;return}async function W0(O,E){if(typeof O!=="function")throw new J("fn",["Function","AsyncFunction"],O);async function a(K0,R){return await O(K0,R),c}for await(let K0 of l.call(this,a,E));}function y(O,E){if(typeof O!=="function")throw new J("fn",["Function","AsyncFunction"],O);async function a(K0,R){if(await O(K0,R))return K0;return c}return l.call(this,a,E)}class i extends Z{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function U0(O,E,a){var K0;if(typeof O!=="function")throw new J("reducer",["Function","AsyncFunction"],O);if(a!=null)U(a,"options");if((a===null||a===void 0?void 0:a.signal)!=null)B(a.signal,"options.signal");let R=arguments.length>1;if(a!==null&&a!==void 0&&(K0=a.signal)!==null&&K0!==void 0&&K0.aborted){let r=new W(void 0,{cause:a.signal.reason});throw this.once("error",()=>{}),await M(this.destroy(r)),r}let Y=new Q,C=Y.signal;if(a!==null&&a!==void 0&&a.signal){let r={once:!0,[w]:this,[F]:!0};a.signal.addEventListener("abort",()=>Y.abort(),r)}let u=!1;try{for await(let r of this){var e;if(u=!0,a!==null&&a!==void 0&&(e=a.signal)!==null&&e!==void 0&&e.aborted)throw new W;if(!R)E=r,R=!0;else E=await O(E,r,{signal:C})}if(!u&&!R)throw new i}finally{Y.abort()}return E}async function m(O){if(O!=null)U(O,"options");if((O===null||O===void 0?void 0:O.signal)!=null)B(O.signal,"options.signal");let E=[];for await(let K0 of this){var a;if(O!==null&&O!==void 0&&(a=O.signal)!==null&&a!==void 0&&a.aborted)throw new W(void 0,{cause:O.signal.reason});N(E,K0)}return E}function V0(O,E){let a=l.call(this,O,E);return async function*(){for await(let K0 of a)yield*K0}.call(this)}function w0(O){if(O=j(O),n(O))return 0;if(O<0)throw new G("number",">= 0",O);return O}function S(O,E=void 0){if(E!=null)U(E,"options");if((E===null||E===void 0?void 0:E.signal)!=null)B(E.signal,"options.signal");return O=w0(O),async function*(){var a;if(E!==null&&E!==void 0&&(a=E.signal)!==null&&a!==void 0&&a.aborted)throw new W;for await(let R of this){var K0;if(E!==null&&E!==void 0&&(K0=E.signal)!==null&&K0!==void 0&&K0.aborted)throw new W;if(O--<=0)yield R}}.call(this)}function b(O,E=void 0){if(E!=null)U(E,"options");if((E===null||E===void 0?void 0:E.signal)!=null)B(E.signal,"options.signal");return O=w0(O),async function*(){var a;if(E!==null&&E!==void 0&&(a=E.signal)!==null&&a!==void 0&&a.aborted)throw new W;for await(let R of this){var K0;if(E!==null&&E!==void 0&&(K0=E.signal)!==null&&K0!==void 0&&K0.aborted)throw new W;if(O-- >0)yield R;if(O<=0)return}}.call(this)}q.exports.streamReturningOperators={asIndexedPairs:z($0,"readable.asIndexedPairs will be removed in a future version."),drop:S,filter:y,flatMap:V0,map:l,take:b,compose:x},q.exports.promiseReturningOperators={every:F0,forEach:W0,reduce:U0,toArray:m,some:Z0,find:p}}),s9=g0(($,q)=>{var{ArrayPrototypePop:Q,Promise:K}=P0(),{isIterable:J,isNodeStream:Z,isWebStream:G}=b2(),{pipelineImpl:W}=n5(),{finished:B}=s2();t9();function V(...U){return new K((w,F)=>{let M,k,f=U[U.length-1];if(f&&typeof f==="object"&&!Z(f)&&!J(f)&&!G(f)){let L=Q(U);M=L.signal,k=L.end}W(U,(L,D)=>{if(L)F(L);else w(D)},{signal:M,end:k})})}q.exports={finished:B,pipeline:V}}),t9=g0(($,q)=>{var{Buffer:Q}=(t0(),X0(K2)),{ObjectDefineProperty:K,ObjectKeys:J,ReflectApply:Z}=P0(),{promisify:{custom:G}}=e0(),{streamReturningOperators:W,promiseReturningOperators:B}=jV(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:V}}=a0(),U=r9(),{setDefaultHighWaterMark:w,getDefaultHighWaterMark:F}=H8(),{pipeline:M}=n5(),{destroyer:k}=o1(),f=s2(),L=s9(),D=b2(),z=q.exports=c5().Stream;z.isDestroyed=D.isDestroyed,z.isDisturbed=D.isDisturbed,z.isErrored=D.isErrored,z.isReadable=D.isReadable,z.isWritable=D.isWritable,z.Readable=v8();for(let H of J(W)){let v=function(...n){if(new.target)throw V();return z.Readable.from(Z(j,this,n))},j=W[H];K(v,"name",{__proto__:null,value:j.name}),K(v,"length",{__proto__:null,value:j.length}),K(z.Readable.prototype,H,{__proto__:null,value:v,enumerable:!1,configurable:!0,writable:!0})}for(let H of J(B)){let v=function(...n){if(new.target)throw V();return Z(j,this,n)},j=B[H];K(v,"name",{__proto__:null,value:j.name}),K(v,"length",{__proto__:null,value:j.length}),K(z.Readable.prototype,H,{__proto__:null,value:v,enumerable:!1,configurable:!0,writable:!0})}z.Writable=b5(),z.Duplex=c2(),z.Transform=a9(),z.PassThrough=l9(),z.pipeline=M;var{addAbortSignal:N}=L8();z.addAbortSignal=N,z.finished=f,z.destroy=k,z.compose=U,z.setDefaultHighWaterMark=w,z.getDefaultHighWaterMark=F,K(z,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return L}}),K(M,G,{__proto__:null,enumerable:!0,get(){return L.pipeline}}),K(f,G,{__proto__:null,enumerable:!0,get(){return L.finished}}),z.Stream=z,z._isUint8Array=function(H){return H instanceof Uint8Array},z._uint8ArrayToBuffer=function(H){return Q.from(H.buffer,H.byteOffset,H.byteLength)}}),gV=g0(($,q)=>{var Q=a1();{let K=t9(),J=s9(),Z=K.Readable.destroy;q.exports=K.Readable,q.exports._uint8ArrayToBuffer=K._uint8ArrayToBuffer,q.exports._isUint8Array=K._isUint8Array,q.exports.isDisturbed=K.isDisturbed,q.exports.isErrored=K.isErrored,q.exports.isReadable=K.isReadable,q.exports.Readable=K.Readable,q.exports.Writable=K.Writable,q.exports.Duplex=K.Duplex,q.exports.Transform=K.Transform,q.exports.PassThrough=K.PassThrough,q.exports.addAbortSignal=K.addAbortSignal,q.exports.finished=K.finished,q.exports.destroy=K.destroy,q.exports.destroy=Z,q.exports.pipeline=K.pipeline,q.exports.compose=K.compose,Object.defineProperty(K,"promises",{configurable:!0,enumerable:!0,get(){return J}}),q.exports.Stream=K.Stream}q.exports.default=q.exports});e9.exports=gV()});var d5=N0((Zz,$$)=>{$$.exports=a1()});var n2=N0((J2)=>{J2.base64=!0;J2.array=!0;J2.string=!0;J2.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u";J2.nodebuffer=typeof Buffer<"u";J2.uint8array=typeof Uint8Array<"u";if(typeof ArrayBuffer>"u")J2.blob=!1;else{f8=new ArrayBuffer(0);try{J2.blob=new Blob([f8],{type:"application/zip"}).size===0}catch($){try{m5=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,R8=new m5,R8.append(f8),J2.blob=R8.getBlob("application/zip").size===0}catch(q){J2.blob=!1}}}var f8,m5,R8;try{J2.nodestream=!!d5().Readable}catch($){J2.nodestream=!1}});var i5=N0((p5)=>{var AV=T0(),XV=n2(),A2="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";p5.encode=function($){var q=[],Q,K,J,Z,G,W,B,V=0,U=$.length,w=U,F=AV.getTypeOf($)!=="string";while(V<$.length){if(w=U-V,!F)Q=$.charCodeAt(V++),K=V>2,G=(Q&3)<<4|K>>4,W=w>1?(K&15)<<2|J>>6:64,B=w>2?J&63:64,q.push(A2.charAt(Z)+A2.charAt(G)+A2.charAt(W)+A2.charAt(B))}return q.join("")};p5.decode=function($){var q,Q,K,J,Z,G,W,B=0,V=0,U="data:";if($.substr(0,U.length)===U)throw Error("Invalid base64 input, it looks like a data url.");$=$.replace(/[^A-Za-z0-9+/=]/g,"");var w=$.length*3/4;if($.charAt($.length-1)===A2.charAt(64))w--;if($.charAt($.length-2)===A2.charAt(64))w--;if(w%1!==0)throw Error("Invalid base64 input, bad content length.");var F;if(XV.uint8array)F=new Uint8Array(w|0);else F=Array(w|0);while(B<$.length){if(J=A2.indexOf($.charAt(B++)),Z=A2.indexOf($.charAt(B++)),G=A2.indexOf($.charAt(B++)),W=A2.indexOf($.charAt(B++)),q=J<<2|Z>>4,Q=(Z&15)<<4|G>>2,K=(G&3)<<6|W,F[V++]=q,G!==64)F[V++]=Q;if(W!==64)F[V++]=K}return F}});var T6=N0((Bz,Q$)=>{Q$.exports={isNode:typeof Buffer<"u",newBufferFrom:function($,q){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from($,q);else{if(typeof $==="number")throw Error('The "data" argument must not be a number');return new Buffer($,q)}},allocBuffer:function($){if(Buffer.alloc)return Buffer.alloc($);else{var q=new Buffer($);return q.fill(0),q}},isBuffer:function($){return Buffer.isBuffer($)},isStream:function($){return $&&typeof $.on==="function"&&typeof $.pause==="function"&&typeof $.resume==="function"}}});var J$=N0((zz,K$)=>{var q$=global.MutationObserver||global.WebKitMutationObserver,u6;if(q$)C8=0,o5=new q$(I8),j8=global.document.createTextNode(""),o5.observe(j8,{characterData:!0}),u6=function(){j8.data=C8=++C8%2};else if(!global.setImmediate&&typeof global.MessageChannel<"u")g8=new global.MessageChannel,g8.port1.onmessage=I8,u6=function(){g8.port2.postMessage(0)};else if("document"in global&&"onreadystatechange"in global.document.createElement("script"))u6=function(){var $=global.document.createElement("script");$.onreadystatechange=function(){I8(),$.onreadystatechange=null,$.parentNode.removeChild($),$=null},global.document.documentElement.appendChild($)};else u6=function(){setTimeout(I8,0)};var C8,o5,j8,g8,a5,S6=[];function I8(){a5=!0;var $,q,Q=S6.length;while(Q){q=S6,S6=[],$=-1;while(++${var hV=J$();function l1(){}var o0={},V$=["REJECTED"],l5=["FULFILLED"],U$=["PENDING"];W$.exports=t2;function t2($){if(typeof $!=="function")throw TypeError("resolver must be a function");if(this.state=U$,this.queue=[],this.outcome=void 0,$!==l1)Z$(this,$)}t2.prototype.finally=function($){if(typeof $!=="function")return this;var q=this.constructor;return this.then(Q,K);function Q(J){function Z(){return J}return q.resolve($()).then(Z)}function K(J){function Z(){throw J}return q.resolve($()).then(Z)}};t2.prototype.catch=function($){return this.then(null,$)};t2.prototype.then=function($,q){if(typeof $!=="function"&&this.state===l5||typeof q!=="function"&&this.state===V$)return this;var Q=new this.constructor(l1);if(this.state!==U$){var K=this.state===l5?$:q;r5(Q,K,this.outcome)}else this.queue.push(new E6(Q,$,q));return Q};function E6($,q,Q){if(this.promise=$,typeof q==="function")this.onFulfilled=q,this.callFulfilled=this.otherCallFulfilled;if(typeof Q==="function")this.onRejected=Q,this.callRejected=this.otherCallRejected}E6.prototype.callFulfilled=function($){o0.resolve(this.promise,$)};E6.prototype.otherCallFulfilled=function($){r5(this.promise,this.onFulfilled,$)};E6.prototype.callRejected=function($){o0.reject(this.promise,$)};E6.prototype.otherCallRejected=function($){r5(this.promise,this.onRejected,$)};function r5($,q,Q){hV(function(){var K;try{K=q(Q)}catch(J){return o0.reject($,J)}if(K===$)o0.reject($,TypeError("Cannot resolve promise with itself"));else o0.resolve($,K)})}o0.resolve=function($,q){var Q=G$(xV,q);if(Q.status==="error")return o0.reject($,Q.value);var K=Q.value;if(K)Z$($,K);else{$.state=l5,$.outcome=q;var J=-1,Z=$.queue.length;while(++J{var s5=null;if(typeof Promise<"u")s5=Promise;else s5=B$();z$.exports={Promise:s5}});var M$=N0((F$)=>{(function($,q){if($.setImmediate)return;var Q=1,K={},J=!1,Z=$.document,G;function W(z){if(typeof z!=="function")z=Function(""+z);var N=Array(arguments.length-1);for(var H=0;H"u"?typeof global>"u"?F$:global:self)});var T0=N0((_0)=>{var e2=n2(),SV=i5(),s1=T6(),t5=r1();M$();function EV($){var q=null;if(e2.uint8array)q=new Uint8Array($.length);else q=Array($.length);return X8($,q)}_0.newBlob=function($,q){_0.checkSupport("blob");try{return new Blob([$],{type:q})}catch(J){try{var Q=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,K=new Q;return K.append($),K.getBlob(q)}catch(Z){throw Error("Bug : can't construct the Blob.")}}};function _6($){return $}function X8($,q){for(var Q=0;Q<$.length;++Q)q[Q]=$.charCodeAt(Q)&255;return q}var A8={stringifyByChunk:function($,q,Q){var K=[],J=0,Z=$.length;if(Z<=Q)return String.fromCharCode.apply(null,$);while(J1)try{return A8.stringifyByChunk($,Q,q)}catch(J){q=Math.floor(q/2)}return A8.stringifyByChar($)}_0.applyFromCharCode=c6;function y8($,q){for(var Q=0;Q<$.length;Q++)q[Q]=$[Q];return q}var $1={};$1.string={string:_6,array:function($){return X8($,Array($.length))},arraybuffer:function($){return $1.string.uint8array($).buffer},uint8array:function($){return X8($,new Uint8Array($.length))},nodebuffer:function($){return X8($,s1.allocBuffer($.length))}};$1.array={string:c6,array:_6,arraybuffer:function($){return new Uint8Array($).buffer},uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return s1.newBufferFrom($)}};$1.arraybuffer={string:function($){return c6(new Uint8Array($))},array:function($){return y8(new Uint8Array($),Array($.byteLength))},arraybuffer:_6,uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return s1.newBufferFrom(new Uint8Array($))}};$1.uint8array={string:c6,array:function($){return y8($,Array($.length))},arraybuffer:function($){return $.buffer},uint8array:_6,nodebuffer:function($){return s1.newBufferFrom($)}};$1.nodebuffer={string:c6,array:function($){return y8($,Array($.length))},arraybuffer:function($){return $1.nodebuffer.uint8array($).buffer},uint8array:function($){return y8($,new Uint8Array($.length))},nodebuffer:_6};_0.transformTo=function($,q){if(!q)q="";if(!$)return q;_0.checkSupport($);var Q=_0.getTypeOf(q),K=$1[Q][$](q);return K};_0.resolve=function($){var q=$.split("/"),Q=[];for(var K=0;K"u")$[Q]=arguments[q][Q];return $};_0.prepareContent=function($,q,Q,K,J){var Z=t5.Promise.resolve(q).then(function(G){var W=e2.blob&&(G instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(G))!==-1);if(W&&typeof FileReader<"u")return new t5.Promise(function(B,V){var U=new FileReader;U.onload=function(w){B(w.target.result)},U.onerror=function(w){V(w.target.error)},U.readAsArrayBuffer(G)});else return G});return Z.then(function(G){var W=_0.getTypeOf(G);if(!W)return t5.Promise.reject(Error("Can't read the data of '"+$+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));if(W==="arraybuffer")G=_0.transformTo("uint8array",G);else if(W==="string"){if(J)G=SV.decode(G);else if(Q){if(K!==!0)G=EV(G)}}return G})}});var V2=N0((Yz,N$)=>{function w$($){this.name=$||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}w$.prototype={push:function($){this.emit("data",$)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch($){this.emit("error",$)}return!0},error:function($){if(this.isFinished)return!1;if(this.isPaused)this.generatedError=$;else{if(this.isFinished=!0,this.emit("error",$),this.previous)this.previous.error($);this.cleanUp()}return!0},on:function($,q){return this._listeners[$].push(q),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function($,q){if(this._listeners[$])for(var Q=0;Q "+$;else return $}};N$.exports=w$});var e1=N0((Q1)=>{var t1=T0(),L1=n2(),_V=T6(),h8=V2(),b6=Array(256);for(X2=0;X2<256;X2++)b6[X2]=X2>=252?6:X2>=248?5:X2>=240?4:X2>=224?3:X2>=192?2:1;var X2;b6[254]=b6[254]=1;var cV=function($){var q,Q,K,J,Z,G=$.length,W=0;for(J=0;J>>6,q[Z++]=128|Q&63;else if(Q<65536)q[Z++]=224|Q>>>12,q[Z++]=128|Q>>>6&63,q[Z++]=128|Q&63;else q[Z++]=240|Q>>>18,q[Z++]=128|Q>>>12&63,q[Z++]=128|Q>>>6&63,q[Z++]=128|Q&63}return q},bV=function($,q){var Q;if(q=q||$.length,q>$.length)q=$.length;Q=q-1;while(Q>=0&&($[Q]&192)===128)Q--;if(Q<0)return q;if(Q===0)return q;return Q+b6[$[Q]]>q?Q:q},nV=function($){var q,Q,K,J,Z=$.length,G=Array(Z*2);for(Q=0,q=0;q4){G[Q++]=65533,q+=J-1;continue}K&=J===2?31:J===3?15:7;while(J>1&&q1){G[Q++]=65533;continue}if(K<65536)G[Q++]=K;else K-=65536,G[Q++]=55296|K>>10&1023,G[Q++]=56320|K&1023}if(G.length!==Q)if(G.subarray)G=G.subarray(0,Q);else G.length=Q;return t1.applyFromCharCode(G)};Q1.utf8encode=function(q){if(L1.nodebuffer)return _V.newBufferFrom(q,"utf-8");return cV(q)};Q1.utf8decode=function(q){if(L1.nodebuffer)return t1.transformTo("nodebuffer",q).toString("utf-8");return q=t1.transformTo(L1.uint8array?"uint8array":"array",q),nV(q)};function x8(){h8.call(this,"utf-8 decode"),this.leftOver=null}t1.inherits(x8,h8);x8.prototype.processChunk=function($){var q=t1.transformTo(L1.uint8array?"uint8array":"array",$.data);if(this.leftOver&&this.leftOver.length){if(L1.uint8array){var Q=q;q=new Uint8Array(Q.length+this.leftOver.length),q.set(this.leftOver,0),q.set(Q,this.leftOver.length)}else q=this.leftOver.concat(q);this.leftOver=null}var K=bV(q),J=q;if(K!==q.length)if(L1.uint8array)J=q.subarray(0,K),this.leftOver=q.subarray(K,q.length);else J=q.slice(0,K),this.leftOver=q.slice(K,q.length);this.push({data:Q1.utf8decode(J),meta:$.meta})};x8.prototype.flush=function(){if(this.leftOver&&this.leftOver.length)this.push({data:Q1.utf8decode(this.leftOver),meta:{}}),this.leftOver=null};Q1.Utf8DecodeWorker=x8;function e5(){h8.call(this,"utf-8 encode")}t1.inherits(e5,h8);e5.prototype.processChunk=function($){this.push({data:Q1.utf8encode($.data),meta:$.meta})};Q1.Utf8EncodeWorker=e5});var L$=N0((Dz,D$)=>{var Y$=V2(),k$=T0();function $4($){Y$.call(this,"ConvertWorker to "+$),this.destType=$}k$.inherits($4,Y$);$4.prototype.processChunk=function($){this.push({data:k$.transformTo(this.destType,$.data),meta:$.meta})};D$.exports=$4});var f$=N0((Lz,v$)=>{var H$=d5().Readable,dV=T0();dV.inherits(Q4,H$);function Q4($,q,Q){H$.call(this,q),this._helper=$;var K=this;$.on("data",function(J,Z){if(!K.push(J))K._helper.pause();if(Q)Q(Z)}).on("error",function(J){K.emit("error",J)}).on("end",function(){K.push(null)})}Q4.prototype._read=function(){this._helper.resume()};v$.exports=Q4});var q4=N0((Hz,C$)=>{var H1=T0(),mV=L$(),pV=V2(),iV=i5(),oV=n2(),aV=r1(),R$=null;if(oV.nodestream)try{R$=f$()}catch($){}function lV($,q,Q){switch($){case"blob":return H1.newBlob(H1.transformTo("arraybuffer",q),Q);case"base64":return iV.encode(q);default:return H1.transformTo($,q)}}function rV($,q){var Q,K=0,J=null,Z=0;for(Q=0;Q{D2.base64=!1;D2.binary=!1;D2.dir=!1;D2.createFolders=!0;D2.date=null;D2.compression=null;D2.compressionOptions=null;D2.comment=null;D2.unixPermissions=null;D2.dosPermissions=null});var J4=N0((fz,j$)=>{var O8=T0(),P8=V2(),tV=16384;function $6($){P8.call(this,"DataWorker");var q=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,$.then(function(Q){if(q.dataIsReady=!0,q.data=Q,q.max=Q&&Q.length||0,q.type=O8.getTypeOf(Q),!q.isPaused)q._tickAndRepeat()},function(Q){q.error(Q)})}O8.inherits($6,P8);$6.prototype.cleanUp=function(){P8.prototype.cleanUp.call(this),this.data=null};$6.prototype.resume=function(){if(!P8.prototype.resume.call(this))return!1;if(!this._tickScheduled&&this.dataIsReady)this._tickScheduled=!0,O8.delay(this._tickAndRepeat,[],this);return!0};$6.prototype._tickAndRepeat=function(){if(this._tickScheduled=!1,this.isPaused||this.isFinished)return;if(this._tick(),!this.isFinished)O8.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0};$6.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var $=tV,q=null,Q=Math.min(this.max,this.index+$);if(this.index>=this.max)return this.end();else{switch(this.type){case"string":q=this.data.substring(this.index,Q);break;case"uint8array":q=this.data.subarray(this.index,Q);break;case"array":case"nodebuffer":q=this.data.slice(this.index,Q);break}return this.index=Q,this.push({data:q,meta:{percent:this.max?this.index/this.max*100:0}})}};j$.exports=$6});var T8=N0((Rz,A$)=>{var eV=T0();function $U(){var $,q=[];for(var Q=0;Q<256;Q++){$=Q;for(var K=0;K<8;K++)$=$&1?3988292384^$>>>1:$>>>1;q[Q]=$}return q}var g$=$U();function QU($,q,Q,K){var J=g$,Z=K+Q;$=$^-1;for(var G=K;G>>8^J[($^q[G])&255];return $^-1}function qU($,q,Q,K){var J=g$,Z=K+Q;$=$^-1;for(var G=K;G>>8^J[($^q.charCodeAt(G))&255];return $^-1}A$.exports=function(q,Q){if(typeof q>"u"||!q.length)return 0;var K=eV.getTypeOf(q)!=="string";if(K)return QU(Q|0,q,q.length,0);else return qU(Q|0,q,q.length,0)}});var U4=N0((Iz,y$)=>{var X$=V2(),KU=T8(),JU=T0();function V4(){X$.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}JU.inherits(V4,X$);V4.prototype.processChunk=function($){this.streamInfo.crc32=KU($.data,this.streamInfo.crc32||0),this.push($)};y$.exports=V4});var x$=N0((Cz,h$)=>{var VU=T0(),Z4=V2();function G4($){Z4.call(this,"DataLengthProbe for "+$),this.propName=$,this.withStreamInfo($,0)}VU.inherits(G4,Z4);G4.prototype.processChunk=function($){if($){var q=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=q+$.data.length}Z4.prototype.processChunk.call(this,$)};h$.exports=G4});var u8=N0((jz,T$)=>{var O$=r1(),P$=J4(),UU=U4(),W4=x$();function B4($,q,Q,K,J){this.compressedSize=$,this.uncompressedSize=q,this.crc32=Q,this.compression=K,this.compressedContent=J}B4.prototype={getContentWorker:function(){var $=new P$(O$.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new W4("data_length")),q=this;return $.on("end",function(){if(this.streamInfo.data_length!==q.uncompressedSize)throw Error("Bug : uncompressed data size mismatch")}),$},getCompressedWorker:function(){return new P$(O$.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};B4.createWorkerFrom=function($,q,Q){return $.pipe(new UU).pipe(new W4("uncompressedSize")).pipe(q.compressWorker(Q)).pipe(new W4("compressedSize")).withStreamInfo("compression",q)};T$.exports=B4});var _$=N0((gz,E$)=>{var ZU=q4(),GU=J4(),z4=e1(),F4=u8(),u$=V2(),M4=function($,q,Q){this.name=$,this.dir=Q.dir,this.date=Q.date,this.comment=Q.comment,this.unixPermissions=Q.unixPermissions,this.dosPermissions=Q.dosPermissions,this._data=q,this._dataBinary=Q.binary,this.options={compression:Q.compression,compressionOptions:Q.compressionOptions}};M4.prototype={internalStream:function($){var q=null,Q="string";try{if(!$)throw Error("No output type specified.");Q=$.toLowerCase();var K=Q==="string"||Q==="text";if(Q==="binarystring"||Q==="text")Q="string";q=this._decompressWorker();var J=!this._dataBinary;if(J&&!K)q=q.pipe(new z4.Utf8EncodeWorker);if(!J&&K)q=q.pipe(new z4.Utf8DecodeWorker)}catch(Z){q=new u$("error"),q.error(Z)}return new ZU(q,Q,"")},async:function($,q){return this.internalStream($).accumulate(q)},nodeStream:function($,q){return this.internalStream($||"nodebuffer").toNodejsStream(q)},_compressWorker:function($,q){if(this._data instanceof F4&&this._data.compression.magic===$.magic)return this._data.getCompressedWorker();else{var Q=this._decompressWorker();if(!this._dataBinary)Q=Q.pipe(new z4.Utf8EncodeWorker);return F4.createWorkerFrom(Q,$,q)}},_decompressWorker:function(){if(this._data instanceof F4)return this._data.getContentWorker();else if(this._data instanceof u$)return this._data;else return new GU(this._data)}};var S$=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],WU=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(n6=0;n6{var BU=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function zU($,q){return Object.prototype.hasOwnProperty.call($,q)}l0.assign=function($){var q=Array.prototype.slice.call(arguments,1);while(q.length){var Q=q.shift();if(!Q)continue;if(typeof Q!=="object")throw TypeError(Q+"must be non-object");for(var K in Q)if(zU(Q,K))$[K]=Q[K]}return $};l0.shrinkBuf=function($,q){if($.length===q)return $;if($.subarray)return $.subarray(0,q);return $.length=q,$};var FU={arraySet:function($,q,Q,K,J){if(q.subarray&&$.subarray){$.set(q.subarray(Q,Q+K),J);return}for(var Z=0;Z{var wU=d2(),NU=4,c$=0,b$=1,YU=2;function q6($){var q=$.length;while(--q>=0)$[q]=0}var kU=0,o$=1,DU=2,LU=3,HU=258,H4=29,a6=256,m6=a6+1+H4,Q6=30,v4=19,a$=2*m6+1,v1=15,w4=16,vU=7,f4=256,l$=16,r$=17,s$=18,D4=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],S8=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],fU=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],t$=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],RU=512,m2=Array((m6+2)*2);q6(m2);var d6=Array(Q6*2);q6(d6);var p6=Array(RU);q6(p6);var i6=Array(HU-LU+1);q6(i6);var R4=Array(H4);q6(R4);var E8=Array(Q6);q6(E8);function N4($,q,Q,K,J){this.static_tree=$,this.extra_bits=q,this.extra_base=Q,this.elems=K,this.max_length=J,this.has_stree=$&&$.length}var e$,$Q,QQ;function Y4($,q){this.dyn_tree=$,this.max_code=0,this.stat_desc=q}function qQ($){return $<256?p6[$]:p6[256+($>>>7)]}function o6($,q){$.pending_buf[$.pending++]=q&255,$.pending_buf[$.pending++]=q>>>8&255}function $2($,q,Q){if($.bi_valid>w4-Q)$.bi_buf|=q<<$.bi_valid&65535,o6($,$.bi_buf),$.bi_buf=q>>w4-$.bi_valid,$.bi_valid+=Q-w4;else $.bi_buf|=q<<$.bi_valid&65535,$.bi_valid+=Q}function y2($,q,Q){$2($,Q[q*2],Q[q*2+1])}function KQ($,q){var Q=0;do Q|=$&1,$>>>=1,Q<<=1;while(--q>0);return Q>>>1}function IU($){if($.bi_valid===16)o6($,$.bi_buf),$.bi_buf=0,$.bi_valid=0;else if($.bi_valid>=8)$.pending_buf[$.pending++]=$.bi_buf&255,$.bi_buf>>=8,$.bi_valid-=8}function CU($,q){var{dyn_tree:Q,max_code:K}=q,J=q.stat_desc.static_tree,Z=q.stat_desc.has_stree,G=q.stat_desc.extra_bits,W=q.stat_desc.extra_base,B=q.stat_desc.max_length,V,U,w,F,M,k,f=0;for(F=0;F<=v1;F++)$.bl_count[F]=0;Q[$.heap[$.heap_max]*2+1]=0;for(V=$.heap_max+1;VB)F=B,f++;if(Q[U*2+1]=F,U>K)continue;if($.bl_count[F]++,M=0,U>=W)M=G[U-W];if(k=Q[U*2],$.opt_len+=k*(F+M),Z)$.static_len+=k*(J[U*2+1]+M)}if(f===0)return;do{F=B-1;while($.bl_count[F]===0)F--;$.bl_count[F]--,$.bl_count[F+1]+=2,$.bl_count[B]--,f-=2}while(f>0);for(F=B;F!==0;F--){U=$.bl_count[F];while(U!==0){if(w=$.heap[--V],w>K)continue;if(Q[w*2+1]!==F)$.opt_len+=(F-Q[w*2+1])*Q[w*2],Q[w*2+1]=F;U--}}}function JQ($,q,Q){var K=Array(v1+1),J=0,Z,G;for(Z=1;Z<=v1;Z++)K[Z]=J=J+Q[Z-1]<<1;for(G=0;G<=q;G++){var W=$[G*2+1];if(W===0)continue;$[G*2]=KQ(K[W]++,W)}}function jU(){var $,q,Q,K,J,Z=Array(v1+1);Q=0;for(K=0;K>=7;for(;K8)o6($,$.bi_buf);else if($.bi_valid>0)$.pending_buf[$.pending++]=$.bi_buf;$.bi_buf=0,$.bi_valid=0}function gU($,q,Q,K){if(UQ($),K)o6($,Q),o6($,~Q);wU.arraySet($.pending_buf,$.window,q,Q,$.pending),$.pending+=Q}function n$($,q,Q,K){var J=q*2,Z=Q*2;return $[J]<$[Z]||$[J]===$[Z]&&K[q]<=K[Q]}function k4($,q,Q){var K=$.heap[Q],J=Q<<1;while(J<=$.heap_len){if(J<$.heap_len&&n$(q,$.heap[J+1],$.heap[J],$.depth))J++;if(n$(q,K,$.heap[J],$.depth))break;$.heap[Q]=$.heap[J],Q=J,J<<=1}$.heap[Q]=K}function d$($,q,Q){var K,J,Z=0,G,W;if($.last_lit!==0)do if(K=$.pending_buf[$.d_buf+Z*2]<<8|$.pending_buf[$.d_buf+Z*2+1],J=$.pending_buf[$.l_buf+Z],Z++,K===0)y2($,J,q);else{if(G=i6[J],y2($,G+a6+1,q),W=D4[G],W!==0)J-=R4[G],$2($,J,W);if(K--,G=qQ(K),y2($,G,Q),W=S8[G],W!==0)K-=E8[G],$2($,K,W)}while(Z<$.last_lit);y2($,f4,q)}function L4($,q){var Q=q.dyn_tree,K=q.stat_desc.static_tree,J=q.stat_desc.has_stree,Z=q.stat_desc.elems,G,W,B=-1,V;$.heap_len=0,$.heap_max=a$;for(G=0;G>1;G>=1;G--)k4($,Q,G);V=Z;do G=$.heap[1],$.heap[1]=$.heap[$.heap_len--],k4($,Q,1),W=$.heap[1],$.heap[--$.heap_max]=G,$.heap[--$.heap_max]=W,Q[V*2]=Q[G*2]+Q[W*2],$.depth[V]=($.depth[G]>=$.depth[W]?$.depth[G]:$.depth[W])+1,Q[G*2+1]=Q[W*2+1]=V,$.heap[1]=V++,k4($,Q,1);while($.heap_len>=2);$.heap[--$.heap_max]=$.heap[1],CU($,q),JQ(Q,B,$.bl_count)}function m$($,q,Q){var K,J=-1,Z,G=q[1],W=0,B=7,V=4;if(G===0)B=138,V=3;q[(Q+1)*2+1]=65535;for(K=0;K<=Q;K++){if(Z=G,G=q[(K+1)*2+1],++W=3;q--)if($.bl_tree[t$[q]*2+1]!==0)break;return $.opt_len+=3*(q+1)+5+5+4,q}function XU($,q,Q,K){var J;$2($,q-257,5),$2($,Q-1,5),$2($,K-4,4);for(J=0;J>>=1)if(q&1&&$.dyn_ltree[Q*2]!==0)return c$;if($.dyn_ltree[18]!==0||$.dyn_ltree[20]!==0||$.dyn_ltree[26]!==0)return b$;for(Q=32;Q0){if($.strm.data_type===YU)$.strm.data_type=yU($);if(L4($,$.l_desc),L4($,$.d_desc),G=AU($),J=$.opt_len+3+7>>>3,Z=$.static_len+3+7>>>3,Z<=J)J=Z}else J=Z=Q+5;if(Q+4<=J&&q!==-1)ZQ($,q,Q,K);else if($.strategy===NU||Z===J)$2($,(o$<<1)+(K?1:0),3),d$($,m2,d6);else $2($,(DU<<1)+(K?1:0),3),XU($,$.l_desc.max_code+1,$.d_desc.max_code+1,G+1),d$($,$.dyn_ltree,$.dyn_dtree);if(VQ($),K)UQ($)}function PU($,q,Q){if($.pending_buf[$.d_buf+$.last_lit*2]=q>>>8&255,$.pending_buf[$.d_buf+$.last_lit*2+1]=q&255,$.pending_buf[$.l_buf+$.last_lit]=Q&255,$.last_lit++,q===0)$.dyn_ltree[Q*2]++;else $.matches++,q--,$.dyn_ltree[(i6[Q]+a6+1)*2]++,$.dyn_dtree[qQ(q)*2]++;return $.last_lit===$.lit_bufsize-1}K6._tr_init=hU;K6._tr_stored_block=ZQ;K6._tr_flush_block=OU;K6._tr_tally=PU;K6._tr_align=xU});var I4=N0((yz,WQ)=>{function TU($,q,Q,K){var J=$&65535|0,Z=$>>>16&65535|0,G=0;while(Q!==0){G=Q>2000?2000:Q,Q-=G;do J=J+q[K++]|0,Z=Z+J|0;while(--G);J%=65521,Z%=65521}return J|Z<<16|0}WQ.exports=TU});var C4=N0((hz,BQ)=>{function uU(){var $,q=[];for(var Q=0;Q<256;Q++){$=Q;for(var K=0;K<8;K++)$=$&1?3988292384^$>>>1:$>>>1;q[Q]=$}return q}var SU=uU();function EU($,q,Q,K){var J=SU,Z=K+Q;$^=-1;for(var G=K;G>>8^J[($^q[G])&255];return $^-1}BQ.exports=EU});var _8=N0((xz,zQ)=>{zQ.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var HQ=N0((O2)=>{var r0=d2(),M2=GQ(),NQ=I4(),q1=C4(),_U=_8(),C1=0,cU=1,bU=3,Z1=4,FQ=5,x2=0,MQ=1,w2=-2,nU=-3,j4=-5,dU=-1,mU=1,c8=2,pU=3,iU=4,oU=0,aU=2,m8=8,lU=9,rU=15,sU=8,tU=29,eU=256,A4=eU+1+tU,$Z=30,QZ=19,qZ=2*A4+1,KZ=15,f0=3,V1=258,L2=V1+f0+1,JZ=32,p8=42,X4=69,b8=73,n8=91,d8=103,f1=113,r6=666,c0=1,s6=2,R1=3,U6=4,VZ=3;function U1($,q){return $.msg=_U[q],q}function wQ($){return($<<1)-($>4?9:0)}function J1($){var q=$.length;while(--q>=0)$[q]=0}function K1($){var q=$.state,Q=q.pending;if(Q>$.avail_out)Q=$.avail_out;if(Q===0)return;if(r0.arraySet($.output,q.pending_buf,q.pending_out,Q,$.next_out),$.next_out+=Q,q.pending_out+=Q,$.total_out+=Q,$.avail_out-=Q,q.pending-=Q,q.pending===0)q.pending_out=0}function d0($,q){M2._tr_flush_block($,$.block_start>=0?$.block_start:-1,$.strstart-$.block_start,q),$.block_start=$.strstart,K1($.strm)}function C0($,q){$.pending_buf[$.pending++]=q}function l6($,q){$.pending_buf[$.pending++]=q>>>8&255,$.pending_buf[$.pending++]=q&255}function UZ($,q,Q,K){var J=$.avail_in;if(J>K)J=K;if(J===0)return 0;if($.avail_in-=J,r0.arraySet(q,$.input,$.next_in,J,Q),$.state.wrap===1)$.adler=NQ($.adler,q,J,Q);else if($.state.wrap===2)$.adler=q1($.adler,q,J,Q);return $.next_in+=J,$.total_in+=J,J}function YQ($,q){var{max_chain_length:Q,strstart:K}=$,J,Z,G=$.prev_length,W=$.nice_match,B=$.strstart>$.w_size-L2?$.strstart-($.w_size-L2):0,V=$.window,U=$.w_mask,w=$.prev,F=$.strstart+V1,M=V[K+G-1],k=V[K+G];if($.prev_length>=$.good_match)Q>>=2;if(W>$.lookahead)W=$.lookahead;do{if(J=q,V[J+G]!==k||V[J+G-1]!==M||V[J]!==V[K]||V[++J]!==V[K+1])continue;K+=2,J++;do;while(V[++K]===V[++J]&&V[++K]===V[++J]&&V[++K]===V[++J]&&V[++K]===V[++J]&&V[++K]===V[++J]&&V[++K]===V[++J]&&V[++K]===V[++J]&&V[++K]===V[++J]&&KG){if($.match_start=q,G=Z,Z>=W)break;M=V[K+G-1],k=V[K+G]}}while((q=w[q&U])>B&&--Q!==0);if(G<=$.lookahead)return G;return $.lookahead}function I1($){var q=$.w_size,Q,K,J,Z,G;do{if(Z=$.window_size-$.lookahead-$.strstart,$.strstart>=q+(q-L2)){r0.arraySet($.window,$.window,q,q,0),$.match_start-=q,$.strstart-=q,$.block_start-=q,K=$.hash_size,Q=K;do J=$.head[--Q],$.head[Q]=J>=q?J-q:0;while(--K);K=q,Q=K;do J=$.prev[--Q],$.prev[Q]=J>=q?J-q:0;while(--K);Z+=q}if($.strm.avail_in===0)break;if(K=UZ($.strm,$.window,$.strstart+$.lookahead,Z),$.lookahead+=K,$.lookahead+$.insert>=f0){G=$.strstart-$.insert,$.ins_h=$.window[G],$.ins_h=($.ins_h<<$.hash_shift^$.window[G+1])&$.hash_mask;while($.insert)if($.ins_h=($.ins_h<<$.hash_shift^$.window[G+f0-1])&$.hash_mask,$.prev[G&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=G,G++,$.insert--,$.lookahead+$.insert$.pending_buf_size-5)Q=$.pending_buf_size-5;for(;;){if($.lookahead<=1){if(I1($),$.lookahead===0&&q===C1)return c0;if($.lookahead===0)break}$.strstart+=$.lookahead,$.lookahead=0;var K=$.block_start+Q;if($.strstart===0||$.strstart>=K){if($.lookahead=$.strstart-K,$.strstart=K,d0($,!1),$.strm.avail_out===0)return c0}if($.strstart-$.block_start>=$.w_size-L2){if(d0($,!1),$.strm.avail_out===0)return c0}}if($.insert=0,q===Z1){if(d0($,!0),$.strm.avail_out===0)return R1;return U6}if($.strstart>$.block_start){if(d0($,!1),$.strm.avail_out===0)return c0}return c0}function g4($,q){var Q,K;for(;;){if($.lookahead=f0)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f0-1])&$.hash_mask,Q=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if(Q!==0&&$.strstart-Q<=$.w_size-L2)$.match_length=YQ($,Q);if($.match_length>=f0)if(K=M2._tr_tally($,$.strstart-$.match_start,$.match_length-f0),$.lookahead-=$.match_length,$.match_length<=$.max_lazy_match&&$.lookahead>=f0){$.match_length--;do $.strstart++,$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f0-1])&$.hash_mask,Q=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.match_length!==0);$.strstart++}else $.strstart+=$.match_length,$.match_length=0,$.ins_h=$.window[$.strstart],$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+1])&$.hash_mask;else K=M2._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(K){if(d0($,!1),$.strm.avail_out===0)return c0}}if($.insert=$.strstart=f0)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f0-1])&$.hash_mask,Q=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if($.prev_length=$.match_length,$.prev_match=$.match_start,$.match_length=f0-1,Q!==0&&$.prev_length<$.max_lazy_match&&$.strstart-Q<=$.w_size-L2){if($.match_length=YQ($,Q),$.match_length<=5&&($.strategy===mU||$.match_length===f0&&$.strstart-$.match_start>4096))$.match_length=f0-1}if($.prev_length>=f0&&$.match_length<=$.prev_length){J=$.strstart+$.lookahead-f0,K=M2._tr_tally($,$.strstart-1-$.prev_match,$.prev_length-f0),$.lookahead-=$.prev_length-1,$.prev_length-=2;do if(++$.strstart<=J)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f0-1])&$.hash_mask,Q=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.prev_length!==0);if($.match_available=0,$.match_length=f0-1,$.strstart++,K){if(d0($,!1),$.strm.avail_out===0)return c0}}else if($.match_available){if(K=M2._tr_tally($,0,$.window[$.strstart-1]),K)d0($,!1);if($.strstart++,$.lookahead--,$.strm.avail_out===0)return c0}else $.match_available=1,$.strstart++,$.lookahead--}if($.match_available)K=M2._tr_tally($,0,$.window[$.strstart-1]),$.match_available=0;if($.insert=$.strstart=f0&&$.strstart>0){if(J=$.strstart-1,K=G[J],K===G[++J]&&K===G[++J]&&K===G[++J]){Z=$.strstart+V1;do;while(K===G[++J]&&K===G[++J]&&K===G[++J]&&K===G[++J]&&K===G[++J]&&K===G[++J]&&K===G[++J]&&K===G[++J]&&J$.lookahead)$.match_length=$.lookahead}}if($.match_length>=f0)Q=M2._tr_tally($,1,$.match_length-f0),$.lookahead-=$.match_length,$.strstart+=$.match_length,$.match_length=0;else Q=M2._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(Q){if(d0($,!1),$.strm.avail_out===0)return c0}}if($.insert=0,q===Z1){if(d0($,!0),$.strm.avail_out===0)return R1;return U6}if($.last_lit){if(d0($,!1),$.strm.avail_out===0)return c0}return s6}function WZ($,q){var Q;for(;;){if($.lookahead===0){if(I1($),$.lookahead===0){if(q===C1)return c0;break}}if($.match_length=0,Q=M2._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++,Q){if(d0($,!1),$.strm.avail_out===0)return c0}}if($.insert=0,q===Z1){if(d0($,!0),$.strm.avail_out===0)return R1;return U6}if($.last_lit){if(d0($,!1),$.strm.avail_out===0)return c0}return s6}function h2($,q,Q,K,J){this.good_length=$,this.max_lazy=q,this.nice_length=Q,this.max_chain=K,this.func=J}var V6;V6=[new h2(0,0,0,0,ZZ),new h2(4,4,8,4,g4),new h2(4,5,16,8,g4),new h2(4,6,32,32,g4),new h2(4,4,16,16,J6),new h2(8,16,32,32,J6),new h2(8,16,128,128,J6),new h2(8,32,128,256,J6),new h2(32,128,258,1024,J6),new h2(32,258,258,4096,J6)];function BZ($){$.window_size=2*$.w_size,J1($.head),$.max_lazy_match=V6[$.level].max_lazy,$.good_match=V6[$.level].good_length,$.nice_match=V6[$.level].nice_length,$.max_chain_length=V6[$.level].max_chain,$.strstart=0,$.block_start=0,$.lookahead=0,$.insert=0,$.match_length=$.prev_length=f0-1,$.match_available=0,$.ins_h=0}function zZ(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=m8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r0.Buf16(qZ*2),this.dyn_dtree=new r0.Buf16((2*$Z+1)*2),this.bl_tree=new r0.Buf16((2*QZ+1)*2),J1(this.dyn_ltree),J1(this.dyn_dtree),J1(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r0.Buf16(KZ+1),this.heap=new r0.Buf16(2*A4+1),J1(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r0.Buf16(2*A4+1),J1(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function kQ($){var q;if(!$||!$.state)return U1($,w2);if($.total_in=$.total_out=0,$.data_type=aU,q=$.state,q.pending=0,q.pending_out=0,q.wrap<0)q.wrap=-q.wrap;return q.status=q.wrap?p8:f1,$.adler=q.wrap===2?0:1,q.last_flush=C1,M2._tr_init(q),x2}function DQ($){var q=kQ($);if(q===x2)BZ($.state);return q}function FZ($,q){if(!$||!$.state)return w2;if($.state.wrap!==2)return w2;return $.state.gzhead=q,x2}function LQ($,q,Q,K,J,Z){if(!$)return w2;var G=1;if(q===dU)q=6;if(K<0)G=0,K=-K;else if(K>15)G=2,K-=16;if(J<1||J>lU||Q!==m8||K<8||K>15||q<0||q>9||Z<0||Z>iU)return U1($,w2);if(K===8)K=9;var W=new zZ;return $.state=W,W.strm=$,W.wrap=G,W.gzhead=null,W.w_bits=K,W.w_size=1<FQ||q<0)return $?U1($,w2):w2;if(K=$.state,!$.output||!$.input&&$.avail_in!==0||K.status===r6&&q!==Z1)return U1($,$.avail_out===0?j4:w2);if(K.strm=$,Q=K.last_flush,K.last_flush=q,K.status===p8)if(K.wrap===2)if($.adler=0,C0(K,31),C0(K,139),C0(K,8),!K.gzhead)C0(K,0),C0(K,0),C0(K,0),C0(K,0),C0(K,0),C0(K,K.level===9?2:K.strategy>=c8||K.level<2?4:0),C0(K,VZ),K.status=f1;else{if(C0(K,(K.gzhead.text?1:0)+(K.gzhead.hcrc?2:0)+(!K.gzhead.extra?0:4)+(!K.gzhead.name?0:8)+(!K.gzhead.comment?0:16)),C0(K,K.gzhead.time&255),C0(K,K.gzhead.time>>8&255),C0(K,K.gzhead.time>>16&255),C0(K,K.gzhead.time>>24&255),C0(K,K.level===9?2:K.strategy>=c8||K.level<2?4:0),C0(K,K.gzhead.os&255),K.gzhead.extra&&K.gzhead.extra.length)C0(K,K.gzhead.extra.length&255),C0(K,K.gzhead.extra.length>>8&255);if(K.gzhead.hcrc)$.adler=q1($.adler,K.pending_buf,K.pending,0);K.gzindex=0,K.status=X4}else{var G=m8+(K.w_bits-8<<4)<<8,W=-1;if(K.strategy>=c8||K.level<2)W=0;else if(K.level<6)W=1;else if(K.level===6)W=2;else W=3;if(G|=W<<6,K.strstart!==0)G|=JZ;if(G+=31-G%31,K.status=f1,l6(K,G),K.strstart!==0)l6(K,$.adler>>>16),l6(K,$.adler&65535);$.adler=1}if(K.status===X4)if(K.gzhead.extra){J=K.pending;while(K.gzindex<(K.gzhead.extra.length&65535)){if(K.pending===K.pending_buf_size){if(K.gzhead.hcrc&&K.pending>J)$.adler=q1($.adler,K.pending_buf,K.pending-J,J);if(K1($),J=K.pending,K.pending===K.pending_buf_size)break}C0(K,K.gzhead.extra[K.gzindex]&255),K.gzindex++}if(K.gzhead.hcrc&&K.pending>J)$.adler=q1($.adler,K.pending_buf,K.pending-J,J);if(K.gzindex===K.gzhead.extra.length)K.gzindex=0,K.status=b8}else K.status=b8;if(K.status===b8)if(K.gzhead.name){J=K.pending;do{if(K.pending===K.pending_buf_size){if(K.gzhead.hcrc&&K.pending>J)$.adler=q1($.adler,K.pending_buf,K.pending-J,J);if(K1($),J=K.pending,K.pending===K.pending_buf_size){Z=1;break}}if(K.gzindexJ)$.adler=q1($.adler,K.pending_buf,K.pending-J,J);if(Z===0)K.gzindex=0,K.status=n8}else K.status=n8;if(K.status===n8)if(K.gzhead.comment){J=K.pending;do{if(K.pending===K.pending_buf_size){if(K.gzhead.hcrc&&K.pending>J)$.adler=q1($.adler,K.pending_buf,K.pending-J,J);if(K1($),J=K.pending,K.pending===K.pending_buf_size){Z=1;break}}if(K.gzindexJ)$.adler=q1($.adler,K.pending_buf,K.pending-J,J);if(Z===0)K.status=d8}else K.status=d8;if(K.status===d8)if(K.gzhead.hcrc){if(K.pending+2>K.pending_buf_size)K1($);if(K.pending+2<=K.pending_buf_size)C0(K,$.adler&255),C0(K,$.adler>>8&255),$.adler=0,K.status=f1}else K.status=f1;if(K.pending!==0){if(K1($),$.avail_out===0)return K.last_flush=-1,x2}else if($.avail_in===0&&wQ(q)<=wQ(Q)&&q!==Z1)return U1($,j4);if(K.status===r6&&$.avail_in!==0)return U1($,j4);if($.avail_in!==0||K.lookahead!==0||q!==C1&&K.status!==r6){var B=K.strategy===c8?WZ(K,q):K.strategy===pU?GZ(K,q):V6[K.level].func(K,q);if(B===R1||B===U6)K.status=r6;if(B===c0||B===R1){if($.avail_out===0)K.last_flush=-1;return x2}if(B===s6){if(q===cU)M2._tr_align(K);else if(q!==FQ){if(M2._tr_stored_block(K,0,0,!1),q===bU){if(J1(K.head),K.lookahead===0)K.strstart=0,K.block_start=0,K.insert=0}}if(K1($),$.avail_out===0)return K.last_flush=-1,x2}}if(q!==Z1)return x2;if(K.wrap<=0)return MQ;if(K.wrap===2)C0(K,$.adler&255),C0(K,$.adler>>8&255),C0(K,$.adler>>16&255),C0(K,$.adler>>24&255),C0(K,$.total_in&255),C0(K,$.total_in>>8&255),C0(K,$.total_in>>16&255),C0(K,$.total_in>>24&255);else l6(K,$.adler>>>16),l6(K,$.adler&65535);if(K1($),K.wrap>0)K.wrap=-K.wrap;return K.pending!==0?x2:MQ}function NZ($){var q;if(!$||!$.state)return w2;if(q=$.state.status,q!==p8&&q!==X4&&q!==b8&&q!==n8&&q!==d8&&q!==f1&&q!==r6)return U1($,w2);return $.state=null,q===f1?U1($,nU):x2}function YZ($,q){var Q=q.length,K,J,Z,G,W,B,V,U;if(!$||!$.state)return w2;if(K=$.state,G=K.wrap,G===2||G===1&&K.status!==p8||K.lookahead)return w2;if(G===1)$.adler=NQ($.adler,q,Q,0);if(K.wrap=0,Q>=K.w_size){if(G===0)J1(K.head),K.strstart=0,K.block_start=0,K.insert=0;U=new r0.Buf8(K.w_size),r0.arraySet(U,q,Q-K.w_size,K.w_size,0),q=U,Q=K.w_size}W=$.avail_in,B=$.next_in,V=$.input,$.avail_in=Q,$.next_in=0,$.input=q,I1(K);while(K.lookahead>=f0){J=K.strstart,Z=K.lookahead-(f0-1);do K.ins_h=(K.ins_h<{var i8=d2(),vQ=!0,fQ=!0;try{String.fromCharCode.apply(null,[0])}catch($){vQ=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch($){fQ=!1}var t6=new i8.Buf8(256);for(P2=0;P2<256;P2++)t6[P2]=P2>=252?6:P2>=248?5:P2>=240?4:P2>=224?3:P2>=192?2:1;var P2;t6[254]=t6[254]=1;Z6.string2buf=function($){var q,Q,K,J,Z,G=$.length,W=0;for(J=0;J>>6,q[Z++]=128|Q&63;else if(Q<65536)q[Z++]=224|Q>>>12,q[Z++]=128|Q>>>6&63,q[Z++]=128|Q&63;else q[Z++]=240|Q>>>18,q[Z++]=128|Q>>>12&63,q[Z++]=128|Q>>>6&63,q[Z++]=128|Q&63}return q};function RQ($,q){if(q<65534){if($.subarray&&fQ||!$.subarray&&vQ)return String.fromCharCode.apply(null,i8.shrinkBuf($,q))}var Q="";for(var K=0;K4){W[K++]=65533,Q+=Z-1;continue}J&=Z===2?31:Z===3?15:7;while(Z>1&&Q1){W[K++]=65533;continue}if(J<65536)W[K++]=J;else J-=65536,W[K++]=55296|J>>10&1023,W[K++]=56320|J&1023}return RQ(W,K)};Z6.utf8border=function($,q){var Q;if(q=q||$.length,q>$.length)q=$.length;Q=q-1;while(Q>=0&&($[Q]&192)===128)Q--;if(Q<0)return q;if(Q===0)return q;return Q+t6[$[Q]]>q?Q:q}});var h4=N0((Tz,IQ)=>{function kZ(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}IQ.exports=kZ});var AQ=N0((Q8)=>{var e6=HQ(),$8=d2(),O4=y4(),P4=_8(),DZ=h4(),gQ=Object.prototype.toString,LZ=0,x4=4,G6=0,CQ=1,jQ=2,HZ=-1,vZ=0,fZ=8;function j1($){if(!(this instanceof j1))return new j1($);this.options=$8.assign({level:HZ,method:fZ,chunkSize:16384,windowBits:15,memLevel:8,strategy:vZ,to:""},$||{});var q=this.options;if(q.raw&&q.windowBits>0)q.windowBits=-q.windowBits;else if(q.gzip&&q.windowBits>0&&q.windowBits<16)q.windowBits+=16;this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new DZ,this.strm.avail_out=0;var Q=e6.deflateInit2(this.strm,q.level,q.method,q.windowBits,q.memLevel,q.strategy);if(Q!==G6)throw Error(P4[Q]);if(q.header)e6.deflateSetHeader(this.strm,q.header);if(q.dictionary){var K;if(typeof q.dictionary==="string")K=O4.string2buf(q.dictionary);else if(gQ.call(q.dictionary)==="[object ArrayBuffer]")K=new Uint8Array(q.dictionary);else K=q.dictionary;if(Q=e6.deflateSetDictionary(this.strm,K),Q!==G6)throw Error(P4[Q]);this._dict_set=!0}}j1.prototype.push=function($,q){var Q=this.strm,K=this.options.chunkSize,J,Z;if(this.ended)return!1;if(Z=q===~~q?q:q===!0?x4:LZ,typeof $==="string")Q.input=O4.string2buf($);else if(gQ.call($)==="[object ArrayBuffer]")Q.input=new Uint8Array($);else Q.input=$;Q.next_in=0,Q.avail_in=Q.input.length;do{if(Q.avail_out===0)Q.output=new $8.Buf8(K),Q.next_out=0,Q.avail_out=K;if(J=e6.deflate(Q,Z),J!==CQ&&J!==G6)return this.onEnd(J),this.ended=!0,!1;if(Q.avail_out===0||Q.avail_in===0&&(Z===x4||Z===jQ))if(this.options.to==="string")this.onData(O4.buf2binstring($8.shrinkBuf(Q.output,Q.next_out)));else this.onData($8.shrinkBuf(Q.output,Q.next_out))}while((Q.avail_in>0||Q.avail_out===0)&&J!==CQ);if(Z===x4)return J=e6.deflateEnd(this.strm),this.onEnd(J),this.ended=!0,J===G6;if(Z===jQ)return this.onEnd(G6),Q.avail_out=0,!0;return!0};j1.prototype.onData=function($){this.chunks.push($)};j1.prototype.onEnd=function($){if($===G6)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=$8.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function T4($,q){var Q=new j1(q);if(Q.push($,!0),Q.err)throw Q.msg||P4[Q.err];return Q.result}function RZ($,q){return q=q||{},q.raw=!0,T4($,q)}function IZ($,q){return q=q||{},q.gzip=!0,T4($,q)}Q8.Deflate=j1;Q8.deflate=T4;Q8.deflateRaw=RZ;Q8.gzip=IZ});var yQ=N0((Sz,XQ)=>{var o8=30,CZ=12;XQ.exports=function(q,Q){var K,J,Z,G,W,B,V,U,w,F,M,k,f,L,D,z,N,H,v,j,n,d,_,X,P;K=q.state,J=q.next_in,X=q.input,Z=J+(q.avail_in-5),G=q.next_out,P=q.output,W=G-(Q-q.avail_out),B=G+(q.avail_out-257),V=K.dmax,U=K.wsize,w=K.whave,F=K.wnext,M=K.window,k=K.hold,f=K.bits,L=K.lencode,D=K.distcode,z=(1<>>24,k>>>=v,f-=v,v=H>>>16&255,v===0)P[G++]=H&65535;else if(v&16){if(j=H&65535,v&=15,v){if(f>>=v,f-=v}if(f<15)k+=X[J++]<>>24,k>>>=v,f-=v,v=H>>>16&255,v&16){if(n=H&65535,v&=15,fV){q.msg="invalid distance too far back",K.mode=o8;break $}if(k>>>=v,f-=v,v=G-W,n>v){if(v=n-v,v>w){if(K.sane){q.msg="invalid distance too far back",K.mode=o8;break $}}if(d=0,_=M,F===0){if(d+=U-v,v2)P[G++]=_[d++],P[G++]=_[d++],P[G++]=_[d++],j-=3;if(j){if(P[G++]=_[d++],j>1)P[G++]=_[d++]}}else{d=G-n;do P[G++]=P[d++],P[G++]=P[d++],P[G++]=P[d++],j-=3;while(j>2);if(j){if(P[G++]=P[d++],j>1)P[G++]=P[d++]}}}else if((v&64)===0){H=D[(H&65535)+(k&(1<>3,J-=j,f-=j<<3,k&=(1<{var hQ=d2(),W6=15,xQ=852,OQ=592,PQ=0,u4=1,TQ=2,jZ=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],gZ=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],AZ=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],XZ=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];uQ.exports=function(q,Q,K,J,Z,G,W,B){var V=B.bits,U=0,w=0,F=0,M=0,k=0,f=0,L=0,D=0,z=0,N=0,H,v,j,n,d,_=null,X=0,P,g=new hQ.Buf16(W6+1),c=new hQ.Buf16(W6+1),h=null,x=0,l,$0,Z0;for(U=0;U<=W6;U++)g[U]=0;for(w=0;w=1;M--)if(g[M]!==0)break;if(k>M)k=M;if(M===0)return Z[G++]=20971520,Z[G++]=20971520,B.bits=1,0;for(F=1;F0&&(q===PQ||M!==1))return-1;c[1]=0;for(U=1;UxQ||q===TQ&&z>OQ)return 1;for(;;){if(l=U-L,W[w]P)$0=h[x+W[w]],Z0=_[X+W[w]];else $0=96,Z0=0;H=1<>L)+v]=l<<24|$0<<16|Z0|0;while(v!==0);H=1<>=1;if(H!==0)N&=H-1,N+=H;else N=0;if(w++,--g[U]===0){if(U===M)break;U=Q[K+W[w]]}if(U>k&&(N&n)!==j){if(L===0)L=k;d+=F,f=U-L,D=1<xQ||q===TQ&&z>OQ)return 1;j=N&n,Z[j]=k<<24|f<<16|d-G|0}}if(N!==0)Z[d+N]=U-L<<24|4194304|0;return B.bits=k,0}});var Dq=N0((H2)=>{var U2=d2(),n4=I4(),T2=C4(),yZ=yQ(),q8=SQ(),hZ=0,Wq=1,Bq=2,EQ=4,xZ=5,a8=6,g1=0,OZ=1,PZ=2,N2=-2,zq=-3,d4=-4,TZ=-5,_Q=8,Fq=1,cQ=2,bQ=3,nQ=4,dQ=5,mQ=6,pQ=7,iQ=8,oQ=9,aQ=10,s8=11,p2=12,S4=13,lQ=14,E4=15,rQ=16,sQ=17,tQ=18,eQ=19,l8=20,r8=21,$q=22,Qq=23,qq=24,Kq=25,Jq=26,_4=27,Vq=28,Uq=29,x0=30,m4=31,uZ=32,SZ=852,EZ=592,_Z=15,cZ=_Z;function Zq($){return($>>>24&255)+($>>>8&65280)+(($&65280)<<8)+(($&255)<<24)}function bZ(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new U2.Buf16(320),this.work=new U2.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Mq($){var q;if(!$||!$.state)return N2;if(q=$.state,$.total_in=$.total_out=q.total=0,$.msg="",q.wrap)$.adler=q.wrap&1;return q.mode=Fq,q.last=0,q.havedict=0,q.dmax=32768,q.head=null,q.hold=0,q.bits=0,q.lencode=q.lendyn=new U2.Buf32(SZ),q.distcode=q.distdyn=new U2.Buf32(EZ),q.sane=1,q.back=-1,g1}function wq($){var q;if(!$||!$.state)return N2;return q=$.state,q.wsize=0,q.whave=0,q.wnext=0,Mq($)}function Nq($,q){var Q,K;if(!$||!$.state)return N2;if(K=$.state,q<0)Q=0,q=-q;else if(Q=(q>>4)+1,q<48)q&=15;if(q&&(q<8||q>15))return N2;if(K.window!==null&&K.wbits!==q)K.window=null;return K.wrap=Q,K.wbits=q,wq($)}function Yq($,q){var Q,K;if(!$)return N2;if(K=new bZ,$.state=K,K.window=null,Q=Nq($,q),Q!==g1)$.state=null;return Q}function nZ($){return Yq($,cZ)}var Gq=!0,c4,b4;function dZ($){if(Gq){var q;c4=new U2.Buf32(512),b4=new U2.Buf32(32),q=0;while(q<144)$.lens[q++]=8;while(q<256)$.lens[q++]=9;while(q<280)$.lens[q++]=7;while(q<288)$.lens[q++]=8;q8(Wq,$.lens,0,288,c4,0,$.work,{bits:9}),q=0;while(q<32)$.lens[q++]=5;q8(Bq,$.lens,0,32,b4,0,$.work,{bits:5}),Gq=!1}$.lencode=c4,$.lenbits=9,$.distcode=b4,$.distbits=5}function kq($,q,Q,K){var J,Z=$.state;if(Z.window===null)Z.wsize=1<=Z.wsize)U2.arraySet(Z.window,q,Q-Z.wsize,Z.wsize,0),Z.wnext=0,Z.whave=Z.wsize;else{if(J=Z.wsize-Z.wnext,J>K)J=K;if(U2.arraySet(Z.window,q,Q-K,J,Z.wnext),K-=J,K)U2.arraySet(Z.window,q,Q-K,K,0),Z.wnext=K,Z.whave=Z.wsize;else{if(Z.wnext+=J,Z.wnext===Z.wsize)Z.wnext=0;if(Z.whave>>8&255,Q.check=T2(Q.check,_,2,0),V=0,U=0,Q.mode=cQ;break}if(Q.flags=0,Q.head)Q.head.done=!1;if(!(Q.wrap&1)||(((V&255)<<8)+(V>>8))%31){$.msg="incorrect header check",Q.mode=x0;break}if((V&15)!==_Q){$.msg="unknown compression method",Q.mode=x0;break}if(V>>>=4,U-=4,n=(V&15)+8,Q.wbits===0)Q.wbits=n;else if(n>Q.wbits){$.msg="invalid window size",Q.mode=x0;break}Q.dmax=1<>8&1;if(Q.flags&512)_[0]=V&255,_[1]=V>>>8&255,Q.check=T2(Q.check,_,2,0);V=0,U=0,Q.mode=bQ;case bQ:while(U<32){if(W===0)break $;W--,V+=K[Z++]<>>8&255,_[2]=V>>>16&255,_[3]=V>>>24&255,Q.check=T2(Q.check,_,4,0);V=0,U=0,Q.mode=nQ;case nQ:while(U<16){if(W===0)break $;W--,V+=K[Z++]<>8;if(Q.flags&512)_[0]=V&255,_[1]=V>>>8&255,Q.check=T2(Q.check,_,2,0);V=0,U=0,Q.mode=dQ;case dQ:if(Q.flags&1024){while(U<16){if(W===0)break $;W--,V+=K[Z++]<>>8&255,Q.check=T2(Q.check,_,2,0);V=0,U=0}else if(Q.head)Q.head.extra=null;Q.mode=mQ;case mQ:if(Q.flags&1024){if(M=Q.length,M>W)M=W;if(M){if(Q.head){if(n=Q.head.extra_len-Q.length,!Q.head.extra)Q.head.extra=Array(Q.head.extra_len);U2.arraySet(Q.head.extra,K,Z,M,n)}if(Q.flags&512)Q.check=T2(Q.check,K,M,Z);W-=M,Z+=M,Q.length-=M}if(Q.length)break $}Q.length=0,Q.mode=pQ;case pQ:if(Q.flags&2048){if(W===0)break $;M=0;do if(n=K[Z+M++],Q.head&&n&&Q.length<65536)Q.head.name+=String.fromCharCode(n);while(n&&M>9&1,Q.head.done=!0;$.adler=Q.check=0,Q.mode=p2;break;case aQ:while(U<32){if(W===0)break $;W--,V+=K[Z++]<>>=U&7,U-=U&7,Q.mode=_4;break}while(U<3){if(W===0)break $;W--,V+=K[Z++]<>>=1,U-=1,V&3){case 0:Q.mode=lQ;break;case 1:if(dZ(Q),Q.mode=l8,q===a8){V>>>=2,U-=2;break $}break;case 2:Q.mode=sQ;break;case 3:$.msg="invalid block type",Q.mode=x0}V>>>=2,U-=2;break;case lQ:V>>>=U&7,U-=U&7;while(U<32){if(W===0)break $;W--,V+=K[Z++]<>>16^65535)){$.msg="invalid stored block lengths",Q.mode=x0;break}if(Q.length=V&65535,V=0,U=0,Q.mode=E4,q===a8)break $;case E4:Q.mode=rQ;case rQ:if(M=Q.length,M){if(M>W)M=W;if(M>B)M=B;if(M===0)break $;U2.arraySet(J,K,Z,M,G),W-=M,Z+=M,B-=M,G+=M,Q.length-=M;break}Q.mode=p2;break;case sQ:while(U<14){if(W===0)break $;W--,V+=K[Z++]<>>=5,U-=5,Q.ndist=(V&31)+1,V>>>=5,U-=5,Q.ncode=(V&15)+4,V>>>=4,U-=4,Q.nlen>286||Q.ndist>30){$.msg="too many length or distance symbols",Q.mode=x0;break}Q.have=0,Q.mode=tQ;case tQ:while(Q.have>>=3,U-=3}while(Q.have<19)Q.lens[g[Q.have++]]=0;if(Q.lencode=Q.lendyn,Q.lenbits=7,X={bits:Q.lenbits},d=q8(hZ,Q.lens,0,19,Q.lencode,0,Q.work,X),Q.lenbits=X.bits,d){$.msg="invalid code lengths set",Q.mode=x0;break}Q.have=0,Q.mode=eQ;case eQ:while(Q.have>>24,z=L>>>16&255,N=L&65535,D<=U)break;if(W===0)break $;W--,V+=K[Z++]<>>=D,U-=D,Q.lens[Q.have++]=N;else{if(N===16){P=D+2;while(U>>=D,U-=D,Q.have===0){$.msg="invalid bit length repeat",Q.mode=x0;break}n=Q.lens[Q.have-1],M=3+(V&3),V>>>=2,U-=2}else if(N===17){P=D+3;while(U>>=D,U-=D,n=0,M=3+(V&7),V>>>=3,U-=3}else{P=D+7;while(U>>=D,U-=D,n=0,M=11+(V&127),V>>>=7,U-=7}if(Q.have+M>Q.nlen+Q.ndist){$.msg="invalid bit length repeat",Q.mode=x0;break}while(M--)Q.lens[Q.have++]=n}}if(Q.mode===x0)break;if(Q.lens[256]===0){$.msg="invalid code -- missing end-of-block",Q.mode=x0;break}if(Q.lenbits=9,X={bits:Q.lenbits},d=q8(Wq,Q.lens,0,Q.nlen,Q.lencode,0,Q.work,X),Q.lenbits=X.bits,d){$.msg="invalid literal/lengths set",Q.mode=x0;break}if(Q.distbits=6,Q.distcode=Q.distdyn,X={bits:Q.distbits},d=q8(Bq,Q.lens,Q.nlen,Q.ndist,Q.distcode,0,Q.work,X),Q.distbits=X.bits,d){$.msg="invalid distances set",Q.mode=x0;break}if(Q.mode=l8,q===a8)break $;case l8:Q.mode=r8;case r8:if(W>=6&&B>=258){if($.next_out=G,$.avail_out=B,$.next_in=Z,$.avail_in=W,Q.hold=V,Q.bits=U,yZ($,F),G=$.next_out,J=$.output,B=$.avail_out,Z=$.next_in,K=$.input,W=$.avail_in,V=Q.hold,U=Q.bits,Q.mode===p2)Q.back=-1;break}Q.back=0;for(;;){if(L=Q.lencode[V&(1<>>24,z=L>>>16&255,N=L&65535,D<=U)break;if(W===0)break $;W--,V+=K[Z++]<>H)],D=L>>>24,z=L>>>16&255,N=L&65535,H+D<=U)break;if(W===0)break $;W--,V+=K[Z++]<>>=H,U-=H,Q.back+=H}if(V>>>=D,U-=D,Q.back+=D,Q.length=N,z===0){Q.mode=Jq;break}if(z&32){Q.back=-1,Q.mode=p2;break}if(z&64){$.msg="invalid literal/length code",Q.mode=x0;break}Q.extra=z&15,Q.mode=$q;case $q:if(Q.extra){P=Q.extra;while(U>>=Q.extra,U-=Q.extra,Q.back+=Q.extra}Q.was=Q.length,Q.mode=Qq;case Qq:for(;;){if(L=Q.distcode[V&(1<>>24,z=L>>>16&255,N=L&65535,D<=U)break;if(W===0)break $;W--,V+=K[Z++]<>H)],D=L>>>24,z=L>>>16&255,N=L&65535,H+D<=U)break;if(W===0)break $;W--,V+=K[Z++]<>>=H,U-=H,Q.back+=H}if(V>>>=D,U-=D,Q.back+=D,z&64){$.msg="invalid distance code",Q.mode=x0;break}Q.offset=N,Q.extra=z&15,Q.mode=qq;case qq:if(Q.extra){P=Q.extra;while(U>>=Q.extra,U-=Q.extra,Q.back+=Q.extra}if(Q.offset>Q.dmax){$.msg="invalid distance too far back",Q.mode=x0;break}Q.mode=Kq;case Kq:if(B===0)break $;if(M=F-B,Q.offset>M){if(M=Q.offset-M,M>Q.whave){if(Q.sane){$.msg="invalid distance too far back",Q.mode=x0;break}}if(M>Q.wnext)M-=Q.wnext,k=Q.wsize-M;else k=Q.wnext-M;if(M>Q.length)M=Q.length;f=Q.window}else f=J,k=G-Q.offset,M=Q.length;if(M>B)M=B;B-=M,Q.length-=M;do J[G++]=f[k++];while(--M);if(Q.length===0)Q.mode=r8;break;case Jq:if(B===0)break $;J[G++]=Q.length,B--,Q.mode=r8;break;case _4:if(Q.wrap){while(U<32){if(W===0)break $;W--,V|=K[Z++]<{Lq.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var vq=N0((bz,Hq)=>{function aZ(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}Hq.exports=aZ});var Rq=N0((J8)=>{var B6=Dq(),K8=d2(),t8=y4(),E0=p4(),i4=_8(),lZ=h4(),rZ=vq(),fq=Object.prototype.toString;function A1($){if(!(this instanceof A1))return new A1($);this.options=K8.assign({chunkSize:16384,windowBits:0,to:""},$||{});var q=this.options;if(q.raw&&q.windowBits>=0&&q.windowBits<16){if(q.windowBits=-q.windowBits,q.windowBits===0)q.windowBits=-15}if(q.windowBits>=0&&q.windowBits<16&&!($&&$.windowBits))q.windowBits+=32;if(q.windowBits>15&&q.windowBits<48){if((q.windowBits&15)===0)q.windowBits|=15}this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new lZ,this.strm.avail_out=0;var Q=B6.inflateInit2(this.strm,q.windowBits);if(Q!==E0.Z_OK)throw Error(i4[Q]);if(this.header=new rZ,B6.inflateGetHeader(this.strm,this.header),q.dictionary){if(typeof q.dictionary==="string")q.dictionary=t8.string2buf(q.dictionary);else if(fq.call(q.dictionary)==="[object ArrayBuffer]")q.dictionary=new Uint8Array(q.dictionary);if(q.raw){if(Q=B6.inflateSetDictionary(this.strm,q.dictionary),Q!==E0.Z_OK)throw Error(i4[Q])}}}A1.prototype.push=function($,q){var Q=this.strm,K=this.options.chunkSize,J=this.options.dictionary,Z,G,W,B,V,U=!1;if(this.ended)return!1;if(G=q===~~q?q:q===!0?E0.Z_FINISH:E0.Z_NO_FLUSH,typeof $==="string")Q.input=t8.binstring2buf($);else if(fq.call($)==="[object ArrayBuffer]")Q.input=new Uint8Array($);else Q.input=$;Q.next_in=0,Q.avail_in=Q.input.length;do{if(Q.avail_out===0)Q.output=new K8.Buf8(K),Q.next_out=0,Q.avail_out=K;if(Z=B6.inflate(Q,E0.Z_NO_FLUSH),Z===E0.Z_NEED_DICT&&J)Z=B6.inflateSetDictionary(this.strm,J);if(Z===E0.Z_BUF_ERROR&&U===!0)Z=E0.Z_OK,U=!1;if(Z!==E0.Z_STREAM_END&&Z!==E0.Z_OK)return this.onEnd(Z),this.ended=!0,!1;if(Q.next_out){if(Q.avail_out===0||Z===E0.Z_STREAM_END||Q.avail_in===0&&(G===E0.Z_FINISH||G===E0.Z_SYNC_FLUSH))if(this.options.to==="string"){if(W=t8.utf8border(Q.output,Q.next_out),B=Q.next_out-W,V=t8.buf2string(Q.output,W),Q.next_out=B,Q.avail_out=K-B,B)K8.arraySet(Q.output,Q.output,W,B,0);this.onData(V)}else this.onData(K8.shrinkBuf(Q.output,Q.next_out))}if(Q.avail_in===0&&Q.avail_out===0)U=!0}while((Q.avail_in>0||Q.avail_out===0)&&Z!==E0.Z_STREAM_END);if(Z===E0.Z_STREAM_END)G=E0.Z_FINISH;if(G===E0.Z_FINISH)return Z=B6.inflateEnd(this.strm),this.onEnd(Z),this.ended=!0,Z===E0.Z_OK;if(G===E0.Z_SYNC_FLUSH)return this.onEnd(E0.Z_OK),Q.avail_out=0,!0;return!0};A1.prototype.onData=function($){this.chunks.push($)};A1.prototype.onEnd=function($){if($===E0.Z_OK)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=K8.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function o4($,q){var Q=new A1(q);if(Q.push($,!0),Q.err)throw Q.msg||i4[Q.err];return Q.result}function sZ($,q){return q=q||{},q.raw=!0,o4($,q)}J8.Inflate=A1;J8.inflate=o4;J8.inflateRaw=sZ;J8.ungzip=o4});var jq=N0((dz,Cq)=>{var tZ=d2().assign,eZ=AQ(),$G=Rq(),QG=p4(),Iq={};tZ(Iq,eZ,$G,QG);Cq.exports=Iq});var Aq=N0(($5)=>{var qG=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",KG=jq(),gq=T0(),e8=V2(),JG=qG?"uint8array":"array";$5.magic="\b\x00";function X1($,q){e8.call(this,"FlateWorker/"+$),this._pako=null,this._pakoAction=$,this._pakoOptions=q,this.meta={}}gq.inherits(X1,e8);X1.prototype.processChunk=function($){if(this.meta=$.meta,this._pako===null)this._createPako();this._pako.push(gq.transformTo(JG,$.data),!1)};X1.prototype.flush=function(){if(e8.prototype.flush.call(this),this._pako===null)this._createPako();this._pako.push([],!0)};X1.prototype.cleanUp=function(){e8.prototype.cleanUp.call(this),this._pako=null};X1.prototype._createPako=function(){this._pako=new KG[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var $=this;this._pako.onData=function(q){$.push({data:q,meta:$.meta})}};$5.compressWorker=function($){return new X1("Deflate",$)};$5.uncompressWorker=function(){return new X1("Inflate",{})}});var l4=N0((a4)=>{var Xq=V2();a4.STORE={magic:"\x00\x00",compressWorker:function(){return new Xq("STORE compression")},uncompressWorker:function(){return new Xq("STORE decompression")}};a4.DEFLATE=Aq()});var r4=N0((y1)=>{y1.LOCAL_FILE_HEADER="PK\x03\x04";y1.CENTRAL_FILE_HEADER="PK\x01\x02";y1.CENTRAL_DIRECTORY_END="PK\x05\x06";y1.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07";y1.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06";y1.DATA_DESCRIPTOR="PK\x07\b"});var Oq=N0((oz,xq)=>{var z6=T0(),F6=V2(),s4=e1(),yq=T8(),Q5=r4(),A0=function($,q){var Q="",K;for(K=0;K>>8;return Q},VG=function($,q){var Q=$;if(!$)Q=q?16893:33204;return(Q&65535)<<16},UG=function($){return($||0)&63},hq=function($,q,Q,K,J,Z){var{file:G,compression:W}=$,B=Z!==s4.utf8encode,V=z6.transformTo("string",Z(G.name)),U=z6.transformTo("string",s4.utf8encode(G.name)),w=G.comment,F=z6.transformTo("string",Z(w)),M=z6.transformTo("string",s4.utf8encode(w)),k=U.length!==G.name.length,f=M.length!==w.length,L,D,z="",N="",H="",v=G.dir,j=G.date,n={crc32:0,compressedSize:0,uncompressedSize:0};if(!q||Q)n.crc32=$.crc32,n.compressedSize=$.compressedSize,n.uncompressedSize=$.uncompressedSize;var d=0;if(q)d|=8;if(!B&&(k||f))d|=2048;var _=0,X=0;if(v)_|=16;if(J==="UNIX")X=798,_|=VG(G.unixPermissions,v);else X=20,_|=UG(G.dosPermissions,v);if(L=j.getUTCHours(),L=L<<6,L=L|j.getUTCMinutes(),L=L<<5,L=L|j.getUTCSeconds()/2,D=j.getUTCFullYear()-1980,D=D<<4,D=D|j.getUTCMonth()+1,D=D<<5,D=D|j.getUTCDate(),k)N=A0(1,1)+A0(yq(V),4)+U,z+="up"+A0(N.length,2)+N;if(f)H=A0(1,1)+A0(yq(F),4)+M,z+="uc"+A0(H.length,2)+H;var P="";P+=` -\x00`,P+=A0(d,2),P+=W.magic,P+=A0(L,2),P+=A0(D,2),P+=A0(n.crc32,4),P+=A0(n.compressedSize,4),P+=A0(n.uncompressedSize,4),P+=A0(V.length,2),P+=A0(z.length,2);var g=Q5.LOCAL_FILE_HEADER+P+V+z,c=Q5.CENTRAL_FILE_HEADER+A0(X,2)+P+A0(F.length,2)+"\x00\x00\x00\x00"+A0(_,4)+A0(K,4)+V+z+F;return{fileRecord:g,dirRecord:c}},ZG=function($,q,Q,K,J){var Z="",G=z6.transformTo("string",J(K));return Z=Q5.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+A0($,2)+A0($,2)+A0(q,4)+A0(Q,4)+A0(G.length,2)+G,Z},GG=function($){var q="";return q=Q5.DATA_DESCRIPTOR+A0($.crc32,4)+A0($.compressedSize,4)+A0($.uncompressedSize,4),q};function v2($,q,Q,K){F6.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=q,this.zipPlatform=Q,this.encodeFileName=K,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}z6.inherits(v2,F6);v2.prototype.push=function($){var q=$.meta.percent||0,Q=this.entriesCount,K=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,F6.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:Q?(q+100*(Q-K-1))/Q:100}})};v2.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var q=this.streamFiles&&!$.file.dir;if(q){var Q=hq($,q,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:Q.fileRecord,meta:{percent:0}})}else this.accumulate=!0};v2.prototype.closedSource=function($){this.accumulate=!1;var q=this.streamFiles&&!$.file.dir,Q=hq($,q,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(Q.dirRecord),q)this.push({data:GG($),meta:{percent:100}});else{this.push({data:Q.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};v2.prototype.flush=function(){var $=this.bytesWritten;for(var q=0;q{var WG=l4(),BG=Oq(),zG=function($,q){var Q=$||q,K=WG[Q];if(!K)throw Error(Q+" is not a valid compression method !");return K};Pq.generateWorker=function($,q,Q){var K=new BG(q.streamFiles,Q,q.platform,q.encodeFileName),J=0;try{$.forEach(function(Z,G){J++;var W=zG(G.options.compression,q.compression),B=G.options.compressionOptions||q.compressionOptions||{},V=G.dir,U=G.date;G._compressWorker(W,B).withStreamInfo("file",{name:Z,dir:V,date:U,comment:G.comment||"",unixPermissions:G.unixPermissions,dosPermissions:G.dosPermissions}).pipe(K)}),K.entriesCount=J}catch(Z){K.error(Z)}return K}});var Sq=N0((lz,uq)=>{var FG=T0(),q5=V2();function V8($,q){q5.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(q)}FG.inherits(V8,q5);V8.prototype._bindStream=function($){var q=this;this._stream=$,$.pause(),$.on("data",function(Q){q.push({data:Q,meta:{percent:0}})}).on("error",function(Q){if(q.isPaused)this.generatedError=Q;else q.error(Q)}).on("end",function(){if(q.isPaused)q._upstreamEnded=!0;else q.end()})};V8.prototype.pause=function(){if(!q5.prototype.pause.call(this))return!1;return this._stream.pause(),!0};V8.prototype.resume=function(){if(!q5.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};uq.exports=V8});var oq=N0((rz,iq)=>{var MG=e1(),U8=T0(),bq=V2(),wG=q4(),nq=K4(),Eq=u8(),NG=_$(),YG=Tq(),_q=T6(),kG=Sq(),dq=function($,q,Q){var K=U8.getTypeOf(q),J,Z=U8.extend(Q||{},nq);if(Z.date=Z.date||new Date,Z.compression!==null)Z.compression=Z.compression.toUpperCase();if(typeof Z.unixPermissions==="string")Z.unixPermissions=parseInt(Z.unixPermissions,8);if(Z.unixPermissions&&Z.unixPermissions&16384)Z.dir=!0;if(Z.dosPermissions&&Z.dosPermissions&16)Z.dir=!0;if(Z.dir)$=mq($);if(Z.createFolders&&(J=DG($)))pq.call(this,J,!0);var G=K==="string"&&Z.binary===!1&&Z.base64===!1;if(!Q||typeof Q.binary>"u")Z.binary=!G;var W=q instanceof Eq&&q.uncompressedSize===0;if(W||Z.dir||!q||q.length===0)Z.base64=!1,Z.binary=!0,q="",Z.compression="STORE",K="string";var B=null;if(q instanceof Eq||q instanceof bq)B=q;else if(_q.isNode&&_q.isStream(q))B=new kG($,q);else B=U8.prepareContent($,q,Z.binary,Z.optimizedBinaryString,Z.base64);var V=new NG($,B,Z);this.files[$]=V},DG=function($){if($.slice(-1)==="/")$=$.substring(0,$.length-1);var q=$.lastIndexOf("/");return q>0?$.substring(0,q):""},mq=function($){if($.slice(-1)!=="/")$+="/";return $},pq=function($,q){if(q=typeof q<"u"?q:nq.createFolders,$=mq($),!this.files[$])dq.call(this,$,null,{dir:!0,createFolders:q});return this.files[$]};function cq($){return Object.prototype.toString.call($)==="[object RegExp]"}var LG={load:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function($){var q,Q,K;for(q in this.files)if(K=this.files[q],Q=q.slice(this.root.length,q.length),Q&&q.slice(0,this.root.length)===this.root)$(Q,K)},filter:function($){var q=[];return this.forEach(function(Q,K){if($(Q,K))q.push(K)}),q},file:function($,q,Q){if(arguments.length===1)if(cq($)){var K=$;return this.filter(function(Z,G){return!G.dir&&K.test(Z)})}else{var J=this.files[this.root+$];if(J&&!J.dir)return J;else return null}else $=this.root+$,dq.call(this,$,q,Q);return this},folder:function($){if(!$)return this;if(cq($))return this.filter(function(J,Z){return Z.dir&&$.test(J)});var q=this.root+$,Q=pq.call(this,q),K=this.clone();return K.root=Q.name,K},remove:function($){$=this.root+$;var q=this.files[$];if(!q){if($.slice(-1)!=="/")$+="/";q=this.files[$]}if(q&&!q.dir)delete this.files[$];else{var Q=this.filter(function(J,Z){return Z.name.slice(0,$.length)===$});for(var K=0;K{var HG=T0();function aq($){this.data=$,this.length=$.length,this.index=0,this.zero=0}aq.prototype={checkOffset:function($){this.checkIndex(this.index+$)},checkIndex:function($){if(this.length=this.index;Q--)q=(q<<8)+this.byteAt(Q);return this.index+=$,q},readString:function($){return HG.transformTo("string",this.readData($))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var $=this.readInt(4);return new Date(Date.UTC(($>>25&127)+1980,($>>21&15)-1,$>>16&31,$>>11&31,$>>5&63,($&31)<<1))}};lq.exports=aq});var e4=N0((tz,sq)=>{var rq=t4(),vG=T0();function M6($){rq.call(this,$);for(var q=0;q=0;--Z)if(this.data[Z]===q&&this.data[Z+1]===Q&&this.data[Z+2]===K&&this.data[Z+3]===J)return Z-this.zero;return-1};M6.prototype.readAndCheckSignature=function($){var q=$.charCodeAt(0),Q=$.charCodeAt(1),K=$.charCodeAt(2),J=$.charCodeAt(3),Z=this.readData(4);return q===Z[0]&&Q===Z[1]&&K===Z[2]&&J===Z[3]};M6.prototype.readData=function($){if(this.checkOffset($),$===0)return[];var q=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,q};sq.exports=M6});var $K=N0((ez,eq)=>{var tq=t4(),fG=T0();function w6($){tq.call(this,$)}fG.inherits(w6,tq);w6.prototype.byteAt=function($){return this.data.charCodeAt(this.zero+$)};w6.prototype.lastIndexOfSignature=function($){return this.data.lastIndexOf($)-this.zero};w6.prototype.readAndCheckSignature=function($){var q=this.readData(4);return $===q};w6.prototype.readData=function($){this.checkOffset($);var q=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,q};eq.exports=w6});var Q7=N0(($F,qK)=>{var QK=e4(),RG=T0();function $7($){QK.call(this,$)}RG.inherits($7,QK);$7.prototype.readData=function($){if(this.checkOffset($),$===0)return new Uint8Array(0);var q=this.data.subarray(this.zero+this.index,this.zero+this.index+$);return this.index+=$,q};qK.exports=$7});var VK=N0((QF,JK)=>{var KK=Q7(),IG=T0();function q7($){KK.call(this,$)}IG.inherits(q7,KK);q7.prototype.readData=function($){this.checkOffset($);var q=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,q};JK.exports=q7});var K7=N0((qF,ZK)=>{var K5=T0(),UK=n2(),CG=e4(),jG=$K(),gG=VK(),AG=Q7();ZK.exports=function($){var q=K5.getTypeOf($);if(K5.checkSupport(q),q==="string"&&!UK.uint8array)return new jG($);if(q==="nodebuffer")return new gG($);if(UK.uint8array)return new AG(K5.transformTo("uint8array",$));return new CG(K5.transformTo("array",$))}});var zK=N0((KF,BK)=>{var J7=K7(),G1=T0(),XG=u8(),GK=T8(),J5=e1(),V5=l4(),yG=n2(),hG=0,xG=3,OG=function($){for(var q in V5){if(!Object.prototype.hasOwnProperty.call(V5,q))continue;if(V5[q].magic===$)return V5[q]}return null};function WK($,q){this.options=$,this.loadOptions=q}WK.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},readLocalPart:function($){var q,Q;if($.skip(22),this.fileNameLength=$.readInt(2),Q=$.readInt(2),this.fileName=$.readData(this.fileNameLength),$.skip(Q),this.compressedSize===-1||this.uncompressedSize===-1)throw Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(q=OG(this.compressionMethod),q===null)throw Error("Corrupted zip : compression "+G1.pretty(this.compressionMethod)+" unknown (inner file : "+G1.transformTo("string",this.fileName)+")");this.decompressed=new XG(this.compressedSize,this.uncompressedSize,this.crc32,q,$.readData(this.compressedSize))},readCentralPart:function($){this.versionMadeBy=$.readInt(2),$.skip(2),this.bitFlag=$.readInt(2),this.compressionMethod=$.readString(2),this.date=$.readDate(),this.crc32=$.readInt(4),this.compressedSize=$.readInt(4),this.uncompressedSize=$.readInt(4);var q=$.readInt(2);if(this.extraFieldsLength=$.readInt(2),this.fileCommentLength=$.readInt(2),this.diskNumberStart=$.readInt(2),this.internalFileAttributes=$.readInt(2),this.externalFileAttributes=$.readInt(4),this.localHeaderOffset=$.readInt(4),this.isEncrypted())throw Error("Encrypted zip are not supported");$.skip(q),this.readExtraFields($),this.parseZIP64ExtraField($),this.fileComment=$.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var $=this.versionMadeBy>>8;if(this.dir=this.externalFileAttributes&16?!0:!1,$===hG)this.dosPermissions=this.externalFileAttributes&63;if($===xG)this.unixPermissions=this.externalFileAttributes>>16&65535;if(!this.dir&&this.fileNameStr.slice(-1)==="/")this.dir=!0},parseZIP64ExtraField:function(){if(!this.extraFields[1])return;var $=J7(this.extraFields[1].value);if(this.uncompressedSize===G1.MAX_VALUE_32BITS)this.uncompressedSize=$.readInt(8);if(this.compressedSize===G1.MAX_VALUE_32BITS)this.compressedSize=$.readInt(8);if(this.localHeaderOffset===G1.MAX_VALUE_32BITS)this.localHeaderOffset=$.readInt(8);if(this.diskNumberStart===G1.MAX_VALUE_32BITS)this.diskNumberStart=$.readInt(4)},readExtraFields:function($){var q=$.index+this.extraFieldsLength,Q,K,J;if(!this.extraFields)this.extraFields={};while($.index+4{var PG=K7(),i2=T0(),f2=r4(),TG=zK(),uG=n2();function FK($){this.files=[],this.loadOptions=$}FK.prototype={checkSignature:function($){if(!this.reader.readAndCheckSignature($)){this.reader.index-=4;var q=this.reader.readString(4);throw Error("Corrupted zip or bug: unexpected signature ("+i2.pretty(q)+", expected "+i2.pretty($)+")")}},isSignature:function($,q){var Q=this.reader.index;this.reader.setIndex($);var K=this.reader.readString(4),J=K===q;return this.reader.setIndex(Q),J},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var $=this.reader.readData(this.zipCommentLength),q=uG.uint8array?"uint8array":"array",Q=i2.transformTo(q,$);this.zipComment=this.loadOptions.decodeFileName(Q)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};var $=this.zip64EndOfCentralSize-44,q=0,Q,K,J;while(q<$)Q=this.reader.readInt(2),K=this.reader.readInt(4),J=this.reader.readData(K),this.zip64ExtensibleData[Q]={id:Q,length:K,value:J}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var $,q;for($=0;$0)if(this.isSignature(Q,f2.CENTRAL_FILE_HEADER));else this.reader.zero=J;else if(J<0)throw Error("Corrupted zip: missing "+Math.abs(J)+" bytes.")},prepareReader:function($){this.reader=PG($)},load:function($){this.prepareReader($),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};MK.exports=FK});var kK=N0((VF,YK)=>{var V7=T0(),U5=r1(),SG=e1(),EG=wK(),_G=U4(),NK=T6();function cG($){return new U5.Promise(function(q,Q){var K=$.decompressed.getContentWorker().pipe(new _G);K.on("error",function(J){Q(J)}).on("end",function(){if(K.streamInfo.crc32!==$.decompressed.crc32)Q(Error("Corrupted zip : CRC32 mismatch"));else q()}).resume()})}YK.exports=function($,q){var Q=this;if(q=V7.extend(q||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:SG.utf8decode}),NK.isNode&&NK.isStream($))return U5.Promise.reject(Error("JSZip can't accept a stream when loading a zip file."));return V7.prepareContent("the loaded zip file",$,!0,q.optimizedBinaryString,q.base64).then(function(K){var J=new EG(q);return J.load(K),J}).then(function(J){var Z=[U5.Promise.resolve(J)],G=J.files;if(q.checkCRC32)for(var W=0;W{function Y2(){if(!(this instanceof Y2))return new Y2;if(arguments.length)throw Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var $=new Y2;for(var q in this)if(typeof this[q]!=="function")$[q]=this[q];return $}}Y2.prototype=oq();Y2.prototype.loadAsync=kK();Y2.support=n2();Y2.defaults=K4();Y2.version="3.10.1";Y2.loadAsync=function($,q){return new Y2().loadAsync($,q)};Y2.external=r1();DK.exports=Y2});var Z8={};c1(Z8,{types:()=>rG,promisify:()=>CK,log:()=>fK,isUndefined:()=>N6,isSymbol:()=>tG,isString:()=>F5,isRegExp:()=>Z5,isPrimitive:()=>eG,isObject:()=>Y6,isNumber:()=>vK,isNullOrUndefined:()=>sG,isNull:()=>z5,isFunction:()=>W5,isError:()=>G5,isDate:()=>W7,isBuffer:()=>$W,isBoolean:()=>z7,isArray:()=>HK,inspect:()=>h1,inherits:()=>RK,format:()=>B7,deprecate:()=>nG,default:()=>KW,debuglog:()=>dG,callbackifyOnRejected:()=>w7,callbackify:()=>jK,_extend:()=>M7,TextEncoder:()=>gK,TextDecoder:()=>AK});function B7($,...q){if(!F5($)){var Q=[$];for(var K=0;K=J)return W;switch(W){case"%s":return String(q[K++]);case"%d":return Number(q[K++]);case"%j":try{return JSON.stringify(q[K++])}catch(B){return"[Circular]"}default:return W}});for(var G=q[K];K"u"||process?.noDeprecation===!0)return $;var Q=!1;function K(...J){if(!Q){if(process.throwDeprecation)throw Error(q);else if(process.traceDeprecation)console.trace(q);else console.error(q);Q=!0}return $.apply(this,...J)}return K}function mG($,q){var Q=h1.styles[q];if(Q)return"\x1B["+h1.colors[Q][0]+"m"+$+"\x1B["+h1.colors[Q][1]+"m";else return $}function pG($,q){return $}function iG($){var q={};return $.forEach(function(Q,K){q[Q]=!0}),q}function B5($,q,Q){if($.customInspect&&q&&W5(q.inspect)&&q.inspect!==h1&&!(q.constructor&&q.constructor.prototype===q)){var K=q.inspect(Q,$);if(!F5(K))K=B5($,K,Q);return K}var J=oG($,q);if(J)return J;var Z=Object.keys(q),G=iG(Z);if($.showHidden)Z=Object.getOwnPropertyNames(q);if(G5(q)&&(Z.indexOf("message")>=0||Z.indexOf("description")>=0))return U7(q);if(Z.length===0){if(W5(q)){var W=q.name?": "+q.name:"";return $.stylize("[Function"+W+"]","special")}if(Z5(q))return $.stylize(RegExp.prototype.toString.call(q),"regexp");if(W7(q))return $.stylize(Date.prototype.toString.call(q),"date");if(G5(q))return U7(q)}var B="",V=!1,U=["{","}"];if(HK(q))V=!0,U=["[","]"];if(W5(q)){var w=q.name?": "+q.name:"";B=" [Function"+w+"]"}if(Z5(q))B=" "+RegExp.prototype.toString.call(q);if(W7(q))B=" "+Date.prototype.toUTCString.call(q);if(G5(q))B=" "+U7(q);if(Z.length===0&&(!V||q.length==0))return U[0]+B+U[1];if(Q<0)if(Z5(q))return $.stylize(RegExp.prototype.toString.call(q),"regexp");else return $.stylize("[Object]","special");$.seen.push(q);var F;if(V)F=aG($,q,Q,G,Z);else F=Z.map(function(M){return G7($,q,Q,G,M,V)});return $.seen.pop(),lG(F,B,U)}function oG($,q){if(N6(q))return $.stylize("undefined","undefined");if(F5(q)){var Q="'"+JSON.stringify(q).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return $.stylize(Q,"string")}if(vK(q))return $.stylize(""+q,"number");if(z7(q))return $.stylize(""+q,"boolean");if(z5(q))return $.stylize("null","null")}function U7($){return"["+Error.prototype.toString.call($)+"]"}function aG($,q,Q,K,J){var Z=[];for(var G=0,W=q.length;G{var fJ=Object.create;var{getPrototypeOf:RJ,defineProperty:X6,getOwnPropertyNames:$9,getOwnPropertyDescriptor:IJ}=Object,Q9=Object.prototype.hasOwnProperty;function q9($){return this[$]}var CJ,jJ,K9=($,q,Q)=>{var K=$!=null&&typeof $==="object";if(K){var J=q?CJ??=new WeakMap:jJ??=new WeakMap,Z=J.get($);if(Z)return Z}Q=$!=null?fJ(RJ($)):{};let G=q||!$||!$.__esModule?X6(Q,"default",{value:$,enumerable:!0}):Q;for(let W of $9($))if(!Q9.call(G,W))X6(G,W,{get:q9.bind($,W),enumerable:!0});if(K)J.set($,G);return G},X0=($)=>{var q=(e7??=new WeakMap).get($),Q;if(q)return q;if(q=X6({},"__esModule",{value:!0}),$&&typeof $==="object"||typeof $==="function"){for(var K of $9($))if(!Q9.call(q,K))X6(q,K,{get:q9.bind($,K),enumerable:!(Q=IJ($,K))||Q.enumerable})}return e7.set($,q),q},e7,N0=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports);var gJ=($)=>$;function AJ($,q){this[$]=gJ.bind(null,q)}var c1=($,q)=>{for(var Q in q)X6($,Q,{get:q[Q],enumerable:!0,configurable:!0,set:AJ.bind(q,Q)})};var b1=($,q)=>()=>($&&(q=$($=0)),q);var J9=(($)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy($,{get:(q,Q)=>(typeof require<"u"?require:q)[Q]}):$)(function($){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+$+'" is not supported')});var K2={};c1(K2,{transcode:()=>MV,resolveObjectURL:()=>BV,kStringMaxLength:()=>w9,kMaxLength:()=>y6,isUtf8:()=>zV,isAscii:()=>FV,default:()=>wV,constants:()=>EJ,btoa:()=>PJ,atob:()=>TJ,INSPECT_MAX_BYTES:()=>M9,File:()=>uJ,Buffer:()=>o,Blob:()=>SJ});function XJ($){var q=$.length;if(q%4>0)throw Error("Invalid string. Length must be a multiple of 4");var Q=$.indexOf("=");if(Q===-1)Q=q;var K=Q===q?0:4-Q%4;return[Q,K]}function yJ($,q){return($+q)*3/4-q}function hJ($){var q,Q=XJ($),K=Q[0],J=Q[1],Z=new Uint8Array(yJ(K,J)),G=0,W=J>0?K-4:K,B;for(B=0;B>16&255,Z[G++]=q>>8&255,Z[G++]=q&255;if(J===2)q=F2[$.charCodeAt(B)]<<2|F2[$.charCodeAt(B+1)]>>4,Z[G++]=q&255;if(J===1)q=F2[$.charCodeAt(B)]<<10|F2[$.charCodeAt(B+1)]<<4|F2[$.charCodeAt(B+2)]>>2,Z[G++]=q>>8&255,Z[G++]=q&255;return Z}function xJ($){return I2[$>>18&63]+I2[$>>12&63]+I2[$>>6&63]+I2[$&63]}function OJ($,q,Q){var K,J=[];for(var Z=q;ZW?W:G+Z));if(K===1)q=$[Q-1],J.push(I2[q>>2]+I2[q<<4&63]+"==");else if(K===2)q=($[Q-2]<<8)+$[Q-1],J.push(I2[q>>10]+I2[q>>4&63]+I2[q<<2&63]+"=");return J.join("")}function N8($,q,Q,K,J){var Z,G,W=J*8-K-1,B=(1<>1,U=-7,w=Q?J-1:0,F=Q?-1:1,M=$[q+w];w+=F,Z=M&(1<<-U)-1,M>>=-U,U+=W;for(;U>0;Z=Z*256+$[q+w],w+=F,U-=8);G=Z&(1<<-U)-1,Z>>=-U,U+=K;for(;U>0;G=G*256+$[q+w],w+=F,U-=8);if(Z===0)Z=1-V;else if(Z===B)return G?NaN:(M?-1:1)*(1/0);else G=G+Math.pow(2,K),Z=Z-V;return(M?-1:1)*G*Math.pow(2,Z-K)}function F9($,q,Q,K,J,Z){var G,W,B,V=Z*8-J-1,U=(1<>1,F=J===23?Math.pow(2,-24)-Math.pow(2,-77):0,M=K?0:Z-1,k=K?1:-1,f=q<0||q===0&&1/q<0?1:0;if(q=Math.abs(q),isNaN(q)||q===1/0)W=isNaN(q)?1:0,G=U;else{if(G=Math.floor(Math.log(q)/Math.LN2),q*(B=Math.pow(2,-G))<1)G--,B*=2;if(G+w>=1)q+=F/B;else q+=F*Math.pow(2,1-w);if(q*B>=2)G++,B/=2;if(G+w>=U)W=0,G=U;else if(G+w>=1)W=(q*B-1)*Math.pow(2,J),G=G+w;else W=q*Math.pow(2,w-1)*Math.pow(2,J),G=0}for(;J>=8;$[Q+M]=W&255,M+=k,W/=256,J-=8);G=G<0;$[Q+M]=G&255,M+=k,G/=256,V-=8);$[Q+M-k]|=f*128}function S2($){if($>y6)throw RangeError('The value "'+$+'" is invalid for option "size"');let q=new Uint8Array($);return Object.setPrototypeOf(q,o.prototype),q}function h5($,q,Q){return class extends Q{constructor(){super();Object.defineProperty(this,"message",{value:q.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${$}]`,this.stack,delete this.name}get code(){return $}set code(K){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:K,writable:!0})}toString(){return`${this.name} [${$}]: ${this.message}`}}}function o($,q,Q){if(typeof $==="number"){if(typeof q==="string")throw TypeError('The "string" argument must be of type string. Received type number');return x5($)}return N9($,q,Q)}function N9($,q,Q){if(typeof $==="string")return nJ($,q);if(ArrayBuffer.isView($))return dJ($);if($==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof $);if(C2($,ArrayBuffer)||$&&C2($.buffer,ArrayBuffer))return X5($,q,Q);if(typeof SharedArrayBuffer<"u"&&(C2($,SharedArrayBuffer)||$&&C2($.buffer,SharedArrayBuffer)))return X5($,q,Q);if(typeof $==="number")throw TypeError('The "value" argument must not be of type number. Received type number');let K=$.valueOf&&$.valueOf();if(K!=null&&K!==$)return o.from(K,q,Q);let J=mJ($);if(J)return J;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof $[Symbol.toPrimitive]==="function")return o.from($[Symbol.toPrimitive]("string"),q,Q);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof $)}function Y9($){if(typeof $!=="number")throw TypeError('"size" argument must be of type number');else if($<0)throw RangeError('The value "'+$+'" is invalid for option "size"')}function bJ($,q,Q){if(Y9($),$<=0)return S2($);if(q!==void 0)return typeof Q==="string"?S2($).fill(q,Q):S2($).fill(q);return S2($)}function x5($){return Y9($),S2($<0?0:O5($)|0)}function nJ($,q){if(typeof q!=="string"||q==="")q="utf8";if(!o.isEncoding(q))throw TypeError("Unknown encoding: "+q);let Q=k9($,q)|0,K=S2(Q),J=K.write($,q);if(J!==Q)K=K.slice(0,J);return K}function A5($){let q=$.length<0?0:O5($.length)|0,Q=S2(q);for(let K=0;K=y6)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+y6.toString(16)+" bytes");return $|0}function k9($,q){if(o.isBuffer($))return $.length;if(ArrayBuffer.isView($)||C2($,ArrayBuffer))return $.byteLength;if(typeof $!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof $);let Q=$.length,K=arguments.length>2&&arguments[2]===!0;if(!K&&Q===0)return 0;let J=!1;for(;;)switch(q){case"ascii":case"latin1":case"binary":return Q;case"utf8":case"utf-8":return y5($).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q*2;case"hex":return Q>>>1;case"base64":return j9($).length;default:if(J)return K?-1:y5($).length;q=(""+q).toLowerCase(),J=!0}}function pJ($,q,Q){let K=!1;if(q===void 0||q<0)q=0;if(q>this.length)return"";if(Q===void 0||Q>this.length)Q=this.length;if(Q<=0)return"";if(Q>>>=0,q>>>=0,Q<=q)return"";if(!$)$="utf8";while(!0)switch($){case"hex":return QV(this,q,Q);case"utf8":case"utf-8":return L9(this,q,Q);case"ascii":return eJ(this,q,Q);case"latin1":case"binary":return $V(this,q,Q);case"base64":return sJ(this,q,Q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qV(this,q,Q);default:if(K)throw TypeError("Unknown encoding: "+$);$=($+"").toLowerCase(),K=!0}}function w1($,q,Q){let K=$[q];$[q]=$[Q],$[Q]=K}function D9($,q,Q,K,J){if($.length===0)return-1;if(typeof Q==="string")K=Q,Q=0;else if(Q>2147483647)Q=2147483647;else if(Q<-2147483648)Q=-2147483648;if(Q=+Q,Number.isNaN(Q))Q=J?0:$.length-1;if(Q<0)Q=$.length+Q;if(Q>=$.length)if(J)return-1;else Q=$.length-1;else if(Q<0)if(J)Q=0;else return-1;if(typeof q==="string")q=o.from(q,K);if(o.isBuffer(q)){if(q.length===0)return-1;return W9($,q,Q,K,J)}else if(typeof q==="number"){if(q=q&255,typeof Uint8Array.prototype.indexOf==="function")if(J)return Uint8Array.prototype.indexOf.call($,q,Q);else return Uint8Array.prototype.lastIndexOf.call($,q,Q);return W9($,[q],Q,K,J)}throw TypeError("val must be string, number or Buffer")}function W9($,q,Q,K,J){let Z=1,G=$.length,W=q.length;if(K!==void 0){if(K=String(K).toLowerCase(),K==="ucs2"||K==="ucs-2"||K==="utf16le"||K==="utf-16le"){if($.length<2||q.length<2)return-1;Z=2,G/=2,W/=2,Q/=2}}function B(U,w){if(Z===1)return U[w];else return U.readUInt16BE(w*Z)}let V;if(J){let U=-1;for(V=Q;VG)Q=G-W;for(V=Q;V>=0;V--){let U=!0;for(let w=0;wJ)K=J;let Z=q.length;if(K>Z/2)K=Z/2;let G;for(G=0;G239?4:Z>223?3:Z>191?2:1;if(J+W<=Q){let B,V,U,w;switch(W){case 1:if(Z<128)G=Z;break;case 2:if(B=$[J+1],(B&192)===128){if(w=(Z&31)<<6|B&63,w>127)G=w}break;case 3:if(B=$[J+1],V=$[J+2],(B&192)===128&&(V&192)===128){if(w=(Z&15)<<12|(B&63)<<6|V&63,w>2047&&(w<55296||w>57343))G=w}break;case 4:if(B=$[J+1],V=$[J+2],U=$[J+3],(B&192)===128&&(V&192)===128&&(U&192)===128){if(w=(Z&15)<<18|(B&63)<<12|(V&63)<<6|U&63,w>65535&&w<1114112)G=w}}}if(G===null)G=65533,W=1;else if(G>65535)G-=65536,K.push(G>>>10&1023|55296),G=56320|G&1023;K.push(G),J+=W}return tJ(K)}function tJ($){let q=$.length;if(q<=B9)return String.fromCharCode.apply(String,$);let Q="",K=0;while(KK)Q=K;let J="";for(let Z=q;ZQ)throw RangeError("Trying to access beyond buffer length")}function s0($,q,Q,K,J,Z){if(!o.isBuffer($))throw TypeError('"buffer" argument must be a Buffer instance');if(q>J||q$.length)throw RangeError("Index out of range")}function H9($,q,Q,K,J){C9(q,K,J,$,Q,7);let Z=Number(q&BigInt(4294967295));$[Q++]=Z,Z=Z>>8,$[Q++]=Z,Z=Z>>8,$[Q++]=Z,Z=Z>>8,$[Q++]=Z;let G=Number(q>>BigInt(32)&BigInt(4294967295));return $[Q++]=G,G=G>>8,$[Q++]=G,G=G>>8,$[Q++]=G,G=G>>8,$[Q++]=G,Q}function v9($,q,Q,K,J){C9(q,K,J,$,Q,7);let Z=Number(q&BigInt(4294967295));$[Q+7]=Z,Z=Z>>8,$[Q+6]=Z,Z=Z>>8,$[Q+5]=Z,Z=Z>>8,$[Q+4]=Z;let G=Number(q>>BigInt(32)&BigInt(4294967295));return $[Q+3]=G,G=G>>8,$[Q+2]=G,G=G>>8,$[Q+1]=G,G=G>>8,$[Q]=G,Q+8}function f9($,q,Q,K,J,Z){if(Q+K>$.length)throw RangeError("Index out of range");if(Q<0)throw RangeError("Index out of range")}function R9($,q,Q,K,J){if(q=+q,Q=Q>>>0,!J)f9($,q,Q,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return F9($,q,Q,K,23,4),Q+4}function I9($,q,Q,K,J){if(q=+q,Q=Q>>>0,!J)f9($,q,Q,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return F9($,q,Q,K,52,8),Q+8}function z9($){let q="",Q=$.length,K=$[0]==="-"?1:0;for(;Q>=K+4;Q-=3)q=`_${$.slice(Q-3,Q)}${q}`;return`${$.slice(0,Q)}${q}`}function KV($,q,Q){if(n1(q,"offset"),$[q]===void 0||$[q+Q]===void 0)h6(q,$.length-(Q+1))}function C9($,q,Q,K,J,Z){if($>Q||$3)if(q===0||q===BigInt(0))W=`>= 0${G} and < 2${G} ** ${(Z+1)*8}${G}`;else W=`>= -(2${G} ** ${(Z+1)*8-1}${G}) and < 2 ** ${(Z+1)*8-1}${G}`;else W=`>= ${q}${G} and <= ${Q}${G}`;throw new g5("value",W,$)}KV(K,J,Z)}function n1($,q){if(typeof $!=="number")throw new cJ(q,"number",$)}function h6($,q,Q){if(Math.floor($)!==$)throw n1($,Q),new g5(Q||"offset","an integer",$);if(q<0)throw new _J;throw new g5(Q||"offset",`>= ${Q?1:0} and <= ${q}`,$)}function VV($){if($=$.split("=")[0],$=$.trim().replace(JV,""),$.length<2)return"";while($.length%4!==0)$=$+"=";return $}function y5($,q){q=q||1/0;let Q,K=$.length,J=null,Z=[];for(let G=0;G55295&&Q<57344){if(!J){if(Q>56319){if((q-=3)>-1)Z.push(239,191,189);continue}else if(G+1===K){if((q-=3)>-1)Z.push(239,191,189);continue}J=Q;continue}if(Q<56320){if((q-=3)>-1)Z.push(239,191,189);J=Q;continue}Q=(J-55296<<10|Q-56320)+65536}else if(J){if((q-=3)>-1)Z.push(239,191,189)}if(J=null,Q<128){if((q-=1)<0)break;Z.push(Q)}else if(Q<2048){if((q-=2)<0)break;Z.push(Q>>6|192,Q&63|128)}else if(Q<65536){if((q-=3)<0)break;Z.push(Q>>12|224,Q>>6&63|128,Q&63|128)}else if(Q<1114112){if((q-=4)<0)break;Z.push(Q>>18|240,Q>>12&63|128,Q>>6&63|128,Q&63|128)}else throw Error("Invalid code point")}return Z}function UV($){let q=[];for(let Q=0;Q<$.length;++Q)q.push($.charCodeAt(Q)&255);return q}function ZV($,q){let Q,K,J,Z=[];for(let G=0;G<$.length;++G){if((q-=2)<0)break;Q=$.charCodeAt(G),K=Q>>8,J=Q%256,Z.push(J),Z.push(K)}return Z}function j9($){return hJ(VV($))}function Y8($,q,Q,K){let J;for(J=0;J=q.length||J>=$.length)break;q[J+Q]=$[J]}return J}function C2($,q){return $ instanceof q||$!=null&&$.constructor!=null&&$.constructor.name!=null&&$.constructor.name===q.name}function l2($){return typeof BigInt>"u"?WV:$}function WV(){throw Error("BigInt not supported")}function P5($){return()=>{throw Error($+" is not implemented for node:buffer browser polyfill")}}var I2,F2,j5="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",M1,U9,G9,M9=50,y6=2147483647,w9=536870888,PJ,TJ,uJ,SJ,EJ,_J,cJ,g5,B9=4096,JV,GV,BV,zV,FV=($)=>{for(let q of $)if(q.charCodeAt(0)>127)return!1;return!0},MV,wV;var t0=b1(()=>{I2=[],F2=[];for(M1=0,U9=j5.length;M14294967296)J=z9(String(Q));else if(typeof Q==="bigint"){if(J=String(Q),Q>BigInt(2)**BigInt(32)||Q<-(BigInt(2)**BigInt(32)))J=z9(J);J+="n"}return K+=` It must be ${q}. Received ${J}`,K},RangeError);Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(!o.isBuffer(this))return;return this.buffer}});Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(!o.isBuffer(this))return;return this.byteOffset}});o.poolSize=8192;o.from=function($,q,Q){return N9($,q,Q)};Object.setPrototypeOf(o.prototype,Uint8Array.prototype);Object.setPrototypeOf(o,Uint8Array);o.alloc=function($,q,Q){return bJ($,q,Q)};o.allocUnsafe=function($){return x5($)};o.allocUnsafeSlow=function($){return x5($)};o.isBuffer=function($){return $!=null&&$._isBuffer===!0&&$!==o.prototype};o.compare=function($,q){if(C2($,Uint8Array))$=o.from($,$.offset,$.byteLength);if(C2(q,Uint8Array))q=o.from(q,q.offset,q.byteLength);if(!o.isBuffer($)||!o.isBuffer(q))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if($===q)return 0;let Q=$.length,K=q.length;for(let J=0,Z=Math.min(Q,K);JK.length){if(!o.isBuffer(Z))Z=o.from(Z);Z.copy(K,J)}else Uint8Array.prototype.set.call(K,Z,J);else if(!o.isBuffer(Z))throw TypeError('"list" argument must be an Array of Buffers');else Z.copy(K,J);J+=Z.length}return K};o.byteLength=k9;o.prototype._isBuffer=!0;o.prototype.swap16=function(){let $=this.length;if($%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let q=0;q<$;q+=2)w1(this,q,q+1);return this};o.prototype.swap32=function(){let $=this.length;if($%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let q=0;q<$;q+=4)w1(this,q,q+3),w1(this,q+1,q+2);return this};o.prototype.swap64=function(){let $=this.length;if($%8!==0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let q=0;q<$;q+=8)w1(this,q,q+7),w1(this,q+1,q+6),w1(this,q+2,q+5),w1(this,q+3,q+4);return this};o.prototype.toString=function(){let $=this.length;if($===0)return"";if(arguments.length===0)return L9(this,0,$);return pJ.apply(this,arguments)};o.prototype.toLocaleString=o.prototype.toString;o.prototype.equals=function($){if(!o.isBuffer($))throw TypeError("Argument must be a Buffer");if(this===$)return!0;return o.compare(this,$)===0};o.prototype.inspect=function(){let $="",q=M9;if($=this.toString("hex",0,q).replace(/(.{2})/g,"$1 ").trim(),this.length>q)$+=" ... ";return""};if(G9)o.prototype[G9]=o.prototype.inspect;o.prototype.compare=function($,q,Q,K,J){if(C2($,Uint8Array))$=o.from($,$.offset,$.byteLength);if(!o.isBuffer($))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof $);if(q===void 0)q=0;if(Q===void 0)Q=$?$.length:0;if(K===void 0)K=0;if(J===void 0)J=this.length;if(q<0||Q>$.length||K<0||J>this.length)throw RangeError("out of range index");if(K>=J&&q>=Q)return 0;if(K>=J)return-1;if(q>=Q)return 1;if(q>>>=0,Q>>>=0,K>>>=0,J>>>=0,this===$)return 0;let Z=J-K,G=Q-q,W=Math.min(Z,G),B=this.slice(K,J),V=$.slice(q,Q);for(let U=0;U>>0,isFinite(Q)){if(Q=Q>>>0,K===void 0)K="utf8"}else K=Q,Q=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let J=this.length-q;if(Q===void 0||Q>J)Q=J;if($.length>0&&(Q<0||q<0)||q>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!K)K="utf8";let Z=!1;for(;;)switch(K){case"hex":return iJ(this,$,q,Q);case"utf8":case"utf-8":return oJ(this,$,q,Q);case"ascii":case"latin1":case"binary":return aJ(this,$,q,Q);case"base64":return lJ(this,$,q,Q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return rJ(this,$,q,Q);default:if(Z)throw TypeError("Unknown encoding: "+K);K=(""+K).toLowerCase(),Z=!0}};o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};o.prototype.slice=function($,q){let Q=this.length;if($=~~$,q=q===void 0?Q:~~q,$<0){if($+=Q,$<0)$=0}else if($>Q)$=Q;if(q<0){if(q+=Q,q<0)q=0}else if(q>Q)q=Q;if(q<$)q=$;let K=this.subarray($,q);return Object.setPrototypeOf(K,o.prototype),K};o.prototype.readUintLE=o.prototype.readUIntLE=function($,q,Q){if($=$>>>0,q=q>>>0,!Q)b0($,q,this.length);let K=this[$],J=1,Z=0;while(++Z>>0,q=q>>>0,!Q)b0($,q,this.length);let K=this[$+--q],J=1;while(q>0&&(J*=256))K+=this[$+--q]*J;return K};o.prototype.readUint8=o.prototype.readUInt8=function($,q){if($=$>>>0,!q)b0($,1,this.length);return this[$]};o.prototype.readUint16LE=o.prototype.readUInt16LE=function($,q){if($=$>>>0,!q)b0($,2,this.length);return this[$]|this[$+1]<<8};o.prototype.readUint16BE=o.prototype.readUInt16BE=function($,q){if($=$>>>0,!q)b0($,2,this.length);return this[$]<<8|this[$+1]};o.prototype.readUint32LE=o.prototype.readUInt32LE=function($,q){if($=$>>>0,!q)b0($,4,this.length);return(this[$]|this[$+1]<<8|this[$+2]<<16)+this[$+3]*16777216};o.prototype.readUint32BE=o.prototype.readUInt32BE=function($,q){if($=$>>>0,!q)b0($,4,this.length);return this[$]*16777216+(this[$+1]<<16|this[$+2]<<8|this[$+3])};o.prototype.readBigUInt64LE=l2(function($){$=$>>>0,n1($,"offset");let q=this[$],Q=this[$+7];if(q===void 0||Q===void 0)h6($,this.length-8);let K=q+this[++$]*256+this[++$]*65536+this[++$]*16777216,J=this[++$]+this[++$]*256+this[++$]*65536+Q*16777216;return BigInt(K)+(BigInt(J)<>>0,n1($,"offset");let q=this[$],Q=this[$+7];if(q===void 0||Q===void 0)h6($,this.length-8);let K=q*16777216+this[++$]*65536+this[++$]*256+this[++$],J=this[++$]*16777216+this[++$]*65536+this[++$]*256+Q;return(BigInt(K)<>>0,q=q>>>0,!Q)b0($,q,this.length);let K=this[$],J=1,Z=0;while(++Z=J)K-=Math.pow(2,8*q);return K};o.prototype.readIntBE=function($,q,Q){if($=$>>>0,q=q>>>0,!Q)b0($,q,this.length);let K=q,J=1,Z=this[$+--K];while(K>0&&(J*=256))Z+=this[$+--K]*J;if(J*=128,Z>=J)Z-=Math.pow(2,8*q);return Z};o.prototype.readInt8=function($,q){if($=$>>>0,!q)b0($,1,this.length);if(!(this[$]&128))return this[$];return(255-this[$]+1)*-1};o.prototype.readInt16LE=function($,q){if($=$>>>0,!q)b0($,2,this.length);let Q=this[$]|this[$+1]<<8;return Q&32768?Q|4294901760:Q};o.prototype.readInt16BE=function($,q){if($=$>>>0,!q)b0($,2,this.length);let Q=this[$+1]|this[$]<<8;return Q&32768?Q|4294901760:Q};o.prototype.readInt32LE=function($,q){if($=$>>>0,!q)b0($,4,this.length);return this[$]|this[$+1]<<8|this[$+2]<<16|this[$+3]<<24};o.prototype.readInt32BE=function($,q){if($=$>>>0,!q)b0($,4,this.length);return this[$]<<24|this[$+1]<<16|this[$+2]<<8|this[$+3]};o.prototype.readBigInt64LE=l2(function($){$=$>>>0,n1($,"offset");let q=this[$],Q=this[$+7];if(q===void 0||Q===void 0)h6($,this.length-8);let K=this[$+4]+this[$+5]*256+this[$+6]*65536+(Q<<24);return(BigInt(K)<>>0,n1($,"offset");let q=this[$],Q=this[$+7];if(q===void 0||Q===void 0)h6($,this.length-8);let K=(q<<24)+this[++$]*65536+this[++$]*256+this[++$];return(BigInt(K)<>>0,!q)b0($,4,this.length);return N8(this,$,!0,23,4)};o.prototype.readFloatBE=function($,q){if($=$>>>0,!q)b0($,4,this.length);return N8(this,$,!1,23,4)};o.prototype.readDoubleLE=function($,q){if($=$>>>0,!q)b0($,8,this.length);return N8(this,$,!0,52,8)};o.prototype.readDoubleBE=function($,q){if($=$>>>0,!q)b0($,8,this.length);return N8(this,$,!1,52,8)};o.prototype.writeUintLE=o.prototype.writeUIntLE=function($,q,Q,K){if($=+$,q=q>>>0,Q=Q>>>0,!K){let G=Math.pow(2,8*Q)-1;s0(this,$,q,Q,G,0)}let J=1,Z=0;this[q]=$&255;while(++Z>>0,Q=Q>>>0,!K){let G=Math.pow(2,8*Q)-1;s0(this,$,q,Q,G,0)}let J=Q-1,Z=1;this[q+J]=$&255;while(--J>=0&&(Z*=256))this[q+J]=$/Z&255;return q+Q};o.prototype.writeUint8=o.prototype.writeUInt8=function($,q,Q){if($=+$,q=q>>>0,!Q)s0(this,$,q,1,255,0);return this[q]=$&255,q+1};o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function($,q,Q){if($=+$,q=q>>>0,!Q)s0(this,$,q,2,65535,0);return this[q]=$&255,this[q+1]=$>>>8,q+2};o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function($,q,Q){if($=+$,q=q>>>0,!Q)s0(this,$,q,2,65535,0);return this[q]=$>>>8,this[q+1]=$&255,q+2};o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function($,q,Q){if($=+$,q=q>>>0,!Q)s0(this,$,q,4,4294967295,0);return this[q+3]=$>>>24,this[q+2]=$>>>16,this[q+1]=$>>>8,this[q]=$&255,q+4};o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function($,q,Q){if($=+$,q=q>>>0,!Q)s0(this,$,q,4,4294967295,0);return this[q]=$>>>24,this[q+1]=$>>>16,this[q+2]=$>>>8,this[q+3]=$&255,q+4};o.prototype.writeBigUInt64LE=l2(function($,q=0){return H9(this,$,q,BigInt(0),BigInt("0xffffffffffffffff"))});o.prototype.writeBigUInt64BE=l2(function($,q=0){return v9(this,$,q,BigInt(0),BigInt("0xffffffffffffffff"))});o.prototype.writeIntLE=function($,q,Q,K){if($=+$,q=q>>>0,!K){let W=Math.pow(2,8*Q-1);s0(this,$,q,Q,W-1,-W)}let J=0,Z=1,G=0;this[q]=$&255;while(++J>0)-G&255}return q+Q};o.prototype.writeIntBE=function($,q,Q,K){if($=+$,q=q>>>0,!K){let W=Math.pow(2,8*Q-1);s0(this,$,q,Q,W-1,-W)}let J=Q-1,Z=1,G=0;this[q+J]=$&255;while(--J>=0&&(Z*=256)){if($<0&&G===0&&this[q+J+1]!==0)G=1;this[q+J]=($/Z>>0)-G&255}return q+Q};o.prototype.writeInt8=function($,q,Q){if($=+$,q=q>>>0,!Q)s0(this,$,q,1,127,-128);if($<0)$=255+$+1;return this[q]=$&255,q+1};o.prototype.writeInt16LE=function($,q,Q){if($=+$,q=q>>>0,!Q)s0(this,$,q,2,32767,-32768);return this[q]=$&255,this[q+1]=$>>>8,q+2};o.prototype.writeInt16BE=function($,q,Q){if($=+$,q=q>>>0,!Q)s0(this,$,q,2,32767,-32768);return this[q]=$>>>8,this[q+1]=$&255,q+2};o.prototype.writeInt32LE=function($,q,Q){if($=+$,q=q>>>0,!Q)s0(this,$,q,4,2147483647,-2147483648);return this[q]=$&255,this[q+1]=$>>>8,this[q+2]=$>>>16,this[q+3]=$>>>24,q+4};o.prototype.writeInt32BE=function($,q,Q){if($=+$,q=q>>>0,!Q)s0(this,$,q,4,2147483647,-2147483648);if($<0)$=4294967295+$+1;return this[q]=$>>>24,this[q+1]=$>>>16,this[q+2]=$>>>8,this[q+3]=$&255,q+4};o.prototype.writeBigInt64LE=l2(function($,q=0){return H9(this,$,q,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});o.prototype.writeBigInt64BE=l2(function($,q=0){return v9(this,$,q,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});o.prototype.writeFloatLE=function($,q,Q){return R9(this,$,q,!0,Q)};o.prototype.writeFloatBE=function($,q,Q){return R9(this,$,q,!1,Q)};o.prototype.writeDoubleLE=function($,q,Q){return I9(this,$,q,!0,Q)};o.prototype.writeDoubleBE=function($,q,Q){return I9(this,$,q,!1,Q)};o.prototype.copy=function($,q,Q,K){if(!o.isBuffer($))throw TypeError("argument should be a Buffer");if(!Q)Q=0;if(!K&&K!==0)K=this.length;if(q>=$.length)q=$.length;if(!q)q=0;if(K>0&&K=this.length)throw RangeError("Index out of range");if(K<0)throw RangeError("sourceEnd out of bounds");if(K>this.length)K=this.length;if($.length-q>>0,Q=Q===void 0?this.length:Q>>>0,!$)$=0;let J;if(typeof $==="number")for(J=q;J{var S0=y9.exports={},j2,g2;function T5(){throw Error("setTimeout has not been defined")}function u5(){throw Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function")j2=setTimeout;else j2=T5}catch($){j2=T5}try{if(typeof clearTimeout==="function")g2=clearTimeout;else g2=u5}catch($){g2=u5}})();function g9($){if(j2===setTimeout)return setTimeout($,0);if((j2===T5||!j2)&&setTimeout)return j2=setTimeout,setTimeout($,0);try{return j2($,0)}catch(q){try{return j2.call(null,$,0)}catch(Q){return j2.call(this,$,0)}}}function NV($){if(g2===clearTimeout)return clearTimeout($);if((g2===u5||!g2)&&clearTimeout)return g2=clearTimeout,clearTimeout($);try{return g2($)}catch(q){try{return g2.call(null,$)}catch(Q){return g2.call(this,$)}}}var E2=[],d1=!1,N1,k8=-1;function YV(){if(!d1||!N1)return;if(d1=!1,N1.length)E2=N1.concat(E2);else k8=-1;if(E2.length)A9()}function A9(){if(d1)return;var $=g9(YV);d1=!0;var q=E2.length;while(q){N1=E2,E2=[];while(++k81)for(var Q=1;Qn9,once:()=>c9,listenerCount:()=>d9,init:()=>r2,getMaxListeners:()=>p9,getEventListeners:()=>b9,default:()=>CV,captureRejectionSymbol:()=>u9,addAbortListener:()=>i9,EventEmitter:()=>r2});function S9($,q){var{_events:Q}=$;if(q[0]??=Error("Unhandled error."),!Q)throw q[0];var K=Q[T9];if(K)for(var J of O9.call(K))J.apply($,q);var Z=Q.error;if(!Z)throw q[0];for(var J of O9.call(Z))J.apply($,q);return!0}function LV($,q,Q,K){q.then(void 0,function(J){queueMicrotask(()=>HV($,J,Q,K))})}function HV($,q,Q,K){if(typeof $[x9]==="function")$[x9](q,Q,...K);else try{$[Y1]=!1,$.emit("error",q)}finally{$[Y1]=!0}}function E9($,q,Q){Q.warned=!0;let K=Error(`Possible EventEmitter memory leak detected. ${Q.length} ${String(q)} listeners added to [${$.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);K.name="MaxListenersExceededWarning",K.emitter=$,K.type=q,K.count=Q.length,console.warn(K)}function _9($,q,...Q){this.removeListener($,q),q.apply(this,Q)}function c9($,q,Q){var K=Q?.signal;if(m9(K,"options.signal"),K?.aborted)throw new S5(void 0,{cause:K?.reason});let{resolve:J,reject:Z,promise:G}=$newPromiseCapability(Promise),W=(U)=>{if($.removeListener(q,B),K!=null)D8(K,"abort",V);Z(U)},B=(...U)=>{if(typeof $.removeListener==="function")$.removeListener("error",W);if(K!=null)D8(K,"abort",V);J(U)};if(P9($,q,B,{once:!0}),q!=="error"&&typeof $.once==="function")$.once("error",W);function V(){D8($,q,B),D8($,"error",W),Z(new S5(void 0,{cause:K?.reason}))}if(K!=null)P9(K,"abort",V,{once:!0});return G}function b9($,q){return $.listeners(q)}function n9($,...q){_5($,"setMaxListeners",0);var Q;if(q&&(Q=q.length))for(let K=0;KK||(Q!=null||K!=null)&&Number.isNaN($))throw RV(q,`${Q!=null?`>= ${Q}`:""}${Q!=null&&K!=null?" && ":""}${K!=null?`<= ${K}`:""}`,$)}function x6($){if(typeof $!=="function")throw TypeError("The listener must be a function")}function IV($,q){if(typeof $!=="boolean")throw m1(q,"boolean",$)}function p9($){return $?._maxListeners??k1}function i9($,q){if($===void 0)throw m1("signal","AbortSignal",$);if(m9($,"signal"),typeof q!=="function")throw m1("listener","function",q);let Q;if($.aborted)queueMicrotask(()=>q());else $.addEventListener("abort",q,{__proto__:null,once:!0}),Q=()=>{$.removeEventListener("abort",q)};return{__proto__:null,[Symbol.dispose](){Q?.()}}}var E5,Y1,T9,kV,DV,x9,u9,O9,k1=10,r2=function($){if(this._events===void 0||this._events===this.__proto__._events)this._events={__proto__:null},this._eventsCount=0;if(this._maxListeners??=void 0,this[Y1]=$?.captureRejections?Boolean($?.captureRejections):y0[Y1])this.emit=fV},y0,vV=function($,...q){if($==="error")return S9(this,q);var{_events:Q}=this;if(Q===void 0)return!1;var K=Q[$];if(K===void 0)return!1;let J=K.length>1?K.slice():K;for(let Z=0,{length:G}=J;Z1?K.slice():K;for(let Z=0,{length:G}=J;Z{E5=Symbol.for,Y1=Symbol("kCapture"),T9=E5("events.errorMonitor"),kV=Symbol("events.maxEventTargetListeners"),DV=Symbol("events.maxEventTargetListenersWarned"),x9=E5("nodejs.rejection"),u9=E5("nodejs.rejection"),O9=Array.prototype.slice,y0=r2.prototype={};y0._events=void 0;y0._eventsCount=0;y0._maxListeners=void 0;y0.setMaxListeners=function($){return _5($,"setMaxListeners",0),this._maxListeners=$,this};y0.constructor=r2;y0.getMaxListeners=function(){return this?._maxListeners??k1};y0.emit=vV;y0.addListener=function($,q){x6(q);var Q=this._events;if(!Q)Q=this._events={__proto__:null},this._eventsCount=0;else if(Q.newListener)this.emit("newListener",$,q.listener??q);var K=Q[$];if(!K)Q[$]=[q],this._eventsCount++;else{K.push(q);var J=this._maxListeners??k1;if(J>0&&K.length>J&&!K.warned)E9(this,$,K)}return this};y0.on=y0.addListener;y0.prependListener=function($,q){x6(q);var Q=this._events;if(!Q)Q=this._events={__proto__:null},this._eventsCount=0;else if(Q.newListener)this.emit("newListener",$,q.listener??q);var K=Q[$];if(!K)Q[$]=[q],this._eventsCount++;else{K.unshift(q);var J=this._maxListeners??k1;if(J>0&&K.length>J&&!K.warned)E9(this,$,K)}return this};y0.once=function($,q){x6(q);let Q=_9.bind(this,$,q);return Q.listener=q,this.addListener($,Q),this};y0.prependOnceListener=function($,q){x6(q);let Q=_9.bind(this,$,q);return Q.listener=q,this.prependListener($,Q),this};y0.removeListener=function($,q){x6(q);var{_events:Q}=this;if(!Q)return this;var K=Q[$];if(!K)return this;var J=K.length;let Z=-1;for(let G=J-1;G>=0;G--)if(K[G]===q||K[G].listener===q){Z=G;break}if(Z<0)return this;if(Z===0)K.shift();else K.splice(Z,1);if(K.length===0)delete Q[$],this._eventsCount--;return this};y0.off=y0.removeListener;y0.removeAllListeners=function($){var{_events:q}=this;if($&&q){if(q[$])delete q[$],this._eventsCount--}else this._events={__proto__:null};return this};y0.listeners=function($){var{_events:q}=this;if(!q)return[];var Q=q[$];if(!Q)return[];return Q.map((K)=>K.listener??K)};y0.rawListeners=function($){var{_events:q}=this;if(!q)return[];var Q=q[$];if(!Q)return[];return Q.slice()};y0.listenerCount=function($){var{_events:q}=this;if(!q)return 0;return q[$]?.length??0};y0.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};y0[Y1]=!1;S5=class S5 extends Error{constructor($="The operation was aborted",q=void 0){if(q!==void 0&&typeof q!=="object")throw m1("options","Object",q);super($,q);this.code="ABORT_ERR",this.name="AbortError"}};Object.defineProperties(r2,{captureRejections:{get(){return y0[Y1]},set($){IV($,"EventEmitter.captureRejections"),y0[Y1]=$},enumerable:!0},defaultMaxListeners:{enumerable:!0,get:()=>{return k1},set:($)=>{_5($,"defaultMaxListeners",0),k1=$}},kMaxEventTargetListeners:{value:kV,enumerable:!1,configurable:!1,writable:!1},kMaxEventTargetListenersWarned:{value:DV,enumerable:!1,configurable:!1,writable:!1}});Object.assign(r2,{once:c9,getEventListeners:b9,getMaxListeners:p9,setMaxListeners:n9,EventEmitter:r2,usingDomains:!1,captureRejectionSymbol:u9,errorMonitor:T9,addAbortListener:i9,init:r2,listenerCount:d9});CV=r2});var a1=N0((Yz,$$)=>{var g0=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports),P0=g0(($,q)=>{class Q extends Error{constructor(K){if(!Array.isArray(K))throw TypeError(`Expected input to be an Array, got ${typeof K}`);let J="";for(let Z=0;Z{q.exports={format(Q,...K){return Q.replace(/%([sdifj])/g,function(...[J,Z]){let G=K.shift();if(Z==="f")return G.toFixed(6);else if(Z==="j")return JSON.stringify(G);else if(Z==="s"&&typeof G==="object")return`${G.constructor!==Object?G.constructor.name:""} {}`.trim();else return G.toString()})},inspect(Q){switch(typeof Q){case"string":if(Q.includes("'")){if(!Q.includes('"'))return`"${Q}"`;else if(!Q.includes("`")&&!Q.includes("${"))return`\`${Q}\``}return`'${Q}'`;case"number":if(isNaN(Q))return"NaN";else if(Object.is(Q,-0))return String(Q);return Q;case"bigint":return`${String(Q)}n`;case"boolean":case"undefined":return String(Q);case"object":return"{}"}}}}),a0=g0(($,q)=>{var{format:Q,inspect:K}=o9(),{AggregateError:J}=P0(),Z=globalThis.AggregateError||J,G=Symbol("kIsNodeError"),W=["string","function","number","object","Function","Object","boolean","bigint","symbol"],B=/^([A-Z][a-z0-9]*)+$/,V={};function U(D,z){if(!D)throw new V.ERR_INTERNAL_ASSERTION(z)}function w(D){let z="",N=D.length,H=D[0]==="-"?1:0;for(;N>=H+4;N-=3)z=`_${D.slice(N-3,N)}${z}`;return`${D.slice(0,N)}${z}`}function F(D,z,N){if(typeof z==="function")return U(z.length<=N.length,`Code: ${D}; The provided arguments length (${N.length}) does not match the required ones (${z.length}).`),z(...N);let H=(z.match(/%[dfijoOs]/g)||[]).length;if(U(H===N.length,`Code: ${D}; The provided arguments length (${N.length}) does not match the required ones (${H}).`),N.length===0)return z;return Q(z,...N)}function M(D,z,N){if(!N)N=Error;class H extends N{constructor(...v){super(F(D,z,v))}toString(){return`${this.name} [${D}]: ${this.message}`}}Object.defineProperties(H.prototype,{name:{value:N.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${D}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),H.prototype.code=D,H.prototype[G]=!0,V[D]=H}function k(D){let z="__node_internal_"+D.name;return Object.defineProperty(D,"name",{value:z}),D}function f(D,z){if(D&&z&&D!==z){if(Array.isArray(z.errors))return z.errors.push(D),z;let N=new Z([z,D],z.message);return N.code=z.code,N}return D||z}class L extends Error{constructor(D="The operation was aborted",z=void 0){if(z!==void 0&&typeof z!=="object")throw new V.ERR_INVALID_ARG_TYPE("options","Object",z);super(D,z);this.code="ABORT_ERR",this.name="AbortError"}}M("ERR_ASSERTION","%s",Error),M("ERR_INVALID_ARG_TYPE",(D,z,N)=>{if(U(typeof D==="string","'name' must be a string"),!Array.isArray(z))z=[z];let H="The ";if(D.endsWith(" argument"))H+=`${D} `;else H+=`"${D}" ${D.includes(".")?"property":"argument"} `;H+="must be ";let v=[],j=[],n=[];for(let _ of z)if(U(typeof _==="string","All expected entries have to be of type string"),W.includes(_))v.push(_.toLowerCase());else if(B.test(_))j.push(_);else U(_!=="object",'The value "object" should be written as "Object"'),n.push(_);if(j.length>0){let _=v.indexOf("object");if(_!==-1)v.splice(v,_,1),j.push("Object")}if(v.length>0){switch(v.length){case 1:H+=`of type ${v[0]}`;break;case 2:H+=`one of type ${v[0]} or ${v[1]}`;break;default:{let _=v.pop();H+=`one of type ${v.join(", ")}, or ${_}`}}if(j.length>0||n.length>0)H+=" or "}if(j.length>0){switch(j.length){case 1:H+=`an instance of ${j[0]}`;break;case 2:H+=`an instance of ${j[0]} or ${j[1]}`;break;default:{let _=j.pop();H+=`an instance of ${j.join(", ")}, or ${_}`}}if(n.length>0)H+=" or "}switch(n.length){case 0:break;case 1:if(n[0].toLowerCase()!==n[0])H+="an ";H+=`${n[0]}`;break;case 2:H+=`one of ${n[0]} or ${n[1]}`;break;default:{let _=n.pop();H+=`one of ${n.join(", ")}, or ${_}`}}if(N==null)H+=`. Received ${N}`;else if(typeof N==="function"&&N.name)H+=`. Received function ${N.name}`;else if(typeof N==="object"){var d;if((d=N.constructor)!==null&&d!==void 0&&d.name)H+=`. Received an instance of ${N.constructor.name}`;else{let _=K(N,{depth:-1});H+=`. Received ${_}`}}else{let _=K(N,{colors:!1});if(_.length>25)_=`${_.slice(0,25)}...`;H+=`. Received type ${typeof N} (${_})`}return H},TypeError),M("ERR_INVALID_ARG_VALUE",(D,z,N="is invalid")=>{let H=K(z);if(H.length>128)H=H.slice(0,128)+"...";return`The ${D.includes(".")?"property":"argument"} '${D}' ${N}. Received ${H}`},TypeError),M("ERR_INVALID_RETURN_VALUE",(D,z,N)=>{var H;let v=N!==null&&N!==void 0&&(H=N.constructor)!==null&&H!==void 0&&H.name?`instance of ${N.constructor.name}`:`type ${typeof N}`;return`Expected ${D} to be returned from the "${z}" function but got ${v}.`},TypeError),M("ERR_MISSING_ARGS",(...D)=>{U(D.length>0,"At least one arg needs to be specified");let z,N=D.length;switch(D=(Array.isArray(D)?D:[D]).map((H)=>`"${H}"`).join(" or "),N){case 1:z+=`The ${D[0]} argument`;break;case 2:z+=`The ${D[0]} and ${D[1]} arguments`;break;default:{let H=D.pop();z+=`The ${D.join(", ")}, and ${H} arguments`}break}return`${z} must be specified`},TypeError),M("ERR_OUT_OF_RANGE",(D,z,N)=>{U(z,'Missing "range" argument');let H;if(Number.isInteger(N)&&Math.abs(N)>4294967296)H=w(String(N));else if(typeof N==="bigint"){H=String(N);let v=BigInt(2)**BigInt(32);if(N>v||N<-v)H=w(H);H+="n"}else H=K(N);return`The value of "${D}" is out of range. It must be ${z}. Received ${H}`},RangeError),M("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),M("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),M("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),M("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),M("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),M("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),M("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),M("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),M("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),M("ERR_STREAM_WRITE_AFTER_END","write after end",Error),M("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),q.exports={AbortError:L,aggregateTwoErrors:k(f),hideStackFrames:k,codes:V}}),jV=g0(($,q)=>{Object.defineProperty($,"__esModule",{value:!0});var Q=new WeakMap,K=new WeakMap;function J(X){let P=Q.get(X);return console.assert(P!=null,"'this' is expected an Event object, but got",X),P}function Z(X){if(X.passiveListener!=null){if(typeof console<"u"&&typeof console.error==="function")console.error("Unable to preventDefault inside passive event listener invocation.",X.passiveListener);return}if(!X.event.cancelable)return;if(X.canceled=!0,typeof X.event.preventDefault==="function")X.event.preventDefault()}function G(X,P){Q.set(this,{eventTarget:X,event:P,eventPhase:2,currentTarget:X,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:P.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let g=Object.keys(P);for(let c=0;c0){let X=Array(arguments.length);for(let P=0;P{Object.defineProperty($,"__esModule",{value:!0});var Q=jV();class K extends Q.EventTarget{constructor(){super();throw TypeError("AbortSignal cannot be constructed directly")}get aborted(){let U=G.get(this);if(typeof U!=="boolean")throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return U}}Q.defineEventAttribute(K.prototype,"abort");function J(){let U=Object.create(K.prototype);return Q.EventTarget.call(U),G.set(U,!1),U}function Z(U){if(G.get(U)!==!1)return;G.set(U,!0),U.dispatchEvent({type:"abort"})}var G=new WeakMap;if(Object.defineProperties(K.prototype,{aborted:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(K.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class W{constructor(){B.set(this,J())}get signal(){return V(this)}abort(){Z(V(this))}}var B=new WeakMap;function V(U){let w=B.get(U);if(w==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${U===null?"null":typeof U}`);return w}if(Object.defineProperties(W.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(W.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});$.AbortController=W,$.AbortSignal=K,$.default=W,q.exports=W,q.exports.AbortController=q.exports.default=W,q.exports.AbortSignal=K}),e0=g0(($,q)=>{var Q=(t0(),X0(K2)),{format:K,inspect:J}=o9(),{codes:{ERR_INVALID_ARG_TYPE:Z}}=a0(),{kResistStopPropagation:G,AggregateError:W,SymbolDispose:B}=P0(),V=globalThis.AbortSignal||O6().AbortSignal,U=globalThis.AbortController||O6().AbortController,w=Object.getPrototypeOf(async function(){}).constructor,F=globalThis.Blob||Q.Blob,M=typeof F<"u"?function(L){return L instanceof F}:function(L){return!1},k=(L,D)=>{if(L!==void 0&&(L===null||typeof L!=="object"||!("aborted"in L)))throw new Z(D,"AbortSignal",L)},f=(L,D)=>{if(typeof L!=="function")throw new Z(D,"Function",L)};q.exports={AggregateError:W,kEmptyObject:Object.freeze({}),once(L){let D=!1;return function(...z){if(D)return;D=!0,L.apply(this,z)}},createDeferredPromise:function(){let L,D;return{promise:new Promise((z,N)=>{L=z,D=N}),resolve:L,reject:D}},promisify(L){return new Promise((D,z)=>{L((N,...H)=>{if(N)return z(N);return D(...H)})})},debuglog(){return function(){}},format:K,inspect:J,types:{isAsyncFunction(L){return L instanceof w},isArrayBufferView(L){return ArrayBuffer.isView(L)}},isBlob:M,deprecate(L,D){return L},addAbortListener:(i1(),X0(p1)).addAbortListener||function(L,D){if(L===void 0)throw new Z("signal","AbortSignal",L);k(L,"signal"),f(D,"listener");let z;if(L.aborted)queueMicrotask(()=>D());else L.addEventListener("abort",D,{__proto__:null,once:!0,[G]:!0}),z=()=>{L.removeEventListener("abort",D)};return{__proto__:null,[B](){var N;(N=z)===null||N===void 0||N()}}},AbortSignalAny:V.any||function(L){if(L.length===1)return L[0];let D=new U,z=()=>D.abort();return L.forEach((N)=>{k(N,"signals"),N.addEventListener("abort",z,{once:!0})}),D.signal.addEventListener("abort",()=>{L.forEach((N)=>N.removeEventListener("abort",z))},{once:!0}),D.signal}},q.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),P6=g0(($,q)=>{var{ArrayIsArray:Q,ArrayPrototypeIncludes:K,ArrayPrototypeJoin:J,ArrayPrototypeMap:Z,NumberIsInteger:G,NumberIsNaN:W,NumberMAX_SAFE_INTEGER:B,NumberMIN_SAFE_INTEGER:V,NumberParseInt:U,ObjectPrototypeHasOwnProperty:w,RegExpPrototypeExec:F,String:M,StringPrototypeToUpperCase:k,StringPrototypeTrim:f}=P0(),{hideStackFrames:L,codes:{ERR_SOCKET_BAD_PORT:D,ERR_INVALID_ARG_TYPE:z,ERR_INVALID_ARG_VALUE:N,ERR_OUT_OF_RANGE:H,ERR_UNKNOWN_SIGNAL:v}}=a0(),{normalizeEncoding:j}=e0(),{isAsyncFunction:n,isArrayBufferView:d}=e0().types,_={};function X(T){return T===(T|0)}function P(T){return T===T>>>0}var g=/^[0-7]+$/,c="must be a 32-bit unsigned integer or an octal string";function h(T,t,G0){if(typeof T>"u")T=G0;if(typeof T==="string"){if(F(g,T)===null)throw new N(t,T,c);T=U(T,8)}return $0(T,t),T}var x=L((T,t,G0=V,Q0=B)=>{if(typeof T!=="number")throw new z(t,"number",T);if(!G(T))throw new H(t,"an integer",T);if(TQ0)throw new H(t,`>= ${G0} && <= ${Q0}`,T)}),l=L((T,t,G0=-2147483648,Q0=2147483647)=>{if(typeof T!=="number")throw new z(t,"number",T);if(!G(T))throw new H(t,"an integer",T);if(TQ0)throw new H(t,`>= ${G0} && <= ${Q0}`,T)}),$0=L((T,t,G0=!1)=>{if(typeof T!=="number")throw new z(t,"number",T);if(!G(T))throw new H(t,"an integer",T);let Q0=G0?1:0,M0=4294967295;if(TM0)throw new H(t,`>= ${Q0} && <= ${M0}`,T)});function Z0(T,t){if(typeof T!=="string")throw new z(t,"string",T)}function F0(T,t,G0=void 0,Q0){if(typeof T!=="number")throw new z(t,"number",T);if(G0!=null&&TQ0||(G0!=null||Q0!=null)&&W(T))throw new H(t,`${G0!=null?`>= ${G0}`:""}${G0!=null&&Q0!=null?" && ":""}${Q0!=null?`<= ${Q0}`:""}`,T)}var p=L((T,t,G0)=>{if(!K(G0,T)){let Q0="must be one of: "+J(Z(G0,(M0)=>typeof M0==="string"?`'${M0}'`:M(M0)),", ");throw new N(t,T,Q0)}});function W0(T,t){if(typeof T!=="boolean")throw new z(t,"boolean",T)}function y(T,t,G0){return T==null||!w(T,t)?G0:T[t]}var i=L((T,t,G0=null)=>{let Q0=y(G0,"allowArray",!1),M0=y(G0,"allowFunction",!1);if(!y(G0,"nullable",!1)&&T===null||!Q0&&Q(T)||typeof T!=="object"&&(!M0||typeof T!=="function"))throw new z(t,"Object",T)}),U0=L((T,t)=>{if(T!=null&&typeof T!=="object"&&typeof T!=="function")throw new z(t,"a dictionary",T)}),m=L((T,t,G0=0)=>{if(!Q(T))throw new z(t,"Array",T);if(T.length{if(!d(T))throw new z(t,["Buffer","TypedArray","DataView"],T)});function E(T,t){let G0=j(t),Q0=T.length;if(G0==="hex"&&Q0%2!==0)throw new N("encoding",t,`is invalid for data of length ${Q0}`)}function a(T,t="Port",G0=!0){if(typeof T!=="number"&&typeof T!=="string"||typeof T==="string"&&f(T).length===0||+T!==+T>>>0||T>65535||T===0&&!G0)throw new D(t,T,G0);return T|0}var K0=L((T,t)=>{if(T!==void 0&&(T===null||typeof T!=="object"||!("aborted"in T)))throw new z(t,"AbortSignal",T)}),R=L((T,t)=>{if(typeof T!=="function")throw new z(t,"Function",T)}),Y=L((T,t)=>{if(typeof T!=="function"||n(T))throw new z(t,"Function",T)}),C=L((T,t)=>{if(T!==void 0)throw new z(t,"undefined",T)});function u(T,t,G0){if(!K(G0,T))throw new z(t,`('${J(G0,"|")}')`,T)}var e=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function r(T,t){if(typeof T>"u"||!F(e,T))throw new N(t,T,'must be an array or string of format "; rel=preload; as=style"')}function s(T){if(typeof T==="string")return r(T,"hints"),T;else if(Q(T)){let t=T.length,G0="";if(t===0)return G0;for(let Q0=0;Q0; rel=preload; as=style"')}q.exports={isInt32:X,isUint32:P,parseFileMode:h,validateArray:m,validateStringArray:V0,validateBooleanArray:w0,validateAbortSignalArray:S,validateBoolean:W0,validateBuffer:O,validateDictionary:U0,validateEncoding:E,validateFunction:R,validateInt32:l,validateInteger:x,validateNumber:F0,validateObject:i,validateOneOf:p,validatePlainFunction:Y,validatePort:a,validateSignalName:b,validateString:Z0,validateUint32:$0,validateUndefined:C,validateUnion:u,validateAbortSignal:K0,validateLinkHeaderValue:s}}),D1=g0(($,q)=>{q.exports=globalThis.process}),b2=g0(($,q)=>{var{SymbolAsyncIterator:Q,SymbolIterator:K,SymbolFor:J}=P0(),Z=J("nodejs.stream.destroyed"),G=J("nodejs.stream.errored"),W=J("nodejs.stream.readable"),B=J("nodejs.stream.writable"),V=J("nodejs.stream.disturbed"),U=J("nodejs.webstream.isClosedPromise"),w=J("nodejs.webstream.controllerErrorFunction");function F(y,i=!1){var U0;return!!(y&&typeof y.pipe==="function"&&typeof y.on==="function"&&(!i||typeof y.pause==="function"&&typeof y.resume==="function")&&(!y._writableState||((U0=y._readableState)===null||U0===void 0?void 0:U0.readable)!==!1)&&(!y._writableState||y._readableState))}function M(y){var i;return!!(y&&typeof y.write==="function"&&typeof y.on==="function"&&(!y._readableState||((i=y._writableState)===null||i===void 0?void 0:i.writable)!==!1))}function k(y){return!!(y&&typeof y.pipe==="function"&&y._readableState&&typeof y.on==="function"&&typeof y.write==="function")}function f(y){return y&&(y._readableState||y._writableState||typeof y.write==="function"&&typeof y.on==="function"||typeof y.pipe==="function"&&typeof y.on==="function")}function L(y){return!!(y&&!f(y)&&typeof y.pipeThrough==="function"&&typeof y.getReader==="function"&&typeof y.cancel==="function")}function D(y){return!!(y&&!f(y)&&typeof y.getWriter==="function"&&typeof y.abort==="function")}function z(y){return!!(y&&!f(y)&&typeof y.readable==="object"&&typeof y.writable==="object")}function N(y){return L(y)||D(y)||z(y)}function H(y,i){if(y==null)return!1;if(i===!0)return typeof y[Q]==="function";if(i===!1)return typeof y[K]==="function";return typeof y[Q]==="function"||typeof y[K]==="function"}function v(y){if(!f(y))return null;let{_writableState:i,_readableState:U0}=y,m=i||U0;return!!(y.destroyed||y[Z]||m!==null&&m!==void 0&&m.destroyed)}function j(y){if(!M(y))return null;if(y.writableEnded===!0)return!0;let i=y._writableState;if(i!==null&&i!==void 0&&i.errored)return!1;if(typeof(i===null||i===void 0?void 0:i.ended)!=="boolean")return null;return i.ended}function n(y,i){if(!M(y))return null;if(y.writableFinished===!0)return!0;let U0=y._writableState;if(U0!==null&&U0!==void 0&&U0.errored)return!1;if(typeof(U0===null||U0===void 0?void 0:U0.finished)!=="boolean")return null;return!!(U0.finished||i===!1&&U0.ended===!0&&U0.length===0)}function d(y){if(!F(y))return null;if(y.readableEnded===!0)return!0;let i=y._readableState;if(!i||i.errored)return!1;if(typeof(i===null||i===void 0?void 0:i.ended)!=="boolean")return null;return i.ended}function _(y,i){if(!F(y))return null;let U0=y._readableState;if(U0!==null&&U0!==void 0&&U0.errored)return!1;if(typeof(U0===null||U0===void 0?void 0:U0.endEmitted)!=="boolean")return null;return!!(U0.endEmitted||i===!1&&U0.ended===!0&&U0.length===0)}function X(y){if(y&&y[W]!=null)return y[W];if(typeof(y===null||y===void 0?void 0:y.readable)!=="boolean")return null;if(v(y))return!1;return F(y)&&y.readable&&!_(y)}function P(y){if(y&&y[B]!=null)return y[B];if(typeof(y===null||y===void 0?void 0:y.writable)!=="boolean")return null;if(v(y))return!1;return M(y)&&y.writable&&!j(y)}function g(y,i){if(!f(y))return null;if(v(y))return!0;if((i===null||i===void 0?void 0:i.readable)!==!1&&X(y))return!1;if((i===null||i===void 0?void 0:i.writable)!==!1&&P(y))return!1;return!0}function c(y){var i,U0;if(!f(y))return null;if(y.writableErrored)return y.writableErrored;return(i=(U0=y._writableState)===null||U0===void 0?void 0:U0.errored)!==null&&i!==void 0?i:null}function h(y){var i,U0;if(!f(y))return null;if(y.readableErrored)return y.readableErrored;return(i=(U0=y._readableState)===null||U0===void 0?void 0:U0.errored)!==null&&i!==void 0?i:null}function x(y){if(!f(y))return null;if(typeof y.closed==="boolean")return y.closed;let{_writableState:i,_readableState:U0}=y;if(typeof(i===null||i===void 0?void 0:i.closed)==="boolean"||typeof(U0===null||U0===void 0?void 0:U0.closed)==="boolean")return(i===null||i===void 0?void 0:i.closed)||(U0===null||U0===void 0?void 0:U0.closed);if(typeof y._closed==="boolean"&&l(y))return y._closed;return null}function l(y){return typeof y._closed==="boolean"&&typeof y._defaultKeepAlive==="boolean"&&typeof y._removedConnection==="boolean"&&typeof y._removedContLen==="boolean"}function $0(y){return typeof y._sent100==="boolean"&&l(y)}function Z0(y){var i;return typeof y._consuming==="boolean"&&typeof y._dumped==="boolean"&&((i=y.req)===null||i===void 0?void 0:i.upgradeOrConnect)===void 0}function F0(y){if(!f(y))return null;let{_writableState:i,_readableState:U0}=y,m=i||U0;return!m&&$0(y)||!!(m&&m.autoDestroy&&m.emitClose&&m.closed===!1)}function p(y){var i;return!!(y&&((i=y[V])!==null&&i!==void 0?i:y.readableDidRead||y.readableAborted))}function W0(y){var i,U0,m,V0,w0,S,b,O,E,a;return!!(y&&((i=(U0=(m=(V0=(w0=(S=y[G])!==null&&S!==void 0?S:y.readableErrored)!==null&&w0!==void 0?w0:y.writableErrored)!==null&&V0!==void 0?V0:(b=y._readableState)===null||b===void 0?void 0:b.errorEmitted)!==null&&m!==void 0?m:(O=y._writableState)===null||O===void 0?void 0:O.errorEmitted)!==null&&U0!==void 0?U0:(E=y._readableState)===null||E===void 0?void 0:E.errored)!==null&&i!==void 0?i:(a=y._writableState)===null||a===void 0?void 0:a.errored))}q.exports={isDestroyed:v,kIsDestroyed:Z,isDisturbed:p,kIsDisturbed:V,isErrored:W0,kIsErrored:G,isReadable:X,kIsReadable:W,kIsClosedPromise:U,kControllerErrorFunction:w,kIsWritable:B,isClosed:x,isDuplexNodeStream:k,isFinished:g,isIterable:H,isReadableNodeStream:F,isReadableStream:L,isReadableEnded:d,isReadableFinished:_,isReadableErrored:h,isNodeStream:f,isWebStream:N,isWritable:P,isWritableNodeStream:M,isWritableStream:D,isWritableEnded:j,isWritableFinished:n,isWritableErrored:c,isServerRequest:Z0,isServerResponse:$0,willEmitClose:F0,isTransformStream:z}}),s2=g0(($,q)=>{var Q=D1(),{AbortError:K,codes:J}=a0(),{ERR_INVALID_ARG_TYPE:Z,ERR_STREAM_PREMATURE_CLOSE:G}=J,{kEmptyObject:W,once:B}=e0(),{validateAbortSignal:V,validateFunction:U,validateObject:w,validateBoolean:F}=P6(),{Promise:M,PromisePrototypeThen:k,SymbolDispose:f}=P0(),{isClosed:L,isReadable:D,isReadableNodeStream:z,isReadableStream:N,isReadableFinished:H,isReadableErrored:v,isWritable:j,isWritableNodeStream:n,isWritableStream:d,isWritableFinished:_,isWritableErrored:X,isNodeStream:P,willEmitClose:g,kIsClosedPromise:c}=b2(),h;function x(p){return p.setHeader&&typeof p.abort==="function"}var l=()=>{};function $0(p,W0,y){var i,U0;if(arguments.length===2)y=W0,W0=W;else if(W0==null)W0=W;else w(W0,"options");if(U(y,"callback"),V(W0.signal,"options.signal"),y=B(y),N(p)||d(p))return Z0(p,W0,y);if(!P(p))throw new Z("stream",["ReadableStream","WritableStream","Stream"],p);let m=(i=W0.readable)!==null&&i!==void 0?i:z(p),V0=(U0=W0.writable)!==null&&U0!==void 0?U0:n(p),w0=p._writableState,S=p._readableState,b=()=>{if(!p.writable)a()},O=g(p)&&z(p)===m&&n(p)===V0,E=_(p,!1),a=()=>{if(E=!0,p.destroyed)O=!1;if(O&&(!p.readable||m))return;if(!m||K0)y.call(p)},K0=H(p,!1),R=()=>{if(K0=!0,p.destroyed)O=!1;if(O&&(!p.writable||V0))return;if(!V0||E)y.call(p)},Y=(T)=>{y.call(p,T)},C=L(p),u=()=>{C=!0;let T=X(p)||v(p);if(T&&typeof T!=="boolean")return y.call(p,T);if(m&&!K0&&z(p,!0)){if(!H(p,!1))return y.call(p,new G)}if(V0&&!E){if(!_(p,!1))return y.call(p,new G)}y.call(p)},e=()=>{C=!0;let T=X(p)||v(p);if(T&&typeof T!=="boolean")return y.call(p,T);y.call(p)},r=()=>{p.req.on("finish",a)};if(x(p)){if(p.on("complete",a),!O)p.on("abort",u);if(p.req)r();else p.on("request",r)}else if(V0&&!w0)p.on("end",b),p.on("close",b);if(!O&&typeof p.aborted==="boolean")p.on("aborted",u);if(p.on("end",R),p.on("finish",a),W0.error!==!1)p.on("error",Y);if(p.on("close",u),C)Q.nextTick(u);else if(w0!==null&&w0!==void 0&&w0.errorEmitted||S!==null&&S!==void 0&&S.errorEmitted){if(!O)Q.nextTick(e)}else if(!m&&(!O||D(p))&&(E||j(p)===!1))Q.nextTick(e);else if(!V0&&(!O||j(p))&&(K0||D(p)===!1))Q.nextTick(e);else if(S&&p.req&&p.aborted)Q.nextTick(e);let s=()=>{if(y=l,p.removeListener("aborted",u),p.removeListener("complete",a),p.removeListener("abort",u),p.removeListener("request",r),p.req)p.req.removeListener("finish",a);p.removeListener("end",b),p.removeListener("close",b),p.removeListener("finish",a),p.removeListener("end",R),p.removeListener("error",Y),p.removeListener("close",u)};if(W0.signal&&!C){let T=()=>{let t=y;s(),t.call(p,new K(void 0,{cause:W0.signal.reason}))};if(W0.signal.aborted)Q.nextTick(T);else{h=h||e0().addAbortListener;let t=h(W0.signal,T),G0=y;y=B((...Q0)=>{t[f](),G0.apply(p,Q0)})}}return s}function Z0(p,W0,y){let i=!1,U0=l;if(W0.signal)if(U0=()=>{i=!0,y.call(p,new K(void 0,{cause:W0.signal.reason}))},W0.signal.aborted)Q.nextTick(U0);else{h=h||e0().addAbortListener;let V0=h(W0.signal,U0),w0=y;y=B((...S)=>{V0[f](),w0.apply(p,S)})}let m=(...V0)=>{if(!i)Q.nextTick(()=>y.apply(p,V0))};return k(p[c].promise,m,m),l}function F0(p,W0){var y;let i=!1;if(W0===null)W0=W;if((y=W0)!==null&&y!==void 0&&y.cleanup)F(W0.cleanup,"cleanup"),i=W0.cleanup;return new M((U0,m)=>{let V0=$0(p,W0,(w0)=>{if(i)V0();if(w0)m(w0);else U0()})})}q.exports=$0,q.exports.finished=F0}),o1=g0(($,q)=>{var Q=D1(),{aggregateTwoErrors:K,codes:{ERR_MULTIPLE_CALLBACK:J},AbortError:Z}=a0(),{Symbol:G}=P0(),{kIsDestroyed:W,isDestroyed:B,isFinished:V,isServerRequest:U}=b2(),w=G("kDestroy"),F=G("kConstruct");function M(g,c,h){if(g){if(g.stack,c&&!c.errored)c.errored=g;if(h&&!h.errored)h.errored=g}}function k(g,c){let h=this._readableState,x=this._writableState,l=x||h;if(x!==null&&x!==void 0&&x.destroyed||h!==null&&h!==void 0&&h.destroyed){if(typeof c==="function")c();return this}if(M(g,x,h),x)x.destroyed=!0;if(h)h.destroyed=!0;if(!l.constructed)this.once(w,function($0){f(this,K($0,g),c)});else f(this,g,c);return this}function f(g,c,h){let x=!1;function l($0){if(x)return;x=!0;let{_readableState:Z0,_writableState:F0}=g;if(M($0,F0,Z0),F0)F0.closed=!0;if(Z0)Z0.closed=!0;if(typeof h==="function")h($0);if($0)Q.nextTick(L,g,$0);else Q.nextTick(D,g)}try{g._destroy(c||null,l)}catch($0){l($0)}}function L(g,c){z(g,c),D(g)}function D(g){let{_readableState:c,_writableState:h}=g;if(h)h.closeEmitted=!0;if(c)c.closeEmitted=!0;if(h!==null&&h!==void 0&&h.emitClose||c!==null&&c!==void 0&&c.emitClose)g.emit("close")}function z(g,c){let{_readableState:h,_writableState:x}=g;if(x!==null&&x!==void 0&&x.errorEmitted||h!==null&&h!==void 0&&h.errorEmitted)return;if(x)x.errorEmitted=!0;if(h)h.errorEmitted=!0;g.emit("error",c)}function N(){let g=this._readableState,c=this._writableState;if(g)g.constructed=!0,g.closed=!1,g.closeEmitted=!1,g.destroyed=!1,g.errored=null,g.errorEmitted=!1,g.reading=!1,g.ended=g.readable===!1,g.endEmitted=g.readable===!1;if(c)c.constructed=!0,c.destroyed=!1,c.closed=!1,c.closeEmitted=!1,c.errored=null,c.errorEmitted=!1,c.finalCalled=!1,c.prefinished=!1,c.ended=c.writable===!1,c.ending=c.writable===!1,c.finished=c.writable===!1}function H(g,c,h){let{_readableState:x,_writableState:l}=g;if(l!==null&&l!==void 0&&l.destroyed||x!==null&&x!==void 0&&x.destroyed)return this;if(x!==null&&x!==void 0&&x.autoDestroy||l!==null&&l!==void 0&&l.autoDestroy)g.destroy(c);else if(c){if(c.stack,l&&!l.errored)l.errored=c;if(x&&!x.errored)x.errored=c;if(h)Q.nextTick(z,g,c);else z(g,c)}}function v(g,c){if(typeof g._construct!=="function")return;let{_readableState:h,_writableState:x}=g;if(h)h.constructed=!1;if(x)x.constructed=!1;if(g.once(F,c),g.listenerCount(F)>1)return;Q.nextTick(j,g)}function j(g){let c=!1;function h(x){if(c){H(g,x!==null&&x!==void 0?x:new J);return}c=!0;let{_readableState:l,_writableState:$0}=g,Z0=$0||l;if(l)l.constructed=!0;if($0)$0.constructed=!0;if(Z0.destroyed)g.emit(w,x);else if(x)H(g,x,!0);else Q.nextTick(n,g)}try{g._construct((x)=>{Q.nextTick(h,x)})}catch(x){Q.nextTick(h,x)}}function n(g){g.emit(F)}function d(g){return(g===null||g===void 0?void 0:g.setHeader)&&typeof g.abort==="function"}function _(g){g.emit("close")}function X(g,c){g.emit("error",c),Q.nextTick(_,g)}function P(g,c){if(!g||B(g))return;if(!c&&!V(g))c=new Z;if(U(g))g.socket=null,g.destroy(c);else if(d(g))g.abort();else if(d(g.req))g.req.abort();else if(typeof g.destroy==="function")g.destroy(c);else if(typeof g.close==="function")g.close();else if(c)Q.nextTick(X,g,c);else Q.nextTick(_,g);if(!g.destroyed)g[W]=!0}q.exports={construct:v,destroyer:P,destroy:k,undestroy:N,errorOrDestroy:H}}),c5=g0(($,q)=>{var{ArrayIsArray:Q,ObjectSetPrototypeOf:K}=P0(),{EventEmitter:J}=(i1(),X0(p1));function Z(W){J.call(this,W)}K(Z.prototype,J.prototype),K(Z,J),Z.prototype.pipe=function(W,B){let V=this;function U(D){if(W.writable&&W.write(D)===!1&&V.pause)V.pause()}V.on("data",U);function w(){if(V.readable&&V.resume)V.resume()}if(W.on("drain",w),!W._isStdio&&(!B||B.end!==!1))V.on("end",M),V.on("close",k);let F=!1;function M(){if(F)return;F=!0,W.end()}function k(){if(F)return;if(F=!0,typeof W.destroy==="function")W.destroy()}function f(D){if(L(),J.listenerCount(this,"error")===0)this.emit("error",D)}G(V,"error",f),G(W,"error",f);function L(){V.removeListener("data",U),W.removeListener("drain",w),V.removeListener("end",M),V.removeListener("close",k),V.removeListener("error",f),W.removeListener("error",f),V.removeListener("end",L),V.removeListener("close",L),W.removeListener("close",L)}return V.on("end",L),V.on("close",L),W.on("close",L),W.emit("pipe",V),W};function G(W,B,V){if(typeof W.prependListener==="function")return W.prependListener(B,V);if(!W._events||!W._events[B])W.on(B,V);else if(Q(W._events[B]))W._events[B].unshift(V);else W._events[B]=[V,W._events[B]]}q.exports={Stream:Z,prependListener:G}}),L8=g0(($,q)=>{var{SymbolDispose:Q}=P0(),{AbortError:K,codes:J}=a0(),{isNodeStream:Z,isWebStream:G,kControllerErrorFunction:W}=b2(),B=s2(),{ERR_INVALID_ARG_TYPE:V}=J,U,w=(F,M)=>{if(typeof F!=="object"||!("aborted"in F))throw new V(M,"AbortSignal",F)};q.exports.addAbortSignal=function(F,M){if(w(F,"signal"),!Z(M)&&!G(M))throw new V("stream",["ReadableStream","WritableStream","Stream"],M);return q.exports.addAbortSignalNoValidate(F,M)},q.exports.addAbortSignalNoValidate=function(F,M){if(typeof F!=="object"||!("aborted"in F))return M;let k=Z(M)?()=>{M.destroy(new K(void 0,{cause:F.reason}))}:()=>{M[W](new K(void 0,{cause:F.reason}))};if(F.aborted)k();else{U=U||e0().addAbortListener;let f=U(F,k);B(M,f[Q])}return M}}),gV=g0(($,q)=>{var{StringPrototypeSlice:Q,SymbolIterator:K,TypedArrayPrototypeSet:J,Uint8Array:Z}=P0(),{Buffer:G}=(t0(),X0(K2)),{inspect:W}=e0();q.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(B){let V={data:B,next:null};if(this.length>0)this.tail.next=V;else this.head=V;this.tail=V,++this.length}unshift(B){let V={data:B,next:this.head};if(this.length===0)this.tail=V;this.head=V,++this.length}shift(){if(this.length===0)return;let B=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,B}clear(){this.head=this.tail=null,this.length=0}join(B){if(this.length===0)return"";let V=this.head,U=""+V.data;while((V=V.next)!==null)U+=B+V.data;return U}concat(B){if(this.length===0)return G.alloc(0);let V=G.allocUnsafe(B>>>0),U=this.head,w=0;while(U)J(V,U.data,w),w+=U.data.length,U=U.next;return V}consume(B,V){let U=this.head.data;if(BF.length)V+=F,B-=F.length;else{if(B===F.length)if(V+=F,++w,U.next)this.head=U.next;else this.head=this.tail=null;else V+=Q(F,0,B),this.head=U,U.data=Q(F,B);break}++w}while((U=U.next)!==null);return this.length-=w,V}_getBuffer(B){let V=G.allocUnsafe(B),U=B,w=this.head,F=0;do{let M=w.data;if(B>M.length)J(V,M,U-B),B-=M.length;else{if(B===M.length)if(J(V,M,U-B),++F,w.next)this.head=w.next;else this.head=this.tail=null;else J(V,new Z(M.buffer,M.byteOffset,B),U-B),this.head=w,w.data=M.slice(B);break}++F}while((w=w.next)!==null);return this.length-=F,V}[Symbol.for("nodejs.util.inspect.custom")](B,V){return W(this,{...V,depth:0,customInspect:!1})}}}),H8=g0(($,q)=>{var{MathFloor:Q,NumberIsInteger:K}=P0(),{validateInteger:J}=P6(),{ERR_INVALID_ARG_VALUE:Z}=a0().codes,G=16384,W=16;function B(F,M,k){return F.highWaterMark!=null?F.highWaterMark:M?F[k]:null}function V(F){return F?W:G}function U(F,M){if(J(M,"value",0),F)W=M;else G=M}function w(F,M,k,f){let L=B(M,f,k);if(L!=null){if(!K(L)||L<0){let D=f?`options.${k}`:"options.highWaterMark";throw new Z(D,L)}return Q(L)}return V(F.objectMode)}q.exports={getHighWaterMark:w,getDefaultHighWaterMark:V,setDefaultHighWaterMark:U}}),AV=g0(($,q)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh */var Q=(t0(),X0(K2)),K=Q.Buffer;function J(G,W){for(var B in G)W[B]=G[B]}if(K.from&&K.alloc&&K.allocUnsafe&&K.allocUnsafeSlow)q.exports=Q;else J(Q,$),$.Buffer=Z;function Z(G,W,B){return K(G,W,B)}Z.prototype=Object.create(K.prototype),J(K,Z),Z.from=function(G,W,B){if(typeof G==="number")throw TypeError("Argument must not be a number");return K(G,W,B)},Z.alloc=function(G,W,B){if(typeof G!=="number")throw TypeError("Argument must be a number");var V=K(G);if(W!==void 0)if(typeof B==="string")V.fill(W,B);else V.fill(W);else V.fill(0);return V},Z.allocUnsafe=function(G){if(typeof G!=="number")throw TypeError("Argument must be a number");return K(G)},Z.allocUnsafeSlow=function(G){if(typeof G!=="number")throw TypeError("Argument must be a number");return Q.SlowBuffer(G)}}),XV=g0(($)=>{var q=AV().Buffer,Q=q.isEncoding||function(z){switch(z=""+z,z&&z.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function K(z){if(!z)return"utf8";var N;while(!0)switch(z){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return z;default:if(N)return;z=(""+z).toLowerCase(),N=!0}}function J(z){var N=K(z);if(typeof N!=="string"&&(q.isEncoding===Q||!Q(z)))throw Error("Unknown encoding: "+z);return N||z}$.StringDecoder=Z;function Z(z){this.encoding=J(z);var N;switch(this.encoding){case"utf16le":this.text=F,this.end=M,N=4;break;case"utf8":this.fillLast=V,N=4;break;case"base64":this.text=k,this.end=f,N=3;break;default:this.write=L,this.end=D;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=q.allocUnsafe(N)}Z.prototype.write=function(z){if(z.length===0)return"";var N,H;if(this.lastNeed){if(N=this.fillLast(z),N===void 0)return"";H=this.lastNeed,this.lastNeed=0}else H=0;if(H>5===6)return 2;else if(z>>4===14)return 3;else if(z>>3===30)return 4;return z>>6===2?-1:-2}function W(z,N,H){var v=N.length-1;if(v=0){if(j>0)z.lastNeed=j-1;return j}if(--v=0){if(j>0)z.lastNeed=j-2;return j}if(--v=0){if(j>0)if(j===2)j=0;else z.lastNeed=j-3;return j}return 0}function B(z,N,H){if((N[0]&192)!==128)return z.lastNeed=0,"�";if(z.lastNeed>1&&N.length>1){if((N[1]&192)!==128)return z.lastNeed=1,"�";if(z.lastNeed>2&&N.length>2){if((N[2]&192)!==128)return z.lastNeed=2,"�"}}}function V(z){var N=this.lastTotal-this.lastNeed,H=B(this,z,N);if(H!==void 0)return H;if(this.lastNeed<=z.length)return z.copy(this.lastChar,N,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);z.copy(this.lastChar,N,0,z.length),this.lastNeed-=z.length}function U(z,N){var H=W(this,z,N);if(!this.lastNeed)return z.toString("utf8",N);this.lastTotal=H;var v=z.length-(H-this.lastNeed);return z.copy(this.lastChar,0,v),z.toString("utf8",N,v)}function w(z){var N=z&&z.length?this.write(z):"";if(this.lastNeed)return N+"�";return N}function F(z,N){if((z.length-N)%2===0){var H=z.toString("utf16le",N);if(H){var v=H.charCodeAt(H.length-1);if(v>=55296&&v<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=z[z.length-2],this.lastChar[1]=z[z.length-1],H.slice(0,-1)}return H}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=z[z.length-1],z.toString("utf16le",N,z.length-1)}function M(z){var N=z&&z.length?this.write(z):"";if(this.lastNeed){var H=this.lastTotal-this.lastNeed;return N+this.lastChar.toString("utf16le",0,H)}return N}function k(z,N){var H=(z.length-N)%3;if(H===0)return z.toString("base64",N);if(this.lastNeed=3-H,this.lastTotal=3,H===1)this.lastChar[0]=z[z.length-1];else this.lastChar[0]=z[z.length-2],this.lastChar[1]=z[z.length-1];return z.toString("base64",N,z.length-H)}function f(z){var N=z&&z.length?this.write(z):"";if(this.lastNeed)return N+this.lastChar.toString("base64",0,3-this.lastNeed);return N}function L(z){return z.toString(this.encoding)}function D(z){return z&&z.length?this.write(z):""}}),a9=g0(($,q)=>{var Q=D1(),{PromisePrototypeThen:K,SymbolAsyncIterator:J,SymbolIterator:Z}=P0(),{Buffer:G}=(t0(),X0(K2)),{ERR_INVALID_ARG_TYPE:W,ERR_STREAM_NULL_VALUES:B}=a0().codes;function V(U,w,F){let M;if(typeof w==="string"||w instanceof G)return new U({objectMode:!0,...F,read(){this.push(w),this.push(null)}});let k;if(w&&w[J])k=!0,M=w[J]();else if(w&&w[Z])k=!1,M=w[Z]();else throw new W("iterable",["Iterable"],w);let f=new U({objectMode:!0,highWaterMark:1,...F}),L=!1;f._read=function(){if(!L)L=!0,z()},f._destroy=function(N,H){K(D(N),()=>Q.nextTick(H,N),(v)=>Q.nextTick(H,v||N))};async function D(N){let H=N!==void 0&&N!==null,v=typeof M.throw==="function";if(H&&v){let{value:j,done:n}=await M.throw(N);if(await j,n)return}if(typeof M.return==="function"){let{value:j}=await M.return();await j}}async function z(){for(;;){try{let{value:N,done:H}=k?await M.next():M.next();if(H)f.push(null);else{let v=N&&typeof N.then==="function"?await N:N;if(v===null)throw L=!1,new B;else if(f.push(v))continue;else L=!1}}catch(N){f.destroy(N)}break}}return f}q.exports=V}),v8=g0(($,q)=>{var Q=D1(),{ArrayPrototypeIndexOf:K,NumberIsInteger:J,NumberIsNaN:Z,NumberParseInt:G,ObjectDefineProperties:W,ObjectKeys:B,ObjectSetPrototypeOf:V,Promise:U,SafeSet:w,SymbolAsyncDispose:F,SymbolAsyncIterator:M,Symbol:k}=P0();q.exports=Q0,Q0.ReadableState=G0;var{EventEmitter:f}=(i1(),X0(p1)),{Stream:L,prependListener:D}=c5(),{Buffer:z}=(t0(),X0(K2)),{addAbortSignal:N}=L8(),H=s2(),v=e0().debuglog("stream",(I)=>{v=I}),j=gV(),n=o1(),{getHighWaterMark:d,getDefaultHighWaterMark:_}=H8(),{aggregateTwoErrors:X,codes:{ERR_INVALID_ARG_TYPE:P,ERR_METHOD_NOT_IMPLEMENTED:g,ERR_OUT_OF_RANGE:c,ERR_STREAM_PUSH_AFTER_EOF:h,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:x},AbortError:l}=a0(),{validateObject:$0}=P6(),Z0=k("kPaused"),{StringDecoder:F0}=XV(),p=a9();V(Q0.prototype,L.prototype),V(Q0,L);var W0=()=>{},{errorOrDestroy:y}=n,i=1,U0=2,m=4,V0=8,w0=16,S=32,b=64,O=128,E=256,a=512,K0=1024,R=2048,Y=4096,C=8192,u=16384,e=32768,r=65536,s=131072,T=262144;function t(I){return{enumerable:!1,get(){return(this.state&I)!==0},set(A){if(A)this.state|=I;else this.state&=~I}}}W(G0.prototype,{objectMode:t(i),ended:t(U0),endEmitted:t(m),reading:t(V0),constructed:t(w0),sync:t(S),needReadable:t(b),emittedReadable:t(O),readableListening:t(E),resumeScheduled:t(a),errorEmitted:t(K0),emitClose:t(R),autoDestroy:t(Y),destroyed:t(C),closed:t(u),closeEmitted:t(e),multiAwaitDrain:t(r),readingMore:t(s),dataEmitted:t(T)});function G0(I,A,J0){if(typeof J0!=="boolean")J0=A instanceof c2();if(this.state=R|Y|w0|S,I&&I.objectMode)this.state|=i;if(J0&&I&&I.readableObjectMode)this.state|=i;if(this.highWaterMark=I?d(this,I,"readableHighWaterMark",J0):_(!1),this.buffer=new j,this.length=0,this.pipes=[],this.flowing=null,this[Z0]=null,I&&I.emitClose===!1)this.state&=~R;if(I&&I.autoDestroy===!1)this.state&=~Y;if(this.errored=null,this.defaultEncoding=I&&I.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,I&&I.encoding)this.decoder=new F0(I.encoding),this.encoding=I.encoding}function Q0(I){if(!(this instanceof Q0))return new Q0(I);let A=this instanceof c2();if(this._readableState=new G0(I,this,A),I){if(typeof I.read==="function")this._read=I.read;if(typeof I.destroy==="function")this._destroy=I.destroy;if(typeof I.construct==="function")this._construct=I.construct;if(I.signal&&!A)N(I.signal,this)}L.call(this,I),n.construct(this,()=>{if(this._readableState.needReadable)_1(this,this._readableState)})}Q0.prototype.destroy=n.destroy,Q0.prototype._undestroy=n.undestroy,Q0.prototype._destroy=function(I,A){A(I)},Q0.prototype[f.captureRejectionSymbol]=function(I){this.destroy(I)},Q0.prototype[F]=function(){let I;if(!this.destroyed)I=this.readableEnded?null:new l,this.destroy(I);return new U((A,J0)=>H(this,(B0)=>B0&&B0!==I?J0(B0):A(null)))},Q0.prototype.push=function(I,A){return M0(this,I,A,!1)},Q0.prototype.unshift=function(I,A){return M0(this,I,A,!0)};function M0(I,A,J0,B0){v("readableAddChunk",A);let z0=I._readableState,i0;if((z0.state&i)===0){if(typeof A==="string"){if(J0=J0||z0.defaultEncoding,z0.encoding!==J0)if(B0&&z0.encoding)A=z.from(A,J0).toString(z0.encoding);else A=z.from(A,J0),J0=""}else if(A instanceof z)J0="";else if(L._isUint8Array(A))A=L._uint8ArrayToBuffer(A),J0="";else if(A!=null)i0=new P("chunk",["string","Buffer","Uint8Array"],A)}if(i0)y(I,i0);else if(A===null)z0.state&=~V0,O0(I,z0);else if((z0.state&i)!==0||A&&A.length>0)if(B0)if((z0.state&m)!==0)y(I,new x);else if(z0.destroyed||z0.errored)return!1;else I0(I,z0,A,!0);else if(z0.ended)y(I,new h);else if(z0.destroyed||z0.errored)return!1;else if(z0.state&=~V0,z0.decoder&&!J0)if(A=z0.decoder.write(A),z0.objectMode||A.length!==0)I0(I,z0,A,!1);else _1(I,z0);else I0(I,z0,A,!1);else if(!B0)z0.state&=~V0,_1(I,z0);return!z0.ended&&(z0.length0){if((A.state&r)!==0)A.awaitDrainWriters.clear();else A.awaitDrainWriters=null;A.dataEmitted=!0,I.emit("data",J0)}else{if(A.length+=A.objectMode?1:J0.length,B0)A.buffer.unshift(J0);else A.buffer.push(J0);if((A.state&b)!==0)u0(I)}_1(I,A)}Q0.prototype.isPaused=function(){let I=this._readableState;return I[Z0]===!0||I.flowing===!1},Q0.prototype.setEncoding=function(I){let A=new F0(I);this._readableState.decoder=A,this._readableState.encoding=this._readableState.decoder.encoding;let J0=this._readableState.buffer,B0="";for(let z0 of J0)B0+=A.write(z0);if(J0.clear(),B0!=="")J0.push(B0);return this._readableState.length=B0.length,this};var m0=1073741824;function p0(I){if(I>m0)throw new c("size","<= 1GiB",I);else I--,I|=I>>>1,I|=I>>>2,I|=I>>>4,I|=I>>>8,I|=I>>>16,I++;return I}function q2(I,A){if(I<=0||A.length===0&&A.ended)return 0;if((A.state&i)!==0)return 1;if(Z(I)){if(A.flowing&&A.length)return A.buffer.first().length;return A.length}if(I<=A.length)return I;return A.ended?A.length:0}Q0.prototype.read=function(I){if(v("read",I),I===void 0)I=NaN;else if(!J(I))I=G(I,10);let A=this._readableState,J0=I;if(I>A.highWaterMark)A.highWaterMark=p0(I);if(I!==0)A.state&=~O;if(I===0&&A.needReadable&&((A.highWaterMark!==0?A.length>=A.highWaterMark:A.length>0)||A.ended)){if(v("read: emitReadable",A.length,A.ended),A.length===0&&A.ended)v5(this);else u0(this);return null}if(I=q2(I,A),I===0&&A.ended){if(A.length===0)v5(this);return null}let B0=(A.state&b)!==0;if(v("need readable",B0),A.length===0||A.length-I0)z0=a7(I,A);else z0=null;if(z0===null)A.needReadable=A.length<=A.highWaterMark,I=0;else if(A.length-=I,A.multiAwaitDrain)A.awaitDrainWriters.clear();else A.awaitDrainWriters=null;if(A.length===0){if(!A.ended)A.needReadable=!0;if(J0!==I&&A.ended)v5(this)}if(z0!==null&&!A.errorEmitted&&!A.closeEmitted)A.dataEmitted=!0,this.emit("data",z0);return z0};function O0(I,A){if(v("onEofChunk"),A.ended)return;if(A.decoder){let J0=A.decoder.end();if(J0&&J0.length)A.buffer.push(J0),A.length+=A.objectMode?1:J0.length}if(A.ended=!0,A.sync)u0(I);else A.needReadable=!1,A.emittedReadable=!0,E1(I)}function u0(I){let A=I._readableState;if(v("emitReadable",A.needReadable,A.emittedReadable),A.needReadable=!1,!A.emittedReadable)v("emitReadable",A.flowing),A.emittedReadable=!0,Q.nextTick(E1,I)}function E1(I){let A=I._readableState;if(v("emitReadable_",A.destroyed,A.length,A.ended),!A.destroyed&&!A.errored&&(A.length||A.ended))I.emit("readable"),A.emittedReadable=!1;A.needReadable=!A.flowing&&!A.ended&&A.length<=A.highWaterMark,i7(I)}function _1(I,A){if(!A.readingMore&&A.constructed)A.readingMore=!0,Q.nextTick(R2,I,A)}function R2(I,A){while(!A.reading&&!A.ended&&(A.length1&&B0.pipes.includes(I))v("false write response, pause",B0.awaitDrainWriters.size),B0.awaitDrainWriters.add(I);J0.pause()}if(!z1)z1=wJ(J0,I),I.on("drain",z1)}J0.on("data",t7);function t7(F1){v("ondata");let u2=I.write(F1);if(v("dest.write",u2),u2===!1)s7()}function R5(F1){if(v("onerror",F1),A6(),I.removeListener("error",R5),I.listenerCount("error")===0){let u2=I._writableState||I._readableState;if(u2&&!u2.errorEmitted)y(I,F1);else I.emit("error",F1)}}D(I,"error",R5);function I5(){I.removeListener("finish",C5),A6()}I.once("close",I5);function C5(){v("onfinish"),I.removeListener("close",I5),A6()}I.once("finish",C5);function A6(){v("unpipe"),J0.unpipe(I)}if(I.emit("pipe",J0),I.writableNeedDrain===!0)s7();else if(!B0.flowing)v("pipe resume"),J0.resume();return I};function wJ(I,A){return function(){let J0=I._readableState;if(J0.awaitDrainWriters===A)v("pipeOnDrain",1),J0.awaitDrainWriters=null;else if(J0.multiAwaitDrain)v("pipeOnDrain",J0.awaitDrainWriters.size),J0.awaitDrainWriters.delete(A);if((!J0.awaitDrainWriters||J0.awaitDrainWriters.size===0)&&I.listenerCount("data"))I.resume()}}Q0.prototype.unpipe=function(I){let A=this._readableState,J0={hasUnpiped:!1};if(A.pipes.length===0)return this;if(!I){let z0=A.pipes;A.pipes=[],this.pause();for(let i0=0;i00,B0.flowing!==!1)this.resume()}else if(I==="readable"){if(!B0.endEmitted&&!B0.readableListening){if(B0.readableListening=B0.needReadable=!0,B0.flowing=!1,B0.emittedReadable=!1,v("on readable",B0.length,B0.reading),B0.length)u0(this);else if(!B0.reading)Q.nextTick(NJ,this)}}return J0},Q0.prototype.addListener=Q0.prototype.on,Q0.prototype.removeListener=function(I,A){let J0=L.prototype.removeListener.call(this,I,A);if(I==="readable")Q.nextTick(p7,this);return J0},Q0.prototype.off=Q0.prototype.removeListener,Q0.prototype.removeAllListeners=function(I){let A=L.prototype.removeAllListeners.apply(this,arguments);if(I==="readable"||I===void 0)Q.nextTick(p7,this);return A};function p7(I){let A=I._readableState;if(A.readableListening=I.listenerCount("readable")>0,A.resumeScheduled&&A[Z0]===!1)A.flowing=!0;else if(I.listenerCount("data")>0)I.resume();else if(!A.readableListening)A.flowing=null}function NJ(I){v("readable nexttick read 0"),I.read(0)}Q0.prototype.resume=function(){let I=this._readableState;if(!I.flowing)v("resume"),I.flowing=!I.readableListening,YJ(this,I);return I[Z0]=!1,this};function YJ(I,A){if(!A.resumeScheduled)A.resumeScheduled=!0,Q.nextTick(kJ,I,A)}function kJ(I,A){if(v("resume",A.reading),!A.reading)I.read(0);if(A.resumeScheduled=!1,I.emit("resume"),i7(I),A.flowing&&!A.reading)I.read(0)}Q0.prototype.pause=function(){if(v("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)v("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState[Z0]=!0,this};function i7(I){let A=I._readableState;v("flow",A.flowing);while(A.flowing&&I.read()!==null);}Q0.prototype.wrap=function(I){let A=!1;I.on("data",(B0)=>{if(!this.push(B0)&&I.pause)A=!0,I.pause()}),I.on("end",()=>{this.push(null)}),I.on("error",(B0)=>{y(this,B0)}),I.on("close",()=>{this.destroy()}),I.on("destroy",()=>{this.destroy()}),this._read=()=>{if(A&&I.resume)A=!1,I.resume()};let J0=B(I);for(let B0=1;B0{z0=z2?X(z0,z2):null,J0(),J0=W0});try{while(!0){let z2=I.destroyed?null:I.read();if(z2!==null)yield z2;else if(z0)throw z0;else if(z0===null)return;else await new U(B0)}}catch(z2){throw z0=X(z0,z2),z0}finally{if((z0||(A===null||A===void 0?void 0:A.destroyOnReturn)!==!1)&&(z0===void 0||I._readableState.autoDestroy))n.destroyer(I,null);else I.off("readable",B0),i0()}}W(Q0.prototype,{readable:{__proto__:null,get(){let I=this._readableState;return!!I&&I.readable!==!1&&!I.destroyed&&!I.errorEmitted&&!I.endEmitted},set(I){if(this._readableState)this._readableState.readable=!!I}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(I){if(this._readableState)this._readableState.flowing=I}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(I){if(!this._readableState)return;this._readableState.destroyed=I}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),W(G0.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Z0]!==!1},set(I){this[Z0]=!!I}}}),Q0._fromList=a7;function a7(I,A){if(A.length===0)return null;let J0;if(A.objectMode)J0=A.buffer.shift();else if(!I||I>=A.length){if(A.decoder)J0=A.buffer.join("");else if(A.buffer.length===1)J0=A.buffer.first();else J0=A.buffer.concat(A.length);A.buffer.clear()}else J0=A.buffer.consume(I,A.decoder);return J0}function v5(I){let A=I._readableState;if(v("endReadable",A.endEmitted),!A.endEmitted)A.ended=!0,Q.nextTick(LJ,A,I)}function LJ(I,A){if(v("endReadableNT",I.endEmitted,I.length),!I.errored&&!I.closeEmitted&&!I.endEmitted&&I.length===0){if(I.endEmitted=!0,A.emit("end"),A.writable&&A.allowHalfOpen===!1)Q.nextTick(HJ,A);else if(I.autoDestroy){let J0=A._writableState;if(!J0||J0.autoDestroy&&(J0.finished||J0.writable===!1))A.destroy()}}}function HJ(I){if(I.writable&&!I.writableEnded&&!I.destroyed)I.end()}Q0.from=function(I,A){return p(Q0,I,A)};var f5;function l7(){if(f5===void 0)f5={};return f5}Q0.fromWeb=function(I,A){return l7().newStreamReadableFromReadableStream(I,A)},Q0.toWeb=function(I,A){return l7().newReadableStreamFromStreamReadable(I,A)},Q0.wrap=function(I,A){var J0,B0;return new Q0({objectMode:(J0=(B0=I.readableObjectMode)!==null&&B0!==void 0?B0:I.objectMode)!==null&&J0!==void 0?J0:!0,...A,destroy(z0,i0){n.destroyer(I,z0),i0(z0)}}).wrap(I)}}),b5=g0(($,q)=>{var Q=D1(),{ArrayPrototypeSlice:K,Error:J,FunctionPrototypeSymbolHasInstance:Z,ObjectDefineProperty:G,ObjectDefineProperties:W,ObjectSetPrototypeOf:B,StringPrototypeToLowerCase:V,Symbol:U,SymbolHasInstance:w}=P0();q.exports=$0,$0.WritableState=x;var{EventEmitter:F}=(i1(),X0(p1)),M=c5().Stream,{Buffer:k}=(t0(),X0(K2)),f=o1(),{addAbortSignal:L}=L8(),{getHighWaterMark:D,getDefaultHighWaterMark:z}=H8(),{ERR_INVALID_ARG_TYPE:N,ERR_METHOD_NOT_IMPLEMENTED:H,ERR_MULTIPLE_CALLBACK:v,ERR_STREAM_CANNOT_PIPE:j,ERR_STREAM_DESTROYED:n,ERR_STREAM_ALREADY_FINISHED:d,ERR_STREAM_NULL_VALUES:_,ERR_STREAM_WRITE_AFTER_END:X,ERR_UNKNOWN_ENCODING:P}=a0().codes,{errorOrDestroy:g}=f;B($0.prototype,M.prototype),B($0,M);function c(){}var h=U("kOnFinished");function x(Y,C,u){if(typeof u!=="boolean")u=C instanceof c2();if(this.objectMode=!!(Y&&Y.objectMode),u)this.objectMode=this.objectMode||!!(Y&&Y.writableObjectMode);this.highWaterMark=Y?D(this,Y,"writableHighWaterMark",u):z(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let e=!!(Y&&Y.decodeStrings===!1);this.decodeStrings=!e,this.defaultEncoding=Y&&Y.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=y.bind(void 0,C),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,l(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!Y||Y.emitClose!==!1,this.autoDestroy=!Y||Y.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[h]=[]}function l(Y){Y.buffered=[],Y.bufferedIndex=0,Y.allBuffers=!0,Y.allNoop=!0}x.prototype.getBuffer=function(){return K(this.buffered,this.bufferedIndex)},G(x.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function $0(Y){let C=this instanceof c2();if(!C&&!Z($0,this))return new $0(Y);if(this._writableState=new x(Y,this,C),Y){if(typeof Y.write==="function")this._write=Y.write;if(typeof Y.writev==="function")this._writev=Y.writev;if(typeof Y.destroy==="function")this._destroy=Y.destroy;if(typeof Y.final==="function")this._final=Y.final;if(typeof Y.construct==="function")this._construct=Y.construct;if(Y.signal)L(Y.signal,this)}M.call(this,Y),f.construct(this,()=>{let u=this._writableState;if(!u.writing)V0(this,u);O(this,u)})}G($0,w,{__proto__:null,value:function(Y){if(Z(this,Y))return!0;if(this!==$0)return!1;return Y&&Y._writableState instanceof x}}),$0.prototype.pipe=function(){g(this,new j)};function Z0(Y,C,u,e){let r=Y._writableState;if(typeof u==="function")e=u,u=r.defaultEncoding;else{if(!u)u=r.defaultEncoding;else if(u!=="buffer"&&!k.isEncoding(u))throw new P(u);if(typeof e!=="function")e=c}if(C===null)throw new _;else if(!r.objectMode)if(typeof C==="string"){if(r.decodeStrings!==!1)C=k.from(C,u),u="buffer"}else if(C instanceof k)u="buffer";else if(M._isUint8Array(C))C=M._uint8ArrayToBuffer(C),u="buffer";else throw new N("chunk",["string","Buffer","Uint8Array"],C);let s;if(r.ending)s=new X;else if(r.destroyed)s=new n("write");if(s)return Q.nextTick(e,s),g(Y,s,!0),s;return r.pendingcb++,F0(Y,r,C,u,e)}$0.prototype.write=function(Y,C,u){return Z0(this,Y,C,u)===!0},$0.prototype.cork=function(){this._writableState.corked++},$0.prototype.uncork=function(){let Y=this._writableState;if(Y.corked){if(Y.corked--,!Y.writing)V0(this,Y)}},$0.prototype.setDefaultEncoding=function(Y){if(typeof Y==="string")Y=V(Y);if(!k.isEncoding(Y))throw new P(Y);return this._writableState.defaultEncoding=Y,this};function F0(Y,C,u,e,r){let s=C.objectMode?1:u.length;C.length+=s;let T=C.lengthu.bufferedIndex)V0(Y,u);if(e)if(u.afterWriteTickInfo!==null&&u.afterWriteTickInfo.cb===r)u.afterWriteTickInfo.count++;else u.afterWriteTickInfo={count:1,cb:r,stream:Y,state:u},Q.nextTick(i,u.afterWriteTickInfo);else U0(Y,u,1,r)}}function i({stream:Y,state:C,count:u,cb:e}){return C.afterWriteTickInfo=null,U0(Y,C,u,e)}function U0(Y,C,u,e){if(!C.ending&&!Y.destroyed&&C.length===0&&C.needDrain)C.needDrain=!1,Y.emit("drain");while(u-- >0)C.pendingcb--,e();if(C.destroyed)m(C);O(Y,C)}function m(Y){if(Y.writing)return;for(let r=Y.bufferedIndex;r1&&Y._writev){C.pendingcb-=s-1;let t=C.allNoop?c:(Q0)=>{for(let M0=T;M0256)u.splice(0,T),C.bufferedIndex=0;else C.bufferedIndex=T}C.bufferProcessing=!1}$0.prototype._write=function(Y,C,u){if(this._writev)this._writev([{chunk:Y,encoding:C}],u);else throw new H("_write()")},$0.prototype._writev=null,$0.prototype.end=function(Y,C,u){let e=this._writableState;if(typeof Y==="function")u=Y,Y=null,C=null;else if(typeof C==="function")u=C,C=null;let r;if(Y!==null&&Y!==void 0){let s=Z0(this,Y,C);if(s instanceof J)r=s}if(e.corked)e.corked=1,this.uncork();if(r);else if(!e.errored&&!e.ending)e.ending=!0,O(this,e,!0),e.ended=!0;else if(e.finished)r=new d("end");else if(e.destroyed)r=new n("end");if(typeof u==="function")if(r||e.finished)Q.nextTick(u,r);else e[h].push(u);return this};function w0(Y){return Y.ending&&!Y.destroyed&&Y.constructed&&Y.length===0&&!Y.errored&&Y.buffered.length===0&&!Y.finished&&!Y.writing&&!Y.errorEmitted&&!Y.closeEmitted}function S(Y,C){let u=!1;function e(r){if(u){g(Y,r!==null&&r!==void 0?r:v());return}if(u=!0,C.pendingcb--,r){let s=C[h].splice(0);for(let T=0;T{if(w0(r))E(e,r);else r.pendingcb--},Y,C);else if(w0(C))C.pendingcb++,E(Y,C)}}}function E(Y,C){C.pendingcb--,C.finished=!0;let u=C[h].splice(0);for(let e=0;e{var Q=D1(),K=(t0(),X0(K2)),{isReadable:J,isWritable:Z,isIterable:G,isNodeStream:W,isReadableNodeStream:B,isWritableNodeStream:V,isDuplexNodeStream:U,isReadableStream:w,isWritableStream:F}=b2(),M=s2(),{AbortError:k,codes:{ERR_INVALID_ARG_TYPE:f,ERR_INVALID_RETURN_VALUE:L}}=a0(),{destroyer:D}=o1(),z=c2(),N=v8(),H=b5(),{createDeferredPromise:v}=e0(),j=a9(),n=globalThis.Blob||K.Blob,d=typeof n<"u"?function(h){return h instanceof n}:function(h){return!1},_=globalThis.AbortController||O6().AbortController,{FunctionPrototypeCall:X}=P0();class P extends z{constructor(h){super(h);if((h===null||h===void 0?void 0:h.readable)===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if((h===null||h===void 0?void 0:h.writable)===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}}q.exports=function h(x,l){if(U(x))return x;if(B(x))return c({readable:x});if(V(x))return c({writable:x});if(W(x))return c({writable:!1,readable:!1});if(w(x))return c({readable:N.fromWeb(x)});if(F(x))return c({writable:H.fromWeb(x)});if(typeof x==="function"){let{value:Z0,write:F0,final:p,destroy:W0}=g(x);if(G(Z0))return j(P,Z0,{objectMode:!0,write:F0,final:p,destroy:W0});let y=Z0===null||Z0===void 0?void 0:Z0.then;if(typeof y==="function"){let i,U0=X(y,Z0,(m)=>{if(m!=null)throw new L("nully","body",m)},(m)=>{D(i,m)});return i=new P({objectMode:!0,readable:!1,write:F0,final(m){p(async()=>{try{await U0,Q.nextTick(m,null)}catch(V0){Q.nextTick(m,V0)}})},destroy:W0})}throw new L("Iterable, AsyncIterable or AsyncFunction",l,Z0)}if(d(x))return h(x.arrayBuffer());if(G(x))return j(P,x,{objectMode:!0,writable:!1});if(w(x===null||x===void 0?void 0:x.readable)&&F(x===null||x===void 0?void 0:x.writable))return P.fromWeb(x);if(typeof(x===null||x===void 0?void 0:x.writable)==="object"||typeof(x===null||x===void 0?void 0:x.readable)==="object"){let Z0=x!==null&&x!==void 0&&x.readable?B(x===null||x===void 0?void 0:x.readable)?x===null||x===void 0?void 0:x.readable:h(x.readable):void 0,F0=x!==null&&x!==void 0&&x.writable?V(x===null||x===void 0?void 0:x.writable)?x===null||x===void 0?void 0:x.writable:h(x.writable):void 0;return c({readable:Z0,writable:F0})}let $0=x===null||x===void 0?void 0:x.then;if(typeof $0==="function"){let Z0;return X($0,x,(F0)=>{if(F0!=null)Z0.push(F0);Z0.push(null)},(F0)=>{D(Z0,F0)}),Z0=new P({objectMode:!0,writable:!1,read(){}})}throw new f(l,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],x)};function g(h){let{promise:x,resolve:l}=v(),$0=new _,Z0=$0.signal;return{value:h(async function*(){while(!0){let F0=x;x=null;let{chunk:p,done:W0,cb:y}=await F0;if(Q.nextTick(y),W0)return;if(Z0.aborted)throw new k(void 0,{cause:Z0.reason});({promise:x,resolve:l}=v()),yield p}}(),{signal:Z0}),write(F0,p,W0){let y=l;l=null,y({chunk:F0,done:!1,cb:W0})},final(F0){let p=l;l=null,p({done:!0,cb:F0})},destroy(F0,p){$0.abort(),p(F0)}}}function c(h){let x=h.readable&&typeof h.readable.read!=="function"?N.wrap(h.readable):h.readable,l=h.writable,$0=!!J(x),Z0=!!Z(l),F0,p,W0,y,i;function U0(m){let V0=y;if(y=null,V0)V0(m);else if(m)i.destroy(m)}if(i=new P({readableObjectMode:!!(x!==null&&x!==void 0&&x.readableObjectMode),writableObjectMode:!!(l!==null&&l!==void 0&&l.writableObjectMode),readable:$0,writable:Z0}),Z0)M(l,(m)=>{if(Z0=!1,m)D(x,m);U0(m)}),i._write=function(m,V0,w0){if(l.write(m,V0))w0();else F0=w0},i._final=function(m){l.end(),p=m},l.on("drain",function(){if(F0){let m=F0;F0=null,m()}}),l.on("finish",function(){if(p){let m=p;p=null,m()}});if($0)M(x,(m)=>{if($0=!1,m)D(x,m);U0(m)}),x.on("readable",function(){if(W0){let m=W0;W0=null,m()}}),x.on("end",function(){i.push(null)}),i._read=function(){while(!0){let m=x.read();if(m===null){W0=i._read;return}if(!i.push(m))return}};return i._destroy=function(m,V0){if(!m&&y!==null)m=new k;if(W0=null,F0=null,p=null,y===null)V0(m);else y=V0,D(l,m),D(x,m)},i}}),c2=g0(($,q)=>{var{ObjectDefineProperties:Q,ObjectGetOwnPropertyDescriptor:K,ObjectKeys:J,ObjectSetPrototypeOf:Z}=P0();q.exports=B;var G=v8(),W=b5();Z(B.prototype,G.prototype),Z(B,G);{let F=J(W.prototype);for(let M=0;M{var{ObjectSetPrototypeOf:Q,Symbol:K}=P0();q.exports=B;var{ERR_METHOD_NOT_IMPLEMENTED:J}=a0().codes,Z=c2(),{getHighWaterMark:G}=H8();Q(B.prototype,Z.prototype),Q(B,Z);var W=K("kCallback");function B(w){if(!(this instanceof B))return new B(w);let F=w?G(this,w,"readableHighWaterMark",!0):null;if(F===0)w={...w,highWaterMark:null,readableHighWaterMark:F,writableHighWaterMark:w.writableHighWaterMark||0};if(Z.call(this,w),this._readableState.sync=!1,this[W]=null,w){if(typeof w.transform==="function")this._transform=w.transform;if(typeof w.flush==="function")this._flush=w.flush}this.on("prefinish",U)}function V(w){if(typeof this._flush==="function"&&!this.destroyed)this._flush((F,M)=>{if(F){if(w)w(F);else this.destroy(F);return}if(M!=null)this.push(M);if(this.push(null),w)w()});else if(this.push(null),w)w()}function U(){if(this._final!==V)V.call(this)}B.prototype._final=V,B.prototype._transform=function(w,F,M){throw new J("_transform()")},B.prototype._write=function(w,F,M){let k=this._readableState,f=this._writableState,L=k.length;this._transform(w,F,(D,z)=>{if(D){M(D);return}if(z!=null)this.push(z);if(f.ended||L===k.length||k.length{var{ObjectSetPrototypeOf:Q}=P0();q.exports=J;var K=l9();Q(J.prototype,K.prototype),Q(J,K);function J(Z){if(!(this instanceof J))return new J(Z);K.call(this,Z)}J.prototype._transform=function(Z,G,W){W(null,Z)}}),n5=g0(($,q)=>{var Q=D1(),{ArrayIsArray:K,Promise:J,SymbolAsyncIterator:Z,SymbolDispose:G}=P0(),W=s2(),{once:B}=e0(),V=o1(),U=c2(),{aggregateTwoErrors:w,codes:{ERR_INVALID_ARG_TYPE:F,ERR_INVALID_RETURN_VALUE:M,ERR_MISSING_ARGS:k,ERR_STREAM_DESTROYED:f,ERR_STREAM_PREMATURE_CLOSE:L},AbortError:D}=a0(),{validateFunction:z,validateAbortSignal:N}=P6(),{isIterable:H,isReadable:v,isReadableNodeStream:j,isNodeStream:n,isTransformStream:d,isWebStream:_,isReadableStream:X,isReadableFinished:P}=b2(),g=globalThis.AbortController||O6().AbortController,c,h,x;function l(m,V0,w0){let S=!1;m.on("close",()=>{S=!0});let b=W(m,{readable:V0,writable:w0},(O)=>{S=!O});return{destroy:(O)=>{if(S)return;S=!0,V.destroyer(m,O||new f("pipe"))},cleanup:b}}function $0(m){return z(m[m.length-1],"streams[stream.length - 1]"),m.pop()}function Z0(m){if(H(m))return m;else if(j(m))return F0(m);throw new F("val",["Readable","Iterable","AsyncIterable"],m)}async function*F0(m){if(!h)h=v8();yield*h.prototype[Z].call(m)}async function p(m,V0,w0,{end:S}){let b,O=null,E=(R)=>{if(R)b=R;if(O){let Y=O;O=null,Y()}},a=()=>new J((R,Y)=>{if(b)Y(b);else O=()=>{if(b)Y(b);else R()}});V0.on("drain",E);let K0=W(V0,{readable:!1},E);try{if(V0.writableNeedDrain)await a();for await(let R of m)if(!V0.write(R))await a();if(S)V0.end(),await a();w0()}catch(R){w0(b!==R?w(b,R):R)}finally{K0(),V0.off("drain",E)}}async function W0(m,V0,w0,{end:S}){if(d(V0))V0=V0.writable;let b=V0.getWriter();try{for await(let O of m)await b.ready,b.write(O).catch(()=>{});if(await b.ready,S)await b.close();w0()}catch(O){try{await b.abort(O),w0(O)}catch(E){w0(E)}}}function y(...m){return i(m,B($0(m)))}function i(m,V0,w0){if(m.length===1&&K(m[0]))m=m[0];if(m.length<2)throw new k("streams");let S=new g,b=S.signal,O=w0===null||w0===void 0?void 0:w0.signal,E=[];N(O,"options.signal");function a(){r(new D)}x=x||e0().addAbortListener;let K0;if(O)K0=x(O,a);let R,Y,C=[],u=0;function e(Q0){r(Q0,--u===0)}function r(Q0,M0){var I0;if(Q0&&(!R||R.code==="ERR_STREAM_PREMATURE_CLOSE"))R=Q0;if(!R&&!M0)return;while(C.length)C.shift()(R);if((I0=K0)===null||I0===void 0||I0[G](),S.abort(),M0){if(!R)E.forEach((m0)=>m0());Q.nextTick(V0,R,Y)}}let s;for(let Q0=0;Q00,p0=I0||(w0===null||w0===void 0?void 0:w0.end)!==!1,q2=Q0===m.length-1;if(n(M0)){let O0=function(u0){if(u0&&u0.name!=="AbortError"&&u0.code!=="ERR_STREAM_PREMATURE_CLOSE")e(u0)};var T=O0;if(p0){let{destroy:u0,cleanup:E1}=l(M0,I0,m0);if(C.push(u0),v(M0)&&q2)E.push(E1)}if(M0.on("error",O0),v(M0)&&q2)E.push(()=>{M0.removeListener("error",O0)})}if(Q0===0)if(typeof M0==="function"){if(s=M0({signal:b}),!H(s))throw new M("Iterable, AsyncIterable or Stream","source",s)}else if(H(M0)||j(M0)||d(M0))s=M0;else s=U.from(M0);else if(typeof M0==="function"){if(d(s)){var t;s=Z0((t=s)===null||t===void 0?void 0:t.readable)}else s=Z0(s);if(s=M0(s,{signal:b}),I0){if(!H(s,!0))throw new M("AsyncIterable",`transform[${Q0-1}]`,s)}else{var G0;if(!c)c=r9();let O0=new c({objectMode:!0}),u0=(G0=s)===null||G0===void 0?void 0:G0.then;if(typeof u0==="function")u++,u0.call(s,(R2)=>{if(Y=R2,R2!=null)O0.write(R2);if(p0)O0.end();Q.nextTick(e)},(R2)=>{O0.destroy(R2),Q.nextTick(e,R2)});else if(H(s,!0))u++,p(s,O0,e,{end:p0});else if(X(s)||d(s)){let R2=s.readable||s;u++,p(R2,O0,e,{end:p0})}else throw new M("AsyncIterable or Promise","destination",s);s=O0;let{destroy:E1,cleanup:_1}=l(s,!1,!0);if(C.push(E1),q2)E.push(_1)}}else if(n(M0)){if(j(s)){u+=2;let O0=U0(s,M0,e,{end:p0});if(v(M0)&&q2)E.push(O0)}else if(d(s)||X(s)){let O0=s.readable||s;u++,p(O0,M0,e,{end:p0})}else if(H(s))u++,p(s,M0,e,{end:p0});else throw new F("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],s);s=M0}else if(_(M0)){if(j(s))u++,W0(Z0(s),M0,e,{end:p0});else if(X(s)||H(s))u++,W0(s,M0,e,{end:p0});else if(d(s))u++,W0(s.readable,M0,e,{end:p0});else throw new F("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],s);s=M0}else s=U.from(M0)}if(b!==null&&b!==void 0&&b.aborted||O!==null&&O!==void 0&&O.aborted)Q.nextTick(a);return s}function U0(m,V0,w0,{end:S}){let b=!1;if(V0.on("close",()=>{if(!b)w0(new L)}),m.pipe(V0,{end:!1}),S){let E=function(){b=!0,V0.end()};var O=E;if(P(m))Q.nextTick(E);else m.once("end",E)}else w0();return W(m,{readable:!0,writable:!1},(E)=>{let a=m._readableState;if(E&&E.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted)m.once("end",w0).once("error",w0);else w0(E)}),W(V0,{readable:!1,writable:!0},w0)}q.exports={pipelineImpl:i,pipeline:y}}),s9=g0(($,q)=>{var{pipeline:Q}=n5(),K=c2(),{destroyer:J}=o1(),{isNodeStream:Z,isReadable:G,isWritable:W,isWebStream:B,isTransformStream:V,isWritableStream:U,isReadableStream:w}=b2(),{AbortError:F,codes:{ERR_INVALID_ARG_VALUE:M,ERR_MISSING_ARGS:k}}=a0(),f=s2();q.exports=function(...L){if(L.length===0)throw new k("streams");if(L.length===1)return K.from(L[0]);let D=[...L];if(typeof L[0]==="function")L[0]=K.from(L[0]);if(typeof L[L.length-1]==="function"){let g=L.length-1;L[g]=K.from(L[g])}for(let g=0;g0&&!(W(L[g])||U(L[g])||V(L[g])))throw new M(`streams[${g}]`,D[g],"must be writable")}let z,N,H,v,j;function n(g){let c=v;if(v=null,c)c(g);else if(g)j.destroy(g);else if(!P&&!X)j.destroy()}let d=L[0],_=Q(L,n),X=!!(W(d)||U(d)||V(d)),P=!!(G(_)||w(_)||V(_));if(j=new K({writableObjectMode:!!(d!==null&&d!==void 0&&d.writableObjectMode),readableObjectMode:!!(_!==null&&_!==void 0&&_.readableObjectMode),writable:X,readable:P}),X){if(Z(d))j._write=function(c,h,x){if(d.write(c,h))x();else z=x},j._final=function(c){d.end(),N=c},d.on("drain",function(){if(z){let c=z;z=null,c()}});else if(B(d)){let c=(V(d)?d.writable:d).getWriter();j._write=async function(h,x,l){try{await c.ready,c.write(h).catch(()=>{}),l()}catch($0){l($0)}},j._final=async function(h){try{await c.ready,c.close().catch(()=>{}),N=h}catch(x){h(x)}}}let g=V(_)?_.readable:_;f(g,()=>{if(N){let c=N;N=null,c()}})}if(P){if(Z(_))_.on("readable",function(){if(H){let g=H;H=null,g()}}),_.on("end",function(){j.push(null)}),j._read=function(){while(!0){let g=_.read();if(g===null){H=j._read;return}if(!j.push(g))return}};else if(B(_)){let g=(V(_)?_.readable:_).getReader();j._read=async function(){while(!0)try{let{value:c,done:h}=await g.read();if(!j.push(c))return;if(h){j.push(null);return}}catch{return}}}}return j._destroy=function(g,c){if(!g&&v!==null)g=new F;if(H=null,z=null,N=null,v===null)c(g);else if(v=c,Z(_))J(_,g)},j}}),hV=g0(($,q)=>{var Q=globalThis.AbortController||O6().AbortController,{codes:{ERR_INVALID_ARG_VALUE:K,ERR_INVALID_ARG_TYPE:J,ERR_MISSING_ARGS:Z,ERR_OUT_OF_RANGE:G},AbortError:W}=a0(),{validateAbortSignal:B,validateInteger:V,validateObject:U}=P6(),w=P0().Symbol("kWeak"),F=P0().Symbol("kResistStopPropagation"),{finished:M}=s2(),k=s9(),{addAbortSignalNoValidate:f}=L8(),{isWritable:L,isNodeStream:D}=b2(),{deprecate:z}=e0(),{ArrayPrototypePush:N,Boolean:H,MathFloor:v,Number:j,NumberIsNaN:n,Promise:d,PromiseReject:_,PromiseResolve:X,PromisePrototypeThen:P,Symbol:g}=P0(),c=g("kEmpty"),h=g("kEof");function x(O,E){if(E!=null)U(E,"options");if((E===null||E===void 0?void 0:E.signal)!=null)B(E.signal,"options.signal");if(D(O)&&!L(O))throw new K("stream",O,"must be writable");let a=k(this,O);if(E!==null&&E!==void 0&&E.signal)f(E.signal,a);return a}function l(O,E){if(typeof O!=="function")throw new J("fn",["Function","AsyncFunction"],O);if(E!=null)U(E,"options");if((E===null||E===void 0?void 0:E.signal)!=null)B(E.signal,"options.signal");let a=1;if((E===null||E===void 0?void 0:E.concurrency)!=null)a=v(E.concurrency);let K0=a-1;if((E===null||E===void 0?void 0:E.highWaterMark)!=null)K0=v(E.highWaterMark);return V(a,"options.concurrency",1),V(K0,"options.highWaterMark",0),K0+=a,async function*(){let R=e0().AbortSignalAny([E===null||E===void 0?void 0:E.signal].filter(H)),Y=this,C=[],u={signal:R},e,r,s=!1,T=0;function t(){s=!0,G0()}function G0(){T-=1,Q0()}function Q0(){if(r&&!s&&T=K0||T>=a))await new d((m0)=>{r=m0})}C.push(h)}catch(I0){let m0=_(I0);P(m0,G0,t),C.push(m0)}finally{if(s=!0,e)e(),e=null}}M0();try{while(!0){while(C.length>0){let I0=await C[0];if(I0===h)return;if(R.aborted)throw new W;if(I0!==c)yield I0;C.shift(),Q0()}await new d((I0)=>{e=I0})}}finally{if(s=!0,r)r(),r=null}}.call(this)}function $0(O=void 0){if(O!=null)U(O,"options");if((O===null||O===void 0?void 0:O.signal)!=null)B(O.signal,"options.signal");return async function*(){let E=0;for await(let K0 of this){var a;if(O!==null&&O!==void 0&&(a=O.signal)!==null&&a!==void 0&&a.aborted)throw new W({cause:O.signal.reason});yield[E++,K0]}}.call(this)}async function Z0(O,E=void 0){for await(let a of y.call(this,O,E))return!0;return!1}async function F0(O,E=void 0){if(typeof O!=="function")throw new J("fn",["Function","AsyncFunction"],O);return!await Z0.call(this,async(...a)=>{return!await O(...a)},E)}async function p(O,E){for await(let a of y.call(this,O,E))return a;return}async function W0(O,E){if(typeof O!=="function")throw new J("fn",["Function","AsyncFunction"],O);async function a(K0,R){return await O(K0,R),c}for await(let K0 of l.call(this,a,E));}function y(O,E){if(typeof O!=="function")throw new J("fn",["Function","AsyncFunction"],O);async function a(K0,R){if(await O(K0,R))return K0;return c}return l.call(this,a,E)}class i extends Z{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function U0(O,E,a){var K0;if(typeof O!=="function")throw new J("reducer",["Function","AsyncFunction"],O);if(a!=null)U(a,"options");if((a===null||a===void 0?void 0:a.signal)!=null)B(a.signal,"options.signal");let R=arguments.length>1;if(a!==null&&a!==void 0&&(K0=a.signal)!==null&&K0!==void 0&&K0.aborted){let r=new W(void 0,{cause:a.signal.reason});throw this.once("error",()=>{}),await M(this.destroy(r)),r}let Y=new Q,C=Y.signal;if(a!==null&&a!==void 0&&a.signal){let r={once:!0,[w]:this,[F]:!0};a.signal.addEventListener("abort",()=>Y.abort(),r)}let u=!1;try{for await(let r of this){var e;if(u=!0,a!==null&&a!==void 0&&(e=a.signal)!==null&&e!==void 0&&e.aborted)throw new W;if(!R)E=r,R=!0;else E=await O(E,r,{signal:C})}if(!u&&!R)throw new i}finally{Y.abort()}return E}async function m(O){if(O!=null)U(O,"options");if((O===null||O===void 0?void 0:O.signal)!=null)B(O.signal,"options.signal");let E=[];for await(let K0 of this){var a;if(O!==null&&O!==void 0&&(a=O.signal)!==null&&a!==void 0&&a.aborted)throw new W(void 0,{cause:O.signal.reason});N(E,K0)}return E}function V0(O,E){let a=l.call(this,O,E);return async function*(){for await(let K0 of a)yield*K0}.call(this)}function w0(O){if(O=j(O),n(O))return 0;if(O<0)throw new G("number",">= 0",O);return O}function S(O,E=void 0){if(E!=null)U(E,"options");if((E===null||E===void 0?void 0:E.signal)!=null)B(E.signal,"options.signal");return O=w0(O),async function*(){var a;if(E!==null&&E!==void 0&&(a=E.signal)!==null&&a!==void 0&&a.aborted)throw new W;for await(let R of this){var K0;if(E!==null&&E!==void 0&&(K0=E.signal)!==null&&K0!==void 0&&K0.aborted)throw new W;if(O--<=0)yield R}}.call(this)}function b(O,E=void 0){if(E!=null)U(E,"options");if((E===null||E===void 0?void 0:E.signal)!=null)B(E.signal,"options.signal");return O=w0(O),async function*(){var a;if(E!==null&&E!==void 0&&(a=E.signal)!==null&&a!==void 0&&a.aborted)throw new W;for await(let R of this){var K0;if(E!==null&&E!==void 0&&(K0=E.signal)!==null&&K0!==void 0&&K0.aborted)throw new W;if(O-- >0)yield R;if(O<=0)return}}.call(this)}q.exports.streamReturningOperators={asIndexedPairs:z($0,"readable.asIndexedPairs will be removed in a future version."),drop:S,filter:y,flatMap:V0,map:l,take:b,compose:x},q.exports.promiseReturningOperators={every:F0,forEach:W0,reduce:U0,toArray:m,some:Z0,find:p}}),t9=g0(($,q)=>{var{ArrayPrototypePop:Q,Promise:K}=P0(),{isIterable:J,isNodeStream:Z,isWebStream:G}=b2(),{pipelineImpl:W}=n5(),{finished:B}=s2();e9();function V(...U){return new K((w,F)=>{let M,k,f=U[U.length-1];if(f&&typeof f==="object"&&!Z(f)&&!J(f)&&!G(f)){let L=Q(U);M=L.signal,k=L.end}W(U,(L,D)=>{if(L)F(L);else w(D)},{signal:M,end:k})})}q.exports={finished:B,pipeline:V}}),e9=g0(($,q)=>{var{Buffer:Q}=(t0(),X0(K2)),{ObjectDefineProperty:K,ObjectKeys:J,ReflectApply:Z}=P0(),{promisify:{custom:G}}=e0(),{streamReturningOperators:W,promiseReturningOperators:B}=hV(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:V}}=a0(),U=s9(),{setDefaultHighWaterMark:w,getDefaultHighWaterMark:F}=H8(),{pipeline:M}=n5(),{destroyer:k}=o1(),f=s2(),L=t9(),D=b2(),z=q.exports=c5().Stream;z.isDestroyed=D.isDestroyed,z.isDisturbed=D.isDisturbed,z.isErrored=D.isErrored,z.isReadable=D.isReadable,z.isWritable=D.isWritable,z.Readable=v8();for(let H of J(W)){let v=function(...n){if(new.target)throw V();return z.Readable.from(Z(j,this,n))},j=W[H];K(v,"name",{__proto__:null,value:j.name}),K(v,"length",{__proto__:null,value:j.length}),K(z.Readable.prototype,H,{__proto__:null,value:v,enumerable:!1,configurable:!0,writable:!0})}for(let H of J(B)){let v=function(...n){if(new.target)throw V();return Z(j,this,n)},j=B[H];K(v,"name",{__proto__:null,value:j.name}),K(v,"length",{__proto__:null,value:j.length}),K(z.Readable.prototype,H,{__proto__:null,value:v,enumerable:!1,configurable:!0,writable:!0})}z.Writable=b5(),z.Duplex=c2(),z.Transform=l9(),z.PassThrough=r9(),z.pipeline=M;var{addAbortSignal:N}=L8();z.addAbortSignal=N,z.finished=f,z.destroy=k,z.compose=U,z.setDefaultHighWaterMark=w,z.getDefaultHighWaterMark=F,K(z,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return L}}),K(M,G,{__proto__:null,enumerable:!0,get(){return L.pipeline}}),K(f,G,{__proto__:null,enumerable:!0,get(){return L.finished}}),z.Stream=z,z._isUint8Array=function(H){return H instanceof Uint8Array},z._uint8ArrayToBuffer=function(H){return Q.from(H.buffer,H.byteOffset,H.byteLength)}}),xV=g0(($,q)=>{var Q=a1();{let K=e9(),J=t9(),Z=K.Readable.destroy;q.exports=K.Readable,q.exports._uint8ArrayToBuffer=K._uint8ArrayToBuffer,q.exports._isUint8Array=K._isUint8Array,q.exports.isDisturbed=K.isDisturbed,q.exports.isErrored=K.isErrored,q.exports.isReadable=K.isReadable,q.exports.Readable=K.Readable,q.exports.Writable=K.Writable,q.exports.Duplex=K.Duplex,q.exports.Transform=K.Transform,q.exports.PassThrough=K.PassThrough,q.exports.addAbortSignal=K.addAbortSignal,q.exports.finished=K.finished,q.exports.destroy=K.destroy,q.exports.destroy=Z,q.exports.pipeline=K.pipeline,q.exports.compose=K.compose,Object.defineProperty(K,"promises",{configurable:!0,enumerable:!0,get(){return J}}),q.exports.Stream=K.Stream}q.exports.default=q.exports});$$.exports=xV()});var d5=N0((Dz,Q$)=>{Q$.exports=a1()});var n2=N0((J2)=>{J2.base64=!0;J2.array=!0;J2.string=!0;J2.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u";J2.nodebuffer=typeof Buffer<"u";J2.uint8array=typeof Uint8Array<"u";if(typeof ArrayBuffer>"u")J2.blob=!1;else{f8=new ArrayBuffer(0);try{J2.blob=new Blob([f8],{type:"application/zip"}).size===0}catch($){try{m5=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,R8=new m5,R8.append(f8),J2.blob=R8.getBlob("application/zip").size===0}catch(q){J2.blob=!1}}}var f8,m5,R8;try{J2.nodestream=!!d5().Readable}catch($){J2.nodestream=!1}});var i5=N0((p5)=>{var OV=T0(),PV=n2(),A2="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";p5.encode=function($){var q=[],Q,K,J,Z,G,W,B,V=0,U=$.length,w=U,F=OV.getTypeOf($)!=="string";while(V<$.length){if(w=U-V,!F)Q=$.charCodeAt(V++),K=V>2,G=(Q&3)<<4|K>>4,W=w>1?(K&15)<<2|J>>6:64,B=w>2?J&63:64,q.push(A2.charAt(Z)+A2.charAt(G)+A2.charAt(W)+A2.charAt(B))}return q.join("")};p5.decode=function($){var q,Q,K,J,Z,G,W,B=0,V=0,U="data:";if($.substr(0,U.length)===U)throw Error("Invalid base64 input, it looks like a data url.");$=$.replace(/[^A-Za-z0-9+/=]/g,"");var w=$.length*3/4;if($.charAt($.length-1)===A2.charAt(64))w--;if($.charAt($.length-2)===A2.charAt(64))w--;if(w%1!==0)throw Error("Invalid base64 input, bad content length.");var F;if(PV.uint8array)F=new Uint8Array(w|0);else F=Array(w|0);while(B<$.length){if(J=A2.indexOf($.charAt(B++)),Z=A2.indexOf($.charAt(B++)),G=A2.indexOf($.charAt(B++)),W=A2.indexOf($.charAt(B++)),q=J<<2|Z>>4,Q=(Z&15)<<4|G>>2,K=(G&3)<<6|W,F[V++]=q,G!==64)F[V++]=Q;if(W!==64)F[V++]=K}return F}});var T6=N0((vz,q$)=>{q$.exports={isNode:typeof Buffer<"u",newBufferFrom:function($,q){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from($,q);else{if(typeof $==="number")throw Error('The "data" argument must not be a number');return new Buffer($,q)}},allocBuffer:function($){if(Buffer.alloc)return Buffer.alloc($);else{var q=new Buffer($);return q.fill(0),q}},isBuffer:function($){return Buffer.isBuffer($)},isStream:function($){return $&&typeof $.on==="function"&&typeof $.pause==="function"&&typeof $.resume==="function"}}});var V$=N0((fz,J$)=>{var K$=global.MutationObserver||global.WebKitMutationObserver,u6;if(K$)C8=0,o5=new K$(I8),j8=global.document.createTextNode(""),o5.observe(j8,{characterData:!0}),u6=function(){j8.data=C8=++C8%2};else if(!global.setImmediate&&typeof global.MessageChannel<"u")g8=new global.MessageChannel,g8.port1.onmessage=I8,u6=function(){g8.port2.postMessage(0)};else if("document"in global&&"onreadystatechange"in global.document.createElement("script"))u6=function(){var $=global.document.createElement("script");$.onreadystatechange=function(){I8(),$.onreadystatechange=null,$.parentNode.removeChild($),$=null},global.document.documentElement.appendChild($)};else u6=function(){setTimeout(I8,0)};var C8,o5,j8,g8,a5,S6=[];function I8(){a5=!0;var $,q,Q=S6.length;while(Q){q=S6,S6=[],$=-1;while(++${var uV=V$();function l1(){}var o0={},U$=["REJECTED"],l5=["FULFILLED"],Z$=["PENDING"];B$.exports=t2;function t2($){if(typeof $!=="function")throw TypeError("resolver must be a function");if(this.state=Z$,this.queue=[],this.outcome=void 0,$!==l1)G$(this,$)}t2.prototype.finally=function($){if(typeof $!=="function")return this;var q=this.constructor;return this.then(Q,K);function Q(J){function Z(){return J}return q.resolve($()).then(Z)}function K(J){function Z(){throw J}return q.resolve($()).then(Z)}};t2.prototype.catch=function($){return this.then(null,$)};t2.prototype.then=function($,q){if(typeof $!=="function"&&this.state===l5||typeof q!=="function"&&this.state===U$)return this;var Q=new this.constructor(l1);if(this.state!==Z$){var K=this.state===l5?$:q;r5(Q,K,this.outcome)}else this.queue.push(new E6(Q,$,q));return Q};function E6($,q,Q){if(this.promise=$,typeof q==="function")this.onFulfilled=q,this.callFulfilled=this.otherCallFulfilled;if(typeof Q==="function")this.onRejected=Q,this.callRejected=this.otherCallRejected}E6.prototype.callFulfilled=function($){o0.resolve(this.promise,$)};E6.prototype.otherCallFulfilled=function($){r5(this.promise,this.onFulfilled,$)};E6.prototype.callRejected=function($){o0.reject(this.promise,$)};E6.prototype.otherCallRejected=function($){r5(this.promise,this.onRejected,$)};function r5($,q,Q){uV(function(){var K;try{K=q(Q)}catch(J){return o0.reject($,J)}if(K===$)o0.reject($,TypeError("Cannot resolve promise with itself"));else o0.resolve($,K)})}o0.resolve=function($,q){var Q=W$(SV,q);if(Q.status==="error")return o0.reject($,Q.value);var K=Q.value;if(K)G$($,K);else{$.state=l5,$.outcome=q;var J=-1,Z=$.queue.length;while(++J{var s5=null;if(typeof Promise<"u")s5=Promise;else s5=z$();F$.exports={Promise:s5}});var w$=N0((M$)=>{(function($,q){if($.setImmediate)return;var Q=1,K={},J=!1,Z=$.document,G;function W(z){if(typeof z!=="function")z=Function(""+z);var N=Array(arguments.length-1);for(var H=0;H"u"?typeof global>"u"?M$:global:self)});var T0=N0((_0)=>{var e2=n2(),nV=i5(),s1=T6(),t5=r1();w$();function dV($){var q=null;if(e2.uint8array)q=new Uint8Array($.length);else q=Array($.length);return X8($,q)}_0.newBlob=function($,q){_0.checkSupport("blob");try{return new Blob([$],{type:q})}catch(J){try{var Q=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,K=new Q;return K.append($),K.getBlob(q)}catch(Z){throw Error("Bug : can't construct the Blob.")}}};function _6($){return $}function X8($,q){for(var Q=0;Q<$.length;++Q)q[Q]=$.charCodeAt(Q)&255;return q}var A8={stringifyByChunk:function($,q,Q){var K=[],J=0,Z=$.length;if(Z<=Q)return String.fromCharCode.apply(null,$);while(J1)try{return A8.stringifyByChunk($,Q,q)}catch(J){q=Math.floor(q/2)}return A8.stringifyByChar($)}_0.applyFromCharCode=c6;function y8($,q){for(var Q=0;Q<$.length;Q++)q[Q]=$[Q];return q}var $1={};$1.string={string:_6,array:function($){return X8($,Array($.length))},arraybuffer:function($){return $1.string.uint8array($).buffer},uint8array:function($){return X8($,new Uint8Array($.length))},nodebuffer:function($){return X8($,s1.allocBuffer($.length))}};$1.array={string:c6,array:_6,arraybuffer:function($){return new Uint8Array($).buffer},uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return s1.newBufferFrom($)}};$1.arraybuffer={string:function($){return c6(new Uint8Array($))},array:function($){return y8(new Uint8Array($),Array($.byteLength))},arraybuffer:_6,uint8array:function($){return new Uint8Array($)},nodebuffer:function($){return s1.newBufferFrom(new Uint8Array($))}};$1.uint8array={string:c6,array:function($){return y8($,Array($.length))},arraybuffer:function($){return $.buffer},uint8array:_6,nodebuffer:function($){return s1.newBufferFrom($)}};$1.nodebuffer={string:c6,array:function($){return y8($,Array($.length))},arraybuffer:function($){return $1.nodebuffer.uint8array($).buffer},uint8array:function($){return y8($,new Uint8Array($.length))},nodebuffer:_6};_0.transformTo=function($,q){if(!q)q="";if(!$)return q;_0.checkSupport($);var Q=_0.getTypeOf(q),K=$1[Q][$](q);return K};_0.resolve=function($){var q=$.split("/"),Q=[];for(var K=0;K"u")$[Q]=arguments[q][Q];return $};_0.prepareContent=function($,q,Q,K,J){var Z=t5.Promise.resolve(q).then(function(G){var W=e2.blob&&(G instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(G))!==-1);if(W&&typeof FileReader<"u")return new t5.Promise(function(B,V){var U=new FileReader;U.onload=function(w){B(w.target.result)},U.onerror=function(w){V(w.target.error)},U.readAsArrayBuffer(G)});else return G});return Z.then(function(G){var W=_0.getTypeOf(G);if(!W)return t5.Promise.reject(Error("Can't read the data of '"+$+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));if(W==="arraybuffer")G=_0.transformTo("uint8array",G);else if(W==="string"){if(J)G=nV.decode(G);else if(Q){if(K!==!0)G=dV(G)}}return G})}});var V2=N0((gz,Y$)=>{function N$($){this.name=$||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}N$.prototype={push:function($){this.emit("data",$)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch($){this.emit("error",$)}return!0},error:function($){if(this.isFinished)return!1;if(this.isPaused)this.generatedError=$;else{if(this.isFinished=!0,this.emit("error",$),this.previous)this.previous.error($);this.cleanUp()}return!0},on:function($,q){return this._listeners[$].push(q),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function($,q){if(this._listeners[$])for(var Q=0;Q "+$;else return $}};Y$.exports=N$});var e1=N0((Q1)=>{var t1=T0(),L1=n2(),mV=T6(),h8=V2(),b6=Array(256);for(X2=0;X2<256;X2++)b6[X2]=X2>=252?6:X2>=248?5:X2>=240?4:X2>=224?3:X2>=192?2:1;var X2;b6[254]=b6[254]=1;var pV=function($){var q,Q,K,J,Z,G=$.length,W=0;for(J=0;J>>6,q[Z++]=128|Q&63;else if(Q<65536)q[Z++]=224|Q>>>12,q[Z++]=128|Q>>>6&63,q[Z++]=128|Q&63;else q[Z++]=240|Q>>>18,q[Z++]=128|Q>>>12&63,q[Z++]=128|Q>>>6&63,q[Z++]=128|Q&63}return q},iV=function($,q){var Q;if(q=q||$.length,q>$.length)q=$.length;Q=q-1;while(Q>=0&&($[Q]&192)===128)Q--;if(Q<0)return q;if(Q===0)return q;return Q+b6[$[Q]]>q?Q:q},oV=function($){var q,Q,K,J,Z=$.length,G=Array(Z*2);for(Q=0,q=0;q4){G[Q++]=65533,q+=J-1;continue}K&=J===2?31:J===3?15:7;while(J>1&&q1){G[Q++]=65533;continue}if(K<65536)G[Q++]=K;else K-=65536,G[Q++]=55296|K>>10&1023,G[Q++]=56320|K&1023}if(G.length!==Q)if(G.subarray)G=G.subarray(0,Q);else G.length=Q;return t1.applyFromCharCode(G)};Q1.utf8encode=function(q){if(L1.nodebuffer)return mV.newBufferFrom(q,"utf-8");return pV(q)};Q1.utf8decode=function(q){if(L1.nodebuffer)return t1.transformTo("nodebuffer",q).toString("utf-8");return q=t1.transformTo(L1.uint8array?"uint8array":"array",q),oV(q)};function x8(){h8.call(this,"utf-8 decode"),this.leftOver=null}t1.inherits(x8,h8);x8.prototype.processChunk=function($){var q=t1.transformTo(L1.uint8array?"uint8array":"array",$.data);if(this.leftOver&&this.leftOver.length){if(L1.uint8array){var Q=q;q=new Uint8Array(Q.length+this.leftOver.length),q.set(this.leftOver,0),q.set(Q,this.leftOver.length)}else q=this.leftOver.concat(q);this.leftOver=null}var K=iV(q),J=q;if(K!==q.length)if(L1.uint8array)J=q.subarray(0,K),this.leftOver=q.subarray(K,q.length);else J=q.slice(0,K),this.leftOver=q.slice(K,q.length);this.push({data:Q1.utf8decode(J),meta:$.meta})};x8.prototype.flush=function(){if(this.leftOver&&this.leftOver.length)this.push({data:Q1.utf8decode(this.leftOver),meta:{}}),this.leftOver=null};Q1.Utf8DecodeWorker=x8;function e5(){h8.call(this,"utf-8 encode")}t1.inherits(e5,h8);e5.prototype.processChunk=function($){this.push({data:Q1.utf8encode($.data),meta:$.meta})};Q1.Utf8EncodeWorker=e5});var H$=N0((Xz,L$)=>{var k$=V2(),D$=T0();function $4($){k$.call(this,"ConvertWorker to "+$),this.destType=$}D$.inherits($4,k$);$4.prototype.processChunk=function($){this.push({data:D$.transformTo(this.destType,$.data),meta:$.meta})};L$.exports=$4});var R$=N0((yz,f$)=>{var v$=d5().Readable,aV=T0();aV.inherits(Q4,v$);function Q4($,q,Q){v$.call(this,q),this._helper=$;var K=this;$.on("data",function(J,Z){if(!K.push(J))K._helper.pause();if(Q)Q(Z)}).on("error",function(J){K.emit("error",J)}).on("end",function(){K.push(null)})}Q4.prototype._read=function(){this._helper.resume()};f$.exports=Q4});var q4=N0((hz,j$)=>{var H1=T0(),lV=H$(),rV=V2(),sV=i5(),tV=n2(),eV=r1(),I$=null;if(tV.nodestream)try{I$=R$()}catch($){}function $U($,q,Q){switch($){case"blob":return H1.newBlob(H1.transformTo("arraybuffer",q),Q);case"base64":return sV.encode(q);default:return H1.transformTo($,q)}}function QU($,q){var Q,K=0,J=null,Z=0;for(Q=0;Q{D2.base64=!1;D2.binary=!1;D2.dir=!1;D2.createFolders=!0;D2.date=null;D2.compression=null;D2.compressionOptions=null;D2.comment=null;D2.unixPermissions=null;D2.dosPermissions=null});var J4=N0((Oz,g$)=>{var O8=T0(),P8=V2(),KU=16384;function $6($){P8.call(this,"DataWorker");var q=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,$.then(function(Q){if(q.dataIsReady=!0,q.data=Q,q.max=Q&&Q.length||0,q.type=O8.getTypeOf(Q),!q.isPaused)q._tickAndRepeat()},function(Q){q.error(Q)})}O8.inherits($6,P8);$6.prototype.cleanUp=function(){P8.prototype.cleanUp.call(this),this.data=null};$6.prototype.resume=function(){if(!P8.prototype.resume.call(this))return!1;if(!this._tickScheduled&&this.dataIsReady)this._tickScheduled=!0,O8.delay(this._tickAndRepeat,[],this);return!0};$6.prototype._tickAndRepeat=function(){if(this._tickScheduled=!1,this.isPaused||this.isFinished)return;if(this._tick(),!this.isFinished)O8.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0};$6.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var $=KU,q=null,Q=Math.min(this.max,this.index+$);if(this.index>=this.max)return this.end();else{switch(this.type){case"string":q=this.data.substring(this.index,Q);break;case"uint8array":q=this.data.subarray(this.index,Q);break;case"array":case"nodebuffer":q=this.data.slice(this.index,Q);break}return this.index=Q,this.push({data:q,meta:{percent:this.max?this.index/this.max*100:0}})}};g$.exports=$6});var T8=N0((Pz,X$)=>{var JU=T0();function VU(){var $,q=[];for(var Q=0;Q<256;Q++){$=Q;for(var K=0;K<8;K++)$=$&1?3988292384^$>>>1:$>>>1;q[Q]=$}return q}var A$=VU();function UU($,q,Q,K){var J=A$,Z=K+Q;$=$^-1;for(var G=K;G>>8^J[($^q[G])&255];return $^-1}function ZU($,q,Q,K){var J=A$,Z=K+Q;$=$^-1;for(var G=K;G>>8^J[($^q.charCodeAt(G))&255];return $^-1}X$.exports=function(q,Q){if(typeof q>"u"||!q.length)return 0;var K=JU.getTypeOf(q)!=="string";if(K)return UU(Q|0,q,q.length,0);else return ZU(Q|0,q,q.length,0)}});var U4=N0((Tz,h$)=>{var y$=V2(),GU=T8(),WU=T0();function V4(){y$.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}WU.inherits(V4,y$);V4.prototype.processChunk=function($){this.streamInfo.crc32=GU($.data,this.streamInfo.crc32||0),this.push($)};h$.exports=V4});var O$=N0((uz,x$)=>{var BU=T0(),Z4=V2();function G4($){Z4.call(this,"DataLengthProbe for "+$),this.propName=$,this.withStreamInfo($,0)}BU.inherits(G4,Z4);G4.prototype.processChunk=function($){if($){var q=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=q+$.data.length}Z4.prototype.processChunk.call(this,$)};x$.exports=G4});var u8=N0((Sz,u$)=>{var P$=r1(),T$=J4(),zU=U4(),W4=O$();function B4($,q,Q,K,J){this.compressedSize=$,this.uncompressedSize=q,this.crc32=Q,this.compression=K,this.compressedContent=J}B4.prototype={getContentWorker:function(){var $=new T$(P$.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new W4("data_length")),q=this;return $.on("end",function(){if(this.streamInfo.data_length!==q.uncompressedSize)throw Error("Bug : uncompressed data size mismatch")}),$},getCompressedWorker:function(){return new T$(P$.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};B4.createWorkerFrom=function($,q,Q){return $.pipe(new zU).pipe(new W4("uncompressedSize")).pipe(q.compressWorker(Q)).pipe(new W4("compressedSize")).withStreamInfo("compression",q)};u$.exports=B4});var c$=N0((Ez,_$)=>{var FU=q4(),MU=J4(),z4=e1(),F4=u8(),S$=V2(),M4=function($,q,Q){this.name=$,this.dir=Q.dir,this.date=Q.date,this.comment=Q.comment,this.unixPermissions=Q.unixPermissions,this.dosPermissions=Q.dosPermissions,this._data=q,this._dataBinary=Q.binary,this.options={compression:Q.compression,compressionOptions:Q.compressionOptions}};M4.prototype={internalStream:function($){var q=null,Q="string";try{if(!$)throw Error("No output type specified.");Q=$.toLowerCase();var K=Q==="string"||Q==="text";if(Q==="binarystring"||Q==="text")Q="string";q=this._decompressWorker();var J=!this._dataBinary;if(J&&!K)q=q.pipe(new z4.Utf8EncodeWorker);if(!J&&K)q=q.pipe(new z4.Utf8DecodeWorker)}catch(Z){q=new S$("error"),q.error(Z)}return new FU(q,Q,"")},async:function($,q){return this.internalStream($).accumulate(q)},nodeStream:function($,q){return this.internalStream($||"nodebuffer").toNodejsStream(q)},_compressWorker:function($,q){if(this._data instanceof F4&&this._data.compression.magic===$.magic)return this._data.getCompressedWorker();else{var Q=this._decompressWorker();if(!this._dataBinary)Q=Q.pipe(new z4.Utf8EncodeWorker);return F4.createWorkerFrom(Q,$,q)}},_decompressWorker:function(){if(this._data instanceof F4)return this._data.getContentWorker();else if(this._data instanceof S$)return this._data;else return new MU(this._data)}};var E$=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],wU=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(n6=0;n6{var NU=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function YU($,q){return Object.prototype.hasOwnProperty.call($,q)}l0.assign=function($){var q=Array.prototype.slice.call(arguments,1);while(q.length){var Q=q.shift();if(!Q)continue;if(typeof Q!=="object")throw TypeError(Q+"must be non-object");for(var K in Q)if(YU(Q,K))$[K]=Q[K]}return $};l0.shrinkBuf=function($,q){if($.length===q)return $;if($.subarray)return $.subarray(0,q);return $.length=q,$};var kU={arraySet:function($,q,Q,K,J){if(q.subarray&&$.subarray){$.set(q.subarray(Q,Q+K),J);return}for(var Z=0;Z{var LU=d2(),HU=4,b$=0,n$=1,vU=2;function q6($){var q=$.length;while(--q>=0)$[q]=0}var fU=0,a$=1,RU=2,IU=3,CU=258,H4=29,a6=256,m6=a6+1+H4,Q6=30,v4=19,l$=2*m6+1,v1=15,w4=16,jU=7,f4=256,r$=16,s$=17,t$=18,D4=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],S8=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],gU=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],e$=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],AU=512,m2=Array((m6+2)*2);q6(m2);var d6=Array(Q6*2);q6(d6);var p6=Array(AU);q6(p6);var i6=Array(CU-IU+1);q6(i6);var R4=Array(H4);q6(R4);var E8=Array(Q6);q6(E8);function N4($,q,Q,K,J){this.static_tree=$,this.extra_bits=q,this.extra_base=Q,this.elems=K,this.max_length=J,this.has_stree=$&&$.length}var $Q,QQ,qQ;function Y4($,q){this.dyn_tree=$,this.max_code=0,this.stat_desc=q}function KQ($){return $<256?p6[$]:p6[256+($>>>7)]}function o6($,q){$.pending_buf[$.pending++]=q&255,$.pending_buf[$.pending++]=q>>>8&255}function $2($,q,Q){if($.bi_valid>w4-Q)$.bi_buf|=q<<$.bi_valid&65535,o6($,$.bi_buf),$.bi_buf=q>>w4-$.bi_valid,$.bi_valid+=Q-w4;else $.bi_buf|=q<<$.bi_valid&65535,$.bi_valid+=Q}function y2($,q,Q){$2($,Q[q*2],Q[q*2+1])}function JQ($,q){var Q=0;do Q|=$&1,$>>>=1,Q<<=1;while(--q>0);return Q>>>1}function XU($){if($.bi_valid===16)o6($,$.bi_buf),$.bi_buf=0,$.bi_valid=0;else if($.bi_valid>=8)$.pending_buf[$.pending++]=$.bi_buf&255,$.bi_buf>>=8,$.bi_valid-=8}function yU($,q){var{dyn_tree:Q,max_code:K}=q,J=q.stat_desc.static_tree,Z=q.stat_desc.has_stree,G=q.stat_desc.extra_bits,W=q.stat_desc.extra_base,B=q.stat_desc.max_length,V,U,w,F,M,k,f=0;for(F=0;F<=v1;F++)$.bl_count[F]=0;Q[$.heap[$.heap_max]*2+1]=0;for(V=$.heap_max+1;VB)F=B,f++;if(Q[U*2+1]=F,U>K)continue;if($.bl_count[F]++,M=0,U>=W)M=G[U-W];if(k=Q[U*2],$.opt_len+=k*(F+M),Z)$.static_len+=k*(J[U*2+1]+M)}if(f===0)return;do{F=B-1;while($.bl_count[F]===0)F--;$.bl_count[F]--,$.bl_count[F+1]+=2,$.bl_count[B]--,f-=2}while(f>0);for(F=B;F!==0;F--){U=$.bl_count[F];while(U!==0){if(w=$.heap[--V],w>K)continue;if(Q[w*2+1]!==F)$.opt_len+=(F-Q[w*2+1])*Q[w*2],Q[w*2+1]=F;U--}}}function VQ($,q,Q){var K=Array(v1+1),J=0,Z,G;for(Z=1;Z<=v1;Z++)K[Z]=J=J+Q[Z-1]<<1;for(G=0;G<=q;G++){var W=$[G*2+1];if(W===0)continue;$[G*2]=JQ(K[W]++,W)}}function hU(){var $,q,Q,K,J,Z=Array(v1+1);Q=0;for(K=0;K>=7;for(;K8)o6($,$.bi_buf);else if($.bi_valid>0)$.pending_buf[$.pending++]=$.bi_buf;$.bi_buf=0,$.bi_valid=0}function xU($,q,Q,K){if(ZQ($),K)o6($,Q),o6($,~Q);LU.arraySet($.pending_buf,$.window,q,Q,$.pending),$.pending+=Q}function d$($,q,Q,K){var J=q*2,Z=Q*2;return $[J]<$[Z]||$[J]===$[Z]&&K[q]<=K[Q]}function k4($,q,Q){var K=$.heap[Q],J=Q<<1;while(J<=$.heap_len){if(J<$.heap_len&&d$(q,$.heap[J+1],$.heap[J],$.depth))J++;if(d$(q,K,$.heap[J],$.depth))break;$.heap[Q]=$.heap[J],Q=J,J<<=1}$.heap[Q]=K}function m$($,q,Q){var K,J,Z=0,G,W;if($.last_lit!==0)do if(K=$.pending_buf[$.d_buf+Z*2]<<8|$.pending_buf[$.d_buf+Z*2+1],J=$.pending_buf[$.l_buf+Z],Z++,K===0)y2($,J,q);else{if(G=i6[J],y2($,G+a6+1,q),W=D4[G],W!==0)J-=R4[G],$2($,J,W);if(K--,G=KQ(K),y2($,G,Q),W=S8[G],W!==0)K-=E8[G],$2($,K,W)}while(Z<$.last_lit);y2($,f4,q)}function L4($,q){var Q=q.dyn_tree,K=q.stat_desc.static_tree,J=q.stat_desc.has_stree,Z=q.stat_desc.elems,G,W,B=-1,V;$.heap_len=0,$.heap_max=l$;for(G=0;G>1;G>=1;G--)k4($,Q,G);V=Z;do G=$.heap[1],$.heap[1]=$.heap[$.heap_len--],k4($,Q,1),W=$.heap[1],$.heap[--$.heap_max]=G,$.heap[--$.heap_max]=W,Q[V*2]=Q[G*2]+Q[W*2],$.depth[V]=($.depth[G]>=$.depth[W]?$.depth[G]:$.depth[W])+1,Q[G*2+1]=Q[W*2+1]=V,$.heap[1]=V++,k4($,Q,1);while($.heap_len>=2);$.heap[--$.heap_max]=$.heap[1],yU($,q),VQ(Q,B,$.bl_count)}function p$($,q,Q){var K,J=-1,Z,G=q[1],W=0,B=7,V=4;if(G===0)B=138,V=3;q[(Q+1)*2+1]=65535;for(K=0;K<=Q;K++){if(Z=G,G=q[(K+1)*2+1],++W=3;q--)if($.bl_tree[e$[q]*2+1]!==0)break;return $.opt_len+=3*(q+1)+5+5+4,q}function PU($,q,Q,K){var J;$2($,q-257,5),$2($,Q-1,5),$2($,K-4,4);for(J=0;J>>=1)if(q&1&&$.dyn_ltree[Q*2]!==0)return b$;if($.dyn_ltree[18]!==0||$.dyn_ltree[20]!==0||$.dyn_ltree[26]!==0)return n$;for(Q=32;Q0){if($.strm.data_type===vU)$.strm.data_type=TU($);if(L4($,$.l_desc),L4($,$.d_desc),G=OU($),J=$.opt_len+3+7>>>3,Z=$.static_len+3+7>>>3,Z<=J)J=Z}else J=Z=Q+5;if(Q+4<=J&&q!==-1)GQ($,q,Q,K);else if($.strategy===HU||Z===J)$2($,(a$<<1)+(K?1:0),3),m$($,m2,d6);else $2($,(RU<<1)+(K?1:0),3),PU($,$.l_desc.max_code+1,$.d_desc.max_code+1,G+1),m$($,$.dyn_ltree,$.dyn_dtree);if(UQ($),K)ZQ($)}function _U($,q,Q){if($.pending_buf[$.d_buf+$.last_lit*2]=q>>>8&255,$.pending_buf[$.d_buf+$.last_lit*2+1]=q&255,$.pending_buf[$.l_buf+$.last_lit]=Q&255,$.last_lit++,q===0)$.dyn_ltree[Q*2]++;else $.matches++,q--,$.dyn_ltree[(i6[Q]+a6+1)*2]++,$.dyn_dtree[KQ(q)*2]++;return $.last_lit===$.lit_bufsize-1}K6._tr_init=uU;K6._tr_stored_block=GQ;K6._tr_flush_block=EU;K6._tr_tally=_U;K6._tr_align=SU});var I4=N0((bz,BQ)=>{function cU($,q,Q,K){var J=$&65535|0,Z=$>>>16&65535|0,G=0;while(Q!==0){G=Q>2000?2000:Q,Q-=G;do J=J+q[K++]|0,Z=Z+J|0;while(--G);J%=65521,Z%=65521}return J|Z<<16|0}BQ.exports=cU});var C4=N0((nz,zQ)=>{function bU(){var $,q=[];for(var Q=0;Q<256;Q++){$=Q;for(var K=0;K<8;K++)$=$&1?3988292384^$>>>1:$>>>1;q[Q]=$}return q}var nU=bU();function dU($,q,Q,K){var J=nU,Z=K+Q;$^=-1;for(var G=K;G>>8^J[($^q[G])&255];return $^-1}zQ.exports=dU});var _8=N0((dz,FQ)=>{FQ.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var vQ=N0((O2)=>{var r0=d2(),M2=WQ(),YQ=I4(),q1=C4(),mU=_8(),C1=0,pU=1,iU=3,Z1=4,MQ=5,x2=0,wQ=1,w2=-2,oU=-3,j4=-5,aU=-1,lU=1,c8=2,rU=3,sU=4,tU=0,eU=2,m8=8,$Z=9,QZ=15,qZ=8,KZ=29,JZ=256,A4=JZ+1+KZ,VZ=30,UZ=19,ZZ=2*A4+1,GZ=15,f0=3,V1=258,L2=V1+f0+1,WZ=32,p8=42,X4=69,b8=73,n8=91,d8=103,f1=113,r6=666,c0=1,s6=2,R1=3,U6=4,BZ=3;function U1($,q){return $.msg=mU[q],q}function NQ($){return($<<1)-($>4?9:0)}function J1($){var q=$.length;while(--q>=0)$[q]=0}function K1($){var q=$.state,Q=q.pending;if(Q>$.avail_out)Q=$.avail_out;if(Q===0)return;if(r0.arraySet($.output,q.pending_buf,q.pending_out,Q,$.next_out),$.next_out+=Q,q.pending_out+=Q,$.total_out+=Q,$.avail_out-=Q,q.pending-=Q,q.pending===0)q.pending_out=0}function d0($,q){M2._tr_flush_block($,$.block_start>=0?$.block_start:-1,$.strstart-$.block_start,q),$.block_start=$.strstart,K1($.strm)}function C0($,q){$.pending_buf[$.pending++]=q}function l6($,q){$.pending_buf[$.pending++]=q>>>8&255,$.pending_buf[$.pending++]=q&255}function zZ($,q,Q,K){var J=$.avail_in;if(J>K)J=K;if(J===0)return 0;if($.avail_in-=J,r0.arraySet(q,$.input,$.next_in,J,Q),$.state.wrap===1)$.adler=YQ($.adler,q,J,Q);else if($.state.wrap===2)$.adler=q1($.adler,q,J,Q);return $.next_in+=J,$.total_in+=J,J}function kQ($,q){var{max_chain_length:Q,strstart:K}=$,J,Z,G=$.prev_length,W=$.nice_match,B=$.strstart>$.w_size-L2?$.strstart-($.w_size-L2):0,V=$.window,U=$.w_mask,w=$.prev,F=$.strstart+V1,M=V[K+G-1],k=V[K+G];if($.prev_length>=$.good_match)Q>>=2;if(W>$.lookahead)W=$.lookahead;do{if(J=q,V[J+G]!==k||V[J+G-1]!==M||V[J]!==V[K]||V[++J]!==V[K+1])continue;K+=2,J++;do;while(V[++K]===V[++J]&&V[++K]===V[++J]&&V[++K]===V[++J]&&V[++K]===V[++J]&&V[++K]===V[++J]&&V[++K]===V[++J]&&V[++K]===V[++J]&&V[++K]===V[++J]&&KG){if($.match_start=q,G=Z,Z>=W)break;M=V[K+G-1],k=V[K+G]}}while((q=w[q&U])>B&&--Q!==0);if(G<=$.lookahead)return G;return $.lookahead}function I1($){var q=$.w_size,Q,K,J,Z,G;do{if(Z=$.window_size-$.lookahead-$.strstart,$.strstart>=q+(q-L2)){r0.arraySet($.window,$.window,q,q,0),$.match_start-=q,$.strstart-=q,$.block_start-=q,K=$.hash_size,Q=K;do J=$.head[--Q],$.head[Q]=J>=q?J-q:0;while(--K);K=q,Q=K;do J=$.prev[--Q],$.prev[Q]=J>=q?J-q:0;while(--K);Z+=q}if($.strm.avail_in===0)break;if(K=zZ($.strm,$.window,$.strstart+$.lookahead,Z),$.lookahead+=K,$.lookahead+$.insert>=f0){G=$.strstart-$.insert,$.ins_h=$.window[G],$.ins_h=($.ins_h<<$.hash_shift^$.window[G+1])&$.hash_mask;while($.insert)if($.ins_h=($.ins_h<<$.hash_shift^$.window[G+f0-1])&$.hash_mask,$.prev[G&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=G,G++,$.insert--,$.lookahead+$.insert$.pending_buf_size-5)Q=$.pending_buf_size-5;for(;;){if($.lookahead<=1){if(I1($),$.lookahead===0&&q===C1)return c0;if($.lookahead===0)break}$.strstart+=$.lookahead,$.lookahead=0;var K=$.block_start+Q;if($.strstart===0||$.strstart>=K){if($.lookahead=$.strstart-K,$.strstart=K,d0($,!1),$.strm.avail_out===0)return c0}if($.strstart-$.block_start>=$.w_size-L2){if(d0($,!1),$.strm.avail_out===0)return c0}}if($.insert=0,q===Z1){if(d0($,!0),$.strm.avail_out===0)return R1;return U6}if($.strstart>$.block_start){if(d0($,!1),$.strm.avail_out===0)return c0}return c0}function g4($,q){var Q,K;for(;;){if($.lookahead=f0)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f0-1])&$.hash_mask,Q=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if(Q!==0&&$.strstart-Q<=$.w_size-L2)$.match_length=kQ($,Q);if($.match_length>=f0)if(K=M2._tr_tally($,$.strstart-$.match_start,$.match_length-f0),$.lookahead-=$.match_length,$.match_length<=$.max_lazy_match&&$.lookahead>=f0){$.match_length--;do $.strstart++,$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f0-1])&$.hash_mask,Q=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.match_length!==0);$.strstart++}else $.strstart+=$.match_length,$.match_length=0,$.ins_h=$.window[$.strstart],$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+1])&$.hash_mask;else K=M2._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(K){if(d0($,!1),$.strm.avail_out===0)return c0}}if($.insert=$.strstart=f0)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f0-1])&$.hash_mask,Q=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;if($.prev_length=$.match_length,$.prev_match=$.match_start,$.match_length=f0-1,Q!==0&&$.prev_length<$.max_lazy_match&&$.strstart-Q<=$.w_size-L2){if($.match_length=kQ($,Q),$.match_length<=5&&($.strategy===lU||$.match_length===f0&&$.strstart-$.match_start>4096))$.match_length=f0-1}if($.prev_length>=f0&&$.match_length<=$.prev_length){J=$.strstart+$.lookahead-f0,K=M2._tr_tally($,$.strstart-1-$.prev_match,$.prev_length-f0),$.lookahead-=$.prev_length-1,$.prev_length-=2;do if(++$.strstart<=J)$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+f0-1])&$.hash_mask,Q=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.prev_length!==0);if($.match_available=0,$.match_length=f0-1,$.strstart++,K){if(d0($,!1),$.strm.avail_out===0)return c0}}else if($.match_available){if(K=M2._tr_tally($,0,$.window[$.strstart-1]),K)d0($,!1);if($.strstart++,$.lookahead--,$.strm.avail_out===0)return c0}else $.match_available=1,$.strstart++,$.lookahead--}if($.match_available)K=M2._tr_tally($,0,$.window[$.strstart-1]),$.match_available=0;if($.insert=$.strstart=f0&&$.strstart>0){if(J=$.strstart-1,K=G[J],K===G[++J]&&K===G[++J]&&K===G[++J]){Z=$.strstart+V1;do;while(K===G[++J]&&K===G[++J]&&K===G[++J]&&K===G[++J]&&K===G[++J]&&K===G[++J]&&K===G[++J]&&K===G[++J]&&J$.lookahead)$.match_length=$.lookahead}}if($.match_length>=f0)Q=M2._tr_tally($,1,$.match_length-f0),$.lookahead-=$.match_length,$.strstart+=$.match_length,$.match_length=0;else Q=M2._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(Q){if(d0($,!1),$.strm.avail_out===0)return c0}}if($.insert=0,q===Z1){if(d0($,!0),$.strm.avail_out===0)return R1;return U6}if($.last_lit){if(d0($,!1),$.strm.avail_out===0)return c0}return s6}function wZ($,q){var Q;for(;;){if($.lookahead===0){if(I1($),$.lookahead===0){if(q===C1)return c0;break}}if($.match_length=0,Q=M2._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++,Q){if(d0($,!1),$.strm.avail_out===0)return c0}}if($.insert=0,q===Z1){if(d0($,!0),$.strm.avail_out===0)return R1;return U6}if($.last_lit){if(d0($,!1),$.strm.avail_out===0)return c0}return s6}function h2($,q,Q,K,J){this.good_length=$,this.max_lazy=q,this.nice_length=Q,this.max_chain=K,this.func=J}var V6;V6=[new h2(0,0,0,0,FZ),new h2(4,4,8,4,g4),new h2(4,5,16,8,g4),new h2(4,6,32,32,g4),new h2(4,4,16,16,J6),new h2(8,16,32,32,J6),new h2(8,16,128,128,J6),new h2(8,32,128,256,J6),new h2(32,128,258,1024,J6),new h2(32,258,258,4096,J6)];function NZ($){$.window_size=2*$.w_size,J1($.head),$.max_lazy_match=V6[$.level].max_lazy,$.good_match=V6[$.level].good_length,$.nice_match=V6[$.level].nice_length,$.max_chain_length=V6[$.level].max_chain,$.strstart=0,$.block_start=0,$.lookahead=0,$.insert=0,$.match_length=$.prev_length=f0-1,$.match_available=0,$.ins_h=0}function YZ(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=m8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r0.Buf16(ZZ*2),this.dyn_dtree=new r0.Buf16((2*VZ+1)*2),this.bl_tree=new r0.Buf16((2*UZ+1)*2),J1(this.dyn_ltree),J1(this.dyn_dtree),J1(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r0.Buf16(GZ+1),this.heap=new r0.Buf16(2*A4+1),J1(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r0.Buf16(2*A4+1),J1(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function DQ($){var q;if(!$||!$.state)return U1($,w2);if($.total_in=$.total_out=0,$.data_type=eU,q=$.state,q.pending=0,q.pending_out=0,q.wrap<0)q.wrap=-q.wrap;return q.status=q.wrap?p8:f1,$.adler=q.wrap===2?0:1,q.last_flush=C1,M2._tr_init(q),x2}function LQ($){var q=DQ($);if(q===x2)NZ($.state);return q}function kZ($,q){if(!$||!$.state)return w2;if($.state.wrap!==2)return w2;return $.state.gzhead=q,x2}function HQ($,q,Q,K,J,Z){if(!$)return w2;var G=1;if(q===aU)q=6;if(K<0)G=0,K=-K;else if(K>15)G=2,K-=16;if(J<1||J>$Z||Q!==m8||K<8||K>15||q<0||q>9||Z<0||Z>sU)return U1($,w2);if(K===8)K=9;var W=new YZ;return $.state=W,W.strm=$,W.wrap=G,W.gzhead=null,W.w_bits=K,W.w_size=1<MQ||q<0)return $?U1($,w2):w2;if(K=$.state,!$.output||!$.input&&$.avail_in!==0||K.status===r6&&q!==Z1)return U1($,$.avail_out===0?j4:w2);if(K.strm=$,Q=K.last_flush,K.last_flush=q,K.status===p8)if(K.wrap===2)if($.adler=0,C0(K,31),C0(K,139),C0(K,8),!K.gzhead)C0(K,0),C0(K,0),C0(K,0),C0(K,0),C0(K,0),C0(K,K.level===9?2:K.strategy>=c8||K.level<2?4:0),C0(K,BZ),K.status=f1;else{if(C0(K,(K.gzhead.text?1:0)+(K.gzhead.hcrc?2:0)+(!K.gzhead.extra?0:4)+(!K.gzhead.name?0:8)+(!K.gzhead.comment?0:16)),C0(K,K.gzhead.time&255),C0(K,K.gzhead.time>>8&255),C0(K,K.gzhead.time>>16&255),C0(K,K.gzhead.time>>24&255),C0(K,K.level===9?2:K.strategy>=c8||K.level<2?4:0),C0(K,K.gzhead.os&255),K.gzhead.extra&&K.gzhead.extra.length)C0(K,K.gzhead.extra.length&255),C0(K,K.gzhead.extra.length>>8&255);if(K.gzhead.hcrc)$.adler=q1($.adler,K.pending_buf,K.pending,0);K.gzindex=0,K.status=X4}else{var G=m8+(K.w_bits-8<<4)<<8,W=-1;if(K.strategy>=c8||K.level<2)W=0;else if(K.level<6)W=1;else if(K.level===6)W=2;else W=3;if(G|=W<<6,K.strstart!==0)G|=WZ;if(G+=31-G%31,K.status=f1,l6(K,G),K.strstart!==0)l6(K,$.adler>>>16),l6(K,$.adler&65535);$.adler=1}if(K.status===X4)if(K.gzhead.extra){J=K.pending;while(K.gzindex<(K.gzhead.extra.length&65535)){if(K.pending===K.pending_buf_size){if(K.gzhead.hcrc&&K.pending>J)$.adler=q1($.adler,K.pending_buf,K.pending-J,J);if(K1($),J=K.pending,K.pending===K.pending_buf_size)break}C0(K,K.gzhead.extra[K.gzindex]&255),K.gzindex++}if(K.gzhead.hcrc&&K.pending>J)$.adler=q1($.adler,K.pending_buf,K.pending-J,J);if(K.gzindex===K.gzhead.extra.length)K.gzindex=0,K.status=b8}else K.status=b8;if(K.status===b8)if(K.gzhead.name){J=K.pending;do{if(K.pending===K.pending_buf_size){if(K.gzhead.hcrc&&K.pending>J)$.adler=q1($.adler,K.pending_buf,K.pending-J,J);if(K1($),J=K.pending,K.pending===K.pending_buf_size){Z=1;break}}if(K.gzindexJ)$.adler=q1($.adler,K.pending_buf,K.pending-J,J);if(Z===0)K.gzindex=0,K.status=n8}else K.status=n8;if(K.status===n8)if(K.gzhead.comment){J=K.pending;do{if(K.pending===K.pending_buf_size){if(K.gzhead.hcrc&&K.pending>J)$.adler=q1($.adler,K.pending_buf,K.pending-J,J);if(K1($),J=K.pending,K.pending===K.pending_buf_size){Z=1;break}}if(K.gzindexJ)$.adler=q1($.adler,K.pending_buf,K.pending-J,J);if(Z===0)K.status=d8}else K.status=d8;if(K.status===d8)if(K.gzhead.hcrc){if(K.pending+2>K.pending_buf_size)K1($);if(K.pending+2<=K.pending_buf_size)C0(K,$.adler&255),C0(K,$.adler>>8&255),$.adler=0,K.status=f1}else K.status=f1;if(K.pending!==0){if(K1($),$.avail_out===0)return K.last_flush=-1,x2}else if($.avail_in===0&&NQ(q)<=NQ(Q)&&q!==Z1)return U1($,j4);if(K.status===r6&&$.avail_in!==0)return U1($,j4);if($.avail_in!==0||K.lookahead!==0||q!==C1&&K.status!==r6){var B=K.strategy===c8?wZ(K,q):K.strategy===rU?MZ(K,q):V6[K.level].func(K,q);if(B===R1||B===U6)K.status=r6;if(B===c0||B===R1){if($.avail_out===0)K.last_flush=-1;return x2}if(B===s6){if(q===pU)M2._tr_align(K);else if(q!==MQ){if(M2._tr_stored_block(K,0,0,!1),q===iU){if(J1(K.head),K.lookahead===0)K.strstart=0,K.block_start=0,K.insert=0}}if(K1($),$.avail_out===0)return K.last_flush=-1,x2}}if(q!==Z1)return x2;if(K.wrap<=0)return wQ;if(K.wrap===2)C0(K,$.adler&255),C0(K,$.adler>>8&255),C0(K,$.adler>>16&255),C0(K,$.adler>>24&255),C0(K,$.total_in&255),C0(K,$.total_in>>8&255),C0(K,$.total_in>>16&255),C0(K,$.total_in>>24&255);else l6(K,$.adler>>>16),l6(K,$.adler&65535);if(K1($),K.wrap>0)K.wrap=-K.wrap;return K.pending!==0?x2:wQ}function HZ($){var q;if(!$||!$.state)return w2;if(q=$.state.status,q!==p8&&q!==X4&&q!==b8&&q!==n8&&q!==d8&&q!==f1&&q!==r6)return U1($,w2);return $.state=null,q===f1?U1($,oU):x2}function vZ($,q){var Q=q.length,K,J,Z,G,W,B,V,U;if(!$||!$.state)return w2;if(K=$.state,G=K.wrap,G===2||G===1&&K.status!==p8||K.lookahead)return w2;if(G===1)$.adler=YQ($.adler,q,Q,0);if(K.wrap=0,Q>=K.w_size){if(G===0)J1(K.head),K.strstart=0,K.block_start=0,K.insert=0;U=new r0.Buf8(K.w_size),r0.arraySet(U,q,Q-K.w_size,K.w_size,0),q=U,Q=K.w_size}W=$.avail_in,B=$.next_in,V=$.input,$.avail_in=Q,$.next_in=0,$.input=q,I1(K);while(K.lookahead>=f0){J=K.strstart,Z=K.lookahead-(f0-1);do K.ins_h=(K.ins_h<{var i8=d2(),fQ=!0,RQ=!0;try{String.fromCharCode.apply(null,[0])}catch($){fQ=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch($){RQ=!1}var t6=new i8.Buf8(256);for(P2=0;P2<256;P2++)t6[P2]=P2>=252?6:P2>=248?5:P2>=240?4:P2>=224?3:P2>=192?2:1;var P2;t6[254]=t6[254]=1;Z6.string2buf=function($){var q,Q,K,J,Z,G=$.length,W=0;for(J=0;J>>6,q[Z++]=128|Q&63;else if(Q<65536)q[Z++]=224|Q>>>12,q[Z++]=128|Q>>>6&63,q[Z++]=128|Q&63;else q[Z++]=240|Q>>>18,q[Z++]=128|Q>>>12&63,q[Z++]=128|Q>>>6&63,q[Z++]=128|Q&63}return q};function IQ($,q){if(q<65534){if($.subarray&&RQ||!$.subarray&&fQ)return String.fromCharCode.apply(null,i8.shrinkBuf($,q))}var Q="";for(var K=0;K4){W[K++]=65533,Q+=Z-1;continue}J&=Z===2?31:Z===3?15:7;while(Z>1&&Q1){W[K++]=65533;continue}if(J<65536)W[K++]=J;else J-=65536,W[K++]=55296|J>>10&1023,W[K++]=56320|J&1023}return IQ(W,K)};Z6.utf8border=function($,q){var Q;if(q=q||$.length,q>$.length)q=$.length;Q=q-1;while(Q>=0&&($[Q]&192)===128)Q--;if(Q<0)return q;if(Q===0)return q;return Q+t6[$[Q]]>q?Q:q}});var h4=N0((iz,CQ)=>{function fZ(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}CQ.exports=fZ});var XQ=N0((Q8)=>{var e6=vQ(),$8=d2(),O4=y4(),P4=_8(),RZ=h4(),AQ=Object.prototype.toString,IZ=0,x4=4,G6=0,jQ=1,gQ=2,CZ=-1,jZ=0,gZ=8;function j1($){if(!(this instanceof j1))return new j1($);this.options=$8.assign({level:CZ,method:gZ,chunkSize:16384,windowBits:15,memLevel:8,strategy:jZ,to:""},$||{});var q=this.options;if(q.raw&&q.windowBits>0)q.windowBits=-q.windowBits;else if(q.gzip&&q.windowBits>0&&q.windowBits<16)q.windowBits+=16;this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new RZ,this.strm.avail_out=0;var Q=e6.deflateInit2(this.strm,q.level,q.method,q.windowBits,q.memLevel,q.strategy);if(Q!==G6)throw Error(P4[Q]);if(q.header)e6.deflateSetHeader(this.strm,q.header);if(q.dictionary){var K;if(typeof q.dictionary==="string")K=O4.string2buf(q.dictionary);else if(AQ.call(q.dictionary)==="[object ArrayBuffer]")K=new Uint8Array(q.dictionary);else K=q.dictionary;if(Q=e6.deflateSetDictionary(this.strm,K),Q!==G6)throw Error(P4[Q]);this._dict_set=!0}}j1.prototype.push=function($,q){var Q=this.strm,K=this.options.chunkSize,J,Z;if(this.ended)return!1;if(Z=q===~~q?q:q===!0?x4:IZ,typeof $==="string")Q.input=O4.string2buf($);else if(AQ.call($)==="[object ArrayBuffer]")Q.input=new Uint8Array($);else Q.input=$;Q.next_in=0,Q.avail_in=Q.input.length;do{if(Q.avail_out===0)Q.output=new $8.Buf8(K),Q.next_out=0,Q.avail_out=K;if(J=e6.deflate(Q,Z),J!==jQ&&J!==G6)return this.onEnd(J),this.ended=!0,!1;if(Q.avail_out===0||Q.avail_in===0&&(Z===x4||Z===gQ))if(this.options.to==="string")this.onData(O4.buf2binstring($8.shrinkBuf(Q.output,Q.next_out)));else this.onData($8.shrinkBuf(Q.output,Q.next_out))}while((Q.avail_in>0||Q.avail_out===0)&&J!==jQ);if(Z===x4)return J=e6.deflateEnd(this.strm),this.onEnd(J),this.ended=!0,J===G6;if(Z===gQ)return this.onEnd(G6),Q.avail_out=0,!0;return!0};j1.prototype.onData=function($){this.chunks.push($)};j1.prototype.onEnd=function($){if($===G6)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=$8.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function T4($,q){var Q=new j1(q);if(Q.push($,!0),Q.err)throw Q.msg||P4[Q.err];return Q.result}function AZ($,q){return q=q||{},q.raw=!0,T4($,q)}function XZ($,q){return q=q||{},q.gzip=!0,T4($,q)}Q8.Deflate=j1;Q8.deflate=T4;Q8.deflateRaw=AZ;Q8.gzip=XZ});var hQ=N0((az,yQ)=>{var o8=30,yZ=12;yQ.exports=function(q,Q){var K,J,Z,G,W,B,V,U,w,F,M,k,f,L,D,z,N,H,v,j,n,d,_,X,P;K=q.state,J=q.next_in,X=q.input,Z=J+(q.avail_in-5),G=q.next_out,P=q.output,W=G-(Q-q.avail_out),B=G+(q.avail_out-257),V=K.dmax,U=K.wsize,w=K.whave,F=K.wnext,M=K.window,k=K.hold,f=K.bits,L=K.lencode,D=K.distcode,z=(1<>>24,k>>>=v,f-=v,v=H>>>16&255,v===0)P[G++]=H&65535;else if(v&16){if(j=H&65535,v&=15,v){if(f>>=v,f-=v}if(f<15)k+=X[J++]<>>24,k>>>=v,f-=v,v=H>>>16&255,v&16){if(n=H&65535,v&=15,fV){q.msg="invalid distance too far back",K.mode=o8;break $}if(k>>>=v,f-=v,v=G-W,n>v){if(v=n-v,v>w){if(K.sane){q.msg="invalid distance too far back",K.mode=o8;break $}}if(d=0,_=M,F===0){if(d+=U-v,v2)P[G++]=_[d++],P[G++]=_[d++],P[G++]=_[d++],j-=3;if(j){if(P[G++]=_[d++],j>1)P[G++]=_[d++]}}else{d=G-n;do P[G++]=P[d++],P[G++]=P[d++],P[G++]=P[d++],j-=3;while(j>2);if(j){if(P[G++]=P[d++],j>1)P[G++]=P[d++]}}}else if((v&64)===0){H=D[(H&65535)+(k&(1<>3,J-=j,f-=j<<3,k&=(1<{var xQ=d2(),W6=15,OQ=852,PQ=592,TQ=0,u4=1,uQ=2,hZ=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],xZ=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],OZ=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],PZ=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];SQ.exports=function(q,Q,K,J,Z,G,W,B){var V=B.bits,U=0,w=0,F=0,M=0,k=0,f=0,L=0,D=0,z=0,N=0,H,v,j,n,d,_=null,X=0,P,g=new xQ.Buf16(W6+1),c=new xQ.Buf16(W6+1),h=null,x=0,l,$0,Z0;for(U=0;U<=W6;U++)g[U]=0;for(w=0;w=1;M--)if(g[M]!==0)break;if(k>M)k=M;if(M===0)return Z[G++]=20971520,Z[G++]=20971520,B.bits=1,0;for(F=1;F0&&(q===TQ||M!==1))return-1;c[1]=0;for(U=1;UOQ||q===uQ&&z>PQ)return 1;for(;;){if(l=U-L,W[w]P)$0=h[x+W[w]],Z0=_[X+W[w]];else $0=96,Z0=0;H=1<>L)+v]=l<<24|$0<<16|Z0|0;while(v!==0);H=1<>=1;if(H!==0)N&=H-1,N+=H;else N=0;if(w++,--g[U]===0){if(U===M)break;U=Q[K+W[w]]}if(U>k&&(N&n)!==j){if(L===0)L=k;d+=F,f=U-L,D=1<OQ||q===uQ&&z>PQ)return 1;j=N&n,Z[j]=k<<24|f<<16|d-G|0}}if(N!==0)Z[d+N]=U-L<<24|4194304|0;return B.bits=k,0}});var Lq=N0((H2)=>{var U2=d2(),n4=I4(),T2=C4(),TZ=hQ(),q8=EQ(),uZ=0,Bq=1,zq=2,_Q=4,SZ=5,a8=6,g1=0,EZ=1,_Z=2,N2=-2,Fq=-3,d4=-4,cZ=-5,cQ=8,Mq=1,bQ=2,nQ=3,dQ=4,mQ=5,pQ=6,iQ=7,oQ=8,aQ=9,lQ=10,s8=11,p2=12,S4=13,rQ=14,E4=15,sQ=16,tQ=17,eQ=18,$q=19,l8=20,r8=21,Qq=22,qq=23,Kq=24,Jq=25,Vq=26,_4=27,Uq=28,Zq=29,x0=30,m4=31,bZ=32,nZ=852,dZ=592,mZ=15,pZ=mZ;function Gq($){return($>>>24&255)+($>>>8&65280)+(($&65280)<<8)+(($&255)<<24)}function iZ(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new U2.Buf16(320),this.work=new U2.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function wq($){var q;if(!$||!$.state)return N2;if(q=$.state,$.total_in=$.total_out=q.total=0,$.msg="",q.wrap)$.adler=q.wrap&1;return q.mode=Mq,q.last=0,q.havedict=0,q.dmax=32768,q.head=null,q.hold=0,q.bits=0,q.lencode=q.lendyn=new U2.Buf32(nZ),q.distcode=q.distdyn=new U2.Buf32(dZ),q.sane=1,q.back=-1,g1}function Nq($){var q;if(!$||!$.state)return N2;return q=$.state,q.wsize=0,q.whave=0,q.wnext=0,wq($)}function Yq($,q){var Q,K;if(!$||!$.state)return N2;if(K=$.state,q<0)Q=0,q=-q;else if(Q=(q>>4)+1,q<48)q&=15;if(q&&(q<8||q>15))return N2;if(K.window!==null&&K.wbits!==q)K.window=null;return K.wrap=Q,K.wbits=q,Nq($)}function kq($,q){var Q,K;if(!$)return N2;if(K=new iZ,$.state=K,K.window=null,Q=Yq($,q),Q!==g1)$.state=null;return Q}function oZ($){return kq($,pZ)}var Wq=!0,c4,b4;function aZ($){if(Wq){var q;c4=new U2.Buf32(512),b4=new U2.Buf32(32),q=0;while(q<144)$.lens[q++]=8;while(q<256)$.lens[q++]=9;while(q<280)$.lens[q++]=7;while(q<288)$.lens[q++]=8;q8(Bq,$.lens,0,288,c4,0,$.work,{bits:9}),q=0;while(q<32)$.lens[q++]=5;q8(zq,$.lens,0,32,b4,0,$.work,{bits:5}),Wq=!1}$.lencode=c4,$.lenbits=9,$.distcode=b4,$.distbits=5}function Dq($,q,Q,K){var J,Z=$.state;if(Z.window===null)Z.wsize=1<=Z.wsize)U2.arraySet(Z.window,q,Q-Z.wsize,Z.wsize,0),Z.wnext=0,Z.whave=Z.wsize;else{if(J=Z.wsize-Z.wnext,J>K)J=K;if(U2.arraySet(Z.window,q,Q-K,J,Z.wnext),K-=J,K)U2.arraySet(Z.window,q,Q-K,K,0),Z.wnext=K,Z.whave=Z.wsize;else{if(Z.wnext+=J,Z.wnext===Z.wsize)Z.wnext=0;if(Z.whave>>8&255,Q.check=T2(Q.check,_,2,0),V=0,U=0,Q.mode=bQ;break}if(Q.flags=0,Q.head)Q.head.done=!1;if(!(Q.wrap&1)||(((V&255)<<8)+(V>>8))%31){$.msg="incorrect header check",Q.mode=x0;break}if((V&15)!==cQ){$.msg="unknown compression method",Q.mode=x0;break}if(V>>>=4,U-=4,n=(V&15)+8,Q.wbits===0)Q.wbits=n;else if(n>Q.wbits){$.msg="invalid window size",Q.mode=x0;break}Q.dmax=1<>8&1;if(Q.flags&512)_[0]=V&255,_[1]=V>>>8&255,Q.check=T2(Q.check,_,2,0);V=0,U=0,Q.mode=nQ;case nQ:while(U<32){if(W===0)break $;W--,V+=K[Z++]<>>8&255,_[2]=V>>>16&255,_[3]=V>>>24&255,Q.check=T2(Q.check,_,4,0);V=0,U=0,Q.mode=dQ;case dQ:while(U<16){if(W===0)break $;W--,V+=K[Z++]<>8;if(Q.flags&512)_[0]=V&255,_[1]=V>>>8&255,Q.check=T2(Q.check,_,2,0);V=0,U=0,Q.mode=mQ;case mQ:if(Q.flags&1024){while(U<16){if(W===0)break $;W--,V+=K[Z++]<>>8&255,Q.check=T2(Q.check,_,2,0);V=0,U=0}else if(Q.head)Q.head.extra=null;Q.mode=pQ;case pQ:if(Q.flags&1024){if(M=Q.length,M>W)M=W;if(M){if(Q.head){if(n=Q.head.extra_len-Q.length,!Q.head.extra)Q.head.extra=Array(Q.head.extra_len);U2.arraySet(Q.head.extra,K,Z,M,n)}if(Q.flags&512)Q.check=T2(Q.check,K,M,Z);W-=M,Z+=M,Q.length-=M}if(Q.length)break $}Q.length=0,Q.mode=iQ;case iQ:if(Q.flags&2048){if(W===0)break $;M=0;do if(n=K[Z+M++],Q.head&&n&&Q.length<65536)Q.head.name+=String.fromCharCode(n);while(n&&M>9&1,Q.head.done=!0;$.adler=Q.check=0,Q.mode=p2;break;case lQ:while(U<32){if(W===0)break $;W--,V+=K[Z++]<>>=U&7,U-=U&7,Q.mode=_4;break}while(U<3){if(W===0)break $;W--,V+=K[Z++]<>>=1,U-=1,V&3){case 0:Q.mode=rQ;break;case 1:if(aZ(Q),Q.mode=l8,q===a8){V>>>=2,U-=2;break $}break;case 2:Q.mode=tQ;break;case 3:$.msg="invalid block type",Q.mode=x0}V>>>=2,U-=2;break;case rQ:V>>>=U&7,U-=U&7;while(U<32){if(W===0)break $;W--,V+=K[Z++]<>>16^65535)){$.msg="invalid stored block lengths",Q.mode=x0;break}if(Q.length=V&65535,V=0,U=0,Q.mode=E4,q===a8)break $;case E4:Q.mode=sQ;case sQ:if(M=Q.length,M){if(M>W)M=W;if(M>B)M=B;if(M===0)break $;U2.arraySet(J,K,Z,M,G),W-=M,Z+=M,B-=M,G+=M,Q.length-=M;break}Q.mode=p2;break;case tQ:while(U<14){if(W===0)break $;W--,V+=K[Z++]<>>=5,U-=5,Q.ndist=(V&31)+1,V>>>=5,U-=5,Q.ncode=(V&15)+4,V>>>=4,U-=4,Q.nlen>286||Q.ndist>30){$.msg="too many length or distance symbols",Q.mode=x0;break}Q.have=0,Q.mode=eQ;case eQ:while(Q.have>>=3,U-=3}while(Q.have<19)Q.lens[g[Q.have++]]=0;if(Q.lencode=Q.lendyn,Q.lenbits=7,X={bits:Q.lenbits},d=q8(uZ,Q.lens,0,19,Q.lencode,0,Q.work,X),Q.lenbits=X.bits,d){$.msg="invalid code lengths set",Q.mode=x0;break}Q.have=0,Q.mode=$q;case $q:while(Q.have>>24,z=L>>>16&255,N=L&65535,D<=U)break;if(W===0)break $;W--,V+=K[Z++]<>>=D,U-=D,Q.lens[Q.have++]=N;else{if(N===16){P=D+2;while(U>>=D,U-=D,Q.have===0){$.msg="invalid bit length repeat",Q.mode=x0;break}n=Q.lens[Q.have-1],M=3+(V&3),V>>>=2,U-=2}else if(N===17){P=D+3;while(U>>=D,U-=D,n=0,M=3+(V&7),V>>>=3,U-=3}else{P=D+7;while(U>>=D,U-=D,n=0,M=11+(V&127),V>>>=7,U-=7}if(Q.have+M>Q.nlen+Q.ndist){$.msg="invalid bit length repeat",Q.mode=x0;break}while(M--)Q.lens[Q.have++]=n}}if(Q.mode===x0)break;if(Q.lens[256]===0){$.msg="invalid code -- missing end-of-block",Q.mode=x0;break}if(Q.lenbits=9,X={bits:Q.lenbits},d=q8(Bq,Q.lens,0,Q.nlen,Q.lencode,0,Q.work,X),Q.lenbits=X.bits,d){$.msg="invalid literal/lengths set",Q.mode=x0;break}if(Q.distbits=6,Q.distcode=Q.distdyn,X={bits:Q.distbits},d=q8(zq,Q.lens,Q.nlen,Q.ndist,Q.distcode,0,Q.work,X),Q.distbits=X.bits,d){$.msg="invalid distances set",Q.mode=x0;break}if(Q.mode=l8,q===a8)break $;case l8:Q.mode=r8;case r8:if(W>=6&&B>=258){if($.next_out=G,$.avail_out=B,$.next_in=Z,$.avail_in=W,Q.hold=V,Q.bits=U,TZ($,F),G=$.next_out,J=$.output,B=$.avail_out,Z=$.next_in,K=$.input,W=$.avail_in,V=Q.hold,U=Q.bits,Q.mode===p2)Q.back=-1;break}Q.back=0;for(;;){if(L=Q.lencode[V&(1<>>24,z=L>>>16&255,N=L&65535,D<=U)break;if(W===0)break $;W--,V+=K[Z++]<>H)],D=L>>>24,z=L>>>16&255,N=L&65535,H+D<=U)break;if(W===0)break $;W--,V+=K[Z++]<>>=H,U-=H,Q.back+=H}if(V>>>=D,U-=D,Q.back+=D,Q.length=N,z===0){Q.mode=Vq;break}if(z&32){Q.back=-1,Q.mode=p2;break}if(z&64){$.msg="invalid literal/length code",Q.mode=x0;break}Q.extra=z&15,Q.mode=Qq;case Qq:if(Q.extra){P=Q.extra;while(U>>=Q.extra,U-=Q.extra,Q.back+=Q.extra}Q.was=Q.length,Q.mode=qq;case qq:for(;;){if(L=Q.distcode[V&(1<>>24,z=L>>>16&255,N=L&65535,D<=U)break;if(W===0)break $;W--,V+=K[Z++]<>H)],D=L>>>24,z=L>>>16&255,N=L&65535,H+D<=U)break;if(W===0)break $;W--,V+=K[Z++]<>>=H,U-=H,Q.back+=H}if(V>>>=D,U-=D,Q.back+=D,z&64){$.msg="invalid distance code",Q.mode=x0;break}Q.offset=N,Q.extra=z&15,Q.mode=Kq;case Kq:if(Q.extra){P=Q.extra;while(U>>=Q.extra,U-=Q.extra,Q.back+=Q.extra}if(Q.offset>Q.dmax){$.msg="invalid distance too far back",Q.mode=x0;break}Q.mode=Jq;case Jq:if(B===0)break $;if(M=F-B,Q.offset>M){if(M=Q.offset-M,M>Q.whave){if(Q.sane){$.msg="invalid distance too far back",Q.mode=x0;break}}if(M>Q.wnext)M-=Q.wnext,k=Q.wsize-M;else k=Q.wnext-M;if(M>Q.length)M=Q.length;f=Q.window}else f=J,k=G-Q.offset,M=Q.length;if(M>B)M=B;B-=M,Q.length-=M;do J[G++]=f[k++];while(--M);if(Q.length===0)Q.mode=r8;break;case Vq:if(B===0)break $;J[G++]=Q.length,B--,Q.mode=r8;break;case _4:if(Q.wrap){while(U<32){if(W===0)break $;W--,V|=K[Z++]<{Hq.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var fq=N0((tz,vq)=>{function eZ(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}vq.exports=eZ});var Iq=N0((J8)=>{var B6=Lq(),K8=d2(),t8=y4(),E0=p4(),i4=_8(),$G=h4(),QG=fq(),Rq=Object.prototype.toString;function A1($){if(!(this instanceof A1))return new A1($);this.options=K8.assign({chunkSize:16384,windowBits:0,to:""},$||{});var q=this.options;if(q.raw&&q.windowBits>=0&&q.windowBits<16){if(q.windowBits=-q.windowBits,q.windowBits===0)q.windowBits=-15}if(q.windowBits>=0&&q.windowBits<16&&!($&&$.windowBits))q.windowBits+=32;if(q.windowBits>15&&q.windowBits<48){if((q.windowBits&15)===0)q.windowBits|=15}this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new $G,this.strm.avail_out=0;var Q=B6.inflateInit2(this.strm,q.windowBits);if(Q!==E0.Z_OK)throw Error(i4[Q]);if(this.header=new QG,B6.inflateGetHeader(this.strm,this.header),q.dictionary){if(typeof q.dictionary==="string")q.dictionary=t8.string2buf(q.dictionary);else if(Rq.call(q.dictionary)==="[object ArrayBuffer]")q.dictionary=new Uint8Array(q.dictionary);if(q.raw){if(Q=B6.inflateSetDictionary(this.strm,q.dictionary),Q!==E0.Z_OK)throw Error(i4[Q])}}}A1.prototype.push=function($,q){var Q=this.strm,K=this.options.chunkSize,J=this.options.dictionary,Z,G,W,B,V,U=!1;if(this.ended)return!1;if(G=q===~~q?q:q===!0?E0.Z_FINISH:E0.Z_NO_FLUSH,typeof $==="string")Q.input=t8.binstring2buf($);else if(Rq.call($)==="[object ArrayBuffer]")Q.input=new Uint8Array($);else Q.input=$;Q.next_in=0,Q.avail_in=Q.input.length;do{if(Q.avail_out===0)Q.output=new K8.Buf8(K),Q.next_out=0,Q.avail_out=K;if(Z=B6.inflate(Q,E0.Z_NO_FLUSH),Z===E0.Z_NEED_DICT&&J)Z=B6.inflateSetDictionary(this.strm,J);if(Z===E0.Z_BUF_ERROR&&U===!0)Z=E0.Z_OK,U=!1;if(Z!==E0.Z_STREAM_END&&Z!==E0.Z_OK)return this.onEnd(Z),this.ended=!0,!1;if(Q.next_out){if(Q.avail_out===0||Z===E0.Z_STREAM_END||Q.avail_in===0&&(G===E0.Z_FINISH||G===E0.Z_SYNC_FLUSH))if(this.options.to==="string"){if(W=t8.utf8border(Q.output,Q.next_out),B=Q.next_out-W,V=t8.buf2string(Q.output,W),Q.next_out=B,Q.avail_out=K-B,B)K8.arraySet(Q.output,Q.output,W,B,0);this.onData(V)}else this.onData(K8.shrinkBuf(Q.output,Q.next_out))}if(Q.avail_in===0&&Q.avail_out===0)U=!0}while((Q.avail_in>0||Q.avail_out===0)&&Z!==E0.Z_STREAM_END);if(Z===E0.Z_STREAM_END)G=E0.Z_FINISH;if(G===E0.Z_FINISH)return Z=B6.inflateEnd(this.strm),this.onEnd(Z),this.ended=!0,Z===E0.Z_OK;if(G===E0.Z_SYNC_FLUSH)return this.onEnd(E0.Z_OK),Q.avail_out=0,!0;return!0};A1.prototype.onData=function($){this.chunks.push($)};A1.prototype.onEnd=function($){if($===E0.Z_OK)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=K8.flattenChunks(this.chunks);this.chunks=[],this.err=$,this.msg=this.strm.msg};function o4($,q){var Q=new A1(q);if(Q.push($,!0),Q.err)throw Q.msg||i4[Q.err];return Q.result}function qG($,q){return q=q||{},q.raw=!0,o4($,q)}J8.Inflate=A1;J8.inflate=o4;J8.inflateRaw=qG;J8.ungzip=o4});var gq=N0(($F,jq)=>{var KG=d2().assign,JG=XQ(),VG=Iq(),UG=p4(),Cq={};KG(Cq,JG,VG,UG);jq.exports=Cq});var Xq=N0(($5)=>{var ZG=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",GG=gq(),Aq=T0(),e8=V2(),WG=ZG?"uint8array":"array";$5.magic="\b\x00";function X1($,q){e8.call(this,"FlateWorker/"+$),this._pako=null,this._pakoAction=$,this._pakoOptions=q,this.meta={}}Aq.inherits(X1,e8);X1.prototype.processChunk=function($){if(this.meta=$.meta,this._pako===null)this._createPako();this._pako.push(Aq.transformTo(WG,$.data),!1)};X1.prototype.flush=function(){if(e8.prototype.flush.call(this),this._pako===null)this._createPako();this._pako.push([],!0)};X1.prototype.cleanUp=function(){e8.prototype.cleanUp.call(this),this._pako=null};X1.prototype._createPako=function(){this._pako=new GG[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var $=this;this._pako.onData=function(q){$.push({data:q,meta:$.meta})}};$5.compressWorker=function($){return new X1("Deflate",$)};$5.uncompressWorker=function(){return new X1("Inflate",{})}});var l4=N0((a4)=>{var yq=V2();a4.STORE={magic:"\x00\x00",compressWorker:function(){return new yq("STORE compression")},uncompressWorker:function(){return new yq("STORE decompression")}};a4.DEFLATE=Xq()});var r4=N0((y1)=>{y1.LOCAL_FILE_HEADER="PK\x03\x04";y1.CENTRAL_FILE_HEADER="PK\x01\x02";y1.CENTRAL_DIRECTORY_END="PK\x05\x06";y1.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07";y1.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06";y1.DATA_DESCRIPTOR="PK\x07\b"});var Pq=N0((JF,Oq)=>{var z6=T0(),F6=V2(),s4=e1(),hq=T8(),Q5=r4(),A0=function($,q){var Q="",K;for(K=0;K>>8;return Q},BG=function($,q){var Q=$;if(!$)Q=q?16893:33204;return(Q&65535)<<16},zG=function($){return($||0)&63},xq=function($,q,Q,K,J,Z){var{file:G,compression:W}=$,B=Z!==s4.utf8encode,V=z6.transformTo("string",Z(G.name)),U=z6.transformTo("string",s4.utf8encode(G.name)),w=G.comment,F=z6.transformTo("string",Z(w)),M=z6.transformTo("string",s4.utf8encode(w)),k=U.length!==G.name.length,f=M.length!==w.length,L,D,z="",N="",H="",v=G.dir,j=G.date,n={crc32:0,compressedSize:0,uncompressedSize:0};if(!q||Q)n.crc32=$.crc32,n.compressedSize=$.compressedSize,n.uncompressedSize=$.uncompressedSize;var d=0;if(q)d|=8;if(!B&&(k||f))d|=2048;var _=0,X=0;if(v)_|=16;if(J==="UNIX")X=798,_|=BG(G.unixPermissions,v);else X=20,_|=zG(G.dosPermissions,v);if(L=j.getUTCHours(),L=L<<6,L=L|j.getUTCMinutes(),L=L<<5,L=L|j.getUTCSeconds()/2,D=j.getUTCFullYear()-1980,D=D<<4,D=D|j.getUTCMonth()+1,D=D<<5,D=D|j.getUTCDate(),k)N=A0(1,1)+A0(hq(V),4)+U,z+="up"+A0(N.length,2)+N;if(f)H=A0(1,1)+A0(hq(F),4)+M,z+="uc"+A0(H.length,2)+H;var P="";P+=` +\x00`,P+=A0(d,2),P+=W.magic,P+=A0(L,2),P+=A0(D,2),P+=A0(n.crc32,4),P+=A0(n.compressedSize,4),P+=A0(n.uncompressedSize,4),P+=A0(V.length,2),P+=A0(z.length,2);var g=Q5.LOCAL_FILE_HEADER+P+V+z,c=Q5.CENTRAL_FILE_HEADER+A0(X,2)+P+A0(F.length,2)+"\x00\x00\x00\x00"+A0(_,4)+A0(K,4)+V+z+F;return{fileRecord:g,dirRecord:c}},FG=function($,q,Q,K,J){var Z="",G=z6.transformTo("string",J(K));return Z=Q5.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+A0($,2)+A0($,2)+A0(q,4)+A0(Q,4)+A0(G.length,2)+G,Z},MG=function($){var q="";return q=Q5.DATA_DESCRIPTOR+A0($.crc32,4)+A0($.compressedSize,4)+A0($.uncompressedSize,4),q};function v2($,q,Q,K){F6.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=q,this.zipPlatform=Q,this.encodeFileName=K,this.streamFiles=$,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}z6.inherits(v2,F6);v2.prototype.push=function($){var q=$.meta.percent||0,Q=this.entriesCount,K=this._sources.length;if(this.accumulate)this.contentBuffer.push($);else this.bytesWritten+=$.data.length,F6.prototype.push.call(this,{data:$.data,meta:{currentFile:this.currentFile,percent:Q?(q+100*(Q-K-1))/Q:100}})};v2.prototype.openedSource=function($){this.currentSourceOffset=this.bytesWritten,this.currentFile=$.file.name;var q=this.streamFiles&&!$.file.dir;if(q){var Q=xq($,q,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:Q.fileRecord,meta:{percent:0}})}else this.accumulate=!0};v2.prototype.closedSource=function($){this.accumulate=!1;var q=this.streamFiles&&!$.file.dir,Q=xq($,q,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(Q.dirRecord),q)this.push({data:MG($),meta:{percent:100}});else{this.push({data:Q.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};v2.prototype.flush=function(){var $=this.bytesWritten;for(var q=0;q{var wG=l4(),NG=Pq(),YG=function($,q){var Q=$||q,K=wG[Q];if(!K)throw Error(Q+" is not a valid compression method !");return K};Tq.generateWorker=function($,q,Q){var K=new NG(q.streamFiles,Q,q.platform,q.encodeFileName),J=0;try{$.forEach(function(Z,G){J++;var W=YG(G.options.compression,q.compression),B=G.options.compressionOptions||q.compressionOptions||{},V=G.dir,U=G.date;G._compressWorker(W,B).withStreamInfo("file",{name:Z,dir:V,date:U,comment:G.comment||"",unixPermissions:G.unixPermissions,dosPermissions:G.dosPermissions}).pipe(K)}),K.entriesCount=J}catch(Z){K.error(Z)}return K}});var Eq=N0((UF,Sq)=>{var kG=T0(),q5=V2();function V8($,q){q5.call(this,"Nodejs stream input adapter for "+$),this._upstreamEnded=!1,this._bindStream(q)}kG.inherits(V8,q5);V8.prototype._bindStream=function($){var q=this;this._stream=$,$.pause(),$.on("data",function(Q){q.push({data:Q,meta:{percent:0}})}).on("error",function(Q){if(q.isPaused)this.generatedError=Q;else q.error(Q)}).on("end",function(){if(q.isPaused)q._upstreamEnded=!0;else q.end()})};V8.prototype.pause=function(){if(!q5.prototype.pause.call(this))return!1;return this._stream.pause(),!0};V8.prototype.resume=function(){if(!q5.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};Sq.exports=V8});var aq=N0((ZF,oq)=>{var DG=e1(),U8=T0(),nq=V2(),LG=q4(),dq=K4(),_q=u8(),HG=c$(),vG=uq(),cq=T6(),fG=Eq(),mq=function($,q,Q){var K=U8.getTypeOf(q),J,Z=U8.extend(Q||{},dq);if(Z.date=Z.date||new Date,Z.compression!==null)Z.compression=Z.compression.toUpperCase();if(typeof Z.unixPermissions==="string")Z.unixPermissions=parseInt(Z.unixPermissions,8);if(Z.unixPermissions&&Z.unixPermissions&16384)Z.dir=!0;if(Z.dosPermissions&&Z.dosPermissions&16)Z.dir=!0;if(Z.dir)$=pq($);if(Z.createFolders&&(J=RG($)))iq.call(this,J,!0);var G=K==="string"&&Z.binary===!1&&Z.base64===!1;if(!Q||typeof Q.binary>"u")Z.binary=!G;var W=q instanceof _q&&q.uncompressedSize===0;if(W||Z.dir||!q||q.length===0)Z.base64=!1,Z.binary=!0,q="",Z.compression="STORE",K="string";var B=null;if(q instanceof _q||q instanceof nq)B=q;else if(cq.isNode&&cq.isStream(q))B=new fG($,q);else B=U8.prepareContent($,q,Z.binary,Z.optimizedBinaryString,Z.base64);var V=new HG($,B,Z);this.files[$]=V},RG=function($){if($.slice(-1)==="/")$=$.substring(0,$.length-1);var q=$.lastIndexOf("/");return q>0?$.substring(0,q):""},pq=function($){if($.slice(-1)!=="/")$+="/";return $},iq=function($,q){if(q=typeof q<"u"?q:dq.createFolders,$=pq($),!this.files[$])mq.call(this,$,null,{dir:!0,createFolders:q});return this.files[$]};function bq($){return Object.prototype.toString.call($)==="[object RegExp]"}var IG={load:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function($){var q,Q,K;for(q in this.files)if(K=this.files[q],Q=q.slice(this.root.length,q.length),Q&&q.slice(0,this.root.length)===this.root)$(Q,K)},filter:function($){var q=[];return this.forEach(function(Q,K){if($(Q,K))q.push(K)}),q},file:function($,q,Q){if(arguments.length===1)if(bq($)){var K=$;return this.filter(function(Z,G){return!G.dir&&K.test(Z)})}else{var J=this.files[this.root+$];if(J&&!J.dir)return J;else return null}else $=this.root+$,mq.call(this,$,q,Q);return this},folder:function($){if(!$)return this;if(bq($))return this.filter(function(J,Z){return Z.dir&&$.test(J)});var q=this.root+$,Q=iq.call(this,q),K=this.clone();return K.root=Q.name,K},remove:function($){$=this.root+$;var q=this.files[$];if(!q){if($.slice(-1)!=="/")$+="/";q=this.files[$]}if(q&&!q.dir)delete this.files[$];else{var Q=this.filter(function(J,Z){return Z.name.slice(0,$.length)===$});for(var K=0;K{var CG=T0();function lq($){this.data=$,this.length=$.length,this.index=0,this.zero=0}lq.prototype={checkOffset:function($){this.checkIndex(this.index+$)},checkIndex:function($){if(this.length=this.index;Q--)q=(q<<8)+this.byteAt(Q);return this.index+=$,q},readString:function($){return CG.transformTo("string",this.readData($))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var $=this.readInt(4);return new Date(Date.UTC(($>>25&127)+1980,($>>21&15)-1,$>>16&31,$>>11&31,$>>5&63,($&31)<<1))}};rq.exports=lq});var e4=N0((WF,tq)=>{var sq=t4(),jG=T0();function M6($){sq.call(this,$);for(var q=0;q=0;--Z)if(this.data[Z]===q&&this.data[Z+1]===Q&&this.data[Z+2]===K&&this.data[Z+3]===J)return Z-this.zero;return-1};M6.prototype.readAndCheckSignature=function($){var q=$.charCodeAt(0),Q=$.charCodeAt(1),K=$.charCodeAt(2),J=$.charCodeAt(3),Z=this.readData(4);return q===Z[0]&&Q===Z[1]&&K===Z[2]&&J===Z[3]};M6.prototype.readData=function($){if(this.checkOffset($),$===0)return[];var q=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,q};tq.exports=M6});var QK=N0((BF,$K)=>{var eq=t4(),gG=T0();function w6($){eq.call(this,$)}gG.inherits(w6,eq);w6.prototype.byteAt=function($){return this.data.charCodeAt(this.zero+$)};w6.prototype.lastIndexOfSignature=function($){return this.data.lastIndexOf($)-this.zero};w6.prototype.readAndCheckSignature=function($){var q=this.readData(4);return $===q};w6.prototype.readData=function($){this.checkOffset($);var q=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,q};$K.exports=w6});var Q7=N0((zF,KK)=>{var qK=e4(),AG=T0();function $7($){qK.call(this,$)}AG.inherits($7,qK);$7.prototype.readData=function($){if(this.checkOffset($),$===0)return new Uint8Array(0);var q=this.data.subarray(this.zero+this.index,this.zero+this.index+$);return this.index+=$,q};KK.exports=$7});var UK=N0((FF,VK)=>{var JK=Q7(),XG=T0();function q7($){JK.call(this,$)}XG.inherits(q7,JK);q7.prototype.readData=function($){this.checkOffset($);var q=this.data.slice(this.zero+this.index,this.zero+this.index+$);return this.index+=$,q};VK.exports=q7});var K7=N0((MF,GK)=>{var K5=T0(),ZK=n2(),yG=e4(),hG=QK(),xG=UK(),OG=Q7();GK.exports=function($){var q=K5.getTypeOf($);if(K5.checkSupport(q),q==="string"&&!ZK.uint8array)return new hG($);if(q==="nodebuffer")return new xG($);if(ZK.uint8array)return new OG(K5.transformTo("uint8array",$));return new yG(K5.transformTo("array",$))}});var FK=N0((wF,zK)=>{var J7=K7(),G1=T0(),PG=u8(),WK=T8(),J5=e1(),V5=l4(),TG=n2(),uG=0,SG=3,EG=function($){for(var q in V5){if(!Object.prototype.hasOwnProperty.call(V5,q))continue;if(V5[q].magic===$)return V5[q]}return null};function BK($,q){this.options=$,this.loadOptions=q}BK.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},readLocalPart:function($){var q,Q;if($.skip(22),this.fileNameLength=$.readInt(2),Q=$.readInt(2),this.fileName=$.readData(this.fileNameLength),$.skip(Q),this.compressedSize===-1||this.uncompressedSize===-1)throw Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(q=EG(this.compressionMethod),q===null)throw Error("Corrupted zip : compression "+G1.pretty(this.compressionMethod)+" unknown (inner file : "+G1.transformTo("string",this.fileName)+")");this.decompressed=new PG(this.compressedSize,this.uncompressedSize,this.crc32,q,$.readData(this.compressedSize))},readCentralPart:function($){this.versionMadeBy=$.readInt(2),$.skip(2),this.bitFlag=$.readInt(2),this.compressionMethod=$.readString(2),this.date=$.readDate(),this.crc32=$.readInt(4),this.compressedSize=$.readInt(4),this.uncompressedSize=$.readInt(4);var q=$.readInt(2);if(this.extraFieldsLength=$.readInt(2),this.fileCommentLength=$.readInt(2),this.diskNumberStart=$.readInt(2),this.internalFileAttributes=$.readInt(2),this.externalFileAttributes=$.readInt(4),this.localHeaderOffset=$.readInt(4),this.isEncrypted())throw Error("Encrypted zip are not supported");$.skip(q),this.readExtraFields($),this.parseZIP64ExtraField($),this.fileComment=$.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var $=this.versionMadeBy>>8;if(this.dir=this.externalFileAttributes&16?!0:!1,$===uG)this.dosPermissions=this.externalFileAttributes&63;if($===SG)this.unixPermissions=this.externalFileAttributes>>16&65535;if(!this.dir&&this.fileNameStr.slice(-1)==="/")this.dir=!0},parseZIP64ExtraField:function(){if(!this.extraFields[1])return;var $=J7(this.extraFields[1].value);if(this.uncompressedSize===G1.MAX_VALUE_32BITS)this.uncompressedSize=$.readInt(8);if(this.compressedSize===G1.MAX_VALUE_32BITS)this.compressedSize=$.readInt(8);if(this.localHeaderOffset===G1.MAX_VALUE_32BITS)this.localHeaderOffset=$.readInt(8);if(this.diskNumberStart===G1.MAX_VALUE_32BITS)this.diskNumberStart=$.readInt(4)},readExtraFields:function($){var q=$.index+this.extraFieldsLength,Q,K,J;if(!this.extraFields)this.extraFields={};while($.index+4{var _G=K7(),i2=T0(),f2=r4(),cG=FK(),bG=n2();function MK($){this.files=[],this.loadOptions=$}MK.prototype={checkSignature:function($){if(!this.reader.readAndCheckSignature($)){this.reader.index-=4;var q=this.reader.readString(4);throw Error("Corrupted zip or bug: unexpected signature ("+i2.pretty(q)+", expected "+i2.pretty($)+")")}},isSignature:function($,q){var Q=this.reader.index;this.reader.setIndex($);var K=this.reader.readString(4),J=K===q;return this.reader.setIndex(Q),J},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var $=this.reader.readData(this.zipCommentLength),q=bG.uint8array?"uint8array":"array",Q=i2.transformTo(q,$);this.zipComment=this.loadOptions.decodeFileName(Q)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};var $=this.zip64EndOfCentralSize-44,q=0,Q,K,J;while(q<$)Q=this.reader.readInt(2),K=this.reader.readInt(4),J=this.reader.readData(K),this.zip64ExtensibleData[Q]={id:Q,length:K,value:J}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var $,q;for($=0;$0)if(this.isSignature(Q,f2.CENTRAL_FILE_HEADER));else this.reader.zero=J;else if(J<0)throw Error("Corrupted zip: missing "+Math.abs(J)+" bytes.")},prepareReader:function($){this.reader=_G($)},load:function($){this.prepareReader($),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};wK.exports=MK});var DK=N0((YF,kK)=>{var V7=T0(),U5=r1(),nG=e1(),dG=NK(),mG=U4(),YK=T6();function pG($){return new U5.Promise(function(q,Q){var K=$.decompressed.getContentWorker().pipe(new mG);K.on("error",function(J){Q(J)}).on("end",function(){if(K.streamInfo.crc32!==$.decompressed.crc32)Q(Error("Corrupted zip : CRC32 mismatch"));else q()}).resume()})}kK.exports=function($,q){var Q=this;if(q=V7.extend(q||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:nG.utf8decode}),YK.isNode&&YK.isStream($))return U5.Promise.reject(Error("JSZip can't accept a stream when loading a zip file."));return V7.prepareContent("the loaded zip file",$,!0,q.optimizedBinaryString,q.base64).then(function(K){var J=new dG(q);return J.load(K),J}).then(function(J){var Z=[U5.Promise.resolve(J)],G=J.files;if(q.checkCRC32)for(var W=0;W{function Y2(){if(!(this instanceof Y2))return new Y2;if(arguments.length)throw Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var $=new Y2;for(var q in this)if(typeof this[q]!=="function")$[q]=this[q];return $}}Y2.prototype=aq();Y2.prototype.loadAsync=DK();Y2.support=n2();Y2.defaults=K4();Y2.version="3.10.1";Y2.loadAsync=function($,q){return new Y2().loadAsync($,q)};Y2.external=r1();LK.exports=Y2});var Z8={};c1(Z8,{types:()=>QW,promisify:()=>jK,log:()=>RK,isUndefined:()=>N6,isSymbol:()=>KW,isString:()=>F5,isRegExp:()=>Z5,isPrimitive:()=>JW,isObject:()=>Y6,isNumber:()=>fK,isNullOrUndefined:()=>qW,isNull:()=>z5,isFunction:()=>W5,isError:()=>G5,isDate:()=>W7,isBuffer:()=>VW,isBoolean:()=>z7,isArray:()=>vK,inspect:()=>h1,inherits:()=>IK,format:()=>B7,deprecate:()=>oG,default:()=>GW,debuglog:()=>aG,callbackifyOnRejected:()=>w7,callbackify:()=>gK,_extend:()=>M7,TextEncoder:()=>AK,TextDecoder:()=>XK});function B7($,...q){if(!F5($)){var Q=[$];for(var K=0;K=J)return W;switch(W){case"%s":return String(q[K++]);case"%d":return Number(q[K++]);case"%j":try{return JSON.stringify(q[K++])}catch(B){return"[Circular]"}default:return W}});for(var G=q[K];K"u"||process?.noDeprecation===!0)return $;var Q=!1;function K(...J){if(!Q){if(process.throwDeprecation)throw Error(q);else if(process.traceDeprecation)console.trace(q);else console.error(q);Q=!0}return $.apply(this,...J)}return K}function lG($,q){var Q=h1.styles[q];if(Q)return"\x1B["+h1.colors[Q][0]+"m"+$+"\x1B["+h1.colors[Q][1]+"m";else return $}function rG($,q){return $}function sG($){var q={};return $.forEach(function(Q,K){q[Q]=!0}),q}function B5($,q,Q){if($.customInspect&&q&&W5(q.inspect)&&q.inspect!==h1&&!(q.constructor&&q.constructor.prototype===q)){var K=q.inspect(Q,$);if(!F5(K))K=B5($,K,Q);return K}var J=tG($,q);if(J)return J;var Z=Object.keys(q),G=sG(Z);if($.showHidden)Z=Object.getOwnPropertyNames(q);if(G5(q)&&(Z.indexOf("message")>=0||Z.indexOf("description")>=0))return U7(q);if(Z.length===0){if(W5(q)){var W=q.name?": "+q.name:"";return $.stylize("[Function"+W+"]","special")}if(Z5(q))return $.stylize(RegExp.prototype.toString.call(q),"regexp");if(W7(q))return $.stylize(Date.prototype.toString.call(q),"date");if(G5(q))return U7(q)}var B="",V=!1,U=["{","}"];if(vK(q))V=!0,U=["[","]"];if(W5(q)){var w=q.name?": "+q.name:"";B=" [Function"+w+"]"}if(Z5(q))B=" "+RegExp.prototype.toString.call(q);if(W7(q))B=" "+Date.prototype.toUTCString.call(q);if(G5(q))B=" "+U7(q);if(Z.length===0&&(!V||q.length==0))return U[0]+B+U[1];if(Q<0)if(Z5(q))return $.stylize(RegExp.prototype.toString.call(q),"regexp");else return $.stylize("[Object]","special");$.seen.push(q);var F;if(V)F=eG($,q,Q,G,Z);else F=Z.map(function(M){return G7($,q,Q,G,M,V)});return $.seen.pop(),$W(F,B,U)}function tG($,q){if(N6(q))return $.stylize("undefined","undefined");if(F5(q)){var Q="'"+JSON.stringify(q).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return $.stylize(Q,"string")}if(fK(q))return $.stylize(""+q,"number");if(z7(q))return $.stylize(""+q,"boolean");if(z5(q))return $.stylize("null","null")}function U7($){return"["+Error.prototype.toString.call($)+"]"}function eG($,q,Q,K,J){var Z=[];for(var G=0,W=q.length;G-1)if(Z)W=W.split(` `).map(function(V){return" "+V}).join(` `).slice(2);else W=` `+W.split(` `).map(function(V){return" "+V}).join(` -`)}else W=$.stylize("[Circular]","special");if(N6(G)){if(Z&&J.match(/^\d+$/))return W;if(G=JSON.stringify(""+J),G.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/))G=G.slice(1,-1),G=$.stylize(G,"name");else G=G.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),G=$.stylize(G,"string")}return G+": "+W}function lG($,q,Q){var K=0,J=$.reduce(function(Z,G){if(K++,G.indexOf(` +`)}else W=$.stylize("[Circular]","special");if(N6(G)){if(Z&&J.match(/^\d+$/))return W;if(G=JSON.stringify(""+J),G.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/))G=G.slice(1,-1),G=$.stylize(G,"name");else G=G.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),G=$.stylize(G,"string")}return G+": "+W}function $W($,q,Q){var K=0,J=$.reduce(function(Z,G){if(K++,G.indexOf(` `)>=0)K++;return Z+G.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(J>60)return Q[0]+(q===""?"":q+` `)+" "+$.join(`, - `)+" "+Q[1];return Q[0]+q+" "+$.join(", ")+" "+Q[1]}function HK($){return Array.isArray($)}function z7($){return typeof $==="boolean"}function z5($){return $===null}function sG($){return $==null}function vK($){return typeof $==="number"}function F5($){return typeof $==="string"}function tG($){return typeof $==="symbol"}function N6($){return $===void 0}function Z5($){return Y6($)&&F7($)==="[object RegExp]"}function Y6($){return typeof $==="object"&&$!==null}function W7($){return Y6($)&&F7($)==="[object Date]"}function G5($){return Y6($)&&(F7($)==="[object Error]"||$ instanceof Error)}function W5($){return typeof $==="function"}function eG($){return $===null||typeof $==="boolean"||typeof $==="number"||typeof $==="string"||typeof $==="symbol"||typeof $>"u"}function $W($){return $ instanceof Buffer}function F7($){return Object.prototype.toString.call($)}function Z7($){return $<10?"0"+$.toString(10):$.toString(10)}function qW(){var $=new Date,q=[Z7($.getHours()),Z7($.getMinutes()),Z7($.getSeconds())].join(":");return[$.getDate(),QW[$.getMonth()],q].join(" ")}function fK(...$){console.log("%s - %s",qW(),B7.apply(null,$))}function RK($,q){if(q)$.super_=q,$.prototype=Object.create(q.prototype,{constructor:{value:$,enumerable:!1,writable:!0,configurable:!0}})}function M7($,q){if(!q||!Y6(q))return $;var Q=Object.keys(q),K=Q.length;while(K--)$[Q[K]]=q[Q[K]];return $}function IK($,q){return Object.prototype.hasOwnProperty.call($,q)}function w7($,q){if(!$){var Q=Error("Promise was rejected with a falsy value");Q.reason=$,$=Q}return q($)}function jK($){if(typeof $!=="function")throw TypeError('The "original" argument must be of type Function');function q(...Q){var K=Q.pop();if(typeof K!=="function")throw TypeError("The last argument must be of type Function");var J=this,Z=function(...G){return K.apply(J,...G)};$.apply(this,Q).then(function(G){process.nextTick(Z.bind(null,null,G))},function(G){process.nextTick(w7.bind(null,G,Z))})}return Object.setPrototypeOf(q,Object.getPrototypeOf($)),Object.defineProperties(q,Object.getOwnPropertyDescriptors($)),q}var bG,dG,h1,rG=()=>{},QW,CK,gK,AK,KW;var G8=b1(()=>{bG=/%[sdj%]/g;dG=(($={},q={},Q)=>((Q=typeof process<"u"&&!1)&&(Q=Q.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase()),q=new RegExp("^"+Q+"$","i"),(K)=>{if(K=K.toUpperCase(),!$[K])if(q.test(K))$[K]=function(...J){console.error("%s: %s",K,pid,B7.apply(null,...J))};else $[K]=function(){};return $[K]}))(),h1=(($)=>($.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},$.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},$.custom=Symbol.for("nodejs.util.inspect.custom"),$))(function($,q,...Q){var K={seen:[],stylize:pG};if(Q.length>=1)K.depth=Q[0];if(Q.length>=2)K.colors=Q[1];if(z7(q))K.showHidden=q;else if(q)M7(K,q);if(N6(K.showHidden))K.showHidden=!1;if(N6(K.depth))K.depth=2;if(N6(K.colors))K.colors=!1;if(K.colors)K.stylize=mG;return B5(K,$,K.depth)});QW=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];CK=(($)=>($.custom=Symbol.for("nodejs.util.promisify.custom"),$))(function($){if(typeof $!=="function")throw TypeError('The "original" argument must be of type Function');if(kCustomPromisifiedSymbol&&$[kCustomPromisifiedSymbol]){var q=$[kCustomPromisifiedSymbol];if(typeof q!=="function")throw TypeError('The "nodejs.util.promisify.custom" argument must be of type Function');return Object.defineProperty(q,kCustomPromisifiedSymbol,{value:q,enumerable:!1,writable:!1,configurable:!0}),q}function q(...Q){var K,J,Z=new Promise(function(G,W){K=G,J=W});Q.push(function(G,W){if(G)J(G);else K(W)});try{$.apply(this,Q)}catch(G){J(G)}return Z}if(Object.setPrototypeOf(q,Object.getPrototypeOf($)),kCustomPromisifiedSymbol)Object.defineProperty(q,kCustomPromisifiedSymbol,{value:q,enumerable:!1,writable:!1,configurable:!0});return Object.defineProperties(q,Object.getOwnPropertyDescriptors($))});({TextEncoder:gK,TextDecoder:AK}=globalThis),KW={TextEncoder:gK,TextDecoder:AK,promisify:CK,log:fK,inherits:RK,_extend:M7,callbackifyOnRejected:w7,callbackify:jK}});var H7={};c1(H7,{resolveObject:()=>uK,resolve:()=>TK,parse:()=>D6,format:()=>PK,default:()=>MW,Url:()=>Z2,URLSearchParams:()=>xK,URL:()=>D7});function L7($){return typeof $==="string"}function OK($){return typeof $==="object"&&$!==null}function M5($){return $===null}function JW($){return $==null}function Z2(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function D6($,q,Q){if($&&OK($)&&$ instanceof Z2)return $;var K=new Z2;return K.parse($,q,Q),K}function PK($){if(L7($))$=D6($);if(!($ instanceof Z2))return Z2.prototype.format.call($);return $.format()}function TK($,q){return D6($,!1,!0).resolve(q)}function uK($,q){if(!$)return q;return D6($,!1,!0).resolveObject(q)}var D7,xK,VW,UW,ZW,GW,WW,N7,XK,yK,BW=255,hK,zW,FW,Y7,k6,k7,MW;var v7=b1(()=>{({URL:D7,URLSearchParams:xK}=globalThis);VW=/^([a-z0-9.+-]+:)/i,UW=/:[0-9]*$/,ZW=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,GW=["<",">",'"',"`"," ","\r",` -`,"\t"],WW=["{","}","|","\\","^","`"].concat(GW),N7=["'"].concat(WW),XK=["%","/","?",";","#"].concat(N7),yK=["/","?","#"],hK=/^[+a-z0-9A-Z_-]{0,63}$/,zW=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,FW={javascript:!0,"javascript:":!0},Y7={javascript:!0,"javascript:":!0},k6={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},k7={parse($){var q=decodeURIComponent;return($+"").replace(/\+/g," ").split("&").filter(Boolean).reduce(function(Q,K,J){var Z=K.split("="),G=q(Z[0]||""),W=q(Z[1]||""),B=Q[G];return Q[G]=B===void 0?W:[].concat(B,W),Q},{})},stringify($){var q=encodeURIComponent;return Object.keys($||{}).reduce(function(Q,K){return[].concat($[K]).forEach(function(J){Q.push(q(K)+"="+q(J))}),Q},[]).join("&").replace(/\s/g,"+")}};Z2.prototype.parse=function($,q,Q){if(!L7($))throw TypeError("Parameter 'url' must be a string, not "+typeof $);var K=$.indexOf("?"),J=K!==-1&&K<$.indexOf("#")?"?":"#",Z=$.split(J),G=/\\/g;Z[0]=Z[0].replace(G,"/"),$=Z.join(J);var W=$;if(W=W.trim(),!Q&&$.split("#").length===1){var B=ZW.exec(W);if(B){if(this.path=W,this.href=W,this.pathname=B[1],B[2])if(this.search=B[2],q)this.query=k7.parse(this.search.substr(1));else this.query=this.search.substr(1);else if(q)this.search="",this.query={};return this}}var V=VW.exec(W);if(V){V=V[0];var U=V.toLowerCase();this.protocol=U,W=W.substr(V.length)}if(Q||V||W.match(/^\/\/[^@\/]+@[^@\/]+/)){var w=W.substr(0,2)==="//";if(w&&!(V&&Y7[V]))W=W.substr(2),this.slashes=!0}if(!Y7[V]&&(w||V&&!k6[V])){var F=-1;for(var M=0;M127)v+="x";else v+=H[j];if(!v.match(hK)){var d=z.slice(0,M),_=z.slice(M+1),X=H.match(zW);if(X)d.push(X[1]),_.unshift(X[2]);if(_.length)W="/"+_.join(".")+W;this.hostname=d.join(".");break}}}}if(this.hostname.length>BW)this.hostname="";else this.hostname=this.hostname.toLowerCase();if(!D)this.hostname=new D7(`https://${this.hostname}`).hostname;var P=this.port?":"+this.port:"",g=this.hostname||"";if(this.host=g+P,this.href+=this.host,D){if(this.hostname=this.hostname.substr(1,this.hostname.length-2),W[0]!=="/")W="/"+W}}if(!FW[U])for(var M=0,N=N7.length;M0?Q.host.split("@"):!1;if(v)Q.auth=v.shift(),Q.host=Q.hostname=v.shift()}if(Q.search=$.search,Q.query=$.query,!M5(Q.pathname)||!M5(Q.search))Q.path=(Q.pathname?Q.pathname:"")+(Q.search?Q.search:"");return Q.href=Q.format(),Q}if(!z.length){if(Q.pathname=null,Q.search)Q.path="/"+Q.search;else Q.path=null;return Q.href=Q.format(),Q}var j=z.slice(-1)[0],n=(Q.host||$.host||z.length>1)&&(j==="."||j==="..")||j==="",d=0;for(var _=z.length;_>=0;_--)if(j=z[_],j===".")z.splice(_,1);else if(j==="..")z.splice(_,1),d++;else if(d)z.splice(_,1),d--;if(!L&&!D)for(;d--;d)z.unshift("..");if(L&&z[0]!==""&&(!z[0]||z[0].charAt(0)!=="/"))z.unshift("");if(n&&z.join("/").substr(-1)!=="/")z.push("");var X=z[0]===""||z[0]&&z[0].charAt(0)==="/";if(H){Q.hostname=Q.host=X?"":z.length?z.shift():"";var v=Q.host&&Q.host.indexOf("@")>0?Q.host.split("@"):!1;if(v)Q.auth=v.shift(),Q.host=Q.hostname=v.shift()}if(L=L||Q.host&&z.length,L&&!X)z.unshift("");if(!z.length)Q.pathname=null,Q.path=null;else Q.pathname=z.join("/");if(!M5(Q.pathname)||!M5(Q.search))Q.path=(Q.pathname?Q.pathname:"")+(Q.search?Q.search:"");return Q.auth=$.auth||Q.auth,Q.slashes=Q.slashes||$.slashes,Q.href=Q.format(),Q};Z2.prototype.parseHost=function(){var $=this.host,q=UW.exec($);if(q){if(q=q[0],q!==":")this.port=q.substr(1);$=$.substr(0,$.length-q.length)}if($)this.hostname=$};MW={parse:D6,resolve:TK,resolveObject:uK,format:PK,Url:Z2,URL:D7,URLSearchParams:xK}});var R7={};c1(R7,{request:()=>hW,globalAgent:()=>uW,get:()=>xW,default:()=>_W,STATUS_CODES:()=>SW,METHODS:()=>EW,IncomingMessage:()=>PW,ClientRequest:()=>OW,Agent:()=>TW});var wW,NW,SK,YW,kW,DW=($,q,Q)=>{Q=$!=null?wW(NW($)):{};let K=q||!$||!$.__esModule?SK(Q,"default",{value:$,enumerable:!0}):Q;for(let J of YW($))if(!kW.call(K,J))SK(K,J,{get:()=>$[J],enumerable:!0});return K},h0=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports),_K,LW,x1,HW,cK,O1,bK,vW,nK,L6,fW,EK,f7,RW,IW,dK,mK,CW,jW,pK,iK,gW,AW,XW,yW,oK,hW,xW,OW,PW,TW,uW,SW,EW,_W;var I7=b1(()=>{wW=Object.create,{getPrototypeOf:NW,defineProperty:SK,getOwnPropertyNames:YW}=Object,kW=Object.prototype.hasOwnProperty,_K=h0(($)=>{$.fetch=J(globalThis.fetch)&&J(globalThis.ReadableStream),$.writableStream=J(globalThis.WritableStream),$.abortController=J(globalThis.AbortController);var q;function Q(){if(q!==void 0)return q;if(globalThis.XMLHttpRequest){q=new globalThis.XMLHttpRequest;try{q.open("GET",globalThis.XDomainRequest?"/":"https://example.com")}catch(Z){q=null}}else q=null;return q}function K(Z){var G=Q();if(!G)return!1;try{return G.responseType=Z,G.responseType===Z}catch(W){}return!1}$.arraybuffer=$.fetch||K("arraybuffer"),$.msstream=!$.fetch&&K("ms-stream"),$.mozchunkedarraybuffer=!$.fetch&&K("moz-chunked-arraybuffer"),$.overrideMimeType=$.fetch||(Q()?J(Q().overrideMimeType):!1);function J(Z){return typeof Z==="function"}q=null}),LW=h0(($,q)=>{if(typeof Object.create==="function")q.exports=function(Q,K){if(K)Q.super_=K,Q.prototype=Object.create(K.prototype,{constructor:{value:Q,enumerable:!1,writable:!0,configurable:!0}})};else q.exports=function(Q,K){if(K){Q.super_=K;var J=function(){};J.prototype=K.prototype,Q.prototype=new J,Q.prototype.constructor=Q}}}),x1=h0(($,q)=>{try{if(Q=(G8(),X0(Z8)),typeof Q.inherits!=="function")throw"";q.exports=Q.inherits}catch(K){q.exports=LW()}var Q}),HW=h0(($,q)=>{function Q(L,D){var z=Object.keys(L);if(Object.getOwnPropertySymbols){var N=Object.getOwnPropertySymbols(L);D&&(N=N.filter(function(H){return Object.getOwnPropertyDescriptor(L,H).enumerable})),z.push.apply(z,N)}return z}function K(L){for(var D=1;D0)this.tail.next=z;else this.head=z;this.tail=z,++this.length}},{key:"unshift",value:function(D){var z={data:D,next:this.head};if(this.length===0)this.tail=z;this.head=z,++this.length}},{key:"shift",value:function(){if(this.length===0)return;var D=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,D}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(D){if(this.length===0)return"";var z=this.head,N=""+z.data;while(z=z.next)N+=D+z.data;return N}},{key:"concat",value:function(D){if(this.length===0)return w.alloc(0);var z=w.allocUnsafe(D>>>0),N=this.head,H=0;while(N)f(N.data,z,H),H+=N.data.length,N=N.next;return z}},{key:"consume",value:function(D,z){var N;if(Dv.length?v.length:D;if(j===v.length)H+=v;else H+=v.slice(0,D);if(D-=j,D===0){if(j===v.length)if(++N,z.next)this.head=z.next;else this.head=this.tail=null;else this.head=z,z.data=v.slice(j);break}++N}return this.length-=N,H}},{key:"_getBuffer",value:function(D){var z=w.allocUnsafe(D),N=this.head,H=1;N.data.copy(z),D-=N.data.length;while(N=N.next){var v=N.data,j=D>v.length?v.length:D;if(v.copy(z,z.length-D,0,j),D-=j,D===0){if(j===v.length)if(++H,N.next)this.head=N.next;else this.head=this.tail=null;else this.head=N,N.data=v.slice(j);break}++H}return this.length-=H,z}},{key:k,value:function(D,z){return M(this,K(K({},z),{},{depth:0,customInspect:!1}))}}]),L}()}),cK=h0(($,q)=>{function Q(B,V){var U=this,w=this._readableState&&this._readableState.destroyed,F=this._writableState&&this._writableState.destroyed;if(w||F){if(V)V(B);else if(B){if(!this._writableState)process.nextTick(G,this,B);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,process.nextTick(G,this,B)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy(B||null,function(M){if(!V&&M)if(!U._writableState)process.nextTick(K,U,M);else if(!U._writableState.errorEmitted)U._writableState.errorEmitted=!0,process.nextTick(K,U,M);else process.nextTick(J,U);else if(V)process.nextTick(J,U),V(M);else process.nextTick(J,U)}),this}function K(B,V){G(B,V),J(B)}function J(B){if(B._writableState&&!B._writableState.emitClose)return;if(B._readableState&&!B._readableState.emitClose)return;B.emit("close")}function Z(){if(this._readableState)this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1;if(this._writableState)this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1}function G(B,V){B.emit("error",V)}function W(B,V){var{_readableState:U,_writableState:w}=B;if(U&&U.autoDestroy||w&&w.autoDestroy)B.destroy(V);else B.emit("error",V)}q.exports={destroy:Q,undestroy:Z,errorOrDestroy:W}}),O1=h0(($,q)=>{var Q={};function K(B,V,U){if(!U)U=Error;function w(M,k,f){if(typeof V==="string")return V;else return V(M,k,f)}class F extends U{constructor(M,k,f){super(w(M,k,f))}}F.prototype.name=U.name,F.prototype.code=B,Q[B]=F}function J(B,V){if(Array.isArray(B)){let U=B.length;if(B=B.map((w)=>String(w)),U>2)return`one of ${V} ${B.slice(0,U-1).join(", ")}, or `+B[U-1];else if(U===2)return`one of ${V} ${B[0]} or ${B[1]}`;else return`of ${V} ${B[0]}`}else return`of ${V} ${String(B)}`}function Z(B,V,U){return B.substr(!U||U<0?0:+U,V.length)===V}function G(B,V,U){if(U===void 0||U>B.length)U=B.length;return B.substring(U-V.length,U)===V}function W(B,V,U){if(typeof U!=="number")U=0;if(U+V.length>B.length)return!1;else return B.indexOf(V,U)!==-1}K("ERR_INVALID_OPT_VALUE",function(B,V){return'The value "'+V+'" is invalid for option "'+B+'"'},TypeError),K("ERR_INVALID_ARG_TYPE",function(B,V,U){let w;if(typeof V==="string"&&Z(V,"not "))w="must not be",V=V.replace(/^not /,"");else w="must be";let F;if(G(B," argument"))F=`The ${B} ${w} ${J(V,"type")}`;else{let M=W(B,".")?"property":"argument";F=`The "${B}" ${M} ${w} ${J(V,"type")}`}return F+=`. Received type ${typeof U}`,F},TypeError),K("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),K("ERR_METHOD_NOT_IMPLEMENTED",function(B){return"The "+B+" method is not implemented"}),K("ERR_STREAM_PREMATURE_CLOSE","Premature close"),K("ERR_STREAM_DESTROYED",function(B){return"Cannot call "+B+" after a stream was destroyed"}),K("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),K("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),K("ERR_STREAM_WRITE_AFTER_END","write after end"),K("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),K("ERR_UNKNOWN_ENCODING",function(B){return"Unknown encoding: "+B},TypeError),K("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),$.codes=Q}),bK=h0(($,q)=>{var Q=O1().codes.ERR_INVALID_OPT_VALUE;function K(Z,G,W){return Z.highWaterMark!=null?Z.highWaterMark:G?Z[W]:null}function J(Z,G,W,B){var V=K(G,B,W);if(V!=null){if(!(isFinite(V)&&Math.floor(V)===V)||V<0){var U=B?W:"highWaterMark";throw new Q(U,V)}return Math.floor(V)}return Z.objectMode?16:16384}q.exports={getHighWaterMark:J}}),vW=h0(($,q)=>{q.exports=(G8(),X0(Z8)).deprecate}),nK=h0(($,q)=>{q.exports=X;function Q(S){var b=this;this.next=null,this.entry=null,this.finish=function(){w0(b,S)}}var K;X.WritableState=d;var J={deprecate:vW()},Z=a1(),G=(t0(),X0(K2)).Buffer,W=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function B(S){return G.from(S)}function V(S){return G.isBuffer(S)||S instanceof W}var U=cK(),w=bK(),F=w.getHighWaterMark,M=O1().codes,k=M.ERR_INVALID_ARG_TYPE,f=M.ERR_METHOD_NOT_IMPLEMENTED,L=M.ERR_MULTIPLE_CALLBACK,D=M.ERR_STREAM_CANNOT_PIPE,z=M.ERR_STREAM_DESTROYED,N=M.ERR_STREAM_NULL_VALUES,H=M.ERR_STREAM_WRITE_AFTER_END,v=M.ERR_UNKNOWN_ENCODING,j=U.errorOrDestroy;x1()(X,Z);function n(){}function d(S,b,O){if(K=K||L6(),S=S||{},typeof O!=="boolean")O=b instanceof K;if(this.objectMode=!!S.objectMode,O)this.objectMode=this.objectMode||!!S.writableObjectMode;this.highWaterMark=F(this,S,"writableHighWaterMark",O),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var E=S.decodeStrings===!1;this.decodeStrings=!E,this.defaultEncoding=S.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(a){Z0(b,a)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=S.emitClose!==!1,this.autoDestroy=!!S.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new Q(this)}d.prototype.getBuffer=function(){var S=this.bufferedRequest,b=[];while(S)b.push(S),S=S.next;return b},function(){try{Object.defineProperty(d.prototype,"buffer",{get:J.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(S){}}();var _;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")_=Function.prototype[Symbol.hasInstance],Object.defineProperty(X,Symbol.hasInstance,{value:function(S){if(_.call(this,S))return!0;if(this!==X)return!1;return S&&S._writableState instanceof d}});else _=function(S){return S instanceof this};function X(S){K=K||L6();var b=this instanceof K;if(!b&&!_.call(X,this))return new X(S);if(this._writableState=new d(S,this,b),this.writable=!0,S){if(typeof S.write==="function")this._write=S.write;if(typeof S.writev==="function")this._writev=S.writev;if(typeof S.destroy==="function")this._destroy=S.destroy;if(typeof S.final==="function")this._final=S.final}Z.call(this)}X.prototype.pipe=function(){j(this,new D)};function P(S,b){var O=new H;j(S,O),process.nextTick(b,O)}function g(S,b,O,E){var a;if(O===null)a=new N;else if(typeof O!=="string"&&!b.objectMode)a=new k("chunk",["string","Buffer"],O);if(a)return j(S,a),process.nextTick(E,a),!1;return!0}X.prototype.write=function(S,b,O){var E=this._writableState,a=!1,K0=!E.objectMode&&V(S);if(K0&&!G.isBuffer(S))S=B(S);if(typeof b==="function")O=b,b=null;if(K0)b="buffer";else if(!b)b=E.defaultEncoding;if(typeof O!=="function")O=n;if(E.ending)P(this,O);else if(K0||g(this,E,S,O))E.pendingcb++,a=h(this,E,K0,S,b,O);return a},X.prototype.cork=function(){this._writableState.corked++},X.prototype.uncork=function(){var S=this._writableState;if(S.corked){if(S.corked--,!S.writing&&!S.corked&&!S.bufferProcessing&&S.bufferedRequest)W0(this,S)}},X.prototype.setDefaultEncoding=function(S){if(typeof S==="string")S=S.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((S+"").toLowerCase())>-1))throw new v(S);return this._writableState.defaultEncoding=S,this},Object.defineProperty(X.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function c(S,b,O){if(!S.objectMode&&S.decodeStrings!==!1&&typeof b==="string")b=G.from(b,O);return b}Object.defineProperty(X.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function h(S,b,O,E,a,K0){if(!O){var R=c(b,E,a);if(E!==R)O=!0,a="buffer",E=R}var Y=b.objectMode?1:E.length;b.length+=Y;var C=b.length{var Q=Object.keys||function(w){var F=[];for(var M in w)F.push(M);return F};q.exports=B;var K=dK(),J=nK();x1()(B,K);{Z=Q(J.prototype);for(W=0;W{/*! safe-buffer. MIT License. Feross Aboukhadijeh */var Q=(t0(),X0(K2)),K=Q.Buffer;function J(G,W){for(var B in G)W[B]=G[B]}if(K.from&&K.alloc&&K.allocUnsafe&&K.allocUnsafeSlow)q.exports=Q;else J(Q,$),$.Buffer=Z;function Z(G,W,B){return K(G,W,B)}Z.prototype=Object.create(K.prototype),J(K,Z),Z.from=function(G,W,B){if(typeof G==="number")throw TypeError("Argument must not be a number");return K(G,W,B)},Z.alloc=function(G,W,B){if(typeof G!=="number")throw TypeError("Argument must be a number");var V=K(G);if(W!==void 0)if(typeof B==="string")V.fill(W,B);else V.fill(W);else V.fill(0);return V},Z.allocUnsafe=function(G){if(typeof G!=="number")throw TypeError("Argument must be a number");return K(G)},Z.allocUnsafeSlow=function(G){if(typeof G!=="number")throw TypeError("Argument must be a number");return Q.SlowBuffer(G)}}),EK=h0(($)=>{var q=fW().Buffer,Q=q.isEncoding||function(z){switch(z=""+z,z&&z.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function K(z){if(!z)return"utf8";var N;while(!0)switch(z){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return z;default:if(N)return;z=(""+z).toLowerCase(),N=!0}}function J(z){var N=K(z);if(typeof N!=="string"&&(q.isEncoding===Q||!Q(z)))throw Error("Unknown encoding: "+z);return N||z}$.StringDecoder=Z;function Z(z){this.encoding=J(z);var N;switch(this.encoding){case"utf16le":this.text=F,this.end=M,N=4;break;case"utf8":this.fillLast=V,N=4;break;case"base64":this.text=k,this.end=f,N=3;break;default:this.write=L,this.end=D;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=q.allocUnsafe(N)}Z.prototype.write=function(z){if(z.length===0)return"";var N,H;if(this.lastNeed){if(N=this.fillLast(z),N===void 0)return"";H=this.lastNeed,this.lastNeed=0}else H=0;if(H>5===6)return 2;else if(z>>4===14)return 3;else if(z>>3===30)return 4;return z>>6===2?-1:-2}function W(z,N,H){var v=N.length-1;if(v=0){if(j>0)z.lastNeed=j-1;return j}if(--v=0){if(j>0)z.lastNeed=j-2;return j}if(--v=0){if(j>0)if(j===2)j=0;else z.lastNeed=j-3;return j}return 0}function B(z,N,H){if((N[0]&192)!==128)return z.lastNeed=0,"�";if(z.lastNeed>1&&N.length>1){if((N[1]&192)!==128)return z.lastNeed=1,"�";if(z.lastNeed>2&&N.length>2){if((N[2]&192)!==128)return z.lastNeed=2,"�"}}}function V(z){var N=this.lastTotal-this.lastNeed,H=B(this,z,N);if(H!==void 0)return H;if(this.lastNeed<=z.length)return z.copy(this.lastChar,N,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);z.copy(this.lastChar,N,0,z.length),this.lastNeed-=z.length}function U(z,N){var H=W(this,z,N);if(!this.lastNeed)return z.toString("utf8",N);this.lastTotal=H;var v=z.length-(H-this.lastNeed);return z.copy(this.lastChar,0,v),z.toString("utf8",N,v)}function w(z){var N=z&&z.length?this.write(z):"";if(this.lastNeed)return N+"�";return N}function F(z,N){if((z.length-N)%2===0){var H=z.toString("utf16le",N);if(H){var v=H.charCodeAt(H.length-1);if(v>=55296&&v<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=z[z.length-2],this.lastChar[1]=z[z.length-1],H.slice(0,-1)}return H}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=z[z.length-1],z.toString("utf16le",N,z.length-1)}function M(z){var N=z&&z.length?this.write(z):"";if(this.lastNeed){var H=this.lastTotal-this.lastNeed;return N+this.lastChar.toString("utf16le",0,H)}return N}function k(z,N){var H=(z.length-N)%3;if(H===0)return z.toString("base64",N);if(this.lastNeed=3-H,this.lastTotal=3,H===1)this.lastChar[0]=z[z.length-1];else this.lastChar[0]=z[z.length-2],this.lastChar[1]=z[z.length-1];return z.toString("base64",N,z.length-H)}function f(z){var N=z&&z.length?this.write(z):"";if(this.lastNeed)return N+this.lastChar.toString("base64",0,3-this.lastNeed);return N}function L(z){return z.toString(this.encoding)}function D(z){return z&&z.length?this.write(z):""}}),f7=h0(($,q)=>{var Q=O1().codes.ERR_STREAM_PREMATURE_CLOSE;function K(W){var B=!1;return function(){if(B)return;B=!0;for(var V=arguments.length,U=Array(V),w=0;w{var Q;function K(v,j,n){if(j=J(j),j in v)Object.defineProperty(v,j,{value:n,enumerable:!0,configurable:!0,writable:!0});else v[j]=n;return v}function J(v){var j=Z(v,"string");return typeof j==="symbol"?j:String(j)}function Z(v,j){if(typeof v!=="object"||v===null)return v;var n=v[Symbol.toPrimitive];if(n!==void 0){var d=n.call(v,j||"default");if(typeof d!=="object")return d;throw TypeError("@@toPrimitive must return a primitive value.")}return(j==="string"?String:Number)(v)}var G=f7(),W=Symbol("lastResolve"),B=Symbol("lastReject"),V=Symbol("error"),U=Symbol("ended"),w=Symbol("lastPromise"),F=Symbol("handlePromise"),M=Symbol("stream");function k(v,j){return{value:v,done:j}}function f(v){var j=v[W];if(j!==null){var n=v[M].read();if(n!==null)v[w]=null,v[W]=null,v[B]=null,j(k(n,!1))}}function L(v){process.nextTick(f,v)}function D(v,j){return function(n,d){v.then(function(){if(j[U]){n(k(void 0,!0));return}j[F](n,d)},d)}}var z=Object.getPrototypeOf(function(){}),N=Object.setPrototypeOf((Q={get stream(){return this[M]},next:function(){var v=this,j=this[V];if(j!==null)return Promise.reject(j);if(this[U])return Promise.resolve(k(void 0,!0));if(this[M].destroyed)return new Promise(function(X,P){process.nextTick(function(){if(v[V])P(v[V]);else X(k(void 0,!0))})});var n=this[w],d;if(n)d=new Promise(D(n,this));else{var _=this[M].read();if(_!==null)return Promise.resolve(k(_,!1));d=new Promise(this[F])}return this[w]=d,d}},K(Q,Symbol.asyncIterator,function(){return this}),K(Q,"return",function(){var v=this;return new Promise(function(j,n){v[M].destroy(null,function(d){if(d){n(d);return}j(k(void 0,!0))})})}),Q),z),H=function(v){var j,n=Object.create(N,(j={},K(j,M,{value:v,writable:!0}),K(j,W,{value:null,writable:!0}),K(j,B,{value:null,writable:!0}),K(j,V,{value:null,writable:!0}),K(j,U,{value:v._readableState.endEmitted,writable:!0}),K(j,F,{value:function(d,_){var X=n[M].read();if(X)n[w]=null,n[W]=null,n[B]=null,d(k(X,!1));else n[W]=d,n[B]=_},writable:!0}),j));return n[w]=null,G(v,function(d){if(d&&d.code!=="ERR_STREAM_PREMATURE_CLOSE"){var _=n[B];if(_!==null)n[w]=null,n[W]=null,n[B]=null,_(d);n[V]=d;return}var X=n[W];if(X!==null)n[w]=null,n[W]=null,n[B]=null,X(k(void 0,!0));n[U]=!0}),v.on("readable",L.bind(null,n)),n};q.exports=H}),IW=h0(($,q)=>{function Q(w,F,M,k,f,L,D){try{var z=w[L](D),N=z.value}catch(H){M(H);return}if(z.done)F(N);else Promise.resolve(N).then(k,f)}function K(w){return function(){var F=this,M=arguments;return new Promise(function(k,f){var L=w.apply(F,M);function D(N){Q(L,k,f,D,z,"next",N)}function z(N){Q(L,k,f,D,z,"throw",N)}D(void 0)})}}function J(w,F){var M=Object.keys(w);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(w);F&&(k=k.filter(function(f){return Object.getOwnPropertyDescriptor(w,f).enumerable})),M.push.apply(M,k)}return M}function Z(w){for(var F=1;F{q.exports=g;var Q;g.ReadableState=P;var K=(i1(),X0(p1)).EventEmitter,J=function(R,Y){return R.listeners(Y).length},Z=a1(),G=(t0(),X0(K2)).Buffer,W=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function B(R){return G.from(R)}function V(R){return G.isBuffer(R)||R instanceof W}var U=(G8(),X0(Z8)),w;if(U&&U.debuglog)w=U.debuglog("stream");else w=function(){};var F=HW(),M=cK(),k=bK(),f=k.getHighWaterMark,L=O1().codes,D=L.ERR_INVALID_ARG_TYPE,z=L.ERR_STREAM_PUSH_AFTER_EOF,N=L.ERR_METHOD_NOT_IMPLEMENTED,H=L.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,v,j,n;x1()(g,Z);var d=M.errorOrDestroy,_=["error","close","destroy","pause","resume"];function X(R,Y,C){if(typeof R.prependListener==="function")return R.prependListener(Y,C);if(!R._events||!R._events[Y])R.on(Y,C);else if(Array.isArray(R._events[Y]))R._events[Y].unshift(C);else R._events[Y]=[C,R._events[Y]]}function P(R,Y,C){if(Q=Q||L6(),R=R||{},typeof C!=="boolean")C=Y instanceof Q;if(this.objectMode=!!R.objectMode,C)this.objectMode=this.objectMode||!!R.readableObjectMode;if(this.highWaterMark=f(this,R,"readableHighWaterMark",C),this.buffer=new F,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=R.emitClose!==!1,this.autoDestroy=!!R.autoDestroy,this.destroyed=!1,this.defaultEncoding=R.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,R.encoding){if(!v)v=EK().StringDecoder;this.decoder=new v(R.encoding),this.encoding=R.encoding}}function g(R){if(Q=Q||L6(),!(this instanceof g))return new g(R);var Y=this instanceof Q;if(this._readableState=new P(R,this,Y),this.readable=!0,R){if(typeof R.read==="function")this._read=R.read;if(typeof R.destroy==="function")this._destroy=R.destroy}Z.call(this)}Object.defineProperty(g.prototype,"destroyed",{enumerable:!1,get:function(){if(this._readableState===void 0)return!1;return this._readableState.destroyed},set:function(R){if(!this._readableState)return;this._readableState.destroyed=R}}),g.prototype.destroy=M.destroy,g.prototype._undestroy=M.undestroy,g.prototype._destroy=function(R,Y){Y(R)},g.prototype.push=function(R,Y){var C=this._readableState,u;if(!C.objectMode){if(typeof R==="string"){if(Y=Y||C.defaultEncoding,Y!==C.encoding)R=G.from(R,Y),Y="";u=!0}}else u=!0;return c(this,R,Y,!1,u)},g.prototype.unshift=function(R){return c(this,R,null,!0,!1)};function c(R,Y,C,u,e){w("readableAddChunk",Y);var r=R._readableState;if(Y===null)r.reading=!1,F0(R,r);else{var s;if(!e)s=x(r,Y);if(s)d(R,s);else if(r.objectMode||Y&&Y.length>0){if(typeof Y!=="string"&&!r.objectMode&&Object.getPrototypeOf(Y)!==G.prototype)Y=B(Y);if(u)if(r.endEmitted)d(R,new H);else h(R,r,Y,!0);else if(r.ended)d(R,new z);else if(r.destroyed)return!1;else if(r.reading=!1,r.decoder&&!C)if(Y=r.decoder.write(Y),r.objectMode||Y.length!==0)h(R,r,Y,!1);else y(R,r);else h(R,r,Y,!1)}else if(!u)r.reading=!1,y(R,r)}return!r.ended&&(r.length=l)R=l;else R--,R|=R>>>1,R|=R>>>2,R|=R>>>4,R|=R>>>8,R|=R>>>16,R++;return R}function Z0(R,Y){if(R<=0||Y.length===0&&Y.ended)return 0;if(Y.objectMode)return 1;if(R!==R)if(Y.flowing&&Y.length)return Y.buffer.head.data.length;else return Y.length;if(R>Y.highWaterMark)Y.highWaterMark=$0(R);if(R<=Y.length)return R;if(!Y.ended)return Y.needReadable=!0,0;return Y.length}g.prototype.read=function(R){w("read",R),R=parseInt(R,10);var Y=this._readableState,C=R;if(R!==0)Y.emittedReadable=!1;if(R===0&&Y.needReadable&&((Y.highWaterMark!==0?Y.length>=Y.highWaterMark:Y.length>0)||Y.ended)){if(w("read: emitReadable",Y.length,Y.ended),Y.length===0&&Y.ended)E(this);else p(this);return null}if(R=Z0(R,Y),R===0&&Y.ended){if(Y.length===0)E(this);return null}var u=Y.needReadable;if(w("need readable",u),Y.length===0||Y.length-R0)e=O(R,Y);else e=null;if(e===null)Y.needReadable=Y.length<=Y.highWaterMark,R=0;else Y.length-=R,Y.awaitDrain=0;if(Y.length===0){if(!Y.ended)Y.needReadable=!0;if(C!==R&&Y.ended)E(this)}if(e!==null)this.emit("data",e);return e};function F0(R,Y){if(w("onEofChunk"),Y.ended)return;if(Y.decoder){var C=Y.decoder.end();if(C&&C.length)Y.buffer.push(C),Y.length+=Y.objectMode?1:C.length}if(Y.ended=!0,Y.sync)p(R);else if(Y.needReadable=!1,!Y.emittedReadable)Y.emittedReadable=!0,W0(R)}function p(R){var Y=R._readableState;if(w("emitReadable",Y.needReadable,Y.emittedReadable),Y.needReadable=!1,!Y.emittedReadable)w("emitReadable",Y.flowing),Y.emittedReadable=!0,process.nextTick(W0,R)}function W0(R){var Y=R._readableState;if(w("emitReadable_",Y.destroyed,Y.length,Y.ended),!Y.destroyed&&(Y.length||Y.ended))R.emit("readable"),Y.emittedReadable=!1;Y.needReadable=!Y.flowing&&!Y.ended&&Y.length<=Y.highWaterMark,b(R)}function y(R,Y){if(!Y.readingMore)Y.readingMore=!0,process.nextTick(i,R,Y)}function i(R,Y){while(!Y.reading&&!Y.ended&&(Y.length1&&K0(u.pipes,R)!==-1)&&!G0)w("false write response, pause",u.awaitDrain),u.awaitDrain++;C.pause()}}function I0(O0){if(w("onerror",O0),q2(),R.removeListener("error",I0),J(R,"error")===0)d(R,O0)}X(R,"error",I0);function m0(){R.removeListener("finish",p0),q2()}R.once("close",m0);function p0(){w("onfinish"),R.removeListener("close",m0),q2()}R.once("finish",p0);function q2(){w("unpipe"),C.unpipe(R)}if(R.emit("pipe",C),!u.flowing)w("pipe resume"),C.resume();return R};function U0(R){return function(){var Y=R._readableState;if(w("pipeOnDrain",Y.awaitDrain),Y.awaitDrain)Y.awaitDrain--;if(Y.awaitDrain===0&&J(R,"data"))Y.flowing=!0,b(R)}}g.prototype.unpipe=function(R){var Y=this._readableState,C={hasUnpiped:!1};if(Y.pipesCount===0)return this;if(Y.pipesCount===1){if(R&&R!==Y.pipes)return this;if(!R)R=Y.pipes;if(Y.pipes=null,Y.pipesCount=0,Y.flowing=!1,R)R.emit("unpipe",this,C);return this}if(!R){var{pipes:u,pipesCount:e}=Y;Y.pipes=null,Y.pipesCount=0,Y.flowing=!1;for(var r=0;r0,u.flowing!==!1)this.resume()}else if(R==="readable"){if(!u.endEmitted&&!u.readableListening){if(u.readableListening=u.needReadable=!0,u.flowing=!1,u.emittedReadable=!1,w("on readable",u.length,u.reading),u.length)p(this);else if(!u.reading)process.nextTick(V0,this)}}return C},g.prototype.addListener=g.prototype.on,g.prototype.removeListener=function(R,Y){var C=Z.prototype.removeListener.call(this,R,Y);if(R==="readable")process.nextTick(m,this);return C},g.prototype.removeAllListeners=function(R){var Y=Z.prototype.removeAllListeners.apply(this,arguments);if(R==="readable"||R===void 0)process.nextTick(m,this);return Y};function m(R){var Y=R._readableState;if(Y.readableListening=R.listenerCount("readable")>0,Y.resumeScheduled&&!Y.paused)Y.flowing=!0;else if(R.listenerCount("data")>0)R.resume()}function V0(R){w("readable nexttick read 0"),R.read(0)}g.prototype.resume=function(){var R=this._readableState;if(!R.flowing)w("resume"),R.flowing=!R.readableListening,w0(this,R);return R.paused=!1,this};function w0(R,Y){if(!Y.resumeScheduled)Y.resumeScheduled=!0,process.nextTick(S,R,Y)}function S(R,Y){if(w("resume",Y.reading),!Y.reading)R.read(0);if(Y.resumeScheduled=!1,R.emit("resume"),b(R),Y.flowing&&!Y.reading)R.read(0)}g.prototype.pause=function(){if(w("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)w("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState.paused=!0,this};function b(R){var Y=R._readableState;w("flow",Y.flowing);while(Y.flowing&&R.read()!==null);}if(g.prototype.wrap=function(R){var Y=this,C=this._readableState,u=!1;R.on("end",function(){if(w("wrapped end"),C.decoder&&!C.ended){var s=C.decoder.end();if(s&&s.length)Y.push(s)}Y.push(null)}),R.on("data",function(s){if(w("wrapped data"),C.decoder)s=C.decoder.write(s);if(C.objectMode&&(s===null||s===void 0))return;else if(!C.objectMode&&(!s||!s.length))return;var T=Y.push(s);if(!T)u=!0,R.pause()});for(var e in R)if(this[e]===void 0&&typeof R[e]==="function")this[e]=function(s){return function(){return R[s].apply(R,arguments)}}(e);for(var r=0;r<_.length;r++)R.on(_[r],this.emit.bind(this,_[r]));return this._read=function(s){if(w("wrapped _read",s),u)u=!1,R.resume()},this},typeof Symbol==="function")g.prototype[Symbol.asyncIterator]=function(){if(j===void 0)j=RW();return j(this)};Object.defineProperty(g.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(g.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(g.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(R){if(this._readableState)this._readableState.flowing=R}}),g._fromList=O,Object.defineProperty(g.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function O(R,Y){if(Y.length===0)return null;var C;if(Y.objectMode)C=Y.buffer.shift();else if(!R||R>=Y.length){if(Y.decoder)C=Y.buffer.join("");else if(Y.buffer.length===1)C=Y.buffer.first();else C=Y.buffer.concat(Y.length);Y.buffer.clear()}else C=Y.buffer.consume(R,Y.decoder);return C}function E(R){var Y=R._readableState;if(w("endReadable",Y.endEmitted),!Y.endEmitted)Y.ended=!0,process.nextTick(a,Y,R)}function a(R,Y){if(w("endReadableNT",R.endEmitted,R.length),!R.endEmitted&&R.length===0){if(R.endEmitted=!0,Y.readable=!1,Y.emit("end"),R.autoDestroy){var C=Y._writableState;if(!C||C.autoDestroy&&C.finished)Y.destroy()}}}if(typeof Symbol==="function")g.from=function(R,Y){if(n===void 0)n=IW();return n(g,R,Y)};function K0(R,Y){for(var C=0,u=R.length;C{q.exports=V;var Q=O1().codes,K=Q.ERR_METHOD_NOT_IMPLEMENTED,J=Q.ERR_MULTIPLE_CALLBACK,Z=Q.ERR_TRANSFORM_ALREADY_TRANSFORMING,G=Q.ERR_TRANSFORM_WITH_LENGTH_0,W=L6();x1()(V,W);function B(F,M){var k=this._transformState;k.transforming=!1;var f=k.writecb;if(f===null)return this.emit("error",new J);if(k.writechunk=null,k.writecb=null,M!=null)this.push(M);f(F);var L=this._readableState;if(L.reading=!1,L.needReadable||L.length{q.exports=K;var Q=mK();x1()(K,Q);function K(J){if(!(this instanceof K))return new K(J);Q.call(this,J)}K.prototype._transform=function(J,Z,G){G(null,J)}}),jW=h0(($,q)=>{var Q;function K(k){var f=!1;return function(){if(f)return;f=!0,k.apply(void 0,arguments)}}var J=O1().codes,Z=J.ERR_MISSING_ARGS,G=J.ERR_STREAM_DESTROYED;function W(k){if(k)throw k}function B(k){return k.setHeader&&typeof k.abort==="function"}function V(k,f,L,D){D=K(D);var z=!1;if(k.on("close",function(){z=!0}),Q===void 0)Q=f7();Q(k,{readable:f,writable:L},function(H){if(H)return D(H);z=!0,D()});var N=!1;return function(H){if(z)return;if(N)return;if(N=!0,B(k))return k.abort();if(typeof k.destroy==="function")return k.destroy();D(H||new G("pipe"))}}function U(k){k()}function w(k,f){return k.pipe(f)}function F(k){if(!k.length)return W;if(typeof k[k.length-1]!=="function")return W;return k.pop()}function M(){for(var k=arguments.length,f=Array(k),L=0;L0;return V(H,j,n,function(d){if(!z)z=d;if(d)N.forEach(U);if(j)return;N.forEach(U),D(z)})});return f.reduce(w)}q.exports=M}),pK=h0(($,q)=>{var Q=a1();$=q.exports=dK(),$.Stream=Q||$,$.Readable=$,$.Writable=nK(),$.Duplex=L6(),$.Transform=mK(),$.PassThrough=CW(),$.finished=f7(),$.pipeline=jW()}),iK=h0(($)=>{var q=_K(),Q=x1(),K=pK(),J=$.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},Z=$.IncomingMessage=function(G,W,B,V){var U=this;if(K.Readable.call(U),U._mode=B,U.headers={},U.rawHeaders=[],U.trailers={},U.rawTrailers=[],U.on("end",function(){process.nextTick(function(){U.emit("close")})}),B==="fetch"){let D=function(){M.read().then(function(z){if(U._destroyed)return;if(V(z.done),z.done){U.push(null);return}U.push(Buffer.from(z.value)),D()}).catch(function(z){if(V(!0),!U._destroyed)U.emit("error",z)})};var w=D;if(U._fetchResponse=W,U.url=W.url,U.statusCode=W.status,U.statusMessage=W.statusText,W.headers.forEach(function(z,N){U.headers[N.toLowerCase()]=z,U.rawHeaders.push(N,z)}),q.writableStream){var F=new WritableStream({write:function(z){return V(!1),new Promise(function(N,H){if(U._destroyed)H();else if(U.push(Buffer.from(z)))N();else U._resumeFetch=N})},close:function(){if(V(!0),!U._destroyed)U.push(null)},abort:function(z){if(V(!0),!U._destroyed)U.emit("error",z)}});try{W.body.pipeTo(F).catch(function(z){if(V(!0),!U._destroyed)U.emit("error",z)});return}catch(z){}}var M=W.body.getReader();D()}else{U._xhr=G,U._pos=0,U.url=G.responseURL,U.statusCode=G.status,U.statusMessage=G.statusText;var k=G.getAllResponseHeaders().split(/\r?\n/);if(k.forEach(function(D){var z=D.match(/^([^:]+):\s*(.*)/);if(z){var N=z[1].toLowerCase();if(N==="set-cookie"){if(U.headers[N]===void 0)U.headers[N]=[];U.headers[N].push(z[2])}else if(U.headers[N]!==void 0)U.headers[N]+=", "+z[2];else U.headers[N]=z[2];U.rawHeaders.push(z[1],z[2])}}),U._charset="x-user-defined",!q.overrideMimeType){var f=U.rawHeaders["mime-type"];if(f){var L=f.match(/;\s*charset=([^;])(;|$)/);if(L)U._charset=L[1].toLowerCase()}if(!U._charset)U._charset="utf-8"}}};Q(Z,K.Readable),Z.prototype._read=function(){var G=this,W=G._resumeFetch;if(W)G._resumeFetch=null,W()},Z.prototype._onXHRProgress=function(G){var W=this,B=W._xhr,V=null;switch(W._mode){case"text":if(V=B.responseText,V.length>W._pos){var U=V.substr(W._pos);if(W._charset==="x-user-defined"){var w=Buffer.alloc(U.length);for(var F=0;FW._pos)W.push(Buffer.from(new Uint8Array(M.result.slice(W._pos)))),W._pos=M.result.byteLength},M.onload=function(){G(!0),W.push(null)},M.readAsArrayBuffer(V);break}if(W._xhr.readyState===J.DONE&&W._mode!=="ms-stream")G(!0),W.push(null)}}),gW=h0(($,q)=>{var Q=_K(),K=x1(),J=iK(),Z=pK(),G=J.IncomingMessage,W=J.readyStates;function B(F,M){if(Q.fetch&&M)return"fetch";else if(Q.mozchunkedarraybuffer)return"moz-chunked-arraybuffer";else if(Q.msstream)return"ms-stream";else if(Q.arraybuffer&&F)return"arraybuffer";else return"text"}var V=q.exports=function(F){var M=this;if(Z.Writable.call(M),M._opts=F,M._body=[],M._headers={},F.auth)M.setHeader("Authorization","Basic "+Buffer.from(F.auth).toString("base64"));Object.keys(F.headers).forEach(function(L){M.setHeader(L,F.headers[L])});var k,f=!0;if(F.mode==="disable-fetch"||"requestTimeout"in F&&!Q.abortController)f=!1,k=!0;else if(F.mode==="prefer-streaming")k=!1;else if(F.mode==="allow-wrong-content-type")k=!Q.overrideMimeType;else if(!F.mode||F.mode==="default"||F.mode==="prefer-fast")k=!0;else throw Error("Invalid value for opts.mode");M._mode=B(k,f),M._fetchTimer=null,M._socketTimeout=null,M._socketTimer=null,M.on("finish",function(){M._onFinish()})};K(V,Z.Writable),V.prototype.setHeader=function(F,M){var k=this,f=F.toLowerCase();if(w.indexOf(f)!==-1)return;k._headers[f]={name:F,value:M}},V.prototype.getHeader=function(F){var M=this._headers[F.toLowerCase()];if(M)return M.value;return null},V.prototype.removeHeader=function(F){var M=this;delete M._headers[F.toLowerCase()]},V.prototype._onFinish=function(){var F=this;if(F._destroyed)return;var M=F._opts;if("timeout"in M&&M.timeout!==0)F.setTimeout(M.timeout);var k=F._headers,f=null;if(M.method!=="GET"&&M.method!=="HEAD")f=new Blob(F._body,{type:(k["content-type"]||{}).value||""});var L=[];if(Object.keys(k).forEach(function(H){var v=k[H].name,j=k[H].value;if(Array.isArray(j))j.forEach(function(n){L.push([v,n])});else L.push([v,j])}),F._mode==="fetch"){var D=null;if(Q.abortController){var z=new AbortController;if(D=z.signal,F._fetchAbortController=z,"requestTimeout"in M&&M.requestTimeout!==0)F._fetchTimer=globalThis.setTimeout(function(){if(F.emit("requestTimeout"),F._fetchAbortController)F._fetchAbortController.abort()},M.requestTimeout)}globalThis.fetch(F._opts.url,{method:F._opts.method,headers:L,body:f||void 0,mode:"cors",credentials:M.withCredentials?"include":"same-origin",signal:D}).then(function(H){F._fetchResponse=H,F._resetTimers(!1),F._connect()},function(H){if(F._resetTimers(!0),!F._destroyed)F.emit("error",H)})}else{var N=F._xhr=new globalThis.XMLHttpRequest;try{N.open(F._opts.method,F._opts.url,!0)}catch(H){process.nextTick(function(){F.emit("error",H)});return}if("responseType"in N)N.responseType=F._mode;if("withCredentials"in N)N.withCredentials=!!M.withCredentials;if(F._mode==="text"&&"overrideMimeType"in N)N.overrideMimeType("text/plain; charset=x-user-defined");if("requestTimeout"in M)N.timeout=M.requestTimeout,N.ontimeout=function(){F.emit("requestTimeout")};if(L.forEach(function(H){N.setRequestHeader(H[0],H[1])}),F._response=null,N.onreadystatechange=function(){switch(N.readyState){case W.LOADING:case W.DONE:F._onXHRProgress();break}},F._mode==="moz-chunked-arraybuffer")N.onprogress=function(){F._onXHRProgress()};N.onerror=function(){if(F._destroyed)return;F._resetTimers(!0),F.emit("error",Error("XHR error"))};try{N.send(f)}catch(H){process.nextTick(function(){F.emit("error",H)});return}}};function U(F){try{var M=F.status;return M!==null&&M!==0}catch(k){return!1}}V.prototype._onXHRProgress=function(){var F=this;if(F._resetTimers(!1),!U(F._xhr)||F._destroyed)return;if(!F._response)F._connect();F._response._onXHRProgress(F._resetTimers.bind(F))},V.prototype._connect=function(){var F=this;if(F._destroyed)return;F._response=new G(F._xhr,F._fetchResponse,F._mode,F._resetTimers.bind(F)),F._response.on("error",function(M){F.emit("error",M)}),F.emit("response",F._response)},V.prototype._write=function(F,M,k){var f=this;f._body.push(F),k()},V.prototype._resetTimers=function(F){var M=this;if(globalThis.clearTimeout(M._socketTimer),M._socketTimer=null,F)globalThis.clearTimeout(M._fetchTimer),M._fetchTimer=null;else if(M._socketTimeout)M._socketTimer=globalThis.setTimeout(function(){M.emit("timeout")},M._socketTimeout)},V.prototype.abort=V.prototype.destroy=function(F){var M=this;if(M._destroyed=!0,M._resetTimers(!0),M._response)M._response._destroyed=!0;if(M._xhr)M._xhr.abort();else if(M._fetchAbortController)M._fetchAbortController.abort();if(F)M.emit("error",F)},V.prototype.end=function(F,M,k){var f=this;if(typeof F==="function")k=F,F=void 0;Z.Writable.prototype.end.call(f,F,M,k)},V.prototype.setTimeout=function(F,M){var k=this;if(M)k.once("timeout",M);k._socketTimeout=F,k._resetTimers(!1)},V.prototype.flushHeaders=function(){},V.prototype.setNoDelay=function(){},V.prototype.setSocketKeepAlive=function(){};var w=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}),AW=h0(($,q)=>{q.exports=K;var Q=Object.prototype.hasOwnProperty;function K(){var J={};for(var Z=0;Z{q.exports=(I7(),X0(R7)).STATUS_CODES}),yW=h0(($)=>{var q=gW(),Q=iK(),K=AW(),J=XW(),Z=(v7(),X0(H7)),G=$;G.request=function(W,B){if(typeof W==="string")W=Z.parse(W);else W=K(W);var V=globalThis.location.protocol.search(/^https?:$/)===-1?"http:":"",U=W.protocol||V,w=W.hostname||W.host,F=W.port,M=W.path||"/";if(w&&w.indexOf(":")!==-1)w="["+w+"]";W.url=(w?U+"//"+w:"")+(F?":"+F:"")+M,W.method=(W.method||"GET").toUpperCase(),W.headers=W.headers||{};var k=new q(W);if(B)k.on("response",B);return k},G.get=function(W,B){var V=G.request(W,B);return V.end(),V},G.ClientRequest=q,G.IncomingMessage=Q.IncomingMessage,G.Agent=function(){},G.Agent.defaultMaxSockets=4,G.globalAgent=new G.Agent,G.STATUS_CODES=J,G.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}),oK=DW(yW(),1),{request:hW,get:xW,ClientRequest:OW,IncomingMessage:PW,Agent:TW,globalAgent:uW,STATUS_CODES:SW,METHODS:EW}=oK.default,_W=oK.default});var rK={};c1(rK,{validateHeaderValue:()=>GB,validateHeaderName:()=>ZB,setMaxIdleHTTPParsers:()=>UB,request:()=>VB,maxHeaderSize:()=>JB,globalAgent:()=>KB,get:()=>qB,default:()=>WB,createServer:()=>QB,ServerResponse:()=>$B,Server:()=>eW,STATUS_CODES:()=>tW,OutgoingMessage:()=>sW,METHODS:()=>rW,IncomingMessage:()=>lW,ClientRequest:()=>aW,Agent:()=>oW});var cW,bW,aK,nW,dW,mW=($,q,Q)=>{Q=$!=null?cW(bW($)):{};let K=q||!$||!$.__esModule?aK(Q,"default",{value:$,enumerable:!0}):Q;for(let J of nW($))if(!dW.call(K,J))aK(K,J,{get:()=>$[J],enumerable:!0});return K},pW=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports),iW,lK,oW,aW,lW,rW,sW,tW,eW,$B,QB,qB,KB,JB,VB,UB,ZB,GB,WB;var sK=b1(()=>{cW=Object.create,{getPrototypeOf:bW,defineProperty:aK,getOwnPropertyNames:nW}=Object,dW=Object.prototype.hasOwnProperty,iW=pW(($,q)=>{var Q=(I7(),X0(R7)),K=(v7(),X0(H7)),J=$;for(Z in Q)if(Q.hasOwnProperty(Z))J[Z]=Q[Z];var Z;J.request=function(W,B){return W=G(W),Q.request.call(this,W,B)},J.get=function(W,B){return W=G(W),Q.get.call(this,W,B)};function G(W){if(typeof W==="string")W=K.parse(W);if(!W.protocol)W.protocol="https:";if(W.protocol!=="https:")throw Error('Protocol "'+W.protocol+'" not supported. Expected "https:"');return W}}),lK=mW(iW(),1),{Agent:oW,ClientRequest:aW,IncomingMessage:lW,METHODS:rW,OutgoingMessage:sW,STATUS_CODES:tW,Server:eW,ServerResponse:$B,createServer:QB,get:qB,globalAgent:KB,maxHeaderSize:JB,request:VB,setMaxIdleHTTPParsers:UB,validateHeaderName:ZB,validateHeaderValue:GB}=lK,WB=lK});var J9=globalThis;if(typeof J9.global>"u")J9.global=globalThis;t0();var Qz=q9(y9(),1);var _7=q9(LK(),1);function W2($,q,Q,K){function J(Z){return Z instanceof Q?Z:new Q(function(G){G(Z)})}return new(Q||(Q=Promise))(function(Z,G){function W(U){try{V(K.next(U))}catch(w){G(w)}}function B(U){try{V(K.throw(U))}catch(w){G(w)}}function V(U){U.done?Z(U.value):J(U.value).then(W,B)}V((K=K.apply($,q||[])).next())})}var L0=914400,w8=12700,n0=`\r -`,BB=2147483649,C7=/^[0-9a-fA-F]{6}$/,zB=1.67,FB=27,H6={type:"solid",color:"666666",pt:1},KJ=[0.05,0.1,0.05,0.1],v6={color:"363636",pt:1},u1={color:"888888",style:"solid",size:1,cap:"flat"},Q2="000000",k2=12,MB=18,f6="LAYOUT_16x9",h7="DEFAULT",JJ="333333",P1={type:"outer",blur:3,offset:1.811023622047244,angle:90,color:"000000",opacity:0.35,rotateWithShape:!0},M8=[0.5,0.5,0.5,0.5],tK={color:"000000"},wB={size:8,color:"FFFFFF",opacity:0.75},o2="2094734552",N5="2094734553",B8="2094734554",x7="2094734555",VJ="2094734556",W8="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),z8=["C0504D","4F81BD","9BBB59","8064A2","4BACC6","F79646","628FC6","C86360","C0504D","4F81BD","9BBB59","8064A2","4BACC6","F79646","628FC6","C86360"],NB=["5DA5DA","FAA43A","60BD68","F17CB0","B2912F","B276B2","DECF3F","F15854","A7A7A7","5DA5DA","FAA43A","60BD68","F17CB0","B2912F","B276B2","DECF3F","F15854","A7A7A7"],R6;(function($){$.left="left",$.center="center",$.right="right",$.justify="justify"})(R6||(R6={}));var I6;(function($){$.b="b",$.ctr="ctr",$.t="t"})(I6||(I6={}));var UJ="{F7021451-1387-4CA6-816F-3879F97B5CBC}",O7;(function($){$.arraybuffer="arraybuffer",$.base64="base64",$.binarystring="binarystring",$.blob="blob",$.nodebuffer="nodebuffer",$.uint8array="uint8array"})(O7||(O7={}));var P7;(function($){$.area="area",$.bar="bar",$.bar3d="bar3D",$.bubble="bubble",$.bubble3d="bubble3D",$.doughnut="doughnut",$.line="line",$.pie="pie",$.radar="radar",$.scatter="scatter"})(P7||(P7={}));var T7;(function($){$.accentBorderCallout1="accentBorderCallout1",$.accentBorderCallout2="accentBorderCallout2",$.accentBorderCallout3="accentBorderCallout3",$.accentCallout1="accentCallout1",$.accentCallout2="accentCallout2",$.accentCallout3="accentCallout3",$.actionButtonBackPrevious="actionButtonBackPrevious",$.actionButtonBeginning="actionButtonBeginning",$.actionButtonBlank="actionButtonBlank",$.actionButtonDocument="actionButtonDocument",$.actionButtonEnd="actionButtonEnd",$.actionButtonForwardNext="actionButtonForwardNext",$.actionButtonHelp="actionButtonHelp",$.actionButtonHome="actionButtonHome",$.actionButtonInformation="actionButtonInformation",$.actionButtonMovie="actionButtonMovie",$.actionButtonReturn="actionButtonReturn",$.actionButtonSound="actionButtonSound",$.arc="arc",$.bentArrow="bentArrow",$.bentUpArrow="bentUpArrow",$.bevel="bevel",$.blockArc="blockArc",$.borderCallout1="borderCallout1",$.borderCallout2="borderCallout2",$.borderCallout3="borderCallout3",$.bracePair="bracePair",$.bracketPair="bracketPair",$.callout1="callout1",$.callout2="callout2",$.callout3="callout3",$.can="can",$.chartPlus="chartPlus",$.chartStar="chartStar",$.chartX="chartX",$.chevron="chevron",$.chord="chord",$.circularArrow="circularArrow",$.cloud="cloud",$.cloudCallout="cloudCallout",$.corner="corner",$.cornerTabs="cornerTabs",$.cube="cube",$.curvedDownArrow="curvedDownArrow",$.curvedLeftArrow="curvedLeftArrow",$.curvedRightArrow="curvedRightArrow",$.curvedUpArrow="curvedUpArrow",$.custGeom="custGeom",$.decagon="decagon",$.diagStripe="diagStripe",$.diamond="diamond",$.dodecagon="dodecagon",$.donut="donut",$.doubleWave="doubleWave",$.downArrow="downArrow",$.downArrowCallout="downArrowCallout",$.ellipse="ellipse",$.ellipseRibbon="ellipseRibbon",$.ellipseRibbon2="ellipseRibbon2",$.flowChartAlternateProcess="flowChartAlternateProcess",$.flowChartCollate="flowChartCollate",$.flowChartConnector="flowChartConnector",$.flowChartDecision="flowChartDecision",$.flowChartDelay="flowChartDelay",$.flowChartDisplay="flowChartDisplay",$.flowChartDocument="flowChartDocument",$.flowChartExtract="flowChartExtract",$.flowChartInputOutput="flowChartInputOutput",$.flowChartInternalStorage="flowChartInternalStorage",$.flowChartMagneticDisk="flowChartMagneticDisk",$.flowChartMagneticDrum="flowChartMagneticDrum",$.flowChartMagneticTape="flowChartMagneticTape",$.flowChartManualInput="flowChartManualInput",$.flowChartManualOperation="flowChartManualOperation",$.flowChartMerge="flowChartMerge",$.flowChartMultidocument="flowChartMultidocument",$.flowChartOfflineStorage="flowChartOfflineStorage",$.flowChartOffpageConnector="flowChartOffpageConnector",$.flowChartOnlineStorage="flowChartOnlineStorage",$.flowChartOr="flowChartOr",$.flowChartPredefinedProcess="flowChartPredefinedProcess",$.flowChartPreparation="flowChartPreparation",$.flowChartProcess="flowChartProcess",$.flowChartPunchedCard="flowChartPunchedCard",$.flowChartPunchedTape="flowChartPunchedTape",$.flowChartSort="flowChartSort",$.flowChartSummingJunction="flowChartSummingJunction",$.flowChartTerminator="flowChartTerminator",$.folderCorner="folderCorner",$.frame="frame",$.funnel="funnel",$.gear6="gear6",$.gear9="gear9",$.halfFrame="halfFrame",$.heart="heart",$.heptagon="heptagon",$.hexagon="hexagon",$.homePlate="homePlate",$.horizontalScroll="horizontalScroll",$.irregularSeal1="irregularSeal1",$.irregularSeal2="irregularSeal2",$.leftArrow="leftArrow",$.leftArrowCallout="leftArrowCallout",$.leftBrace="leftBrace",$.leftBracket="leftBracket",$.leftCircularArrow="leftCircularArrow",$.leftRightArrow="leftRightArrow",$.leftRightArrowCallout="leftRightArrowCallout",$.leftRightCircularArrow="leftRightCircularArrow",$.leftRightRibbon="leftRightRibbon",$.leftRightUpArrow="leftRightUpArrow",$.leftUpArrow="leftUpArrow",$.lightningBolt="lightningBolt",$.line="line",$.lineInv="lineInv",$.mathDivide="mathDivide",$.mathEqual="mathEqual",$.mathMinus="mathMinus",$.mathMultiply="mathMultiply",$.mathNotEqual="mathNotEqual",$.mathPlus="mathPlus",$.moon="moon",$.noSmoking="noSmoking",$.nonIsoscelesTrapezoid="nonIsoscelesTrapezoid",$.notchedRightArrow="notchedRightArrow",$.octagon="octagon",$.parallelogram="parallelogram",$.pentagon="pentagon",$.pie="pie",$.pieWedge="pieWedge",$.plaque="plaque",$.plaqueTabs="plaqueTabs",$.plus="plus",$.quadArrow="quadArrow",$.quadArrowCallout="quadArrowCallout",$.rect="rect",$.ribbon="ribbon",$.ribbon2="ribbon2",$.rightArrow="rightArrow",$.rightArrowCallout="rightArrowCallout",$.rightBrace="rightBrace",$.rightBracket="rightBracket",$.round1Rect="round1Rect",$.round2DiagRect="round2DiagRect",$.round2SameRect="round2SameRect",$.roundRect="roundRect",$.rtTriangle="rtTriangle",$.smileyFace="smileyFace",$.snip1Rect="snip1Rect",$.snip2DiagRect="snip2DiagRect",$.snip2SameRect="snip2SameRect",$.snipRoundRect="snipRoundRect",$.squareTabs="squareTabs",$.star10="star10",$.star12="star12",$.star16="star16",$.star24="star24",$.star32="star32",$.star4="star4",$.star5="star5",$.star6="star6",$.star7="star7",$.star8="star8",$.stripedRightArrow="stripedRightArrow",$.sun="sun",$.swooshArrow="swooshArrow",$.teardrop="teardrop",$.trapezoid="trapezoid",$.triangle="triangle",$.upArrow="upArrow",$.upArrowCallout="upArrowCallout",$.upDownArrow="upDownArrow",$.upDownArrowCallout="upDownArrowCallout",$.uturnArrow="uturnArrow",$.verticalScroll="verticalScroll",$.wave="wave",$.wedgeEllipseCallout="wedgeEllipseCallout",$.wedgeRectCallout="wedgeRectCallout",$.wedgeRoundRectCallout="wedgeRoundRectCallout"})(T7||(T7={}));var G2;(function($){$.text1="tx1",$.text2="tx2",$.background1="bg1",$.background2="bg2",$.accent1="accent1",$.accent2="accent2",$.accent3="accent3",$.accent4="accent4",$.accent5="accent5",$.accent6="accent6"})(G2||(G2={}));var u7;(function($){$.left="left",$.center="center",$.right="right",$.justify="justify"})(u7||(u7={}));var S7;(function($){$.top="top",$.middle="middle",$.bottom="bottom"})(S7||(S7={}));var B1;(function($){$.ACTION_BUTTON_BACK_OR_PREVIOUS="actionButtonBackPrevious",$.ACTION_BUTTON_BEGINNING="actionButtonBeginning",$.ACTION_BUTTON_CUSTOM="actionButtonBlank",$.ACTION_BUTTON_DOCUMENT="actionButtonDocument",$.ACTION_BUTTON_END="actionButtonEnd",$.ACTION_BUTTON_FORWARD_OR_NEXT="actionButtonForwardNext",$.ACTION_BUTTON_HELP="actionButtonHelp",$.ACTION_BUTTON_HOME="actionButtonHome",$.ACTION_BUTTON_INFORMATION="actionButtonInformation",$.ACTION_BUTTON_MOVIE="actionButtonMovie",$.ACTION_BUTTON_RETURN="actionButtonReturn",$.ACTION_BUTTON_SOUND="actionButtonSound",$.ARC="arc",$.BALLOON="wedgeRoundRectCallout",$.BENT_ARROW="bentArrow",$.BENT_UP_ARROW="bentUpArrow",$.BEVEL="bevel",$.BLOCK_ARC="blockArc",$.CAN="can",$.CHART_PLUS="chartPlus",$.CHART_STAR="chartStar",$.CHART_X="chartX",$.CHEVRON="chevron",$.CHORD="chord",$.CIRCULAR_ARROW="circularArrow",$.CLOUD="cloud",$.CLOUD_CALLOUT="cloudCallout",$.CORNER="corner",$.CORNER_TABS="cornerTabs",$.CROSS="plus",$.CUBE="cube",$.CURVED_DOWN_ARROW="curvedDownArrow",$.CURVED_DOWN_RIBBON="ellipseRibbon",$.CURVED_LEFT_ARROW="curvedLeftArrow",$.CURVED_RIGHT_ARROW="curvedRightArrow",$.CURVED_UP_ARROW="curvedUpArrow",$.CURVED_UP_RIBBON="ellipseRibbon2",$.CUSTOM_GEOMETRY="custGeom",$.DECAGON="decagon",$.DIAGONAL_STRIPE="diagStripe",$.DIAMOND="diamond",$.DODECAGON="dodecagon",$.DONUT="donut",$.DOUBLE_BRACE="bracePair",$.DOUBLE_BRACKET="bracketPair",$.DOUBLE_WAVE="doubleWave",$.DOWN_ARROW="downArrow",$.DOWN_ARROW_CALLOUT="downArrowCallout",$.DOWN_RIBBON="ribbon",$.EXPLOSION1="irregularSeal1",$.EXPLOSION2="irregularSeal2",$.FLOWCHART_ALTERNATE_PROCESS="flowChartAlternateProcess",$.FLOWCHART_CARD="flowChartPunchedCard",$.FLOWCHART_COLLATE="flowChartCollate",$.FLOWCHART_CONNECTOR="flowChartConnector",$.FLOWCHART_DATA="flowChartInputOutput",$.FLOWCHART_DECISION="flowChartDecision",$.FLOWCHART_DELAY="flowChartDelay",$.FLOWCHART_DIRECT_ACCESS_STORAGE="flowChartMagneticDrum",$.FLOWCHART_DISPLAY="flowChartDisplay",$.FLOWCHART_DOCUMENT="flowChartDocument",$.FLOWCHART_EXTRACT="flowChartExtract",$.FLOWCHART_INTERNAL_STORAGE="flowChartInternalStorage",$.FLOWCHART_MAGNETIC_DISK="flowChartMagneticDisk",$.FLOWCHART_MANUAL_INPUT="flowChartManualInput",$.FLOWCHART_MANUAL_OPERATION="flowChartManualOperation",$.FLOWCHART_MERGE="flowChartMerge",$.FLOWCHART_MULTIDOCUMENT="flowChartMultidocument",$.FLOWCHART_OFFLINE_STORAGE="flowChartOfflineStorage",$.FLOWCHART_OFFPAGE_CONNECTOR="flowChartOffpageConnector",$.FLOWCHART_OR="flowChartOr",$.FLOWCHART_PREDEFINED_PROCESS="flowChartPredefinedProcess",$.FLOWCHART_PREPARATION="flowChartPreparation",$.FLOWCHART_PROCESS="flowChartProcess",$.FLOWCHART_PUNCHED_TAPE="flowChartPunchedTape",$.FLOWCHART_SEQUENTIAL_ACCESS_STORAGE="flowChartMagneticTape",$.FLOWCHART_SORT="flowChartSort",$.FLOWCHART_STORED_DATA="flowChartOnlineStorage",$.FLOWCHART_SUMMING_JUNCTION="flowChartSummingJunction",$.FLOWCHART_TERMINATOR="flowChartTerminator",$.FOLDED_CORNER="folderCorner",$.FRAME="frame",$.FUNNEL="funnel",$.GEAR_6="gear6",$.GEAR_9="gear9",$.HALF_FRAME="halfFrame",$.HEART="heart",$.HEPTAGON="heptagon",$.HEXAGON="hexagon",$.HORIZONTAL_SCROLL="horizontalScroll",$.ISOSCELES_TRIANGLE="triangle",$.LEFT_ARROW="leftArrow",$.LEFT_ARROW_CALLOUT="leftArrowCallout",$.LEFT_BRACE="leftBrace",$.LEFT_BRACKET="leftBracket",$.LEFT_CIRCULAR_ARROW="leftCircularArrow",$.LEFT_RIGHT_ARROW="leftRightArrow",$.LEFT_RIGHT_ARROW_CALLOUT="leftRightArrowCallout",$.LEFT_RIGHT_CIRCULAR_ARROW="leftRightCircularArrow",$.LEFT_RIGHT_RIBBON="leftRightRibbon",$.LEFT_RIGHT_UP_ARROW="leftRightUpArrow",$.LEFT_UP_ARROW="leftUpArrow",$.LIGHTNING_BOLT="lightningBolt",$.LINE_CALLOUT_1="borderCallout1",$.LINE_CALLOUT_1_ACCENT_BAR="accentCallout1",$.LINE_CALLOUT_1_BORDER_AND_ACCENT_BAR="accentBorderCallout1",$.LINE_CALLOUT_1_NO_BORDER="callout1",$.LINE_CALLOUT_2="borderCallout2",$.LINE_CALLOUT_2_ACCENT_BAR="accentCallout2",$.LINE_CALLOUT_2_BORDER_AND_ACCENT_BAR="accentBorderCallout2",$.LINE_CALLOUT_2_NO_BORDER="callout2",$.LINE_CALLOUT_3="borderCallout3",$.LINE_CALLOUT_3_ACCENT_BAR="accentCallout3",$.LINE_CALLOUT_3_BORDER_AND_ACCENT_BAR="accentBorderCallout3",$.LINE_CALLOUT_3_NO_BORDER="callout3",$.LINE_CALLOUT_4="borderCallout4",$.LINE_CALLOUT_4_ACCENT_BAR="accentCallout3=4",$.LINE_CALLOUT_4_BORDER_AND_ACCENT_BAR="accentBorderCallout4",$.LINE_CALLOUT_4_NO_BORDER="callout4",$.LINE="line",$.LINE_INVERSE="lineInv",$.MATH_DIVIDE="mathDivide",$.MATH_EQUAL="mathEqual",$.MATH_MINUS="mathMinus",$.MATH_MULTIPLY="mathMultiply",$.MATH_NOT_EQUAL="mathNotEqual",$.MATH_PLUS="mathPlus",$.MOON="moon",$.NON_ISOSCELES_TRAPEZOID="nonIsoscelesTrapezoid",$.NOTCHED_RIGHT_ARROW="notchedRightArrow",$.NO_SYMBOL="noSmoking",$.OCTAGON="octagon",$.OVAL="ellipse",$.OVAL_CALLOUT="wedgeEllipseCallout",$.PARALLELOGRAM="parallelogram",$.PENTAGON="homePlate",$.PIE="pie",$.PIE_WEDGE="pieWedge",$.PLAQUE="plaque",$.PLAQUE_TABS="plaqueTabs",$.QUAD_ARROW="quadArrow",$.QUAD_ARROW_CALLOUT="quadArrowCallout",$.RECTANGLE="rect",$.RECTANGULAR_CALLOUT="wedgeRectCallout",$.REGULAR_PENTAGON="pentagon",$.RIGHT_ARROW="rightArrow",$.RIGHT_ARROW_CALLOUT="rightArrowCallout",$.RIGHT_BRACE="rightBrace",$.RIGHT_BRACKET="rightBracket",$.RIGHT_TRIANGLE="rtTriangle",$.ROUNDED_RECTANGLE="roundRect",$.ROUNDED_RECTANGULAR_CALLOUT="wedgeRoundRectCallout",$.ROUND_1_RECTANGLE="round1Rect",$.ROUND_2_DIAG_RECTANGLE="round2DiagRect",$.ROUND_2_SAME_RECTANGLE="round2SameRect",$.SMILEY_FACE="smileyFace",$.SNIP_1_RECTANGLE="snip1Rect",$.SNIP_2_DIAG_RECTANGLE="snip2DiagRect",$.SNIP_2_SAME_RECTANGLE="snip2SameRect",$.SNIP_ROUND_RECTANGLE="snipRoundRect",$.SQUARE_TABS="squareTabs",$.STAR_10_POINT="star10",$.STAR_12_POINT="star12",$.STAR_16_POINT="star16",$.STAR_24_POINT="star24",$.STAR_32_POINT="star32",$.STAR_4_POINT="star4",$.STAR_5_POINT="star5",$.STAR_6_POINT="star6",$.STAR_7_POINT="star7",$.STAR_8_POINT="star8",$.STRIPED_RIGHT_ARROW="stripedRightArrow",$.SUN="sun",$.SWOOSH_ARROW="swooshArrow",$.TEAR="teardrop",$.TRAPEZOID="trapezoid",$.UP_ARROW="upArrow",$.UP_ARROW_CALLOUT="upArrowCallout",$.UP_DOWN_ARROW="upDownArrow",$.UP_DOWN_ARROW_CALLOUT="upDownArrowCallout",$.UP_RIBBON="ribbon2",$.U_TURN_ARROW="uturnArrow",$.VERTICAL_SCROLL="verticalScroll",$.WAVE="wave"})(B1||(B1={}));var q0;(function($){$.AREA="area",$.BAR="bar",$.BAR3D="bar3D",$.BUBBLE="bubble",$.BUBBLE3D="bubble3D",$.DOUGHNUT="doughnut",$.LINE="line",$.PIE="pie",$.RADAR="radar",$.SCATTER="scatter"})(q0||(q0={}));var D5;(function($){$.TEXT1="tx1",$.TEXT2="tx2",$.BACKGROUND1="bg1",$.BACKGROUND2="bg2",$.ACCENT1="accent1",$.ACCENT2="accent2",$.ACCENT3="accent3",$.ACCENT4="accent4",$.ACCENT5="accent5",$.ACCENT6="accent6"})(D5||(D5={}));var W1;(function($){$.chart="chart",$.image="image",$.line="line",$.rect="rect",$.text="text",$.placeholder="placeholder"})(W1||(W1={}));var D0;(function($){$.chart="chart",$.hyperlink="hyperlink",$.image="image",$.media="media",$.online="online",$.placeholder="placeholder",$.table="table",$.tablecell="tablecell",$.text="text",$.notes="notes"})(D0||(D0={}));var F8;(function($){$.title="title",$.body="body",$.image="pic",$.chart="chart",$.table="tbl",$.media="media"})(F8||(F8={}));var C6;(function($){$.DEFAULT="•",$.CHECK="✓",$.STAR="★",$.TRIANGLE="▶"})(C6||(C6={}));var j6="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAB3CAYAAAD1oOVhAAAGAUlEQVR4Xu2dT0xcRRzHf7tAYSsc0EBSIq2xEg8mtTGebVzEqOVIolz0siRE4gGTStqKwdpWsXoyGhMuyAVJOHBgqyvLNgonDkabeCBYW/8kTUr0wsJC+Wfm0bfuvn37Znbem9mR9303mJnf/Pb7ed95M7PDI5JIJPYJV5EC7e3t1N/fT62trdqViQCIu+bVgpIHEo/Hqbe3V/sdYVKHyWSSZmZm8ilVA0oeyNjYmEnaVC2Xvr6+qg5fAOJAz4DU1dURGzFSqZRVqtMpAFIGyMjICC0vL9PExIRWKADiAYTNshYWFrRCARAOEFZcCKWtrY0GBgaUTYkBRACIE4rKZwqACALR5RQAqQCIDqcASIVAVDsFQCSAqHQKgEgCUeUUAPEBRIVTAMQnEBvK5OQkbW9vk991CoAEAMQJxc86BUACAhKUUwAkQCBBOAVAAgbi1ykAogCIH6cAiCIgsk4BEIVAZJwCIIqBVLqiBxANQFgXS0tLND4+zl08AogmIG5OSSQS1gGKwgtANAIRcQqAaAbCe6YASBWA2E6xDyeyDUl7+AKQMkDYYevm5mZHabA/Li4uUiaTsYLau8QA4gLE/hU7wajyYtv1hReDAiAOxQcHBymbzark4BkbQKom/X8dp9Npmpqasn4BIAYAYSnYp+4BBEAMUcCwNOCQsAKZnp62NtQOw8WmwT09PUo+ijaHsOMx7GppaaH6+nolH0Z10K2tLVpdXbW6UfV3mNqBdHd3U1NTk2rtlMRfW1uj2dlZAFGirkRQAJEQTWUTAFGprkRsAJEQTWUTAFGprkRsAJEQTWUTAFGprkRsAJEQTWUTAFGprkRsAJEQTWUTAFGprkRsAJEQTWUTAGHqrm8caPzQ0WC1logbeiC7X3xJm0PvUmRzh45cuki1588FAmVn9BO6P3yF9utrqGH0MtW82S8UN9RA9v/4k7InjhcJFTs/TLVXLwmJV67S7vD7tHF5pKi46fYdosdOcOOGG8j1OcqefbFEJD9Q3GCwDhqT31HklS4A8VRgfYM2Op6k3bt/BQJl58J7lPvwg5JYNccepaMry0LPqFA7hCm39+NNyp2J0172b19QysGINj5CsRtpij57musOViH0QPJQXn6J9u7dlYJSFkbrMYolrwvDAJAC+WWdEpQz7FTgECeUCpzi6YxvvqXoM6eEhqnCSgDikEzUKUE7Aw7xuHctKB5OYU3dZlNR9syQdAaAcAYTC0pXF+39c09o2Ik+3EqxVKqiB7hbYAxZkk4pbBaEM+AQofv+wTrFwylBOQNABIGwavdfe4O2pg5elO+86l99nY58/VUF0byrYsjiSFluNlXYrOHcBar7+EogUADEQ0YRGHbzoKAASBkg2+9cpM1rV0tK2QOcXW7bLEFAARAXIF4w2DrDWoeUWaf4hQIgDiA8GPZ2iNfi0Q8UACkAIgrDbrJ385eDxaPLLrEsFAB5oG6lMPJQPLZZZKAACBGVhcG2Q+bmuLu2nk55e4jqPv1IeEoceiBeX7s2zCa5MAqdstl91vfXwaEGsv/rb5TtOFk6tWXOuJGh6KmnhO9sayrMninPx103JBtXblHkice58cINZP4Hyr5wpkgkdiChEmc4FWazLzenNKa/p0jncwDiqcD6BuWePk07t1asatZGoYQzSqA4nFJ7soNiP/+EUyfc25GI2GG53dHPrKo1g/1Cw4pIXLrzO+1c+/wg7tBbFDle/EbQcjFCPWQJCau5EoBoFpzXHYDwFNJcDiCaBed1ByA8hTSXA4hmwXndAQhPIc3lAKJZcF53AMJTSHM5gGgWnNcdgPAU0lwOIJoF53UHIDyFNJcfSiCdnZ0Ui8U0SxlMd7lcjubn561gh+Y1scFIU/0o/3sgeLO12E2k7UXKYumgFoAYdg8ACIAYpoBh6cAhAGKYAoalA4cAiGEKGJYOHAIghilgWDpwCIAYpoBh6cAhAGKYAoalA4cAiGEKGJYOHAIghilgWDpwCIAYpoBh6ZQ4JB6PKzviYthnNy4d9h+1M5mMlVckkUjsG5dhiBMCEMPg/wuOfrZZ/RSywQAAAABJRU5ErkJggg==",YB="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAB4AAAAVnCAYAAACzfHDVAAAAYHpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjaVcjJDYAwDEXBu6ughBfH+YnLQSwSHVA+Yrkwx7HtPHabHuEWrQ+lBBAZ6TMweBWoCwUH8quZH6VWFXVT696zxp12ARkVFEqn8wB8AAAACXBIWXMAAC4jAAAuIwF4pT92AADZLklEQVR42uzdd5hV9Z0/8M+dmcsUZmDovYOhKCiKYhR7JJuoSTCWGFI0WUxijBoTTXazVlyza4maYm9rTRSJigVsqCDNQhHBAogKCEgRMjMMU+7vj93sL8kqClLmnPt6PY+PeXZM9vP9vO8jZ+Y955xMfJLjorBrRMuSgmiViyjN1Ee2oSCyucbIBAAAAAAAAADbXaYgcoWNUZcrirpMbdRsysa69wbF+rggGrf439vSF7seF12aFUTnxvoosGIAAAAAAACAXacgoqEgF++/VRgr4r5o+Kh/pvD//F8uiII+LaPrum/EXzqui2b1ddHGKgEAAAAAAAB2rVxEQWMmWrQtjHZlA6N2w2tR84//zP8pgHu3ib6NBdG+zdqorK6KVUXZaB85j3sGAAAAAAAAaAoaG6OwIBdtyneP2PBabPzbr/1dAdx3VHRtyESHiIhcYzQrLo7WmVzkcjmPgAYAAAAAAABoSgpy0eIfS+D/LYD7fy3abC6Inn/7X2hsjELlLwAAAAAAAEDT9D8lcM1fHwddFBFxyAVR9M686PVp/gfqayKiJiLqLBMAAAAAAABgh8hGRGlEUekn/6PFEb3ikNgQk6O+KCJi6dzoksv83/cB/1X9xoiaJdmoWxlRV1dk2QAAAAAAAAA7QTZbH9muERX96v7n9t7/q6Exinq3i86LI94pjOOisHUu+uYykfmof7h+Y8Sa6aVRt74gGhs9DRoAAAAAAABgZ2lsLIi69QWxeUUmSjs0/vedwR8hk4uydSfE+wVd6qOyMfMx7/mtj9jwUtbjngEAAAAAAAB2obrqolg7IxtR/9Ffb4wo7P5GtCwobRaVH/c/UvNmNuqqPfIZAAAAAAAAYFerqy6KmjezH/v1ktpoVZBr/PgCeMN7yl8AAAAAAACApmJLHW5jUVQWNDSP+Q3ZeLco4i9/+8X6teHRzwAAAAAAAABNSd3/dLn/oLAoqqIuVhXFxhhSGB/xqGjlLwAAAAAAAECTU1eTjaK/KXSLIv7SWB+bc5ko9YxnAAAAAAAAgATJFv393bz1EeV//c8F1gMAAAAAAACQDgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKREkRUAAACwrUpLSwuGDRvWfMCAAS26du3avKysrLiioqKkZcuWzZs1a1bcvHnz0tLS0rJsNtusuLi4ebNmzUoLCgo+8/eijY2N9Zs3b66pra2tqqur21xTU1NdVVVVs2nTptqNGzdWbdiwoeYvf/nL5hUrVlQtWLBgw6xZs6pqamoaJQYAAEDaKYABAACIiIghQ4aUHnTQQW379u3bql27dq3at2/fpkWLFq2bN29eWVpa2qpZs2bNCwsLm2ez2fLCwsLyoqKi8sLCwtKknK+hoaG6vr6+qqGh4S91dXV/aWhoqNq8eXNVTU3NuqqqqvUbNmxYu2rVqjWrV69e99Zbb6177rnnPpgzZ06NTwYAAABJogAGAADIA8OGDWt+xBFHdBwwYECnLl26dGjdunXHFi1adCgtLe1YUlLSvlmzZq0KCgqK07yDwsLCssLCwrKIaPdp/zuNjY21mzdvXrdp06ZVNTU172/YsGHl2rVr31+2bNnKBQsWrHjyySffnzVrVpVPGAAAAE1Fpuexsd9HfaF+ZcSal0ptCAAAIAE6deqUPf744zvtueeeXbp3796lbdu2XSorKzuXlpZ2KS0t7VBYWFhhSztGQ0PDxpqampU1NTXL169fv+yDDz5Y9s477yybPXv2sj/96U8rVqxYUWdLAAAAbE9t9q6Jog4f/TUFMAAAQEJks9nMt7/97Y4jRozo1bdv397t2rXrXl5e3rWsrKxzcXFx+4gosKUmp7G2tnZVTU3Nso0bNy5btWrV0tdff/2tJ598cvG999672noAAADYFgpgAACAhPne977X6a9Fb/v27Xu1bNmyV1lZWa8kvXOXLauvr9/wl7/8ZdG6desWL1u2bNHChQsX/fGPf1w8derUjbYDAADAliiAAQAAmqhsNps59dRTuxx66KH9+/Tp87n27dv3Ly8v719UVOSRzXlq06ZNKzZu3Pj6+++//8abb775xqOPPvrG3XffvcpmAAAA+CsFMAAAQBNx6qmndvniF784qHfv3v3btWv3uYqKis8VFhaW2wxbUl9fv37Dhg1vfPDBB68vXrz4jccee2z+jTfeuNxmAAAA8pMCGAAAYBc45phjWn/rW9/aq3///kPatGnTv6Kiop9HOLO9NDQ0VG/cuPGtNWvWLFy4cOGcO+6445WHHnporc0AAACknwIYAABgJzjjjDO6f+lLX9qrV69eg1u3bj2orKysR0RkbIadJFddXb103bp18xcvXjz30UcffeXqq69+x1oAAADSRwEMAACwnZWWlhb86le/2u3QQw8d1r17931btmw5qLCwsMxmaEoaGhqqP/zww/nvvPPOzGeeeWbW2LFj36ipqWm0GQAAgGRTAAMAAGwHP/7xj7t+9atf3bdXr15D27Ztu1c2m21jKyRJXV3dmg8++OCVRYsWvfznP/95xh/+8IdltgIAAJA8CmAAAIBtcOKJJ7Y75ZRTDujXr9+w1q1bD81ms61shTSpq6tbt3bt2pfffPPNWbfccsvUe++9d7WtAAAANH0KYAAAgE+hoqKi4IILLhg0YsSI/bp27bpfy5YtB2YymUKbIR/kcrmGDz/8cP6777474/nnn59x4YUXvrZx40aPiwYAAGiCFMAAAAAf4/jjj2/7/e9//8D+/fsf2Lp1630KCgpKbAUiGhsbN61fv37eW2+9NeWGG2545u67715lKwAAAE2DAhgAAOB/ZLPZzAUXXPC5I4888sDu3bsfWFFRsVtEFNgMbFl1dfWSd999d8qsWbNmnnvuuS+vW7euwVYAAAB2DQUwAACQ10pLSwsuvfTSQYcccsjBXbt2HVFWVtbDVmDb1dbWrnr//fdfmDp16uRf/vKXL65evbreVgAAAHYeBTAAAJB3Bg0aVHrBBRd8fs899zywQ4cOBxQVFbWwFdj+Ghsba9euXTtrzpw5T59//vmTX3755WpbAQAA2LEUwAAAQF4YNmxY8/POO+/gIUOGHOZ9vrDz/W0ZfNFFFz07a9asKlsBAADY/hTAAABAarVq1arwyiuv3HfEiBEjO3TocFBhYWGZrcCu19DQUP3+++8/O2XKlIk/+clPZm7cuLHRVgAAALYPBTAAAJAqrVq1Kvztb3+7/3777Xd4x44dRxQWFpbbCjRdDQ0NG99///0pM2bMeOqHP/zhC8pgAACAz0YBDAAApMJZZ53V45vf/OaRvXr1GllaWtrVRiB5ampq3l28ePHEO++8c9LVV1/9jo0AAABsPQUwAACQWMOHDy+/6KKLvjB48OCjW7RoMdBGID0+/PDDV+fNmzfhvPPOe3L69Ol/sREAAIBPRwEMAAAkSqtWrQpvuOGGQ/bbb79/atOmzX6ZTCZrK5BeuVyubs2aNTNmzJjx2JgxYyavW7euwVYAAAA+ngIYAABIhB//+Mddv/e9732lZ8+e/1RcXNzWRiD/1NbWfvD2228/dssttzz029/+9l0bAQAA+L8UwAAAQJNVUVFRcO21137+4IMPPrZ169b7ZTKZAlsBIqJxzZo1M59//vnxp5122hR3BQMAAPx/CmAAAKDJOeWUUzqefvrpx/bu3ftL2Wy2jY0AH6e+vn7j0qVLH/vd7373x+uvv36ZjQAAAPlOAQwAADQJ2Ww2c+uttx5wyCGHnNC6deu9I8LdvsDWaFy7du1L06ZN+/OPfvSjZ1evXl1vJQAAQD5SAAMAALtU//79S6655pp/2nPPPY8tLy/vayPAZ1VTU7NswYIF488999wHp06dutFGAACAfKIABgAAdomf//znPU855ZQTu3btemRhYWGZjQDbW2NjY92KFSuevOWWW+689NJLF9kIAACQDxTAAADATuMxz8Cusn79+rlPP/30f5188slT6+rqcjYCAACklQIYAADY4fr27Vv8hz/84a+Pee5nI8CuUlNT8+68efPu/8EPfvDgwoULN9kIAACQNgpgAABghxkyZEjpNddc89XBgwefWFxc3MFGgKaitrZ21dy5c+/5yU9+8uc5c+bU2AgAAJAWWyqAPYoNAADYJqNHj+4wb968n06ZMuXRYcOGnaH8BZqa4uLi9sOGDTtjypQpj86bN++nJ510UntbAQAA0s4dwAAAwFY599xze33/+9//dufOnY/IZDJZGwGSIpfL1S1fvvzJG2644fbLLrvsbRsBAACSyiOgAQCAz+y8887r+53vfOfbHTt2PDyTyRTaCJBUuVyuYcWKFU/cdNNN//XrX/96sY0AAABJowAGAAC22WWXXTboG9/4xg9at249zDaAtFm7du2su++++9pzzjnnNdsAAACSQgEMAABsNcUvkE8UwQAAQJIogAEAgE9N8Qvks7Vr18665557rvv5z38+3zYAAICmaksFcGHlwOj6UV9orIqoWZG1PQAAyBO/+MUvet9xxx3nHHrooT8pLS3tYiNAPiotLe2y7777HvP973+/X1lZ2ZIpU6assxUAAKCpKetcHwXlH/01BTAAAOS5M844o/u99957zpe//OWflZeX94qIjK0AeS5TXl7e8+CDDx71/e9/v3dEvDVjxowPrQUAAGgqFMAAAMD/ceKJJ7a77777fjJq1Kh/KS8v7xOKX4B/lCkvL+99+OGHj/rWt77VfvXq1Qvnz59fbS0AAMCutqUC2DuAAQAgzwwdOrTs+uuvP6l///4nFRYWltkI20NjY2Ns2rQpqquro6amJurr62PTpk2xefPmqK+vj+rq6qivr4/NmzfHpk2boqGhYZv/fxUWFkZJSUk0a9YsioqKoqysLIqKiqJZs2ZRUlISRUVFUVpa+r9/FRQUCIjtoqGhoeq11167a8yYMffMmTOnxkYAAIBdZUvvAFYAAwBAnujUqVP2nnvuGbXXXnudnM1mK22Ej9PQ0BAbN26MDRs2/J+/Nm7cGBs3boyamprYtGlTbNq0KWpqaqK2trbJnqe4uDhKSkqitLT0f/9eUVERFRUV0aJFi//zV0VFRRQWFvog8LHq6urWvvjii7eceOKJf169enW9jQAAADubAhgAAPLcXXfdddAXv/jF00tLS7vZRn7L5XKxYcOGWLt2baxbty7Wrl37d3+tW7cuNmzYkPd7atGiRbRu3TpatWoVrVu3jjZt2vzvf27dunW0aNHCh4morq5e+sgjj1zzne98Z6ptAAAAO5MCGAAA8tTVV189+MQTTzyzoqJioG3kj8bGxli5cmUsX748Pvjgg1i9evX//n3t2rXR2NhoSZ9RYWFhtGrVKtq1axdt27b937937tw5OnTo4LHTeWbDhg3z77333qvOPPPMebYBAADsDApgAADIM1/72tfaXHrppad27979qIjQRKVUQ0NDrFq1KlasWBHvv//+//595cqVTfqRzGlXXFwcHTp0iI4dO0bnzp2jY8eO0alTp2jXrp1HS6dYLpdrfOeddx76+c9/fv2ECRPW2QgAALAjKYABACBP9OrVq9ldd931jT322OM7hYWFZTaSHh9++GG88847sXTp0njvvfdixYoVsXr16mhoaLCchCgsLIz27dtHp06dolu3btG9e/fo3r27x0mnTENDQ9W8efNu++Y3v/nHJUuWbLYRAABgR1AAAwBAHrjrrrtG/NM//dOZJSUlXWwj2davXx9Lly6Nd955539L3w8//NBiUqqysvJ/y+C//tWqVSuLSbiamppljz322G9Gjx49xTYAAIDtTQEMAAAp9qtf/arPD3/4w5+1atVqL9tIno0bN8aSJUvirbfeikWLFsV7770XmzZtspg8V1JSEl27do0+ffpE3759o3fv3lFeXm4xCbRu3bqXr7322ivGjh27yDYAAIDtRQEMAAApNGjQoNI77rjju7vttttJBQUFWRtJhtWrV8ebb74ZixcvjiVLlsTy5cujsbHRYtiigoKC6Ny5c/Tu3Tt69+4d/fr1i7Zt21pMQjQ2Nta98cYbd33rW9+6ff78+TU2AgAAfFYKYAAASJHS0tKCBx988Jj99tvvn7PZbBsbaboaGhri7bffjrfeeisWLFgQS5YscXcv201FRUX06tUr+vbtG3379o2ePXtGYWGhxTRhdXV1a2bMmHHjV77ylYdqamr85gcAALDNFMAAAJASp59+erdf/vKX51ZWVu5jG03T6tWr47XXXouFCxfGm2++GRs3brQUdooWLVpE3759Y8CAATFw4EB3CDdh69evf/E//uM//vPqq69+xzYAAIBtoQAGAICEGzRoUOm99977w969ex+byWTc4teErF+/PubNmxcLFiyIN954Q+FLk9GiRYvo169fDBgwIPbYY4+orKy0lCYkl8s1LF68eNyJJ554rcdCAwAAW0sBDAAACXbNNdcMOemkk35RVlbWyzZ2vVwuF++++27MnTs3XnvttViyZIl3+NLkFRQURK9evWLQoEExePDg6Natm6U0EdXV1UvuvvvuX//kJz+ZYxsAAMCnpQAGAIAEOuqoo1r99re//VmHDh0Ot41da9OmTTF79uyYO3duLFy4MKqqqiyFRGvevHn0798/Bg8eHHvuuWeUlJRYyi62cuXKp04//fTLJ0yYsM42AACAT6IABgCAhBk3btwRRxxxxFnZbLaNbewaVVVVMXfu3Jg7d27Mnz8/amtrLYVUKi4ujoEDB8bgwYNj8ODBUV5ebim7SF1d3ZqnnnrqqlGjRj1hGwAAwJYogAEAICFOOeWUjhdddNEvW7duvZ9t7HwrV66MWbNmxdy5c+Odd96JXC5nKeSdzp07x9577x3Dhg2LDh06WMgusHbt2hnnnXfepbfccsv7tgEAAHwUBTAAADRxpaWlBU899dQ3Bw8e/L2CggLPYt2JVqxYES+99FK89NJLsXz5cguBv/HXMnjvvfeOTp06WchO1NjYuGnu3Lk3H3744XfV1NR40TgAAPB3FMAAANCEjR49usOll176yzZt2gy3jZ1j/fr18eKLL8bMmTNj6dKlFgKfQs+ePWPfffeNYcOGRYsWLSxkJ1mzZs0L55577q/vvvvuVbYBAAD8lQIYAACaoIqKioKJEyd+c/Dgwd8vKCgotpEda8OGDfHiiy/G9OnTlb7wGfXo0SOGDx8ew4YNi4qKCgvZwdwNDAAA/CMFMAAANDGnnHJKx7Fjx/5rZWXlMNvYcerr6+PVV1+NGTNmxLx586Kurs5SYDvKZrMxZMiQ2HfffWP33XePwsJCS9mB1q5dO+MXv/jFv995550rbQMAAPKbAhgAAJqIbDabeeKJJ47fZ599fuSu3x0jl8vFwoULY/r06TF79uzYtGmTpcBOUFpaGkOGDInhw4fHgAEDLGQHaWhoqJ42bdo1Rx555J9tAwAA8pcCGAAAmoDjjz++7ZVXXvmr1q1be9fvDrBmzZqYNm1azJw5M1audHMc7EodO3aMz3/+87H//vt7X/CO+3fetDPPPPOScePGfWAbAACQfxTAAACwi9100037HXvssf9WXFzc1ja2n1wuF6+99lo8//zzMW/evKivr7cUaEKKiopizz33jBEjRsTnPve5yGQylrId1dbWrvrjH/948Q9+8INZtgEAAPlFAQwAALvIkCFDSu+///5zunTp8k+2sf2sXbs2Jk+eHNOnT48PP/zQQiABKisrY8SIEXHIIYdEeXm5hWxHy5Yte+zrX//6f86ZM6fGNgAAID9sqQAurBwYXT/qC41VETUrsrYHAADb6IILLtjt97///VVt2rQZZhvbx+LFi2P8+PFx9913xxtvvBG1tbWWAgmxadOmeOONN+LZZ5+NtWvXRps2bTweejtp0aJFv5NOOumg0tLSuc8+++xaGwEAgPQr61wfBR/zu7XuAAYAgO0sm81mJk2a9PVhw4b9pKCgwG9VfkZ1dXUxY8aMeOaZZ+K9996zEEiRfv36xSGHHBJDhw6NgoICC/mMGhsbN8+YMeOaL37xi+Pq6upyNgIAAOnlEdAAALCTHH/88W2vuuqqCyorK/exjc9mzZo18dRTT8XUqVNj06ZNFgIpVlFREZ///OfjsMMOi8rKSgv5jNavXz/r9NNPv3DcuHEf2AYAAKSTAhgAAHaC22677fNf+9rXzstms5W2se0WLVoUjz/+eMybNy9yOTewQT4pKiqKIUOGxBFHHBG9e/e2kM+grq5u3QMPPHDRySefPM02AAAgfRTAAACwA1VUVBQ8/fTTpwwcOPCUTCbjGabbIJfLxauvvhpPPvlkLFy40EIgz2UymRgwYEAcccQRMWjQIAvZ9n+3Ns6fP/+Www8//JaNGzc22ggAAKTHlgrgwsqB0fWjvtBYFVGzwuvKAABgS0488cR2EyZMuLx79+5fzmQyGRvZOo2NjTFr1qy49dZb48knn4wPPvC0UuC/rV69OmbMmBFz5syJ0tLS6NSpU/jX7NbJZDKZ9u3bD/3+978/dPny5TNfffXValsBAIB0KOtcHwXlH/O9gDuAAQBg29x66637H3vssRcWFRW1sI2tU1NTE0899VQ8++yzsWHDBgsBPlGLFi3i4IMPjsMPPzxKS/28YmvV19d/OG7cuPNPPvnk6bYBAADJ5xHQAACwHWWz2cyzzz77rSFDhvzAI5+3zqZNm2Ly5Mnx1FNPKX6BbdKiRYs47LDD4pBDDlEEb6VcLtfwyiuvXHfooYfeWVdX5yXrAACQYApgAADYTo455pjW11133cWVlZV728ant2HDhnj88cdjypQpUVtbayHAZ1ZcXBwHHnhgfPGLX4wWLTyIYWusWbNm2re//e3zn3nmGb+JAwAACeUdwAAAsB1cfvnlu1900UW/LS8v72cbn05VVVVMmDAhbrnllnjzzTejoaHBUoDtoqGhIZYsWRLPPfdc1NTURI8ePSKb9XOMT6OsrKzb17/+9SPbtm0774knnlhtIwAAkMDreu8ABgCAz+bhhx/+8qGHHnpOQUFBsW18sk2bNsUzzzwTTzzxRFRVVVkIsMOVl5fHkUceGYccckgUF/tX9afR2Ni46emnn/71Mccc87htAABAsngENAAAbKN27doVTZ48+YxevXodZxufrK6uLp5++umYOHGi4hfYJSoqKuKLX/xiHHzwwe4I/pQWLVr0x4MOOuiadevWeUwDAAAkhEdAAwDANjj22GPbPvzww7/p2LHjobaxZXV1dfHkk0/GddddF3Pnzo26ujpLAXaJzZs3x2uvvRbPPfdcRET06NEjCgsLLWYLWrduvfv3vve9fd9+++1pCxYsqLYRAABo+rb0CGgFMAAAfITLL7989wsuuOB3zZs372UbH6+xsTGmTJkS119/fbzyyiuKX6DJ2Lx5cyxYsCCmT58excXF0a1bt8hkMhbzMUpKSjp8+ctfPrJt27ZzvBcYAACaPu8ABgCArTB+/Pgjv/CFL/xLQUFBiW18vAULFsT48eNj6dKllgE0eT169IivfOUrMWjQIMvYgsbGxpqJEydecuyxxz5pGwAA0HR5BzAAAHwK7dq1K3ruued+1qNHj6/axsdbtGhR3H///bF48WLLABKnV69ecdxxx0WfPn0sYwuWLl3654MOOujy1atX19sGAAA0Pd4BDAAAn2DYsGHNn3766V936tTpC7bx0TZs2BD33Xdf/PGPf4y1a9daCJBI69evj2nTpsW6deuiZ8+eUVLiYQ8fpbKysv+3v/3t/lOmTJmyfPlyz/cHAIAmxjuAAQBgC372s5/1uP76669t0aKF54J+hJqamhg/fnzcfPPN8fbbb0cul7MUINFyuVy888478cwzz0RVVVX07t07slk/A/lHZWVl3U488cTD6+rqZkyfPv1DGwEAgCZ0va4ABgCAj3bFFVfscdZZZ11dXFzcwTb+Xi6XixkzZsR1110XCxYsiMbGRksBUqWxsTGWLFkSM2bMiPLy8ujSpUtkMhmL+RvZbLbFQQcddHibNm1mP/HEE6ttBAAAmoYtFcDeAQwAQN6aNGnSqAMOOODsTCZTaBt/b9GiRXHPPffEu+++axlA3ujWrVucdNJJ0bt3b8v4B7lcrm7y5Mm//vKXv/yIbQAAwK63pXcAK4ABAMg7paWlBTNnzjyzT58+x9vG39uwYUOMGzcuZsyY4VHPQF7KZDKx3377xde//vWoqKiwkH+waNGiP+27775X1dTUeCwEAADsQgpgAAD4H926dctOnjz5V506dRppG/9fLpeLqVOnxp///OfYuHGjhQB5r6KiIkaNGhX777+/x0L/g+XLlz9+6KGHXvLuu+/W2QYAAOwaWyqAvQMYAIC8MXz48PInnnjiynbt2o2wjf/vnXfeiWuvvTaee+652Lx5s4UARMTmzZtjzpw58dprr0XPnj2jRYsWlvI/Kioq+n7rW98aMnXq1Ofee+89f3AAAMAusKV3ACuAAQDIC9/+9rc73n777X9o0aLFANv4b1VVVXHXXXfFvffeG+vXr7cQgI+wbt26eP7552P9+vWx2267RVFRkaVERElJSefjjjvuoA8++GDKK6+88hcbAQCAnUsBDABAXjv//PP7XXzxxX8oKSnpbBv/bfr06XHttdfGokWLLAPgU3jnnXdi2rRp0bp16+jc2R8nERHZbLbyC1/4whElJSUvTp48eY2NAADAzqMABgAgb/3ud7/b60c/+tFVRUVFrWwjYs2aNXHzzTfHpEmTora21kIAtkJtbW289NJL8c4770Tfvn2jtLQ073dSWFhYNnz48C/26dNn4UMPPbTMpwQAAHYOBTAAAHnp1ltv3f+b3/zmfxYWFjbP913kcrl4/vnn4/rrr4/ly5f7cAB8BitXroxp06ZFRUVFdOvWLTKZTF7vo6CgIDto0KBDBw0atOiBBx54xycEAAB2vC0VwJmex8Z+H/WF+pURa17ym6wAACTTww8//KXDDjvsXzKZTN6/rPGDDz6I22+/Pd544w0fDIDtbMCAAfGtb30r2rRpk/e7yOVyjVOmTPn1yJEjH/LJAACAHavN3jVR1OGjv6YABgAgdV555ZXTPve5z30r3/fQ0NAQjz32WDz++ONRV1fngwGwg2Sz2Tj66KPjC1/4QhQUFOT9Pl5//fU79tprr9/7ZAAAwI6jAAYAIC9ks9nMyy+/fFafPn2Oz/ddvPvuu3HbbbfFe++954MBsJN069YtvvOd70S3bt3yfhdLliy5f5999rmypqam0ScDAAC2PwUwAACpV1paWjBr1qyzevfufVw+7yGXy8WTTz4ZDz74oLt+AXaBbDYbxxxzTBxxxBF5fzfw0qVLHxg6dOjlSmAAANj+FMAAAKRar169mk2ePHlsu3btDsrnPaxcuTJuueWWePvtt30oAHaxnj17ximnnBIdOnTI6z2sXr16yiGHHPIvS5Ys2exTAQAA28+WCuDCyoHR9aO+0FgVUbMia3sAADRpQ4cOLXvqqacub9Omzf75uoNcLhfPPPNMXH/99bF27VofCoAmYP369TFlypQoKSmJnj17RiaTycs9NG/evPtJJ500ZPLkyc+sWLHCoykAAGA7KetcHwXlH/01BTAAAIk1ZMiQ0kceeeSKVq1a7Z2vO6iuro7bb789nnjiiWhs9IRNgKaksbEx5s+fH++//34MGDAgstn8/DlLaWlpp6997WuDn3rqqadXrlxZ75MBAACfnQIYAIDUOfTQQ1s8+OCDv2/ZsuUe+bqDOXPmxNVXX+2RzwBN3PLly+OFF16Ijh075u0joUtLSzudcMIJ+7/00ktPv/3227U+FQAA8NkogAEASJVhw4Y1v++++37TsmXLQfl4/vr6+hg/fnz88Y9/jNpaP0MHSILNmzfHiy++GJs3b47ddtstCgoK8m4HxcXFbY866qg9n3vuuaeXL1/ucdAAAPAZKIABAEiNI488snLcuHG/b9GixcB8PP97770XV111VcyZM8eHASCBFi1aFC+//HL069cvWrRokXfnLykp6XDcccftP2fOnGcWLVq0yScCAAC2jQIYAIBUOPLIIyvvvPPO35aXl++Wj+d/+umn48Ybb4wPP/zQhwEgwf7yl7/ECy+8ECUlJdGrV6+8O3+zZs3aHHXUUfspgQEAYNspgAEASLxjjz227W233faH5s2b98m3s1dVVcXNN98cTz31VDQ2NvowAKRAY2NjzJ8/P5YtWxYDBgyIZs2a5dX5mzVr1uaYY4458M0333xm4cKFNT4RAACwdRTAAAAk2qGHHtritttuuzofy9+33347rrnmmli8eLEPAkAKvf/++/HKK69Enz59orKyMq/Ons1mK4888sh9Zs6c+dTSpUs3+zQAAMCnpwAGACCxjjjiiJb33nvvteXl5f3y6dy5XC4mTZoUN998c1RVVfkgAKRYVVVVTJ06NbLZbPTp0ycymUzenL24uLjtV7/61c+/8sorTy1evLjWpwEAAD4dBTAAAIl06KGHtrj33nt/l2/lb3V1ddx0000xefLkyOVyPggAeSCXy8WCBQvi3Xffjd133z2y2fz5mUyzZs1aH3300fvNmDHjSXcCAwDAp6MABgAgcYYOHVo2fvz4qysqKgbk07mXLVsWV111lUc+A+SplStXxiuvvBKf+9znoqKiIm/O3axZszZHH3300GeeeebJFStW1PkkAADAlimAAQBIlCFDhpQ++uij17Rs2XL3fDr31KlT49prr42NGzf6EADksaqqqpg+fXq0bds2unTpkjfnLikpaT9q1KihTz755JMrV66s90kAAICPt6UCuMB6AABoSjp16pSdMGHCv1dWVu6RL2dubGyMcePGxR133BF1dW56AiCitrY2br755hg/fnw0NjbmzbkrKyv3mDBhwr9369bNXQkAALCNFMAAADQZrVq1Kpw+ffolbdq02T9fzlxdXR2/+93vYtKkSd73C8DfyeVy8fjjj8fvf//7qK6uzptzt2nTZv8pU6Zc0qpVq0KfAgAA2HoKYAAAmoSKioqC2bNnX9KuXbuD8uXMS5cujYsuuijmz5/vAwDAx3r11VfjoosuiqVLl+bNmdu1a3fQ7Nmz/72iosLPrgAAYCu5iAYAoEmYOXPmz9q1a3dIvpz35ZdfjiuuuCLWrVsnfAA+0bp16+KKK66Il19+OW/O3K5du4Nnzpz5M+kDAMDWUQADALDLvfjii2N69OgxKh/Omsvl4oEHHogbbrghamtrhQ/Ap1ZbWxs33HBDPPDAA3nz2oAePXqMevHFF8dIHwAAPj0FMAAAu9SkSZO+NnDgwFPy4ax1dXVx8803x8SJE73vF4BtksvlYuLEiXHLLbdEXV1dXpx54MCBJ0+aNOlr0gcAgE9HAQwAwC7z6KOPHnXggQeekw9nXbduXfz617+OWbNmCR6Az2zmzJnx61//Ol9eJZA58MADz3n00UePkjwAAHyywsqB0fWjvtBYFVGzImtDAADsEDfeeOO+Rx999EWZTKYw7Wddvnx5XHXVVbFy5UrBA7DdbNiwIWbPnh0DBw6MioqKtB8307179/179uz56sMPP7xc+gAA5LuyzvVRUP7RX1MAAwCw011xxRV7fPe7372qoKCgWdrPOmfOnPjtb38bGzduFDwA2111dXVMmzYtOnfuHB07dkz1WTOZTOHuu+9+eJs2bV6aNGnSKukDAJDPFMAAADQZZ5xxRvef/exnvy0sLCxP+1knTJgQd999d9TX1wsegB2moaEhXnrppchms9G3b99UnzWTyRTttddeB/3lL395dubMmRukDwBAvlIAAwDQJBx00EEVf/jDH64pLi7ulOZz5nK5eOCBB+Kxxx4TOgA77c+eBQsWRF1dXfTv3z8ymUxqz1pQUFBywAEHDJs+ffqkpUuXbpY+AAD5aEsFcIH1AACwMwwaNKj0vvvuu7qsrKxXms9ZV1cX1113XUyaNEnoAOx0EydOjOuvvz7q6upSfc6ysrJef/rTn67u379/idQBAODvKYABANjhKioqCh577LGLKyoqBqb5nNXV1XHNNdfE7NmzhQ7ALvPKK6/ElVdeGVVVVak+Z4sWLQZOnDhxbEVFhZ9vAQDA33CBDADADjdz5syftW3b9sA0n3HdunVx2WWXxRtvvCFwAHa5xYsXx2WXXRZr165N9TnbtWt34MyZM38mcQAA+P8UwAAA7FBPPvnkqB49eoxK8xlXrVoVV1xxRSxfvlzgADQZK1asiCuuuCJWrlyZ6nP26NFj1KRJk0ZJHAAA/lth5cDo+lFfaKyKqFmRtSEAALbZjTfeuO+XvvSlCzOZTGp/8fDdd9+NK6+8MtatWydwAJqc6urqmDVrVvTv3z8qKytTe85u3boN79mz57yHH37Yb2MBAJAXyjrXR0H5R39NAQwAwA5x3nnn9T311FOvLigoKE7rGV977bW45pprorq6WuAANFmbN2+OGTNmRI8ePaJ9+/apPGMmkykYNGjQIYWFhVOee+45v5UFAEDqKYABANipjjrqqFb/8R//8YdmzZq1SusZX3755bj++uujrq5O4AA0eQ0NDfHSSy9Fp06dolOnTqk8Y0FBQXbYsGGfnz9//qQ33nhjk9QBAEizLRXA3gEMAMB21a1bt+wNN9zwnyUlJR3TesYpU6bEjTfeGPX19QIHIDHq6+vjxhtvjKlTp6b2jCUlJZ1uuOGG/+jWrZu7GgAAyFsKYAAAtqunn376XyorK/dI6/kmTZoUd955ZzQ2NgobgMRpbGyMO+64I5588snUnrGysnLw008//UtpAwCQrxTAAABsN88///w3unTp8k9pPd/EiRNj3LhxkcvlhA1AYuVyubj//vtTXQJ36dLlS88+++yJ0gYAIB95BzAAANvFTTfdNPzII488L5PJZNJ4vsceeyzGjx8vaABS47XXXotmzZpF3759U3m+zp0779urV695Dz/88DJpAwCQNlt6B7ACGACAz+wXv/hF7x/+8IdXFxQUNEvj+R544IF45JFHBA1A6ixYsCDq6upiwIABqTtbJpPJDBo06ODGxsbnpk6dul7aAACkiQIYAIAd5oADDqj43e9+99tmzZq1TeP5xo0bF5MmTRI0AKm1aNGi2Lx5cwwcODB1ZysoKMjut99+w5577rnH33vvvc3SBgAgLbZUAHsHMAAA2yybzWbuvPPOfyktLe2exvNNmDBB+QtAXpg0aVI89NBDqTxbaWlpj3vuuedfstlsRtIAAOQDBTAAANvs+eef/06HDh0OTePZHn744Xj44YeFDEDeeOSRR+LPf/5zKs/WoUOHw5599tlvSxkAgHygAAYAYJvcd999hw8ePPjUNJ7t/vvvjwkTJggZgLzz2GOPxX333ZfKs+25554/+NOf/nSYlAEASDvvAAYAYKudccYZ3ceMGXN5QUFBcdrONnHixHjkkUeEDEDeWrx4cWSz2ejbt2/ajpbp06fPvn/5y18mz5w5c4OkAQBIsi29A1gBDADAVhk2bFjzG2+88Q/NmjVrl7azPfroo6l99CUAbI2FCxdGUVFR9OvXL1XnKigoKD7wwAP3e/LJJx9dsWJFnaQBAEiqLRXAHgENAMBWuffee39ZWlraPW3nevzxx+PBBx8UMAD8jz//+c8xceLE1J2rtLS0x3333fdLCQMAkFYKYAAAPrVJkyaN6tSp0xEpPFeMHz9ewADwD8aPHx+TJ09O3bk6der0hUmTJn1VwgAApJFHQAMA8Kmcd955fU888cR/z2QyRWk618yZM+Puu+8WMAB8jNdeey06duwYnTt3TtW5unbtuk9BQcHzzz333DopAwCQNN4BDADAZ3LEEUe0vOKKK67NZrOVaTrXyy+/HDfffHPkcjkhA8DHyOVyMXv27OjSpUt06tQpNefKZDJF++yzz/CpU6c+9u67726WNAAASeIdwAAAbLNsNpu55ZZb/q2kpKRjms61YMGCuPnmm6OxsVHIAPAJGhsb4+abb44333wzVecqLS3tcvfdd5+fzWYzUgYAIC0UwAAAbNGkSZO+3rZt2wPTdKZly5bFDTfcEPX19QIGgE+prq4urr322li+fHmqztWuXbsDH3/88VESBgAgLTwCGgCAj3XZZZcN+upXvzo2k8mk5hcH33///bjyyiujqqpKwACwlerq6uLll1+OIUOGRHl5eWrO1aVLl31LS0unPvPMM2ukDABAEngENAAAW61///4lJ5988q8ymUxRWs60YcOG+P3vfx8bN24UMABso40bN8bvfve7VP15WlBQkP3hD394ft++fYslDABA4q9vrQAAgI/y4IMPnl1WVtYrLeeprq6O3/zmN7Fq1SrhAsBntGrVqrjyyiujuro6NWcqKyvr8/DDD58lXQAAkk4BDADA/zF+/Pgju3XrdnRazlNfX5/KdxYCwK60fPnyuO6666K+vj41Z+rRo8dXx40bd4R0AQBIMgUwAAB/53vf+16nI4444py0nCeXy8Vtt90Wb7zxhnABYDt7/fXX47bbbotcLpeaMx155JHnfvvb3+4oXQAAkkoBDADA/6qoqCi4+OKLLywsLCxPy5nGjx8fs2bNEi4A7CCzZs2Khx56KDXnKSwsrPj1r399QUVFhZ+bAQCQSC5kAQD4XxMnThxdWVk5OC3nef7552PixImCBYAd7LHHHosXXnghNeeprKzc89FHHz1RsgAAJFFh5cDo+lFfaKyKqFmRtSEAgDxxwQUX7DZq1KgLM5lMYRrO8+qrr8Ytt9ySqkdSAkBT/7O3d+/e0a5du1Scp2PHjkNzudxzU6ZMWSddAACamrLO9VHwMc/wcwcwAADRt2/f4h//+McXZzKZVPwG4HvvvRc33HBDNDY2ChcAdpKGhoa47rrrYtmyZak4T0FBQfbss88e27dv32LpAgCQqGtZKwAAYPz48T8qKyvrkYazbNiwIX7/+99HbW2tYAFgJ9u0aVP8/ve/j40bN6biPGVlZb3GjRs3RrIAACSJAhgAIM/ddNNNw/v06XN8Gs5SX18f1157baxdu1awALCLrFmzJq699tqor69PxXn69ev3jd///vdDJQsAQFIogAEA8thBBx1Uceyxx/5rRGTScJ477rgjFi9eLFgA2MUWLVoUd955Z1qOU/CNb3zj34YNG9ZcsgAAJOIC1goAAPLXzTfffFZxcXG7NJxl4sSJMX36dKECQBMxbdq0mDRpUirOUlJS0unOO+88Q6oAACSBAhgAIE/913/914FdunT5UhrO8tprr8Wf//xnoQJAEzN+/PhYsGBBKs7SrVu3o2+66abhUgUAoKlTAAMA5KEvfelLlV/5yld+lYazrFixIq6//vpobGwULAA0MY2NjXHdddfFihUr0nCczHHHHfergw46qEKyAAA0ZQpgAIA8dPXVV5+ezWYrk36OmpqauPbaa2PTpk1CBYAmatOmTXHttddGTU1N4s+SzWbb3njjjT+RKgAATZkCGAAgz9x6663Du3Tp8uWknyOXy8Utt9wSK1euFCoANHErV66MW2+9NXK5XOLP4lHQAAA0dQpgAIA8MnTo0LKvfvWrv0jDWSZMmBBz584VKgAkxJw5c+Kxxx5LxVlGjRr1i6FDh5ZJFQCApkgBDACQR+64444fFRcXd0z6OV5++eV45JFHBAoACfPQQw+l4he4SkpKOt5xxx0/lCgAAE2RAhgAIE9cfvnlu/fs2XNU0s/xwQcfxB133JGKR0gCQL7J5XJx2223xZo1axJ/lp49ex57+eWX7y5VAACaGgUwAEAe6NatW/a73/3uv2YymURf/9XX18cNN9wQ1dXVQgWAhKqqqoobb7wx6uvrE32OTCZT8N3vfvdX3bp1y0oVAICmRAEMAJAHxo8ff0pZWVmvpJ/jnnvuiaVLlwoUABJuyZIlcd999yX+HGVlZT3Hjx9/ikQBAGhKFMAAACn385//vOeAAQNGJ/0c06dPjylTpggUAFJi8uTJMWPGjMSfY8CAAaN//vOf95QoAABNhQIYACDFstls5qyzzjo3k8kk+tGEK1asiLvvvlugAJAyd911V6xYsSLRZ8hkMtmzzjrr3Gw2m5EoAABNgQIYACDFxo0b98XKysq9knyG2trauOGGG6K2tlagAJAyf/1zfvPmzYk+R2Vl5V7jxo0bKVEAAJoCBTAAQEoNHz68/OCDDz4t6ee4//77Y/ny5QIFgJRavnx5jBs3LvHnGDFixI+HDRvWXKIAAOxqCmAAgJS69dZbT8tms22TfIYZM2bEc889J0wASLnJkyfHzJkzE32G4uLitrfffvtp0gQAYFdTAAMApNBVV121R48ePb6S5DOsXLky7rrrLmECQJ64++6744MPPkj0GXr27PnVK664Yg9pAgCwKymAAQBSprS0tOAb3/jGT5N8rdfY2Bi333679/4CQB6pqamJ2267LRobG5N8jIJvfvObZ5aWlvqZGwAAu+6i1AoAANJlwoQJX6uoqBiQ5DOMHz8+Fi1aJEwAyDNvvvlmPPjgg4k+Q4sWLQY9+OCDx0gTAIBdRQEMAJAiRx55ZOWwYcN+kOQzzJ07N5544glhAkCemjhxYixYsCDRZxg+fPiPjjjiiJbSBABgV1AAAwCkyBVXXHFyUVFRRVLnr6qqijvvvDNyuZwwASBP5XK5uP3226O6ujqxZygqKmrxm9/85mRpAgCwKyiAAQBS4vzzz+/Xu3fv45J8httvvz0+/PBDYQJAnlu3bl3cfvvtiT5D7969jz///PP7SRMAgJ1NAQwAkALZbDZz6qmn/jyTyST2+m769OkxZ84cYQIAERExe/bsmDFjRmLnz2QyBaeeeurPs9lsRpoAAOxMCmAAgBT44x//eERlZeXgpM6/du3auPfeewUJAPyde+65J9atW5fY+SsrKwf/6U9/+oIkAQDYmRTAAAAJ17dv3+JDDjnkR0k+w9133x01NTXCBAD+Tk1NTdx9992JPsPBBx/8o759+xZLEwCAnUUBDACQcHfdddc3S0pKOiV1/smTJ8e8efMECQB8pLlz58azzz6b2PlLSko63nPPPd+SJAAAO4sCGAAgwb70pS9VDhw48KSkzr9mzZoYP368IAGALXrggQdizZo1iZ2/f//+Jx111FGtJAkAwM6gAAYASLArrrji1MLCwvIkzp7L5eK2226LTZs2CRIA2KJNmzbFbbfdFrlcLpHzFxYWll1++eU/kCQAADuDAhgAIKF+8Ytf9O7evftXkjr/s88+G2+88YYgAYBP5Y033ojnn38+sfN369bt6F/96ld9JAkAwI6mAAYASKgf/vCHP8pkMom8nvvggw/igQceECIAsFXGjRsX69atS+TsmUym4NRTT/2xFAEA2NEUwAAACXTdddcNa9eu3YFJnD2Xy8Udd9wRtbW1ggQAtsqmTZvizjvvTOz8bdq02f+mm27aT5IAAOxICmAAgIQpLS0t+NrXvnZ6Uud/4YUXYuHChYIEALbJq6++GjNmzEjs/Mccc8zpFRUVfiYHAMAO42ITACBhbr/99oMrKip2S+LsGzZsiHHjxgkRAPhM7r///qiqqkrk7OXl5X3/67/+6wgpAgCwoyiAAQASpKKiouCwww47Nanz33vvvYn9YS0A0HRs2LAh7r///sTOf9BBB/1zq1atCiUJAMCOoAAGAEiQ+++//+iysrKeSZx9zpw58dJLLwkRANguXnjhhViwYEEiZy8tLe32xz/+8StSBABgR1AAAwAkRN++fYv33Xfff07i7LW1tXHvvfcKEQDYru6+++6oq6tL5Oz77bffKf379y+RIgAA25sCGAAgIW6++eZRxcXFbZM4+yOPPBJr164VIgCwXa1atSoee+yxRM6ezWbb3njjjV+TIgAA25sCGAAgAYYOHVq21157fSeJs7/33nvxxBNPCBEA2CEmTpwYK1asSOTsQ4YM+c7QoUPLpAgAwPakAAYASIBrr732xKKiosqkzZ3L5eKee+6JxsZGIQIAO0R9fX3cddddkcvlEjd7UVFR5bXXXnuCFAEA2J4UwAAATdwBBxxQMWDAgG8kcfYZM2bEW2+9JUQAYId6880348UXX0zk7AMGDPjG8OHDy6UIAMD2ogAGAGjirrrqqhOKiooqkjb3pk2b4oEHHhAgALBT3H///VFbW5u4uYuKilpcffXV7gIGAGC7UQADADRhBx10UEX//v0Teffvww8/HB9++KEQAYCdYv369TFhwoREzj5w4MBvHHDAARVSBABge1AAAwA0Yf/5n/95bGFhYfOkzb1q1aqYPHmyAAGAnerpp5+O1atXJ27uwsLC8ssuu2yUBAEA2B4UwAAATdQBBxxQMWjQoNFJnP3uu++O+vp6IQIAO1V9fX3cddddiZx99913/+bQoUPLpAgAwGelAAYAaKIuv/zyYwsLC8uTNvfcuXNjwYIFAgQAdokFCxbE3LlzEzd3UVFRi9/97ndflyAAAJ+VAhgAoAkaOnRo2aBBgxL37t+6urr405/+JEAAYJf605/+FHV1dYmbe/fdd//mkCFDSiUIAMBnoQAGAGiCfvOb33ylqKioZdLmfu655xL53j0AIF1Wr14dzz33XOLmLioqann11VcfLUEAAD4LBTAAQBPTq1evZoMHD/5m0uaurq6ORx55RIAAQJPwyCOPRHV1deLmHjJkyLe6deuWlSAAANtKAQwA0MTcdNNNxxQXF7dN2twTJkyIqqoqAQIATUJVVVUifzmtuLi43a233uouYAAAtpkCGACgCWnVqlXhXnvtdVLS5l61alU8++yzAgQAmpTJkyfHqlWrEjf30KFDR7dq1apQggAAbAsFMABAE3LLLbccXlJS0jlpcz/44INRX18vQACgSamvr48HH3wwcXOXlJR0vummmw6VIAAA20IBDADQRGSz2cwBBxzw7aTNvWjRonjppZcECAA0SS+99FIsXrw4cXOPGDHiO9lsNiNBAAC2lgIYAKCJuOaaa/YuLy/vm7S5H3roocjlcgIEAJqkXC6XyLuAy8vL+1111VV7SRAAgK2lAAYAaCK+8pWvfDdpM8+bNy8WLlwoPACgSVu4cGG8+uqrrg8BAMgLCmAAgCbgsssuG1RZWblPkmbO5XIxfvx44QEAifDAAw8k7qklrVu33veSSy7pLz0AALaGAhgAoAkYNWrUCUmbefbs2bFs2TLhAQCJsGzZsnjllVcSN/cJJ5xwovQAANgaCmAAgF3sn//5nzt37NjxiCTN3NjYGA888IDwAIBEGT9+fDQ0NCRq5k6dOn1h9OjRHaQHAMCnpQAGANjFfvSjH30tk8kk6rps2rRpsWrVKuEBAImyatWqeOGFFxI1cyaTKfzpT386SnoAAHxaCmAAgF1o0KBBpX369Plqkmaur6+PCRMmCA8ASKQJEyZEXV1dombu27fvV/r27VssPQAAPg0FMADALnTZZZcdXlRUVJGkmadOnRpr164VHgCQSOvXr48pU6YkauaioqLK3/zmN0dIDwCAT0MBDACwi2Sz2cy+++57UpJmrqurc/cvAJB4jz76aOLuAt5///1PymazGekBAPBJFMAAALvI1VdfPbSsrKx3kmaeMmVKbNiwQXgAQKJt2LAhnn/++UTNXFZW1ueqq67aS3oAAHwSBTAAwC7y5S9/+bgkzVtfXx8TJ04UHACQCo8//nji7gL+0pe+dLzkAAD4JApgAIBdYPTo0R3atm07IkkzT5s2LdatWyc8ACAVPvzww5g+fXqiZm7fvv2I0aNHd5AeAABbogAGANgFfvrTn47KZDKFSZm3vr4+HnnkEcEBAKnyyCOPRH19fWLmzWQyhT/96U+/JjkAALZEAQwAsJN16tQp26dPn6OTNLO7fwGANFq3bl1MmzYtUTP36dPnmE6dOmWlBwDAx1EAAwDsZFddddUB2Wy2dVLmbWxsjEmTJgmOVOvYsWN06OCJmgD5aNKkSdHY2JiYebPZbOurrrrqAMkBAPBxFMAAADvZiBEjvp6keV988cVYtWqV4Ei1Ll26xIUXXhinnXZadO3a1UIA8siqVavipZdecj0JAEBqKIABAHaiM844o3tlZeXeSZk3l8vFxIkTBUdeyGQyMXjw4PjVr34VY8aMcUcwQB55/PHHI5fLJWbeysrKvc8444zukgMA4KMogAEAdqJTTjnlqxGRScq8CxYsiPfee09w5JVMJhN77713XHjhhTFmzJho3769pQCk3HvvvRcLFy5M1B9X/3NdCQAA/4cCGABgJ+nVq1ezXr16fTlJM3v3L/nsr0XwBRdcECeffHK0bdvWUgBSLGnXPb169fpyr169mkkOAIB/pAAGANhJrrjiioOLiopaJmXeBN4JAztEYWFhDB8+PC688MIYPXp0VFZWWgpACi1YsCCWLVuWmHmLiopaXnnllYdIDgCAf6QABgDYSYYPH/6VJM2btHfhwY5WVFQUI0aMiEsuuSRGjx4dLVu2tBSAFMnlcvH4448naub99tvvK5IDAOAfKYABAHaC0aNHd6isrByalHnXrl0bL7/8suDgI/y1CL744ovjhBNOiBYtWlgKQEq89NJLsW7dusTMW1lZudfo0aM7SA4AgL+lAAYA2AlOP/30o5J07fXMM89EQ0OD4GALiouL47DDDouxY8fGqFGjoqyszFIAEq6hoSGeeeaZJI1c8D/XmQAA8P8vEq0AAGDHymazmX79+n05KfPW1tbGlClTBAefUnFxcYwcOTIuvfTSGDVqVJSWlloKQII9//zzUVtbm5h5+/Xr9+VsNpuRHAAAf6UABgDYwX7zm9/sWVJS0jkp886YMSOqq6sFB1uppKQkRo4cGZdcckkcffTRUVJSYikACVRdXR0zZ85M0p8/na+44orBkgMA4K8UwAAAO9gXvvCFLyVl1lwuF08//bTQ4DNo3rx5HHXUUXHJJZfEyJEjI5vNWgpAwjz11FORy+USM++RRx75ZakBAPBXCmAAgB1oyJAhpZ07dz4iKfO+/vrrsWLFCsHBdlBeXh6jRo2KSy+9VBEMkDArVqyI119/PTHzdunS5fD+/ft79AQAABGhAAYA2KHGjh17aGFhYWJeCOruX9j+KioqYtSoUXHxxRfH4YcfHkVFRZYC4LpouyosLGz+H//xHwdLDQCACAUwAMAOteeeex6ZlFnXrl0b8+bNExrsIK1atYrjjz8+LrroohgxYkQUFPh2DKApmzdvXqxZsyYx8+61115HSg0AgAgFMADADnPMMce0bt269b5Jmfe5556LxsZGwcEO1qZNmxg9enRcfPHFimCAJqyxsTGee+65JP35MvyYY45pLTkAAPykAQBgBznzzDMPz2Qyibjeqq+vj6lTpwoNdqK2bdvG6NGj47zzzovhw4crggGaoBdeeCHq6+sTMWsmkyk844wzDpUaAAB+wgAAsIP079//C0mZdc6cObFhwwahwS7QqVOnOPnkk+Pf/u3fYu+9945MJmMpAE3Ehg0bYvbs2YmZd8CAAR4DDQCAAhgAYEf43ve+16mysnKPpMybpMcbQlp17tw5xowZE7/61a8UwQBNyPPPP5+YWSsrKwd/73vf6yQ1AID8pgAGANgBTj755CMiIhHtzcqVK+P1118XGjQRXbt2jTFjxsQ555wTgwcPthCAXez111+PlStXJmXczMknn3y41AAA8psCGABgB+jXr19iHv88ZcqUyOVyQoMmpnfv3nHaaafFOeecE/3797cQgF0kl8vFlClTknQd6jHQAAB5TgEMALCdnX766d0qKip2S8Ks9fX1MW3aNKFBE9anT58466yz4pxzzonddtvNQgB2gWnTpkV9fX0iZq2oqNjt9NNP7yY1AID8pQAGANjORo8efURSZp03b15s3LhRaJAAffr0ibPPPjvOPPPM6Nmzp4UA7EQbN26MefPmuR4FACARFMAAANtZr169EvPetSQ9zhD4bwMGDIhf/vKXceaZZ0b37t0tBGAnmTp1apKuRw+TGABA/lIAAwBsR2eccUb38vLyvkmYdf369fHaa68JDRJqwIAB8S//8i9x2mmnRbdunvQJsKPNnz8/Pvzww0TMWl5e3u9HP/pRF6kBAOQnBTAAwHZ03HHHHZSUWWfMmBGNjY1CgwTLZDIxePDg+Nd//dcYM2ZMdOjQwVIAdpDGxsaYMWNGYub9xje+cYjUAADykwIYAGA76tOnz8FJmDOXyyXqMYbAlmUymdh7773jwgsvjDFjxkT79u0tBWAHeOGFF5J0XXqIxAAA8pMCGABgOznppJPat2zZcvckzLpkyZJYuXKl0CBl/loEX3DBBXHyySdH27ZtLQVgO1qxYkW8/fbbiZi1srJy0PHHH+8PAgCAPKQABgDYTr773e8eGBGZJMyapMcXAluvsLAwhg8fHhdeeGGMHj06KisrLQVgO5k+fXpSRi34/ve/f6DEAADyjwIYAGA72X333Q9Nwpz19fUxc+ZMgUEeKCoqihEjRsQll1wSo0ePjpYtW1oKwGc0c+bMqK+vT8SsAwcOPFRiAAD5RwEMALAdHHTQQRUtW7bcKwmzLly4MKqrq4UGeeSvRfDFF18cJ5xwQrRo0cJSALZRVVVVvP7664mYtVWrVkOHDx9eLjUAgPyiAAYA2A7OPvvsz2cymaIkzOrxz5C/iouL47DDDouxY8fGqFGjoqyszFIAtkFSnqaSyWSy55577uclBgCQXxTAAADbwe67735AEuasra2NOXPmCAzyXHFxcYwcOTIuvfRSRTDANpg9e3bU1dUlYtY99tjjAIkBAOQXBTAAwGfUqlWrwnbt2u2fhFnnzZsXtbW1QgMiIqKkpCRGjhwZY8eOjaOPPjpKSkosBeBT2LRpU8ybNy8Rs7Zv337/iooKPwMEAMgjLv4AAD6jCy+8cPeioqKKJMz64osvCgz4P5o3bx5HHXVUXHLJJTFy5MjIZrOWAvAJZs2alYg5i4qKWlx88cWDJAYAkD8UwAAAn9GBBx6YiMfqVVdXJ+ZOFWDXKC8vj1GjRsWll16qCAb4BPPmzYuamppEzHrQQQd5DDQAQB5RAAMAfEZdu3YdnoQ5582bF/X19QIDPlFFRUWMGjUqLr744jj88MOjqKjIUgD+QV1dXbz66quJmLVLly77SwwAIH8ogAEAPoNTTjmlY3l5+W5JmPXll18WGLBVWrVqFccff3xcdNFFMWLEiCgo8C0kwN966aWXEjFnRUXFbieddFJ7iQEA5AffvQMAfAYnnnji55MwZ21tbcyfP19gwDZp06ZNjB49OsaOHasIBvgb8+fPj9ra2iSMmvnud7/7eYkBAOQH37UDAHwGn/vc5/ZLwpwLFy6Muro6gQGfyV+L4PPOOy+GDx+uCAby3ubNm2PhwoWJmLVfv37DJQYAkB98tw4AsI1atWpV2Lp1672TMKvHPwPbU6dOneLkk0+Oc889NwYNGmQhQF6bPXt2IuZs06bN3hUVFX4WCACQB1z0AQBso/PPP39gYWFheVOfs76+PubMmSMwYLvr2bNn/OQnP4nzzjsv9t5778hkMpYC5J3Zs2dHfX19k5+zqKio4vzzzx8oMQCA9FMAAwBso/3333/fJMz5+uuvR01NjcCAHaZLly4xZsyYOOecc2Lw4MEWAuSV6urqeOONNxIx64EHHriPxAAA0k8BDACwjbp27ZqIxz/PnTtXWMBO0bt37zjttNPinHPOif79+1sIkDeScr3VvXv3vaUFAJB+CmAAgG0wZMiQ0srKyj2a+py5XM7jn4Gdrk+fPnHWWWfFOeecE7vttpuFAKk3e/bsyOVyTX7Oli1b7jlo0KBSiQEApJsCGABgG5x55pl7ZjKZbFOfc9myZbFu3TqBAbtEnz594uyzz44zzzwzevbsaSFAaq1bty6WL1/e5OfMZDLZs846a4jEAADSrcgKAAC23tChQ4clYc558+YJC9jlBgwYEAMGDIgFCxbE+PHjY+nSpZYCpM68efOiS5cuTX7OffbZZ5+ImC4xAID0cgcwAMA26Nix4z5JmHP+/PnCApqMAQMGxC9/+cs47bTTolu3bhYCpEpSrrs6deq0j7QAANJNAQwAsJWOOOKIlhUVFf2a+pxVVVWxaNEigQFNSiaTicGDB8e//uu/xpgxY6JDhw6WAqTCW2+9FVVVVU1+zoqKis8deuihLSQGAJBeCmAAgK108sknD46ITFOfc/78+dHY2CgwoEnKZDKx9957x4UXXhhjxoyJ9u3bWwqQaI2NjbFgwYJE/Cv4u9/97h4SAwBILwUwAMBW2n333fdMwpze/wskwV+L4AsuuCBOPvnkaNu2raUAiZWU66/BgwfvKS0AgPQqsgIAgK3Trl27wU19xlwul5Q7UAAiIqKwsDCGDx8e++yzT0ybNi0mTJgQ69evtxggURYsWBC5XC4ymab9sJgOHToMlhYAQHq5AxgAYCsMGjSotGXLlgOa+pzvvfdebNy4UWBA4hQVFcWIESPikksuidGjR0fLli0tBUiMDz/8MJYtW9bk52zZsuXA/v37l0gMACCdFMAAAFvhxz/+8aBMJtPkn6Li7l8g6f5aBI8dOzZOOOGEaNGihaUAibBw4cImP2Mmk8n+5Cc/GSAtAIB0UgADAGyFvffee88kzJmEHzwCfBrNmjWLww47LMaOHRujRo2KsrIySwGatKT8Il5SrmsBANh63gEMALAVunbtOqSpz1hfXx9vvvmmsIBUKS4ujpEjR8bBBx8czz77bDz++ONRXV1tMUCT8+abb0Z9fX0UFTXtH7t16dJlT2kBAKSTO4ABAD6lioqKgoqKikFNfc4lS5bE5s2bBQakUklJSYwcOTLGjh0bRx99dJSUeIUl0LTU1tbG0qVLm/ycLVu2HFRaWupngwAAKeQiDwDgUzr77LP7FhYWNvlnj7722mvCAlKvefPmcdRRR8Ull1wSI0eOjGbNmlkK4HpsKxQWFpafffbZvaQFAJA+CmAAgE9p//3375+EOV9//XVhAXmjvLw8Ro0aFf/+7/8eI0eOjGw2aymA67FP6fOf//xAaQEApI8CGADgU+rRo8fuTX3G2traePvtt4UF5J2KiooYNWpUXHzxxXH44Yc3+XdvAum2ePHiRLySo1evXoOkBQCQPgpgAIBPqXXr1k3+DoklS5ZEQ0ODsIC81apVqzj++OPj4osvjhEjRkRBgW97gZ2voaEhlixZ0uTnbNOmjQIYACCFfCcMAPApDBkypLR58+a9m/qcb775prAAIqJ169YxevToGDt2rCIYcF32MZo3b95n0KBBpdICAEgX3wEDAHwKp556av9MJtPkr53eeustYQH8jTZt2sTo0aPjvPPOi+HDhyuCAddlfyOTyRT84Ac/+Jy0AADSxXe+AACfwuDBg5v84/Hq6+tj0aJFwgL4CJ06dYqTTz45/u3f/i323nvvyGQylgLsUIsXL07Eqzn23HPPgdICAEgXBTAAwKfQpUuXAU19xnfeeSfq6uqEBbAFnTt3jjFjxiiCgR2utrY23n333SRc53oPMABAyiiAAQA+hZYtW/Zv6jN6/DPAp9elS5cYM2ZMnHvuuTF48GALAfL2+iwJ17kAAGwdBTAAwCcYPnx4eUlJSeemPqfHPwNsvV69esVpp50W55xzTvTvrwMB8u/6rLS0tPPw4cPLpQUAkB4KYACAT/Ctb31rt4ho8s8IXbx4sbAAtlGfPn3irLPOinPOOSd22203CwG2i4T8gl7m29/+dj9pAQCkhwIYAOAT7L777k2+CVi7dm1s2LBBWACfUZ8+feLss8+OM888M3r27GkhwGfy4Ycfxrp165r8nAMHDlQAAwCkSJEVAABsWadOnZr8D8TefvttQQFsRwMGDIgBAwbEggULYvz48bF06VJLAbb5Oq1Vq1audwEA2GkUwAAAn6CyslIBDJCnBgwYEP3794958+bFQw89FO+++66lAFtlyZIlsddeezX1613PvgcASBEFMADAFnTq1CnbvHnzXk19ziVLlggLYAfJZDIxePDg2GOPPeLll1+OBx98MFauXGkxQGqu05o3b967Xbt2RatXr66XGABA8nkHMADAFowZM6ZnJpPJNuUZGxsbPZoUYCfIZDKx9957x4UXXhhjxoyJ9u3bWwrwiZYuXRqNjY1NesaCgoLsqaee2kNaAADp4A5gAIAt2Hvvvfs29RlXrlwZtbW1wgLYSf5aBO+5554xa9asmDBhQqxevdpigI9UW1sb77//fnTu3LlJzzls2LC+EbFIYgAAyecOYACALejRo0eTL4DfeecdQQHsAoWFhTF8+PC48MILY/To0VFZWWkpQGKv15Jw3QsAwKejAAYA2ILWrVs3+ff/vvvuu4IC2IUKCwtjxIgRcckll8To0aOjZcuWlgIk7notCde9AAB8Oh4BDQCwBc2bN+/Z1GdUAAM0kW+wi4pixIgRsd9++8WUKVPiscceiw0bNlgMEO+9914SrnsVwAAAKeEOYACAj9G/f/+SkpKSjk19TgUwQNPSrFmzOOyww2Ls2LExatSoKCsrsxTIc0m4XistLe3Ut2/fYmkBACSfAhgA4GOccMIJ3Zr69dK6deuiqqpKWABNUHFxcYwcOTJ+/etfK4Ihz1VVVcX69eub+pgF3/zmN7tLCwAg+RTAAAAfY8iQIT2b+oxJeJwgQL77axE8duzYOProo6OkpMRSIA8l4botCde/AAB8MgUwAMDH6N69e8+mPqPHPwMkR/PmzeOoo46KSy65JEaOHBnNmjWzFMgjSbhuS8L1LwAAn0wBDADwMVq1atWjqc+4bNkyQQEkTHl5eYwaNSr+/d//PUaOHBnZbNZSIA8k4botCde/AAB8MgUwAMDHqKio6NXUZ1y+fLmgAJL750yMGjUqLr744jj88MOjqKjIUiDFknDd1rJly16SAgBIPgUwAMBHyGazmbKysq5NecbGxsZYtWqVsAASrlWrVnH88cfHxRdfHCNGjIiCAt+qQxqtWrUqGhsbm/SMJSUlXbPZbEZaAADJ5rtKAICPcNxxx7UrKCgobsozrl69Ourr64UFkBKtW7eO0aNHx9ixYxXBkEJ1dXXxwQcfNOkZCwoKio877rh20gIASDbfTQIAfITPf/7zXZr6jO+//76gAFKoTZs2MXr06Dj//PNj+PDhimBIkRUrVrgOBgBgh/NdJP+PvTuPr7I888d/nSwEkhD2HUQEUVRAoIiouCtq64Jabd1arVorbqO2tlXbaavTOu38Rqffdmpbu9rWpYogsqgFRXCttAIKArJDgAAJBLKQ5JzfH8WO4+DOcp6T9/v18jWvTv657ut6hNvnk/t+AICd2G+//bL+xVcSXiAC8PF17do1Lr300rj99ttj2LBhkUq5lRWSLgn7tyTsgwEAeH8FWgAA8H917txZAAxAVujevXtceeWVsXr16njiiSdi9uzZkclkNAYSKAn7tyTsgwEAeH8CYACAnWjXrp0roAHIKj169Igrr7wyli5dGpMmTYo5c+ZoCiRMEvZvSdgHAwDw/gTAAAA7UVxc3D3baxQAAzRPffr0ibFjx8aSJUti/PjxsWDBAk2BhEjC/i0J+2AAAN6fbwADAOxESUlJz2yur7q6Ourq6gwKoBnbb7/94l/+5V/ia1/7WhxwwAEaAglQV1cX1dXV9sEAAOxWAmAAgHc5/PDDSwsKCtpmc40VFRUGBUBERPTt2zduvPHGuOGGG2LffffVEMhy2b6PKygoaDt8+PASkwIASC4BMADAu5x44oldsr3GDRs2GBQA/8uAAQPiG9/4Rtxwww3Ru3dvDQH7uE+yH+5qUgAAyeUbwAAA79KvX7+sD4DXr19vUADs1IABA+LAAw+MuXPnxoQJE2LlypWaAlkkCTe5HHDAAV0i4i3TAgBIJgEwAMC7dO/evXO21+gEMADvJ5VKxaBBg2LgwIExe/bsGD9+fKxbt05jwD4uZ/bDAAC8NwEwAMC7tG/fvlO21ygABuDDSKVSMWzYsBg6dGjMnj07HnvsMbdIwF6WhBPASdgPAwDw3gTAAADv0rp166w/8ZCEF4cAZI+3g+BDDz00XnnllZg4caK/S8A+LtH7YQAA3psAGADgXUpKSrL6xENjY2Ns3rzZoAD4yPLz8+Pwww+P4cOHx/PPPx8TJ06MqqoqjYE9aPPmzdHY2BgFBdn7Wi7b98MAALw/ATAAwLu0bNmySzbXV1lZGZlMxqAA+Njy8/Nj1KhRMXLkyHjhhRcEwbAHZTKZqKqqio4dO9oPAwCwWwiAAQDepaioKKuvvKusrDQkAHaJgoKCGDVqVIwYMSJmzpwZkydPji1btmgM7IH9XDYHwNm+HwYA4P3laQEAwP8YPnx4SX5+fkk21ygABmBXa9GiRRx//PFxxx13xNlnnx0lJSWaAs14P5efn18yfPhwfxAAACSUABgA4B2OOOKIDtleo+//ArC7FBUVxejRo+P73/9+nH322VFcXKwpsBsk4cr1JOyLAQDYOQEwAMA79O3bt1221+gEMAC729tB8B133BGnn356tGrVSlOgme3n9ttvv7YmBQCQTAJgAIB36NSpkwAYAHYoKSmJz3zmM3HnnXfG6NGjo0WLFpoCzWQ/l4R9MQAAOycABgB4hw4dOrTN9hqTcGUgALmlpKQkzj777PjOd74To0aNivz8fE2BHN/PJWFfDADAzgmAAQDeoaysrG221ygABmBvad++fVx00UVx5513xgknnBCFhYWaAjm6nysrK3MCGAAgoQTAAADvUFJS0j6b68tkMlFdXW1QAOxV7dq1i/POOy+++93vxqhRoyIvz+sF+CiSsJ8rLS0VAAMAJJT/QgMAeIfi4uK22VxfXV1dNDY2GhQAWeHtE8F33HGHIBg+gsbGxqirq7MvBgBgt/BfZgAA79CqVausPung9C8A2ahDhw5x0UUXxbe//e04/PDDBcGQA/u6oqIiJ4ABABLKf5EBALxDQUGBABgAPqauXbvGpZdeGt/61rdi2LBhkUqlNAUSuq9r0aJFW1MCAEimAi0AAPgfhYWFZdlc39atWw0JgKzXrVu3uPLKK2P16tXxxBNPxOzZsyOTyWgMJGhfl+37YgAA3psAGADgnZujgoLW2VyfE8AAJEmPHj3iyiuvjKVLl8akSZNizpw5mgIJ2ddl+74YAID35gpoAIAdWrdunZefn98ym2sUAAOQRH369ImxY8fGLbfcEgMGDNAQSMC+Lj8/v1WrVq28OwQASCCbOACAHQYNGlQSEVn9scJt27YZFACJtd9++8UNN9wQX/va1+KAAw7QEJq1BOzr8gYPHlxsUgAAySMABgDY4YADDijJ9hpramoMCoDE69u3b9x4441xww03xL777qshNEu1tbVZX2P//v1LTQoAIHl8AxgAYIeePXtm/QuuJLwoBIAPa8CAATFgwICYP39+jBs3LpYvX64pNBtJ2Nf16NGjxKQAAJJHAAwAsEOnTp0EwACwFwwYMCAOPPDAmDt3bkyYMCFWrlypKeS8JOzrunbtKgAGAEggATAAwA5lZWVZ/4Krrq7OoADISalUKgYNGhQDBw6M2bNnx4QJE2Lt2rUaQ85KQgDcpk0bV0ADACSQABgAYIeysjIngAFgL0ulUjFs2LAYOnRozJ49O8aPHx/r1q3TGHKOABgAgN1FAAwAsENJSUlxttfoBDAAzcXbQfCQIUPi5ZdfjokTJ0ZFRYXGkDOSEAAnYX8MAMD/JQAGANihqKioKNtrrKmpMSgAmpW8vLw4/PDDY/jw4fH888/HE088EZWVlRpD4iUhAG7RokWRSQEAJI8AGABgh8LCwhbZXF86nY7t27cbFADNUn5+fowaNSpGjhwZL7zwQkycODGqqqo0hsTavn17ZDKZSKVSWVtjixYtWpgUAEDyCIABAHbI9gC4oaHBkABo9goKCmLUqFExYsSImDlzZkyePDm2bNmiMSROJpOJhoaGyOaMtbCw0AlgAIAk/neTFgAA7NgYFRRk9QuuxsZGQwKAHVq0aBHHH398HHnkkfHMM8/E1KlTY9u2bRpDomR7AJzt+2MAAN5jH6cFAAA7NkZZ/oLL9c8A8H8VFRXF6NGj49hjj41nnnkmpkyZEjU1NRpDImT7DS8FBQWugAYASCABMADA2xujLH/B5QpoAHhvbwfBRx11VEyfPj2efvrpqK2t1RiymgAYAIDdIU8LAAD+QQAMAMlXUlISn/nMZ+LOO++M0aNHZ/X1uiAABgBgdxAAAwDskO1XQAuAAeDDKykpibPPPjv+7d/+LUaPHh2FhYWagv3dR5Sfn9/SlAAAkkcADADw9sYoL88JYADIMa1bt46zzz47vve978UJJ5wgCMb+7iPIz8/3LwwAQAIJgAEAdkilUlm9N2psbDQkAPiY2rVrF+edd15897vfjRNOOCEKCgo0Bfu7D94f55sSAEDyCIABAHbI9gA4nU4bEgB8Qu3bt/9nEDxq1KjIy/NqBPu799kfp0wJACB5/FcOAMAOXnABQPPRoUOHuOiii+J73/ueIJi9JpPJZHuJ/sUAAEggmzgAgP+R1QFwAl4QAkDidOzYMS666KL41re+FYcffnj4fTDs796xOc7yG3IAANg5mzgAgITsjQTAALD7dOvWLS699NL41re+FcOGDRMEs0dk+xXQeXl5/kUAAEigAi0AAPiHbH/BJQAGgN2ve/fuceWVV8ayZcviiSeeiDlz5mgKzXl/5/AIAEACCYABAHbIZDJOAAMAERGx7777xtixY2PJkiUxYcKEmD9/vqZgfwwAQCIIgAEA/ocr7gCA/2W//faLG264Id56660YP358vPnmm5rCLpPtV0Cn3IUOAJBIAmAAgB2y/QVXtr8gBIBc1rdv37jxxhvjrbfeinHjxsWiRYs0hU/MFdAAANjEAQDsXln9Bs4BDADY+/r27Rs333xz3HDDDdG7d28NIdf3d75BAgCQQE4AAwDskO0nMATAAJA9BgwYEAMGDIj58+fHI488EitXrtQUcnF/5woaAIAEcgIYAGCHVCqVzvL6DAkAssyAAQPi1ltvjbFjx0bPnj01hJza32UScEc1AAD/lxPAAAD/QwAMAHysv6MHDRoUBx98cDz//PMxadKk2LRpk8aQ+P1dtv+CJAAAO+cEMADADul0dr/fEgADQHarr6+PioqK2LZtm2aQE/u7dDrtBDAAQAI5AQwA8D+cAAYAPrK6urp4+umnY9q0acJfcm1/5wQwAEACCYABAP6HEw4AwIfW0NAQ06ZNiyeffDK2bt2qIXxkCfgGsAAYACCBBMAAADtkMpmsDoDz8ny9AwCywdvB71NPPRXV1dUaQs7u7wTAAADJJAAGANgh219wCYABYO9qbGyMGTNmxJNPPhmVlZUawieWn5+f9VtkUwIASB4BMADADplMpiGb6yssLDQkANgL0ul0zJo1KyZPnhwbN27UEHaZgoLsfjXX1NTUaEoAAAncZ2oBAMA/NDY2bs/m+gTAALBnpdPpePnll2Py5Mmxdu1aDWGXa9GiRbb/O1BvSgAAySMABgDYoampSQAMAEQmk4nZs2fH448/HuXl5RpCs93fNTY2CoABABJIAAwAsENDQ0NWv+ASAAPA7vV28PvEE0/E6tWrNYTdLtuvgM72G3IAAHiPfaYWAAD8gyugAaD5mjNnTkyaNCmWLl2qGewx2X4FtAAYACCZBMAAADs0NTU5AQwAzcyCBQtiwoQJ8dZbb2kG9nfv0tDQIAAGAEggATAAwA7Z/oJLAAwAu87ChQtj/PjxsXjxYs1gr8n2K6Cz/RckAQB4j32mFgAA/EO2B8AFBQWRl5cX6XTasADgY1q+fHmMGzcu5s+frxnsVXl5eVkfAG/fvt0JYACABBIAAwDs0NDQkPUnHFq1ahXbtm0zLAD4iFauXBmPPPKI4Jes2tclYH8sAAYASCABMADADrW1tXXZXqMAGAA+mnXr1sX48eNj9uzZkclkNISs2tdlu7q6ulqTAgBIHgEwAMAOW7du3ZrtNSbhRSEAZIP169fHY489JvjFvu4TqK6u3mpSAADJIwAGANihqqpKAAwACbdhw4Z4/PHH45VXXommpiYNwb7uE6isrHT1DABAAgmAAQB22LRpU9a/4GrZsqVBAcBOVFVVxcSJE+OFF16IxsZGDSHrJSEA3rRpkxPAAAAJJAAGANhh3bp1WR8AOwEMAP/bli1bYsKECYJfEicJ+7ry8nIBMABAAgmAAQB2WLZsmSugASAhqqurY/LkyTFz5syor6/XEBInCfu6pUuXCoABABJIAAwAsMP8+fOz/gRwcXGxQQHQrNXU1MSUKVPimWeeEfySaEnY173++uu+AQwAkEACYACAHRYsWFCXyWQaUqlUYbbW2Lp1a4MCoFmqq6uLp59+OqZNmxbbtsmkSL5s39el0+mGpUuXbjcpAIDkEQADALxDU1PTtoKCgrbZWp8AGIDmZvv27TF9+vR48sknY+tWt9GSO7J9X9fU1ORfOACAhBIAAwC8Q0NDw9ZsDoBLS0sNCYDm8ndyTJs2LZ566qmorq7WEHJOtu/rGhsb/YsHAJBQAmAAgHeor6+vbNWqVc9src8JYAByXWNjY8yYMSOefPLJqKys1BByVrbv6+rr66tMCQAgmQTAAADv0NDQkNVvmgXAAOSqdDods2bNismTJ8fGjRs1hJyX7fu6bN8XAwDw3gTAAADvUFdXV5XN9ZWWlkYqlYpMJmNYAOSETCYTr732Wjz++OOxatUqDaFZSKVSUVJSktU11tbWVpkUAEAyCYABAN5h27Ztm7K5vvz8/GjVqlXU1NQYFgCJlslkYvbs2fH4449HeXm5htCstGrVKvLz87O6xq1btzoBDACQUAJgAIB3qK6u3pztNZaVlQmAAUist4PfiRMnxpo1azSEZqmsrCzra9y2bVuVSQEAJJMAGADgHaqqqjZle43t2rWLtWvXGhYAiTNnzpyYNGlSLF26VDNo1tq1a5f1NW7atMkJYACALNbQWBgFjQ0REZFKRSavMJre/pkAGADgHSoqKqqyvcYkvDAEgHdasGBBTJgwId566y3NgITs5zZs2CAABgDIYoUFDf9MejMRqab0/+S+AmAAgHdYtWpV1r/oatu2rUEBkAgLFy6M8ePHx+LFizUD3iEJAfDq1aurTAoAIJkEwAAA77BgwYKsD4CdAAYg2y1fvjzGjRsX8+fP1wzYiST8Ql8S9sUAAOycABgA4B2eeOKJjZlMpimVSuVna41OAAOQrVauXBmPPPKI4Bc+QLb/Ql8mk2l64oknNpoUAEAyCYABAN6huro6vX379g1FRUVdsrVGJ4AByDZr166NCRMmxOzZsyOTyWgIJHw/t3379g3V1dVpkwIASCYBMADAu9TV1a0XAAPAB1u/fn089thjgl/Isf1cXV3delMCAEguATAAwLvU1dVVtGnTJmvrKykpiRYtWsT27dsNC4C9oqKiIiZOnBivvPJKNDU1aQh8BEVFRVFcXJz1+2GTAgBILgEwAMC7bN26dV2XLll7ADhSqVR07Ngx1qxZY1gA7FFVVVUxceLEeP755wW/8DF17NgxUqlU1u+HTQoAILkEwAAA71JVVZX1Jx46deokAAZgj9m8eXM8/vjj8cILL0RjY6OGwCfcx9kPAwCwOwmAAQDeZf369Vn/zbMkvDgEIPm2bNkSU6ZMiZkzZ0Z9fb2GwC7QsWNH+2EAAHYrATAAwLusXr066088JOHFIQDJVVNTE1OmTIlnnnlG8Au7WBJ+kW/VqlUCYACABBMAAwC8y9///ves/+aZABiA3aG2tjYmT54czz77bNTV1WkINNN93KuvvioABgBIMAEwAMC7PPzww+t//OMfN6RSqcJsrbFz584GBcAus3379pg+fXpMnTo1tm3bpiGwG2X7CeB0Ot3w8MMPC4ABABJMAAwA8C7V1dXpurq68latWu2TrTV26NAh8vLyIp1OGxgAH1tDQ0NMmzYtnnrqqaiurtYQ2M3y8vKiQ4cOWV1jfX39mtraWptMAIAEEwADAOxEbW3tmmwOgAsKCqJdu3axceNGwwLgI2tsbIwZM2bEk08+GZWVlRoCe0j79u2joCC7X8fV1NSUmxQAQLIJgAEAdmLz5s2r2rdvn9U1duvWTQAMwEeSTqdj1qxZMXnyZH+HwF7av2W7LVu2rDQpAIBkEwADAOzEpk2bVvfp0yera+zWrVvMmzfPsAD4QG8Hv1OmTIkNGzZoCOzF/Vu227BhwxqTAgBINgEwAMBOrFixYvWwYcOyusYkvEAEYO/KZDLx0ksvxZQpU6K83K2usLd17do162tctWrVKpMCAEg2ATAAwE7Mnz9/9ZgxY7K6xiS8QARg78hkMjF79uyYOHFirFnjMB9kiyT8At+8efP8oQEAkHACYACAnRg3btyab37zm5mISGVrjU4AA7Azc+bMiSeeeCKWLVumGZBlEvALfJlx48atNikAgGQTAAMA7MTrr79e29DQsKmwsLBDttZYXFwcZWVlsWXLFgMDIBYsWBDjx4+PJUuWaAZkobKysiguLs7qGhsaGjYuWLCgzrQAAJJNAAwA8B62bt26vF27dh2yucauXbsKgAGauYULF8b48eNj8eLFmgFZLAm3t2zbtm25SQEAJJ8AGADgPVRVVS1t167d0GyusWfPnrFw4ULDAmiGli1bFo899ljMnz9fMyABevbsmfU1VlZWLjUpAIDkEwADALyHdevWLevTp09W15iEF4kA7ForVqyIRx99VPALCZOEfdvatWuXmRQAQPIJgAEA3sPChQuXHX744VldY69evQwKoJlYtWpVjB8/PubOnRuZTEZDIGGSsG9buHDhMpMCAEg+ATAAwHuYNm3a0ksuuSSra+zevXvk5+dHU1OTgQHkqHXr1sX48eNj9uzZgl9IqIKCgkR8A/jpp59eZloAADmw/9QCAICde+ihhzbcd999W/Pz80uzdjNXUBBdunSJNWvWGBhAjqmoqIiJEyfGyy+/HOl0WkMgwbp27RoFBdn9Gq6xsbH6kUce2WBaAADJJwAGAHgf27ZtW15WVnZwNtfYq1cvATBADqmqqoqJEyfG888/74YHyBFJ+P7vtm3blpsUAEBuEAADALyPLVu2LMv2ALhnz57x0ksvGRZAwm3evDkef/zxeOGFF6KxsVFDIIck4fu/W7ZsWWpSAAC5QQAMAPA+1q9fvyzbT2z06NHDoAASbMuWLTFlypSYOXNm1NfXawjkoCTs19avX7/MpAAAcoMAGADgfSxYsGDh0KFDs7rGfffdN1KpVGQyGQMDSJCampqYMmVKPPPMM4JfyGGpVCr23XffrK9z/vz5C00LACA3CIABAN7Ho48++uYFF1yQ1TWWlJRE586dY926dQYGkAC1tbUxefLkePbZZ6Ourk5DIMd17do1WrVqlfV1/vnPf15kWgAAuUEADADwPiZNmlRVX1+/oaioqGM217nvvvsKgAGy3Pbt22P69OkxderU2LZtm4ZAM9GnT5+sr7G+vr7iySefrDItAIDcIAAGAPgAW7duXZTtAXCfPn3ipZdeMiyALNTQ0BDTpk2Lp556KqqrqzUEmpkkXP+8detWp38BAHKIABgA4ANUVFQs7NChw8hsrjEJLxYBmpvGxsaYMWNGPPnkk1FZWakh0EwlYZ9WUVHh+78AADlEAAwA8AGWLl266MADD8zqGnv16hUFBQXR2NhoYAB7WTqdjlmzZsWkSZNi06ZNGgLNWGFhYfTs2TMR+13TAgDIHQJgAIAPMHPmzEWnnnpqdm/qCgqiZ8+esWzZMgMD2EveDn4nT54cGzdu1BAg9tlnn8jPz0/CfnexaQEA5I48LQAAeH+//OUvV6bT6bpsr7NPnz6GBbAXZDKZePHFF+O73/1u3H///cJf4J+ScP1zOp2u++Uvf7nStAAAcocTwAAAH6C6ujpdXV29uE2bNodkc539+vWL6dOnGxjAHpLJZGL27NkxceLEWLNmjYYAO92fJWCvu7i6ujptWgAAuUMADADwIWzYsGFetgfA/fv3NyiAPeTVV1+NSZMmxapVqzQD2KlUKpWI/dmGDRvmmhYAQG4RAAMAfAiLFy9+o2/fvlldY1lZWXTu3DnWr19vYAC7yYIFC2L8+PGxZMkSzQDeV5cuXaK0tDQJ+9z5pgUAkFsEwAAAH8JTTz31+ujRo7O+zv33318ADLAbLFy4MMaPHx+LFy/WDOBD78uSYMqUKa+bFgBAbsnTAgCAD/aLX/xiTWNjY1W215mUF40ASbFs2bK4++674z/+4z+Ev8BHkoTv/zY0NFTee++9q00LACC3OAEMAPAhNDQ0ZDZv3jy/Q4cOI7O5TgEwwK6xYsWKePTRR2P+fDejArm7L9uyZYs/5AAAcpAAGADgQ1q3bl3WB8AdO3aMNm3axObNmw0M4GNYtWpVjB8/PubOnRuZTEZDgI+lbdu20aFDh0Tsb00LACD3CIABAD6kefPmzTvooIOyvs4DDzwwXnrpJQMD+AjWrVsX48ePj9mzZwt+gV2yH0uCuXPnzjMtAIDcIwAGAPiQ/vznP88/77zzsr7OAw44QAAM8CFVVFTEuHHjBL/ALt+PJcHDDz/sBDAAQA4SAAMAfEgTJ06srK2tXdGqVat9srnOgw8+2LAAPkBVVVVMnDgxnn/++WhqatIQYJdKwq0xNTU1yydNmlRlWgAAuUcADADwEWzYsOHvvXr1yuoAuG3bttG1a9dYu3atgQG8y+bNm+Pxxx+PF154IRobGzUE2OW6desWbdu2TcS+1rQAAHKTABgA4CNYuHDha7169Toj2+scMGCAABjgHbZs2RJTpkyJ5557LrZv364hwG6TlO//Lly48O+mBQCQmwTAAAAfwcSJE/9+wgknZH2dBx54YEyfPt3AgGavpqYmpkyZEs8880zU19drCLDbDRgwIBF1jh8//u+mBQCQmwTAAAAfwb333rv6Bz/4wfqioqLO2VznAQccEHl5eZFOpw0NaJZqa2tj8uTJ8eyzz0ZdXZ2GAHtEXl5e9O/fP+vrrK+vX3ffffeVmxgAQG4SAAMAfESVlZVzu3btmtXHgFu1ahX77LNPLFu2zMCAZqWuri6efvrpmDZtWmzbtk1DgD1qn332iVatWmV9nZs2bZpjWgAAuUsADADwES1dunR2tgfAERGDBg0SAAPNRkNDQ0ybNi2eeuqpqK6u1hBgr+2/kuCtt976m2kBAOQuATAAwEc0ffr0v48cOTLr6xw4cGBMmDDBwICc1tDQEM8991w8+eSTUVlZqSHAXt9/JcG0adP+bloAALlLAAwA8BH9x3/8x9JbbrmlOj8/v3U219mrV68oKyuLLVu2GBqQc9LpdMyaNSsmTZoUmzZt0hBgrysrK4tevXplfZ2NjY1b7rnnnmUmBgCQuwTAAAAfUW1tbXrDhg1/7dKly3HZXGcqlYqBAwfGrFmzDA3IGW8Hv5MnT46NGzdqCJA1Bg4cGKlUKuvr3Lhx4yu1tbVpEwMAyF0CYACAj+Gtt956JdsD4IgQAAM5I51Ox8svvxxTpkyJ8vJyDQGyct+VBIsWLXrFtAAAcpsAGADgYxg/fvwrRxxxRNbXedBBB0VBQUE0NjYaGpBImUwmZs+eHRMnTow1a9ZoCJCVCgoK4qCDDkpErY888ogAGAAgx+VpAQDAR/fjH/94ZX19/fpsr7OoqCj69etnYEAivfrqq3HHHXfEz3/+c+EvkNX69esXRUVFWV9nXV1d+b333rvaxAAAcpsTwAAAH9OGDRte6dGjx6ezvc5BgwbFggULDAxIjCVLlsSECRNi/vz5mgEkwuDBgxNR5/r1653+BQBoBgTAAAAf07x5815OQgA8bNiwePjhhyOTyRgakNXefPPNmDBhQixevFgzgMRIpVIxdOjQRNQ6d+7cl0wMACD3CYABAD6m++677+XRo0dnIiKVzXW2bds2evfuHcuWLTM0ICstW7YsHnvsMSd+gUTq06dPtG3bNgmlpu+9996/mhgAQO4TAAMAfEwTJ06s3Lp165LS0tK+2V7rkCFDBMBA1lmxYkU8+uijgl8g0YYMGZKIOqurqxc+/fTTm00MACD3CYABAD6B8vLyl/fff/+sD4AHDx4c48aNMzAgK6xcuTImTJgQc+fOdT09kHhJ+f7vmjVrfP8XAKCZEAADAHwCM2fOfG7//ff/fLbX2a1bt+jWrVuUl5cbGrDXrFu3LsaPHx+zZ88W/AI5oWfPntGlS5dE1DpjxoznTAwAoHkQAAMAfAK33Xbba5dcckl1fn5+62yvdciQIQJgYK9Yv359PPbYY4JfIOck5frnxsbGzbfddts8EwMAaB4EwAAAn0BlZWXThg0b/tqlS5fjsr3WQw89NCZNmmRowJ78MzKeeOKJeP7556OpqUlDgJxz6KGHJqLOioqKV6qrq9MmBgDQPAiAAQA+oXnz5s1MQgDcu3dv10ADe0RVVVVMnDgxXnjhhWhsbNQQICd17949evbsmZT9quufAQCakTwtAAD4ZP77v/97VkQk4kTFpz71KQMDdpstW7bEQw89FLfffns899xzwl8gpw0fPjwRdWYymfTdd9/9gokBADQfTgADAHxCkyZNqtqyZcuCsrKyg7K91uHDh8fjjz9uaMAuVVNTE1OmTIlnnnkm6uvrNQTIealUKg477LBE1Lply5bXp0+fvsXUAACaDwEwAMAusHz58lkDBw7M+gC4S5cu0atXr1i5cqWhAZ9YbW1tTJ48OZ599tmoq6vTEKDZ6N27d3Ts2DEx+1QTAwBoXgTAAAC7wLPPPvvCwIEDr0hCrcOGDRMAA59IXV1dPP300zFt2rTYtm2bhgDNzrBhwxJT61/+8pcXTQwAoHnxDWAAgF3g1ltvnV9fX782CbUefvjhkUqlDA34yBoaGmLq1Klx6623xuOPPy78BZqlJF3/XFdXt/rWW29dYGoAAM2LE8AAALtAQ0NDZs2aNc/16dPns9lea7t27aJPnz6xZMkSgwM+7J9xMW3atHjqqaeiurpaQ4Bmbb/99ou2bdsmotbVq1fPNDEAgOZHAAwAsIs8++yz05IQAEdEHHHEEQJg4AOl0+mYNWtWTJo0KTZt2qQhABFx5JFHJqbW6dOnTzMxAIDmxxXQAAC7yC233PJaQ0NDZRJqHT58eLRo0cLQgJ1Kp9Px3HPPxW233Rb333+/8Bdgh6KiovjUpz6ViFobGho23HLLLXNNDQCg+XECGABgF6murk6Xl5c/t88++5yR7bW2bNkyDj300Hj55ZcNDvindDodL7/8ckyZMiXKy8s1BOBdhgwZEkVFRYmodc2aNc/V1tamTQ0AoPkRAAMA7EIvvvjiM0kIgCMiRo4cKQAGIiIik8nE7NmzY+LEibFmzRoNAXif/VNSzJo161kTAwBongTAAAC70O233/7KOeecszU/P78022sdMGBAtG/f3tWu0My9+uqrMWnSpFi1apVmALyPjh07xgEHHJCIWhsbG6u/8Y1v/NXUAACaJwEwAMAutHLlyob169fP6tat2+hsrzWVSsXhhx8ekyZNMjhohubMmROTJ0+OJUuWaAbAh3D44YdHKpVKRK3r16+fVVFR0WhqAADNU54WAADsWq+++mpirts77LDDDAyamTfffDP+/d//PX7yk58IfwE+pFQqFSNGjEhMva+88sozpgYA0Hw5AQwAsIvddNNNz5166qnV+fn5rbO91m7dukX//v1j4cKFBgc5btmyZfHYY4/F/PnzNQPgIzrggAOic+fOiai1sbFxy4033jjL1AAAmi8BMADALrZy5cqG8vLyGT179vx0Euo9+uijBcCQw5YvXx7jxo0T/AJ8wv1SUpSXlz9TXl7eYGoAAM2XABgAYDeYMWPGUxdccEEiAuAhQ4ZE69ato7q62uAgh6xcuTImTJgQc+fOjUwmoyEAH1ObNm3i0EMPTUy9zz777FOmBgDQvPkGMADAbvDVr371lYaGhk1JqLWgoCCOOOIIQ4McsW7duvj5z38ed955Z8yZM0f4C/AJjRw5MvLz8xNRa0NDw8abbrrpVVMDAGjenAAGANgNKisrm1atWjW9T58+5ySh3qOPPjqefPJJQREk2Pr16+Oxxx6L2bNn+3cZYBdJpVIxatSoxNS7cuXKadXV1WmTAwBo3pwABgDYTaZNm5aY6/c6duwYAwYMMDRIoA0bNsSvf/3r+Nd//dd49dVXhb8Au9CAAQOiY8eOian36aefftLUAAAQAAMA7CZf+9rX5tTX11ckpd6jjjrK0CBBqqqq4v77749vf/vb8eKLL0ZTU5OmAOxiRx55ZGJqra+vX/eNb3zjdVMDAMAV0AAAu0ltbW16xYoVT++///6fT0K9hx56aLRt2zaqqqoMD7LYli1bYsqUKfHcc8/F9u3bNQRgN2nbtm0MGTIkMfUuX778qdraWtc/AwDgBDAAwO70xz/+cUJSas3Pz4/jjjvO0CBL1dTUxKOPPhq33XZb/OUvfxH+Auxmxx57bOTn5yel3Myvf/3rCaYGAECEABgAYLe66667llZXV89PSr1HH310tGjRwuAgi7wd/H7jG9+IqVOnRn19vaYA7GYtWrSIo48+OjH1btmy5Y177rlnhckBABDhCmgAgN3u9ddfn3T44YcPSEKtxcXFcdhhh8XMmTMNDvayurq6ePrpp2PatGmxbds2DQHYgw477LAoKSlJTL3z5s17wtQAAHibE8AAALvZ9773vanpdLohKfWecMIJkUqlDA72koaGhpg6dWrceuut8fjjjwt/AfawVCoVJ5xwQmLqTafT27/73e8+ZXIAALzNCWAAgN1s+vTpWyoqKmZ26dIlER/Y7d69e/Tv3z/efPNNw4M9qKGhIaZNmxZPPfVUVFdXawjAXnLAAQdE9+7dE1NvRUXFczNmzPAXBwAA/+QEMADAHjBr1qxEXcuXpFMvkHTpdDqee+65uP322+PRRx8V/gLsZccff3yi6p0xY8YkUwMA4J2cAAYA2AO++tWvvnT66adXFRYWtk1CvQMHDoyOHTvGhg0bDA92k3Q6HbNmzYrJkyfHxo0bNQQgC3Ts2DEGDhyYmHobGhoqb7755pdMDgCAd3ICGABgDygvL29YsWLF1MRsEvPy4sQTTzQ42A3S6XS8+OKL8Z3vfCfuv/9+4S9AFjnppJMiLy85r8tWrFgxpaKiotHkAAB4JwEwAMAe8qtf/erRiMgkpd6jjjoqysrKDA52kUwmE6+++mp873vfi1//+texdu1aTQHIImVlZXHUUUcl6q+W//7v//6zyQEA8G4CYACAPeQ///M/l1dWVv4tKfUWFhbGMcccY3CwC7wd/P785z+PNWvWaAhAFjruuOOioCA5X0urqqqa/dOf/nS1yQEA8G4CYACAPeill14al6R6jzvuuCgqKjI4+JjmzJkTd911V/z85z+P1au9owfIVkVFRYn7xbcXXnhhnMkBALAzBVoAALDnjB079pkFCxZUFhYWtktCvSUlJXHEEUfE9OnTDQ8+gjfffDPGjx8fb731lmYAJMCRRx4ZJSUliam3oaFh0zXXXPOsyQEAsDMCYACAPai8vLxh6dKlE/v3739xUmo+8cQT49lnn410Om2A8AEWLVoUjz32WCxevFgzABIiLy8vTjzxxETVvGTJkifKy8sbTA8AgJ3ucbUAAGDP+u1vfzsxIjJJqbdjx44xdOhQg4P3sXz58rj77rvjRz/6kfAXIGGGDRsWHTp0SFLJmd/85jePmxwAAO9FAAwAsIf953/+5/JNmza9kqSaTz/99EilUoYH77Jy5cr4yU9+Et///vdj/vz5GgKQMHl5eXHGGWckquZNmza9fM8996wwPQAA3osroAEA9oKXXnpp/KmnnnpYUurt2rVrDBkyJGbPnm14EBHr1q2L8ePHx+zZsyOTyWgIQEINHTo0OnfunKiaX3jhhQkmBwDA+xEAAwDsBZdffvkzS5YsWVdUVNQlKTWfccYZ8be//U3YRbO2fv36eOyxxwS/ADkglUrF6aefnqia6+rq1lx22WXTTQ8AgPcjAAYA2AsqKyub5s+f/8ihhx56dVJq7tatm1PANFsbNmyIxx9/PF555ZVoamrSEIAc8KlPfSq6du2aqJrfeOONcdXV1WnTAwDg/fgGMADAXvL1r399XDqdrktSzb4FTHNTVVUV999/f3z729+OF198UfgLkCNSqVR8+tOfTlTN6XS69pvf/OZjpgcAwAdxAhgAYC+ZMWNG9Zo1a/7Ss2fPxLx97N69ewwcODDmzJljgOS0LVu2xIQJE+KFF16IxsZGDQHIMYceemh069YtUTWvXr36qRkzZlSbHgAAH8QJYACAvejXv/71HyMiUR8SPeuss5wCJmdt27YtHn300bjtttviueeeE/4C5KC8vLwYM2ZM0srO/OpXv/qT6QEA8KH2vFoAALD3fP/733+rqqoqUR/V7dGjR3zqU58yPHJKfX19TJ06Nb71rW/F1KlTo76+XlMActSIESOiS5cuiap506ZNf73rrruWmh4AAB+GABgAYC975plnHkpazWeccUbk5dlKkjvmzZsXjz76aGzdulUzAHJYQUFBnH766Ymre9q0aQ+aHgAAH5a3dgAAe9nYsWNn1tfXr01SzZ07d47DDjvM8ACARBk5cmR06NAhUTXX1dWtHjt27POmBwDAhyUABgDYyyorK5tee+21Pyat7jPPPDMKCgoMEABIhBYtWiTy9O/s2bP/UF1dnTZBAAA+LAEwAEAWuOqqqyY0NjZWJanm9u3bx9FHH214AEAiHHfccdGmTZtE1dzQ0LDxiiuumGh6AAB8FAJgAIAssGDBgrqFCxc+lrS6R48eHYWFhQYIAGS1li1bxsknn5y4uhcuXDhu6dKl200QAICPQgAMAJAlvv71r/8pnU7XJqnmtm3bximnnGJ4AEBWO+2006K0tDRRNTc1NdV+7Wtfe8j0AAD4qATAAABZ4umnn968fPnyxF3xN3r06GjXrp0BAgBZqUOHDnH88ccnru5ly5ZNmD59+hYTBADgoxIAAwBkkbvvvvtPmUymKUk1FxYWxumnn254AEBWOvPMMxP3yYpMJtN41113/dH0AAD4OATAAABZ5Be/+MWatWvXTkta3UcccUT06tXLAAGArNK7d+847LDDEld3eXn5X+6///51JggAwMchAAYAyDIPP/zwn5JWcyqVijPPPNPwAICsMmbMmEilUomr+8EHH/yT6QEA8HEJgAEAsszXv/71NzZs2DAraXUPHDgwDj74YAMEALLCoEGDYsCAAYmru6KiYuatt966wAQBAPi4BMAAAFlo3Lhxv01i3WPGjIm8PFtMAGDvysvLizFjxiSy9j//+c+/NUEAAD7RflgLAACyz/XXXz+nqqrqr0mru1evXnHUUUcZIACwVx1zzDHRvXv3xNW9adOmV2666aa5JggAwCchAAYAyFJ/+tOf7k1i3WPGjInS0lIDBAD2ijZt2sRZZ52VyNofeOCBe00QAIBPSgAMAJClbrrpprlJPAVcXFwcZ555pgECAHvFWWedFS1btkxc3Zs2bXrl5ptvnmeCAAB8UgJgAIAsNm7cuF8lse5Ro0ZF7969DRAA2KP69OkTI0eOTGTtjz322K9MEACAXUEADACQxcaOHTu7qqrqb0mrO5VKxfnnnx+pVMoQAYA9tv/4/Oc/n8j9R2Vl5d+uueaav5kiAAC7ggAYACDLTZ069bdJrLtv374xZMgQAwQA9ojDDjsssTeQTJ48+TcmCADAriIABgDIcpdeeumLVVVVryax9s9//vNRXFxsiADAblVaWhrnn39+Imuvqqr66+WXX/6SKQIAsKsIgAEAEuChhx76WRLrLisri9NPP90AAYDd6qyzzoqSkpIklp753e9+91MTBABgVxIAAwAkwA033DB3w4YNs5JY+3HHHRd9+vQxRABgt+jbt28cddRRiay9oqJi1te//vU3TBEAgF1JAAwAkBA///nPfxoR6aTVnUql4vOf/3zk5dl6AgC7Vn5+flx00UWRSqWSWH76F7/4xX+bIgAAu5q3cAAACXHHHXe8tW7duulJrL13795xzDHHGCIAsEudcMIJ0b1790TWXl5e/pc77rjjLVMEAGBXEwADACTI3XfffW8mk2lKYu1nnXVWtG3b1hABgF2iQ4cOcfrppyey9kwm03T33Xf/3BQBANgdBMAAAAlyzz33rCgvL386ibW3bNkyzj33XEMEAHaJc889N1q0aJHI2tesWTP1xz/+8UpTBABgdxAAAwAkzA9/+MOfZzKZhiTWPnz48Bg0aJAhAgCfyKGHHhpDhw5NZO3pdLrhBz/4wS9MEQCA3UUADACQMPfee+/qRYsWPZDU+i+++OIoKSkxSADgY2ndunVcfPHFia1/4cKFf7jvvvvKTRIAgN1FAAwAkECXXXbZrxsaGjYlsfaysjJXQQMAH9u5554bpaWliay9oaFh4+WXX/47UwQAYHcSAAMAJNDs2bNrXn311V8ntf4jjjgiDj74YIMEAD6SwYMHx+GHH57Y+l955ZX7Zs+eXWOSAADsTgJgAICEOueccx6tqalZmtT6L7roomjZsqVBAgAfSsuWLeNzn/tcYuuvqalZMmbMmMdMEgCA3U0ADACQUJWVlU3Tpk37RVLrb9++fZx++ukGCQB8KGeccUa0b98+sfU/+eST91ZXV6dNEgCA3U0ADACQYOedd960qqqqV5Ja/wknnOAqaADgAx188MFx/PHHJ7b+TZs2vXzBBRc8a5IAAOwJAmAAgIT74x//eG9EZJJYeyqVigsuuMBV0ADAe2rZsmVccMEFkUqlkrqEzP333/8zkwQAYE8RAAMAJNzNN988b9WqVU8ktf6OHTsm+nt+AMDudcEFF0THjh0TW/+KFSse//rXv/6GSQIAsKcIgAEAcsCNN974k6ampq1JrX/kyJExdOhQgwQA/pdPfepTMWLEiMTW39TUVH3zzTf/t0kCALAnCYABAHLAxIkTK//+97//KslruPDCC6OsrMwwAYCIiGjTpk18/vOfT/QaZs+efd/EiRMrTRMAgD1JAAwAkCPOPvvsh2pqapYntf7S0tK46KKLDBIAiFQqFV/84hejtLQ0sWuoqal566yzznrYNAEA2NMEwAAAOaKioqJx0qRJP07yGgYPHhwjR440TABo5o444og46KCDEr2GJ5544qeVlZVNpgkAwJ4mAAYAyCGXXHLJzIqKihlJXsMFF1wQ3bp1M0wAaKZ69uyZ+KufKyoqZnzhC1+YZZoAAOwNAmAAgBzzb//2b/ek0+ntSa2/RYsWceWVV0ZhYaFhAkAzU1hYGF/60pcSvQ9Ip9Pb/+3f/u0e0wQAYG8RAAMA5Jh777139aJFix5M8hq6d+8eZ555pmECQDNzxhlnRPfu3RO9hsWLFz947733rjZNAAD2FgEwAEAO+uxnP/vL2traRL94PPHEE2Pw4MGGCQDNxKBBg+Kkk05K9Bpqa2tXn3vuub80TQAA9iYBMABADlq8eHH9uHHj/j3Ja0ilUnHJJZdE27ZtDRQAclybNm3ikksuiVQqleh1jBs37t8XL15cb6IAAOxNAmAAgBx1+eWXv1RRUTEjyWsoLS2NL3zhC4l/GQwAvLe3f+mrdevWiV5HRUXFM5dffvlLJgoAwN4mAAYAyGE33HDDXU1NTVuTvIaDDjrI94ABIId95jOfiUMOOSTRa2hqaqq+4YYbfmiaAABkAwEwAEAOGzdu3MbZs2cn/jt0p5xyiu8BA0AOOuSQQ+LTn/504tfx17/+9efjxo3baKIAAGQDATAAQI77zGc+81B1dfXCJK8hlUrFF7/4xejQoYOBAkCO6NixY3zpS19K/KceNm/ePO+00057xEQBAMgWAmAAgBxXXV2dfuCBB34UEekkr6O4uDguvfTSyMuzhQWApMvPz4/LLrssiouLk76U9P333/+ftbW1aVMFACBbeHsGANAMXH/99XMWLVr0YNLXsf/++8e5555roACQcOedd1707ds38etYuHDhH7/61a++bqIAAGQTATAAQDNxySWX/Lyurq486es4/vjjfQ8YABJs2LBhccwxxyR+HXV1dWsuvPDC+0wUAIBsIwAGAGgmXnvttdoHHnjguxGRSfI6UqlUfOlLX4oePXoYKgAkTO/evePSSy9N/Hd/IyLzwAMPfO/111+vNVUAALKNABgAoBm5+uqr/7Z06dJHk76OoqKiGDt2bJSWlhoqACRE69at46qrrorCwsLEr2X58uXjrr766r+ZKgAA2UgADADQzJx33nn/r66ubnXS19GhQ4e4/PLLIy/PlhYAsl1eXl5cfvnl0b59+8Svpb6+ft0ll1zyE1MFACBr999aAADQvLz++uu1Dz744Pcj4VdBR0QMGDAgzjrrLEMFgCw3ZsyYOPDAA3NiLY899tgPXnnllW2mCgBAthIAAwA0Q1/5ylf+umbNmqm5sJaTTz45Dj30UEMFgCw1ZMiQOOmkk3JiLWvXrv3LpZde+oKpAgCQzQTAAADN1GWXXfYf9fX1FUlfRyqViksvvTS6d+9uqACQZXr06BFf/OIXI5VKJX4tDQ0Nm6655pofmioAANlOAAwA0EzNmDGj+oEHHvhO5MBV0C1btozrr78+2rZta7AAkCXatWsX1113XbRs2TIXlpN56KGH/nXSpElVJgsAQLYTAAMANGNf+cpX/rpkyZI/58Ja2rZtG1dffXW0aNHCYAFgL2vRokVcffXVOfPLWUuXLn30iiuueNlkAQBIAgEwAEAzd+655/6ktrZ2eS6spXfv3jlzzSQAJNXbn2fYZ599cmI9tbW1y88555wfmywAAEkhAAYAaOYWLFhQ97Of/ezbmUymMRfWM2zYsDjllFMMFgD2kk9/+tMxdOjQnFhLJpNp/NnPfvbtBQsW1JksAABJIQAGACBuvfXWBfPnz78/V9Zz5plnxuDBgw0WAPaw4cOHx2c+85mcWc/8+fN/d+utty4wWQAAkkQADABARESMGTPmvpqamrdyYS2pVCouu+yy6Nmzp8ECwB7Su3fvuPjii3PmUwxbt25ddPrpp//aZAEASBoBMAAAERGxcuXKhh/+8Ie3pdPpnLjisGXLlvEv//Iv0aVLF8MFgN2sS5cucf3110dRUVFOrKepqanmu9/97jfKy8sbTBcAgKQRAAMA8E933XXX0ueff/6eXFlPaWlpXHvttVFWVma4ALCblJWVxXXXXRclJSU5s6aZM2fe/f/+3/9bZboAACSRABgAgP/l5JNPHldeXv50rqynU6dOMXbs2Jw5kQQA2aSoqCiuueaa6NixY86sqby8/MlTTz11gukCAJBUAmAAAP6PSy655K66urq1ubKefffdN6644orIy7P9BYBdJS8vL6688sro3bt3zqyprq6u/JJLLvmh6QIAkOi9uhYAAPBus2bNqn7ooYfujIh0rqxp4MCBcd555xkuAOwi559/fhxyyCG5tKT0gw8+eOesWbOqTRcAgCTLb3tQ9NzpjndbRG15oQ4BADRTEydOXDNmzJi8Tp06Dc2VNfXp0yfy8/PjzTffNGAA+ATOOuusOOmkk3JqTa+//vp9Z5555kTTBQAgCYq7N0Ze6c5/5gQwAADv6dRTT/31li1bXs+lNZ122mlx9NFHGy4AfEzHHntsnHrqqTm1pi1btrxx2mmn/cZ0AQDIBQJgAADeU0VFReONN974jcbGxqpcWtcFF1wQRx55pAEDwEd05JFHxuc+97mcWlNjY2PVzTff/I2KiopGEwYAIBcIgAEAeF9//OMf1z/yyCPfiRz6HnAqlYqLLroohgwZYsAA8CENHTo0LrrookilUrm0rPQjjzzynfvvv3+dCQMAkCsEwAAAfKBLL730hQULFvwupzbCeXnxpS99Kfbff38DBoAPcNBBB8WXvvSlyMvLrVdJCxYs+N2ll176ggkDAJBLBMAAAHwoo0eP/mVVVdXcXFpTYWFhfOUrX4kePXoYMAC8h169esUVV1wRBQUFObWuqqqqOaNHj/6lCQMAkGsEwAAAfCgVFRWNV1111S0NDQ0bcmldJSUlcfPNN8c+++xjyADwLr17946bbropiouLc2pdDQ0NG6666qqv++4vAAC5SAAMAMCHNmHChE3333//tzKZTDqX1lVcXBzXXXdddO/e3ZABYIfu3bvHtddeG61atcqpdWUymfT999//rQkTJmwyZQAAcpEAGACAj2Ts2LGz58+f/9tcW1fr1q3juuuuiw4dOhgyAM1ehw4d4rrrrovWrVvn3Nrmz5//m7Fjx842ZQAAcpUAGACAj+y44477xaZNm17MtXW1a9cubrzxxmjXrp0hA9BstW3bNmf/Pty4ceOLxx13nO/+AgCQ0wTAAAB8ZNXV1emLL774W3V1datzbW0dO3aMG2+8Mdq0aWPQADQ7ZWVlceONN0bHjh1zbm21tbWrL7zwwturq6vTJg0AQC7Lb3tQ9NzZD9LbImrLC3UIAICdWrZsWf327dtfOvbYY0/Ny8trkUtrKykpiaFDh8Zrr70WNTU1hg1As9ChQ4f42te+Fp06dcq5tTU1NW39zne+M/bBBx9cb9IAAOSC4u6NkVe6858JgAEA+NhefPHFzYcccsiyAQMGnBgRqZzaRBcXx5AhQ4TAADQLHTt2jJtuuik6dOiQi8tLjx8//ravfvWrc0waAIBc8X4BsCugAQD4RC688MIZb7zxxm9ycW3t27ePm266KSdPQgHA2zp16pTL4W+88cYbv77wwgufM2kAAJoLATAAAJ/YqFGjfrFhw4aZubi2t0Pgzp07GzQAOadz585x0003Rfv27XNyfRs2bJg5atSo+0waAIDmRAAMAMAnVltbm77sssu+V1dXtzoX19euXbu44YYbomPHjoYNQM7o0KFDXH/99dGuXbtc3Z+s/sIXvvDd2tratGkDANCc+AYwAAC7xJIlS+oj4pVRo0admpeX1yLX1ldcXBxDhw6NuXPnxrZt2wwcgETr0qVL3HjjjTl77XNTU1P1nXfeec0f/vCHdaYNAEAuer9vAAuAAQDYZWbNmlXVo0ePuYceeujoVCqVn2vra9WqVYwYMSIWLVoUlZWVBg5AIu23335x0003RVlZWU6uL51ON/z617++4fbbb3/TtAEAyFUCYAAA9phJkyatPeqoozbsu+++R+fi+goLC2P48OGxbNmy2LBhg4EDkCgDBgyIa6+9Nlq1apWza5w2bdq/XXLJJc+ZNgAAuez9AmDfAAYAYJc77bTTHn/rrbcezNX1FRUVxTXXXBNDhgwxbAASY8iQIXHNNddEUVFRzq5xwYIFvzv99NOfMG0AAJozATAAALvFEUcccc+GDRtm5ur6CgoK4sorr4wjjjjCsAFIwt/LceWVV0ZBQUHOrrG8vPypESNG/LdpAwDQ3AmAAQDYLaqrq9MXXXTRd2pra1fk7GY6Ly8uvvjiOPLIIw0cgKw1atSouPjiiyMvL3dfA23dunXxZz/72e83NDRkTBwAgObON4ABANhtli9fvr2mpuaFY4899uT8/PyWubjGVCoVgwYNikwmE4sWLTJ0ALLK6aefHueee26kUqmcXWN9fX3FDTfccM3UqVOrTBwAgObi/b4BLAAGAGC3evnll7cUFBS8cMQRR4zOy8trkYtrTKVSccABB0SnTp1i7ty5kck4fATA3lVYWBhXXHFFHHPMMTm9zsbGxuo777zzKz/72c9WmzoAAM2JABgAgL1qxowZlb169Xp98ODBJ6dSqfxcXWfPnj2jb9++8fe//z0aGxsNHoC9olWrVnH11VfHwIEDc3qd6XS64be//e2Nt9122wJTBwCguREAAwCw1z3xxBPlw4cPX9OvX79jIyJn76Hs2LFjDBw4MObMmRN1dXUGD8Ae1a5du7jxxhujT58+ub7U9JQpU779xS9+8XlTBwCgOXq/ADhPewAA2FPGjBkz9Y033vh1rq+zZ8+eceONN0bHjh0NHYA9pkuXLnHTTTdF9+7dc36tc+fO/eU555zzF1MHAID/SwAMAMAe9alPfernS5cufTjX19mlS5e49dZb48ADDzR0AHa7gQMHxje/+c3o1KlTzq/1rbfeemjEiBG/MnUAANg5ATAAAHvcsccee8/GjRtfyPV1FhcXx7XXXhsjRowwdAB2m8MPPzyuuuqqaNmyZc6vdePGjc8fffTR95g6AAC8NwEwAAB7XEVFReNxxx339crKyr/l+loLCgrisssui/PPPz9SqZThA7DLpFKpOP/88+PSSy+NgoKCnF/vpk2bXj7ssMNuqaysbDJ9AAB4bwJgAAD2isWLF9efddZZN1dXV7/ZHNZ7/PHHx5e//OUoKioyfAA+sRYtWsSXv/zlOP7445vFequrq98cM2bMN8rLyxtMHwAA3l9+24Oi585+kN4WUVteqEMAAOw2a9asaVi1atWs0aNHH1dQUNA619fbrVu3OOCAA2LevHlRX1/vAQDgYykrK4trrrkmDjrooGax3rq6uvKxY8de89RTT202fQAA+Ifi7o2RV7rznwmAAQDYq+bNm1ezevXqZ04++eTjCwoKSnN9ve3atYuRI0fG8uXLY+PGjR4AAD6S/v37x0033RRdu3ZtFuutr69fd9111335T3/6U4XpAwDA/xAAAwCQ1ebMmbMtlUq9fOSRR56Ul5eX83ckt2jRIkaMGBG1tbWxdOlSDwAAH8rxxx8fX/rSl5rN5wQaGxu33HXXXdf99Kc/XWn6AADwvwmAAQDIejNnzqzs2bPn64MHDz4plUrl5/p6U6lUHHLIIdGqVatYsGBBZDIZDwEAO5WXlxef/exn4/TTT49UKtUs1pxOp7f//ve//+o3vvGN1z0BAADwfwmAAQBIhEmTJpXvs88+8wYOHHhCKpUqaA5r3m+//WLAgAExd+5c3wUG4P8oKyuL6667LoYNG9Zs1pxOp7f/8Y9/vOmqq676qycAAAB2TgAMAEBiTJw4cc3BBx+85MADDzwulUrlNYc1t2/fPoYOHRqLFi2KLVu2eAgAiIiIffbZJ66//vro2bNns1lzJpNpnDBhwm1f/OIXn/cEAADAexMAAwCQKI8++ujy/fff/42DDjrohOZwHXRERHFxcRx11FHR2NgYb731locAoJkbPXp0XHHFFVFSUtJs1pxOpxsefvjhr15yySWzPAEAAPD+BMAAACTO+PHjVw0cOHDpAQcccGxzOQmcSqViwIAB0aVLl3jjjTeiqanJgwDQzBQVFcWll14aJ554YrP53m/EP07+Pv7447dffPHFMz0FAADwwQTAAAAk0iOPPLLs0EMPXbb//vs3mxA4IqJHjx4xZMiQePPNN2Pr1q0eBIBmonv37vEv//IvccABBzSrdWcymaYnnnji9s997nPPeAoAAODDEQADAJBYDz/88NJjjjlmY+/evY+KiGZzFKq0tDSGDx8eq1evjvXr13sQAHLcwIED45prrol27do1t6VnZsyY8YOzzjprqqcAAAA+PAEwAACJdv/99795zDHHVO6zzz5HRDMKgVu0aBGHHXZYtGzZMhYuXBjpdNrDAJBjCgoK4pxzzonzzz8/WrRo0dyWn37uuefuOuWUUyZ4EgAA4KMRAAMAkHi///3v5w8bNmxF3759j2lO10GnUqno27dvDB06NBYvXhxbtmzxMADkiJ49e8YNN9wQgwcPblbf+434x7XPU6ZM+fbpp58+2ZMAAAAfnQAYAICc8OCDDy4ZNmzYin79+jWrEDgionXr1nHEEUdEfX19LF261MMAkGCpVCpOOOGEuOKKK6JNmzbNbv07wt9vnXPOOX/xNAAAwMcjAAYAIGc89NBDS4YNG7a8X79+xza3EDg/Pz8OPvjg6NWrV8yfPz8aGho8EAAJU1JSEpdffnmccMIJkZ+f3+zWn8lkGp944olvffazn53maQAAgI9PAAwAQE556KGHlo4cOXJdnz59RqWa252ZEdG1a9cYNmxYLFu2LCorKz0QAAnRt2/fuO6662K//fZrluvPZDLpp59++rvnnHPO054GAAD4ZATAAADknD/96U+LDj300KX7779/s7sOOiKiuLg4jjzyyCgpKYk333wz0um0hwIgSxUUFMRnP/vZuPDCC6OkpKRZ9iCdTjc88sgjt5x//vnTPREAAPDJCYABAMhJDz/88NId3wQelUqlmt09mqlUKvr06RMHH3xwLFy4MLZt2+ahAMgynTt3jrFjx8bQoUOjGV5aERH/CH+feOKJ2y+88MLnPBEAALBrCIABAMhZDz300JIePXq8NmjQoGPz8vJaNMcetG3bNkaNGhVNTU2xZMkSDwVAFkilUjF69Oi48soro0OHDs22D01NTdt++9vf/stll132oqcCAAB2HQEwAAA5bdKkSeXdu3efM3jw4GYbAufn58eAAQOiV69esWDBgti+fbsHA2Avad26dVx66aVx/PHHR35+frPtQ2NjY/WvfvWrf7nuuute81QAAMCuJQAGACDnTZ48eW1jY+OMI4444uiCgoKS5tqHrl27xqhRo2Lbtm2xcuVKDwbAHpRKpWLUqFExduzY6NWrV7PuRX19/fo77rjjK9/61rcWejIAAGDXEwADANAsPP/881UbNmx45rjjjjuqsLCwrLn2obCwMAYNGhT77bdfLF68OGpraz0cALtZ+/bt44orrogTTzwxCgub9/uU2tralTfffPPVP/nJT1Z7MgAAYPcQAAMA0Gz87W9/27p27doZJ5xwwsjCwsK2zbkXnTp1ipEjR0Z1dbXTwAC70ciRI+Pqq6+OHj16NPte1NTULL/hhhuu/e1vf7vOkwEAALuPABgAgGbltdde2zpv3rynTznllKFFRUWdmnMvCgsL49BDD4399tsvFi1a5DQwwC709qnfk08+udmf+o2I2Lx587yLL774unHjxm30dAAAwO71fgFwat9zYsTOftC4LmLjq610DwCAxOrVq1fhs88++69du3Y9QTciGhoaYurUqTF58uRobGzUEICPqaCgIE499dQYPXq04HeH8vLyp4499tjvrly5skE3AABg9+swrDYKuuz8ZwJgAAByWuvWrfNeeumlm/fdd9+zdeMfVq9eHffff38sWbJEMwA+ov322y8uuugi1z2/w8KFC38/fPjwnzY0NGR0AwAA9gwBMAAAzd7zzz9/8aGHHnp1RKR0IyKTycTMmTPjz3/+c9TV1WkIwAcoKSmJ8847L0aMGBGplL9Kdki//PLL9xx77LEPagUAAOxZ7xcA+wYwAADNwn333Tfn+OOP39yrV6/DQwgcqVQqevfuHcOHD49169ZFRUWFhwTgPRxyyCExduzY6N+/v/B3h0wm0/jMM8/828knnzxONwAAYM97v28AC4ABAGg2fve7370xePDgJf369Ts6lUrl60hEcXFxjBgxInr06BFLly6N2tpaTQHYoUOHDvGFL3whzjzzzCguLtaQHZqammoeeOCBWz73uc9N1w0AANg7BMAAALDDww8/vKygoOC54cOHH1FQUFCqI//QrVu3OO6446K0tDQWL14cTU1NmgI0Wy1btoxzzjknLr300ujevbuGvENtbe2K22677arbbrvtDd0AAIC9RwAMAADv8Oyzz25avHjx0yeddNKQoqKiTjryD3l5edGnT58YOXJkbN26NVatWqUpQLNz+OGHx1e+8pUYMGBA5OXlacg7VFVV/e3CCy+8/oEHHvDdAAAA2MsEwAAA8C7z58+vefbZZ58+44wz+hcXF/fSkf/RsmXLGDJkSOyzzz6xdOnSqKmp0RQg53Xs2DG++MUvximnnBItW7bUkHdZt27dMyeffPI3Xn755W26AQAAe9/7BcCpfc+JETv7QeO6iI2vttI9AAByWmFhYer555//0sEHH3y5bvxfTU1N8fzzz8f48eOjurpaQ4Cc07p16zjzzDPjyCOPdOJ35zJ///vff3rMMcfc39DQkNEOAADIDh2G1UZBl53/TAAMAAARMWnSpM8cc8wxt6RSKdfg7ERNTU1MmTIlpk2bFg0NDRoCJF5hYWGccsopcdJJJ0VRUZGG7EQ6na6fOnXqd88555y/6AYAAGSX9wuAXQENAAAR8Yc//GHhfvvt98aAAQOOysvLkwS8S2FhYQwYMCCGDh0amzZtinXr1mkKkFiDBw+Oq666KoYOHRoFBQUashONjY1Vv//972/5whe+MEs3AAAg+/gGMAAAfAgTJkxYXV1dPf3II4/8VGFhYTsd+b9KS0vjsMMOi/79+8eaNWti8+bNmgIkRu/evePyyy+PU045JUpLSzXkPWzdunXxLbfccs33vve9hboBAADZyTeAAQDgI+jTp0+LJ5988us9evQ4TTfe3/z58+ORRx6JlStXagaQtXr16hXnnHNODBgwQDM+wKpVq5444YQTfrBy5Ur3/QMAQBbzDWAAAPgYnnnmmfOHDx9+fSqVytON95bJZGL27Nkxbty4qKio0BAga3Tu3DnOOuusGDp0aKRSKQ15/z/Lm2bNmvXDk08++THdAACA7OcbwAAA8DH85je/eX3//fd//cADDzzSd4HfWyqViu7du8cxxxwT7dq1i2XLlkV9fb3GAHtN27Zt49xzz42LL744evToIfz9AI2NjdUPPvjgLZ/97Gf/ohsAAJAMvgEMAAAf0/jx41dFxPOHHXbYiMLCwjIdeW95eXnRu3fvOOqoo6KgoCBWrlwZjY2NGgPsMcXFxXHKKafEl770pejbt2/k5bnA4YPU1tau+MEPfnD9LbfcMk83AAAgQf/94xvAAADwyQwePLjVo48++s1u3bqdpBsfTn19fTzzzDMxderU2LZtm4YAu01ZWVmceuqpceSRR0ZRkQsbPqyVK1c+/ulPf/pHixcvdm0DAAAkjG8AAwDALvLkk0+edeSRR96USqVcl/MhCYKB3eXtE7/HHnus4PcjyGQyDbNmzfoP3/sFAIDk8g1gAADYRX7/+98v6NGjx2uHHHLIyPz8fL8x+SEUFBREv3794qijjoq8vLxYtWqVq6GBT6Rly5ZxwgknxBVXXBEHHXRQFBQUaMqH1NDQsOG3v/3t1z7/+c8/oxsAAJBcroAGAIBd7Lzzzut4991339m2bdvBuvHR1NTUxLPPPhvTpk2LLVu2aAjwoZWVlcXxxx8fxxxzTBQXF2vIR1RVVfW3a6+99vZHHnlkg24AAECyuQIaAAB2g06dOhVMmzZtbN++fT8XESkd+WgaGhri+eefjyeffDI2bJBFAO/7522cdNJJccQRR0RhodvKPobMokWL/nTsscf+pLKyskk7AAAg+QTAAACwG/3hD38Ydfrpp99WUFDQRjc+unQ6Ha+++mpMnTo1Vq5cqSHAP/Xq1StOOeWUGDp0aOTl5WnIx9DY2Fg1YcKEOy666KKZugEAALlDAAwAALvZaaed1vbee+/9docOHUbqxse3fPnymDZtWrz88suRTqc1BJqhvLy8OOyww+L444+P3r17a8gnsHHjxue//OUvf3fSpElVugEAALlFAAwAAHtAYWFh6qmnnjpv+PDh16RSKXeUfgIbNmyIGTNmxHPPPRc1NTUaAs1AcXFxjBo1Ko4++ujo2LGjhnwCmUym4ZVXXvl/J5100kMNDQ0ZHQEAgNzzfgFwftuDoufOfpDeFlFb7p0VAAB8WOl0On7zm9+8Xlpa+uLgwYM/VVhYWKYrH09xcXEMGDAgjj322GjTpk2sXbs2amtrNQZyUIcOHeKMM86ISy+9NAYOHBjFxcWa8gnU1tau+slPfnLjxRdf/IybFAAAIHcVd2+MvNKd/8wJYAAA2A1OPPHENvfdd9+tnTp1Olo3PrnGxsb429/+Fs8++2wsWrRIQyAH9OvXL44++ugYNmxYFBQUaMguUFFR8cwXv/jFf5s+ffoW3QAAgNzmCmgAANhLHn744RNGjx799YKCgta6sWusX78+Zs6cGc8//3xUV1drCCRIaWlpHHnkkXHUUUdF586dNWQXaWxs3DJ16tS7PvvZz/5FNwAAoHkQAAMAwF50ySWXdP3+97//rXbt2g3VjV2nsbExXnvttXjuuedi/vz5GgJZbMCAATFq1KgYPHiw0767WFVV1atf//rXv/e73/1urW4AAEDzIQAGAIC9rF27dvlTp0699OCDD740lUrl68iutXz58nj++efj5ZdfjpqaGg2BLFBSUhLDhw+PI444Inr37q0hu1gmk2mcN2/efSeeeOJvq6urfewXAACaGQEwAABkia9//ev73Xjjjf9aWlraXzd2vXQ6HW+++WY899xz8dprr0VjY6OmwB5UUFAQgwcPjlGjRsUBBxwQeXl5mrIbVFdXL/zP//zPf/3BD36wRDcAAKB5EgADAEAWOfjgg1v9+c9/vrZ3795jIiKlI7tHZWVlvPjii/HCCy/EunXrNAR2o65du8bIkSPj8MMPj7Zt22rI7pNZunTpn88888z/t3jx4nrtAACA5ksADAAAWejuu+8eePHFF9/WqlUrd6PuZuXl5fHqq6/GSy+9FOvXr9cQ2AU6d+4cI0aMiGHDhkW3bt00ZDerqalZ9tvf/vbOm266aa5uAAAAAmAAAMhS/fr1K3r44Ycv79+//4WpVMpdqXvA8uXL46WXXoqXX345qqurNQQ+grKyshg+fHiMGDHCd333kEwmk164cOEfzj777F8sXbp0u44AAAARAmAAAMh6P/3pT4d97nOf+2bLli176Mae0dDQEHPnzo2//vWvMXfu3Ni+Xa4CO9OyZcsYNGhQDBs2LA455JAoKCjQlD2ktrZ21R//+Mc7rr322r/rBgAA8E4CYAAASIA+ffq0ePTRR69wGnjPS6fTsXTp0nj11VedDIaIaNu2bQwbNiyGDRsWffr0ibw8fyTtSZlMpuG11177+ZlnnvmnioqKRh0BAADeTQAMAAAJ8uMf//jQCy644JutWrXaRzf2vLdPBs+ePTvmzp0bdXV1mkKzUFZWFoMHD45hw4ZF//79Iz8/X1P2gpqammX333//nTfccINv/QIAAO9JAAwAAAnTrl27/HHjxp37qU996qq8vDwb870kk8nEihUrYu7cuTFnzpxYsWJFZDIZjSEnpFKp6Nu3bwwbNiwGDRoUHTt21JS9qKmpqfbVV1/92ZgxY/5cWVnZpCMAAMD7EQADAEBCffnLX+5x++23f7V9+/aH68bet2XLlnjjjTdizpw5MW/evKivr9cUEqVly5Zx8MEHx6BBg+KQQw6J0tJSTckCGzdufPG73/3uv//iF79YoxsAAMCHIQAGAIAEKywsTE2cOPGMkSNHXlNQUNBaR7JDXV1dvPnmm/HGG2/EG2+8EevXr9cUslKXLl3ioIMOioMOOigOOOCAKCoq0pQs0djYuGXmzJk/PvPMMyc2NDS4XgAAAPjQBMAAAJADjjzyyNY/+9nPrujbt++5EZGnI9mluro6Fi5cGPPnz4958+ZFZWWlprBXtGvXLg455JAYMGBA9O/fP1q39nsjWSj91ltv/fmqq676xaxZs6q1AwAA+KgEwAAAkEN++ctfjhgzZsyNrVq16q0b2SmdTsfKlStj0aJFsXDhwli8eHFs27ZNY9gtSkpKol+/ftG/f//Yf//9o1evXpGX53dEslVNTc3yRx999EdXXnnlK7oBAAB8XAJgAADIMd26dSt8+OGHPzd48ODL8vPzbdyzXCaTiTVr1sTChQtj0aJFsWjRotiyZYvG8LGUlZVF//79/xn6du/ePVKplMZkuaampprXXnvtV2PGjHmgoqKiUUcAAIBPQgAMAAA56rjjjiv7r//6r8tdC508mzdvjuXLl8eKFSti+fLlsXjx4qipqdEY/pfi4uLo169f9O7dO/bZZ5/Yd999o6ysTGMSJJPJpJcsWfLn66677pfTp0/3mx8AAMAuIQAGAIAc99Of/nTIueeee3NpaWlf3UimxsbGWLlyZSxdujSWLVsWy5cvj3Xr1kUmk9GcZiKVSkWXLl1in332iT59+kSfPn2iV69eUVBQoDkJtXXr1sUPPvjgj6699tq/6wYAALArCYABAKAZaNeuXf64cePOGTp06BUFBQWtdST56uvrY+XKlf88KbxixYpYu3ZtpNNpzUm4vLy86Nq1a+yzzz7//KdXr17RsmVLzckBjY2NW/7617/+4pxzznm0srKySUcAAIBdTQAMAADNyIknntjmnnvuuXzfffcdk0qlHB3MMdu3b481a9bEmjVrYu3atbF27dooLy+PDRs2CIazUF5eXnTs2DG6desWXbt2jW7dukW3bt2iR48eUVhYqEE5JpPJNC5ZsuRR1z0DAAC7mwAYAACaoa9+9av7Xnfdddd16NDhCN3IfY2Njf8MhNetWxfr1q2LioqKWLduXWzbtk2DdrPS0tLo3LnzP//p0qVLdO3aNbp27eoK52Ziw4YNM//rv/7rxz/60Y+W6wYAALC7CYABAKAZ++UvfznirLPOuq64uNj3gZupmpqaWL9+/T//qaioiMrKyqisrIxNmzZFY2OjJn2AgoKCaN++fbRr1y7at28fHTt2jC5dukSnTp2ic+fOUVxcrEnN1NatW98aP378PVdcccXLugEAAOwpAmAAAGjm2rVrl//ggw+eOWLEiCsLCwvb6gjvtHnz5n+GwZs2bYrKysqorq6OLVu2xJYtW6K6ujqqq6sjk8nk3NpTqVS0bt06WrduHWVlZdGmTZsoLS39X2Fvu3btok2bNh4U/peGhobKl1566efnnHPO+OrqavevAwAAe5QAGAAAiIiIoUOHFt97770XHHjggRfk5+c7ssiHlk6n/xkEV1dXR01Nzfv+k8lkora2NtLpdNTX10dTU1PU1dXt0u8U5+XlRcuWLSM/Pz+KiooiLy8vWrVqFalUKoqLi3f6T0lJSbRq1eqfgW9paWnk5eUZMB9aU1NTzYIFC/745S9/+Y+zZ8+u0REAAGBvEAADAAD/y2mnndb2rrvuurRPnz5n5+XlFeoIe9LbgfDbtm/f/r7XUBcUFESLFi3++b/fDnxhT8pkMg1LliwZd8stt/xq0qRJVToCAADsTQJgAABgp0477bS2d95554X777//5wTBAP9XJpNpWLhw4QO33nrrHwS/AABAtni/ADi/7UHRc2c/SG+LqC33/gcAAHLZokWL6u69995X0un0swcddFCnkpKS3roC8A8VFRUz/7//7/+77aKLLpq6aNGiOh0BAACyRXH3xsgr3fnPBMAAAEDMnDmz8u67736qqalpWr9+/Ypbt27dN5VKpXQGaG4ymUx6zZo1U+65555/Peeccx6cOXNmpa4AAADZRgAMAAB8KDNnzqz88Y9//Gw6nZ4uCAaak7eD37vvvvtfzz///McEvwAAQDYTAAMAAB+JIBhoLgS/AABAEgmAAQCAj+XtILisrOyFvn37diwuLu4VEYJgIBdkKioqnrv33nu/PWbMmEcEvwAAQJK8XwCc2vecGLGzHzSui9j4aivdAwAA/unqq6/u8ZWvfOX8Pn36nJWXl9dCR4CkSafT9UuXLh3/X//1Xw/84he/WKMjAABAEnUYVhsFXXb+MwEwAADwkZ1xxhntb7/99rMPPPDA8/Pz81vrCJDtmpqaqhcsWPDgd77znUcmTpzotC8AAJBoAmAAAGC3GD58eMkPf/jDzwwePPjioqKijjoCZJv6+voNr7322u9vvPHGx2fPnl2jIwAAQC4QAAMAALvV0KFDi++5556zDjnkkPOKioq66giwt9XV1a19/fXXH7z++uvHC34BAIBcIwAGAAD2iFatWuXdc889w0455ZTzO3bseJSOAHtYZsOGDbOmTJny4PXXX/9qbW1tWksAAIBcJAAGAAD2uH/913/tf/7555/dq1ev0/Ly8lroCLC7pNPp+pUrV05+4IEHHvnOd76zSEcAAIBcJwAGAAD2mjPOOKP97bfffvYBBxzw2YKCgjY6AuwqjY2NVW+++eafv/e97z06YcKETToCAAA0FwJgAABgrxs+fHjJ97///dGDBg0aU1paur+OAB9XdXX1wtdee+3Rr371q1Nfe+21Wh0BAACaGwEwAACQVb761a/ue8EFF3y6b9++ZxUUFLTWEeCDNDY2bnnrrbfG/+EPf5j4ox/9aLmOAAAAzZkAGAAAyEpDhw4t/sEPfnDy4MGDz27dunV/HQHerbq6+s2XX375weuuu+7ppUuXbtcRAAAAATAAAJDlCgsLU3ffffeQ0aNHn9G1a9fj8vLyinQFmq90Ol1XXl4+bcqUKROuvfbav+sIAADA/yYABgAAEqNPnz4t/v3f/33UyJEjz2rfvv2nIiKlK9AsZDZt2vTXF1544bGvfe1rzzntCwAA8N4EwAAAQCJddNFFXa6++uqTDzzwwLNbtmzZTUcg99TV1a1ZsGDBuJ/+9KdP3n///et0BAAA4IMJgAEAgETr1q1b4d13333k4YcffmqHDh2OyMvLK9QVSK50Ot2wcePGWbNmzZp8/fXXz6qoqGjUFQAAgA9PAAwAAOSMo48+uvWtt956/CGHHHJKu3btBkdEnq5AIqQrKytfmzdv3uQ777xz+owZM6q1BAAA4OMRAAMAADnpuOOOK/vGN75x/CGHHHJa27ZtB4bvBUO2yVRVVc2dN2/epO9///vTpk+fvkVLAAAAPjkBMAAAkPNuu+22vmedddZJffr0Oa5Vq1a9dQT2ntra2uXLly+f/uijjz51xx13vKUjAAAAu5YAGAAAaFa+9KUvdbv44ouP7t+//wlOBsMekamqqpq7cOHCv/z+97+fcd9995VrCQAAwO4jAAYAAJqtSy65pOtll112jDAYdrl0VVXVvIULF/7lV7/61bO/+93v1moJAADAniEABgAAiIirr766x/nnnz9q//33P7JNmzZDUqlUga7Ah5fJZBoqKyv/vnjx4uf+9Kc/zbr33ntX6woAAMCeJwAGAAB4l379+hV97WtfGzRy5MhRPXv2PLaoqKizrsD/VV9fv37VqlXPvPDCC8/9+7//+5zFixfX6woAAMDeJQAGAAB4H61bt8678847Bx599NFHde/efURpaen+4apomq/M1q1bF69Zs+bF5557btY3v/nNOdXV1WltAQAAyB4CYAAAgI9g8ODBrcaOHXvI8OHDD+vevfvw1q1bHxACYXJXprq6+s01a9a88sorr7z8k5/8ZN5rr71Wqy0AAADZSwAMAADwCVx//fX7nHHGGYf169dvePv27Yfm5+e31hWSrLGxsXrjxo2vvvXWWy+PHz/+lR//+McrdQUAACA5BMAAAAC70Je//OUe55xzzvA+ffoM7tix45CioqKuukI2q6+vX7t27doXFy9ePGfixImv3Xvvvat1BQAAILkEwAAAALvRl7/85R6f+cxnBvfr129Qly5dDm/ZsqVAmL2qrq5u7bp16wS+AAAAOUoADAAAsIe0atUq75prrtnn2GOPPXi//fY7uH379oeUlpb2TaVS+brDbpKuqalZtnHjxnlvvfXW3GeffXbef/3Xfy2vra1Naw0AAEBuEgADAADsRQceeGDLq6+++oAhQ4Yc3LNnz4Pbtm17sGuj+biampqqq6qqXi8vL583Z86ceb/85S/nvfjii1t1BgAAoPkQAAMAAGSZoUOHFn/xi1/cf9CgQQf26NHjwHbt2h3YqlWr3qlUKk932CFdU1OzvLKycsHq1asXzJkzZ8Gf//znJTNmzKjWGgAAgOZNAAwAAJAAxx13XNkFF1xw4MEHH3xA165dDywtLd23pKRkn1QqVag7uS2TyTRs27ZtRXV19dJ169YtfOONNxZOmDBh4YQJEzbpDgAAAO8mAAYAAEiw8847r+OJJ57Yp3///vt16dKlT5s2bfZr3bp1v/z8/GLdSZampqaa6urqxZs3b16ybt26pQsXLlzy9NNPL33ooYc26A4AAAAflgAYAAAgx7Rr1y7/kksu6TFkyJCe++67b89OnTr1Kisr61VcXNyzZcuW3VKpVL4u7R2ZTKaprq6uvKamZtWWLVtWVlRUrFy6dOnK2bNnr7r//vvXVFZWNukSAAAAn4QAGAAAoBnp1KlTwec+97luQ4cO7bnPPvv0aNeuXafWrVt3Li4u7tqyZcvORUVFnfLy8lro1MeTTqe319fXr6+rq6uoqalZW11dvb6ysnL9ihUrVr/66qurHnzwwbUVFRWNOgUAAMDuIgAGAADgfznjjDPaH3bYYZ369OnTuUuXLp3Kysral5SUtC0uLu5YVFTUrqioqG2LFi065OfnlzaXnjQ1NW3dvn37xvr6+qr6+vrKmpqaDdu2bavasmXLpnXr1lUsXbp0/Ysvvrh+4sSJlZ4gAAAA9iYBMAAAAB9Lr169CkeNGtXuoIMOatexY8ey9u3bl7Zp06Z1SUlJWXFxcetWrVq1btGiRVlRUVHrwsLC1hGRX1hYWBoR+QUFBSV5eXkFeXl5u/0/LtPpdG06nW5sbGzcFhFNDQ0NW3f83+r6+vrq7du3b6mtra2uqamp3rZtW/XmzZurN23aVL1hw4YtCxYsqJo1a1bl0qVLt5s4AAAASSAABgAAYK/q169fUffu3Vvss88+xSUlJQVv//8LCwtT3bp1+8BTxuXl5VsbGhoyb//vbdu2Na5YsaJmzZo12xcvXlyvwwAAADQn7xcAF2gPAAAAu9vixYvrdwS11boBAAAAu0+eFgAAAAAAAADkBgEwAAAAAAAAQI4QAAMAAAAAAADkCAEwAAAAAAAAQI4QAAMAAAAAAADkCAEwAAAAAAAAQI4QAAMAAAAAAADkCAEwAAAAAAAAQI4QAAMAAAAAAADkCAEwAAAAAAAAQI4QAAMAAAAAAADkCAEwAAAAAAAAQI4QAAMAAAAAAADkCAEwAAAAAAAAQI4o0AIAAAAAAACA5GhoLIyCxoaIiEilIpNXGE1v/0wADAAAAAAAAJAghQUN/0x6MxGppvT/5L6ugAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAIb/v5272ZHiusM4/FZ1NUkz9sQwOF4EyZJtpJCwysa5jSy4n1xPEqRIuQFvvfGSgIwBOzGRQAQERnx0d1UW0cgWGvKxsMGvnmfVdc7/1OJsf+oCAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoMY3JP//9K8My551lzpAk293a7QAAAAAAAAD8iIw3r+SL7TpPxuSt4/ibJJuz20QDBgAAAAAAAHhzrJPp6NvHYcyyjLl7dJTPbl/Jp6sPLufSsM+5ec7q5YOrF0OeP/SVaAAAAAAAAIA3weH7u6zfm79dWDIMSw6225w785vsx3XyzasOby5ssz69c4sAAAAAAAAAr9n69C6bC9sT93a7rKdnORin5Otxynzi1JQcfiwCAwAAAAAAALxO69O7HH68TaaT98cp85R8vbp3Nfszv8q0LHn7xMF1sjk/ZzUPmZ/MmWefhAYAAAAAAAD4oayPdjn7223Gn7x6ZrXPnetX8mBKkpv3cufDd/Pufn5FL56SzcVtNheT3dNt8tQlAwAAAAAAAHyv1sm0ySv/9XtsNWZ3I/lHkgzHi7/4XY7WYz5yiwAAAAAAAAA/Ivtcv/3nPEyS1fHa42t5+vNLyX7JoRsCAAAAAAAAePPt1/nbV3/KvePn1Xc371/NYxEYAAAAAAAA4M0yTHk2rvNo2WdzvHZqzN9v/SF3vju3evng/at5fPDLPDu1yuGyZHSVAAAAAAAAAK/XOGe4ueSvZ4e8M8xZbVe5ceuPufvy3Oqkw4+v5emDX+fuuTlLhhwsEYIBAAAAAAAAXpclGR8OuXP0TR4cPM/9z/+SRyfNDf/1TZezOp/87KdjzizJZkhO7edMy/w/nAUAAAAAAADg/zaMWcZkP8/ZLsmLacr2/MV8+cnvs/tP5/4FmLjAq1ifcioAAAAASUVORK5CYII=";function H0($,q,Q){if(typeof $==="string"&&!isNaN(Number($)))$=Number($);if(typeof $==="number"&&$<100)return v0($);if(typeof $==="number"&&$>=100)return $;if(typeof $==="string"&&$.includes("%")){if(q&&q==="X")return Math.round(parseFloat($)/100*Q.width);if(q&&q==="Y")return Math.round(parseFloat($)/100*Q.height);return Math.round(parseFloat($)/100*Q.width)}return 0}function Y5($){return $.replace(/[xy]/g,function(q){let Q=Math.random()*16|0;return(q==="x"?Q:Q&3|8).toString(16)})}function k0($){if(typeof $>"u"||$==null)return"";return $.toString().replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function v0($){if(typeof $==="number"&&$>100)return $;if(typeof $==="string")$=Number($.replace(/in*/gi,""));return Math.round(L0*$)}function Y0($){let q=Number($)||0;return isNaN(q)?0:Math.round(q*w8)}function S1($){return $=$||0,Math.round(($>360?$-360:$)*60000)}function j7($){let q=$.toString(16);return q.length===1?"0"+q:q}function g7($,q,Q){return(j7($)+j7(q)+j7(Q)).toUpperCase()}function R0($,q){let Q=($||"").replace("#","");if(!C7.test(Q)&&Q!==G2.background1&&Q!==G2.background2&&Q!==G2.text1&&Q!==G2.text2&&Q!==G2.accent1&&Q!==G2.accent2&&Q!==G2.accent3&&Q!==G2.accent4&&Q!==G2.accent5&&Q!==G2.accent6)console.warn(`"${Q}" is not a valid scheme color or hex RGB! "${Q2}" used instead. Only provide 6-digit RGB or 'pptx.SchemeColor' values!`),Q=Q2;let K=C7.test(Q)?"srgbClr":"schemeClr",J='val="'+(C7.test(Q)?Q.toUpperCase():Q)+'"';return q?`${q}`:``}function kB($,q){let Q="",K=Object.assign(Object.assign({},q),$),J=Math.round(K.size*w8),Z=K.color,G=Math.round(K.opacity*1e5);return Q+=``,Q+=R0(Z,``),Q+="",Q}function B2($){let q="solid",Q="",K="",J="";if($){if(typeof $==="string")Q=$;else{if($.type)q=$.type;if($.color)Q=$.color;if($.alpha)K+=``;if($.transparency)K+=``}switch(q){case"solid":J+=`${R0(Q,K)}`;break;default:J+="";break}}return J}function a2($){return $._rels.length+$._relsChart.length+$._relsMedia.length+1}function c7($){if(!$||typeof $!=="object")return;if($.type!=="outer"&&$.type!=="inner"&&$.type!=="none")console.warn("Warning: shadow.type options are `outer`, `inner` or `none`."),$.type="outer";if($.angle){if(isNaN(Number($.angle))||$.angle<0||$.angle>359)console.warn("Warning: shadow.angle can only be 0-359"),$.angle=270;$.angle=Math.round(Number($.angle))}if($.opacity){if(isNaN(Number($.opacity))||$.opacity<0||$.opacity>1)console.warn("Warning: shadow.opacity can only be 0-1"),$.opacity=0.75;$.opacity=Number($.opacity)}if($.color){if($.color.startsWith("#"))console.warn('Warning: shadow.color should not include hash (#) character, , e.g. "FF0000"'),$.color=$.color.replace("#","")}return $}function DB($,q,Q){var K,J;let Z=2.3+(((K=$.options)===null||K===void 0?void 0:K.autoPageCharWeight)?$.options.autoPageCharWeight:0),G=Math.floor(q/w8*L0)/((((J=$.options)===null||J===void 0?void 0:J.fontSize)?$.options.fontSize:k2)/Z),W=[],B=[],V=[],U=[];if($.text&&$.text.toString().trim().length===0)B.push({_type:D0.tablecell,text:" "});else if(typeof $.text==="number"||typeof $.text==="string")B.push({_type:D0.tablecell,text:($.text||"").toString().trim()});else if(Array.isArray($.text))B=$.text;let w=[];return B.forEach((F)=>{var M;if(typeof F.text==="string"){if(F.text.split(` + `)+" "+Q[1];return Q[0]+q+" "+$.join(", ")+" "+Q[1]}function vK($){return Array.isArray($)}function z7($){return typeof $==="boolean"}function z5($){return $===null}function qW($){return $==null}function fK($){return typeof $==="number"}function F5($){return typeof $==="string"}function KW($){return typeof $==="symbol"}function N6($){return $===void 0}function Z5($){return Y6($)&&F7($)==="[object RegExp]"}function Y6($){return typeof $==="object"&&$!==null}function W7($){return Y6($)&&F7($)==="[object Date]"}function G5($){return Y6($)&&(F7($)==="[object Error]"||$ instanceof Error)}function W5($){return typeof $==="function"}function JW($){return $===null||typeof $==="boolean"||typeof $==="number"||typeof $==="string"||typeof $==="symbol"||typeof $>"u"}function VW($){return $ instanceof Buffer}function F7($){return Object.prototype.toString.call($)}function Z7($){return $<10?"0"+$.toString(10):$.toString(10)}function ZW(){var $=new Date,q=[Z7($.getHours()),Z7($.getMinutes()),Z7($.getSeconds())].join(":");return[$.getDate(),UW[$.getMonth()],q].join(" ")}function RK(...$){console.log("%s - %s",ZW(),B7.apply(null,$))}function IK($,q){if(q)$.super_=q,$.prototype=Object.create(q.prototype,{constructor:{value:$,enumerable:!1,writable:!0,configurable:!0}})}function M7($,q){if(!q||!Y6(q))return $;var Q=Object.keys(q),K=Q.length;while(K--)$[Q[K]]=q[Q[K]];return $}function CK($,q){return Object.prototype.hasOwnProperty.call($,q)}function w7($,q){if(!$){var Q=Error("Promise was rejected with a falsy value");Q.reason=$,$=Q}return q($)}function gK($){if(typeof $!=="function")throw TypeError('The "original" argument must be of type Function');function q(...Q){var K=Q.pop();if(typeof K!=="function")throw TypeError("The last argument must be of type Function");var J=this,Z=function(...G){return K.apply(J,...G)};$.apply(this,Q).then(function(G){process.nextTick(Z.bind(null,null,G))},function(G){process.nextTick(w7.bind(null,G,Z))})}return Object.setPrototypeOf(q,Object.getPrototypeOf($)),Object.defineProperties(q,Object.getOwnPropertyDescriptors($)),q}var iG,aG,h1,QW=()=>{},UW,jK,AK,XK,GW;var G8=b1(()=>{iG=/%[sdj%]/g;aG=(($={},q={},Q)=>((Q=typeof process<"u"&&!1)&&(Q=Q.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase()),q=new RegExp("^"+Q+"$","i"),(K)=>{if(K=K.toUpperCase(),!$[K])if(q.test(K))$[K]=function(...J){console.error("%s: %s",K,pid,B7.apply(null,...J))};else $[K]=function(){};return $[K]}))(),h1=(($)=>($.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},$.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},$.custom=Symbol.for("nodejs.util.inspect.custom"),$))(function($,q,...Q){var K={seen:[],stylize:rG};if(Q.length>=1)K.depth=Q[0];if(Q.length>=2)K.colors=Q[1];if(z7(q))K.showHidden=q;else if(q)M7(K,q);if(N6(K.showHidden))K.showHidden=!1;if(N6(K.depth))K.depth=2;if(N6(K.colors))K.colors=!1;if(K.colors)K.stylize=lG;return B5(K,$,K.depth)});UW=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];jK=(($)=>($.custom=Symbol.for("nodejs.util.promisify.custom"),$))(function($){if(typeof $!=="function")throw TypeError('The "original" argument must be of type Function');if(kCustomPromisifiedSymbol&&$[kCustomPromisifiedSymbol]){var q=$[kCustomPromisifiedSymbol];if(typeof q!=="function")throw TypeError('The "nodejs.util.promisify.custom" argument must be of type Function');return Object.defineProperty(q,kCustomPromisifiedSymbol,{value:q,enumerable:!1,writable:!1,configurable:!0}),q}function q(...Q){var K,J,Z=new Promise(function(G,W){K=G,J=W});Q.push(function(G,W){if(G)J(G);else K(W)});try{$.apply(this,Q)}catch(G){J(G)}return Z}if(Object.setPrototypeOf(q,Object.getPrototypeOf($)),kCustomPromisifiedSymbol)Object.defineProperty(q,kCustomPromisifiedSymbol,{value:q,enumerable:!1,writable:!1,configurable:!0});return Object.defineProperties(q,Object.getOwnPropertyDescriptors($))});({TextEncoder:AK,TextDecoder:XK}=globalThis),GW={TextEncoder:AK,TextDecoder:XK,promisify:jK,log:RK,inherits:IK,_extend:M7,callbackifyOnRejected:w7,callbackify:gK}});var H7={};c1(H7,{resolveObject:()=>SK,resolve:()=>uK,parse:()=>D6,format:()=>TK,default:()=>DW,Url:()=>Z2,URLSearchParams:()=>OK,URL:()=>D7});function L7($){return typeof $==="string"}function PK($){return typeof $==="object"&&$!==null}function M5($){return $===null}function WW($){return $==null}function Z2(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function D6($,q,Q){if($&&PK($)&&$ instanceof Z2)return $;var K=new Z2;return K.parse($,q,Q),K}function TK($){if(L7($))$=D6($);if(!($ instanceof Z2))return Z2.prototype.format.call($);return $.format()}function uK($,q){return D6($,!1,!0).resolve(q)}function SK($,q){if(!$)return q;return D6($,!1,!0).resolveObject(q)}var D7,OK,BW,zW,FW,MW,wW,N7,yK,hK,NW=255,xK,YW,kW,Y7,k6,k7,DW;var v7=b1(()=>{({URL:D7,URLSearchParams:OK}=globalThis);BW=/^([a-z0-9.+-]+:)/i,zW=/:[0-9]*$/,FW=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,MW=["<",">",'"',"`"," ","\r",` +`,"\t"],wW=["{","}","|","\\","^","`"].concat(MW),N7=["'"].concat(wW),yK=["%","/","?",";","#"].concat(N7),hK=["/","?","#"],xK=/^[+a-z0-9A-Z_-]{0,63}$/,YW=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,kW={javascript:!0,"javascript:":!0},Y7={javascript:!0,"javascript:":!0},k6={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},k7={parse($){var q=decodeURIComponent;return($+"").replace(/\+/g," ").split("&").filter(Boolean).reduce(function(Q,K,J){var Z=K.split("="),G=q(Z[0]||""),W=q(Z[1]||""),B=Q[G];return Q[G]=B===void 0?W:[].concat(B,W),Q},{})},stringify($){var q=encodeURIComponent;return Object.keys($||{}).reduce(function(Q,K){return[].concat($[K]).forEach(function(J){Q.push(q(K)+"="+q(J))}),Q},[]).join("&").replace(/\s/g,"+")}};Z2.prototype.parse=function($,q,Q){if(!L7($))throw TypeError("Parameter 'url' must be a string, not "+typeof $);var K=$.indexOf("?"),J=K!==-1&&K<$.indexOf("#")?"?":"#",Z=$.split(J),G=/\\/g;Z[0]=Z[0].replace(G,"/"),$=Z.join(J);var W=$;if(W=W.trim(),!Q&&$.split("#").length===1){var B=FW.exec(W);if(B){if(this.path=W,this.href=W,this.pathname=B[1],B[2])if(this.search=B[2],q)this.query=k7.parse(this.search.substr(1));else this.query=this.search.substr(1);else if(q)this.search="",this.query={};return this}}var V=BW.exec(W);if(V){V=V[0];var U=V.toLowerCase();this.protocol=U,W=W.substr(V.length)}if(Q||V||W.match(/^\/\/[^@\/]+@[^@\/]+/)){var w=W.substr(0,2)==="//";if(w&&!(V&&Y7[V]))W=W.substr(2),this.slashes=!0}if(!Y7[V]&&(w||V&&!k6[V])){var F=-1;for(var M=0;M127)v+="x";else v+=H[j];if(!v.match(xK)){var d=z.slice(0,M),_=z.slice(M+1),X=H.match(YW);if(X)d.push(X[1]),_.unshift(X[2]);if(_.length)W="/"+_.join(".")+W;this.hostname=d.join(".");break}}}}if(this.hostname.length>NW)this.hostname="";else this.hostname=this.hostname.toLowerCase();if(!D)this.hostname=new D7(`https://${this.hostname}`).hostname;var P=this.port?":"+this.port:"",g=this.hostname||"";if(this.host=g+P,this.href+=this.host,D){if(this.hostname=this.hostname.substr(1,this.hostname.length-2),W[0]!=="/")W="/"+W}}if(!kW[U])for(var M=0,N=N7.length;M0?Q.host.split("@"):!1;if(v)Q.auth=v.shift(),Q.host=Q.hostname=v.shift()}if(Q.search=$.search,Q.query=$.query,!M5(Q.pathname)||!M5(Q.search))Q.path=(Q.pathname?Q.pathname:"")+(Q.search?Q.search:"");return Q.href=Q.format(),Q}if(!z.length){if(Q.pathname=null,Q.search)Q.path="/"+Q.search;else Q.path=null;return Q.href=Q.format(),Q}var j=z.slice(-1)[0],n=(Q.host||$.host||z.length>1)&&(j==="."||j==="..")||j==="",d=0;for(var _=z.length;_>=0;_--)if(j=z[_],j===".")z.splice(_,1);else if(j==="..")z.splice(_,1),d++;else if(d)z.splice(_,1),d--;if(!L&&!D)for(;d--;d)z.unshift("..");if(L&&z[0]!==""&&(!z[0]||z[0].charAt(0)!=="/"))z.unshift("");if(n&&z.join("/").substr(-1)!=="/")z.push("");var X=z[0]===""||z[0]&&z[0].charAt(0)==="/";if(H){Q.hostname=Q.host=X?"":z.length?z.shift():"";var v=Q.host&&Q.host.indexOf("@")>0?Q.host.split("@"):!1;if(v)Q.auth=v.shift(),Q.host=Q.hostname=v.shift()}if(L=L||Q.host&&z.length,L&&!X)z.unshift("");if(!z.length)Q.pathname=null,Q.path=null;else Q.pathname=z.join("/");if(!M5(Q.pathname)||!M5(Q.search))Q.path=(Q.pathname?Q.pathname:"")+(Q.search?Q.search:"");return Q.auth=$.auth||Q.auth,Q.slashes=Q.slashes||$.slashes,Q.href=Q.format(),Q};Z2.prototype.parseHost=function(){var $=this.host,q=zW.exec($);if(q){if(q=q[0],q!==":")this.port=q.substr(1);$=$.substr(0,$.length-q.length)}if($)this.hostname=$};DW={parse:D6,resolve:uK,resolveObject:SK,format:TK,Url:Z2,URL:D7,URLSearchParams:OK}});var R7={};c1(R7,{request:()=>_W,globalAgent:()=>mW,get:()=>cW,default:()=>oW,STATUS_CODES:()=>pW,METHODS:()=>iW,IncomingMessage:()=>nW,ClientRequest:()=>bW,Agent:()=>dW});function RW($){return this[$]}var LW,HW,EK,vW,fW,IW,CW,jW=($,q,Q)=>{var K=$!=null&&typeof $==="object";if(K){var J=q?IW??=new WeakMap:CW??=new WeakMap,Z=J.get($);if(Z)return Z}Q=$!=null?LW(HW($)):{};let G=q||!$||!$.__esModule?EK(Q,"default",{value:$,enumerable:!0}):Q;for(let W of vW($))if(!fW.call(G,W))EK(G,W,{get:RW.bind($,W),enumerable:!0});if(K)J.set($,G);return G},h0=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports),cK,gW,x1,AW,bK,O1,nK,XW,dK,L6,yW,_K,f7,hW,xW,mK,pK,OW,PW,iK,oK,TW,uW,SW,EW,aK,_W,cW,bW,nW,dW,mW,pW,iW,oW;var I7=b1(()=>{LW=Object.create,{getPrototypeOf:HW,defineProperty:EK,getOwnPropertyNames:vW}=Object,fW=Object.prototype.hasOwnProperty;cK=h0(($)=>{$.fetch=J(globalThis.fetch)&&J(globalThis.ReadableStream),$.writableStream=J(globalThis.WritableStream),$.abortController=J(globalThis.AbortController);var q;function Q(){if(q!==void 0)return q;if(globalThis.XMLHttpRequest){q=new globalThis.XMLHttpRequest;try{q.open("GET",globalThis.XDomainRequest?"/":"https://example.com")}catch(Z){q=null}}else q=null;return q}function K(Z){var G=Q();if(!G)return!1;try{return G.responseType=Z,G.responseType===Z}catch(W){}return!1}$.arraybuffer=$.fetch||K("arraybuffer"),$.msstream=!$.fetch&&K("ms-stream"),$.mozchunkedarraybuffer=!$.fetch&&K("moz-chunked-arraybuffer"),$.overrideMimeType=$.fetch||(Q()?J(Q().overrideMimeType):!1);function J(Z){return typeof Z==="function"}q=null}),gW=h0(($,q)=>{if(typeof Object.create==="function")q.exports=function(Q,K){if(K)Q.super_=K,Q.prototype=Object.create(K.prototype,{constructor:{value:Q,enumerable:!1,writable:!0,configurable:!0}})};else q.exports=function(Q,K){if(K){Q.super_=K;var J=function(){};J.prototype=K.prototype,Q.prototype=new J,Q.prototype.constructor=Q}}}),x1=h0(($,q)=>{try{if(Q=(G8(),X0(Z8)),typeof Q.inherits!=="function")throw"";q.exports=Q.inherits}catch(K){q.exports=gW()}var Q}),AW=h0(($,q)=>{function Q(L,D){var z=Object.keys(L);if(Object.getOwnPropertySymbols){var N=Object.getOwnPropertySymbols(L);D&&(N=N.filter(function(H){return Object.getOwnPropertyDescriptor(L,H).enumerable})),z.push.apply(z,N)}return z}function K(L){for(var D=1;D0)this.tail.next=z;else this.head=z;this.tail=z,++this.length}},{key:"unshift",value:function(D){var z={data:D,next:this.head};if(this.length===0)this.tail=z;this.head=z,++this.length}},{key:"shift",value:function(){if(this.length===0)return;var D=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,D}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(D){if(this.length===0)return"";var z=this.head,N=""+z.data;while(z=z.next)N+=D+z.data;return N}},{key:"concat",value:function(D){if(this.length===0)return w.alloc(0);var z=w.allocUnsafe(D>>>0),N=this.head,H=0;while(N)f(N.data,z,H),H+=N.data.length,N=N.next;return z}},{key:"consume",value:function(D,z){var N;if(Dv.length?v.length:D;if(j===v.length)H+=v;else H+=v.slice(0,D);if(D-=j,D===0){if(j===v.length)if(++N,z.next)this.head=z.next;else this.head=this.tail=null;else this.head=z,z.data=v.slice(j);break}++N}return this.length-=N,H}},{key:"_getBuffer",value:function(D){var z=w.allocUnsafe(D),N=this.head,H=1;N.data.copy(z),D-=N.data.length;while(N=N.next){var v=N.data,j=D>v.length?v.length:D;if(v.copy(z,z.length-D,0,j),D-=j,D===0){if(j===v.length)if(++H,N.next)this.head=N.next;else this.head=this.tail=null;else this.head=N,N.data=v.slice(j);break}++H}return this.length-=H,z}},{key:k,value:function(D,z){return M(this,K(K({},z),{},{depth:0,customInspect:!1}))}}]),L}()}),bK=h0(($,q)=>{function Q(B,V){var U=this,w=this._readableState&&this._readableState.destroyed,F=this._writableState&&this._writableState.destroyed;if(w||F){if(V)V(B);else if(B){if(!this._writableState)process.nextTick(G,this,B);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,process.nextTick(G,this,B)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy(B||null,function(M){if(!V&&M)if(!U._writableState)process.nextTick(K,U,M);else if(!U._writableState.errorEmitted)U._writableState.errorEmitted=!0,process.nextTick(K,U,M);else process.nextTick(J,U);else if(V)process.nextTick(J,U),V(M);else process.nextTick(J,U)}),this}function K(B,V){G(B,V),J(B)}function J(B){if(B._writableState&&!B._writableState.emitClose)return;if(B._readableState&&!B._readableState.emitClose)return;B.emit("close")}function Z(){if(this._readableState)this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1;if(this._writableState)this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1}function G(B,V){B.emit("error",V)}function W(B,V){var{_readableState:U,_writableState:w}=B;if(U&&U.autoDestroy||w&&w.autoDestroy)B.destroy(V);else B.emit("error",V)}q.exports={destroy:Q,undestroy:Z,errorOrDestroy:W}}),O1=h0(($,q)=>{var Q={};function K(B,V,U){if(!U)U=Error;function w(M,k,f){if(typeof V==="string")return V;else return V(M,k,f)}class F extends U{constructor(M,k,f){super(w(M,k,f))}}F.prototype.name=U.name,F.prototype.code=B,Q[B]=F}function J(B,V){if(Array.isArray(B)){let U=B.length;if(B=B.map((w)=>String(w)),U>2)return`one of ${V} ${B.slice(0,U-1).join(", ")}, or `+B[U-1];else if(U===2)return`one of ${V} ${B[0]} or ${B[1]}`;else return`of ${V} ${B[0]}`}else return`of ${V} ${String(B)}`}function Z(B,V,U){return B.substr(!U||U<0?0:+U,V.length)===V}function G(B,V,U){if(U===void 0||U>B.length)U=B.length;return B.substring(U-V.length,U)===V}function W(B,V,U){if(typeof U!=="number")U=0;if(U+V.length>B.length)return!1;else return B.indexOf(V,U)!==-1}K("ERR_INVALID_OPT_VALUE",function(B,V){return'The value "'+V+'" is invalid for option "'+B+'"'},TypeError),K("ERR_INVALID_ARG_TYPE",function(B,V,U){let w;if(typeof V==="string"&&Z(V,"not "))w="must not be",V=V.replace(/^not /,"");else w="must be";let F;if(G(B," argument"))F=`The ${B} ${w} ${J(V,"type")}`;else{let M=W(B,".")?"property":"argument";F=`The "${B}" ${M} ${w} ${J(V,"type")}`}return F+=`. Received type ${typeof U}`,F},TypeError),K("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),K("ERR_METHOD_NOT_IMPLEMENTED",function(B){return"The "+B+" method is not implemented"}),K("ERR_STREAM_PREMATURE_CLOSE","Premature close"),K("ERR_STREAM_DESTROYED",function(B){return"Cannot call "+B+" after a stream was destroyed"}),K("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),K("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),K("ERR_STREAM_WRITE_AFTER_END","write after end"),K("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),K("ERR_UNKNOWN_ENCODING",function(B){return"Unknown encoding: "+B},TypeError),K("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),$.codes=Q}),nK=h0(($,q)=>{var Q=O1().codes.ERR_INVALID_OPT_VALUE;function K(Z,G,W){return Z.highWaterMark!=null?Z.highWaterMark:G?Z[W]:null}function J(Z,G,W,B){var V=K(G,B,W);if(V!=null){if(!(isFinite(V)&&Math.floor(V)===V)||V<0){var U=B?W:"highWaterMark";throw new Q(U,V)}return Math.floor(V)}return Z.objectMode?16:16384}q.exports={getHighWaterMark:J}}),XW=h0(($,q)=>{q.exports=(G8(),X0(Z8)).deprecate}),dK=h0(($,q)=>{q.exports=X;function Q(S){var b=this;this.next=null,this.entry=null,this.finish=function(){w0(b,S)}}var K;X.WritableState=d;var J={deprecate:XW()},Z=a1(),G=(t0(),X0(K2)).Buffer,W=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function B(S){return G.from(S)}function V(S){return G.isBuffer(S)||S instanceof W}var U=bK(),w=nK(),F=w.getHighWaterMark,M=O1().codes,k=M.ERR_INVALID_ARG_TYPE,f=M.ERR_METHOD_NOT_IMPLEMENTED,L=M.ERR_MULTIPLE_CALLBACK,D=M.ERR_STREAM_CANNOT_PIPE,z=M.ERR_STREAM_DESTROYED,N=M.ERR_STREAM_NULL_VALUES,H=M.ERR_STREAM_WRITE_AFTER_END,v=M.ERR_UNKNOWN_ENCODING,j=U.errorOrDestroy;x1()(X,Z);function n(){}function d(S,b,O){if(K=K||L6(),S=S||{},typeof O!=="boolean")O=b instanceof K;if(this.objectMode=!!S.objectMode,O)this.objectMode=this.objectMode||!!S.writableObjectMode;this.highWaterMark=F(this,S,"writableHighWaterMark",O),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var E=S.decodeStrings===!1;this.decodeStrings=!E,this.defaultEncoding=S.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(a){Z0(b,a)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=S.emitClose!==!1,this.autoDestroy=!!S.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new Q(this)}d.prototype.getBuffer=function(){var S=this.bufferedRequest,b=[];while(S)b.push(S),S=S.next;return b},function(){try{Object.defineProperty(d.prototype,"buffer",{get:J.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(S){}}();var _;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")_=Function.prototype[Symbol.hasInstance],Object.defineProperty(X,Symbol.hasInstance,{value:function(S){if(_.call(this,S))return!0;if(this!==X)return!1;return S&&S._writableState instanceof d}});else _=function(S){return S instanceof this};function X(S){K=K||L6();var b=this instanceof K;if(!b&&!_.call(X,this))return new X(S);if(this._writableState=new d(S,this,b),this.writable=!0,S){if(typeof S.write==="function")this._write=S.write;if(typeof S.writev==="function")this._writev=S.writev;if(typeof S.destroy==="function")this._destroy=S.destroy;if(typeof S.final==="function")this._final=S.final}Z.call(this)}X.prototype.pipe=function(){j(this,new D)};function P(S,b){var O=new H;j(S,O),process.nextTick(b,O)}function g(S,b,O,E){var a;if(O===null)a=new N;else if(typeof O!=="string"&&!b.objectMode)a=new k("chunk",["string","Buffer"],O);if(a)return j(S,a),process.nextTick(E,a),!1;return!0}X.prototype.write=function(S,b,O){var E=this._writableState,a=!1,K0=!E.objectMode&&V(S);if(K0&&!G.isBuffer(S))S=B(S);if(typeof b==="function")O=b,b=null;if(K0)b="buffer";else if(!b)b=E.defaultEncoding;if(typeof O!=="function")O=n;if(E.ending)P(this,O);else if(K0||g(this,E,S,O))E.pendingcb++,a=h(this,E,K0,S,b,O);return a},X.prototype.cork=function(){this._writableState.corked++},X.prototype.uncork=function(){var S=this._writableState;if(S.corked){if(S.corked--,!S.writing&&!S.corked&&!S.bufferProcessing&&S.bufferedRequest)W0(this,S)}},X.prototype.setDefaultEncoding=function(S){if(typeof S==="string")S=S.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((S+"").toLowerCase())>-1))throw new v(S);return this._writableState.defaultEncoding=S,this},Object.defineProperty(X.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function c(S,b,O){if(!S.objectMode&&S.decodeStrings!==!1&&typeof b==="string")b=G.from(b,O);return b}Object.defineProperty(X.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function h(S,b,O,E,a,K0){if(!O){var R=c(b,E,a);if(E!==R)O=!0,a="buffer",E=R}var Y=b.objectMode?1:E.length;b.length+=Y;var C=b.length{var Q=Object.keys||function(w){var F=[];for(var M in w)F.push(M);return F};q.exports=B;var K=mK(),J=dK();x1()(B,K);{Z=Q(J.prototype);for(W=0;W{/*! safe-buffer. MIT License. Feross Aboukhadijeh */var Q=(t0(),X0(K2)),K=Q.Buffer;function J(G,W){for(var B in G)W[B]=G[B]}if(K.from&&K.alloc&&K.allocUnsafe&&K.allocUnsafeSlow)q.exports=Q;else J(Q,$),$.Buffer=Z;function Z(G,W,B){return K(G,W,B)}Z.prototype=Object.create(K.prototype),J(K,Z),Z.from=function(G,W,B){if(typeof G==="number")throw TypeError("Argument must not be a number");return K(G,W,B)},Z.alloc=function(G,W,B){if(typeof G!=="number")throw TypeError("Argument must be a number");var V=K(G);if(W!==void 0)if(typeof B==="string")V.fill(W,B);else V.fill(W);else V.fill(0);return V},Z.allocUnsafe=function(G){if(typeof G!=="number")throw TypeError("Argument must be a number");return K(G)},Z.allocUnsafeSlow=function(G){if(typeof G!=="number")throw TypeError("Argument must be a number");return Q.SlowBuffer(G)}}),_K=h0(($)=>{var q=yW().Buffer,Q=q.isEncoding||function(z){switch(z=""+z,z&&z.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function K(z){if(!z)return"utf8";var N;while(!0)switch(z){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return z;default:if(N)return;z=(""+z).toLowerCase(),N=!0}}function J(z){var N=K(z);if(typeof N!=="string"&&(q.isEncoding===Q||!Q(z)))throw Error("Unknown encoding: "+z);return N||z}$.StringDecoder=Z;function Z(z){this.encoding=J(z);var N;switch(this.encoding){case"utf16le":this.text=F,this.end=M,N=4;break;case"utf8":this.fillLast=V,N=4;break;case"base64":this.text=k,this.end=f,N=3;break;default:this.write=L,this.end=D;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=q.allocUnsafe(N)}Z.prototype.write=function(z){if(z.length===0)return"";var N,H;if(this.lastNeed){if(N=this.fillLast(z),N===void 0)return"";H=this.lastNeed,this.lastNeed=0}else H=0;if(H>5===6)return 2;else if(z>>4===14)return 3;else if(z>>3===30)return 4;return z>>6===2?-1:-2}function W(z,N,H){var v=N.length-1;if(v=0){if(j>0)z.lastNeed=j-1;return j}if(--v=0){if(j>0)z.lastNeed=j-2;return j}if(--v=0){if(j>0)if(j===2)j=0;else z.lastNeed=j-3;return j}return 0}function B(z,N,H){if((N[0]&192)!==128)return z.lastNeed=0,"�";if(z.lastNeed>1&&N.length>1){if((N[1]&192)!==128)return z.lastNeed=1,"�";if(z.lastNeed>2&&N.length>2){if((N[2]&192)!==128)return z.lastNeed=2,"�"}}}function V(z){var N=this.lastTotal-this.lastNeed,H=B(this,z,N);if(H!==void 0)return H;if(this.lastNeed<=z.length)return z.copy(this.lastChar,N,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);z.copy(this.lastChar,N,0,z.length),this.lastNeed-=z.length}function U(z,N){var H=W(this,z,N);if(!this.lastNeed)return z.toString("utf8",N);this.lastTotal=H;var v=z.length-(H-this.lastNeed);return z.copy(this.lastChar,0,v),z.toString("utf8",N,v)}function w(z){var N=z&&z.length?this.write(z):"";if(this.lastNeed)return N+"�";return N}function F(z,N){if((z.length-N)%2===0){var H=z.toString("utf16le",N);if(H){var v=H.charCodeAt(H.length-1);if(v>=55296&&v<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=z[z.length-2],this.lastChar[1]=z[z.length-1],H.slice(0,-1)}return H}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=z[z.length-1],z.toString("utf16le",N,z.length-1)}function M(z){var N=z&&z.length?this.write(z):"";if(this.lastNeed){var H=this.lastTotal-this.lastNeed;return N+this.lastChar.toString("utf16le",0,H)}return N}function k(z,N){var H=(z.length-N)%3;if(H===0)return z.toString("base64",N);if(this.lastNeed=3-H,this.lastTotal=3,H===1)this.lastChar[0]=z[z.length-1];else this.lastChar[0]=z[z.length-2],this.lastChar[1]=z[z.length-1];return z.toString("base64",N,z.length-H)}function f(z){var N=z&&z.length?this.write(z):"";if(this.lastNeed)return N+this.lastChar.toString("base64",0,3-this.lastNeed);return N}function L(z){return z.toString(this.encoding)}function D(z){return z&&z.length?this.write(z):""}}),f7=h0(($,q)=>{var Q=O1().codes.ERR_STREAM_PREMATURE_CLOSE;function K(W){var B=!1;return function(){if(B)return;B=!0;for(var V=arguments.length,U=Array(V),w=0;w{var Q;function K(v,j,n){if(j=J(j),j in v)Object.defineProperty(v,j,{value:n,enumerable:!0,configurable:!0,writable:!0});else v[j]=n;return v}function J(v){var j=Z(v,"string");return typeof j==="symbol"?j:String(j)}function Z(v,j){if(typeof v!=="object"||v===null)return v;var n=v[Symbol.toPrimitive];if(n!==void 0){var d=n.call(v,j||"default");if(typeof d!=="object")return d;throw TypeError("@@toPrimitive must return a primitive value.")}return(j==="string"?String:Number)(v)}var G=f7(),W=Symbol("lastResolve"),B=Symbol("lastReject"),V=Symbol("error"),U=Symbol("ended"),w=Symbol("lastPromise"),F=Symbol("handlePromise"),M=Symbol("stream");function k(v,j){return{value:v,done:j}}function f(v){var j=v[W];if(j!==null){var n=v[M].read();if(n!==null)v[w]=null,v[W]=null,v[B]=null,j(k(n,!1))}}function L(v){process.nextTick(f,v)}function D(v,j){return function(n,d){v.then(function(){if(j[U]){n(k(void 0,!0));return}j[F](n,d)},d)}}var z=Object.getPrototypeOf(function(){}),N=Object.setPrototypeOf((Q={get stream(){return this[M]},next:function(){var v=this,j=this[V];if(j!==null)return Promise.reject(j);if(this[U])return Promise.resolve(k(void 0,!0));if(this[M].destroyed)return new Promise(function(X,P){process.nextTick(function(){if(v[V])P(v[V]);else X(k(void 0,!0))})});var n=this[w],d;if(n)d=new Promise(D(n,this));else{var _=this[M].read();if(_!==null)return Promise.resolve(k(_,!1));d=new Promise(this[F])}return this[w]=d,d}},K(Q,Symbol.asyncIterator,function(){return this}),K(Q,"return",function(){var v=this;return new Promise(function(j,n){v[M].destroy(null,function(d){if(d){n(d);return}j(k(void 0,!0))})})}),Q),z),H=function(v){var j,n=Object.create(N,(j={},K(j,M,{value:v,writable:!0}),K(j,W,{value:null,writable:!0}),K(j,B,{value:null,writable:!0}),K(j,V,{value:null,writable:!0}),K(j,U,{value:v._readableState.endEmitted,writable:!0}),K(j,F,{value:function(d,_){var X=n[M].read();if(X)n[w]=null,n[W]=null,n[B]=null,d(k(X,!1));else n[W]=d,n[B]=_},writable:!0}),j));return n[w]=null,G(v,function(d){if(d&&d.code!=="ERR_STREAM_PREMATURE_CLOSE"){var _=n[B];if(_!==null)n[w]=null,n[W]=null,n[B]=null,_(d);n[V]=d;return}var X=n[W];if(X!==null)n[w]=null,n[W]=null,n[B]=null,X(k(void 0,!0));n[U]=!0}),v.on("readable",L.bind(null,n)),n};q.exports=H}),xW=h0(($,q)=>{function Q(w,F,M,k,f,L,D){try{var z=w[L](D),N=z.value}catch(H){M(H);return}if(z.done)F(N);else Promise.resolve(N).then(k,f)}function K(w){return function(){var F=this,M=arguments;return new Promise(function(k,f){var L=w.apply(F,M);function D(N){Q(L,k,f,D,z,"next",N)}function z(N){Q(L,k,f,D,z,"throw",N)}D(void 0)})}}function J(w,F){var M=Object.keys(w);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(w);F&&(k=k.filter(function(f){return Object.getOwnPropertyDescriptor(w,f).enumerable})),M.push.apply(M,k)}return M}function Z(w){for(var F=1;F{q.exports=g;var Q;g.ReadableState=P;var K=(i1(),X0(p1)).EventEmitter,J=function(R,Y){return R.listeners(Y).length},Z=a1(),G=(t0(),X0(K2)).Buffer,W=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function B(R){return G.from(R)}function V(R){return G.isBuffer(R)||R instanceof W}var U=(G8(),X0(Z8)),w;if(U&&U.debuglog)w=U.debuglog("stream");else w=function(){};var F=AW(),M=bK(),k=nK(),f=k.getHighWaterMark,L=O1().codes,D=L.ERR_INVALID_ARG_TYPE,z=L.ERR_STREAM_PUSH_AFTER_EOF,N=L.ERR_METHOD_NOT_IMPLEMENTED,H=L.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,v,j,n;x1()(g,Z);var d=M.errorOrDestroy,_=["error","close","destroy","pause","resume"];function X(R,Y,C){if(typeof R.prependListener==="function")return R.prependListener(Y,C);if(!R._events||!R._events[Y])R.on(Y,C);else if(Array.isArray(R._events[Y]))R._events[Y].unshift(C);else R._events[Y]=[C,R._events[Y]]}function P(R,Y,C){if(Q=Q||L6(),R=R||{},typeof C!=="boolean")C=Y instanceof Q;if(this.objectMode=!!R.objectMode,C)this.objectMode=this.objectMode||!!R.readableObjectMode;if(this.highWaterMark=f(this,R,"readableHighWaterMark",C),this.buffer=new F,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=R.emitClose!==!1,this.autoDestroy=!!R.autoDestroy,this.destroyed=!1,this.defaultEncoding=R.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,R.encoding){if(!v)v=_K().StringDecoder;this.decoder=new v(R.encoding),this.encoding=R.encoding}}function g(R){if(Q=Q||L6(),!(this instanceof g))return new g(R);var Y=this instanceof Q;if(this._readableState=new P(R,this,Y),this.readable=!0,R){if(typeof R.read==="function")this._read=R.read;if(typeof R.destroy==="function")this._destroy=R.destroy}Z.call(this)}Object.defineProperty(g.prototype,"destroyed",{enumerable:!1,get:function(){if(this._readableState===void 0)return!1;return this._readableState.destroyed},set:function(R){if(!this._readableState)return;this._readableState.destroyed=R}}),g.prototype.destroy=M.destroy,g.prototype._undestroy=M.undestroy,g.prototype._destroy=function(R,Y){Y(R)},g.prototype.push=function(R,Y){var C=this._readableState,u;if(!C.objectMode){if(typeof R==="string"){if(Y=Y||C.defaultEncoding,Y!==C.encoding)R=G.from(R,Y),Y="";u=!0}}else u=!0;return c(this,R,Y,!1,u)},g.prototype.unshift=function(R){return c(this,R,null,!0,!1)};function c(R,Y,C,u,e){w("readableAddChunk",Y);var r=R._readableState;if(Y===null)r.reading=!1,F0(R,r);else{var s;if(!e)s=x(r,Y);if(s)d(R,s);else if(r.objectMode||Y&&Y.length>0){if(typeof Y!=="string"&&!r.objectMode&&Object.getPrototypeOf(Y)!==G.prototype)Y=B(Y);if(u)if(r.endEmitted)d(R,new H);else h(R,r,Y,!0);else if(r.ended)d(R,new z);else if(r.destroyed)return!1;else if(r.reading=!1,r.decoder&&!C)if(Y=r.decoder.write(Y),r.objectMode||Y.length!==0)h(R,r,Y,!1);else y(R,r);else h(R,r,Y,!1)}else if(!u)r.reading=!1,y(R,r)}return!r.ended&&(r.length=l)R=l;else R--,R|=R>>>1,R|=R>>>2,R|=R>>>4,R|=R>>>8,R|=R>>>16,R++;return R}function Z0(R,Y){if(R<=0||Y.length===0&&Y.ended)return 0;if(Y.objectMode)return 1;if(R!==R)if(Y.flowing&&Y.length)return Y.buffer.head.data.length;else return Y.length;if(R>Y.highWaterMark)Y.highWaterMark=$0(R);if(R<=Y.length)return R;if(!Y.ended)return Y.needReadable=!0,0;return Y.length}g.prototype.read=function(R){w("read",R),R=parseInt(R,10);var Y=this._readableState,C=R;if(R!==0)Y.emittedReadable=!1;if(R===0&&Y.needReadable&&((Y.highWaterMark!==0?Y.length>=Y.highWaterMark:Y.length>0)||Y.ended)){if(w("read: emitReadable",Y.length,Y.ended),Y.length===0&&Y.ended)E(this);else p(this);return null}if(R=Z0(R,Y),R===0&&Y.ended){if(Y.length===0)E(this);return null}var u=Y.needReadable;if(w("need readable",u),Y.length===0||Y.length-R0)e=O(R,Y);else e=null;if(e===null)Y.needReadable=Y.length<=Y.highWaterMark,R=0;else Y.length-=R,Y.awaitDrain=0;if(Y.length===0){if(!Y.ended)Y.needReadable=!0;if(C!==R&&Y.ended)E(this)}if(e!==null)this.emit("data",e);return e};function F0(R,Y){if(w("onEofChunk"),Y.ended)return;if(Y.decoder){var C=Y.decoder.end();if(C&&C.length)Y.buffer.push(C),Y.length+=Y.objectMode?1:C.length}if(Y.ended=!0,Y.sync)p(R);else if(Y.needReadable=!1,!Y.emittedReadable)Y.emittedReadable=!0,W0(R)}function p(R){var Y=R._readableState;if(w("emitReadable",Y.needReadable,Y.emittedReadable),Y.needReadable=!1,!Y.emittedReadable)w("emitReadable",Y.flowing),Y.emittedReadable=!0,process.nextTick(W0,R)}function W0(R){var Y=R._readableState;if(w("emitReadable_",Y.destroyed,Y.length,Y.ended),!Y.destroyed&&(Y.length||Y.ended))R.emit("readable"),Y.emittedReadable=!1;Y.needReadable=!Y.flowing&&!Y.ended&&Y.length<=Y.highWaterMark,b(R)}function y(R,Y){if(!Y.readingMore)Y.readingMore=!0,process.nextTick(i,R,Y)}function i(R,Y){while(!Y.reading&&!Y.ended&&(Y.length1&&K0(u.pipes,R)!==-1)&&!G0)w("false write response, pause",u.awaitDrain),u.awaitDrain++;C.pause()}}function I0(O0){if(w("onerror",O0),q2(),R.removeListener("error",I0),J(R,"error")===0)d(R,O0)}X(R,"error",I0);function m0(){R.removeListener("finish",p0),q2()}R.once("close",m0);function p0(){w("onfinish"),R.removeListener("close",m0),q2()}R.once("finish",p0);function q2(){w("unpipe"),C.unpipe(R)}if(R.emit("pipe",C),!u.flowing)w("pipe resume"),C.resume();return R};function U0(R){return function(){var Y=R._readableState;if(w("pipeOnDrain",Y.awaitDrain),Y.awaitDrain)Y.awaitDrain--;if(Y.awaitDrain===0&&J(R,"data"))Y.flowing=!0,b(R)}}g.prototype.unpipe=function(R){var Y=this._readableState,C={hasUnpiped:!1};if(Y.pipesCount===0)return this;if(Y.pipesCount===1){if(R&&R!==Y.pipes)return this;if(!R)R=Y.pipes;if(Y.pipes=null,Y.pipesCount=0,Y.flowing=!1,R)R.emit("unpipe",this,C);return this}if(!R){var{pipes:u,pipesCount:e}=Y;Y.pipes=null,Y.pipesCount=0,Y.flowing=!1;for(var r=0;r0,u.flowing!==!1)this.resume()}else if(R==="readable"){if(!u.endEmitted&&!u.readableListening){if(u.readableListening=u.needReadable=!0,u.flowing=!1,u.emittedReadable=!1,w("on readable",u.length,u.reading),u.length)p(this);else if(!u.reading)process.nextTick(V0,this)}}return C},g.prototype.addListener=g.prototype.on,g.prototype.removeListener=function(R,Y){var C=Z.prototype.removeListener.call(this,R,Y);if(R==="readable")process.nextTick(m,this);return C},g.prototype.removeAllListeners=function(R){var Y=Z.prototype.removeAllListeners.apply(this,arguments);if(R==="readable"||R===void 0)process.nextTick(m,this);return Y};function m(R){var Y=R._readableState;if(Y.readableListening=R.listenerCount("readable")>0,Y.resumeScheduled&&!Y.paused)Y.flowing=!0;else if(R.listenerCount("data")>0)R.resume()}function V0(R){w("readable nexttick read 0"),R.read(0)}g.prototype.resume=function(){var R=this._readableState;if(!R.flowing)w("resume"),R.flowing=!R.readableListening,w0(this,R);return R.paused=!1,this};function w0(R,Y){if(!Y.resumeScheduled)Y.resumeScheduled=!0,process.nextTick(S,R,Y)}function S(R,Y){if(w("resume",Y.reading),!Y.reading)R.read(0);if(Y.resumeScheduled=!1,R.emit("resume"),b(R),Y.flowing&&!Y.reading)R.read(0)}g.prototype.pause=function(){if(w("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)w("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState.paused=!0,this};function b(R){var Y=R._readableState;w("flow",Y.flowing);while(Y.flowing&&R.read()!==null);}if(g.prototype.wrap=function(R){var Y=this,C=this._readableState,u=!1;R.on("end",function(){if(w("wrapped end"),C.decoder&&!C.ended){var s=C.decoder.end();if(s&&s.length)Y.push(s)}Y.push(null)}),R.on("data",function(s){if(w("wrapped data"),C.decoder)s=C.decoder.write(s);if(C.objectMode&&(s===null||s===void 0))return;else if(!C.objectMode&&(!s||!s.length))return;var T=Y.push(s);if(!T)u=!0,R.pause()});for(var e in R)if(this[e]===void 0&&typeof R[e]==="function")this[e]=function(s){return function(){return R[s].apply(R,arguments)}}(e);for(var r=0;r<_.length;r++)R.on(_[r],this.emit.bind(this,_[r]));return this._read=function(s){if(w("wrapped _read",s),u)u=!1,R.resume()},this},typeof Symbol==="function")g.prototype[Symbol.asyncIterator]=function(){if(j===void 0)j=hW();return j(this)};Object.defineProperty(g.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(g.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(g.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(R){if(this._readableState)this._readableState.flowing=R}}),g._fromList=O,Object.defineProperty(g.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function O(R,Y){if(Y.length===0)return null;var C;if(Y.objectMode)C=Y.buffer.shift();else if(!R||R>=Y.length){if(Y.decoder)C=Y.buffer.join("");else if(Y.buffer.length===1)C=Y.buffer.first();else C=Y.buffer.concat(Y.length);Y.buffer.clear()}else C=Y.buffer.consume(R,Y.decoder);return C}function E(R){var Y=R._readableState;if(w("endReadable",Y.endEmitted),!Y.endEmitted)Y.ended=!0,process.nextTick(a,Y,R)}function a(R,Y){if(w("endReadableNT",R.endEmitted,R.length),!R.endEmitted&&R.length===0){if(R.endEmitted=!0,Y.readable=!1,Y.emit("end"),R.autoDestroy){var C=Y._writableState;if(!C||C.autoDestroy&&C.finished)Y.destroy()}}}if(typeof Symbol==="function")g.from=function(R,Y){if(n===void 0)n=xW();return n(g,R,Y)};function K0(R,Y){for(var C=0,u=R.length;C{q.exports=V;var Q=O1().codes,K=Q.ERR_METHOD_NOT_IMPLEMENTED,J=Q.ERR_MULTIPLE_CALLBACK,Z=Q.ERR_TRANSFORM_ALREADY_TRANSFORMING,G=Q.ERR_TRANSFORM_WITH_LENGTH_0,W=L6();x1()(V,W);function B(F,M){var k=this._transformState;k.transforming=!1;var f=k.writecb;if(f===null)return this.emit("error",new J);if(k.writechunk=null,k.writecb=null,M!=null)this.push(M);f(F);var L=this._readableState;if(L.reading=!1,L.needReadable||L.length{q.exports=K;var Q=pK();x1()(K,Q);function K(J){if(!(this instanceof K))return new K(J);Q.call(this,J)}K.prototype._transform=function(J,Z,G){G(null,J)}}),PW=h0(($,q)=>{var Q;function K(k){var f=!1;return function(){if(f)return;f=!0,k.apply(void 0,arguments)}}var J=O1().codes,Z=J.ERR_MISSING_ARGS,G=J.ERR_STREAM_DESTROYED;function W(k){if(k)throw k}function B(k){return k.setHeader&&typeof k.abort==="function"}function V(k,f,L,D){D=K(D);var z=!1;if(k.on("close",function(){z=!0}),Q===void 0)Q=f7();Q(k,{readable:f,writable:L},function(H){if(H)return D(H);z=!0,D()});var N=!1;return function(H){if(z)return;if(N)return;if(N=!0,B(k))return k.abort();if(typeof k.destroy==="function")return k.destroy();D(H||new G("pipe"))}}function U(k){k()}function w(k,f){return k.pipe(f)}function F(k){if(!k.length)return W;if(typeof k[k.length-1]!=="function")return W;return k.pop()}function M(){for(var k=arguments.length,f=Array(k),L=0;L0;return V(H,j,n,function(d){if(!z)z=d;if(d)N.forEach(U);if(j)return;N.forEach(U),D(z)})});return f.reduce(w)}q.exports=M}),iK=h0(($,q)=>{var Q=a1();$=q.exports=mK(),$.Stream=Q||$,$.Readable=$,$.Writable=dK(),$.Duplex=L6(),$.Transform=pK(),$.PassThrough=OW(),$.finished=f7(),$.pipeline=PW()}),oK=h0(($)=>{var q=cK(),Q=x1(),K=iK(),J=$.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},Z=$.IncomingMessage=function(G,W,B,V){var U=this;if(K.Readable.call(U),U._mode=B,U.headers={},U.rawHeaders=[],U.trailers={},U.rawTrailers=[],U.on("end",function(){process.nextTick(function(){U.emit("close")})}),B==="fetch"){let D=function(){M.read().then(function(z){if(U._destroyed)return;if(V(z.done),z.done){U.push(null);return}U.push(Buffer.from(z.value)),D()}).catch(function(z){if(V(!0),!U._destroyed)U.emit("error",z)})};var w=D;if(U._fetchResponse=W,U.url=W.url,U.statusCode=W.status,U.statusMessage=W.statusText,W.headers.forEach(function(z,N){U.headers[N.toLowerCase()]=z,U.rawHeaders.push(N,z)}),q.writableStream){var F=new WritableStream({write:function(z){return V(!1),new Promise(function(N,H){if(U._destroyed)H();else if(U.push(Buffer.from(z)))N();else U._resumeFetch=N})},close:function(){if(V(!0),!U._destroyed)U.push(null)},abort:function(z){if(V(!0),!U._destroyed)U.emit("error",z)}});try{W.body.pipeTo(F).catch(function(z){if(V(!0),!U._destroyed)U.emit("error",z)});return}catch(z){}}var M=W.body.getReader();D()}else{U._xhr=G,U._pos=0,U.url=G.responseURL,U.statusCode=G.status,U.statusMessage=G.statusText;var k=G.getAllResponseHeaders().split(/\r?\n/);if(k.forEach(function(D){var z=D.match(/^([^:]+):\s*(.*)/);if(z){var N=z[1].toLowerCase();if(N==="set-cookie"){if(U.headers[N]===void 0)U.headers[N]=[];U.headers[N].push(z[2])}else if(U.headers[N]!==void 0)U.headers[N]+=", "+z[2];else U.headers[N]=z[2];U.rawHeaders.push(z[1],z[2])}}),U._charset="x-user-defined",!q.overrideMimeType){var f=U.rawHeaders["mime-type"];if(f){var L=f.match(/;\s*charset=([^;])(;|$)/);if(L)U._charset=L[1].toLowerCase()}if(!U._charset)U._charset="utf-8"}}};Q(Z,K.Readable),Z.prototype._read=function(){var G=this,W=G._resumeFetch;if(W)G._resumeFetch=null,W()},Z.prototype._onXHRProgress=function(G){var W=this,B=W._xhr,V=null;switch(W._mode){case"text":if(V=B.responseText,V.length>W._pos){var U=V.substr(W._pos);if(W._charset==="x-user-defined"){var w=Buffer.alloc(U.length);for(var F=0;FW._pos)W.push(Buffer.from(new Uint8Array(M.result.slice(W._pos)))),W._pos=M.result.byteLength},M.onload=function(){G(!0),W.push(null)},M.readAsArrayBuffer(V);break}if(W._xhr.readyState===J.DONE&&W._mode!=="ms-stream")G(!0),W.push(null)}}),TW=h0(($,q)=>{var Q=cK(),K=x1(),J=oK(),Z=iK(),G=J.IncomingMessage,W=J.readyStates;function B(F,M){if(Q.fetch&&M)return"fetch";else if(Q.mozchunkedarraybuffer)return"moz-chunked-arraybuffer";else if(Q.msstream)return"ms-stream";else if(Q.arraybuffer&&F)return"arraybuffer";else return"text"}var V=q.exports=function(F){var M=this;if(Z.Writable.call(M),M._opts=F,M._body=[],M._headers={},F.auth)M.setHeader("Authorization","Basic "+Buffer.from(F.auth).toString("base64"));Object.keys(F.headers).forEach(function(L){M.setHeader(L,F.headers[L])});var k,f=!0;if(F.mode==="disable-fetch"||"requestTimeout"in F&&!Q.abortController)f=!1,k=!0;else if(F.mode==="prefer-streaming")k=!1;else if(F.mode==="allow-wrong-content-type")k=!Q.overrideMimeType;else if(!F.mode||F.mode==="default"||F.mode==="prefer-fast")k=!0;else throw Error("Invalid value for opts.mode");M._mode=B(k,f),M._fetchTimer=null,M._socketTimeout=null,M._socketTimer=null,M.on("finish",function(){M._onFinish()})};K(V,Z.Writable),V.prototype.setHeader=function(F,M){var k=this,f=F.toLowerCase();if(w.indexOf(f)!==-1)return;k._headers[f]={name:F,value:M}},V.prototype.getHeader=function(F){var M=this._headers[F.toLowerCase()];if(M)return M.value;return null},V.prototype.removeHeader=function(F){var M=this;delete M._headers[F.toLowerCase()]},V.prototype._onFinish=function(){var F=this;if(F._destroyed)return;var M=F._opts;if("timeout"in M&&M.timeout!==0)F.setTimeout(M.timeout);var k=F._headers,f=null;if(M.method!=="GET"&&M.method!=="HEAD")f=new Blob(F._body,{type:(k["content-type"]||{}).value||""});var L=[];if(Object.keys(k).forEach(function(H){var v=k[H].name,j=k[H].value;if(Array.isArray(j))j.forEach(function(n){L.push([v,n])});else L.push([v,j])}),F._mode==="fetch"){var D=null;if(Q.abortController){var z=new AbortController;if(D=z.signal,F._fetchAbortController=z,"requestTimeout"in M&&M.requestTimeout!==0)F._fetchTimer=globalThis.setTimeout(function(){if(F.emit("requestTimeout"),F._fetchAbortController)F._fetchAbortController.abort()},M.requestTimeout)}globalThis.fetch(F._opts.url,{method:F._opts.method,headers:L,body:f||void 0,mode:"cors",credentials:M.withCredentials?"include":"same-origin",signal:D}).then(function(H){F._fetchResponse=H,F._resetTimers(!1),F._connect()},function(H){if(F._resetTimers(!0),!F._destroyed)F.emit("error",H)})}else{var N=F._xhr=new globalThis.XMLHttpRequest;try{N.open(F._opts.method,F._opts.url,!0)}catch(H){process.nextTick(function(){F.emit("error",H)});return}if("responseType"in N)N.responseType=F._mode;if("withCredentials"in N)N.withCredentials=!!M.withCredentials;if(F._mode==="text"&&"overrideMimeType"in N)N.overrideMimeType("text/plain; charset=x-user-defined");if("requestTimeout"in M)N.timeout=M.requestTimeout,N.ontimeout=function(){F.emit("requestTimeout")};if(L.forEach(function(H){N.setRequestHeader(H[0],H[1])}),F._response=null,N.onreadystatechange=function(){switch(N.readyState){case W.LOADING:case W.DONE:F._onXHRProgress();break}},F._mode==="moz-chunked-arraybuffer")N.onprogress=function(){F._onXHRProgress()};N.onerror=function(){if(F._destroyed)return;F._resetTimers(!0),F.emit("error",Error("XHR error"))};try{N.send(f)}catch(H){process.nextTick(function(){F.emit("error",H)});return}}};function U(F){try{var M=F.status;return M!==null&&M!==0}catch(k){return!1}}V.prototype._onXHRProgress=function(){var F=this;if(F._resetTimers(!1),!U(F._xhr)||F._destroyed)return;if(!F._response)F._connect();F._response._onXHRProgress(F._resetTimers.bind(F))},V.prototype._connect=function(){var F=this;if(F._destroyed)return;F._response=new G(F._xhr,F._fetchResponse,F._mode,F._resetTimers.bind(F)),F._response.on("error",function(M){F.emit("error",M)}),F.emit("response",F._response)},V.prototype._write=function(F,M,k){var f=this;f._body.push(F),k()},V.prototype._resetTimers=function(F){var M=this;if(globalThis.clearTimeout(M._socketTimer),M._socketTimer=null,F)globalThis.clearTimeout(M._fetchTimer),M._fetchTimer=null;else if(M._socketTimeout)M._socketTimer=globalThis.setTimeout(function(){M.emit("timeout")},M._socketTimeout)},V.prototype.abort=V.prototype.destroy=function(F){var M=this;if(M._destroyed=!0,M._resetTimers(!0),M._response)M._response._destroyed=!0;if(M._xhr)M._xhr.abort();else if(M._fetchAbortController)M._fetchAbortController.abort();if(F)M.emit("error",F)},V.prototype.end=function(F,M,k){var f=this;if(typeof F==="function")k=F,F=void 0;Z.Writable.prototype.end.call(f,F,M,k)},V.prototype.setTimeout=function(F,M){var k=this;if(M)k.once("timeout",M);k._socketTimeout=F,k._resetTimers(!1)},V.prototype.flushHeaders=function(){},V.prototype.setNoDelay=function(){},V.prototype.setSocketKeepAlive=function(){};var w=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}),uW=h0(($,q)=>{q.exports=K;var Q=Object.prototype.hasOwnProperty;function K(){var J={};for(var Z=0;Z{q.exports=(I7(),X0(R7)).STATUS_CODES}),EW=h0(($)=>{var q=TW(),Q=oK(),K=uW(),J=SW(),Z=(v7(),X0(H7)),G=$;G.request=function(W,B){if(typeof W==="string")W=Z.parse(W);else W=K(W);var V=globalThis.location.protocol.search(/^https?:$/)===-1?"http:":"",U=W.protocol||V,w=W.hostname||W.host,F=W.port,M=W.path||"/";if(w&&w.indexOf(":")!==-1)w="["+w+"]";W.url=(w?U+"//"+w:"")+(F?":"+F:"")+M,W.method=(W.method||"GET").toUpperCase(),W.headers=W.headers||{};var k=new q(W);if(B)k.on("response",B);return k},G.get=function(W,B){var V=G.request(W,B);return V.end(),V},G.ClientRequest=q,G.IncomingMessage=Q.IncomingMessage,G.Agent=function(){},G.Agent.defaultMaxSockets=4,G.globalAgent=new G.Agent,G.STATUS_CODES=J,G.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}),aK=jW(EW(),1),{request:_W,get:cW,ClientRequest:bW,IncomingMessage:nW,Agent:dW,globalAgent:mW,STATUS_CODES:pW,METHODS:iW}=aK.default,oW=aK.default});var sK={};c1(sK,{validateHeaderValue:()=>LB,validateHeaderName:()=>DB,setMaxIdleHTTPParsers:()=>kB,request:()=>YB,maxHeaderSize:()=>NB,globalAgent:()=>wB,get:()=>MB,default:()=>HB,createServer:()=>FB,ServerResponse:()=>zB,Server:()=>BB,STATUS_CODES:()=>WB,OutgoingMessage:()=>GB,METHODS:()=>ZB,IncomingMessage:()=>UB,ClientRequest:()=>VB,Agent:()=>JB});function tW($){return this[$]}var aW,lW,lK,rW,sW,eW,$B,QB=($,q,Q)=>{var K=$!=null&&typeof $==="object";if(K){var J=q?eW??=new WeakMap:$B??=new WeakMap,Z=J.get($);if(Z)return Z}Q=$!=null?aW(lW($)):{};let G=q||!$||!$.__esModule?lK(Q,"default",{value:$,enumerable:!0}):Q;for(let W of rW($))if(!sW.call(G,W))lK(G,W,{get:tW.bind($,W),enumerable:!0});if(K)J.set($,G);return G},qB=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports),KB,rK,JB,VB,UB,ZB,GB,WB,BB,zB,FB,MB,wB,NB,YB,kB,DB,LB,HB;var tK=b1(()=>{aW=Object.create,{getPrototypeOf:lW,defineProperty:lK,getOwnPropertyNames:rW}=Object,sW=Object.prototype.hasOwnProperty;KB=qB(($,q)=>{var Q=(I7(),X0(R7)),K=(v7(),X0(H7)),J=$;for(Z in Q)if(Q.hasOwnProperty(Z))J[Z]=Q[Z];var Z;J.request=function(W,B){return W=G(W),Q.request.call(this,W,B)},J.get=function(W,B){return W=G(W),Q.get.call(this,W,B)};function G(W){if(typeof W==="string")W=K.parse(W);if(!W.protocol)W.protocol="https:";if(W.protocol!=="https:")throw Error('Protocol "'+W.protocol+'" not supported. Expected "https:"');return W}}),rK=QB(KB(),1),{Agent:JB,ClientRequest:VB,IncomingMessage:UB,METHODS:ZB,OutgoingMessage:GB,STATUS_CODES:WB,Server:BB,ServerResponse:zB,createServer:FB,get:MB,globalAgent:wB,maxHeaderSize:NB,request:YB,setMaxIdleHTTPParsers:kB,validateHeaderName:DB,validateHeaderValue:LB}=rK,HB=rK});var V9=globalThis;if(typeof V9.global>"u")V9.global=globalThis;t0();var Fz=K9(h9(),1);var _7=K9(HK(),1);function W2($,q,Q,K){function J(Z){return Z instanceof Q?Z:new Q(function(G){G(Z)})}return new(Q||(Q=Promise))(function(Z,G){function W(U){try{V(K.next(U))}catch(w){G(w)}}function B(U){try{V(K.throw(U))}catch(w){G(w)}}function V(U){U.done?Z(U.value):J(U.value).then(W,B)}V((K=K.apply($,q||[])).next())})}var L0=914400,w8=12700,n0=`\r +`,vB=2147483649,C7=/^[0-9a-fA-F]{6}$/,fB=1.67,RB=27,H6={type:"solid",color:"666666",pt:1},JJ=[0.05,0.1,0.05,0.1],v6={color:"363636",pt:1},u1={color:"888888",style:"solid",size:1,cap:"flat"},Q2="000000",k2=12,IB=18,f6="LAYOUT_16x9",h7="DEFAULT",VJ="333333",P1={type:"outer",blur:3,offset:1.811023622047244,angle:90,color:"000000",opacity:0.35,rotateWithShape:!0},M8=[0.5,0.5,0.5,0.5],eK={color:"000000"},CB={size:8,color:"FFFFFF",opacity:0.75},o2="2094734552",N5="2094734553",B8="2094734554",x7="2094734555",UJ="2094734556",W8="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),z8=["C0504D","4F81BD","9BBB59","8064A2","4BACC6","F79646","628FC6","C86360","C0504D","4F81BD","9BBB59","8064A2","4BACC6","F79646","628FC6","C86360"],jB=["5DA5DA","FAA43A","60BD68","F17CB0","B2912F","B276B2","DECF3F","F15854","A7A7A7","5DA5DA","FAA43A","60BD68","F17CB0","B2912F","B276B2","DECF3F","F15854","A7A7A7"],R6;(function($){$.left="left",$.center="center",$.right="right",$.justify="justify"})(R6||(R6={}));var I6;(function($){$.b="b",$.ctr="ctr",$.t="t"})(I6||(I6={}));var ZJ="{F7021451-1387-4CA6-816F-3879F97B5CBC}",O7;(function($){$.arraybuffer="arraybuffer",$.base64="base64",$.binarystring="binarystring",$.blob="blob",$.nodebuffer="nodebuffer",$.uint8array="uint8array"})(O7||(O7={}));var P7;(function($){$.area="area",$.bar="bar",$.bar3d="bar3D",$.bubble="bubble",$.bubble3d="bubble3D",$.doughnut="doughnut",$.line="line",$.pie="pie",$.radar="radar",$.scatter="scatter"})(P7||(P7={}));var T7;(function($){$.accentBorderCallout1="accentBorderCallout1",$.accentBorderCallout2="accentBorderCallout2",$.accentBorderCallout3="accentBorderCallout3",$.accentCallout1="accentCallout1",$.accentCallout2="accentCallout2",$.accentCallout3="accentCallout3",$.actionButtonBackPrevious="actionButtonBackPrevious",$.actionButtonBeginning="actionButtonBeginning",$.actionButtonBlank="actionButtonBlank",$.actionButtonDocument="actionButtonDocument",$.actionButtonEnd="actionButtonEnd",$.actionButtonForwardNext="actionButtonForwardNext",$.actionButtonHelp="actionButtonHelp",$.actionButtonHome="actionButtonHome",$.actionButtonInformation="actionButtonInformation",$.actionButtonMovie="actionButtonMovie",$.actionButtonReturn="actionButtonReturn",$.actionButtonSound="actionButtonSound",$.arc="arc",$.bentArrow="bentArrow",$.bentUpArrow="bentUpArrow",$.bevel="bevel",$.blockArc="blockArc",$.borderCallout1="borderCallout1",$.borderCallout2="borderCallout2",$.borderCallout3="borderCallout3",$.bracePair="bracePair",$.bracketPair="bracketPair",$.callout1="callout1",$.callout2="callout2",$.callout3="callout3",$.can="can",$.chartPlus="chartPlus",$.chartStar="chartStar",$.chartX="chartX",$.chevron="chevron",$.chord="chord",$.circularArrow="circularArrow",$.cloud="cloud",$.cloudCallout="cloudCallout",$.corner="corner",$.cornerTabs="cornerTabs",$.cube="cube",$.curvedDownArrow="curvedDownArrow",$.curvedLeftArrow="curvedLeftArrow",$.curvedRightArrow="curvedRightArrow",$.curvedUpArrow="curvedUpArrow",$.custGeom="custGeom",$.decagon="decagon",$.diagStripe="diagStripe",$.diamond="diamond",$.dodecagon="dodecagon",$.donut="donut",$.doubleWave="doubleWave",$.downArrow="downArrow",$.downArrowCallout="downArrowCallout",$.ellipse="ellipse",$.ellipseRibbon="ellipseRibbon",$.ellipseRibbon2="ellipseRibbon2",$.flowChartAlternateProcess="flowChartAlternateProcess",$.flowChartCollate="flowChartCollate",$.flowChartConnector="flowChartConnector",$.flowChartDecision="flowChartDecision",$.flowChartDelay="flowChartDelay",$.flowChartDisplay="flowChartDisplay",$.flowChartDocument="flowChartDocument",$.flowChartExtract="flowChartExtract",$.flowChartInputOutput="flowChartInputOutput",$.flowChartInternalStorage="flowChartInternalStorage",$.flowChartMagneticDisk="flowChartMagneticDisk",$.flowChartMagneticDrum="flowChartMagneticDrum",$.flowChartMagneticTape="flowChartMagneticTape",$.flowChartManualInput="flowChartManualInput",$.flowChartManualOperation="flowChartManualOperation",$.flowChartMerge="flowChartMerge",$.flowChartMultidocument="flowChartMultidocument",$.flowChartOfflineStorage="flowChartOfflineStorage",$.flowChartOffpageConnector="flowChartOffpageConnector",$.flowChartOnlineStorage="flowChartOnlineStorage",$.flowChartOr="flowChartOr",$.flowChartPredefinedProcess="flowChartPredefinedProcess",$.flowChartPreparation="flowChartPreparation",$.flowChartProcess="flowChartProcess",$.flowChartPunchedCard="flowChartPunchedCard",$.flowChartPunchedTape="flowChartPunchedTape",$.flowChartSort="flowChartSort",$.flowChartSummingJunction="flowChartSummingJunction",$.flowChartTerminator="flowChartTerminator",$.folderCorner="folderCorner",$.frame="frame",$.funnel="funnel",$.gear6="gear6",$.gear9="gear9",$.halfFrame="halfFrame",$.heart="heart",$.heptagon="heptagon",$.hexagon="hexagon",$.homePlate="homePlate",$.horizontalScroll="horizontalScroll",$.irregularSeal1="irregularSeal1",$.irregularSeal2="irregularSeal2",$.leftArrow="leftArrow",$.leftArrowCallout="leftArrowCallout",$.leftBrace="leftBrace",$.leftBracket="leftBracket",$.leftCircularArrow="leftCircularArrow",$.leftRightArrow="leftRightArrow",$.leftRightArrowCallout="leftRightArrowCallout",$.leftRightCircularArrow="leftRightCircularArrow",$.leftRightRibbon="leftRightRibbon",$.leftRightUpArrow="leftRightUpArrow",$.leftUpArrow="leftUpArrow",$.lightningBolt="lightningBolt",$.line="line",$.lineInv="lineInv",$.mathDivide="mathDivide",$.mathEqual="mathEqual",$.mathMinus="mathMinus",$.mathMultiply="mathMultiply",$.mathNotEqual="mathNotEqual",$.mathPlus="mathPlus",$.moon="moon",$.noSmoking="noSmoking",$.nonIsoscelesTrapezoid="nonIsoscelesTrapezoid",$.notchedRightArrow="notchedRightArrow",$.octagon="octagon",$.parallelogram="parallelogram",$.pentagon="pentagon",$.pie="pie",$.pieWedge="pieWedge",$.plaque="plaque",$.plaqueTabs="plaqueTabs",$.plus="plus",$.quadArrow="quadArrow",$.quadArrowCallout="quadArrowCallout",$.rect="rect",$.ribbon="ribbon",$.ribbon2="ribbon2",$.rightArrow="rightArrow",$.rightArrowCallout="rightArrowCallout",$.rightBrace="rightBrace",$.rightBracket="rightBracket",$.round1Rect="round1Rect",$.round2DiagRect="round2DiagRect",$.round2SameRect="round2SameRect",$.roundRect="roundRect",$.rtTriangle="rtTriangle",$.smileyFace="smileyFace",$.snip1Rect="snip1Rect",$.snip2DiagRect="snip2DiagRect",$.snip2SameRect="snip2SameRect",$.snipRoundRect="snipRoundRect",$.squareTabs="squareTabs",$.star10="star10",$.star12="star12",$.star16="star16",$.star24="star24",$.star32="star32",$.star4="star4",$.star5="star5",$.star6="star6",$.star7="star7",$.star8="star8",$.stripedRightArrow="stripedRightArrow",$.sun="sun",$.swooshArrow="swooshArrow",$.teardrop="teardrop",$.trapezoid="trapezoid",$.triangle="triangle",$.upArrow="upArrow",$.upArrowCallout="upArrowCallout",$.upDownArrow="upDownArrow",$.upDownArrowCallout="upDownArrowCallout",$.uturnArrow="uturnArrow",$.verticalScroll="verticalScroll",$.wave="wave",$.wedgeEllipseCallout="wedgeEllipseCallout",$.wedgeRectCallout="wedgeRectCallout",$.wedgeRoundRectCallout="wedgeRoundRectCallout"})(T7||(T7={}));var G2;(function($){$.text1="tx1",$.text2="tx2",$.background1="bg1",$.background2="bg2",$.accent1="accent1",$.accent2="accent2",$.accent3="accent3",$.accent4="accent4",$.accent5="accent5",$.accent6="accent6"})(G2||(G2={}));var u7;(function($){$.left="left",$.center="center",$.right="right",$.justify="justify"})(u7||(u7={}));var S7;(function($){$.top="top",$.middle="middle",$.bottom="bottom"})(S7||(S7={}));var B1;(function($){$.ACTION_BUTTON_BACK_OR_PREVIOUS="actionButtonBackPrevious",$.ACTION_BUTTON_BEGINNING="actionButtonBeginning",$.ACTION_BUTTON_CUSTOM="actionButtonBlank",$.ACTION_BUTTON_DOCUMENT="actionButtonDocument",$.ACTION_BUTTON_END="actionButtonEnd",$.ACTION_BUTTON_FORWARD_OR_NEXT="actionButtonForwardNext",$.ACTION_BUTTON_HELP="actionButtonHelp",$.ACTION_BUTTON_HOME="actionButtonHome",$.ACTION_BUTTON_INFORMATION="actionButtonInformation",$.ACTION_BUTTON_MOVIE="actionButtonMovie",$.ACTION_BUTTON_RETURN="actionButtonReturn",$.ACTION_BUTTON_SOUND="actionButtonSound",$.ARC="arc",$.BALLOON="wedgeRoundRectCallout",$.BENT_ARROW="bentArrow",$.BENT_UP_ARROW="bentUpArrow",$.BEVEL="bevel",$.BLOCK_ARC="blockArc",$.CAN="can",$.CHART_PLUS="chartPlus",$.CHART_STAR="chartStar",$.CHART_X="chartX",$.CHEVRON="chevron",$.CHORD="chord",$.CIRCULAR_ARROW="circularArrow",$.CLOUD="cloud",$.CLOUD_CALLOUT="cloudCallout",$.CORNER="corner",$.CORNER_TABS="cornerTabs",$.CROSS="plus",$.CUBE="cube",$.CURVED_DOWN_ARROW="curvedDownArrow",$.CURVED_DOWN_RIBBON="ellipseRibbon",$.CURVED_LEFT_ARROW="curvedLeftArrow",$.CURVED_RIGHT_ARROW="curvedRightArrow",$.CURVED_UP_ARROW="curvedUpArrow",$.CURVED_UP_RIBBON="ellipseRibbon2",$.CUSTOM_GEOMETRY="custGeom",$.DECAGON="decagon",$.DIAGONAL_STRIPE="diagStripe",$.DIAMOND="diamond",$.DODECAGON="dodecagon",$.DONUT="donut",$.DOUBLE_BRACE="bracePair",$.DOUBLE_BRACKET="bracketPair",$.DOUBLE_WAVE="doubleWave",$.DOWN_ARROW="downArrow",$.DOWN_ARROW_CALLOUT="downArrowCallout",$.DOWN_RIBBON="ribbon",$.EXPLOSION1="irregularSeal1",$.EXPLOSION2="irregularSeal2",$.FLOWCHART_ALTERNATE_PROCESS="flowChartAlternateProcess",$.FLOWCHART_CARD="flowChartPunchedCard",$.FLOWCHART_COLLATE="flowChartCollate",$.FLOWCHART_CONNECTOR="flowChartConnector",$.FLOWCHART_DATA="flowChartInputOutput",$.FLOWCHART_DECISION="flowChartDecision",$.FLOWCHART_DELAY="flowChartDelay",$.FLOWCHART_DIRECT_ACCESS_STORAGE="flowChartMagneticDrum",$.FLOWCHART_DISPLAY="flowChartDisplay",$.FLOWCHART_DOCUMENT="flowChartDocument",$.FLOWCHART_EXTRACT="flowChartExtract",$.FLOWCHART_INTERNAL_STORAGE="flowChartInternalStorage",$.FLOWCHART_MAGNETIC_DISK="flowChartMagneticDisk",$.FLOWCHART_MANUAL_INPUT="flowChartManualInput",$.FLOWCHART_MANUAL_OPERATION="flowChartManualOperation",$.FLOWCHART_MERGE="flowChartMerge",$.FLOWCHART_MULTIDOCUMENT="flowChartMultidocument",$.FLOWCHART_OFFLINE_STORAGE="flowChartOfflineStorage",$.FLOWCHART_OFFPAGE_CONNECTOR="flowChartOffpageConnector",$.FLOWCHART_OR="flowChartOr",$.FLOWCHART_PREDEFINED_PROCESS="flowChartPredefinedProcess",$.FLOWCHART_PREPARATION="flowChartPreparation",$.FLOWCHART_PROCESS="flowChartProcess",$.FLOWCHART_PUNCHED_TAPE="flowChartPunchedTape",$.FLOWCHART_SEQUENTIAL_ACCESS_STORAGE="flowChartMagneticTape",$.FLOWCHART_SORT="flowChartSort",$.FLOWCHART_STORED_DATA="flowChartOnlineStorage",$.FLOWCHART_SUMMING_JUNCTION="flowChartSummingJunction",$.FLOWCHART_TERMINATOR="flowChartTerminator",$.FOLDED_CORNER="folderCorner",$.FRAME="frame",$.FUNNEL="funnel",$.GEAR_6="gear6",$.GEAR_9="gear9",$.HALF_FRAME="halfFrame",$.HEART="heart",$.HEPTAGON="heptagon",$.HEXAGON="hexagon",$.HORIZONTAL_SCROLL="horizontalScroll",$.ISOSCELES_TRIANGLE="triangle",$.LEFT_ARROW="leftArrow",$.LEFT_ARROW_CALLOUT="leftArrowCallout",$.LEFT_BRACE="leftBrace",$.LEFT_BRACKET="leftBracket",$.LEFT_CIRCULAR_ARROW="leftCircularArrow",$.LEFT_RIGHT_ARROW="leftRightArrow",$.LEFT_RIGHT_ARROW_CALLOUT="leftRightArrowCallout",$.LEFT_RIGHT_CIRCULAR_ARROW="leftRightCircularArrow",$.LEFT_RIGHT_RIBBON="leftRightRibbon",$.LEFT_RIGHT_UP_ARROW="leftRightUpArrow",$.LEFT_UP_ARROW="leftUpArrow",$.LIGHTNING_BOLT="lightningBolt",$.LINE_CALLOUT_1="borderCallout1",$.LINE_CALLOUT_1_ACCENT_BAR="accentCallout1",$.LINE_CALLOUT_1_BORDER_AND_ACCENT_BAR="accentBorderCallout1",$.LINE_CALLOUT_1_NO_BORDER="callout1",$.LINE_CALLOUT_2="borderCallout2",$.LINE_CALLOUT_2_ACCENT_BAR="accentCallout2",$.LINE_CALLOUT_2_BORDER_AND_ACCENT_BAR="accentBorderCallout2",$.LINE_CALLOUT_2_NO_BORDER="callout2",$.LINE_CALLOUT_3="borderCallout3",$.LINE_CALLOUT_3_ACCENT_BAR="accentCallout3",$.LINE_CALLOUT_3_BORDER_AND_ACCENT_BAR="accentBorderCallout3",$.LINE_CALLOUT_3_NO_BORDER="callout3",$.LINE_CALLOUT_4="borderCallout4",$.LINE_CALLOUT_4_ACCENT_BAR="accentCallout3=4",$.LINE_CALLOUT_4_BORDER_AND_ACCENT_BAR="accentBorderCallout4",$.LINE_CALLOUT_4_NO_BORDER="callout4",$.LINE="line",$.LINE_INVERSE="lineInv",$.MATH_DIVIDE="mathDivide",$.MATH_EQUAL="mathEqual",$.MATH_MINUS="mathMinus",$.MATH_MULTIPLY="mathMultiply",$.MATH_NOT_EQUAL="mathNotEqual",$.MATH_PLUS="mathPlus",$.MOON="moon",$.NON_ISOSCELES_TRAPEZOID="nonIsoscelesTrapezoid",$.NOTCHED_RIGHT_ARROW="notchedRightArrow",$.NO_SYMBOL="noSmoking",$.OCTAGON="octagon",$.OVAL="ellipse",$.OVAL_CALLOUT="wedgeEllipseCallout",$.PARALLELOGRAM="parallelogram",$.PENTAGON="homePlate",$.PIE="pie",$.PIE_WEDGE="pieWedge",$.PLAQUE="plaque",$.PLAQUE_TABS="plaqueTabs",$.QUAD_ARROW="quadArrow",$.QUAD_ARROW_CALLOUT="quadArrowCallout",$.RECTANGLE="rect",$.RECTANGULAR_CALLOUT="wedgeRectCallout",$.REGULAR_PENTAGON="pentagon",$.RIGHT_ARROW="rightArrow",$.RIGHT_ARROW_CALLOUT="rightArrowCallout",$.RIGHT_BRACE="rightBrace",$.RIGHT_BRACKET="rightBracket",$.RIGHT_TRIANGLE="rtTriangle",$.ROUNDED_RECTANGLE="roundRect",$.ROUNDED_RECTANGULAR_CALLOUT="wedgeRoundRectCallout",$.ROUND_1_RECTANGLE="round1Rect",$.ROUND_2_DIAG_RECTANGLE="round2DiagRect",$.ROUND_2_SAME_RECTANGLE="round2SameRect",$.SMILEY_FACE="smileyFace",$.SNIP_1_RECTANGLE="snip1Rect",$.SNIP_2_DIAG_RECTANGLE="snip2DiagRect",$.SNIP_2_SAME_RECTANGLE="snip2SameRect",$.SNIP_ROUND_RECTANGLE="snipRoundRect",$.SQUARE_TABS="squareTabs",$.STAR_10_POINT="star10",$.STAR_12_POINT="star12",$.STAR_16_POINT="star16",$.STAR_24_POINT="star24",$.STAR_32_POINT="star32",$.STAR_4_POINT="star4",$.STAR_5_POINT="star5",$.STAR_6_POINT="star6",$.STAR_7_POINT="star7",$.STAR_8_POINT="star8",$.STRIPED_RIGHT_ARROW="stripedRightArrow",$.SUN="sun",$.SWOOSH_ARROW="swooshArrow",$.TEAR="teardrop",$.TRAPEZOID="trapezoid",$.UP_ARROW="upArrow",$.UP_ARROW_CALLOUT="upArrowCallout",$.UP_DOWN_ARROW="upDownArrow",$.UP_DOWN_ARROW_CALLOUT="upDownArrowCallout",$.UP_RIBBON="ribbon2",$.U_TURN_ARROW="uturnArrow",$.VERTICAL_SCROLL="verticalScroll",$.WAVE="wave"})(B1||(B1={}));var q0;(function($){$.AREA="area",$.BAR="bar",$.BAR3D="bar3D",$.BUBBLE="bubble",$.BUBBLE3D="bubble3D",$.DOUGHNUT="doughnut",$.LINE="line",$.PIE="pie",$.RADAR="radar",$.SCATTER="scatter"})(q0||(q0={}));var D5;(function($){$.TEXT1="tx1",$.TEXT2="tx2",$.BACKGROUND1="bg1",$.BACKGROUND2="bg2",$.ACCENT1="accent1",$.ACCENT2="accent2",$.ACCENT3="accent3",$.ACCENT4="accent4",$.ACCENT5="accent5",$.ACCENT6="accent6"})(D5||(D5={}));var W1;(function($){$.chart="chart",$.image="image",$.line="line",$.rect="rect",$.text="text",$.placeholder="placeholder"})(W1||(W1={}));var D0;(function($){$.chart="chart",$.hyperlink="hyperlink",$.image="image",$.media="media",$.online="online",$.placeholder="placeholder",$.table="table",$.tablecell="tablecell",$.text="text",$.notes="notes"})(D0||(D0={}));var F8;(function($){$.title="title",$.body="body",$.image="pic",$.chart="chart",$.table="tbl",$.media="media"})(F8||(F8={}));var C6;(function($){$.DEFAULT="•",$.CHECK="✓",$.STAR="★",$.TRIANGLE="▶"})(C6||(C6={}));var j6="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAB3CAYAAAD1oOVhAAAGAUlEQVR4Xu2dT0xcRRzHf7tAYSsc0EBSIq2xEg8mtTGebVzEqOVIolz0siRE4gGTStqKwdpWsXoyGhMuyAVJOHBgqyvLNgonDkabeCBYW/8kTUr0wsJC+Wfm0bfuvn37Znbem9mR9303mJnf/Pb7ed95M7PDI5JIJPYJV5EC7e3t1N/fT62trdqViQCIu+bVgpIHEo/Hqbe3V/sdYVKHyWSSZmZm8ilVA0oeyNjYmEnaVC2Xvr6+qg5fAOJAz4DU1dURGzFSqZRVqtMpAFIGyMjICC0vL9PExIRWKADiAYTNshYWFrRCARAOEFZcCKWtrY0GBgaUTYkBRACIE4rKZwqACALR5RQAqQCIDqcASIVAVDsFQCSAqHQKgEgCUeUUAPEBRIVTAMQnEBvK5OQkbW9vk991CoAEAMQJxc86BUACAhKUUwAkQCBBOAVAAgbi1ykAogCIH6cAiCIgsk4BEIVAZJwCIIqBVLqiBxANQFgXS0tLND4+zl08AogmIG5OSSQS1gGKwgtANAIRcQqAaAbCe6YASBWA2E6xDyeyDUl7+AKQMkDYYevm5mZHabA/Li4uUiaTsYLau8QA4gLE/hU7wajyYtv1hReDAiAOxQcHBymbzark4BkbQKom/X8dp9Npmpqasn4BIAYAYSnYp+4BBEAMUcCwNOCQsAKZnp62NtQOw8WmwT09PUo+ijaHsOMx7GppaaH6+nolH0Z10K2tLVpdXbW6UfV3mNqBdHd3U1NTk2rtlMRfW1uj2dlZAFGirkRQAJEQTWUTAFGprkRsAJEQTWUTAFGprkRsAJEQTWUTAFGprkRsAJEQTWUTAFGprkRsAJEQTWUTAFGprkRsAJEQTWUTAGHqrm8caPzQ0WC1logbeiC7X3xJm0PvUmRzh45cuki1588FAmVn9BO6P3yF9utrqGH0MtW82S8UN9RA9v/4k7InjhcJFTs/TLVXLwmJV67S7vD7tHF5pKi46fYdosdOcOOGG8j1OcqefbFEJD9Q3GCwDhqT31HklS4A8VRgfYM2Op6k3bt/BQJl58J7lPvwg5JYNccepaMry0LPqFA7hCm39+NNyp2J0172b19QysGINj5CsRtpij57musOViH0QPJQXn6J9u7dlYJSFkbrMYolrwvDAJAC+WWdEpQz7FTgECeUCpzi6YxvvqXoM6eEhqnCSgDikEzUKUE7Aw7xuHctKB5OYU3dZlNR9syQdAaAcAYTC0pXF+39c09o2Ik+3EqxVKqiB7hbYAxZkk4pbBaEM+AQofv+wTrFwylBOQNABIGwavdfe4O2pg5elO+86l99nY58/VUF0byrYsjiSFluNlXYrOHcBar7+EogUADEQ0YRGHbzoKAASBkg2+9cpM1rV0tK2QOcXW7bLEFAARAXIF4w2DrDWoeUWaf4hQIgDiA8GPZ2iNfi0Q8UACkAIgrDbrJ385eDxaPLLrEsFAB5oG6lMPJQPLZZZKAACBGVhcG2Q+bmuLu2nk55e4jqPv1IeEoceiBeX7s2zCa5MAqdstl91vfXwaEGsv/rb5TtOFk6tWXOuJGh6KmnhO9sayrMninPx103JBtXblHkice58cINZP4Hyr5wpkgkdiChEmc4FWazLzenNKa/p0jncwDiqcD6BuWePk07t1asatZGoYQzSqA4nFJ7soNiP/+EUyfc25GI2GG53dHPrKo1g/1Cw4pIXLrzO+1c+/wg7tBbFDle/EbQcjFCPWQJCau5EoBoFpzXHYDwFNJcDiCaBed1ByA8hTSXA4hmwXndAQhPIc3lAKJZcF53AMJTSHM5gGgWnNcdgPAU0lwOIJoF53UHIDyFNJcfSiCdnZ0Ui8U0SxlMd7lcjubn561gh+Y1scFIU/0o/3sgeLO12E2k7UXKYumgFoAYdg8ACIAYpoBh6cAhAGKYAoalA4cAiGEKGJYOHAIghilgWDpwCIAYpoBh6cAhAGKYAoalA4cAiGEKGJYOHAIghilgWDpwCIAYpoBh6ZQ4JB6PKzviYthnNy4d9h+1M5mMlVckkUjsG5dhiBMCEMPg/wuOfrZZ/RSywQAAAABJRU5ErkJggg==",gB="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAB4AAAAVnCAYAAACzfHDVAAAAYHpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjaVcjJDYAwDEXBu6ughBfH+YnLQSwSHVA+Yrkwx7HtPHabHuEWrQ+lBBAZ6TMweBWoCwUH8quZH6VWFXVT696zxp12ARkVFEqn8wB8AAAACXBIWXMAAC4jAAAuIwF4pT92AADZLklEQVR42uzdd5hV9Z0/8M+dmcsUZmDovYOhKCiKYhR7JJuoSTCWGFI0WUxijBoTTXazVlyza4maYm9rTRSJigVsqCDNQhHBAogKCEgRMjMMU+7vj93sL8kqClLmnPt6PY+PeXZM9vP9vO8jZ+Y955xMfJLjorBrRMuSgmiViyjN1Ee2oSCyucbIBAAAAAAAAADbXaYgcoWNUZcrirpMbdRsysa69wbF+rggGrf439vSF7seF12aFUTnxvoosGIAAAAAAACAXacgoqEgF++/VRgr4r5o+Kh/pvD//F8uiII+LaPrum/EXzqui2b1ddHGKgEAAAAAAAB2rVxEQWMmWrQtjHZlA6N2w2tR84//zP8pgHu3ib6NBdG+zdqorK6KVUXZaB85j3sGAAAAAAAAaAoaG6OwIBdtyneP2PBabPzbr/1dAdx3VHRtyESHiIhcYzQrLo7WmVzkcjmPgAYAAAAAAABoSgpy0eIfS+D/LYD7fy3abC6Inn/7X2hsjELlLwAAAAAAAEDT9D8lcM1fHwddFBFxyAVR9M686PVp/gfqayKiJiLqLBMAAAAAAABgh8hGRGlEUekn/6PFEb3ikNgQk6O+KCJi6dzoksv83/cB/1X9xoiaJdmoWxlRV1dk2QAAAAAAAAA7QTZbH9muERX96v7n9t7/q6Exinq3i86LI94pjOOisHUu+uYykfmof7h+Y8Sa6aVRt74gGhs9DRoAAAAAAABgZ2lsLIi69QWxeUUmSjs0/vedwR8hk4uydSfE+wVd6qOyMfMx7/mtj9jwUtbjngEAAAAAAAB2obrqolg7IxtR/9Ffb4wo7P5GtCwobRaVH/c/UvNmNuqqPfIZAAAAAAAAYFerqy6KmjezH/v1ktpoVZBr/PgCeMN7yl8AAAAAAACApmJLHW5jUVQWNDSP+Q3ZeLco4i9/+8X6teHRzwAAAAAAAABNSd3/dLn/oLAoqqIuVhXFxhhSGB/xqGjlLwAAAAAAAECTU1eTjaK/KXSLIv7SWB+bc5ko9YxnAAAAAAAAgATJFv393bz1EeV//c8F1gMAAAAAAACQDgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKSEAhgAAAAAAAAgJRTAAAAAAAAAACmhAAYAAAAAAABICQUwAAAAAAAAQEoogAEAAAAAAABSQgEMAAAAAAAAkBIKYAAAAAAAAICUUAADAAAAAAAApIQCGAAAAAAAACAlFMAAAAAAAAAAKaEABgAAAAAAAEgJBTAAAAAAAABASiiAAQAAAAAAAFJCAQwAAAAAAACQEgpgAAAAAAAAgJRQAAMAAAAAAACkhAIYAAAAAAAAICUUwAAAAAAAAAApoQAGAAAAAAAASAkFMAAAAAAAAEBKKIABAAAAAAAAUkIBDAAAAAAAAJASCmAAAAAAAACAlFAAAwAAAAAAAKREkRUAAACwrUpLSwuGDRvWfMCAAS26du3avKysrLiioqKkZcuWzZs1a1bcvHnz0tLS0rJsNtusuLi4ebNmzUoLCgo+8/eijY2N9Zs3b66pra2tqqur21xTU1NdVVVVs2nTptqNGzdWbdiwoeYvf/nL5hUrVlQtWLBgw6xZs6pqamoaJQYAAEDaKYABAACIiIghQ4aUHnTQQW379u3bql27dq3at2/fpkWLFq2bN29eWVpa2qpZs2bNCwsLm2ez2fLCwsLyoqKi8sLCwtKknK+hoaG6vr6+qqGh4S91dXV/aWhoqNq8eXNVTU3NuqqqqvUbNmxYu2rVqjWrV69e99Zbb6177rnnPpgzZ06NTwYAAABJogAGAADIA8OGDWt+xBFHdBwwYECnLl26dGjdunXHFi1adCgtLe1YUlLSvlmzZq0KCgqK07yDwsLCssLCwrKIaPdp/zuNjY21mzdvXrdp06ZVNTU172/YsGHl2rVr31+2bNnKBQsWrHjyySffnzVrVpVPGAAAAE1Fpuexsd9HfaF+ZcSal0ptCAAAIAE6deqUPf744zvtueeeXbp3796lbdu2XSorKzuXlpZ2KS0t7VBYWFhhSztGQ0PDxpqampU1NTXL169fv+yDDz5Y9s477yybPXv2sj/96U8rVqxYUWdLAAAAbE9t9q6Jog4f/TUFMAAAQEJks9nMt7/97Y4jRozo1bdv397t2rXrXl5e3rWsrKxzcXFx+4gosKUmp7G2tnZVTU3Nso0bNy5btWrV0tdff/2tJ598cvG999672noAAADYFgpgAACAhPne977X6a9Fb/v27Xu1bNmyV1lZWa8kvXOXLauvr9/wl7/8ZdG6desWL1u2bNHChQsX/fGPf1w8derUjbYDAADAliiAAQAAmqhsNps59dRTuxx66KH9+/Tp87n27dv3Ly8v719UVOSRzXlq06ZNKzZu3Pj6+++//8abb775xqOPPvrG3XffvcpmAAAA+CsFMAAAQBNx6qmndvniF784qHfv3v3btWv3uYqKis8VFhaW2wxbUl9fv37Dhg1vfPDBB68vXrz4jccee2z+jTfeuNxmAAAA8pMCGAAAYBc45phjWn/rW9/aq3///kPatGnTv6Kiop9HOLO9NDQ0VG/cuPGtNWvWLFy4cOGcO+6445WHHnporc0AAACknwIYAABgJzjjjDO6f+lLX9qrV69eg1u3bj2orKysR0RkbIadJFddXb103bp18xcvXjz30UcffeXqq69+x1oAAADSRwEMAACwnZWWlhb86le/2u3QQw8d1r17931btmw5qLCwsMxmaEoaGhqqP/zww/nvvPPOzGeeeWbW2LFj36ipqWm0GQAAgGRTAAMAAGwHP/7xj7t+9atf3bdXr15D27Ztu1c2m21jKyRJXV3dmg8++OCVRYsWvfznP/95xh/+8IdltgIAAJA8CmAAAIBtcOKJJ7Y75ZRTDujXr9+w1q1bD81ms61shTSpq6tbt3bt2pfffPPNWbfccsvUe++9d7WtAAAANH0KYAAAgE+hoqKi4IILLhg0YsSI/bp27bpfy5YtB2YymUKbIR/kcrmGDz/8cP6777474/nnn59x4YUXvrZx40aPiwYAAGiCFMAAAAAf4/jjj2/7/e9//8D+/fsf2Lp1630KCgpKbAUiGhsbN61fv37eW2+9NeWGG2545u67715lKwAAAE2DAhgAAOB/ZLPZzAUXXPC5I4888sDu3bsfWFFRsVtEFNgMbFl1dfWSd999d8qsWbNmnnvuuS+vW7euwVYAAAB2DQUwAACQ10pLSwsuvfTSQYcccsjBXbt2HVFWVtbDVmDb1dbWrnr//fdfmDp16uRf/vKXL65evbreVgAAAHYeBTAAAJB3Bg0aVHrBBRd8fs899zywQ4cOBxQVFbWwFdj+Ghsba9euXTtrzpw5T59//vmTX3755WpbAQAA2LEUwAAAQF4YNmxY8/POO+/gIUOGHOZ9vrDz/W0ZfNFFFz07a9asKlsBAADY/hTAAABAarVq1arwyiuv3HfEiBEjO3TocFBhYWGZrcCu19DQUP3+++8/O2XKlIk/+clPZm7cuLHRVgAAALYPBTAAAJAqrVq1Kvztb3+7/3777Xd4x44dRxQWFpbbCjRdDQ0NG99///0pM2bMeOqHP/zhC8pgAACAz0YBDAAApMJZZ53V45vf/OaRvXr1GllaWtrVRiB5ampq3l28ePHEO++8c9LVV1/9jo0AAABsPQUwAACQWMOHDy+/6KKLvjB48OCjW7RoMdBGID0+/PDDV+fNmzfhvPPOe3L69Ol/sREAAIBPRwEMAAAkSqtWrQpvuOGGQ/bbb79/atOmzX6ZTCZrK5BeuVyubs2aNTNmzJjx2JgxYyavW7euwVYAAAA+ngIYAABIhB//+Mddv/e9732lZ8+e/1RcXNzWRiD/1NbWfvD2228/dssttzz029/+9l0bAQAA+L8UwAAAQJNVUVFRcO21137+4IMPPrZ169b7ZTKZAlsBIqJxzZo1M59//vnxp5122hR3BQMAAPx/CmAAAKDJOeWUUzqefvrpx/bu3ftL2Wy2jY0AH6e+vn7j0qVLH/vd7373x+uvv36ZjQAAAPlOAQwAADQJ2Ww2c+uttx5wyCGHnNC6deu9I8LdvsDWaFy7du1L06ZN+/OPfvSjZ1evXl1vJQAAQD5SAAMAALtU//79S6655pp/2nPPPY8tLy/vayPAZ1VTU7NswYIF488999wHp06dutFGAACAfKIABgAAdomf//znPU855ZQTu3btemRhYWGZjQDbW2NjY92KFSuevOWWW+689NJLF9kIAACQDxTAAADATuMxz8Cusn79+rlPP/30f5188slT6+rqcjYCAACklQIYAADY4fr27Vv8hz/84a+Pee5nI8CuUlNT8+68efPu/8EPfvDgwoULN9kIAACQNgpgAABghxkyZEjpNddc89XBgwefWFxc3MFGgKaitrZ21dy5c+/5yU9+8uc5c+bU2AgAAJAWWyqAPYoNAADYJqNHj+4wb968n06ZMuXRYcOGnaH8BZqa4uLi9sOGDTtjypQpj86bN++nJ510UntbAQAA0s4dwAAAwFY599xze33/+9//dufOnY/IZDJZGwGSIpfL1S1fvvzJG2644fbLLrvsbRsBAACSyiOgAQCAz+y8887r+53vfOfbHTt2PDyTyRTaCJBUuVyuYcWKFU/cdNNN//XrX/96sY0AAABJowAGAAC22WWXXTboG9/4xg9at249zDaAtFm7du2su++++9pzzjnnNdsAAACSQgEMAABsNcUvkE8UwQAAQJIogAEAgE9N8Qvks7Vr18665557rvv5z38+3zYAAICmaksFcGHlwOj6UV9orIqoWZG1PQAAyBO/+MUvet9xxx3nHHrooT8pLS3tYiNAPiotLe2y7777HvP973+/X1lZ2ZIpU6assxUAAKCpKetcHwXlH/01BTAAAOS5M844o/u99957zpe//OWflZeX94qIjK0AeS5TXl7e8+CDDx71/e9/v3dEvDVjxowPrQUAAGgqFMAAAMD/ceKJJ7a77777fjJq1Kh/KS8v7xOKX4B/lCkvL+99+OGHj/rWt77VfvXq1Qvnz59fbS0AAMCutqUC2DuAAQAgzwwdOrTs+uuvP6l///4nFRYWltkI20NjY2Ns2rQpqquro6amJurr62PTpk2xefPmqK+vj+rq6qivr4/NmzfHpk2boqGhYZv/fxUWFkZJSUk0a9YsioqKoqysLIqKiqJZs2ZRUlISRUVFUVpa+r9/FRQUCIjtoqGhoeq11167a8yYMffMmTOnxkYAAIBdZUvvAFYAAwBAnujUqVP2nnvuGbXXXnudnM1mK22Ej9PQ0BAbN26MDRs2/J+/Nm7cGBs3boyamprYtGlTbNq0KWpqaqK2trbJnqe4uDhKSkqitLT0f/9eUVERFRUV0aJFi//zV0VFRRQWFvog8LHq6urWvvjii7eceOKJf169enW9jQAAADubAhgAAPLcXXfdddAXv/jF00tLS7vZRn7L5XKxYcOGWLt2baxbty7Wrl37d3+tW7cuNmzYkPd7atGiRbRu3TpatWoVrVu3jjZt2vzvf27dunW0aNHCh4morq5e+sgjj1zzne98Z6ptAAAAO5MCGAAA8tTVV189+MQTTzyzoqJioG3kj8bGxli5cmUsX748Pvjgg1i9evX//n3t2rXR2NhoSZ9RYWFhtGrVKtq1axdt27b937937tw5OnTo4LHTeWbDhg3z77333qvOPPPMebYBAADsDApgAADIM1/72tfaXHrppad27979qIjQRKVUQ0NDrFq1KlasWBHvv//+//595cqVTfqRzGlXXFwcHTp0iI4dO0bnzp2jY8eO0alTp2jXrp1HS6dYLpdrfOeddx76+c9/fv2ECRPW2QgAALAjKYABACBP9OrVq9ldd931jT322OM7hYWFZTaSHh9++GG88847sXTp0njvvfdixYoVsXr16mhoaLCchCgsLIz27dtHp06dolu3btG9e/fo3r27x0mnTENDQ9W8efNu++Y3v/nHJUuWbLYRAABgR1AAAwBAHrjrrrtG/NM//dOZJSUlXWwj2davXx9Lly6Nd955539L3w8//NBiUqqysvJ/y+C//tWqVSuLSbiamppljz322G9Gjx49xTYAAIDtTQEMAAAp9qtf/arPD3/4w5+1atVqL9tIno0bN8aSJUvirbfeikWLFsV7770XmzZtspg8V1JSEl27do0+ffpE3759o3fv3lFeXm4xCbRu3bqXr7322ivGjh27yDYAAIDtRQEMAAApNGjQoNI77rjju7vttttJBQUFWRtJhtWrV8ebb74ZixcvjiVLlsTy5cujsbHRYtiigoKC6Ny5c/Tu3Tt69+4d/fr1i7Zt21pMQjQ2Nta98cYbd33rW9+6ff78+TU2AgAAfFYKYAAASJHS0tKCBx988Jj99tvvn7PZbBsbaboaGhri7bffjrfeeisWLFgQS5YscXcv201FRUX06tUr+vbtG3379o2ePXtGYWGhxTRhdXV1a2bMmHHjV77ylYdqamr85gcAALDNFMAAAJASp59+erdf/vKX51ZWVu5jG03T6tWr47XXXouFCxfGm2++GRs3brQUdooWLVpE3759Y8CAATFw4EB3CDdh69evf/E//uM//vPqq69+xzYAAIBtoQAGAICEGzRoUOm99977w969ex+byWTc4teErF+/PubNmxcLFiyIN954Q+FLk9GiRYvo169fDBgwIPbYY4+orKy0lCYkl8s1LF68eNyJJ554rcdCAwAAW0sBDAAACXbNNdcMOemkk35RVlbWyzZ2vVwuF++++27MnTs3XnvttViyZIl3+NLkFRQURK9evWLQoEExePDg6Natm6U0EdXV1UvuvvvuX//kJz+ZYxsAAMCnpQAGAIAEOuqoo1r99re//VmHDh0Ot41da9OmTTF79uyYO3duLFy4MKqqqiyFRGvevHn0798/Bg8eHHvuuWeUlJRYyi62cuXKp04//fTLJ0yYsM42AACAT6IABgCAhBk3btwRRxxxxFnZbLaNbewaVVVVMXfu3Jg7d27Mnz8/amtrLYVUKi4ujoEDB8bgwYNj8ODBUV5ebim7SF1d3ZqnnnrqqlGjRj1hGwAAwJYogAEAICFOOeWUjhdddNEvW7duvZ9t7HwrV66MWbNmxdy5c+Odd96JXC5nKeSdzp07x9577x3Dhg2LDh06WMgusHbt2hnnnXfepbfccsv7tgEAAHwUBTAAADRxpaWlBU899dQ3Bw8e/L2CggLPYt2JVqxYES+99FK89NJLsXz5cguBv/HXMnjvvfeOTp06WchO1NjYuGnu3Lk3H3744XfV1NR40TgAAPB3FMAAANCEjR49usOll176yzZt2gy3jZ1j/fr18eKLL8bMmTNj6dKlFgKfQs+ePWPfffeNYcOGRYsWLSxkJ1mzZs0L55577q/vvvvuVbYBAAD8lQIYAACaoIqKioKJEyd+c/Dgwd8vKCgotpEda8OGDfHiiy/G9OnTlb7wGfXo0SOGDx8ew4YNi4qKCgvZwdwNDAAA/CMFMAAANDGnnHJKx7Fjx/5rZWXlMNvYcerr6+PVV1+NGTNmxLx586Kurs5SYDvKZrMxZMiQ2HfffWP33XePwsJCS9mB1q5dO+MXv/jFv995550rbQMAAPKbAhgAAJqIbDabeeKJJ47fZ599fuSu3x0jl8vFwoULY/r06TF79uzYtGmTpcBOUFpaGkOGDInhw4fHgAEDLGQHaWhoqJ42bdo1Rx555J9tAwAA8pcCGAAAmoDjjz++7ZVXXvmr1q1be9fvDrBmzZqYNm1azJw5M1audHMc7EodO3aMz3/+87H//vt7X/CO+3fetDPPPPOScePGfWAbAACQfxTAAACwi9100037HXvssf9WXFzc1ja2n1wuF6+99lo8//zzMW/evKivr7cUaEKKiopizz33jBEjRsTnPve5yGQylrId1dbWrvrjH/948Q9+8INZtgEAAPlFAQwAALvIkCFDSu+///5zunTp8k+2sf2sXbs2Jk+eHNOnT48PP/zQQiABKisrY8SIEXHIIYdEeXm5hWxHy5Yte+zrX//6f86ZM6fGNgAAID9sqQAurBwYXT/qC41VETUrsrYHAADb6IILLtjt97///VVt2rQZZhvbx+LFi2P8+PFx9913xxtvvBG1tbWWAgmxadOmeOONN+LZZ5+NtWvXRps2bTweejtp0aJFv5NOOumg0tLSuc8+++xaGwEAgPQr61wfBR/zu7XuAAYAgO0sm81mJk2a9PVhw4b9pKCgwG9VfkZ1dXUxY8aMeOaZZ+K9996zEEiRfv36xSGHHBJDhw6NgoICC/mMGhsbN8+YMeOaL37xi+Pq6upyNgIAAOnlEdAAALCTHH/88W2vuuqqCyorK/exjc9mzZo18dRTT8XUqVNj06ZNFgIpVlFREZ///OfjsMMOi8rKSgv5jNavXz/r9NNPv3DcuHEf2AYAAKSTAhgAAHaC22677fNf+9rXzstms5W2se0WLVoUjz/+eMybNy9yOTewQT4pKiqKIUOGxBFHHBG9e/e2kM+grq5u3QMPPHDRySefPM02AAAgfRTAAACwA1VUVBQ8/fTTpwwcOPCUTCbjGabbIJfLxauvvhpPPvlkLFy40EIgz2UymRgwYEAcccQRMWjQIAvZ9n+3Ns6fP/+Www8//JaNGzc22ggAAKTHlgrgwsqB0fWjvtBYFVGzwuvKAABgS0488cR2EyZMuLx79+5fzmQyGRvZOo2NjTFr1qy49dZb48knn4wPPvC0UuC/rV69OmbMmBFz5syJ0tLS6NSpU/jX7NbJZDKZ9u3bD/3+978/dPny5TNfffXValsBAIB0KOtcHwXlH/O9gDuAAQBg29x66637H3vssRcWFRW1sI2tU1NTE0899VQ8++yzsWHDBgsBPlGLFi3i4IMPjsMPPzxKS/28YmvV19d/OG7cuPNPPvnk6bYBAADJ5xHQAACwHWWz2cyzzz77rSFDhvzAI5+3zqZNm2Ly5Mnx1FNPKX6BbdKiRYs47LDD4pBDDlEEb6VcLtfwyiuvXHfooYfeWVdX5yXrAACQYApgAADYTo455pjW11133cWVlZV728ant2HDhnj88cdjypQpUVtbayHAZ1ZcXBwHHnhgfPGLX4wWLTyIYWusWbNm2re//e3zn3nmGb+JAwAACeUdwAAAsB1cfvnlu1900UW/LS8v72cbn05VVVVMmDAhbrnllnjzzTejoaHBUoDtoqGhIZYsWRLPPfdc1NTURI8ePSKb9XOMT6OsrKzb17/+9SPbtm0774knnlhtIwAAkMDreu8ABgCAz+bhhx/+8qGHHnpOQUFBsW18sk2bNsUzzzwTTzzxRFRVVVkIsMOVl5fHkUceGYccckgUF/tX9afR2Ni46emnn/71Mccc87htAABAsngENAAAbKN27doVTZ48+YxevXodZxufrK6uLp5++umYOHGi4hfYJSoqKuKLX/xiHHzwwe4I/pQWLVr0x4MOOuiadevWeUwDAAAkhEdAAwDANjj22GPbPvzww7/p2LHjobaxZXV1dfHkk0/GddddF3Pnzo26ujpLAXaJzZs3x2uvvRbPPfdcRET06NEjCgsLLWYLWrduvfv3vve9fd9+++1pCxYsqLYRAABo+rb0CGgFMAAAfITLL7989wsuuOB3zZs372UbH6+xsTGmTJkS119/fbzyyiuKX6DJ2Lx5cyxYsCCmT58excXF0a1bt8hkMhbzMUpKSjp8+ctfPrJt27ZzvBcYAACaPu8ABgCArTB+/Pgjv/CFL/xLQUFBiW18vAULFsT48eNj6dKllgE0eT169IivfOUrMWjQIMvYgsbGxpqJEydecuyxxz5pGwAA0HR5BzAAAHwK7dq1K3ruued+1qNHj6/axsdbtGhR3H///bF48WLLABKnV69ecdxxx0WfPn0sYwuWLl3654MOOujy1atX19sGAAA0Pd4BDAAAn2DYsGHNn3766V936tTpC7bx0TZs2BD33Xdf/PGPf4y1a9daCJBI69evj2nTpsW6deuiZ8+eUVLiYQ8fpbKysv+3v/3t/lOmTJmyfPlyz/cHAIAmxjuAAQBgC372s5/1uP76669t0aKF54J+hJqamhg/fnzcfPPN8fbbb0cul7MUINFyuVy888478cwzz0RVVVX07t07slk/A/lHZWVl3U488cTD6+rqZkyfPv1DGwEAgCZ0va4ABgCAj3bFFVfscdZZZ11dXFzcwTb+Xi6XixkzZsR1110XCxYsiMbGRksBUqWxsTGWLFkSM2bMiPLy8ujSpUtkMhmL+RvZbLbFQQcddHibNm1mP/HEE6ttBAAAmoYtFcDeAQwAQN6aNGnSqAMOOODsTCZTaBt/b9GiRXHPPffEu+++axlA3ujWrVucdNJJ0bt3b8v4B7lcrm7y5Mm//vKXv/yIbQAAwK63pXcAK4ABAMg7paWlBTNnzjyzT58+x9vG39uwYUOMGzcuZsyY4VHPQF7KZDKx3377xde//vWoqKiwkH+waNGiP+27775X1dTUeCwEAADsQgpgAAD4H926dctOnjz5V506dRppG/9fLpeLqVOnxp///OfYuHGjhQB5r6KiIkaNGhX777+/x0L/g+XLlz9+6KGHXvLuu+/W2QYAAOwaWyqAvQMYAIC8MXz48PInnnjiynbt2o2wjf/vnXfeiWuvvTaee+652Lx5s4UARMTmzZtjzpw58dprr0XPnj2jRYsWlvI/Kioq+n7rW98aMnXq1Ofee+89f3AAAMAusKV3ACuAAQDIC9/+9rc73n777X9o0aLFANv4b1VVVXHXXXfFvffeG+vXr7cQgI+wbt26eP7552P9+vWx2267RVFRkaVERElJSefjjjvuoA8++GDKK6+88hcbAQCAnUsBDABAXjv//PP7XXzxxX8oKSnpbBv/bfr06XHttdfGokWLLAPgU3jnnXdi2rRp0bp16+jc2R8nERHZbLbyC1/4whElJSUvTp48eY2NAADAzqMABgAgb/3ud7/b60c/+tFVRUVFrWwjYs2aNXHzzTfHpEmTora21kIAtkJtbW289NJL8c4770Tfvn2jtLQ073dSWFhYNnz48C/26dNn4UMPPbTMpwQAAHYOBTAAAHnp1ltv3f+b3/zmfxYWFjbP913kcrl4/vnn4/rrr4/ly5f7cAB8BitXroxp06ZFRUVFdOvWLTKZTF7vo6CgIDto0KBDBw0atOiBBx54xycEAAB2vC0VwJmex8Z+H/WF+pURa17ym6wAACTTww8//KXDDjvsXzKZTN6/rPGDDz6I22+/Pd544w0fDIDtbMCAAfGtb30r2rRpk/e7yOVyjVOmTPn1yJEjH/LJAACAHavN3jVR1OGjv6YABgAgdV555ZXTPve5z30r3/fQ0NAQjz32WDz++ONRV1fngwGwg2Sz2Tj66KPjC1/4QhQUFOT9Pl5//fU79tprr9/7ZAAAwI6jAAYAIC9ks9nMyy+/fFafPn2Oz/ddvPvuu3HbbbfFe++954MBsJN069YtvvOd70S3bt3yfhdLliy5f5999rmypqam0ScDAAC2PwUwAACpV1paWjBr1qyzevfufVw+7yGXy8WTTz4ZDz74oLt+AXaBbDYbxxxzTBxxxBF5fzfw0qVLHxg6dOjlSmAAANj+FMAAAKRar169mk2ePHlsu3btDsrnPaxcuTJuueWWePvtt30oAHaxnj17ximnnBIdOnTI6z2sXr16yiGHHPIvS5Ys2exTAQAA28+WCuDCyoHR9aO+0FgVUbMia3sAADRpQ4cOLXvqqacub9Omzf75uoNcLhfPPPNMXH/99bF27VofCoAmYP369TFlypQoKSmJnj17RiaTycs9NG/evPtJJ500ZPLkyc+sWLHCoykAAGA7KetcHwXlH/01BTAAAIk1ZMiQ0kceeeSKVq1a7Z2vO6iuro7bb789nnjiiWhs9IRNgKaksbEx5s+fH++//34MGDAgstn8/DlLaWlpp6997WuDn3rqqadXrlxZ75MBAACfnQIYAIDUOfTQQ1s8+OCDv2/ZsuUe+bqDOXPmxNVXX+2RzwBN3PLly+OFF16Ijh075u0joUtLSzudcMIJ+7/00ktPv/3227U+FQAA8NkogAEASJVhw4Y1v++++37TsmXLQfl4/vr6+hg/fnz88Y9/jNpaP0MHSILNmzfHiy++GJs3b47ddtstCgoK8m4HxcXFbY866qg9n3vuuaeXL1/ucdAAAPAZKIABAEiNI488snLcuHG/b9GixcB8PP97770XV111VcyZM8eHASCBFi1aFC+//HL069cvWrRokXfnLykp6XDcccftP2fOnGcWLVq0yScCAAC2jQIYAIBUOPLIIyvvvPPO35aXl++Wj+d/+umn48Ybb4wPP/zQhwEgwf7yl7/ECy+8ECUlJdGrV6+8O3+zZs3aHHXUUfspgQEAYNspgAEASLxjjz227W233faH5s2b98m3s1dVVcXNN98cTz31VDQ2NvowAKRAY2NjzJ8/P5YtWxYDBgyIZs2a5dX5mzVr1uaYY4458M0333xm4cKFNT4RAACwdRTAAAAk2qGHHtritttuuzofy9+33347rrnmmli8eLEPAkAKvf/++/HKK69Enz59orKyMq/Ons1mK4888sh9Zs6c+dTSpUs3+zQAAMCnpwAGACCxjjjiiJb33nvvteXl5f3y6dy5XC4mTZoUN998c1RVVfkgAKRYVVVVTJ06NbLZbPTp0ycymUzenL24uLjtV7/61c+/8sorTy1evLjWpwEAAD4dBTAAAIl06KGHtrj33nt/l2/lb3V1ddx0000xefLkyOVyPggAeSCXy8WCBQvi3Xffjd133z2y2fz5mUyzZs1aH3300fvNmDHjSXcCAwDAp6MABgAgcYYOHVo2fvz4qysqKgbk07mXLVsWV111lUc+A+SplStXxiuvvBKf+9znoqKiIm/O3axZszZHH3300GeeeebJFStW1PkkAADAlimAAQBIlCFDhpQ++uij17Rs2XL3fDr31KlT49prr42NGzf6EADksaqqqpg+fXq0bds2unTpkjfnLikpaT9q1KihTz755JMrV66s90kAAICPt6UCuMB6AABoSjp16pSdMGHCv1dWVu6RL2dubGyMcePGxR133BF1dW56AiCitrY2br755hg/fnw0NjbmzbkrKyv3mDBhwr9369bNXQkAALCNFMAAADQZrVq1Kpw+ffolbdq02T9fzlxdXR2/+93vYtKkSd73C8DfyeVy8fjjj8fvf//7qK6uzptzt2nTZv8pU6Zc0qpVq0KfAgAA2HoKYAAAmoSKioqC2bNnX9KuXbuD8uXMS5cujYsuuijmz5/vAwDAx3r11VfjoosuiqVLl+bNmdu1a3fQ7Nmz/72iosLPrgAAYCu5iAYAoEmYOXPmz9q1a3dIvpz35ZdfjiuuuCLWrVsnfAA+0bp16+KKK66Il19+OW/O3K5du4Nnzpz5M+kDAMDWUQADALDLvfjii2N69OgxKh/Omsvl4oEHHogbbrghamtrhQ/Ap1ZbWxs33HBDPPDAA3nz2oAePXqMevHFF8dIHwAAPj0FMAAAu9SkSZO+NnDgwFPy4ax1dXVx8803x8SJE73vF4BtksvlYuLEiXHLLbdEXV1dXpx54MCBJ0+aNOlr0gcAgE9HAQwAwC7z6KOPHnXggQeekw9nXbduXfz617+OWbNmCR6Az2zmzJnx61//Ol9eJZA58MADz3n00UePkjwAAHyywsqB0fWjvtBYFVGzImtDAADsEDfeeOO+Rx999EWZTKYw7Wddvnx5XHXVVbFy5UrBA7DdbNiwIWbPnh0DBw6MioqKtB8307179/179uz56sMPP7xc+gAA5LuyzvVRUP7RX1MAAwCw011xxRV7fPe7372qoKCgWdrPOmfOnPjtb38bGzduFDwA2111dXVMmzYtOnfuHB07dkz1WTOZTOHuu+9+eJs2bV6aNGnSKukDAJDPFMAAADQZZ5xxRvef/exnvy0sLCxP+1knTJgQd999d9TX1wsegB2moaEhXnrppchms9G3b99UnzWTyRTttddeB/3lL395dubMmRukDwBAvlIAAwDQJBx00EEVf/jDH64pLi7ulOZz5nK5eOCBB+Kxxx4TOgA77c+eBQsWRF1dXfTv3z8ymUxqz1pQUFBywAEHDJs+ffqkpUuXbpY+AAD5aEsFcIH1AACwMwwaNKj0vvvuu7qsrKxXms9ZV1cX1113XUyaNEnoAOx0EydOjOuvvz7q6upSfc6ysrJef/rTn67u379/idQBAODvKYABANjhKioqCh577LGLKyoqBqb5nNXV1XHNNdfE7NmzhQ7ALvPKK6/ElVdeGVVVVak+Z4sWLQZOnDhxbEVFhZ9vAQDA33CBDADADjdz5syftW3b9sA0n3HdunVx2WWXxRtvvCFwAHa5xYsXx2WXXRZr165N9TnbtWt34MyZM38mcQAA+P8UwAAA7FBPPvnkqB49eoxK8xlXrVoVV1xxRSxfvlzgADQZK1asiCuuuCJWrlyZ6nP26NFj1KRJk0ZJHAAA/lth5cDo+lFfaKyKqFmRtSEAALbZjTfeuO+XvvSlCzOZTGp/8fDdd9+NK6+8MtatWydwAJqc6urqmDVrVvTv3z8qKytTe85u3boN79mz57yHH37Yb2MBAJAXyjrXR0H5R39NAQwAwA5x3nnn9T311FOvLigoKE7rGV977bW45pprorq6WuAANFmbN2+OGTNmRI8ePaJ9+/apPGMmkykYNGjQIYWFhVOee+45v5UFAEDqKYABANipjjrqqFb/8R//8YdmzZq1SusZX3755bj++uujrq5O4AA0eQ0NDfHSSy9Fp06dolOnTqk8Y0FBQXbYsGGfnz9//qQ33nhjk9QBAEizLRXA3gEMAMB21a1bt+wNN9zwnyUlJR3TesYpU6bEjTfeGPX19QIHIDHq6+vjxhtvjKlTp6b2jCUlJZ1uuOGG/+jWrZu7GgAAyFsKYAAAtqunn376XyorK/dI6/kmTZoUd955ZzQ2NgobgMRpbGyMO+64I5588snUnrGysnLw008//UtpAwCQrxTAAABsN88///w3unTp8k9pPd/EiRNj3LhxkcvlhA1AYuVyubj//vtTXQJ36dLlS88+++yJ0gYAIB95BzAAANvFTTfdNPzII488L5PJZNJ4vsceeyzGjx8vaABS47XXXotmzZpF3759U3m+zp0779urV695Dz/88DJpAwCQNlt6B7ACGACAz+wXv/hF7x/+8IdXFxQUNEvj+R544IF45JFHBA1A6ixYsCDq6upiwIABqTtbJpPJDBo06ODGxsbnpk6dul7aAACkiQIYAIAd5oADDqj43e9+99tmzZq1TeP5xo0bF5MmTRI0AKm1aNGi2Lx5cwwcODB1ZysoKMjut99+w5577rnH33vvvc3SBgAgLbZUAHsHMAAA2yybzWbuvPPOfyktLe2exvNNmDBB+QtAXpg0aVI89NBDqTxbaWlpj3vuuedfstlsRtIAAOQDBTAAANvs+eef/06HDh0OTePZHn744Xj44YeFDEDeeOSRR+LPf/5zKs/WoUOHw5599tlvSxkAgHygAAYAYJvcd999hw8ePPjUNJ7t/vvvjwkTJggZgLzz2GOPxX333ZfKs+25554/+NOf/nSYlAEASDvvAAYAYKudccYZ3ceMGXN5QUFBcdrONnHixHjkkUeEDEDeWrx4cWSz2ejbt2/ajpbp06fPvn/5y18mz5w5c4OkAQBIsi29A1gBDADAVhk2bFjzG2+88Q/NmjVrl7azPfroo6l99CUAbI2FCxdGUVFR9OvXL1XnKigoKD7wwAP3e/LJJx9dsWJFnaQBAEiqLRXAHgENAMBWuffee39ZWlraPW3nevzxx+PBBx8UMAD8jz//+c8xceLE1J2rtLS0x3333fdLCQMAkFYKYAAAPrVJkyaN6tSp0xEpPFeMHz9ewADwD8aPHx+TJ09O3bk6der0hUmTJn1VwgAApJFHQAMA8Kmcd955fU888cR/z2QyRWk618yZM+Puu+8WMAB8jNdeey06duwYnTt3TtW5unbtuk9BQcHzzz333DopAwCQNN4BDADAZ3LEEUe0vOKKK67NZrOVaTrXyy+/HDfffHPkcjkhA8DHyOVyMXv27OjSpUt06tQpNefKZDJF++yzz/CpU6c+9u67726WNAAASeIdwAAAbLNsNpu55ZZb/q2kpKRjms61YMGCuPnmm6OxsVHIAPAJGhsb4+abb44333wzVecqLS3tcvfdd5+fzWYzUgYAIC0UwAAAbNGkSZO+3rZt2wPTdKZly5bFDTfcEPX19QIGgE+prq4urr322li+fHmqztWuXbsDH3/88VESBgAgLTwCGgCAj3XZZZcN+upXvzo2k8mk5hcH33///bjyyiujqqpKwACwlerq6uLll1+OIUOGRHl5eWrO1aVLl31LS0unPvPMM2ukDABAEngENAAAW61///4lJ5988q8ymUxRWs60YcOG+P3vfx8bN24UMABso40bN8bvfve7VP15WlBQkP3hD394ft++fYslDABA4q9vrQAAgI/y4IMPnl1WVtYrLeeprq6O3/zmN7Fq1SrhAsBntGrVqrjyyiujuro6NWcqKyvr8/DDD58lXQAAkk4BDADA/zF+/Pgju3XrdnRazlNfX5/KdxYCwK60fPnyuO6666K+vj41Z+rRo8dXx40bd4R0AQBIMgUwAAB/53vf+16nI4444py0nCeXy8Vtt90Wb7zxhnABYDt7/fXX47bbbotcLpeaMx155JHnfvvb3+4oXQAAkkoBDADA/6qoqCi4+OKLLywsLCxPy5nGjx8fs2bNEi4A7CCzZs2Khx56KDXnKSwsrPj1r399QUVFhZ+bAQCQSC5kAQD4XxMnThxdWVk5OC3nef7552PixImCBYAd7LHHHosXXnghNeeprKzc89FHHz1RsgAAJFFh5cDo+lFfaKyKqFmRtSEAgDxxwQUX7DZq1KgLM5lMYRrO8+qrr8Ytt9ySqkdSAkBT/7O3d+/e0a5du1Scp2PHjkNzudxzU6ZMWSddAACamrLO9VHwMc/wcwcwAADRt2/f4h//+McXZzKZVPwG4HvvvRc33HBDNDY2ChcAdpKGhoa47rrrYtmyZak4T0FBQfbss88e27dv32LpAgCQqGtZKwAAYPz48T8qKyvrkYazbNiwIX7/+99HbW2tYAFgJ9u0aVP8/ve/j40bN6biPGVlZb3GjRs3RrIAACSJAhgAIM/ddNNNw/v06XN8Gs5SX18f1157baxdu1awALCLrFmzJq699tqor69PxXn69ev3jd///vdDJQsAQFIogAEA8thBBx1Uceyxx/5rRGTScJ477rgjFi9eLFgA2MUWLVoUd955Z1qOU/CNb3zj34YNG9ZcsgAAJOIC1goAAPLXzTfffFZxcXG7NJxl4sSJMX36dKECQBMxbdq0mDRpUirOUlJS0unOO+88Q6oAACSBAhgAIE/913/914FdunT5UhrO8tprr8Wf//xnoQJAEzN+/PhYsGBBKs7SrVu3o2+66abhUgUAoKlTAAMA5KEvfelLlV/5yld+lYazrFixIq6//vpobGwULAA0MY2NjXHdddfFihUr0nCczHHHHfergw46qEKyAAA0ZQpgAIA8dPXVV5+ezWYrk36OmpqauPbaa2PTpk1CBYAmatOmTXHttddGTU1N4s+SzWbb3njjjT+RKgAATZkCGAAgz9x6663Du3Tp8uWknyOXy8Utt9wSK1euFCoANHErV66MW2+9NXK5XOLP4lHQAAA0dQpgAIA8MnTo0LKvfvWrv0jDWSZMmBBz584VKgAkxJw5c+Kxxx5LxVlGjRr1i6FDh5ZJFQCApkgBDACQR+64444fFRcXd0z6OV5++eV45JFHBAoACfPQQw+l4he4SkpKOt5xxx0/lCgAAE2RAhgAIE9cfvnlu/fs2XNU0s/xwQcfxB133JGKR0gCQL7J5XJx2223xZo1axJ/lp49ex57+eWX7y5VAACaGgUwAEAe6NatW/a73/3uv2YymURf/9XX18cNN9wQ1dXVQgWAhKqqqoobb7wx6uvrE32OTCZT8N3vfvdX3bp1y0oVAICmRAEMAJAHxo8ff0pZWVmvpJ/jnnvuiaVLlwoUABJuyZIlcd999yX+HGVlZT3Hjx9/ikQBAGhKFMAAACn385//vOeAAQNGJ/0c06dPjylTpggUAFJi8uTJMWPGjMSfY8CAAaN//vOf95QoAABNhQIYACDFstls5qyzzjo3k8kk+tGEK1asiLvvvlugAJAyd911V6xYsSLRZ8hkMtmzzjrr3Gw2m5EoAABNgQIYACDFxo0b98XKysq9knyG2trauOGGG6K2tlagAJAyf/1zfvPmzYk+R2Vl5V7jxo0bKVEAAJoCBTAAQEoNHz68/OCDDz4t6ee4//77Y/ny5QIFgJRavnx5jBs3LvHnGDFixI+HDRvWXKIAAOxqCmAAgJS69dZbT8tms22TfIYZM2bEc889J0wASLnJkyfHzJkzE32G4uLitrfffvtp0gQAYFdTAAMApNBVV121R48ePb6S5DOsXLky7rrrLmECQJ64++6744MPPkj0GXr27PnVK664Yg9pAgCwKymAAQBSprS0tOAb3/jGT5N8rdfY2Bi333679/4CQB6pqamJ2267LRobG5N8jIJvfvObZ5aWlvqZGwAAu+6i1AoAANJlwoQJX6uoqBiQ5DOMHz8+Fi1aJEwAyDNvvvlmPPjgg4k+Q4sWLQY9+OCDx0gTAIBdRQEMAJAiRx55ZOWwYcN+kOQzzJ07N5544glhAkCemjhxYixYsCDRZxg+fPiPjjjiiJbSBABgV1AAAwCkyBVXXHFyUVFRRVLnr6qqijvvvDNyuZwwASBP5XK5uP3226O6ujqxZygqKmrxm9/85mRpAgCwKyiAAQBS4vzzz+/Xu3fv45J8httvvz0+/PBDYQJAnlu3bl3cfvvtiT5D7969jz///PP7SRMAgJ1NAQwAkALZbDZz6qmn/jyTyST2+m769OkxZ84cYQIAERExe/bsmDFjRmLnz2QyBaeeeurPs9lsRpoAAOxMCmAAgBT44x//eERlZeXgpM6/du3auPfeewUJAPyde+65J9atW5fY+SsrKwf/6U9/+oIkAQDYmRTAAAAJ17dv3+JDDjnkR0k+w9133x01NTXCBAD+Tk1NTdx9992JPsPBBx/8o759+xZLEwCAnUUBDACQcHfdddc3S0pKOiV1/smTJ8e8efMECQB8pLlz58azzz6b2PlLSko63nPPPd+SJAAAO4sCGAAgwb70pS9VDhw48KSkzr9mzZoYP368IAGALXrggQdizZo1iZ2/f//+Jx111FGtJAkAwM6gAAYASLArrrji1MLCwvIkzp7L5eK2226LTZs2CRIA2KJNmzbFbbfdFrlcLpHzFxYWll1++eU/kCQAADuDAhgAIKF+8Ytf9O7evftXkjr/s88+G2+88YYgAYBP5Y033ojnn38+sfN369bt6F/96ld9JAkAwI6mAAYASKgf/vCHP8pkMom8nvvggw/igQceECIAsFXGjRsX69atS+TsmUym4NRTT/2xFAEA2NEUwAAACXTdddcNa9eu3YFJnD2Xy8Udd9wRtbW1ggQAtsqmTZvizjvvTOz8bdq02f+mm27aT5IAAOxICmAAgIQpLS0t+NrXvnZ6Uud/4YUXYuHChYIEALbJq6++GjNmzEjs/Mccc8zpFRUVfiYHAMAO42ITACBhbr/99oMrKip2S+LsGzZsiHHjxgkRAPhM7r///qiqqkrk7OXl5X3/67/+6wgpAgCwoyiAAQASpKKiouCwww47Nanz33vvvYn9YS0A0HRs2LAh7r///sTOf9BBB/1zq1atCiUJAMCOoAAGAEiQ+++//+iysrKeSZx9zpw58dJLLwkRANguXnjhhViwYEEiZy8tLe32xz/+8StSBABgR1AAAwAkRN++fYv33Xfff07i7LW1tXHvvfcKEQDYru6+++6oq6tL5Oz77bffKf379y+RIgAA25sCGAAgIW6++eZRxcXFbZM4+yOPPBJr164VIgCwXa1atSoee+yxRM6ezWbb3njjjV+TIgAA25sCGAAgAYYOHVq21157fSeJs7/33nvxxBNPCBEA2CEmTpwYK1asSOTsQ4YM+c7QoUPLpAgAwPakAAYASIBrr732xKKiosqkzZ3L5eKee+6JxsZGIQIAO0R9fX3cddddkcvlEjd7UVFR5bXXXnuCFAEA2J4UwAAATdwBBxxQMWDAgG8kcfYZM2bEW2+9JUQAYId6880348UXX0zk7AMGDPjG8OHDy6UIAMD2ogAGAGjirrrqqhOKiooqkjb3pk2b4oEHHhAgALBT3H///VFbW5u4uYuKilpcffXV7gIGAGC7UQADADRhBx10UEX//v0Teffvww8/HB9++KEQAYCdYv369TFhwoREzj5w4MBvHHDAARVSBABge1AAAwA0Yf/5n/95bGFhYfOkzb1q1aqYPHmyAAGAnerpp5+O1atXJ27uwsLC8ssuu2yUBAEA2B4UwAAATdQBBxxQMWjQoNFJnP3uu++O+vp6IQIAO1V9fX3cddddiZx99913/+bQoUPLpAgAwGelAAYAaKIuv/zyYwsLC8uTNvfcuXNjwYIFAgQAdokFCxbE3LlzEzd3UVFRi9/97ndflyAAAJ+VAhgAoAkaOnRo2aBBgxL37t+6urr405/+JEAAYJf605/+FHV1dYmbe/fdd//mkCFDSiUIAMBnoQAGAGiCfvOb33ylqKioZdLmfu655xL53j0AIF1Wr14dzz33XOLmLioqann11VcfLUEAAD4LBTAAQBPTq1evZoMHD/5m0uaurq6ORx55RIAAQJPwyCOPRHV1deLmHjJkyLe6deuWlSAAANtKAQwA0MTcdNNNxxQXF7dN2twTJkyIqqoqAQIATUJVVVUifzmtuLi43a233uouYAAAtpkCGACgCWnVqlXhXnvtdVLS5l61alU8++yzAgQAmpTJkyfHqlWrEjf30KFDR7dq1apQggAAbAsFMABAE3LLLbccXlJS0jlpcz/44INRX18vQACgSamvr48HH3wwcXOXlJR0vummmw6VIAAA20IBDADQRGSz2cwBBxzw7aTNvWjRonjppZcECAA0SS+99FIsXrw4cXOPGDHiO9lsNiNBAAC2lgIYAKCJuOaaa/YuLy/vm7S5H3roocjlcgIEAJqkXC6XyLuAy8vL+1111VV7SRAAgK2lAAYAaCK+8pWvfDdpM8+bNy8WLlwoPACgSVu4cGG8+uqrrg8BAMgLCmAAgCbgsssuG1RZWblPkmbO5XIxfvx44QEAifDAAw8k7qklrVu33veSSy7pLz0AALaGAhgAoAkYNWrUCUmbefbs2bFs2TLhAQCJsGzZsnjllVcSN/cJJ5xwovQAANgaCmAAgF3sn//5nzt37NjxiCTN3NjYGA888IDwAIBEGT9+fDQ0NCRq5k6dOn1h9OjRHaQHAMCnpQAGANjFfvSjH30tk8kk6rps2rRpsWrVKuEBAImyatWqeOGFFxI1cyaTKfzpT386SnoAAHxaCmAAgF1o0KBBpX369Plqkmaur6+PCRMmCA8ASKQJEyZEXV1dombu27fvV/r27VssPQAAPg0FMADALnTZZZcdXlRUVJGkmadOnRpr164VHgCQSOvXr48pU6YkauaioqLK3/zmN0dIDwCAT0MBDACwi2Sz2cy+++57UpJmrqurc/cvAJB4jz76aOLuAt5///1PymazGekBAPBJFMAAALvI1VdfPbSsrKx3kmaeMmVKbNiwQXgAQKJt2LAhnn/++UTNXFZW1ueqq67aS3oAAHwSBTAAwC7y5S9/+bgkzVtfXx8TJ04UHACQCo8//nji7gL+0pe+dLzkAAD4JApgAIBdYPTo0R3atm07IkkzT5s2LdatWyc8ACAVPvzww5g+fXqiZm7fvv2I0aNHd5AeAABbogAGANgFfvrTn47KZDKFSZm3vr4+HnnkEcEBAKnyyCOPRH19fWLmzWQyhT/96U+/JjkAALZEAQwAsJN16tQp26dPn6OTNLO7fwGANFq3bl1MmzYtUTP36dPnmE6dOmWlBwDAx1EAAwDsZFddddUB2Wy2dVLmbWxsjEmTJgmOVOvYsWN06OCJmgD5aNKkSdHY2JiYebPZbOurrrrqAMkBAPBxFMAAADvZiBEjvp6keV988cVYtWqV4Ei1Ll26xIUXXhinnXZadO3a1UIA8siqVavipZdecj0JAEBqKIABAHaiM844o3tlZeXeSZk3l8vFxIkTBUdeyGQyMXjw4PjVr34VY8aMcUcwQB55/PHHI5fLJWbeysrKvc8444zukgMA4KMogAEAdqJTTjnlqxGRScq8CxYsiPfee09w5JVMJhN77713XHjhhTFmzJho3769pQCk3HvvvRcLFy5M1B9X/3NdCQAA/4cCGABgJ+nVq1ezXr16fTlJM3v3L/nsr0XwBRdcECeffHK0bdvWUgBSLGnXPb169fpyr169mkkOAIB/pAAGANhJrrjiioOLiopaJmXeBN4JAztEYWFhDB8+PC688MIYPXp0VFZWWgpACi1YsCCWLVuWmHmLiopaXnnllYdIDgCAf6QABgDYSYYPH/6VJM2btHfhwY5WVFQUI0aMiEsuuSRGjx4dLVu2tBSAFMnlcvH4448naub99tvvK5IDAOAfKYABAHaC0aNHd6isrByalHnXrl0bL7/8suDgI/y1CL744ovjhBNOiBYtWlgKQEq89NJLsW7dusTMW1lZudfo0aM7SA4AgL+lAAYA2AlOP/30o5J07fXMM89EQ0OD4GALiouL47DDDouxY8fGqFGjoqyszFIAEq6hoSGeeeaZJI1c8D/XmQAA8P8vEq0AAGDHymazmX79+n05KfPW1tbGlClTBAefUnFxcYwcOTIuvfTSGDVqVJSWlloKQII9//zzUVtbm5h5+/Xr9+VsNpuRHAAAf6UABgDYwX7zm9/sWVJS0jkp886YMSOqq6sFB1uppKQkRo4cGZdcckkcffTRUVJSYikACVRdXR0zZ85M0p8/na+44orBkgMA4K8UwAAAO9gXvvCFLyVl1lwuF08//bTQ4DNo3rx5HHXUUXHJJZfEyJEjI5vNWgpAwjz11FORy+USM++RRx75ZakBAPBXCmAAgB1oyJAhpZ07dz4iKfO+/vrrsWLFCsHBdlBeXh6jRo2KSy+9VBEMkDArVqyI119/PTHzdunS5fD+/ft79AQAABGhAAYA2KHGjh17aGFhYWJeCOruX9j+KioqYtSoUXHxxRfH4YcfHkVFRZYC4LpouyosLGz+H//xHwdLDQCACAUwAMAOteeeex6ZlFnXrl0b8+bNExrsIK1atYrjjz8+LrroohgxYkQUFPh2DKApmzdvXqxZsyYx8+61115HSg0AgAgFMADADnPMMce0bt269b5Jmfe5556LxsZGwcEO1qZNmxg9enRcfPHFimCAJqyxsTGee+65JP35MvyYY45pLTkAAPykAQBgBznzzDMPz2Qyibjeqq+vj6lTpwoNdqK2bdvG6NGj47zzzovhw4crggGaoBdeeCHq6+sTMWsmkyk844wzDpUaAAB+wgAAsIP079//C0mZdc6cObFhwwahwS7QqVOnOPnkk+Pf/u3fYu+9945MJmMpAE3Ehg0bYvbs2YmZd8CAAR4DDQCAAhgAYEf43ve+16mysnKPpMybpMcbQlp17tw5xowZE7/61a8UwQBNyPPPP5+YWSsrKwd/73vf6yQ1AID8pgAGANgBTj755CMiIhHtzcqVK+P1118XGjQRXbt2jTFjxsQ555wTgwcPthCAXez111+PlStXJmXczMknn3y41AAA8psCGABgB+jXr19iHv88ZcqUyOVyQoMmpnfv3nHaaafFOeecE/3797cQgF0kl8vFlClTknQd6jHQAAB5TgEMALCdnX766d0qKip2S8Ks9fX1MW3aNKFBE9anT58466yz4pxzzonddtvNQgB2gWnTpkV9fX0iZq2oqNjt9NNP7yY1AID8pQAGANjORo8efURSZp03b15s3LhRaJAAffr0ibPPPjvOPPPM6Nmzp4UA7EQbN26MefPmuR4FACARFMAAANtZr169EvPetSQ9zhD4bwMGDIhf/vKXceaZZ0b37t0tBGAnmTp1apKuRw+TGABA/lIAAwBsR2eccUb38vLyvkmYdf369fHaa68JDRJqwIAB8S//8i9x2mmnRbdunvQJsKPNnz8/Pvzww0TMWl5e3u9HP/pRF6kBAOQnBTAAwHZ03HHHHZSUWWfMmBGNjY1CgwTLZDIxePDg+Nd//dcYM2ZMdOjQwVIAdpDGxsaYMWNGYub9xje+cYjUAADykwIYAGA76tOnz8FJmDOXyyXqMYbAlmUymdh7773jwgsvjDFjxkT79u0tBWAHeOGFF5J0XXqIxAAA8pMCGABgOznppJPat2zZcvckzLpkyZJYuXKl0CBl/loEX3DBBXHyySdH27ZtLQVgO1qxYkW8/fbbiZi1srJy0PHHH+8PAgCAPKQABgDYTr773e8eGBGZJMyapMcXAluvsLAwhg8fHhdeeGGMHj06KisrLQVgO5k+fXpSRi34/ve/f6DEAADyjwIYAGA72X333Q9Nwpz19fUxc+ZMgUEeKCoqihEjRsQll1wSo0ePjpYtW1oKwGc0c+bMqK+vT8SsAwcOPFRiAAD5RwEMALAdHHTQQRUtW7bcKwmzLly4MKqrq4UGeeSvRfDFF18cJ5xwQrRo0cJSALZRVVVVvP7664mYtVWrVkOHDx9eLjUAgPyiAAYA2A7OPvvsz2cymaIkzOrxz5C/iouL47DDDouxY8fGqFGjoqyszFIAtkFSnqaSyWSy55577uclBgCQXxTAAADbwe67735AEuasra2NOXPmCAzyXHFxcYwcOTIuvfRSRTDANpg9e3bU1dUlYtY99tjjAIkBAOQXBTAAwGfUqlWrwnbt2u2fhFnnzZsXtbW1QgMiIqKkpCRGjhwZY8eOjaOPPjpKSkosBeBT2LRpU8ybNy8Rs7Zv337/iooKPwMEAMgjLv4AAD6jCy+8cPeioqKKJMz64osvCgz4P5o3bx5HHXVUXHLJJTFy5MjIZrOWAvAJZs2alYg5i4qKWlx88cWDJAYAkD8UwAAAn9GBBx6YiMfqVVdXJ+ZOFWDXKC8vj1GjRsWll16qCAb4BPPmzYuamppEzHrQQQd5DDQAQB5RAAMAfEZdu3YdnoQ5582bF/X19QIDPlFFRUWMGjUqLr744jj88MOjqKjIUgD+QV1dXbz66quJmLVLly77SwwAIH8ogAEAPoNTTjmlY3l5+W5JmPXll18WGLBVWrVqFccff3xcdNFFMWLEiCgo8C0kwN966aWXEjFnRUXFbieddFJ7iQEA5AffvQMAfAYnnnji55MwZ21tbcyfP19gwDZp06ZNjB49OsaOHasIBvgb8+fPj9ra2iSMmvnud7/7eYkBAOQH37UDAHwGn/vc5/ZLwpwLFy6Muro6gQGfyV+L4PPOOy+GDx+uCAby3ubNm2PhwoWJmLVfv37DJQYAkB98tw4AsI1atWpV2Lp1672TMKvHPwPbU6dOneLkk0+Oc889NwYNGmQhQF6bPXt2IuZs06bN3hUVFX4WCACQB1z0AQBso/PPP39gYWFheVOfs76+PubMmSMwYLvr2bNn/OQnP4nzzjsv9t5778hkMpYC5J3Zs2dHfX19k5+zqKio4vzzzx8oMQCA9FMAAwBso/3333/fJMz5+uuvR01NjcCAHaZLly4xZsyYOOecc2Lw4MEWAuSV6urqeOONNxIx64EHHriPxAAA0k8BDACwjbp27ZqIxz/PnTtXWMBO0bt37zjttNPinHPOif79+1sIkDeScr3VvXv3vaUFAJB+CmAAgG0wZMiQ0srKyj2a+py5XM7jn4Gdrk+fPnHWWWfFOeecE7vttpuFAKk3e/bsyOVyTX7Oli1b7jlo0KBSiQEApJsCGABgG5x55pl7ZjKZbFOfc9myZbFu3TqBAbtEnz594uyzz44zzzwzevbsaSFAaq1bty6WL1/e5OfMZDLZs846a4jEAADSrcgKAAC23tChQ4clYc558+YJC9jlBgwYEAMGDIgFCxbE+PHjY+nSpZYCpM68efOiS5cuTX7OffbZZ5+ImC4xAID0cgcwAMA26Nix4z5JmHP+/PnCApqMAQMGxC9/+cs47bTTolu3bhYCpEpSrrs6deq0j7QAANJNAQwAsJWOOOKIlhUVFf2a+pxVVVWxaNEigQFNSiaTicGDB8e//uu/xpgxY6JDhw6WAqTCW2+9FVVVVU1+zoqKis8deuihLSQGAJBeCmAAgK108sknD46ITFOfc/78+dHY2CgwoEnKZDKx9957x4UXXhhjxoyJ9u3bWwqQaI2NjbFgwYJE/Cv4u9/97h4SAwBILwUwAMBW2n333fdMwpze/wskwV+L4AsuuCBOPvnkaNu2raUAiZWU66/BgwfvKS0AgPQqsgIAgK3Trl27wU19xlwul5Q7UAAiIqKwsDCGDx8e++yzT0ybNi0mTJgQ69evtxggURYsWBC5XC4ymab9sJgOHToMlhYAQHq5AxgAYCsMGjSotGXLlgOa+pzvvfdebNy4UWBA4hQVFcWIESPikksuidGjR0fLli0tBUiMDz/8MJYtW9bk52zZsuXA/v37l0gMACCdFMAAAFvhxz/+8aBMJtPkn6Li7l8g6f5aBI8dOzZOOOGEaNGihaUAibBw4cImP2Mmk8n+5Cc/GSAtAIB0UgADAGyFvffee88kzJmEHzwCfBrNmjWLww47LMaOHRujRo2KsrIySwGatKT8Il5SrmsBANh63gEMALAVunbtOqSpz1hfXx9vvvmmsIBUKS4ujpEjR8bBBx8czz77bDz++ONRXV1tMUCT8+abb0Z9fX0UFTXtH7t16dJlT2kBAKSTO4ABAD6lioqKgoqKikFNfc4lS5bE5s2bBQakUklJSYwcOTLGjh0bRx99dJSUeIUl0LTU1tbG0qVLm/ycLVu2HFRaWupngwAAKeQiDwDgUzr77LP7FhYWNvlnj7722mvCAlKvefPmcdRRR8Ull1wSI0eOjGbNmlkK4HpsKxQWFpafffbZvaQFAJA+CmAAgE9p//3375+EOV9//XVhAXmjvLw8Ro0aFf/+7/8eI0eOjGw2aymA67FP6fOf//xAaQEApI8CGADgU+rRo8fuTX3G2traePvtt4UF5J2KiooYNWpUXHzxxXH44Yc3+XdvAum2ePHiRLySo1evXoOkBQCQPgpgAIBPqXXr1k3+DoklS5ZEQ0ODsIC81apVqzj++OPj4osvjhEjRkRBgW97gZ2voaEhlixZ0uTnbNOmjQIYACCFfCcMAPApDBkypLR58+a9m/qcb775prAAIqJ169YxevToGDt2rCIYcF32MZo3b95n0KBBpdICAEgX3wEDAHwKp556av9MJtPkr53eeustYQH8jTZt2sTo0aPjvPPOi+HDhyuCAddlfyOTyRT84Ac/+Jy0AADSxXe+AACfwuDBg5v84/Hq6+tj0aJFwgL4CJ06dYqTTz45/u3f/i323nvvyGQylgLsUIsXL07Eqzn23HPPgdICAEgXBTAAwKfQpUuXAU19xnfeeSfq6uqEBbAFnTt3jjFjxiiCgR2utrY23n333SRc53oPMABAyiiAAQA+hZYtW/Zv6jN6/DPAp9elS5cYM2ZMnHvuuTF48GALAfL2+iwJ17kAAGwdBTAAwCcYPnx4eUlJSeemPqfHPwNsvV69esVpp50W55xzTvTvrwMB8u/6rLS0tPPw4cPLpQUAkB4KYACAT/Ctb31rt4ho8s8IXbx4sbAAtlGfPn3irLPOinPOOSd22203CwG2i4T8gl7m29/+dj9pAQCkhwIYAOAT7L777k2+CVi7dm1s2LBBWACfUZ8+feLss8+OM888M3r27GkhwGfy4Ycfxrp165r8nAMHDlQAAwCkSJEVAABsWadOnZr8D8TefvttQQFsRwMGDIgBAwbEggULYvz48bF06VJLAbb5Oq1Vq1audwEA2GkUwAAAn6CyslIBDJCnBgwYEP3794958+bFQw89FO+++66lAFtlyZIlsddeezX1613PvgcASBEFMADAFnTq1CnbvHnzXk19ziVLlggLYAfJZDIxePDg2GOPPeLll1+OBx98MFauXGkxQGqu05o3b967Xbt2RatXr66XGABA8nkHMADAFowZM6ZnJpPJNuUZGxsbPZoUYCfIZDKx9957x4UXXhhjxoyJ9u3bWwrwiZYuXRqNjY1NesaCgoLsqaee2kNaAADp4A5gAIAt2Hvvvfs29RlXrlwZtbW1wgLYSf5aBO+5554xa9asmDBhQqxevdpigI9UW1sb77//fnTu3LlJzzls2LC+EbFIYgAAyecOYACALejRo0eTL4DfeecdQQHsAoWFhTF8+PC48MILY/To0VFZWWkpQGKv15Jw3QsAwKejAAYA2ILWrVs3+ff/vvvuu4IC2IUKCwtjxIgRcckll8To0aOjZcuWlgIk7notCde9AAB8Oh4BDQCwBc2bN+/Z1GdUAAM0kW+wi4pixIgRsd9++8WUKVPiscceiw0bNlgMEO+9914SrnsVwAAAKeEOYACAj9G/f/+SkpKSjk19TgUwQNPSrFmzOOyww2Ls2LExatSoKCsrsxTIc0m4XistLe3Ut2/fYmkBACSfAhgA4GOccMIJ3Zr69dK6deuiqqpKWABNUHFxcYwcOTJ+/etfK4Ihz1VVVcX69eub+pgF3/zmN7tLCwAg+RTAAAAfY8iQIT2b+oxJeJwgQL77axE8duzYOProo6OkpMRSIA8l4botCde/AAB8MgUwAMDH6N69e8+mPqPHPwMkR/PmzeOoo46KSy65JEaOHBnNmjWzFMgjSbhuS8L1LwAAn0wBDADwMVq1atWjqc+4bNkyQQEkTHl5eYwaNSr+/d//PUaOHBnZbNZSIA8k4botCde/AAB8MgUwAMDHqKio6NXUZ1y+fLmgAJL750yMGjUqLr744jj88MOjqKjIUiDFknDd1rJly16SAgBIPgUwAMBHyGazmbKysq5NecbGxsZYtWqVsAASrlWrVnH88cfHxRdfHCNGjIiCAt+qQxqtWrUqGhsbm/SMJSUlXbPZbEZaAADJ5rtKAICPcNxxx7UrKCgobsozrl69Ourr64UFkBKtW7eO0aNHx9ixYxXBkEJ1dXXxwQcfNOkZCwoKio877rh20gIASDbfTQIAfITPf/7zXZr6jO+//76gAFKoTZs2MXr06Dj//PNj+PDhimBIkRUrVrgOBgBgh/NdJP+PvTuPr7I888d/nSwEkhD2HUQEUVRAoIiouCtq64Jabd1arVorbqO2tlXbaavTOu38Rqffdmpbu9rWpYogsqgFRXCttAIKArJDgAAJBLKQ5JzfH8WO4+DOcp6T9/v18jWvTv657ut6hNvnk/t+AICd2G+//bL+xVcSXiAC8PF17do1Lr300rj99ttj2LBhkUq5lRWSLgn7tyTsgwEAeH8FWgAA8H917txZAAxAVujevXtceeWVsXr16njiiSdi9uzZkclkNAYSKAn7tyTsgwEAeH8CYACAnWjXrp0roAHIKj169Igrr7wyli5dGpMmTYo5c+ZoCiRMEvZvSdgHAwDw/gTAAAA7UVxc3D3baxQAAzRPffr0ibFjx8aSJUti/PjxsWDBAk2BhEjC/i0J+2AAAN6fbwADAOxESUlJz2yur7q6Ourq6gwKoBnbb7/94l/+5V/ia1/7WhxwwAEaAglQV1cX1dXV9sEAAOxWAmAAgHc5/PDDSwsKCtpmc40VFRUGBUBERPTt2zduvPHGuOGGG2LffffVEMhy2b6PKygoaDt8+PASkwIASC4BMADAu5x44oldsr3GDRs2GBQA/8uAAQPiG9/4Rtxwww3Ru3dvDQH7uE+yH+5qUgAAyeUbwAAA79KvX7+sD4DXr19vUADs1IABA+LAAw+MuXPnxoQJE2LlypWaAlkkCTe5HHDAAV0i4i3TAgBIJgEwAMC7dO/evXO21+gEMADvJ5VKxaBBg2LgwIExe/bsGD9+fKxbt05jwD4uZ/bDAAC8NwEwAMC7tG/fvlO21ygABuDDSKVSMWzYsBg6dGjMnj07HnvsMbdIwF6WhBPASdgPAwDw3gTAAADv0rp166w/8ZCEF4cAZI+3g+BDDz00XnnllZg4caK/S8A+LtH7YQAA3psAGADgXUpKSrL6xENjY2Ns3rzZoAD4yPLz8+Pwww+P4cOHx/PPPx8TJ06MqqoqjYE9aPPmzdHY2BgFBdn7Wi7b98MAALw/ATAAwLu0bNmySzbXV1lZGZlMxqAA+Njy8/Nj1KhRMXLkyHjhhRcEwbAHZTKZqKqqio4dO9oPAwCwWwiAAQDepaioKKuvvKusrDQkAHaJgoKCGDVqVIwYMSJmzpwZkydPji1btmgM7IH9XDYHwNm+HwYA4P3laQEAwP8YPnx4SX5+fkk21ygABmBXa9GiRRx//PFxxx13xNlnnx0lJSWaAs14P5efn18yfPhwfxAAACSUABgA4B2OOOKIDtleo+//ArC7FBUVxejRo+P73/9+nH322VFcXKwpsBsk4cr1JOyLAQDYOQEwAMA79O3bt1221+gEMAC729tB8B133BGnn356tGrVSlOgme3n9ttvv7YmBQCQTAJgAIB36NSpkwAYAHYoKSmJz3zmM3HnnXfG6NGjo0WLFpoCzWQ/l4R9MQAAOycABgB4hw4dOrTN9hqTcGUgALmlpKQkzj777PjOd74To0aNivz8fE2BHN/PJWFfDADAzgmAAQDeoaysrG221ygABmBvad++fVx00UVx5513xgknnBCFhYWaAjm6nysrK3MCGAAgoQTAAADvUFJS0j6b68tkMlFdXW1QAOxV7dq1i/POOy+++93vxqhRoyIvz+sF+CiSsJ8rLS0VAAMAJJT/QgMAeIfi4uK22VxfXV1dNDY2GhQAWeHtE8F33HGHIBg+gsbGxqirq7MvBgBgt/BfZgAA79CqVausPung9C8A2ahDhw5x0UUXxbe//e04/PDDBcGQA/u6oqIiJ4ABABLKf5EBALxDQUGBABgAPqauXbvGpZdeGt/61rdi2LBhkUqlNAUSuq9r0aJFW1MCAEimAi0AAPgfhYWFZdlc39atWw0JgKzXrVu3uPLKK2P16tXxxBNPxOzZsyOTyWgMJGhfl+37YgAA3psAGADgnZujgoLW2VyfE8AAJEmPHj3iyiuvjKVLl8akSZNizpw5mgIJ2ddl+74YAID35gpoAIAdWrdunZefn98ym2sUAAOQRH369ImxY8fGLbfcEgMGDNAQSMC+Lj8/v1WrVq28OwQASCCbOACAHQYNGlQSEVn9scJt27YZFACJtd9++8UNN9wQX/va1+KAAw7QEJq1BOzr8gYPHlxsUgAAySMABgDY4YADDijJ9hpramoMCoDE69u3b9x4441xww03xL777qshNEu1tbVZX2P//v1LTQoAIHl8AxgAYIeePXtm/QuuJLwoBIAPa8CAATFgwICYP39+jBs3LpYvX64pNBtJ2Nf16NGjxKQAAJJHAAwAsEOnTp0EwACwFwwYMCAOPPDAmDt3bkyYMCFWrlypKeS8JOzrunbtKgAGAEggATAAwA5lZWVZ/4Krrq7OoADISalUKgYNGhQDBw6M2bNnx4QJE2Lt2rUaQ85KQgDcpk0bV0ADACSQABgAYIeysjIngAFgL0ulUjFs2LAYOnRozJ49O8aPHx/r1q3TGHKOABgAgN1FAAwAsENJSUlxttfoBDAAzcXbQfCQIUPi5ZdfjokTJ0ZFRYXGkDOSEAAnYX8MAMD/JQAGANihqKioKNtrrKmpMSgAmpW8vLw4/PDDY/jw4fH888/HE088EZWVlRpD4iUhAG7RokWRSQEAJI8AGABgh8LCwhbZXF86nY7t27cbFADNUn5+fowaNSpGjhwZL7zwQkycODGqqqo0hsTavn17ZDKZSKVSWVtjixYtWpgUAEDyCIABAHbI9gC4oaHBkABo9goKCmLUqFExYsSImDlzZkyePDm2bNmiMSROJpOJhoaGyOaMtbCw0AlgAIAk/neTFgAA7NgYFRRk9QuuxsZGQwKAHVq0aBHHH398HHnkkfHMM8/E1KlTY9u2bRpDomR7AJzt+2MAAN5jH6cFAAA7NkZZ/oLL9c8A8H8VFRXF6NGj49hjj41nnnkmpkyZEjU1NRpDImT7DS8FBQWugAYASCABMADA2xujLH/B5QpoAHhvbwfBRx11VEyfPj2efvrpqK2t1RiymgAYAIDdIU8LAAD+QQAMAMlXUlISn/nMZ+LOO++M0aNHZ/X1uiAABgBgdxAAAwDskO1XQAuAAeDDKykpibPPPjv+7d/+LUaPHh2FhYWagv3dR5Sfn9/SlAAAkkcADADw9sYoL88JYADIMa1bt46zzz47vve978UJJ5wgCMb+7iPIz8/3LwwAQAIJgAEAdkilUlm9N2psbDQkAPiY2rVrF+edd15897vfjRNOOCEKCgo0Bfu7D94f55sSAEDyCIABAHbI9gA4nU4bEgB8Qu3bt/9nEDxq1KjIy/NqBPu799kfp0wJACB5/FcOAMAOXnABQPPRoUOHuOiii+J73/ueIJi9JpPJZHuJ/sUAAEggmzgAgP+R1QFwAl4QAkDidOzYMS666KL41re+FYcffnj4fTDs796xOc7yG3IAANg5mzgAgITsjQTAALD7dOvWLS699NL41re+FcOGDRMEs0dk+xXQeXl5/kUAAEigAi0AAPiHbH/BJQAGgN2ve/fuceWVV8ayZcviiSeeiDlz5mgKzXl/5/AIAEACCYABAHbIZDJOAAMAERGx7777xtixY2PJkiUxYcKEmD9/vqZgfwwAQCIIgAEA/ocr7gCA/2W//faLG264Id56660YP358vPnmm5rCLpPtV0Cn3IUOAJBIAmAAgB2y/QVXtr8gBIBc1rdv37jxxhvjrbfeinHjxsWiRYs0hU/MFdAAANjEAQDsXln9Bs4BDADY+/r27Rs333xz3HDDDdG7d28NIdf3d75BAgCQQE4AAwDskO0nMATAAJA9BgwYEAMGDIj58+fHI488EitXrtQUcnF/5woaAIAEcgIYAGCHVCqVzvL6DAkAssyAAQPi1ltvjbFjx0bPnj01hJza32UScEc1AAD/lxPAAAD/QwAMAHysv6MHDRoUBx98cDz//PMxadKk2LRpk8aQ+P1dtv+CJAAAO+cEMADADul0dr/fEgADQHarr6+PioqK2LZtm2aQE/u7dDrtBDAAQAI5AQwA8D+cAAYAPrK6urp4+umnY9q0acJfcm1/5wQwAEACCYABAP6HEw4AwIfW0NAQ06ZNiyeffDK2bt2qIXxkCfgGsAAYACCBBMAAADtkMpmsDoDz8ny9AwCywdvB71NPPRXV1dUaQs7u7wTAAADJJAAGANgh219wCYABYO9qbGyMGTNmxJNPPhmVlZUawieWn5+f9VtkUwIASB4BMADADplMpiGb6yssLDQkANgL0ul0zJo1KyZPnhwbN27UEHaZgoLsfjXX1NTUaEoAAAncZ2oBAMA/NDY2bs/m+gTAALBnpdPpePnll2Py5Mmxdu1aDWGXa9GiRbb/O1BvSgAAySMABgDYoampSQAMAEQmk4nZs2fH448/HuXl5RpCs93fNTY2CoABABJIAAwAsENDQ0NWv+ASAAPA7vV28PvEE0/E6tWrNYTdLtuvgM72G3IAAHiPfaYWAAD8gyugAaD5mjNnTkyaNCmWLl2qGewx2X4FtAAYACCZBMAAADs0NTU5AQwAzcyCBQtiwoQJ8dZbb2kG9nfv0tDQIAAGAEggATAAwA7Z/oJLAAwAu87ChQtj/PjxsXjxYs1gr8n2K6Cz/RckAQB4j32mFgAA/EO2B8AFBQWRl5cX6XTasADgY1q+fHmMGzcu5s+frxnsVXl5eVkfAG/fvt0JYACABBIAAwDs0NDQkPUnHFq1ahXbtm0zLAD4iFauXBmPPPKI4Jes2tclYH8sAAYASCABMADADrW1tXXZXqMAGAA+mnXr1sX48eNj9uzZkclkNISs2tdlu7q6ulqTAgBIHgEwAMAOW7du3ZrtNSbhRSEAZIP169fHY489JvjFvu4TqK6u3mpSAADJIwAGANihqqpKAAwACbdhw4Z4/PHH45VXXommpiYNwb7uE6isrHT1DABAAgmAAQB22LRpU9a/4GrZsqVBAcBOVFVVxcSJE+OFF16IxsZGDSHrJSEA3rRpkxPAAAAJJAAGANhh3bp1WR8AOwEMAP/bli1bYsKECYJfEicJ+7ry8nIBMABAAgmAAQB2WLZsmSugASAhqqurY/LkyTFz5syor6/XEBInCfu6pUuXCoABABJIAAwAsMP8+fOz/gRwcXGxQQHQrNXU1MSUKVPimWeeEfySaEnY173++uu+AQwAkEACYACAHRYsWFCXyWQaUqlUYbbW2Lp1a4MCoFmqq6uLp59+OqZNmxbbtsmkSL5s39el0+mGpUuXbjcpAIDkEQADALxDU1PTtoKCgrbZWp8AGIDmZvv27TF9+vR48sknY+tWt9GSO7J9X9fU1ORfOACAhBIAAwC8Q0NDw9ZsDoBLS0sNCYDm8ndyTJs2LZ566qmorq7WEHJOtu/rGhsb/YsHAJBQAmAAgHeor6+vbNWqVc9src8JYAByXWNjY8yYMSOefPLJqKys1BByVrbv6+rr66tMCQAgmQTAAADv0NDQkNVvmgXAAOSqdDods2bNismTJ8fGjRs1hJyX7fu6bN8XAwDw3gTAAADvUFdXV5XN9ZWWlkYqlYpMJmNYAOSETCYTr732Wjz++OOxatUqDaFZSKVSUVJSktU11tbWVpkUAEAyCYABAN5h27Ztm7K5vvz8/GjVqlXU1NQYFgCJlslkYvbs2fH4449HeXm5htCstGrVKvLz87O6xq1btzoBDACQUAJgAIB3qK6u3pztNZaVlQmAAUist4PfiRMnxpo1azSEZqmsrCzra9y2bVuVSQEAJJMAGADgHaqqqjZle43t2rWLtWvXGhYAiTNnzpyYNGlSLF26VDNo1tq1a5f1NW7atMkJYACALNbQWBgFjQ0REZFKRSavMJre/pkAGADgHSoqKqqyvcYkvDAEgHdasGBBTJgwId566y3NgITs5zZs2CAABgDIYoUFDf9MejMRqab0/+S+AmAAgHdYtWpV1r/oatu2rUEBkAgLFy6M8ePHx+LFizUD3iEJAfDq1aurTAoAIJkEwAAA77BgwYKsD4CdAAYg2y1fvjzGjRsX8+fP1wzYiST8Ql8S9sUAAOycABgA4B2eeOKJjZlMpimVSuVna41OAAOQrVauXBmPPPKI4Bc+QLb/Ql8mk2l64oknNpoUAEAyCYABAN6huro6vX379g1FRUVdsrVGJ4AByDZr166NCRMmxOzZsyOTyWgIJHw/t3379g3V1dVpkwIASCYBMADAu9TV1a0XAAPAB1u/fn089thjgl/Isf1cXV3delMCAEguATAAwLvU1dVVtGnTJmvrKykpiRYtWsT27dsNC4C9oqKiIiZOnBivvPJKNDU1aQh8BEVFRVFcXJz1+2GTAgBILgEwAMC7bN26dV2XLll7ADhSqVR07Ngx1qxZY1gA7FFVVVUxceLEeP755wW/8DF17NgxUqlU1u+HTQoAILkEwAAA71JVVZX1Jx46deokAAZgj9m8eXM8/vjj8cILL0RjY6OGwCfcx9kPAwCwOwmAAQDeZf369Vn/zbMkvDgEIPm2bNkSU6ZMiZkzZ0Z9fb2GwC7QsWNH+2EAAHYrATAAwLusXr066088JOHFIQDJVVNTE1OmTIlnnnlG8Au7WBJ+kW/VqlUCYACABBMAAwC8y9///ves/+aZABiA3aG2tjYmT54czz77bNTV1WkINNN93KuvvioABgBIMAEwAMC7PPzww+t//OMfN6RSqcJsrbFz584GBcAus3379pg+fXpMnTo1tm3bpiGwG2X7CeB0Ot3w8MMPC4ABABJMAAwA8C7V1dXpurq68latWu2TrTV26NAh8vLyIp1OGxgAH1tDQ0NMmzYtnnrqqaiurtYQ2M3y8vKiQ4cOWV1jfX39mtraWptMAIAEEwADAOxEbW3tmmwOgAsKCqJdu3axceNGwwLgI2tsbIwZM2bEk08+GZWVlRoCe0j79u2joCC7X8fV1NSUmxQAQLIJgAEAdmLz5s2r2rdvn9U1duvWTQAMwEeSTqdj1qxZMXnyZH+HwF7av2W7LVu2rDQpAIBkEwADAOzEpk2bVvfp0yera+zWrVvMmzfPsAD4QG8Hv1OmTIkNGzZoCOzF/Vu227BhwxqTAgBINgEwAMBOrFixYvWwYcOyusYkvEAEYO/KZDLx0ksvxZQpU6K83K2usLd17do162tctWrVKpMCAEg2ATAAwE7Mnz9/9ZgxY7K6xiS8QARg78hkMjF79uyYOHFirFnjMB9kiyT8At+8efP8oQEAkHACYACAnRg3btyab37zm5mISGVrjU4AA7Azc+bMiSeeeCKWLVumGZBlEvALfJlx48atNikAgGQTAAMA7MTrr79e29DQsKmwsLBDttZYXFwcZWVlsWXLFgMDIBYsWBDjx4+PJUuWaAZkobKysiguLs7qGhsaGjYuWLCgzrQAAJJNAAwA8B62bt26vF27dh2yucauXbsKgAGauYULF8b48eNj8eLFmgFZLAm3t2zbtm25SQEAJJ8AGADgPVRVVS1t167d0GyusWfPnrFw4ULDAmiGli1bFo899ljMnz9fMyABevbsmfU1VlZWLjUpAIDkEwADALyHdevWLevTp09W15iEF4kA7ForVqyIRx99VPALCZOEfdvatWuXmRQAQPIJgAEA3sPChQuXHX744VldY69evQwKoJlYtWpVjB8/PubOnRuZTEZDIGGSsG9buHDhMpMCAEg+ATAAwHuYNm3a0ksuuSSra+zevXvk5+dHU1OTgQHkqHXr1sX48eNj9uzZgl9IqIKCgkR8A/jpp59eZloAADmw/9QCAICde+ihhzbcd999W/Pz80uzdjNXUBBdunSJNWvWGBhAjqmoqIiJEyfGyy+/HOl0WkMgwbp27RoFBdn9Gq6xsbH6kUce2WBaAADJJwAGAHgf27ZtW15WVnZwNtfYq1cvATBADqmqqoqJEyfG888/74YHyBFJ+P7vtm3blpsUAEBuEAADALyPLVu2LMv2ALhnz57x0ksvGRZAwm3evDkef/zxeOGFF6KxsVFDIIck4fu/W7ZsWWpSAAC5QQAMAPA+1q9fvyzbT2z06NHDoAASbMuWLTFlypSYOXNm1NfXawjkoCTs19avX7/MpAAAcoMAGADgfSxYsGDh0KFDs7rGfffdN1KpVGQyGQMDSJCampqYMmVKPPPMM4JfyGGpVCr23XffrK9z/vz5C00LACA3CIABAN7Ho48++uYFF1yQ1TWWlJRE586dY926dQYGkAC1tbUxefLkePbZZ6Ourk5DIMd17do1WrVqlfV1/vnPf15kWgAAuUEADADwPiZNmlRVX1+/oaioqGM217nvvvsKgAGy3Pbt22P69OkxderU2LZtm4ZAM9GnT5+sr7G+vr7iySefrDItAIDcIAAGAPgAW7duXZTtAXCfPn3ipZdeMiyALNTQ0BDTpk2Lp556KqqrqzUEmpkkXP+8detWp38BAHKIABgA4ANUVFQs7NChw8hsrjEJLxYBmpvGxsaYMWNGPPnkk1FZWakh0EwlYZ9WUVHh+78AADlEAAwA8AGWLl266MADD8zqGnv16hUFBQXR2NhoYAB7WTqdjlmzZsWkSZNi06ZNGgLNWGFhYfTs2TMR+13TAgDIHQJgAIAPMHPmzEWnnnpqdm/qCgqiZ8+esWzZMgMD2EveDn4nT54cGzdu1BAg9tlnn8jPz0/CfnexaQEA5I48LQAAeH+//OUvV6bT6bpsr7NPnz6GBbAXZDKZePHFF+O73/1u3H///cJf4J+ScP1zOp2u++Uvf7nStAAAcocTwAAAH6C6ujpdXV29uE2bNodkc539+vWL6dOnGxjAHpLJZGL27NkxceLEWLNmjYYAO92fJWCvu7i6ujptWgAAuUMADADwIWzYsGFetgfA/fv3NyiAPeTVV1+NSZMmxapVqzQD2KlUKpWI/dmGDRvmmhYAQG4RAAMAfAiLFy9+o2/fvlldY1lZWXTu3DnWr19vYAC7yYIFC2L8+PGxZMkSzQDeV5cuXaK0tDQJ+9z5pgUAkFsEwAAAH8JTTz31+ujRo7O+zv33318ADLAbLFy4MMaPHx+LFy/WDOBD78uSYMqUKa+bFgBAbsnTAgCAD/aLX/xiTWNjY1W215mUF40ASbFs2bK4++674z/+4z+Ev8BHkoTv/zY0NFTee++9q00LACC3OAEMAPAhNDQ0ZDZv3jy/Q4cOI7O5TgEwwK6xYsWKePTRR2P+fDejArm7L9uyZYs/5AAAcpAAGADgQ1q3bl3WB8AdO3aMNm3axObNmw0M4GNYtWpVjB8/PubOnRuZTEZDgI+lbdu20aFDh0Tsb00LACD3CIABAD6kefPmzTvooIOyvs4DDzwwXnrpJQMD+AjWrVsX48ePj9mzZwt+gV2yH0uCuXPnzjMtAIDcIwAGAPiQ/vznP88/77zzsr7OAw44QAAM8CFVVFTEuHHjBL/ALt+PJcHDDz/sBDAAQA4SAAMAfEgTJ06srK2tXdGqVat9srnOgw8+2LAAPkBVVVVMnDgxnn/++WhqatIQYJdKwq0xNTU1yydNmlRlWgAAuUcADADwEWzYsOHvvXr1yuoAuG3bttG1a9dYu3atgQG8y+bNm+Pxxx+PF154IRobGzUE2OW6desWbdu2TcS+1rQAAHKTABgA4CNYuHDha7169Toj2+scMGCAABjgHbZs2RJTpkyJ5557LrZv364hwG6TlO//Lly48O+mBQCQmwTAAAAfwcSJE/9+wgknZH2dBx54YEyfPt3AgGavpqYmpkyZEs8880zU19drCLDbDRgwIBF1jh8//u+mBQCQmwTAAAAfwb333rv6Bz/4wfqioqLO2VznAQccEHl5eZFOpw0NaJZqa2tj8uTJ8eyzz0ZdXZ2GAHtEXl5e9O/fP+vrrK+vX3ffffeVmxgAQG4SAAMAfESVlZVzu3btmtXHgFu1ahX77LNPLFu2zMCAZqWuri6efvrpmDZtWmzbtk1DgD1qn332iVatWmV9nZs2bZpjWgAAuUsADADwES1dunR2tgfAERGDBg0SAAPNRkNDQ0ybNi2eeuqpqK6u1hBgr+2/kuCtt976m2kBAOQuATAAwEc0ffr0v48cOTLr6xw4cGBMmDDBwICc1tDQEM8991w8+eSTUVlZqSHAXt9/JcG0adP+bloAALlLAAwA8BH9x3/8x9JbbrmlOj8/v3U219mrV68oKyuLLVu2GBqQc9LpdMyaNSsmTZoUmzZt0hBgrysrK4tevXplfZ2NjY1b7rnnnmUmBgCQuwTAAAAfUW1tbXrDhg1/7dKly3HZXGcqlYqBAwfGrFmzDA3IGW8Hv5MnT46NGzdqCJA1Bg4cGKlUKuvr3Lhx4yu1tbVpEwMAyF0CYACAj+Gtt956JdsD4IgQAAM5I51Ox8svvxxTpkyJ8vJyDQGyct+VBIsWLXrFtAAAcpsAGADgYxg/fvwrRxxxRNbXedBBB0VBQUE0NjYaGpBImUwmZs+eHRMnTow1a9ZoCJCVCgoK4qCDDkpErY888ogAGAAgx+VpAQDAR/fjH/94ZX19/fpsr7OoqCj69etnYEAivfrqq3HHHXfEz3/+c+EvkNX69esXRUVFWV9nXV1d+b333rvaxAAAcpsTwAAAH9OGDRte6dGjx6ezvc5BgwbFggULDAxIjCVLlsSECRNi/vz5mgEkwuDBgxNR5/r1653+BQBoBgTAAAAf07x5815OQgA8bNiwePjhhyOTyRgakNXefPPNmDBhQixevFgzgMRIpVIxdOjQRNQ6d+7cl0wMACD3CYABAD6m++677+XRo0dnIiKVzXW2bds2evfuHcuWLTM0ICstW7YsHnvsMSd+gUTq06dPtG3bNgmlpu+9996/mhgAQO4TAAMAfEwTJ06s3Lp165LS0tK+2V7rkCFDBMBA1lmxYkU8+uijgl8g0YYMGZKIOqurqxc+/fTTm00MACD3CYABAD6B8vLyl/fff/+sD4AHDx4c48aNMzAgK6xcuTImTJgQc+fOdT09kHhJ+f7vmjVrfP8XAKCZEAADAHwCM2fOfG7//ff/fLbX2a1bt+jWrVuUl5cbGrDXrFu3LsaPHx+zZ88W/AI5oWfPntGlS5dE1DpjxoznTAwAoHkQAAMAfAK33Xbba5dcckl1fn5+62yvdciQIQJgYK9Yv359PPbYY4JfIOck5frnxsbGzbfddts8EwMAaB4EwAAAn0BlZWXThg0b/tqlS5fjsr3WQw89NCZNmmRowJ78MzKeeOKJeP7556OpqUlDgJxz6KGHJqLOioqKV6qrq9MmBgDQPAiAAQA+oXnz5s1MQgDcu3dv10ADe0RVVVVMnDgxXnjhhWhsbNQQICd17949evbsmZT9quufAQCakTwtAAD4ZP77v/97VkQk4kTFpz71KQMDdpstW7bEQw89FLfffns899xzwl8gpw0fPjwRdWYymfTdd9/9gokBADQfTgADAHxCkyZNqtqyZcuCsrKyg7K91uHDh8fjjz9uaMAuVVNTE1OmTIlnnnkm6uvrNQTIealUKg477LBE1Lply5bXp0+fvsXUAACaDwEwAMAusHz58lkDBw7M+gC4S5cu0atXr1i5cqWhAZ9YbW1tTJ48OZ599tmoq6vTEKDZ6N27d3Ts2DEx+1QTAwBoXgTAAAC7wLPPPvvCwIEDr0hCrcOGDRMAA59IXV1dPP300zFt2rTYtm2bhgDNzrBhwxJT61/+8pcXTQwAoHnxDWAAgF3g1ltvnV9fX782CbUefvjhkUqlDA34yBoaGmLq1Klx6623xuOPPy78BZqlJF3/XFdXt/rWW29dYGoAAM2LE8AAALtAQ0NDZs2aNc/16dPns9lea7t27aJPnz6xZMkSgwM+7J9xMW3atHjqqaeiurpaQ4Bmbb/99ou2bdsmotbVq1fPNDEAgOZHAAwAsIs8++yz05IQAEdEHHHEEQJg4AOl0+mYNWtWTJo0KTZt2qQhABFx5JFHJqbW6dOnTzMxAIDmxxXQAAC7yC233PJaQ0NDZRJqHT58eLRo0cLQgJ1Kp9Px3HPPxW233Rb333+/8Bdgh6KiovjUpz6ViFobGho23HLLLXNNDQCg+XECGABgF6murk6Xl5c/t88++5yR7bW2bNkyDj300Hj55ZcNDvindDodL7/8ckyZMiXKy8s1BOBdhgwZEkVFRYmodc2aNc/V1tamTQ0AoPkRAAMA7EIvvvjiM0kIgCMiRo4cKQAGIiIik8nE7NmzY+LEibFmzRoNAXif/VNSzJo161kTAwBongTAAAC70O233/7KOeecszU/P78022sdMGBAtG/f3tWu0My9+uqrMWnSpFi1apVmALyPjh07xgEHHJCIWhsbG6u/8Y1v/NXUAACaJwEwAMAutHLlyob169fP6tat2+hsrzWVSsXhhx8ekyZNMjhohubMmROTJ0+OJUuWaAbAh3D44YdHKpVKRK3r16+fVVFR0WhqAADNU54WAADsWq+++mpirts77LDDDAyamTfffDP+/d//PX7yk58IfwE+pFQqFSNGjEhMva+88sozpgYA0Hw5AQwAsIvddNNNz5166qnV+fn5rbO91m7dukX//v1j4cKFBgc5btmyZfHYY4/F/PnzNQPgIzrggAOic+fOiai1sbFxy4033jjL1AAAmi8BMADALrZy5cqG8vLyGT179vx0Euo9+uijBcCQw5YvXx7jxo0T/AJ8wv1SUpSXlz9TXl7eYGoAAM2XABgAYDeYMWPGUxdccEEiAuAhQ4ZE69ato7q62uAgh6xcuTImTJgQc+fOjUwmoyEAH1ObNm3i0EMPTUy9zz777FOmBgDQvPkGMADAbvDVr371lYaGhk1JqLWgoCCOOOIIQ4McsW7duvj5z38ed955Z8yZM0f4C/AJjRw5MvLz8xNRa0NDw8abbrrpVVMDAGjenAAGANgNKisrm1atWjW9T58+5ySh3qOPPjqefPJJQREk2Pr16+Oxxx6L2bNn+3cZYBdJpVIxatSoxNS7cuXKadXV1WmTAwBo3pwABgDYTaZNm5aY6/c6duwYAwYMMDRIoA0bNsSvf/3r+Nd//dd49dVXhb8Au9CAAQOiY8eOian36aefftLUAAAQAAMA7CZf+9rX5tTX11ckpd6jjjrK0CBBqqqq4v77749vf/vb8eKLL0ZTU5OmAOxiRx55ZGJqra+vX/eNb3zjdVMDAMAV0AAAu0ltbW16xYoVT++///6fT0K9hx56aLRt2zaqqqoMD7LYli1bYsqUKfHcc8/F9u3bNQRgN2nbtm0MGTIkMfUuX778qdraWtc/AwDgBDAAwO70xz/+cUJSas3Pz4/jjjvO0CBL1dTUxKOPPhq33XZb/OUvfxH+Auxmxx57bOTn5yel3Myvf/3rCaYGAECEABgAYLe66667llZXV89PSr1HH310tGjRwuAgi7wd/H7jG9+IqVOnRn19vaYA7GYtWrSIo48+OjH1btmy5Y177rlnhckBABDhCmgAgN3u9ddfn3T44YcPSEKtxcXFcdhhh8XMmTMNDvayurq6ePrpp2PatGmxbds2DQHYgw477LAoKSlJTL3z5s17wtQAAHibE8AAALvZ9773vanpdLohKfWecMIJkUqlDA72koaGhpg6dWrceuut8fjjjwt/AfawVCoVJ5xwQmLqTafT27/73e8+ZXIAALzNCWAAgN1s+vTpWyoqKmZ26dIlER/Y7d69e/Tv3z/efPNNw4M9qKGhIaZNmxZPPfVUVFdXawjAXnLAAQdE9+7dE1NvRUXFczNmzPAXBwAA/+QEMADAHjBr1qxEXcuXpFMvkHTpdDqee+65uP322+PRRx8V/gLsZccff3yi6p0xY8YkUwMA4J2cAAYA2AO++tWvvnT66adXFRYWtk1CvQMHDoyOHTvGhg0bDA92k3Q6HbNmzYrJkyfHxo0bNQQgC3Ts2DEGDhyYmHobGhoqb7755pdMDgCAd3ICGABgDygvL29YsWLF1MRsEvPy4sQTTzQ42A3S6XS8+OKL8Z3vfCfuv/9+4S9AFjnppJMiLy85r8tWrFgxpaKiotHkAAB4JwEwAMAe8qtf/erRiMgkpd6jjjoqysrKDA52kUwmE6+++mp873vfi1//+texdu1aTQHIImVlZXHUUUcl6q+W//7v//6zyQEA8G4CYACAPeQ///M/l1dWVv4tKfUWFhbGMcccY3CwC7wd/P785z+PNWvWaAhAFjruuOOioCA5X0urqqqa/dOf/nS1yQEA8G4CYACAPeill14al6R6jzvuuCgqKjI4+JjmzJkTd911V/z85z+P1au9owfIVkVFRYn7xbcXXnhhnMkBALAzBVoAALDnjB079pkFCxZUFhYWtktCvSUlJXHEEUfE9OnTDQ8+gjfffDPGjx8fb731lmYAJMCRRx4ZJSUliam3oaFh0zXXXPOsyQEAsDMCYACAPai8vLxh6dKlE/v3739xUmo+8cQT49lnn410Om2A8AEWLVoUjz32WCxevFgzABIiLy8vTjzxxETVvGTJkifKy8sbTA8AgJ3ucbUAAGDP+u1vfzsxIjJJqbdjx44xdOhQg4P3sXz58rj77rvjRz/6kfAXIGGGDRsWHTp0SFLJmd/85jePmxwAAO9FAAwAsIf953/+5/JNmza9kqSaTz/99EilUoYH77Jy5cr4yU9+Et///vdj/vz5GgKQMHl5eXHGGWckquZNmza9fM8996wwPQAA3osroAEA9oKXXnpp/KmnnnpYUurt2rVrDBkyJGbPnm14EBHr1q2L8ePHx+zZsyOTyWgIQEINHTo0OnfunKiaX3jhhQkmBwDA+xEAAwDsBZdffvkzS5YsWVdUVNQlKTWfccYZ8be//U3YRbO2fv36eOyxxwS/ADkglUrF6aefnqia6+rq1lx22WXTTQ8AgPcjAAYA2AsqKyub5s+f/8ihhx56dVJq7tatm1PANFsbNmyIxx9/PF555ZVoamrSEIAc8KlPfSq6du2aqJrfeOONcdXV1WnTAwDg/fgGMADAXvL1r399XDqdrktSzb4FTHNTVVUV999/f3z729+OF198UfgLkCNSqVR8+tOfTlTN6XS69pvf/OZjpgcAwAdxAhgAYC+ZMWNG9Zo1a/7Ss2fPxLx97N69ewwcODDmzJljgOS0LVu2xIQJE+KFF16IxsZGDQHIMYceemh069YtUTWvXr36qRkzZlSbHgAAH8QJYACAvejXv/71HyMiUR8SPeuss5wCJmdt27YtHn300bjtttviueeeE/4C5KC8vLwYM2ZM0srO/OpXv/qT6QEA8KH2vFoAALD3fP/733+rqqoqUR/V7dGjR3zqU58yPHJKfX19TJ06Nb71rW/F1KlTo76+XlMActSIESOiS5cuiap506ZNf73rrruWmh4AAB+GABgAYC975plnHkpazWeccUbk5dlKkjvmzZsXjz76aGzdulUzAHJYQUFBnH766Ymre9q0aQ+aHgAAH5a3dgAAe9nYsWNn1tfXr01SzZ07d47DDjvM8ACARBk5cmR06NAhUTXX1dWtHjt27POmBwDAhyUABgDYyyorK5tee+21Pyat7jPPPDMKCgoMEABIhBYtWiTy9O/s2bP/UF1dnTZBAAA+LAEwAEAWuOqqqyY0NjZWJanm9u3bx9FHH214AEAiHHfccdGmTZtE1dzQ0LDxiiuumGh6AAB8FAJgAIAssGDBgrqFCxc+lrS6R48eHYWFhQYIAGS1li1bxsknn5y4uhcuXDhu6dKl200QAICPQgAMAJAlvv71r/8pnU7XJqnmtm3bximnnGJ4AEBWO+2006K0tDRRNTc1NdV+7Wtfe8j0AAD4qATAAABZ4umnn968fPnyxF3xN3r06GjXrp0BAgBZqUOHDnH88ccnru5ly5ZNmD59+hYTBADgoxIAAwBkkbvvvvtPmUymKUk1FxYWxumnn254AEBWOvPMMxP3yYpMJtN41113/dH0AAD4OATAAABZ5Be/+MWatWvXTkta3UcccUT06tXLAAGArNK7d+847LDDEld3eXn5X+6///51JggAwMchAAYAyDIPP/zwn5JWcyqVijPPPNPwAICsMmbMmEilUomr+8EHH/yT6QEA8HEJgAEAsszXv/71NzZs2DAraXUPHDgwDj74YAMEALLCoEGDYsCAAYmru6KiYuatt966wAQBAPi4BMAAAFlo3Lhxv01i3WPGjIm8PFtMAGDvysvLizFjxiSy9j//+c+/NUEAAD7RflgLAACyz/XXXz+nqqrqr0mru1evXnHUUUcZIACwVx1zzDHRvXv3xNW9adOmV2666aa5JggAwCchAAYAyFJ/+tOf7k1i3WPGjInS0lIDBAD2ijZt2sRZZ52VyNofeOCBe00QAIBPSgAMAJClbrrpprlJPAVcXFwcZ555pgECAHvFWWedFS1btkxc3Zs2bXrl5ptvnmeCAAB8UgJgAIAsNm7cuF8lse5Ro0ZF7969DRAA2KP69OkTI0eOTGTtjz322K9MEACAXUEADACQxcaOHTu7qqrqb0mrO5VKxfnnnx+pVMoQAYA9tv/4/Oc/n8j9R2Vl5d+uueaav5kiAAC7ggAYACDLTZ069bdJrLtv374xZMgQAwQA9ojDDjsssTeQTJ48+TcmCADAriIABgDIcpdeeumLVVVVryax9s9//vNRXFxsiADAblVaWhrnn39+Imuvqqr66+WXX/6SKQIAsKsIgAEAEuChhx76WRLrLisri9NPP90AAYDd6qyzzoqSkpIklp753e9+91MTBABgVxIAAwAkwA033DB3w4YNs5JY+3HHHRd9+vQxRABgt+jbt28cddRRiay9oqJi1te//vU3TBEAgF1JAAwAkBA///nPfxoR6aTVnUql4vOf/3zk5dl6AgC7Vn5+flx00UWRSqWSWH76F7/4xX+bIgAAu5q3cAAACXHHHXe8tW7duulJrL13795xzDHHGCIAsEudcMIJ0b1790TWXl5e/pc77rjjLVMEAGBXEwADACTI3XfffW8mk2lKYu1nnXVWtG3b1hABgF2iQ4cOcfrppyey9kwm03T33Xf/3BQBANgdBMAAAAlyzz33rCgvL386ibW3bNkyzj33XEMEAHaJc889N1q0aJHI2tesWTP1xz/+8UpTBABgdxAAAwAkzA9/+MOfZzKZhiTWPnz48Bg0aJAhAgCfyKGHHhpDhw5NZO3pdLrhBz/4wS9MEQCA3UUADACQMPfee+/qRYsWPZDU+i+++OIoKSkxSADgY2ndunVcfPHFia1/4cKFf7jvvvvKTRIAgN1FAAwAkECXXXbZrxsaGjYlsfaysjJXQQMAH9u5554bpaWliay9oaFh4+WXX/47UwQAYHcSAAMAJNDs2bNrXn311V8ntf4jjjgiDj74YIMEAD6SwYMHx+GHH57Y+l955ZX7Zs+eXWOSAADsTgJgAICEOueccx6tqalZmtT6L7roomjZsqVBAgAfSsuWLeNzn/tcYuuvqalZMmbMmMdMEgCA3U0ADACQUJWVlU3Tpk37RVLrb9++fZx++ukGCQB8KGeccUa0b98+sfU/+eST91ZXV6dNEgCA3U0ADACQYOedd960qqqqV5Ja/wknnOAqaADgAx188MFx/PHHJ7b+TZs2vXzBBRc8a5IAAOwJAmAAgIT74x//eG9EZJJYeyqVigsuuMBV0ADAe2rZsmVccMEFkUqlkrqEzP333/8zkwQAYE8RAAMAJNzNN988b9WqVU8ktf6OHTsm+nt+AMDudcEFF0THjh0TW/+KFSse//rXv/6GSQIAsKcIgAEAcsCNN974k6ampq1JrX/kyJExdOhQgwQA/pdPfepTMWLEiMTW39TUVH3zzTf/t0kCALAnCYABAHLAxIkTK//+97//KslruPDCC6OsrMwwAYCIiGjTpk18/vOfT/QaZs+efd/EiRMrTRMAgD1JAAwAkCPOPvvsh2pqapYntf7S0tK46KKLDBIAiFQqFV/84hejtLQ0sWuoqal566yzznrYNAEA2NMEwAAAOaKioqJx0qRJP07yGgYPHhwjR440TABo5o444og46KCDEr2GJ5544qeVlZVNpgkAwJ4mAAYAyCGXXHLJzIqKihlJXsMFF1wQ3bp1M0wAaKZ69uyZ+KufKyoqZnzhC1+YZZoAAOwNAmAAgBzzb//2b/ek0+ntSa2/RYsWceWVV0ZhYaFhAkAzU1hYGF/60pcSvQ9Ip9Pb/+3f/u0e0wQAYG8RAAMA5Jh777139aJFix5M8hq6d+8eZ555pmECQDNzxhlnRPfu3RO9hsWLFz947733rjZNAAD2FgEwAEAO+uxnP/vL2traRL94PPHEE2Pw4MGGCQDNxKBBg+Kkk05K9Bpqa2tXn3vuub80TQAA9iYBMABADlq8eHH9uHHj/j3Ja0ilUnHJJZdE27ZtDRQAclybNm3ikksuiVQqleh1jBs37t8XL15cb6IAAOxNAmAAgBx1+eWXv1RRUTEjyWsoLS2NL3zhC4l/GQwAvLe3f+mrdevWiV5HRUXFM5dffvlLJgoAwN4mAAYAyGE33HDDXU1NTVuTvIaDDjrI94ABIId95jOfiUMOOSTRa2hqaqq+4YYbfmiaAABkAwEwAEAOGzdu3MbZs2cn/jt0p5xyiu8BA0AOOuSQQ+LTn/504tfx17/+9efjxo3baKIAAGQDATAAQI77zGc+81B1dfXCJK8hlUrFF7/4xejQoYOBAkCO6NixY3zpS19K/KceNm/ePO+00057xEQBAMgWAmAAgBxXXV2dfuCBB34UEekkr6O4uDguvfTSyMuzhQWApMvPz4/LLrssiouLk76U9P333/+ftbW1aVMFACBbeHsGANAMXH/99XMWLVr0YNLXsf/++8e5555roACQcOedd1707ds38etYuHDhH7/61a++bqIAAGQTATAAQDNxySWX/Lyurq486es4/vjjfQ8YABJs2LBhccwxxyR+HXV1dWsuvPDC+0wUAIBsIwAGAGgmXnvttdoHHnjguxGRSfI6UqlUfOlLX4oePXoYKgAkTO/evePSSy9N/Hd/IyLzwAMPfO/111+vNVUAALKNABgAoBm5+uqr/7Z06dJHk76OoqKiGDt2bJSWlhoqACRE69at46qrrorCwsLEr2X58uXjrr766r+ZKgAA2UgADADQzJx33nn/r66ubnXS19GhQ4e4/PLLIy/PlhYAsl1eXl5cfvnl0b59+8Svpb6+ft0ll1zyE1MFACBr999aAADQvLz++uu1Dz744Pcj4VdBR0QMGDAgzjrrLEMFgCw3ZsyYOPDAA3NiLY899tgPXnnllW2mCgBAthIAAwA0Q1/5ylf+umbNmqm5sJaTTz45Dj30UEMFgCw1ZMiQOOmkk3JiLWvXrv3LpZde+oKpAgCQzQTAAADN1GWXXfYf9fX1FUlfRyqViksvvTS6d+9uqACQZXr06BFf/OIXI5VKJX4tDQ0Nm6655pofmioAANlOAAwA0EzNmDGj+oEHHvhO5MBV0C1btozrr78+2rZta7AAkCXatWsX1113XbRs2TIXlpN56KGH/nXSpElVJgsAQLYTAAMANGNf+cpX/rpkyZI/58Ja2rZtG1dffXW0aNHCYAFgL2vRokVcffXVOfPLWUuXLn30iiuueNlkAQBIAgEwAEAzd+655/6ktrZ2eS6spXfv3jlzzSQAJNXbn2fYZ599cmI9tbW1y88555wfmywAAEkhAAYAaOYWLFhQ97Of/ezbmUymMRfWM2zYsDjllFMMFgD2kk9/+tMxdOjQnFhLJpNp/NnPfvbtBQsW1JksAABJIQAGACBuvfXWBfPnz78/V9Zz5plnxuDBgw0WAPaw4cOHx2c+85mcWc/8+fN/d+utty4wWQAAkkQADABARESMGTPmvpqamrdyYS2pVCouu+yy6Nmzp8ECwB7Su3fvuPjii3PmUwxbt25ddPrpp//aZAEASBoBMAAAERGxcuXKhh/+8Ie3pdPpnLjisGXLlvEv//Iv0aVLF8MFgN2sS5cucf3110dRUVFOrKepqanmu9/97jfKy8sbTBcAgKQRAAMA8E933XXX0ueff/6eXFlPaWlpXHvttVFWVma4ALCblJWVxXXXXRclJSU5s6aZM2fe/f/+3/9bZboAACSRABgAgP/l5JNPHldeXv50rqynU6dOMXbs2Jw5kQQA2aSoqCiuueaa6NixY86sqby8/MlTTz11gukCAJBUAmAAAP6PSy655K66urq1ubKefffdN6644orIy7P9BYBdJS8vL6688sro3bt3zqyprq6u/JJLLvmh6QIAkOi9uhYAAPBus2bNqn7ooYfujIh0rqxp4MCBcd555xkuAOwi559/fhxyyCG5tKT0gw8+eOesWbOqTRcAgCTLb3tQ9NzpjndbRG15oQ4BADRTEydOXDNmzJi8Tp06Dc2VNfXp0yfy8/PjzTffNGAA+ATOOuusOOmkk3JqTa+//vp9Z5555kTTBQAgCYq7N0Ze6c5/5gQwAADv6dRTT/31li1bXs+lNZ122mlx9NFHGy4AfEzHHntsnHrqqTm1pi1btrxx2mmn/cZ0AQDIBQJgAADeU0VFReONN974jcbGxqpcWtcFF1wQRx55pAEDwEd05JFHxuc+97mcWlNjY2PVzTff/I2KiopGEwYAIBcIgAEAeF9//OMf1z/yyCPfiRz6HnAqlYqLLroohgwZYsAA8CENHTo0LrrookilUrm0rPQjjzzynfvvv3+dCQMAkCsEwAAAfKBLL730hQULFvwupzbCeXnxpS99Kfbff38DBoAPcNBBB8WXvvSlyMvLrVdJCxYs+N2ll176ggkDAJBLBMAAAHwoo0eP/mVVVdXcXFpTYWFhfOUrX4kePXoYMAC8h169esUVV1wRBQUFObWuqqqqOaNHj/6lCQMAkGsEwAAAfCgVFRWNV1111S0NDQ0bcmldJSUlcfPNN8c+++xjyADwLr17946bbropiouLc2pdDQ0NG6666qqv++4vAAC5SAAMAMCHNmHChE3333//tzKZTDqX1lVcXBzXXXdddO/e3ZABYIfu3bvHtddeG61atcqpdWUymfT999//rQkTJmwyZQAAcpEAGACAj2Ts2LGz58+f/9tcW1fr1q3juuuuiw4dOhgyAM1ehw4d4rrrrovWrVvn3Nrmz5//m7Fjx842ZQAAcpUAGACAj+y44477xaZNm17MtXW1a9cubrzxxmjXrp0hA9BstW3bNmf/Pty4ceOLxx13nO/+AgCQ0wTAAAB8ZNXV1emLL774W3V1datzbW0dO3aMG2+8Mdq0aWPQADQ7ZWVlceONN0bHjh1zbm21tbWrL7zwwturq6vTJg0AQC7Lb3tQ9NzZD9LbImrLC3UIAICdWrZsWf327dtfOvbYY0/Ny8trkUtrKykpiaFDh8Zrr70WNTU1hg1As9ChQ4f42te+Fp06dcq5tTU1NW39zne+M/bBBx9cb9IAAOSC4u6NkVe6858JgAEA+NhefPHFzYcccsiyAQMGnBgRqZzaRBcXx5AhQ4TAADQLHTt2jJtuuik6dOiQi8tLjx8//ravfvWrc0waAIBc8X4BsCugAQD4RC688MIZb7zxxm9ycW3t27ePm266KSdPQgHA2zp16pTL4W+88cYbv77wwgufM2kAAJoLATAAAJ/YqFGjfrFhw4aZubi2t0Pgzp07GzQAOadz585x0003Rfv27XNyfRs2bJg5atSo+0waAIDmRAAMAMAnVltbm77sssu+V1dXtzoX19euXbu44YYbomPHjoYNQM7o0KFDXH/99dGuXbtc3Z+s/sIXvvDd2tratGkDANCc+AYwAAC7xJIlS+oj4pVRo0admpeX1yLX1ldcXBxDhw6NuXPnxrZt2wwcgETr0qVL3HjjjTl77XNTU1P1nXfeec0f/vCHdaYNAEAuer9vAAuAAQDYZWbNmlXVo0ePuYceeujoVCqVn2vra9WqVYwYMSIWLVoUlZWVBg5AIu23335x0003RVlZWU6uL51ON/z617++4fbbb3/TtAEAyFUCYAAA9phJkyatPeqoozbsu+++R+fi+goLC2P48OGxbNmy2LBhg4EDkCgDBgyIa6+9Nlq1apWza5w2bdq/XXLJJc+ZNgAAuez9AmDfAAYAYJc77bTTHn/rrbcezNX1FRUVxTXXXBNDhgwxbAASY8iQIXHNNddEUVFRzq5xwYIFvzv99NOfMG0AAJozATAAALvFEUcccc+GDRtm5ur6CgoK4sorr4wjjjjCsAFIwt/LceWVV0ZBQUHOrrG8vPypESNG/LdpAwDQ3AmAAQDYLaqrq9MXXXTRd2pra1fk7GY6Ly8uvvjiOPLIIw0cgKw1atSouPjiiyMvL3dfA23dunXxZz/72e83NDRkTBwAgObON4ABANhtli9fvr2mpuaFY4899uT8/PyWubjGVCoVgwYNikwmE4sWLTJ0ALLK6aefHueee26kUqmcXWN9fX3FDTfccM3UqVOrTBwAgObi/b4BLAAGAGC3evnll7cUFBS8cMQRR4zOy8trkYtrTKVSccABB0SnTp1i7ty5kck4fATA3lVYWBhXXHFFHHPMMTm9zsbGxuo777zzKz/72c9WmzoAAM2JABgAgL1qxowZlb169Xp98ODBJ6dSqfxcXWfPnj2jb9++8fe//z0aGxsNHoC9olWrVnH11VfHwIEDc3qd6XS64be//e2Nt9122wJTBwCguREAAwCw1z3xxBPlw4cPX9OvX79jIyJn76Hs2LFjDBw4MObMmRN1dXUGD8Ae1a5du7jxxhujT58+ub7U9JQpU779xS9+8XlTBwCgOXq/ADhPewAA2FPGjBkz9Y033vh1rq+zZ8+eceONN0bHjh0NHYA9pkuXLnHTTTdF9+7dc36tc+fO/eU555zzF1MHAID/SwAMAMAe9alPfernS5cufTjX19mlS5e49dZb48ADDzR0AHa7gQMHxje/+c3o1KlTzq/1rbfeemjEiBG/MnUAANg5ATAAAHvcsccee8/GjRtfyPV1FhcXx7XXXhsjRowwdAB2m8MPPzyuuuqqaNmyZc6vdePGjc8fffTR95g6AAC8NwEwAAB7XEVFReNxxx339crKyr/l+loLCgrisssui/PPPz9SqZThA7DLpFKpOP/88+PSSy+NgoKCnF/vpk2bXj7ssMNuqaysbDJ9AAB4bwJgAAD2isWLF9efddZZN1dXV7/ZHNZ7/PHHx5e//OUoKioyfAA+sRYtWsSXv/zlOP7445vFequrq98cM2bMN8rLyxtMHwAA3l9+24Oi585+kN4WUVteqEMAAOw2a9asaVi1atWs0aNHH1dQUNA619fbrVu3OOCAA2LevHlRX1/vAQDgYykrK4trrrkmDjrooGax3rq6uvKxY8de89RTT202fQAA+Ifi7o2RV7rznwmAAQDYq+bNm1ezevXqZ04++eTjCwoKSnN9ve3atYuRI0fG8uXLY+PGjR4AAD6S/v37x0033RRdu3ZtFuutr69fd9111335T3/6U4XpAwDA/xAAAwCQ1ebMmbMtlUq9fOSRR56Ul5eX83ckt2jRIkaMGBG1tbWxdOlSDwAAH8rxxx8fX/rSl5rN5wQaGxu33HXXXdf99Kc/XWn6AADwvwmAAQDIejNnzqzs2bPn64MHDz4plUrl5/p6U6lUHHLIIdGqVatYsGBBZDIZDwEAO5WXlxef/exn4/TTT49UKtUs1pxOp7f//ve//+o3vvGN1z0BAADwfwmAAQBIhEmTJpXvs88+8wYOHHhCKpUqaA5r3m+//WLAgAExd+5c3wUG4P8oKyuL6667LoYNG9Zs1pxOp7f/8Y9/vOmqq676qycAAAB2TgAMAEBiTJw4cc3BBx+85MADDzwulUrlNYc1t2/fPoYOHRqLFi2KLVu2eAgAiIiIffbZJ66//vro2bNns1lzJpNpnDBhwm1f/OIXn/cEAADAexMAAwCQKI8++ujy/fff/42DDjrohOZwHXRERHFxcRx11FHR2NgYb731locAoJkbPXp0XHHFFVFSUtJs1pxOpxsefvjhr15yySWzPAEAAPD+BMAAACTO+PHjVw0cOHDpAQcccGxzOQmcSqViwIAB0aVLl3jjjTeiqanJgwDQzBQVFcWll14aJ554YrP53m/EP07+Pv7447dffPHFMz0FAADwwQTAAAAk0iOPPLLs0EMPXbb//vs3mxA4IqJHjx4xZMiQePPNN2Pr1q0eBIBmonv37vEv//IvccABBzSrdWcymaYnnnji9s997nPPeAoAAODDEQADAJBYDz/88NJjjjlmY+/evY+KiGZzFKq0tDSGDx8eq1evjvXr13sQAHLcwIED45prrol27do1t6VnZsyY8YOzzjprqqcAAAA+PAEwAACJdv/99795zDHHVO6zzz5HRDMKgVu0aBGHHXZYtGzZMhYuXBjpdNrDAJBjCgoK4pxzzonzzz8/WrRo0dyWn37uuefuOuWUUyZ4EgAA4KMRAAMAkHi///3v5w8bNmxF3759j2lO10GnUqno27dvDB06NBYvXhxbtmzxMADkiJ49e8YNN9wQgwcPblbf+434x7XPU6ZM+fbpp58+2ZMAAAAfnQAYAICc8OCDDy4ZNmzYin79+jWrEDgionXr1nHEEUdEfX19LF261MMAkGCpVCpOOOGEuOKKK6JNmzbNbv07wt9vnXPOOX/xNAAAwMcjAAYAIGc89NBDS4YNG7a8X79+xza3EDg/Pz8OPvjg6NWrV8yfPz8aGho8EAAJU1JSEpdffnmccMIJkZ+f3+zWn8lkGp944olvffazn53maQAAgI9PAAwAQE556KGHlo4cOXJdnz59RqWa252ZEdG1a9cYNmxYLFu2LCorKz0QAAnRt2/fuO6662K//fZrluvPZDLpp59++rvnnHPO054GAAD4ZATAAADknD/96U+LDj300KX7779/s7sOOiKiuLg4jjzyyCgpKYk333wz0um0hwIgSxUUFMRnP/vZuPDCC6OkpKRZ9iCdTjc88sgjt5x//vnTPREAAPDJCYABAMhJDz/88NId3wQelUqlmt09mqlUKvr06RMHH3xwLFy4MLZt2+ahAMgynTt3jrFjx8bQoUOjGV5aERH/CH+feOKJ2y+88MLnPBEAALBrCIABAMhZDz300JIePXq8NmjQoGPz8vJaNMcetG3bNkaNGhVNTU2xZMkSDwVAFkilUjF69Oi48soro0OHDs22D01NTdt++9vf/stll132oqcCAAB2HQEwAAA5bdKkSeXdu3efM3jw4GYbAufn58eAAQOiV69esWDBgti+fbsHA2Avad26dVx66aVx/PHHR35+frPtQ2NjY/WvfvWrf7nuuute81QAAMCuJQAGACDnTZ48eW1jY+OMI4444uiCgoKS5tqHrl27xqhRo2Lbtm2xcuVKDwbAHpRKpWLUqFExduzY6NWrV7PuRX19/fo77rjjK9/61rcWejIAAGDXEwADANAsPP/881UbNmx45rjjjjuqsLCwrLn2obCwMAYNGhT77bdfLF68OGpraz0cALtZ+/bt44orrogTTzwxCgub9/uU2tralTfffPPVP/nJT1Z7MgAAYPcQAAMA0Gz87W9/27p27doZJ5xwwsjCwsK2zbkXnTp1ipEjR0Z1dbXTwAC70ciRI+Pqq6+OHj16NPte1NTULL/hhhuu/e1vf7vOkwEAALuPABgAgGbltdde2zpv3rynTznllKFFRUWdmnMvCgsL49BDD4399tsvFi1a5DQwwC709qnfk08+udmf+o2I2Lx587yLL774unHjxm30dAAAwO71fgFwat9zYsTOftC4LmLjq610DwCAxOrVq1fhs88++69du3Y9QTciGhoaYurUqTF58uRobGzUEICPqaCgIE499dQYPXq04HeH8vLyp4499tjvrly5skE3AABg9+swrDYKuuz8ZwJgAAByWuvWrfNeeumlm/fdd9+zdeMfVq9eHffff38sWbJEMwA+ov322y8uuugi1z2/w8KFC38/fPjwnzY0NGR0AwAA9gwBMAAAzd7zzz9/8aGHHnp1RKR0IyKTycTMmTPjz3/+c9TV1WkIwAcoKSmJ8847L0aMGBGplL9Kdki//PLL9xx77LEPagUAAOxZ7xcA+wYwAADNwn333Tfn+OOP39yrV6/DQwgcqVQqevfuHcOHD49169ZFRUWFhwTgPRxyyCExduzY6N+/v/B3h0wm0/jMM8/828knnzxONwAAYM97v28AC4ABAGg2fve7370xePDgJf369Ts6lUrl60hEcXFxjBgxInr06BFLly6N2tpaTQHYoUOHDvGFL3whzjzzzCguLtaQHZqammoeeOCBWz73uc9N1w0AANg7BMAAALDDww8/vKygoOC54cOHH1FQUFCqI//QrVu3OO6446K0tDQWL14cTU1NmgI0Wy1btoxzzjknLr300ujevbuGvENtbe2K22677arbbrvtDd0AAIC9RwAMAADv8Oyzz25avHjx0yeddNKQoqKiTjryD3l5edGnT58YOXJkbN26NVatWqUpQLNz+OGHx1e+8pUYMGBA5OXlacg7VFVV/e3CCy+8/oEHHvDdAAAA2MsEwAAA8C7z58+vefbZZ58+44wz+hcXF/fSkf/RsmXLGDJkSOyzzz6xdOnSqKmp0RQg53Xs2DG++MUvximnnBItW7bUkHdZt27dMyeffPI3Xn755W26AQAAe9/7BcCpfc+JETv7QeO6iI2vttI9AAByWmFhYer555//0sEHH3y5bvxfTU1N8fzzz8f48eOjurpaQ4Cc07p16zjzzDPjyCOPdOJ35zJ///vff3rMMcfc39DQkNEOAADIDh2G1UZBl53/TAAMAAARMWnSpM8cc8wxt6RSKdfg7ERNTU1MmTIlpk2bFg0NDRoCJF5hYWGccsopcdJJJ0VRUZGG7EQ6na6fOnXqd88555y/6AYAAGSX9wuAXQENAAAR8Yc//GHhfvvt98aAAQOOysvLkwS8S2FhYQwYMCCGDh0amzZtinXr1mkKkFiDBw+Oq666KoYOHRoFBQUashONjY1Vv//972/5whe+MEs3AAAg+/gGMAAAfAgTJkxYXV1dPf3II4/8VGFhYTsd+b9KS0vjsMMOi/79+8eaNWti8+bNmgIkRu/evePyyy+PU045JUpLSzXkPWzdunXxLbfccs33vve9hboBAADZyTeAAQDgI+jTp0+LJ5988us9evQ4TTfe3/z58+ORRx6JlStXagaQtXr16hXnnHNODBgwQDM+wKpVq5444YQTfrBy5Ur3/QMAQBbzDWAAAPgYnnnmmfOHDx9+fSqVytON95bJZGL27Nkxbty4qKio0BAga3Tu3DnOOuusGDp0aKRSKQ15/z/Lm2bNmvXDk08++THdAACA7OcbwAAA8DH85je/eX3//fd//cADDzzSd4HfWyqViu7du8cxxxwT7dq1i2XLlkV9fb3GAHtN27Zt49xzz42LL744evToIfz9AI2NjdUPPvjgLZ/97Gf/ohsAAJAMvgEMAAAf0/jx41dFxPOHHXbYiMLCwjIdeW95eXnRu3fvOOqoo6KgoCBWrlwZjY2NGgPsMcXFxXHKKafEl770pejbt2/k5bnA4YPU1tau+MEPfnD9LbfcMk83AAAgQf/94xvAAADwyQwePLjVo48++s1u3bqdpBsfTn19fTzzzDMxderU2LZtm4YAu01ZWVmceuqpceSRR0ZRkQsbPqyVK1c+/ulPf/pHixcvdm0DAAAkjG8AAwDALvLkk0+edeSRR96USqVcl/MhCYKB3eXtE7/HHnus4PcjyGQyDbNmzfoP3/sFAIDk8g1gAADYRX7/+98v6NGjx2uHHHLIyPz8fL8x+SEUFBREv3794qijjoq8vLxYtWqVq6GBT6Rly5ZxwgknxBVXXBEHHXRQFBQUaMqH1NDQsOG3v/3t1z7/+c8/oxsAAJBcroAGAIBd7Lzzzut4991339m2bdvBuvHR1NTUxLPPPhvTpk2LLVu2aAjwoZWVlcXxxx8fxxxzTBQXF2vIR1RVVfW3a6+99vZHHnlkg24AAECyuQIaAAB2g06dOhVMmzZtbN++fT8XESkd+WgaGhri+eefjyeffDI2bJBFAO/7522cdNJJccQRR0RhodvKPobMokWL/nTsscf+pLKyskk7AAAg+QTAAACwG/3hD38Ydfrpp99WUFDQRjc+unQ6Ha+++mpMnTo1Vq5cqSHAP/Xq1StOOeWUGDp0aOTl5WnIx9DY2Fg1YcKEOy666KKZugEAALlDAAwAALvZaaed1vbee+/9docOHUbqxse3fPnymDZtWrz88suRTqc1BJqhvLy8OOyww+L444+P3r17a8gnsHHjxue//OUvf3fSpElVugEAALlFAAwAAHtAYWFh6qmnnjpv+PDh16RSKXeUfgIbNmyIGTNmxHPPPRc1NTUaAs1AcXFxjBo1Ko4++ujo2LGjhnwCmUym4ZVXXvl/J5100kMNDQ0ZHQEAgNzzfgFwftuDoufOfpDeFlFb7p0VAAB8WOl0On7zm9+8Xlpa+uLgwYM/VVhYWKYrH09xcXEMGDAgjj322GjTpk2sXbs2amtrNQZyUIcOHeKMM86ISy+9NAYOHBjFxcWa8gnU1tau+slPfnLjxRdf/IybFAAAIHcVd2+MvNKd/8wJYAAA2A1OPPHENvfdd9+tnTp1Olo3PrnGxsb429/+Fs8++2wsWrRIQyAH9OvXL44++ugYNmxYFBQUaMguUFFR8cwXv/jFf5s+ffoW3QAAgNzmCmgAANhLHn744RNGjx799YKCgta6sWusX78+Zs6cGc8//3xUV1drCCRIaWlpHHnkkXHUUUdF586dNWQXaWxs3DJ16tS7PvvZz/5FNwAAoHkQAAMAwF50ySWXdP3+97//rXbt2g3VjV2nsbExXnvttXjuuedi/vz5GgJZbMCAATFq1KgYPHiw0767WFVV1atf//rXv/e73/1urW4AAEDzIQAGAIC9rF27dvlTp0699OCDD740lUrl68iutXz58nj++efj5ZdfjpqaGg2BLFBSUhLDhw+PI444Inr37q0hu1gmk2mcN2/efSeeeOJvq6urfewXAACaGQEwAABkia9//ev73Xjjjf9aWlraXzd2vXQ6HW+++WY899xz8dprr0VjY6OmwB5UUFAQgwcPjlGjRsUBBxwQeXl5mrIbVFdXL/zP//zPf/3BD36wRDcAAKB5EgADAEAWOfjgg1v9+c9/vrZ3795jIiKlI7tHZWVlvPjii/HCCy/EunXrNAR2o65du8bIkSPj8MMPj7Zt22rI7pNZunTpn88888z/t3jx4nrtAACA5ksADAAAWejuu+8eePHFF9/WqlUrd6PuZuXl5fHqq6/GSy+9FOvXr9cQ2AU6d+4cI0aMiGHDhkW3bt00ZDerqalZ9tvf/vbOm266aa5uAAAAAmAAAMhS/fr1K3r44Ycv79+//4WpVMpdqXvA8uXL46WXXoqXX345qqurNQQ+grKyshg+fHiMGDHCd333kEwmk164cOEfzj777F8sXbp0u44AAAARAmAAAMh6P/3pT4d97nOf+2bLli176Mae0dDQEHPnzo2//vWvMXfu3Ni+Xa4CO9OyZcsYNGhQDBs2LA455JAoKCjQlD2ktrZ21R//+Mc7rr322r/rBgAA8E4CYAAASIA+ffq0ePTRR69wGnjPS6fTsXTp0nj11VedDIaIaNu2bQwbNiyGDRsWffr0ibw8fyTtSZlMpuG11177+ZlnnvmnioqKRh0BAADeTQAMAAAJ8uMf//jQCy644JutWrXaRzf2vLdPBs+ePTvmzp0bdXV1mkKzUFZWFoMHD45hw4ZF//79Iz8/X1P2gpqammX333//nTfccINv/QIAAO9JAAwAAAnTrl27/HHjxp37qU996qq8vDwb870kk8nEihUrYu7cuTFnzpxYsWJFZDIZjSEnpFKp6Nu3bwwbNiwGDRoUHTt21JS9qKmpqfbVV1/92ZgxY/5cWVnZpCMAAMD7EQADAEBCffnLX+5x++23f7V9+/aH68bet2XLlnjjjTdizpw5MW/evKivr9cUEqVly5Zx8MEHx6BBg+KQQw6J0tJSTckCGzdufPG73/3uv//iF79YoxsAAMCHIQAGAIAEKywsTE2cOPGMkSNHXlNQUNBaR7JDXV1dvPnmm/HGG2/EG2+8EevXr9cUslKXLl3ioIMOioMOOigOOOCAKCoq0pQs0djYuGXmzJk/PvPMMyc2NDS4XgAAAPjQBMAAAJADjjzyyNY/+9nPrujbt++5EZGnI9mluro6Fi5cGPPnz4958+ZFZWWlprBXtGvXLg455JAYMGBA9O/fP1q39nsjWSj91ltv/fmqq676xaxZs6q1AwAA+KgEwAAAkEN++ctfjhgzZsyNrVq16q0b2SmdTsfKlStj0aJFsXDhwli8eHFs27ZNY9gtSkpKol+/ftG/f//Yf//9o1evXpGX53dEslVNTc3yRx999EdXXnnlK7oBAAB8XAJgAADIMd26dSt8+OGHPzd48ODL8vPzbdyzXCaTiTVr1sTChQtj0aJFsWjRotiyZYvG8LGUlZVF//79/xn6du/ePVKplMZkuaampprXXnvtV2PGjHmgoqKiUUcAAIBPQgAMAAA56rjjjiv7r//6r8tdC508mzdvjuXLl8eKFSti+fLlsXjx4qipqdEY/pfi4uLo169f9O7dO/bZZ5/Yd999o6ysTGMSJJPJpJcsWfLn66677pfTp0/3mx8AAMAuIQAGAIAc99Of/nTIueeee3NpaWlf3UimxsbGWLlyZSxdujSWLVsWy5cvj3Xr1kUmk9GcZiKVSkWXLl1in332iT59+kSfPn2iV69eUVBQoDkJtXXr1sUPPvjgj6699tq/6wYAALArCYABAKAZaNeuXf64cePOGTp06BUFBQWtdST56uvrY+XKlf88KbxixYpYu3ZtpNNpzUm4vLy86Nq1a+yzzz7//KdXr17RsmVLzckBjY2NW/7617/+4pxzznm0srKySUcAAIBdTQAMAADNyIknntjmnnvuuXzfffcdk0qlHB3MMdu3b481a9bEmjVrYu3atbF27dooLy+PDRs2CIazUF5eXnTs2DG6desWXbt2jW7dukW3bt2iR48eUVhYqEE5JpPJNC5ZsuRR1z0DAAC7mwAYAACaoa9+9av7Xnfdddd16NDhCN3IfY2Njf8MhNetWxfr1q2LioqKWLduXWzbtk2DdrPS0tLo3LnzP//p0qVLdO3aNbp27eoK52Ziw4YNM//rv/7rxz/60Y+W6wYAALC7CYABAKAZ++UvfznirLPOuq64uNj3gZupmpqaWL9+/T//qaioiMrKyqisrIxNmzZFY2OjJn2AgoKCaN++fbRr1y7at28fHTt2jC5dukSnTp2ic+fOUVxcrEnN1NatW98aP378PVdcccXLugEAAOwpAmAAAGjm2rVrl//ggw+eOWLEiCsLCwvb6gjvtHnz5n+GwZs2bYrKysqorq6OLVu2xJYtW6K6ujqqq6sjk8nk3NpTqVS0bt06WrduHWVlZdGmTZsoLS39X2Fvu3btok2bNh4U/peGhobKl1566efnnHPO+OrqavevAwAAe5QAGAAAiIiIoUOHFt97770XHHjggRfk5+c7ssiHlk6n/xkEV1dXR01Nzfv+k8lkora2NtLpdNTX10dTU1PU1dXt0u8U5+XlRcuWLSM/Pz+KiooiLy8vWrVqFalUKoqLi3f6T0lJSbRq1eqfgW9paWnk5eUZMB9aU1NTzYIFC/745S9/+Y+zZ8+u0REAAGBvEAADAAD/y2mnndb2rrvuurRPnz5n5+XlFeoIe9LbgfDbtm/f/r7XUBcUFESLFi3++b/fDnxhT8pkMg1LliwZd8stt/xq0qRJVToCAADsTQJgAABgp0477bS2d95554X777//5wTBAP9XJpNpWLhw4QO33nrrHwS/AABAtni/ADi/7UHRc2c/SG+LqC33/gcAAHLZokWL6u69995X0un0swcddFCnkpKS3roC8A8VFRUz/7//7/+77aKLLpq6aNGiOh0BAACyRXH3xsgr3fnPBMAAAEDMnDmz8u67736qqalpWr9+/Ypbt27dN5VKpXQGaG4ymUx6zZo1U+65555/Peeccx6cOXNmpa4AAADZRgAMAAB8KDNnzqz88Y9//Gw6nZ4uCAaak7eD37vvvvtfzz///McEvwAAQDYTAAMAAB+JIBhoLgS/AABAEgmAAQCAj+XtILisrOyFvn37diwuLu4VEYJgIBdkKioqnrv33nu/PWbMmEcEvwAAQJK8XwCc2vecGLGzHzSui9j4aivdAwAA/unqq6/u8ZWvfOX8Pn36nJWXl9dCR4CkSafT9UuXLh3/X//1Xw/84he/WKMjAABAEnUYVhsFXXb+MwEwAADwkZ1xxhntb7/99rMPPPDA8/Pz81vrCJDtmpqaqhcsWPDgd77znUcmTpzotC8AAJBoAmAAAGC3GD58eMkPf/jDzwwePPjioqKijjoCZJv6+voNr7322u9vvPHGx2fPnl2jIwAAQC4QAAMAALvV0KFDi++5556zDjnkkPOKioq66giwt9XV1a19/fXXH7z++uvHC34BAIBcIwAGAAD2iFatWuXdc889w0455ZTzO3bseJSOAHtYZsOGDbOmTJny4PXXX/9qbW1tWksAAIBcJAAGAAD2uH/913/tf/7555/dq1ev0/Ly8lroCLC7pNPp+pUrV05+4IEHHvnOd76zSEcAAIBcJwAGAAD2mjPOOKP97bfffvYBBxzw2YKCgjY6AuwqjY2NVW+++eafv/e97z06YcKETToCAAA0FwJgAABgrxs+fHjJ97///dGDBg0aU1paur+OAB9XdXX1wtdee+3Rr371q1Nfe+21Wh0BAACaGwEwAACQVb761a/ue8EFF3y6b9++ZxUUFLTWEeCDNDY2bnnrrbfG/+EPf5j4ox/9aLmOAAAAzZkAGAAAyEpDhw4t/sEPfnDy4MGDz27dunV/HQHerbq6+s2XX375weuuu+7ppUuXbtcRAAAAATAAAJDlCgsLU3ffffeQ0aNHn9G1a9fj8vLyinQFmq90Ol1XXl4+bcqUKROuvfbav+sIAADA/yYABgAAEqNPnz4t/v3f/33UyJEjz2rfvv2nIiKlK9AsZDZt2vTXF1544bGvfe1rzzntCwAA8N4EwAAAQCJddNFFXa6++uqTDzzwwLNbtmzZTUcg99TV1a1ZsGDBuJ/+9KdP3n///et0BAAA4IMJgAEAgETr1q1b4d13333k4YcffmqHDh2OyMvLK9QVSK50Ot2wcePGWbNmzZp8/fXXz6qoqGjUFQAAgA9PAAwAAOSMo48+uvWtt956/CGHHHJKu3btBkdEnq5AIqQrKytfmzdv3uQ777xz+owZM6q1BAAA4OMRAAMAADnpuOOOK/vGN75x/CGHHHJa27ZtB4bvBUO2yVRVVc2dN2/epO9///vTpk+fvkVLAAAAPjkBMAAAkPNuu+22vmedddZJffr0Oa5Vq1a9dQT2ntra2uXLly+f/uijjz51xx13vKUjAAAAu5YAGAAAaFa+9KUvdbv44ouP7t+//wlOBsMekamqqpq7cOHCv/z+97+fcd9995VrCQAAwO4jAAYAAJqtSy65pOtll112jDAYdrl0VVXVvIULF/7lV7/61bO/+93v1moJAADAniEABgAAiIirr766x/nnnz9q//33P7JNmzZDUqlUga7Ah5fJZBoqKyv/vnjx4uf+9Kc/zbr33ntX6woAAMCeJwAGAAB4l379+hV97WtfGzRy5MhRPXv2PLaoqKizrsD/VV9fv37VqlXPvPDCC8/9+7//+5zFixfX6woAAMDeJQAGAAB4H61bt8678847Bx599NFHde/efURpaen+4apomq/M1q1bF69Zs+bF5557btY3v/nNOdXV1WltAQAAyB4CYAAAgI9g8ODBrcaOHXvI8OHDD+vevfvw1q1bHxACYXJXprq6+s01a9a88sorr7z8k5/8ZN5rr71Wqy0AAADZSwAMAADwCVx//fX7nHHGGYf169dvePv27Yfm5+e31hWSrLGxsXrjxo2vvvXWWy+PHz/+lR//+McrdQUAACA5BMAAAAC70Je//OUe55xzzvA+ffoM7tix45CioqKuukI2q6+vX7t27doXFy9ePGfixImv3Xvvvat1BQAAILkEwAAAALvRl7/85R6f+cxnBvfr129Qly5dDm/ZsqVAmL2qrq5u7bp16wS+AAAAOUoADAAAsIe0atUq75prrtnn2GOPPXi//fY7uH379oeUlpb2TaVS+brDbpKuqalZtnHjxnlvvfXW3GeffXbef/3Xfy2vra1Naw0AAEBuEgADAADsRQceeGDLq6+++oAhQ4Yc3LNnz4Pbtm17sGuj+biampqqq6qqXi8vL583Z86ceb/85S/nvfjii1t1BgAAoPkQAAMAAGSZoUOHFn/xi1/cf9CgQQf26NHjwHbt2h3YqlWr3qlUKk932CFdU1OzvLKycsHq1asXzJkzZ8Gf//znJTNmzKjWGgAAgOZNAAwAAJAAxx13XNkFF1xw4MEHH3xA165dDywtLd23pKRkn1QqVag7uS2TyTRs27ZtRXV19dJ169YtfOONNxZOmDBh4YQJEzbpDgAAAO8mAAYAAEiw8847r+OJJ57Yp3///vt16dKlT5s2bfZr3bp1v/z8/GLdSZampqaa6urqxZs3b16ybt26pQsXLlzy9NNPL33ooYc26A4AAAAflgAYAAAgx7Rr1y7/kksu6TFkyJCe++67b89OnTr1Kisr61VcXNyzZcuW3VKpVL4u7R2ZTKaprq6uvKamZtWWLVtWVlRUrFy6dOnK2bNnr7r//vvXVFZWNukSAAAAn4QAGAAAoBnp1KlTwec+97luQ4cO7bnPPvv0aNeuXafWrVt3Li4u7tqyZcvORUVFnfLy8lro1MeTTqe319fXr6+rq6uoqalZW11dvb6ysnL9ihUrVr/66qurHnzwwbUVFRWNOgUAAMDuIgAGAADgfznjjDPaH3bYYZ369OnTuUuXLp3Kysral5SUtC0uLu5YVFTUrqioqG2LFi065OfnlzaXnjQ1NW3dvn37xvr6+qr6+vrKmpqaDdu2bavasmXLpnXr1lUsXbp0/Ysvvrh+4sSJlZ4gAAAA9iYBMAAAAB9Lr169CkeNGtXuoIMOatexY8ey9u3bl7Zp06Z1SUlJWXFxcetWrVq1btGiRVlRUVHrwsLC1hGRX1hYWBoR+QUFBSV5eXkFeXl5u/0/LtPpdG06nW5sbGzcFhFNDQ0NW3f83+r6+vrq7du3b6mtra2uqamp3rZtW/XmzZurN23aVL1hw4YtCxYsqJo1a1bl0qVLt5s4AAAASSAABgAAYK/q169fUffu3Vvss88+xSUlJQVv//8LCwtT3bp1+8BTxuXl5VsbGhoyb//vbdu2Na5YsaJmzZo12xcvXlyvwwAAADQn7xcAF2gPAAAAu9vixYvrdwS11boBAAAAu0+eFgAAAAAAAADkBgEwAAAAAAAAQI4QAAMAAAAAAADkCAEwAAAAAAAAQI4QAAMAAAAAAADkCAEwAAAAAAAAQI4QAAMAAAAAAADkCAEwAAAAAAAAQI4QAAMAAAAAAADkCAEwAAAAAAAAQI4QAAMAAAAAAADkCAEwAAAAAAAAQI4QAAMAAAAAAADkCAEwAAAAAAAAQI4o0AIAAAAAAACA5GhoLIyCxoaIiEilIpNXGE1v/0wADAAAAAAAAJAghQUN/0x6MxGppvT/5L6ugAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAAYAAAAAAADIEQJgAAAAAAAAgBwhAIb/v5272ZHiusM4/FZ1NUkz9sQwOF4EyZJtpJCwysa5jSy4n1xPEqRIuQFvvfGSgIwBOzGRQAQERnx0d1UW0cgWGvKxsMGvnmfVdc7/1OJsf+oCAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoIQADAAAAAAAAlBCAAQAAAAAAAEoIwAAAAAAAAAAlBGAAAAAAAACAEgIwAAAAAAAAQAkBGAAAAAAAAKCEAAwAAAAAAABQQgAGAAAAAAAAKCEAAwAAAAAAAJQQgAEAAAAAAABKCMAAAAAAAAAAJQRgAAAAAAAAgBICMAAAAAAAAEAJARgAAAAAAACghAAMAAAAAAAAUEIABgAAAAAAACghAAMAAAAAAACUEIABAAAAAAAASgjAAAAAAAAAACUEYAAAAAAAAIASAjAAAAAAAABACQEYAAAAAAAAoIQADAAAAAAAAFBCAAYAAAAAAAAoMY3JP//9K8My551lzpAk293a7QAAAAAAAAD8iIw3r+SL7TpPxuSt4/ibJJuz20QDBgAAAAAAAHhzrJPp6NvHYcyyjLl7dJTPbl/Jp6sPLufSsM+5ec7q5YOrF0OeP/SVaAAAAAAAAIA3weH7u6zfm79dWDIMSw6225w785vsx3XyzasOby5ssz69c4sAAAAAAAAAr9n69C6bC9sT93a7rKdnORin5Otxynzi1JQcfiwCAwAAAAAAALxO69O7HH68TaaT98cp85R8vbp3Nfszv8q0LHn7xMF1sjk/ZzUPmZ/MmWefhAYAAAAAAAD4oayPdjn7223Gn7x6ZrXPnetX8mBKkpv3cufDd/Pufn5FL56SzcVtNheT3dNt8tQlAwAAAAAAAHyv1sm0ySv/9XtsNWZ3I/lHkgzHi7/4XY7WYz5yiwAAAAAAAAA/Ivtcv/3nPEyS1fHa42t5+vNLyX7JoRsCAAAAAAAAePPt1/nbV3/KvePn1Xc371/NYxEYAAAAAAAA4M0yTHk2rvNo2WdzvHZqzN9v/SF3vju3evng/at5fPDLPDu1yuGyZHSVAAAAAAAAAK/XOGe4ueSvZ4e8M8xZbVe5ceuPufvy3Oqkw4+v5emDX+fuuTlLhhwsEYIBAAAAAAAAXpclGR8OuXP0TR4cPM/9z/+SRyfNDf/1TZezOp/87KdjzizJZkhO7edMy/w/nAUAAAAAAADg/zaMWcZkP8/ZLsmLacr2/MV8+cnvs/tP5/4FmLjAq1ifcioAAAAASUVORK5CYII=";function H0($,q,Q){if(typeof $==="string"&&!isNaN(Number($)))$=Number($);if(typeof $==="number"&&$<100)return v0($);if(typeof $==="number"&&$>=100)return $;if(typeof $==="string"&&$.includes("%")){if(q&&q==="X")return Math.round(parseFloat($)/100*Q.width);if(q&&q==="Y")return Math.round(parseFloat($)/100*Q.height);return Math.round(parseFloat($)/100*Q.width)}return 0}function Y5($){return $.replace(/[xy]/g,function(q){let Q=Math.random()*16|0;return(q==="x"?Q:Q&3|8).toString(16)})}function k0($){if(typeof $>"u"||$==null)return"";return $.toString().replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function v0($){if(typeof $==="number"&&$>100)return $;if(typeof $==="string")$=Number($.replace(/in*/gi,""));return Math.round(L0*$)}function Y0($){let q=Number($)||0;return isNaN(q)?0:Math.round(q*w8)}function S1($){return $=$||0,Math.round(($>360?$-360:$)*60000)}function j7($){let q=$.toString(16);return q.length===1?"0"+q:q}function g7($,q,Q){return(j7($)+j7(q)+j7(Q)).toUpperCase()}function R0($,q){let Q=($||"").replace("#","");if(!C7.test(Q)&&Q!==G2.background1&&Q!==G2.background2&&Q!==G2.text1&&Q!==G2.text2&&Q!==G2.accent1&&Q!==G2.accent2&&Q!==G2.accent3&&Q!==G2.accent4&&Q!==G2.accent5&&Q!==G2.accent6)console.warn(`"${Q}" is not a valid scheme color or hex RGB! "${Q2}" used instead. Only provide 6-digit RGB or 'pptx.SchemeColor' values!`),Q=Q2;let K=C7.test(Q)?"srgbClr":"schemeClr",J='val="'+(C7.test(Q)?Q.toUpperCase():Q)+'"';return q?`${q}`:``}function AB($,q){let Q="",K=Object.assign(Object.assign({},q),$),J=Math.round(K.size*w8),Z=K.color,G=Math.round(K.opacity*1e5);return Q+=``,Q+=R0(Z,``),Q+="",Q}function B2($){let q="solid",Q="",K="",J="";if($){if(typeof $==="string")Q=$;else{if($.type)q=$.type;if($.color)Q=$.color;if($.alpha)K+=``;if($.transparency)K+=``}switch(q){case"solid":J+=`${R0(Q,K)}`;break;default:J+="";break}}return J}function a2($){return $._rels.length+$._relsChart.length+$._relsMedia.length+1}function c7($){if(!$||typeof $!=="object")return;if($.type!=="outer"&&$.type!=="inner"&&$.type!=="none")console.warn("Warning: shadow.type options are `outer`, `inner` or `none`."),$.type="outer";if($.angle){if(isNaN(Number($.angle))||$.angle<0||$.angle>359)console.warn("Warning: shadow.angle can only be 0-359"),$.angle=270;$.angle=Math.round(Number($.angle))}if($.opacity){if(isNaN(Number($.opacity))||$.opacity<0||$.opacity>1)console.warn("Warning: shadow.opacity can only be 0-1"),$.opacity=0.75;$.opacity=Number($.opacity)}if($.color){if($.color.startsWith("#"))console.warn('Warning: shadow.color should not include hash (#) character, , e.g. "FF0000"'),$.color=$.color.replace("#","")}return $}function XB($,q,Q){var K,J;let Z=2.3+(((K=$.options)===null||K===void 0?void 0:K.autoPageCharWeight)?$.options.autoPageCharWeight:0),G=Math.floor(q/w8*L0)/((((J=$.options)===null||J===void 0?void 0:J.fontSize)?$.options.fontSize:k2)/Z),W=[],B=[],V=[],U=[];if($.text&&$.text.toString().trim().length===0)B.push({_type:D0.tablecell,text:" "});else if(typeof $.text==="number"||typeof $.text==="string")B.push({_type:D0.tablecell,text:($.text||"").toString().trim()});else if(Array.isArray($.text))B=$.text;let w=[];return B.forEach((F)=>{var M;if(typeof F.text==="string"){if(F.text.split(` `).length>1)F.text.split(` -`).forEach((k)=>{w.push({_type:D0.tablecell,text:k,options:Object.assign(Object.assign({},F.options),{breakLine:!0})})});else w.push({_type:D0.tablecell,text:F.text.trim(),options:F.options});if((M=F.options)===null||M===void 0?void 0:M.breakLine)V.push(w),w=[]}if(w.length>0)V.push(w),w=[]}),V.forEach((F)=>{F.forEach((M)=>{let k=[],L=String(M.text).split(" ");L.forEach((D,z)=>{let N=Object.assign({},M.options);if(N===null||N===void 0?void 0:N.breakLine)N.breakLine=z+1===L.length;k.push({_type:D0.tablecell,text:D+(z+1{let M=[],k="";if(F.forEach((f)=>{if(k.length+f.text.length>G)W.push(M),M=[],k="";M.push(f),k+=f.text.toString()}),M.length>0)W.push(M)}),W}function ZJ($=[],q={},Q,K){let J=M8,Z=L0*1,G=L0*1,W=0,B=0,V=[],U=H0(q.x,"X",Q),w=H0(q.y,"Y",Q),F=H0(q.w,"X",Q),M=H0(q.h,"Y",Q),k=F;function f(){let D=0;if(V.length===0)D=w||v0(J[0]);if(V.length>0)D=v0(q.autoPageSlideStartY||q.newSlideStartY||J[0]);if(G=(M||Q.height)-D-v0(J[2]),V.length>1){if(typeof q.autoPageSlideStartY==="number")G=(M||Q.height)-v0(q.autoPageSlideStartY+J[2]);else if(typeof q.newSlideStartY==="number")G=(M||Q.height)-v0(q.newSlideStartY+J[2]);else if(w){if(G=(M||Q.height)-v0((w/L0{if(!z)z={_type:D0.tablecell};let N=z.options||null;B+=Number((N===null||N===void 0?void 0:N.colspan)?N.colspan:1)}),q.verbose)console.log(`| numCols ......................................... = ${B}`);if(!F&&q.colW){if(k=Array.isArray(q.colW)?q.colW.reduce((D,z)=>D+z)*L0:q.colW*B||0,q.verbose)console.log(`| tableCalcW ...................................... = ${k/L0}`)}if(Z=k||v0((U?U/L0:J[1])+J[3]),q.verbose)console.log(`| emuSlideTabW .................................... = ${(Z/L0).toFixed(1)}`);if(!q.colW||!Array.isArray(q.colW))if(q.colW&&!isNaN(Number(q.colW))){let D=[];($[0]||[]).forEach(()=>D.push(q.colW)),q.colW=[],D.forEach((N)=>{if(Array.isArray(q.colW))q.colW.push(N)})}else{q.colW=[];for(let D=0;D{let N=[],H=0,v=0,j=[];if(D.forEach((X)=>{var P,g,c,h;if(j.push({_type:D0.tablecell,text:[],options:X.options}),X.options.margin&&X.options.margin[0]>=1){if(((P=X.options)===null||P===void 0?void 0:P.margin)&&X.options.margin[0]&&Y0(X.options.margin[0])>H)H=Y0(X.options.margin[0]);else if((q===null||q===void 0?void 0:q.margin)&&q.margin[0]&&Y0(q.margin[0])>H)H=Y0(q.margin[0]);if(((g=X.options)===null||g===void 0?void 0:g.margin)&&X.options.margin[2]&&Y0(X.options.margin[2])>v)v=Y0(X.options.margin[2]);else if((q===null||q===void 0?void 0:q.margin)&&q.margin[2]&&Y0(q.margin[2])>v)v=Y0(q.margin[2])}else{if(((c=X.options)===null||c===void 0?void 0:c.margin)&&X.options.margin[0]&&v0(X.options.margin[0])>H)H=v0(X.options.margin[0]);else if((q===null||q===void 0?void 0:q.margin)&&q.margin[0]&&v0(q.margin[0])>H)H=v0(q.margin[0]);if(((h=X.options)===null||h===void 0?void 0:h.margin)&&X.options.margin[2]&&v0(X.options.margin[2])>v)v=v0(X.options.margin[2]);else if((q===null||q===void 0?void 0:q.margin)&&q.margin[2]&&v0(q.margin[2])>v)v=v0(q.margin[2])}}),f(),W+=H+v,q.verbose&&z===0)console.log(`| SLIDE [${V.length}]: emuSlideTabH ...... = ${(G/L0).toFixed(1)} `);if(D.forEach((X,P)=>{var g;let c={_type:D0.tablecell,_lines:null,_lineHeight:v0((((g=X.options)===null||g===void 0?void 0:g.fontSize)?X.options.fontSize:q.fontSize?q.fontSize:k2)*(zB+(q.autoPageLineWeight?q.autoPageLineWeight:0))/100),text:[],options:X.options};if(c.options.rowspan)c._lineHeight=0;c.options.autoPageCharWeight=q.autoPageCharWeight?q.autoPageCharWeight:null;let h=q.colW[P];if(X.options.colspan&&Array.isArray(q.colW))h=q.colW.filter((x,l)=>l>=P&&lx+l);c._lines=DB(X,h),N.push(c)}),q.verbose)console.log(` +`).forEach((k)=>{w.push({_type:D0.tablecell,text:k,options:Object.assign(Object.assign({},F.options),{breakLine:!0})})});else w.push({_type:D0.tablecell,text:F.text.trim(),options:F.options});if((M=F.options)===null||M===void 0?void 0:M.breakLine)V.push(w),w=[]}if(w.length>0)V.push(w),w=[]}),V.forEach((F)=>{F.forEach((M)=>{let k=[],L=String(M.text).split(" ");L.forEach((D,z)=>{let N=Object.assign({},M.options);if(N===null||N===void 0?void 0:N.breakLine)N.breakLine=z+1===L.length;k.push({_type:D0.tablecell,text:D+(z+1{let M=[],k="";if(F.forEach((f)=>{if(k.length+f.text.length>G)W.push(M),M=[],k="";M.push(f),k+=f.text.toString()}),M.length>0)W.push(M)}),W}function GJ($=[],q={},Q,K){let J=M8,Z=L0*1,G=L0*1,W=0,B=0,V=[],U=H0(q.x,"X",Q),w=H0(q.y,"Y",Q),F=H0(q.w,"X",Q),M=H0(q.h,"Y",Q),k=F;function f(){let D=0;if(V.length===0)D=w||v0(J[0]);if(V.length>0)D=v0(q.autoPageSlideStartY||q.newSlideStartY||J[0]);if(G=(M||Q.height)-D-v0(J[2]),V.length>1){if(typeof q.autoPageSlideStartY==="number")G=(M||Q.height)-v0(q.autoPageSlideStartY+J[2]);else if(typeof q.newSlideStartY==="number")G=(M||Q.height)-v0(q.newSlideStartY+J[2]);else if(w){if(G=(M||Q.height)-v0((w/L0{if(!z)z={_type:D0.tablecell};let N=z.options||null;B+=Number((N===null||N===void 0?void 0:N.colspan)?N.colspan:1)}),q.verbose)console.log(`| numCols ......................................... = ${B}`);if(!F&&q.colW){if(k=Array.isArray(q.colW)?q.colW.reduce((D,z)=>D+z)*L0:q.colW*B||0,q.verbose)console.log(`| tableCalcW ...................................... = ${k/L0}`)}if(Z=k||v0((U?U/L0:J[1])+J[3]),q.verbose)console.log(`| emuSlideTabW .................................... = ${(Z/L0).toFixed(1)}`);if(!q.colW||!Array.isArray(q.colW))if(q.colW&&!isNaN(Number(q.colW))){let D=[];($[0]||[]).forEach(()=>D.push(q.colW)),q.colW=[],D.forEach((N)=>{if(Array.isArray(q.colW))q.colW.push(N)})}else{q.colW=[];for(let D=0;D{let N=[],H=0,v=0,j=[];if(D.forEach((X)=>{var P,g,c,h;if(j.push({_type:D0.tablecell,text:[],options:X.options}),X.options.margin&&X.options.margin[0]>=1){if(((P=X.options)===null||P===void 0?void 0:P.margin)&&X.options.margin[0]&&Y0(X.options.margin[0])>H)H=Y0(X.options.margin[0]);else if((q===null||q===void 0?void 0:q.margin)&&q.margin[0]&&Y0(q.margin[0])>H)H=Y0(q.margin[0]);if(((g=X.options)===null||g===void 0?void 0:g.margin)&&X.options.margin[2]&&Y0(X.options.margin[2])>v)v=Y0(X.options.margin[2]);else if((q===null||q===void 0?void 0:q.margin)&&q.margin[2]&&Y0(q.margin[2])>v)v=Y0(q.margin[2])}else{if(((c=X.options)===null||c===void 0?void 0:c.margin)&&X.options.margin[0]&&v0(X.options.margin[0])>H)H=v0(X.options.margin[0]);else if((q===null||q===void 0?void 0:q.margin)&&q.margin[0]&&v0(q.margin[0])>H)H=v0(q.margin[0]);if(((h=X.options)===null||h===void 0?void 0:h.margin)&&X.options.margin[2]&&v0(X.options.margin[2])>v)v=v0(X.options.margin[2]);else if((q===null||q===void 0?void 0:q.margin)&&q.margin[2]&&v0(q.margin[2])>v)v=v0(q.margin[2])}}),f(),W+=H+v,q.verbose&&z===0)console.log(`| SLIDE [${V.length}]: emuSlideTabH ...... = ${(G/L0).toFixed(1)} `);if(D.forEach((X,P)=>{var g;let c={_type:D0.tablecell,_lines:null,_lineHeight:v0((((g=X.options)===null||g===void 0?void 0:g.fontSize)?X.options.fontSize:q.fontSize?q.fontSize:k2)*(fB+(q.autoPageLineWeight?q.autoPageLineWeight:0))/100),text:[],options:X.options};if(c.options.rowspan)c._lineHeight=0;c.options.autoPageCharWeight=q.autoPageCharWeight?q.autoPageCharWeight:null;let h=q.colW[P];if(X.options.colspan&&Array.isArray(q.colW))h=q.colW.filter((x,l)=>l>=P&&lx+l);c._lines=XB(X,h),N.push(c)}),q.verbose)console.log(` | SLIDE [${V.length}]: ROW [${z}]: START...`);let n=0,d=0,_=!1;while(!_){let X=N[n],P=j[n];if(N.forEach((h)=>{if(h._lineHeight>=d)d=h._lineHeight}),W+d>G){if(q.verbose)console.log(` |-----------------------------------------------------------------------|`),console.log(`|-- NEW SLIDE CREATED (currTabH+currLineH > maxH) => ${(W/L0).toFixed(2)} + ${(X._lineHeight/L0).toFixed(2)} > ${G/L0}`),console.log(`|-----------------------------------------------------------------------| `);if(j.length>0&&j.map((x)=>x.text.length).reduce((x,l)=>x+l)>0)L.rows.push(j);if(V.push(L),L={rows:[]},j=[],D.forEach((x)=>j.push({_type:D0.tablecell,text:[],options:x.options})),f(),W+=H+v,q.verbose)console.log(`| SLIDE [${V.length}]: emuSlideTabH ...... = ${(G/L0).toFixed(1)} `);if(W=0,(q.addHeaderToEach||q.autoPageRepeatHeader)&&q._arrObjTabHeadRows)q._arrObjTabHeadRows.forEach((x)=>{let l=[],$0=0;x.forEach((Z0)=>{if(l.push(Z0),Z0._lineHeight>$0)$0=Z0._lineHeight}),L.rows.push(l),W+=$0});P=j[n]}let g=X._lines.shift();if(Array.isArray(P.text)){if(g)P.text=P.text.concat(g);else if(P.text.length===0)P.text=P.text.concat({_type:D0.tablecell,text:""})}if(n===N.length-1)W+=d;if(n=nh._lines.length).reduce((h,x)=>h+x)===0)_=!0}if(j.length>0)L.rows.push(j);if(q.verbose)console.log(`- SLIDE [${V.length}]: ROW [${z}]: ...COMPLETE ...... emuTabCurrH = ${(W/L0).toFixed(2)} ( emuSlideTabH = ${(G/L0).toFixed(2)} )`)}),V.push(L),q.verbose)console.log(` |================================================|`),console.log(`| FINAL: tableRowSlides.length = ${V.length}`),V.forEach((D)=>console.log(D)),console.log(`|================================================| -`);return V}function LB($,q,Q={},K){let J=Q||{};J.slideMargin=J.slideMargin||J.slideMargin===0?J.slideMargin:0.5;let Z=J.w||$.presLayout.width,G=[],W=[],B=[],V=[],U=[],w=[0.5,0.5,0.5,0.5],F=0;if(!document.getElementById(q))throw Error('tableToSlides: Table ID "'+q+'" does not exist!');if(K===null||K===void 0?void 0:K._margin){if(Array.isArray(K._margin))w=K._margin;else if(!isNaN(K._margin))w=[K._margin,K._margin,K._margin,K._margin];J.slideMargin=w}else if(J===null||J===void 0?void 0:J.slideMargin){if(Array.isArray(J.slideMargin))w=J.slideMargin;else if(!isNaN(J.slideMargin))w=[J.slideMargin,J.slideMargin,J.slideMargin,J.slideMargin]}if(Z=(J.w?v0(J.w):$.presLayout.width)-v0(w[1]+w[3]),J.verbose)console.log("[[VERBOSE MODE]]"),console.log("|-- `tableToSlides` ----------------------------------------------------|"),console.log(`| tableProps.h .................................... = ${J.h}`),console.log(`| tableProps.w .................................... = ${J.w}`),console.log(`| pptx.presLayout.width ........................... = ${($.presLayout.width/L0).toFixed(1)}`),console.log(`| pptx.presLayout.height .......................... = ${($.presLayout.height/L0).toFixed(1)}`),console.log(`| emuSlideTabW .................................... = ${(Z/L0).toFixed(1)}`);let M=document.querySelectorAll(`#${q} tr:first-child th`);if(M.length===0)M=document.querySelectorAll(`#${q} tr:first-child td`);if(M.forEach((f)=>{let L=f;if(L.getAttribute("colspan"))for(let D=0;D{F+=f}),U.forEach((f,L)=>{let D=Number((Number(Z)*(f/F*100)/100/L0).toFixed(2)),z=0,N=document.querySelector(`#${q} thead tr:first-child th:nth-child(${L+1})`);if(N)z=Number(N.getAttribute("data-pptx-min-width"));let H=document.querySelector(`#${q} thead tr:first-child th:nth-child(${L+1})`);if(H)z=Number(H.getAttribute("data-pptx-width"));V.push(z>D?z:D)}),J.verbose)console.log(`| arrColW ......................................... = [${V.join(", ")}]`);["thead","tbody","tfoot"].forEach((f)=>{document.querySelectorAll(`#${q} ${f} tr`).forEach((L)=>{let D=L,z=[];switch(Array.from(D.cells).forEach((N)=>{let H=window.getComputedStyle(N).getPropertyValue("color").replace(/\s+/gi,"").replace("rgba(","").replace("rgb(","").replace(")","").split(","),v=window.getComputedStyle(N).getPropertyValue("background-color").replace(/\s+/gi,"").replace("rgba(","").replace("rgb(","").replace(")","").split(",");if(window.getComputedStyle(N).getPropertyValue("background-color")==="rgba(0, 0, 0, 0)"||window.getComputedStyle(N).getPropertyValue("transparent"))v=["255","255","255"];let j={align:null,bold:window.getComputedStyle(N).getPropertyValue("font-weight")==="bold"||Number(window.getComputedStyle(N).getPropertyValue("font-weight"))>=500,border:null,color:g7(Number(H[0]),Number(H[1]),Number(H[2])),fill:{color:g7(Number(v[0]),Number(v[1]),Number(v[2]))},fontFace:(window.getComputedStyle(N).getPropertyValue("font-family")||"").split(",")[0].replace(/"/g,"").replace("inherit","").replace("initial","")||null,fontSize:Number(window.getComputedStyle(N).getPropertyValue("font-size").replace(/[a-z]/gi,"")),margin:null,colspan:Number(N.getAttribute("colspan"))||null,rowspan:Number(N.getAttribute("rowspan"))||null,valign:null};if(["left","center","right","start","end"].includes(window.getComputedStyle(N).getPropertyValue("text-align"))){let n=window.getComputedStyle(N).getPropertyValue("text-align").replace("start","left").replace("end","right");j.align=n==="center"?"center":n==="left"?"left":n==="right"?"right":null}if(["top","middle","bottom"].includes(window.getComputedStyle(N).getPropertyValue("vertical-align"))){let n=window.getComputedStyle(N).getPropertyValue("vertical-align");j.valign=n==="top"?"top":n==="middle"?"middle":n==="bottom"?"bottom":null}if(window.getComputedStyle(N).getPropertyValue("padding-left"))j.margin=[0,0,0,0],["padding-top","padding-right","padding-bottom","padding-left"].forEach((d,_)=>{j.margin[_]=Math.round(Number(window.getComputedStyle(N).getPropertyValue(d).replace(/\D/gi,"")))});if(window.getComputedStyle(N).getPropertyValue("border-top-width")||window.getComputedStyle(N).getPropertyValue("border-right-width")||window.getComputedStyle(N).getPropertyValue("border-bottom-width")||window.getComputedStyle(N).getPropertyValue("border-left-width"))j.border=[null,null,null,null],["top","right","bottom","left"].forEach((d,_)=>{let X=Math.round(Number(window.getComputedStyle(N).getPropertyValue("border-"+d+"-width").replace("px",""))),P=[];P=window.getComputedStyle(N).getPropertyValue("border-"+d+"-color").replace(/\s+/gi,"").replace("rgba(","").replace("rgb(","").replace(")","").split(",");let g=g7(Number(P[0]),Number(P[1]),Number(P[2]));j.border[_]={pt:X,color:g}});z.push({_type:D0.tablecell,text:N.innerText,options:j})}),f){case"thead":G.push(z);break;case"tbody":W.push(z);break;case"tfoot":B.push(z);break;default:console.log(`table parsing: unexpected table part: ${f}`);break}})}),J._arrObjTabHeadRows=G||null,J.colW=V,ZJ([...G,...W,...B],J,$.presLayout,K).forEach((f,L)=>{let D=$.addSlide({masterName:J.masterSlideName||null});if(L===0)J.y=J.y||w[0];if(L>0)J.y=J.autoPageSlideStartY||J.newSlideStartY||w[0];if(J.verbose)console.log(`| opts.autoPageSlideStartY: ${J.autoPageSlideStartY} / arrInchMargins[0]: ${w[0]} => opts.y = ${J.y}`);if(D.addTable(f.rows,{x:J.x||w[3],y:J.y,w:Number(Z)/L0,colW:V,autoPage:!1}),J.addImage)if(J.addImage.options=J.addImage.options||{},!J.addImage.image||!J.addImage.image.path&&!J.addImage.image.data)console.warn("Warning: tableToSlides.addImage requires either `path` or `data`");else D.addImage({path:J.addImage.image.path,data:J.addImage.image.data,x:J.addImage.options.x,y:J.addImage.options.y,w:J.addImage.options.w,h:J.addImage.options.h});if(J.addShape)D.addShape(J.addShape.shapeName,J.addShape.options||{});if(J.addTable)D.addTable(J.addTable.rows,J.addTable.options||{});if(J.addText)D.addText(J.addText.text,J.addText.options||{})})}var HB=0;function vB($,q){if($.bkgd)q.bkgd=$.bkgd;if($.objects&&Array.isArray($.objects)&&$.objects.length>0)$.objects.forEach((Q,K)=>{let J=Object.keys(Q)[0],Z=q;if(W1[J]&&J==="chart")GJ(Z,Q[J].type,Q[J].data,Q[J].opts);else if(W1[J]&&J==="image")WJ(Z,Q[J]);else if(W1[J]&&J==="line")E7(Z,B1.LINE,Q[J]);else if(W1[J]&&J==="rect")E7(Z,B1.RECTANGLE,Q[J]);else if(W1[J]&&J==="text")L5(Z,[{text:Q[J].text}],Q[J].options,!1);else if(W1[J]&&J==="placeholder")Q[J].options.placeholder=Q[J].options.name,delete Q[J].options.name,Q[J].options._placeholderType=Q[J].options.type,delete Q[J].options.type,Q[J].options._placeholderIdx=100+K,L5(Z,[{text:Q[J].text}],Q[J].options,!0)});if($.slideNumber&&typeof $.slideNumber==="object")q._slideNumberProps=$.slideNumber}function GJ($,q,Q,K){var J;function Z(w){if(!w||w.style==="none")return;if(w.size!==void 0&&(isNaN(Number(w.size))||w.size<=0))console.warn("Warning: chart.gridLine.size must be greater than 0."),delete w.size;if(w.style&&!["solid","dash","dot"].includes(w.style))console.warn("Warning: chart.gridLine.style options: `solid`, `dash`, `dot`."),delete w.style;if(w.cap&&!["flat","square","round"].includes(w.cap))console.warn("Warning: chart.gridLine.cap options: `flat`, `square`, `round`."),delete w.cap}let G=++HB,W={_type:null,text:null,options:null,chartRid:null},B=null,V=[];if(Array.isArray(q))q.forEach((w)=>{V=V.concat(w.data)}),B=Q||K;else V=Q,B=K;V.forEach((w,F)=>{if(w._dataIndex=F,w.labels!==void 0&&!Array.isArray(w.labels[0]))w.labels=[w.labels]});let U=B&&typeof B==="object"?B:{};if(U._type=q,U.x=typeof U.x<"u"&&U.x!=null&&!isNaN(Number(U.x))?U.x:1,U.y=typeof U.y<"u"&&U.y!=null&&!isNaN(Number(U.y))?U.y:1,U.w=U.w||"50%",U.h=U.h||"50%",U.objectName=U.objectName?k0(U.objectName):`Chart ${$._slideObjects.filter((w)=>w._type===D0.chart).length}`,!["bar","col"].includes(U.barDir||""))U.barDir="col";if(U._type===q0.AREA){if(!["stacked","standard","percentStacked"].includes(U.barGrouping||""))U.barGrouping="standard"}if(U._type===q0.BAR){if(!["clustered","stacked","percentStacked"].includes(U.barGrouping||""))U.barGrouping="clustered"}if(U._type===q0.BAR3D){if(!["clustered","stacked","standard","percentStacked"].includes(U.barGrouping||""))U.barGrouping="standard"}if((J=U.barGrouping)===null||J===void 0?void 0:J.includes("tacked")){if(!U.barGapWidthPct)U.barGapWidthPct=50}if(U.dataLabelPosition){if(U._type===q0.AREA||U._type===q0.BAR3D||U._type===q0.DOUGHNUT||U._type===q0.RADAR)delete U.dataLabelPosition;if(U._type===q0.PIE){if(!["bestFit","ctr","inEnd","outEnd"].includes(U.dataLabelPosition))delete U.dataLabelPosition}if(U._type===q0.BUBBLE||U._type===q0.BUBBLE3D||U._type===q0.LINE||U._type===q0.SCATTER){if(!["b","ctr","l","r","t"].includes(U.dataLabelPosition))delete U.dataLabelPosition}if(U._type===q0.BAR){if(!["stacked","percentStacked"].includes(U.barGrouping||"")){if(!["ctr","inBase","inEnd"].includes(U.dataLabelPosition))delete U.dataLabelPosition}if(!["clustered"].includes(U.barGrouping||"")){if(!["ctr","inBase","inEnd","outEnd"].includes(U.dataLabelPosition))delete U.dataLabelPosition}}}if(U.dataLabelBkgrdColors=U.dataLabelBkgrdColors||!U.dataLabelBkgrdColors?U.dataLabelBkgrdColors:!1,!["b","l","r","t","tr"].includes(U.legendPos||""))U.legendPos="r";if(!["cone","coneToMax","box","cylinder","pyramid","pyramidToMax"].includes(U.bar3DShape||""))U.bar3DShape="box";if(!["circle","dash","diamond","dot","none","square","triangle"].includes(U.lineDataSymbol||""))U.lineDataSymbol="circle";if(!["gap","span"].includes(U.displayBlanksAs||""))U.displayBlanksAs="span";if(!["standard","marker","filled"].includes(U.radarStyle||""))U.radarStyle="standard";if(U.lineDataSymbolSize=U.lineDataSymbolSize&&!isNaN(U.lineDataSymbolSize)?U.lineDataSymbolSize:6,U.lineDataSymbolLineSize=U.lineDataSymbolLineSize&&!isNaN(U.lineDataSymbolLineSize)?Y0(U.lineDataSymbolLineSize):Y0(0.75),U.layout)["x","y","w","h"].forEach((w)=>{let F=U.layout[w];if(isNaN(Number(F))||F<0||F>1)console.warn("Warning: chart.layout."+w+" can only be 0-1"),delete U.layout[w]});if(U.catGridLine=U.catGridLine||(U._type===q0.SCATTER?{color:"D9D9D9",size:1}:{style:"none"}),U.valGridLine=U.valGridLine||(U._type===q0.SCATTER?{color:"D9D9D9",size:1}:{}),U.serGridLine=U.serGridLine||(U._type===q0.SCATTER?{color:"D9D9D9",size:1}:{style:"none"}),Z(U.catGridLine),Z(U.valGridLine),Z(U.serGridLine),c7(U.shadow),U.showDataTable=U.showDataTable||!U.showDataTable?U.showDataTable:!1,U.showDataTableHorzBorder=U.showDataTableHorzBorder||!U.showDataTableHorzBorder?U.showDataTableHorzBorder:!0,U.showDataTableVertBorder=U.showDataTableVertBorder||!U.showDataTableVertBorder?U.showDataTableVertBorder:!0,U.showDataTableOutline=U.showDataTableOutline||!U.showDataTableOutline?U.showDataTableOutline:!0,U.showDataTableKeys=U.showDataTableKeys||!U.showDataTableKeys?U.showDataTableKeys:!0,U.showLabel=U.showLabel||!U.showLabel?U.showLabel:!1,U.showLegend=U.showLegend||!U.showLegend?U.showLegend:!1,U.showPercent=U.showPercent||!U.showPercent?U.showPercent:!0,U.showTitle=U.showTitle||!U.showTitle?U.showTitle:!1,U.showValue=U.showValue||!U.showValue?U.showValue:!1,U.showLeaderLines=U.showLeaderLines||!U.showLeaderLines?U.showLeaderLines:!1,U.catAxisLineShow=typeof U.catAxisLineShow<"u"?U.catAxisLineShow:!0,U.valAxisLineShow=typeof U.valAxisLineShow<"u"?U.valAxisLineShow:!0,U.serAxisLineShow=typeof U.serAxisLineShow<"u"?U.serAxisLineShow:!0,U.v3DRotX=!isNaN(U.v3DRotX)&&U.v3DRotX>=-90&&U.v3DRotX<=90?U.v3DRotX:30,U.v3DRotY=!isNaN(U.v3DRotY)&&U.v3DRotY>=0&&U.v3DRotY<=360?U.v3DRotY:30,U.v3DRAngAx=U.v3DRAngAx||!U.v3DRAngAx?U.v3DRAngAx:!0,U.v3DPerspective=!isNaN(U.v3DPerspective)&&U.v3DPerspective>=0&&U.v3DPerspective<=240?U.v3DPerspective:30,U.barGapWidthPct=!isNaN(U.barGapWidthPct)&&U.barGapWidthPct>=0&&U.barGapWidthPct<=1000?U.barGapWidthPct:150,U.barGapDepthPct=!isNaN(U.barGapDepthPct)&&U.barGapDepthPct>=0&&U.barGapDepthPct<=1000?U.barGapDepthPct:150,U.chartColors=Array.isArray(U.chartColors)?U.chartColors:U._type===q0.PIE||U._type===q0.DOUGHNUT?NB:z8,U.chartColorsOpacity=U.chartColorsOpacity&&!isNaN(U.chartColorsOpacity)?U.chartColorsOpacity:null,U.border=U.border&&typeof U.border==="object"?U.border:null,U.border&&(!U.border.pt||isNaN(U.border.pt)))U.border.pt=v6.pt;if(U.border&&(!U.border.color||typeof U.border.color!=="string"))U.border.color=v6.color;if(U.plotArea=U.plotArea||{},U.plotArea.border=U.plotArea.border&&typeof U.plotArea.border==="object"?U.plotArea.border:null,U.plotArea.border&&(!U.plotArea.border.pt||isNaN(U.plotArea.border.pt)))U.plotArea.border.pt=v6.pt;if(U.plotArea.border&&(!U.plotArea.border.color||typeof U.plotArea.border.color!=="string"))U.plotArea.border.color=v6.color;if(U.border)U.plotArea.border=U.border;if(U.plotArea.fill=U.plotArea.fill||{color:null,transparency:null},U.fill)U.plotArea.fill.color=U.fill;if(U.chartArea=U.chartArea||{},U.chartArea.border=U.chartArea.border&&typeof U.chartArea.border==="object"?U.chartArea.border:null,U.chartArea.border)U.chartArea.border={color:U.chartArea.border.color||v6.color,pt:U.chartArea.border.pt||v6.pt};if(U.chartArea.roundedCorners=typeof U.chartArea.roundedCorners==="boolean"?U.chartArea.roundedCorners:!0,U.dataBorder=U.dataBorder&&typeof U.dataBorder==="object"?U.dataBorder:null,U.dataBorder&&(!U.dataBorder.pt||isNaN(U.dataBorder.pt)))U.dataBorder.pt=0.75;if(U.dataBorder&&U.dataBorder.color){let w=typeof U.dataBorder.color==="string"&&U.dataBorder.color.length===6&&/^[0-9A-Fa-f]{6}$/.test(U.dataBorder.color),F=Object.values(D5).includes(U.dataBorder.color);if(!w&&!F)U.dataBorder.color="F9F9F9"}if(!U.dataLabelFormatCode&&U._type===q0.SCATTER)U.dataLabelFormatCode="General";if(!U.dataLabelFormatCode&&(U._type===q0.PIE||U._type===q0.DOUGHNUT))U.dataLabelFormatCode=U.showPercent?"0%":"General";if(U.dataLabelFormatCode=U.dataLabelFormatCode&&typeof U.dataLabelFormatCode==="string"?U.dataLabelFormatCode:"#,##0",!U.dataLabelFormatScatter&&U._type===q0.SCATTER)U.dataLabelFormatScatter="custom";if(U.lineSize=typeof U.lineSize==="number"?U.lineSize:2,U.valAxisMajorUnit=typeof U.valAxisMajorUnit==="number"?U.valAxisMajorUnit:null,U._type===q0.AREA||U._type===q0.BAR||U._type===q0.BAR3D||U._type===q0.LINE)U.catAxisMultiLevelLabels=!!U.catAxisMultiLevelLabels;else delete U.catAxisMultiLevelLabels;return W._type="chart",W.options=U,W.chartRid=a2($),$._relsChart.push({rId:a2($),data:V,opts:U,type:U._type,globalId:G,fileName:`chart${G}.xml`,Target:`/ppt/charts/chart${G}.xml`}),$._slideObjects.push(W),W}function WJ($,q){let Q={_type:null,text:null,options:null,image:null,imageRid:null,hyperlink:null},K=q.x||0,J=q.y||0,Z=q.w||0,G=q.h||0,W=q.sizing||null,B=q.hyperlink||"",V=q.data||"",U=q.path||"",w=a2($),F=q.objectName?k0(q.objectName):`Image ${$._slideObjects.filter((k)=>k._type===D0.image).length}`;if(!U&&!V)return console.error("ERROR: addImage() requires either 'data' or 'path' parameter!"),null;else if(U&&typeof U!=="string")return console.error(`ERROR: addImage() 'path' should be a string, ex: {path:'/img/sample.png'} - you sent ${String(U)}`),null;else if(V&&typeof V!=="string")return console.error(`ERROR: addImage() 'data' should be a string, ex: {data:'image/png;base64,NMP[...]'} - you sent ${String(V)}`),null;else if(V&&typeof V==="string"&&!V.toLowerCase().includes("base64,"))return console.error("ERROR: Image `data` value lacks a base64 header! Ex: 'image/png;base64,NMP[...]')"),null;let M=(U.substring(U.lastIndexOf("/")+1).split("?")[0].split(".").pop().split("#")[0]||"png").toLowerCase();if(V&&/image\/(\w+);/.exec(V)&&/image\/(\w+);/.exec(V).length>0)M=/image\/(\w+);/.exec(V)[1];else if(V===null||V===void 0?void 0:V.toLowerCase().includes("image/svg+xml"))M="svg";if(Q._type=D0.image,Q.image=U||"preencoded.png",Q.options={x:K||0,y:J||0,w:Z||1,h:G||1,altText:q.altText||"",rounding:typeof q.rounding==="boolean"?q.rounding:!1,sizing:W,placeholder:q.placeholder,rotate:q.rotate||0,flipV:q.flipV||!1,flipH:q.flipH||!1,transparency:q.transparency||0,objectName:F,shadow:c7(q.shadow)},M==="svg")$._relsMedia.push({path:U||V+"png",type:"image/png",extn:"png",data:V||"",rId:w,Target:`../media/image-${$._slideNum}-${$._relsMedia.length+1}.png`,isSvgPng:!0,svgSize:{w:H0(Q.options.w,"X",$._presLayout),h:H0(Q.options.h,"Y",$._presLayout)}}),Q.imageRid=w,$._relsMedia.push({path:U||V,type:"image/svg+xml",extn:M,data:V||"",rId:w+1,Target:`../media/image-${$._slideNum}-${$._relsMedia.length+1}.${M}`}),Q.imageRid=w+1;else{let k=$._relsMedia.filter((f)=>f.path&&f.path===U&&f.type==="image/"+M&&!f.isDuplicate)[0];$._relsMedia.push({path:U||"preencoded."+M,type:"image/"+M,extn:M,data:V||"",rId:w,isDuplicate:!!(k===null||k===void 0?void 0:k.Target),Target:(k===null||k===void 0?void 0:k.Target)?k.Target:`../media/image-${$._slideNum}-${$._relsMedia.length+1}.${M}`}),Q.imageRid=w}if(typeof B==="object")if(!B.url&&!B.slide)throw Error("ERROR: `hyperlink` option requires either: `url` or `slide`");else w++,$._rels.push({type:D0.hyperlink,data:B.slide?"slide":"dummy",rId:w,Target:B.url||B.slide.toString()}),B._rId=w,Q.hyperlink=B;$._slideObjects.push(Q)}function fB($,q){let Q=q.x||0,K=q.y||0,J=q.w||2,Z=q.h||2,G=q.data||"",W=q.link||"",B=q.path||"",V=q.type||"audio",U="",w=q.cover||YB,F=q.objectName?k0(q.objectName):`Media ${$._slideObjects.filter((k)=>k._type===D0.media).length}`,M={_type:D0.media};if(!B&&!G&&V!=="online")throw Error("addMedia() error: either `data` or `path` are required!");else if(G&&!G.toLowerCase().includes("base64,"))throw Error("addMedia() error: `data` value lacks a base64 header! Ex: 'video/mpeg;base64,NMP[...]')");else if(!w.toLowerCase().includes("base64,"))throw Error("addMedia() error: `cover` value lacks a base64 header! Ex: 'data:image/png;base64,iV[...]')");if(V==="online"&&!W)throw Error("addMedia() error: online videos require `link` value");if(U=q.extn||(G?G.split(";")[0].split("/")[1]:B.split(".").pop())||"mp3",M.mtype=V,M.media=B||"preencoded.mov",M.options={},M.options.x=Q,M.options.y=K,M.options.w=J,M.options.h=Z,M.options.objectName=F,V==="online"){let k=a2($);$._relsMedia.push({path:B||"preencoded"+U,data:"dummy",type:"online",extn:U,rId:k,Target:W}),M.mediaRid=k,$._relsMedia.push({path:"preencoded.png",data:w,type:"image/png",extn:"png",rId:a2($),Target:`../media/image-${$._slideNum}-${$._relsMedia.length+1}.png`})}else{let k=$._relsMedia.filter((L)=>L.path&&L.path===B&&L.type===V+"/"+U&&!L.isDuplicate)[0],f=a2($);$._relsMedia.push({path:B||"preencoded"+U,type:V+"/"+U,extn:U,data:G||"",rId:f,isDuplicate:!!(k===null||k===void 0?void 0:k.Target),Target:(k===null||k===void 0?void 0:k.Target)?k.Target:`../media/media-${$._slideNum}-${$._relsMedia.length+1}.${U}`}),M.mediaRid=f,$._relsMedia.push({path:B||"preencoded"+U,type:V+"/"+U,extn:U,data:G||"",rId:a2($),isDuplicate:!!(k===null||k===void 0?void 0:k.Target),Target:(k===null||k===void 0?void 0:k.Target)?k.Target:`../media/media-${$._slideNum}-${$._relsMedia.length+0}.${U}`}),$._relsMedia.push({path:"preencoded.png",type:"image/png",extn:"png",data:w,rId:a2($),Target:`../media/image-${$._slideNum}-${$._relsMedia.length+1}.png`})}$._slideObjects.push(M)}function RB($,q){$._slideObjects.push({_type:D0.notes,text:[{text:q}]})}function E7($,q,Q){let K=typeof Q==="object"?Q:{};K.line=K.line||{type:"none"};let J={_type:D0.text,shape:q||B1.RECTANGLE,options:K,text:null};if(!q)throw Error("Missing/Invalid shape parameter! Example: `addShape(pptxgen.shapes.LINE, {x:1, y:1, w:1, h:1});`");let Z={type:K.line.type||"solid",color:K.line.color||JJ,transparency:K.line.transparency||0,width:K.line.width||1,dashType:K.line.dashType||"solid",beginArrowType:K.line.beginArrowType||null,endArrowType:K.line.endArrowType||null};if(typeof K.line==="object"&&K.line.type!=="none")K.line=Z;if(K.x=K.x||(K.x===0?0:1),K.y=K.y||(K.y===0?0:1),K.w=K.w||(K.w===0?0:1),K.h=K.h||(K.h===0?0:1),K.objectName=K.objectName?k0(K.objectName):`Shape ${$._slideObjects.filter((G)=>G._type===D0.text).length}`,typeof K.line==="string"){let G=Z;G.color=String(K.line),K.line=G}if(typeof K.lineSize==="number")K.line.width=K.lineSize;if(typeof K.lineDash==="string")K.line.dashType=K.lineDash;if(typeof K.lineHead==="string")K.line.beginArrowType=K.lineHead;if(typeof K.lineTail==="string")K.line.endArrowType=K.lineTail;g6($,J),$._slideObjects.push(J)}function IB($,q,Q,K,J,Z,G){let W=[$],B=Q&&typeof Q==="object"?Q:{};B.objectName=B.objectName?k0(B.objectName):`Table ${$._slideObjects.filter((F)=>F._type===D0.table).length}`;{if(q===null||q.length===0||!Array.isArray(q))throw Error("addTable: Array expected! EX: 'slide.addTable( [rows], {options} );' (https://gitbrent.github.io/PptxGenJS/docs/api-tables.html)");if(!q[0]||!Array.isArray(q[0]))throw Error("addTable: 'rows' should be an array of cells! EX: 'slide.addTable( [ ['A'], ['B'], {text:'C',options:{align:'center'}} ] );' (https://gitbrent.github.io/PptxGenJS/docs/api-tables.html)")}let V=[];if(q.forEach((F)=>{let M=[];if(Array.isArray(F))F.forEach((k)=>{let f={_type:D0.tablecell,text:"",options:typeof k==="object"&&k.options?k.options:{}};if(typeof k==="string"||typeof k==="number")f.text=k.toString();else if(k.text){if(typeof k.text==="string"||typeof k.text==="number")f.text=k.text.toString();else if(k.text)f.text=k.text;if(k.options&&typeof k.options==="object")f.options=k.options}f.options.border=f.options.border||B.border||[{type:"none"},{type:"none"},{type:"none"},{type:"none"}];let L=f.options.border;if(!Array.isArray(L)&&typeof L==="object")f.options.border=[L,L,L,L];if(!f.options.border[0])f.options.border[0]={type:"none"};if(!f.options.border[1])f.options.border[1]={type:"none"};if(!f.options.border[2])f.options.border[2]={type:"none"};if(!f.options.border[3])f.options.border[3]={type:"none"};[0,1,2,3].forEach((z)=>{f.options.border[z]={type:f.options.border[z].type||H6.type,color:f.options.border[z].color||H6.color,pt:typeof f.options.border[z].pt==="number"?f.options.border[z].pt:H6.pt}}),M.push(f)});else console.log("addTable: tableRows has a bad row. A row should be an array of cells. You provided:"),console.log(F);V.push(M)}),B.x=H0(B.x||(B.x===0?0:L0/2),"X",J),B.y=H0(B.y||(B.y===0?0:L0/2),"Y",J),B.h)B.h=H0(B.h,"Y",J);if(B.fontSize=B.fontSize||k2,B.margin=B.margin===0||B.margin?B.margin:KJ,typeof B.margin==="number")B.margin=[Number(B.margin),Number(B.margin),Number(B.margin),Number(B.margin)];if(JSON.stringify({arrRows:V}).indexOf("hyperlink")===-1){if(!B.color)B.color=B.color||Q2}if(typeof B.border==="string")console.warn("addTable `border` option must be an object. Ex: `{border: {type:'none'}}`"),B.border=null;else if(Array.isArray(B.border))[0,1,2,3].forEach((F)=>{B.border[F]=B.border[F]?{type:B.border[F].type||H6.type,color:B.border[F].color||H6.color,pt:B.border[F].pt||H6.pt}:{type:"none"}});if(B.autoPage=typeof B.autoPage==="boolean"?B.autoPage:!1,B.autoPageRepeatHeader=typeof B.autoPageRepeatHeader==="boolean"?B.autoPageRepeatHeader:!1,B.autoPageHeaderRows=typeof B.autoPageHeaderRows<"u"&&!isNaN(Number(B.autoPageHeaderRows))?Number(B.autoPageHeaderRows):1,B.autoPageLineWeight=typeof B.autoPageLineWeight<"u"&&!isNaN(Number(B.autoPageLineWeight))?Number(B.autoPageLineWeight):0,B.autoPageLineWeight){if(B.autoPageLineWeight>1)B.autoPageLineWeight=1;else if(B.autoPageLineWeight<-1)B.autoPageLineWeight=-1}let U=M8;if(K&&typeof K._margin<"u"){if(Array.isArray(K._margin))U=K._margin;else if(!isNaN(Number(K._margin)))U=[Number(K._margin),Number(K._margin),Number(K._margin),Number(K._margin)]}if(B.colW){let F=V[0].reduce((M,k)=>{var f;if(((f=k===null||k===void 0?void 0:k.options)===null||f===void 0?void 0:f.colspan)&&typeof k.options.colspan==="number")M+=k.options.colspan;else M+=1;return M},0);if(typeof B.colW==="string"||typeof B.colW==="number")B.w=Math.floor(Number(B.colW)*F),B.colW=null;else if(B.colW&&Array.isArray(B.colW)&&B.colW.length===1&&F>1)B.w=Math.floor(Number(B.colW)*F),B.colW=null;else if(B.colW&&Array.isArray(B.colW)&&B.colW.length!==F)console.warn("addTable: mismatch: (colW.length != data.length) Therefore, defaulting to evenly distributed col widths."),B.colW=null}else if(B.w)B.w=H0(B.w,"X",J);else B.w=Math.floor(J._sizeW/L0-U[1]-U[3]);if(B.x&&B.x<20)B.x=v0(B.x);if(B.y&&B.y<20)B.y=v0(B.y);if(B.w&&typeof B.w==="number"&&B.w<20)B.w=v0(B.w);if(B.h&&typeof B.h==="number"&&B.h<20)B.h=v0(B.h);V.forEach((F)=>{F.forEach((M,k)=>{if(typeof M==="number"||typeof M==="string")F[k]={_type:D0.tablecell,text:String(F[k]),options:B};else if(typeof M==="object"){if(typeof M.text==="number")F[k].text=F[k].text.toString();else if(typeof M.text>"u"||M.text===null)F[k].text="";F[k].options=M.options||{},F[k]._type=D0.tablecell}})});let w=[];if(B&&!B.autoPage)g6($,V),$._slideObjects.push({_type:D0.table,arrTabRows:V,options:Object.assign({},B)});else{if(B.autoPageRepeatHeader)B._arrObjTabHeadRows=V.filter((F,M)=>M{if(!G($._slideNum+M))W.push(Z({masterName:(K===null||K===void 0?void 0:K._name)||null}));if(M>0)B.y=v0(B.autoPageSlideStartY||B.newSlideStartY||U[0]);{let k=G($._slideNum+M);if(B.autoPage=!1,g6(k,F.rows),k.addTable(F.rows,Object.assign({},B)),M>0)w.push(k)}})}return w}function L5($,q,Q,K){let J={_type:K?D0.placeholder:D0.text,shape:(Q===null||Q===void 0?void 0:Q.shape)||B1.RECTANGLE,text:!q||q.length===0?[{text:"",options:null}]:q,options:Q||{}};function Z(G){{if(!G.placeholder)G.color=G.color||J.options.color||$.color||Q2;if(G.placeholder||K)G.bullet=G.bullet||!1;if(G.placeholder&&$._slideLayout&&$._slideLayout._slideObjects){let W=$._slideLayout._slideObjects.filter((B)=>B._type==="placeholder"&&B.options&&B.options.placeholder&&B.options.placeholder===G.placeholder)[0];if(W===null||W===void 0?void 0:W.options)G=Object.assign(Object.assign({},G),W.options)}if(G.objectName=G.objectName?k0(G.objectName):`Text ${$._slideObjects.filter((W)=>W._type===D0.text).length}`,G.shape===B1.LINE){let W={type:G.line.type||"solid",color:G.line.color||JJ,transparency:G.line.transparency||0,width:G.line.width||1,dashType:G.line.dashType||"solid",beginArrowType:G.line.beginArrowType||null,endArrowType:G.line.endArrowType||null};if(typeof G.line==="object")G.line=W;if(typeof G.line==="string"){let B=W;if(typeof G.line==="string")B.color=G.line;G.line=B}if(typeof G.lineSize==="number")G.line.width=G.lineSize;if(typeof G.lineDash==="string")G.line.dashType=G.lineDash;if(typeof G.lineHead==="string")G.line.beginArrowType=G.lineHead;if(typeof G.lineTail==="string")G.line.endArrowType=G.lineTail}if(G.line=G.line||{},G.lineSpacing=G.lineSpacing&&!isNaN(G.lineSpacing)?G.lineSpacing:null,G.lineSpacingMultiple=G.lineSpacingMultiple&&!isNaN(G.lineSpacingMultiple)?G.lineSpacingMultiple:null,G._bodyProp=G._bodyProp||{},G._bodyProp.autoFit=G.autoFit||!1,G._bodyProp.anchor=!G.placeholder?I6.ctr:null,G._bodyProp.vert=G.vert||null,G._bodyProp.wrap=typeof G.wrap==="boolean"?G.wrap:!0,G.inset&&!isNaN(Number(G.inset))||G.inset===0)G._bodyProp.lIns=v0(G.inset),G._bodyProp.rIns=v0(G.inset),G._bodyProp.tIns=v0(G.inset),G._bodyProp.bIns=v0(G.inset);if(typeof G.underline==="boolean"&&G.underline===!0)G.underline={style:"sng"}}{if((G.align||"").toLowerCase().indexOf("c")===0)G._bodyProp.align=R6.center;else if((G.align||"").toLowerCase().indexOf("l")===0)G._bodyProp.align=R6.left;else if((G.align||"").toLowerCase().indexOf("r")===0)G._bodyProp.align=R6.right;else if((G.align||"").toLowerCase().indexOf("j")===0)G._bodyProp.align=R6.justify;if((G.valign||"").toLowerCase().indexOf("b")===0)G._bodyProp.anchor=I6.b;else if((G.valign||"").toLowerCase().indexOf("m")===0)G._bodyProp.anchor=I6.ctr;else if((G.valign||"").toLowerCase().indexOf("t")===0)G._bodyProp.anchor=I6.t}return c7(G.shadow),G}J.options=Z(J.options),J.text.forEach((G)=>G.options=Z(G.options||{})),g6($,J.text||""),$._slideObjects.push(J)}function CB($){($._slideLayout._slideObjects||[]).forEach((q)=>{if(q._type===D0.placeholder){if($._slideObjects.filter((Q)=>Q.options&&Q.options.placeholder===q.options.placeholder).length===0)L5($,[{text:""}],q.options,!1)}})}function BJ($,q){var Q;if(q.bkgd){if(!q.background)q.background={};if(typeof q.bkgd==="string")q.background.color=q.bkgd;else{if(q.bkgd.data)q.background.data=q.bkgd.data;if(q.bkgd.path)q.background.path=q.bkgd.path;if(q.bkgd.src)q.background.path=q.bkgd.src}}if((Q=q.background)===null||Q===void 0?void 0:Q.fill)q.background.color=q.background.fill;if($&&($.path||$.data)){$.path=$.path||"preencoded.png";let K=($.path.split(".").pop()||"png").split("?")[0];if(K==="jpg")K="jpeg";q._relsMedia=q._relsMedia||[];let J=q._relsMedia.length+1;q._relsMedia.push({path:$.path,type:D0.image,extn:K,data:$.data||null,rId:J,Target:`../media/${(q._name||"").replace(/\s+/gi,"-")}-image-${q._relsMedia.length+1}.${K}`}),q._bkgdImgRid=J}}function g6($,q,Q){let K=[];if(typeof q==="string"||typeof q==="number")return;else if(Array.isArray(q))K=q;else if(typeof q==="object")K=[q];K.forEach((J,Z)=>{if(Q&&Q[Z]&&Q[Z].hyperlink)J.options=Object.assign(Object.assign({},J.options),Q[Z]);if(Array.isArray(J)){let G=[];J.forEach((W)=>{if(W.options&&!W.text.options)G.push(W.options)}),g6($,J,G)}else if(Array.isArray(J.text))g6($,J.text,Q&&Q[Z]?[Q[Z]]:void 0);else if(J&&typeof J==="object"&&J.options&&J.options.hyperlink&&!J.options.hyperlink._rId)if(typeof J.options.hyperlink!=="object")console.log("ERROR: text `hyperlink` option should be an object. Ex: `hyperlink: {url:'https://github.com'}` ");else if(!J.options.hyperlink.url&&!J.options.hyperlink.slide)console.log("ERROR: 'hyperlink requires either: `url` or `slide`'");else{let G=a2($);$._rels.push({type:D0.hyperlink,data:J.options.hyperlink.slide?"slide":"dummy",rId:G,Target:k0(J.options.hyperlink.url)||J.options.hyperlink.slide.toString()}),J.options.hyperlink._rId=G}else if(J&&typeof J==="object"&&J.options&&J.options.hyperlink&&J.options.hyperlink._rId){if($._rels.filter((G)=>G.rId===J.options.hyperlink._rId).length===0)$._rels.push({type:D0.hyperlink,data:J.options.hyperlink.slide?"slide":"dummy",rId:J.options.hyperlink._rId,Target:k0(J.options.hyperlink.url)||J.options.hyperlink.slide.toString()})}})}class zJ{constructor($){var q;this.addSlide=$.addSlide,this.getSlide=$.getSlide,this._name=`Slide ${$.slideNumber}`,this._presLayout=$.presLayout,this._rId=$.slideRId,this._rels=[],this._relsChart=[],this._relsMedia=[],this._setSlideNum=$.setSlideNum,this._slideId=$.slideId,this._slideLayout=$.slideLayout||null,this._slideNum=$.slideNumber,this._slideObjects=[],this._slideNumberProps=((q=this._slideLayout)===null||q===void 0?void 0:q._slideNumberProps)?this._slideLayout._slideNumberProps:null}set bkgd($){if(this._bkgd=$,!this._background||!this._background.color){if(!this._background)this._background={};if(typeof $==="string")this._background.color=$}}get bkgd(){return this._bkgd}set background($){if(this._background=$,$)BJ($,this)}get background(){return this._background}set color($){this._color=$}get color(){return this._color}set hidden($){this._hidden=$}get hidden(){return this._hidden}set slideNumber($){this._slideNumberProps=$,this._setSlideNum($)}get slideNumber(){return this._slideNumberProps}get newAutoPagedSlides(){return this._newAutoPagedSlides}addChart($,q,Q){let K=Q||{};return K._type=$,GJ(this,$,q,Q),this}addImage($){return WJ(this,$),this}addMedia($){return fB(this,$),this}addNotes($){return RB(this,$),this}addShape($,q){return E7(this,$,q),this}addTable($,q){return this._newAutoPagedSlides=IB(this,$,q,this._slideLayout,this._presLayout,this.addSlide,this.getSlide),this}addText($,q){return L5(this,typeof $==="string"||typeof $==="number"?[{text:$,options:q}]:$,q,!1),this}}function jB($,q){return W2(this,void 0,void 0,function*(){let Q=$.data;return yield new Promise((K,J)=>{var Z,G;let W=new _7.default,B=(Q.length-1)*2+1,V=((G=(Z=Q[0])===null||Z===void 0?void 0:Z.labels)===null||G===void 0?void 0:G.length)>1;W.folder("_rels"),W.folder("docProps"),W.folder("xl/_rels"),W.folder("xl/tables"),W.folder("xl/theme"),W.folder("xl/worksheets"),W.folder("xl/worksheets/_rels"),W.file("[Content_Types].xml",' \n'),W.file("_rels/.rels",` +`);return V}function yB($,q,Q={},K){let J=Q||{};J.slideMargin=J.slideMargin||J.slideMargin===0?J.slideMargin:0.5;let Z=J.w||$.presLayout.width,G=[],W=[],B=[],V=[],U=[],w=[0.5,0.5,0.5,0.5],F=0;if(!document.getElementById(q))throw Error('tableToSlides: Table ID "'+q+'" does not exist!');if(K===null||K===void 0?void 0:K._margin){if(Array.isArray(K._margin))w=K._margin;else if(!isNaN(K._margin))w=[K._margin,K._margin,K._margin,K._margin];J.slideMargin=w}else if(J===null||J===void 0?void 0:J.slideMargin){if(Array.isArray(J.slideMargin))w=J.slideMargin;else if(!isNaN(J.slideMargin))w=[J.slideMargin,J.slideMargin,J.slideMargin,J.slideMargin]}if(Z=(J.w?v0(J.w):$.presLayout.width)-v0(w[1]+w[3]),J.verbose)console.log("[[VERBOSE MODE]]"),console.log("|-- `tableToSlides` ----------------------------------------------------|"),console.log(`| tableProps.h .................................... = ${J.h}`),console.log(`| tableProps.w .................................... = ${J.w}`),console.log(`| pptx.presLayout.width ........................... = ${($.presLayout.width/L0).toFixed(1)}`),console.log(`| pptx.presLayout.height .......................... = ${($.presLayout.height/L0).toFixed(1)}`),console.log(`| emuSlideTabW .................................... = ${(Z/L0).toFixed(1)}`);let M=document.querySelectorAll(`#${q} tr:first-child th`);if(M.length===0)M=document.querySelectorAll(`#${q} tr:first-child td`);if(M.forEach((f)=>{let L=f;if(L.getAttribute("colspan"))for(let D=0;D{F+=f}),U.forEach((f,L)=>{let D=Number((Number(Z)*(f/F*100)/100/L0).toFixed(2)),z=0,N=document.querySelector(`#${q} thead tr:first-child th:nth-child(${L+1})`);if(N)z=Number(N.getAttribute("data-pptx-min-width"));let H=document.querySelector(`#${q} thead tr:first-child th:nth-child(${L+1})`);if(H)z=Number(H.getAttribute("data-pptx-width"));V.push(z>D?z:D)}),J.verbose)console.log(`| arrColW ......................................... = [${V.join(", ")}]`);["thead","tbody","tfoot"].forEach((f)=>{document.querySelectorAll(`#${q} ${f} tr`).forEach((L)=>{let D=L,z=[];switch(Array.from(D.cells).forEach((N)=>{let H=window.getComputedStyle(N).getPropertyValue("color").replace(/\s+/gi,"").replace("rgba(","").replace("rgb(","").replace(")","").split(","),v=window.getComputedStyle(N).getPropertyValue("background-color").replace(/\s+/gi,"").replace("rgba(","").replace("rgb(","").replace(")","").split(",");if(window.getComputedStyle(N).getPropertyValue("background-color")==="rgba(0, 0, 0, 0)"||window.getComputedStyle(N).getPropertyValue("transparent"))v=["255","255","255"];let j={align:null,bold:window.getComputedStyle(N).getPropertyValue("font-weight")==="bold"||Number(window.getComputedStyle(N).getPropertyValue("font-weight"))>=500,border:null,color:g7(Number(H[0]),Number(H[1]),Number(H[2])),fill:{color:g7(Number(v[0]),Number(v[1]),Number(v[2]))},fontFace:(window.getComputedStyle(N).getPropertyValue("font-family")||"").split(",")[0].replace(/"/g,"").replace("inherit","").replace("initial","")||null,fontSize:Number(window.getComputedStyle(N).getPropertyValue("font-size").replace(/[a-z]/gi,"")),margin:null,colspan:Number(N.getAttribute("colspan"))||null,rowspan:Number(N.getAttribute("rowspan"))||null,valign:null};if(["left","center","right","start","end"].includes(window.getComputedStyle(N).getPropertyValue("text-align"))){let n=window.getComputedStyle(N).getPropertyValue("text-align").replace("start","left").replace("end","right");j.align=n==="center"?"center":n==="left"?"left":n==="right"?"right":null}if(["top","middle","bottom"].includes(window.getComputedStyle(N).getPropertyValue("vertical-align"))){let n=window.getComputedStyle(N).getPropertyValue("vertical-align");j.valign=n==="top"?"top":n==="middle"?"middle":n==="bottom"?"bottom":null}if(window.getComputedStyle(N).getPropertyValue("padding-left"))j.margin=[0,0,0,0],["padding-top","padding-right","padding-bottom","padding-left"].forEach((d,_)=>{j.margin[_]=Math.round(Number(window.getComputedStyle(N).getPropertyValue(d).replace(/\D/gi,"")))});if(window.getComputedStyle(N).getPropertyValue("border-top-width")||window.getComputedStyle(N).getPropertyValue("border-right-width")||window.getComputedStyle(N).getPropertyValue("border-bottom-width")||window.getComputedStyle(N).getPropertyValue("border-left-width"))j.border=[null,null,null,null],["top","right","bottom","left"].forEach((d,_)=>{let X=Math.round(Number(window.getComputedStyle(N).getPropertyValue("border-"+d+"-width").replace("px",""))),P=[];P=window.getComputedStyle(N).getPropertyValue("border-"+d+"-color").replace(/\s+/gi,"").replace("rgba(","").replace("rgb(","").replace(")","").split(",");let g=g7(Number(P[0]),Number(P[1]),Number(P[2]));j.border[_]={pt:X,color:g}});z.push({_type:D0.tablecell,text:N.innerText,options:j})}),f){case"thead":G.push(z);break;case"tbody":W.push(z);break;case"tfoot":B.push(z);break;default:console.log(`table parsing: unexpected table part: ${f}`);break}})}),J._arrObjTabHeadRows=G||null,J.colW=V,GJ([...G,...W,...B],J,$.presLayout,K).forEach((f,L)=>{let D=$.addSlide({masterName:J.masterSlideName||null});if(L===0)J.y=J.y||w[0];if(L>0)J.y=J.autoPageSlideStartY||J.newSlideStartY||w[0];if(J.verbose)console.log(`| opts.autoPageSlideStartY: ${J.autoPageSlideStartY} / arrInchMargins[0]: ${w[0]} => opts.y = ${J.y}`);if(D.addTable(f.rows,{x:J.x||w[3],y:J.y,w:Number(Z)/L0,colW:V,autoPage:!1}),J.addImage)if(J.addImage.options=J.addImage.options||{},!J.addImage.image||!J.addImage.image.path&&!J.addImage.image.data)console.warn("Warning: tableToSlides.addImage requires either `path` or `data`");else D.addImage({path:J.addImage.image.path,data:J.addImage.image.data,x:J.addImage.options.x,y:J.addImage.options.y,w:J.addImage.options.w,h:J.addImage.options.h});if(J.addShape)D.addShape(J.addShape.shapeName,J.addShape.options||{});if(J.addTable)D.addTable(J.addTable.rows,J.addTable.options||{});if(J.addText)D.addText(J.addText.text,J.addText.options||{})})}var hB=0;function xB($,q){if($.bkgd)q.bkgd=$.bkgd;if($.objects&&Array.isArray($.objects)&&$.objects.length>0)$.objects.forEach((Q,K)=>{let J=Object.keys(Q)[0],Z=q;if(W1[J]&&J==="chart")WJ(Z,Q[J].type,Q[J].data,Q[J].opts);else if(W1[J]&&J==="image")BJ(Z,Q[J]);else if(W1[J]&&J==="line")E7(Z,B1.LINE,Q[J]);else if(W1[J]&&J==="rect")E7(Z,B1.RECTANGLE,Q[J]);else if(W1[J]&&J==="text")L5(Z,[{text:Q[J].text}],Q[J].options,!1);else if(W1[J]&&J==="placeholder")Q[J].options.placeholder=Q[J].options.name,delete Q[J].options.name,Q[J].options._placeholderType=Q[J].options.type,delete Q[J].options.type,Q[J].options._placeholderIdx=100+K,L5(Z,[{text:Q[J].text}],Q[J].options,!0)});if($.slideNumber&&typeof $.slideNumber==="object")q._slideNumberProps=$.slideNumber}function WJ($,q,Q,K){var J;function Z(w){if(!w||w.style==="none")return;if(w.size!==void 0&&(isNaN(Number(w.size))||w.size<=0))console.warn("Warning: chart.gridLine.size must be greater than 0."),delete w.size;if(w.style&&!["solid","dash","dot"].includes(w.style))console.warn("Warning: chart.gridLine.style options: `solid`, `dash`, `dot`."),delete w.style;if(w.cap&&!["flat","square","round"].includes(w.cap))console.warn("Warning: chart.gridLine.cap options: `flat`, `square`, `round`."),delete w.cap}let G=++hB,W={_type:null,text:null,options:null,chartRid:null},B=null,V=[];if(Array.isArray(q))q.forEach((w)=>{V=V.concat(w.data)}),B=Q||K;else V=Q,B=K;V.forEach((w,F)=>{if(w._dataIndex=F,w.labels!==void 0&&!Array.isArray(w.labels[0]))w.labels=[w.labels]});let U=B&&typeof B==="object"?B:{};if(U._type=q,U.x=typeof U.x<"u"&&U.x!=null&&!isNaN(Number(U.x))?U.x:1,U.y=typeof U.y<"u"&&U.y!=null&&!isNaN(Number(U.y))?U.y:1,U.w=U.w||"50%",U.h=U.h||"50%",U.objectName=U.objectName?k0(U.objectName):`Chart ${$._slideObjects.filter((w)=>w._type===D0.chart).length}`,!["bar","col"].includes(U.barDir||""))U.barDir="col";if(U._type===q0.AREA){if(!["stacked","standard","percentStacked"].includes(U.barGrouping||""))U.barGrouping="standard"}if(U._type===q0.BAR){if(!["clustered","stacked","percentStacked"].includes(U.barGrouping||""))U.barGrouping="clustered"}if(U._type===q0.BAR3D){if(!["clustered","stacked","standard","percentStacked"].includes(U.barGrouping||""))U.barGrouping="standard"}if((J=U.barGrouping)===null||J===void 0?void 0:J.includes("tacked")){if(!U.barGapWidthPct)U.barGapWidthPct=50}if(U.dataLabelPosition){if(U._type===q0.AREA||U._type===q0.BAR3D||U._type===q0.DOUGHNUT||U._type===q0.RADAR)delete U.dataLabelPosition;if(U._type===q0.PIE){if(!["bestFit","ctr","inEnd","outEnd"].includes(U.dataLabelPosition))delete U.dataLabelPosition}if(U._type===q0.BUBBLE||U._type===q0.BUBBLE3D||U._type===q0.LINE||U._type===q0.SCATTER){if(!["b","ctr","l","r","t"].includes(U.dataLabelPosition))delete U.dataLabelPosition}if(U._type===q0.BAR){if(!["stacked","percentStacked"].includes(U.barGrouping||"")){if(!["ctr","inBase","inEnd"].includes(U.dataLabelPosition))delete U.dataLabelPosition}if(!["clustered"].includes(U.barGrouping||"")){if(!["ctr","inBase","inEnd","outEnd"].includes(U.dataLabelPosition))delete U.dataLabelPosition}}}if(U.dataLabelBkgrdColors=U.dataLabelBkgrdColors||!U.dataLabelBkgrdColors?U.dataLabelBkgrdColors:!1,!["b","l","r","t","tr"].includes(U.legendPos||""))U.legendPos="r";if(!["cone","coneToMax","box","cylinder","pyramid","pyramidToMax"].includes(U.bar3DShape||""))U.bar3DShape="box";if(!["circle","dash","diamond","dot","none","square","triangle"].includes(U.lineDataSymbol||""))U.lineDataSymbol="circle";if(!["gap","span"].includes(U.displayBlanksAs||""))U.displayBlanksAs="span";if(!["standard","marker","filled"].includes(U.radarStyle||""))U.radarStyle="standard";if(U.lineDataSymbolSize=U.lineDataSymbolSize&&!isNaN(U.lineDataSymbolSize)?U.lineDataSymbolSize:6,U.lineDataSymbolLineSize=U.lineDataSymbolLineSize&&!isNaN(U.lineDataSymbolLineSize)?Y0(U.lineDataSymbolLineSize):Y0(0.75),U.layout)["x","y","w","h"].forEach((w)=>{let F=U.layout[w];if(isNaN(Number(F))||F<0||F>1)console.warn("Warning: chart.layout."+w+" can only be 0-1"),delete U.layout[w]});if(U.catGridLine=U.catGridLine||(U._type===q0.SCATTER?{color:"D9D9D9",size:1}:{style:"none"}),U.valGridLine=U.valGridLine||(U._type===q0.SCATTER?{color:"D9D9D9",size:1}:{}),U.serGridLine=U.serGridLine||(U._type===q0.SCATTER?{color:"D9D9D9",size:1}:{style:"none"}),Z(U.catGridLine),Z(U.valGridLine),Z(U.serGridLine),c7(U.shadow),U.showDataTable=U.showDataTable||!U.showDataTable?U.showDataTable:!1,U.showDataTableHorzBorder=U.showDataTableHorzBorder||!U.showDataTableHorzBorder?U.showDataTableHorzBorder:!0,U.showDataTableVertBorder=U.showDataTableVertBorder||!U.showDataTableVertBorder?U.showDataTableVertBorder:!0,U.showDataTableOutline=U.showDataTableOutline||!U.showDataTableOutline?U.showDataTableOutline:!0,U.showDataTableKeys=U.showDataTableKeys||!U.showDataTableKeys?U.showDataTableKeys:!0,U.showLabel=U.showLabel||!U.showLabel?U.showLabel:!1,U.showLegend=U.showLegend||!U.showLegend?U.showLegend:!1,U.showPercent=U.showPercent||!U.showPercent?U.showPercent:!0,U.showTitle=U.showTitle||!U.showTitle?U.showTitle:!1,U.showValue=U.showValue||!U.showValue?U.showValue:!1,U.showLeaderLines=U.showLeaderLines||!U.showLeaderLines?U.showLeaderLines:!1,U.catAxisLineShow=typeof U.catAxisLineShow<"u"?U.catAxisLineShow:!0,U.valAxisLineShow=typeof U.valAxisLineShow<"u"?U.valAxisLineShow:!0,U.serAxisLineShow=typeof U.serAxisLineShow<"u"?U.serAxisLineShow:!0,U.v3DRotX=!isNaN(U.v3DRotX)&&U.v3DRotX>=-90&&U.v3DRotX<=90?U.v3DRotX:30,U.v3DRotY=!isNaN(U.v3DRotY)&&U.v3DRotY>=0&&U.v3DRotY<=360?U.v3DRotY:30,U.v3DRAngAx=U.v3DRAngAx||!U.v3DRAngAx?U.v3DRAngAx:!0,U.v3DPerspective=!isNaN(U.v3DPerspective)&&U.v3DPerspective>=0&&U.v3DPerspective<=240?U.v3DPerspective:30,U.barGapWidthPct=!isNaN(U.barGapWidthPct)&&U.barGapWidthPct>=0&&U.barGapWidthPct<=1000?U.barGapWidthPct:150,U.barGapDepthPct=!isNaN(U.barGapDepthPct)&&U.barGapDepthPct>=0&&U.barGapDepthPct<=1000?U.barGapDepthPct:150,U.chartColors=Array.isArray(U.chartColors)?U.chartColors:U._type===q0.PIE||U._type===q0.DOUGHNUT?jB:z8,U.chartColorsOpacity=U.chartColorsOpacity&&!isNaN(U.chartColorsOpacity)?U.chartColorsOpacity:null,U.border=U.border&&typeof U.border==="object"?U.border:null,U.border&&(!U.border.pt||isNaN(U.border.pt)))U.border.pt=v6.pt;if(U.border&&(!U.border.color||typeof U.border.color!=="string"))U.border.color=v6.color;if(U.plotArea=U.plotArea||{},U.plotArea.border=U.plotArea.border&&typeof U.plotArea.border==="object"?U.plotArea.border:null,U.plotArea.border&&(!U.plotArea.border.pt||isNaN(U.plotArea.border.pt)))U.plotArea.border.pt=v6.pt;if(U.plotArea.border&&(!U.plotArea.border.color||typeof U.plotArea.border.color!=="string"))U.plotArea.border.color=v6.color;if(U.border)U.plotArea.border=U.border;if(U.plotArea.fill=U.plotArea.fill||{color:null,transparency:null},U.fill)U.plotArea.fill.color=U.fill;if(U.chartArea=U.chartArea||{},U.chartArea.border=U.chartArea.border&&typeof U.chartArea.border==="object"?U.chartArea.border:null,U.chartArea.border)U.chartArea.border={color:U.chartArea.border.color||v6.color,pt:U.chartArea.border.pt||v6.pt};if(U.chartArea.roundedCorners=typeof U.chartArea.roundedCorners==="boolean"?U.chartArea.roundedCorners:!0,U.dataBorder=U.dataBorder&&typeof U.dataBorder==="object"?U.dataBorder:null,U.dataBorder&&(!U.dataBorder.pt||isNaN(U.dataBorder.pt)))U.dataBorder.pt=0.75;if(U.dataBorder&&U.dataBorder.color){let w=typeof U.dataBorder.color==="string"&&U.dataBorder.color.length===6&&/^[0-9A-Fa-f]{6}$/.test(U.dataBorder.color),F=Object.values(D5).includes(U.dataBorder.color);if(!w&&!F)U.dataBorder.color="F9F9F9"}if(!U.dataLabelFormatCode&&U._type===q0.SCATTER)U.dataLabelFormatCode="General";if(!U.dataLabelFormatCode&&(U._type===q0.PIE||U._type===q0.DOUGHNUT))U.dataLabelFormatCode=U.showPercent?"0%":"General";if(U.dataLabelFormatCode=U.dataLabelFormatCode&&typeof U.dataLabelFormatCode==="string"?U.dataLabelFormatCode:"#,##0",!U.dataLabelFormatScatter&&U._type===q0.SCATTER)U.dataLabelFormatScatter="custom";if(U.lineSize=typeof U.lineSize==="number"?U.lineSize:2,U.valAxisMajorUnit=typeof U.valAxisMajorUnit==="number"?U.valAxisMajorUnit:null,U._type===q0.AREA||U._type===q0.BAR||U._type===q0.BAR3D||U._type===q0.LINE)U.catAxisMultiLevelLabels=!!U.catAxisMultiLevelLabels;else delete U.catAxisMultiLevelLabels;return W._type="chart",W.options=U,W.chartRid=a2($),$._relsChart.push({rId:a2($),data:V,opts:U,type:U._type,globalId:G,fileName:`chart${G}.xml`,Target:`/ppt/charts/chart${G}.xml`}),$._slideObjects.push(W),W}function BJ($,q){let Q={_type:null,text:null,options:null,image:null,imageRid:null,hyperlink:null},K=q.x||0,J=q.y||0,Z=q.w||0,G=q.h||0,W=q.sizing||null,B=q.hyperlink||"",V=q.data||"",U=q.path||"",w=a2($),F=q.objectName?k0(q.objectName):`Image ${$._slideObjects.filter((k)=>k._type===D0.image).length}`;if(!U&&!V)return console.error("ERROR: addImage() requires either 'data' or 'path' parameter!"),null;else if(U&&typeof U!=="string")return console.error(`ERROR: addImage() 'path' should be a string, ex: {path:'/img/sample.png'} - you sent ${String(U)}`),null;else if(V&&typeof V!=="string")return console.error(`ERROR: addImage() 'data' should be a string, ex: {data:'image/png;base64,NMP[...]'} - you sent ${String(V)}`),null;else if(V&&typeof V==="string"&&!V.toLowerCase().includes("base64,"))return console.error("ERROR: Image `data` value lacks a base64 header! Ex: 'image/png;base64,NMP[...]')"),null;let M=(U.substring(U.lastIndexOf("/")+1).split("?")[0].split(".").pop().split("#")[0]||"png").toLowerCase();if(V&&/image\/(\w+);/.exec(V)&&/image\/(\w+);/.exec(V).length>0)M=/image\/(\w+);/.exec(V)[1];else if(V===null||V===void 0?void 0:V.toLowerCase().includes("image/svg+xml"))M="svg";if(Q._type=D0.image,Q.image=U||"preencoded.png",Q.options={x:K||0,y:J||0,w:Z||1,h:G||1,altText:q.altText||"",rounding:typeof q.rounding==="boolean"?q.rounding:!1,sizing:W,placeholder:q.placeholder,rotate:q.rotate||0,flipV:q.flipV||!1,flipH:q.flipH||!1,transparency:q.transparency||0,objectName:F,shadow:c7(q.shadow)},M==="svg")$._relsMedia.push({path:U||V+"png",type:"image/png",extn:"png",data:V||"",rId:w,Target:`../media/image-${$._slideNum}-${$._relsMedia.length+1}.png`,isSvgPng:!0,svgSize:{w:H0(Q.options.w,"X",$._presLayout),h:H0(Q.options.h,"Y",$._presLayout)}}),Q.imageRid=w,$._relsMedia.push({path:U||V,type:"image/svg+xml",extn:M,data:V||"",rId:w+1,Target:`../media/image-${$._slideNum}-${$._relsMedia.length+1}.${M}`}),Q.imageRid=w+1;else{let k=$._relsMedia.filter((f)=>f.path&&f.path===U&&f.type==="image/"+M&&!f.isDuplicate)[0];$._relsMedia.push({path:U||"preencoded."+M,type:"image/"+M,extn:M,data:V||"",rId:w,isDuplicate:!!(k===null||k===void 0?void 0:k.Target),Target:(k===null||k===void 0?void 0:k.Target)?k.Target:`../media/image-${$._slideNum}-${$._relsMedia.length+1}.${M}`}),Q.imageRid=w}if(typeof B==="object")if(!B.url&&!B.slide)throw Error("ERROR: `hyperlink` option requires either: `url` or `slide`");else w++,$._rels.push({type:D0.hyperlink,data:B.slide?"slide":"dummy",rId:w,Target:B.url||B.slide.toString()}),B._rId=w,Q.hyperlink=B;$._slideObjects.push(Q)}function OB($,q){let Q=q.x||0,K=q.y||0,J=q.w||2,Z=q.h||2,G=q.data||"",W=q.link||"",B=q.path||"",V=q.type||"audio",U="",w=q.cover||gB,F=q.objectName?k0(q.objectName):`Media ${$._slideObjects.filter((k)=>k._type===D0.media).length}`,M={_type:D0.media};if(!B&&!G&&V!=="online")throw Error("addMedia() error: either `data` or `path` are required!");else if(G&&!G.toLowerCase().includes("base64,"))throw Error("addMedia() error: `data` value lacks a base64 header! Ex: 'video/mpeg;base64,NMP[...]')");else if(!w.toLowerCase().includes("base64,"))throw Error("addMedia() error: `cover` value lacks a base64 header! Ex: 'data:image/png;base64,iV[...]')");if(V==="online"&&!W)throw Error("addMedia() error: online videos require `link` value");if(U=q.extn||(G?G.split(";")[0].split("/")[1]:B.split(".").pop())||"mp3",M.mtype=V,M.media=B||"preencoded.mov",M.options={},M.options.x=Q,M.options.y=K,M.options.w=J,M.options.h=Z,M.options.objectName=F,V==="online"){let k=a2($);$._relsMedia.push({path:B||"preencoded"+U,data:"dummy",type:"online",extn:U,rId:k,Target:W}),M.mediaRid=k,$._relsMedia.push({path:"preencoded.png",data:w,type:"image/png",extn:"png",rId:a2($),Target:`../media/image-${$._slideNum}-${$._relsMedia.length+1}.png`})}else{let k=$._relsMedia.filter((L)=>L.path&&L.path===B&&L.type===V+"/"+U&&!L.isDuplicate)[0],f=a2($);$._relsMedia.push({path:B||"preencoded"+U,type:V+"/"+U,extn:U,data:G||"",rId:f,isDuplicate:!!(k===null||k===void 0?void 0:k.Target),Target:(k===null||k===void 0?void 0:k.Target)?k.Target:`../media/media-${$._slideNum}-${$._relsMedia.length+1}.${U}`}),M.mediaRid=f,$._relsMedia.push({path:B||"preencoded"+U,type:V+"/"+U,extn:U,data:G||"",rId:a2($),isDuplicate:!!(k===null||k===void 0?void 0:k.Target),Target:(k===null||k===void 0?void 0:k.Target)?k.Target:`../media/media-${$._slideNum}-${$._relsMedia.length+0}.${U}`}),$._relsMedia.push({path:"preencoded.png",type:"image/png",extn:"png",data:w,rId:a2($),Target:`../media/image-${$._slideNum}-${$._relsMedia.length+1}.png`})}$._slideObjects.push(M)}function PB($,q){$._slideObjects.push({_type:D0.notes,text:[{text:q}]})}function E7($,q,Q){let K=typeof Q==="object"?Q:{};K.line=K.line||{type:"none"};let J={_type:D0.text,shape:q||B1.RECTANGLE,options:K,text:null};if(!q)throw Error("Missing/Invalid shape parameter! Example: `addShape(pptxgen.shapes.LINE, {x:1, y:1, w:1, h:1});`");let Z={type:K.line.type||"solid",color:K.line.color||VJ,transparency:K.line.transparency||0,width:K.line.width||1,dashType:K.line.dashType||"solid",beginArrowType:K.line.beginArrowType||null,endArrowType:K.line.endArrowType||null};if(typeof K.line==="object"&&K.line.type!=="none")K.line=Z;if(K.x=K.x||(K.x===0?0:1),K.y=K.y||(K.y===0?0:1),K.w=K.w||(K.w===0?0:1),K.h=K.h||(K.h===0?0:1),K.objectName=K.objectName?k0(K.objectName):`Shape ${$._slideObjects.filter((G)=>G._type===D0.text).length}`,typeof K.line==="string"){let G=Z;G.color=String(K.line),K.line=G}if(typeof K.lineSize==="number")K.line.width=K.lineSize;if(typeof K.lineDash==="string")K.line.dashType=K.lineDash;if(typeof K.lineHead==="string")K.line.beginArrowType=K.lineHead;if(typeof K.lineTail==="string")K.line.endArrowType=K.lineTail;g6($,J),$._slideObjects.push(J)}function TB($,q,Q,K,J,Z,G){let W=[$],B=Q&&typeof Q==="object"?Q:{};B.objectName=B.objectName?k0(B.objectName):`Table ${$._slideObjects.filter((F)=>F._type===D0.table).length}`;{if(q===null||q.length===0||!Array.isArray(q))throw Error("addTable: Array expected! EX: 'slide.addTable( [rows], {options} );' (https://gitbrent.github.io/PptxGenJS/docs/api-tables.html)");if(!q[0]||!Array.isArray(q[0]))throw Error("addTable: 'rows' should be an array of cells! EX: 'slide.addTable( [ ['A'], ['B'], {text:'C',options:{align:'center'}} ] );' (https://gitbrent.github.io/PptxGenJS/docs/api-tables.html)")}let V=[];if(q.forEach((F)=>{let M=[];if(Array.isArray(F))F.forEach((k)=>{let f={_type:D0.tablecell,text:"",options:typeof k==="object"&&k.options?k.options:{}};if(typeof k==="string"||typeof k==="number")f.text=k.toString();else if(k.text){if(typeof k.text==="string"||typeof k.text==="number")f.text=k.text.toString();else if(k.text)f.text=k.text;if(k.options&&typeof k.options==="object")f.options=k.options}f.options.border=f.options.border||B.border||[{type:"none"},{type:"none"},{type:"none"},{type:"none"}];let L=f.options.border;if(!Array.isArray(L)&&typeof L==="object")f.options.border=[L,L,L,L];if(!f.options.border[0])f.options.border[0]={type:"none"};if(!f.options.border[1])f.options.border[1]={type:"none"};if(!f.options.border[2])f.options.border[2]={type:"none"};if(!f.options.border[3])f.options.border[3]={type:"none"};[0,1,2,3].forEach((z)=>{f.options.border[z]={type:f.options.border[z].type||H6.type,color:f.options.border[z].color||H6.color,pt:typeof f.options.border[z].pt==="number"?f.options.border[z].pt:H6.pt}}),M.push(f)});else console.log("addTable: tableRows has a bad row. A row should be an array of cells. You provided:"),console.log(F);V.push(M)}),B.x=H0(B.x||(B.x===0?0:L0/2),"X",J),B.y=H0(B.y||(B.y===0?0:L0/2),"Y",J),B.h)B.h=H0(B.h,"Y",J);if(B.fontSize=B.fontSize||k2,B.margin=B.margin===0||B.margin?B.margin:JJ,typeof B.margin==="number")B.margin=[Number(B.margin),Number(B.margin),Number(B.margin),Number(B.margin)];if(JSON.stringify({arrRows:V}).indexOf("hyperlink")===-1){if(!B.color)B.color=B.color||Q2}if(typeof B.border==="string")console.warn("addTable `border` option must be an object. Ex: `{border: {type:'none'}}`"),B.border=null;else if(Array.isArray(B.border))[0,1,2,3].forEach((F)=>{B.border[F]=B.border[F]?{type:B.border[F].type||H6.type,color:B.border[F].color||H6.color,pt:B.border[F].pt||H6.pt}:{type:"none"}});if(B.autoPage=typeof B.autoPage==="boolean"?B.autoPage:!1,B.autoPageRepeatHeader=typeof B.autoPageRepeatHeader==="boolean"?B.autoPageRepeatHeader:!1,B.autoPageHeaderRows=typeof B.autoPageHeaderRows<"u"&&!isNaN(Number(B.autoPageHeaderRows))?Number(B.autoPageHeaderRows):1,B.autoPageLineWeight=typeof B.autoPageLineWeight<"u"&&!isNaN(Number(B.autoPageLineWeight))?Number(B.autoPageLineWeight):0,B.autoPageLineWeight){if(B.autoPageLineWeight>1)B.autoPageLineWeight=1;else if(B.autoPageLineWeight<-1)B.autoPageLineWeight=-1}let U=M8;if(K&&typeof K._margin<"u"){if(Array.isArray(K._margin))U=K._margin;else if(!isNaN(Number(K._margin)))U=[Number(K._margin),Number(K._margin),Number(K._margin),Number(K._margin)]}if(B.colW){let F=V[0].reduce((M,k)=>{var f;if(((f=k===null||k===void 0?void 0:k.options)===null||f===void 0?void 0:f.colspan)&&typeof k.options.colspan==="number")M+=k.options.colspan;else M+=1;return M},0);if(typeof B.colW==="string"||typeof B.colW==="number")B.w=Math.floor(Number(B.colW)*F),B.colW=null;else if(B.colW&&Array.isArray(B.colW)&&B.colW.length===1&&F>1)B.w=Math.floor(Number(B.colW)*F),B.colW=null;else if(B.colW&&Array.isArray(B.colW)&&B.colW.length!==F)console.warn("addTable: mismatch: (colW.length != data.length) Therefore, defaulting to evenly distributed col widths."),B.colW=null}else if(B.w)B.w=H0(B.w,"X",J);else B.w=Math.floor(J._sizeW/L0-U[1]-U[3]);if(B.x&&B.x<20)B.x=v0(B.x);if(B.y&&B.y<20)B.y=v0(B.y);if(B.w&&typeof B.w==="number"&&B.w<20)B.w=v0(B.w);if(B.h&&typeof B.h==="number"&&B.h<20)B.h=v0(B.h);V.forEach((F)=>{F.forEach((M,k)=>{if(typeof M==="number"||typeof M==="string")F[k]={_type:D0.tablecell,text:String(F[k]),options:B};else if(typeof M==="object"){if(typeof M.text==="number")F[k].text=F[k].text.toString();else if(typeof M.text>"u"||M.text===null)F[k].text="";F[k].options=M.options||{},F[k]._type=D0.tablecell}})});let w=[];if(B&&!B.autoPage)g6($,V),$._slideObjects.push({_type:D0.table,arrTabRows:V,options:Object.assign({},B)});else{if(B.autoPageRepeatHeader)B._arrObjTabHeadRows=V.filter((F,M)=>M{if(!G($._slideNum+M))W.push(Z({masterName:(K===null||K===void 0?void 0:K._name)||null}));if(M>0)B.y=v0(B.autoPageSlideStartY||B.newSlideStartY||U[0]);{let k=G($._slideNum+M);if(B.autoPage=!1,g6(k,F.rows),k.addTable(F.rows,Object.assign({},B)),M>0)w.push(k)}})}return w}function L5($,q,Q,K){let J={_type:K?D0.placeholder:D0.text,shape:(Q===null||Q===void 0?void 0:Q.shape)||B1.RECTANGLE,text:!q||q.length===0?[{text:"",options:null}]:q,options:Q||{}};function Z(G){{if(!G.placeholder)G.color=G.color||J.options.color||$.color||Q2;if(G.placeholder||K)G.bullet=G.bullet||!1;if(G.placeholder&&$._slideLayout&&$._slideLayout._slideObjects){let W=$._slideLayout._slideObjects.filter((B)=>B._type==="placeholder"&&B.options&&B.options.placeholder&&B.options.placeholder===G.placeholder)[0];if(W===null||W===void 0?void 0:W.options)G=Object.assign(Object.assign({},G),W.options)}if(G.objectName=G.objectName?k0(G.objectName):`Text ${$._slideObjects.filter((W)=>W._type===D0.text).length}`,G.shape===B1.LINE){let W={type:G.line.type||"solid",color:G.line.color||VJ,transparency:G.line.transparency||0,width:G.line.width||1,dashType:G.line.dashType||"solid",beginArrowType:G.line.beginArrowType||null,endArrowType:G.line.endArrowType||null};if(typeof G.line==="object")G.line=W;if(typeof G.line==="string"){let B=W;if(typeof G.line==="string")B.color=G.line;G.line=B}if(typeof G.lineSize==="number")G.line.width=G.lineSize;if(typeof G.lineDash==="string")G.line.dashType=G.lineDash;if(typeof G.lineHead==="string")G.line.beginArrowType=G.lineHead;if(typeof G.lineTail==="string")G.line.endArrowType=G.lineTail}if(G.line=G.line||{},G.lineSpacing=G.lineSpacing&&!isNaN(G.lineSpacing)?G.lineSpacing:null,G.lineSpacingMultiple=G.lineSpacingMultiple&&!isNaN(G.lineSpacingMultiple)?G.lineSpacingMultiple:null,G._bodyProp=G._bodyProp||{},G._bodyProp.autoFit=G.autoFit||!1,G._bodyProp.anchor=!G.placeholder?I6.ctr:null,G._bodyProp.vert=G.vert||null,G._bodyProp.wrap=typeof G.wrap==="boolean"?G.wrap:!0,G.inset&&!isNaN(Number(G.inset))||G.inset===0)G._bodyProp.lIns=v0(G.inset),G._bodyProp.rIns=v0(G.inset),G._bodyProp.tIns=v0(G.inset),G._bodyProp.bIns=v0(G.inset);if(typeof G.underline==="boolean"&&G.underline===!0)G.underline={style:"sng"}}{if((G.align||"").toLowerCase().indexOf("c")===0)G._bodyProp.align=R6.center;else if((G.align||"").toLowerCase().indexOf("l")===0)G._bodyProp.align=R6.left;else if((G.align||"").toLowerCase().indexOf("r")===0)G._bodyProp.align=R6.right;else if((G.align||"").toLowerCase().indexOf("j")===0)G._bodyProp.align=R6.justify;if((G.valign||"").toLowerCase().indexOf("b")===0)G._bodyProp.anchor=I6.b;else if((G.valign||"").toLowerCase().indexOf("m")===0)G._bodyProp.anchor=I6.ctr;else if((G.valign||"").toLowerCase().indexOf("t")===0)G._bodyProp.anchor=I6.t}return c7(G.shadow),G}J.options=Z(J.options),J.text.forEach((G)=>G.options=Z(G.options||{})),g6($,J.text||""),$._slideObjects.push(J)}function uB($){($._slideLayout._slideObjects||[]).forEach((q)=>{if(q._type===D0.placeholder){if($._slideObjects.filter((Q)=>Q.options&&Q.options.placeholder===q.options.placeholder).length===0)L5($,[{text:""}],q.options,!1)}})}function zJ($,q){var Q;if(q.bkgd){if(!q.background)q.background={};if(typeof q.bkgd==="string")q.background.color=q.bkgd;else{if(q.bkgd.data)q.background.data=q.bkgd.data;if(q.bkgd.path)q.background.path=q.bkgd.path;if(q.bkgd.src)q.background.path=q.bkgd.src}}if((Q=q.background)===null||Q===void 0?void 0:Q.fill)q.background.color=q.background.fill;if($&&($.path||$.data)){$.path=$.path||"preencoded.png";let K=($.path.split(".").pop()||"png").split("?")[0];if(K==="jpg")K="jpeg";q._relsMedia=q._relsMedia||[];let J=q._relsMedia.length+1;q._relsMedia.push({path:$.path,type:D0.image,extn:K,data:$.data||null,rId:J,Target:`../media/${(q._name||"").replace(/\s+/gi,"-")}-image-${q._relsMedia.length+1}.${K}`}),q._bkgdImgRid=J}}function g6($,q,Q){let K=[];if(typeof q==="string"||typeof q==="number")return;else if(Array.isArray(q))K=q;else if(typeof q==="object")K=[q];K.forEach((J,Z)=>{if(Q&&Q[Z]&&Q[Z].hyperlink)J.options=Object.assign(Object.assign({},J.options),Q[Z]);if(Array.isArray(J)){let G=[];J.forEach((W)=>{if(W.options&&!W.text.options)G.push(W.options)}),g6($,J,G)}else if(Array.isArray(J.text))g6($,J.text,Q&&Q[Z]?[Q[Z]]:void 0);else if(J&&typeof J==="object"&&J.options&&J.options.hyperlink&&!J.options.hyperlink._rId)if(typeof J.options.hyperlink!=="object")console.log("ERROR: text `hyperlink` option should be an object. Ex: `hyperlink: {url:'https://github.com'}` ");else if(!J.options.hyperlink.url&&!J.options.hyperlink.slide)console.log("ERROR: 'hyperlink requires either: `url` or `slide`'");else{let G=a2($);$._rels.push({type:D0.hyperlink,data:J.options.hyperlink.slide?"slide":"dummy",rId:G,Target:k0(J.options.hyperlink.url)||J.options.hyperlink.slide.toString()}),J.options.hyperlink._rId=G}else if(J&&typeof J==="object"&&J.options&&J.options.hyperlink&&J.options.hyperlink._rId){if($._rels.filter((G)=>G.rId===J.options.hyperlink._rId).length===0)$._rels.push({type:D0.hyperlink,data:J.options.hyperlink.slide?"slide":"dummy",rId:J.options.hyperlink._rId,Target:k0(J.options.hyperlink.url)||J.options.hyperlink.slide.toString()})}})}class FJ{constructor($){var q;this.addSlide=$.addSlide,this.getSlide=$.getSlide,this._name=`Slide ${$.slideNumber}`,this._presLayout=$.presLayout,this._rId=$.slideRId,this._rels=[],this._relsChart=[],this._relsMedia=[],this._setSlideNum=$.setSlideNum,this._slideId=$.slideId,this._slideLayout=$.slideLayout||null,this._slideNum=$.slideNumber,this._slideObjects=[],this._slideNumberProps=((q=this._slideLayout)===null||q===void 0?void 0:q._slideNumberProps)?this._slideLayout._slideNumberProps:null}set bkgd($){if(this._bkgd=$,!this._background||!this._background.color){if(!this._background)this._background={};if(typeof $==="string")this._background.color=$}}get bkgd(){return this._bkgd}set background($){if(this._background=$,$)zJ($,this)}get background(){return this._background}set color($){this._color=$}get color(){return this._color}set hidden($){this._hidden=$}get hidden(){return this._hidden}set slideNumber($){this._slideNumberProps=$,this._setSlideNum($)}get slideNumber(){return this._slideNumberProps}get newAutoPagedSlides(){return this._newAutoPagedSlides}addChart($,q,Q){let K=Q||{};return K._type=$,WJ(this,$,q,Q),this}addImage($){return BJ(this,$),this}addMedia($){return OB(this,$),this}addNotes($){return PB(this,$),this}addShape($,q){return E7(this,$,q),this}addTable($,q){return this._newAutoPagedSlides=TB(this,$,q,this._slideLayout,this._presLayout,this.addSlide,this.getSlide),this}addText($,q){return L5(this,typeof $==="string"||typeof $==="number"?[{text:$,options:q}]:$,q,!1),this}}function SB($,q){return W2(this,void 0,void 0,function*(){let Q=$.data;return yield new Promise((K,J)=>{var Z,G;let W=new _7.default,B=(Q.length-1)*2+1,V=((G=(Z=Q[0])===null||Z===void 0?void 0:Z.labels)===null||G===void 0?void 0:G.length)>1;W.folder("_rels"),W.folder("docProps"),W.folder("xl/_rels"),W.folder("xl/tables"),W.folder("xl/theme"),W.folder("xl/worksheets"),W.folder("xl/worksheets/_rels"),W.file("[Content_Types].xml",' \n'),W.file("_rels/.rels",` `),W.file("docProps/app.xml",`Microsoft Macintosh Excel0falseWorksheets1Sheet1falsefalsefalse16.0300 `),W.file("docProps/core.xml",'PptxGenJSPptxGenJS'+new Date().toISOString()+''+new Date().toISOString()+""),W.file("xl/_rels/workbook.xml.rels",''),W.file("xl/styles.xml",'\n'),W.file("xl/theme/theme1.xml",''),W.file("xl/workbook.xml",` `),W.file("xl/worksheets/_rels/sheet1.xml.rels",` `);{let U='';if($.opts._type===q0.BUBBLE||$.opts._type===q0.BUBBLE3D)U+=``;else if($.opts._type===q0.SCATTER)U+=``;else if(V){let w=Q.length;Q[0].labels.forEach((F)=>w+=F.filter((M)=>M&&M!=="").length),U+=``,U+=""}else{let w=Q.length+Q[0].labels.length*Q[0].labels[0].length+Q[0].labels.length,F=Q.length+Q[0].labels.length*Q[0].labels[0].length+1;U+=``,U+=''}if($.opts._type===q0.BUBBLE||$.opts._type===q0.BUBBLE3D)Q.forEach((w,F)=>{if(F===0)U+="X-Axis";else U+=`${k0(w.name||`Y-Axis${F}`)}`,U+=`${k0(`Size${F}`)}`});else Q.forEach((w)=>{U+=`${k0((w.name||" ").replace("X-Axis","X-Values"))}`});if($.opts._type!==q0.BUBBLE&&$.opts._type!==q0.BUBBLE3D&&$.opts._type!==q0.SCATTER)Q[0].labels.slice().reverse().forEach((w)=>{w.filter((F)=>F&&F!=="").forEach((F)=>{U+=`${k0(F)}`})});U+=` `,W.file("xl/sharedStrings.xml",U)}{let U='';if($.opts._type===q0.BUBBLE||$.opts._type===q0.BUBBLE3D){U+=``,U+=``;let w=1;Q.forEach((F,M)=>{if(M===0)U+=``;else U+=``,w++,U+=``})}else if($.opts._type===q0.SCATTER)U+=`
`,U+=``,Q.forEach((w,F)=>{U+=``});else U+=`
`,U+=``,Q[0].labels.forEach((w,F)=>{U+=``}),Q.forEach((w,F)=>{U+=``});U+="",U+='',U+="
",W.file("xl/tables/table1.xml",U)}{let U='';if(U+='',$.opts._type===q0.BUBBLE||$.opts._type===q0.BUBBLE3D)U+=``;else if($.opts._type===q0.SCATTER)U+=``;else U+=``;if(U+='',U+='',$.opts._type===q0.BUBBLE||$.opts._type===q0.BUBBLE3D){U+="",U+=``,U+='0';for(let w=1;w${w}`;U+="",Q[0].values.forEach((w,F)=>{U+=``,U+=`${w}`;let M=2;for(let k=1;k${Q[k].values[F]||""}`,M++,U+=`${Q[k].sizes[F]||""}`,M++;U+=""})}else if($.opts._type===q0.SCATTER){U+="",U+=``;for(let w=0;w${w}`;U+="",Q[0].values.forEach((w,F)=>{U+=``,U+=`${w}`;for(let M=1;M${Q[M].values[F]||Q[M].values[F]===0?Q[M].values[F]:""}`;U+=""})}else if(U+="",!V){U+=``,Q[0].labels.forEach((w,F)=>{U+=`0`});for(let w=0;w${w+1}`;U+="",Q[0].labels[0].forEach((w,F)=>{U+=``;for(let M=Q[0].labels.length-1;M>=0;M--)U+=``,U+=`${Q.length+F+1}`,U+="";for(let M=0;M${Q[M].values[F]||""}`;U+=""})}else{U+=``;for(let k=0;k0`;for(let k=Q[0].labels.length-1;k${k}`;U+="";let w=Q.length,F=Q[0].labels[0].length,M=Q[0].labels.length;for(let k=0;k`;let f=w,L=Q[0].labels.slice().reverse();L.forEach((D,z)=>{if(D[k]){let H=z===0?1:L[z-1].filter((v)=>v&&v!=="").length;f+=H,U+=`${f}`}});for(let D=0;D${Q[D].values[k]||0}`;U+=""}}U+="",U+='',U+=` -`,W.file("xl/worksheets/sheet1.xml",U)}W.generateAsync({type:"base64"}).then((U)=>{q.file(`ppt/embeddings/Microsoft_Excel_Worksheet${$.globalId}.xlsx`,U,{base64:!0}),q.file("ppt/charts/_rels/"+$.fileName+".rels",``),q.file(`ppt/charts/${$.fileName}`,gB($)),K("")}).catch((U)=>{J(U)})})})}function gB($){var q,Q,K,J;let Z='',G=!1;{if(Z+='',Z+='',Z+=``,Z+="",$.opts.showTitle)Z+=H5({title:$.opts.title||"Chart Title",color:$.opts.titleColor,fontFace:$.opts.titleFontFace,fontSize:$.opts.titleFontSize||MB,titleAlign:$.opts.titleAlign,titleBold:$.opts.titleBold,titlePos:$.opts.titlePos,titleRotate:$.opts.titleRotate},$.opts.x,$.opts.y),Z+='';else Z+='';if($.opts._type===q0.BAR3D)Z+=``;if(Z+="",$.opts.layout)Z+="",Z+=" ",Z+=' ',Z+=' ',Z+=' ',Z+=' ',Z+=' ',Z+=' ',Z+=' ',Z+=" ",Z+="";else Z+=""}if(Array.isArray($.opts._type))$.opts._type.forEach((W)=>{let B=Object.assign(Object.assign({},$.opts),W.options),V=B.secondaryValAxis?N5:o2,U=B.secondaryCatAxis?x7:B8;G=G||B.secondaryValAxis,Z+=eK(W.type,W.data,B,V,U)});else Z+=eK($.opts._type,$.data,$.opts,o2,B8);if($.opts._type!==q0.PIE&&$.opts._type!==q0.DOUGHNUT){if($.opts.valAxes&&$.opts.valAxes.length>1&&!G)throw Error("Secondary axis must be used by one of the multiple charts");if($.opts.catAxes){if(!$.opts.valAxes||$.opts.valAxes.length!==$.opts.catAxes.length)throw Error("There must be the same number of value and category axes.");Z+=A7(Object.assign(Object.assign({},$.opts),$.opts.catAxes[0]),B8,o2)}else Z+=A7($.opts,B8,o2);if($.opts.valAxes){if(Z+=X7(Object.assign(Object.assign({},$.opts),$.opts.valAxes[0]),o2),$.opts.valAxes[1])Z+=X7(Object.assign(Object.assign({},$.opts),$.opts.valAxes[1]),N5)}else if(Z+=X7($.opts,o2),$.opts._type===q0.BAR3D)Z+=AB($.opts,VJ,o2);if(((q=$.opts)===null||q===void 0?void 0:q.catAxes)&&((Q=$.opts)===null||Q===void 0?void 0:Q.catAxes[1]))Z+=A7(Object.assign(Object.assign({},$.opts),$.opts.catAxes[1]),x7,N5)}{if($.opts.showDataTable)Z+="",Z+=` `,Z+=` `,Z+=` `,Z+=` `,Z+=" ",Z+=" ",Z+=' ',Z+=" ",Z+=" ",Z+=" ",Z+=' ',Z+=" ",Z+=" ",Z+=' ',Z+=` `,Z+=' ',Z+=' ',Z+=' ',Z+=' ',Z+=" ",Z+=" ",Z+=' ',Z+=" ",Z+=" ",Z+="";if(Z+=" ",Z+=((K=$.opts.plotArea.fill)===null||K===void 0?void 0:K.color)?B2($.opts.plotArea.fill):"",Z+=$.opts.plotArea.border?`${B2($.opts.plotArea.border.color)}`:"",Z+=" ",Z+=" ",Z+="",$.opts.showLegend){if(Z+="",Z+='',Z+='',$.opts.legendFontFace||$.opts.legendFontSize||$.opts.legendColor){if(Z+="",Z+=" ",Z+=" ",Z+=" ",Z+=" ",Z+=$.opts.legendFontSize?``:"",$.opts.legendColor)Z+=B2($.opts.legendColor);if($.opts.legendFontFace)Z+='';if($.opts.legendFontFace)Z+='';Z+=" ",Z+=" ",Z+=' ',Z+=" ",Z+=""}Z+=""}}if(Z+=' ',Z+=' ',$.opts._type===q0.SCATTER)Z+='';return Z+="",Z+="",Z+=((J=$.opts.chartArea.fill)===null||J===void 0?void 0:J.color)?B2($.opts.chartArea.fill):"",Z+=$.opts.chartArea.border?`${B2($.opts.chartArea.border.color)}`:"",Z+=" ",Z+="",Z+='',Z+="",Z}function eK($,q,Q,K,J,Z){let G=-1,W=1,B=null,V="";switch($){case q0.AREA:case q0.BAR:case q0.BAR3D:case q0.LINE:case q0.RADAR:if(V+=``,$===q0.AREA&&Q.barGrouping==="stacked")V+='';if($===q0.BAR||$===q0.BAR3D)V+='',V+='';if($===q0.RADAR)V+='';V+='',q.forEach((U)=>{var w;G++,V+="",V+=` `,V+=" ",V+=" ",V+=" Sheet1!$"+j0(U._dataIndex+U.labels.length+1)+"$1",V+=' '+k0(U.name)+"",V+=" ",V+=" ";let F=Q.chartColors?Q.chartColors[G%Q.chartColors.length]:null;if(V+=" ",F==="transparent")V+="";else if(Q.chartColorsOpacity)V+=""+R0(F,``)+"";else V+=""+R0(F)+"";if($===q0.LINE||$===q0.RADAR)if(Q.lineSize===0)V+="";else V+=`${R0(F)}`,V+='';else if(Q.dataBorder)V+=`${R0(Q.dataBorder.color)}`;if(V+=T1(Q.shadow,P1),V+=" ",V+=' ',$!==q0.RADAR){if(V+="",V+=``,Q.dataLabelBkgrdColors)V+=`${R0(F)}`;if(V+="",V+=``,V+=`${R0(Q.dataLabelColor||Q2)}`,V+=``,V+="",Q.dataLabelPosition)V+=``;V+='',V+=``,V+=``,V+=``,V+=""}if($===q0.LINE||$===q0.RADAR){if(V+="",V+=' ',Q.lineDataSymbolSize)V+=``;V+=" ",V+=` ${R0(Q.chartColors[U._dataIndex+1>Q.chartColors.length?Math.floor(Math.random()*Q.chartColors.length):U._dataIndex])}`,V+=` ${R0(Q.lineDataSymbolLineColor||F)}`,V+=" ",V+=" ",V+=""}if(($===q0.BAR||$===q0.BAR3D)&&q.length===1&&(Q.chartColors&&Q.chartColors!==z8&&Q.chartColors.length>1||((w=Q.invertedColors)===null||w===void 0?void 0:w.length)))U.values.forEach((M,k)=>{let f=M<0?Q.invertedColors||Q.chartColors||z8:Q.chartColors||[];if(V+=" ",V+=` `,V+=' ',V+=' ',V+=" ",Q.lineSize===0)V+="";else if($===q0.BAR)V+="",V+=' ',V+="";else V+="",V+=" ",V+=' ',V+=" ",V+="";V+=T1(Q.shadow,P1),V+=" ",V+=" "});{if(V+="",Q.catLabelFormatCode)V+=" ",V+=` Sheet1!$A$2:$A$${U.labels[0].length+1}`,V+=" ",V+=" "+(Q.catLabelFormatCode||"General")+"",V+=` `,U.labels[0].forEach((M,k)=>V+=`${k0(M)}`),V+=" ",V+=" ";else V+=" ",V+=` Sheet1!$A$2:$${j0(U.labels.length)}$${U.labels[0].length+1}`,V+=" ",V+=` `,U.labels.forEach((M)=>{V+="",M.forEach((k,f)=>V+=`${k0(k)}`),V+=""}),V+=" ",V+=" ";V+=""}if(V+="",V+=" ",V+=`Sheet1!$${j0(U._dataIndex+U.labels.length+1)}$2:$${j0(U._dataIndex+U.labels.length+1)}$${U.labels[0].length+1}`,V+=" ",V+=" "+(Q.valLabelFormatCode||Q.dataTableFormatCode||"General")+"",V+=` `,U.values.forEach((M,k)=>V+=`${M||M===0?M:""}`),V+=" ",V+=" ",V+="",$===q0.LINE)V+='';V+=""});{if(V+=" ",V+=` `,V+=" ",V+=" ",V+=" ",V+=" ",V+=` `,V+=" "+R0(Q.dataLabelColor||Q2)+"",V+=' ',V+=" ",V+=" ",V+=" ",Q.dataLabelPosition)V+=' ';V+=' ',V+=' ',V+=' ',V+=' ',V+=' ',V+=' ',V+=` `,V+=" "}if($===q0.BAR)V+=` `,V+=` `;else if($===q0.BAR3D)V+=` `,V+=` `,V+=' ';else if($===q0.LINE)V+=' ';V+=``,V+=``;break;case q0.SCATTER:V+="",V+='',V+='',G=-1,q.filter((U,w)=>w>0).forEach((U,w)=>{G++,V+="",V+=` `,V+=` `,V+=" ",V+=" ",V+=` Sheet1!$${j0(w+2)}$1`,V+=' '+k0(U.name)+"",V+=" ",V+=" ",V+=" ";{let F=Q.chartColors[G%Q.chartColors.length];if(F==="transparent")V+="";else if(Q.chartColorsOpacity)V+=""+R0(F,'')+"";else V+=""+R0(F)+"";if(Q.lineSize===0)V+="";else V+=`${R0(F)}`,V+=``;V+=T1(Q.shadow,P1)}V+=" ";{if(V+="",V+=' ',Q.lineDataSymbolSize)V+=``;V+="",V+=`${R0(Q.chartColors[w+1>Q.chartColors.length?Math.floor(Math.random()*Q.chartColors.length):w])}`,V+=`${R0(Q.lineDataSymbolLineColor||Q.chartColors[G%Q.chartColors.length])}`,V+="",V+="",V+=""}if(Q.showLabel){let F=Y5("-xxxx-xxxx-xxxx-xxxxxxxxxxxx");if(U.labels[0]&&(Q.dataLabelFormatScatter==="custom"||Q.dataLabelFormatScatter==="customXY"))V+="",U.labels[0].forEach((M,k)=>{if(Q.dataLabelFormatScatter==="custom"||Q.dataLabelFormatScatter==="customXY"){if(V+=" ",V+=` `,V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=' ',V+=" "+k0(M)+"",V+=" ",Q.dataLabelFormatScatter==="customXY"&&!/^ *$/.test(M))V+=" ",V+=' ',V+=" (",V+=" ",V+=' ',V+=' ',V+=" ",V+=" ",V+=" ",V+=" ["+k0(U.name)+"",V+=" ",V+=" ",V+=' ',V+=" , ",V+=" ",V+=' ',V+=' ',V+=" ",V+=" ",V+=" ",V+=" ["+k0(U.name)+"]",V+=" ",V+=" ",V+=' ',V+=" )",V+=" ",V+=' ';if(V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",Q.dataLabelPosition)V+=' ';V+=' ',V+=' ',V+=' ',V+=' ',V+=' ',V+=' ',V+=' ',V+=" ",V+=' ',V+=' ',V+=` `,V+=" ",V+=" ",V+=""}}),V+="";if(Q.dataLabelFormatScatter==="XY"){if(V+="",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=' ',V+=" ",V+=" ",Q.dataLabelPosition)V+=' ';V+=' ',V+=` `,V+=` `,V+=` `,V+=' ',V+=' ',V+=" ",V+=' ',V+=' ',V+=" ",V+=" ",V+=""}}if(q.length===1&&Q.chartColors!==z8)U.values.forEach((F,M)=>{let k=F<0?Q.invertedColors||Q.chartColors||z8:Q.chartColors||[];if(V+=" ",V+=` `,V+=' ',V+=' ',V+=" ",Q.lineSize===0)V+="";else V+="",V+=' ',V+="";V+=T1(Q.shadow,P1),V+=" ",V+=" "});V+="",V+=" ",V+=` Sheet1!$A$2:$A$${q[0].values.length+1}`,V+=" ",V+=" General",V+=` `,q[0].values.forEach((F,M)=>{V+=`${F||F===0?F:""}`}),V+=" ",V+=" ",V+="",V+="",V+=" ",V+=` Sheet1!$${j0(w+2)}$2:$${j0(w+2)}$${q[0].values.length+1}`,V+=" ",V+=" General",V+=` `,q[0].values.forEach((F,M)=>{V+=`${U.values[M]||U.values[M]===0?U.values[M]:""}`}),V+=" ",V+=" ",V+="",V+='',V+=""});{if(V+=" ",V+=` `,V+=" ",V+=" ",V+=" ",V+=" ",V+=` `,V+=" "+R0(Q.dataLabelColor||Q2)+"",V+=' ',V+=" ",V+=" ",V+=" ",Q.dataLabelPosition)V+=' ';V+=' ',V+=' ',V+=' ',V+=' ',V+=' ',V+=' ',V+=" "}V+=``,V+="";break;case q0.BUBBLE:case q0.BUBBLE3D:V+="",V+='',G=-1,q.filter((U,w)=>w>0).forEach((U,w)=>{G++,V+="",V+=` `,V+=` `,V+=" ",V+=" ",V+=" Sheet1!$"+j0(W+1)+"$1",V+=' '+k0(U.name)+"",V+=" ",V+=" ";{V+="";let F=Q.chartColors[G%Q.chartColors.length];if(F==="transparent")V+="";else if(Q.chartColorsOpacity)V+=`${R0(F,'')}`;else V+=""+R0(F)+"";if(Q.lineSize===0)V+="";else if(Q.dataBorder)V+=`${R0(Q.dataBorder.color)}`;else V+=`${R0(F)}`,V+=``;V+=T1(Q.shadow,P1),V+=""}V+="",V+=" ",V+=` Sheet1!$A$2:$A$${q[0].values.length+1}`,V+=" ",V+=" General",V+=` `,q[0].values.forEach((F,M)=>{V+=`${F||F===0?F:""}`}),V+=" ",V+=" ",V+="",V+="",V+=" ",V+=`Sheet1!$${j0(W+1)}$2:$${j0(W+1)}$${q[0].values.length+1}`,W++,V+=" ",V+=" General",V+=` `,q[0].values.forEach((F,M)=>{V+=`${U.values[M]||U.values[M]===0?U.values[M]:""}`}),V+=" ",V+=" ",V+="",V+=" ",V+=" ",V+=`Sheet1!$${j0(W+1)}$2:$${j0(W+1)}$${U.sizes.length+1}`,W++,V+=" ",V+=" General",V+=` `,U.sizes.forEach((F,M)=>{V+=`${F||""}`}),V+=" ",V+=" ",V+=" ",V+=' ',V+=""});{if(V+="",V+=``,V+="",V+=``,V+=`${R0(Q.dataLabelColor||Q2)}`,V+=``,V+="",Q.dataLabelPosition)V+=``;V+='',V+=``,V+=``,V+="",V+=' ',V+=' ',V+=" ",V+="",V+=""}V+=``,V+="";break;case q0.DOUGHNUT:case q0.PIE:if(B=q[0],V+="",V+=' ',V+="",V+=' ',V+=' ',V+=" ",V+=" ",V+=" Sheet1!$B$1",V+=" ",V+=' ',V+=' '+k0(B.name)+"",V+=" ",V+=" ",V+=" ",V+=" ",V+=' ',V+=' ',Q.dataNoEffects)V+="";else V+=T1(Q.shadow,P1);if(V+=" ",B.labels[0].forEach((U,w)=>{if(V+="",V+=` `,V+=' ',V+=" ",V+=`${R0(Q.chartColors[w+1>Q.chartColors.length?Math.floor(Math.random()*Q.chartColors.length):w])}`,Q.dataBorder)V+=`${R0(Q.dataBorder.color)}`;V+=T1(Q.shadow,P1),V+=" ",V+=""}),V+="",B.labels[0].forEach((U,w)=>{if(V+="",V+=` `,V+=` `,V+=" ",V+=" ",V+=" ",V+=` `,V+=" "+R0(Q.dataLabelColor||Q2)+"",V+=` `,V+=" ",V+=" ",V+=" ",$===q0.PIE&&Q.dataLabelPosition)V+=``;V+=' ',V+=' ',V+=' ',V+=' ',V+=' ',V+=' ',V+=" "}),V+=` `,V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=` `,V+=' ',V+=" ",V+=" ",V+=" ",V+=" ",V+=$===q0.PIE?'':"",V+=' ',V+=' ',V+=' ',V+=' ',V+=' ',V+=' ',V+=` `,V+="",V+="",V+=" ",V+=` Sheet1!$A$2:$A$${B.labels[0].length+1}`,V+=" ",V+=` `,B.labels[0].forEach((U,w)=>{V+=`${k0(U)}`}),V+=" ",V+=" ",V+="",V+=" ",V+=" ",V+=` Sheet1!$B$2:$B$${B.labels[0].length+1}`,V+=" ",V+=` `,B.values.forEach((U,w)=>{V+=`${U||U===0?U:""}`}),V+=" ",V+=" ",V+=" ",V+=" ",V+=` `,$===q0.DOUGHNUT)V+=``;V+="";break;default:V+="";break}return V}function A7($,q,Q){let K="";if($._type===q0.SCATTER||$._type===q0.BUBBLE||$._type===q0.BUBBLE3D)K+="";else K+="";if(K+=' ',K+=" ",K+='',$.catAxisMaxVal||$.catAxisMaxVal===0)K+=``;if($.catAxisMinVal||$.catAxisMinVal===0)K+=``;if(K+="",K+=' ',K+=' ',K+=$.catGridLine.style!=="none"?b7($.catGridLine):"",$.showCatAxisTitle)K+=H5({color:$.catAxisTitleColor,fontFace:$.catAxisTitleFontFace,fontSize:$.catAxisTitleFontSize,titleRotate:$.catAxisTitleRotate,title:$.catAxisTitle||"Axis Title"});if($._type===q0.SCATTER||$._type===q0.BUBBLE||$._type===q0.BUBBLE3D)K+=' ';else K+=' ';if($._type===q0.SCATTER)K+=' ',K+=' ',K+=' ';else K+=' ',K+=' ',K+=' ';if(K+=" ",K+=` `,K+=!$.catAxisLineShow?"":""+R0($.catAxisLineColor||u1.color)+"",K+=' ',K+=" ",K+=" ",K+=" ",K+=" ",$.catAxisLabelRotate)K+=``;else K+="";if(K+=" ",K+=" ",K+=" ",K+=` `,K+=" "+R0($.catAxisLabelColor||Q2)+"",K+=' ',K+=" ",K+=" ",K+=' ',K+=" ",K+=" ",K+=' ',K+=` `,K+=' ',K+=' ',K+=` `,$.catAxisLabelFrequency)K+=' ';if($.catLabelFormatCode||$._type===q0.SCATTER||$._type===q0.BUBBLE||$._type===q0.BUBBLE3D){if($.catLabelFormatCode){if(["catAxisBaseTimeUnit","catAxisMajorTimeUnit","catAxisMinorTimeUnit"].forEach((J)=>{if($[J]&&(typeof $[J]!=="string"||!["days","months","years"].includes($[J].toLowerCase())))console.warn(`"${J}" must be one of: 'days','months','years' !`),$[J]=null}),$.catAxisBaseTimeUnit)K+='';if($.catAxisMajorTimeUnit)K+='';if($.catAxisMinorTimeUnit)K+=''}if($.catAxisMajorUnit)K+=``;if($.catAxisMinorUnit)K+=``}if($._type===q0.SCATTER||$._type===q0.BUBBLE||$._type===q0.BUBBLE3D)K+="";else K+="";return K}function X7($,q){let Q=q===o2?$.barDir==="col"?"l":"b":$.barDir!=="col"?"r":"t";if(q===N5)Q="r";let K=q===o2?B8:x7,J="";if(J+="",J+=' ',J+=" ",$.valAxisLogScaleBase)J+=``;if(J+='',$.valAxisMaxVal||$.valAxisMaxVal===0)J+=``;if($.valAxisMinVal||$.valAxisMinVal===0)J+=``;if(J+=" ",J+=` `,J+=' ',$.valGridLine.style!=="none")J+=b7($.valGridLine);if($.showValAxisTitle)J+=H5({color:$.valAxisTitleColor,fontFace:$.valAxisTitleFontFace,fontSize:$.valAxisTitleFontSize,titleRotate:$.valAxisTitleRotate,title:$.valAxisTitle||"Axis Title"});if(J+=``,$._type===q0.SCATTER)J+=' ',J+=' ',J+=' ';else J+=' ',J+=' ',J+=' ';if(J+=" ",J+=` `,J+=!$.valAxisLineShow?"":""+R0($.valAxisLineColor||u1.color)+"",J+=' ',J+=" ",J+=" ",J+=" ",J+=" ",J+=` `,J+=" ",J+=" ",J+=" ",J+=` `,J+=" "+R0($.valAxisLabelColor||Q2)+"",J+=' ',J+=" ",J+=" ",J+=' ',J+=" ",J+=" ",J+=' ',typeof $.catAxisCrossesAt==="number")J+=` `;else if(typeof $.catAxisCrossesAt==="string")J+=' ';else J+=' ';if(J+=' ',$.valAxisMajorUnit)J+=` `;if($.valAxisDisplayUnit)J+=`${$.valAxisDisplayUnitLabel?"":""}`;return J+="",J}function AB($,q,Q){let K="";if(K+="",K+=' ',K+=' ',K+=' ',K+=' ',K+=$.serGridLine.style!=="none"?b7($.serGridLine):"",$.showSerAxisTitle)K+=H5({color:$.serAxisTitleColor,fontFace:$.serAxisTitleFontFace,fontSize:$.serAxisTitleFontSize,titleRotate:$.serAxisTitleRotate,title:$.serAxisTitle||"Axis Title"});if(K+=` `,K+=' ',K+=' ',K+=` `,K+=" ",K+=' ',K+=!$.serAxisLineShow?"":`${R0($.serAxisLineColor||u1.color)}`,K+=' ',K+=" ",K+=" ",K+=" ",K+=" ",K+=" ",K+=" ",K+=" ",K+=" ",K+=` `,K+=` ${R0($.serAxisLabelColor||Q2)}`,K+=` `,K+=" ",K+=" ",K+=' ',K+=" ",K+=" ",K+=' ',K+=' ',$.serAxisLabelFrequency)K+=' ';if($.serLabelFormatCode){if(["serAxisBaseTimeUnit","serAxisMajorTimeUnit","serAxisMinorTimeUnit"].forEach((J)=>{if($[J]&&(typeof $[J]!=="string"||!["days","months","years"].includes(J.toLowerCase())))console.warn(`"${J}" must be one of: 'days','months','years' !`),$[J]=null}),$.serAxisBaseTimeUnit)K+=` `;if($.serAxisMajorTimeUnit)K+=` `;if($.serAxisMinorTimeUnit)K+=` `;if($.serAxisMajorUnit)K+=` `;if($.serAxisMinorUnit)K+=` `}return K+="",K}function H5($,q,Q){let K=$.titleAlign==="left"||$.titleAlign==="right"?``:"",J=$.titleRotate?``:"",Z=$.fontSize?`sz="${Math.round($.fontSize*100)}"`:"",G=$.titleBold?1:0,W="";if($.titlePos&&typeof $.titlePos.x==="number"&&typeof $.titlePos.y==="number"){let B=$.titlePos.x+q,V=$.titlePos.y+Q,U=B===0?0:B*(B/5)/10;if(U>=1)U=U/10;if(U>=0.1)U=U/10;let w=V===0?0:V*(V/5)/10;if(w>=1)w=w/10;if(w>=0.1)w=w/10;W=``}return` +`,W.file("xl/worksheets/sheet1.xml",U)}W.generateAsync({type:"base64"}).then((U)=>{q.file(`ppt/embeddings/Microsoft_Excel_Worksheet${$.globalId}.xlsx`,U,{base64:!0}),q.file("ppt/charts/_rels/"+$.fileName+".rels",``),q.file(`ppt/charts/${$.fileName}`,EB($)),K("")}).catch((U)=>{J(U)})})})}function EB($){var q,Q,K,J;let Z='',G=!1;{if(Z+='',Z+='',Z+=``,Z+="",$.opts.showTitle)Z+=H5({title:$.opts.title||"Chart Title",color:$.opts.titleColor,fontFace:$.opts.titleFontFace,fontSize:$.opts.titleFontSize||IB,titleAlign:$.opts.titleAlign,titleBold:$.opts.titleBold,titlePos:$.opts.titlePos,titleRotate:$.opts.titleRotate},$.opts.x,$.opts.y),Z+='';else Z+='';if($.opts._type===q0.BAR3D)Z+=``;if(Z+="",$.opts.layout)Z+="",Z+=" ",Z+=' ',Z+=' ',Z+=' ',Z+=' ',Z+=' ',Z+=' ',Z+=' ',Z+=" ",Z+="";else Z+=""}if(Array.isArray($.opts._type))$.opts._type.forEach((W)=>{let B=Object.assign(Object.assign({},$.opts),W.options),V=B.secondaryValAxis?N5:o2,U=B.secondaryCatAxis?x7:B8;G=G||B.secondaryValAxis,Z+=$J(W.type,W.data,B,V,U)});else Z+=$J($.opts._type,$.data,$.opts,o2,B8);if($.opts._type!==q0.PIE&&$.opts._type!==q0.DOUGHNUT){if($.opts.valAxes&&$.opts.valAxes.length>1&&!G)throw Error("Secondary axis must be used by one of the multiple charts");if($.opts.catAxes){if(!$.opts.valAxes||$.opts.valAxes.length!==$.opts.catAxes.length)throw Error("There must be the same number of value and category axes.");Z+=A7(Object.assign(Object.assign({},$.opts),$.opts.catAxes[0]),B8,o2)}else Z+=A7($.opts,B8,o2);if($.opts.valAxes){if(Z+=X7(Object.assign(Object.assign({},$.opts),$.opts.valAxes[0]),o2),$.opts.valAxes[1])Z+=X7(Object.assign(Object.assign({},$.opts),$.opts.valAxes[1]),N5)}else if(Z+=X7($.opts,o2),$.opts._type===q0.BAR3D)Z+=_B($.opts,UJ,o2);if(((q=$.opts)===null||q===void 0?void 0:q.catAxes)&&((Q=$.opts)===null||Q===void 0?void 0:Q.catAxes[1]))Z+=A7(Object.assign(Object.assign({},$.opts),$.opts.catAxes[1]),x7,N5)}{if($.opts.showDataTable)Z+="",Z+=` `,Z+=` `,Z+=` `,Z+=` `,Z+=" ",Z+=" ",Z+=' ',Z+=" ",Z+=" ",Z+=" ",Z+=' ',Z+=" ",Z+=" ",Z+=' ',Z+=` `,Z+=' ',Z+=' ',Z+=' ',Z+=' ',Z+=" ",Z+=" ",Z+=' ',Z+=" ",Z+=" ",Z+="";if(Z+=" ",Z+=((K=$.opts.plotArea.fill)===null||K===void 0?void 0:K.color)?B2($.opts.plotArea.fill):"",Z+=$.opts.plotArea.border?`${B2($.opts.plotArea.border.color)}`:"",Z+=" ",Z+=" ",Z+="",$.opts.showLegend){if(Z+="",Z+='',Z+='',$.opts.legendFontFace||$.opts.legendFontSize||$.opts.legendColor){if(Z+="",Z+=" ",Z+=" ",Z+=" ",Z+=" ",Z+=$.opts.legendFontSize?``:"",$.opts.legendColor)Z+=B2($.opts.legendColor);if($.opts.legendFontFace)Z+='';if($.opts.legendFontFace)Z+='';Z+=" ",Z+=" ",Z+=' ',Z+=" ",Z+=""}Z+=""}}if(Z+=' ',Z+=' ',$.opts._type===q0.SCATTER)Z+='';return Z+="",Z+="",Z+=((J=$.opts.chartArea.fill)===null||J===void 0?void 0:J.color)?B2($.opts.chartArea.fill):"",Z+=$.opts.chartArea.border?`${B2($.opts.chartArea.border.color)}`:"",Z+=" ",Z+="",Z+='',Z+="",Z}function $J($,q,Q,K,J,Z){let G=-1,W=1,B=null,V="";switch($){case q0.AREA:case q0.BAR:case q0.BAR3D:case q0.LINE:case q0.RADAR:if(V+=``,$===q0.AREA&&Q.barGrouping==="stacked")V+='';if($===q0.BAR||$===q0.BAR3D)V+='',V+='';if($===q0.RADAR)V+='';V+='',q.forEach((U)=>{var w;G++,V+="",V+=` `,V+=" ",V+=" ",V+=" Sheet1!$"+j0(U._dataIndex+U.labels.length+1)+"$1",V+=' '+k0(U.name)+"",V+=" ",V+=" ";let F=Q.chartColors?Q.chartColors[G%Q.chartColors.length]:null;if(V+=" ",F==="transparent")V+="";else if(Q.chartColorsOpacity)V+=""+R0(F,``)+"";else V+=""+R0(F)+"";if($===q0.LINE||$===q0.RADAR)if(Q.lineSize===0)V+="";else V+=`${R0(F)}`,V+='';else if(Q.dataBorder)V+=`${R0(Q.dataBorder.color)}`;if(V+=T1(Q.shadow,P1),V+=" ",V+=' ',$!==q0.RADAR){if(V+="",V+=``,Q.dataLabelBkgrdColors)V+=`${R0(F)}`;if(V+="",V+=``,V+=`${R0(Q.dataLabelColor||Q2)}`,V+=``,V+="",Q.dataLabelPosition)V+=``;V+='',V+=``,V+=``,V+=``,V+=""}if($===q0.LINE||$===q0.RADAR){if(V+="",V+=' ',Q.lineDataSymbolSize)V+=``;V+=" ",V+=` ${R0(Q.chartColors[U._dataIndex+1>Q.chartColors.length?Math.floor(Math.random()*Q.chartColors.length):U._dataIndex])}`,V+=` ${R0(Q.lineDataSymbolLineColor||F)}`,V+=" ",V+=" ",V+=""}if(($===q0.BAR||$===q0.BAR3D)&&q.length===1&&(Q.chartColors&&Q.chartColors!==z8&&Q.chartColors.length>1||((w=Q.invertedColors)===null||w===void 0?void 0:w.length)))U.values.forEach((M,k)=>{let f=M<0?Q.invertedColors||Q.chartColors||z8:Q.chartColors||[];if(V+=" ",V+=` `,V+=' ',V+=' ',V+=" ",Q.lineSize===0)V+="";else if($===q0.BAR)V+="",V+=' ',V+="";else V+="",V+=" ",V+=' ',V+=" ",V+="";V+=T1(Q.shadow,P1),V+=" ",V+=" "});{if(V+="",Q.catLabelFormatCode)V+=" ",V+=` Sheet1!$A$2:$A$${U.labels[0].length+1}`,V+=" ",V+=" "+(Q.catLabelFormatCode||"General")+"",V+=` `,U.labels[0].forEach((M,k)=>V+=`${k0(M)}`),V+=" ",V+=" ";else V+=" ",V+=` Sheet1!$A$2:$${j0(U.labels.length)}$${U.labels[0].length+1}`,V+=" ",V+=` `,U.labels.forEach((M)=>{V+="",M.forEach((k,f)=>V+=`${k0(k)}`),V+=""}),V+=" ",V+=" ";V+=""}if(V+="",V+=" ",V+=`Sheet1!$${j0(U._dataIndex+U.labels.length+1)}$2:$${j0(U._dataIndex+U.labels.length+1)}$${U.labels[0].length+1}`,V+=" ",V+=" "+(Q.valLabelFormatCode||Q.dataTableFormatCode||"General")+"",V+=` `,U.values.forEach((M,k)=>V+=`${M||M===0?M:""}`),V+=" ",V+=" ",V+="",$===q0.LINE)V+='';V+=""});{if(V+=" ",V+=` `,V+=" ",V+=" ",V+=" ",V+=" ",V+=` `,V+=" "+R0(Q.dataLabelColor||Q2)+"",V+=' ',V+=" ",V+=" ",V+=" ",Q.dataLabelPosition)V+=' ';V+=' ',V+=' ',V+=' ',V+=' ',V+=' ',V+=' ',V+=` `,V+=" "}if($===q0.BAR)V+=` `,V+=` `;else if($===q0.BAR3D)V+=` `,V+=` `,V+=' ';else if($===q0.LINE)V+=' ';V+=``,V+=``;break;case q0.SCATTER:V+="",V+='',V+='',G=-1,q.filter((U,w)=>w>0).forEach((U,w)=>{G++,V+="",V+=` `,V+=` `,V+=" ",V+=" ",V+=` Sheet1!$${j0(w+2)}$1`,V+=' '+k0(U.name)+"",V+=" ",V+=" ",V+=" ";{let F=Q.chartColors[G%Q.chartColors.length];if(F==="transparent")V+="";else if(Q.chartColorsOpacity)V+=""+R0(F,'')+"";else V+=""+R0(F)+"";if(Q.lineSize===0)V+="";else V+=`${R0(F)}`,V+=``;V+=T1(Q.shadow,P1)}V+=" ";{if(V+="",V+=' ',Q.lineDataSymbolSize)V+=``;V+="",V+=`${R0(Q.chartColors[w+1>Q.chartColors.length?Math.floor(Math.random()*Q.chartColors.length):w])}`,V+=`${R0(Q.lineDataSymbolLineColor||Q.chartColors[G%Q.chartColors.length])}`,V+="",V+="",V+=""}if(Q.showLabel){let F=Y5("-xxxx-xxxx-xxxx-xxxxxxxxxxxx");if(U.labels[0]&&(Q.dataLabelFormatScatter==="custom"||Q.dataLabelFormatScatter==="customXY"))V+="",U.labels[0].forEach((M,k)=>{if(Q.dataLabelFormatScatter==="custom"||Q.dataLabelFormatScatter==="customXY"){if(V+=" ",V+=` `,V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=' ',V+=" "+k0(M)+"",V+=" ",Q.dataLabelFormatScatter==="customXY"&&!/^ *$/.test(M))V+=" ",V+=' ',V+=" (",V+=" ",V+=' ',V+=' ',V+=" ",V+=" ",V+=" ",V+=" ["+k0(U.name)+"",V+=" ",V+=" ",V+=' ',V+=" , ",V+=" ",V+=' ',V+=' ',V+=" ",V+=" ",V+=" ",V+=" ["+k0(U.name)+"]",V+=" ",V+=" ",V+=' ',V+=" )",V+=" ",V+=' ';if(V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",Q.dataLabelPosition)V+=' ';V+=' ',V+=' ',V+=' ',V+=' ',V+=' ',V+=' ',V+=' ',V+=" ",V+=' ',V+=' ',V+=` `,V+=" ",V+=" ",V+=""}}),V+="";if(Q.dataLabelFormatScatter==="XY"){if(V+="",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=' ',V+=" ",V+=" ",Q.dataLabelPosition)V+=' ';V+=' ',V+=` `,V+=` `,V+=` `,V+=' ',V+=' ',V+=" ",V+=' ',V+=' ',V+=" ",V+=" ",V+=""}}if(q.length===1&&Q.chartColors!==z8)U.values.forEach((F,M)=>{let k=F<0?Q.invertedColors||Q.chartColors||z8:Q.chartColors||[];if(V+=" ",V+=` `,V+=' ',V+=' ',V+=" ",Q.lineSize===0)V+="";else V+="",V+=' ',V+="";V+=T1(Q.shadow,P1),V+=" ",V+=" "});V+="",V+=" ",V+=` Sheet1!$A$2:$A$${q[0].values.length+1}`,V+=" ",V+=" General",V+=` `,q[0].values.forEach((F,M)=>{V+=`${F||F===0?F:""}`}),V+=" ",V+=" ",V+="",V+="",V+=" ",V+=` Sheet1!$${j0(w+2)}$2:$${j0(w+2)}$${q[0].values.length+1}`,V+=" ",V+=" General",V+=` `,q[0].values.forEach((F,M)=>{V+=`${U.values[M]||U.values[M]===0?U.values[M]:""}`}),V+=" ",V+=" ",V+="",V+='',V+=""});{if(V+=" ",V+=` `,V+=" ",V+=" ",V+=" ",V+=" ",V+=` `,V+=" "+R0(Q.dataLabelColor||Q2)+"",V+=' ',V+=" ",V+=" ",V+=" ",Q.dataLabelPosition)V+=' ';V+=' ',V+=' ',V+=' ',V+=' ',V+=' ',V+=' ',V+=" "}V+=``,V+="";break;case q0.BUBBLE:case q0.BUBBLE3D:V+="",V+='',G=-1,q.filter((U,w)=>w>0).forEach((U,w)=>{G++,V+="",V+=` `,V+=` `,V+=" ",V+=" ",V+=" Sheet1!$"+j0(W+1)+"$1",V+=' '+k0(U.name)+"",V+=" ",V+=" ";{V+="";let F=Q.chartColors[G%Q.chartColors.length];if(F==="transparent")V+="";else if(Q.chartColorsOpacity)V+=`${R0(F,'')}`;else V+=""+R0(F)+"";if(Q.lineSize===0)V+="";else if(Q.dataBorder)V+=`${R0(Q.dataBorder.color)}`;else V+=`${R0(F)}`,V+=``;V+=T1(Q.shadow,P1),V+=""}V+="",V+=" ",V+=` Sheet1!$A$2:$A$${q[0].values.length+1}`,V+=" ",V+=" General",V+=` `,q[0].values.forEach((F,M)=>{V+=`${F||F===0?F:""}`}),V+=" ",V+=" ",V+="",V+="",V+=" ",V+=`Sheet1!$${j0(W+1)}$2:$${j0(W+1)}$${q[0].values.length+1}`,W++,V+=" ",V+=" General",V+=` `,q[0].values.forEach((F,M)=>{V+=`${U.values[M]||U.values[M]===0?U.values[M]:""}`}),V+=" ",V+=" ",V+="",V+=" ",V+=" ",V+=`Sheet1!$${j0(W+1)}$2:$${j0(W+1)}$${U.sizes.length+1}`,W++,V+=" ",V+=" General",V+=` `,U.sizes.forEach((F,M)=>{V+=`${F||""}`}),V+=" ",V+=" ",V+=" ",V+=' ',V+=""});{if(V+="",V+=``,V+="",V+=``,V+=`${R0(Q.dataLabelColor||Q2)}`,V+=``,V+="",Q.dataLabelPosition)V+=``;V+='',V+=``,V+=``,V+="",V+=' ',V+=' ',V+=" ",V+="",V+=""}V+=``,V+="";break;case q0.DOUGHNUT:case q0.PIE:if(B=q[0],V+="",V+=' ',V+="",V+=' ',V+=' ',V+=" ",V+=" ",V+=" Sheet1!$B$1",V+=" ",V+=' ',V+=' '+k0(B.name)+"",V+=" ",V+=" ",V+=" ",V+=" ",V+=' ',V+=' ',Q.dataNoEffects)V+="";else V+=T1(Q.shadow,P1);if(V+=" ",B.labels[0].forEach((U,w)=>{if(V+="",V+=` `,V+=' ',V+=" ",V+=`${R0(Q.chartColors[w+1>Q.chartColors.length?Math.floor(Math.random()*Q.chartColors.length):w])}`,Q.dataBorder)V+=`${R0(Q.dataBorder.color)}`;V+=T1(Q.shadow,P1),V+=" ",V+=""}),V+="",B.labels[0].forEach((U,w)=>{if(V+="",V+=` `,V+=` `,V+=" ",V+=" ",V+=" ",V+=` `,V+=" "+R0(Q.dataLabelColor||Q2)+"",V+=` `,V+=" ",V+=" ",V+=" ",$===q0.PIE&&Q.dataLabelPosition)V+=``;V+=' ',V+=' ',V+=' ',V+=' ',V+=' ',V+=' ',V+=" "}),V+=` `,V+=" ",V+=" ",V+=" ",V+=" ",V+=" ",V+=` `,V+=' ',V+=" ",V+=" ",V+=" ",V+=" ",V+=$===q0.PIE?'':"",V+=' ',V+=' ',V+=' ',V+=' ',V+=' ',V+=' ',V+=` `,V+="",V+="",V+=" ",V+=` Sheet1!$A$2:$A$${B.labels[0].length+1}`,V+=" ",V+=` `,B.labels[0].forEach((U,w)=>{V+=`${k0(U)}`}),V+=" ",V+=" ",V+="",V+=" ",V+=" ",V+=` Sheet1!$B$2:$B$${B.labels[0].length+1}`,V+=" ",V+=` `,B.values.forEach((U,w)=>{V+=`${U||U===0?U:""}`}),V+=" ",V+=" ",V+=" ",V+=" ",V+=` `,$===q0.DOUGHNUT)V+=``;V+="";break;default:V+="";break}return V}function A7($,q,Q){let K="";if($._type===q0.SCATTER||$._type===q0.BUBBLE||$._type===q0.BUBBLE3D)K+="";else K+="";if(K+=' ',K+=" ",K+='',$.catAxisMaxVal||$.catAxisMaxVal===0)K+=``;if($.catAxisMinVal||$.catAxisMinVal===0)K+=``;if(K+="",K+=' ',K+=' ',K+=$.catGridLine.style!=="none"?b7($.catGridLine):"",$.showCatAxisTitle)K+=H5({color:$.catAxisTitleColor,fontFace:$.catAxisTitleFontFace,fontSize:$.catAxisTitleFontSize,titleRotate:$.catAxisTitleRotate,title:$.catAxisTitle||"Axis Title"});if($._type===q0.SCATTER||$._type===q0.BUBBLE||$._type===q0.BUBBLE3D)K+=' ';else K+=' ';if($._type===q0.SCATTER)K+=' ',K+=' ',K+=' ';else K+=' ',K+=' ',K+=' ';if(K+=" ",K+=` `,K+=!$.catAxisLineShow?"":""+R0($.catAxisLineColor||u1.color)+"",K+=' ',K+=" ",K+=" ",K+=" ",K+=" ",$.catAxisLabelRotate)K+=``;else K+="";if(K+=" ",K+=" ",K+=" ",K+=` `,K+=" "+R0($.catAxisLabelColor||Q2)+"",K+=' ',K+=" ",K+=" ",K+=' ',K+=" ",K+=" ",K+=' ',K+=` `,K+=' ',K+=' ',K+=` `,$.catAxisLabelFrequency)K+=' ';if($.catLabelFormatCode||$._type===q0.SCATTER||$._type===q0.BUBBLE||$._type===q0.BUBBLE3D){if($.catLabelFormatCode){if(["catAxisBaseTimeUnit","catAxisMajorTimeUnit","catAxisMinorTimeUnit"].forEach((J)=>{if($[J]&&(typeof $[J]!=="string"||!["days","months","years"].includes($[J].toLowerCase())))console.warn(`"${J}" must be one of: 'days','months','years' !`),$[J]=null}),$.catAxisBaseTimeUnit)K+='';if($.catAxisMajorTimeUnit)K+='';if($.catAxisMinorTimeUnit)K+=''}if($.catAxisMajorUnit)K+=``;if($.catAxisMinorUnit)K+=``}if($._type===q0.SCATTER||$._type===q0.BUBBLE||$._type===q0.BUBBLE3D)K+="";else K+="";return K}function X7($,q){let Q=q===o2?$.barDir==="col"?"l":"b":$.barDir!=="col"?"r":"t";if(q===N5)Q="r";let K=q===o2?B8:x7,J="";if(J+="",J+=' ',J+=" ",$.valAxisLogScaleBase)J+=``;if(J+='',$.valAxisMaxVal||$.valAxisMaxVal===0)J+=``;if($.valAxisMinVal||$.valAxisMinVal===0)J+=``;if(J+=" ",J+=` `,J+=' ',$.valGridLine.style!=="none")J+=b7($.valGridLine);if($.showValAxisTitle)J+=H5({color:$.valAxisTitleColor,fontFace:$.valAxisTitleFontFace,fontSize:$.valAxisTitleFontSize,titleRotate:$.valAxisTitleRotate,title:$.valAxisTitle||"Axis Title"});if(J+=``,$._type===q0.SCATTER)J+=' ',J+=' ',J+=' ';else J+=' ',J+=' ',J+=' ';if(J+=" ",J+=` `,J+=!$.valAxisLineShow?"":""+R0($.valAxisLineColor||u1.color)+"",J+=' ',J+=" ",J+=" ",J+=" ",J+=" ",J+=` `,J+=" ",J+=" ",J+=" ",J+=` `,J+=" "+R0($.valAxisLabelColor||Q2)+"",J+=' ',J+=" ",J+=" ",J+=' ',J+=" ",J+=" ",J+=' ',typeof $.catAxisCrossesAt==="number")J+=` `;else if(typeof $.catAxisCrossesAt==="string")J+=' ';else J+=' ';if(J+=' ',$.valAxisMajorUnit)J+=` `;if($.valAxisDisplayUnit)J+=`${$.valAxisDisplayUnitLabel?"":""}`;return J+="",J}function _B($,q,Q){let K="";if(K+="",K+=' ',K+=' ',K+=' ',K+=' ',K+=$.serGridLine.style!=="none"?b7($.serGridLine):"",$.showSerAxisTitle)K+=H5({color:$.serAxisTitleColor,fontFace:$.serAxisTitleFontFace,fontSize:$.serAxisTitleFontSize,titleRotate:$.serAxisTitleRotate,title:$.serAxisTitle||"Axis Title"});if(K+=` `,K+=' ',K+=' ',K+=` `,K+=" ",K+=' ',K+=!$.serAxisLineShow?"":`${R0($.serAxisLineColor||u1.color)}`,K+=' ',K+=" ",K+=" ",K+=" ",K+=" ",K+=" ",K+=" ",K+=" ",K+=" ",K+=` `,K+=` ${R0($.serAxisLabelColor||Q2)}`,K+=` `,K+=" ",K+=" ",K+=' ',K+=" ",K+=" ",K+=' ',K+=' ',$.serAxisLabelFrequency)K+=' ';if($.serLabelFormatCode){if(["serAxisBaseTimeUnit","serAxisMajorTimeUnit","serAxisMinorTimeUnit"].forEach((J)=>{if($[J]&&(typeof $[J]!=="string"||!["days","months","years"].includes(J.toLowerCase())))console.warn(`"${J}" must be one of: 'days','months','years' !`),$[J]=null}),$.serAxisBaseTimeUnit)K+=` `;if($.serAxisMajorTimeUnit)K+=` `;if($.serAxisMinorTimeUnit)K+=` `;if($.serAxisMajorUnit)K+=` `;if($.serAxisMinorUnit)K+=` `}return K+="",K}function H5($,q,Q){let K=$.titleAlign==="left"||$.titleAlign==="right"?``:"",J=$.titleRotate?``:"",Z=$.fontSize?`sz="${Math.round($.fontSize*100)}"`:"",G=$.titleBold?1:0,W="";if($.titlePos&&typeof $.titlePos.x==="number"&&typeof $.titlePos.y==="number"){let B=$.titlePos.x+q,V=$.titlePos.y+Q,U=B===0?0:B*(B/5)/10;if(U>=1)U=U/10;if(U>=0.1)U=U/10;let w=V===0?0:V*(V/5)/10;if(w>=1)w=w/10;if(w>=0.1)w=w/10;W=``}return` ${J} @@ -53,23 +53,23 @@ ${W} - `}function j0($){let q="",Q=$-1;if(Q<=25)q=W8[Q];else q=`${W8[Math.floor(Q/W8.length-1)]}${W8[Q%W8.length]}`;return q}function T1($,q){if(!$)return"";else if(typeof $!=="object")return console.warn("`shadow` options must be an object. Ex: `{shadow: {type:'none'}}`"),"";let Q="",K=Object.assign(Object.assign({},q),$),J=K.type||"outer",Z=Y0(K.blur),G=Y0(K.offset),W=Math.round(K.angle*60000),B=K.color,V=Math.round(K.opacity*1e5),U=K.rotateWithShape?1:0;return Q+=``,Q+=``,Q+=``,Q+=``,Q+="",Q}function b7($){let q="";return q+=" ",q+=` `,q+=' ',q+=' ',q+=" ",q+=" ",q+="",q}function k5($){if(!$||$==="flat")return"flat";else if($==="square")return"sq";else if($==="round")return"rnd";else throw Error(`Invalid chart line cap: ${$}`)}function y7($){var q,Q;let K=typeof process<"u"&&!!((q=process.versions)===null||q===void 0?void 0:q.node)&&((Q=process.release)===null||Q===void 0?void 0:Q.name)==="node",J,Z,G=K?()=>W2(this,void 0,void 0,function*(){({default:J}=yield import("node:fs")),{default:Z}=yield Promise.resolve().then(() => (sK(),rK))}):()=>W2(this,void 0,void 0,function*(){});if(K)G();let W=[],B=$._relsMedia.filter((U)=>U.type!=="online"&&!U.data&&(!U.path||U.path&&!U.path.includes("preencoded"))),V=[];return B.forEach((U)=>{if(!V.includes(U.path))U.isDuplicate=!1,V.push(U.path);else U.isDuplicate=!0}),B.filter((U)=>!U.isDuplicate).forEach((U)=>{W.push((()=>W2(this,void 0,void 0,function*(){if(!Z)yield G();if(K&&J&&U.path.indexOf("http")!==0)try{let w=J.readFileSync(U.path);return U.data=Buffer.from(w).toString("base64"),B.filter((F)=>F.isDuplicate&&F.path===U.path).forEach((F)=>F.data=U.data),"done"}catch(w){throw U.data=j6,B.filter((F)=>F.isDuplicate&&F.path===U.path).forEach((F)=>F.data=U.data),Error(`ERROR: Unable to read media: "${U.path}" -${String(w)}`)}if(K&&Z&&U.path.startsWith("http"))return yield new Promise((w,F)=>{Z.get(U.path,(M)=>{let k="";M.setEncoding("binary"),M.on("data",(f)=>k+=f),M.on("end",()=>{U.data=Buffer.from(k,"binary").toString("base64"),B.filter((f)=>f.isDuplicate&&f.path===U.path).forEach((f)=>f.data=U.data),w("done")}),M.on("error",()=>{U.data=j6,B.filter((f)=>f.isDuplicate&&f.path===U.path).forEach((f)=>f.data=U.data),F(Error(`ERROR! Unable to load image (https.get): ${U.path}`))})})});return yield new Promise((w,F)=>{let M=new XMLHttpRequest;M.onload=()=>{let k=new FileReader;k.onloadend=()=>{if(U.data=k.result,B.filter((f)=>f.isDuplicate&&f.path===U.path).forEach((f)=>f.data=U.data),!U.isSvgPng)w("done");else $J(U).then(()=>w("done")).catch(F)},k.readAsDataURL(M.response)},M.onerror=()=>{U.data=j6,B.filter((k)=>k.isDuplicate&&k.path===U.path).forEach((k)=>k.data=U.data),F(Error(`ERROR! Unable to load image (xhr.onerror): ${U.path}`))},M.open("GET",U.path),M.responseType="blob",M.send()})}))())}),$._relsMedia.filter((U)=>U.isSvgPng&&U.data).forEach((U)=>{(()=>W2(this,void 0,void 0,function*(){if(K&&!J)yield G();if(K&&J)U.data=j6,W.push(Promise.resolve("done"));else W.push($J(U))}))()}),W}function $J($){return W2(this,void 0,void 0,function*(){return yield new Promise((q,Q)=>{let K=new Image;K.onload=()=>{if(K.width+K.height===0)K.onerror("h/w=0");let J=document.createElement("CANVAS"),Z=J.getContext("2d");J.width=K.width,J.height=K.height,Z.drawImage(K,0,0);try{$.data=J.toDataURL($.type),q("done")}catch(G){K.onerror(G.toString())}J=null},K.onerror=()=>{$.data=j6,Q(Error(`ERROR! Unable to load image (image.onerror): ${$.path}`))},K.src=typeof $.data==="string"?$.data:j6})})}var XB={cover:function($,q){let Q=$.h/$.w,J=q.h/q.w>Q,Z=J?q.h/Q:q.w,G=J?q.h:q.w*Q,W=Math.round(50000*(1-q.w/Z)),B=Math.round(50000*(1-q.h/G));return``},contain:function($,q){let Q=$.h/$.w,J=q.h/q.w>Q,Z=J?q.w:q.h/Q,G=J?q.w*Q:q.h,W=Math.round(50000*(1-q.w/Z)),B=Math.round(50000*(1-q.h/G));return``},crop:function($,q){let Q=q.x,K=$.w-(q.x+q.w),J=q.y,Z=$.h-(q.y+q.h),G=Math.round(1e5*(Q/$.w)),W=Math.round(1e5*(K/$.w)),B=Math.round(1e5*(J/$.h)),V=Math.round(1e5*(Z/$.h));return``}};function n7($){var q;let Q=$._name?'':"",K=1;if($._bkgdImgRid)Q+=``;else if((q=$.background)===null||q===void 0?void 0:q.color)Q+=`${B2($.background)}`;else if(!$.bkgd&&$._name&&$._name===h7)Q+='';if(Q+="",Q+='',Q+='',Q+='',$._slideObjects.forEach((J,Z)=>{var G,W,B,V,U,w,F,M;let k=0,f=0,L=H0("75%","X",$._presLayout),D=0,z,N="",H=null,v=null,j=0,n=0,d=null,_=null,X=(G=J.options)===null||G===void 0?void 0:G.sizing,P=(W=J.options)===null||W===void 0?void 0:W.rounding;if($._slideLayout!==void 0&&$._slideLayout._slideObjects!==void 0&&J.options&&J.options.placeholder)z=$._slideLayout._slideObjects.filter((h)=>h.options.placeholder===J.options.placeholder)[0];if(J.options=J.options||{},typeof J.options.x<"u")k=H0(J.options.x,"X",$._presLayout);if(typeof J.options.y<"u")f=H0(J.options.y,"Y",$._presLayout);if(typeof J.options.w<"u")L=H0(J.options.w,"X",$._presLayout);if(typeof J.options.h<"u")D=H0(J.options.h,"Y",$._presLayout);let g=L,c=D;if(z){if(z.options.x||z.options.x===0)k=H0(z.options.x,"X",$._presLayout);if(z.options.y||z.options.y===0)f=H0(z.options.y,"Y",$._presLayout);if(z.options.w||z.options.w===0)L=H0(z.options.w,"X",$._presLayout);if(z.options.h||z.options.h===0)D=H0(z.options.h,"Y",$._presLayout)}if(J.options.flipH)N+=' flipH="1"';if(J.options.flipV)N+=' flipV="1"';if(J.options.rotate)N+=` rot="${S1(J.options.rotate)}"`;switch(J._type){case D0.table:if(H=J.arrTabRows,v=J.options,j=0,n=0,H[0].forEach((h)=>{d=h.options||null,j+=(d===null||d===void 0?void 0:d.colspan)?Number(d.colspan):1}),_=``,_+=' ',_+=``,_+='',Array.isArray(v.colW)){_+="";for(let h=0;h`}_+=""}else{if(n=v.colW?v.colW:L0,J.options.w&&!v.colW)n=Math.round((typeof J.options.w==="number"?J.options.w:1)/j);_+="";for(let h=0;h`;_+=""}H.forEach((h)=>{var x,l;for(let $0=0;$01){let W0=Array(F0-1).fill(void 0).map(()=>{return{_type:D0.tablecell,options:{rowspan:p},_hmerge:!0}});h.splice($0+1,0,...W0),$0+=F0}else $0+=1}}),H.forEach((h,x)=>{let l=H[x+1];if(!l)return;h.forEach(($0,Z0)=>{var F0,p;let W0=$0._rowContinue||((F0=$0.options)===null||F0===void 0?void 0:F0.rowspan),y=(p=$0.options)===null||p===void 0?void 0:p.colspan,i=$0._hmerge;if(W0&&W0>1){let U0={_type:D0.tablecell,options:{colspan:y},_rowContinue:W0-1,_vmerge:!0,_hmerge:i};l.splice(Z0,0,U0)}})}),H.forEach((h,x)=>{let l=0;if(Array.isArray(v.rowH)&&v.rowH[x])l=v0(Number(v.rowH[x]));else if(v.rowH&&!isNaN(Number(v.rowH)))l=v0(Number(v.rowH));else if(J.options.cy||J.options.h)l=Math.round((J.options.h?v0(J.options.h):typeof J.options.cy==="number"?J.options.cy:1)/H.length);_+=``,h.forEach(($0)=>{var Z0,F0,p,W0,y;let i=$0,U0={rowSpan:((Z0=i.options)===null||Z0===void 0?void 0:Z0.rowspan)>1?i.options.rowspan:void 0,gridSpan:((F0=i.options)===null||F0===void 0?void 0:F0.colspan)>1?i.options.colspan:void 0,vMerge:i._vmerge?1:void 0,hMerge:i._hmerge?1:void 0},m=Object.keys(U0).map((K0)=>[K0,U0[K0]]).filter(([,K0])=>!!K0).map(([K0,R])=>`${String(K0)}="${String(R)}"`).join(" ");if(m)m=" "+m;if(i._hmerge||i._vmerge){_+=``;return}let V0=i.options||{};i.options=V0,["align","bold","border","color","fill","fontFace","fontSize","margin","textDirection","underline","valign"].forEach((K0)=>{if(v[K0]&&!V0[K0]&&V0[K0]!==0)V0[K0]=v[K0]});let w0=V0.valign?` anchor="${V0.valign.replace(/^c$/i,"ctr").replace(/^m$/i,"ctr").replace("center","ctr").replace("middle","ctr").replace("top","t").replace("btm","b").replace("bottom","b")}"`:"",S=V0.textDirection&&V0.textDirection!=="horz"?` vert="${V0.textDirection}"`:"",b=((W0=(p=i._optImp)===null||p===void 0?void 0:p.fill)===null||W0===void 0?void 0:W0.color)?i._optImp.fill.color:((y=i._optImp)===null||y===void 0?void 0:y.fill)&&typeof i._optImp.fill==="string"?i._optImp.fill:"";b=b||V0.fill?V0.fill:"";let O=b?B2(b):"",E=V0.margin===0||V0.margin?V0.margin:KJ;if(!Array.isArray(E)&&typeof E==="number")E=[E,E,E,E];let a="";if(E[0]>=1)a=` marL="${Y0(E[3])}" marR="${Y0(E[1])}" marT="${Y0(E[0])}" marB="${Y0(E[2])}"`;else a=` marL="${v0(E[3])}" marR="${v0(E[1])}" marT="${v0(E[0])}" marB="${v0(E[2])}"`;if(_+=`${qJ(i)}`,V0.border&&Array.isArray(V0.border))[{idx:3,name:"lnL"},{idx:1,name:"lnR"},{idx:0,name:"lnT"},{idx:2,name:"lnB"}].forEach((K0)=>{if(V0.border[K0.idx].type!=="none")_+=``,_+=`${R0(V0.border[K0.idx].color)}`,_+=``,_+=``;else _+=``});_+=O,_+=" ",_+=" "}),_+=""}),_+=" ",_+=" ",_+=" ",_+="",Q+=_,K++;break;case D0.text:case D0.placeholder:if(!J.options.line&&D===0)D=L0*0.3;if(!J.options._bodyProp)J.options._bodyProp={};if(J.options.margin&&Array.isArray(J.options.margin))J.options._bodyProp.lIns=Y0(J.options.margin[0]||0),J.options._bodyProp.rIns=Y0(J.options.margin[1]||0),J.options._bodyProp.bIns=Y0(J.options.margin[2]||0),J.options._bodyProp.tIns=Y0(J.options.margin[3]||0);else if(typeof J.options.margin==="number")J.options._bodyProp.lIns=Y0(J.options.margin),J.options._bodyProp.rIns=Y0(J.options.margin),J.options._bodyProp.bIns=Y0(J.options.margin),J.options._bodyProp.tIns=Y0(J.options.margin);if(Q+="",Q+=``,(B=J.options.hyperlink)===null||B===void 0?void 0:B.url)Q+=``;if((V=J.options.hyperlink)===null||V===void 0?void 0:V.slide)Q+=``;if(Q+="",Q+="':"/>"),Q+=`${J._type==="placeholder"?w5(J):w5(z)}`,Q+="",Q+=``,Q+=``,Q+=``,J.shape==="custGeom")Q+="",Q+="",Q+="",Q+="",Q+="",Q+="",Q+='',Q+="",Q+=``,(w=J.options.points)===null||w===void 0||w.forEach((h,x)=>{if("curve"in h)switch(h.curve.type){case"arc":Q+=``;break;case"cubic":Q+=` + `}function j0($){let q="",Q=$-1;if(Q<=25)q=W8[Q];else q=`${W8[Math.floor(Q/W8.length-1)]}${W8[Q%W8.length]}`;return q}function T1($,q){if(!$)return"";else if(typeof $!=="object")return console.warn("`shadow` options must be an object. Ex: `{shadow: {type:'none'}}`"),"";let Q="",K=Object.assign(Object.assign({},q),$),J=K.type||"outer",Z=Y0(K.blur),G=Y0(K.offset),W=Math.round(K.angle*60000),B=K.color,V=Math.round(K.opacity*1e5),U=K.rotateWithShape?1:0;return Q+=``,Q+=``,Q+=``,Q+=``,Q+="",Q}function b7($){let q="";return q+=" ",q+=` `,q+=' ',q+=' ',q+=" ",q+=" ",q+="",q}function k5($){if(!$||$==="flat")return"flat";else if($==="square")return"sq";else if($==="round")return"rnd";else throw Error(`Invalid chart line cap: ${$}`)}function y7($){var q,Q;let K=typeof process<"u"&&!!((q=process.versions)===null||q===void 0?void 0:q.node)&&((Q=process.release)===null||Q===void 0?void 0:Q.name)==="node",J,Z,G=K?()=>W2(this,void 0,void 0,function*(){({default:J}=yield import("node:fs")),{default:Z}=yield Promise.resolve().then(() => (tK(),sK))}):()=>W2(this,void 0,void 0,function*(){});if(K)G();let W=[],B=$._relsMedia.filter((U)=>U.type!=="online"&&!U.data&&(!U.path||U.path&&!U.path.includes("preencoded"))),V=[];return B.forEach((U)=>{if(!V.includes(U.path))U.isDuplicate=!1,V.push(U.path);else U.isDuplicate=!0}),B.filter((U)=>!U.isDuplicate).forEach((U)=>{W.push((()=>W2(this,void 0,void 0,function*(){if(!Z)yield G();if(K&&J&&U.path.indexOf("http")!==0)try{let w=J.readFileSync(U.path);return U.data=Buffer.from(w).toString("base64"),B.filter((F)=>F.isDuplicate&&F.path===U.path).forEach((F)=>F.data=U.data),"done"}catch(w){throw U.data=j6,B.filter((F)=>F.isDuplicate&&F.path===U.path).forEach((F)=>F.data=U.data),Error(`ERROR: Unable to read media: "${U.path}" +${String(w)}`)}if(K&&Z&&U.path.startsWith("http"))return yield new Promise((w,F)=>{Z.get(U.path,(M)=>{let k="";M.setEncoding("binary"),M.on("data",(f)=>k+=f),M.on("end",()=>{U.data=Buffer.from(k,"binary").toString("base64"),B.filter((f)=>f.isDuplicate&&f.path===U.path).forEach((f)=>f.data=U.data),w("done")}),M.on("error",()=>{U.data=j6,B.filter((f)=>f.isDuplicate&&f.path===U.path).forEach((f)=>f.data=U.data),F(Error(`ERROR! Unable to load image (https.get): ${U.path}`))})})});return yield new Promise((w,F)=>{let M=new XMLHttpRequest;M.onload=()=>{let k=new FileReader;k.onloadend=()=>{if(U.data=k.result,B.filter((f)=>f.isDuplicate&&f.path===U.path).forEach((f)=>f.data=U.data),!U.isSvgPng)w("done");else QJ(U).then(()=>w("done")).catch(F)},k.readAsDataURL(M.response)},M.onerror=()=>{U.data=j6,B.filter((k)=>k.isDuplicate&&k.path===U.path).forEach((k)=>k.data=U.data),F(Error(`ERROR! Unable to load image (xhr.onerror): ${U.path}`))},M.open("GET",U.path),M.responseType="blob",M.send()})}))())}),$._relsMedia.filter((U)=>U.isSvgPng&&U.data).forEach((U)=>{(()=>W2(this,void 0,void 0,function*(){if(K&&!J)yield G();if(K&&J)U.data=j6,W.push(Promise.resolve("done"));else W.push(QJ(U))}))()}),W}function QJ($){return W2(this,void 0,void 0,function*(){return yield new Promise((q,Q)=>{let K=new Image;K.onload=()=>{if(K.width+K.height===0)K.onerror("h/w=0");let J=document.createElement("CANVAS"),Z=J.getContext("2d");J.width=K.width,J.height=K.height,Z.drawImage(K,0,0);try{$.data=J.toDataURL($.type),q("done")}catch(G){K.onerror(G.toString())}J=null},K.onerror=()=>{$.data=j6,Q(Error(`ERROR! Unable to load image (image.onerror): ${$.path}`))},K.src=typeof $.data==="string"?$.data:j6})})}var cB={cover:function($,q){let Q=$.h/$.w,J=q.h/q.w>Q,Z=J?q.h/Q:q.w,G=J?q.h:q.w*Q,W=Math.round(50000*(1-q.w/Z)),B=Math.round(50000*(1-q.h/G));return``},contain:function($,q){let Q=$.h/$.w,J=q.h/q.w>Q,Z=J?q.w:q.h/Q,G=J?q.w*Q:q.h,W=Math.round(50000*(1-q.w/Z)),B=Math.round(50000*(1-q.h/G));return``},crop:function($,q){let Q=q.x,K=$.w-(q.x+q.w),J=q.y,Z=$.h-(q.y+q.h),G=Math.round(1e5*(Q/$.w)),W=Math.round(1e5*(K/$.w)),B=Math.round(1e5*(J/$.h)),V=Math.round(1e5*(Z/$.h));return``}};function n7($){var q;let Q=$._name?'':"",K=1;if($._bkgdImgRid)Q+=``;else if((q=$.background)===null||q===void 0?void 0:q.color)Q+=`${B2($.background)}`;else if(!$.bkgd&&$._name&&$._name===h7)Q+='';if(Q+="",Q+='',Q+='',Q+='',$._slideObjects.forEach((J,Z)=>{var G,W,B,V,U,w,F,M;let k=0,f=0,L=H0("75%","X",$._presLayout),D=0,z,N="",H=null,v=null,j=0,n=0,d=null,_=null,X=(G=J.options)===null||G===void 0?void 0:G.sizing,P=(W=J.options)===null||W===void 0?void 0:W.rounding;if($._slideLayout!==void 0&&$._slideLayout._slideObjects!==void 0&&J.options&&J.options.placeholder)z=$._slideLayout._slideObjects.filter((h)=>h.options.placeholder===J.options.placeholder)[0];if(J.options=J.options||{},typeof J.options.x<"u")k=H0(J.options.x,"X",$._presLayout);if(typeof J.options.y<"u")f=H0(J.options.y,"Y",$._presLayout);if(typeof J.options.w<"u")L=H0(J.options.w,"X",$._presLayout);if(typeof J.options.h<"u")D=H0(J.options.h,"Y",$._presLayout);let g=L,c=D;if(z){if(z.options.x||z.options.x===0)k=H0(z.options.x,"X",$._presLayout);if(z.options.y||z.options.y===0)f=H0(z.options.y,"Y",$._presLayout);if(z.options.w||z.options.w===0)L=H0(z.options.w,"X",$._presLayout);if(z.options.h||z.options.h===0)D=H0(z.options.h,"Y",$._presLayout)}if(J.options.flipH)N+=' flipH="1"';if(J.options.flipV)N+=' flipV="1"';if(J.options.rotate)N+=` rot="${S1(J.options.rotate)}"`;switch(J._type){case D0.table:if(H=J.arrTabRows,v=J.options,j=0,n=0,H[0].forEach((h)=>{d=h.options||null,j+=(d===null||d===void 0?void 0:d.colspan)?Number(d.colspan):1}),_=``,_+=' ',_+=``,_+='',Array.isArray(v.colW)){_+="";for(let h=0;h`}_+=""}else{if(n=v.colW?v.colW:L0,J.options.w&&!v.colW)n=Math.round((typeof J.options.w==="number"?J.options.w:1)/j);_+="";for(let h=0;h`;_+=""}H.forEach((h)=>{var x,l;for(let $0=0;$01){let W0=Array(F0-1).fill(void 0).map(()=>{return{_type:D0.tablecell,options:{rowspan:p},_hmerge:!0}});h.splice($0+1,0,...W0),$0+=F0}else $0+=1}}),H.forEach((h,x)=>{let l=H[x+1];if(!l)return;h.forEach(($0,Z0)=>{var F0,p;let W0=$0._rowContinue||((F0=$0.options)===null||F0===void 0?void 0:F0.rowspan),y=(p=$0.options)===null||p===void 0?void 0:p.colspan,i=$0._hmerge;if(W0&&W0>1){let U0={_type:D0.tablecell,options:{colspan:y},_rowContinue:W0-1,_vmerge:!0,_hmerge:i};l.splice(Z0,0,U0)}})}),H.forEach((h,x)=>{let l=0;if(Array.isArray(v.rowH)&&v.rowH[x])l=v0(Number(v.rowH[x]));else if(v.rowH&&!isNaN(Number(v.rowH)))l=v0(Number(v.rowH));else if(J.options.cy||J.options.h)l=Math.round((J.options.h?v0(J.options.h):typeof J.options.cy==="number"?J.options.cy:1)/H.length);_+=``,h.forEach(($0)=>{var Z0,F0,p,W0,y;let i=$0,U0={rowSpan:((Z0=i.options)===null||Z0===void 0?void 0:Z0.rowspan)>1?i.options.rowspan:void 0,gridSpan:((F0=i.options)===null||F0===void 0?void 0:F0.colspan)>1?i.options.colspan:void 0,vMerge:i._vmerge?1:void 0,hMerge:i._hmerge?1:void 0},m=Object.keys(U0).map((K0)=>[K0,U0[K0]]).filter(([,K0])=>!!K0).map(([K0,R])=>`${String(K0)}="${String(R)}"`).join(" ");if(m)m=" "+m;if(i._hmerge||i._vmerge){_+=``;return}let V0=i.options||{};i.options=V0,["align","bold","border","color","fill","fontFace","fontSize","margin","textDirection","underline","valign"].forEach((K0)=>{if(v[K0]&&!V0[K0]&&V0[K0]!==0)V0[K0]=v[K0]});let w0=V0.valign?` anchor="${V0.valign.replace(/^c$/i,"ctr").replace(/^m$/i,"ctr").replace("center","ctr").replace("middle","ctr").replace("top","t").replace("btm","b").replace("bottom","b")}"`:"",S=V0.textDirection&&V0.textDirection!=="horz"?` vert="${V0.textDirection}"`:"",b=((W0=(p=i._optImp)===null||p===void 0?void 0:p.fill)===null||W0===void 0?void 0:W0.color)?i._optImp.fill.color:((y=i._optImp)===null||y===void 0?void 0:y.fill)&&typeof i._optImp.fill==="string"?i._optImp.fill:"";b=b||V0.fill?V0.fill:"";let O=b?B2(b):"",E=V0.margin===0||V0.margin?V0.margin:JJ;if(!Array.isArray(E)&&typeof E==="number")E=[E,E,E,E];let a="";if(E[0]>=1)a=` marL="${Y0(E[3])}" marR="${Y0(E[1])}" marT="${Y0(E[0])}" marB="${Y0(E[2])}"`;else a=` marL="${v0(E[3])}" marR="${v0(E[1])}" marT="${v0(E[0])}" marB="${v0(E[2])}"`;if(_+=`${KJ(i)}`,V0.border&&Array.isArray(V0.border))[{idx:3,name:"lnL"},{idx:1,name:"lnR"},{idx:0,name:"lnT"},{idx:2,name:"lnB"}].forEach((K0)=>{if(V0.border[K0.idx].type!=="none")_+=``,_+=`${R0(V0.border[K0.idx].color)}`,_+=``,_+=``;else _+=``});_+=O,_+=" ",_+=" "}),_+=""}),_+=" ",_+=" ",_+=" ",_+="",Q+=_,K++;break;case D0.text:case D0.placeholder:if(!J.options.line&&D===0)D=L0*0.3;if(!J.options._bodyProp)J.options._bodyProp={};if(J.options.margin&&Array.isArray(J.options.margin))J.options._bodyProp.lIns=Y0(J.options.margin[0]||0),J.options._bodyProp.rIns=Y0(J.options.margin[1]||0),J.options._bodyProp.bIns=Y0(J.options.margin[2]||0),J.options._bodyProp.tIns=Y0(J.options.margin[3]||0);else if(typeof J.options.margin==="number")J.options._bodyProp.lIns=Y0(J.options.margin),J.options._bodyProp.rIns=Y0(J.options.margin),J.options._bodyProp.bIns=Y0(J.options.margin),J.options._bodyProp.tIns=Y0(J.options.margin);if(Q+="",Q+=``,(B=J.options.hyperlink)===null||B===void 0?void 0:B.url)Q+=``;if((V=J.options.hyperlink)===null||V===void 0?void 0:V.slide)Q+=``;if(Q+="",Q+="':"/>"),Q+=`${J._type==="placeholder"?w5(J):w5(z)}`,Q+="",Q+=``,Q+=``,Q+=``,J.shape==="custGeom")Q+="",Q+="",Q+="",Q+="",Q+="",Q+="",Q+='',Q+="",Q+=``,(w=J.options.points)===null||w===void 0||w.forEach((h,x)=>{if("curve"in h)switch(h.curve.type){case"arc":Q+=``;break;case"cubic":Q+=` `;break;case"quadratic":Q+=` - `;break}else if("close"in h)Q+="";else if(h.moveTo||x===0)Q+=``;else Q+=``}),Q+="",Q+="",Q+="";else{if(Q+='',J.options.rectRadius)Q+=``;else if(J.options.angleRange){for(let h=0;h<2;h++){let x=J.options.angleRange[h];Q+=``}if(J.options.arcThicknessRatio)Q+=``}Q+=""}if(Q+=J.options.fill?B2(J.options.fill):"",J.options.line){if(Q+=J.options.line.width?``:"",J.options.line.color)Q+=B2(J.options.line);if(J.options.line.dashType)Q+=``;if(J.options.line.beginArrowType)Q+=``;if(J.options.line.endArrowType)Q+=``;Q+=""}if(J.options.shadow&&J.options.shadow.type!=="none")J.options.shadow.type=J.options.shadow.type||"outer",J.options.shadow.blur=Y0(J.options.shadow.blur||8),J.options.shadow.offset=Y0(J.options.shadow.offset||4),J.options.shadow.angle=Math.round((J.options.shadow.angle||270)*60000),J.options.shadow.opacity=Math.round((J.options.shadow.opacity||0.75)*1e5),J.options.shadow.color=J.options.shadow.color||tK.color,Q+="",Q+=` `,Q+=` `,Q+=` `,Q+=" ",Q+="";Q+="",Q+=qJ(J),Q+="";break;case D0.image:if(Q+="",Q+=" ",Q+=``,(F=J.hyperlink)===null||F===void 0?void 0:F.url)Q+=``;if((M=J.hyperlink)===null||M===void 0?void 0:M.slide)Q+=``;if(Q+=" ",Q+=' ',Q+=" "+w5(z)+"",Q+=" ",Q+="",($._relsMedia||[]).filter((h)=>h.rId===J.imageRid)[0]&&($._relsMedia||[]).filter((h)=>h.rId===J.imageRid)[0].extn==="svg")Q+=``,Q+=J.options.transparency?` `:"",Q+=" ",Q+=' ',Q+=` `,Q+=" ",Q+=" ",Q+="";else Q+=``,Q+=J.options.transparency?``:"",Q+="";if(X===null||X===void 0?void 0:X.type){let h=X.w?H0(X.w,"X",$._presLayout):L,x=X.h?H0(X.h,"Y",$._presLayout):D,l=H0(X.x||0,"X",$._presLayout),$0=H0(X.y||0,"Y",$._presLayout);Q+=XB[X.type]({w:g,h:c},{w:h,h:x,x:l,y:$0}),g=h,c=x}else Q+=" ";if(Q+="",Q+="",Q+=" ",Q+=` `,Q+=` `,Q+=" ",Q+=` `,J.options.shadow&&J.options.shadow.type!=="none")J.options.shadow.type=J.options.shadow.type||"outer",J.options.shadow.blur=Y0(J.options.shadow.blur||8),J.options.shadow.offset=Y0(J.options.shadow.offset||4),J.options.shadow.angle=Math.round((J.options.shadow.angle||270)*60000),J.options.shadow.opacity=Math.round((J.options.shadow.opacity||0.75)*1e5),J.options.shadow.color=J.options.shadow.color||tK.color,Q+="",Q+=``,Q+=``,Q+=``,Q+=``,Q+="";Q+="",Q+="";break;case D0.media:if(J.mtype==="online")Q+="",Q+=" ",Q+=``,Q+=" ",Q+=" ",Q+=` `,Q+=" ",Q+=" ",Q+=` `,Q+=" ",Q+=` `,Q+=' ',Q+=" ",Q+="";else Q+="",Q+=" ",Q+=``,Q+=' ',Q+=" ",Q+=` `,Q+=" ",Q+=' ',Q+=` `,Q+=" ",Q+=" ",Q+=" ",Q+=" ",Q+=` `,Q+=" ",Q+=` `,Q+=' ',Q+=" ",Q+="";break;case D0.chart:Q+="",Q+=" ",Q+=` `,Q+=" ",Q+=` ${w5(z)}`,Q+=" ",Q+=` `,Q+=' ',Q+=' ',Q+=` `,Q+=" ",Q+=" ",Q+="";break;default:Q+="";break}}),$._slideNumberProps){if(!$._slideNumberProps.align)$._slideNumberProps.align="left";if(Q+="",Q+=" ",Q+=' ',Q+=' ',Q+=" ",Q+=" ",Q+=` `,Q+="",Q+="`,$._slideNumberProps.color)Q+=B2($._slideNumberProps.color);if($._slideNumberProps.fontFace)Q+=``;Q+=""}if(Q+="",Q+="",$._slideNumberProps.align.startsWith("l"))Q+='';else if($._slideNumberProps.align.startsWith("c"))Q+='';else if($._slideNumberProps.align.startsWith("r"))Q+='';else Q+='';Q+=``,Q+=`${$._slideNum}`,Q+=""}return Q+="",Q+="",Q}function d7($,q){let Q=0,K=''+n0+'';return $._rels.forEach((J)=>{if(Q=Math.max(Q,J.rId),J.type.toLowerCase().includes("hyperlink"))if(J.data==="slide")K+=``;else K+=``;else if(J.type.toLowerCase().includes("notesSlide"))K+=``}),($._relsChart||[]).forEach((J)=>{Q=Math.max(Q,J.rId),K+=``}),($._relsMedia||[]).forEach((J)=>{let Z=J.rId.toString();if(Q=Math.max(Q,J.rId),J.type.toLowerCase().includes("image"))K+='';else if(J.type.toLowerCase().includes("audio"))if(K.includes(' Target="'+J.Target+'"'))K+='';else K+='';else if(J.type.toLowerCase().includes("video"))if(K.includes(' Target="'+J.Target+'"'))K+='';else K+='';else if(J.type.toLowerCase().includes("online"))if(K.includes(' Target="'+J.Target+'"'))K+='';else K+=''}),q.forEach((J,Z)=>{K+=``}),K+="",K}function QJ($,q){var Q,K;let J="",Z="",G="",W="",B=q?"a:lvl1pPr":"a:pPr",V=Y0(FB),U=`<${B}${$.options.rtlMode?' rtl="1" ':""}`;{if($.options.align)switch($.options.align){case"left":U+=' algn="l"';break;case"right":U+=' algn="r"';break;case"center":U+=' algn="ctr"';break;case"justify":U+=' algn="just"';break;default:U+="";break}if($.options.lineSpacing)Z=``;else if($.options.lineSpacingMultiple)Z=``;if($.options.indentLevel&&!isNaN(Number($.options.indentLevel))&&$.options.indentLevel>0)U+=` lvl="${$.options.indentLevel}"`;if($.options.paraSpaceBefore&&!isNaN(Number($.options.paraSpaceBefore))&&$.options.paraSpaceBefore>0)G+=``;if($.options.paraSpaceAfter&&!isNaN(Number($.options.paraSpaceAfter))&&$.options.paraSpaceAfter>0)G+=``;if(typeof $.options.bullet==="object"){if((K=(Q=$===null||$===void 0?void 0:$.options)===null||Q===void 0?void 0:Q.bullet)===null||K===void 0?void 0:K.indent)V=Y0($.options.bullet.indent);if($.options.bullet.type){if($.options.bullet.type.toString().toLowerCase()==="number")U+=` marL="${$.options.indentLevel&&$.options.indentLevel>0?V+V*$.options.indentLevel:V}" indent="-${V}"`,J=``}else if($.options.bullet.characterCode){let w=`&#x${$.options.bullet.characterCode};`;if(!/^[0-9A-Fa-f]{4}$/.test($.options.bullet.characterCode))console.warn("Warning: `bullet.characterCode should be a 4-digit unicode charatcer (ex: 22AB)`!"),w=C6.DEFAULT;U+=` marL="${$.options.indentLevel&&$.options.indentLevel>0?V+V*$.options.indentLevel:V}" indent="-${V}"`,J=''}else if($.options.bullet.code){let w=`&#x${$.options.bullet.code};`;if(!/^[0-9A-Fa-f]{4}$/.test($.options.bullet.code))console.warn("Warning: `bullet.code should be a 4-digit hex code (ex: 22AB)`!"),w=C6.DEFAULT;U+=` marL="${$.options.indentLevel&&$.options.indentLevel>0?V+V*$.options.indentLevel:V}" indent="-${V}"`,J=''}else U+=` marL="${$.options.indentLevel&&$.options.indentLevel>0?V+V*$.options.indentLevel:V}" indent="-${V}"`,J=``}else if($.options.bullet)U+=` marL="${$.options.indentLevel&&$.options.indentLevel>0?V+V*$.options.indentLevel:V}" indent="-${V}"`,J=``;else if(!$.options.bullet)U+=' indent="0" marL="0"',J="";if($.options.tabStops&&Array.isArray($.options.tabStops))W=`${$.options.tabStops.map((F)=>``).join("")}`;if(U+=">"+Z+G+J+W,q)U+=FJ($.options,!0);U+=""}return U}function FJ($,q){var Q;let K="",J=q?"a:defRPr":"a:rPr";if(K+="<"+J+' lang="'+($.lang?$.lang:"en-US")+'"'+($.lang?' altLang="en-US"':""),K+=$.fontSize?` sz="${Math.round($.fontSize*100)}"`:"",K+=($===null||$===void 0?void 0:$.bold)?` b="${$.bold?"1":"0"}"`:"",K+=($===null||$===void 0?void 0:$.italic)?` i="${$.italic?"1":"0"}"`:"",K+=($===null||$===void 0?void 0:$.strike)?` strike="${typeof $.strike==="string"?$.strike:"sngStrike"}"`:"",typeof $.underline==="object"&&((Q=$.underline)===null||Q===void 0?void 0:Q.style))K+=` u="${$.underline.style}"`;else if(typeof $.underline==="string")K+=` u="${String($.underline)}"`;else if($.hyperlink)K+=' u="sng"';if($.baseline)K+=` baseline="${Math.round($.baseline*50)}"`;else if($.subscript)K+=' baseline="-40000"';else if($.superscript)K+=' baseline="30000"';if(K+=$.charSpacing?` spc="${Math.round($.charSpacing*100)}" kern="0"`:"",K+=' dirty="0">',$.color||$.fontFace||$.outline||typeof $.underline==="object"&&$.underline.color){if($.outline&&typeof $.outline==="object")K+=`${B2($.outline.color||"FFFFFF")}`;if($.color)K+=B2({color:$.color,transparency:$.transparency});if($.highlight)K+=`${R0($.highlight)}`;if(typeof $.underline==="object"&&$.underline.color)K+=`${B2($.underline.color)}`;if($.glow)K+=`${kB($.glow,wB)}`;if($.fontFace)K+=``}if($.hyperlink){if(typeof $.hyperlink!=="object")throw Error("ERROR: text `hyperlink` option should be an object. Ex: `hyperlink:{url:'https://github.com'}` ");else if(!$.hyperlink.url&&!$.hyperlink.slide)throw Error("ERROR: 'hyperlink requires either `url` or `slide`'");else if($.hyperlink.url)K+=`":"/>"}`;else if($.hyperlink.slide)K+=`":"/>"}`;if($.color)K+=" ",K+=' ',K+=' ',K+=" ",K+=" ",K+=""}return K+=``,K}function yB($){return $.text?`${FJ($.options,!1)}${k0($.text)}`:""}function hB($){let q="";else if($.options.fit==="resize")q+=""}if($.options.shrinkText)q+="";q+=$.options._bodyProp.autoFit?"":"",q+=""}else q+=' wrap="square" rtlCol="0">',q+="";return $._type===D0.tablecell?"":q}function qJ($){let q=$.options||{},Q=[],K=[];if(q&&$._type!==D0.tablecell&&(typeof $.text>"u"||$.text===null))return"";let J=$._type===D0.tablecell?"":"";if(J+=hB($),q.h===0&&q.line&&q.align)J+='';else if($._type==="placeholder")J+=`${QJ($,!0)}`;else J+="";if(typeof $.text==="string"||typeof $.text==="number")Q.push({text:$.text.toString(),options:q||{}});else if($.text&&!Array.isArray($.text)&&typeof $.text==="object"&&Object.keys($.text).includes("text"))Q.push({text:$.text||"",options:$.options||{}});else if(Array.isArray($.text))Q=$.text.map((W)=>({text:W.text,options:W.options}));Q.forEach((W,B)=>{if(!W.text)W.text="";if(W.options=W.options||q||{},B===0&&W.options&&!W.options.bullet&&q.bullet)W.options.bullet=q.bullet;if(typeof W.text==="string"||typeof W.text==="number")W.text=W.text.toString().replace(/\r*\n/g,n0);if(W.text.includes(n0)&&W.text.match(/\n$/g)===null)W.text.split(n0).forEach((V)=>{W.options.breakLine=!0,K.push({text:V,options:W.options})});else K.push(W)});let Z=[],G=[];if(K.forEach((W,B)=>{if(G.length>0&&(W.options.align||q.align)){if(W.options.align!==K[B-1].options.align)Z.push(G),G=[]}else if(G.length>0&&W.options.bullet&&G.length>0)Z.push(G),G=[],W.options.breakLine=!1;if(G.push(W),G.length>0&&W.options.breakLine){if(B+1{var B;let V=!1;J+="";let U=`{if(w.options._lineIdx=F,F>0&&w.options.softBreakBefore)J+="";if(w.options.align=w.options.align||q.align,w.options.lineSpacing=w.options.lineSpacing||q.lineSpacing,w.options.lineSpacingMultiple=w.options.lineSpacingMultiple||q.lineSpacingMultiple,w.options.indentLevel=w.options.indentLevel||q.indentLevel,w.options.paraSpaceBefore=w.options.paraSpaceBefore||q.paraSpaceBefore,w.options.paraSpaceAfter=w.options.paraSpaceAfter||q.paraSpaceAfter,U=QJ(w,!1),J+=U.replace("",""),Object.entries(q).filter(([M])=>!(w.options.hyperlink&&M==="color")).forEach(([M,k])=>{if(M!=="bullet"&&!w.options[M])w.options[M]=k}),J+=yB(w),!w.text&&q.fontSize||w.options.fontSize)V=!0,q.fontSize=q.fontSize||w.options.fontSize}),$._type===D0.tablecell&&(q.fontSize||q.fontFace))if(q.fontFace)J+=`',J+=``,J+=``,J+=``,J+="";else J+=`';else if(V)J+=`';else J+=``;J+=""}),J.indexOf("")===-1)J+="";return J+=$._type===D0.tablecell?"":"",J}function w5($){var q,Q;if(!$)return"";let K=((q=$.options)===null||q===void 0?void 0:q._placeholderIdx)?$.options._placeholderIdx:"",J=((Q=$.options)===null||Q===void 0?void 0:Q._placeholderType)?$.options._placeholderType:"",Z=J&&F8[J]?F8[J].toString():"";return``;break}else if("close"in h)Q+="";else if(h.moveTo||x===0)Q+=``;else Q+=``}),Q+="",Q+="",Q+="";else{if(Q+='',J.options.rectRadius)Q+=``;else if(J.options.angleRange){for(let h=0;h<2;h++){let x=J.options.angleRange[h];Q+=``}if(J.options.arcThicknessRatio)Q+=``}Q+=""}if(Q+=J.options.fill?B2(J.options.fill):"",J.options.line){if(Q+=J.options.line.width?``:"",J.options.line.color)Q+=B2(J.options.line);if(J.options.line.dashType)Q+=``;if(J.options.line.beginArrowType)Q+=``;if(J.options.line.endArrowType)Q+=``;Q+=""}if(J.options.shadow&&J.options.shadow.type!=="none")J.options.shadow.type=J.options.shadow.type||"outer",J.options.shadow.blur=Y0(J.options.shadow.blur||8),J.options.shadow.offset=Y0(J.options.shadow.offset||4),J.options.shadow.angle=Math.round((J.options.shadow.angle||270)*60000),J.options.shadow.opacity=Math.round((J.options.shadow.opacity||0.75)*1e5),J.options.shadow.color=J.options.shadow.color||eK.color,Q+="",Q+=` `,Q+=` `,Q+=` `,Q+=" ",Q+="";Q+="",Q+=KJ(J),Q+="";break;case D0.image:if(Q+="",Q+=" ",Q+=``,(F=J.hyperlink)===null||F===void 0?void 0:F.url)Q+=``;if((M=J.hyperlink)===null||M===void 0?void 0:M.slide)Q+=``;if(Q+=" ",Q+=' ',Q+=" "+w5(z)+"",Q+=" ",Q+="",($._relsMedia||[]).filter((h)=>h.rId===J.imageRid)[0]&&($._relsMedia||[]).filter((h)=>h.rId===J.imageRid)[0].extn==="svg")Q+=``,Q+=J.options.transparency?` `:"",Q+=" ",Q+=' ',Q+=` `,Q+=" ",Q+=" ",Q+="";else Q+=``,Q+=J.options.transparency?``:"",Q+="";if(X===null||X===void 0?void 0:X.type){let h=X.w?H0(X.w,"X",$._presLayout):L,x=X.h?H0(X.h,"Y",$._presLayout):D,l=H0(X.x||0,"X",$._presLayout),$0=H0(X.y||0,"Y",$._presLayout);Q+=cB[X.type]({w:g,h:c},{w:h,h:x,x:l,y:$0}),g=h,c=x}else Q+=" ";if(Q+="",Q+="",Q+=" ",Q+=` `,Q+=` `,Q+=" ",Q+=` `,J.options.shadow&&J.options.shadow.type!=="none")J.options.shadow.type=J.options.shadow.type||"outer",J.options.shadow.blur=Y0(J.options.shadow.blur||8),J.options.shadow.offset=Y0(J.options.shadow.offset||4),J.options.shadow.angle=Math.round((J.options.shadow.angle||270)*60000),J.options.shadow.opacity=Math.round((J.options.shadow.opacity||0.75)*1e5),J.options.shadow.color=J.options.shadow.color||eK.color,Q+="",Q+=``,Q+=``,Q+=``,Q+=``,Q+="";Q+="",Q+="";break;case D0.media:if(J.mtype==="online")Q+="",Q+=" ",Q+=``,Q+=" ",Q+=" ",Q+=` `,Q+=" ",Q+=" ",Q+=` `,Q+=" ",Q+=` `,Q+=' ',Q+=" ",Q+="";else Q+="",Q+=" ",Q+=``,Q+=' ',Q+=" ",Q+=` `,Q+=" ",Q+=' ',Q+=` `,Q+=" ",Q+=" ",Q+=" ",Q+=" ",Q+=` `,Q+=" ",Q+=` `,Q+=' ',Q+=" ",Q+="";break;case D0.chart:Q+="",Q+=" ",Q+=` `,Q+=" ",Q+=` ${w5(z)}`,Q+=" ",Q+=` `,Q+=' ',Q+=' ',Q+=` `,Q+=" ",Q+=" ",Q+="";break;default:Q+="";break}}),$._slideNumberProps){if(!$._slideNumberProps.align)$._slideNumberProps.align="left";if(Q+="",Q+=" ",Q+=' ',Q+=' ',Q+=" ",Q+=" ",Q+=` `,Q+="",Q+="`,$._slideNumberProps.color)Q+=B2($._slideNumberProps.color);if($._slideNumberProps.fontFace)Q+=``;Q+=""}if(Q+="",Q+="",$._slideNumberProps.align.startsWith("l"))Q+='';else if($._slideNumberProps.align.startsWith("c"))Q+='';else if($._slideNumberProps.align.startsWith("r"))Q+='';else Q+='';Q+=``,Q+=`${$._slideNum}`,Q+=""}return Q+="",Q+="",Q}function d7($,q){let Q=0,K=''+n0+'';return $._rels.forEach((J)=>{if(Q=Math.max(Q,J.rId),J.type.toLowerCase().includes("hyperlink"))if(J.data==="slide")K+=``;else K+=``;else if(J.type.toLowerCase().includes("notesSlide"))K+=``}),($._relsChart||[]).forEach((J)=>{Q=Math.max(Q,J.rId),K+=``}),($._relsMedia||[]).forEach((J)=>{let Z=J.rId.toString();if(Q=Math.max(Q,J.rId),J.type.toLowerCase().includes("image"))K+='';else if(J.type.toLowerCase().includes("audio"))if(K.includes(' Target="'+J.Target+'"'))K+='';else K+='';else if(J.type.toLowerCase().includes("video"))if(K.includes(' Target="'+J.Target+'"'))K+='';else K+='';else if(J.type.toLowerCase().includes("online"))if(K.includes(' Target="'+J.Target+'"'))K+='';else K+=''}),q.forEach((J,Z)=>{K+=``}),K+="",K}function qJ($,q){var Q,K;let J="",Z="",G="",W="",B=q?"a:lvl1pPr":"a:pPr",V=Y0(RB),U=`<${B}${$.options.rtlMode?' rtl="1" ':""}`;{if($.options.align)switch($.options.align){case"left":U+=' algn="l"';break;case"right":U+=' algn="r"';break;case"center":U+=' algn="ctr"';break;case"justify":U+=' algn="just"';break;default:U+="";break}if($.options.lineSpacing)Z=``;else if($.options.lineSpacingMultiple)Z=``;if($.options.indentLevel&&!isNaN(Number($.options.indentLevel))&&$.options.indentLevel>0)U+=` lvl="${$.options.indentLevel}"`;if($.options.paraSpaceBefore&&!isNaN(Number($.options.paraSpaceBefore))&&$.options.paraSpaceBefore>0)G+=``;if($.options.paraSpaceAfter&&!isNaN(Number($.options.paraSpaceAfter))&&$.options.paraSpaceAfter>0)G+=``;if(typeof $.options.bullet==="object"){if((K=(Q=$===null||$===void 0?void 0:$.options)===null||Q===void 0?void 0:Q.bullet)===null||K===void 0?void 0:K.indent)V=Y0($.options.bullet.indent);if($.options.bullet.type){if($.options.bullet.type.toString().toLowerCase()==="number")U+=` marL="${$.options.indentLevel&&$.options.indentLevel>0?V+V*$.options.indentLevel:V}" indent="-${V}"`,J=``}else if($.options.bullet.characterCode){let w=`&#x${$.options.bullet.characterCode};`;if(!/^[0-9A-Fa-f]{4}$/.test($.options.bullet.characterCode))console.warn("Warning: `bullet.characterCode should be a 4-digit unicode charatcer (ex: 22AB)`!"),w=C6.DEFAULT;U+=` marL="${$.options.indentLevel&&$.options.indentLevel>0?V+V*$.options.indentLevel:V}" indent="-${V}"`,J=''}else if($.options.bullet.code){let w=`&#x${$.options.bullet.code};`;if(!/^[0-9A-Fa-f]{4}$/.test($.options.bullet.code))console.warn("Warning: `bullet.code should be a 4-digit hex code (ex: 22AB)`!"),w=C6.DEFAULT;U+=` marL="${$.options.indentLevel&&$.options.indentLevel>0?V+V*$.options.indentLevel:V}" indent="-${V}"`,J=''}else U+=` marL="${$.options.indentLevel&&$.options.indentLevel>0?V+V*$.options.indentLevel:V}" indent="-${V}"`,J=``}else if($.options.bullet)U+=` marL="${$.options.indentLevel&&$.options.indentLevel>0?V+V*$.options.indentLevel:V}" indent="-${V}"`,J=``;else if(!$.options.bullet)U+=' indent="0" marL="0"',J="";if($.options.tabStops&&Array.isArray($.options.tabStops))W=`${$.options.tabStops.map((F)=>``).join("")}`;if(U+=">"+Z+G+J+W,q)U+=MJ($.options,!0);U+=""}return U}function MJ($,q){var Q;let K="",J=q?"a:defRPr":"a:rPr";if(K+="<"+J+' lang="'+($.lang?$.lang:"en-US")+'"'+($.lang?' altLang="en-US"':""),K+=$.fontSize?` sz="${Math.round($.fontSize*100)}"`:"",K+=($===null||$===void 0?void 0:$.bold)?` b="${$.bold?"1":"0"}"`:"",K+=($===null||$===void 0?void 0:$.italic)?` i="${$.italic?"1":"0"}"`:"",K+=($===null||$===void 0?void 0:$.strike)?` strike="${typeof $.strike==="string"?$.strike:"sngStrike"}"`:"",typeof $.underline==="object"&&((Q=$.underline)===null||Q===void 0?void 0:Q.style))K+=` u="${$.underline.style}"`;else if(typeof $.underline==="string")K+=` u="${String($.underline)}"`;else if($.hyperlink)K+=' u="sng"';if($.baseline)K+=` baseline="${Math.round($.baseline*50)}"`;else if($.subscript)K+=' baseline="-40000"';else if($.superscript)K+=' baseline="30000"';if(K+=$.charSpacing?` spc="${Math.round($.charSpacing*100)}" kern="0"`:"",K+=' dirty="0">',$.color||$.fontFace||$.outline||typeof $.underline==="object"&&$.underline.color){if($.outline&&typeof $.outline==="object")K+=`${B2($.outline.color||"FFFFFF")}`;if($.color)K+=B2({color:$.color,transparency:$.transparency});if($.highlight)K+=`${R0($.highlight)}`;if(typeof $.underline==="object"&&$.underline.color)K+=`${B2($.underline.color)}`;if($.glow)K+=`${AB($.glow,CB)}`;if($.fontFace)K+=``}if($.hyperlink){if(typeof $.hyperlink!=="object")throw Error("ERROR: text `hyperlink` option should be an object. Ex: `hyperlink:{url:'https://github.com'}` ");else if(!$.hyperlink.url&&!$.hyperlink.slide)throw Error("ERROR: 'hyperlink requires either `url` or `slide`'");else if($.hyperlink.url)K+=`":"/>"}`;else if($.hyperlink.slide)K+=`":"/>"}`;if($.color)K+=" ",K+=' ',K+=' ',K+=" ",K+=" ",K+=""}return K+=``,K}function bB($){return $.text?`${MJ($.options,!1)}${k0($.text)}`:""}function nB($){let q="";else if($.options.fit==="resize")q+=""}if($.options.shrinkText)q+="";q+=$.options._bodyProp.autoFit?"":"",q+=""}else q+=' wrap="square" rtlCol="0">',q+="";return $._type===D0.tablecell?"":q}function KJ($){let q=$.options||{},Q=[],K=[];if(q&&$._type!==D0.tablecell&&(typeof $.text>"u"||$.text===null))return"";let J=$._type===D0.tablecell?"":"";if(J+=nB($),q.h===0&&q.line&&q.align)J+='';else if($._type==="placeholder")J+=`${qJ($,!0)}`;else J+="";if(typeof $.text==="string"||typeof $.text==="number")Q.push({text:$.text.toString(),options:q||{}});else if($.text&&!Array.isArray($.text)&&typeof $.text==="object"&&Object.keys($.text).includes("text"))Q.push({text:$.text||"",options:$.options||{}});else if(Array.isArray($.text))Q=$.text.map((W)=>({text:W.text,options:W.options}));Q.forEach((W,B)=>{if(!W.text)W.text="";if(W.options=W.options||q||{},B===0&&W.options&&!W.options.bullet&&q.bullet)W.options.bullet=q.bullet;if(typeof W.text==="string"||typeof W.text==="number")W.text=W.text.toString().replace(/\r*\n/g,n0);if(W.text.includes(n0)&&W.text.match(/\n$/g)===null)W.text.split(n0).forEach((V)=>{W.options.breakLine=!0,K.push({text:V,options:W.options})});else K.push(W)});let Z=[],G=[];if(K.forEach((W,B)=>{if(G.length>0&&(W.options.align||q.align)){if(W.options.align!==K[B-1].options.align)Z.push(G),G=[]}else if(G.length>0&&W.options.bullet&&G.length>0)Z.push(G),G=[],W.options.breakLine=!1;if(G.push(W),G.length>0&&W.options.breakLine){if(B+1{var B;let V=!1;J+="";let U=`{if(w.options._lineIdx=F,F>0&&w.options.softBreakBefore)J+="";if(w.options.align=w.options.align||q.align,w.options.lineSpacing=w.options.lineSpacing||q.lineSpacing,w.options.lineSpacingMultiple=w.options.lineSpacingMultiple||q.lineSpacingMultiple,w.options.indentLevel=w.options.indentLevel||q.indentLevel,w.options.paraSpaceBefore=w.options.paraSpaceBefore||q.paraSpaceBefore,w.options.paraSpaceAfter=w.options.paraSpaceAfter||q.paraSpaceAfter,U=qJ(w,!1),J+=U.replace("",""),Object.entries(q).filter(([M])=>!(w.options.hyperlink&&M==="color")).forEach(([M,k])=>{if(M!=="bullet"&&!w.options[M])w.options[M]=k}),J+=bB(w),!w.text&&q.fontSize||w.options.fontSize)V=!0,q.fontSize=q.fontSize||w.options.fontSize}),$._type===D0.tablecell&&(q.fontSize||q.fontFace))if(q.fontFace)J+=`',J+=``,J+=``,J+=``,J+="";else J+=`';else if(V)J+=`';else J+=``;J+=""}),J.indexOf("")===-1)J+="";return J+=$._type===D0.tablecell?"":"",J}function w5($){var q,Q;if(!$)return"";let K=((q=$.options)===null||q===void 0?void 0:q._placeholderIdx)?$.options._placeholderIdx:"",J=((Q=$.options)===null||Q===void 0?void 0:Q._placeholderType)?$.options._placeholderType:"",Z=J&&F8[J]?F8[J].toString():"";return`0?' hasCustomPrompt="1"':""} - />`}function xB($,q,Q){let K=''+n0;return K+='',K+='',K+='',K+='',K+='',K+='',K+='',K+='',K+='',K+='',$.forEach((J)=>{(J._relsMedia||[]).forEach((Z)=>{if(Z.type!=="image"&&Z.type!=="online"&&Z.type!=="chart"&&Z.extn!=="m4v"&&!K.includes(Z.type))K+=''})}),K+='',K+='',K+='',K+='',$.forEach((J,Z)=>{K+=``,K+=``,J._relsChart.forEach((G)=>{K+=``})}),K+='',K+='',K+='',K+='',q.forEach((J,Z)=>{K+=``,(J._relsChart||[]).forEach((G)=>{K+=' '})}),$.forEach((J,Z)=>{K+=``}),Q._relsChart.forEach((J)=>{K+=' '}),Q._relsMedia.forEach((J)=>{if(J.type!=="image"&&J.type!=="online"&&J.type!=="chart"&&J.extn!=="m4v"&&!K.includes(J.type))K+=' '}),K+=' ',K+=' ',K+="",K}function OB(){return`${n0} + />`}function dB($,q,Q){let K=''+n0;return K+='',K+='',K+='',K+='',K+='',K+='',K+='',K+='',K+='',K+='',$.forEach((J)=>{(J._relsMedia||[]).forEach((Z)=>{if(Z.type!=="image"&&Z.type!=="online"&&Z.type!=="chart"&&Z.extn!=="m4v"&&!K.includes(Z.type))K+=''})}),K+='',K+='',K+='',K+='',$.forEach((J,Z)=>{K+=``,K+=``,J._relsChart.forEach((G)=>{K+=``})}),K+='',K+='',K+='',K+='',q.forEach((J,Z)=>{K+=``,(J._relsChart||[]).forEach((G)=>{K+=' '})}),$.forEach((J,Z)=>{K+=``}),Q._relsChart.forEach((J)=>{K+=' '}),Q._relsMedia.forEach((J)=>{if(J.type!=="image"&&J.type!=="online"&&J.type!=="chart"&&J.extn!=="m4v"&&!K.includes(J.type))K+=' '}),K+=' ',K+=' ',K+="",K}function mB(){return`${n0} - `}function PB($,q){return`${n0} + `}function pB($,q){return`${n0} 0 0 Microsoft Office PowerPoint @@ -103,7 +103,7 @@ ${String(w)}`)}if(K&&Z&&U.path.startsWith("http"))return yield new Promise((w,F) false false 16.0000 - `}function TB($,q,Q,K){return` + `}function iB($,q,Q,K){return` ${k0($)} ${k0(q)} @@ -112,13 +112,13 @@ ${String(w)}`)}if(K&&Z&&U.path.startsWith("http"))return yield new Promise((w,F) ${K} ${new Date().toISOString().replace(/\.\d\d\dZ/,"Z")} ${new Date().toISOString().replace(/\.\d\d\dZ/,"Z")} - `}function uB($){let q=1,Q=''+n0;Q+='',Q+='';for(let K=1;K<=$.length;K++)Q+=``;return q++,Q+=``,Q}function SB($){return`${n0}${n7($)}`}function EB($){let q="";return $._slideObjects.forEach((Q)=>{if(Q._type===D0.notes)q+=(Q===null||Q===void 0?void 0:Q.text)&&Q.text[0]?Q.text[0].text:""}),q.replace(/\r*\n/g,n0)}function _B(){return`${n0}7/23/19Click to edit Master text stylesSecond levelThird levelFourth levelFifth level‹#›`}function cB($){return`${n0}${k0(EB($))}${$._slideNum}`}function bB($){return` + `}function oB($){let q=1,Q=''+n0;Q+='',Q+='';for(let K=1;K<=$.length;K++)Q+=``;return q++,Q+=``,Q}function aB($){return`${n0}${n7($)}`}function lB($){let q="";return $._slideObjects.forEach((Q)=>{if(Q._type===D0.notes)q+=(Q===null||Q===void 0?void 0:Q.text)&&Q.text[0]?Q.text[0].text:""}),q.replace(/\r*\n/g,n0)}function rB(){return`${n0}7/23/19Click to edit Master text stylesSecond levelThird levelFourth levelFifth level‹#›`}function sB($){return`${n0}${k0(lB($))}${$._slideNum}`}function tB($){return` ${n7($)} - `}function nB($,q){let Q=q.map((J,Z)=>``),K=''+n0;return K+='',K+=n7($),K+='',K+=""+Q.join("")+"",K+='',K+=' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' ',K+="",K}function dB($,q){return d7(q[$-1],[{target:"../slideMasters/slideMaster1.xml",type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster"}])}function mB($,q,Q){return d7($[Q-1],[{target:`../slideLayouts/slideLayout${aB($,q,Q)}.xml`,type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout"},{target:`../notesSlides/notesSlide${Q}.xml`,type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide"}])}function pB($){return` + `}function eB($,q){let Q=q.map((J,Z)=>``),K=''+n0;return K+='',K+=n7($),K+='',K+=""+Q.join("")+"",K+='',K+=' '+' '+' '+' '+' '+' '+' '+' '+' '+' '+' ',K+="",K}function $z($,q){return d7(q[$-1],[{target:"../slideMasters/slideMaster1.xml",type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster"}])}function Qz($,q,Q){return d7($[Q-1],[{target:`../slideLayouts/slideLayout${Vz($,q,Q)}.xml`,type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout"},{target:`../notesSlides/notesSlide${Q}.xml`,type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide"}])}function qz($){return` - `}function iB($,q){let Q=q.map((K,J)=>({target:`../slideLayouts/slideLayout${J+1}.xml`,type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout"}));return Q.push({target:"../theme/theme1.xml",type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"}),d7($,Q)}function oB(){return`${n0} + `}function Kz($,q){let Q=q.map((K,J)=>({target:`../slideLayouts/slideLayout${J+1}.xml`,type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout"}));return Q.push({target:"../theme/theme1.xml",type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"}),d7($,Q)}function Jz(){return`${n0} - `}function aB($,q,Q){for(let K=0;K`:'',G=((K=$.theme)===null||K===void 0?void 0:K.bodyFontFace)?``:'';return`${Z}${G}`}function rB($){let q=`${n0}`;q+='',q+="",$.slides.forEach((Q)=>q+=``),q+="",q+=``,q+=``,q+=``,q+="";for(let Q=1;Q<10;Q++)q+=``;if(q+="",$.sections&&$.sections.length>0)q+='',q+='',$.sections.forEach((Q)=>{q+=``,Q._slides.forEach((K)=>q+=``),q+=""}),q+="",q+='',q+="";return q+="",q}function sB(){return`${n0}`}function tB(){return`${n0}`}function eB(){return`${n0}`}var $z="4.0.1";class m7{set layout($){let q=this.LAYOUTS[$];if(q)this._layout=$,this._presLayout=q;else throw Error("UNKNOWN-LAYOUT")}get layout(){return this._layout}get version(){return this._version}set author($){this._author=$}get author(){return this._author}set company($){this._company=$}get company(){return this._company}set revision($){this._revision=$}get revision(){return this._revision}set subject($){this._subject=$}get subject(){return this._subject}set theme($){this._theme=$}get theme(){return this._theme}set title($){this._title=$}get title(){return this._title}set rtlMode($){this._rtlMode=$}get rtlMode(){return this._rtlMode}get masterSlide(){return this._masterSlide}get slides(){return this._slides}get sections(){return this._sections}get slideLayouts(){return this._slideLayouts}get AlignH(){return this._alignH}get AlignV(){return this._alignV}get ChartType(){return this._chartType}get OutputType(){return this._outputType}get presLayout(){return this._presLayout}get SchemeColor(){return this._schemeColor}get ShapeType(){return this._shapeType}get charts(){return this._charts}get colors(){return this._colors}get shapes(){return this._shapes}constructor(){this._version=$z,this._alignH=u7,this._alignV=S7,this._chartType=P7,this._outputType=O7,this._schemeColor=G2,this._shapeType=T7,this._charts=q0,this._colors=D5,this._shapes=B1,this.addNewSlide=(J)=>{let Z=this.sections.length>0&&this.sections[this.sections.length-1]._slides.filter((G)=>G._slideNum===this.slides[this.slides.length-1]._slideNum).length>0;return J.sectionTitle=Z?this.sections[this.sections.length-1].title:null,this.addSlide(J)},this.getSlide=(J)=>this.slides.filter((Z)=>Z._slideNum===J)[0],this.setSlideNumber=(J)=>{this.masterSlide._slideNumberProps=J,this.slideLayouts.filter((Z)=>Z._name===h7)[0]._slideNumberProps=J},this.createChartMediaRels=(J,Z,G)=>{J._relsChart.forEach((W)=>G.push(jB(W,Z))),J._relsMedia.forEach((W)=>{if(W.type!=="online"&&W.type!=="hyperlink"){let B=W.data&&typeof W.data==="string"?W.data:"";if(!B.includes(",")&&!B.includes(";"))B="image/png;base64,"+B;else if(!B.includes(","))B="image/png;base64,"+B;else if(!B.includes(";"))B="image/png;"+B;Z.file(W.Target.replace("..","ppt"),B.split(",").pop(),{base64:!0})}})},this.writeFileToBrowser=(J,Z)=>W2(this,void 0,void 0,function*(){let G=document.createElement("a");if(G.setAttribute("style","display:none;"),G.dataset.interception="off",document.body.appendChild(G),window.URL.createObjectURL){let W=window.URL.createObjectURL(new Blob([Z],{type:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}));return G.href=W,G.download=J,G.click(),setTimeout(()=>{window.URL.revokeObjectURL(W),document.body.removeChild(G)},100),yield Promise.resolve(J)}}),this.exportPresentation=(J)=>W2(this,void 0,void 0,function*(){let Z=[],G=[],W=new _7.default;return this.slides.forEach((B)=>{G=G.concat(y7(B))}),this.slideLayouts.forEach((B)=>{G=G.concat(y7(B))}),G=G.concat(y7(this.masterSlide)),yield Promise.all(G).then(()=>W2(this,void 0,void 0,function*(){return this.slides.forEach((B)=>{if(B._slideLayout)CB(B)}),W.folder("_rels"),W.folder("docProps"),W.folder("ppt").folder("_rels"),W.folder("ppt/charts").folder("_rels"),W.folder("ppt/embeddings"),W.folder("ppt/media"),W.folder("ppt/slideLayouts").folder("_rels"),W.folder("ppt/slideMasters").folder("_rels"),W.folder("ppt/slides").folder("_rels"),W.folder("ppt/theme"),W.folder("ppt/notesMasters").folder("_rels"),W.folder("ppt/notesSlides").folder("_rels"),W.file("[Content_Types].xml",xB(this.slides,this.slideLayouts,this.masterSlide)),W.file("_rels/.rels",OB()),W.file("docProps/app.xml",PB(this.slides,this.company)),W.file("docProps/core.xml",TB(this.title,this.subject,this.author,this.revision)),W.file("ppt/_rels/presentation.xml.rels",uB(this.slides)),W.file("ppt/theme/theme1.xml",lB(this)),W.file("ppt/presentation.xml",rB(this)),W.file("ppt/presProps.xml",sB()),W.file("ppt/tableStyles.xml",tB()),W.file("ppt/viewProps.xml",eB()),this.slideLayouts.forEach((B,V)=>{W.file(`ppt/slideLayouts/slideLayout${V+1}.xml`,bB(B)),W.file(`ppt/slideLayouts/_rels/slideLayout${V+1}.xml.rels`,dB(V+1,this.slideLayouts))}),this.slides.forEach((B,V)=>{W.file(`ppt/slides/slide${V+1}.xml`,SB(B)),W.file(`ppt/slides/_rels/slide${V+1}.xml.rels`,mB(this.slides,this.slideLayouts,V+1)),W.file(`ppt/notesSlides/notesSlide${V+1}.xml`,cB(B)),W.file(`ppt/notesSlides/_rels/notesSlide${V+1}.xml.rels`,pB(V+1))}),W.file("ppt/slideMasters/slideMaster1.xml",nB(this.masterSlide,this.slideLayouts)),W.file("ppt/slideMasters/_rels/slideMaster1.xml.rels",iB(this.masterSlide,this.slideLayouts)),W.file("ppt/notesMasters/notesMaster1.xml",_B()),W.file("ppt/notesMasters/_rels/notesMaster1.xml.rels",oB()),this.slideLayouts.forEach((B)=>{this.createChartMediaRels(B,W,Z)}),this.slides.forEach((B)=>{this.createChartMediaRels(B,W,Z)}),this.createChartMediaRels(this.masterSlide,W,Z),yield Promise.all(Z).then(()=>W2(this,void 0,void 0,function*(){if(J.outputType==="STREAM")return yield W.generateAsync({type:"nodebuffer",compression:J.compression?"DEFLATE":"STORE"});else if(J.outputType)return yield W.generateAsync({type:J.outputType});else return yield W.generateAsync({type:"blob",compression:J.compression?"DEFLATE":"STORE"})}))}))});let $={name:"screen4x3",width:9144000,height:6858000},q={name:"screen16x9",width:9144000,height:5143500},Q={name:"screen16x10",width:9144000,height:5715000},K={name:"custom",width:12192000,height:6858000};this.LAYOUTS={LAYOUT_4x3:$,LAYOUT_16x9:q,LAYOUT_16x10:Q,LAYOUT_WIDE:K},this._author="PptxGenJS",this._company="PptxGenJS",this._revision="1",this._subject="PptxGenJS Presentation",this._title="PptxGenJS Presentation",this._presLayout={name:this.LAYOUTS[f6].name,_sizeW:this.LAYOUTS[f6].width,_sizeH:this.LAYOUTS[f6].height,width:this.LAYOUTS[f6].width,height:this.LAYOUTS[f6].height},this._rtlMode=!1,this._slideLayouts=[{_margin:M8,_name:h7,_presLayout:this._presLayout,_rels:[],_relsChart:[],_relsMedia:[],_slide:null,_slideNum:1000,_slideNumberProps:null,_slideObjects:[]}],this._slides=[],this._sections=[],this._masterSlide={addChart:null,addImage:null,addMedia:null,addNotes:null,addShape:null,addTable:null,addText:null,_name:null,_presLayout:this._presLayout,_rId:null,_rels:[],_relsChart:[],_relsMedia:[],_slideId:null,_slideLayout:null,_slideNum:null,_slideNumberProps:null,_slideObjects:[]}}stream($){return W2(this,void 0,void 0,function*(){return yield this.exportPresentation({compression:$===null||$===void 0?void 0:$.compression,outputType:"STREAM"})})}write($){return W2(this,void 0,void 0,function*(){let q=typeof $==="object"&&($===null||$===void 0?void 0:$.outputType)?$.outputType:$?$:null,Q=typeof $==="object"&&($===null||$===void 0?void 0:$.compression)?$.compression:!1;return yield this.exportPresentation({compression:Q,outputType:q})})}writeFile($){return W2(this,void 0,void 0,function*(){var q,Q;let K=typeof process<"u"&&!!((q=process.versions)===null||q===void 0?void 0:q.node)&&((Q=process.release)===null||Q===void 0?void 0:Q.name)==="node";if(typeof $==="string")console.warn("[WARNING] writeFile(string) is deprecated - pass { fileName } instead."),$={fileName:$};let{fileName:J="Presentation.pptx",compression:Z=!1}=$,G=J.toLowerCase().endsWith(".pptx")?J:`${J}.pptx`,W=K?"nodebuffer":null,B=yield this.exportPresentation({compression:Z,outputType:W});if(K){let{promises:V}=yield import("node:fs"),{writeFile:U}=V;return yield U(G,B),G}return yield this.writeFileToBrowser(G,B),G})}addSection($){if(!$)console.warn("addSection requires an argument");else if(!$.title)console.warn("addSection requires a title");let q={_type:"user",_slides:[],title:$.title};if($.order)this.sections.splice($.order,0,q);else this._sections.push(q)}addSlide($){let q=typeof $==="string"?$:($===null||$===void 0?void 0:$.masterName)?$.masterName:"",Q={_name:this.LAYOUTS[f6].name,_presLayout:this.presLayout,_rels:[],_relsChart:[],_relsMedia:[],_slideNum:this.slides.length+1};if(q){let J=this.slideLayouts.filter((Z)=>Z._name===q)[0];if(J)Q=J}let K=new zJ({addSlide:this.addNewSlide,getSlide:this.getSlide,presLayout:this.presLayout,setSlideNum:this.setSlideNumber,slideId:this.slides.length+256,slideRId:this.slides.length+2,slideNumber:this.slides.length+1,slideLayout:Q});if(this._slides.push(K),$===null||$===void 0?void 0:$.sectionTitle){let J=this.sections.filter((Z)=>Z.title===$.sectionTitle)[0];if(!J)console.warn(`addSlide: unable to find section with title: "${$.sectionTitle}"`);else J._slides.push(K)}else if(this.sections&&this.sections.length>0&&!($===null||$===void 0?void 0:$.sectionTitle)){let J=this._sections[this.sections.length-1];if(J._type==="default")J._slides.push(K);else this._sections.push({title:`Default-${this.sections.filter((Z)=>Z._type==="default").length+1}`,_type:"default",_slides:[K]})}return K}defineLayout($){if(!$)console.warn("defineLayout requires `{name, width, height}`");else if(!$.name)console.warn("defineLayout requires `name`");else if(!$.width)console.warn("defineLayout requires `width`");else if(!$.height)console.warn("defineLayout requires `height`");else if(typeof $.height!=="number")console.warn("defineLayout `height` should be a number (inches)");else if(typeof $.width!=="number")console.warn("defineLayout `width` should be a number (inches)");this.LAYOUTS[$.name]={name:$.name,_sizeW:Math.round(Number($.width)*L0),_sizeH:Math.round(Number($.height)*L0),width:Math.round(Number($.width)*L0),height:Math.round(Number($.height)*L0)}}defineSlideMaster($){let q=JSON.parse(JSON.stringify($));if(!q.title)throw Error("defineSlideMaster() object argument requires a `title` value. (https://gitbrent.github.io/PptxGenJS/docs/masters.html)");let Q={_margin:q.margin||M8,_name:q.title,_presLayout:this.presLayout,_rels:[],_relsChart:[],_relsMedia:[],_slide:null,_slideNum:1000+this.slideLayouts.length+1,_slideNumberProps:q.slideNumber||null,_slideObjects:[],background:q.background||null,bkgd:q.bkgd||null};if(vB(q,Q),this.slideLayouts.push(Q),q.background||q.bkgd)BJ(q.background,Q);if(Q._slideNumberProps&&!this.masterSlide._slideNumberProps)this.masterSlide._slideNumberProps=Q._slideNumberProps}tableToSlides($,q={}){LB(this,$,q,(q===null||q===void 0?void 0:q.masterSlideName)?this.slideLayouts.filter((Q)=>Q._name===q.masterSlideName)[0]:null)}}if(typeof globalThis.Buffer>"u")globalThis.Buffer=o;if(typeof globalThis.process>"u")globalThis.process=Qz;globalThis.__bundles=globalThis.__bundles||{};globalThis.__bundles.pptxgenjs=m7;})(); + `}function Vz($,q,Q){for(let K=0;K`:'',G=((K=$.theme)===null||K===void 0?void 0:K.bodyFontFace)?``:'';return`${Z}${G}`}function Zz($){let q=`${n0}`;q+='',q+="",$.slides.forEach((Q)=>q+=``),q+="",q+=``,q+=``,q+=``,q+="";for(let Q=1;Q<10;Q++)q+=``;if(q+="",$.sections&&$.sections.length>0)q+='',q+='',$.sections.forEach((Q)=>{q+=``,Q._slides.forEach((K)=>q+=``),q+=""}),q+="",q+='',q+="";return q+="",q}function Gz(){return`${n0}`}function Wz(){return`${n0}`}function Bz(){return`${n0}`}var zz="4.0.1";class m7{set layout($){let q=this.LAYOUTS[$];if(q)this._layout=$,this._presLayout=q;else throw Error("UNKNOWN-LAYOUT")}get layout(){return this._layout}get version(){return this._version}set author($){this._author=$}get author(){return this._author}set company($){this._company=$}get company(){return this._company}set revision($){this._revision=$}get revision(){return this._revision}set subject($){this._subject=$}get subject(){return this._subject}set theme($){this._theme=$}get theme(){return this._theme}set title($){this._title=$}get title(){return this._title}set rtlMode($){this._rtlMode=$}get rtlMode(){return this._rtlMode}get masterSlide(){return this._masterSlide}get slides(){return this._slides}get sections(){return this._sections}get slideLayouts(){return this._slideLayouts}get AlignH(){return this._alignH}get AlignV(){return this._alignV}get ChartType(){return this._chartType}get OutputType(){return this._outputType}get presLayout(){return this._presLayout}get SchemeColor(){return this._schemeColor}get ShapeType(){return this._shapeType}get charts(){return this._charts}get colors(){return this._colors}get shapes(){return this._shapes}constructor(){this._version=zz,this._alignH=u7,this._alignV=S7,this._chartType=P7,this._outputType=O7,this._schemeColor=G2,this._shapeType=T7,this._charts=q0,this._colors=D5,this._shapes=B1,this.addNewSlide=(J)=>{let Z=this.sections.length>0&&this.sections[this.sections.length-1]._slides.filter((G)=>G._slideNum===this.slides[this.slides.length-1]._slideNum).length>0;return J.sectionTitle=Z?this.sections[this.sections.length-1].title:null,this.addSlide(J)},this.getSlide=(J)=>this.slides.filter((Z)=>Z._slideNum===J)[0],this.setSlideNumber=(J)=>{this.masterSlide._slideNumberProps=J,this.slideLayouts.filter((Z)=>Z._name===h7)[0]._slideNumberProps=J},this.createChartMediaRels=(J,Z,G)=>{J._relsChart.forEach((W)=>G.push(SB(W,Z))),J._relsMedia.forEach((W)=>{if(W.type!=="online"&&W.type!=="hyperlink"){let B=W.data&&typeof W.data==="string"?W.data:"";if(!B.includes(",")&&!B.includes(";"))B="image/png;base64,"+B;else if(!B.includes(","))B="image/png;base64,"+B;else if(!B.includes(";"))B="image/png;"+B;Z.file(W.Target.replace("..","ppt"),B.split(",").pop(),{base64:!0})}})},this.writeFileToBrowser=(J,Z)=>W2(this,void 0,void 0,function*(){let G=document.createElement("a");if(G.setAttribute("style","display:none;"),G.dataset.interception="off",document.body.appendChild(G),window.URL.createObjectURL){let W=window.URL.createObjectURL(new Blob([Z],{type:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}));return G.href=W,G.download=J,G.click(),setTimeout(()=>{window.URL.revokeObjectURL(W),document.body.removeChild(G)},100),yield Promise.resolve(J)}}),this.exportPresentation=(J)=>W2(this,void 0,void 0,function*(){let Z=[],G=[],W=new _7.default;return this.slides.forEach((B)=>{G=G.concat(y7(B))}),this.slideLayouts.forEach((B)=>{G=G.concat(y7(B))}),G=G.concat(y7(this.masterSlide)),yield Promise.all(G).then(()=>W2(this,void 0,void 0,function*(){return this.slides.forEach((B)=>{if(B._slideLayout)uB(B)}),W.folder("_rels"),W.folder("docProps"),W.folder("ppt").folder("_rels"),W.folder("ppt/charts").folder("_rels"),W.folder("ppt/embeddings"),W.folder("ppt/media"),W.folder("ppt/slideLayouts").folder("_rels"),W.folder("ppt/slideMasters").folder("_rels"),W.folder("ppt/slides").folder("_rels"),W.folder("ppt/theme"),W.folder("ppt/notesMasters").folder("_rels"),W.folder("ppt/notesSlides").folder("_rels"),W.file("[Content_Types].xml",dB(this.slides,this.slideLayouts,this.masterSlide)),W.file("_rels/.rels",mB()),W.file("docProps/app.xml",pB(this.slides,this.company)),W.file("docProps/core.xml",iB(this.title,this.subject,this.author,this.revision)),W.file("ppt/_rels/presentation.xml.rels",oB(this.slides)),W.file("ppt/theme/theme1.xml",Uz(this)),W.file("ppt/presentation.xml",Zz(this)),W.file("ppt/presProps.xml",Gz()),W.file("ppt/tableStyles.xml",Wz()),W.file("ppt/viewProps.xml",Bz()),this.slideLayouts.forEach((B,V)=>{W.file(`ppt/slideLayouts/slideLayout${V+1}.xml`,tB(B)),W.file(`ppt/slideLayouts/_rels/slideLayout${V+1}.xml.rels`,$z(V+1,this.slideLayouts))}),this.slides.forEach((B,V)=>{W.file(`ppt/slides/slide${V+1}.xml`,aB(B)),W.file(`ppt/slides/_rels/slide${V+1}.xml.rels`,Qz(this.slides,this.slideLayouts,V+1)),W.file(`ppt/notesSlides/notesSlide${V+1}.xml`,sB(B)),W.file(`ppt/notesSlides/_rels/notesSlide${V+1}.xml.rels`,qz(V+1))}),W.file("ppt/slideMasters/slideMaster1.xml",eB(this.masterSlide,this.slideLayouts)),W.file("ppt/slideMasters/_rels/slideMaster1.xml.rels",Kz(this.masterSlide,this.slideLayouts)),W.file("ppt/notesMasters/notesMaster1.xml",rB()),W.file("ppt/notesMasters/_rels/notesMaster1.xml.rels",Jz()),this.slideLayouts.forEach((B)=>{this.createChartMediaRels(B,W,Z)}),this.slides.forEach((B)=>{this.createChartMediaRels(B,W,Z)}),this.createChartMediaRels(this.masterSlide,W,Z),yield Promise.all(Z).then(()=>W2(this,void 0,void 0,function*(){if(J.outputType==="STREAM")return yield W.generateAsync({type:"nodebuffer",compression:J.compression?"DEFLATE":"STORE"});else if(J.outputType)return yield W.generateAsync({type:J.outputType});else return yield W.generateAsync({type:"blob",compression:J.compression?"DEFLATE":"STORE"})}))}))});let $={name:"screen4x3",width:9144000,height:6858000},q={name:"screen16x9",width:9144000,height:5143500},Q={name:"screen16x10",width:9144000,height:5715000},K={name:"custom",width:12192000,height:6858000};this.LAYOUTS={LAYOUT_4x3:$,LAYOUT_16x9:q,LAYOUT_16x10:Q,LAYOUT_WIDE:K},this._author="PptxGenJS",this._company="PptxGenJS",this._revision="1",this._subject="PptxGenJS Presentation",this._title="PptxGenJS Presentation",this._presLayout={name:this.LAYOUTS[f6].name,_sizeW:this.LAYOUTS[f6].width,_sizeH:this.LAYOUTS[f6].height,width:this.LAYOUTS[f6].width,height:this.LAYOUTS[f6].height},this._rtlMode=!1,this._slideLayouts=[{_margin:M8,_name:h7,_presLayout:this._presLayout,_rels:[],_relsChart:[],_relsMedia:[],_slide:null,_slideNum:1000,_slideNumberProps:null,_slideObjects:[]}],this._slides=[],this._sections=[],this._masterSlide={addChart:null,addImage:null,addMedia:null,addNotes:null,addShape:null,addTable:null,addText:null,_name:null,_presLayout:this._presLayout,_rId:null,_rels:[],_relsChart:[],_relsMedia:[],_slideId:null,_slideLayout:null,_slideNum:null,_slideNumberProps:null,_slideObjects:[]}}stream($){return W2(this,void 0,void 0,function*(){return yield this.exportPresentation({compression:$===null||$===void 0?void 0:$.compression,outputType:"STREAM"})})}write($){return W2(this,void 0,void 0,function*(){let q=typeof $==="object"&&($===null||$===void 0?void 0:$.outputType)?$.outputType:$?$:null,Q=typeof $==="object"&&($===null||$===void 0?void 0:$.compression)?$.compression:!1;return yield this.exportPresentation({compression:Q,outputType:q})})}writeFile($){return W2(this,void 0,void 0,function*(){var q,Q;let K=typeof process<"u"&&!!((q=process.versions)===null||q===void 0?void 0:q.node)&&((Q=process.release)===null||Q===void 0?void 0:Q.name)==="node";if(typeof $==="string")console.warn("[WARNING] writeFile(string) is deprecated - pass { fileName } instead."),$={fileName:$};let{fileName:J="Presentation.pptx",compression:Z=!1}=$,G=J.toLowerCase().endsWith(".pptx")?J:`${J}.pptx`,W=K?"nodebuffer":null,B=yield this.exportPresentation({compression:Z,outputType:W});if(K){let{promises:V}=yield import("node:fs"),{writeFile:U}=V;return yield U(G,B),G}return yield this.writeFileToBrowser(G,B),G})}addSection($){if(!$)console.warn("addSection requires an argument");else if(!$.title)console.warn("addSection requires a title");let q={_type:"user",_slides:[],title:$.title};if($.order)this.sections.splice($.order,0,q);else this._sections.push(q)}addSlide($){let q=typeof $==="string"?$:($===null||$===void 0?void 0:$.masterName)?$.masterName:"",Q={_name:this.LAYOUTS[f6].name,_presLayout:this.presLayout,_rels:[],_relsChart:[],_relsMedia:[],_slideNum:this.slides.length+1};if(q){let J=this.slideLayouts.filter((Z)=>Z._name===q)[0];if(J)Q=J}let K=new FJ({addSlide:this.addNewSlide,getSlide:this.getSlide,presLayout:this.presLayout,setSlideNum:this.setSlideNumber,slideId:this.slides.length+256,slideRId:this.slides.length+2,slideNumber:this.slides.length+1,slideLayout:Q});if(this._slides.push(K),$===null||$===void 0?void 0:$.sectionTitle){let J=this.sections.filter((Z)=>Z.title===$.sectionTitle)[0];if(!J)console.warn(`addSlide: unable to find section with title: "${$.sectionTitle}"`);else J._slides.push(K)}else if(this.sections&&this.sections.length>0&&!($===null||$===void 0?void 0:$.sectionTitle)){let J=this._sections[this.sections.length-1];if(J._type==="default")J._slides.push(K);else this._sections.push({title:`Default-${this.sections.filter((Z)=>Z._type==="default").length+1}`,_type:"default",_slides:[K]})}return K}defineLayout($){if(!$)console.warn("defineLayout requires `{name, width, height}`");else if(!$.name)console.warn("defineLayout requires `name`");else if(!$.width)console.warn("defineLayout requires `width`");else if(!$.height)console.warn("defineLayout requires `height`");else if(typeof $.height!=="number")console.warn("defineLayout `height` should be a number (inches)");else if(typeof $.width!=="number")console.warn("defineLayout `width` should be a number (inches)");this.LAYOUTS[$.name]={name:$.name,_sizeW:Math.round(Number($.width)*L0),_sizeH:Math.round(Number($.height)*L0),width:Math.round(Number($.width)*L0),height:Math.round(Number($.height)*L0)}}defineSlideMaster($){let q=JSON.parse(JSON.stringify($));if(!q.title)throw Error("defineSlideMaster() object argument requires a `title` value. (https://gitbrent.github.io/PptxGenJS/docs/masters.html)");let Q={_margin:q.margin||M8,_name:q.title,_presLayout:this.presLayout,_rels:[],_relsChart:[],_relsMedia:[],_slide:null,_slideNum:1000+this.slideLayouts.length+1,_slideNumberProps:q.slideNumber||null,_slideObjects:[],background:q.background||null,bkgd:q.bkgd||null};if(xB(q,Q),this.slideLayouts.push(Q),q.background||q.bkgd)zJ(q.background,Q);if(Q._slideNumberProps&&!this.masterSlide._slideNumberProps)this.masterSlide._slideNumberProps=Q._slideNumberProps}tableToSlides($,q={}){yB(this,$,q,(q===null||q===void 0?void 0:q.masterSlideName)?this.slideLayouts.filter((Q)=>Q._name===q.masterSlideName)[0]:null)}}if(typeof globalThis.Buffer>"u")globalThis.Buffer=o;if(typeof globalThis.process>"u")globalThis.process=Fz;globalThis.__bundles=globalThis.__bundles||{};globalThis.__bundles.pptxgenjs=m7;})(); diff --git a/apps/sim/lib/file-parsers/xlsx-parser.ts b/apps/sim/lib/file-parsers/xlsx-parser.ts index 40624f459b7..394119a3f08 100644 --- a/apps/sim/lib/file-parsers/xlsx-parser.ts +++ b/apps/sim/lib/file-parsers/xlsx-parser.ts @@ -1,6 +1,7 @@ import { existsSync } from 'fs' import { readFile } from 'fs/promises' import { createLogger } from '@sim/logger' +import { truncate } from '@sim/utils/string' import * as XLSX from 'xlsx' import type { FileParseResult, FileParser } from '@/lib/file-parsers/types' import { sanitizeTextForUTF8 } from '@/lib/file-parsers/utils' @@ -199,9 +200,7 @@ export class XlsxParser implements FileParser { let cellStr = String(cell) // Truncate very long cells - if (cellStr.length > CONFIG.MAX_CELL_LENGTH) { - cellStr = `${cellStr.substring(0, CONFIG.MAX_CELL_LENGTH)}...` - } + cellStr = truncate(cellStr, CONFIG.MAX_CELL_LENGTH) return sanitizeTextForUTF8(cellStr) } diff --git a/apps/sim/lib/knowledge/connectors/sync-engine.test.ts b/apps/sim/lib/knowledge/connectors/sync-engine.test.ts index 56baf974ef9..9cf0bcd3dc0 100644 --- a/apps/sim/lib/knowledge/connectors/sync-engine.test.ts +++ b/apps/sim/lib/knowledge/connectors/sync-engine.test.ts @@ -2,6 +2,7 @@ * @vitest-environment node */ import { authOAuthUtilsMock, urlsMock } from '@sim/testing' +import { generateShortId } from '@sim/utils/id' import { beforeEach, describe, expect, it, vi } from 'vitest' vi.mock('@sim/db', () => ({ db: {} })) @@ -233,7 +234,7 @@ describe('chunkOpsByByteBudget', () => { const addOp = (sizeBytes?: number) => ({ type: 'add' as const, extDoc: { - externalId: `e-${Math.random()}`, + externalId: `e-${generateShortId()}`, title: 'f', content: 'x', contentHash: 'h', @@ -244,7 +245,7 @@ describe('chunkOpsByByteBudget', () => { const skipOp = (sizeBytes: number) => ({ type: 'skip' as const, extDoc: { - externalId: `s-${Math.random()}`, + externalId: `s-${generateShortId()}`, title: 'f', content: '', contentHash: 'h', diff --git a/apps/sim/lib/knowledge/connectors/sync-engine.ts b/apps/sim/lib/knowledge/connectors/sync-engine.ts index cbd18b4333a..5c4710c67a3 100644 --- a/apps/sim/lib/knowledge/connectors/sync-engine.ts +++ b/apps/sim/lib/knowledge/connectors/sync-engine.ts @@ -7,7 +7,7 @@ import { knowledgeConnectorSyncLog, } from '@sim/db/schema' import { createLogger } from '@sim/logger' -import { toError } from '@sim/utils/errors' +import { getErrorMessage, toError } from '@sim/utils/errors' import { generateId } from '@sim/utils/id' import { randomInt } from '@sim/utils/random' import { and, eq, gt, inArray, isNotNull, isNull, lt, ne, or, sql } from 'drizzle-orm' @@ -733,8 +733,7 @@ export async function executeSync( result.docsFailed++ logger.error('Failed to hydrate deferred document', { connectorId, - error: - outcome.reason instanceof Error ? outcome.reason.message : String(outcome.reason), + error: getErrorMessage(outcome.reason), }) } } @@ -799,8 +798,7 @@ export async function executeSync( logger.error('Failed to process document', { connectorId, externalId: batch[j].extDoc.externalId, - error: - outcome.reason instanceof Error ? outcome.reason.message : String(outcome.reason), + error: getErrorMessage(outcome.reason), }) } } diff --git a/apps/sim/lib/library/registry.ts b/apps/sim/lib/library/registry.ts new file mode 100644 index 00000000000..6d642dc88ab --- /dev/null +++ b/apps/sim/lib/library/registry.ts @@ -0,0 +1,17 @@ +import path from 'path' +import { createContentRegistry } from '@/lib/content/registry-factory' + +const LIBRARY_DIR = path.join(process.cwd(), 'content', 'library') +const AUTHORS_DIR = path.join(process.cwd(), 'content', 'authors') + +const libraryRegistry = createContentRegistry({ + contentDir: LIBRARY_DIR, + authorsDir: AUTHORS_DIR, +}) + +export const getAllPostMeta = libraryRegistry.getAllPostMeta +export const getPostBySlug = libraryRegistry.getPostBySlug +export const getAllTags = libraryRegistry.getAllTags +export const getRelatedPosts = libraryRegistry.getRelatedPosts +export const getNavLibraryPosts = libraryRegistry.getNavPosts +export const invalidateLibraryCaches = libraryRegistry.invalidateCaches diff --git a/apps/sim/lib/library/seo.ts b/apps/sim/lib/library/seo.ts new file mode 100644 index 00000000000..4932bc62441 --- /dev/null +++ b/apps/sim/lib/library/seo.ts @@ -0,0 +1,51 @@ +import type { Author, ContentMeta } from '@/lib/content/schema' +import type { ContentSection } from '@/lib/content/seo' +import { + buildArticleJsonLd, + buildAuthorGraphJsonLd as buildAuthorGraphJsonLdGeneric, + buildAuthorMetadata as buildAuthorMetadataGeneric, + buildCollectionPageJsonLd as buildCollectionPageJsonLdGeneric, + buildFaqJsonLd, + buildIndexMetadata as buildIndexMetadataGeneric, + buildPostGraphJsonLd as buildPostGraphJsonLdGeneric, + buildPostMetadata, + buildTagsBreadcrumbJsonLd as buildTagsBreadcrumbJsonLdGeneric, + buildTagsMetadata as buildTagsMetadataGeneric, +} from '@/lib/content/seo' + +export const LIBRARY_SECTION: ContentSection = { + name: 'Library', + basePath: '/library', + description: + 'Comparisons, how-tos, and roundups for teams evaluating and building AI agents with Sim.', +} + +export { buildArticleJsonLd, buildFaqJsonLd, buildPostMetadata } + +export function buildPostGraphJsonLd(post: ContentMeta) { + return buildPostGraphJsonLdGeneric(post, LIBRARY_SECTION) +} + +export function buildCollectionPageJsonLd() { + return buildCollectionPageJsonLdGeneric(LIBRARY_SECTION) +} + +export function buildIndexMetadata(input: { tag?: string; pageNum: number }) { + return buildIndexMetadataGeneric(LIBRARY_SECTION, input) +} + +export function buildTagsMetadata() { + return buildTagsMetadataGeneric(LIBRARY_SECTION) +} + +export function buildTagsBreadcrumbJsonLd() { + return buildTagsBreadcrumbJsonLdGeneric(LIBRARY_SECTION) +} + +export function buildAuthorMetadata(id: string, author?: Author) { + return buildAuthorMetadataGeneric(LIBRARY_SECTION, id, author) +} + +export function buildAuthorGraphJsonLd(author: Author) { + return buildAuthorGraphJsonLdGeneric(LIBRARY_SECTION, author) +} diff --git a/apps/sim/lib/logs/execution/progress-markers.ts b/apps/sim/lib/logs/execution/progress-markers.ts index 352196cebca..a23e4ec747f 100644 --- a/apps/sim/lib/logs/execution/progress-markers.ts +++ b/apps/sim/lib/logs/execution/progress-markers.ts @@ -1,5 +1,6 @@ import { createLogger } from '@sim/logger' import { toError } from '@sim/utils/errors' +import { isRecordLike as isRecord } from '@sim/utils/object' import { getRedisClient } from '@/lib/core/config/redis' import { getExecutionReservationTtlMs } from '@/lib/core/execution-limits' import type { ExecutionLastCompletedBlock, ExecutionLastStartedBlock } from '@/lib/logs/types' @@ -157,10 +158,6 @@ function safeJsonParse(raw: string | undefined): unknown { } } -function isRecord(value: unknown): value is Record { - return typeof value === 'object' && value !== null && !Array.isArray(value) -} - /** * Parse a stored last-started marker, rebuilding it from validated fields so a * stale or wrong-shaped Redis value can never reach API consumers. diff --git a/apps/sim/lib/messaging/sms/service.ts b/apps/sim/lib/messaging/sms/service.ts index e8ef363d43e..831c8e8fdea 100644 --- a/apps/sim/lib/messaging/sms/service.ts +++ b/apps/sim/lib/messaging/sms/service.ts @@ -1,5 +1,6 @@ import { createLogger } from '@sim/logger' import { getErrorMessage } from '@sim/utils/errors' +import { truncate } from '@sim/utils/string' import { Twilio } from 'twilio' import { env } from '@/lib/core/config/env' @@ -66,7 +67,7 @@ export async function sendSMS(options: SMSOptions): Promise { if (!twilioClient) { logger.error('SMS sending failed: Twilio not configured', { to, - body: `${body.substring(0, 50)}...`, + body: truncate(body, 50), from: fromNumber, }) return { diff --git a/apps/sim/lib/monitoring/metrics.ts b/apps/sim/lib/monitoring/metrics.ts index 486ba57175e..c4fd6d47d1b 100644 --- a/apps/sim/lib/monitoring/metrics.ts +++ b/apps/sim/lib/monitoring/metrics.ts @@ -29,6 +29,7 @@ import { StandardUnit, } from '@aws-sdk/client-cloudwatch' import { createLogger } from '@sim/logger' +import { getErrorMessage } from '@sim/utils/errors' const logger = createLogger('HostedKeyMetrics') @@ -133,7 +134,7 @@ export async function flushHostedKeyMetrics(): Promise { // Telemetry must never break the request path — log and drop the batch. logger.warn('PutMetricData failed; dropping batch', { count: MetricData.length, - error: err instanceof Error ? err.message : String(err), + error: getErrorMessage(err), }) } } diff --git a/apps/sim/lib/table/__tests__/update-row.test.ts b/apps/sim/lib/table/__tests__/update-row.test.ts index b1135cd8d1b..bc5209d40f1 100644 --- a/apps/sim/lib/table/__tests__/update-row.test.ts +++ b/apps/sim/lib/table/__tests__/update-row.test.ts @@ -26,12 +26,6 @@ vi.mock('@/lib/table/billing', () => ({ TableRowLimitError: class TableRowLimitError extends Error {}, })) -// These suites assert flag-off position-shift semantics; pin the flag so they're -// deterministic regardless of a local TABLES_FRACTIONAL_ORDERING env value. -vi.mock('@/lib/core/config/feature-flags', () => ({ - isFeatureEnabled: vi.fn().mockResolvedValue(false), -})) - vi.mock('@/lib/table/validation', () => ({ validateRowSize: vi.fn(() => ({ valid: true, errors: [] })), validateRowAgainstSchema: vi.fn(() => ({ valid: true, errors: [] })), @@ -187,29 +181,17 @@ describe('insertRow — position race safety (migration 0198 + advisory lock)', expect(findExecutedSqlContaining('hashtextextended')).toBe(true) }) - it('explicit-position inserts also acquire the advisory lock to serialize position shifts', async () => { - dbChainMockFns.limit.mockResolvedValueOnce([]) - dbChainMockFns.returning.mockResolvedValueOnce([ - { - id: 'row-1', - tableId: 'tbl-1', - workspaceId: 'ws-1', - data: { name: 'a' }, - position: 5, - createdAt: new Date(), - updatedAt: new Date(), - }, - ]) - - await insertRow( - { tableId: 'tbl-1', data: { name: 'a' }, workspaceId: 'ws-1', position: 5 }, - TABLE, - 'req-1' - ) + it('explicit-position inserts also acquire the advisory lock to serialize order-key minting', async () => { + await expect( + insertRow( + { tableId: 'tbl-1', data: { name: 'a' }, workspaceId: 'ws-1', position: 5 }, + TABLE, + 'req-1' + ) + ).rejects.toBeDefined() - // `(table_id, position)` index is non-unique, so concurrent explicit-position - // inserts at the same slot could both skip the shift and duplicate — lock - // serializes them. + // A position-based insert resolves its order_key from the neighbor at that + // rank; the lock serializes concurrent minting at the same slot. expect(findExecutedSqlContaining('pg_advisory_xact_lock')).toBe(true) }) @@ -225,42 +207,6 @@ describe('insertRow — position race safety (migration 0198 + advisory lock)', expect(findExecutedSqlContaining('pg_advisory_xact_lock')).toBe(true) }) - it('batchInsertRows with explicit positions acquires the advisory lock', async () => { - dbChainMockFns.returning.mockResolvedValueOnce([ - { - id: 'row-1', - tableId: 'tbl-1', - workspaceId: 'ws-1', - data: { name: 'a' }, - position: 3, - createdAt: new Date(), - updatedAt: new Date(), - }, - { - id: 'row-2', - tableId: 'tbl-1', - workspaceId: 'ws-1', - data: { name: 'b' }, - position: 4, - createdAt: new Date(), - updatedAt: new Date(), - }, - ]) - - await batchInsertRows( - { - tableId: 'tbl-1', - rows: [{ name: 'a' }, { name: 'b' }], - workspaceId: 'ws-1', - positions: [3, 4], - }, - TABLE, - 'req-1' - ) - - expect(findExecutedSqlContaining('pg_advisory_xact_lock')).toBe(true) - }) - it('upsertRow skips the advisory lock on the update path (match found)', async () => { vi.mocked(getUniqueColumns).mockReturnValue([{ name: 'name', type: 'string', unique: true }]) dbChainMockFns.limit.mockResolvedValueOnce([ diff --git a/apps/sim/lib/table/rows/ordering.ts b/apps/sim/lib/table/rows/ordering.ts index 7646f8c0a1d..368c9959d9e 100644 --- a/apps/sim/lib/table/rows/ordering.ts +++ b/apps/sim/lib/table/rows/ordering.ts @@ -8,8 +8,7 @@ import { db } from '@sim/db' import { userTableRows } from '@sim/db/schema' -import { and, asc, desc, eq, gt, gte, inArray, lt, lte, type SQL, sql } from 'drizzle-orm' -import { isFeatureEnabled } from '@/lib/core/config/feature-flags' +import { and, asc, desc, eq, gt, inArray, lt, lte, type SQL, sql } from 'drizzle-orm' import type { DbOrTx } from '@/lib/db/types' import { TABLE_LIMITS } from '@/lib/table/constants' import { keyBetween, nKeysBetween } from '@/lib/table/order-key' @@ -75,116 +74,15 @@ export async function maxOrderKey(executor: DbOrTx, tableId: string): Promise { - await acquireRowOrderLock(trx, tableId) - if (requestedPosition === undefined) { - return nextRowPosition(trx, tableId) - } - const [existing] = await trx - .select({ id: userTableRows.id }) - .from(userTableRows) - .where(and(eq(userTableRows.tableId, tableId), eq(userTableRows.position, requestedPosition))) - .limit(1) - if (existing) { - await shiftRowsUpFrom(trx, tableId, requestedPosition) - } - return requestedPosition -} - -/** - * Reserves positions for a batch of `count` rows. Opens each requested slot - * (ascending, preserving prior gaps) and returns the requested positions in - * original order; otherwise returns a contiguous append range. - */ -export async function reserveBatchPositions( - trx: DbTransaction, - tableId: string, - count: number, - requestedPositions?: number[] -): Promise { - await acquireRowOrderLock(trx, tableId) - if (requestedPositions && requestedPositions.length > 0) { - for (const pos of [...requestedPositions].sort((a, b) => a - b)) { - await shiftRowsUpFrom(trx, tableId, pos) - } - return requestedPositions - } - const start = await nextRowPosition(trx, tableId) - return Array.from({ length: count }, (_, i) => start + i) -} - -/** - * Recompacts row positions to be contiguous after a bulk delete. With - * `minDeletedPos`, only rows at/after it are re-numbered; single-row deletes use - * the cheaper {@link shiftRowsDownAfter}. - */ -export async function compactPositions( - trx: DbTransaction, - tableId: string, - minDeletedPos?: number -) { - if (minDeletedPos === undefined) { - await trx.execute(sql` - UPDATE user_table_rows t - SET position = r.new_pos - FROM ( - SELECT id, ROW_NUMBER() OVER (ORDER BY position) - 1 AS new_pos - FROM user_table_rows - WHERE table_id = ${tableId} - ) r - WHERE t.id = r.id AND t.table_id = ${tableId} AND t.position != r.new_pos - `) - return - } - await trx.execute(sql` - UPDATE user_table_rows t - SET position = r.new_pos - FROM ( - SELECT id, ${minDeletedPos}::int + ROW_NUMBER() OVER (ORDER BY position) - 1 AS new_pos - FROM user_table_rows - WHERE table_id = ${tableId} AND position >= ${minDeletedPos} - ) r - WHERE t.id = r.id AND t.table_id = ${tableId} AND t.position != r.new_pos - `) -} - /** * Computes the fractional `order_key` for a row inserted at the integer * `requestedPosition` (or appended when omitted). Used by position-based callers * (mothership tool, v1 API, undo position-fallback, transient old clients). * - * The neighbor at slot `s` is resolved differently per flag state: - * - **off**: `WHERE position = s` (positions are contiguous, so the row at - * position `s` is the `s`-th row — an indexed O(1) lookup). - * - **on**: the `s`-th row in `order_key, id` order (`OFFSET s`) — positions are - * gappy and non-authoritative, so `position = s` would miss; the visual - * ordinal is the key's ordinal. O(s), acceptable for these low-volume callers. + * The neighbor at slot `s` is the `s`-th row in `order_key, id` order (`OFFSET + * s`) — positions are gappy and non-authoritative, so `position = s` would miss; + * the visual ordinal is the key's ordinal. O(s), acceptable for these low-volume + * callers. * * Caller holds the row-order lock. */ @@ -193,24 +91,15 @@ export async function resolveInsertOrderKey( tableId: string, requestedPosition?: number ): Promise { - const fractionalOrdering = await isFeatureEnabled('tables-fractional-ordering') const orderKeyAtSlot = async (slot: number): Promise => { if (slot < 0) return null - if (fractionalOrdering) { - const [r] = await trx - .select({ orderKey: userTableRows.orderKey }) - .from(userTableRows) - .where(eq(userTableRows.tableId, tableId)) - .orderBy(asc(userTableRows.orderKey), asc(userTableRows.id)) - .limit(1) - .offset(slot) - return r?.orderKey ?? null - } const [r] = await trx .select({ orderKey: userTableRows.orderKey }) .from(userTableRows) - .where(and(eq(userTableRows.tableId, tableId), eq(userTableRows.position, slot))) + .where(eq(userTableRows.tableId, tableId)) + .orderBy(asc(userTableRows.orderKey), asc(userTableRows.id)) .limit(1) + .offset(slot) return r?.orderKey ?? null } if (requestedPosition === undefined) { @@ -225,19 +114,17 @@ export async function resolveInsertOrderKey( * Resolves the `order_key` for an insert expressed by an anchor row id — * `afterRowId` (place directly after) or `beforeRowId` (directly before). Finds * the anchor and its adjacent key via the `(table_id, order_key, id)` index - * (O(1)) and mints a key between them. Also returns a legacy integer `position` - * (anchor's position ±) so the flag-off shift path still works. Caller holds the - * row-order lock. + * (O(1)) and mints a key between them. Caller holds the row-order lock. */ export async function resolveInsertByNeighbor( trx: DbTransaction, tableId: string, afterRowId?: string, beforeRowId?: string -): Promise<{ orderKey: string; position: number }> { +): Promise { const anchorId = afterRowId ?? beforeRowId! const [anchor] = await trx - .select({ orderKey: userTableRows.orderKey, position: userTableRows.position }) + .select({ orderKey: userTableRows.orderKey }) .from(userTableRows) .where(and(eq(userTableRows.tableId, tableId), eq(userTableRows.id, anchorId))) .limit(1) @@ -245,12 +132,10 @@ export async function resolveInsertByNeighbor( // stale view) is an error, not a silent insert at the front. if (!anchor) throw new Error(`Row not found: ${anchorId}`) const anchorKey = anchor.orderKey ?? null - // A null key on the anchor means the table isn't backfilled. With the flag on - // (key is authoritative) the adjacent-key lookup below can't work — fail - // loudly rather than mint a wrong key. Flag off keeps `position` authoritative, - // so a best-effort key here is fine (the backfill re-keys before the flip). - const fractionalOrdering = await isFeatureEnabled('tables-fractional-ordering') - if (anchorKey === null && fractionalOrdering) { + // A null key on the anchor means the table isn't backfilled. order_key is + // authoritative, so the adjacent-key lookup below can't work — fail loudly + // rather than mint a wrong key. + if (anchorKey === null) { throw new Error(`Row ${anchorId} has no order_key yet (table not backfilled)`) } @@ -259,82 +144,45 @@ export async function resolveInsertByNeighbor( // (not the `(order_key, id)` row tuple) skips past any sibling that shares the // anchor's key, so `keyBetween` always gets strictly-ordered bounds and can't // throw on a stray duplicate. Identical to the row tuple when keys are distinct. - // A null anchorKey (flag off, un-backfilled) has no key to compare — leave the - // upper bound open, matching the prior best-effort behavior. - let nextKey: string | null = null - if (anchorKey !== null) { - const [next] = await trx - .select({ orderKey: userTableRows.orderKey }) - .from(userTableRows) - .where(and(eq(userTableRows.tableId, tableId), gt(userTableRows.orderKey, anchorKey))) - .orderBy(asc(userTableRows.orderKey)) - .limit(1) - nextKey = next?.orderKey ?? null - } - return { - orderKey: keyBetween(anchorKey, nextKey), - position: anchor.position + 1, - } - } - - // beforeRowId: lo = the largest key strictly LESS than the anchor key (distinct, - // same rationale as the afterRowId branch above). - let prevKey: string | null = null - if (anchorKey !== null) { - const [prev] = await trx + const [next] = await trx .select({ orderKey: userTableRows.orderKey }) .from(userTableRows) - .where(and(eq(userTableRows.tableId, tableId), lt(userTableRows.orderKey, anchorKey))) - .orderBy(desc(userTableRows.orderKey)) + .where(and(eq(userTableRows.tableId, tableId), gt(userTableRows.orderKey, anchorKey))) + .orderBy(asc(userTableRows.orderKey)) .limit(1) - prevKey = prev?.orderKey ?? null - } - return { - orderKey: keyBetween(prevKey, anchorKey), - position: anchor.position, + return keyBetween(anchorKey, next?.orderKey ?? null) } + + // beforeRowId: lo = the largest key strictly LESS than the anchor key (distinct, + // same rationale as the afterRowId branch above). + const [prev] = await trx + .select({ orderKey: userTableRows.orderKey }) + .from(userTableRows) + .where(and(eq(userTableRows.tableId, tableId), lt(userTableRows.orderKey, anchorKey))) + .orderBy(desc(userTableRows.orderKey)) + .limit(1) + return keyBetween(prev?.orderKey ?? null, anchorKey) } /** - * Computes fractional `order_key`s for a batch insert. With no `positions`, - * appends a contiguous run after the current max key. With explicit `positions` - * (undo restore), keys each row between its pre-shift position neighbors — - * correct because requested positions are distinct. Caller holds the lock. - * - * The explicit-`positions` path is meaningful only when `position` is - * authoritative (flag off): with the flag on, a saved `position` is a gappy - * column value, not a visual rank, so feeding it to {@link resolveInsertOrderKey} - * (which reads `position` as an `OFFSET` rank under the flag) would mint keys at - * the wrong ranks. Callers needing exact placement under the flag pass - * `orderKeys` (handled before this function); here we just append a run. + * Computes fractional `order_key`s for a batch insert by appending a contiguous + * run after the current max key. `order_key` is authoritative, so callers needing + * exact placement pass explicit `orderKeys` (handled before this function); here + * we just append a run. Caller holds the lock. */ export async function resolveBatchInsertOrderKeys( trx: DbTransaction, tableId: string, - count: number, - positions?: number[] + count: number ): Promise { - if ( - !positions || - positions.length === 0 || - (await isFeatureEnabled('tables-fractional-ordering')) - ) { - return nKeysBetween(await maxOrderKey(trx, tableId), null, count) - } - const keys: string[] = [] - for (const pos of positions) { - keys.push(await resolveInsertOrderKey(trx, tableId, pos)) - } - return keys + return nKeysBetween(await maxOrderKey(trx, tableId), null, count) } /** - * Inserts a single row in its own transaction. Always assigns a fractional - * `order_key`. When the fractional-ordering flag is on, `order_key` is - * authoritative and `position` is a best-effort append (no O(N) shift); when - * off, `position` is reserved as before (shifting to open the slot). Validation - * and side-effect dispatch stay with the caller; capacity is enforced by the - * `increment_user_table_row_count` trigger. + * Inserts a single row in its own transaction. Assigns a fractional `order_key` + * (authoritative) and a best-effort append `position` (no O(N) shift). + * Validation and side-effect dispatch stay with the caller; capacity is enforced + * by the `increment_user_table_row_count` trigger. */ export async function insertOrderedRow(params: { tableId: string @@ -360,35 +208,15 @@ export async function insertOrderedRow(params: { await setTableTxTimeouts(trx) await acquireRowOrderLock(trx, tableId) - const fractionalOrdering = await isFeatureEnabled('tables-fractional-ordering') + // Resolve the authoritative order key from neighbor ids when given, else from + // the requested position. + const orderKey = + afterRowId || beforeRowId + ? await resolveInsertByNeighbor(trx, tableId, afterRowId, beforeRowId) + : await resolveInsertOrderKey(trx, tableId, position) - // Resolve the order key (and a legacy slot position for the flag-off shift - // path) from neighbor ids when given, else from the requested position. - let orderKey: string - let slotPosition = position - if (afterRowId || beforeRowId) { - const resolved = await resolveInsertByNeighbor(trx, tableId, afterRowId, beforeRowId) - orderKey = resolved.orderKey - slotPosition = resolved.position - } else { - orderKey = await resolveInsertOrderKey(trx, tableId, position) - } - - let targetPosition: number - if (fractionalOrdering) { - // order_key is authoritative — keep a best-effort, no-shift position. - targetPosition = await nextRowPosition(trx, tableId) - } else if (slotPosition !== undefined) { - const [existing] = await trx - .select({ id: userTableRows.id }) - .from(userTableRows) - .where(and(eq(userTableRows.tableId, tableId), eq(userTableRows.position, slotPosition))) - .limit(1) - if (existing) await shiftRowsUpFrom(trx, tableId, slotPosition) - targetPosition = slotPosition - } else { - targetPosition = await nextRowPosition(trx, tableId) - } + // order_key is authoritative — keep a best-effort, no-shift position. + const targetPosition = await nextRowPosition(trx, tableId) return trx .insert(userTableRows) @@ -416,8 +244,9 @@ export async function insertOrderedRow(params: { } /** - * Deletes a single row by id in its own transaction, then closes the positional - * gap. Returns `false` when no row matched. + * Deletes a single row by id in its own transaction. Deleting a row never changes + * another row's `order_key`, so no positional reshift is needed. Returns `false` + * when no row matched. */ export async function deleteOrderedRow(params: { tableId: string @@ -436,33 +265,27 @@ export async function deleteOrderedRow(params: { eq(userTableRows.workspaceId, workspaceId) ) ) - .returning({ position: userTableRows.position }) - if (!deleted) return false - // Fractional ordering: deleting a row never changes another row's order_key, - // so the O(N) position reshift is skipped entirely. - if (!(await isFeatureEnabled('tables-fractional-ordering'))) { - await shiftRowsDownAfter(trx, tableId, deleted.position) - } - return true + .returning({ id: userTableRows.id }) + return Boolean(deleted) }) } /** - * Deletes the given row ids in batches within one transaction, then recompacts - * positions from the earliest deleted slot. Returns the deleted rows (id + prior - * position). The caller resolves which ids to delete (used by both delete-by-ids - * and delete-by-filter). + * Deletes the given row ids in batches within one transaction. Deletes leave + * `order_key` untouched, so no positional recompaction is needed. Returns the + * deleted row ids. The caller resolves which ids to delete (used by both + * delete-by-ids and delete-by-filter). */ export async function deleteOrderedRowsByIds(params: { tableId: string workspaceId: string rowIds: string[] -}): Promise<{ id: string; position: number }[]> { +}): Promise<{ id: string }[]> { const { tableId, workspaceId, rowIds } = params if (rowIds.length === 0) return [] return db.transaction(async (trx) => { await setTableTxTimeouts(trx, { statementMs: 60_000 }) - const deleted: { id: string; position: number }[] = [] + const deleted: { id: string }[] = [] for (let i = 0; i < rowIds.length; i += TABLE_LIMITS.DELETE_BATCH_SIZE) { const batch = rowIds.slice(i, i + TABLE_LIMITS.DELETE_BATCH_SIZE) const rows = await trx @@ -474,17 +297,9 @@ export async function deleteOrderedRowsByIds(params: { inArray(userTableRows.id, batch) ) ) - .returning({ id: userTableRows.id, position: userTableRows.position }) + .returning({ id: userTableRows.id }) deleted.push(...rows) } - // Fractional ordering: deletes leave order_key untouched, so no recompaction. - if (!(await isFeatureEnabled('tables-fractional-ordering')) && deleted.length > 0) { - const minDeletedPos = deleted.reduce( - (min, r) => (r.position < min ? r.position : min), - deleted[0].position - ) - await compactPositions(trx, tableId, minDeletedPos) - } return deleted }) } diff --git a/apps/sim/lib/table/rows/service.ts b/apps/sim/lib/table/rows/service.ts index 75497ad8aeb..fe12af429b3 100644 --- a/apps/sim/lib/table/rows/service.ts +++ b/apps/sim/lib/table/rows/service.ts @@ -16,7 +16,6 @@ import { createLogger } from '@sim/logger' import { toError } from '@sim/utils/errors' import { generateId } from '@sim/utils/id' import { and, count, eq, inArray, lte, notInArray, type SQL, sql } from 'drizzle-orm' -import { isFeatureEnabled } from '@/lib/core/config/feature-flags' import { assertRowCapacity, getMaxRowsPerTable, @@ -41,8 +40,6 @@ import { deleteOrderedRowsByIds, insertOrderedRow, nextRowPosition, - reserveBatchPositions, - reserveInsertPosition, resolveBatchInsertOrderKeys, resolveInsertOrderKey, } from '@/lib/table/rows/ordering' @@ -281,20 +278,14 @@ export async function batchInsertRowsWithTx( }) await acquireRowOrderLock(trx, data.tableId) - const fractionalOrdering = await isFeatureEnabled('tables-fractional-ordering') - // Undo restore passes exact saved keys; otherwise derive from positions/append. + // Undo restore passes exact saved keys; otherwise append after the current max. const orderKeys = data.orderKeys && data.orderKeys.length > 0 ? data.orderKeys - : await resolveBatchInsertOrderKeys(trx, data.tableId, data.rows.length, data.positions) - let positions: number[] - if (fractionalOrdering) { - // order_key authoritative — best-effort append positions, no shift. - const start = await nextRowPosition(trx, data.tableId) - positions = Array.from({ length: data.rows.length }, (_, i) => start + i) - } else { - positions = await reserveBatchPositions(trx, data.tableId, data.rows.length, data.positions) - } + : await resolveBatchInsertOrderKeys(trx, data.tableId, data.rows.length) + // order_key is authoritative — best-effort append positions, no shift. + const start = await nextRowPosition(trx, data.tableId) + const positions = Array.from({ length: data.rows.length }, (_, i) => start + i) const rowsToInsert = data.rows.map((rowData, i) => buildRow(rowData, positions[i], orderKeys[i])) const insertedRows = await trx.insert(userTableRows).values(rowsToInsert).returning() @@ -668,7 +659,7 @@ export async function upsertRow( tableId: data.tableId, workspaceId: data.workspaceId, data: data.data, - position: await reserveInsertPosition(trx, data.tableId), + position: await nextRowPosition(trx, data.tableId), orderKey: await resolveInsertOrderKey(trx, data.tableId), createdAt: now, updatedAt: now, @@ -738,18 +729,17 @@ export async function upsertRow( /** * Canonical ORDER BY for a table's rows, shared by `queryRows` (the paginated * list) and `findRowMatches` so a match's ordinal lines up with its index in - * the list. Order: explicit data sort (if any) → fractional `order_key` or - * legacy `position` → `id`. The `id` tiebreak is always appended so equal - * positions order deterministically — without it two separate query executions - * (a find vs a list page) could shuffle ties and misalign ordinals. + * the list. Order: explicit data sort (if any) → fractional `order_key` → `id`. + * The `id` tiebreak is always appended so equal keys order deterministically — + * without it two separate query executions (a find vs a list page) could shuffle + * ties and misalign ordinals. */ function buildRowOrderBySql( sort: Sort | undefined, tableName: string, - columns: ColumnDefinition[], - fractionalOrderingEnabled: boolean + columns: ColumnDefinition[] ): SQL { - const primary = fractionalOrderingEnabled ? `${tableName}.order_key` : `${tableName}.position` + const primary = `${tableName}.order_key` const id = `${tableName}.id` if (sort && Object.keys(sort).length > 0) { const sortClause = buildSortClause(sort, tableName, columns) @@ -814,8 +804,7 @@ export async function findRowMatches( if (filterClause) whereClause = and(baseConditions, filterClause) } - const fractionalOrdering = await isFeatureEnabled('tables-fractional-ordering') - const orderBySql = buildRowOrderBySql(options.sort, tableName, columns, fractionalOrdering) + const orderBySql = buildRowOrderBySql(options.sort, tableName, columns) const pattern = `%${escapeLikePattern(options.q)}%` const result = await db.transaction(async (trx) => { @@ -969,10 +958,7 @@ export async function queryRows( // Hide rows a running delete job is about to remove — both the page and the count below share // this clause, so totals stay consistent with the visible rows. - const [deleteMask, fractionalOrdering] = await Promise.all([ - pendingDeleteMask(table), - isFeatureEnabled('tables-fractional-ordering'), - ]) + const deleteMask = await pendingDeleteMask(table) const baseConditions = and( eq(userTableRows.tableId, table.id), @@ -1005,7 +991,7 @@ export async function queryRows( .select() .from(userTableRows) .where(pageWhere ?? baseConditions) - .orderBy(buildRowOrderBySql(sort, tableName, columns, fractionalOrdering)) + .orderBy(buildRowOrderBySql(sort, tableName, columns)) return after ? query.limit(limit) : query.limit(limit).offset(offset) } diff --git a/apps/sim/lib/table/sql.ts b/apps/sim/lib/table/sql.ts index 1e4f4a35ea0..5e695d93195 100644 --- a/apps/sim/lib/table/sql.ts +++ b/apps/sim/lib/table/sql.ts @@ -5,6 +5,7 @@ * Uses text extraction (->>) for comparisons and pattern matching. */ +import { isRecordLike } from '@sim/utils/object' import type { SQL } from 'drizzle-orm' import { sql } from 'drizzle-orm' import { getColumnId } from '@/lib/table/column-keys' @@ -311,7 +312,7 @@ function buildFieldCondition( const conditions: SQL[] = [] - if (typeof condition === 'object' && condition !== null && !Array.isArray(condition)) { + if (isRecordLike(condition)) { for (const [op, value] of Object.entries(condition)) { // Validate operator to ensure only allowed operators are used validateOperator(op) @@ -405,7 +406,10 @@ function buildFieldCondition( } else { // Simple value (primitive or null) - shorthand for equality. // Example: { name: 'John' } is equivalent to { name: { $eq: 'John' } } - conditions.push(buildContainmentClause(tableName, field, condition)) + // isRecordLike's negation can't structurally exclude ConditionOperators (no index + // signature), unlike the prior typeof-based narrowing, so the JsonValue-only shape + // of this branch is asserted rather than inferred. + conditions.push(buildContainmentClause(tableName, field, condition as JsonValue)) } return conditions diff --git a/apps/sim/lib/table/types.ts b/apps/sim/lib/table/types.ts index ba08af9c83e..26dcb886bba 100644 --- a/apps/sim/lib/table/types.ts +++ b/apps/sim/lib/table/types.ts @@ -372,8 +372,8 @@ export interface TableRow { executions: RowExecutions position: number /** - * Fractional order key. Authoritative row order when `TABLES_FRACTIONAL_ORDERING` - * is on; absent only for rows not yet backfilled (clients fall back to `position`). + * Fractional order key — the authoritative row order. Absent only for rows not + * yet backfilled (clients fall back to `position`). */ orderKey?: string createdAt: Date | string @@ -526,11 +526,9 @@ export interface BatchInsertData { rows: RowData[] workspaceId: string userId?: string - /** Optional per-row target positions. Length must equal `rows.length`. */ - positions?: number[] /** * Optional per-row exact order keys (undo restore re-inserts at the saved key). - * Length must equal `rows.length`. Takes precedence over `positions`. + * Length must equal `rows.length`. */ orderKeys?: string[] } diff --git a/apps/sim/lib/tokenization/utils.ts b/apps/sim/lib/tokenization/utils.ts index 72bcf9ac420..3a4c8cadee8 100644 --- a/apps/sim/lib/tokenization/utils.ts +++ b/apps/sim/lib/tokenization/utils.ts @@ -4,6 +4,7 @@ import { createLogger } from '@sim/logger' import { toError } from '@sim/utils/errors' +import { truncate } from '@sim/utils/string' import { LLM_BLOCK_TYPES, MAX_PREVIEW_LENGTH, @@ -103,10 +104,7 @@ export function extractTextContent(input: unknown): string { * Creates a preview of text for logging (truncated) */ export function createTextPreview(text: string): string { - if (text.length <= MAX_PREVIEW_LENGTH) { - return text - } - return `${text.substring(0, MAX_PREVIEW_LENGTH)}...` + return truncate(text, MAX_PREVIEW_LENGTH) } /** diff --git a/apps/sim/lib/webhooks/processor.ts b/apps/sim/lib/webhooks/processor.ts index 67ca4ac030a..80fb7b488f5 100644 --- a/apps/sim/lib/webhooks/processor.ts +++ b/apps/sim/lib/webhooks/processor.ts @@ -2,6 +2,7 @@ import { db, webhook, workflow, workflowDeploymentVersion } from '@sim/db' import { createLogger } from '@sim/logger' import { toError } from '@sim/utils/errors' import { generateId } from '@sim/utils/id' +import { truncate } from '@sim/utils/string' import { and, eq, isNull, or } from 'drizzle-orm' import { type NextRequest, NextResponse } from 'next/server' import { tryAdmit } from '@/lib/core/admission/gate' @@ -102,7 +103,7 @@ export async function parseWebhookBody( logger.error(`[${requestId}] Failed to parse webhook body`, { error: toError(parseError).message, contentType: request.headers.get('content-type'), - bodyPreview: `${rawBody?.slice(0, 100)}...`, + bodyPreview: truncate(rawBody ?? '', 100), }) return new NextResponse('Invalid payload format', { status: 400 }) } diff --git a/apps/sim/lib/webhooks/providers/ashby.test.ts b/apps/sim/lib/webhooks/providers/ashby.test.ts new file mode 100644 index 00000000000..f51eb1f8d9a --- /dev/null +++ b/apps/sim/lib/webhooks/providers/ashby.test.ts @@ -0,0 +1,231 @@ +/** + * @vitest-environment node + */ +import crypto from 'crypto' +import { createMockRequest } from '@sim/testing' +import { describe, expect, it } from 'vitest' +import { ashbyHandler } from '@/lib/webhooks/providers/ashby' + +describe('ashbyHandler', () => { + describe('verifyAuth', () => { + const secret = 'test-secret-token' + const rawBody = JSON.stringify({ action: 'ping', data: { webhookActionType: 'ping' } }) + const signature = `sha256=${crypto.createHmac('sha256', secret).update(rawBody, 'utf8').digest('hex')}` + + it('returns 401 when secretToken is missing', () => { + const request = createMockRequest('POST', JSON.parse(rawBody), { + 'ashby-signature': signature, + }) + const res = ashbyHandler.verifyAuth!({ + request: request as any, + rawBody, + requestId: 'r1', + providerConfig: {}, + webhook: {}, + workflow: {}, + }) + expect(res?.status).toBe(401) + }) + + it('returns 401 when signature header is missing', () => { + const request = createMockRequest('POST', JSON.parse(rawBody), {}) + const res = ashbyHandler.verifyAuth!({ + request: request as any, + rawBody, + requestId: 'r1', + providerConfig: { secretToken: secret }, + webhook: {}, + workflow: {}, + }) + expect(res?.status).toBe(401) + }) + + it('returns 401 when signature is invalid', () => { + const request = createMockRequest('POST', JSON.parse(rawBody), { + 'ashby-signature': 'sha256=deadbeef', + }) + const res = ashbyHandler.verifyAuth!({ + request: request as any, + rawBody, + requestId: 'r1', + providerConfig: { secretToken: secret }, + webhook: {}, + workflow: {}, + }) + expect(res?.status).toBe(401) + }) + + it('returns null when signature is valid', () => { + const request = createMockRequest('POST', JSON.parse(rawBody), { + 'ashby-signature': signature, + }) + const res = ashbyHandler.verifyAuth!({ + request: request as any, + rawBody, + requestId: 'r1', + providerConfig: { secretToken: secret }, + webhook: {}, + workflow: {}, + }) + expect(res).toBeNull() + }) + }) + + describe('matchEvent', () => { + it('rejects ping events', async () => { + const matched = await ashbyHandler.matchEvent!({ + webhook: { id: 'w1' } as any, + body: { action: 'ping', data: { webhookActionType: 'ping' } }, + requestId: 'r1', + providerConfig: { triggerId: 'ashby_application_submit' }, + } as any) + expect(matched).toBe(false) + }) + + it('matches when action equals the configured trigger event', async () => { + const matched = await ashbyHandler.matchEvent!({ + webhook: { id: 'w1' } as any, + body: { action: 'applicationSubmit', data: {} }, + requestId: 'r1', + providerConfig: { triggerId: 'ashby_application_submit' }, + } as any) + expect(matched).toBe(true) + }) + + it('rejects when action does not match the configured trigger event', async () => { + const matched = await ashbyHandler.matchEvent!({ + webhook: { id: 'w1' } as any, + body: { action: 'jobCreate', data: {} }, + requestId: 'r1', + providerConfig: { triggerId: 'ashby_application_submit' }, + } as any) + expect(matched).toBe(false) + }) + }) + + describe('formatInput', () => { + it('spreads data fields to the top level alongside action', async () => { + const result = await ashbyHandler.formatInput!({ + body: { + action: 'applicationSubmit', + data: { application: { id: 'app-1', status: 'Active' } }, + }, + } as any) + expect(result.input).toEqual({ + action: 'applicationSubmit', + application: { id: 'app-1', status: 'Active' }, + }) + }) + + it('renames currentInterviewStage.type to stageType, matching the trigger output schema', async () => { + const result = await ashbyHandler.formatInput!({ + body: { + action: 'candidateStageChange', + data: { + application: { + id: 'app-1', + currentInterviewStage: { id: 'stage-1', title: 'Offer', type: 'Offer' }, + }, + }, + }, + } as any) + expect(result.input.application).toEqual({ + id: 'app-1', + currentInterviewStage: { id: 'stage-1', title: 'Offer', stageType: 'Offer' }, + }) + }) + }) + + describe('extractIdempotencyId', () => { + it('derives a stable key from application id + updatedAt', () => { + const body = { + action: 'candidateStageChange', + data: { application: { id: 'app-1', updatedAt: '2026-01-01T00:00:00Z' } }, + } + expect(ashbyHandler.extractIdempotencyId!(body)).toBe( + 'ashby:candidateStageChange:app-1:2026-01-01T00:00:00Z' + ) + expect(ashbyHandler.extractIdempotencyId!({ ...body })).toBe( + ashbyHandler.extractIdempotencyId!(body) + ) + }) + + it('derives a key from candidate id for candidateDelete', () => { + const body = { action: 'candidateDelete', data: { candidate: { id: 'cand-1' } } } + expect(ashbyHandler.extractIdempotencyId!(body)).toBe('ashby:candidateDelete:cand-1') + }) + + it('derives a key from job id for jobCreate', () => { + const body = { action: 'jobCreate', data: { job: { id: 'job-1' } } } + expect(ashbyHandler.extractIdempotencyId!(body)).toBe('ashby:jobCreate:job-1') + }) + + it('derives a stable key from offer id alone, ignoring mutable decidedAt', () => { + const created = { action: 'offerCreate', data: { offer: { id: 'offer-1', decidedAt: null } } } + expect(ashbyHandler.extractIdempotencyId!(created)).toBe('ashby:offerCreate:offer-1') + + const retriedAfterDecision = { + action: 'offerCreate', + data: { offer: { id: 'offer-1', decidedAt: '2026-01-02T00:00:00Z' } }, + } + expect(ashbyHandler.extractIdempotencyId!(retriedAfterDecision)).toBe( + ashbyHandler.extractIdempotencyId!(created) + ) + }) + + it('falls back to a content fingerprint when updatedAt is missing, still deduping retries', () => { + const body = { + action: 'candidateStageChange', + data: { application: { id: 'app-1', status: 'Active' } }, + } + const key = ashbyHandler.extractIdempotencyId!(body) + expect(key).not.toBeNull() + expect(ashbyHandler.extractIdempotencyId!({ ...body, data: { ...body.data } })).toBe(key) + + const different = { + action: 'candidateStageChange', + data: { application: { id: 'app-1', status: 'Hired' } }, + } + expect(ashbyHandler.extractIdempotencyId!(different)).not.toBe(key) + }) + + it('distinguishes candidateHire deliveries that share an application snapshot but differ in offer', () => { + const application = { id: 'app-1', status: 'Hired' } + const first = { + action: 'candidateHire', + data: { application, offer: { id: 'offer-1' } }, + } + const second = { + action: 'candidateHire', + data: { application, offer: { id: 'offer-2' } }, + } + expect(ashbyHandler.extractIdempotencyId!(first)).not.toBe( + ashbyHandler.extractIdempotencyId!(second) + ) + }) + + it('distinguishes candidateHire deliveries sharing application id + updatedAt but differing in offer', () => { + const application = { id: 'app-1', status: 'Hired', updatedAt: '2026-01-01T00:00:00Z' } + const first = { + action: 'candidateHire', + data: { application, offer: { id: 'offer-1' } }, + } + const second = { + action: 'candidateHire', + data: { application, offer: { id: 'offer-2' } }, + } + expect(ashbyHandler.extractIdempotencyId!(first)).not.toBe( + ashbyHandler.extractIdempotencyId!(second) + ) + // a genuine retry of `first` (identical offer too) still dedupes + expect(ashbyHandler.extractIdempotencyId!({ ...first })).toBe( + ashbyHandler.extractIdempotencyId!(first) + ) + }) + + it('returns null when no recognizable resource is present', () => { + expect(ashbyHandler.extractIdempotencyId!({ action: 'ping', data: {} })).toBeNull() + expect(ashbyHandler.extractIdempotencyId!({})).toBeNull() + }) + }) +}) diff --git a/apps/sim/lib/webhooks/providers/ashby.ts b/apps/sim/lib/webhooks/providers/ashby.ts index 77fabe6e024..781fef57c66 100644 --- a/apps/sim/lib/webhooks/providers/ashby.ts +++ b/apps/sim/lib/webhooks/providers/ashby.ts @@ -2,6 +2,7 @@ import { createLogger } from '@sim/logger' import { safeCompare } from '@sim/security/compare' import { hmacSha256Hex } from '@sim/security/hmac' import { generateId } from '@sim/utils/id' +import { omit } from '@sim/utils/object' import { NextResponse } from 'next/server' import { getNotificationUrl, getProviderConfig } from '@/lib/webhooks/provider-subscription-utils' import type { @@ -14,6 +15,7 @@ import type { SubscriptionResult, WebhookProviderHandler, } from '@/lib/webhooks/providers/types' +import { buildFallbackDeliveryFingerprint } from '@/lib/webhooks/providers/utils' const logger = createLogger('WebhookProvider:Ashby') @@ -37,18 +39,54 @@ function validateAshbySignature(secretToken: string, signature: string, body: st export const ashbyHandler: WebhookProviderHandler = { extractIdempotencyId(body: unknown): string | null { const obj = body as Record - const webhookActionId = obj.webhookActionId - if (typeof webhookActionId === 'string' && webhookActionId) { - return `ashby:${webhookActionId}` + const action = typeof obj.action === 'string' ? obj.action : undefined + const data = obj.data as Record | undefined + if (!action || !data) return null + + const application = data.application as Record | undefined + const candidate = data.candidate as Record | undefined + const job = data.job as Record | undefined + const offer = data.offer as Record | undefined + + if (application?.id) { + const discriminator = application.updatedAt ?? buildFallbackDeliveryFingerprint(data) + const offerSuffix = offer?.id ? `:${offer.id}` : '' + return `ashby:${action}:${application.id}:${discriminator}${offerSuffix}` + } + if (offer?.id) { + return `ashby:${action}:${offer.id}` + } + if (candidate?.id) { + return `ashby:${action}:${candidate.id}` + } + if (job?.id) { + return `ashby:${action}:${job.id}` } return null }, async formatInput({ body }: FormatInputContext): Promise { const b = body as Record + const data = (b.data as Record) || {} + const application = data.application as Record | undefined + const currentInterviewStage = application?.currentInterviewStage as + | Record + | undefined + return { input: { - ...((b.data as Record) || {}), + ...data, + ...(application && currentInterviewStage + ? { + application: { + ...application, + currentInterviewStage: { + ...omit(currentInterviewStage, ['type']), + stageType: currentInterviewStage.type, + }, + }, + } + : {}), action: b.action, }, } @@ -185,6 +223,9 @@ export const ashbyHandler: WebhookProviderHandler = { } else if (ashbyResponse.status === 403) { userFriendlyMessage = 'Access denied. Please ensure your Ashby API Key has the apiKeysWrite permission.' + } else if (/duplicate webhook/i.test(errorMessage)) { + userFriendlyMessage = + 'A webhook for this URL and event already exists in Ashby. This usually happens when a previous save succeeded in Ashby but Sim failed to record it. Delete the duplicate webhook under Ashby Settings > API/Webhooks, then re-save this trigger.' } else if (errorMessage && errorMessage !== 'Unknown Ashby API error') { userFriendlyMessage = `Ashby error: ${errorMessage}` } diff --git a/apps/sim/lib/webhooks/providers/salesforce.ts b/apps/sim/lib/webhooks/providers/salesforce.ts index 3aef2eb2d12..8ead8812df0 100644 --- a/apps/sim/lib/webhooks/providers/salesforce.ts +++ b/apps/sim/lib/webhooks/providers/salesforce.ts @@ -1,5 +1,4 @@ import { createLogger } from '@sim/logger' -import { sha256Hex } from '@sim/security/hash' import { NextResponse } from 'next/server' import type { AuthContext, @@ -8,7 +7,7 @@ import type { FormatInputResult, WebhookProviderHandler, } from '@/lib/webhooks/providers/types' -import { verifyTokenAuth } from '@/lib/webhooks/providers/utils' +import { buildFallbackDeliveryFingerprint, verifyTokenAuth } from '@/lib/webhooks/providers/utils' export function extractSalesforceObjectTypeFromPayload( body: Record @@ -98,25 +97,6 @@ function pickTimestamp(body: Record, record: Record stableSerialize(item)).join(',')}]` - } - - if (value && typeof value === 'object') { - return `{${Object.entries(value as Record) - .sort(([a], [b]) => a.localeCompare(b)) - .map(([key, nested]) => `${JSON.stringify(key)}:${stableSerialize(nested)}`) - .join(',')}}` - } - - return JSON.stringify(value) -} - -function buildFallbackDeliveryFingerprint(body: Record): string { - return sha256Hex(stableSerialize(body)) -} - function pickRecordId(body: Record, record: Record): string { const id = (typeof body.recordId === 'string' && body.recordId) || diff --git a/apps/sim/lib/webhooks/providers/utils.ts b/apps/sim/lib/webhooks/providers/utils.ts index 43ff2b45fed..1afe2ce3196 100644 --- a/apps/sim/lib/webhooks/providers/utils.ts +++ b/apps/sim/lib/webhooks/providers/utils.ts @@ -1,11 +1,41 @@ import type { Logger } from '@sim/logger' import { createLogger } from '@sim/logger' import { safeCompare } from '@sim/security/compare' +import { sha256Hex } from '@sim/security/hash' import { NextResponse } from 'next/server' import type { AuthContext, EventFilterContext } from '@/lib/webhooks/providers/types' const logger = createLogger('WebhookProviderAuth') +/** + * Deterministic JSON serialization with object keys sorted, so structurally + * identical payloads produce identical output regardless of key order. + */ +function stableSerialize(value: unknown): string { + if (Array.isArray(value)) { + return `[${value.map((item) => stableSerialize(item)).join(',')}]` + } + + if (value && typeof value === 'object') { + return `{${Object.entries(value as Record) + .sort(([a], [b]) => a.localeCompare(b)) + .map(([key, nested]) => `${JSON.stringify(key)}:${stableSerialize(nested)}`) + .join(',')}}` + } + + return JSON.stringify(value) +} + +/** + * Fallback idempotency fingerprint for payloads with no stable delivery id + * or content timestamp to key on. A provider retry resends identical bytes, + * so this hash is stable across retries of the same delivery while still + * differentiating distinct events. + */ +export function buildFallbackDeliveryFingerprint(body: unknown): string { + return sha256Hex(stableSerialize(body)) +} + interface HmacVerifierOptions { configKey: string headerName: string diff --git a/apps/sim/lib/workflows/custom-blocks/operations.ts b/apps/sim/lib/workflows/custom-blocks/operations.ts index 83df77525ca..28d7dc5af35 100644 --- a/apps/sim/lib/workflows/custom-blocks/operations.ts +++ b/apps/sim/lib/workflows/custom-blocks/operations.ts @@ -34,6 +34,8 @@ export interface CustomBlockWithInputs { organizationId: string workflowId: string workflowName: string + /** Source workflow's home workspace id — used client-side to gate manage affordances. */ + workspaceId: string | null workspaceName: string | null type: string name: string @@ -162,18 +164,24 @@ export async function listCustomBlocksWithInputs( organizationId: string ): Promise { const rows = await db - .select({ block: customBlock, workflowName: workflow.name, workspaceName: workspace.name }) + .select({ + block: customBlock, + workflowName: workflow.name, + workspaceId: workflow.workspaceId, + workspaceName: workspace.name, + }) .from(customBlock) .innerJoin(workflow, eq(workflow.id, customBlock.workflowId)) .leftJoin(workspace, eq(workspace.id, workflow.workspaceId)) .where(eq(customBlock.organizationId, organizationId)) return Promise.all( - rows.map(async ({ block: row, workflowName, workspaceName }) => ({ + rows.map(async ({ block: row, workflowName, workspaceId, workspaceName }) => ({ id: row.id, organizationId: row.organizationId, workflowId: row.workflowId, workflowName, + workspaceId, workspaceName, type: row.type, name: row.name, @@ -381,6 +389,7 @@ export async function publishCustomBlock(params: { organizationId, workflowId, workflowName: wf.name, + workspaceId: wf.workspaceId, workspaceName: ws?.name ?? null, type, name, diff --git a/apps/sim/lib/workflows/schedules/utils.ts b/apps/sim/lib/workflows/schedules/utils.ts index f8a2ae7b4ab..53f7bf01ab4 100644 --- a/apps/sim/lib/workflows/schedules/utils.ts +++ b/apps/sim/lib/workflows/schedules/utils.ts @@ -1,6 +1,6 @@ import { createLogger } from '@sim/logger' import { getErrorMessage, toError } from '@sim/utils/errors' -import { formatDateTime } from '@sim/utils/formatting' +import { formatDateTime, getTimezoneAbbreviation } from '@sim/utils/formatting' import { Cron } from 'croner' import cronstrue from 'cronstrue' @@ -476,27 +476,6 @@ export function calculateNextRunTime( } } -/** - * Helper function to get a friendly timezone abbreviation. - * Uses Intl.DateTimeFormat to get the correct abbreviation for the current time, - * automatically handling DST transitions. - */ -function getTimezoneAbbreviation(timezone: string): string { - if (timezone === 'UTC') return 'UTC' - - try { - const formatter = new Intl.DateTimeFormat('en-US', { - timeZone: timezone, - timeZoneName: 'short', - }) - const parts = formatter.formatToParts(new Date()) - const tzPart = parts.find((p) => p.type === 'timeZoneName') - return tzPart?.value || timezone - } catch { - return timezone - } -} - /** * Converts a cron expression to a human-readable string format * Uses the cronstrue library for accurate parsing of complex cron expressions diff --git a/apps/sim/lib/workflows/search-replace/indexer.test.ts b/apps/sim/lib/workflows/search-replace/indexer.test.ts index 082cee6de72..2fe792b2073 100644 --- a/apps/sim/lib/workflows/search-replace/indexer.test.ts +++ b/apps/sim/lib/workflows/search-replace/indexer.test.ts @@ -1387,6 +1387,10 @@ describe('indexWorkflowSearchMatches', () => { custom: { subBlocks: [{ id: 'tools', title: 'Tools', type: 'tool-input' }], }, + native: { + name: 'Customer Mailer', + subBlocks: [], + }, }, }).filter((match) => match.blockId === 'tool-input-1') @@ -1395,7 +1399,7 @@ describe('indexWorkflowSearchMatches', () => { expect.objectContaining({ subBlockId: 'tools', valuePath: [0, 'title'], - searchText: 'Customer notifier', + searchText: 'Customer Mailer', }), expect.objectContaining({ subBlockId: 'tools', @@ -1404,6 +1408,7 @@ describe('indexWorkflowSearchMatches', () => { }), ]) ) + expect(matches.some((match) => match.searchText === 'Customer notifier')).toBe(false) expect(matches.some((match) => match.valuePath.includes('toolId'))).toBe(false) expect(matches.some((match) => match.valuePath.includes('operation'))).toBe(false) expect(matches.some((match) => match.valuePath.includes('credentialId'))).toBe(false) @@ -1418,6 +1423,50 @@ describe('indexWorkflowSearchMatches', () => { expect(matches.some((match) => match.valuePath.includes('schema'))).toBe(false) }) + it('indexes canonical MCP and custom-tool names over mutated stored titles', () => { + const workflow = createSearchReplaceWorkflowFixture() + workflow.blocks['tool-input-1'] = { + id: 'tool-input-1', + type: 'custom', + name: 'Tool Input Block', + position: { x: 0, y: 0 }, + enabled: true, + outputs: {}, + subBlocks: { + tools: { + id: 'tools', + type: 'tool-input', + value: [ + { type: 'mcp', toolId: 'mcp-tool-1', title: 'Mutated Title', params: {} }, + { type: 'custom-tool', customToolId: 'ct-1', title: 'Mutated Title', params: {} }, + ], + }, + }, + } + + const matches = indexWorkflowSearchMatches({ + workflow, + query: 'customer', + mode: 'text', + blockConfigs: { + ...SEARCH_REPLACE_BLOCK_CONFIGS, + custom: { + subBlocks: [{ id: 'tools', title: 'Tools', type: 'tool-input' }], + }, + }, + customTools: [{ id: 'ct-1', title: 'Customer Records' }], + mcpToolNamesById: new Map([['mcp-tool-1', 'customer_lookup']]), + }).filter((match) => match.blockId === 'tool-input-1') + + expect(matches).toEqual( + expect.arrayContaining([ + expect.objectContaining({ valuePath: [0, 'title'], searchText: 'customer_lookup' }), + expect.objectContaining({ valuePath: [1, 'title'], searchText: 'Customer Records' }), + ]) + ) + expect(matches.some((match) => match.searchText === 'Mutated Title')).toBe(false) + }) + it('indexes explicit secret tool params for intentional replacement', () => { const workflow = createSearchReplaceWorkflowFixture() workflow.blocks['tool-input-1'] = { diff --git a/apps/sim/lib/workflows/search-replace/indexer.ts b/apps/sim/lib/workflows/search-replace/indexer.ts index 2a412fedd6c..359dc8e7c01 100644 --- a/apps/sim/lib/workflows/search-replace/indexer.ts +++ b/apps/sim/lib/workflows/search-replace/indexer.ts @@ -23,6 +23,7 @@ import type { } from '@/lib/workflows/search-replace/types' import { pathToKey, walkStringValues } from '@/lib/workflows/search-replace/value-walker' import { SELECTOR_CONTEXT_FIELDS } from '@/lib/workflows/subblocks/context' +import { resolveStoredToolName } from '@/lib/workflows/subblocks/display' import { buildCanonicalIndex, buildSubBlockValues, @@ -931,6 +932,8 @@ function addToolInputMatches({ workflowId, credentialTypeById, blockConfigs, + customTools, + mcpToolNamesById, }: { matches: WorkflowSearchMatch[] block: WorkflowSearchBlockState @@ -950,11 +953,20 @@ function addToolInputMatches({ workflowId?: string credentialTypeById?: Record blockConfigs?: WorkflowSearchIndexerOptions['blockConfigs'] + customTools?: WorkflowSearchIndexerOptions['customTools'] + mcpToolNamesById?: WorkflowSearchIndexerOptions['mcpToolNamesById'] }) { const parentCanonicalModes = getSearchCanonicalModes(block) parseStoredToolInputValue(value).forEach((tool, toolIndex) => { - if (mode !== 'resource' && tool.title) { + // Index the resolved display name (not the stored mutable title) so + // search text and highlights match what the tool chip actually renders. + const toolDisplayName = resolveStoredToolName(tool, { + customTools, + mcpToolNamesById, + getBlockConfig: (type) => blockConfigs?.[type] ?? getBlock(type), + }) + if (mode !== 'resource' && toolDisplayName) { addTextMatches({ matches, idPrefix: 'tool-input-title', @@ -963,7 +975,7 @@ function addToolInputMatches({ canonicalSubBlockId, subBlockType: 'tool-input', fieldTitle: 'Tool', - value: tool.title, + value: toolDisplayName, valuePath: [toolIndex, 'title'], target: { kind: 'subblock' }, query, @@ -1228,6 +1240,8 @@ export function indexWorkflowSearchMatches( workflowId, blockConfigs = {}, credentialTypeById, + customTools, + mcpToolNamesById, } = options const matches: WorkflowSearchMatch[] = [] @@ -1363,6 +1377,8 @@ export function indexWorkflowSearchMatches( workflowId, credentialTypeById, blockConfigs, + customTools, + mcpToolNamesById, }) continue } diff --git a/apps/sim/lib/workflows/search-replace/types.ts b/apps/sim/lib/workflows/search-replace/types.ts index 9298430318d..4eefe464a80 100644 --- a/apps/sim/lib/workflows/search-replace/types.ts +++ b/apps/sim/lib/workflows/search-replace/types.ts @@ -3,6 +3,7 @@ import type { WorkflowSearchSubflowEditableValue, WorkflowSearchSubflowFieldId, } from '@/lib/workflows/search-replace/subflow-fields' +import type { StoredCustomToolRecord } from '@/lib/workflows/subblocks/display' import type { SubBlockConfig } from '@/blocks/types' import type { SelectorContext } from '@/hooks/selectors/types' import type { BlockState, SubBlockState } from '@/stores/workflows/workflow/types' @@ -96,10 +97,19 @@ export interface WorkflowSearchIndexerOptions { workflowId?: string blockConfigs?: Record< string, - | { subBlocks?: SubBlockConfig[]; triggers?: { enabled?: boolean }; category?: string } + | { + name?: string + subBlocks?: SubBlockConfig[] + triggers?: { enabled?: boolean } + category?: string + } | undefined > credentialTypeById?: Record + /** Custom-tool records so indexed tool names match the rendered chips. */ + customTools?: StoredCustomToolRecord[] + /** Live MCP tool names keyed by composite tool id, same as the chip renderers. */ + mcpToolNamesById?: ReadonlyMap } export interface WorkflowSearchReplacementOption { diff --git a/apps/sim/lib/workflows/subblocks/display.test.ts b/apps/sim/lib/workflows/subblocks/display.test.ts index 305c3cd6dd6..310af5d3701 100644 --- a/apps/sim/lib/workflows/subblocks/display.test.ts +++ b/apps/sim/lib/workflows/subblocks/display.test.ts @@ -4,7 +4,11 @@ import { describe, expect, it, vi } from 'vitest' vi.mock('@/blocks', () => ({ - getBlock: (type: string) => (type === 'slack' ? { name: 'Slack' } : undefined), + getBlock: (type: string) => { + if (type === 'slack') return { name: 'Slack' } + if (type === 'workflow' || type === 'workflow_input') return { name: 'Workflow' } + return undefined + }, })) import { @@ -113,6 +117,54 @@ describe('resolveToolsLabel', () => { null ) }) + + it('ignores the stored title on registry-backed tools so state edits cannot rename them', () => { + const slackName = resolveToolsLabel(toolInput, [{ type: 'slack' }], []) + expect(slackName).not.toBe(null) + expect(resolveToolsLabel(toolInput, [{ type: 'slack', title: 'Renamed By Copilot' }], [])).toBe( + slackName + ) + }) + + it('falls back to the stored title, then the raw type id, for unresolvable block types', () => { + expect( + resolveToolsLabel(toolInput, [{ type: 'custom_block_gone', title: 'Invoice Parser' }], []) + ).toBe('Invoice Parser') + expect(resolveToolsLabel(toolInput, [{ type: 'custom_block_gone' }], [])).toBe( + 'custom_block_gone' + ) + }) + + it('renders the static label for workflow-as-tool entries regardless of stored title', () => { + expect( + resolveToolsLabel(toolInput, [{ type: 'workflow', title: 'Renamed By Copilot' }], []) + ).toBe('Workflow') + expect(resolveToolsLabel(toolInput, [{ type: 'workflow_input' }], [])).toBe('Workflow') + }) + + it('prefers the live MCP tool name over the stored title', () => { + expect( + resolveToolsLabel( + toolInput, + [{ type: 'mcp', toolId: 'mcp-1', title: 'Renamed By Copilot' }], + [], + new Map([['mcp-1', 'Live MCP Name']]) + ) + ).toBe('Live MCP Name') + expect( + resolveToolsLabel(toolInput, [{ type: 'mcp', toolId: 'mcp-1', title: 'Snapshot' }], []) + ).toBe('Snapshot') + }) + + it('prefers the custom tool record over the stored title', () => { + expect( + resolveToolsLabel( + toolInput, + [{ type: 'custom-tool', customToolId: 'ct-1', title: 'Renamed By Copilot' }], + [{ id: 'ct-1', title: 'My Tool' }] + ) + ).toBe('My Tool') + }) }) describe('resolveSkillsLabel', () => { diff --git a/apps/sim/lib/workflows/subblocks/display.ts b/apps/sim/lib/workflows/subblocks/display.ts index 4b6bf462018..26088c25fff 100644 --- a/apps/sim/lib/workflows/subblocks/display.ts +++ b/apps/sim/lib/workflows/subblocks/display.ts @@ -302,7 +302,7 @@ export const getDisplayValue = (value: unknown): string => { try { const json = JSON.stringify(parsedValue) if (json.length <= 40) return json - return `${json.slice(0, 37)}...` + return truncate(json, 37) } catch { return '-' } @@ -426,52 +426,89 @@ export function resolveVariablesLabel( return summarizeNames(names) } +/** Custom-tool record shape needed to resolve a stored custom-tool reference. */ +export interface StoredCustomToolRecord { + id: string + title?: string + schema?: { function?: { name?: string } } +} + +export interface ResolveStoredToolNameOptions { + customTools?: StoredCustomToolRecord[] + /** Live MCP tool names keyed by composite tool id (`createMcpToolId`). */ + mcpToolNamesById?: ReadonlyMap + /** Block-config lookup; overridable so snapshot views can scope configs. */ + getBlockConfig?: (type: string) => { name?: string } | undefined +} + +/** + * Resolves one stored tool entry to its display name. Canonical sources win — + * the block registry (including the custom-block overlay), the custom-tool + * record, live MCP server data — so edits to the entry's mutable `title` in + * workflow state cannot relabel a tool that has a canonical name. The stored + * title is the fallback for entries with no resolvable source (deleted custom + * blocks, MCP entries while server data is unavailable, legacy inline custom + * tools where the title is the identity), ahead of the raw type id. + */ +export function resolveStoredToolName( + tool: unknown, + options: ResolveStoredToolNameOptions = {} +): string | null { + if (!tool || typeof tool !== 'object') return null + const t = tool as Record + const { customTools = [], mcpToolNamesById, getBlockConfig = getBlock } = options + + const storedTitle = typeof t.title === 'string' && t.title ? t.title : null + const schema = t.schema as { function?: { name?: string } } | undefined + const schemaName = schema?.function?.name || null + + if (t.type === 'custom-tool') { + if (typeof t.customToolId === 'string') { + const record = customTools.find((candidate) => candidate.id === t.customToolId) + if (record?.title) return record.title + if (record?.schema?.function?.name) return record.schema.function.name + } + return storedTitle || schemaName + } + + if (t.type === 'mcp') { + if (typeof t.toolId === 'string') { + const liveName = mcpToolNamesById?.get(t.toolId) + if (liveName) return liveName + } + return storedTitle + } + + if (typeof t.type === 'string' && t.type) { + const blockConfig = getBlockConfig(t.type) + if (blockConfig?.name) return blockConfig.name + return storedTitle || t.type + } + + if (storedTitle) return storedTitle + if (schemaName) return schemaName + + const fn = t.function as { name?: string } | undefined + if (fn?.name) return fn.name + + return null +} + /** - * Resolves a tool-input value to a tool-name summary. Stored tool entries - * come in several historical shapes, checked in priority order: explicit - * title, custom tool referenced by id, inline schema name, OpenAI function - * name, then the block registry. + * Resolves a tool-input value to a tool-name summary via + * {@link resolveStoredToolName}. Unresolvable entries are skipped. */ export function resolveToolsLabel( subBlock: SubBlockConfig | undefined, rawValue: unknown, - customTools: Array<{ id: string; title?: string; schema?: { function?: { name?: string } } }> + customTools: StoredCustomToolRecord[], + mcpToolNamesById?: ReadonlyMap ): string | null { if (subBlock?.type !== 'tool-input') return null if (!Array.isArray(rawValue) || rawValue.length === 0) return null const names = rawValue - .map((tool: unknown) => { - if (!tool || typeof tool !== 'object') return null - const t = tool as Record - - if (typeof t.title === 'string' && t.title) return t.title - - if (t.type === 'custom-tool' && typeof t.customToolId === 'string') { - const customTool = customTools.find((candidate) => candidate.id === t.customToolId) - if (customTool?.title) return customTool.title - if (customTool?.schema?.function?.name) return customTool.schema.function.name - } - - const schema = t.schema as { function?: { name?: string } } | undefined - if (schema?.function?.name) return schema.function.name - - const fn = t.function as { name?: string } | undefined - if (fn?.name) return fn.name - - if ( - typeof t.type === 'string' && - t.type !== 'custom-tool' && - t.type !== 'mcp' && - t.type !== 'workflow' && - t.type !== 'workflow_input' - ) { - const blockConfig = getBlock(t.type) - if (blockConfig?.name) return blockConfig.name - } - - return null - }) + .map((tool: unknown) => resolveStoredToolName(tool, { customTools, mcpToolNamesById })) .filter((name): name is string => !!name) return summarizeNames(names) diff --git a/apps/sim/lib/workspaces/organization/utils.ts b/apps/sim/lib/workspaces/organization/utils.ts index 27ccb51396b..43f5990b29c 100644 --- a/apps/sim/lib/workspaces/organization/utils.ts +++ b/apps/sim/lib/workspaces/organization/utils.ts @@ -4,6 +4,7 @@ */ import { isOrgAdminRole } from '@sim/platform-authz/predicates' +import { normalizeEmail } from '@sim/utils/string' import { quickValidateEmail } from '@/lib/messaging/email/validation' import type { Organization } from '@/lib/workspaces/organization/types' @@ -88,5 +89,5 @@ export function validateSlug(slug: string): boolean { * Validate email format */ export function validateEmail(email: string): boolean { - return quickValidateEmail(email.trim().toLowerCase()).isValid + return quickValidateEmail(normalizeEmail(email)).isValid } diff --git a/apps/sim/next.config.ts b/apps/sim/next.config.ts index 1a5d0132734..9affd751b0b 100644 --- a/apps/sim/next.config.ts +++ b/apps/sim/next.config.ts @@ -409,6 +409,26 @@ const nextConfig: NextConfig = { permanent: true, }) + /** + * AEO/GEO-style posts (listicles, comparisons, how-tos) were split out of + * `/blog` into the dedicated `/library` section so `/blog` stays + * editorial-only. Preserve previously indexed URLs for the moved posts. + */ + for (const slug of [ + 'best-zapier-alternatives', + 'ai-agents-vs-rpa', + 'ai-agent-vs-chatbot', + 'openai-vs-n8n-vs-sim', + 'ai-agent-ideas', + 'how-to-create-an-ai-agent', + ]) { + redirects.push({ + source: `/blog/${slug}`, + destination: `/library/${slug}`, + permanent: true, + }) + } + return redirects }, async rewrites() { diff --git a/apps/sim/package.json b/apps/sim/package.json index 31e66edbc00..f58c8e61b80 100644 --- a/apps/sim/package.json +++ b/apps/sim/package.json @@ -59,8 +59,8 @@ "@aws-sdk/s3-request-presigner": "3.1032.0", "@azure/communication-email": "1.0.0", "@azure/storage-blob": "12.27.0", - "@better-auth/sso": "1.6.11", - "@better-auth/stripe": "1.6.11", + "@better-auth/sso": "1.6.13", + "@better-auth/stripe": "1.6.13", "@browserbasehq/stagehand": "^3.2.1", "@calcom/embed-react": "1.5.3", "@cerebras/cerebras_cloud_sdk": "^1.23.0", @@ -124,8 +124,9 @@ "@tiptap/starter-kit": "3.26.1", "@tiptap/suggestion": "3.26.1", "@trigger.dev/sdk": "4.4.3", + "@typescript/typescript6": "^6.0.2", "ajv": "8.18.0", - "better-auth": "1.6.11", + "better-auth": "1.6.13", "binary-extensions": "3.1.0", "browser-image-compression": "^2.0.2", "busboy": "1.6.0", @@ -235,6 +236,7 @@ "@types/react-dom": "^19", "@types/ssh2": "^1.15.5", "@types/three": "0.177.0", + "@typescript/native-preview": "7.0.0-dev.20260707.2", "@vitejs/plugin-react": "^4.3.4", "@vitest/coverage-v8": "^4.1.0", "autoprefixer": "10.4.21", @@ -243,7 +245,7 @@ "postcss": "^8", "react-email": "4.3.2", "tailwindcss": "^3.4.1", - "typescript": "^5.7.3", + "typescript": "^7.0.2", "vite-tsconfig-paths": "^5.1.4", "vitest": "^4.1.0" }, diff --git a/apps/sim/providers/models.ts b/apps/sim/providers/models.ts index cc6a0f44386..e30af3a0b31 100644 --- a/apps/sim/providers/models.ts +++ b/apps/sim/providers/models.ts @@ -1844,7 +1844,7 @@ export const PROVIDER_DEFINITIONS: Record = { fileAttachment: { maxBytes: 20 * 1024 * 1024, strategy: 'remote-url' }, name: 'xAI', description: "xAI's Grok models", - defaultModel: 'grok-4.3', + defaultModel: 'grok-4.5', modelPatterns: [/^grok/], icon: xAIIcon, color: '#555555', @@ -1852,6 +1852,20 @@ export const PROVIDER_DEFINITIONS: Record = { toolUsageControl: true, }, models: [ + { + id: 'grok-4.5', + pricing: { + input: 2.0, + output: 6.0, + updatedAt: '2026-07-08', + }, + capabilities: { + temperature: { min: 0, max: 2 }, + }, + contextWindow: 500000, + releaseDate: '2026-07-08', + recommended: true, + }, { id: 'grok-4.3', pricing: { @@ -1865,7 +1879,6 @@ export const PROVIDER_DEFINITIONS: Record = { }, contextWindow: 1000000, releaseDate: '2026-04-30', - recommended: true, }, { id: 'grok-4-latest', diff --git a/apps/sim/providers/utils.ts b/apps/sim/providers/utils.ts index 40ff390cadf..487313e6564 100644 --- a/apps/sim/providers/utils.ts +++ b/apps/sim/providers/utils.ts @@ -1,5 +1,6 @@ import { createLogger, type Logger } from '@sim/logger' import { getErrorMessage } from '@sim/utils/errors' +import { omit } from '@sim/utils/object' import type OpenAI from 'openai' import type { ChatCompletionChunk } from 'openai/resources/chat/completions' import type { CompletionUsage } from 'openai/resources/completions' @@ -642,7 +643,7 @@ export async function transformBlockTool( ) const sourceIds = [group.basicId, ...group.advancedIds].filter(Boolean) as string[] - sourceIds.forEach((id) => delete result[id]) + result = omit(result, sourceIds) if (chosen !== undefined) { result[group.canonicalId] = chosen diff --git a/apps/sim/public/blog/authors/emir.jpg b/apps/sim/public/authors/emir.jpg similarity index 100% rename from apps/sim/public/blog/authors/emir.jpg rename to apps/sim/public/authors/emir.jpg diff --git a/apps/sim/public/blog/authors/sid.jpg b/apps/sim/public/authors/sid.jpg similarity index 100% rename from apps/sim/public/blog/authors/sid.jpg rename to apps/sim/public/authors/sid.jpg diff --git a/apps/sim/public/blog/authors/vik.jpg b/apps/sim/public/authors/vik.jpg similarity index 100% rename from apps/sim/public/blog/authors/vik.jpg rename to apps/sim/public/authors/vik.jpg diff --git a/apps/sim/public/blog/authors/waleed.jpg b/apps/sim/public/authors/waleed.jpg similarity index 100% rename from apps/sim/public/blog/authors/waleed.jpg rename to apps/sim/public/authors/waleed.jpg diff --git a/apps/sim/public/blog/ai-agent-ideas/cover.jpg b/apps/sim/public/library/ai-agent-ideas/cover.jpg similarity index 100% rename from apps/sim/public/blog/ai-agent-ideas/cover.jpg rename to apps/sim/public/library/ai-agent-ideas/cover.jpg diff --git a/apps/sim/public/blog/ai-agent-ideas/cover.png b/apps/sim/public/library/ai-agent-ideas/cover.png similarity index 100% rename from apps/sim/public/blog/ai-agent-ideas/cover.png rename to apps/sim/public/library/ai-agent-ideas/cover.png diff --git a/apps/sim/public/blog/ai-agent-vs-chatbot/cover.jpg b/apps/sim/public/library/ai-agent-vs-chatbot/cover.jpg similarity index 100% rename from apps/sim/public/blog/ai-agent-vs-chatbot/cover.jpg rename to apps/sim/public/library/ai-agent-vs-chatbot/cover.jpg diff --git a/apps/sim/public/blog/ai-agent-vs-chatbot/cover.png b/apps/sim/public/library/ai-agent-vs-chatbot/cover.png similarity index 100% rename from apps/sim/public/blog/ai-agent-vs-chatbot/cover.png rename to apps/sim/public/library/ai-agent-vs-chatbot/cover.png diff --git a/apps/sim/public/blog/ai-agents-vs-rpa/cover.jpg b/apps/sim/public/library/ai-agents-vs-rpa/cover.jpg similarity index 100% rename from apps/sim/public/blog/ai-agents-vs-rpa/cover.jpg rename to apps/sim/public/library/ai-agents-vs-rpa/cover.jpg diff --git a/apps/sim/public/blog/ai-agents-vs-rpa/cover.png b/apps/sim/public/library/ai-agents-vs-rpa/cover.png similarity index 100% rename from apps/sim/public/blog/ai-agents-vs-rpa/cover.png rename to apps/sim/public/library/ai-agents-vs-rpa/cover.png diff --git a/apps/sim/public/blog/best-zapier-alternatives/cover.jpg b/apps/sim/public/library/best-zapier-alternatives/cover.jpg similarity index 100% rename from apps/sim/public/blog/best-zapier-alternatives/cover.jpg rename to apps/sim/public/library/best-zapier-alternatives/cover.jpg diff --git a/apps/sim/public/blog/best-zapier-alternatives/cover.png b/apps/sim/public/library/best-zapier-alternatives/cover.png similarity index 100% rename from apps/sim/public/blog/best-zapier-alternatives/cover.png rename to apps/sim/public/library/best-zapier-alternatives/cover.png diff --git a/apps/sim/public/blog/how-to-create-an-ai-agent/cover.jpg b/apps/sim/public/library/how-to-create-an-ai-agent/cover.jpg similarity index 100% rename from apps/sim/public/blog/how-to-create-an-ai-agent/cover.jpg rename to apps/sim/public/library/how-to-create-an-ai-agent/cover.jpg diff --git a/apps/sim/public/blog/how-to-create-an-ai-agent/cover.png b/apps/sim/public/library/how-to-create-an-ai-agent/cover.png similarity index 100% rename from apps/sim/public/blog/how-to-create-an-ai-agent/cover.png rename to apps/sim/public/library/how-to-create-an-ai-agent/cover.png diff --git a/apps/sim/public/blog/openai-vs-n8n-vs-sim/copilot.png b/apps/sim/public/library/openai-vs-n8n-vs-sim/copilot.png similarity index 100% rename from apps/sim/public/blog/openai-vs-n8n-vs-sim/copilot.png rename to apps/sim/public/library/openai-vs-n8n-vs-sim/copilot.png diff --git a/apps/sim/public/blog/openai-vs-n8n-vs-sim/cover.jpg b/apps/sim/public/library/openai-vs-n8n-vs-sim/cover.jpg similarity index 100% rename from apps/sim/public/blog/openai-vs-n8n-vs-sim/cover.jpg rename to apps/sim/public/library/openai-vs-n8n-vs-sim/cover.jpg diff --git a/apps/sim/public/blog/openai-vs-n8n-vs-sim/cover.png b/apps/sim/public/library/openai-vs-n8n-vs-sim/cover.png similarity index 100% rename from apps/sim/public/blog/openai-vs-n8n-vs-sim/cover.png rename to apps/sim/public/library/openai-vs-n8n-vs-sim/cover.png diff --git a/apps/sim/public/blog/openai-vs-n8n-vs-sim/logs.png b/apps/sim/public/library/openai-vs-n8n-vs-sim/logs.png similarity index 100% rename from apps/sim/public/blog/openai-vs-n8n-vs-sim/logs.png rename to apps/sim/public/library/openai-vs-n8n-vs-sim/logs.png diff --git a/apps/sim/public/blog/openai-vs-n8n-vs-sim/n8n.png b/apps/sim/public/library/openai-vs-n8n-vs-sim/n8n.png similarity index 100% rename from apps/sim/public/blog/openai-vs-n8n-vs-sim/n8n.png rename to apps/sim/public/library/openai-vs-n8n-vs-sim/n8n.png diff --git a/apps/sim/public/blog/openai-vs-n8n-vs-sim/openai.png b/apps/sim/public/library/openai-vs-n8n-vs-sim/openai.png similarity index 100% rename from apps/sim/public/blog/openai-vs-n8n-vs-sim/openai.png rename to apps/sim/public/library/openai-vs-n8n-vs-sim/openai.png diff --git a/apps/sim/public/blog/openai-vs-n8n-vs-sim/sim.png b/apps/sim/public/library/openai-vs-n8n-vs-sim/sim.png similarity index 100% rename from apps/sim/public/blog/openai-vs-n8n-vs-sim/sim.png rename to apps/sim/public/library/openai-vs-n8n-vs-sim/sim.png diff --git a/apps/sim/public/blog/openai-vs-n8n-vs-sim/templates.png b/apps/sim/public/library/openai-vs-n8n-vs-sim/templates.png similarity index 100% rename from apps/sim/public/blog/openai-vs-n8n-vs-sim/templates.png rename to apps/sim/public/library/openai-vs-n8n-vs-sim/templates.png diff --git a/apps/sim/public/blog/openai-vs-n8n-vs-sim/widgets.png b/apps/sim/public/library/openai-vs-n8n-vs-sim/widgets.png similarity index 100% rename from apps/sim/public/blog/openai-vs-n8n-vs-sim/widgets.png rename to apps/sim/public/library/openai-vs-n8n-vs-sim/widgets.png diff --git a/apps/sim/stores/chat/store.ts b/apps/sim/stores/chat/store.ts index be1ef9bfe54..23086295b97 100644 --- a/apps/sim/stores/chat/store.ts +++ b/apps/sim/stores/chat/store.ts @@ -1,5 +1,6 @@ import { createLogger } from '@sim/logger' import { generateId } from '@sim/utils/id' +import { truncate } from '@sim/utils/string' import { create } from 'zustand' import { devtools, persist } from 'zustand/middleware' import type { ChatMessage, ChatState } from './types' @@ -109,9 +110,7 @@ export const useChatStore = create()( let stringValue = typeof value === 'object' ? JSON.stringify(value) : String(value) // Truncate very long strings - if (stringValue.length > 2000) { - stringValue = `${stringValue.substring(0, 2000)}...` - } + stringValue = truncate(stringValue, 2000) // Escape quotes and wrap in quotes if contains special characters if ( diff --git a/apps/sim/stores/settings/dirty/store.ts b/apps/sim/stores/settings/dirty/store.ts index 4dbec7bf720..49a702d2568 100644 --- a/apps/sim/stores/settings/dirty/store.ts +++ b/apps/sim/stores/settings/dirty/store.ts @@ -1,28 +1,28 @@ import { create } from 'zustand' import { devtools } from 'zustand/middleware' -import type { SettingsSection } from '@/app/workspace/[workspaceId]/settings/navigation' interface SettingsDirtyStore { isDirty: boolean - pendingSection: SettingsSection | null + /** Leave action deferred until the user confirms discard. */ + pendingLeave: (() => void) | null setDirty: (dirty: boolean) => void /** - * Call before navigating to a new section. Returns `true` if navigation may - * proceed immediately; returns `false` if there are unsaved changes — in that - * case `pendingSection` is set so a confirmation dialog can be shown. + * Call before leaving the current settings surface. If clean, runs `leave` immediately + * and returns `true`. If dirty, stashes `leave` and returns `false` so the shared + * discard dialog can confirm before running it. */ - requestNavigation: (section: SettingsSection) => boolean - /** Clears dirty + pending state and returns the section to navigate to. */ - confirmNavigation: () => SettingsSection | null - /** Cancels a pending navigation without clearing dirty state. */ - cancelNavigation: () => void + requestLeave: (leave: () => void) => boolean + /** Clears dirty + pending state and runs the deferred leave action. */ + confirmLeave: () => void + /** Cancels a pending leave without clearing dirty state. */ + cancelLeave: () => void /** Resets all state — call on component unmount. */ reset: () => void } const initialState = { isDirty: false, - pendingSection: null as SettingsSection | null, + pendingLeave: null as (() => void) | null, } export const useSettingsDirtyStore = create()( @@ -32,19 +32,22 @@ export const useSettingsDirtyStore = create()( setDirty: (dirty) => set({ isDirty: dirty }), - requestNavigation: (section) => { - if (!get().isDirty) return true - set({ pendingSection: section }) + requestLeave: (leave) => { + if (!get().isDirty) { + leave() + return true + } + set({ pendingLeave: leave }) return false }, - confirmNavigation: () => { - const { pendingSection } = get() + confirmLeave: () => { + const { pendingLeave } = get() set({ ...initialState }) - return pendingSection + pendingLeave?.() }, - cancelNavigation: () => set({ pendingSection: null }), + cancelLeave: () => set({ pendingLeave: null }), reset: () => set({ ...initialState }), }), diff --git a/apps/sim/stores/table/types.ts b/apps/sim/stores/table/types.ts index 17e72fb8c0a..55521402cef 100644 --- a/apps/sim/stores/table/types.ts +++ b/apps/sim/stores/table/types.ts @@ -32,7 +32,6 @@ export type TableUndoAction = | { type: 'create-row' rowId: string - position: number orderKey?: string data?: Record } @@ -40,7 +39,6 @@ export type TableUndoAction = type: 'create-rows' rows: Array<{ rowId: string - position: number orderKey?: string data: Record }> diff --git a/apps/sim/tools/amplitude/funnels.ts b/apps/sim/tools/amplitude/funnels.ts index 7eed8cdc883..f00036320f4 100644 --- a/apps/sim/tools/amplitude/funnels.ts +++ b/apps/sim/tools/amplitude/funnels.ts @@ -1,3 +1,4 @@ +import { isRecordLike } from '@sim/utils/object' import type { AmplitudeFunnelsParams, AmplitudeFunnelsResponse } from '@/tools/amplitude/types' import { getDashboardHost } from '@/tools/amplitude/utils' import type { ToolConfig } from '@/tools/types' @@ -100,10 +101,7 @@ export const funnelsTool: ToolConfig => - Boolean(value) && typeof value === 'object' && !Array.isArray(value) - - if (!Array.isArray(parsed) || parsed.length === 0 || !parsed.every(isPlainObject)) { + if (!Array.isArray(parsed) || parsed.length === 0 || !parsed.every(isRecordLike)) { throw new Error( 'Amplitude Funnels: "events" must be a non-empty JSON array of event objects' ) diff --git a/apps/sim/tools/github/issue_comment.ts b/apps/sim/tools/github/issue_comment.ts index 80259df0709..a32fe31c665 100644 --- a/apps/sim/tools/github/issue_comment.ts +++ b/apps/sim/tools/github/issue_comment.ts @@ -1,3 +1,4 @@ +import { truncate } from '@sim/utils/string' import type { CreateIssueCommentParams, IssueCommentResponse } from '@/tools/github/types' import { COMMENT_OUTPUT_PROPERTIES, USER_OUTPUT } from '@/tools/github/types' import type { ToolConfig } from '@/tools/types' @@ -58,7 +59,7 @@ export const issueCommentTool: ToolConfig { const data = await response.json() - const content = `Comment created on issue #${data.issue_url.split('/').pop()}: "${data.body.substring(0, 100)}${data.body.length > 100 ? '...' : ''}"` + const content = `Comment created on issue #${data.issue_url.split('/').pop()}: "${truncate(data.body, 100)}"` return { success: true, diff --git a/apps/sim/tools/github/list_issue_comments.ts b/apps/sim/tools/github/list_issue_comments.ts index 9016777c92d..c113b107fb0 100644 --- a/apps/sim/tools/github/list_issue_comments.ts +++ b/apps/sim/tools/github/list_issue_comments.ts @@ -1,3 +1,4 @@ +import { truncate } from '@sim/utils/string' import type { CommentsListResponse, ListIssueCommentsParams } from '@/tools/github/types' import { COMMENT_OUTPUT_PROPERTIES, USER_OUTPUT } from '@/tools/github/types' import type { ToolConfig } from '@/tools/types' @@ -84,7 +85,7 @@ export const listIssueCommentsTool: ToolConfig - `- ${c.user.login} (${new Date(c.created_at).toLocaleDateString()}): "${c.body.substring(0, 80)}${c.body.length > 80 ? '...' : ''}"` + `- ${c.user.login} (${new Date(c.created_at).toLocaleDateString()}): "${truncate(c.body, 80)}"` ) .join('\n')}` : '' diff --git a/apps/sim/tools/github/list_pr_comments.ts b/apps/sim/tools/github/list_pr_comments.ts index 1683e17ab21..f0b4ba23765 100644 --- a/apps/sim/tools/github/list_pr_comments.ts +++ b/apps/sim/tools/github/list_pr_comments.ts @@ -1,3 +1,4 @@ +import { truncate } from '@sim/utils/string' import type { CommentsListResponse, ListPRCommentsParams } from '@/tools/github/types' import { PR_COMMENT_OUTPUT_PROPERTIES, USER_OUTPUT } from '@/tools/github/types' import type { ToolConfig } from '@/tools/types' @@ -100,7 +101,7 @@ export const listPRCommentsTool: ToolConfig - `- ${c.user.login} on ${c.path}${c.line ? `:${c.line}` : ''} (${new Date(c.created_at).toLocaleDateString()}): "${c.body.substring(0, 80)}${c.body.length > 80 ? '...' : ''}"` + `- ${c.user.login} on ${c.path}${c.line ? `:${c.line}` : ''} (${new Date(c.created_at).toLocaleDateString()}): "${truncate(c.body, 80)}"` ) .join('\n')}` : '' diff --git a/apps/sim/tools/github/update_comment.ts b/apps/sim/tools/github/update_comment.ts index 7eb7862dd38..ded246aee9d 100644 --- a/apps/sim/tools/github/update_comment.ts +++ b/apps/sim/tools/github/update_comment.ts @@ -1,3 +1,4 @@ +import { truncate } from '@sim/utils/string' import type { IssueCommentResponse, UpdateCommentParams } from '@/tools/github/types' import { COMMENT_OUTPUT_PROPERTIES, USER_OUTPUT } from '@/tools/github/types' import type { ToolConfig } from '@/tools/types' @@ -58,7 +59,7 @@ export const updateCommentTool: ToolConfig { const data = await response.json() - const content = `Comment #${data.id} updated: "${data.body.substring(0, 100)}${data.body.length > 100 ? '...' : ''}"` + const content = `Comment #${data.id} updated: "${truncate(data.body, 100)}"` return { success: true, diff --git a/apps/sim/tools/incidentio/utils.ts b/apps/sim/tools/incidentio/utils.ts index c08e81f4433..265f9d6921a 100644 --- a/apps/sim/tools/incidentio/utils.ts +++ b/apps/sim/tools/incidentio/utils.ts @@ -1,9 +1,6 @@ +import { getErrorMessage } from '@sim/utils/errors' import type { Workflow } from '@/tools/incidentio/types' -function getJsonParseErrorMessage(error: unknown): string { - return error instanceof Error ? error.message : String(error) -} - function toStringValue(value: unknown): string { return typeof value === 'string' ? value : String(value ?? '') } @@ -34,7 +31,7 @@ export function parseIncidentioJsonParam( try { return JSON.parse(jsonString) } catch (error) { - throw new Error(`Invalid JSON for ${paramName}: ${getJsonParseErrorMessage(error)}`) + throw new Error(`Invalid JSON for ${paramName}: ${getErrorMessage(error)}`) } } diff --git a/apps/sim/tools/index.test.ts b/apps/sim/tools/index.test.ts index 0b4d4ccbd58..04bb1617bd1 100644 --- a/apps/sim/tools/index.test.ts +++ b/apps/sim/tools/index.test.ts @@ -1896,6 +1896,28 @@ describe('MCP Tool Execution', () => { expect(result.success).toBe(false) }) + it('skips retry when Retry-After exceeds a maxDelayMs configured above the 30s default cap', async () => { + global.fetch = Object.assign( + vi + .fn() + .mockResolvedValueOnce( + makeJsonResponse(429, { error: 'rate limited' }, { 'retry-after': '50' }) + ) + .mockResolvedValueOnce(makeJsonResponse(200, { ok: true })), + { preconnect: vi.fn() } + ) as typeof fetch + + const result = await executeTool('http_request', { + url: '/api/test', + method: 'GET', + retries: 3, + retryMaxDelayMs: 40000, + }) + + expect(global.fetch).toHaveBeenCalledTimes(1) + expect(result.success).toBe(false) + }) + it('retries when Retry-After header is within maxDelayMs', async () => { global.fetch = Object.assign( vi diff --git a/apps/sim/tools/index.ts b/apps/sim/tools/index.ts index 2ee548a4324..dbd766914e1 100644 --- a/apps/sim/tools/index.ts +++ b/apps/sim/tools/index.ts @@ -1,7 +1,7 @@ import { createLogger } from '@sim/logger' import { getErrorMessage, toError } from '@sim/utils/errors' import { sleep } from '@sim/utils/helpers' -import { randomFloat } from '@sim/utils/random' +import { backoffWithJitter, parseRetryAfter } from '@sim/utils/retry' import { getBYOKKey } from '@/lib/api-key/byok' import { generateInternalToken } from '@/lib/auth/internal' import { isHosted } from '@/lib/core/config/env-flags' @@ -475,7 +475,7 @@ async function executeWithRetry( throw error } - const delayMs = baseDelayMs * 2 ** attempt + const delayMs = backoffWithJitter(attempt + 1, null, { baseMs: baseDelayMs }) // Track throttling event via telemetry PlatformEvents.hostedKeyRateLimited({ @@ -1486,26 +1486,6 @@ function isRetryableFailure(error: unknown, status?: number): boolean { return false } -function calculateBackoff(attempt: number, initialDelayMs: number, maxDelayMs: number): number { - const base = Math.min(initialDelayMs * 2 ** attempt, maxDelayMs) - return Math.round(base / 2 + randomFloat() * (base / 2)) -} - -function parseRetryAfterHeader(header: string | null): number { - if (!header) return 0 - const trimmed = header.trim() - if (/^\d+$/.test(trimmed)) { - const seconds = Number.parseInt(trimmed, 10) - return seconds > 0 ? seconds * 1000 : 0 - } - const date = new Date(trimmed) - if (!Number.isNaN(date.getTime())) { - const deltaMs = date.getTime() - Date.now() - return deltaMs > 0 ? deltaMs : 0 - } - return 0 -} - function shouldRetryWithoutReadingBody( status: number, headers: { get(name: string): string | null }, @@ -1515,7 +1495,10 @@ function shouldRetryWithoutReadingBody( if (!retryConfig || isLastAttempt || !isRetryableFailure(null, status)) { return false } - return parseRetryAfterHeader(headers.get('retry-after')) <= retryConfig.maxDelayMs + return ( + (parseRetryAfter(headers.get('retry-after'), Number.POSITIVE_INFINITY) ?? 0) <= + retryConfig.maxDelayMs + ) } /** @@ -1742,11 +1725,10 @@ async function executeToolRequest( if (!retryConfig || isLastAttempt || !isRetryableFailure(error)) { throw error } - const delayMs = calculateBackoff( - attempt, - retryConfig.initialDelayMs, - retryConfig.maxDelayMs - ) + const delayMs = backoffWithJitter(attempt + 1, null, { + baseMs: retryConfig.initialDelayMs, + maxMs: retryConfig.maxDelayMs, + }) logger.warn( `[${requestId}] Retrying ${toolId} after error (attempt ${attempt + 1}/${maxAttempts})`, { delayMs } @@ -1762,8 +1744,11 @@ async function executeToolRequest( !response.ok && isRetryableFailure(null, response.status) ) { - const retryAfterMs = parseRetryAfterHeader(response.headers.get('retry-after')) - if (retryAfterMs > retryConfig.maxDelayMs) { + const retryAfterMs = parseRetryAfter( + response.headers.get('retry-after'), + Number.POSITIVE_INFINITY + ) + if (retryAfterMs !== null && retryAfterMs > retryConfig.maxDelayMs) { logger.warn( `[${requestId}] Retry-After (${retryAfterMs}ms) exceeds maxDelayMs (${retryConfig.maxDelayMs}ms), skipping retry` ) @@ -1774,12 +1759,10 @@ async function executeToolRequest( } catch { // Ignore errors when consuming body } - const backoffMs = calculateBackoff( - attempt, - retryConfig.initialDelayMs, - retryConfig.maxDelayMs - ) - const delayMs = Math.max(backoffMs, retryAfterMs) + const delayMs = backoffWithJitter(attempt + 1, retryAfterMs, { + baseMs: retryConfig.initialDelayMs, + maxMs: retryConfig.maxDelayMs, + }) logger.warn( `[${requestId}] Retrying ${toolId} after HTTP ${response.status} (attempt ${attempt + 1}/${maxAttempts})`, { delayMs } diff --git a/apps/sim/tools/notion/update_block.ts b/apps/sim/tools/notion/update_block.ts index 52a7cb52e11..4756c851cb1 100644 --- a/apps/sim/tools/notion/update_block.ts +++ b/apps/sim/tools/notion/update_block.ts @@ -1,3 +1,4 @@ +import { isRecordLike } from '@sim/utils/object' import type { NotionUpdateBlockParams } from '@/tools/notion/types' import { BLOCK_OUTPUT_PROPERTIES } from '@/tools/notion/types' import type { ToolConfig } from '@/tools/types' @@ -19,12 +20,12 @@ interface NotionUpdateBlockResponse { function parseBlock(block: Record | string): Record { if (typeof block === 'string') { const parsed = JSON.parse(block) - if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) { + if (!isRecordLike(parsed)) { throw new Error('block must be a JSON object describing the block-type fields to update') } return parsed } - if (typeof block === 'object' && block !== null && !Array.isArray(block)) return block + if (isRecordLike(block)) return block throw new Error('block must be a JSON object describing the block-type fields to update') } diff --git a/apps/sim/triggers/ashby/utils.ts b/apps/sim/triggers/ashby/utils.ts index cc26a224cda..54367de590a 100644 --- a/apps/sim/triggers/ashby/utils.ts +++ b/apps/sim/triggers/ashby/utils.ts @@ -144,6 +144,10 @@ export function buildApplicationSubmitOutputs(): Record { currentInterviewStage: { id: { type: 'string', description: 'Current interview stage UUID' }, title: { type: 'string', description: 'Current interview stage title' }, + stageType: { + type: 'string', + description: 'Current interview stage type (e.g., Lead, Applied, Interview, Offer)', + }, }, job: { id: { type: 'string', description: 'Job UUID' }, @@ -181,6 +185,10 @@ export function buildCandidateStageChangeOutputs(): Record { currentInterviewStage: { id: { type: 'string', description: 'Current interview stage UUID' }, title: { type: 'string', description: 'Current interview stage title' }, + stageType: { + type: 'string', + description: 'Current interview stage type (e.g., Lead, Applied, Interview, Offer)', + }, }, job: { id: { type: 'string', description: 'Job UUID' }, @@ -262,7 +274,7 @@ export function buildJobCreateOutputs(): Record { status: { type: 'string', description: 'Job status (Open, Closed, Draft, Archived)' }, employmentType: { type: 'string', - description: 'Employment type (Full-time, Part-time, etc.)', + description: 'Employment type (FullTime, PartTime, Intern, Contract)', }, }, } as Record @@ -281,13 +293,12 @@ export function buildOfferCreateOutputs(): Record { applicationId: { type: 'string', description: 'Associated application UUID' }, acceptanceStatus: { type: 'string', - description: - 'Offer acceptance status (Accepted, Declined, Pending, Created, Cancelled, WaitingOnResponse)', + description: 'Offer acceptance status (Accepted, Declined, Pending, Created, Cancelled)', }, offerStatus: { type: 'string', description: - 'Offer process status (WaitingOnApprovalStart, WaitingOnOfferApproval, WaitingOnCandidateResponse, CandidateAccepted, CandidateRejected, OfferCancelled)', + 'Offer process status (WaitingOnApprovalStart, WaitingOnOfferApproval, WaitingOnApprovalDefinition, WaitingOnCandidateResponse, CandidateRejected, CandidateAccepted, OfferCancelled)', }, decidedAt: { type: 'string', diff --git a/apps/sim/tsconfig.json b/apps/sim/tsconfig.json index adb44824922..8e6ac20bdf1 100644 --- a/apps/sim/tsconfig.json +++ b/apps/sim/tsconfig.json @@ -1,10 +1,9 @@ { "extends": "@sim/tsconfig/nextjs.json", "compilerOptions": { - "baseUrl": ".", "paths": { "@/*": ["./*"], - "@/components/*": ["components/*"], + "@/components/*": ["./components/*"], "@/lib/*": ["./lib/*"], "@/stores": ["./stores"], "@/stores/*": ["./stores/*"], diff --git a/bun.lock b/bun.lock index b6ab6c68a15..0f9ba9efcf1 100644 --- a/bun.lock +++ b/bun.lock @@ -57,9 +57,10 @@ "@types/node": "^22.14.1", "@types/react": "^19.1.2", "@types/react-dom": "^19.0.4", + "@typescript/native-preview": "7.0.0-dev.20260707.2", "postcss": "^8.5.3", "tailwindcss": "^4.0.12", - "typescript": "^5.8.2", + "typescript": "^7.0.2", }, }, "apps/pii": { @@ -93,7 +94,7 @@ "@sim/tsconfig": "workspace:*", "@types/node": "24.2.1", "socket.io-client": "4.8.1", - "typescript": "^5.7.3", + "typescript": "^7.0.2", "vitest": "^4.1.0", }, }, @@ -127,8 +128,8 @@ "@aws-sdk/s3-request-presigner": "3.1032.0", "@azure/communication-email": "1.0.0", "@azure/storage-blob": "12.27.0", - "@better-auth/sso": "1.6.11", - "@better-auth/stripe": "1.6.11", + "@better-auth/sso": "1.6.13", + "@better-auth/stripe": "1.6.13", "@browserbasehq/stagehand": "^3.2.1", "@calcom/embed-react": "1.5.3", "@cerebras/cerebras_cloud_sdk": "^1.23.0", @@ -192,8 +193,9 @@ "@tiptap/starter-kit": "3.26.1", "@tiptap/suggestion": "3.26.1", "@trigger.dev/sdk": "4.4.3", + "@typescript/typescript6": "^6.0.2", "ajv": "8.18.0", - "better-auth": "1.6.11", + "better-auth": "1.6.13", "binary-extensions": "3.1.0", "browser-image-compression": "^2.0.2", "busboy": "1.6.0", @@ -303,6 +305,7 @@ "@types/react-dom": "^19", "@types/ssh2": "^1.15.5", "@types/three": "0.177.0", + "@typescript/native-preview": "7.0.0-dev.20260707.2", "@vitejs/plugin-react": "^4.3.4", "@vitest/coverage-v8": "^4.1.0", "autoprefixer": "10.4.21", @@ -311,7 +314,7 @@ "postcss": "^8", "react-email": "4.3.2", "tailwindcss": "^3.4.1", - "typescript": "^5.7.3", + "typescript": "^7.0.2", "vite-tsconfig-paths": "^5.1.4", "vitest": "^4.1.0", }, @@ -328,7 +331,8 @@ "devDependencies": { "@sim/testing": "workspace:*", "@sim/tsconfig": "workspace:*", - "typescript": "^5.7.3", + "@types/node": "24.2.1", + "typescript": "^7.0.2", "vitest": "^4.1.0", }, }, @@ -337,11 +341,12 @@ "version": "0.1.0", "dependencies": { "@sim/db": "workspace:*", - "better-auth": "1.6.11", + "better-auth": "1.6.13", }, "devDependencies": { "@sim/tsconfig": "workspace:*", - "typescript": "^5.7.3", + "@types/node": "24.2.1", + "typescript": "^7.0.2", }, }, "packages/cli": { @@ -361,7 +366,7 @@ "@sim/tsconfig": "workspace:*", "@types/inquirer": "^8.2.6", "@types/node": "^20.5.1", - "typescript": "^5.7.3", + "typescript": "^7.0.2", }, }, "packages/db": { @@ -378,7 +383,7 @@ "@sim/tsconfig": "workspace:*", "@types/node": "^22.10.5", "drizzle-kit": "^0.31.4", - "typescript": "^5.7.3", + "typescript": "^7.0.2", }, }, "packages/emcn": { @@ -401,7 +406,7 @@ "prismjs": "^1.30.0", "react": "19.2.4", "react-dom": "19.2.4", - "typescript": "^5.7.3", + "typescript": "^7.0.2", "vitest": "^4.1.0", }, "peerDependencies": { @@ -419,11 +424,13 @@ "name": "@sim/logger", "version": "0.1.0", "dependencies": { + "@sim/utils": "workspace:*", "chalk": "5.6.2", }, "devDependencies": { "@sim/tsconfig": "workspace:*", - "typescript": "^5.7.3", + "@types/node": "24.2.1", + "typescript": "^7.0.2", "vitest": "^4.1.0", }, }, @@ -436,7 +443,8 @@ }, "devDependencies": { "@sim/tsconfig": "workspace:*", - "typescript": "^5.7.3", + "@types/node": "24.2.1", + "typescript": "^7.0.2", }, }, "packages/realtime-protocol": { @@ -447,7 +455,7 @@ }, "devDependencies": { "@sim/tsconfig": "workspace:*", - "typescript": "^5.7.3", + "typescript": "^7.0.2", }, }, "packages/runtime-secrets": { @@ -461,7 +469,7 @@ "devDependencies": { "@sim/tsconfig": "workspace:*", "@types/node": "24.2.1", - "typescript": "^5.7.3", + "typescript": "^7.0.2", "vitest": "^4.1.0", }, }, @@ -471,7 +479,7 @@ "devDependencies": { "@sim/tsconfig": "workspace:*", "@types/node": "24.2.1", - "typescript": "^5.7.3", + "typescript": "^7.0.2", "vitest": "^4.1.0", }, }, @@ -483,7 +491,7 @@ }, "devDependencies": { "@sim/tsconfig": "workspace:*", - "typescript": "^5.7.3", + "typescript": "^7.0.2", "vitest": "^4.1.0", }, "peerDependencies": { @@ -500,7 +508,7 @@ "@sim/tsconfig": "workspace:*", "@types/node": "^20.5.1", "@vitest/coverage-v8": "^4.1.0", - "typescript": "^5.7.3", + "typescript": "^7.0.2", "vitest": "^4.1.0", }, }, @@ -513,7 +521,7 @@ "version": "0.1.0", "devDependencies": { "@sim/tsconfig": "workspace:*", - "typescript": "^5.7.3", + "typescript": "^7.0.2", "vitest": "^4.1.0", }, }, @@ -530,7 +538,8 @@ }, "devDependencies": { "@sim/tsconfig": "workspace:*", - "typescript": "^5.7.3", + "@types/node": "24.2.1", + "typescript": "^7.0.2", }, }, "packages/workflow-renderer": { @@ -546,7 +555,7 @@ "reactflow": "^11.11.4", "remark-breaks": "^4.0.0", "streamdown": "2.5.0", - "typescript": "^5.7.3", + "typescript": "^7.0.2", }, "peerDependencies": { "@sim/emcn": "workspace:*", @@ -564,7 +573,7 @@ "devDependencies": { "@sim/tsconfig": "workspace:*", "reactflow": "^11.11.4", - "typescript": "^5.7.3", + "typescript": "^7.0.2", }, "peerDependencies": { "reactflow": "^11.11.4", @@ -857,25 +866,25 @@ "@bcoe/v8-coverage": ["@bcoe/v8-coverage@1.0.2", "", {}, "sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA=="], - "@better-auth/core": ["@better-auth/core@1.6.11", "", { "dependencies": { "@opentelemetry/semantic-conventions": "^1.39.0", "@standard-schema/spec": "^1.1.0", "zod": "^4.3.6" }, "peerDependencies": { "@better-auth/utils": "0.4.0", "@better-fetch/fetch": "1.1.21", "@cloudflare/workers-types": ">=4", "@opentelemetry/api": "^1.9.0", "better-call": "1.3.5", "jose": "^6.1.0", "kysely": "^0.28.5", "nanostores": "^1.0.1" }, "optionalPeers": ["@cloudflare/workers-types", "@opentelemetry/api"] }, "sha512-LrwidLCV8azdMGjvtwp30nj9tIv1BwI3VhtC0UaGSjQkAVWw4bN42I8qwbxRziPeSQoj+zUVkOpxZzAWBDARtQ=="], + "@better-auth/core": ["@better-auth/core@1.6.13", "", { "dependencies": { "@opentelemetry/semantic-conventions": "^1.39.0", "@standard-schema/spec": "^1.1.0", "zod": "^4.3.6" }, "peerDependencies": { "@better-auth/utils": "0.4.1", "@better-fetch/fetch": "1.1.21", "@cloudflare/workers-types": ">=4", "@opentelemetry/api": "^1.9.0", "better-call": "1.3.5", "jose": "^6.1.0", "kysely": "^0.28.5 || ^0.29.0", "nanostores": "^1.0.1" }, "optionalPeers": ["@cloudflare/workers-types", "@opentelemetry/api"] }, "sha512-3YNjiLUmlNt5T9qQ/weu0tZgGgXDSYax4EE/uLUBIBBGtQI9Q3KdEnO6tfPgDedborcSE1bIspuAIaHpaHwxZQ=="], - "@better-auth/drizzle-adapter": ["@better-auth/drizzle-adapter@1.6.11", "", { "peerDependencies": { "@better-auth/core": "^1.6.11", "@better-auth/utils": "0.4.0", "drizzle-orm": "^0.45.2" }, "optionalPeers": ["drizzle-orm"] }, "sha512-4jpkETIGZOHCf7BK4jnu22fdN6jjomH0/HhEzkaWy3+Eppi5PYlHTF/460jrTmA3Xc+Vqwp9t282ymHiEPypGw=="], + "@better-auth/drizzle-adapter": ["@better-auth/drizzle-adapter@1.6.13", "", { "peerDependencies": { "@better-auth/core": "^1.6.13", "@better-auth/utils": "0.4.1", "drizzle-orm": "^0.45.2" }, "optionalPeers": ["drizzle-orm"] }, "sha512-0V6e+e7TnIZZDjhQP/tvAberSrdrf5yfbDSx5oDFsfI5MCh2ATvbuTPNxGWbLdbGnUYfbX4K9FZwzKMj8RpLmg=="], - "@better-auth/kysely-adapter": ["@better-auth/kysely-adapter@1.6.11", "", { "peerDependencies": { "@better-auth/core": "^1.6.11", "@better-auth/utils": "0.4.0", "kysely": "^0.28.17" }, "optionalPeers": ["kysely"] }, "sha512-/g8M9RfIjdcZDnbstSUvQiINkvdNlCeZr248zwqx2/PVksQI1MhQofbzUn3RnQnbPKp0EPwpX/dR3oudRFenUg=="], + "@better-auth/kysely-adapter": ["@better-auth/kysely-adapter@1.6.13", "", { "peerDependencies": { "@better-auth/core": "^1.6.13", "@better-auth/utils": "0.4.1", "kysely": "^0.28.17 || ^0.29.0" }, "optionalPeers": ["kysely"] }, "sha512-r+TeBL9dJecuCaSMqL3106qwaXYL3GAkoJDfmtbZ2eZ/Ejr9xVj5msJnSULb0ZqyQ1g5SCbnM39WZaCOFirziQ=="], - "@better-auth/memory-adapter": ["@better-auth/memory-adapter@1.6.11", "", { "peerDependencies": { "@better-auth/core": "^1.6.11", "@better-auth/utils": "0.4.0" } }, "sha512-hpdfw0BBf8MuzLkIdmbcUZICbY9r/bhLO2RxSnkzT5+/O+0I0u2I8+m0YUP7vNllP/ZCKASHOYgXPLO75Z0f9Q=="], + "@better-auth/memory-adapter": ["@better-auth/memory-adapter@1.6.13", "", { "peerDependencies": { "@better-auth/core": "^1.6.13", "@better-auth/utils": "0.4.1" } }, "sha512-upmNncEwm9Q0MpWLVOdx9Pe3fU/aqobO80zwI+WVCavxmL59SufW5Ud7194/J5ushw4Dd52XNn0XWPJT1ZUThg=="], - "@better-auth/mongo-adapter": ["@better-auth/mongo-adapter@1.6.11", "", { "peerDependencies": { "@better-auth/core": "^1.6.11", "@better-auth/utils": "0.4.0", "mongodb": "^6.0.0 || ^7.0.0" }, "optionalPeers": ["mongodb"] }, "sha512-3Tor8rSv8vSEIMEaV2PFpPEuVhqc1gNoZ6eGvoh3LwExXXuj8madew6ob+H1pH7Aphn3Ar5PQ08AguT8TbwFAA=="], + "@better-auth/mongo-adapter": ["@better-auth/mongo-adapter@1.6.13", "", { "peerDependencies": { "@better-auth/core": "^1.6.13", "@better-auth/utils": "0.4.1", "mongodb": "^6.0.0 || ^7.0.0" }, "optionalPeers": ["mongodb"] }, "sha512-u0g5KThZQInx4QxsaXDJ+Yg5A9z/ia/3EBwi+gI7+kSTKkeT9PZZ6J+erwJ5Sh4d0JUQsEX2DX2YRsg/mYnXWQ=="], - "@better-auth/prisma-adapter": ["@better-auth/prisma-adapter@1.6.11", "", { "peerDependencies": { "@better-auth/core": "^1.6.11", "@better-auth/utils": "0.4.0", "@prisma/client": "^5.0.0 || ^6.0.0 || ^7.0.0", "prisma": "^5.0.0 || ^6.0.0 || ^7.0.0" }, "optionalPeers": ["@prisma/client", "prisma"] }, "sha512-Pw+7q7zTp+VSci1V+CYMvuxIbAeVMZLe4lRo46LJoAKMHfjFl5T/ycsyFvWs/DkWC7n9gZZzRDEbHp0I5FiKKw=="], + "@better-auth/prisma-adapter": ["@better-auth/prisma-adapter@1.6.13", "", { "peerDependencies": { "@better-auth/core": "^1.6.13", "@better-auth/utils": "0.4.1", "@prisma/client": "^5.0.0 || ^6.0.0 || ^7.0.0", "prisma": "^5.0.0 || ^6.0.0 || ^7.0.0" }, "optionalPeers": ["@prisma/client", "prisma"] }, "sha512-gjmUIdqmxWb4WoNEN5rTQYQli6A9fPopAaVDiLh/gwO3ET10/PuOEwfESePEwUbArlKLLK3hPEWWe0RBojyxgQ=="], - "@better-auth/sso": ["@better-auth/sso@1.6.11", "", { "dependencies": { "fast-xml-parser": "^5.5.7", "jose": "^6.1.3", "samlify": "~2.10.2", "tldts": "^6.1.0", "zod": "^4.3.6" }, "peerDependencies": { "@better-auth/core": "^1.6.11", "@better-auth/utils": "0.4.0", "@better-fetch/fetch": "1.1.21", "better-auth": "^1.6.11", "better-call": "1.3.5" } }, "sha512-lJHmoCayp9Woh/MPKTHDfGq7k1oQbU2yz5tIOZXl/pzrgLxV7fMGo9aJCyabHkw3GHMjBes4byC6aakHYzpZIg=="], + "@better-auth/sso": ["@better-auth/sso@1.6.13", "", { "dependencies": { "fast-xml-parser": "^5.8.0", "jose": "^6.1.3", "samlify": "^2.13.1", "tldts": "^6.1.0", "zod": "^4.3.6" }, "peerDependencies": { "@better-auth/core": "^1.6.13", "@better-auth/utils": "0.4.1", "@better-fetch/fetch": "1.1.21", "better-auth": "^1.6.13", "better-call": "1.3.5" } }, "sha512-GMhdpiYJ4yi1E5BZ32jDAZgT0zboQLqEh9fMQXgxj0OJbMxgW1/nVq5nB45m8HOhdlX0DAhF5yuQpY5df/nLbg=="], - "@better-auth/stripe": ["@better-auth/stripe@1.6.11", "", { "dependencies": { "defu": "^6.1.5", "zod": "^4.3.6" }, "peerDependencies": { "@better-auth/core": "^1.6.11", "better-auth": "^1.6.11", "better-call": "1.3.5", "stripe": "^18 || ^19 || ^20 || ^21 || ^22" } }, "sha512-P1qHlBpJKRP68zhj4ka2W01Dq/4GrbSHbtuY62cqRMQ++CJdYSSg/FvVb7sAEtg3dfjJ06EEmwW6f9n2CoCtPQ=="], + "@better-auth/stripe": ["@better-auth/stripe@1.6.13", "", { "dependencies": { "defu": "^6.1.5", "zod": "^4.3.6" }, "peerDependencies": { "@better-auth/core": "^1.6.13", "better-auth": "^1.6.13", "better-call": "1.3.5", "stripe": "^18 || ^19 || ^20 || ^21 || ^22" } }, "sha512-T++Tki8X+tdHGkGr6SLsq/SKFSMxHunoKT+RPOsGDXoBF8oHch/X6xSOM2y5T7/ztN4Xi/B4e8nfp0/SFG4xnA=="], - "@better-auth/telemetry": ["@better-auth/telemetry@1.6.11", "", { "peerDependencies": { "@better-auth/core": "^1.6.11", "@better-auth/utils": "0.4.0", "@better-fetch/fetch": "1.1.21" } }, "sha512-hsjDHc8MZbm6/AHeNdtywrWedXevnBjmdvnHTcZub+rTVjOv+Td0roI8USKuC6uUibmrl//2rJfVCsGbopihNA=="], + "@better-auth/telemetry": ["@better-auth/telemetry@1.6.13", "", { "peerDependencies": { "@better-auth/core": "^1.6.13", "@better-auth/utils": "0.4.1", "@better-fetch/fetch": "1.1.21" } }, "sha512-CXfPPL55mZrGH1FUhZOw9REp2WRJoVjCh9egn+cIx3ReB/OnPz+eHSRft/IVLD2PQyP1FNr1Au89SXd2oPBUPg=="], - "@better-auth/utils": ["@better-auth/utils@0.4.0", "", { "dependencies": { "@noble/hashes": "^2.0.1" } }, "sha512-RpMtLUIQAEWMgdPLNVbIF5ON2mm+CH0U3rCdUCU1VyeAUui4m38DyK7/aXMLZov2YDjG684pS1D0MBllrmgjQA=="], + "@better-auth/utils": ["@better-auth/utils@0.4.1", "", { "dependencies": { "@noble/hashes": "^2.0.1" } }, "sha512-SZBPRPF3z0nBvE5ygOkxae35wnnXPRShmqFo78S+qslLeFoPu/pMgnXAuNKFMMybac3tiLaVg1e3MQW5MC+1iA=="], "@better-fetch/fetch": ["@better-fetch/fetch@1.1.21", "", {}, "sha512-/ImESw0sskqlVR94jB+5+Pxjf+xBwDZF/N5+y2/q4EqD7IARUTSpPfIo8uf39SYpCxyOCtbyYpUrZ3F/k0zT4A=="], @@ -1931,7 +1940,7 @@ "@types/ms": ["@types/ms@2.1.0", "", {}, "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA=="], - "@types/node": ["@types/node@22.19.21", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-VMeFBSCKQKmm2swI2kW51SFusDqekC6q9trBCvJ/JliDchFSuoYYKN7yVNjPthP1HKZcx3U1gI/wTcEBjEFKTA=="], + "@types/node": ["@types/node@24.2.1", "", { "dependencies": { "undici-types": "~7.10.0" } }, "sha512-DRh5K+ka5eJic8CjH7td8QpYEV6Zo10gfRkjHCO3weqZHWDtAaSTFtl4+VMqOJ4N5jcuhZ9/l+yy8rVgw7BQeQ=="], "@types/node-fetch": ["@types/node-fetch@2.6.13", "", { "dependencies": { "@types/node": "*", "form-data": "^4.0.4" } }, "sha512-QGpRVpzSaUs30JBSGPjOg4Uveu384erbHBoT1zeONvyCfwQxIkUshLAOqN/k9EjGviPRmWTTe6aH2qySWKTVSw=="], @@ -1969,6 +1978,66 @@ "@types/ws": ["@types/ws@8.18.1", "", { "dependencies": { "@types/node": "*" } }, "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg=="], + "@typescript/native-preview": ["@typescript/native-preview@7.0.0-dev.20260707.2", "", { "optionalDependencies": { "@typescript/native-preview-darwin-arm64": "7.0.0-dev.20260707.2", "@typescript/native-preview-darwin-x64": "7.0.0-dev.20260707.2", "@typescript/native-preview-linux-arm": "7.0.0-dev.20260707.2", "@typescript/native-preview-linux-arm64": "7.0.0-dev.20260707.2", "@typescript/native-preview-linux-x64": "7.0.0-dev.20260707.2", "@typescript/native-preview-win32-arm64": "7.0.0-dev.20260707.2", "@typescript/native-preview-win32-x64": "7.0.0-dev.20260707.2" }, "bin": { "tsgo": "bin/tsgo" } }, "sha512-oUGp+Rep/hqMhPunyinsALUwSlzHINSxitifPiSaeqoKOKD2OlR9NE3TaPqwsl4NlGslsOSUXI1JotWQzpYCPg=="], + + "@typescript/native-preview-darwin-arm64": ["@typescript/native-preview-darwin-arm64@7.0.0-dev.20260707.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-wny2pgKjGbiZtnOIHVa3tXC1UfDqxNEFzyPGmiqybedG8hipG2Nfp0l5UxbaKCjkLacUpH/W5bP2hBOMVhCOzg=="], + + "@typescript/native-preview-darwin-x64": ["@typescript/native-preview-darwin-x64@7.0.0-dev.20260707.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-Afc7M5zOwo+GpfcYwz5Z8HMB2tPVsui7nNIqEuuFB73MPdVqNn/Wmpe4tP4MRri0AtJnJknoHBaTJ/VDAp/Jhw=="], + + "@typescript/native-preview-linux-arm": ["@typescript/native-preview-linux-arm@7.0.0-dev.20260707.2", "", { "os": "linux", "cpu": "arm" }, "sha512-hJm/UOqZTr9FHmR7uNm8VGX4oKtfWk0Jem0zPeJFNC8ckGUfSBueyiEYMZB+XmRc1aG4x1E46y3CplP4CLHvGQ=="], + + "@typescript/native-preview-linux-arm64": ["@typescript/native-preview-linux-arm64@7.0.0-dev.20260707.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-iITBa2WjjTI5N9t5l7Z4KoOSI+2zBlhbvFzsD/f8qX8QoKjz/Y4DPyBDgezYi8nkqjjksbgSOJ3/ykzhwrB9cg=="], + + "@typescript/native-preview-linux-x64": ["@typescript/native-preview-linux-x64@7.0.0-dev.20260707.2", "", { "os": "linux", "cpu": "x64" }, "sha512-du0dzi6y97Po5vDNdPJTyyijHCpaS22JLRnKZEJXBDaO9gCIymOv/5QQokFRuOlQm0bWl3i9PF4OVdGP6uAOQA=="], + + "@typescript/native-preview-win32-arm64": ["@typescript/native-preview-win32-arm64@7.0.0-dev.20260707.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-SsAwfhyHJ1akgBc+99z4+hwdbHsdWaKB8EwCNIMA6JfSLMeUjffrYvxu+vfMyxVtOVOz7RrRXRoiDiu4a2sCtg=="], + + "@typescript/native-preview-win32-x64": ["@typescript/native-preview-win32-x64@7.0.0-dev.20260707.2", "", { "os": "win32", "cpu": "x64" }, "sha512-DL4u27stv0fo71sVhOzHSwE+YMZsbBijVI+kg5dLDLilSH79WFTJ8RSQ46vJrCMt+Gjlv/JOZP1PuLJDfioYeQ=="], + + "@typescript/old": ["typescript@6.0.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw=="], + + "@typescript/typescript-aix-ppc64": ["@typescript/typescript-aix-ppc64@7.0.2", "", { "os": "aix", "cpu": "ppc64" }, "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ=="], + + "@typescript/typescript-darwin-arm64": ["@typescript/typescript-darwin-arm64@7.0.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA=="], + + "@typescript/typescript-darwin-x64": ["@typescript/typescript-darwin-x64@7.0.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA=="], + + "@typescript/typescript-freebsd-arm64": ["@typescript/typescript-freebsd-arm64@7.0.2", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ=="], + + "@typescript/typescript-freebsd-x64": ["@typescript/typescript-freebsd-x64@7.0.2", "", { "os": "freebsd", "cpu": "x64" }, "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw=="], + + "@typescript/typescript-linux-arm": ["@typescript/typescript-linux-arm@7.0.2", "", { "os": "linux", "cpu": "arm" }, "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ=="], + + "@typescript/typescript-linux-arm64": ["@typescript/typescript-linux-arm64@7.0.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ=="], + + "@typescript/typescript-linux-loong64": ["@typescript/typescript-linux-loong64@7.0.2", "", { "os": "linux", "cpu": "none" }, "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ=="], + + "@typescript/typescript-linux-mips64el": ["@typescript/typescript-linux-mips64el@7.0.2", "", { "os": "linux", "cpu": "none" }, "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA=="], + + "@typescript/typescript-linux-ppc64": ["@typescript/typescript-linux-ppc64@7.0.2", "", { "os": "linux", "cpu": "ppc64" }, "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA=="], + + "@typescript/typescript-linux-riscv64": ["@typescript/typescript-linux-riscv64@7.0.2", "", { "os": "linux", "cpu": "none" }, "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ=="], + + "@typescript/typescript-linux-s390x": ["@typescript/typescript-linux-s390x@7.0.2", "", { "os": "linux", "cpu": "s390x" }, "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw=="], + + "@typescript/typescript-linux-x64": ["@typescript/typescript-linux-x64@7.0.2", "", { "os": "linux", "cpu": "x64" }, "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A=="], + + "@typescript/typescript-netbsd-arm64": ["@typescript/typescript-netbsd-arm64@7.0.2", "", { "os": "none", "cpu": "arm64" }, "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA=="], + + "@typescript/typescript-netbsd-x64": ["@typescript/typescript-netbsd-x64@7.0.2", "", { "os": "none", "cpu": "x64" }, "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA=="], + + "@typescript/typescript-openbsd-arm64": ["@typescript/typescript-openbsd-arm64@7.0.2", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ=="], + + "@typescript/typescript-openbsd-x64": ["@typescript/typescript-openbsd-x64@7.0.2", "", { "os": "openbsd", "cpu": "x64" }, "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg=="], + + "@typescript/typescript-sunos-x64": ["@typescript/typescript-sunos-x64@7.0.2", "", { "os": "sunos", "cpu": "x64" }, "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g=="], + + "@typescript/typescript-win32-arm64": ["@typescript/typescript-win32-arm64@7.0.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ=="], + + "@typescript/typescript-win32-x64": ["@typescript/typescript-win32-x64@7.0.2", "", { "os": "win32", "cpu": "x64" }, "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g=="], + + "@typescript/typescript6": ["@typescript/typescript6@6.0.2", "", { "dependencies": { "@typescript/old": "npm:typescript@^6" }, "bin": { "tsc6": "bin/tsc6" } }, "sha512-mbCddXd+jm7hfx7w2YU64/Av4/NqqeG3GoRZgxPcgoTxYjhrcfJRw9ULch71SS4G+Q3bOXFhRvPqjguN0Hyp5w=="], + "@typespec/ts-http-runtime": ["@typespec/ts-http-runtime@0.3.6", "", { "dependencies": { "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.0", "tslib": "^2.6.2" } }, "sha512-jIXhD0eWQ1JA6ln/5Dltyx22UxWNrw0hZmhy2rlv6m6KgF7kplHx3g0fzi09lNmTJQRR91OlemYp3xFnvDK9og=="], "@ungap/structured-clone": ["@ungap/structured-clone@1.3.1", "", {}, "sha512-mUFwbeTqrVgDQxFveS+df2yfap6iuP20NAKAsBt5jDEoOTDew+zwLAOilHCeQJOVSvmgCX4ogqIrA0mnyr08yQ=="], @@ -2085,7 +2154,7 @@ "before-after-hook": ["before-after-hook@3.0.2", "", {}, "sha512-Nik3Sc0ncrMK4UUdXQmAnRtzmNQTAAXmXIopizwZ1W1t8QmfJj+zL4OA2I7XPTPW5z5TDqv4hRo/JzouDJnX3A=="], - "better-auth": ["better-auth@1.6.11", "", { "dependencies": { "@better-auth/core": "1.6.11", "@better-auth/drizzle-adapter": "1.6.11", "@better-auth/kysely-adapter": "1.6.11", "@better-auth/memory-adapter": "1.6.11", "@better-auth/mongo-adapter": "1.6.11", "@better-auth/prisma-adapter": "1.6.11", "@better-auth/telemetry": "1.6.11", "@better-auth/utils": "0.4.0", "@better-fetch/fetch": "1.1.21", "@noble/ciphers": "^2.1.1", "@noble/hashes": "^2.0.1", "better-call": "1.3.5", "defu": "^6.1.4", "jose": "^6.1.3", "kysely": "^0.28.17", "nanostores": "^1.1.1", "zod": "^4.3.6" }, "peerDependencies": { "@lynx-js/react": "*", "@prisma/client": "^5.0.0 || ^6.0.0 || ^7.0.0", "@sveltejs/kit": "^2.0.0", "@tanstack/react-start": "^1.0.0", "@tanstack/solid-start": "^1.0.0", "better-sqlite3": "^12.0.0", "drizzle-kit": ">=0.31.4", "drizzle-orm": "^0.45.2", "mongodb": "^6.0.0 || ^7.0.0", "mysql2": "^3.0.0", "next": "^14.0.0 || ^15.0.0 || ^16.0.0", "pg": "^8.0.0", "prisma": "^5.0.0 || ^6.0.0 || ^7.0.0", "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0", "solid-js": "^1.0.0", "svelte": "^4.0.0 || ^5.0.0", "vitest": "^2.0.0 || ^3.0.0 || ^4.0.0", "vue": "^3.0.0" }, "optionalPeers": ["@lynx-js/react", "@prisma/client", "@sveltejs/kit", "@tanstack/react-start", "@tanstack/solid-start", "better-sqlite3", "drizzle-kit", "drizzle-orm", "mongodb", "mysql2", "next", "pg", "prisma", "react", "react-dom", "solid-js", "svelte", "vitest", "vue"] }, "sha512-Wwt6+q07dwIhsp6XiM7L1qSXVUWBEtNl+eZvwM778CguFqDZFBN9Pt6LtFaHl55t8Z+Zc//5kxcbgDY8/79vFQ=="], + "better-auth": ["better-auth@1.6.13", "", { "dependencies": { "@better-auth/core": "1.6.13", "@better-auth/drizzle-adapter": "1.6.13", "@better-auth/kysely-adapter": "1.6.13", "@better-auth/memory-adapter": "1.6.13", "@better-auth/mongo-adapter": "1.6.13", "@better-auth/prisma-adapter": "1.6.13", "@better-auth/telemetry": "1.6.13", "@better-auth/utils": "0.4.1", "@better-fetch/fetch": "1.1.21", "@noble/ciphers": "^2.1.1", "@noble/hashes": "^2.0.1", "better-call": "1.3.5", "defu": "^6.1.4", "jose": "^6.1.3", "kysely": "^0.28.17 || ^0.29.0", "nanostores": "^1.1.1", "zod": "^4.3.6" }, "peerDependencies": { "@lynx-js/react": "*", "@prisma/client": "^5.0.0 || ^6.0.0 || ^7.0.0", "@sveltejs/kit": "^2.0.0", "@tanstack/react-start": "^1.0.0", "@tanstack/solid-start": "^1.0.0", "better-sqlite3": "^12.0.0", "drizzle-kit": ">=0.31.4", "drizzle-orm": "^0.45.2", "mongodb": "^6.0.0 || ^7.0.0", "mysql2": "^3.0.0", "next": "^14.0.0 || ^15.0.0 || ^16.0.0", "pg": "^8.0.0", "prisma": "^5.0.0 || ^6.0.0 || ^7.0.0", "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0", "solid-js": "^1.0.0", "svelte": "^4.0.0 || ^5.0.0", "vitest": "^2.0.0 || ^3.0.0 || ^4.0.0", "vue": "^3.0.0" }, "optionalPeers": ["@lynx-js/react", "@prisma/client", "@sveltejs/kit", "@tanstack/react-start", "@tanstack/solid-start", "better-sqlite3", "drizzle-kit", "drizzle-orm", "mongodb", "mysql2", "next", "pg", "prisma", "react", "react-dom", "solid-js", "svelte", "vitest", "vue"] }, "sha512-jn8ATnGWDzMwpO4a/3iyW1/RayOF/aoPQOfAeqyCVnQCdqkaONVas9CjbY6PovMsTMa/MG+GRABySfzqtj5J/g=="], "better-call": ["better-call@1.3.5", "", { "dependencies": { "@better-auth/utils": "^0.4.0", "@better-fetch/fetch": "^1.1.21", "rou3": "^0.7.12", "set-cookie-parser": "^3.0.1" }, "peerDependencies": { "zod": "^4.0.0" }, "optionalPeers": ["zod"] }, "sha512-kOFJkBP7utAQLEYrobZm3vkTH8mXq5GNgvjc5/XEST1ilVHaxXUXfeDeFlqoETMtyqS4+3/h4ONX2i++ebZrvA=="], @@ -2135,8 +2204,6 @@ "call-bound": ["call-bound@1.0.4", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" } }, "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg=="], - "camelcase": ["camelcase@6.3.0", "", {}, "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA=="], - "camelcase-css": ["camelcase-css@2.0.1", "", {}, "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA=="], "camelize": ["camelize@1.0.1", "", {}, "sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ=="], @@ -3231,8 +3298,6 @@ "node-fetch-native": ["node-fetch-native@1.6.7", "", {}, "sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q=="], - "node-forge": ["node-forge@1.4.0", "", {}, "sha512-LarFH0+6VfriEhqMMcLX2F7SwSXeWwnEAJEsYm5QKWchiVYVvJyV9v7UDvUv+w5HO23ZpQTXDv/GxdDdMyOuoQ=="], - "node-gyp-build": ["node-gyp-build@4.8.4", "", { "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", "node-gyp-build-test": "build-test.js" } }, "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ=="], "node-releases": ["node-releases@2.0.47", "", {}, "sha512-Uzmd6LXpouKo8EUK68IjH4+E01w/hXyV3R3g/geCJo+rXLNfh1xucB+LOzYEOQPSiUK3h/xZf0cQGcSsmyL2Og=="], @@ -3625,7 +3690,7 @@ "safer-buffer": ["safer-buffer@2.1.2", "", {}, "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="], - "samlify": ["samlify@2.10.2", "", { "dependencies": { "@authenio/xml-encryption": "^2.0.2", "@xmldom/xmldom": "^0.8.6", "camelcase": "^6.2.0", "node-forge": "^1.3.0", "node-rsa": "^1.1.1", "pako": "^1.0.10", "uuid": "^8.3.2", "xml": "^1.0.1", "xml-crypto": "^6.1.2", "xml-escape": "^1.1.0", "xpath": "^0.0.32" } }, "sha512-y5s1cHwclqwP8h7K2Wj9SfP1q+1S9+jrs5OAegYTLAiuFi7nDvuKqbiXLmUTvYPMpzHcX94wTY2+D604jgTKvA=="], + "samlify": ["samlify@2.13.1", "", { "dependencies": { "@authenio/xml-encryption": "^2.0.2", "@xmldom/xmldom": "^0.8.11", "node-rsa": "^1.1.1", "xml": "^1.0.1", "xml-crypto": "^6.1.2", "xml-escape": "^1.1.0", "xpath": "^0.0.34" } }, "sha512-vdYr/zohDGBbfWNU4miEzc1jmWOtkLySPViapC6nfGkv9KxzLq4UlGkKyryzwLw4jVlZk88Rw93HaCRVpe+t+g=="], "satori": ["satori@0.12.2", "", { "dependencies": { "@shuding/opentype.js": "1.4.0-beta.0", "css-background-parser": "^0.1.0", "css-box-shadow": "1.0.0-3", "css-gradient-parser": "^0.0.16", "css-to-react-native": "^3.0.0", "emoji-regex": "^10.2.1", "escape-html": "^1.0.3", "linebreak": "^1.1.0", "parse-css-color": "^0.2.1", "postcss-value-parser": "^4.2.0", "yoga-wasm-web": "^0.3.3" } }, "sha512-3C/laIeE6UUe9A+iQ0A48ywPVCCMKCNSTU5Os101Vhgsjd3AAxGNjyq0uAA8kulMPK5n0csn8JlxPN9riXEjLA=="], @@ -3891,7 +3956,7 @@ "typedarray": ["typedarray@0.0.6", "", {}, "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA=="], - "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], + "typescript": ["typescript@7.0.2", "", { "optionalDependencies": { "@typescript/typescript-aix-ppc64": "7.0.2", "@typescript/typescript-darwin-arm64": "7.0.2", "@typescript/typescript-darwin-x64": "7.0.2", "@typescript/typescript-freebsd-arm64": "7.0.2", "@typescript/typescript-freebsd-x64": "7.0.2", "@typescript/typescript-linux-arm": "7.0.2", "@typescript/typescript-linux-arm64": "7.0.2", "@typescript/typescript-linux-loong64": "7.0.2", "@typescript/typescript-linux-mips64el": "7.0.2", "@typescript/typescript-linux-ppc64": "7.0.2", "@typescript/typescript-linux-riscv64": "7.0.2", "@typescript/typescript-linux-s390x": "7.0.2", "@typescript/typescript-linux-x64": "7.0.2", "@typescript/typescript-netbsd-arm64": "7.0.2", "@typescript/typescript-netbsd-x64": "7.0.2", "@typescript/typescript-openbsd-arm64": "7.0.2", "@typescript/typescript-openbsd-x64": "7.0.2", "@typescript/typescript-sunos-x64": "7.0.2", "@typescript/typescript-win32-arm64": "7.0.2", "@typescript/typescript-win32-x64": "7.0.2" }, "bin": { "tsc": "bin/tsc" } }, "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA=="], "ufo": ["ufo@1.6.4", "", {}, "sha512-JFNbkD1Svwe0KvGi8GOeLcP4kAWQ609twvCdcHxq1oSL8svv39ZuSvajcD8B+5D0eL4+s1Is2D/O6KN3qcTeRA=="], @@ -3905,7 +3970,7 @@ "undici": ["undici@7.28.0", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="], - "undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="], + "undici-types": ["undici-types@7.10.0", "", {}, "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag=="], "unfetch": ["unfetch@4.2.0", "", {}, "sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA=="], @@ -4025,7 +4090,7 @@ "xmlhttprequest-ssl": ["xmlhttprequest-ssl@2.1.2", "", {}, "sha512-TEU+nJVUUnA4CYJFLvK5X9AOeH4KvDvhIfm0vV1GaQRtchnG0hgK5p8hw/xjv8cunWYCsiPCSDzObPyhEwq3KQ=="], - "xpath": ["xpath@0.0.32", "", {}, "sha512-rxMJhSIoiO8vXcWvSifKqhvV96GjiD5wYb8/QHdoRyQvraTpp4IEv944nhGausZZ3u7dhQXteZuZbaqfpB7uYw=="], + "xpath": ["xpath@0.0.34", "", {}, "sha512-FxF6+rkr1rNSQrhUNYrAFJpRXNzlDoMxeXN5qI84939ylEv3qqPFKa85Oxr6tDaJKqwW6KKyo2v26TSv3k6LeA=="], "y18n": ["y18n@5.0.8", "", {}, "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="], @@ -4061,6 +4126,8 @@ "@asamuzakjp/css-color/lru-cache": ["lru-cache@10.4.3", "", {}, "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="], + "@authenio/xml-encryption/xpath": ["xpath@0.0.32", "", {}, "sha512-rxMJhSIoiO8vXcWvSifKqhvV96GjiD5wYb8/QHdoRyQvraTpp4IEv944nhGausZZ3u7dhQXteZuZbaqfpB7uYw=="], + "@aws-crypto/sha1-browser/@smithy/util-utf8": ["@smithy/util-utf8@2.3.0", "", { "dependencies": { "@smithy/util-buffer-from": "^2.2.0", "tslib": "^2.6.2" } }, "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A=="], "@aws-crypto/sha256-browser/@smithy/util-utf8": ["@smithy/util-utf8@2.3.0", "", { "dependencies": { "@smithy/util-buffer-from": "^2.2.0", "tslib": "^2.6.2" } }, "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A=="], @@ -4351,11 +4418,7 @@ "@shuding/opentype.js/fflate": ["fflate@0.7.4", "", {}, "sha512-5u2V/CDW15QM1XbbgS+0DfPxVB+jUKhWEKuuFuHncbk3tEEqzmoXL+2KyOFuKGqOnmdIy0/davWF1CkuwtibCw=="], - "@sim/realtime/@types/node": ["@types/node@24.2.1", "", { "dependencies": { "undici-types": "~7.10.0" } }, "sha512-DRh5K+ka5eJic8CjH7td8QpYEV6Zo10gfRkjHCO3weqZHWDtAaSTFtl4+VMqOJ4N5jcuhZ9/l+yy8rVgw7BQeQ=="], - - "@sim/runtime-secrets/@types/node": ["@types/node@24.2.1", "", { "dependencies": { "undici-types": "~7.10.0" } }, "sha512-DRh5K+ka5eJic8CjH7td8QpYEV6Zo10gfRkjHCO3weqZHWDtAaSTFtl4+VMqOJ4N5jcuhZ9/l+yy8rVgw7BQeQ=="], - - "@sim/security/@types/node": ["@types/node@24.2.1", "", { "dependencies": { "undici-types": "~7.10.0" } }, "sha512-DRh5K+ka5eJic8CjH7td8QpYEV6Zo10gfRkjHCO3weqZHWDtAaSTFtl4+VMqOJ4N5jcuhZ9/l+yy8rVgw7BQeQ=="], + "@sim/db/@types/node": ["@types/node@22.19.21", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-VMeFBSCKQKmm2swI2kW51SFusDqekC6q9trBCvJ/JliDchFSuoYYKN7yVNjPthP1HKZcx3U1gI/wTcEBjEFKTA=="], "@smithy/middleware-compression/fflate": ["fflate@0.8.1", "", {}, "sha512-/exOvEuc+/iaUm105QIiOt4LpBdMTWsXxqR0HDF35vx3fmaKzw7354gTilCh5rkzEt8WYyG//ku3h3nRmd7CHQ=="], @@ -4423,14 +4486,8 @@ "@trigger.dev/sdk/uuid": ["uuid@9.0.1", "", { "bin": { "uuid": "dist/bin/uuid" } }, "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA=="], - "@types/busboy/@types/node": ["@types/node@24.2.1", "", { "dependencies": { "undici-types": "~7.10.0" } }, "sha512-DRh5K+ka5eJic8CjH7td8QpYEV6Zo10gfRkjHCO3weqZHWDtAaSTFtl4+VMqOJ4N5jcuhZ9/l+yy8rVgw7BQeQ=="], - "@types/cors/@types/node": ["@types/node@25.9.3", "", { "dependencies": { "undici-types": ">=7.24.0 <7.24.7" } }, "sha512-603BddQMv3pUcr4U2dhujk83N2tTDVr/34wII2B6bJy6g+8WD6yUb11jszNs0gdi4PesVWl7ABt8nYMVpnLUcg=="], - "@types/fluent-ffmpeg/@types/node": ["@types/node@24.2.1", "", { "dependencies": { "undici-types": "~7.10.0" } }, "sha512-DRh5K+ka5eJic8CjH7td8QpYEV6Zo10gfRkjHCO3weqZHWDtAaSTFtl4+VMqOJ4N5jcuhZ9/l+yy8rVgw7BQeQ=="], - - "@types/jsdom/@types/node": ["@types/node@24.2.1", "", { "dependencies": { "undici-types": "~7.10.0" } }, "sha512-DRh5K+ka5eJic8CjH7td8QpYEV6Zo10gfRkjHCO3weqZHWDtAaSTFtl4+VMqOJ4N5jcuhZ9/l+yy8rVgw7BQeQ=="], - "@types/node-fetch/@types/node": ["@types/node@25.9.3", "", { "dependencies": { "undici-types": ">=7.24.0 <7.24.7" } }, "sha512-603BddQMv3pUcr4U2dhujk83N2tTDVr/34wII2B6bJy6g+8WD6yUb11jszNs0gdi4PesVWl7ABt8nYMVpnLUcg=="], "@types/nodemailer/@types/node": ["@types/node@25.9.3", "", { "dependencies": { "undici-types": ">=7.24.0 <7.24.7" } }, "sha512-603BddQMv3pUcr4U2dhujk83N2tTDVr/34wII2B6bJy6g+8WD6yUb11jszNs0gdi4PesVWl7ABt8nYMVpnLUcg=="], @@ -4453,6 +4510,8 @@ "better-auth/jose": ["jose@6.2.3", "", {}, "sha512-YYVDInQKFJfR/xa3ojUTl8c2KoTwiL1R5Wg9YCydwH0x0B9grbzlg5HC7mMjCtUJjbQ/YnGEZIhI5tCgfTb4Hw=="], + "better-call/@better-auth/utils": ["@better-auth/utils@0.4.0", "", { "dependencies": { "@noble/hashes": "^2.0.1" } }, "sha512-RpMtLUIQAEWMgdPLNVbIF5ON2mm+CH0U3rCdUCU1VyeAUui4m38DyK7/aXMLZov2YDjG684pS1D0MBllrmgjQA=="], + "bl/buffer": ["buffer@5.7.1", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" } }, "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ=="], "bl/readable-stream": ["readable-stream@3.6.2", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="], @@ -4495,6 +4554,8 @@ "d3-sankey/d3-shape": ["d3-shape@1.3.7", "", { "dependencies": { "d3-path": "1" } }, "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw=="], + "docs/@types/node": ["@types/node@22.19.21", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-VMeFBSCKQKmm2swI2kW51SFusDqekC6q9trBCvJ/JliDchFSuoYYKN7yVNjPthP1HKZcx3U1gI/wTcEBjEFKTA=="], + "docs/lucide-react": ["lucide-react@0.511.0", "", { "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-VK5a2ydJ7xm8GvBeKLS9mu1pVK6ucef9780JVUjw6bAjJL/QXnd4Y0p7SPeOUMC27YhzNCZvm5d/QX0Tp3rc0w=="], "docs/tailwind-merge": ["tailwind-merge@3.6.0", "", {}, "sha512-uxL7qAVQriqRQPAyK3pj66VqskWqoZ37PW94jwOTwNfq/z9oyu1V+eqrZqtR2+fCiXdYOZe/Modt8GtvqNzu+w=="], @@ -4673,6 +4734,8 @@ "posthog-js/fflate": ["fflate@0.4.8", "", {}, "sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA=="], + "pptxgenjs/@types/node": ["@types/node@22.19.21", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-VMeFBSCKQKmm2swI2kW51SFusDqekC6q9trBCvJ/JliDchFSuoYYKN7yVNjPthP1HKZcx3U1gI/wTcEBjEFKTA=="], + "protobufjs/@types/node": ["@types/node@25.9.3", "", { "dependencies": { "undici-types": ">=7.24.0 <7.24.7" } }, "sha512-603BddQMv3pUcr4U2dhujk83N2tTDVr/34wII2B6bJy6g+8WD6yUb11jszNs0gdi4PesVWl7ABt8nYMVpnLUcg=="], "proxy-addr/ipaddr.js": ["ipaddr.js@1.9.1", "", {}, "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="], @@ -4699,12 +4762,8 @@ "rolldown/@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.1", "", {}, "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw=="], - "samlify/uuid": ["uuid@8.3.2", "", { "bin": { "uuid": "dist/bin/uuid" } }, "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="], - "sharp/semver": ["semver@7.8.4", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-rUCObTnP32Q08R2uuIrt7r9PlEonuTmtuXYcW6s5kjdlj3xbnwe+21yXptAUYcMAABLkYYTtnmzb3w3EDZfueA=="], - "sim/@types/node": ["@types/node@24.2.1", "", { "dependencies": { "undici-types": "~7.10.0" } }, "sha512-DRh5K+ka5eJic8CjH7td8QpYEV6Zo10gfRkjHCO3weqZHWDtAaSTFtl4+VMqOJ4N5jcuhZ9/l+yy8rVgw7BQeQ=="], - "sim/tailwindcss": ["tailwindcss@3.4.19", "", { "dependencies": { "@alloc/quick-lru": "^5.2.0", "arg": "^5.0.2", "chokidar": "^3.6.0", "didyoumean": "^1.2.2", "dlv": "^1.1.3", "fast-glob": "^3.3.2", "glob-parent": "^6.0.2", "is-glob": "^4.0.3", "jiti": "^1.21.7", "lilconfig": "^3.1.3", "micromatch": "^4.0.8", "normalize-path": "^3.0.0", "object-hash": "^3.0.0", "picocolors": "^1.1.1", "postcss": "^8.4.47", "postcss-import": "^15.1.0", "postcss-js": "^4.0.1", "postcss-load-config": "^4.0.2 || ^5.0 || ^6.0", "postcss-nested": "^6.2.0", "postcss-selector-parser": "^6.1.2", "resolve": "^1.22.8", "sucrase": "^3.35.0" }, "bin": { "tailwind": "lib/cli.js", "tailwindcss": "lib/cli.js" } }, "sha512-3ofp+LL8E+pK/JuPLPggVAIaEuhvIz4qNcf3nA1Xn2o/7fb7s/TYpHhwGDv1ZU3PkBluUVaF8PyCHcm48cKLWQ=="], "simstudio/@types/node": ["@types/node@20.19.43", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA=="], @@ -4741,6 +4800,8 @@ "tough-cookie/tldts": ["tldts@6.1.86", "", { "dependencies": { "tldts-core": "^6.1.86" }, "bin": { "tldts": "bin/cli.js" } }, "sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ=="], + "tsconfck/typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], + "tsx/esbuild": ["esbuild@0.28.1", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.28.1", "@esbuild/android-arm": "0.28.1", "@esbuild/android-arm64": "0.28.1", "@esbuild/android-x64": "0.28.1", "@esbuild/darwin-arm64": "0.28.1", "@esbuild/darwin-x64": "0.28.1", "@esbuild/freebsd-arm64": "0.28.1", "@esbuild/freebsd-x64": "0.28.1", "@esbuild/linux-arm": "0.28.1", "@esbuild/linux-arm64": "0.28.1", "@esbuild/linux-ia32": "0.28.1", "@esbuild/linux-loong64": "0.28.1", "@esbuild/linux-mips64el": "0.28.1", "@esbuild/linux-ppc64": "0.28.1", "@esbuild/linux-riscv64": "0.28.1", "@esbuild/linux-s390x": "0.28.1", "@esbuild/linux-x64": "0.28.1", "@esbuild/netbsd-arm64": "0.28.1", "@esbuild/netbsd-x64": "0.28.1", "@esbuild/openbsd-arm64": "0.28.1", "@esbuild/openbsd-x64": "0.28.1", "@esbuild/openharmony-arm64": "0.28.1", "@esbuild/sunos-x64": "0.28.1", "@esbuild/win32-arm64": "0.28.1", "@esbuild/win32-ia32": "0.28.1", "@esbuild/win32-x64": "0.28.1" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw=="], "twilio/https-proxy-agent": ["https-proxy-agent@5.0.1", "", { "dependencies": { "agent-base": "6", "debug": "4" } }, "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA=="], @@ -4873,11 +4934,7 @@ "@radix-ui/react-visually-hidden/@radix-ui/react-primitive/@radix-ui/react-slot": ["@radix-ui/react-slot@1.3.0", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.3" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-MojKku4U/miO8Av4Dkb+ctMAQx7JmY96LmtDQlAarCRtd7rN52QCSzBF+XAvr5S6coSVj9HEPBgHAHKEJVk/WA=="], - "@sim/realtime/@types/node/undici-types": ["undici-types@7.10.0", "", {}, "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag=="], - - "@sim/runtime-secrets/@types/node/undici-types": ["undici-types@7.10.0", "", {}, "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag=="], - - "@sim/security/@types/node/undici-types": ["undici-types@7.10.0", "", {}, "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag=="], + "@sim/db/@types/node/undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="], "@trigger.dev/core/@opentelemetry/api-logs/@opentelemetry/api": ["@opentelemetry/api@1.9.1", "", {}, "sha512-gLyJlPHPZYdAk1JENA9LeHejZe1Ti77/pTeFm/nMXmQH/HFZlcS/O2XJB+L8fkbrNSqhdtlvjBVjxwUYanNH5Q=="], @@ -4913,14 +4970,8 @@ "@trigger.dev/core/socket.io-client/engine.io-client": ["engine.io-client@6.5.4", "", { "dependencies": { "@socket.io/component-emitter": "~3.1.0", "debug": "~4.3.1", "engine.io-parser": "~5.2.1", "ws": "~8.17.1", "xmlhttprequest-ssl": "~2.0.0" } }, "sha512-GeZeeRjpD2qf49cZQ0Wvh/8NJNfeXkXXcoGh+F77oEAgo9gUHwT1fCRxSNU+YEEaysOJTnsFHmM5oAcPy4ntvQ=="], - "@types/busboy/@types/node/undici-types": ["undici-types@7.10.0", "", {}, "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag=="], - "@types/cors/@types/node/undici-types": ["undici-types@7.24.6", "", {}, "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg=="], - "@types/fluent-ffmpeg/@types/node/undici-types": ["undici-types@7.10.0", "", {}, "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag=="], - - "@types/jsdom/@types/node/undici-types": ["undici-types@7.10.0", "", {}, "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag=="], - "@types/node-fetch/@types/node/undici-types": ["undici-types@7.24.6", "", {}, "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg=="], "@types/nodemailer/@types/node/undici-types": ["undici-types@7.24.6", "", {}, "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg=="], @@ -4957,6 +5008,8 @@ "d3-sankey/d3-shape/d3-path": ["d3-path@1.0.9", "", {}, "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg=="], + "docs/@types/node/undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="], + "docx/@types/node/undici-types": ["undici-types@7.24.6", "", {}, "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg=="], "engine.io/@types/node/undici-types": ["undici-types@7.24.6", "", {}, "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg=="], @@ -5159,6 +5212,8 @@ "posthog-js/@opentelemetry/sdk-logs/@opentelemetry/resources": ["@opentelemetry/resources@2.2.0", "", { "dependencies": { "@opentelemetry/core": "2.2.0", "@opentelemetry/semantic-conventions": "^1.29.0" }, "peerDependencies": { "@opentelemetry/api": ">=1.3.0 <1.10.0" } }, "sha512-1pNQf/JazQTMA0BiO5NINUzH0cbLbbl7mntLa4aJNmCCXSj0q03T5ZXXL0zw4G55TjdL9Tz32cznGClf+8zr5A=="], + "pptxgenjs/@types/node/undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="], + "protobufjs/@types/node/undici-types": ["undici-types@7.24.6", "", {}, "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg=="], "react-email/chokidar/readdirp": ["readdirp@4.1.2", "", {}, "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg=="], @@ -5171,14 +5226,16 @@ "rimraf/glob/path-scurry": ["path-scurry@1.11.1", "", { "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" } }, "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA=="], - "sim/@types/node/undici-types": ["undici-types@7.10.0", "", {}, "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag=="], - "sim/tailwindcss/chokidar": ["chokidar@3.6.0", "", { "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" }, "optionalDependencies": { "fsevents": "~2.3.2" } }, "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw=="], "sim/tailwindcss/jiti": ["jiti@1.21.7", "", { "bin": { "jiti": "bin/jiti.js" } }, "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A=="], "sim/tailwindcss/postcss-selector-parser": ["postcss-selector-parser@6.1.4", "", { "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" } }, "sha512-bIoJLOmjCO1S9XdY/DcnR5hJxvrDir1PbGChrzXG3vw0/FOliy/fA3dmdhQ441kah4gKv+TwckGzex6wNS5cnQ=="], + "simstudio-ts-sdk/@types/node/undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="], + + "simstudio/@types/node/undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="], + "tar-stream/readable-stream/string_decoder": ["string_decoder@1.3.0", "", { "dependencies": { "safe-buffer": "~5.2.0" } }, "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA=="], "tough-cookie/tldts/tldts-core": ["tldts-core@6.1.86", "", {}, "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA=="], diff --git a/bunfig.toml b/bunfig.toml index b74c34f6800..27722f016f1 100644 --- a/bunfig.toml +++ b/bunfig.toml @@ -1,6 +1,6 @@ [install] exact = true -minimumReleaseAge = 604800 +minimumReleaseAge = 0 [run] env = { NEXT_PUBLIC_APP_URL = "http://localhost:3000" } diff --git a/docker/pii.Dockerfile b/docker/pii.Dockerfile index 29cb5185ea4..5d0fedb542c 100644 --- a/docker/pii.Dockerfile +++ b/docker/pii.Dockerfile @@ -1,5 +1,17 @@ # ======================================== # Combined Presidio service (analyzer + anonymizer) on a single port (5001) +# +# ONE image serves both NER engines — the engine is a pure runtime choice via +# PII_ENGINE (spacy default | gliner). spaCy large models, torch (CPU), the +# gliner package, and the baked GLiNER weights all ship in it, so flipping +# engines never requires an image swap. +# +# GPU variant (EC2-GPU fleet follow-up): same Dockerfile, CUDA torch wheels — +# docker build --build-arg TORCH_INDEX_URL=https://download.pytorch.org/whl/cu128 ... +# (torch CUDA wheels bundle their own CUDA libs; the host only needs the +# nvidia container runtime.) +# +# Source files are COPY'd last so code edits never re-download deps or models. # ======================================== FROM python:3.12-slim-bookworm AS base @@ -31,11 +43,55 @@ RUN --mount=type=cache,target=/root/.cache/pip \ pip install /tmp/*.whl && \ rm /tmp/*.whl -COPY apps/pii/server.py ./server.py +# --- GLiNER engine deps ------------------------------------------------------- +# torch is pinned here (not requirements-gliner.txt) because the CPU and CUDA +# builds install the same version from different wheel indexes. 2.11.0 is the +# newest release published on both the cpu and cu128 indexes for py312. +ARG TORCH_VERSION=2.11.0 +ARG TORCH_INDEX_URL=https://download.pytorch.org/whl/cpu +RUN --mount=type=cache,target=/root/.cache/pip \ + pip install torch==${TORCH_VERSION} --index-url ${TORCH_INDEX_URL} + +COPY apps/pii/requirements-gliner.txt ./requirements-gliner.txt +RUN --mount=type=cache,target=/root/.cache/pip \ + pip install -r requirements-gliner.txt + +# Small spaCy models (~60MB total) give the gliner engine tokenization + +# lemmas for the regex recognizers; GLiNER does the NER (see engines.py). +ARG SPACY_SM_MODELS="en_core_web_sm-3.8.0 es_core_news_sm-3.8.0 it_core_news_sm-3.8.0 pl_core_news_sm-3.8.0 fi_core_news_sm-3.8.0" +RUN --mount=type=cache,target=/root/.cache/pip \ + for model in ${SPACY_SM_MODELS}; do \ + whl="${model}-py3-none-any.whl"; \ + curl -fL --retry 5 --retry-delay 5 --retry-all-errors -C - \ + -o "/tmp/${whl}" \ + "https://github.com/explosion/spacy-models/releases/download/${model}/${whl}" || exit 1; \ + done && \ + pip install /tmp/*.whl && \ + rm /tmp/*.whl + +# Bake the GLiNER weights at build time (cached layer) so startup never +# touches the network. HF_HUB_OFFLINE makes a missing/overridden +# PII_GLINER_MODEL fail fast at startup instead of silently downloading. +ENV HF_HOME=/opt/hf-cache +ARG GLINER_MODEL=urchade/gliner_multi_pii-v1 +RUN python -c "from gliner import GLiNER; GLiNER.from_pretrained('${GLINER_MODEL}')" && \ + chmod -R a+rX /opt/hf-cache +ENV HF_HUB_OFFLINE=1 + +# pytest/httpx for the in-image test suites (tests/) — baked in because the +# runtime user has no writable HOME for pip install --user. +COPY apps/pii/requirements-dev.txt ./requirements-dev.txt +RUN --mount=type=cache,target=/root/.cache/pip \ + pip install -r requirements-dev.txt RUN groupadd -g 1001 pii && \ useradd -u 1001 -g pii pii && \ chown -R pii:pii /app + +COPY --chown=pii:pii apps/pii/server.py apps/pii/engines.py ./ +COPY --chown=pii:pii apps/pii/scripts ./scripts +COPY --chown=pii:pii apps/pii/tests ./tests + USER pii # Listen on 5001. Runs as its own ECS service (separate task), reached via PII_URL; @@ -54,4 +110,6 @@ HEALTHCHECK --interval=30s --timeout=5s --start-period=300s --retries=3 \ # `sh -c exec` expands the env var while keeping uvicorn as PID 1 for clean SIGTERM. # Quote the expansion so a malformed PII_WORKERS fails uvicorn arg-parsing rather # than being interpreted by the shell. +# NB for the gliner engine: EACH worker loads its own GLiNER model copy (into GPU +# memory when on cuda), so GPU deployments generally want PII_WORKERS=1 per GPU. CMD ["sh", "-c", "exec uvicorn server:app --host 0.0.0.0 --port 5001 --workers \"${PII_WORKERS:-1}\""] diff --git a/helm/sim/templates/deployment-pii.yaml b/helm/sim/templates/deployment-pii.yaml index e6c7dc206f0..2dd4b8b22c6 100644 --- a/helm/sim/templates/deployment-pii.yaml +++ b/helm/sim/templates/deployment-pii.yaml @@ -44,16 +44,20 @@ spec: - name: http containerPort: {{ .Values.pii.service.targetPort }} protocol: TCP - {{- if or .Values.pii.env .Values.extraEnvVars }} env: - {{- range $key, $value := .Values.pii.env }} + - name: PII_ENGINE + value: {{ .Values.pii.engine | quote }} + {{- if .Values.pii.device }} + - name: PII_DEVICE + value: {{ .Values.pii.device | quote }} + {{- end }} + {{- range $key, $value := omit (.Values.pii.env | default dict) "PII_ENGINE" "PII_DEVICE" }} - name: {{ $key }} value: {{ $value | quote }} {{- end }} {{- with .Values.extraEnvVars }} {{- toYaml . | nindent 12 }} {{- end }} - {{- end }} {{- if .Values.pii.startupProbe }} startupProbe: {{- toYaml .Values.pii.startupProbe | nindent 12 }} diff --git a/helm/sim/tests/pii_test.yaml b/helm/sim/tests/pii_test.yaml index 9d89b625ac5..3a416237207 100644 --- a/helm/sim/tests/pii_test.yaml +++ b/helm/sim/tests/pii_test.yaml @@ -31,6 +31,65 @@ tests: path: spec.template.spec.containers[0].ports[0].containerPort value: 5001 + - it: pii pod defaults to the spacy engine + template: deployment-pii.yaml + set: + pii.enabled: true + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: PII_ENGINE + value: "spacy" + - notContains: + path: spec.template.spec.containers[0].env + content: + name: PII_DEVICE + value: "cpu" + + - it: pii.engine and pii.device render through to the container env + template: deployment-pii.yaml + set: + pii.enabled: true + pii.engine: gliner + pii.device: cuda + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: PII_ENGINE + value: "gliner" + - contains: + path: spec.template.spec.containers[0].env + content: + name: PII_DEVICE + value: "cuda" + + - it: user-set pii.env cannot override the chart-owned engine keys + template: deployment-pii.yaml + set: + pii.enabled: true + pii.env: + PII_ENGINE: evil + PII_DEVICE: evil + PII_GLINER_MODEL: acme/custom-model + asserts: + - notContains: + path: spec.template.spec.containers[0].env + content: + name: PII_ENGINE + value: "evil" + - notContains: + path: spec.template.spec.containers[0].env + content: + name: PII_DEVICE + value: "evil" + - contains: + path: spec.template.spec.containers[0].env + content: + name: PII_GLINER_MODEL + value: "acme/custom-model" + - it: app pod gets chart-computed PII_URL pointing at the in-cluster service template: deployment-app.yaml set: diff --git a/helm/sim/values.schema.json b/helm/sim/values.schema.json index e20ec2026f2..37f518542b2 100644 --- a/helm/sim/values.schema.json +++ b/helm/sim/values.schema.json @@ -711,6 +711,15 @@ "type": "boolean", "description": "Enable the Presidio PII redaction service" }, + "engine": { + "type": "string", + "enum": ["spacy", "gliner"], + "description": "NER engine (spacy default, gliner opt-in; both ship in the image)" + }, + "device": { + "type": "string", + "description": "Torch device for the gliner engine (cpu, cuda, cuda:N); empty auto-detects" + }, "replicaCount": { "type": "integer", "minimum": 1, diff --git a/helm/sim/values.yaml b/helm/sim/values.yaml index f089cbb638a..a12713a5bec 100644 --- a/helm/sim/values.yaml +++ b/helm/sim/values.yaml @@ -822,6 +822,18 @@ pii: digest: "" # sha256: pin overrides tag pullPolicy: IfNotPresent + # NER engine: "spacy" (default) or "gliner" (opt-in zero-shot transformer NER + # for PERSON/LOCATION/NRP/DATE_TIME; regex/checksum recognizers are identical + # on both engines). The image ships both engines, so this is a pure env flip + # — no image change needed. Note: gliner on CPU is orders of magnitude slower + # than spacy; it is intended for GPU nodes. + engine: "spacy" + + # Torch device for the gliner engine: "cpu", "cuda", or "cuda:N". Empty + # auto-detects (cuda when a GPU is visible, else cpu). GPU resource requests + # (nvidia.com/gpu) are not wired yet — GPU scheduling is an infra follow-up. + device: "" + # Number of replicas replicaCount: 1 diff --git a/packages/audit/package.json b/packages/audit/package.json index 19510233d97..caaf323d8d5 100644 --- a/packages/audit/package.json +++ b/packages/audit/package.json @@ -33,7 +33,8 @@ "devDependencies": { "@sim/testing": "workspace:*", "@sim/tsconfig": "workspace:*", - "typescript": "^5.7.3", + "@types/node": "24.2.1", + "typescript": "^7.0.2", "vitest": "^4.1.0" } } diff --git a/packages/audit/src/types.ts b/packages/audit/src/types.ts index ab0818a5724..9d58bea4ddb 100644 --- a/packages/audit/src/types.ts +++ b/packages/audit/src/types.ts @@ -179,6 +179,7 @@ export const AuditAction = { WORKSPACE_FORKED: 'workspace.forked', WORKSPACE_FORK_PROMOTED: 'workspace.fork_promoted', WORKSPACE_FORK_ROLLED_BACK: 'workspace.fork_rolled_back', + WORKSPACE_FORK_UNLINKED: 'workspace.fork_unlinked', } as const export type AuditActionType = (typeof AuditAction)[keyof typeof AuditAction] diff --git a/packages/auth/package.json b/packages/auth/package.json index 45d8d658e1e..4d960fd53b7 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -24,10 +24,11 @@ }, "dependencies": { "@sim/db": "workspace:*", - "better-auth": "1.6.11" + "better-auth": "1.6.13" }, "devDependencies": { "@sim/tsconfig": "workspace:*", - "typescript": "^5.7.3" + "@types/node": "24.2.1", + "typescript": "^7.0.2" } } diff --git a/packages/cli/package.json b/packages/cli/package.json index fe4d487c3d3..9b0f6bb9d6c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -49,6 +49,6 @@ "@sim/tsconfig": "workspace:*", "@types/inquirer": "^8.2.6", "@types/node": "^20.5.1", - "typescript": "^5.7.3" + "typescript": "^7.0.2" } } diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index d69820f2a97..dd8c62518df 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -2,7 +2,8 @@ "extends": "@sim/tsconfig/library-build.json", "compilerOptions": { "target": "ES2020", - "moduleResolution": "node", + "module": "nodenext", + "moduleResolution": "nodenext", "outDir": "./dist", "rootDir": "./src" }, diff --git a/packages/db/migrations/0257_majestic_chat.sql b/packages/db/migrations/0257_majestic_chat.sql new file mode 100644 index 00000000000..e6571f9ff78 --- /dev/null +++ b/packages/db/migrations/0257_majestic_chat.sql @@ -0,0 +1,15 @@ +-- Replay-safety: this file ends in CONCURRENTLY index builds below an embedded COMMIT, so a +-- failure there replays the whole file — every statement here is idempotent. +-- +-- migration-safe: additive enum value only (no rewrite, no table lock); old app code never +-- reads or writes 'workflow_mcp_server' rows, so it is invisible during cutover +ALTER TYPE "public"."workspace_fork_resource_type" ADD VALUE IF NOT EXISTS 'workflow_mcp_server' BEFORE 'custom_tool';--> statement-breakpoint +-- Expression indexes for listSurfacedBackgroundWork's `metadata ->> …` legs: `->>` equality +-- can't use a GIN index, and one unindexable leg in its `or()` forces a full-table scan of +-- this shared relation on every Activity page load / poll. Built CONCURRENTLY per runner +-- convention (plain CREATE INDEX write-blocks the relation for the build). +COMMIT;--> statement-breakpoint +SET lock_timeout = 0;--> statement-breakpoint +CREATE INDEX CONCURRENTLY IF NOT EXISTS "background_work_status_meta_child_ws_idx" ON "background_work_status" USING btree (("metadata" ->> 'childWorkspaceId'));--> statement-breakpoint +CREATE INDEX CONCURRENTLY IF NOT EXISTS "background_work_status_meta_other_ws_idx" ON "background_work_status" USING btree (("metadata" ->> 'otherWorkspaceId'));--> statement-breakpoint +SET lock_timeout = '5s'; diff --git a/packages/db/migrations/meta/0257_snapshot.json b/packages/db/migrations/meta/0257_snapshot.json new file mode 100644 index 00000000000..e519a265e31 --- /dev/null +++ b/packages/db/migrations/meta/0257_snapshot.json @@ -0,0 +1,16718 @@ +{ + "id": "c405fc48-c6bb-4786-863f-3d3e686095b5", + "prevId": "b932608c-c10f-4085-8f59-0621b23071f4", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.academy_certificate": { + "name": "academy_certificate", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "course_id": { + "name": "course_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "academy_cert_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "issued_at": { + "name": "issued_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "certificate_number": { + "name": "certificate_number", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "metadata": { + "name": "metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "academy_certificate_user_id_idx": { + "name": "academy_certificate_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "academy_certificate_course_id_idx": { + "name": "academy_certificate_course_id_idx", + "columns": [ + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "academy_certificate_user_course_unique": { + "name": "academy_certificate_user_course_unique", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "course_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "academy_certificate_number_idx": { + "name": "academy_certificate_number_idx", + "columns": [ + { + "expression": "certificate_number", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "academy_certificate_status_idx": { + "name": "academy_certificate_status_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "academy_certificate_user_id_user_id_fk": { + "name": "academy_certificate_user_id_user_id_fk", + "tableFrom": "academy_certificate", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "academy_certificate_certificate_number_unique": { + "name": "academy_certificate_certificate_number_unique", + "nullsNotDistinct": false, + "columns": ["certificate_number"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.account": { + "name": "account", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "account_id": { + "name": "account_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider_id": { + "name": "provider_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "access_token": { + "name": "access_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refresh_token": { + "name": "refresh_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "id_token": { + "name": "id_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "access_token_expires_at": { + "name": "access_token_expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "refresh_token_expires_at": { + "name": "refresh_token_expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "account_user_id_idx": { + "name": "account_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_account_on_account_id_provider_id": { + "name": "idx_account_on_account_id_provider_id", + "columns": [ + { + "expression": "account_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "provider_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "account_user_id_user_id_fk": { + "name": "account_user_id_user_id_fk", + "tableFrom": "account", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.api_key": { + "name": "api_key", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "key_hash": { + "name": "key_hash", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'personal'" + }, + "last_used": { + "name": "last_used", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "api_key_workspace_type_idx": { + "name": "api_key_workspace_type_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "api_key_user_type_idx": { + "name": "api_key_user_type_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "api_key_key_hash_idx": { + "name": "api_key_key_hash_idx", + "columns": [ + { + "expression": "key_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "api_key_user_id_user_id_fk": { + "name": "api_key_user_id_user_id_fk", + "tableFrom": "api_key", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "api_key_workspace_id_workspace_id_fk": { + "name": "api_key_workspace_id_workspace_id_fk", + "tableFrom": "api_key", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "api_key_created_by_user_id_fk": { + "name": "api_key_created_by_user_id_fk", + "tableFrom": "api_key", + "tableTo": "user", + "columnsFrom": ["created_by"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "api_key_key_unique": { + "name": "api_key_key_unique", + "nullsNotDistinct": false, + "columns": ["key"] + } + }, + "policies": {}, + "checkConstraints": { + "workspace_type_check": { + "name": "workspace_type_check", + "value": "(type = 'workspace' AND workspace_id IS NOT NULL) OR (type = 'personal' AND workspace_id IS NULL)" + } + }, + "isRLSEnabled": false + }, + "public.async_jobs": { + "name": "async_jobs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "payload": { + "name": "payload", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "started_at": { + "name": "started_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "run_at": { + "name": "run_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "attempts": { + "name": "attempts", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "max_attempts": { + "name": "max_attempts", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 3 + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "output": { + "name": "output", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "async_jobs_status_started_at_idx": { + "name": "async_jobs_status_started_at_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "started_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "async_jobs_status_completed_at_idx": { + "name": "async_jobs_status_completed_at_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "completed_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "async_jobs_schedule_pending_run_at_idx": { + "name": "async_jobs_schedule_pending_run_at_idx", + "columns": [ + { + "expression": "run_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"async_jobs\".\"type\" = 'schedule-execution' AND \"async_jobs\".\"status\" = 'pending'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "async_jobs_schedule_processing_started_at_idx": { + "name": "async_jobs_schedule_processing_started_at_idx", + "columns": [ + { + "expression": "started_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"async_jobs\".\"type\" = 'schedule-execution' AND \"async_jobs\".\"status\" = 'processing'", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.audit_log": { + "name": "audit_log", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "actor_id": { + "name": "actor_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "action": { + "name": "action", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "resource_type": { + "name": "resource_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "resource_id": { + "name": "resource_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "actor_name": { + "name": "actor_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "actor_email": { + "name": "actor_email", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "resource_name": { + "name": "resource_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'{}'" + }, + "ip_address": { + "name": "ip_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_agent": { + "name": "user_agent", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "audit_log_workspace_created_idx": { + "name": "audit_log_workspace_created_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "audit_log_workspace_created_at_id_idx": { + "name": "audit_log_workspace_created_at_id_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "date_trunc('milliseconds', \"created_at\")", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "audit_log_actor_created_idx": { + "name": "audit_log_actor_created_idx", + "columns": [ + { + "expression": "actor_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "audit_log_resource_idx": { + "name": "audit_log_resource_idx", + "columns": [ + { + "expression": "resource_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "resource_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "audit_log_action_idx": { + "name": "audit_log_action_idx", + "columns": [ + { + "expression": "action", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "audit_log_workspace_id_workspace_id_fk": { + "name": "audit_log_workspace_id_workspace_id_fk", + "tableFrom": "audit_log", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + }, + "audit_log_actor_id_user_id_fk": { + "name": "audit_log_actor_id_user_id_fk", + "tableFrom": "audit_log", + "tableTo": "user", + "columnsFrom": ["actor_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.background_work_status": { + "name": "background_work_status", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "kind": { + "name": "kind", + "type": "background_work_kind", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "background_work_status_value", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "started_at": { + "name": "started_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "background_work_status_workspace_status_idx": { + "name": "background_work_status_workspace_status_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "background_work_status_workflow_status_idx": { + "name": "background_work_status_workflow_status_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "background_work_status_meta_child_ws_idx": { + "name": "background_work_status_meta_child_ws_idx", + "columns": [ + { + "expression": "(\"metadata\" ->> 'childWorkspaceId')", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "background_work_status_meta_other_ws_idx": { + "name": "background_work_status_meta_other_ws_idx", + "columns": [ + { + "expression": "(\"metadata\" ->> 'otherWorkspaceId')", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "background_work_status_workspace_id_workspace_id_fk": { + "name": "background_work_status_workspace_id_workspace_id_fk", + "tableFrom": "background_work_status", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "background_work_status_workflow_id_workflow_id_fk": { + "name": "background_work_status_workflow_id_workflow_id_fk", + "tableFrom": "background_work_status", + "tableTo": "workflow", + "columnsFrom": ["workflow_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.chat": { + "name": "chat", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "identifier": { + "name": "identifier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_active": { + "name": "is_active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "customizations": { + "name": "customizations", + "type": "json", + "primaryKey": false, + "notNull": false, + "default": "'{}'" + }, + "auth_type": { + "name": "auth_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'public'" + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "allowed_emails": { + "name": "allowed_emails", + "type": "json", + "primaryKey": false, + "notNull": false, + "default": "'[]'" + }, + "output_configs": { + "name": "output_configs", + "type": "json", + "primaryKey": false, + "notNull": false, + "default": "'[]'" + }, + "archived_at": { + "name": "archived_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "identifier_idx": { + "name": "identifier_idx", + "columns": [ + { + "expression": "identifier", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"chat\".\"archived_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "chat_archived_at_partial_idx": { + "name": "chat_archived_at_partial_idx", + "columns": [ + { + "expression": "archived_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"chat\".\"archived_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_chat_on_workflow_id_archived_at": { + "name": "idx_chat_on_workflow_id_archived_at", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "archived_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "chat_workflow_id_workflow_id_fk": { + "name": "chat_workflow_id_workflow_id_fk", + "tableFrom": "chat", + "tableTo": "workflow", + "columnsFrom": ["workflow_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "chat_user_id_user_id_fk": { + "name": "chat_user_id_user_id_fk", + "tableFrom": "chat", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.copilot_async_tool_calls": { + "name": "copilot_async_tool_calls", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "run_id": { + "name": "run_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "checkpoint_id": { + "name": "checkpoint_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "tool_call_id": { + "name": "tool_call_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tool_name": { + "name": "tool_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "args": { + "name": "args", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "status": { + "name": "status", + "type": "copilot_async_tool_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "result": { + "name": "result", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "claimed_at": { + "name": "claimed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "claimed_by": { + "name": "claimed_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "copilot_async_tool_calls_run_id_idx": { + "name": "copilot_async_tool_calls_run_id_idx", + "columns": [ + { + "expression": "run_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_async_tool_calls_checkpoint_id_idx": { + "name": "copilot_async_tool_calls_checkpoint_id_idx", + "columns": [ + { + "expression": "checkpoint_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_async_tool_calls_tool_call_id_idx": { + "name": "copilot_async_tool_calls_tool_call_id_idx", + "columns": [ + { + "expression": "tool_call_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_async_tool_calls_status_idx": { + "name": "copilot_async_tool_calls_status_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_async_tool_calls_run_status_idx": { + "name": "copilot_async_tool_calls_run_status_idx", + "columns": [ + { + "expression": "run_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_async_tool_calls_tool_call_id_unique": { + "name": "copilot_async_tool_calls_tool_call_id_unique", + "columns": [ + { + "expression": "tool_call_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "copilot_async_tool_calls_run_id_copilot_runs_id_fk": { + "name": "copilot_async_tool_calls_run_id_copilot_runs_id_fk", + "tableFrom": "copilot_async_tool_calls", + "tableTo": "copilot_runs", + "columnsFrom": ["run_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "copilot_async_tool_calls_checkpoint_id_copilot_run_checkpoints_id_fk": { + "name": "copilot_async_tool_calls_checkpoint_id_copilot_run_checkpoints_id_fk", + "tableFrom": "copilot_async_tool_calls", + "tableTo": "copilot_run_checkpoints", + "columnsFrom": ["checkpoint_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.copilot_chats": { + "name": "copilot_chats", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "chat_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'copilot'" + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "model": { + "name": "model", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'claude-3-7-sonnet-latest'" + }, + "conversation_id": { + "name": "conversation_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "preview_yaml": { + "name": "preview_yaml", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "plan_artifact": { + "name": "plan_artifact", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "config": { + "name": "config", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "resources": { + "name": "resources", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'" + }, + "last_seen_at": { + "name": "last_seen_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "pinned": { + "name": "pinned", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "copilot_chats_user_id_idx": { + "name": "copilot_chats_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_chats_workflow_id_idx": { + "name": "copilot_chats_workflow_id_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_chats_user_workflow_idx": { + "name": "copilot_chats_user_workflow_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_chats_user_workspace_idx": { + "name": "copilot_chats_user_workspace_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_chats_created_at_idx": { + "name": "copilot_chats_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_chats_updated_at_idx": { + "name": "copilot_chats_updated_at_idx", + "columns": [ + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_chats_workspace_created_at_id_idx": { + "name": "copilot_chats_workspace_created_at_id_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "date_trunc('milliseconds', \"created_at\")", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "copilot_chats_user_id_user_id_fk": { + "name": "copilot_chats_user_id_user_id_fk", + "tableFrom": "copilot_chats", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "copilot_chats_workflow_id_workflow_id_fk": { + "name": "copilot_chats_workflow_id_workflow_id_fk", + "tableFrom": "copilot_chats", + "tableTo": "workflow", + "columnsFrom": ["workflow_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "copilot_chats_workspace_id_workspace_id_fk": { + "name": "copilot_chats_workspace_id_workspace_id_fk", + "tableFrom": "copilot_chats", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.copilot_feedback": { + "name": "copilot_feedback", + "schema": "", + "columns": { + "feedback_id": { + "name": "feedback_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chat_id": { + "name": "chat_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_query": { + "name": "user_query", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "agent_response": { + "name": "agent_response", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_positive": { + "name": "is_positive", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "feedback": { + "name": "feedback", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "workflow_yaml": { + "name": "workflow_yaml", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "copilot_feedback_user_id_idx": { + "name": "copilot_feedback_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_feedback_chat_id_idx": { + "name": "copilot_feedback_chat_id_idx", + "columns": [ + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_feedback_user_chat_idx": { + "name": "copilot_feedback_user_chat_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_feedback_is_positive_idx": { + "name": "copilot_feedback_is_positive_idx", + "columns": [ + { + "expression": "is_positive", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_feedback_created_at_idx": { + "name": "copilot_feedback_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "copilot_feedback_user_id_user_id_fk": { + "name": "copilot_feedback_user_id_user_id_fk", + "tableFrom": "copilot_feedback", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "copilot_feedback_chat_id_copilot_chats_id_fk": { + "name": "copilot_feedback_chat_id_copilot_chats_id_fk", + "tableFrom": "copilot_feedback", + "tableTo": "copilot_chats", + "columnsFrom": ["chat_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.copilot_messages": { + "name": "copilot_messages", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "chat_id": { + "name": "chat_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "message_id": { + "name": "message_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "stream_id": { + "name": "stream_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "parent_message_id": { + "name": "parent_message_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "model": { + "name": "model", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tokens_in": { + "name": "tokens_in", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "tokens_out": { + "name": "tokens_out", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "seq": { + "name": "seq", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "copilot_messages_chat_message_unique": { + "name": "copilot_messages_chat_message_unique", + "columns": [ + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "message_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_messages_chat_created_at_idx": { + "name": "copilot_messages_chat_created_at_idx", + "columns": [ + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"copilot_messages\".\"deleted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_messages_chat_seq_idx": { + "name": "copilot_messages_chat_seq_idx", + "columns": [ + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "seq", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"copilot_messages\".\"deleted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_messages_chat_stream_idx": { + "name": "copilot_messages_chat_stream_idx", + "columns": [ + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "stream_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"copilot_messages\".\"stream_id\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "copilot_messages_chat_id_copilot_chats_id_fk": { + "name": "copilot_messages_chat_id_copilot_chats_id_fk", + "tableFrom": "copilot_messages", + "tableTo": "copilot_chats", + "columnsFrom": ["chat_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.copilot_run_checkpoints": { + "name": "copilot_run_checkpoints", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "run_id": { + "name": "run_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "pending_tool_call_id": { + "name": "pending_tool_call_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "conversation_snapshot": { + "name": "conversation_snapshot", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "agent_state": { + "name": "agent_state", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "provider_request": { + "name": "provider_request", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "copilot_run_checkpoints_run_id_idx": { + "name": "copilot_run_checkpoints_run_id_idx", + "columns": [ + { + "expression": "run_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_run_checkpoints_pending_tool_call_id_idx": { + "name": "copilot_run_checkpoints_pending_tool_call_id_idx", + "columns": [ + { + "expression": "pending_tool_call_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_run_checkpoints_run_pending_tool_unique": { + "name": "copilot_run_checkpoints_run_pending_tool_unique", + "columns": [ + { + "expression": "run_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "pending_tool_call_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "copilot_run_checkpoints_run_id_copilot_runs_id_fk": { + "name": "copilot_run_checkpoints_run_id_copilot_runs_id_fk", + "tableFrom": "copilot_run_checkpoints", + "tableTo": "copilot_runs", + "columnsFrom": ["run_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.copilot_runs": { + "name": "copilot_runs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "execution_id": { + "name": "execution_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "parent_run_id": { + "name": "parent_run_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "chat_id": { + "name": "chat_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "stream_id": { + "name": "stream_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "agent": { + "name": "agent", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "model": { + "name": "model", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "copilot_run_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "request_context": { + "name": "request_context", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "started_at": { + "name": "started_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "copilot_runs_execution_id_idx": { + "name": "copilot_runs_execution_id_idx", + "columns": [ + { + "expression": "execution_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_runs_parent_run_id_idx": { + "name": "copilot_runs_parent_run_id_idx", + "columns": [ + { + "expression": "parent_run_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_runs_chat_id_idx": { + "name": "copilot_runs_chat_id_idx", + "columns": [ + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_runs_user_id_idx": { + "name": "copilot_runs_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_runs_workflow_id_idx": { + "name": "copilot_runs_workflow_id_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_runs_workspace_id_idx": { + "name": "copilot_runs_workspace_id_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_runs_status_idx": { + "name": "copilot_runs_status_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_runs_chat_execution_idx": { + "name": "copilot_runs_chat_execution_idx", + "columns": [ + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "execution_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_runs_execution_started_at_idx": { + "name": "copilot_runs_execution_started_at_idx", + "columns": [ + { + "expression": "execution_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "started_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_runs_workspace_completed_at_id_idx": { + "name": "copilot_runs_workspace_completed_at_id_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "date_trunc('milliseconds', \"completed_at\")", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_runs_stream_id_unique": { + "name": "copilot_runs_stream_id_unique", + "columns": [ + { + "expression": "stream_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "copilot_runs_chat_id_copilot_chats_id_fk": { + "name": "copilot_runs_chat_id_copilot_chats_id_fk", + "tableFrom": "copilot_runs", + "tableTo": "copilot_chats", + "columnsFrom": ["chat_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "copilot_runs_user_id_user_id_fk": { + "name": "copilot_runs_user_id_user_id_fk", + "tableFrom": "copilot_runs", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "copilot_runs_workflow_id_workflow_id_fk": { + "name": "copilot_runs_workflow_id_workflow_id_fk", + "tableFrom": "copilot_runs", + "tableTo": "workflow", + "columnsFrom": ["workflow_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "copilot_runs_workspace_id_workspace_id_fk": { + "name": "copilot_runs_workspace_id_workspace_id_fk", + "tableFrom": "copilot_runs", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.copilot_workflow_read_hashes": { + "name": "copilot_workflow_read_hashes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "chat_id": { + "name": "chat_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hash": { + "name": "hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "copilot_workflow_read_hashes_chat_id_idx": { + "name": "copilot_workflow_read_hashes_chat_id_idx", + "columns": [ + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_workflow_read_hashes_workflow_id_idx": { + "name": "copilot_workflow_read_hashes_workflow_id_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "copilot_workflow_read_hashes_chat_workflow_unique": { + "name": "copilot_workflow_read_hashes_chat_workflow_unique", + "columns": [ + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "copilot_workflow_read_hashes_chat_id_copilot_chats_id_fk": { + "name": "copilot_workflow_read_hashes_chat_id_copilot_chats_id_fk", + "tableFrom": "copilot_workflow_read_hashes", + "tableTo": "copilot_chats", + "columnsFrom": ["chat_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "copilot_workflow_read_hashes_workflow_id_workflow_id_fk": { + "name": "copilot_workflow_read_hashes_workflow_id_workflow_id_fk", + "tableFrom": "copilot_workflow_read_hashes", + "tableTo": "workflow", + "columnsFrom": ["workflow_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.credential": { + "name": "credential", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "credential_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "display_name": { + "name": "display_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "provider_id": { + "name": "provider_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "account_id": { + "name": "account_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env_key": { + "name": "env_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "env_owner_user_id": { + "name": "env_owner_user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "encrypted_service_account_key": { + "name": "encrypted_service_account_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "credential_workspace_id_idx": { + "name": "credential_workspace_id_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "credential_type_idx": { + "name": "credential_type_idx", + "columns": [ + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "credential_provider_id_idx": { + "name": "credential_provider_id_idx", + "columns": [ + { + "expression": "provider_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "credential_account_id_idx": { + "name": "credential_account_id_idx", + "columns": [ + { + "expression": "account_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "credential_env_owner_user_id_idx": { + "name": "credential_env_owner_user_id_idx", + "columns": [ + { + "expression": "env_owner_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "credential_workspace_account_unique": { + "name": "credential_workspace_account_unique", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "account_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "account_id IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "credential_workspace_env_unique": { + "name": "credential_workspace_env_unique", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "env_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "type = 'env_workspace'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "credential_workspace_personal_env_unique": { + "name": "credential_workspace_personal_env_unique", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "env_key", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "env_owner_user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "type = 'env_personal'", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "credential_workspace_id_workspace_id_fk": { + "name": "credential_workspace_id_workspace_id_fk", + "tableFrom": "credential", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "credential_account_id_account_id_fk": { + "name": "credential_account_id_account_id_fk", + "tableFrom": "credential", + "tableTo": "account", + "columnsFrom": ["account_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "credential_env_owner_user_id_user_id_fk": { + "name": "credential_env_owner_user_id_user_id_fk", + "tableFrom": "credential", + "tableTo": "user", + "columnsFrom": ["env_owner_user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "credential_created_by_user_id_fk": { + "name": "credential_created_by_user_id_fk", + "tableFrom": "credential", + "tableTo": "user", + "columnsFrom": ["created_by"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "credential_oauth_source_check": { + "name": "credential_oauth_source_check", + "value": "(type <> 'oauth') OR (account_id IS NOT NULL AND provider_id IS NOT NULL)" + }, + "credential_workspace_env_source_check": { + "name": "credential_workspace_env_source_check", + "value": "(type <> 'env_workspace') OR (env_key IS NOT NULL AND env_owner_user_id IS NULL)" + }, + "credential_personal_env_source_check": { + "name": "credential_personal_env_source_check", + "value": "(type <> 'env_personal') OR (env_key IS NOT NULL AND env_owner_user_id IS NOT NULL)" + } + }, + "isRLSEnabled": false + }, + "public.credential_member": { + "name": "credential_member", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "credential_id": { + "name": "credential_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "credential_member_role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'member'" + }, + "status": { + "name": "status", + "type": "credential_member_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "joined_at": { + "name": "joined_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "invited_by": { + "name": "invited_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "credential_member_user_id_idx": { + "name": "credential_member_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "credential_member_role_idx": { + "name": "credential_member_role_idx", + "columns": [ + { + "expression": "role", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "credential_member_status_idx": { + "name": "credential_member_status_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "credential_member_unique": { + "name": "credential_member_unique", + "columns": [ + { + "expression": "credential_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "credential_member_credential_id_credential_id_fk": { + "name": "credential_member_credential_id_credential_id_fk", + "tableFrom": "credential_member", + "tableTo": "credential", + "columnsFrom": ["credential_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "credential_member_user_id_user_id_fk": { + "name": "credential_member_user_id_user_id_fk", + "tableFrom": "credential_member", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "credential_member_invited_by_user_id_fk": { + "name": "credential_member_invited_by_user_id_fk", + "tableFrom": "credential_member", + "tableTo": "user", + "columnsFrom": ["invited_by"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.custom_block": { + "name": "custom_block", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "icon_url": { + "name": "icon_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "inputs": { + "name": "inputs", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "outputs": { + "name": "outputs", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "custom_block_organization_id_idx": { + "name": "custom_block_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "custom_block_workflow_id_idx": { + "name": "custom_block_workflow_id_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "custom_block_organization_type_unique": { + "name": "custom_block_organization_type_unique", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "custom_block_organization_id_organization_id_fk": { + "name": "custom_block_organization_id_organization_id_fk", + "tableFrom": "custom_block", + "tableTo": "organization", + "columnsFrom": ["organization_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "custom_block_workflow_id_workflow_id_fk": { + "name": "custom_block_workflow_id_workflow_id_fk", + "tableFrom": "custom_block", + "tableTo": "workflow", + "columnsFrom": ["workflow_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "custom_block_created_by_user_id_fk": { + "name": "custom_block_created_by_user_id_fk", + "tableFrom": "custom_block", + "tableTo": "user", + "columnsFrom": ["created_by"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.custom_tools": { + "name": "custom_tools", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "schema": { + "name": "schema", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "code": { + "name": "code", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "custom_tools_workspace_id_idx": { + "name": "custom_tools_workspace_id_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "custom_tools_workspace_title_unique": { + "name": "custom_tools_workspace_title_unique", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "title", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "custom_tools_workspace_id_workspace_id_fk": { + "name": "custom_tools_workspace_id_workspace_id_fk", + "tableFrom": "custom_tools", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "custom_tools_user_id_user_id_fk": { + "name": "custom_tools_user_id_user_id_fk", + "tableFrom": "custom_tools", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.data_drain_runs": { + "name": "data_drain_runs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "drain_id": { + "name": "drain_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "data_drain_run_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "trigger": { + "name": "trigger", + "type": "data_drain_run_trigger", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "started_at": { + "name": "started_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "finished_at": { + "name": "finished_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "rows_exported": { + "name": "rows_exported", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "bytes_written": { + "name": "bytes_written", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "cursor_before": { + "name": "cursor_before", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cursor_after": { + "name": "cursor_after", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "locators": { + "name": "locators", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + } + }, + "indexes": { + "data_drain_runs_drain_started_idx": { + "name": "data_drain_runs_drain_started_idx", + "columns": [ + { + "expression": "drain_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "started_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "data_drain_runs_drain_id_data_drains_id_fk": { + "name": "data_drain_runs_drain_id_data_drains_id_fk", + "tableFrom": "data_drain_runs", + "tableTo": "data_drains", + "columnsFrom": ["drain_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.data_drains": { + "name": "data_drains", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source": { + "name": "source", + "type": "data_drain_source", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "destination_type": { + "name": "destination_type", + "type": "data_drain_destination", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "destination_config": { + "name": "destination_config", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "destination_credentials": { + "name": "destination_credentials", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "schedule_cadence": { + "name": "schedule_cadence", + "type": "data_drain_cadence", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "cursor": { + "name": "cursor", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "last_run_at": { + "name": "last_run_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "last_success_at": { + "name": "last_success_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "data_drains_org_idx": { + "name": "data_drains_org_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "data_drains_due_idx": { + "name": "data_drains_due_idx", + "columns": [ + { + "expression": "enabled", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "last_run_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "data_drains_org_name_unique": { + "name": "data_drains_org_name_unique", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "data_drains_organization_id_organization_id_fk": { + "name": "data_drains_organization_id_organization_id_fk", + "tableFrom": "data_drains", + "tableTo": "organization", + "columnsFrom": ["organization_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "data_drains_created_by_user_id_fk": { + "name": "data_drains_created_by_user_id_fk", + "tableFrom": "data_drains", + "tableTo": "user", + "columnsFrom": ["created_by"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.docs_embeddings": { + "name": "docs_embeddings", + "schema": "", + "columns": { + "chunk_id": { + "name": "chunk_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "chunk_text": { + "name": "chunk_text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_document": { + "name": "source_document", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_link": { + "name": "source_link", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "header_text": { + "name": "header_text", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "header_level": { + "name": "header_level", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "token_count": { + "name": "token_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "embedding": { + "name": "embedding", + "type": "vector(1536)", + "primaryKey": false, + "notNull": true + }, + "embedding_model": { + "name": "embedding_model", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'text-embedding-3-small'" + }, + "metadata": { + "name": "metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "chunk_text_tsv": { + "name": "chunk_text_tsv", + "type": "tsvector", + "primaryKey": false, + "notNull": false, + "generated": { + "as": "to_tsvector('english', \"docs_embeddings\".\"chunk_text\")", + "type": "stored" + } + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "docs_emb_source_document_idx": { + "name": "docs_emb_source_document_idx", + "columns": [ + { + "expression": "source_document", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "docs_emb_header_level_idx": { + "name": "docs_emb_header_level_idx", + "columns": [ + { + "expression": "header_level", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "docs_emb_source_header_idx": { + "name": "docs_emb_source_header_idx", + "columns": [ + { + "expression": "source_document", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "header_level", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "docs_emb_model_idx": { + "name": "docs_emb_model_idx", + "columns": [ + { + "expression": "embedding_model", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "docs_emb_created_at_idx": { + "name": "docs_emb_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "docs_embedding_vector_hnsw_idx": { + "name": "docs_embedding_vector_hnsw_idx", + "columns": [ + { + "expression": "embedding", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "vector_cosine_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "hnsw", + "with": { + "m": 16, + "ef_construction": 64 + } + }, + "docs_emb_metadata_gin_idx": { + "name": "docs_emb_metadata_gin_idx", + "columns": [ + { + "expression": "metadata", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + }, + "docs_emb_chunk_text_fts_idx": { + "name": "docs_emb_chunk_text_fts_idx", + "columns": [ + { + "expression": "chunk_text_tsv", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "docs_embedding_not_null_check": { + "name": "docs_embedding_not_null_check", + "value": "\"embedding\" IS NOT NULL" + }, + "docs_header_level_check": { + "name": "docs_header_level_check", + "value": "\"header_level\" >= 1 AND \"header_level\" <= 6" + } + }, + "isRLSEnabled": false + }, + "public.document": { + "name": "document", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "knowledge_base_id": { + "name": "knowledge_base_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "filename": { + "name": "filename", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "file_url": { + "name": "file_url", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "storage_key": { + "name": "storage_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "file_size": { + "name": "file_size", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "mime_type": { + "name": "mime_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chunk_count": { + "name": "chunk_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "token_count": { + "name": "token_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "character_count": { + "name": "character_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "processing_status": { + "name": "processing_status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "processing_started_at": { + "name": "processing_started_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "processing_completed_at": { + "name": "processing_completed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "processing_error": { + "name": "processing_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "archived_at": { + "name": "archived_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "user_excluded": { + "name": "user_excluded", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "tag1": { + "name": "tag1", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tag2": { + "name": "tag2", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tag3": { + "name": "tag3", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tag4": { + "name": "tag4", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tag5": { + "name": "tag5", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tag6": { + "name": "tag6", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tag7": { + "name": "tag7", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number1": { + "name": "number1", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "number2": { + "name": "number2", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "number3": { + "name": "number3", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "number4": { + "name": "number4", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "number5": { + "name": "number5", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "date1": { + "name": "date1", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "date2": { + "name": "date2", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "boolean1": { + "name": "boolean1", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "boolean2": { + "name": "boolean2", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "boolean3": { + "name": "boolean3", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "connector_id": { + "name": "connector_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "external_id": { + "name": "external_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "content_hash": { + "name": "content_hash", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "source_url": { + "name": "source_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "uploaded_by": { + "name": "uploaded_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "uploaded_at": { + "name": "uploaded_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "doc_kb_id_idx": { + "name": "doc_kb_id_idx", + "columns": [ + { + "expression": "knowledge_base_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_filename_idx": { + "name": "doc_filename_idx", + "columns": [ + { + "expression": "filename", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_processing_status_idx": { + "name": "doc_processing_status_idx", + "columns": [ + { + "expression": "knowledge_base_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "processing_status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_connector_external_id_idx": { + "name": "doc_connector_external_id_idx", + "columns": [ + { + "expression": "connector_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "external_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"document\".\"deleted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_connector_id_idx": { + "name": "doc_connector_id_idx", + "columns": [ + { + "expression": "connector_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_storage_key_idx": { + "name": "doc_storage_key_idx", + "columns": [ + { + "expression": "storage_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"document\".\"storage_key\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_archived_at_partial_idx": { + "name": "doc_archived_at_partial_idx", + "columns": [ + { + "expression": "archived_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"document\".\"archived_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_deleted_at_partial_idx": { + "name": "doc_deleted_at_partial_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"document\".\"deleted_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_tag1_idx": { + "name": "doc_tag1_idx", + "columns": [ + { + "expression": "tag1", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_tag2_idx": { + "name": "doc_tag2_idx", + "columns": [ + { + "expression": "tag2", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_tag3_idx": { + "name": "doc_tag3_idx", + "columns": [ + { + "expression": "tag3", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_tag4_idx": { + "name": "doc_tag4_idx", + "columns": [ + { + "expression": "tag4", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_tag5_idx": { + "name": "doc_tag5_idx", + "columns": [ + { + "expression": "tag5", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_tag6_idx": { + "name": "doc_tag6_idx", + "columns": [ + { + "expression": "tag6", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_tag7_idx": { + "name": "doc_tag7_idx", + "columns": [ + { + "expression": "tag7", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_number1_idx": { + "name": "doc_number1_idx", + "columns": [ + { + "expression": "number1", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_number2_idx": { + "name": "doc_number2_idx", + "columns": [ + { + "expression": "number2", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_number3_idx": { + "name": "doc_number3_idx", + "columns": [ + { + "expression": "number3", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_number4_idx": { + "name": "doc_number4_idx", + "columns": [ + { + "expression": "number4", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_number5_idx": { + "name": "doc_number5_idx", + "columns": [ + { + "expression": "number5", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_date1_idx": { + "name": "doc_date1_idx", + "columns": [ + { + "expression": "date1", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_date2_idx": { + "name": "doc_date2_idx", + "columns": [ + { + "expression": "date2", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_boolean1_idx": { + "name": "doc_boolean1_idx", + "columns": [ + { + "expression": "boolean1", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_boolean2_idx": { + "name": "doc_boolean2_idx", + "columns": [ + { + "expression": "boolean2", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "doc_boolean3_idx": { + "name": "doc_boolean3_idx", + "columns": [ + { + "expression": "boolean3", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "document_knowledge_base_id_knowledge_base_id_fk": { + "name": "document_knowledge_base_id_knowledge_base_id_fk", + "tableFrom": "document", + "tableTo": "knowledge_base", + "columnsFrom": ["knowledge_base_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "document_connector_id_knowledge_connector_id_fk": { + "name": "document_connector_id_knowledge_connector_id_fk", + "tableFrom": "document", + "tableTo": "knowledge_connector", + "columnsFrom": ["connector_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + }, + "document_uploaded_by_user_id_fk": { + "name": "document_uploaded_by_user_id_fk", + "tableFrom": "document", + "tableTo": "user", + "columnsFrom": ["uploaded_by"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.embedding": { + "name": "embedding", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "knowledge_base_id": { + "name": "knowledge_base_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "document_id": { + "name": "document_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chunk_index": { + "name": "chunk_index", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "chunk_hash": { + "name": "chunk_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content_length": { + "name": "content_length", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "token_count": { + "name": "token_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "embedding": { + "name": "embedding", + "type": "vector(1536)", + "primaryKey": false, + "notNull": false + }, + "embedding_model": { + "name": "embedding_model", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'text-embedding-3-small'" + }, + "start_offset": { + "name": "start_offset", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "end_offset": { + "name": "end_offset", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "tag1": { + "name": "tag1", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tag2": { + "name": "tag2", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tag3": { + "name": "tag3", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tag4": { + "name": "tag4", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tag5": { + "name": "tag5", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tag6": { + "name": "tag6", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tag7": { + "name": "tag7", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number1": { + "name": "number1", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "number2": { + "name": "number2", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "number3": { + "name": "number3", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "number4": { + "name": "number4", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "number5": { + "name": "number5", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "date1": { + "name": "date1", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "date2": { + "name": "date2", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "boolean1": { + "name": "boolean1", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "boolean2": { + "name": "boolean2", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "boolean3": { + "name": "boolean3", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "content_tsv": { + "name": "content_tsv", + "type": "tsvector", + "primaryKey": false, + "notNull": false, + "generated": { + "as": "to_tsvector('english', \"embedding\".\"content\")", + "type": "stored" + } + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "emb_kb_id_idx": { + "name": "emb_kb_id_idx", + "columns": [ + { + "expression": "knowledge_base_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "emb_doc_id_idx": { + "name": "emb_doc_id_idx", + "columns": [ + { + "expression": "document_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "emb_doc_chunk_idx": { + "name": "emb_doc_chunk_idx", + "columns": [ + { + "expression": "document_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "chunk_index", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "emb_kb_model_idx": { + "name": "emb_kb_model_idx", + "columns": [ + { + "expression": "knowledge_base_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "embedding_model", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "emb_kb_enabled_idx": { + "name": "emb_kb_enabled_idx", + "columns": [ + { + "expression": "knowledge_base_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "enabled", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "emb_doc_enabled_idx": { + "name": "emb_doc_enabled_idx", + "columns": [ + { + "expression": "document_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "enabled", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "embedding_vector_hnsw_idx": { + "name": "embedding_vector_hnsw_idx", + "columns": [ + { + "expression": "embedding", + "isExpression": false, + "asc": true, + "nulls": "last", + "opclass": "vector_cosine_ops" + } + ], + "isUnique": false, + "concurrently": false, + "method": "hnsw", + "with": { + "m": 16, + "ef_construction": 64 + } + }, + "emb_tag1_idx": { + "name": "emb_tag1_idx", + "columns": [ + { + "expression": "tag1", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "emb_tag2_idx": { + "name": "emb_tag2_idx", + "columns": [ + { + "expression": "tag2", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "emb_tag3_idx": { + "name": "emb_tag3_idx", + "columns": [ + { + "expression": "tag3", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "emb_tag4_idx": { + "name": "emb_tag4_idx", + "columns": [ + { + "expression": "tag4", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "emb_tag5_idx": { + "name": "emb_tag5_idx", + "columns": [ + { + "expression": "tag5", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "emb_tag6_idx": { + "name": "emb_tag6_idx", + "columns": [ + { + "expression": "tag6", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "emb_tag7_idx": { + "name": "emb_tag7_idx", + "columns": [ + { + "expression": "tag7", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "emb_number1_idx": { + "name": "emb_number1_idx", + "columns": [ + { + "expression": "number1", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "emb_number2_idx": { + "name": "emb_number2_idx", + "columns": [ + { + "expression": "number2", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "emb_number3_idx": { + "name": "emb_number3_idx", + "columns": [ + { + "expression": "number3", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "emb_number4_idx": { + "name": "emb_number4_idx", + "columns": [ + { + "expression": "number4", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "emb_number5_idx": { + "name": "emb_number5_idx", + "columns": [ + { + "expression": "number5", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "emb_date1_idx": { + "name": "emb_date1_idx", + "columns": [ + { + "expression": "date1", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "emb_date2_idx": { + "name": "emb_date2_idx", + "columns": [ + { + "expression": "date2", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "emb_boolean1_idx": { + "name": "emb_boolean1_idx", + "columns": [ + { + "expression": "boolean1", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "emb_boolean2_idx": { + "name": "emb_boolean2_idx", + "columns": [ + { + "expression": "boolean2", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "emb_boolean3_idx": { + "name": "emb_boolean3_idx", + "columns": [ + { + "expression": "boolean3", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "emb_content_fts_idx": { + "name": "emb_content_fts_idx", + "columns": [ + { + "expression": "content_tsv", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + } + }, + "foreignKeys": { + "embedding_knowledge_base_id_knowledge_base_id_fk": { + "name": "embedding_knowledge_base_id_knowledge_base_id_fk", + "tableFrom": "embedding", + "tableTo": "knowledge_base", + "columnsFrom": ["knowledge_base_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "embedding_document_id_document_id_fk": { + "name": "embedding_document_id_document_id_fk", + "tableFrom": "embedding", + "tableTo": "document", + "columnsFrom": ["document_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "embedding_not_null_check": { + "name": "embedding_not_null_check", + "value": "\"embedding\" IS NOT NULL" + } + }, + "isRLSEnabled": false + }, + "public.environment": { + "name": "environment", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "variables": { + "name": "variables", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "environment_user_id_user_id_fk": { + "name": "environment_user_id_user_id_fk", + "tableFrom": "environment", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "environment_user_id_unique": { + "name": "environment_user_id_unique", + "nullsNotDistinct": false, + "columns": ["user_id"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.execution_large_value_dependencies": { + "name": "execution_large_value_dependencies", + "schema": "", + "columns": { + "parent_key": { + "name": "parent_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "child_key": { + "name": "child_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "execution_large_value_dependencies_workspace_parent_key_idx": { + "name": "execution_large_value_dependencies_workspace_parent_key_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "parent_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "execution_large_value_dependencies_workspace_child_key_idx": { + "name": "execution_large_value_dependencies_workspace_child_key_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "child_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "execution_large_value_dependencies_workspace_id_workspace_id_fk": { + "name": "execution_large_value_dependencies_workspace_id_workspace_id_fk", + "tableFrom": "execution_large_value_dependencies", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "execution_large_value_dependencies_parent_key_child_key_pk": { + "name": "execution_large_value_dependencies_parent_key_child_key_pk", + "columns": ["parent_key", "child_key"] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.execution_large_value_references": { + "name": "execution_large_value_references", + "schema": "", + "columns": { + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "execution_id": { + "name": "execution_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source": { + "name": "source", + "type": "execution_large_value_reference_source", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "execution_large_value_references_workspace_execution_source_idx": { + "name": "execution_large_value_references_workspace_execution_source_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "execution_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "source", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "execution_large_value_references_workspace_id_workspace_id_fk": { + "name": "execution_large_value_references_workspace_id_workspace_id_fk", + "tableFrom": "execution_large_value_references", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "execution_large_value_references_workflow_id_workflow_id_fk": { + "name": "execution_large_value_references_workflow_id_workflow_id_fk", + "tableFrom": "execution_large_value_references", + "tableTo": "workflow", + "columnsFrom": ["workflow_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "execution_large_value_references_key_execution_id_source_pk": { + "name": "execution_large_value_references_key_execution_id_source_pk", + "columns": ["key", "execution_id", "source"] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.execution_large_values": { + "name": "execution_large_values", + "schema": "", + "columns": { + "key": { + "name": "key", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "owner_execution_id": { + "name": "owner_execution_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "size": { + "name": "size", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "execution_large_values_owner_execution_id_idx": { + "name": "execution_large_values_owner_execution_id_idx", + "columns": [ + { + "expression": "owner_execution_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "execution_large_values_cleanup_idx": { + "name": "execution_large_values_cleanup_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"execution_large_values\".\"deleted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "execution_large_values_tombstone_cleanup_idx": { + "name": "execution_large_values_tombstone_cleanup_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"execution_large_values\".\"deleted_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "execution_large_values_workspace_id_workspace_id_fk": { + "name": "execution_large_values_workspace_id_workspace_id_fk", + "tableFrom": "execution_large_values", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "execution_large_values_workflow_id_workflow_id_fk": { + "name": "execution_large_values_workflow_id_workflow_id_fk", + "tableFrom": "execution_large_values", + "tableTo": "workflow", + "columnsFrom": ["workflow_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.idempotency_key": { + "name": "idempotency_key", + "schema": "", + "columns": { + "key": { + "name": "key", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "result": { + "name": "result", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "idempotency_key_created_at_idx": { + "name": "idempotency_key_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.invitation": { + "name": "invitation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "kind": { + "name": "kind", + "type": "invitation_kind", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'organization'" + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "inviter_id": { + "name": "inviter_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "membership_intent": { + "name": "membership_intent", + "type": "invitation_membership_intent", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'internal'" + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "invitation_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "invitation_email_idx": { + "name": "invitation_email_idx", + "columns": [ + { + "expression": "email", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "invitation_organization_id_idx": { + "name": "invitation_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "invitation_status_idx": { + "name": "invitation_status_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "invitation_pending_email_org_unique": { + "name": "invitation_pending_email_org_unique", + "columns": [ + { + "expression": "email", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"invitation\".\"status\" = 'pending' AND \"invitation\".\"organization_id\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "invitation_inviter_id_user_id_fk": { + "name": "invitation_inviter_id_user_id_fk", + "tableFrom": "invitation", + "tableTo": "user", + "columnsFrom": ["inviter_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "invitation_organization_id_organization_id_fk": { + "name": "invitation_organization_id_organization_id_fk", + "tableFrom": "invitation", + "tableTo": "organization", + "columnsFrom": ["organization_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "invitation_token_unique": { + "name": "invitation_token_unique", + "nullsNotDistinct": false, + "columns": ["token"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.invitation_workspace_grant": { + "name": "invitation_workspace_grant", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "invitation_id": { + "name": "invitation_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "permission": { + "name": "permission", + "type": "permission_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "invitation_workspace_grant_unique": { + "name": "invitation_workspace_grant_unique", + "columns": [ + { + "expression": "invitation_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "invitation_workspace_grant_workspace_id_idx": { + "name": "invitation_workspace_grant_workspace_id_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "invitation_workspace_grant_invitation_id_invitation_id_fk": { + "name": "invitation_workspace_grant_invitation_id_invitation_id_fk", + "tableFrom": "invitation_workspace_grant", + "tableTo": "invitation", + "columnsFrom": ["invitation_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "invitation_workspace_grant_workspace_id_workspace_id_fk": { + "name": "invitation_workspace_grant_workspace_id_workspace_id_fk", + "tableFrom": "invitation_workspace_grant", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.job_execution_logs": { + "name": "job_execution_logs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "schedule_id": { + "name": "schedule_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "execution_id": { + "name": "execution_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "level": { + "name": "level", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'running'" + }, + "trigger": { + "name": "trigger", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "started_at": { + "name": "started_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "ended_at": { + "name": "ended_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "total_duration_ms": { + "name": "total_duration_ms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "execution_data": { + "name": "execution_data", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "cost": { + "name": "cost", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "job_execution_logs_schedule_id_idx": { + "name": "job_execution_logs_schedule_id_idx", + "columns": [ + { + "expression": "schedule_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "job_execution_logs_workspace_started_at_idx": { + "name": "job_execution_logs_workspace_started_at_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "started_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "job_execution_logs_workspace_ended_at_id_idx": { + "name": "job_execution_logs_workspace_ended_at_id_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "date_trunc('milliseconds', \"ended_at\")", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "job_execution_logs_execution_id_unique": { + "name": "job_execution_logs_execution_id_unique", + "columns": [ + { + "expression": "execution_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "job_execution_logs_trigger_idx": { + "name": "job_execution_logs_trigger_idx", + "columns": [ + { + "expression": "trigger", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "job_execution_logs_schedule_id_workflow_schedule_id_fk": { + "name": "job_execution_logs_schedule_id_workflow_schedule_id_fk", + "tableFrom": "job_execution_logs", + "tableTo": "workflow_schedule", + "columnsFrom": ["schedule_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + }, + "job_execution_logs_workspace_id_workspace_id_fk": { + "name": "job_execution_logs_workspace_id_workspace_id_fk", + "tableFrom": "job_execution_logs", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.knowledge_base": { + "name": "knowledge_base", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "token_count": { + "name": "token_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "embedding_model": { + "name": "embedding_model", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'text-embedding-3-small'" + }, + "embedding_dimension": { + "name": "embedding_dimension", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1536 + }, + "chunking_config": { + "name": "chunking_config", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'{\"maxSize\": 1024, \"minSize\": 1, \"overlap\": 200}'" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "kb_user_id_idx": { + "name": "kb_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "kb_workspace_id_idx": { + "name": "kb_workspace_id_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "kb_user_workspace_idx": { + "name": "kb_user_workspace_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "kb_deleted_at_idx": { + "name": "kb_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "kb_workspace_deleted_partial_idx": { + "name": "kb_workspace_deleted_partial_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"knowledge_base\".\"deleted_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "kb_workspace_name_active_unique": { + "name": "kb_workspace_name_active_unique", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"knowledge_base\".\"deleted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "knowledge_base_user_id_user_id_fk": { + "name": "knowledge_base_user_id_user_id_fk", + "tableFrom": "knowledge_base", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "knowledge_base_workspace_id_workspace_id_fk": { + "name": "knowledge_base_workspace_id_workspace_id_fk", + "tableFrom": "knowledge_base", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.knowledge_base_tag_definitions": { + "name": "knowledge_base_tag_definitions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "knowledge_base_id": { + "name": "knowledge_base_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tag_slot": { + "name": "tag_slot", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "display_name": { + "name": "display_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "field_type": { + "name": "field_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'text'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "kb_tag_definitions_kb_slot_idx": { + "name": "kb_tag_definitions_kb_slot_idx", + "columns": [ + { + "expression": "knowledge_base_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "tag_slot", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "kb_tag_definitions_kb_display_name_idx": { + "name": "kb_tag_definitions_kb_display_name_idx", + "columns": [ + { + "expression": "knowledge_base_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "display_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "kb_tag_definitions_kb_id_idx": { + "name": "kb_tag_definitions_kb_id_idx", + "columns": [ + { + "expression": "knowledge_base_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "knowledge_base_tag_definitions_knowledge_base_id_knowledge_base_id_fk": { + "name": "knowledge_base_tag_definitions_knowledge_base_id_knowledge_base_id_fk", + "tableFrom": "knowledge_base_tag_definitions", + "tableTo": "knowledge_base", + "columnsFrom": ["knowledge_base_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.knowledge_connector": { + "name": "knowledge_connector", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "knowledge_base_id": { + "name": "knowledge_base_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "connector_type": { + "name": "connector_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "credential_id": { + "name": "credential_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "encrypted_api_key": { + "name": "encrypted_api_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "source_config": { + "name": "source_config", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "sync_mode": { + "name": "sync_mode", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'full'" + }, + "sync_interval_minutes": { + "name": "sync_interval_minutes", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1440 + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "last_sync_at": { + "name": "last_sync_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "last_sync_error": { + "name": "last_sync_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "last_sync_doc_count": { + "name": "last_sync_doc_count", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "next_sync_at": { + "name": "next_sync_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "consecutive_failures": { + "name": "consecutive_failures", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "archived_at": { + "name": "archived_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "kc_knowledge_base_id_idx": { + "name": "kc_knowledge_base_id_idx", + "columns": [ + { + "expression": "knowledge_base_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "kc_status_next_sync_idx": { + "name": "kc_status_next_sync_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "next_sync_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "kc_archived_at_partial_idx": { + "name": "kc_archived_at_partial_idx", + "columns": [ + { + "expression": "archived_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"knowledge_connector\".\"archived_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "kc_deleted_at_partial_idx": { + "name": "kc_deleted_at_partial_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"knowledge_connector\".\"deleted_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "knowledge_connector_knowledge_base_id_knowledge_base_id_fk": { + "name": "knowledge_connector_knowledge_base_id_knowledge_base_id_fk", + "tableFrom": "knowledge_connector", + "tableTo": "knowledge_base", + "columnsFrom": ["knowledge_base_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.knowledge_connector_sync_log": { + "name": "knowledge_connector_sync_log", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "connector_id": { + "name": "connector_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "started_at": { + "name": "started_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "docs_added": { + "name": "docs_added", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "docs_updated": { + "name": "docs_updated", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "docs_deleted": { + "name": "docs_deleted", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "docs_unchanged": { + "name": "docs_unchanged", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "docs_failed": { + "name": "docs_failed", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "error_message": { + "name": "error_message", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "kcsl_connector_id_idx": { + "name": "kcsl_connector_id_idx", + "columns": [ + { + "expression": "connector_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "knowledge_connector_sync_log_connector_id_knowledge_connector_id_fk": { + "name": "knowledge_connector_sync_log_connector_id_knowledge_connector_id_fk", + "tableFrom": "knowledge_connector_sync_log", + "tableTo": "knowledge_connector", + "columnsFrom": ["connector_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.mcp_server_oauth": { + "name": "mcp_server_oauth", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "mcp_server_id": { + "name": "mcp_server_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "client_information": { + "name": "client_information", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tokens": { + "name": "tokens", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "code_verifier": { + "name": "code_verifier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "state": { + "name": "state", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "state_created_at": { + "name": "state_created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "last_refreshed_at": { + "name": "last_refreshed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "mcp_server_oauth_server_unique": { + "name": "mcp_server_oauth_server_unique", + "columns": [ + { + "expression": "mcp_server_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "mcp_server_oauth_state_idx": { + "name": "mcp_server_oauth_state_idx", + "columns": [ + { + "expression": "state", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "mcp_server_oauth_mcp_server_id_mcp_servers_id_fk": { + "name": "mcp_server_oauth_mcp_server_id_mcp_servers_id_fk", + "tableFrom": "mcp_server_oauth", + "tableTo": "mcp_servers", + "columnsFrom": ["mcp_server_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mcp_server_oauth_user_id_user_id_fk": { + "name": "mcp_server_oauth_user_id_user_id_fk", + "tableFrom": "mcp_server_oauth", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + }, + "mcp_server_oauth_workspace_id_workspace_id_fk": { + "name": "mcp_server_oauth_workspace_id_workspace_id_fk", + "tableFrom": "mcp_server_oauth", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.mcp_servers": { + "name": "mcp_servers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "transport": { + "name": "transport", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "url": { + "name": "url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "auth_type": { + "name": "auth_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'headers'" + }, + "oauth_client_id": { + "name": "oauth_client_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oauth_client_secret": { + "name": "oauth_client_secret", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "headers": { + "name": "headers", + "type": "json", + "primaryKey": false, + "notNull": false, + "default": "'{}'" + }, + "timeout": { + "name": "timeout", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 30000 + }, + "retries": { + "name": "retries", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 3 + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "last_connected": { + "name": "last_connected", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "connection_status": { + "name": "connection_status", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'disconnected'" + }, + "last_error": { + "name": "last_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status_config": { + "name": "status_config", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'{}'" + }, + "tool_count": { + "name": "tool_count", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "last_tools_refresh": { + "name": "last_tools_refresh", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "total_requests": { + "name": "total_requests", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "last_used": { + "name": "last_used", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "mcp_servers_workspace_enabled_idx": { + "name": "mcp_servers_workspace_enabled_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "enabled", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "mcp_servers_workspace_deleted_partial_idx": { + "name": "mcp_servers_workspace_deleted_partial_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"mcp_servers\".\"deleted_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "mcp_servers_workspace_id_workspace_id_fk": { + "name": "mcp_servers_workspace_id_workspace_id_fk", + "tableFrom": "mcp_servers", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mcp_servers_created_by_user_id_fk": { + "name": "mcp_servers_created_by_user_id_fk", + "tableFrom": "mcp_servers", + "tableTo": "user", + "columnsFrom": ["created_by"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.member": { + "name": "member", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "member_user_id_unique": { + "name": "member_user_id_unique", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "member_organization_id_idx": { + "name": "member_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "member_user_id_user_id_fk": { + "name": "member_user_id_user_id_fk", + "tableFrom": "member", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "member_organization_id_organization_id_fk": { + "name": "member_organization_id_organization_id_fk", + "tableFrom": "member", + "tableTo": "organization", + "columnsFrom": ["organization_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.memory": { + "name": "memory", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "data": { + "name": "data", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "memory_key_idx": { + "name": "memory_key_idx", + "columns": [ + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "memory_workspace_idx": { + "name": "memory_workspace_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "memory_workspace_key_idx": { + "name": "memory_workspace_key_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "memory_workspace_deleted_partial_idx": { + "name": "memory_workspace_deleted_partial_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"memory\".\"deleted_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "memory_workspace_id_workspace_id_fk": { + "name": "memory_workspace_id_workspace_id_fk", + "tableFrom": "memory", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.mothership_inbox_allowed_sender": { + "name": "mothership_inbox_allowed_sender", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "label": { + "name": "label", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "added_by": { + "name": "added_by", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "inbox_sender_ws_email_idx": { + "name": "inbox_sender_ws_email_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "email", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "mothership_inbox_allowed_sender_workspace_id_workspace_id_fk": { + "name": "mothership_inbox_allowed_sender_workspace_id_workspace_id_fk", + "tableFrom": "mothership_inbox_allowed_sender", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mothership_inbox_allowed_sender_added_by_user_id_fk": { + "name": "mothership_inbox_allowed_sender_added_by_user_id_fk", + "tableFrom": "mothership_inbox_allowed_sender", + "tableTo": "user", + "columnsFrom": ["added_by"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.mothership_inbox_task": { + "name": "mothership_inbox_task", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "from_email": { + "name": "from_email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "from_name": { + "name": "from_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "subject": { + "name": "subject", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "body_preview": { + "name": "body_preview", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "body_text": { + "name": "body_text", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "body_html": { + "name": "body_html", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "email_message_id": { + "name": "email_message_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "in_reply_to": { + "name": "in_reply_to", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "response_message_id": { + "name": "response_message_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "agentmail_message_id": { + "name": "agentmail_message_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'received'" + }, + "chat_id": { + "name": "chat_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "trigger_job_id": { + "name": "trigger_job_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "result_summary": { + "name": "result_summary", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "error_message": { + "name": "error_message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "rejection_reason": { + "name": "rejection_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "has_attachments": { + "name": "has_attachments", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "cc_recipients": { + "name": "cc_recipients", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "processing_started_at": { + "name": "processing_started_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "inbox_task_ws_created_at_idx": { + "name": "inbox_task_ws_created_at_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "inbox_task_ws_status_idx": { + "name": "inbox_task_ws_status_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "inbox_task_response_msg_id_idx": { + "name": "inbox_task_response_msg_id_idx", + "columns": [ + { + "expression": "response_message_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "inbox_task_email_msg_id_idx": { + "name": "inbox_task_email_msg_id_idx", + "columns": [ + { + "expression": "email_message_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "mothership_inbox_task_workspace_id_workspace_id_fk": { + "name": "mothership_inbox_task_workspace_id_workspace_id_fk", + "tableFrom": "mothership_inbox_task", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "mothership_inbox_task_chat_id_copilot_chats_id_fk": { + "name": "mothership_inbox_task_chat_id_copilot_chats_id_fk", + "tableFrom": "mothership_inbox_task", + "tableTo": "copilot_chats", + "columnsFrom": ["chat_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.mothership_inbox_webhook": { + "name": "mothership_inbox_webhook", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "webhook_id": { + "name": "webhook_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "secret": { + "name": "secret", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "mothership_inbox_webhook_workspace_id_workspace_id_fk": { + "name": "mothership_inbox_webhook_workspace_id_workspace_id_fk", + "tableFrom": "mothership_inbox_webhook", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "mothership_inbox_webhook_workspace_id_unique": { + "name": "mothership_inbox_webhook_workspace_id_unique", + "nullsNotDistinct": false, + "columns": ["workspace_id"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.mothership_settings": { + "name": "mothership_settings", + "schema": "", + "columns": { + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "mcp_tool_refs": { + "name": "mcp_tool_refs", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "custom_tool_refs": { + "name": "custom_tool_refs", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "skill_refs": { + "name": "skill_refs", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "mothership_settings_workspace_id_idx": { + "name": "mothership_settings_workspace_id_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "mothership_settings_workspace_id_workspace_id_fk": { + "name": "mothership_settings_workspace_id_workspace_id_fk", + "tableFrom": "mothership_settings", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.organization": { + "name": "organization", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "logo": { + "name": "logo", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "whitelabel_settings": { + "name": "whitelabel_settings", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "data_retention_settings": { + "name": "data_retention_settings", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "org_usage_limit": { + "name": "org_usage_limit", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "storage_used_bytes": { + "name": "storage_used_bytes", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "limit_notifications": { + "name": "limit_notifications", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "departed_member_usage": { + "name": "departed_member_usage", + "type": "numeric", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "credit_balance": { + "name": "credit_balance", + "type": "numeric", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.organization_member_usage_limit": { + "name": "organization_member_usage_limit", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "usage_limit": { + "name": "usage_limit", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "set_by": { + "name": "set_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "org_member_usage_limit_org_user_unique": { + "name": "org_member_usage_limit_org_user_unique", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "org_member_usage_limit_organization_id_idx": { + "name": "org_member_usage_limit_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "organization_member_usage_limit_organization_id_organization_id_fk": { + "name": "organization_member_usage_limit_organization_id_organization_id_fk", + "tableFrom": "organization_member_usage_limit", + "tableTo": "organization", + "columnsFrom": ["organization_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "organization_member_usage_limit_user_id_user_id_fk": { + "name": "organization_member_usage_limit_user_id_user_id_fk", + "tableFrom": "organization_member_usage_limit", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "organization_member_usage_limit_set_by_user_id_fk": { + "name": "organization_member_usage_limit_set_by_user_id_fk", + "tableFrom": "organization_member_usage_limit", + "tableTo": "user", + "columnsFrom": ["set_by"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.outbox_event": { + "name": "outbox_event", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "event_type": { + "name": "event_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "payload": { + "name": "payload", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "attempts": { + "name": "attempts", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "max_attempts": { + "name": "max_attempts", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 10 + }, + "available_at": { + "name": "available_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "locked_at": { + "name": "locked_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "last_error": { + "name": "last_error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "processed_at": { + "name": "processed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "outbox_event_status_available_idx": { + "name": "outbox_event_status_available_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "available_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "outbox_event_locked_at_idx": { + "name": "outbox_event_locked_at_idx", + "columns": [ + { + "expression": "locked_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.paused_executions": { + "name": "paused_executions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "execution_id": { + "name": "execution_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "execution_snapshot": { + "name": "execution_snapshot", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "pause_points": { + "name": "pause_points", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "total_pause_count": { + "name": "total_pause_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "resumed_count": { + "name": "resumed_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'paused'" + }, + "metadata": { + "name": "metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "paused_at": { + "name": "paused_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "next_resume_at": { + "name": "next_resume_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "paused_executions_workflow_id_idx": { + "name": "paused_executions_workflow_id_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "paused_executions_status_idx": { + "name": "paused_executions_status_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "paused_executions_execution_id_unique": { + "name": "paused_executions_execution_id_unique", + "columns": [ + { + "expression": "execution_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "paused_executions_next_resume_at_idx": { + "name": "paused_executions_next_resume_at_idx", + "columns": [ + { + "expression": "next_resume_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "status = 'paused' AND next_resume_at IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "paused_executions_workflow_id_workflow_id_fk": { + "name": "paused_executions_workflow_id_workflow_id_fk", + "tableFrom": "paused_executions", + "tableTo": "workflow", + "columnsFrom": ["workflow_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.pending_credential_draft": { + "name": "pending_credential_draft", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider_id": { + "name": "provider_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "display_name": { + "name": "display_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "credential_id": { + "name": "credential_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "pending_draft_user_provider_ws": { + "name": "pending_draft_user_provider_ws", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "provider_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "pending_credential_draft_user_id_user_id_fk": { + "name": "pending_credential_draft_user_id_user_id_fk", + "tableFrom": "pending_credential_draft", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "pending_credential_draft_workspace_id_workspace_id_fk": { + "name": "pending_credential_draft_workspace_id_workspace_id_fk", + "tableFrom": "pending_credential_draft", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "pending_credential_draft_credential_id_credential_id_fk": { + "name": "pending_credential_draft_credential_id_credential_id_fk", + "tableFrom": "pending_credential_draft", + "tableTo": "credential", + "columnsFrom": ["credential_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.permission_group": { + "name": "permission_group", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "config": { + "name": "config", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + } + }, + "indexes": { + "permission_group_created_by_idx": { + "name": "permission_group_created_by_idx", + "columns": [ + { + "expression": "created_by", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "permission_group_organization_name_unique": { + "name": "permission_group_organization_name_unique", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "permission_group_organization_default_unique": { + "name": "permission_group_organization_default_unique", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "is_default = true", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "permission_group_organization_id_organization_id_fk": { + "name": "permission_group_organization_id_organization_id_fk", + "tableFrom": "permission_group", + "tableTo": "organization", + "columnsFrom": ["organization_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "permission_group_created_by_user_id_fk": { + "name": "permission_group_created_by_user_id_fk", + "tableFrom": "permission_group", + "tableTo": "user", + "columnsFrom": ["created_by"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.permission_group_member": { + "name": "permission_group_member", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "permission_group_id": { + "name": "permission_group_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "assigned_by": { + "name": "assigned_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "assigned_at": { + "name": "assigned_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "permission_group_member_group_id_idx": { + "name": "permission_group_member_group_id_idx", + "columns": [ + { + "expression": "permission_group_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "permission_group_member_group_user_unique": { + "name": "permission_group_member_group_user_unique", + "columns": [ + { + "expression": "permission_group_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "permission_group_member_organization_user_idx": { + "name": "permission_group_member_organization_user_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "permission_group_member_permission_group_id_permission_group_id_fk": { + "name": "permission_group_member_permission_group_id_permission_group_id_fk", + "tableFrom": "permission_group_member", + "tableTo": "permission_group", + "columnsFrom": ["permission_group_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "permission_group_member_organization_id_organization_id_fk": { + "name": "permission_group_member_organization_id_organization_id_fk", + "tableFrom": "permission_group_member", + "tableTo": "organization", + "columnsFrom": ["organization_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "permission_group_member_user_id_user_id_fk": { + "name": "permission_group_member_user_id_user_id_fk", + "tableFrom": "permission_group_member", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "permission_group_member_assigned_by_user_id_fk": { + "name": "permission_group_member_assigned_by_user_id_fk", + "tableFrom": "permission_group_member", + "tableTo": "user", + "columnsFrom": ["assigned_by"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.permission_group_workspace": { + "name": "permission_group_workspace", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "permission_group_id": { + "name": "permission_group_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "permission_group_workspace_workspace_id_idx": { + "name": "permission_group_workspace_workspace_id_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "permission_group_workspace_group_workspace_unique": { + "name": "permission_group_workspace_group_workspace_unique", + "columns": [ + { + "expression": "permission_group_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "permission_group_workspace_permission_group_id_permission_group_id_fk": { + "name": "permission_group_workspace_permission_group_id_permission_group_id_fk", + "tableFrom": "permission_group_workspace", + "tableTo": "permission_group", + "columnsFrom": ["permission_group_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "permission_group_workspace_workspace_id_workspace_id_fk": { + "name": "permission_group_workspace_workspace_id_workspace_id_fk", + "tableFrom": "permission_group_workspace", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "permission_group_workspace_organization_id_organization_id_fk": { + "name": "permission_group_workspace_organization_id_organization_id_fk", + "tableFrom": "permission_group_workspace", + "tableTo": "organization", + "columnsFrom": ["organization_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.permissions": { + "name": "permissions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "entity_type": { + "name": "entity_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "entity_id": { + "name": "entity_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "permission_type": { + "name": "permission_type", + "type": "permission_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "permissions_user_id_idx": { + "name": "permissions_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "permissions_entity_idx": { + "name": "permissions_entity_idx", + "columns": [ + { + "expression": "entity_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "entity_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "permissions_user_entity_type_idx": { + "name": "permissions_user_entity_type_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "entity_type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "permissions_user_entity_permission_idx": { + "name": "permissions_user_entity_permission_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "entity_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "permission_type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "permissions_user_entity_idx": { + "name": "permissions_user_entity_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "entity_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "entity_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "permissions_unique_constraint": { + "name": "permissions_unique_constraint", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "entity_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "entity_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "permissions_user_id_user_id_fk": { + "name": "permissions_user_id_user_id_fk", + "tableFrom": "permissions", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.public_share": { + "name": "public_share", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "resource_type": { + "name": "resource_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "resource_id": { + "name": "resource_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_active": { + "name": "is_active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "auth_type": { + "name": "auth_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'public'" + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "allowed_emails": { + "name": "allowed_emails", + "type": "json", + "primaryKey": false, + "notNull": false, + "default": "'[]'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "public_share_token_unique": { + "name": "public_share_token_unique", + "columns": [ + { + "expression": "token", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "public_share_resource_unique": { + "name": "public_share_resource_unique", + "columns": [ + { + "expression": "resource_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "resource_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "public_share_resource_id_idx": { + "name": "public_share_resource_id_idx", + "columns": [ + { + "expression": "resource_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "public_share_workspace_id_idx": { + "name": "public_share_workspace_id_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "public_share_workspace_id_workspace_id_fk": { + "name": "public_share_workspace_id_workspace_id_fk", + "tableFrom": "public_share", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "public_share_created_by_user_id_fk": { + "name": "public_share_created_by_user_id_fk", + "tableFrom": "public_share", + "tableTo": "user", + "columnsFrom": ["created_by"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.rate_limit_bucket": { + "name": "rate_limit_bucket", + "schema": "", + "columns": { + "key": { + "name": "key", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "tokens": { + "name": "tokens", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "last_refill_at": { + "name": "last_refill_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.resume_queue": { + "name": "resume_queue", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "paused_execution_id": { + "name": "paused_execution_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "parent_execution_id": { + "name": "parent_execution_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "new_execution_id": { + "name": "new_execution_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "context_id": { + "name": "context_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "resume_input": { + "name": "resume_input", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "queued_at": { + "name": "queued_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "claimed_at": { + "name": "claimed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "failure_reason": { + "name": "failure_reason", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "resume_queue_parent_status_idx": { + "name": "resume_queue_parent_status_idx", + "columns": [ + { + "expression": "parent_execution_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "queued_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "resume_queue_new_execution_idx": { + "name": "resume_queue_new_execution_idx", + "columns": [ + { + "expression": "new_execution_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "resume_queue_paused_execution_id_paused_executions_id_fk": { + "name": "resume_queue_paused_execution_id_paused_executions_id_fk", + "tableFrom": "resume_queue", + "tableTo": "paused_executions", + "columnsFrom": ["paused_execution_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.session": { + "name": "session", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "ip_address": { + "name": "ip_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_agent": { + "name": "user_agent", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "active_organization_id": { + "name": "active_organization_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "impersonated_by": { + "name": "impersonated_by", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "session_user_id_idx": { + "name": "session_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "session_token_idx": { + "name": "session_token_idx", + "columns": [ + { + "expression": "token", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "session_user_id_user_id_fk": { + "name": "session_user_id_user_id_fk", + "tableFrom": "session", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "session_active_organization_id_organization_id_fk": { + "name": "session_active_organization_id_organization_id_fk", + "tableFrom": "session", + "tableTo": "organization", + "columnsFrom": ["active_organization_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "session_token_unique": { + "name": "session_token_unique", + "nullsNotDistinct": false, + "columns": ["token"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.settings": { + "name": "settings", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "theme": { + "name": "theme", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'system'" + }, + "auto_connect": { + "name": "auto_connect", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "telemetry_enabled": { + "name": "telemetry_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "email_preferences": { + "name": "email_preferences", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "billing_usage_notifications_enabled": { + "name": "billing_usage_notifications_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "show_training_controls": { + "name": "show_training_controls", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "super_user_mode_enabled": { + "name": "super_user_mode_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "mothership_environment": { + "name": "mothership_environment", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'default'" + }, + "error_notifications_enabled": { + "name": "error_notifications_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "snap_to_grid_size": { + "name": "snap_to_grid_size", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "show_action_bar": { + "name": "show_action_bar", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "timezone": { + "name": "timezone", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "copilot_enabled_models": { + "name": "copilot_enabled_models", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "copilot_auto_allowed_tools": { + "name": "copilot_auto_allowed_tools", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'" + }, + "last_active_workspace_id": { + "name": "last_active_workspace_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "settings_user_id_user_id_fk": { + "name": "settings_user_id_user_id_fk", + "tableFrom": "settings", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "settings_user_id_unique": { + "name": "settings_user_id_unique", + "nullsNotDistinct": false, + "columns": ["user_id"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.sim_trigger_state": { + "name": "sim_trigger_state", + "schema": "", + "columns": { + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "block_id": { + "name": "block_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "scope_key": { + "name": "scope_key", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "''" + }, + "last_fired_at": { + "name": "last_fired_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "sim_trigger_state_workflow_id_workflow_id_fk": { + "name": "sim_trigger_state_workflow_id_workflow_id_fk", + "tableFrom": "sim_trigger_state", + "tableTo": "workflow", + "columnsFrom": ["workflow_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "sim_trigger_state_workflow_id_block_id_scope_key_pk": { + "name": "sim_trigger_state_workflow_id_block_id_scope_key_pk", + "columns": ["workflow_id", "block_id", "scope_key"] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.skill": { + "name": "skill", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "skill_workspace_name_unique": { + "name": "skill_workspace_name_unique", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "skill_workspace_id_workspace_id_fk": { + "name": "skill_workspace_id_workspace_id_fk", + "tableFrom": "skill", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "skill_user_id_user_id_fk": { + "name": "skill_user_id_user_id_fk", + "tableFrom": "skill", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.sso_provider": { + "name": "sso_provider", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "issuer": { + "name": "issuer", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "domain": { + "name": "domain", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "oidc_config": { + "name": "oidc_config", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "saml_config": { + "name": "saml_config", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider_id": { + "name": "provider_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "sso_provider_provider_id_idx": { + "name": "sso_provider_provider_id_idx", + "columns": [ + { + "expression": "provider_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "sso_provider_domain_idx": { + "name": "sso_provider_domain_idx", + "columns": [ + { + "expression": "domain", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "sso_provider_user_id_idx": { + "name": "sso_provider_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "sso_provider_organization_id_idx": { + "name": "sso_provider_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "sso_provider_user_id_user_id_fk": { + "name": "sso_provider_user_id_user_id_fk", + "tableFrom": "sso_provider", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "sso_provider_organization_id_organization_id_fk": { + "name": "sso_provider_organization_id_organization_id_fk", + "tableFrom": "sso_provider", + "tableTo": "organization", + "columnsFrom": ["organization_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.subscription": { + "name": "subscription", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "plan": { + "name": "plan", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "reference_id": { + "name": "reference_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "stripe_customer_id": { + "name": "stripe_customer_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "stripe_subscription_id": { + "name": "stripe_subscription_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "period_start": { + "name": "period_start", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "period_end": { + "name": "period_end", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "cancel_at_period_end": { + "name": "cancel_at_period_end", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "cancel_at": { + "name": "cancel_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "canceled_at": { + "name": "canceled_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "ended_at": { + "name": "ended_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "seats": { + "name": "seats", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "trial_start": { + "name": "trial_start", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "trial_end": { + "name": "trial_end", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "billing_interval": { + "name": "billing_interval", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "stripe_schedule_id": { + "name": "stripe_schedule_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "type": "json", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "subscription_reference_status_idx": { + "name": "subscription_reference_status_idx", + "columns": [ + { + "expression": "reference_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "check_enterprise_metadata": { + "name": "check_enterprise_metadata", + "value": "plan != 'enterprise' OR metadata IS NOT NULL" + } + }, + "isRLSEnabled": false + }, + "public.table_jobs": { + "name": "table_jobs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "table_id": { + "name": "table_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'running'" + }, + "payload": { + "name": "payload", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "rows_processed": { + "name": "rows_processed", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "started_at": { + "name": "started_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "table_jobs_one_active_per_table": { + "name": "table_jobs_one_active_per_table", + "columns": [ + { + "expression": "table_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"table_jobs\".\"status\" = 'running' AND \"table_jobs\".\"type\" <> 'export'", + "concurrently": false, + "method": "btree", + "with": {} + }, + "table_jobs_watchdog_idx": { + "name": "table_jobs_watchdog_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "updated_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "table_jobs_table_started_idx": { + "name": "table_jobs_table_started_idx", + "columns": [ + { + "expression": "table_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "started_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "table_jobs_table_id_user_table_definitions_id_fk": { + "name": "table_jobs_table_id_user_table_definitions_id_fk", + "tableFrom": "table_jobs", + "tableTo": "user_table_definitions", + "columnsFrom": ["table_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "table_jobs_workspace_id_workspace_id_fk": { + "name": "table_jobs_workspace_id_workspace_id_fk", + "tableFrom": "table_jobs", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.table_row_executions": { + "name": "table_row_executions", + "schema": "", + "columns": { + "table_id": { + "name": "table_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "row_id": { + "name": "row_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "group_id": { + "name": "group_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "execution_id": { + "name": "execution_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "job_id": { + "name": "job_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "error": { + "name": "error", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "running_block_ids": { + "name": "running_block_ids", + "type": "text[]", + "primaryKey": false, + "notNull": true, + "default": "'{}'::text[]" + }, + "block_errors": { + "name": "block_errors", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "cancelled_at": { + "name": "cancelled_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "enrichment_details": { + "name": "enrichment_details", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "table_row_executions_table_status_idx": { + "name": "table_row_executions_table_status_idx", + "columns": [ + { + "expression": "table_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"table_row_executions\".\"status\" IN ('queued', 'running', 'pending')", + "concurrently": false, + "method": "btree", + "with": {} + }, + "table_row_executions_execution_id_idx": { + "name": "table_row_executions_execution_id_idx", + "columns": [ + { + "expression": "execution_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"table_row_executions\".\"execution_id\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "table_row_executions_table_group_idx": { + "name": "table_row_executions_table_group_idx", + "columns": [ + { + "expression": "table_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "group_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "table_row_executions_table_id_user_table_definitions_id_fk": { + "name": "table_row_executions_table_id_user_table_definitions_id_fk", + "tableFrom": "table_row_executions", + "tableTo": "user_table_definitions", + "columnsFrom": ["table_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "table_row_executions_row_id_user_table_rows_id_fk": { + "name": "table_row_executions_row_id_user_table_rows_id_fk", + "tableFrom": "table_row_executions", + "tableTo": "user_table_rows", + "columnsFrom": ["row_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "table_row_executions_row_id_group_id_pk": { + "name": "table_row_executions_row_id_group_id_pk", + "columns": ["row_id", "group_id"] + } + }, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.table_run_dispatches": { + "name": "table_run_dispatches", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "table_id": { + "name": "table_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "request_id": { + "name": "request_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mode": { + "name": "mode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "scope": { + "name": "scope", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "cursor": { + "name": "cursor", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "limit": { + "name": "limit", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "processed_count": { + "name": "processed_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "is_manual_run": { + "name": "is_manual_run", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "triggered_by_user_id": { + "name": "triggered_by_user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "requested_at": { + "name": "requested_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "completed_at": { + "name": "completed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "cancelled_at": { + "name": "cancelled_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "table_run_dispatches_active_idx": { + "name": "table_run_dispatches_active_idx", + "columns": [ + { + "expression": "table_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "table_run_dispatches_watchdog_idx": { + "name": "table_run_dispatches_watchdog_idx", + "columns": [ + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "requested_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "table_run_dispatches_table_id_user_table_definitions_id_fk": { + "name": "table_run_dispatches_table_id_user_table_definitions_id_fk", + "tableFrom": "table_run_dispatches", + "tableTo": "user_table_definitions", + "columnsFrom": ["table_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "table_run_dispatches_workspace_id_workspace_id_fk": { + "name": "table_run_dispatches_workspace_id_workspace_id_fk", + "tableFrom": "table_run_dispatches", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "table_run_dispatches_triggered_by_user_id_user_id_fk": { + "name": "table_run_dispatches_triggered_by_user_id_user_id_fk", + "tableFrom": "table_run_dispatches", + "tableTo": "user", + "columnsFrom": ["triggered_by_user_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.usage_log": { + "name": "usage_log", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "category": { + "name": "category", + "type": "usage_log_category", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "source": { + "name": "source", + "type": "usage_log_source", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "metadata": { + "name": "metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "event_key": { + "name": "event_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "billing_entity_type": { + "name": "billing_entity_type", + "type": "billing_entity_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "billing_entity_id": { + "name": "billing_entity_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "billing_period_start": { + "name": "billing_period_start", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "billing_period_end": { + "name": "billing_period_end", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "execution_id": { + "name": "execution_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "usage_log_user_created_at_idx": { + "name": "usage_log_user_created_at_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "usage_log_source_idx": { + "name": "usage_log_source_idx", + "columns": [ + { + "expression": "source", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "usage_log_workspace_id_idx": { + "name": "usage_log_workspace_id_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "usage_log_workflow_id_idx": { + "name": "usage_log_workflow_id_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "usage_log_event_key_unique": { + "name": "usage_log_event_key_unique", + "columns": [ + { + "expression": "event_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"usage_log\".\"event_key\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "usage_log_billing_entity_period_idx": { + "name": "usage_log_billing_entity_period_idx", + "columns": [ + { + "expression": "billing_entity_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "billing_entity_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "billing_period_start", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "billing_period_end", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"usage_log\".\"billing_entity_type\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "usage_log_workspace_created_at_idx": { + "name": "usage_log_workspace_created_at_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "usage_log_execution_id_idx": { + "name": "usage_log_execution_id_idx", + "columns": [ + { + "expression": "execution_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "usage_log_user_id_user_id_fk": { + "name": "usage_log_user_id_user_id_fk", + "tableFrom": "usage_log", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "usage_log_workspace_id_workspace_id_fk": { + "name": "usage_log_workspace_id_workspace_id_fk", + "tableFrom": "usage_log", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + }, + "usage_log_workflow_id_workflow_id_fk": { + "name": "usage_log_workflow_id_workflow_id_fk", + "tableFrom": "usage_log", + "tableTo": "workflow", + "columnsFrom": ["workflow_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": { + "usage_log_billing_scope_all_or_none": { + "name": "usage_log_billing_scope_all_or_none", + "value": "(\n (\"usage_log\".\"billing_entity_type\" IS NULL AND \"usage_log\".\"billing_entity_id\" IS NULL AND \"usage_log\".\"billing_period_start\" IS NULL AND \"usage_log\".\"billing_period_end\" IS NULL)\n OR\n (\"usage_log\".\"billing_entity_type\" IS NOT NULL AND \"usage_log\".\"billing_entity_id\" IS NOT NULL AND \"usage_log\".\"billing_period_start\" IS NOT NULL AND \"usage_log\".\"billing_period_end\" IS NOT NULL AND \"usage_log\".\"billing_period_start\" < \"usage_log\".\"billing_period_end\")\n )" + } + }, + "isRLSEnabled": false + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "normalized_email": { + "name": "normalized_email", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "email_verified": { + "name": "email_verified", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "image": { + "name": "image", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "stripe_customer_id": { + "name": "stripe_customer_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'user'" + }, + "banned": { + "name": "banned", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "ban_reason": { + "name": "ban_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ban_expires": { + "name": "ban_expires", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "user_email_unique": { + "name": "user_email_unique", + "nullsNotDistinct": false, + "columns": ["email"] + }, + "user_normalized_email_unique": { + "name": "user_normalized_email_unique", + "nullsNotDistinct": false, + "columns": ["normalized_email"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user_stats": { + "name": "user_stats", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "total_manual_executions": { + "name": "total_manual_executions", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "total_api_calls": { + "name": "total_api_calls", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "total_webhook_triggers": { + "name": "total_webhook_triggers", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "total_scheduled_executions": { + "name": "total_scheduled_executions", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "total_chat_executions": { + "name": "total_chat_executions", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "total_mcp_executions": { + "name": "total_mcp_executions", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "total_tokens_used": { + "name": "total_tokens_used", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "total_cost": { + "name": "total_cost", + "type": "numeric", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "current_usage_limit": { + "name": "current_usage_limit", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "default": "'5'" + }, + "usage_limit_updated_at": { + "name": "usage_limit_updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "current_period_cost": { + "name": "current_period_cost", + "type": "numeric", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "last_period_cost": { + "name": "last_period_cost", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "default": "'0'" + }, + "billed_overage_this_period": { + "name": "billed_overage_this_period", + "type": "numeric", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "pro_period_cost_snapshot": { + "name": "pro_period_cost_snapshot", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "default": "'0'" + }, + "pro_period_cost_snapshot_at": { + "name": "pro_period_cost_snapshot_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "credit_balance": { + "name": "credit_balance", + "type": "numeric", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "total_copilot_cost": { + "name": "total_copilot_cost", + "type": "numeric", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "current_period_copilot_cost": { + "name": "current_period_copilot_cost", + "type": "numeric", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "last_period_copilot_cost": { + "name": "last_period_copilot_cost", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "default": "'0'" + }, + "total_copilot_tokens": { + "name": "total_copilot_tokens", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "total_copilot_calls": { + "name": "total_copilot_calls", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "total_mcp_copilot_calls": { + "name": "total_mcp_copilot_calls", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "total_mcp_copilot_cost": { + "name": "total_mcp_copilot_cost", + "type": "numeric", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "current_period_mcp_copilot_cost": { + "name": "current_period_mcp_copilot_cost", + "type": "numeric", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "storage_used_bytes": { + "name": "storage_used_bytes", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "last_active": { + "name": "last_active", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "billing_blocked": { + "name": "billing_blocked", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "billing_blocked_reason": { + "name": "billing_blocked_reason", + "type": "billing_blocked_reason", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "limit_notifications": { + "name": "limit_notifications", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + } + }, + "indexes": {}, + "foreignKeys": { + "user_stats_user_id_user_id_fk": { + "name": "user_stats_user_id_user_id_fk", + "tableFrom": "user_stats", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "user_stats_user_id_unique": { + "name": "user_stats_user_id_unique", + "nullsNotDistinct": false, + "columns": ["user_id"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user_table_definitions": { + "name": "user_table_definitions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "schema": { + "name": "schema", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "metadata": { + "name": "metadata", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "max_rows": { + "name": "max_rows", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 10000 + }, + "row_count": { + "name": "row_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "rows_version": { + "name": "rows_version", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "archived_at": { + "name": "archived_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "user_table_def_workspace_id_idx": { + "name": "user_table_def_workspace_id_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "user_table_def_workspace_name_unique": { + "name": "user_table_def_workspace_name_unique", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"user_table_definitions\".\"archived_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "user_table_def_archived_at_idx": { + "name": "user_table_def_archived_at_idx", + "columns": [ + { + "expression": "archived_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "user_table_def_workspace_archived_partial_idx": { + "name": "user_table_def_workspace_archived_partial_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "archived_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"user_table_definitions\".\"archived_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "user_table_definitions_workspace_id_workspace_id_fk": { + "name": "user_table_definitions_workspace_id_workspace_id_fk", + "tableFrom": "user_table_definitions", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "user_table_definitions_created_by_user_id_fk": { + "name": "user_table_definitions_created_by_user_id_fk", + "tableFrom": "user_table_definitions", + "tableTo": "user", + "columnsFrom": ["created_by"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user_table_rows": { + "name": "user_table_rows", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "table_id": { + "name": "table_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "data": { + "name": "data", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "position": { + "name": "position", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "order_key": { + "name": "order_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "user_table_rows_tenant_data_gin_idx": { + "name": "user_table_rows_tenant_data_gin_idx", + "columns": [ + { + "expression": "table_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "\"data\" jsonb_path_ops", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + }, + "user_table_rows_workspace_table_idx": { + "name": "user_table_rows_workspace_table_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "table_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "user_table_rows_table_position_idx": { + "name": "user_table_rows_table_position_idx", + "columns": [ + { + "expression": "table_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "position", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "user_table_rows_table_order_key_idx": { + "name": "user_table_rows_table_order_key_idx", + "columns": [ + { + "expression": "table_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "order_key", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "user_table_rows_table_id_id_idx": { + "name": "user_table_rows_table_id_id_idx", + "columns": [ + { + "expression": "table_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "user_table_rows_table_id_user_table_definitions_id_fk": { + "name": "user_table_rows_table_id_user_table_definitions_id_fk", + "tableFrom": "user_table_rows", + "tableTo": "user_table_definitions", + "columnsFrom": ["table_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "user_table_rows_workspace_id_workspace_id_fk": { + "name": "user_table_rows_workspace_id_workspace_id_fk", + "tableFrom": "user_table_rows", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "user_table_rows_created_by_user_id_fk": { + "name": "user_table_rows_created_by_user_id_fk", + "tableFrom": "user_table_rows", + "tableTo": "user", + "columnsFrom": ["created_by"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.verification": { + "name": "verification", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "identifier": { + "name": "identifier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "verification_identifier_idx": { + "name": "verification_identifier_idx", + "columns": [ + { + "expression": "identifier", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "verification_expires_at_idx": { + "name": "verification_expires_at_idx", + "columns": [ + { + "expression": "expires_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.waitlist": { + "name": "waitlist", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'pending'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "waitlist_email_unique": { + "name": "waitlist_email_unique", + "nullsNotDistinct": false, + "columns": ["email"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.webhook": { + "name": "webhook", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "deployment_version_id": { + "name": "deployment_version_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "block_id": { + "name": "block_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "provider_config": { + "name": "provider_config", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "is_active": { + "name": "is_active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "failed_count": { + "name": "failed_count", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "last_failed_at": { + "name": "last_failed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "archived_at": { + "name": "archived_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "path_deployment_unique": { + "name": "path_deployment_unique", + "columns": [ + { + "expression": "path", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "deployment_version_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"webhook\".\"archived_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "webhook_workflow_deployment_idx": { + "name": "webhook_workflow_deployment_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "deployment_version_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "webhook_archived_at_partial_idx": { + "name": "webhook_archived_at_partial_idx", + "columns": [ + { + "expression": "archived_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"webhook\".\"archived_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_webhook_on_provider_is_active_workflow_id_deploym_bdeed5468": { + "name": "idx_webhook_on_provider_is_active_workflow_id_deploym_bdeed5468", + "columns": [ + { + "expression": "provider", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_active", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "deployment_version_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_webhook_on_workflow_id_block_id_updated_at_desc": { + "name": "idx_webhook_on_workflow_id_block_id_updated_at_desc", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "block_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "updated_at", + "isExpression": false, + "asc": false, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "webhook_workflow_id_workflow_id_fk": { + "name": "webhook_workflow_id_workflow_id_fk", + "tableFrom": "webhook", + "tableTo": "workflow", + "columnsFrom": ["workflow_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "webhook_deployment_version_id_workflow_deployment_version_id_fk": { + "name": "webhook_deployment_version_id_workflow_deployment_version_id_fk", + "tableFrom": "webhook", + "tableTo": "workflow_deployment_version", + "columnsFrom": ["deployment_version_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workflow": { + "name": "workflow", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "folder_id": { + "name": "folder_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sort_order": { + "name": "sort_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "last_synced": { + "name": "last_synced", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "is_deployed": { + "name": "is_deployed", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "deployed_at": { + "name": "deployed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "is_public_api": { + "name": "is_public_api", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "locked": { + "name": "locked", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "run_count": { + "name": "run_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "last_run_at": { + "name": "last_run_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "variables": { + "name": "variables", + "type": "json", + "primaryKey": false, + "notNull": false, + "default": "'{}'" + }, + "archived_at": { + "name": "archived_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "workflow_user_id_idx": { + "name": "workflow_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_workspace_id_idx": { + "name": "workflow_workspace_id_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_user_workspace_idx": { + "name": "workflow_user_workspace_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_workspace_folder_name_active_unique": { + "name": "workflow_workspace_folder_name_active_unique", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "coalesce(\"folder_id\", '')", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"workflow\".\"archived_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_folder_sort_idx": { + "name": "workflow_folder_sort_idx", + "columns": [ + { + "expression": "folder_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "sort_order", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_archived_at_idx": { + "name": "workflow_archived_at_idx", + "columns": [ + { + "expression": "archived_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_workspace_archived_partial_idx": { + "name": "workflow_workspace_archived_partial_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "archived_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"workflow\".\"archived_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workflow_user_id_user_id_fk": { + "name": "workflow_user_id_user_id_fk", + "tableFrom": "workflow", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workflow_workspace_id_workspace_id_fk": { + "name": "workflow_workspace_id_workspace_id_fk", + "tableFrom": "workflow", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workflow_folder_id_workflow_folder_id_fk": { + "name": "workflow_folder_id_workflow_folder_id_fk", + "tableFrom": "workflow", + "tableTo": "workflow_folder", + "columnsFrom": ["folder_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workflow_blocks": { + "name": "workflow_blocks", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "position_x": { + "name": "position_x", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "position_y": { + "name": "position_y", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "horizontal_handles": { + "name": "horizontal_handles", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "is_wide": { + "name": "is_wide", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "advanced_mode": { + "name": "advanced_mode", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "trigger_mode": { + "name": "trigger_mode", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "locked": { + "name": "locked", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "height": { + "name": "height", + "type": "numeric", + "primaryKey": false, + "notNull": true, + "default": "'0'" + }, + "sub_blocks": { + "name": "sub_blocks", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "outputs": { + "name": "outputs", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "data": { + "name": "data", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'{}'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "workflow_blocks_workflow_id_idx": { + "name": "workflow_blocks_workflow_id_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_blocks_type_idx": { + "name": "workflow_blocks_type_idx", + "columns": [ + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workflow_blocks_workflow_id_workflow_id_fk": { + "name": "workflow_blocks_workflow_id_workflow_id_fk", + "tableFrom": "workflow_blocks", + "tableTo": "workflow", + "columnsFrom": ["workflow_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workflow_checkpoints": { + "name": "workflow_checkpoints", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chat_id": { + "name": "chat_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "message_id": { + "name": "message_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "workflow_state": { + "name": "workflow_state", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "workflow_checkpoints_user_id_idx": { + "name": "workflow_checkpoints_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_checkpoints_workflow_id_idx": { + "name": "workflow_checkpoints_workflow_id_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_checkpoints_chat_id_idx": { + "name": "workflow_checkpoints_chat_id_idx", + "columns": [ + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_checkpoints_message_id_idx": { + "name": "workflow_checkpoints_message_id_idx", + "columns": [ + { + "expression": "message_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_checkpoints_user_workflow_idx": { + "name": "workflow_checkpoints_user_workflow_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_checkpoints_workflow_chat_idx": { + "name": "workflow_checkpoints_workflow_chat_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_checkpoints_created_at_idx": { + "name": "workflow_checkpoints_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_checkpoints_chat_created_at_idx": { + "name": "workflow_checkpoints_chat_created_at_idx", + "columns": [ + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workflow_checkpoints_user_id_user_id_fk": { + "name": "workflow_checkpoints_user_id_user_id_fk", + "tableFrom": "workflow_checkpoints", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workflow_checkpoints_workflow_id_workflow_id_fk": { + "name": "workflow_checkpoints_workflow_id_workflow_id_fk", + "tableFrom": "workflow_checkpoints", + "tableTo": "workflow", + "columnsFrom": ["workflow_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workflow_checkpoints_chat_id_copilot_chats_id_fk": { + "name": "workflow_checkpoints_chat_id_copilot_chats_id_fk", + "tableFrom": "workflow_checkpoints", + "tableTo": "copilot_chats", + "columnsFrom": ["chat_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workflow_deployment_version": { + "name": "workflow_deployment_version", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "version": { + "name": "version", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "state": { + "name": "state", + "type": "json", + "primaryKey": false, + "notNull": true + }, + "is_active": { + "name": "is_active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "workflow_deployment_version_workflow_version_unique": { + "name": "workflow_deployment_version_workflow_version_unique", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "version", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_deployment_version_workflow_active_idx": { + "name": "workflow_deployment_version_workflow_active_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "is_active", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_deployment_version_created_at_idx": { + "name": "workflow_deployment_version_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workflow_deployment_version_workflow_id_workflow_id_fk": { + "name": "workflow_deployment_version_workflow_id_workflow_id_fk", + "tableFrom": "workflow_deployment_version", + "tableTo": "workflow", + "columnsFrom": ["workflow_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workflow_edges": { + "name": "workflow_edges", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_block_id": { + "name": "source_block_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "target_block_id": { + "name": "target_block_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_handle": { + "name": "source_handle", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "target_handle": { + "name": "target_handle", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "workflow_edges_workflow_id_idx": { + "name": "workflow_edges_workflow_id_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_edges_workflow_source_idx": { + "name": "workflow_edges_workflow_source_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "source_block_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_edges_workflow_target_idx": { + "name": "workflow_edges_workflow_target_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "target_block_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workflow_edges_workflow_id_workflow_id_fk": { + "name": "workflow_edges_workflow_id_workflow_id_fk", + "tableFrom": "workflow_edges", + "tableTo": "workflow", + "columnsFrom": ["workflow_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workflow_edges_source_block_id_workflow_blocks_id_fk": { + "name": "workflow_edges_source_block_id_workflow_blocks_id_fk", + "tableFrom": "workflow_edges", + "tableTo": "workflow_blocks", + "columnsFrom": ["source_block_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workflow_edges_target_block_id_workflow_blocks_id_fk": { + "name": "workflow_edges_target_block_id_workflow_blocks_id_fk", + "tableFrom": "workflow_edges", + "tableTo": "workflow_blocks", + "columnsFrom": ["target_block_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workflow_execution_logs": { + "name": "workflow_execution_logs", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "execution_id": { + "name": "execution_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "state_snapshot_id": { + "name": "state_snapshot_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "deployment_version_id": { + "name": "deployment_version_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "level": { + "name": "level", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'running'" + }, + "trigger": { + "name": "trigger", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "started_at": { + "name": "started_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "ended_at": { + "name": "ended_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "total_duration_ms": { + "name": "total_duration_ms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "execution_data": { + "name": "execution_data", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "cost": { + "name": "cost", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "cost_total": { + "name": "cost_total", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "models_used": { + "name": "models_used", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "files": { + "name": "files", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "workflow_execution_logs_workflow_id_idx": { + "name": "workflow_execution_logs_workflow_id_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_execution_logs_state_snapshot_id_idx": { + "name": "workflow_execution_logs_state_snapshot_id_idx", + "columns": [ + { + "expression": "state_snapshot_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_execution_logs_deployment_version_id_idx": { + "name": "workflow_execution_logs_deployment_version_id_idx", + "columns": [ + { + "expression": "deployment_version_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_execution_logs_trigger_idx": { + "name": "workflow_execution_logs_trigger_idx", + "columns": [ + { + "expression": "trigger", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_execution_logs_level_idx": { + "name": "workflow_execution_logs_level_idx", + "columns": [ + { + "expression": "level", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_execution_logs_started_at_idx": { + "name": "workflow_execution_logs_started_at_idx", + "columns": [ + { + "expression": "started_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_execution_logs_execution_id_unique": { + "name": "workflow_execution_logs_execution_id_unique", + "columns": [ + { + "expression": "execution_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_execution_logs_workflow_started_at_idx": { + "name": "workflow_execution_logs_workflow_started_at_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "started_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_execution_logs_workspace_started_at_idx": { + "name": "workflow_execution_logs_workspace_started_at_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "started_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_execution_logs_workspace_started_at_id_desc_idx": { + "name": "workflow_execution_logs_workspace_started_at_id_desc_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "\"started_at\" DESC NULLS LAST", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "\"id\" DESC", + "asc": true, + "isExpression": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_execution_logs_workspace_cost_total_idx": { + "name": "workflow_execution_logs_workspace_cost_total_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "cost_total", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_execution_logs_models_used_idx": { + "name": "workflow_execution_logs_models_used_idx", + "columns": [ + { + "expression": "models_used", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "gin", + "with": {} + }, + "workflow_execution_logs_workspace_ended_at_id_idx": { + "name": "workflow_execution_logs_workspace_ended_at_id_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "date_trunc('milliseconds', \"ended_at\")", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_execution_logs_running_started_at_idx": { + "name": "workflow_execution_logs_running_started_at_idx", + "columns": [ + { + "expression": "started_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "status = 'running'", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workflow_execution_logs_workflow_id_workflow_id_fk": { + "name": "workflow_execution_logs_workflow_id_workflow_id_fk", + "tableFrom": "workflow_execution_logs", + "tableTo": "workflow", + "columnsFrom": ["workflow_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + }, + "workflow_execution_logs_workspace_id_workspace_id_fk": { + "name": "workflow_execution_logs_workspace_id_workspace_id_fk", + "tableFrom": "workflow_execution_logs", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workflow_execution_logs_state_snapshot_id_workflow_execution_snapshots_id_fk": { + "name": "workflow_execution_logs_state_snapshot_id_workflow_execution_snapshots_id_fk", + "tableFrom": "workflow_execution_logs", + "tableTo": "workflow_execution_snapshots", + "columnsFrom": ["state_snapshot_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "workflow_execution_logs_deployment_version_id_workflow_deployment_version_id_fk": { + "name": "workflow_execution_logs_deployment_version_id_workflow_deployment_version_id_fk", + "tableFrom": "workflow_execution_logs", + "tableTo": "workflow_deployment_version", + "columnsFrom": ["deployment_version_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workflow_execution_snapshots": { + "name": "workflow_execution_snapshots", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "state_hash": { + "name": "state_hash", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "state_data": { + "name": "state_data", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "workflow_snapshots_workflow_id_idx": { + "name": "workflow_snapshots_workflow_id_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_snapshots_hash_idx": { + "name": "workflow_snapshots_hash_idx", + "columns": [ + { + "expression": "state_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_snapshots_workflow_hash_idx": { + "name": "workflow_snapshots_workflow_hash_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "state_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_snapshots_created_at_idx": { + "name": "workflow_snapshots_created_at_idx", + "columns": [ + { + "expression": "created_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workflow_execution_snapshots_workflow_id_workflow_id_fk": { + "name": "workflow_execution_snapshots_workflow_id_workflow_id_fk", + "tableFrom": "workflow_execution_snapshots", + "tableTo": "workflow", + "columnsFrom": ["workflow_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workflow_folder": { + "name": "workflow_folder", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "parent_id": { + "name": "parent_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "color": { + "name": "color", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'#6B7280'" + }, + "is_expanded": { + "name": "is_expanded", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "locked": { + "name": "locked", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "sort_order": { + "name": "sort_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "archived_at": { + "name": "archived_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "workflow_folder_user_idx": { + "name": "workflow_folder_user_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_folder_workspace_parent_idx": { + "name": "workflow_folder_workspace_parent_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_folder_parent_sort_idx": { + "name": "workflow_folder_parent_sort_idx", + "columns": [ + { + "expression": "parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "sort_order", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_folder_archived_at_idx": { + "name": "workflow_folder_archived_at_idx", + "columns": [ + { + "expression": "archived_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_folder_workspace_archived_partial_idx": { + "name": "workflow_folder_workspace_archived_partial_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "archived_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"workflow_folder\".\"archived_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workflow_folder_user_id_user_id_fk": { + "name": "workflow_folder_user_id_user_id_fk", + "tableFrom": "workflow_folder", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workflow_folder_workspace_id_workspace_id_fk": { + "name": "workflow_folder_workspace_id_workspace_id_fk", + "tableFrom": "workflow_folder", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workflow_mcp_server": { + "name": "workflow_mcp_server", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_public": { + "name": "is_public", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "workflow_mcp_server_workspace_id_idx": { + "name": "workflow_mcp_server_workspace_id_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_mcp_server_created_by_idx": { + "name": "workflow_mcp_server_created_by_idx", + "columns": [ + { + "expression": "created_by", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_mcp_server_deleted_at_idx": { + "name": "workflow_mcp_server_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_mcp_server_workspace_deleted_partial_idx": { + "name": "workflow_mcp_server_workspace_deleted_partial_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"workflow_mcp_server\".\"deleted_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workflow_mcp_server_workspace_id_workspace_id_fk": { + "name": "workflow_mcp_server_workspace_id_workspace_id_fk", + "tableFrom": "workflow_mcp_server", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workflow_mcp_server_created_by_user_id_fk": { + "name": "workflow_mcp_server_created_by_user_id_fk", + "tableFrom": "workflow_mcp_server", + "tableTo": "user", + "columnsFrom": ["created_by"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workflow_mcp_tool": { + "name": "workflow_mcp_tool", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "server_id": { + "name": "server_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tool_name": { + "name": "tool_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tool_description": { + "name": "tool_description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "parameter_schema": { + "name": "parameter_schema", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "parameter_description_overrides": { + "name": "parameter_description_overrides", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'{}'::json" + }, + "archived_at": { + "name": "archived_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "workflow_mcp_tool_server_id_idx": { + "name": "workflow_mcp_tool_server_id_idx", + "columns": [ + { + "expression": "server_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_mcp_tool_workflow_id_idx": { + "name": "workflow_mcp_tool_workflow_id_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_mcp_tool_server_workflow_unique": { + "name": "workflow_mcp_tool_server_workflow_unique", + "columns": [ + { + "expression": "server_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"workflow_mcp_tool\".\"archived_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_mcp_tool_archived_at_partial_idx": { + "name": "workflow_mcp_tool_archived_at_partial_idx", + "columns": [ + { + "expression": "archived_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"workflow_mcp_tool\".\"archived_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workflow_mcp_tool_server_id_workflow_mcp_server_id_fk": { + "name": "workflow_mcp_tool_server_id_workflow_mcp_server_id_fk", + "tableFrom": "workflow_mcp_tool", + "tableTo": "workflow_mcp_server", + "columnsFrom": ["server_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workflow_mcp_tool_workflow_id_workflow_id_fk": { + "name": "workflow_mcp_tool_workflow_id_workflow_id_fk", + "tableFrom": "workflow_mcp_tool", + "tableTo": "workflow", + "columnsFrom": ["workflow_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workflow_schedule": { + "name": "workflow_schedule", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "deployment_version_id": { + "name": "deployment_version_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "block_id": { + "name": "block_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cron_expression": { + "name": "cron_expression", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "next_run_at": { + "name": "next_run_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "last_ran_at": { + "name": "last_ran_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "last_queued_at": { + "name": "last_queued_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "trigger_type": { + "name": "trigger_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "timezone": { + "name": "timezone", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'UTC'" + }, + "failed_count": { + "name": "failed_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "infra_retry_count": { + "name": "infra_retry_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'active'" + }, + "last_failed_at": { + "name": "last_failed_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "source_type": { + "name": "source_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'workflow'" + }, + "job_title": { + "name": "job_title", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "prompt": { + "name": "prompt", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lifecycle": { + "name": "lifecycle", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'persistent'" + }, + "success_condition": { + "name": "success_condition", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "max_runs": { + "name": "max_runs", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "run_count": { + "name": "run_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "source_chat_id": { + "name": "source_chat_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "source_task_name": { + "name": "source_task_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "source_user_id": { + "name": "source_user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "source_workspace_id": { + "name": "source_workspace_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "job_history": { + "name": "job_history", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "contexts": { + "name": "contexts", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "excluded_dates": { + "name": "excluded_dates", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "ends_at": { + "name": "ends_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "archived_at": { + "name": "archived_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "workflow_schedule_workflow_block_deployment_unique": { + "name": "workflow_schedule_workflow_block_deployment_unique", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "block_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "deployment_version_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"workflow_schedule\".\"archived_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_schedule_workflow_deployment_idx": { + "name": "workflow_schedule_workflow_deployment_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "deployment_version_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_schedule_archived_at_partial_idx": { + "name": "workflow_schedule_archived_at_partial_idx", + "columns": [ + { + "expression": "archived_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"workflow_schedule\".\"archived_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "idx_workflow_schedule_on_source_workspace_id_source_t_c07f3bba6": { + "name": "idx_workflow_schedule_on_source_workspace_id_source_t_c07f3bba6", + "columns": [ + { + "expression": "source_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "source_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "archived_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "status", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_schedule_due_workflow_idx": { + "name": "workflow_schedule_due_workflow_idx", + "columns": [ + { + "expression": "next_run_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "last_queued_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "deployment_version_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"workflow_schedule\".\"archived_at\" IS NULL AND \"workflow_schedule\".\"status\" NOT IN ('disabled', 'completed') AND (\"workflow_schedule\".\"source_type\" = 'workflow' OR \"workflow_schedule\".\"source_type\" IS NULL)", + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_schedule_due_job_idx": { + "name": "workflow_schedule_due_job_idx", + "columns": [ + { + "expression": "next_run_at", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "last_queued_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"workflow_schedule\".\"archived_at\" IS NULL AND \"workflow_schedule\".\"status\" NOT IN ('disabled', 'completed') AND \"workflow_schedule\".\"source_type\" = 'job'", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workflow_schedule_workflow_id_workflow_id_fk": { + "name": "workflow_schedule_workflow_id_workflow_id_fk", + "tableFrom": "workflow_schedule", + "tableTo": "workflow", + "columnsFrom": ["workflow_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workflow_schedule_deployment_version_id_workflow_deployment_version_id_fk": { + "name": "workflow_schedule_deployment_version_id_workflow_deployment_version_id_fk", + "tableFrom": "workflow_schedule", + "tableTo": "workflow_deployment_version", + "columnsFrom": ["deployment_version_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workflow_schedule_source_user_id_user_id_fk": { + "name": "workflow_schedule_source_user_id_user_id_fk", + "tableFrom": "workflow_schedule", + "tableTo": "user", + "columnsFrom": ["source_user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workflow_schedule_source_workspace_id_workspace_id_fk": { + "name": "workflow_schedule_source_workspace_id_workspace_id_fk", + "tableFrom": "workflow_schedule", + "tableTo": "workspace", + "columnsFrom": ["source_workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workflow_subflows": { + "name": "workflow_subflows", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workflow_id": { + "name": "workflow_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "config": { + "name": "config", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "workflow_subflows_workflow_id_idx": { + "name": "workflow_subflows_workflow_id_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workflow_subflows_workflow_type_idx": { + "name": "workflow_subflows_workflow_type_idx", + "columns": [ + { + "expression": "workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workflow_subflows_workflow_id_workflow_id_fk": { + "name": "workflow_subflows_workflow_id_workflow_id_fk", + "tableFrom": "workflow_subflows", + "tableTo": "workflow", + "columnsFrom": ["workflow_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workspace": { + "name": "workspace", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "color": { + "name": "color", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'#33C482'" + }, + "logo_url": { + "name": "logo_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "owner_id": { + "name": "owner_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "organization_id": { + "name": "organization_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "workspace_mode": { + "name": "workspace_mode", + "type": "workspace_mode", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'grandfathered_shared'" + }, + "billed_account_user_id": { + "name": "billed_account_user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "allow_personal_api_keys": { + "name": "allow_personal_api_keys", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "inbox_enabled": { + "name": "inbox_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "inbox_address": { + "name": "inbox_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "inbox_provider_id": { + "name": "inbox_provider_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "archived_at": { + "name": "archived_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "forked_from_workspace_id": { + "name": "forked_from_workspace_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "workspace_owner_id_idx": { + "name": "workspace_owner_id_idx", + "columns": [ + { + "expression": "owner_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_organization_id_idx": { + "name": "workspace_organization_id_idx", + "columns": [ + { + "expression": "organization_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_mode_idx": { + "name": "workspace_mode_idx", + "columns": [ + { + "expression": "workspace_mode", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_forked_from_workspace_id_idx": { + "name": "workspace_forked_from_workspace_id_idx", + "columns": [ + { + "expression": "forked_from_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workspace_owner_id_user_id_fk": { + "name": "workspace_owner_id_user_id_fk", + "tableFrom": "workspace", + "tableTo": "user", + "columnsFrom": ["owner_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workspace_organization_id_organization_id_fk": { + "name": "workspace_organization_id_organization_id_fk", + "tableFrom": "workspace", + "tableTo": "organization", + "columnsFrom": ["organization_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + }, + "workspace_billed_account_user_id_user_id_fk": { + "name": "workspace_billed_account_user_id_user_id_fk", + "tableFrom": "workspace", + "tableTo": "user", + "columnsFrom": ["billed_account_user_id"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "workspace_forked_from_workspace_id_workspace_id_fk": { + "name": "workspace_forked_from_workspace_id_workspace_id_fk", + "tableFrom": "workspace", + "tableTo": "workspace", + "columnsFrom": ["forked_from_workspace_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workspace_byok_keys": { + "name": "workspace_byok_keys", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider_id": { + "name": "provider_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "encrypted_api_key": { + "name": "encrypted_api_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "workspace_byok_workspace_provider_idx": { + "name": "workspace_byok_workspace_provider_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "provider_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workspace_byok_keys_workspace_id_workspace_id_fk": { + "name": "workspace_byok_keys_workspace_id_workspace_id_fk", + "tableFrom": "workspace_byok_keys", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workspace_byok_keys_created_by_user_id_fk": { + "name": "workspace_byok_keys_created_by_user_id_fk", + "tableFrom": "workspace_byok_keys", + "tableTo": "user", + "columnsFrom": ["created_by"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workspace_environment": { + "name": "workspace_environment", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "variables": { + "name": "variables", + "type": "json", + "primaryKey": false, + "notNull": true, + "default": "'{}'" + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "workspace_environment_workspace_unique": { + "name": "workspace_environment_workspace_unique", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workspace_environment_workspace_id_workspace_id_fk": { + "name": "workspace_environment_workspace_id_workspace_id_fk", + "tableFrom": "workspace_environment", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workspace_file": { + "name": "workspace_file", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "size": { + "name": "size", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "uploaded_by": { + "name": "uploaded_by", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "uploaded_at": { + "name": "uploaded_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "workspace_file_workspace_id_idx": { + "name": "workspace_file_workspace_id_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_file_key_idx": { + "name": "workspace_file_key_idx", + "columns": [ + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_file_deleted_at_idx": { + "name": "workspace_file_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_file_workspace_deleted_partial_idx": { + "name": "workspace_file_workspace_deleted_partial_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"workspace_file\".\"deleted_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workspace_file_workspace_id_workspace_id_fk": { + "name": "workspace_file_workspace_id_workspace_id_fk", + "tableFrom": "workspace_file", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workspace_file_uploaded_by_user_id_fk": { + "name": "workspace_file_uploaded_by_user_id_fk", + "tableFrom": "workspace_file", + "tableTo": "user", + "columnsFrom": ["uploaded_by"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "workspace_file_key_unique": { + "name": "workspace_file_key_unique", + "nullsNotDistinct": false, + "columns": ["key"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workspace_file_folders": { + "name": "workspace_file_folders", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "parent_id": { + "name": "parent_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sort_order": { + "name": "sort_order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "workspace_file_folders_workspace_parent_idx": { + "name": "workspace_file_folders_workspace_parent_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_file_folders_parent_sort_idx": { + "name": "workspace_file_folders_parent_sort_idx", + "columns": [ + { + "expression": "parent_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "sort_order", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_file_folders_deleted_at_idx": { + "name": "workspace_file_folders_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_file_folders_workspace_deleted_partial_idx": { + "name": "workspace_file_folders_workspace_deleted_partial_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"workspace_file_folders\".\"deleted_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_file_folders_workspace_parent_name_active_unique": { + "name": "workspace_file_folders_workspace_parent_name_active_unique", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "coalesce(\"parent_id\", '')", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"workspace_file_folders\".\"deleted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workspace_file_folders_user_id_user_id_fk": { + "name": "workspace_file_folders_user_id_user_id_fk", + "tableFrom": "workspace_file_folders", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workspace_file_folders_workspace_id_workspace_id_fk": { + "name": "workspace_file_folders_workspace_id_workspace_id_fk", + "tableFrom": "workspace_file_folders", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workspace_file_folders_parent_id_workspace_file_folders_id_fk": { + "name": "workspace_file_folders_parent_id_workspace_file_folders_id_fk", + "tableFrom": "workspace_file_folders", + "tableTo": "workspace_file_folders", + "columnsFrom": ["parent_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workspace_files": { + "name": "workspace_files", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "workspace_id": { + "name": "workspace_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "folder_id": { + "name": "folder_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "context": { + "name": "context", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "chat_id": { + "name": "chat_id", + "type": "uuid", + "primaryKey": false, + "notNull": false + }, + "original_name": { + "name": "original_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "display_name": { + "name": "display_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "content_type": { + "name": "content_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "size": { + "name": "size", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "deleted_at": { + "name": "deleted_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "uploaded_at": { + "name": "uploaded_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "workspace_files_key_active_unique": { + "name": "workspace_files_key_active_unique", + "columns": [ + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"workspace_files\".\"deleted_at\" IS NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_files_workspace_folder_name_active_unique": { + "name": "workspace_files_workspace_folder_name_active_unique", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "coalesce(\"folder_id\", '')", + "asc": true, + "isExpression": true, + "nulls": "last" + }, + { + "expression": "original_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"workspace_files\".\"deleted_at\" IS NULL AND \"workspace_files\".\"context\" = 'workspace' AND \"workspace_files\".\"workspace_id\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_files_chat_display_name_unique": { + "name": "workspace_files_chat_display_name_unique", + "columns": [ + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "display_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "where": "\"workspace_files\".\"context\" = 'mothership' AND \"workspace_files\".\"chat_id\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_files_key_idx": { + "name": "workspace_files_key_idx", + "columns": [ + { + "expression": "key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_files_user_id_idx": { + "name": "workspace_files_user_id_idx", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_files_workspace_id_idx": { + "name": "workspace_files_workspace_id_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_files_folder_id_idx": { + "name": "workspace_files_folder_id_idx", + "columns": [ + { + "expression": "folder_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_files_context_idx": { + "name": "workspace_files_context_idx", + "columns": [ + { + "expression": "context", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_files_chat_id_idx": { + "name": "workspace_files_chat_id_idx", + "columns": [ + { + "expression": "chat_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_files_deleted_at_idx": { + "name": "workspace_files_deleted_at_idx", + "columns": [ + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_files_workspace_deleted_partial_idx": { + "name": "workspace_files_workspace_deleted_partial_idx", + "columns": [ + { + "expression": "workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "deleted_at", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "where": "\"workspace_files\".\"deleted_at\" IS NOT NULL", + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workspace_files_user_id_user_id_fk": { + "name": "workspace_files_user_id_user_id_fk", + "tableFrom": "workspace_files", + "tableTo": "user", + "columnsFrom": ["user_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workspace_files_workspace_id_workspace_id_fk": { + "name": "workspace_files_workspace_id_workspace_id_fk", + "tableFrom": "workspace_files", + "tableTo": "workspace", + "columnsFrom": ["workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workspace_files_folder_id_workspace_file_folders_id_fk": { + "name": "workspace_files_folder_id_workspace_file_folders_id_fk", + "tableFrom": "workspace_files", + "tableTo": "workspace_file_folders", + "columnsFrom": ["folder_id"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + }, + "workspace_files_chat_id_copilot_chats_id_fk": { + "name": "workspace_files_chat_id_copilot_chats_id_fk", + "tableFrom": "workspace_files", + "tableTo": "copilot_chats", + "columnsFrom": ["chat_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workspace_fork_block_map": { + "name": "workspace_fork_block_map", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "child_workspace_id": { + "name": "child_workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "parent_workflow_id": { + "name": "parent_workflow_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "parent_block_id": { + "name": "parent_block_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "child_workflow_id": { + "name": "child_workflow_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "child_block_id": { + "name": "child_block_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "workspace_fork_block_map_child_ws_parent_unique": { + "name": "workspace_fork_block_map_child_ws_parent_unique", + "columns": [ + { + "expression": "child_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "parent_block_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_fork_block_map_child_ws_child_unique": { + "name": "workspace_fork_block_map_child_ws_child_unique", + "columns": [ + { + "expression": "child_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "child_block_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_fork_block_map_child_ws_parent_wf_idx": { + "name": "workspace_fork_block_map_child_ws_parent_wf_idx", + "columns": [ + { + "expression": "child_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "parent_workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_fork_block_map_child_ws_child_wf_idx": { + "name": "workspace_fork_block_map_child_ws_child_wf_idx", + "columns": [ + { + "expression": "child_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "child_workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workspace_fork_block_map_child_workspace_id_workspace_id_fk": { + "name": "workspace_fork_block_map_child_workspace_id_workspace_id_fk", + "tableFrom": "workspace_fork_block_map", + "tableTo": "workspace", + "columnsFrom": ["child_workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workspace_fork_dependent_value": { + "name": "workspace_fork_dependent_value", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "child_workspace_id": { + "name": "child_workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "target_workflow_id": { + "name": "target_workflow_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "target_block_id": { + "name": "target_block_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sub_block_key": { + "name": "sub_block_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "workspace_fork_dependent_value_child_ws_wf_idx": { + "name": "workspace_fork_dependent_value_child_ws_wf_idx", + "columns": [ + { + "expression": "child_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "target_workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_fork_dependent_value_field_unique": { + "name": "workspace_fork_dependent_value_field_unique", + "columns": [ + { + "expression": "child_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "target_workflow_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "target_block_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "sub_block_key", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workspace_fork_dependent_value_child_workspace_id_workspace_id_fk": { + "name": "workspace_fork_dependent_value_child_workspace_id_workspace_id_fk", + "tableFrom": "workspace_fork_dependent_value", + "tableTo": "workspace", + "columnsFrom": ["child_workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workspace_fork_promote_run": { + "name": "workspace_fork_promote_run", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "child_workspace_id": { + "name": "child_workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source_workspace_id": { + "name": "source_workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "target_workspace_id": { + "name": "target_workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "direction": { + "name": "direction", + "type": "workspace_fork_promote_direction", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "snapshot": { + "name": "snapshot", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "workspace_fork_promote_run_child_ws_target_unique": { + "name": "workspace_fork_promote_run_child_ws_target_unique", + "columns": [ + { + "expression": "child_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "target_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_fork_promote_run_target_ws_idx": { + "name": "workspace_fork_promote_run_target_ws_idx", + "columns": [ + { + "expression": "target_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workspace_fork_promote_run_child_workspace_id_workspace_id_fk": { + "name": "workspace_fork_promote_run_child_workspace_id_workspace_id_fk", + "tableFrom": "workspace_fork_promote_run", + "tableTo": "workspace", + "columnsFrom": ["child_workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workspace_fork_promote_run_created_by_user_id_fk": { + "name": "workspace_fork_promote_run_created_by_user_id_fk", + "tableFrom": "workspace_fork_promote_run", + "tableTo": "user", + "columnsFrom": ["created_by"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.workspace_fork_resource_map": { + "name": "workspace_fork_resource_map", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "child_workspace_id": { + "name": "child_workspace_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "resource_type": { + "name": "resource_type", + "type": "workspace_fork_resource_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "parent_resource_id": { + "name": "parent_resource_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "child_resource_id": { + "name": "child_resource_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": { + "workspace_fork_resource_map_child_ws_idx": { + "name": "workspace_fork_resource_map_child_ws_idx", + "columns": [ + { + "expression": "child_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_fork_resource_map_child_ws_type_idx": { + "name": "workspace_fork_resource_map_child_ws_type_idx", + "columns": [ + { + "expression": "child_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "resource_type", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "workspace_fork_resource_map_child_type_parent_unique": { + "name": "workspace_fork_resource_map_child_type_parent_unique", + "columns": [ + { + "expression": "child_workspace_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "resource_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "parent_resource_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "workspace_fork_resource_map_child_workspace_id_workspace_id_fk": { + "name": "workspace_fork_resource_map_child_workspace_id_workspace_id_fk", + "tableFrom": "workspace_fork_resource_map", + "tableTo": "workspace", + "columnsFrom": ["child_workspace_id"], + "columnsTo": ["id"], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "workspace_fork_resource_map_created_by_user_id_fk": { + "name": "workspace_fork_resource_map_created_by_user_id_fk", + "tableFrom": "workspace_fork_resource_map", + "tableTo": "user", + "columnsFrom": ["created_by"], + "columnsTo": ["id"], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.academy_cert_status": { + "name": "academy_cert_status", + "schema": "public", + "values": ["active", "revoked", "expired"] + }, + "public.background_work_kind": { + "name": "background_work_kind", + "schema": "public", + "values": ["deployment_side_effects", "fork_content_copy", "fork_sync", "fork_rollback"] + }, + "public.background_work_status_value": { + "name": "background_work_status_value", + "schema": "public", + "values": ["pending", "processing", "completed", "completed_with_warnings", "failed"] + }, + "public.billing_blocked_reason": { + "name": "billing_blocked_reason", + "schema": "public", + "values": ["payment_failed", "dispute"] + }, + "public.billing_entity_type": { + "name": "billing_entity_type", + "schema": "public", + "values": ["user", "organization"] + }, + "public.chat_type": { + "name": "chat_type", + "schema": "public", + "values": ["mothership", "copilot"] + }, + "public.copilot_async_tool_status": { + "name": "copilot_async_tool_status", + "schema": "public", + "values": ["pending", "running", "completed", "failed", "cancelled", "delivered"] + }, + "public.copilot_run_status": { + "name": "copilot_run_status", + "schema": "public", + "values": ["active", "paused_waiting_for_tool", "resuming", "complete", "error", "cancelled"] + }, + "public.credential_member_role": { + "name": "credential_member_role", + "schema": "public", + "values": ["admin", "member"] + }, + "public.credential_member_status": { + "name": "credential_member_status", + "schema": "public", + "values": ["active", "pending", "revoked"] + }, + "public.credential_type": { + "name": "credential_type", + "schema": "public", + "values": ["oauth", "env_workspace", "env_personal", "service_account"] + }, + "public.data_drain_cadence": { + "name": "data_drain_cadence", + "schema": "public", + "values": ["hourly", "daily"] + }, + "public.data_drain_destination": { + "name": "data_drain_destination", + "schema": "public", + "values": ["s3", "gcs", "azure_blob", "datadog", "bigquery", "snowflake", "webhook"] + }, + "public.data_drain_run_status": { + "name": "data_drain_run_status", + "schema": "public", + "values": ["running", "success", "failed"] + }, + "public.data_drain_run_trigger": { + "name": "data_drain_run_trigger", + "schema": "public", + "values": ["cron", "manual"] + }, + "public.data_drain_source": { + "name": "data_drain_source", + "schema": "public", + "values": ["workflow_logs", "job_logs", "audit_logs", "copilot_chats", "copilot_runs"] + }, + "public.execution_large_value_reference_source": { + "name": "execution_large_value_reference_source", + "schema": "public", + "values": ["execution_log", "paused_snapshot"] + }, + "public.invitation_kind": { + "name": "invitation_kind", + "schema": "public", + "values": ["organization", "workspace"] + }, + "public.invitation_membership_intent": { + "name": "invitation_membership_intent", + "schema": "public", + "values": ["internal", "external"] + }, + "public.invitation_status": { + "name": "invitation_status", + "schema": "public", + "values": ["pending", "accepted", "rejected", "cancelled", "expired"] + }, + "public.permission_type": { + "name": "permission_type", + "schema": "public", + "values": ["admin", "write", "read"] + }, + "public.usage_log_category": { + "name": "usage_log_category", + "schema": "public", + "values": ["model", "fixed", "tool"] + }, + "public.usage_log_source": { + "name": "usage_log_source", + "schema": "public", + "values": [ + "workflow", + "wand", + "copilot", + "workspace-chat", + "mcp_copilot", + "mothership_block", + "knowledge-base", + "voice-input", + "enrichment" + ] + }, + "public.workspace_fork_promote_direction": { + "name": "workspace_fork_promote_direction", + "schema": "public", + "values": ["push", "pull"] + }, + "public.workspace_fork_resource_type": { + "name": "workspace_fork_resource_type", + "schema": "public", + "values": [ + "workflow", + "oauth_credential", + "service_account_credential", + "env_var", + "table", + "knowledge_base", + "knowledge_document", + "file", + "mcp_server", + "workflow_mcp_server", + "custom_tool", + "skill" + ] + }, + "public.workspace_mode": { + "name": "workspace_mode", + "schema": "public", + "values": ["personal", "organization", "grandfathered_shared"] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index c3b64dc1f5b..b457b88600c 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -1793,6 +1793,13 @@ "when": 1783392614134, "tag": "0256_custom_block_inputs", "breakpoints": true + }, + { + "idx": 257, + "version": "7", + "when": 1783531236677, + "tag": "0257_majestic_chat", + "breakpoints": true } ] } diff --git a/packages/db/package.json b/packages/db/package.json index 9b4a5c07b79..3b8b133cf7d 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -40,6 +40,6 @@ "@sim/tsconfig": "workspace:*", "drizzle-kit": "^0.31.4", "@types/node": "^22.10.5", - "typescript": "^5.7.3" + "typescript": "^7.0.2" } } diff --git a/packages/db/schema.ts b/packages/db/schema.ts index b7d03c020df..62bf0b5d806 100644 --- a/packages/db/schema.ts +++ b/packages/db/schema.ts @@ -1364,6 +1364,8 @@ export const workspaceForkResourceTypeEnum = pgEnum('workspace_fork_resource_typ 'knowledge_document', 'file', 'mcp_server', + /** Workflow-publishing MCP server identity (fork shell copy), for attachment sync. */ + 'workflow_mcp_server', 'custom_tool', 'skill', ]) @@ -1572,6 +1574,14 @@ export const backgroundWorkStatus = pgTable( table.workflowId, table.status ), + // Expression indexes for listSurfacedBackgroundWork's metadata legs: `->>` equality can't + // use a GIN index, and one unindexable leg in its `or()` forces a full-table scan. + metaChildWorkspaceIdx: index('background_work_status_meta_child_ws_idx').on( + sql`(${table.metadata} ->> 'childWorkspaceId')` + ), + metaOtherWorkspaceIdx: index('background_work_status_meta_other_ws_idx').on( + sql`(${table.metadata} ->> 'otherWorkspaceId')` + ), }) ) @@ -3389,9 +3399,9 @@ export const userTableRows = pgTable( data: jsonb('data').notNull(), position: integer('position').notNull().default(0), /** - * Fractional order key (base-62 string). Authoritative row order when the - * `TABLES_FRACTIONAL_ORDERING` flag is on; nullable during the backfill - * window. Ordered with `id` as a deterministic tiebreaker. + * Fractional order key (base-62 string) — the authoritative row order. + * Nullable during the backfill window. Ordered with `id` as a deterministic + * tiebreaker. * * Stored with `COLLATE "C"` (migration 0228) so Postgres compares it bytewise, * matching the fractional-indexing library's ASCII ordering. drizzle can't diff --git a/packages/db/script-migrations/0001_backfill_table_order_keys.ts b/packages/db/script-migrations/0001_backfill_table_order_keys.ts index ea0e368f0ce..371d8e32edc 100644 --- a/packages/db/script-migrations/0001_backfill_table_order_keys.ts +++ b/packages/db/script-migrations/0001_backfill_table_order_keys.ts @@ -16,7 +16,7 @@ const WRITE_CHUNK_SIZE = 5000 * Row ordering moved from the contiguous integer `position` to a fractional * string `order_key` (O(1) insert/delete — no reshift/recompact). Each existing * row gets a key derived from its current `position` order, so the fractional - * ordering matches today's once `TABLES_FRACTIONAL_ORDERING` is on. + * ordering matches the legacy ordering for rows that predate the column. * * Per-table-atomic: each table is keyed inside one transaction holding the same * per-table advisory lock the app uses for inserts, so a concurrent insert diff --git a/packages/db/tsconfig.json b/packages/db/tsconfig.json index dc837d829ef..d4ad559627c 100644 --- a/packages/db/tsconfig.json +++ b/packages/db/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "@sim/tsconfig/library.json", "compilerOptions": { - "baseUrl": ".", "paths": { "@sim/db": ["./index.ts"], "@sim/db/*": ["./*"] diff --git a/packages/emcn/package.json b/packages/emcn/package.json index e2e73281ec5..7aaa3d4c467 100644 --- a/packages/emcn/package.json +++ b/packages/emcn/package.json @@ -61,7 +61,7 @@ "prismjs": "^1.30.0", "react": "19.2.4", "react-dom": "19.2.4", - "typescript": "^5.7.3", + "typescript": "^7.0.2", "vitest": "^4.1.0" } } diff --git a/packages/emcn/src/css-modules.d.ts b/packages/emcn/src/css-modules.d.ts index 6f79bf12d1e..f0caf6ef9c0 100644 --- a/packages/emcn/src/css-modules.d.ts +++ b/packages/emcn/src/css-modules.d.ts @@ -6,3 +6,5 @@ declare module '*.module.css' { const classes: { readonly [key: string]: string } export default classes } + +declare module '*.css' diff --git a/packages/logger/package.json b/packages/logger/package.json index c547b6e2e91..0e8135a81cc 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -25,11 +25,13 @@ "test:watch": "vitest" }, "dependencies": { + "@sim/utils": "workspace:*", "chalk": "5.6.2" }, "devDependencies": { "@sim/tsconfig": "workspace:*", - "typescript": "^5.7.3", + "@types/node": "24.2.1", + "typescript": "^7.0.2", "vitest": "^4.1.0" } } diff --git a/packages/logger/src/index.ts b/packages/logger/src/index.ts index 844c513bf95..25e6e3f9ae3 100644 --- a/packages/logger/src/index.ts +++ b/packages/logger/src/index.ts @@ -4,6 +4,7 @@ * Framework-agnostic logging utilities for the Sim platform. * Provides standardized console logging with environment-aware configuration. */ +import { filterUndefined } from '@sim/utils/object' import chalk from 'chalk' import { getRequestContext } from './request-context' @@ -200,7 +201,10 @@ export class Logger { private shouldLog(level: LogLevel): boolean { if (!this.config.enabled) return false - if (getNodeEnv() === 'production' && typeof window !== 'undefined') { + if ( + getNodeEnv() === 'production' && + typeof (globalThis as { window?: unknown }).window !== 'undefined' + ) { return false } @@ -240,7 +244,7 @@ export class Logger { ...this.metadata, } : this.metadata - const metadataEntries = Object.entries(effectiveMetadata).filter(([_, v]) => v !== undefined) + const metadataEntries = Object.entries(filterUndefined(effectiveMetadata)) const metadataStr = metadataEntries.length > 0 ? ` {${metadataEntries.map(([k, v]) => `${k}=${v}`).join(' ')}}` diff --git a/packages/platform-authz/package.json b/packages/platform-authz/package.json index adebe6563fa..fd989954ec1 100644 --- a/packages/platform-authz/package.json +++ b/packages/platform-authz/package.json @@ -36,6 +36,7 @@ }, "devDependencies": { "@sim/tsconfig": "workspace:*", - "typescript": "^5.7.3" + "@types/node": "24.2.1", + "typescript": "^7.0.2" } } diff --git a/packages/realtime-protocol/package.json b/packages/realtime-protocol/package.json index 4f026e9d2ac..a4248404adc 100644 --- a/packages/realtime-protocol/package.json +++ b/packages/realtime-protocol/package.json @@ -35,6 +35,6 @@ }, "devDependencies": { "@sim/tsconfig": "workspace:*", - "typescript": "^5.7.3" + "typescript": "^7.0.2" } } diff --git a/packages/runtime-secrets/package.json b/packages/runtime-secrets/package.json index ee57201f3d1..732b6b81de0 100644 --- a/packages/runtime-secrets/package.json +++ b/packages/runtime-secrets/package.json @@ -32,7 +32,7 @@ "devDependencies": { "@sim/tsconfig": "workspace:*", "@types/node": "24.2.1", - "typescript": "^5.7.3", + "typescript": "^7.0.2", "vitest": "^4.1.0" } } diff --git a/packages/security/package.json b/packages/security/package.json index c6fefac2fe4..754e354b983 100644 --- a/packages/security/package.json +++ b/packages/security/package.json @@ -44,7 +44,7 @@ "devDependencies": { "@sim/tsconfig": "workspace:*", "@types/node": "24.2.1", - "typescript": "^5.7.3", + "typescript": "^7.0.2", "vitest": "^4.1.0" } } diff --git a/packages/testing/package.json b/packages/testing/package.json index e729096f1ef..216129ae6c1 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -53,7 +53,7 @@ }, "devDependencies": { "@sim/tsconfig": "workspace:*", - "typescript": "^5.7.3", + "typescript": "^7.0.2", "vitest": "^4.1.0" }, "dependencies": { diff --git a/packages/testing/src/mocks/audit.mock.ts b/packages/testing/src/mocks/audit.mock.ts index 65685d9237d..8cfb3b7373d 100644 --- a/packages/testing/src/mocks/audit.mock.ts +++ b/packages/testing/src/mocks/audit.mock.ts @@ -151,6 +151,7 @@ export const auditMock = { WORKSPACE_FORKED: 'workspace.forked', WORKSPACE_FORK_PROMOTED: 'workspace.fork_promoted', WORKSPACE_FORK_ROLLED_BACK: 'workspace.fork_rolled_back', + WORKSPACE_FORK_UNLINKED: 'workspace.fork_unlinked', }, AuditResourceType: { API_KEY: 'api_key', diff --git a/packages/testing/src/mocks/database.mock.ts b/packages/testing/src/mocks/database.mock.ts index 17a039b5d63..9a879e4cad8 100644 --- a/packages/testing/src/mocks/database.mock.ts +++ b/packages/testing/src/mocks/database.mock.ts @@ -100,7 +100,15 @@ export function createMockSqlOperators() { * }) * ``` */ -const limit = vi.fn(() => Promise.resolve([] as unknown[])) +const offset = vi.fn(() => Promise.resolve([] as unknown[])) +// `.limit()` returns a builder that is awaitable (default empty page) and also +// exposes `.offset()` for keyset/OFFSET paging (`.limit(n).offset(m)`). +const limitBuilder = () => { + const thenable: any = Promise.resolve([] as unknown[]) + thenable.offset = offset + return thenable +} +const limit = vi.fn(limitBuilder) const returning = vi.fn(() => Promise.resolve([] as unknown[])) const execute = vi.fn(() => Promise.resolve([] as unknown[])) @@ -169,6 +177,7 @@ export const dbChainMockFns = { from, where, limit, + offset, orderBy, returning, innerJoin, @@ -211,7 +220,8 @@ export function resetDbChainMock(): void { update.mockImplementation(() => ({ set })) set.mockImplementation(() => ({ where })) del.mockImplementation(() => ({ where })) - limit.mockImplementation(() => Promise.resolve([] as unknown[])) + limit.mockImplementation(limitBuilder) + offset.mockImplementation(() => Promise.resolve([] as unknown[])) orderBy.mockImplementation(terminalBuilder) returning.mockImplementation(() => Promise.resolve([] as unknown[])) having.mockImplementation(terminalBuilder) diff --git a/packages/testing/src/mocks/env-flags.mock.ts b/packages/testing/src/mocks/env-flags.mock.ts index 480ae0d62f0..590a5b9fde6 100644 --- a/packages/testing/src/mocks/env-flags.mock.ts +++ b/packages/testing/src/mocks/env-flags.mock.ts @@ -21,7 +21,6 @@ export const envFlagsMock = { isRegistrationDisabled: false, isEmailPasswordEnabled: false, isTriggerDevEnabled: false, - isTablesFractionalOrderingEnabled: false, isSsoEnabled: false, isAccessControlEnabled: false, isOrganizationsEnabled: false, diff --git a/packages/testing/src/mocks/schema.mock.ts b/packages/testing/src/mocks/schema.mock.ts index 4d52742a3a5..c90f7d3ba06 100644 --- a/packages/testing/src/mocks/schema.mock.ts +++ b/packages/testing/src/mocks/schema.mock.ts @@ -481,9 +481,23 @@ export const schemaMock = { inboxAddress: 'inboxAddress', inboxProviderId: 'inboxProviderId', archivedAt: 'archivedAt', + forkedFromWorkspaceId: 'forkedFromWorkspaceId', createdAt: 'createdAt', updatedAt: 'updatedAt', }, + backgroundWorkStatus: { + id: 'id', + workspaceId: 'workspaceId', + workflowId: 'workflowId', + kind: 'kind', + status: 'status', + message: 'message', + error: 'error', + metadata: 'metadata', + startedAt: 'startedAt', + completedAt: 'completedAt', + updatedAt: 'updatedAt', + }, workspaceFileFolder: { id: 'id', name: 'name', @@ -1171,6 +1185,36 @@ export const schemaMock = { createdAt: 'createdAt', updatedAt: 'updatedAt', }, + workspaceForkResourceMap: { + id: 'id', + childWorkspaceId: 'childWorkspaceId', + resourceType: 'resourceType', + parentResourceId: 'parentResourceId', + childResourceId: 'childResourceId', + createdBy: 'createdBy', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + }, + workspaceForkBlockMap: { + id: 'id', + childWorkspaceId: 'childWorkspaceId', + parentWorkflowId: 'parentWorkflowId', + parentBlockId: 'parentBlockId', + childWorkflowId: 'childWorkflowId', + childBlockId: 'childBlockId', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + }, + workspaceForkPromoteRun: { + id: 'id', + childWorkspaceId: 'childWorkspaceId', + sourceWorkspaceId: 'sourceWorkspaceId', + targetWorkspaceId: 'targetWorkspaceId', + direction: 'direction', + snapshot: 'snapshot', + createdBy: 'createdBy', + createdAt: 'createdAt', + }, /** Custom type export for tsvector */ tsvector: 'tsvector', } diff --git a/packages/testing/tsconfig.json b/packages/testing/tsconfig.json index 052e9d01c74..e08d8f7ee29 100644 --- a/packages/testing/tsconfig.json +++ b/packages/testing/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "@sim/tsconfig/library.json", "compilerOptions": { - "baseUrl": ".", + "lib": ["ES2022", "DOM"], "paths": { "@sim/testing/*": ["./src/*"] } diff --git a/packages/ts-sdk/package.json b/packages/ts-sdk/package.json index 85589da2380..b85e704e9ea 100644 --- a/packages/ts-sdk/package.json +++ b/packages/ts-sdk/package.json @@ -42,7 +42,7 @@ "@sim/tsconfig": "workspace:*", "@types/node": "^20.5.1", "@vitest/coverage-v8": "^4.1.0", - "typescript": "^5.7.3", + "typescript": "^7.0.2", "vitest": "^4.1.0" }, "engines": { diff --git a/packages/ts-sdk/tsconfig.json b/packages/ts-sdk/tsconfig.json index 46c1cc18ad2..7e2e51f66e9 100644 --- a/packages/ts-sdk/tsconfig.json +++ b/packages/ts-sdk/tsconfig.json @@ -2,9 +2,9 @@ "extends": "@sim/tsconfig/library-build.json", "compilerOptions": { "target": "ES2020", - "module": "ES2020", + "module": "nodenext", "lib": ["ES2020"], - "moduleResolution": "node", + "moduleResolution": "nodenext", "outDir": "./dist", "rootDir": "./src" }, diff --git a/packages/tsconfig/base.json b/packages/tsconfig/base.json index f3cc7a966a3..213b2c09f9f 100644 --- a/packages/tsconfig/base.json +++ b/packages/tsconfig/base.json @@ -7,6 +7,7 @@ "module": "ESNext", "moduleResolution": "bundler", "moduleDetection": "force", + "types": ["node"], "strict": true, "esModuleInterop": true, diff --git a/packages/utils/package.json b/packages/utils/package.json index e8571f95dcd..db5ffdc6768 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -63,7 +63,7 @@ "dependencies": {}, "devDependencies": { "@sim/tsconfig": "workspace:*", - "typescript": "^5.7.3", + "typescript": "^7.0.2", "vitest": "^4.1.0" } } diff --git a/packages/utils/src/formatting.test.ts b/packages/utils/src/formatting.test.ts index 9670efeaed0..6e8d43ce8fc 100644 --- a/packages/utils/src/formatting.test.ts +++ b/packages/utils/src/formatting.test.ts @@ -28,6 +28,11 @@ describe('getTimezoneAbbreviation', () => { expect(getTimezoneAbbreviation('Unknown/Zone')).toBe('Unknown/Zone') }) + it('resolves a valid IANA timezone outside the hardcoded map via Intl instead of the raw string', () => { + const result = getTimezoneAbbreviation('Europe/Berlin', new Date('2023-01-15')) + expect(result).not.toBe('Europe/Berlin') + }) + it('returns PST or PDT for Los Angeles', () => { const result = getTimezoneAbbreviation('America/Los_Angeles', new Date('2023-01-15')) expect(['PST', 'PDT']).toContain(result) diff --git a/packages/utils/src/formatting.ts b/packages/utils/src/formatting.ts index 96460ee90fc..3c26b464f2a 100644 --- a/packages/utils/src/formatting.ts +++ b/packages/utils/src/formatting.ts @@ -48,7 +48,15 @@ export function getTimezoneAbbreviation(timezone: string, date: Date = new Date( return timezoneMap[timezone].standard } - return timezone + try { + const parts = new Intl.DateTimeFormat('en-US', { + timeZone: timezone, + timeZoneName: 'short', + }).formatToParts(date) + return parts.find((p) => p.type === 'timeZoneName')?.value || timezone + } catch { + return timezone + } } /** diff --git a/packages/utils/src/retry.ts b/packages/utils/src/retry.ts index cc32d8c83e5..c3fe72461d7 100644 --- a/packages/utils/src/retry.ts +++ b/packages/utils/src/retry.ts @@ -32,28 +32,31 @@ export function backoffWithJitter( return exponential * (0.8 + jitter * 0.4) } -/** Maximum `Retry-After` value honored: 30 s. Prevents a misconfigured upstream from stalling callers. */ +/** Default maximum `Retry-After` value honored: 30 s. Prevents a misconfigured upstream from stalling callers. */ const RETRY_AFTER_MAX_MS = 30_000 /** * Parses an HTTP `Retry-After` header (either delta-seconds or an HTTP-date) - * into a millisecond delay, capped at 30 s. + * into a millisecond delay, capped at `maxMs` (default 30 s). * Returns `null` when the header is absent or unparseable so callers can fall - * back to their own backoff. + * back to their own backoff. Pass the caller's own `maxDelayMs` as `maxMs` when + * that value needs to be compared against the parsed delay (e.g. to decide + * whether to skip a retry) — otherwise the default cap silently truncates the + * comparison. */ -export function parseRetryAfter(header: string | null): number | null { +export function parseRetryAfter(header: string | null, maxMs = RETRY_AFTER_MAX_MS): number | null { if (!header) return null const trimmed = header.trim() if (trimmed.length === 0) return null const seconds = Number(trimmed) if (Number.isFinite(seconds) && seconds >= 0) { - return Math.min(Math.floor(seconds * 1000), RETRY_AFTER_MAX_MS) + return Math.min(Math.floor(seconds * 1000), maxMs) } const dateMs = Date.parse(trimmed) if (!Number.isNaN(dateMs)) { const delta = dateMs - Date.now() if (delta <= 0) return 0 - return Math.min(delta, RETRY_AFTER_MAX_MS) + return Math.min(delta, maxMs) } return null } diff --git a/packages/utils/tsconfig.json b/packages/utils/tsconfig.json index 1ffa3d2e844..f24122d580b 100644 --- a/packages/utils/tsconfig.json +++ b/packages/utils/tsconfig.json @@ -1,5 +1,8 @@ { "extends": "@sim/tsconfig/library.json", + "compilerOptions": { + "lib": ["ES2022", "DOM"] + }, "include": ["src/**/*"], "exclude": ["node_modules", "dist"] } diff --git a/packages/workflow-persistence/package.json b/packages/workflow-persistence/package.json index 00a99f1dfff..3b3275b60c1 100644 --- a/packages/workflow-persistence/package.json +++ b/packages/workflow-persistence/package.json @@ -52,6 +52,7 @@ }, "devDependencies": { "@sim/tsconfig": "workspace:*", - "typescript": "^5.7.3" + "@types/node": "24.2.1", + "typescript": "^7.0.2" } } diff --git a/packages/workflow-persistence/src/subblocks.ts b/packages/workflow-persistence/src/subblocks.ts index 549fe7c303c..28501bf8f02 100644 --- a/packages/workflow-persistence/src/subblocks.ts +++ b/packages/workflow-persistence/src/subblocks.ts @@ -1,3 +1,4 @@ +import { filterUndefined } from '@sim/utils/object' import type { BlockState, SubBlockState } from '@sim/workflow-types/workflow' export const DEFAULT_SUBBLOCK_TYPE = 'short-input' @@ -60,7 +61,7 @@ export function mergeSubblockStateWithValues( const blockSubBlocks = block.subBlocks || {} const blockValues = subBlockValues[id] || {} const filteredValues = Object.fromEntries( - Object.entries(blockValues).filter(([, value]) => value !== null && value !== undefined) + Object.entries(filterUndefined(blockValues)).filter(([, value]) => value !== null) ) const mergedSubBlocks = mergeSubBlockValues(blockSubBlocks, filteredValues) as Record< diff --git a/packages/workflow-renderer/package.json b/packages/workflow-renderer/package.json index 2fbefefdbbe..d31bb33c895 100644 --- a/packages/workflow-renderer/package.json +++ b/packages/workflow-renderer/package.json @@ -44,6 +44,6 @@ "reactflow": "^11.11.4", "remark-breaks": "^4.0.0", "streamdown": "2.5.0", - "typescript": "^5.7.3" + "typescript": "^7.0.2" } } diff --git a/packages/workflow-renderer/src/css-modules.d.ts b/packages/workflow-renderer/src/css-modules.d.ts index 21599b894ea..25bd57c31c6 100644 --- a/packages/workflow-renderer/src/css-modules.d.ts +++ b/packages/workflow-renderer/src/css-modules.d.ts @@ -7,3 +7,5 @@ declare module '*.module.css' { const classes: { readonly [key: string]: string } export default classes } + +declare module '*.css' diff --git a/packages/workflow-types/package.json b/packages/workflow-types/package.json index cc041b0caaf..0dcde040f24 100644 --- a/packages/workflow-types/package.json +++ b/packages/workflow-types/package.json @@ -32,6 +32,6 @@ "devDependencies": { "@sim/tsconfig": "workspace:*", "reactflow": "^11.11.4", - "typescript": "^5.7.3" + "typescript": "^7.0.2" } } diff --git a/scripts/check-api-validation-contracts.ts b/scripts/check-api-validation-contracts.ts index 436d4081dec..1aa4dc0495d 100644 --- a/scripts/check-api-validation-contracts.ts +++ b/scripts/check-api-validation-contracts.ts @@ -9,8 +9,8 @@ const QUERY_HOOKS_DIR = path.join(ROOT, 'apps/sim/hooks/queries') const SELECTOR_HOOKS_DIR = path.join(ROOT, 'apps/sim/hooks/selectors') const BASELINE = { - totalRoutes: 917, - zodRoutes: 917, + totalRoutes: 919, + zodRoutes: 919, nonZodRoutes: 0, } as const diff --git a/scripts/create-single-release.ts b/scripts/create-single-release.ts index 943386a91f3..9d98b930593 100755 --- a/scripts/create-single-release.ts +++ b/scripts/create-single-release.ts @@ -2,6 +2,7 @@ import { execSync } from 'node:child_process' import { Octokit } from '@octokit/rest' +import { sleep } from '@sim/utils/helpers' const GITHUB_TOKEN = process.env.GH_PAT const REPO_OWNER = 'simstudioai' @@ -139,7 +140,7 @@ async function fetchGitHubCommitDetails( prNumber, }) - await new Promise((resolve) => setTimeout(resolve, 100)) + await sleep(100) } catch (error: any) { console.warn(`⚠️ Could not fetch commit ${hash.substring(0, 7)}: ${error?.message || error}`)