Compare commits

..
Author SHA1 Message Date
Simon Lamon 608cdf168e Move live condition test inline 2026-06-05 20:53:18 +00:00
2358 changed files with 86801 additions and 266354 deletions

No files matched your search

@@ -1,106 +0,0 @@
---
name: ha-frontend-components
description: Home Assistant frontend component patterns. Use when implementing or reviewing dialogs, ha-form, ha-alert, keyboard shortcuts, tooltips, panels, Lovelace cards, or ha-button usage.
---
# HA Frontend Components
Use this skill when creating or reviewing Home Assistant UI components and common interaction patterns.
Cross-load `ha-frontend-events` when component work includes event listener typing, custom event dispatch, or event-map declarations.
## Dialogs
Open dialogs through the fire-event pattern:
```ts
fireEvent(this, "show-dialog", {
dialogTag: "dialog-example",
dialogImport: () => import("./dialog-example"),
dialogParams: { title: "Example", data: someData },
});
```
Dialog implementation requirements:
- Use `ha-dialog`.
- Use `DialogMixin`, which implements `HassDialogNext<T>`, for new dialogs. See `src/dialogs/dialog-mixin.ts`.
- Read dialog parameters from the mixin's `params` property and render the dialog open. Return `nothing` while required parameters are absent.
- Call the mixin's `closeDialog()` to close a new dialog. The mixin handles the `closed` event, fires `dialog-closed`, and removes the host element.
- Existing dialogs may implement the legacy `HassDialog<T>` interface from `src/dialogs/make-dialog-manager.ts`.
- Preserve the existing `showDialog()`, open-state, and close-event lifecycle when maintaining a legacy dialog; do not copy that lifecycle into a `DialogMixin` dialog.
- Use `header-title` and `header-subtitle` for simple header text.
- Use slots when standard header attributes are not enough.
- Use `ha-dialog-footer` with `primaryAction` and `secondaryAction` slots.
- Add `autofocus` to the first focusable element, such as `<ha-form autofocus>`, and forward it internally if needed.
Use standard dialog widths: `small`, `medium`, `large`, or `full`. Avoid custom dialog sizing unless there is a clear product need.
## Buttons
`ha-button` wraps the Web Awesome button in `src/components/ha-button.ts`.
Axes:
- `variant`: `brand`, `neutral`, `danger`, `warning`, `success`.
- `appearance`: `accent`, `filled`, `outlined`, `plain`.
- `size`: `xs`, `s`, `m`, `l`, `xl`.
Common usage:
- Use `appearance="filled"` for primary emphasis when needed.
- Use `appearance="plain"` for cancel and dismiss actions.
- Use `variant="danger"` for destructive actions.
- Place primary actions in `slot="primaryAction"` and secondary actions in `slot="secondaryAction"`.
## Forms
`ha-form` is schema-driven with `HaFormSchema[]` and supports common selectors for entities, devices, areas, targets, numbers, booleans, time, actions, text, objects, selects, icons, media, and location.
Use `computeLabel`, `computeError`, and `computeHelper` for translated labels, validation, and helper text.
```ts
<ha-form
.hass=${this.hass}
.data=${this._data}
.schema=${this._schema}
.error=${this._errors}
.computeLabel=${(schema) => this._localize(`ui.panel.${schema.name}`)}
@value-changed=${this._valueChanged}
></ha-form>
```
## Alerts
Use `ha-alert` for user-visible status messaging.
- Alert types: `error`, `warning`, `info`, `success`.
- Useful properties: `title`, `alert-type`, `dismissable`, `narrow`.
- Slots: `icon` for custom leading icon, `action` for custom action content.
- Content is announced by screen readers when dynamically displayed.
```ts
html`
<ha-alert alert-type="error">${this._localize("ui.example.error")}</ha-alert>
<ha-alert alert-type="warning" .title=${this._localize("ui.example.warning")}>
${this._localize("ui.example.description")}
</ha-alert>
<ha-alert alert-type="success" dismissable>
${this._localize("ui.example.success")}
</ha-alert>
`;
```
## Shortcuts And Tooltips
Use `ShortcutManager` from `src/common/keyboard/shortcuts.ts` for keyboard shortcuts. It blocks shortcuts in input fields, can prevent shortcuts during text selection, and supports character and KeyCode shortcuts for non-latin keyboards. See `src/state/quick-bar-mixin.ts` for global shortcut examples.
Use `ha-tooltip` from `src/components/ha-tooltip.ts` for contextual hover help. See `src/components/ha-label.ts` for an example.
## Panels And Lovelace Cards
Panels commonly extend `SubscribeMixin(LitElement)` and receive route and narrow-layout properties.
Lovelace cards should implement `LovelaceCard`, validate config in `setConfig()`, handle loading, error, unavailable, and missing-entity states, and add a configuration editor when needed.
Cards are user-story surfaces. Support different households, entity types, responsive layouts, and accessible interaction states.
@@ -1,94 +0,0 @@
---
name: ha-frontend-contexts
description: Home Assistant frontend Lit context and hass migration guidance. Use when adding or changing component state access, replacing hass reads, consuming entity or registry contexts, or reviewing rerender behavior.
---
# HA Frontend Contexts
Use this skill when a component reads Home Assistant state, registries, localization, services, config, UI data, connection state, or API helpers.
## Goal
Move leaf components away from the broad `hass: HomeAssistant` object. Broad `hass` access rerenders components for unrelated changes, hides the data a component depends on, and makes tests harder to mock.
Container components may keep `hass` when they own it and feed providers. Leaf components should consume the narrowest context that covers their reads.
## Core Files
- Context definitions: `src/data/context/index.ts`
- `consume` decorator and `ContextSubscriptionController`: `src/common/decorators/consume.ts` (use instead of `@lit/context`'s `consume` and `ContextConsumer`, enforced by ESLint)
- Entity-scoped consume helpers: `src/common/decorators/consume-context-entry.ts`
- Transform decorator: `src/common/decorators/transform.ts`
- Canonical migration example: `src/panels/lovelace/cards/hui-button-card.ts`
- Providers are wired by `contextMixin` on `HassBaseEl`; consumers do not wire providers manually.
## Context Selection
| Context | Replaces |
| -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| `statesContext` | `hass.states` |
| `entitiesContext`, `devicesContext`, `areasContext`, `floorsContext` | `hass.entities`, `hass.devices`, `hass.areas`, `hass.floors` |
| `registriesContext` | all four registries together |
| `servicesContext` | `hass.services` |
| `internationalizationContext` | `hass.localize`, `hass.locale`, `hass.language` |
| `formattersContext` | entity and attribute formatters |
| `configContext` | `hass.config`, `hass.user`, `hass.auth`, `hass.userData` |
| `connectionContext` | `hass.connection`, `hass.connected`, `hass.debugConnection`, `hass.hassUrl` |
| `apiContext` | `hass.callService`, `hass.callApi`, `hass.callApiRaw`, `hass.callWS`, `hass.sendWS`, `hass.fetchWithAuth` |
| `uiContext` | themes, selected theme, panels, sidebar, and UI state |
| `narrowViewportContext` | narrow-layout boolean |
Lazy contexts subscribe on first consumer and tear down after the last consumer: `labelsContext`, `fullEntitiesContext`, `configEntriesContext`, `manifestsContext`, `triggerDescriptionsContext`, and `conditionDescriptionsContext`.
The single-field contexts such as `localizeContext`, `themesContext`, and `userContext` are deprecated. Use grouped contexts instead.
## Consumption Patterns
Import `consume` from `src/common/decorators/consume`, not from `@lit/context`. The `@lit/context` version forces a host update on every context change, so every consumed field rerenders the component, even without `@state()`, and `@transform` cannot skip anything. Our `consume` leaves update scheduling to the field:
- `@state()` plus `@consume`: rerenders when the context value changes.
- `@state()` plus `@consume` plus `@transform`: rerenders only when the transformed value changes.
- `@consume` alone: the field stays current but never triggers a render. Use this for values only read in event handlers or callbacks, such as `apiContext`, or for data read on demand, such as picker item callbacks.
In controllers or for lazily created subscriptions, use `ContextSubscriptionController` from the same file instead of `@lit/context`'s `ContextConsumer`, which also forces a host update. Its callback must store the value in a reactive field or call `host.requestUpdate()` itself when the host needs to rerender.
Use entity-scoped helpers when the component watches an entity ID held on the host:
```ts
@state() @consumeEntityState({ entityIdPath: ["_config", "entity"] })
private _stateObj?: HassEntity;
@state() @consumeEntityRegistryEntry({ entityIdPath: ["_config", "entity"] })
private _entity?: EntityRegistryDisplayEntry;
@state() @consumeLocalize()
private _localize!: LocalizeFunc;
```
Use `consumeEntityStates` when the host property contains one or more entity IDs. It filters missing entities and preserves the previous record when none of the selected entities changed.
```ts
@state() @consumeEntityStates({ entityIdPath: ["_config", "entities"] })
private _stateObjs?: Record<string, HassEntity>;
```
For a single field from a grouped context, pair `@consume` with `@transform`:
```ts
@state()
@consume({ context: uiContext, subscribe: true })
@transform<HomeAssistantUI, Themes>({ transformer: ({ themes }) => themes })
private _themes!: Themes;
```
Use `@transform` with `watch` when the transformer depends on a host property, such as a computed entity ID. `consumeEntityState` and `consumeEntityStates` only watch the first path segment.
To consume a whole group untransformed, omit `@transform` and type the field as `ContextType<typeof statesContext>` or the matching context type.
## Review Checklist
- The component consumes the narrowest context needed for the data it reads.
- A broad `hass` property is kept only when the component is a container or external API requires it.
- Entity-scoped reads use the consume helpers rather than ad hoc context transforms.
- Context fields read during render or `willUpdate` are marked `@state()` so updates trigger rendering. Fields only read outside the render cycle are left without `@state()`.
- Tests and mocks only provide the data the component actually consumes.
-65
View File
@@ -1,65 +0,0 @@
---
name: ha-frontend-demo
description: Home Assistant standalone demo structure, configurations, URL navigation, mocked APIs, shared demo stubs used by gallery, and verification. Use when changing files under demo/, changing gallery consumers of demo/src/stubs/, or running and validating the demo.
---
# HA Frontend Demo
Use this skill for standalone demo work and changes to shared demo stubs consumed by the gallery. Follow the persistent repository guidance in `AGENTS.md` and load matching specialist skills alongside this skill, especially `ha-frontend-testing` when running or validating the demo.
## Purpose
The demo is the full Home Assistant frontend running against a mocked backend and is published at <https://demo.home-assistant.io>. It needs no Home Assistant server, which makes it the easiest way to load the real UI in a browser, for example to take screenshots.
## Running The Demo
Run commands from the repository root:
```bash
pnpm dev:demo # Development server on http://localhost:8090
pnpm dev:demo --background # Detached; also supports --status/--stop/--logs
```
Use the E2E workflows documented in `ha-frontend-testing` when validating the demo.
## Opening A Specific Demo
The demo contains multiple demo configurations. Select one directly with the `demo` query parameter, for example `http://localhost:8090/?demo=<slug>`. The valid slugs are defined in `demoConfigs` in `demo/src/configs/demo-configs.ts`, so "the second demo" means the slug of the second entry in that list. An unknown slug falls back to the default, which is the first entry.
## Opening A Specific Page
The demo build uses hash-based routing: the frontend path goes in the URL hash, and the `demo` query parameter goes before the `#`. The URL format is:
```text
http://localhost:8090/?demo=<slug>#/<path>
```
Useful paths:
- `/lovelace/0`: The selected demo's dashboard, also the default when no hash is given.
- `/energy`: The energy dashboard. Its tabs are views: `/energy/overview` (Summary), `/energy/electricity`, `/energy/gas`, `/energy/water`, and `/energy/now`.
- `/map`, `/history`, `/todo`, `/config`: Other sidebar panels.
For example, the water tab of the energy dashboard of the second demo is:
```text
http://localhost:8090/?demo=<second slug>#/energy/water
```
## Structure
- `demo/src/ha-demo.ts`: Root element that sets up all backend mocks.
- `demo/src/configs/<slug>/`: One directory per demo configuration, containing entities, dashboard, and theme data.
- `demo/src/configs/demo-configs.ts`: Registry of demo configurations and URL slug handling.
- `demo/src/stubs/`: Mocked WebSocket and REST APIs.
- `demo/script/develop_demo`, `demo/script/build_demo`: Development server and static build wrappers.
## Shared Gallery Stubs
`demo/src/stubs/` is shared, not demo-private: gallery pages import from it directly. Before changing or removing anything a stub does, search for its callers across `demo/src/` and `gallery/src/`, then check the affected gallery pages as well as the demo.
The two consumers use a stub differently, so demo behavior does not predict gallery behavior. A gallery page calls stubs against the `hass` from `provideHass`, where `hass.config` is the shared `demoConfig` object. A stub that mutates `hass.config` in place is therefore visible to the page. `demo/src/ha-demo.ts` copies `components` into a new array before the stubs run, so the same mutation never reaches the demo. A change can look correct in the demo while quietly breaking a gallery page.
## Verification
Load `ha-frontend-testing` and use its demo and gallery workflows. Validate both consumers when changing shared stubs. Documentation-only changes do not require code tests unless examples or commands change.
-105
View File
@@ -1,105 +0,0 @@
---
name: ha-frontend-events
description: Home Assistant frontend event patterns. Use when typing event handlers, using HASSDomEvent types, dispatching with fireEvent, or declaring HASSDomEvents and event maps.
---
# HA Frontend Events
Use this skill when implementing or reviewing event listeners and custom event contracts. Cross-load `ha-frontend-components` when the work also involves dialogs, forms, alerts, shortcuts, tooltips, panels, Lovelace cards, or buttons.
## Event Handling
Use the event types from `src/common/dom/fire_event.ts` instead of plain `Event`, generic `CustomEvent`, or element casts when they express the handler contract:
- Use `HASSDomCurrentTargetEvent<T>` to read the element on which the listener was registered through `ev.currentTarget`.
- Use `HASSDomTargetEvent<T>` only to read the element that originated the event through `ev.target`.
- Use `HASSDomEvent<T>` to read a custom event payload through `ev.detail`.
- Use `ValueChangedEvent<T>` from `src/types.ts` for the standard `value-changed` event.
- Prefer an event type exported by the component being listened to, such as `HaSelectSelectEvent<T, Clearable>` or `HaDropdownSelectEvent<TValue, TData>`, over reconstructing its detail type.
- Use `ActionHandlerEvent` from `src/data/lovelace/action_handler.ts` for Lovelace tap, hold, and double-tap handlers.
Import event and element types with `import type`:
```ts
import type {
HASSDomCurrentTargetEvent,
HASSDomEvent,
HASSDomTargetEvent,
} from "../common/dom/fire_event";
import type { HaCheckbox } from "../components/ha-checkbox";
import type { HaEntityPicker } from "../components/entity/ha-entity-picker";
import type { HaRadioGroup } from "../components/radio/ha-radio-group";
import type { ValueChangedEvent } from "../types";
```
Type the handler so the selected property can be read directly. Do not cast `ev.currentTarget` or assign it to a single-use variable:
```ts
private _scopeChanged(ev: HASSDomCurrentTargetEvent<HaRadioGroup>): void {
this._scope = ev.currentTarget.value;
}
private _checkedChanged(ev: HASSDomTargetEvent<HaCheckbox>): void {
this._checked = ev.target.checked;
}
private _valueChanged(ev: ValueChangedEvent<string>): void {
this._value = ev.detail.value;
}
private _itemSelected(ev: HASSDomEvent<{ id: string }>): void {
this._selectedId = ev.detail.id;
}
```
Use intersections when a handler needs more than one facet of an event. Keep the native event type when the handler reads native fields such as `key`, modifier keys, `dataTransfer`, or focus relationships:
```ts
private _entityChanged(
ev: ValueChangedEvent<string> & HASSDomCurrentTargetEvent<HaEntityPicker>
): void {
ev.currentTarget.value = ev.detail.value;
}
private _keyDown(
ev: KeyboardEvent & HASSDomCurrentTargetEvent<HTMLInputElement>
): void {
if (ev.key === "Enter") {
this._submit(ev.currentTarget.value);
}
}
```
Dispatch Home Assistant component events with `fireEvent()` instead of constructing `Event` or `CustomEvent` directly. Register the event name and detail type by augmenting `HASSDomEvents`; use `undefined` when an event has no detail. `fireEvent()` constrains event names and supplied detail, and events bubble and cross shadow boundaries by default:
```ts
fireEvent(this, "item-selected", { id: item.id });
fireEvent(this, "refresh-requested");
```
When an event is already registered, derive handler and listener types from its registration rather than repeating the payload shape:
```ts
private _itemSelected(
ev: HASSDomEvent<HASSDomEvents["item-selected"]>
): void {
this._selectedId = ev.detail.id;
}
```
`HASSDomEvents` types `fireEvent()` calls. Augment `HTMLElementEventMap` for typed listeners on HTML elements, or `GlobalEventHandlersEventMap` when the event is handled on global event targets.
In component files, prefer placing global event declarations after the class at the bottom of the file. Preserve the existing placement when editing established files; foundational type, helper, and mixin files commonly keep declarations near the top before their consumers.
```ts
declare global {
interface HASSDomEvents {
"item-selected": { id: string };
"refresh-requested": undefined;
}
interface HTMLElementEventMap {
"item-selected": HASSDomEvent<HASSDomEvents["item-selected"]>;
}
}
```
-128
View File
@@ -1,128 +0,0 @@
---
name: ha-frontend-gallery
description: Home Assistant frontend gallery structure, pages, demos, content, and verification. Use when changing files under gallery/, including gallery markdown, TypeScript demos, sidebar entries, mock data, page generation, or gallery builds.
---
# HA Frontend Gallery
Use this skill for all work under `gallery/`. Follow the persistent repository guidance in `AGENTS.md` and load the matching specialist skills alongside this gallery-specific guidance.
## Quick Reference
Run commands from the repository root unless noted otherwise:
```bash
gallery/script/develop_gallery # Start the gallery development server
gallery/script/build_gallery # Build the static gallery
pnpm lint # ESLint, Prettier, TypeScript, and Lit checks
pnpm lint:types # TypeScript compiler, without file arguments
```
Never run `pnpm lint:types` or `tsc` with file arguments. File arguments make `tsc` ignore `tsconfig.json` and can emit `.js` files into `src/`.
## Purpose
The gallery is a developer and designer reference for Home Assistant frontend UI patterns. It documents component APIs, shows realistic Lovelace and more-info states, captures brand and copy guidance, and provides reproducible demos that are safe to inspect outside a running Home Assistant instance.
- Prefer demonstrating real production components from `src/` instead of creating gallery-only replacements.
- Keep fake state, sample data, and demo-only helpers inside `gallery/`.
- Do not move gallery stubs or demo data into production code unless a production feature explicitly needs them.
- Do not hand-edit generated output under `gallery/build/` or `gallery/dist/`.
## Structure
- `gallery/sidebar.js`: Defines gallery sections, headers, and explicit page ordering.
- `gallery/script/develop_gallery`: Wrapper for the `develop-gallery` gulp task.
- `gallery/script/build_gallery`: Wrapper for the `build-gallery` gulp task.
- `gallery/src/entrypoint.js`: Creates the `<ha-gallery>` shell.
- `gallery/src/ha-gallery.ts`: Renders the drawer, page routing, markdown descriptions, demos, edit links, and RTL toggle.
- `gallery/src/html/index.html.template`: HTML template used by the gallery build.
- `gallery/src/pages/<category>/<page>.markdown`: Optional page description and frontmatter.
- `gallery/src/pages/<category>/<page>.ts`: Optional live demo module for the same page ID.
- `gallery/src/components/`: Gallery-only demo wrappers like `demo-card`, `demo-cards`, `demo-more-info`, and `page-description`.
- `gallery/src/data/`: Fake `hass`, demo states, mock traces, and reusable sample data.
- `gallery/public/`: Static assets copied into the gallery output.
## Page Model
Gallery pages are generated by `gather-gallery-pages` in `build-scripts/gulp/gallery.js`.
- A page ID is the path under `gallery/src/pages/` without the extension, like `components/ha-button`.
- A `.markdown` file and a `.ts` file with the same page ID become one gallery page.
- A page may have only markdown, only a TypeScript demo, or both.
- Markdown can contain YAML frontmatter with `title` and optional `subtitle`.
- Markdown that contains only frontmatter contributes metadata without rendering a description block.
- TypeScript demo modules are dynamically imported for side effects when the page is opened.
- A demo module must define a custom element named `demo-${category}-${page}` with slashes replaced by hyphens, like `demo-components-ha-button` for `components/ha-button`.
- `gallery/src/ha-gallery.ts` renders that element with `dynamicElement()` based on the current page ID.
## Sidebar
Use `gallery/sidebar.js` when a page needs a visible section, section header, or deterministic ordering.
- `category` must match the first directory name under `gallery/src/pages/`.
- `header` is the section label shown in the drawer.
- `pages` is optional. When present, listed pages keep that exact order.
- Pages in a category that are not listed are appended alphabetically after the listed pages.
- New categories without a sidebar entry are appended by the generator with their category name as the header.
- If a listed page does not exist, the generator logs an error during `gather-gallery-pages`.
### Subsections
A section can group its pages under named subsections instead of one flat list. Use this for large categories where related pages should sit together.
- `subsections` is an array of `{ header, pages }`. It is mutually exclusive with a flat `pages` array on the same group.
- Each subsection `header` is a non-collapsible label rendered inside the section's expansion panel; the section stays the only collapsible level.
- Listed pages keep their per-subsection order.
- Any pages found in the category but not listed in a subsection are collected into a generated `Other` subsection, appended alphabetically. The `Other` subsection is omitted when there are no leftovers.
- A listed page that does not exist still logs an error during `gather-gallery-pages`.
- Use sentence case for subsection headers and follow the content standards below.
## Markdown Pages
Use markdown pages for explanations, design guidance, API notes, and copy standards.
- Start with frontmatter when the page needs a title or subtitle.
- Use sentence case for titles, headings, labels, and UI copy.
- Put the live example before the reference API when that makes the page easier to scan.
- Use fenced code blocks with a language tag for copyable examples.
- Keep examples short and focused on the behavior being documented.
- Prefer real component names and attributes over prose-only descriptions.
- Use Home Assistant terminology from `ha-frontend-user-facing-text`.
- For remove/delete and add/create wording, follow `gallery/src/pages/misc/remove-delete-add-create.markdown`.
Gallery markdown is documentation content and is not localized with `localize`. If demo code creates production UI strings, follow the localization and copy guidance in `ha-frontend-user-facing-text`.
## Demo Components
Use TypeScript demo pages for interactive or stateful examples.
- Import production components from `src/` using the correct relative path from the demo file.
- Import reusable gallery helpers from `gallery/src/components/` when they already model the pattern.
- Use `demo-card` and `demo-cards` for Lovelace card examples that render YAML card configs.
- Use `demo-more-info` and `demo-more-infos` for more-info dialog examples.
- Use shared mock data from `gallery/src/data/` instead of repeating large fake state objects inline.
- Show meaningful states, such as loading, unavailable, empty, error, active, inactive, and disabled when relevant.
- Check responsive behavior and the gallery RTL toggle when layout or direction-sensitive UI changes.
- Keep unavoidable casts or loose demo parsing local to the demo helper or demo page.
The gallery ESLint config allows `console` for gallery diagnostics. Do not copy that exception into production frontend code.
## Content Standards
Follow the detailed copy standards in `ha-frontend-user-facing-text`: use American English, sentence case, active voice, inclusive language, direct user-focused wording, and consistent Home Assistant terminology.
- Use `Home Assistant` in full, not `HA` or `HASS`.
- Use `integration` instead of `component` for product concepts.
- Use `Remove` for reversible disassociation and `Delete` for permanent deletion.
- Use `Add` for existing items and `Create` for something made from scratch.
- Avoid Latin abbreviations like `e.g.` and `i.e.` in prose.
- Avoid stitching sentence fragments together in production UI examples.
## Verification
- For markdown, sidebar, and page-generation changes, run `gallery/script/build_gallery`.
- For TypeScript demo or gallery shell changes, run the smallest relevant check plus `pnpm lint` when practical.
- For type checking, run `pnpm lint:types` without file arguments.
- For visual changes, run `gallery/script/develop_gallery` and check the affected page on desktop, narrow viewport, and RTL when relevant.
- If verification is skipped, state which command was skipped and why.
-39
View File
@@ -1,39 +0,0 @@
---
name: ha-frontend-lit
description: Home Assistant frontend Lit conventions. Use when working with reactive properties, internal state, DOM queries, lifecycle methods, or render-derived state.
---
# HA Frontend Lit
Use this skill when implementing or reviewing Lit component state, DOM access, lifecycle methods, or rendering behavior. Cross-load `ha-frontend-types` for Home Assistant data contracts, assertions, and lifecycle parameter types.
## Reactive Fields
This project currently uses Lit's TypeScript experimental decorators with `useDefineForClassFields: false`. Match existing declarations and do not introduce standard-decorator `accessor` syntax unless the project changes decorator mode.
- Use `@property()` for public reactive API and `@state()` for private reactive state.
- Prefer inferred types for initialized reactive fields when inference preserves the intended type; annotate when widening or an external contract requires it.
## DOM Queries
Prefer Lit's `@query()` or `@queryAll()` decorators for fixed selectors in the component's render root.
- Type the decorated field with the narrowest useful DOM or component interface.
- Keep the field optional when it may be absent at the point of access, including conditional rendering or pre-render lifecycle access.
- Use a definite assignment assertion only when every call site runs after the node is guaranteed to exist.
- The optional second argument to `@query()`, as in `@query("#target", true)`, caches the first query result. Use it only when later renders cannot replace the queried node.
- Use a direct query when the selector is dynamic or the target is outside the component's render root. Before querying a child, consider whether the required value belongs in parent state or data flow.
## Render-Derived State
- Prefer render-local values for inexpensive structures used only by that render.
- Assign a render-local value once when repeated evaluation is non-trivial or a local name improves clarity.
- Keep purely presentational derivations in `render()`. Use stored state or `willUpdate()` when the value must participate in lifecycle work, reflection, CSS, or non-render consumers.
- Use `memoizeOne` for pure, argument-derived transforms when stable input identity avoids meaningful repeated work. Keep inputs explicit and limited, and do not add caching without a credible benefit over computing the value directly.
## References
- [Reactive properties](https://lit.dev/docs/components/properties/)
- [Decorators](https://lit.dev/docs/components/decorators/)
- [Shadow DOM queries](https://lit.dev/docs/components/shadow-dom/#query)
- [Reactive update cycle](https://lit.dev/docs/components/lifecycle/)
-127
View File
@@ -1,127 +0,0 @@
---
name: ha-frontend-review
description: Home Assistant frontend PR and review guidance, including implementation quality, existing review feedback, established design patterns, and the authority of UI/UX evidence. Use when reviewing frontend changes, preparing a PR, checking recurring review issues, or applying the PR template.
---
# HA Frontend Review
Use this skill when reviewing Home Assistant frontend changes or preparing a pull request.
## Review Preparation
1. Establish the review scope from the diff and the behavior changed by it.
2. Before identifying findings, use the [project skill catalogue](../../../AGENTS.md#project-skills) to load every matching companion's `SKILL.md`. Follow applicable companion references in those skills as well; this review skill supplies the workflow, and companions supply the domain-specific criteria.
3. Apply all loaded guidance within that scope. Report only problems introduced or worsened by the changeset, anchored to changed lines. Read surrounding code to understand affected behavior, not to generate unrelated cleanup or migration requests.
## Pull Request Body
When creating a pull request, use `.github/PULL_REQUEST_TEMPLATE.md` as the body.
- Do not omit, reorder, or rewrite template sections.
- Check the appropriate "Type of change" box based on the actual change.
- Do not check checklist items on behalf of the user.
- If the PR includes UI changes, remind the user to add screenshots or a short video.
- Explain what the change does for users, not only implementation details.
- Use Markdown.
## Pre-Submission Checklist
- `pnpm lint` passes when practical for the scope.
- `pnpm test` or focused relevant tests are green when practical for the scope.
- Each test added by the change protects real logic, not the look of a component.
- User-facing text is localized and follows `ha-frontend-user-facing-text` guidance.
- Components handle loading, error, unavailable, and missing-entity states.
- Entity existence is checked before property access.
- Event listeners and subscriptions are cleaned up.
- UI is accessible to screen readers and keyboard users.
## Recurring Review Issues
Scope and public surface:
- Keep changes independently reviewable and limited to the requested area.
- Prefer existing Home Assistant helpers, Lit primitives, and component seams over parallel implementations.
- Challenge new public properties and optional feature surface when transient options or existing seams meet the requirement with less lifecycle and consistency cost.
Stateful and asynchronous UI:
- Review transitions in both directions, not only individual rendered states.
- When controls reappear, restore valid defaults instead of retaining state that was only valid while they were hidden.
- Establish immutable dirty-state baselines before asynchronous work, guard against stale responses, and preserve unsaved state in mounted editors.
- Determine an action's current meaning before applying dirty-state checks, especially when an action can change between Save and Close.
Readiness and invalidation:
- Treat readiness as the first displayable terminal result, including stable empty and error states.
- Register child readiness before resolving the parent, do not treat fallback work as terminal, and replay readiness correctly for cached or reused panels.
- Ensure every value read by memoized output participates in its invalidation.
Repository-owned contracts:
- Consult the public [frontend developer documentation](https://developers.home-assistant.io/docs/frontend/) for documented architecture, data flow, design, and development workflows.
- For new leaf components, load `ha-frontend-contexts` and verify they consume narrow contexts instead of introducing a broad `hass` property; containers and external APIs may still require `hass`.
- Verify backend assumptions against the owning Core, Supervisor, or WebSocket implementation, and component assumptions against the exported component contract.
- Prefer canonical repository helpers and test setup over duplicate local implementations.
- Promote AI-review concerns into durable guidance only when supported by code evidence, reproduced behavior, an accepted corrective commit, or human-maintainer validation.
User experience and accessibility:
- Forms need proper labels, helper text, and validation feedback.
- Form markup should not cause password managers to identify fields incorrectly.
- Clickable areas should be large enough for touch interaction.
- Hover, active, disabled, loading, and focus states should be clear.
Dialog and modal patterns:
- Multi-step operations should show progress.
- Dialog state should survive background operations correctly.
- Cancel and close buttons should behave consistently.
- Defaults should be helpful without blocking user override.
Component design patterns:
- Terminology should be consistent. Use words like "Join" or "Apply" instead of "Group" when that better matches the user action.
- Visual hierarchy should use appropriate font sizes, weights, and spacing ratios.
- Components should align to the design grid.
- Badges and indicators should be placed consistently.
Code quality:
- Null and undefined paths should be handled explicitly.
- Potentially undefined array and object access should be guarded.
- Event handlers, timers, observers, and subscriptions should be cleaned up.
Configuration and props:
- Make configuration fields optional when sensible.
- Provide reasonable defaults.
- Keep APIs extensible without adding speculative abstractions.
- Validate configuration before applying changes.
## UI/UX Evidence
For user-facing changes, establish the existing design context as part of frontend review:
- Treat an applicable gallery specification as the authoritative repository source for the documented component or interaction. Inspect its written guidance and demos when present.
- Note relevant production designs, approved designs, and shared `ha-*` components so the implementation can also be compared with established frontend behaviour.
- Require the applicable gallery documentation or demo to change when the implementation intentionally changes behaviour documented there.
- Prefer an established input layout or appropriate shared component over a raw input or ad hoc control.
- Treat explicit UI/UX approval, current repository guidance, and direct human or workflow instructions as stronger evidence than inference.
- Treat linked tasks as evidence of the problem and stated requirements, not automatic UI/UX approval.
- When the direction remains uncertain, search frontend pull requests that carry or previously carried **Needs UX**. Inspect their label history, comments, and reviews rather than relying on the current label alone.
- Judge relevant feedback by its content and surrounding discussion. When GitHub provides `author_association`, prioritise feedback marked `MEMBER`.
- Prefer recent feedback about similar interactions or components. Label removal can show that a workflow gate moved on, but does not prove approval without the surrounding discussion.
- Summarise the applicable guidance instead of maintaining a reviewer list or treating one historical decision as a permanent rule.
## Review Flow
- Before reviewing a pull request, read its existing comments, reviews, and threads, including their status, resolver, and Copilot resolution reason when available.
- Prioritise substantive human feedback, especially from authors marked `MEMBER`, and validate agent-generated feedback against the code and repository guidance.
- Do not duplicate unresolved findings as new inline comments; reference any that still need action in the review summary. Treat resolved feedback as closed only when the resolution reason or surrounding discussion supports that outcome; otherwise validate it against the current code before suppressing it. Respect **Won't fix** and **Incorrect** reasons.
- When a later commit addresses an unresolved thread, note in the review summary that it looks addressed, linking the thread and the commit, so it can be resolved. Do not report it as still open.
- Identify behavioral regressions, bugs, accessibility issues, and missing tests that `ha-frontend-testing` calls for first.
- Do not ask for new tests on visual components. If the visuals clearly changed and the PR has no screenshots or videos, suggest adding them instead.
- When the change adds something repository guidance rules out, such as a rendering test, open the comment with the removal ("Remove this test file") and cite the guidance in one sentence. Do not critique how the unwanted code is written, as that reads as a request to fix it.
- Record the applicable UI/UX evidence for user-facing changes, whether or not further input is needed.
- Keep style-only comments secondary unless they affect maintainability or user experience.
- Prefer small, direct fixes over large refactors during review follow-up.
@@ -1,78 +0,0 @@
---
name: ha-frontend-styling
description: Home Assistant frontend styling, theming, spacing, responsive layout, RTL, and View Transitions guidance. Use when editing CSS, layout, motion, or visual component structure.
---
# HA Frontend Styling
Use this skill when editing CSS, layout, visual hierarchy, theme integration, responsive behavior, RTL support, or view transitions.
## Theme And Layout Basics
- Use Home Assistant CSS custom properties instead of hardcoded colors.
- Use `--ha-space-*` spacing tokens instead of hardcoded spacing where possible.
- Keep components mobile-first and enhance for desktop.
- Keep layouts RTL-safe. Prefer logical properties when they fit.
- Prefer `ha-*` components and current Web Awesome wrappers.
- Avoid adding new legacy Material Web Components (`mwc-*`).
- Scope styles to the component. Do not rely on global styles for component internals.
Spacing tokens are defined in `src/resources/theme/core.globals.ts`. The scale runs from `--ha-space-1` at 4px through `--ha-space-20` at 80px in 4px increments. Common values are `--ha-space-2` at 8px, `--ha-space-4` at 16px, and `--ha-space-8` at 32px.
```ts
static get styles() {
return css`
:host {
padding: var(--ha-space-4);
color: var(--primary-text-color);
background-color: var(--card-background-color);
}
.content {
gap: var(--ha-space-2);
}
@media (max-width: 600px) {
:host {
padding: var(--ha-space-2);
}
}
`;
}
```
## Interaction States
- Make touch targets large enough for mobile.
- Provide clear hover, active, focus, disabled, loading, error, and unavailable states.
- Preserve keyboard navigation and visible focus indicators.
- Maintain WCAG AA contrast for text and essential UI affordances.
## View Transitions
Use the View Transitions API only for meaningful continuity between DOM states.
Core resources:
- Utility wrapper: `src/common/util/view-transition.ts`, `withViewTransition()`.
- Launch-screen fade example: `src/util/launch-screen.ts`.
- Animation keyframes: `src/resources/theme/animations.globals.ts`.
- Animation duration tokens: `src/resources/theme/core.globals.ts`.
Implementation rules:
- Use `withViewTransition()` for fallback behavior.
- Keep transitions simple. Subtle fades and crossfades usually work best.
- Use `--ha-animation-duration-fast`, `--ha-animation-duration-normal`, or `--ha-animation-duration-slow` for timing.
- Ensure each `view-transition-name` is unique at any given time.
- Remember only one view transition can run at a time.
- View transitions operate at document level and do not work inside Shadow DOM style isolation. For web components, set `view-transition-name` on `:host` or use document-level transitions.
- The root gets `view-transition-name: root` by default. Target `::view-transition-group(root)` to customize the default page transition.
## Review Checklist
- Styling uses theme variables and spacing tokens where practical.
- Layout is mobile-first and RTL-safe.
- Component styles are scoped.
- Interactive states are clear and accessible.
- Motion is subtle, tokenized, and respects reduced-motion behavior through existing globals.
-100
View File
@@ -1,100 +0,0 @@
---
name: ha-frontend-testing
description: Home Assistant frontend testing and validation workflow. Use when adding or updating tests, running lint, TypeScript checks, Vitest, Playwright e2e suites, dev servers, or chart-data benchmarks.
---
# HA Frontend Testing
Use this skill when choosing or running validation for frontend changes.
## Test Helpers
- Before adding or changing tests, inspect the relevant suite's existing helpers and fixtures. Reuse them instead of duplicating setup, test data, navigation, interactions, waits, or assertions.
- When the same test flow appears more than once, move it into the closest suite-local helper with a focused interface.
- Keep one-off test behaviour in the test unless a helper makes the intent materially clearer. Do not hide the behaviour under test behind broad, configurable abstractions.
## Core Commands
```bash
pnpm lint # ESLint + Prettier + TypeScript + Lit
pnpm format # Auto-fix ESLint + Prettier
pnpm lint:types # TypeScript compiler, run without file arguments
pnpm test # Vitest
pnpm build # Full production build
pnpm dev # App dev server
pnpm dev:serve # Local serving dev server
```
Never run `tsc` or `pnpm lint:types` with file arguments. File arguments make `tsc` ignore `tsconfig.json` and can emit `.js` files into `src/`.
For focused type feedback on one file, use editor diagnostics instead of a file-scoped `tsc` command.
## Production Builds
Production builds support foreground and managed background execution:
```bash
pnpm build # Full foreground build
pnpm build --background # Full managed background build
pnpm build --modern # Modern frontend_latest bundle only
pnpm build --modern --background # Modern managed background build
pnpm build --status
pnpm build --logs [--follow]
pnpm build --stop
```
Use `pnpm build --modern --background` for production bundle-size or browser performance comparisons that only need modern browser output. It runs the normal metadata and static preparation, minifies and compresses the modern `frontend_latest` bundle and shared static assets, and generates modern-only entry pages and service workers. It deliberately skips the legacy bundle and its service worker.
Do not pass `--help`, `--background`, or `--modern` to `script/build_frontend`; that raw script does not parse arguments and always starts the full foreground build. Use `pnpm build` for managed builds. App builds and development servers keep exclusive ownership of `hass_frontend/` for their lifetime.
Managed app, demo, gallery, and E2E app workflows share one lifetime lock, so only one build or development server can run at a time.
## When To Add Tests
- Write tests for code that computes something: data processing, utilities, config validation, and strategies.
- Do not write rendering tests. This includes views, panels, and components whose text, styles, slots, or option defaults are checked, or that only put context and helper data into a template.
- Do not try to cover every scenario, especially for behaviour that changes often.
- If you are not sure a test is useful, describe it and what it would catch, and let the user decide.
- Tests never talk to a real Home Assistant. Replace `callWS`, `callApi`, and the connection with fakes.
## Dev Servers
`pnpm dev` builds and watches the app, served by a running Home Assistant core configured through `development_repo`.
`pnpm dev:serve` also serves locally and supports `-c` for the core URL and `-p` for the port. The default is 8124, or 8123 in a devcontainer.
Dev server commands support `--background`, `--status`, `--stop`, and `--logs [--follow]`. `pnpm dev`, `pnpm dev:serve`, `pnpm dev:demo`, and `pnpm dev:gallery` also support `--fetch-translations`; this runs translation fetching, including first-time GitHub device authentication, under the workflow lock before starting the watcher. It works in foreground and background modes. Prefer managed background mode while iterating so the watcher stays available across test runs without occupying the terminal. `pnpm dev` and `pnpm dev:serve` share one managed process slot because both write the app output.
## Playwright E2E
Each suite has its own dev server port. Playwright reuses an existing server locally when its configured URL responds; otherwise it performs a slow full build. When a development watcher is being reused, rspack recompiles on save and reruns should not need a restart.
Start the relevant suite server, then run that suite:
| Suite | Background server | Test command |
| ------- | -------------------------------------------- | ----------------------- |
| App | `pnpm test:e2e:app:dev --background` on 8095 | `pnpm test:e2e:app` |
| Demo | `pnpm dev:demo --background` on 8090 | `pnpm test:e2e:demo` |
| Gallery | `pnpm dev:gallery --background` on 8100 | `pnpm test:e2e:gallery` |
The custom development wrappers use `/__ha_dev_status` to identify and manage their own suites. Playwright server reuse checks the configured URL instead. Wrapper start and stop operations are idempotent for a matching suite and reject an unrelated process occupying the port.
Local runs against a watched development server do not always match CI's clean build artifacts, environment, sharding, or worker configuration. Use background servers for the fast iteration loop, but confirm the relevant CI jobs complete successfully before considering E2E changes verified.
Use `-g "<title>" --project=chromium` to narrow a run. `pnpm test:e2e` runs suites sequentially when managed servers are unavailable to prevent cold builds racing over shared generated assets. Run suites directly; piping through output truncation hides progress and failures.
The app suite uses a stripped-down harness for e2e. Demo and gallery use their normal dev servers.
## Benchmarks
For chart data transforms such as history, statistics, energy, and downsampling, read and follow the complete workflow in `test/benchmarks/README.md` before making benchmark or optimization changes.
That workflow owns the baseline, noise analysis, guardrails, acceptance thresholds, and reporting requirements. In particular, optimizations must keep output bit-identical; never update snapshots or modify fixtures to make an optimization pass.
## Verification Selection
- Documentation-only change: no code test required unless examples or commands changed.
- Type-only or utility change: run focused Vitest if available, then `pnpm lint:types` if practical.
- Lit component change: run relevant tests plus lint or typecheck depending on scope.
- E2E-sensitive flow: start the relevant e2e dev server and run the narrow Playwright suite.
- Broad refactor: run `pnpm lint` and relevant test suites when practical.
-44
View File
@@ -1,44 +0,0 @@
---
name: ha-frontend-types
description: Home Assistant frontend TypeScript conventions. Use when defining or reviewing backend data contracts, optional schemas, shared types, assertions, or Lit lifecycle types.
---
# HA Frontend Types
Use this skill for Home Assistant-specific TypeScript contracts and type choices.
## Home Assistant Data Contracts
Verify data contracts against the source that owns them, such as Home Assistant Core, Supervisor, a WebSocket handler, or an exported component type. Do not shape a type around assumptions made by its current frontend consumers.
- Match required, optional, nullable, and defaulted fields to the producer and runtime contract. Preserve optional configuration fields when omission is supported and has defined behavior.
- Use distinct request and response types when their wire shapes differ.
- When changing a shared contract, check affected consumers, tests, fixtures, and mocks.
## Reuse Home Assistant Contracts
- Reuse the canonical Home Assistant type when one exists. Define shared contract types in the data or API module that owns them.
- Reuse types exported by components and helpers rather than reconstructing their payloads. For event types, follow `ha-frontend-events`.
- When one domain contract is used across modules, define and export it from the module that owns that contract.
Prefer an existing owning contract. Introduce a frontend-specific type when the frontend shape or boundary genuinely differs.
## Assertions
Prefer accurate types and runtime narrowing. Use assertions or TypeScript suppressions at boundaries where the runtime invariant is understood but cannot be expressed cleanly; keep them narrow and explain non-obvious invariants.
## Lit Lifecycle Types
For Lit lifecycle methods that receive changed properties, use `PropertyValues<this>` when the method only needs public reactive properties:
```ts
protected willUpdate(changedProperties: PropertyValues<this>) {
// ...
}
```
Use unparameterized `PropertyValues` when the method inspects private or protected reactive properties, which are not keys of `this`. Do not add assertions solely to retain `PropertyValues<this>`.
## Enforced Baseline
Use `import type` for type-only imports. This is enforced by the repository ESLint configuration.
@@ -1,98 +0,0 @@
---
name: ha-frontend-user-facing-text
description: Home Assistant frontend copy, localization, terminology, and user-facing text guidance. Use when adding or reviewing labels, buttons, dialogs, errors, translations, or UI strings.
---
# HA Frontend User-Facing Text
Use this skill for all user-facing text, translations, labels, buttons, dialog copy, errors, helper text, and review comments about wording.
## Localization
- All user-facing text must be translatable.
- Add translation keys to `src/translations/en.json` when introducing new strings.
- Use the localization system instead of inline user-visible strings.
- Prefer complete localized strings with placeholders over concatenating translated fragments.
- Give translators enough context through key naming and placeholders.
```ts
this._localize("ui.panel.config.updates.updates_refreshed", {
count: 5,
});
```
## Voice And Style
- Use American English.
- Use a friendly, informational tone.
- Address users directly with "you" and "your" when appropriate.
- Be inclusive, objective, and non-discriminatory.
- Be concise and clear.
- Use active voice.
- Avoid jargon where a familiar home automation term works.
- Always write "Home Assistant" in full. Do not use "HA" or "HASS" in user-facing copy.
- Spell out terms when possible.
- Use sentence case for titles, headings, buttons, labels, and UI elements.
- Use the Oxford comma in lists.
- Prefer "like" over "e.g." and "for example" over "i.e.".
- Avoid all caps for emphasis. Use wording, bold, or italics instead.
- Write for both technical and non-technical users.
Sentence case examples:
- Use: "Create new automation"
- Avoid: "Create New Automation"
- Use: "Device settings"
- Avoid: "Device Settings"
## Terminology
Use "integration" instead of "component" for user-facing product language unless referring to a frontend component in developer context.
Technical product terms are lowercase in prose: automation, entity, device, service.
## Delete, Remove, Create, Add
Use "Remove" for actions that can be restored or reapplied:
- Removing a user's permission.
- Removing a user from a group.
- Removing links between items.
- Removing a widget from a dashboard.
- Removing an item from a cart.
Use "Delete" for permanent, non-recoverable actions:
- Deleting a field.
- Deleting a value in a field.
- Deleting a task.
- Deleting a group.
- Deleting a permission.
- Deleting a calendar event.
Use "Add" for already-existing items:
- Adding a permission to a user.
- Adding a user to a group.
- Adding links between items.
- Adding a widget to a dashboard.
- Adding an item to a cart.
Use "Create" for something made from scratch:
- Creating a new field.
- Creating a new task.
- Creating a new group.
- Creating a new permission.
- Creating a new calendar event.
Create pairs with Delete. Add pairs with Remove.
## Review Checklist
- Text is localized.
- Copy uses sentence case.
- "Home Assistant" is written in full.
- Delete/Remove and Create/Add match recoverability and object lifecycle.
- Placeholders are used instead of string concatenation.
- The wording is concise and understandable without implementation knowledge.
@@ -1,44 +0,0 @@
---
name: ha-frontend-ux-readiness
description: Home Assistant frontend UI/UX readiness routing for new cards, badges, screens, and interaction patterns. Use it with `ha-frontend-review` to decide whether frontend review is enough or further UI/UX input is needed. Skip it for PRs already carrying Needs UX and for fixes or technical details that preserve an established experience.
---
# HA Frontend UI/UX Readiness
Use the design context and evidence gathered through `ha-frontend-review` to decide whether a change's UI/UX direction is settled and whether further UI/UX review should be recommended or is explicitly required. This skill routes the result; it does not repeat or replace implementation, accessibility, or frontend quality review.
## Early Exit
If the PR already carries the **Needs UX** label, reviewers have already decided to ask designers or UX reviewers for guidance. Do not use this skill to make that recommendation again.
## Triage
1. Apply `ha-frontend-review` and record its UI/UX evidence.
- Include the applicable gallery specification, production or approved designs, shared `ha-*` components, task requirements, historical feedback, and direct instructions.
- Keep the implementation review separate from this readiness decision.
2. Classify the user-facing decision.
- Existing-feature fixes and technical details normally remain with frontend review when they preserve the established experience.
- New cards, badges, screens, and interaction patterns normally need this readiness check.
3. Decide whether the evidence gathered during frontend review settles the direction.
- Frontend maintainer guidance, explicit UI/UX approval, current guidance, an established pattern, or a task that settles the material visual and interaction choices can settle the direction.
- Insufficient or conflicting evidence leaves the direction unresolved.
4. Select exactly one route below and state which frontend-review evidence supports it.
## Routes
- **Frontend review sufficient:** The change preserves the established experience, or the evidence settles the material visual and interaction choices. Cite that evidence and continue with `ha-frontend-review`.
- **UI/UX review recommended:** A new user experience has material design choices that remain unresolved. Identify the decision that needs input and recommend UI/UX review.
- **UI/UX review required:** A workflow rule or direct human instruction explicitly requires UI/UX review. Cite that evidence. A new design, task link, or lack of evidence is not enough on its own.
Frontend maintainer guidance, explicit UI/UX approval, established patterns, and task requirements inform the route. A task can settle requirements without settling the UI/UX. Recommend UI/UX review when important design choices remain unresolved.
## Reporting
Keep the result concise and use this structure:
- **Route:** Frontend review sufficient, UI/UX review recommended, or UI/UX review required
- **Established patterns:** relevant gallery specifications, production designs, and shared `ha-*` components for the next reviewer to compare
- **Supporting evidence:** approval, guidance, established patterns, task requirements, direct instructions, or the evidence gap or conflict
- **Next action:** the review action implied by the route
Separate whether the UI/UX direction is settled from whether the implementation is correct.
+24 -40
View File
@@ -1,52 +1,36 @@
[modern]
# Modern builds target recent browsers supporting the latest features to minimize transpilation, polyfills, etc.
# It is served to browsers meeting the following requirements:
# - released in the last 2 years + current alpha/beta versions
# - released in the last year + current alpha/beta versions
# - Firefox extended support release (ESR)
# - with global utilization at or above 0.5%
# - exclude dead browsers (no security maintenance for 2+ years)
# - exclude QQ, and UC browsers due to lack of sufficient feature support data
# - exclude KaiOS, QQ, and UC browsers due to lack of sufficient feature support data
unreleased versions
last 2 years
last 1 year
Firefox ESR
>= 0.5%
not dead
not KaiOS > 0
not QQAndroid > 0
not UCAndroid > 0
[legacy]
# Legacy builds are served when modern requirements are not met.
# Floors are pinned explicitly (not usage-based) so the support policy is
# deliberate and does not drift with global usage statistics, which do not
# represent old tablets and wall displays used as Home Assistant dashboards:
# - iOS/Safari >= 12: iPad Air 1 / mini 2 / mini 3 (last supported iOS).
# Older iPads (iPad 2/3/mini 1 on iOS 9.3, iPad 4 on iOS 10.3) cannot run
# the app: their engines lack custom elements, shadow DOM, and/or CSS grid.
# - Chrome >= 59: Fire OS 5 tablets (Fire 7/HD 8/HD 10 through ~2017) have
# their system WebView pinned at Chromium 59 and commonly run Fully Kiosk;
# also covers old kiosk browsers and no-longer-updating webviews above it.
# - Edge >= 79: all Chromium-based Edge. Costs nothing (above the Chrome
# floor); mainly catches Edge 109 on Windows 7/8.1 and update-frozen
# enterprise installs, whose engines can run the legacy build fine.
# - Firefox >= 94: the zero-cost floor, not a chased population — pinning it
# adds no babel transforms, core-js modules, or Lightning CSS prefixes to
# the output. Mozilla-supported Firefox (incl. current ESR) always matches
# [modern]; Firefox on old OSes is not supported (use Chrome 109 instead).
# If Firefox ever becomes the pin forcing extra output, raise it first.
# - Samsung >= 9: Samsung Internet on old Galaxy tablets
Chrome >= 59
ChromeAndroid >= 59
Edge >= 79
Firefox >= 94
FirefoxAndroid >= 94
iOS >= 12
Safari >= 12
Samsung >= 9
# Legacy builds are served when modern requirements are not met and support browsers:
# - released in the last 7 years + current alpha/beta versionss
# - with global utilization at or above 0.05%
# - exclude dead browsers (no security maintenance for 2+ years)
# - exclude Opera Mini which does not support web sockets
unreleased versions
last 7 years
>= 0.05%
not dead
not op_mini all
[legacy-sw]
# Same as legacy, restricted to browsers that support service workers
# (currently resolves to the same set; guards the service worker build if the legacy floor ever drops below them)
Chrome >= 59 and supports serviceworkers
ChromeAndroid >= 59 and supports serviceworkers
Edge >= 79 and supports serviceworkers
Firefox >= 94 and supports serviceworkers
FirefoxAndroid >= 94 and supports serviceworkers
iOS >= 12 and supports serviceworkers
Safari >= 12 and supports serviceworkers
Samsung >= 9 and supports serviceworkers
# Same as legacy plus supports service workers
unreleased versions
last 7 years
>= 0.05% and supports serviceworkers
not dead
not op_mini all
-1
View File
@@ -1 +0,0 @@
../.agents/skills
+1 -1
View File
@@ -67,7 +67,7 @@ DO NOT DELETE ANY TEXT from this template! Otherwise, your issue may be closed w
<!--
If your issue is about how an entity is shown in the UI, please add the state
and attributes for all situations with a screenshot of the UI.
You can find this information at `/config/tools/state`
You can find this information at `/config/developer-tools/state`
-->
```yaml
+2 -17
View File
@@ -7,17 +7,13 @@ body:
value: |
Make sure you are running the [latest version of Home Assistant][releases] before reporting an issue.
Please read our [issue reporting guide][reporting-issues] before submitting a report.
If you have a feature or enhancement request for the frontend, please [start a discussion][fr] instead of creating an issue.
**Please do not report issues for custom cards.**
[fr]: https://github.com/orgs/home-assistant/discussions
[releases]: https://github.com/home-assistant/home-assistant/releases
[reporting-issues]: https://www.home-assistant.io/help/reporting_issues/
- type: checkboxes
id: checklist
attributes:
label: Checklist
description: Please verify that you've followed these steps
@@ -34,21 +30,18 @@ body:
value: |
## The problem
- type: textarea
id: problem
validations:
required: true
attributes:
label: Describe the issue you are experiencing
description: Provide a clear and concise description of what the bug is.
- type: textarea
id: expected_behavior
validations:
required: true
attributes:
label: Describe the behavior you expected
description: Describe what you expected to happen or it should look/behave.
- type: textarea
id: steps_to_reproduce
validations:
required: true
attributes:
@@ -66,7 +59,6 @@ body:
value: |
## Environment
- type: input
id: core_version
validations:
required: true
attributes:
@@ -75,21 +67,18 @@ body:
description: >
Can be found in: [Settings -> About](https://my.home-assistant.io/redirect/info/).
- type: input
id: last_working_version
attributes:
label: What was the last working version of Home Assistant Core?
placeholder: core-
description: >
If known, otherwise leave blank.
- type: input
id: browser
attributes:
label: In which browser are you experiencing the issue?
placeholder: Google Chrome 88.0.4324.150
description: >
Provide the full name and don't forget to add the version!
- type: input
id: os
attributes:
label: Which operating system are you using to run this browser?
placeholder: macOS Big Sur (1.11)
@@ -101,16 +90,14 @@ body:
# Details
- type: textarea
id: entity_state
attributes:
label: State of relevant entities
description: >
If your issue is about how an entity is shown in the UI, please add the
state and attributes for all situations. You can find this
information in the Details view of the More info dialog.
state and attributes for all situations. You can find this information
at Developer Tools -> States.
render: txt
- type: textarea
id: configuration
attributes:
label: Problem-relevant frontend configuration
description: >
@@ -120,7 +107,6 @@ body:
passwords, private URLs and other credentials.
render: yaml
- type: textarea
id: javascript_errors
attributes:
label: JavaScript errors shown in your browser console/inspector
description: >
@@ -128,7 +114,6 @@ body:
browser console/inspector please provide them.
render: txt
- type: textarea
id: additional_information
attributes:
label: Additional information
description: >
-27
View File
@@ -1,27 +0,0 @@
name: Build frontend target
description: Run a gulp build target
inputs:
target:
description: gulp target to run
required: true
github-token:
description: GitHub token for fetching nightly translations; omit to build English-only
default: ""
is-test:
description: Set IS_TEST for the build (skips source maps and compression)
default: "false"
rspack-cache:
description: rspack persistent cache mode ("readwrite", "readonly", or "" to disable)
default: ""
runs:
using: composite
steps:
- name: Build ${{ inputs.target }}
shell: bash
run: ./node_modules/.bin/gulp ${{ inputs.target }}
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
IS_TEST: ${{ inputs.is-test }}
RSPACK_CACHE: ${{ inputs.rspack-cache }}
-52
View File
@@ -1,52 +0,0 @@
name: Deploy to Netlify
description: Deploy a directory to Netlify (production when alias is empty, otherwise to the alias)
inputs:
dir:
description: Directory to deploy
required: true
alias:
description: Deploy alias; leave empty to deploy to production
default: ""
auth-token:
description: NETLIFY_AUTH_TOKEN
required: true
site-id:
description: NETLIFY_SITE_ID
required: true
outputs:
netlify_url:
description: The deployed URL
value: ${{ steps.deploy.outputs.netlify_url }}
unique_deploy_url:
description: The unique hash-based deployment URL for this specific build
value: ${{ steps.deploy.outputs.unique_deploy_url }}
runs:
using: composite
steps:
- name: Deploy to Netlify
id: deploy
shell: bash
env:
DIR: ${{ inputs.dir }}
ALIAS: ${{ inputs.alias }}
NETLIFY_AUTH_TOKEN: ${{ inputs.auth-token }}
NETLIFY_SITE_ID: ${{ inputs.site-id }}
run: |
# Execute the deployment
if [ -n "$ALIAS" ]; then
npx -y netlify-cli deploy --dir="$DIR" --alias "$ALIAS" --json > deploy_output.json
else
npx -y netlify-cli deploy --dir="$DIR" --prod --json > deploy_output.json
fi
# Collect the urls from the deployment output
NETLIFY_URL=$(jq -r '.url // .deploy_url' deploy_output.json)
SITE_NAME=$(jq -r '.site_name' deploy_output.json)
DEPLOY_ID=$(jq -r '.deploy_id' deploy_output.json)
UNIQUE_URL="https://${DEPLOY_ID}--${SITE_NAME}.netlify.app"
echo "netlify_url=$NETLIFY_URL" >> "$GITHUB_OUTPUT"
echo "unique_deploy_url=$UNIQUE_URL" >> "$GITHUB_OUTPUT"
@@ -1,41 +0,0 @@
name: Prepare dependencies
description: Install and cache the complete dependency tree
inputs:
node-modules-cache-key:
description: Prefix for the shared node_modules cache key
default: node-modules-v1
runs:
using: composite
steps:
- name: Check for complete dependency tree
id: dependencies
continue-on-error: true
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
node_modules
~/.local/share/pnpm/store
key: >-
${{ inputs.node-modules-cache-key }}-${{ runner.os }}-${{ runner.arch }}-${{
hashFiles('.nvmrc', 'package.json', 'pnpm-lock.yaml', 'pnpm-workspace.yaml', 'patches/**') }}
lookup-only: true
- name: Setup Node and install
if: steps.dependencies.outputs.cache-hit != 'true'
uses: ./.github/actions/setup
with:
cache: false
- name: Save complete dependency tree
if: steps.dependencies.outputs.cache-hit != 'true'
continue-on-error: true
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
node_modules
~/.local/share/pnpm/store
key: >-
${{ inputs.node-modules-cache-key }}-${{ runner.os }}-${{ runner.arch }}-${{
hashFiles('.nvmrc', 'package.json', 'pnpm-lock.yaml', 'pnpm-workspace.yaml', 'patches/**') }}
-62
View File
@@ -1,62 +0,0 @@
name: Setup Node and install
description: Set up Node from .nvmrc and install pnpm dependencies
inputs:
immutable:
description: Pass --frozen-lockfile to pnpm install
default: "true"
cache:
description: Cache the pnpm store
default: "true"
node-modules-cache:
description: Restore the exact shared node_modules cache before installing
default: "false"
node-modules-cache-key:
description: Prefix for the shared node_modules cache key
default: node-modules-v1
runs:
using: composite
steps:
# The pnpm store is cached with node_modules because `pnpm licenses`
# (used by the license file generation) reads package metadata from it.
- name: Restore complete dependency tree
id: dependency-cache
if: inputs.node-modules-cache == 'true'
continue-on-error: true
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
node_modules
~/.local/share/pnpm/store
key: >-
${{ inputs.node-modules-cache-key }}-${{ runner.os }}-${{ runner.arch }}-${{
hashFiles('.nvmrc', 'package.json', 'pnpm-lock.yaml', 'pnpm-workspace.yaml', 'patches/**') }}
- name: Setup Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: ".nvmrc"
- name: Enable Corepack
shell: bash
run: corepack enable
- name: Get pnpm store directory
id: pnpm-store
if: inputs.cache == 'true' && (inputs.node-modules-cache != 'true' || steps.dependency-cache.outputs.cache-hit != 'true')
shell: bash
run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
- name: Cache pnpm store
if: steps.pnpm-store.outputs.path
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: pnpm-store-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: pnpm-store-${{ runner.os }}-${{ runner.arch }}-
- name: Install dependencies
if: inputs.node-modules-cache != 'true' || steps.dependency-cache.outputs.cache-hit != 'true'
shell: bash
run: pnpm install ${{ inputs.immutable == 'true' && '--frozen-lockfile' || '--no-frozen-lockfile' }}
-1
View File
@@ -1 +0,0 @@
../AGENTS.md
+657
View File
@@ -0,0 +1,657 @@
# GitHub Copilot & Claude Code Instructions
You are an assistant helping with development of the Home Assistant frontend. The frontend is built using Lit-based Web Components and TypeScript, providing a responsive and performant interface for home automation control.
**Note**: This file contains high-level guidelines and references to implementation patterns. For detailed component documentation, API references, and usage examples, refer to the `gallery/` directory.
## Table of Contents
- [Quick Reference](#quick-reference)
- [Core Architecture](#core-architecture)
- [State Access: Contexts Instead of `hass`](#state-access-contexts-instead-of-hass)
- [Development Standards](#development-standards)
- [Component Library](#component-library)
- [Common Patterns](#common-patterns)
- [Text and Copy Guidelines](#text-and-copy-guidelines)
- [Development Workflow](#development-workflow)
- [Review Guidelines](#review-guidelines)
## Quick Reference
### Essential Commands
```bash
yarn lint # ESLint + Prettier + TypeScript + Lit
yarn format # Auto-fix ESLint + Prettier
yarn lint:types # TypeScript compiler (run WITHOUT file arguments)
yarn test # Vitest
script/develop # Development server
```
> **WARNING:** Never run `tsc` or `yarn lint:types` with file arguments (e.g., `yarn lint:types src/file.ts`). When `tsc` receives file arguments, it ignores `tsconfig.json` and emits `.js` files into `src/`, polluting the codebase. Always run `yarn lint:types` without arguments. For individual file type checking, rely on IDE diagnostics. If `.js` files are accidentally generated, clean up with `git clean -fd src/`.
### Component Prefixes
- `ha-` - Home Assistant components
- `hui-` - Lovelace UI components
- `dialog-` - Dialog components
### Import Patterns
```typescript
import type { HomeAssistant } from "../types";
import { fireEvent } from "../common/dom/fire_event";
import { showAlertDialog } from "../dialogs/generic/show-dialog-box";
```
## Core Architecture
The Home Assistant frontend is a modern web application that:
- Uses Web Components (custom elements) built with Lit framework
- Is written entirely in TypeScript with strict type checking
- Communicates with the backend via WebSocket API
- Provides comprehensive theming and internationalization
## State Access: Contexts Instead of `hass`
Every component used to take the whole `hass: HomeAssistant` object — a god-object that re-renders on any unrelated `hass` change, forces tests to mock everything, and hides what a component actually reads. We're moving leaf components to **fine-grained [Lit context](https://lit.dev/docs/data/context/)**: consume only the slice you need and re-render only when it changes.
For new code, consume the matching context instead of adding a `hass` property. `hass` stays for container components that own it and feed the providers; the canonical migration is [`hui-button-card.ts`](src/panels/lovelace/cards/hui-button-card.ts). Infrastructure: contexts in [`src/data/context/index.ts`](src/data/context/index.ts), the `consume…` helpers in [`src/common/decorators/consume-context-entry.ts`](src/common/decorators/consume-context-entry.ts), and `@transform` in [`src/common/decorators/transform.ts`](src/common/decorators/transform.ts). Providers are wired automatically by `contextMixin` on `HassBaseEl` — you only consume.
### Contexts
Consume the narrowest context that covers your reads:
| Context | Replaces |
| ----------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| `statesContext` | `hass.states` |
| `entitiesContext` / `devicesContext` / `areasContext` / `floorsContext` | `hass.entities` / `.devices` / `.areas` / `.floors` (or `registriesContext` for all four) |
| `servicesContext` | `hass.services` |
| `internationalizationContext` | `hass.localize`, `hass.locale`, `hass.language` |
| `formattersContext` | `hass.formatEntityName`, `hass.formatEntityState`, `hass.formatEntityAttributeName`, … |
| `configContext` | `hass.config`, `hass.user`, `hass.auth`, `hass.userData` |
| `connectionContext` | `hass.connection`, `hass.connected`, `hass.hassUrl` |
| `apiContext` | `hass.callService`, `hass.callApi`, `hass.callWS`, `hass.sendWS`, `hass.fetchWithAuth` |
| `uiContext` | `hass.themes`, `hass.selectedTheme`, `hass.panels`, `hass.dockedSidebar`, … |
| `narrowViewportContext` | narrow-layout boolean |
Lazy contexts (subscribe on first consumer, tear down after the last): `labelsContext`, `fullEntitiesContext`, `configEntriesContext`, `manifestsContext`. The single-field contexts (`localizeContext`, `themesContext`, `userContext`, …) are **deprecated** — use the grouped ones above.
### Consuming
Use the `consume…` helpers for entity-scoped and `localize` reads. `entityIdPath` is resolved against `this`, so these watch `this._config.entity`:
```ts
@state() @consumeEntityState({ entityIdPath: ["_config", "entity"] })
private _stateObj?: HassEntity; // consumeEntityStates(...) for a record of several
@state() @consumeEntityRegistryEntry({ entityIdPath: ["_config", "entity"] })
private _entity?: EntityRegistryDisplayEntry;
@state() @consumeLocalize()
private _localize!: LocalizeFunc;
```
For any other single field, pair `@consume` with `@transform`:
```ts
@state()
@consume({ context: uiContext, subscribe: true })
@transform<HomeAssistantUI, Themes>({ transformer: ({ themes }) => themes })
private _themes!: Themes;
```
`@transform`'s `watch` option re-runs the transformer when a host prop changes — needed when an entity id is computed, since `consumeEntityState` only watches the first path segment. To consume a whole group untransformed, drop `@transform` and type it `ContextType<typeof statesContext>`.
## Development Standards
### Code Quality Requirements
**Linting and Formatting (Enforced by Tools)**
- ESLint config (flat config) extends TypeScript strict, Lit, Web Components, Accessibility (lit-a11y), and import-x
- Prettier with ES5 trailing commas enforced
- No console statements (`no-console: "error"`) - use proper logging
- Import organization: No unused imports, consistent type imports
**Naming Conventions**
- PascalCase for types and classes
- camelCase for variables, methods
- Private methods require leading underscore
- Public methods forbid leading underscore
### TypeScript Usage
- **Always use strict TypeScript**: Enable all strict flags, avoid `any` types
- **Proper type imports**: Use `import type` for type-only imports
- **Define interfaces**: Create proper interfaces for data structures
- **Type component properties**: All Lit properties must be properly typed
- **No unused variables**: Prefix with `_` if intentionally unused
- **Consistent imports**: Use `@typescript-eslint/consistent-type-imports`
```typescript
// Good
import type { HomeAssistant } from "../types";
interface EntityConfig {
entity: string;
name?: string;
}
@property({ type: Object })
hass!: HomeAssistant;
// Bad
@property()
hass: any;
```
### Web Components with Lit
- **Use Lit 3.x patterns**: Follow modern Lit practices
- **Extend appropriate base classes**: Use `LitElement`, `SubscribeMixin`, or other mixins as needed
- **Define custom element names**: Use `ha-` prefix for components
```typescript
@customElement("ha-my-component")
export class HaMyComponent extends LitElement {
@property({ attribute: false })
hass!: HomeAssistant;
@state()
private _config?: MyComponentConfig;
static get styles() {
return css`
:host {
display: block;
}
`;
}
render() {
return html`<div>Content</div>`;
}
}
```
### Component Guidelines
- **Use composition**: Prefer composition over inheritance
- **Lazy load panels**: Heavy panels should be dynamically imported
- **Optimize renders**: Use `@state()` for internal state, `@property()` for public API
- **Handle loading states**: Always show appropriate loading indicators
- **Support themes**: Use CSS custom properties from theme
### Data Management
- **Use WebSocket API**: All backend communication via home-assistant-js-websocket
- **Prefer contexts over `hass`**: For state reads, consume the relevant Lit context instead of taking the whole `hass` object — see [State Access: Contexts Instead of `hass`](#state-access-contexts-instead-of-hass)
- **Cache appropriately**: Use collections and caching for frequently accessed data
- **Handle errors gracefully**: All API calls should have error handling
- **Update real-time**: Subscribe to state changes for live updates
```typescript
// Good
try {
const result = await fetchEntityRegistry(this.hass.connection);
this._processResult(result);
} catch (err) {
showAlertDialog(this, {
text: `Failed to load: ${err.message}`,
});
}
```
### Styling Guidelines
- **Use CSS custom properties**: Leverage the theme system
- **Use spacing tokens**: Prefer `--ha-space-*` tokens over hardcoded values for consistent spacing
- Spacing scale: `--ha-space-1` (4px) through `--ha-space-20` (80px) in 4px increments
- Defined in `src/resources/theme/core.globals.ts`
- Common values: `--ha-space-2` (8px), `--ha-space-4` (16px), `--ha-space-8` (32px)
- **Mobile-first responsive**: Design for mobile, enhance for desktop
- **Prefer `ha-*` components**: Build on the Home Assistant component library (many now wrap Web Awesome components); avoid new use of legacy Material Web Components (`mwc-*`), which are being phased out
- **Support RTL**: Ensure all layouts work in RTL languages
```typescript
static get styles() {
return css`
:host {
padding: var(--ha-space-4);
color: var(--primary-text-color);
background-color: var(--card-background-color);
}
.content {
gap: var(--ha-space-2);
}
@media (max-width: 600px) {
:host {
padding: var(--ha-space-2);
}
}
`;
}
```
### View Transitions
The View Transitions API creates smooth animations between DOM state changes. When implementing view transitions:
**Core Resources:**
- **Utility wrapper**: `src/common/util/view-transition.ts` - `withViewTransition()` function with graceful fallback
- **Real-world example**: `src/util/launch-screen.ts` - Launch screen fade pattern with browser support detection
- **Animation keyframes**: `src/resources/theme/animations.globals.ts` - Global `fade-in`, `fade-out`, `scale` animations
- **Animation duration**: `src/resources/theme/core.globals.ts` - `--ha-animation-duration-fast` (150ms), `--ha-animation-duration-normal` (250ms), `--ha-animation-duration-slow` (350ms) (all respect `prefers-reduced-motion`)
**Implementation Guidelines:**
1. Always use `withViewTransition()` wrapper for automatic fallback
2. Keep transitions simple (subtle crossfades and fades work best)
3. Use `--ha-animation-duration-*` CSS variables for consistent timing (`fast`, `normal`, `slow`)
4. Assign unique `view-transition-name` to elements (must be unique at any given time)
5. For Lit components: Override `performUpdate()` or use `::part()` for internal elements
**Default Root Transition:**
By default, `:root` receives `view-transition-name: root`, creating a full-page crossfade. Target with [`::view-transition-group(root)`](https://developer.mozilla.org/en-US/docs/Web/CSS/::view-transition-group) to customize the default page transition.
**Important Constraints:**
- Each `view-transition-name` must be unique at any given time
- Only one view transition can run at a time
- **Shadow DOM incompatibility**: View transitions operate at document level and do not work within Shadow DOM due to style isolation ([spec discussion](https://github.com/w3c/csswg-drafts/issues/10303)). For web components, set `view-transition-name` on the `:host` element or use document-level transitions
**Specification & Documentation:**
For browser support, API details, and current specifications, refer to these authoritative sources (note: check publication dates as specs evolve):
- [MDN: View Transition API](https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API) - Comprehensive API reference
- [Chrome for Developers: View Transitions](https://developer.chrome.com/docs/web-platform/view-transitions) - Implementation guide and examples
- [W3C Draft Specification](https://drafts.csswg.org/css-view-transitions/) - Official specification (evolving)
### Performance Best Practices
- **Code split**: Split code at the panel/dialog level
- **Lazy load**: Use dynamic imports for heavy components
- **Optimize bundle**: Keep initial bundle size minimal
- **Use virtual scrolling**: For long lists, implement virtual scrolling
- **Memoize computations**: Cache expensive calculations
### Testing Requirements
- **Write tests**: Add tests for data processing and utilities
- **Test with Vitest**: Use the established test framework
- **Mock appropriately**: Mock WebSocket connections and API calls
- **Test accessibility**: Ensure components are accessible
## Component Library
### Dialog Component
**Opening Dialogs (Fire Event Pattern - Recommended):**
```typescript
fireEvent(this, "show-dialog", {
dialogTag: "dialog-example",
dialogImport: () => import("./dialog-example"),
dialogParams: { title: "Example", data: someData },
});
```
**Dialog Implementation Requirements:**
- Use `ha-dialog` component
- Implement `HassDialog<T>` interface
- Use `@state() private _open = false` to control dialog visibility
- Set `_open = true` in `showDialog()`, `_open = false` in `closeDialog()`
- Return `nothing` when no params (loading state)
- Fire `dialog-closed` event in `_dialogClosed()` handler
- Use `header-title` attribute for simple titles
- Use `header-subtitle` attribute for simple subtitles
- Use slots for custom content where the standard attributes are not enough
- Use `ha-dialog-footer` with `primaryAction`/`secondaryAction` slots for footer content
- Add `autofocus` to first focusable element (e.g., `<ha-form autofocus>`). The component may need to forward this attribute internally.
**Dialog Sizing:**
- Use `width` attribute with predefined sizes: `"small"` (320px), `"medium"` (580px - default), `"large"` (1024px), or `"full"`
- Custom sizing is NOT recommended - use the standard width presets
**Button Appearance Guidelines:**
`ha-button` (wraps the Web Awesome button — see `src/components/ha-button.ts`) has two independent axes plus size:
- **`variant`** (color): `"brand"` (default), `"neutral"`, `"danger"`, `"warning"`, `"success"`
- **`appearance`** (fill style): `"accent"`, `"filled"`, `"outlined"`, `"plain"`
- **`size`**: `"xs"` (extra small, 40px), `"s"` (small, 32px), `"m"` (medium, 40px - default), `"l"` (large, 48px), `"xl"` (extra large, 40px)
Common patterns:
- **Primary action**: `appearance="filled"` for emphasis (or the default appearance for a lighter look)
- **Secondary action**: `appearance="plain"` for cancel/dismiss actions
- **Destructive actions**: `variant="danger"` for delete/remove operations (the generic confirmation dialog uses `variant="danger"` for its confirm button — see `src/dialogs/generic/dialog-box.ts`)
- Always place primary action in `slot="primaryAction"` and secondary in `slot="secondaryAction"` within `ha-dialog-footer`
**Gallery Documentation:**
- `gallery/src/pages/components/ha-dialog.markdown`
- `gallery/src/pages/components/ha-dialogs.markdown`
### Form Component (ha-form)
- Schema-driven using `HaFormSchema[]`
- Supports entity, device, area, target, number, boolean, time, action, text, object, select, icon, media, location selectors
- Built-in validation with error display
- Use `computeLabel`, `computeError`, `computeHelper` for translations
```typescript
<ha-form
.hass=${this.hass}
.data=${this._data}
.schema=${this._schema}
.error=${this._errors}
.computeLabel=${(schema) => this.hass.localize(`ui.panel.${schema.name}`)}
@value-changed=${this._valueChanged}
></ha-form>
```
**Gallery Documentation:**
- `gallery/src/pages/components/ha-form.markdown`
### Alert Component (ha-alert)
- Types: `error`, `warning`, `info`, `success`
- Properties: `title`, `alert-type`, `dismissable`, `narrow`
- Slots: `icon` (override the leading icon), `action` (custom action content)
- Content announced by screen readers when dynamically displayed
```html
<ha-alert alert-type="error">Error message</ha-alert>
<ha-alert alert-type="warning" title="Warning">Description</ha-alert>
<ha-alert alert-type="success" dismissable>Success message</ha-alert>
```
**Gallery Documentation:**
- `gallery/src/pages/components/ha-alert.markdown`
### Keyboard Shortcuts (ShortcutManager)
The `ShortcutManager` class provides a unified way to register keyboard shortcuts with automatic input field protection.
**Key Features:**
- Automatically blocks shortcuts when input fields are focused
- Prevents shortcuts during text selection (configurable via `allowWhenTextSelected`)
- Supports both character-based and KeyCode-based shortcuts (for non-latin keyboards)
**Implementation:**
- **Class definition**: `src/common/keyboard/shortcuts.ts`
- **Real-world example**: `src/state/quick-bar-mixin.ts` - Global shortcuts (e, c, d, m, a, Shift+?) with non-latin keyboard fallbacks
### Tooltip Component (ha-tooltip)
The `ha-tooltip` component wraps Web Awesome tooltip with Home Assistant theming. Use for providing contextual help text on hover.
**Implementation:**
- **Component definition**: `src/components/ha-tooltip.ts`
- **Usage example**: `src/components/ha-label.ts`
- **Gallery documentation**: `gallery/src/pages/components/ha-tooltip.markdown`
## Common Patterns
### Creating a Panel
```typescript
@customElement("ha-panel-myfeature")
export class HaPanelMyFeature extends SubscribeMixin(LitElement) {
@property({ attribute: false })
hass!: HomeAssistant;
@property({ type: Boolean, reflect: true })
narrow!: boolean;
@property()
route!: Route;
hassSubscribe() {
return [
subscribeEntityRegistry(this.hass.connection, (entities) => {
this._entities = entities;
}),
];
}
}
```
#### Creating a Lovelace Card
**Purpose**: Cards allow users to tell different stories about their house (based on gallery)
```typescript
@customElement("hui-my-card")
export class HuiMyCard extends LitElement implements LovelaceCard {
@property({ attribute: false })
hass!: HomeAssistant;
@state()
private _config?: MyCardConfig;
public setConfig(config: MyCardConfig): void {
if (!config.entity) {
throw new Error("Entity required");
}
this._config = config;
}
public getCardSize(): number {
return 3; // Height in grid units
}
// Optional: Editor for card configuration
public static getConfigElement(): LovelaceCardEditor {
return document.createElement("hui-my-card-editor");
}
// Optional: Stub config for card picker
public static getStubConfig(): object {
return { entity: "" };
}
}
```
**Card Guidelines:**
- Cards are highly customizable for different households
- Implement `LovelaceCard` interface with `setConfig()` and `getCardSize()`
- Use proper error handling in `setConfig()`
- Consider all possible states (loading, error, unavailable)
- Support different entity types and states
- Follow responsive design principles
- Add configuration editor when needed
### Internationalization
- **Use localize**: Always use the localization system
- **Add translation keys**: Add keys to src/translations/en.json
- **Support placeholders**: Use proper placeholder syntax
```typescript
this.hass.localize("ui.panel.config.updates.update_available", {
count: 5,
});
```
### Accessibility
- **ARIA labels**: Add appropriate ARIA labels
- **Keyboard navigation**: Ensure all interactions work with keyboard
- **Screen reader support**: Test with screen readers
- **Color contrast**: Meet WCAG AA standards
## Development Workflow
### Setup and Commands
1. **Setup**: `script/setup` - Install dependencies
2. **Develop**: `script/develop` - Development server
3. **Lint**: `yarn lint` - Run all linting before committing
4. **Test**: `yarn test` - Add and run tests
5. **Build**: `script/build_frontend` - Test production build
### Common Pitfalls to Avoid
- Don't manually query the DOM with `querySelector` - use the `@query`/`@queryAll` decorators or component properties
- Don't manipulate DOM directly - Let Lit handle rendering
- Don't use global styles - Scope styles to components
- Don't block the main thread - Use web workers for heavy computation
- Don't ignore TypeScript errors - Fix all type issues
### Security Best Practices
- Sanitize HTML - Never use `unsafeHTML` with user content
- Validate inputs - Always validate user inputs
- Use HTTPS - All external resources must use HTTPS
- CSP compliance - Ensure code works with Content Security Policy
### Pull Requests
When creating a pull request, you **must** use the PR template located at `.github/PULL_REQUEST_TEMPLATE.md`. Read the template file and use its full content as the PR body, filling in each section appropriately.
- Do not omit, reorder, or rewrite the template sections
- Check the appropriate "Type of change" box based on the changes
- Do not check the checklist items on behalf of the user — those are the user's responsibility to review and check
- If the PR includes UI changes, remind the user to add screenshots or a short video to the PR after creating it
- Be simple and user friendly — explain what the change does, not implementation details
- Use markdown so the user can copy it
### Text and Copy Guidelines
#### Terminology Standards
**Delete vs Remove** (Based on gallery/src/pages/Text/remove-delete-add-create.markdown)
- **Use "Remove"** for actions that can be restored or reapplied:
- Removing a user's permission
- Removing a user from a group
- Removing links between items
- Removing a widget from dashboard
- Removing an item from a cart
- **Use "Delete"** for permanent, non-recoverable actions:
- Deleting a field
- Deleting a value in a field
- Deleting a task
- Deleting a group
- Deleting a permission
- Deleting a calendar event
**Create vs Add** (Create pairs with Delete, Add pairs with Remove)
- **Use "Add"** for already-existing items:
- Adding a permission to a user
- Adding a user to a group
- Adding links between items
- Adding a widget to dashboard
- Adding an item to a cart
- **Use "Create"** for something made from scratch:
- Creating a new field
- Creating a new task
- Creating a new group
- Creating a new permission
- Creating a new calendar event
#### Writing Style (Consistent with Home Assistant Documentation)
- **Use American English**: Standard spelling and terminology
- **Friendly, informational tone**: Be inspiring, personal, comforting, engaging
- **Address users directly**: Use "you" and "your"
- **Be inclusive**: Objective, non-discriminatory language
- **Be concise**: Use clear, direct language
- **Be consistent**: Follow established terminology patterns
- **Use active voice**: "Delete the automation" not "The automation should be deleted"
- **Avoid jargon**: Use terms familiar to home automation users
#### Language Standards
- **Always use "Home Assistant"** in full, never "HA" or "HASS"
- **Avoid abbreviations**: Spell out terms when possible
- **Use sentence case everywhere**: Titles, headings, buttons, labels, UI elements
- ✅ "Create new automation"
- ❌ "Create New Automation"
- ✅ "Device settings"
- ❌ "Device Settings"
- **Oxford comma**: Use in lists (item 1, item 2, and item 3)
- **Replace Latin terms**: Use "like" instead of "e.g.", "for example" instead of "i.e."
- **Avoid CAPS for emphasis**: Use bold or italics instead
- **Write for all skill levels**: Both technical and non-technical users
#### Key Terminology
- **"integration"** (preferred over "component")
- **Technical terms**: Use lowercase (automation, entity, device, service)
#### Translation Considerations
All user-facing text must be translatable — see the **Internationalization** section (under Common Patterns) for the `localize` API and placeholder usage. From a copy perspective:
- **Keep context**: Provide enough context for translators
- **Avoid concatenation**: Prefer full localized strings with placeholders over stitching translated fragments together
### Common Review Issues (From PR Analysis)
Recurring, easy-to-miss problems surfaced in real PR reviews. These complement the standards above rather than repeating them — items already covered earlier (loading states, error handling, mobile layout, theming, import hygiene) are intentionally not duplicated here.
#### User Experience and Accessibility
- **Form validation**: Always provide proper field labels and validation feedback
- **Form accessibility**: Prevent password managers from incorrectly identifying fields
- **Hit targets**: Make clickable areas large enough for touch interaction
- **Visual feedback**: Provide clear indication of interactive states (hover, active, focus)
#### Dialog and Modal Patterns
- **Interview progress**: Show clear progress for multi-step operations
- **State persistence**: Handle dialog state properly during background operations
- **Cancel behavior**: Ensure cancel/close buttons work consistently
- **Form prefilling**: Use smart defaults but allow user override
#### Component Design Patterns
- **Terminology consistency**: Use "Join"/"Apply" instead of "Group" when appropriate
- **Visual hierarchy**: Ensure proper font sizes and spacing ratios
- **Grid alignment**: Components should align to the design grid system
- **Badge placement**: Position badges and indicators consistently
#### Code Quality Issues
- **Null checking**: Always check if entities exist before accessing properties
- **TypeScript safety**: Handle potentially undefined array/object access
- **Event handling and cleanup**: Subscribe/unsubscribe correctly and remove listeners to avoid memory leaks
#### Configuration and Props
- **Optional parameters**: Make configuration fields optional when sensible
- **Smart defaults**: Provide reasonable default values
- **Future extensibility**: Design APIs that can be extended later
- **Validation**: Validate configuration before applying changes
## Review Guidelines
Final pre-submission checklist. Linting and formatting are enforced by tooling, so this focuses on what tools can't catch rather than restating every rule above.
- [ ] `yarn lint` passes (TypeScript, ESLint, Prettier, Lit analyzer) and `yarn test` is green
- [ ] Tests added for new data processing/utilities (where applicable)
- [ ] All user-facing text is localized and follows the Text and Copy guidelines (sentence case, "Home Assistant" in full, Delete/Remove + Create/Add)
- [ ] Components handle all states (loading, error, unavailable)
- [ ] Entity existence checked before property access
- [ ] Event/subscription listeners cleaned up (no memory leaks)
- [ ] Accessible to screen readers and keyboard
+13
View File
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
time: "06:00"
cooldown:
default-days: 7
open-pull-requests-limit: 10
labels:
- Dependencies
- GitHub Actions
+3 -52
View File
@@ -1,21 +1,3 @@
Agents:
- changed-files:
- any-glob-to-any-file:
- "**/AGENTS.md"
- "**/CLAUDE.md"
- "**/GEMINI.md"
- .agents/**
- .claude/**
- .github/agents/**
- .github/copilot-instructions.md
- .github/hooks/**
- .github/instructions/**
- .github/plugin.json
- .github/plugin/**
- .github/prompts/**
- .github/skills/**
- .github/workflows/copilot-setup-steps.yml
Build:
- changed-files:
- any-glob-to-any-file:
@@ -48,9 +30,9 @@ Dependencies:
- any-glob-to-all-files:
- package.json
- renovate.json
- pnpm-lock.yaml
- pnpm-workspace.yaml
- patches/**
- yarn.lock
- .yarn/**
- .yarnrc.yml
- .nvmrc
# Dependabot and Renovate branches always match (i.e. compatibility tweaks by members considered minor)
- head-branch:
@@ -60,36 +42,5 @@ Dependencies:
GitHub Actions:
- changed-files:
- any-glob-to-any-file:
- .github/actions/**
- .github/workflows/**
- .github/*.yml
"Tests: E2E":
- changed-files:
- any-glob-to-any-file:
- test/e2e/**
"Tests: App":
- changed-files:
- any-glob-to-any-file:
- test/e2e/app.spec.ts
- test/e2e/app/**
- test/e2e/playwright.app.config.ts
"Tests: Demo":
- changed-files:
- any-glob-to-any-file:
- test/e2e/demo.spec.ts
- test/e2e/playwright.demo.config.ts
"Tests: Design":
- changed-files:
- any-glob-to-any-file:
- test/e2e/gallery.spec.ts
- test/e2e/playwright.gallery.config.ts
"Tests: Unit":
- changed-files:
- any-glob-to-any-file:
- test/*.ts
- "test/!(e2e)/**"
-38
View File
@@ -1,38 +0,0 @@
#!/usr/bin/env node
// Fails the check when a pull request carries a label that blocks merging, and
// writes the outcome to the job summary. Invoked from the `check` job in
// .github/workflows/blocking-labels.yaml via actions/github-script:
//
// const { default: checkBlockingLabels } =
// await import(`${process.env.GITHUB_WORKSPACE}/.github/scripts/check-blocking-labels.mjs`);
// await checkBlockingLabels({ github, context, core });
export default async function checkBlockingLabels({ context, core }) {
const blockingLabels = [
"wait for backend",
"Needs UX",
"Do Not Review",
"Blocked",
"has-parent",
];
const prLabels = context.payload.pull_request.labels.map((l) => l.name);
const found = blockingLabels.filter((bl) => prLabels.includes(bl));
if (found.length > 0) {
const message = `This Pull Request is blocked by label${found.length > 1 ? "s" : ""}: ${found.join(", ")}`;
await core.summary
.addHeading(":no_entry_sign: Pull Request is blocked", 2)
.addRaw(message)
.write();
core.setFailed(message);
} else {
await core.summary
.addHeading(
":white_check_mark: Pull Request is clear to merge after review",
2
)
.addRaw(
"This Pull Request is not blocked by any labels which prevent it from being merged."
)
.write();
}
}
@@ -1,195 +0,0 @@
#!/usr/bin/env node
// Checks that a pull request follows the contribution standards: it must use the
// PR template, tick exactly one "Type of change" option, and describe the change.
// Labels and comments the PR when it does not, and fails the check so it blocks
// merging. Invoked from the `check` job in .github/workflows/pull-request-standards.yaml
// via actions/github-script:
//
// const { default: checkStandards } =
// await import(`${process.env.GITHUB_WORKSPACE}/.github/scripts/check-pull-request-standards.mjs`);
// await checkStandards({ github, context, core });
export default async function checkPullRequestStandards({
github,
context,
core,
}) {
const pr = context.payload.pull_request;
// Exempt bots (Copilot agent, dependabot), drafts, and maintainers.
if (pr.user.type === "Bot") {
core.info(`Skipping bot author: ${pr.user.login}`);
return;
}
if (pr.draft) {
core.info("Skipping draft pull request");
return;
}
try {
await github.rest.orgs.checkMembershipForUser({
org: "home-assistant",
username: pr.user.login,
});
core.info(`Skipping organization member: ${pr.user.login}`);
return;
} catch (_error) {
core.info(
`${pr.user.login} is not an organization member, checking standards`
);
}
const label = "Needs Template";
const marker = "<!-- pr-standards-check -->";
const { owner, repo } = context.repo;
const issue_number = pr.number;
let body = pr.body || "";
let previous;
do {
previous = body;
body = body.replace(/<!--[\s\S]*?-->/g, "");
} while (body !== previous);
const normalized = body.toLowerCase();
// Ignore 404s from mutations that race manual edits or cancelled runs.
const ignoreMissing = async (fn) => {
try {
await fn();
} catch (error) {
if (error.status === 404) {
core.info("Target already removed, nothing to do");
return;
}
throw error;
}
};
// Hide/restore our comment via GraphQL (REST cannot minimize).
const setMinimized = async (subjectId, minimized) => {
const mutation = minimized
? `mutation($id: ID!) {
minimizeComment(input: { subjectId: $id, classifier: RESOLVED }) {
clientMutationId
}
}`
: `mutation($id: ID!) {
unminimizeComment(input: { subjectId: $id }) {
clientMutationId
}
}`;
try {
await github.graphql(mutation, { id: subjectId });
} catch (error) {
core.info(
`Could not ${minimized ? "minimize" : "restore"} comment: ${error.message}`
);
}
};
// Content of a "## <name>" section, or null when the heading is absent.
const section = (name) => {
const match = body.match(
new RegExp(`##\\s${name}([\\s\\S]*?)(?=\\n##\\s|$)`, "i")
);
return match ? match[1] : null;
};
const problems = [];
const requiredHeadings = [
"## proposed change",
"## type of change",
"## checklist",
];
if (requiredHeadings.some((h) => !normalized.includes(h))) {
problems.push(
"Use the pull request template without removing its sections."
);
}
const typeOfChange = section("type of change");
if (typeOfChange !== null) {
const ticked = (typeOfChange.match(/-\s*\[[xX]\]/g) || []).length;
if (ticked !== 1) {
problems.push('Select exactly one option under "Type of change".');
}
}
const proposedChange = section("proposed change");
if (proposedChange !== null && proposedChange.trim().length === 0) {
problems.push('Describe your changes under "Proposed change".');
}
const isValid = problems.length === 0;
const comments = await github.paginate(github.rest.issues.listComments, {
owner,
repo,
issue_number,
per_page: 100,
});
const existing = comments.find((c) => c.body.includes(marker));
const hasLabel = pr.labels.some((l) => l.name === label);
if (isValid) {
core.info("Pull request standards met");
if (hasLabel) {
await ignoreMissing(() =>
github.rest.issues.removeLabel({
owner,
repo,
issue_number,
name: label,
})
);
}
if (existing) {
await setMinimized(existing.node_id, true);
}
return;
}
core.info(`Pull request standards not met:\n- ${problems.join("\n- ")}`);
if (!hasLabel) {
await github.rest.issues.addLabels({
owner,
repo,
issue_number,
labels: [label],
});
}
const message =
`${marker}\n` +
`Hey @${pr.user.login}!\n\n` +
`Thank you for your contribution! To help reviewers, please update ` +
`this pull request to follow our pull request standards:\n\n` +
problems.map((p) => `- ${p}`).join("\n") +
`\n\n` +
`Please complete the ` +
`[PR template](https://github.com/home-assistant/frontend/blob/dev/.github/PULL_REQUEST_TEMPLATE.md?plain=1) ` +
`and see the [developer docs](https://developers.home-assistant.io/docs/review-process) ` +
`for more on creating a great pull request (see point 6).`;
if (existing) {
await github.rest.issues.updateComment({
owner,
repo,
comment_id: existing.id,
body: message,
});
await setMinimized(existing.node_id, false);
} else {
await github.rest.issues.createComment({
owner,
repo,
issue_number,
body: message,
});
}
// Fail this check so it can block the PR from being merged
core.setFailed(`Pull request standards not met:\n- ${problems.join("\n- ")}`);
}
@@ -1,58 +0,0 @@
#!/usr/bin/env node
// Restricts Task issues to organization members: closes and labels the issue with
// an explanatory comment when the author is not an org member. Invoked from the
// `check-authorization` job in .github/workflows/restrict-task-creation.yaml via
// actions/github-script:
//
// const { default: checkTaskAuthorization } =
// await import(`${process.env.GITHUB_WORKSPACE}/.github/scripts/check-task-authorization.mjs`);
// await checkTaskAuthorization({ github, context, core });
export default async function checkTaskAuthorization({
github,
context,
core,
}) {
const issueAuthor = context.payload.issue.user.login;
// Check if user is an organization member
try {
await github.rest.orgs.checkMembershipForUser({
org: "home-assistant",
username: issueAuthor,
});
core.info(`✅ ${issueAuthor} is an organization member`);
return; // Authorized
} catch (_error) {
core.info(`❌ ${issueAuthor} is not authorized to create Task issues`);
}
// Close the issue with a comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body:
`Hi @${issueAuthor}, thank you for your contribution!\n\n` +
`Task issues are restricted to Open Home Foundation staff and authorized contributors.\n\n` +
`If you would like to:\n` +
`- Report a bug: Please use the [bug report form](https://github.com/home-assistant/frontend/issues/new?template=bug_report.yml)\n` +
`- Request a feature: Please submit to [Feature Requests](https://github.com/orgs/home-assistant/discussions)\n\n` +
`If you believe you should have access to create Task issues, please contact the maintainers.`,
});
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
state: "closed",
});
// Add a label to indicate this was auto-closed
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ["auto-closed"],
});
}
-42
View File
@@ -1,42 +0,0 @@
name: Lint workflow files
on:
push:
branches:
- dev
- master
paths:
- ".github/actions/**"
- ".github/workflows/**"
pull_request:
branches:
- dev
- master
paths:
- ".github/actions/**"
- ".github/workflows/**"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
actionlint:
name: Check workflow files
runs-on: ubuntu-latest
env:
# renovate: datasource=github-releases depName=rhysd/actionlint
ACTIONLINT_VERSION: 1.7.12
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Run actionlint
run: |
curl -sSfL "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz" \
| tar -xz actionlint
./actionlint -color
-35
View File
@@ -1,35 +0,0 @@
name: Blocking labels
on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled
branches:
- dev
- master
permissions:
contents: read
jobs:
check:
name: Check for labels which block the Pull Request from being merged
runs-on: ubuntu-latest
steps:
- name: Check out workflow scripts
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
sparse-checkout: .github/scripts
- name: Check for blocking labels
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const { default: checkBlockingLabels } = await import(
`${process.env.GITHUB_WORKSPACE}/.github/scripts/check-blocking-labels.mjs`
);
await checkBlockingLabels({ github, context, core });
+38 -29
View File
@@ -18,62 +18,71 @@ jobs:
deploy_dev:
runs-on: ubuntu-latest
name: Deploy Development
if: github.repository == 'home-assistant/frontend' && github.event_name != 'push'
if: github.event_name != 'push'
environment:
name: Cast Development
url: ${{ steps.deploy.outputs.netlify_url }}
url: ${{ steps.deploy.outputs.NETLIFY_LIVE_URL || steps.deploy.outputs.NETLIFY_URL }}
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: dev
persist-credentials: false
- name: Setup Node and install
uses: ./.github/actions/setup
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: ".nvmrc"
cache: yarn
- name: Install dependencies
run: yarn install --immutable
- name: Build Cast
uses: ./.github/actions/build
with:
target: build-cast
github-token: ${{ secrets.GITHUB_TOKEN }}
run: ./node_modules/.bin/gulp build-cast
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to Netlify
id: deploy
uses: ./.github/actions/netlify-deploy
with:
dir: cast/dist
alias: dev
auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
site-id: ${{ secrets.NETLIFY_CAST_SITE_ID }}
run: |
npx -y netlify-cli deploy --dir=cast/dist --alias dev
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_CAST_SITE_ID }}
deploy_master:
runs-on: ubuntu-latest
name: Deploy Production
if: github.repository == 'home-assistant/frontend' && github.event_name == 'push'
if: github.event_name == 'push'
environment:
name: Cast Production
url: ${{ steps.deploy.outputs.netlify_url }}
url: ${{ steps.deploy.outputs.NETLIFY_LIVE_URL || steps.deploy.outputs.NETLIFY_URL }}
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: master
persist-credentials: false
- name: Setup Node and install
uses: ./.github/actions/setup
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: ".nvmrc"
cache: yarn
- name: Install dependencies
run: yarn install --immutable
- name: Build Cast
uses: ./.github/actions/build
with:
target: build-cast
github-token: ${{ secrets.GITHUB_TOKEN }}
run: ./node_modules/.bin/gulp build-cast
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to Netlify
id: deploy
uses: ./.github/actions/netlify-deploy
with:
dir: cast/dist
auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
site-id: ${{ secrets.NETLIFY_CAST_SITE_ID }}
run: |
npx -y netlify-cli deploy --dir=cast/dist --prod
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_CAST_SITE_ID }}
+34 -124
View File
@@ -1,7 +1,6 @@
name: CI
on:
workflow_dispatch:
push:
branches:
- dev
@@ -13,6 +12,7 @@ on:
env:
NODE_OPTIONS: --max_old_space_size=6144
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -22,39 +22,27 @@ permissions:
contents: read
jobs:
prepare-dependencies:
name: Prepare dependencies
runs-on: ubuntu-latest
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Prepare dependencies
uses: ./.github/actions/prepare-dependencies
lint:
name: Lint and check format
needs: prepare-dependencies
runs-on: ubuntu-latest
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Node with shared dependencies
uses: ./.github/actions/setup
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-modules-cache: true
node-version-file: ".nvmrc"
cache: yarn
- name: Install dependencies
run: yarn install --immutable
- name: Check for duplicate dependencies
run: pnpm dedupe --check
run: yarn dedupe --check
- name: Build resources
id: build_resources
run: ./node_modules/.bin/gulp gen-icons-json build-translations build-locale-data gather-gallery-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup lint cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: |
node_modules/.cache/prettier
@@ -63,87 +51,60 @@ jobs:
key: lint-${{ github.sha }}
restore-keys: lint-
- name: Run eslint
run: pnpm run lint:eslint --quiet
run: yarn run lint:eslint --quiet
- name: Run tsc
if: ${{ !cancelled() && steps.build_resources.outcome == 'success' }}
run: pnpm run lint:types
run: yarn run lint:types
- name: Run lit-analyzer
if: ${{ !cancelled() && steps.build_resources.outcome == 'success' }}
run: pnpm run lint:lit --quiet
run: yarn run lint:lit --quiet
- name: Run prettier
if: ${{ !cancelled() && steps.build_resources.outcome == 'success' }}
run: pnpm run lint:prettier
run: yarn run lint:prettier
- name: Check dependency licenses
if: ${{ !cancelled() && steps.build_resources.outcome == 'success' }}
run: pnpm run lint:licenses
- name: Check the bundled map sprite sheet
if: ${{ !cancelled() }}
run: ./node_modules/.bin/gulp check-map-sprites
run: yarn run lint:licenses
test:
name: Run tests
needs: prepare-dependencies
runs-on: ubuntu-latest
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Node with shared dependencies
uses: ./.github/actions/setup
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-modules-cache: true
node-version-file: ".nvmrc"
cache: yarn
- name: Install dependencies
run: yarn install --immutable
- name: Build resources
run: ./node_modules/.bin/gulp gen-icons-json build-translations build-locale-data
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run Tests
run: pnpm run test
run: yarn run test
build:
name: Build frontend
# Runs alongside lint and test rather than after them: the build only needs
# the dependency tree, and with the rspack cache it is no longer expensive
# enough to be worth serialising behind the other checks. The
# cancel-on-failure job below stops the run as soon as a check fails, so a
# broken pull request does not finish building.
needs: prepare-dependencies
needs: [lint, test]
runs-on: ubuntu-latest
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Node with shared dependencies
uses: ./.github/actions/setup
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-modules-cache: true
# Read-only reuse of the rspack cache written by the nightly (see
# nightly.yaml). rspack itself decides what is still valid (version +
# buildDependencies + node_modules snapshot), so the GHA key just restores
# the latest nightly cache; no fingerprint, and no save step (CI never
# writes the shared cache).
- name: Restore rspack cache
continue-on-error: true
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .rspack-cache
key: rspack-cache-${{ runner.os }}-${{ github.run_id }}
restore-keys: |
rspack-cache-${{ runner.os }}-
node-version-file: ".nvmrc"
cache: yarn
- name: Install dependencies
run: yarn install --immutable
- name: Build Application
uses: ./.github/actions/build
with:
target: build-app
github-token: ${{ secrets.GITHUB_TOKEN }}
is-test: true
rspack-cache: readonly
run: ./node_modules/.bin/gulp build-app
env:
IS_TEST: "true"
- name: Upload bundle stats
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: frontend-bundle-stats
path: build/stats/*.json
if-no-files-found: error
- name: Check entrypoint bundle size budget
run: pnpm run check-bundlesize
- name: Upload frontend build
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
@@ -151,54 +112,3 @@ jobs:
path: hass_frontend/
if-no-files-found: error
retention-days: 7
# Now that the checks run in parallel, a failing lint or test no longer stops
# the build from finishing on its own, so this watches them and cancels the
# whole run on the first failure.
#
# It is a separate job on purpose. Cancelling needs `actions: write`, and the
# other jobs check out the pull request and run its build scripts — handing
# them that scope would give PR-controlled code (or a compromised dependency)
# write access to Actions. This job never checks out the repository, so the
# elevated token stays away from PR code. It also cannot be a job that
# `needs` the checks: that would only start once they have all finished, which
# is exactly too late to cancel anything.
cancel-on-failure:
name: Cancel run on failure
needs: prepare-dependencies
runs-on: ubuntu-latest
permissions:
actions: write
timeout-minutes: 30
steps:
- name: Cancel the run when a check fails
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
RUN_ID: ${{ github.run_id }}
run: |
watched='^(Lint and check format|Run tests|Build frontend)$'
while :; do
jobs=$(gh api "repos/$REPO/actions/runs/$RUN_ID/jobs?per_page=100" \
--paginate --jq '.jobs[] | [.name, .status, (.conclusion // "")] | @tsv' \
2>/dev/null || true)
failed=$(printf '%s\n' "$jobs" | awk -F'\t' -v w="$watched" \
'$1 ~ w && ($3 == "failure" || $3 == "timed_out") { print $1 }')
if [ -n "$failed" ]; then
echo "Cancelling the run, these checks failed:"
printf '%s\n' "$failed"
gh run cancel "$RUN_ID" --repo "$REPO" || true
exit 0
fi
found=$(printf '%s\n' "$jobs" | awk -F'\t' -v w="$watched" '$1 ~ w' | wc -l)
running=$(printf '%s\n' "$jobs" | awk -F'\t' -v w="$watched" \
'$1 ~ w && $2 != "completed" { print $1 }')
if [ "$found" -ge 3 ] && [ -z "$running" ]; then
echo "All checks finished without failure"
exit 0
fi
sleep 15
done
-43
View File
@@ -1,43 +0,0 @@
name: "CodeQL"
on:
push:
branches:
- dev
- master
pull_request:
# The branches below must be a subset of the branches above
branches:
- dev
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
timeout-minutes: 360
permissions:
contents: read # To check out the repository
security-events: write # To upload CodeQL results
steps:
- name: Check out code from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Initialize CodeQL
uses: github/codeql-action/init@1c5b675653bb5c22dbe9b12b556ec555138e09fd # v4.38.1
with:
languages: javascript-typescript
build-mode: none
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@1c5b675653bb5c22dbe9b12b556ec555138e09fd # v4.38.1
with:
category: "/language:javascript-typescript"
+65
View File
@@ -0,0 +1,65 @@
name: "CodeQL"
on:
push:
branches: [dev, master]
pull_request:
# The branches below must be a subset of the branches above
branches: [dev]
permissions:
contents: read
security-events: write
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ["javascript"]
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
persist-credentials: false
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
with:
languages: ${{ matrix.language }}
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
-34
View File
@@ -1,34 +0,0 @@
name: Copilot Setup Steps
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
env:
NODE_OPTIONS: --max_old_space_size=6144
jobs:
copilot-setup-steps:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Node and install
uses: ./.github/actions/setup
with:
node-modules-cache: true
- name: Skip fetching nightly translations
run: echo "SKIP_FETCH_NIGHTLY_TRANSLATIONS=1" >> "$GITHUB_ENV"
- name: Build resources
run: ./node_modules/.bin/gulp gen-icons-json build-translations build-locale-data gather-gallery-pages
+38 -28
View File
@@ -19,61 +19,71 @@ jobs:
deploy_dev:
runs-on: ubuntu-latest
name: Demo Development
if: github.repository == 'home-assistant/frontend' && (github.event_name != 'push' || github.ref_name != 'master')
if: github.event_name != 'push' || github.ref_name != 'master'
environment:
name: Demo Development
url: ${{ steps.deploy.outputs.unique_deploy_url }}
url: ${{ steps.deploy.outputs.NETLIFY_LIVE_URL || steps.deploy.outputs.NETLIFY_URL }}
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: dev
persist-credentials: false
- name: Setup Node and install
uses: ./.github/actions/setup
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: ".nvmrc"
cache: yarn
- name: Install dependencies
run: yarn install --immutable
- name: Build Demo
uses: ./.github/actions/build
with:
target: build-demo
github-token: ${{ secrets.GITHUB_TOKEN }}
run: ./node_modules/.bin/gulp build-demo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to Netlify
id: deploy
uses: ./.github/actions/netlify-deploy
with:
dir: demo/dist
auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
site-id: ${{ secrets.NETLIFY_DEMO_DEV_SITE_ID }}
run: |
npx -y netlify-cli deploy --dir=demo/dist --prod
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEMO_DEV_SITE_ID }}
deploy_master:
runs-on: ubuntu-latest
name: Demo Production
if: github.repository == 'home-assistant/frontend' && github.event_name == 'push' && github.ref_name == 'master'
if: github.event_name == 'push' && github.ref_name == 'master'
environment:
name: Demo Production
url: ${{ steps.deploy.outputs.netlify_url }}
url: ${{ steps.deploy.outputs.NETLIFY_LIVE_URL || steps.deploy.outputs.NETLIFY_URL }}
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: master
persist-credentials: false
- name: Setup Node and install
uses: ./.github/actions/setup
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: ".nvmrc"
cache: yarn
- name: Install dependencies
run: yarn install --immutable
- name: Build Demo
uses: ./.github/actions/build
with:
target: build-demo
github-token: ${{ secrets.GITHUB_TOKEN }}
run: ./node_modules/.bin/gulp build-demo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to Netlify
id: deploy
uses: ./.github/actions/netlify-deploy
with:
dir: demo/dist
auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
site-id: ${{ secrets.NETLIFY_DEMO_SITE_ID }}
run: |
npx -y netlify-cli deploy --dir=demo/dist --prod
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DEMO_SITE_ID }}
+18 -14
View File
@@ -13,30 +13,34 @@ env:
jobs:
deploy:
if: github.repository == 'home-assistant/frontend'
runs-on: ubuntu-latest
environment:
name: Design
url: ${{ steps.deploy.outputs.netlify_url }}
url: ${{ steps.deploy.outputs.NETLIFY_LIVE_URL || steps.deploy.outputs.NETLIFY_URL }}
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Node and install
uses: ./.github/actions/setup
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: ".nvmrc"
cache: yarn
- name: Install dependencies
run: yarn install --immutable
- name: Build Gallery
uses: ./.github/actions/build
with:
target: build-gallery
github-token: ${{ secrets.GITHUB_TOKEN }}
run: ./node_modules/.bin/gulp build-gallery
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy to Netlify
id: deploy
uses: ./.github/actions/netlify-deploy
with:
dir: gallery/dist
auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
site-id: ${{ secrets.NETLIFY_GALLERY_SITE_ID }}
run: |
npx -y netlify-cli deploy --dir=gallery/dist --prod
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_GALLERY_SITE_ID }}
+21 -14
View File
@@ -24,27 +24,34 @@ jobs:
if: github.repository == 'home-assistant/frontend' && contains(github.event.pull_request.labels.*.name, 'needs design preview')
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Node and install
uses: ./.github/actions/setup
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: ".nvmrc"
cache: yarn
- name: Install dependencies
run: yarn install --immutable
- name: Build Gallery
uses: ./.github/actions/build
with:
target: build-gallery
github-token: ${{ secrets.GITHUB_TOKEN }}
run: ./node_modules/.bin/gulp build-gallery
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy preview to Netlify
id: deploy
uses: ./.github/actions/netlify-deploy
with:
dir: gallery/dist
alias: deploy-preview-${{ github.event.number }}
auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
site-id: ${{ secrets.NETLIFY_GALLERY_SITE_ID }}
run: |
npx -y netlify-cli deploy --dir=gallery/dist --alias "deploy-preview-${{ github.event.number }}" \
--json > deploy_output.json
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_GALLERY_SITE_ID }}
- name: Generate summary
run: echo "${{ steps.deploy.outputs.netlify_url }}" >> "$GITHUB_STEP_SUMMARY"
run: |
NETLIFY_LIVE_URL=$(jq -r '.deploy_url' deploy_output.json)
echo "$NETLIFY_LIVE_URL" >> "$GITHUB_STEP_SUMMARY"
-396
View File
@@ -1,396 +0,0 @@
name: E2E Tests
on:
push:
branches:
- dev
- master
pull_request:
branches:
- dev
- master
workflow_dispatch:
env:
NODE_OPTIONS: --max_old_space_size=6144
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
prepare-dependencies:
name: Prepare dependencies
runs-on: ubuntu-latest
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Prepare dependencies
uses: ./.github/actions/prepare-dependencies
prepare-container-dependencies:
name: Prepare container dependencies
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.63.0-noble
options: --user 1001
defaults:
run:
shell: bash
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Prepare dependencies
uses: ./.github/actions/prepare-dependencies
with:
node-modules-cache-key: node-modules-container-v1
# ── Build the demo once and share it across test jobs via artifact ──────────
build-demo:
name: Build demo
needs: prepare-dependencies
runs-on: ubuntu-latest
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Node with shared dependencies
uses: ./.github/actions/setup
with:
node-modules-cache: true
- name: Build demo
uses: ./.github/actions/build
with:
target: build-demo-e2e
github-token: ${{ secrets.GITHUB_TOKEN }}
is-test: true
- name: Upload demo build
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: demo-dist
path: demo/dist/
if-no-files-found: error
retention-days: 3
# ── Build the e2e test app and share it via artifact ────────────────────────
build-e2e-test-app:
name: Build e2e test app
needs: prepare-dependencies
runs-on: ubuntu-latest
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Node with shared dependencies
uses: ./.github/actions/setup
with:
node-modules-cache: true
- name: Build e2e test app
uses: ./.github/actions/build
with:
target: build-e2e-test-app-e2e
github-token: ${{ secrets.GITHUB_TOKEN }}
is-test: true
- name: Upload e2e test app build
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: e2e-test-app-dist
path: test/e2e/app/dist/
if-no-files-found: error
retention-days: 3
# ── Build the gallery and share it via artifact ─────────────────────────────
build-gallery:
name: Build gallery
needs: prepare-dependencies
runs-on: ubuntu-latest
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Node with shared dependencies
uses: ./.github/actions/setup
with:
node-modules-cache: true
- name: Build gallery
uses: ./.github/actions/build
with:
target: build-gallery
github-token: ${{ secrets.GITHUB_TOKEN }}
is-test: true
- name: Upload gallery build
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: gallery-dist
path: gallery/dist/
if-no-files-found: error
retention-days: 3
# ── Run Playwright tests against Chromium ──────────────────────────────────
e2e-demo:
name: E2E demo (${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
needs:
- build-demo
- prepare-container-dependencies
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.63.0-noble
options: --user 1001 --ipc=host
defaults:
run:
shell: bash
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
shardIndex:
- 1
- 2
shardTotal:
- 2
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Node with shared dependencies
uses: ./.github/actions/setup
with:
node-modules-cache: true
node-modules-cache-key: node-modules-container-v1
- name: Download demo build
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: demo-dist
path: demo/dist/
- name: Run Playwright demo tests
run: pnpm run test:e2e:demo --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
timeout-minutes: 15
- name: Upload demo blob report
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: always()
with:
name: blob-report-demo-${{ matrix.shardIndex }}
path: test/e2e/reports/demo/
if-no-files-found: warn
retention-days: 3
e2e-app:
name: E2E app (${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
needs:
- build-e2e-test-app
- prepare-container-dependencies
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.63.0-noble
options: --user 1001 --ipc=host
defaults:
run:
shell: bash
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
shardIndex:
- 1
- 2
- 3
- 4
shardTotal:
- 4
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Node with shared dependencies
uses: ./.github/actions/setup
with:
node-modules-cache: true
node-modules-cache-key: node-modules-container-v1
- name: Download e2e test app build
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: e2e-test-app-dist
path: test/e2e/app/dist/
- name: Run Playwright app tests
run: pnpm run test:e2e:app --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
timeout-minutes: 15
- name: Upload app blob report
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: always()
with:
name: blob-report-app-${{ matrix.shardIndex }}
path: test/e2e/reports/app/
if-no-files-found: warn
retention-days: 3
e2e-gallery:
name: E2E gallery (${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
needs:
- build-gallery
- prepare-container-dependencies
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.63.0-noble
options: --user 1001 --ipc=host
defaults:
run:
shell: bash
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
shardIndex:
- 1
- 2
- 3
- 4
shardTotal:
- 4
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Node with shared dependencies
uses: ./.github/actions/setup
with:
node-modules-cache: true
node-modules-cache-key: node-modules-container-v1
- name: Download gallery build
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: gallery-dist
path: gallery/dist/
- name: Run Playwright gallery tests
run: pnpm run test:e2e:gallery --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
timeout-minutes: 15
- name: Upload gallery blob report
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: always()
with:
name: blob-report-gallery-${{ matrix.shardIndex }}
path: test/e2e/reports/gallery/
if-no-files-found: warn
retention-days: 3
report:
name: Report
needs:
- e2e-demo
- e2e-app
- e2e-gallery
runs-on: ubuntu-latest
if: ${{ always() }}
permissions:
contents: read
pull-requests: write
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Node with shared dependencies
uses: ./.github/actions/setup
with:
node-modules-cache: true
- name: Download demo blob reports
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
continue-on-error: true
with:
pattern: blob-report-demo-*
path: test/e2e/reports/demo/
- name: Download app blob reports
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
continue-on-error: true
with:
pattern: blob-report-app-*
path: test/e2e/reports/app/
- name: Download gallery blob reports
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
continue-on-error: true
with:
pattern: blob-report-gallery-*
path: test/e2e/reports/gallery/
- name: Stage blobs for merge
run: node test/e2e/collect-blob-reports.mjs
- name: Merge blob reports
run: npx playwright merge-reports -c test/e2e/playwright.merge.config.ts test/e2e/reports/blob
- name: Upload merged HTML report
id: upload-report
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: playwright-report
path: test/e2e/reports/combined/
retention-days: 14
- name: Post report to PR
if: >-
github.event_name == 'pull_request' &&
(needs.e2e-demo.result == 'failure' ||
needs.e2e-app.result == 'failure' ||
needs.e2e-gallery.result == 'failure')
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const { default: postReportComment } = await import(
`${process.env.GITHUB_WORKSPACE}/test/e2e/post-report-comment.mjs`
);
await postReportComment({ github, context, core });
- name: Check suite results
run: |
failed=0
for suite in \
"demo:${{ needs.e2e-demo.result }}" \
"app:${{ needs.e2e-app.result }}" \
"gallery:${{ needs.e2e-gallery.result }}"; do
name="${suite%%:*}"
result="${suite#*:}"
echo "E2E ${name}: ${result}"
if [ "$result" != "success" ]; then
failed=1
fi
done
exit "$failed"
+1 -1
View File
@@ -10,6 +10,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Apply labels
uses: actions/labeler@bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13 # v7.0.0
uses: actions/labeler@f27b608878404679385c85cfa523b85ccb86e213 # v6.1.0
with:
sync-labels: true
@@ -11,7 +11,6 @@ permissions:
jobs:
lock:
if: github.repository == 'home-assistant/frontend'
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@89ae32b08ed1a541efecbab17912962a5e38981c # v6.0.2
+12 -83
View File
@@ -14,94 +14,49 @@ permissions:
jobs:
nightly:
if: github.repository == 'home-assistant/frontend'
name: Nightly
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout the repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Setup Node and install
uses: ./.github/actions/setup
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
immutable: false
node-version-file: ".nvmrc"
cache: yarn
- name: Install dependencies
run: yarn install
- name: Download translations
run: ./script/translations_download
env:
LOKALISE_TOKEN: ${{ secrets.LOKALISE_TOKEN }}
# The wheel only builds the app (build-app), which does not merge
# backend translations. Skipping the whole-project backend export (as
# the release does) keeps this off the build's critical path; the full
# translations artifact is produced in parallel by the job below.
SKIP_BACKEND_TRANSLATIONS: "1"
- name: Bump version
run: script/version_bump.js nightly
# Warm the shared compression cache so releases reuse it (see release.yaml).
- name: Restore compression cache
id: compress-cache
continue-on-error: true
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .compress-cache
key: compress-cache-${{ runner.os }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
compress-cache-${{ runner.os }}-
# The nightly writes the rspack persistent cache; CI reads it read-only
# (see ci.yaml). rspack invalidates internally (version + buildDependencies
# + node_modules snapshot), so the cache rolls forward daily and a single
# dependency bump keeps most of it warm instead of dropping the lineage.
- name: Restore rspack cache
id: rspack-cache
continue-on-error: true
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .rspack-cache
key: rspack-cache-${{ runner.os }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
rspack-cache-${{ runner.os }}-
- name: Build nightly Python wheels
env:
COMPRESS_CACHE_DIR: ${{ github.workspace }}/.compress-cache
RSPACK_CACHE: readwrite
run: |
pip install build
pnpm install --frozen-lockfile
yarn install
export SKIP_FETCH_NIGHTLY_TRANSLATIONS=1
script/build_frontend
rm -rf dist home_assistant_frontend.egg-info
python3 -m build
# Not gated on the restore steps: a transient restore failure (they are
# continue-on-error) must not stop us persisting a freshly built cache.
- name: Save compression cache
if: success()
continue-on-error: true
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .compress-cache
key: compress-cache-${{ runner.os }}-${{ github.run_id }}-${{ github.run_attempt }}
- name: Save rspack cache
if: success()
continue-on-error: true
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .rspack-cache
key: rspack-cache-${{ runner.os }}-${{ github.run_id }}-${{ github.run_attempt }}
- name: Archive translations
run: tar -czvf translations.tar.gz translations
- name: Upload build artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
@@ -110,32 +65,6 @@ jobs:
path: dist/home_assistant_frontend*.whl
if-no-files-found: error
# The full translations (including the slow backend/core export) are only
# needed for the uploaded artifact, not the wheel, so they are downloaded in
# parallel here instead of blocking the build above.
translations:
if: github.repository == 'home-assistant/frontend'
name: Translations
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Node and install
uses: ./.github/actions/setup
with:
immutable: false
- name: Download translations
run: ./script/translations_download
env:
LOKALISE_TOKEN: ${{ secrets.LOKALISE_TOKEN }}
- name: Archive translations
run: tar -czvf translations.tar.gz translations
- name: Upload translations
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
@@ -1,38 +0,0 @@
name: Pull request standards
on:
pull_request_target: # zizmor: ignore[dangerous-triggers] -- safe: reads PR metadata from event payload only, checks out base repo scripts only, never PR head code
types:
- opened
- edited
- reopened
- ready_for_review
branches:
- dev
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
check:
name: Check pull request follows contribution standards
runs-on: ubuntu-latest
permissions:
pull-requests: write # To label and comment on pull requests
steps:
- name: Check out workflow scripts
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
sparse-checkout: .github/scripts
- name: Check pull request standards
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const { default: checkStandards } = await import(
`${process.env.GITHUB_WORKSPACE}/.github/scripts/check-pull-request-standards.mjs`
);
await checkStandards({ github, context, core });
+2 -2
View File
@@ -14,7 +14,7 @@ permissions:
jobs:
upload-frontend-modern:
name: Upload stats (frontend/modern)
if: ${{ github.repository == 'home-assistant/frontend' && github.event.workflow_run.conclusion == 'success' }}
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Send bundle stats and build information to RelativeCI
@@ -27,7 +27,7 @@ jobs:
upload-frontend-legacy:
name: Upload stats (frontend/legacy)
if: ${{ github.repository == 'home-assistant/frontend' && github.event.workflow_run.conclusion == 'success' }}
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Send bundle stats and build information to RelativeCI
+1 -2
View File
@@ -10,7 +10,6 @@ permissions:
jobs:
update_release_draft:
if: github.repository == 'home-assistant/frontend'
permissions:
# write permission for contents is required to create a github release
contents: write
@@ -19,6 +18,6 @@ jobs:
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@34d80673e067bdc0c24568d3af899c216adcfaa9 # v7.7.0
- uses: release-drafter/release-drafter@c2e2804cc59f45f57076a99af580d0fedb697927 # v7.3.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+24 -54
View File
@@ -26,66 +26,39 @@ jobs:
if: github.repository_owner == 'home-assistant'
steps:
- name: Checkout the repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Verify version
uses: home-assistant/actions/helpers/verify-version@58bff37c8947f690ace498be413a9b78d6f30f93 # master
uses: home-assistant/actions/helpers/verify-version@868e6cb4607727d764341a158d98872cd63fa658 # master
- name: Setup Node and install
uses: ./.github/actions/setup
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
immutable: false
cache: false
node-version-file: ".nvmrc"
- name: Install dependencies
run: yarn install
- name: Download Translations
run: ./script/translations_download
env:
LOKALISE_TOKEN: ${{ secrets.LOKALISE_TOKEN }}
# The app fetches core (backend) translations live from HA, so the
# release build does not need Lokalise's backend project.
SKIP_BACKEND_TRANSLATIONS: "1"
# Restore the content-addressed compression cache. Unchanged chunks and
# static assets are then reused instead of re-run through brotli/zopfli.
- name: Restore compression cache
id: compress-cache
continue-on-error: true
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .compress-cache
key: compress-cache-${{ runner.os }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
compress-cache-${{ runner.os }}-
- name: Build and release package
env:
COMPRESS_CACHE_DIR: ${{ github.workspace }}/.compress-cache
run: |
python3 -m pip install build
export SKIP_FETCH_NIGHTLY_TRANSLATIONS=1
script/release
# The build keeps the cache under its size budget, so saving stays bounded.
# A unique key always writes; restore-keys picks the newest on the next
# run. Not gated on the restore step: a transient restore failure (it is
# continue-on-error) must not stop us persisting a freshly built cache.
- name: Save compression cache
if: success()
continue-on-error: true
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .compress-cache
key: compress-cache-${{ runner.os }}-${{ github.run_id }}-${{ github.run_attempt }}
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
with:
skip-existing: true
@@ -105,28 +78,26 @@ jobs:
GITHUB_REF: ${{ github.ref }}
run: |
version=$(echo "$GITHUB_REF" | awk -F"/" '{print $NF}' )
# Wait for the exact wheel to appear on the simple index (the surface
# the wheels build's pip uses). The JSON API can report a version as
# available before it propagates here, which fails the wheels build.
wheel="home_assistant_frontend-${version}-py3-none-any.whl"
echo "Waiting for $wheel to appear on the PyPI simple index..."
# Wait for the package to become available on PyPI
echo "Waiting for home-assistant-frontend==$version to appear on PyPI..."
for i in $(seq 1 30); do
if curl -sf "https://pypi.org/simple/home-assistant-frontend/" | grep -qF "$wheel"; then
echo "Package is available on the PyPI simple index!"
status=$(curl -s -o /dev/null -w "%{http_code}" "https://pypi.org/pypi/home-assistant-frontend/$version/json")
if [ "$status" = "200" ]; then
echo "Package is available on PyPI!"
break
fi
if [ "$i" = "30" ]; then
echo "Timed out waiting for package to appear on PyPI"
exit 1
fi
echo "Not available yet, retrying in 30 seconds... ($i/30)"
echo "Not available yet (HTTP $status), retrying in 30 seconds... ($i/30)"
sleep 30
done
echo "home-assistant-frontend==$version" > ./requirements.txt
# home-assistant/wheels doesn't support SHA pinning
- name: Build wheels
uses: home-assistant/wheels@9e17ab1ed5c4c79d8b61e29fa63de25ca2710716 # 2026.07.0
uses: home-assistant/wheels@e5742a69d69f0e274e2689c998900c7d19652c21 # 2025.12.0
with:
abi: cp314
tag: musllinux_1_2
@@ -136,26 +107,25 @@ jobs:
release-landing-page:
name: Release landing-page frontend
if: github.repository == 'home-assistant/frontend' && github.event.release.prerelease == false
if: github.event.release.prerelease == false
runs-on: ubuntu-latest
permissions:
contents: write # Required to upload release assets
steps:
- name: Checkout the repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Node and install
uses: ./.github/actions/setup
- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
immutable: false
cache: false
node-version-file: ".nvmrc"
- name: Install dependencies
run: yarn install
- name: Download Translations
run: ./script/translations_download
env:
LOKALISE_TOKEN: ${{ secrets.LOKALISE_TOKEN }}
# The landing-page build does not merge backend translations.
SKIP_BACKEND_TRANSLATIONS: "1"
- name: Build landing-page
run: landing-page/script/build_landing_page
- name: Tar folder
@@ -1,56 +0,0 @@
name: Restrict task creation
# yamllint disable-line rule:truthy
on:
issues:
types: [opened]
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number }}
jobs:
add-no-stale:
name: Add no-stale label
runs-on: ubuntu-latest
permissions:
issues: write # To add labels to issues
if: >-
github.event.issue.type.name == 'Task'
|| github.event.issue.type.name == 'Epic'
|| github.event.issue.type.name == 'Opportunity'
steps:
- name: Add no-stale label
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['no-stale']
});
check-authorization:
name: Check authorization
runs-on: ubuntu-latest
permissions:
contents: read # To check out workflow scripts
issues: write # To comment on, label, and close issues
# Only run if this is a Task issue type (from the issue form)
if: github.event.issue.type.name == 'Task'
steps:
- name: Check out workflow scripts
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
sparse-checkout: .github/scripts
- name: Check if user is authorized
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const { default: checkTaskAuthorization } = await import(
`${process.env.GITHUB_WORKSPACE}/.github/scripts/check-task-authorization.mjs`
);
await checkTaskAuthorization({ github, context, core });
@@ -0,0 +1,87 @@
name: Restrict task creation
# yamllint disable-line rule:truthy
on:
issues:
types: [opened]
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number }}
jobs:
add-no-stale:
name: Add no-stale label
runs-on: ubuntu-latest
permissions:
issues: write # To add labels to issues
if: >-
github.event.issue.type.name == 'Task'
|| github.event.issue.type.name == 'Epic'
|| github.event.issue.type.name == 'Opportunity'
steps:
- name: Add no-stale label
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['no-stale']
});
check-authorization:
name: Check authorization
runs-on: ubuntu-latest
permissions:
issues: write # To comment on, label, and close issues
# Only run if this is a Task issue type (from the issue form)
if: github.event.issue.type.name == 'Task'
steps:
- name: Check if user is authorized
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const issueAuthor = context.payload.issue.user.login;
// Check if user is an organization member
try {
await github.rest.orgs.checkMembershipForUser({
org: 'home-assistant',
username: issueAuthor
});
console.log(`✅ ${issueAuthor} is an organization member`);
return; // Authorized
} catch (error) {
console.log(`❌ ${issueAuthor} is not authorized to create Task issues`);
}
// Close the issue with a comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: `Hi @${issueAuthor}, thank you for your contribution!\n\n` +
`Task issues are restricted to Open Home Foundation staff and authorized contributors.\n\n` +
`If you would like to:\n` +
`- Report a bug: Please use the [bug report form](https://github.com/home-assistant/frontend/issues/new?template=bug_report.yml)\n` +
`- Request a feature: Please submit to [Feature Requests](https://github.com/orgs/home-assistant/discussions)\n\n` +
`If you believe you should have access to create Task issues, please contact the maintainers.`
});
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
state: 'closed'
});
// Add a label to indicate this was auto-closed
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['auto-closed']
});
@@ -12,11 +12,10 @@ permissions:
jobs:
stale:
if: github.repository == 'home-assistant/frontend'
runs-on: ubuntu-latest
steps:
- name: 90 days stale policy
uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v11.0.0
uses: actions/stale@eb5cf3af3ac0a1aa4c9c45633dd1ae542a27a899 # v10.3.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 90
@@ -1,48 +0,0 @@
name: Sync device class constants
# Mirrors the device class constants for Home Assistant Core's into the
# build-time default in src/data/device_classes.ts and opens a PR
# when it drifts. Reads homeassistant/generated/device_classes.json from core.
on:
workflow_dispatch:
schedule:
- cron: "0 4 * * *" # Daily, 04:00 UTC
permissions:
contents: read
jobs:
sync:
if: github.repository == 'home-assistant/frontend'
name: Sync
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout the repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Node and install
uses: ./.github/actions/setup
- name: Regenerate device class constants
run: ./script/gen_device_classes
- name: Format
run: pnpm exec prettier --write src/data/device_classes.ts
- name: Create pull request
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
branch: chore/sync-device-classes
commit-message: Update device class constants
title: Update device class constants
body: |
Regenerated `DOMAIN_DEVICE_CLASSES` from Home Assistant Core's
`homeassistant/generated/device_classes.json`.
Automated by `.github/workflows/sync-device-classes.yaml`.
@@ -1,49 +0,0 @@
name: Sync sensor entity constants
# Mirrors Home Assistant Core's numeric `SensorDeviceClass`, `SensorStateClass`,
# units and related device and state classes arrays into the
# build-time default in src/data/sensor_entity_constants.ts and opens a PR
# when it drifts. Reads homeassistant/generated/sensor.json from core.
on:
workflow_dispatch:
schedule:
- cron: "0 4 * * *" # Daily, 04:00 UTC
permissions:
contents: read
jobs:
sync:
if: github.repository == 'home-assistant/frontend'
name: Sync
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout the repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup Node and install
uses: ./.github/actions/setup
- name: Regenerate sensor entity constants
run: ./script/gen_sensor_entity_constants
- name: Format
run: pnpm exec prettier --write src/data/sensor_entity_constants.ts
- name: Create pull request
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
branch: chore/sync-sensor-entity-constants
commit-message: Update sensor entity constants
title: Update sensor entity constants
body: |
Regenerated the sensor entity constants from Home Assistant Core's
`homeassistant/generated/sensor.json`.
Automated by `.github/workflows/sync-sensor-entity-constants.yaml`.
+4 -6
View File
@@ -6,7 +6,6 @@ on:
branches:
- dev
paths:
- .github/workflows/translations.yaml
- src/translations/en.json
permissions:
@@ -15,15 +14,14 @@ permissions:
jobs:
upload:
name: Upload
if: github.repository == 'home-assistant/frontend'
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Upload Translations
run: ./script/translations_upload_base
env:
LOKALISE_TOKEN: ${{ secrets.LOKALISE_TOKEN }}
run: |
export LOKALISE_TOKEN="${{ secrets.LOKALISE_TOKEN }}"
./script/translations_upload_base
+10 -19
View File
@@ -6,13 +6,17 @@ build/
dist/
/hass_frontend/
/translations/
/.compress-cache/
/.rspack-cache/
# Composite action source, not build output
!/.github/actions/build/
# Node
# yarn
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
node_modules/
yarn-error.log
npm-debug.log
# Python stuff
@@ -50,20 +54,7 @@ src/cast/dev_const.ts
# test coverage
test/coverage/
# Playwright e2e output
test/e2e/reports/
test/e2e/test-results/
# E2E test app build output
test/e2e/app/dist/
# MCP server
.playwright-mcp/
# AI tooling
.claude/*
!.claude/skills
.claude
.cursor
.opencode
.serena
test/benchmarks/results/
+1 -1
View File
@@ -1 +1 @@
pnpm exec lint-staged --relative
yarn run lint-staged --relative
+1 -1
View File
@@ -1 +1 @@
24.21.0
24.16.0
+1 -3
View File
@@ -1,6 +1,4 @@
CLA.md
CODE_OF_CONDUCT.md
LICENSE.md
PULL_REQUEST_TEMPLATE.md
public/static/map/sprites/*.json
pnpm-lock.yaml
PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,13 @@
diff --git a/dist/leaflet.draw.js b/dist/leaflet.draw.js
index 71aeb33b49192dac65f869795716fc3e34969b7e..9be93575809b224c3100fbb9cca72de4bce3faf4 100644
--- a/dist/leaflet.draw.js
+++ b/dist/leaflet.draw.js
@@ -5,6 +5,7 @@
https://github.com/Leaflet/Leaflet.draw
http://leafletjs.com
*/
+var radius;
!function(t,e,i){function o(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t}L.drawVersion="1.0.4",L.Draw={},L.drawLocal={draw:{toolbar:{actions:{title:"Cancel drawing",text:"Cancel"},finish:{title:"Finish drawing",text:"Finish"},undo:{title:"Delete last point drawn",text:"Delete last point"},buttons:{polyline:"Draw a polyline",polygon:"Draw a polygon",rectangle:"Draw a rectangle",circle:"Draw a circle",marker:"Draw a marker",circlemarker:"Draw a circlemarker"}},handlers:{circle:{tooltip:{start:"Click and drag to draw circle."},radius:"Radius"},circlemarker:{tooltip:{start:"Click map to place circle marker."}},marker:{tooltip:{start:"Click map to place marker."}},polygon:{tooltip:{start:"Click to start drawing shape.",cont:"Click to continue drawing shape.",end:"Click first point to close this shape."}},polyline:{error:"<strong>Error:</strong> shape edges cannot cross!",tooltip:{start:"Click to start drawing line.",cont:"Click to continue drawing line.",end:"Click last point to finish line."}},rectangle:{tooltip:{start:"Click and drag to draw rectangle."}},simpleshape:{tooltip:{end:"Release mouse to finish drawing."}}}},edit:{toolbar:{actions:{save:{title:"Save changes",text:"Save"},cancel:{title:"Cancel editing, discards all changes",text:"Cancel"},clearAll:{title:"Clear all layers",text:"Clear All"}},buttons:{edit:"Edit layers",editDisabled:"No layers to edit",remove:"Delete layers",removeDisabled:"No layers to delete"}},handlers:{edit:{tooltip:{text:"Drag handles or markers to edit features.",subtext:"Click cancel to undo changes."}},remove:{tooltip:{text:"Click on a feature to remove."}}}}},L.Draw.Event={},L.Draw.Event.CREATED="draw:created",L.Draw.Event.EDITED="draw:edited",L.Draw.Event.DELETED="draw:deleted",L.Draw.Event.DRAWSTART="draw:drawstart",L.Draw.Event.DRAWSTOP="draw:drawstop",L.Draw.Event.DRAWVERTEX="draw:drawvertex",L.Draw.Event.EDITSTART="draw:editstart",L.Draw.Event.EDITMOVE="draw:editmove",L.Draw.Event.EDITRESIZE="draw:editresize",L.Draw.Event.EDITVERTEX="draw:editvertex",L.Draw.Event.EDITSTOP="draw:editstop",L.Draw.Event.DELETESTART="draw:deletestart",L.Draw.Event.DELETESTOP="draw:deletestop",L.Draw.Event.TOOLBAROPENED="draw:toolbaropened",L.Draw.Event.TOOLBARCLOSED="draw:toolbarclosed",L.Draw.Event.MARKERCONTEXT="draw:markercontext",L.Draw=L.Draw||{},L.Draw.Feature=L.Handler.extend({initialize:function(t,e){this._map=t,this._container=t._container,this._overlayPane=t._panes.overlayPane,this._popupPane=t._panes.popupPane,e&&e.shapeOptions&&(e.shapeOptions=L.Util.extend({},this.options.shapeOptions,e.shapeOptions)),L.setOptions(this,e);var i=L.version.split(".");1===parseInt(i[0],10)&&parseInt(i[1],10)>=2?L.Draw.Feature.include(L.Evented.prototype):L.Draw.Feature.include(L.Mixin.Events)},enable:function(){this._enabled||(L.Handler.prototype.enable.call(this),this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DRAWSTART,{layerType:this.type}))},disable:function(){this._enabled&&(L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DRAWSTOP,{layerType:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(L.DomUtil.disableTextSelection(),t.getContainer().focus(),this._tooltip=new L.Draw.Tooltip(this._map),L.DomEvent.on(this._container,"keyup",this._cancelDrawing,this))},removeHooks:function(){this._map&&(L.DomUtil.enableTextSelection(),this._tooltip.dispose(),this._tooltip=null,L.DomEvent.off(this._container,"keyup",this._cancelDrawing,this))},setOptions:function(t){L.setOptions(this,t)},_fireCreatedEvent:function(t){this._map.fire(L.Draw.Event.CREATED,{layer:t,layerType:this.type})},_cancelDrawing:function(t){27===t.keyCode&&(this._map.fire("draw:canceled",{layerType:this.type}),this.disable())}}),L.Draw.Polyline=L.Draw.Feature.extend({statics:{TYPE:"polyline"},Poly:L.Polyline,options:{allowIntersection:!0,repeatMode:!1,drawError:{color:"#b00b00",timeout:2500},icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,nautic:!1,showLength:!0,zIndexOffset:2e3,factor:1,maxPoints:0},initialize:function(t,e){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this.options.drawError.message=L.drawLocal.draw.handlers.polyline.error,e&&e.drawError&&(e.drawError=L.Util.extend({},this.options.drawError,e.drawError)),this.type=L.Draw.Polyline.TYPE,L.Draw.Feature.prototype.initialize.call(this,t,e)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._markers=[],this._markerGroup=new L.LayerGroup,this._map.addLayer(this._markerGroup),this._poly=new L.Polyline([],this.options.shapeOptions),this._tooltip.updateContent(this._getTooltipText()),this._mouseMarker||(this._mouseM Line truncated
className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize"}),touchMoveIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move leaflet-touch-icon"}),touchResizeIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize leaflet-touch-icon"})},initialize:function(t,e){L.Browser.touch&&(this.options.moveIcon=this.options.touchMoveIcon,this.options.resizeIcon=this.options.touchResizeIcon),this._shape=t,L.Util.setOptions(this,e)},addHooks:function(){var t=this._shape;this._shape._map&&(this._map=this._shape._map,t.setStyle(t.options.editing),t._map&&(this._map=t._map,this._markerGroup||this._initMarkers(),this._map.addLayer(this._markerGroup)))},removeHooks:function(){var t=this._shape;if(t.setStyle(t.options.original),t._map){this._unbindMarker(this._moveMarker);for(var e=0,i=this._resizeMarkers.length;e<i;e++)this._unbindMarker(this._resizeMarkers[e]);this._resizeMarkers=null,this._map.removeLayer(this._markerGroup),delete this._markerGroup}this._map=null},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._createMoveMarker(),this._createResizeMarker()},_createMoveMarker:function(){},_createResizeMarker:function(){},_createMarker:function(t,e){var i=new L.Marker.Touch(t,{draggable:!0,icon:e,zIndexOffset:10});return this._bindMarker(i),this._markerGroup.addLayer(i),i},_bindMarker:function(t){t.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._onMarkerDragEnd,this).on("touchstart",this._onTouchStart,this).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onTouchEnd,this).on("MSPointerUp",this._onTouchEnd,this)},_unbindMarker:function(t){t.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._onMarkerDragEnd,this).off("touchstart",this._onTouchStart,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onTouchEnd,this).off("MSPointerUp",this._onTouchEnd,this)},_onMarkerDragStart:function(t){t.target.setOpacity(0),this._shape.fire("editstart")},_fireEdit:function(){this._shape.edited=!0,this._shape.fire("edit")},_onMarkerDrag:function(t){var e=t.target,i=e.getLatLng();e===this._moveMarker?this._move(i):this._resize(i),this._shape.redraw(),this._shape.fire("editdrag")},_onMarkerDragEnd:function(t){t.target.setOpacity(1),this._fireEdit()},_onTouchStart:function(t){if(L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,t),"function"==typeof this._getCorners){var e=this._getCorners(),i=t.target,o=i._cornerIndex;i.setOpacity(0),this._oppositeCorner=e[(o+2)%4],this._toggleCornerMarkers(0,o)}this._shape.fire("editstart")},_onTouchMove:function(t){var e=this._map.mouseEventToLayerPoint(t.originalEvent.touches[0]),i=this._map.layerPointToLatLng(e);return t.target===this._moveMarker?this._move(i):this._resize(i),this._shape.redraw(),!1},_onTouchEnd:function(t){t.target.setOpacity(1),this.updateMarkers(),this._fireEdit()},_move:function(){},_resize:function(){}}),L.Edit=L.Edit||{},L.Edit.Rectangle=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var t=this._shape.getBounds(),e=t.getCenter();this._moveMarker=this._createMarker(e,this.options.moveIcon)},_createResizeMarker:function(){var t=this._getCorners();this._resizeMarkers=[];for(var e=0,i=t.length;e<i;e++)this._resizeMarkers.push(this._createMarker(t[e],this.options.resizeIcon)),this._resizeMarkers[e]._cornerIndex=e},_onMarkerDragStart:function(t){L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,t);var e=this._getCorners(),i=t.target,o=i._cornerIndex;this._oppositeCorner=e[(o+2)%4],this._toggleCornerMarkers(0,o)},_onMarkerDragEnd:function(t){var e,i,o=t.target;o===this._moveMarker&&(e=this._shape.getBounds(),i=e.getCenter(),o.setLatLng(i)),this._toggleCornerMarkers(1),this._repositionCornerMarkers(),L.Edit.SimpleShape.prototype._onMarkerDragEnd.call(this,t)},_move:function(t){for(var e,i=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),o=this._shape.getBounds(),a=o.getCenter(),n=[],s=0,r=i.length;s<r;s++)e=[i[s].lat-a.lat,i[s].lng-a.lng],n.push([t.lat+e[0],t.lng+e[1]]);this._shape.setLatLngs(n),this._repositionCornerMarkers(),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})},_resize:function(t){var e;this._shape.setBounds(L.latLngBounds(t,this._oppositeCorner)),e=this._shape.getBounds(),this._moveMarker.setLatLng(e.getCenter()),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})},_getCorners:function(){var t=this._shape.getBounds();return[t.getNorthWest(),t.getNorthEast(),t.getSouthEast(),t.getSouthWest()]},_toggleCornerMarkers:function(t){for(var e=0,i=this._resizeMarkers.length;e<i;e++)this._resizeMarkers[e].setOpacity(t)},_repositionCornerMarkers:function(){for( Line truncated
this._selectedPathOptions&&(e instanceof L.Marker?this._toggleMarkerHighlight(e):(e.setStyle(e.options.previousOptions),delete e.options.previousOptions)),e instanceof L.Marker?(e.dragging.disable(),e.off("dragend",this._onMarkerDragEnd,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onMarkerDragEnd,this).off("MSPointerUp",this._onMarkerDragEnd,this)):e.editing.disable()},_onMouseMove:function(t){this._tooltip.updatePosition(t.latlng)},_onMarkerDragEnd:function(t){var e=t.target;e.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:e})},_onTouchMove:function(t){var e=t.originalEvent.changedTouches[0],i=this._map.mouseEventToLayerPoint(e),o=this._map.layerPointToLatLng(i);t.target.setLatLng(o)},_hasAvailableLayers:function(){return 0!==this._featureGroup.getLayers().length}}),L.EditToolbar.Delete=L.Handler.extend({statics:{TYPE:"remove"},initialize:function(t,e){if(L.Handler.prototype.initialize.call(this,t),L.Util.setOptions(this,e),this._deletableLayers=this.options.featureGroup,!(this._deletableLayers instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this.type=L.EditToolbar.Delete.TYPE;var i=L.version.split(".");1===parseInt(i[0],10)&&parseInt(i[1],10)>=2?L.EditToolbar.Delete.include(L.Evented.prototype):L.EditToolbar.Delete.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DELETESTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._deletableLayers.on("layeradd",this._enableLayerDelete,this).on("layerremove",this._disableLayerDelete,this))},disable:function(){this._enabled&&(this._deletableLayers.off("layeradd",this._enableLayerDelete,this).off("layerremove",this._disableLayerDelete,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DELETESTOP,{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var t=this._map;t&&(t.getContainer().focus(),this._deletableLayers.eachLayer(this._enableLayerDelete,this),this._deletedLayers=new L.LayerGroup,this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.remove.tooltip.text}),this._map.on("mousemove",this._onMouseMove,this))},removeHooks:function(){this._map&&(this._deletableLayers.eachLayer(this._disableLayerDelete,this),this._deletedLayers=null,this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this))},revertLayers:function(){this._deletedLayers.eachLayer(function(t){this._deletableLayers.addLayer(t),t.fire("revert-deleted",{layer:t})},this)},save:function(){this._map.fire(L.Draw.Event.DELETED,{layers:this._deletedLayers})},removeAllLayers:function(){this._deletableLayers.eachLayer(function(t){this._removeLayer({layer:t})},this),this.save()},_enableLayerDelete:function(t){(t.layer||t.target||t).on("click",this._removeLayer,this)},_disableLayerDelete:function(t){var e=t.layer||t.target||t;e.off("click",this._removeLayer,this),this._deletedLayers.removeLayer(e)},_removeLayer:function(t){var e=t.layer||t.target||t;this._deletableLayers.removeLayer(e),this._deletedLayers.addLayer(e),e.fire("deleted")},_onMouseMove:function(t){this._tooltip.updatePosition(t.latlng)},_hasAvailableLayers:function(){return 0!==this._deletableLayers.getLayers().length}})}(window,document);
\ No newline at end of file
File renamed without changes.
+944
View File
@@ -0,0 +1,944 @@
#!/usr/bin/env node
/* eslint-disable */
//prettier-ignore
(()=>{var Cje=Object.create;var sU=Object.defineProperty;var wje=Object.getOwnPropertyDescriptor;var Bje=Object.getOwnPropertyNames;var vje=Object.getPrototypeOf,Sje=Object.prototype.hasOwnProperty;var Ie=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Xe=(e,t)=>()=>(e&&(t=e(e=0)),t);var G=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Vt=(e,t)=>{for(var r in t)sU(e,r,{get:t[r],enumerable:!0})},bje=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Bje(t))!Sje.call(e,a)&&a!==r&&sU(e,a,{get:()=>t[a],enumerable:!(s=wje(t,a))||s.enumerable});return e};var et=(e,t,r)=>(r=e!=null?Cje(vje(e)):{},bje(t||!e||!e.__esModule?sU(r,"default",{value:e,enumerable:!0}):r,e));var pi={};Vt(pi,{SAFE_TIME:()=>gZ,S_IFDIR:()=>ZP,S_IFLNK:()=>$P,S_IFMT:()=>Hf,S_IFREG:()=>R2});var Hf,ZP,R2,$P,gZ,mZ=Xe(()=>{Hf=61440,ZP=16384,R2=32768,$P=40960,gZ=456789e3});var or={};Vt(or,{EBADF:()=>Yo,EBUSY:()=>Dje,EEXIST:()=>Tje,EINVAL:()=>xje,EISDIR:()=>Rje,ENOENT:()=>kje,ENOSYS:()=>Pje,ENOTDIR:()=>Qje,ENOTEMPTY:()=>Nje,EOPNOTSUPP:()=>Oje,EROFS:()=>Fje,ERR_DIR_CLOSED:()=>oU});function vc(e,t){return Object.assign(new Error(`${e}: ${t}`),{code:e})}function Dje(e){return vc("EBUSY",e)}function Pje(e,t){return vc("ENOSYS",`${e}, ${t}`)}function xje(e){return vc("EINVAL",`invalid argument, ${e}`)}function Yo(e){return vc("EBADF",`bad file descriptor, ${e}`)}function kje(e){return vc("ENOENT",`no such file or directory, ${e}`)}function Qje(e){return vc("ENOTDIR",`not a directory, ${e}`)}function Rje(e){return vc("EISDIR",`illegal operation on a directory, ${e}`)}function Tje(e){return vc("EEXIST",`file already exists, ${e}`)}function Fje(e){return vc("EROFS",`read-only filesystem, ${e}`)}function Nje(e){return vc("ENOTEMPTY",`directory not empty, ${e}`)}function Oje(e){return vc("EOPNOTSUPP",`operation not supported, ${e}`)}function oU(){return vc("ERR_DIR_CLOSED","Directory handle was closed")}var ex=Xe(()=>{});var ll={};Vt(ll,{BigIntStatsEntry:()=>uE,DEFAULT_MODE:()=>cU,DirEntry:()=>aU,StatEntry:()=>cE,areStatsEqual:()=>uU,clearStats:()=>tx,convertToBigIntStats:()=>Mje,makeDefaultStats:()=>yZ,makeEmptyStats:()=>Lje});function yZ(){return new cE}function Lje(){return tx(yZ())}function tx(e){for(let t in e)if(Object.hasOwn(e,t)){let r=e[t];typeof r=="number"?e[t]=0:typeof r=="bigint"?e[t]=BigInt(0):lU.types.isDate(r)&&(e[t]=new Date(0))}return e}function Mje(e){let t=new uE;for(let r in e)if(Object.hasOwn(e,r)){let s=e[r];typeof s=="number"?t[r]=BigInt(Math.floor(s)):lU.types.isDate(s)&&(t[r]=new Date(s))}return t.atimeNs=t.atimeMs*BigInt(1e6)+BigInt(Math.floor(e.atimeMs%1*1e3))*BigInt(1e3),t.mtimeNs=t.mtimeMs*BigInt(1e6)+BigInt(Math.floor(e.mtimeMs%1*1e3))*BigInt(1e3),t.ctimeNs=t.ctimeMs*BigInt(1e6)+BigInt(Math.floor(e.ctimeMs%1*1e3))*BigInt(1e3),t.birthtimeNs=t.birthtimeMs*BigInt(1e6)+BigInt(Math.floor(e.birthtimeMs%1*1e3))*BigInt(1e3),t}function uU(e,t){if(e.atimeMs!==t.atimeMs||e.birthtimeMs!==t.birthtimeMs||e.blksize!==t.blksize||e.blocks!==t.blocks||e.ctimeMs!==t.ctimeMs||e.dev!==t.dev||e.gid!==t.gid||e.ino!==t.ino||e.isBlockDevice()!==t.isBlockDevice()||e.isCharacterDevice()!==t.isCharacterDevice()||e.isDirectory()!==t.isDirectory()||e.isFIFO()!==t.isFIFO()||e.isFile()!==t.isFile()||e.isSocket()!==t.isSocket()||e.isSymbolicLink()!==t.isSymbolicLink()||e.mode!==t.mode||e.mtimeMs!==t.mtimeMs||e.nlink!==t.nlink||e.rdev!==t.rdev||e.size!==t.size||e.uid!==t.uid)return!1;let r=e,s=t;return!(r.atimeNs!==s.atimeNs||r.mtimeNs!==s.mtimeNs||r.ctimeNs!==s.ctimeNs||r.birthtimeNs!==s.birthtimeNs)}var lU,cU,aU,cE,uE,fU=Xe(()=>{lU=et(Ie("util")),cU=33188,aU=class{constructor(){this.name="";this.path="";this.mode=0}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&61440)===16384}isFIFO(){return!1}isFile(){return(this.mode&61440)===32768}isSocket(){return!1}isSymbolicLink(){return(this.mode&61440)===40960}},cE=class{constructor(){this.uid=0;this.gid=0;this.size=0;this.blksize=0;this.atimeMs=0;this.mtimeMs=0;this.ctimeMs=0;this.birthtimeMs=0;this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birthtime=new Date(0);this.dev=0;this.ino=0;this.mode=cU;this.nlink=1;this.rdev=0;this.blocks=1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&61440)===16384}isFIFO(){return!1}isFile(){return(this.mode&61440)===32768}isSocket(){return!1}isSymbolicLink(){return(this.mode&61440)===40960}},uE=class{constructor(){this.uid=BigInt(0);this.gid=BigInt(0);this.size=BigInt(0);this.blksize=BigInt(0);this.atimeMs=BigInt(0);this.mtimeMs=BigInt(0);this.ctimeMs=BigInt(0);this.birthtimeMs=BigInt(0);this.atimeNs=BigInt(0);this.mtimeNs=BigInt(0);this.ctimeNs=BigInt(0);this.birthtimeNs=BigInt(0);this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birthtLine truncated
`).length,s=t.length-r;return r>s?`\r
`:`
`}function Ig(e,t){return t.replace(/\r?\n/g,Xje(e))}var DZ,PZ,Ip,jf,Cg=Xe(()=>{DZ=Ie("crypto"),PZ=Ie("os");hU();cl();Ip=class{constructor(t){this.pathUtils=t}async*genTraversePromise(t,{stableSort:r=!1}={}){let s=[t];for(;s.length>0;){let a=s.shift();if((await this.lstatPromise(a)).isDirectory()){let c=await this.readdirPromise(a);if(r)for(let f of c.sort())s.push(this.pathUtils.join(a,f));else throw new Error("Not supported")}else yield a}}async checksumFilePromise(t,{algorithm:r="sha512"}={}){let s=await this.openPromise(t,"r");try{let n=Buffer.allocUnsafeSlow(65536),c=(0,DZ.createHash)(r),f=0;for(;(f=await this.readPromise(s,n,0,65536))!==0;)c.update(f===65536?n:n.slice(0,f));return c.digest("hex")}finally{await this.closePromise(s)}}async removePromise(t,{recursive:r=!0,maxRetries:s=5}={}){let a;try{a=await this.lstatPromise(t)}catch(n){if(n.code==="ENOENT")return;throw n}if(a.isDirectory()){if(r){let n=await this.readdirPromise(t);await Promise.all(n.map(c=>this.removePromise(this.pathUtils.resolve(t,c))))}for(let n=0;n<=s;n++)try{await this.rmdirPromise(t);break}catch(c){if(c.code!=="EBUSY"&&c.code!=="ENOTEMPTY")throw c;n<s&&await new Promise(f=>setTimeout(f,n*100))}}else await this.unlinkPromise(t)}removeSync(t,{recursive:r=!0}={}){let s;try{s=this.lstatSync(t)}catch(a){if(a.code==="ENOENT")return;throw a}if(s.isDirectory()){if(r)for(let a of this.readdirSync(t))this.removeSync(this.pathUtils.resolve(t,a));this.rmdirSync(t)}else this.unlinkSync(t)}async mkdirpPromise(t,{chmod:r,utimes:s}={}){if(t=this.resolve(t),t===this.pathUtils.dirname(t))return;let a=t.split(this.pathUtils.sep),n;for(let c=2;c<=a.length;++c){let f=a.slice(0,c).join(this.pathUtils.sep);if(!this.existsSync(f)){try{await this.mkdirPromise(f)}catch(p){if(p.code==="EEXIST")continue;throw p}if(n??=f,r!=null&&await this.chmodPromise(f,r),s!=null)await this.utimesPromise(f,s[0],s[1]);else{let p=await this.statPromise(this.pathUtils.dirname(f));await this.utimesPromise(f,p.atime,p.mtime)}}}return n}mkdirpSync(t,{chmod:r,utimes:s}={}){if(t=this.resolve(t),t===this.pathUtils.dirname(t))return;let a=t.split(this.pathUtils.sep),n;for(let c=2;c<=a.length;++c){let f=a.slice(0,c).join(this.pathUtils.sep);if(!this.existsSync(f)){try{this.mkdirSync(f)}catch(p){if(p.code==="EEXIST")continue;throw p}if(n??=f,r!=null&&this.chmodSync(f,r),s!=null)this.utimesSync(f,s[0],s[1]);else{let p=this.statSync(this.pathUtils.dirname(f));this.utimesSync(f,p.atime,p.mtime)}}}return n}async copyPromise(t,r,{baseFs:s=this,overwrite:a=!0,stableSort:n=!1,stableTime:c=!1,linkStrategy:f=null}={}){return await CZ(this,t,s,r,{overwrite:a,stableSort:n,stableTime:c,linkStrategy:f})}copySync(t,r,{baseFs:s=this,overwrite:a=!0}={}){let n=s.lstatSync(r),c=this.existsSync(t);if(n.isDirectory()){this.mkdirpSync(t);let p=s.readdirSync(r);for(let h of p)this.copySync(this.pathUtils.join(t,h),s.pathUtils.join(r,h),{baseFs:s,overwrite:a})}else if(n.isFile()){if(!c||a){c&&this.removeSync(t);let p=s.readFileSync(r);this.writeFileSync(t,p)}}else if(n.isSymbolicLink()){if(!c||a){c&&this.removeSync(t);let p=s.readlinkSync(r);this.symlinkSync(rx(this.pathUtils,p),t)}}else throw new Error(`Unsupported file type (file: ${r}, mode: 0o${n.mode.toString(8).padStart(6,"0")})`);let f=n.mode&511;this.chmodSync(t,f)}async changeFilePromise(t,r,s={}){return Buffer.isBuffer(r)?this.changeFileBufferPromise(t,r,s):this.changeFileTextPromise(t,r,s)}async changeFileBufferPromise(t,r,{mode:s}={}){let a=Buffer.alloc(0);try{a=await this.readFilePromise(t)}catch{}Buffer.compare(a,r)!==0&&await this.writeFilePromise(t,r,{mode:s})}async changeFileTextPromise(t,r,{automaticNewlines:s,mode:a}={}){let n="";try{n=await this.readFilePromise(t,"utf8")}catch{}let c=s?Ig(n,r):r;n!==c&&await this.writeFilePromise(t,c,{mode:a})}changeFileSync(t,r,s={}){return Buffer.isBuffer(r)?this.changeFileBufferSync(t,r,s):this.changeFileTextSync(t,r,s)}changeFileBufferSync(t,r,{mode:s}={}){let a=Buffer.alloc(0);try{a=this.readFileSync(t)}catch{}Buffer.compare(a,r)!==0&&this.writeFileSync(t,r,{mode:s})}changeFileTextSync(t,r,{automaticNewlines:s=!1,mode:a}={}){let n="";try{n=this.readFileSync(t,"utf8")}catch{}let c=s?Ig(n,r):r;n!==c&&this.writeFileSync(t,c,{mode:a})}async movePromise(t,r){try{await this.renamePromise(t,r)}catch(s){if(s.code==="EXDEV")await this.copyPromise(r,t),await this.removePromise(t);else throw s}}moveSync(t,r){try{this.renameSync(t,r)}catch(s){if(s.code==="EXDEV")this.copySync(r,t),this.removeSync(t);else throw s}}async lockPromise(t,r){let s=`${t}.flock`,a=1e3/60,n=Date.now(),c=null,f=async()=>{let p;try{[p]=await this.readJsonPromise(s)}catch{return Date.now()-n<500}try{return process.kill(p,0),!0}catch{return!1}};for(;c===null;)try{c=await this.openPromise(s,"wx")}catch(p){if(p.code==="EEXIST"){if(!await f())try{await this.unlinkPromise(s);continue}catch{}if(Date.now()-n<60*1e3)await new Promise(h=>setTimeout(h,a));else throw new Error(`Couldn't acquire a lock in a reasonable time (via ${s})`)}else throw Line truncated
`)}writeJsonSync(t,r,{compact:s=!1}={}){let a=s?0:2;return this.writeFileSync(t,`${JSON.stringify(r,null,a)}
`)}async preserveTimePromise(t,r){let s=await this.lstatPromise(t),a=await r();typeof a<"u"&&(t=a),await this.lutimesPromise(t,s.atime,s.mtime)}async preserveTimeSync(t,r){let s=this.lstatSync(t),a=r();typeof a<"u"&&(t=a),this.lutimesSync(t,s.atime,s.mtime)}},jf=class extends Ip{constructor(){super(K)}}});var Gs,Cp=Xe(()=>{Cg();Gs=class extends Ip{getExtractHint(t){return this.baseFs.getExtractHint(t)}resolve(t){return this.mapFromBase(this.baseFs.resolve(this.mapToBase(t)))}getRealPath(){return this.mapFromBase(this.baseFs.getRealPath())}async openPromise(t,r,s){return this.baseFs.openPromise(this.mapToBase(t),r,s)}openSync(t,r,s){return this.baseFs.openSync(this.mapToBase(t),r,s)}async opendirPromise(t,r){return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(t),r),{path:t})}opendirSync(t,r){return Object.assign(this.baseFs.opendirSync(this.mapToBase(t),r),{path:t})}async readPromise(t,r,s,a,n){return await this.baseFs.readPromise(t,r,s,a,n)}readSync(t,r,s,a,n){return this.baseFs.readSync(t,r,s,a,n)}async writePromise(t,r,s,a,n){return typeof r=="string"?await this.baseFs.writePromise(t,r,s):await this.baseFs.writePromise(t,r,s,a,n)}writeSync(t,r,s,a,n){return typeof r=="string"?this.baseFs.writeSync(t,r,s):this.baseFs.writeSync(t,r,s,a,n)}async closePromise(t){return this.baseFs.closePromise(t)}closeSync(t){this.baseFs.closeSync(t)}createReadStream(t,r){return this.baseFs.createReadStream(t!==null?this.mapToBase(t):t,r)}createWriteStream(t,r){return this.baseFs.createWriteStream(t!==null?this.mapToBase(t):t,r)}async realpathPromise(t){return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(t)))}realpathSync(t){return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(t)))}async existsPromise(t){return this.baseFs.existsPromise(this.mapToBase(t))}existsSync(t){return this.baseFs.existsSync(this.mapToBase(t))}accessSync(t,r){return this.baseFs.accessSync(this.mapToBase(t),r)}async accessPromise(t,r){return this.baseFs.accessPromise(this.mapToBase(t),r)}async statPromise(t,r){return this.baseFs.statPromise(this.mapToBase(t),r)}statSync(t,r){return this.baseFs.statSync(this.mapToBase(t),r)}async fstatPromise(t,r){return this.baseFs.fstatPromise(t,r)}fstatSync(t,r){return this.baseFs.fstatSync(t,r)}lstatPromise(t,r){return this.baseFs.lstatPromise(this.mapToBase(t),r)}lstatSync(t,r){return this.baseFs.lstatSync(this.mapToBase(t),r)}async fchmodPromise(t,r){return this.baseFs.fchmodPromise(t,r)}fchmodSync(t,r){return this.baseFs.fchmodSync(t,r)}async chmodPromise(t,r){return this.baseFs.chmodPromise(this.mapToBase(t),r)}chmodSync(t,r){return this.baseFs.chmodSync(this.mapToBase(t),r)}async fchownPromise(t,r,s){return this.baseFs.fchownPromise(t,r,s)}fchownSync(t,r,s){return this.baseFs.fchownSync(t,r,s)}async chownPromise(t,r,s){return this.baseFs.chownPromise(this.mapToBase(t),r,s)}chownSync(t,r,s){return this.baseFs.chownSync(this.mapToBase(t),r,s)}async renamePromise(t,r){return this.baseFs.renamePromise(this.mapToBase(t),this.mapToBase(r))}renameSync(t,r){return this.baseFs.renameSync(this.mapToBase(t),this.mapToBase(r))}async copyFilePromise(t,r,s=0){return this.baseFs.copyFilePromise(this.mapToBase(t),this.mapToBase(r),s)}copyFileSync(t,r,s=0){return this.baseFs.copyFileSync(this.mapToBase(t),this.mapToBase(r),s)}async appendFilePromise(t,r,s){return this.baseFs.appendFilePromise(this.fsMapToBase(t),r,s)}appendFileSync(t,r,s){return this.baseFs.appendFileSync(this.fsMapToBase(t),r,s)}async writeFilePromise(t,r,s){return this.baseFs.writeFilePromise(this.fsMapToBase(t),r,s)}writeFileSync(t,r,s){return this.baseFs.writeFileSync(this.fsMapToBase(t),r,s)}async unlinkPromise(t){return this.baseFs.unlinkPromise(this.mapToBase(t))}unlinkSync(t){return this.baseFs.unlinkSync(this.mapToBase(t))}async utimesPromise(t,r,s){return this.baseFs.utimesPromise(this.mapToBase(t),r,s)}utimesSync(t,r,s){return this.baseFs.utimesSync(this.mapToBase(t),r,s)}async lutimesPromise(t,r,s){return this.baseFs.lutimesPromise(this.mapToBase(t),r,s)}lutimesSync(t,r,s){return this.baseFs.lutimesSync(this.mapToBase(t),r,s)}async mkdirPromise(t,r){return this.baseFs.mkdirPromise(this.mapToBase(t),r)}mkdirSync(t,r){return this.baseFs.mkdirSync(this.mapToBase(t),r)}async rmdirPromise(t,r){return this.baseFs.rmdirPromise(this.mapToBase(t),r)}rmdirSync(t,r){return this.baseFs.rmdirSync(this.mapToBase(t),r)}async rmPromise(t,r){return this.baseFs.rmPromise(this.mapToBase(t),r)}rmSync(t,r){return this.baseFs.rmSync(this.mapToBase(t),r)}async linkPromise(t,r){return this.baseFs.linkPromise(this.mapToBase(t),this.mapToBase(r))}linkSync(t,r){return this.baseFs.linkSync(this.mapToBase(t),this.mapToBase(r))}async symlinkPromise(t,r,s){let a=this.mapToBase(r);if(this.pathUtils.isAbsolute(t))return this.baseFs.symlinkPromise(this.mapToBase(t),a,s);let n=this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(r),t)),c=this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(a),n);return this.baseFs.symlinkP Line truncated
`,NA=ur(`\\
`,!1),OA=function(){return""},Aa="\\",pa=ur("\\",!1),LA=/^[\\$"`]/,gr=zi(["\\","$",'"',"`"],!1,!1),ko=function(N){return N},qa="\\a",Ue=ur("\\a",!1),wr=function(){return"a"},gf="\\b",MA=ur("\\b",!1),UA=function(){return"\b"},cu=/^[Ee]/,uu=zi(["E","e"],!1,!1),cc=function(){return"\x1B"},we="\\f",Ot=ur("\\f",!1),uc=function(){return"\f"},Oi="\\n",fo=ur("\\n",!1),Tt=function(){return`
`},Rn="\\r",ha=ur("\\r",!1),Gi=function(){return"\r"},Li="\\t",Ya=ur("\\t",!1),yn=function(){return" "},Zn="\\v",fu=ur("\\v",!1),Eh=function(){return"\v"},Wa=/^[\\'"?]/,Va=zi(["\\","'",'"',"?"],!1,!1),Ka=function(N){return String.fromCharCode(parseInt(N,16))},$e="\\x",Ja=ur("\\x",!1),mf="\\u",fc=ur("\\u",!1),Sn="\\U",da=ur("\\U",!1),_A=function(N){return String.fromCodePoint(parseInt(N,16))},HA=/^[0-7]/,ga=zi([["0","7"]],!1,!1),Ql=/^[0-9a-fA-f]/,Ut=zi([["0","9"],["a","f"],["A","f"]],!1,!1),Tn=Cf(),ma="{}",za=ur("{}",!1),ss=function(){return"{}"},Ac="-",Au=ur("-",!1),pc="+",Xa=ur("+",!1),Mi=".",vs=ur(".",!1),Rl=function(N,J,re){return{type:"number",value:(N==="-"?-1:1)*parseFloat(J.join("")+"."+re.join(""))}},yf=function(N,J){return{type:"number",value:(N==="-"?-1:1)*parseInt(J.join(""))}},hc=function(N){return{type:"variable",...N}},Bi=function(N){return{type:"variable",name:N}},Fn=function(N){return N},dc="*",ze=ur("*",!1),at="/",St=ur("/",!1),lr=function(N,J,re){return{type:J==="*"?"multiplication":"division",right:re}},te=function(N,J){return J.reduce((re,de)=>({left:re,...de}),N)},ye=function(N,J,re){return{type:J==="+"?"addition":"subtraction",right:re}},Oe="$((",mt=ur("$((",!1),Et="))",Dt=ur("))",!1),tr=function(N){return N},pn="$(",ui=ur("$(",!1),qi=function(N){return N},Nn="${",Za=ur("${",!1),By=":-",J1=ur(":-",!1),Qo=function(N,J){return{name:N,defaultValue:J}},vy=":-}",Ih=ur(":-}",!1),z1=function(N){return{name:N,defaultValue:[]}},Ro=":+",Ch=ur(":+",!1),wh=function(N,J){return{name:N,alternativeValue:J}},pu=":+}",Bh=ur(":+}",!1),Nd=function(N){return{name:N,alternativeValue:[]}},Od=function(N){return{name:N}},Ld="$",Sy=ur("$",!1),Ef=function(N){return t.isGlobPattern(N)},To=function(N){return N},Tl=/^[a-zA-Z0-9_]/,vh=zi([["a","z"],["A","Z"],["0","9"],"_"],!1,!1),Md=function(){return xy()},Fl=/^[$@*?#a-zA-Z0-9_\-]/,Nl=zi(["$","@","*","?","#",["a","z"],["A","Z"],["0","9"],"_","-"],!1,!1),by=/^[()}<>$|&; \t"']/,jA=zi(["(",")","}","<",">","$","|","&",";"," "," ",'"',"'"],!1,!1),Dy=/^[<>&; \t"']/,Py=zi(["<",">","&",";"," "," ",'"',"'"],!1,!1),GA=/^[ \t]/,qA=zi([" "," "],!1,!1),Y=0,xt=0,YA=[{line:1,column:1}],Fo=0,If=[],yt=0,hu;if("startRule"in t){if(!(t.startRule in s))throw new Error(`Can't start parsing from rule "`+t.startRule+'".');a=s[t.startRule]}function xy(){return e.substring(xt,Y)}function Ud(){return wf(xt,Y)}function X1(N,J){throw J=J!==void 0?J:wf(xt,Y),WA([_d(N)],e.substring(xt,Y),J)}function Sh(N,J){throw J=J!==void 0?J:wf(xt,Y),mi(N,J)}function ur(N,J){return{type:"literal",text:N,ignoreCase:J}}function zi(N,J,re){return{type:"class",parts:N,inverted:J,ignoreCase:re}}function Cf(){return{type:"any"}}function $a(){return{type:"end"}}function _d(N){return{type:"other",description:N}}function du(N){var J=YA[N],re;if(J)return J;for(re=N-1;!YA[re];)re--;for(J=YA[re],J={line:J.line,column:J.column};re<N;)e.charCodeAt(re)===10?(J.line++,J.column=1):J.column++,re++;return YA[N]=J,J}function wf(N,J){var re=du(N),de=du(J);return{start:{offset:N,line:re.line,column:re.column},end:{offset:J,line:de.line,column:de.column}}}function wt(N){Y<Fo||(Y>Fo&&(Fo=Y,If=[]),If.push(N))}function mi(N,J){return new vg(N,null,null,J)}function WA(N,J,re){return new vg(vg.buildMessage(N,J),N,J,re)}function el(){var N,J,re;for(N=Y,J=[],re=kt();re!==r;)J.push(re),re=kt();return J!==r?(re=ya(),re===r&&(re=null),re!==r?(xt=N,J=n(re),N=J):(Y=N,N=r)):(Y=N,N=r),N}function ya(){var N,J,re,de,Ke;if(N=Y,J=bh(),J!==r){for(re=[],de=kt();de!==r;)re.push(de),de=kt();re!==r?(de=Hd(),de!==r?(Ke=tl(),Ke===r&&(Ke=null),Ke!==r?(xt=N,J=c(J,de,Ke),N=J):(Y=N,N=r)):(Y=N,N=r)):(Y=N,N=r)}else Y=N,N=r;if(N===r)if(N=Y,J=bh(),J!==r){for(re=[],de=kt();de!==r;)re.push(de),de=kt();re!==r?(de=Hd(),de===r&&(de=null),de!==r?(xt=N,J=f(J,de),N=J):(Y=N,N=r)):(Y=N,N=r)}else Y=N,N=r;return N}function tl(){var N,J,re,de,Ke;for(N=Y,J=[],re=kt();re!==r;)J.push(re),re=kt();if(J!==r)if(re=ya(),re!==r){for(de=[],Ke=kt();Ke!==r;)de.push(Ke),Ke=kt();de!==r?(xt=N,J=p(re),N=J):(Y=N,N=r)}else Y=N,N=r;else Y=N,N=r;return N}function Hd(){var N;return e.charCodeAt(Y)===59?(N=h,Y++):(N=r,yt===0&&wt(E)),N===r&&(e.charCodeAt(Y)===38?(N=C,Y++):(N=r,yt===0&&wt(S))),N}function bh(){var N,J,re;return N=Y,J=VA(),J!==r?(re=jd(),re===r&&(re=null),re!==r?(xt=N,J=x(J,re),N=J):(Y=N,N=r)):(Y=N,N=r),N}function jd(){var N,J,re,de,Ke,pt,mr;for(N=Y,J=[],re=kt();re!==r;)J.push(re),re=kt();if(J!==r)if(re=ky(),re!==r){for(de=[],Ke=kt();Ke!==r;)de.push(Ke),Ke=kt();if(de!==r)if(Ke=bh(),Ke!==r){for(pt=[],mr=kt();mr!==r;)pt.push(mr),mr=kt();pt!==r?(xt=N,J=I(re,Ke),N=J):(Y=N,N=r)}else Y=N,N=r;else Y=N,N=r}else Y=N,N=r;else Y=N,N=r;return N}function ky(){var N;return e.substr(Y,2)===T?(N=T,Y+=2):(N=r,yt===0&&wt(O)),N===r&&(e.substr(Y,2)===U?(N=U,Y+=2):(N=r,yt===0&&wt(V))),N}function VA(){var N,J,re;return N=Y,J=Bf(),J!==r?(re=Gd(),re===r&&(re=null),re!==r?(xt=N,J=$(J,re),N=J):(Y=N,N=r)):(Y=N,N=r),N}function Gd(){var N,J,re,de,Ke,pt,mr;for(N=Y,J=[],re=kt();re!==r;)J.push(re),re=kt();if(J!==r)iLine truncated
`,"\\n"],["\r","\\r"],[" ","\\t"],["\v","\\v"],["\0","\\0"]]),k6e=new Map([["\\","\\\\"],["$","\\$"],['"','\\"'],...Array.from(Y$,([e,t])=>[e,`"$'${t}'"`])]),W$=e=>Y$.get(e)??`\\x${e.charCodeAt(0).toString(16).padStart(2,"0")}`,Q6e=e=>k6e.get(e)??`"$'${W$(e)}'"`});var J$=G((SPt,K$)=>{"use strict";function R6e(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}function bg(e,t,r,s){this.message=e,this.expected=t,this.found=r,this.location=s,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,bg)}R6e(bg,Error);bg.buildMessage=function(e,t){var r={literal:function(h){return'"'+a(h.text)+'"'},class:function(h){var E="",C;for(C=0;C<h.parts.length;C++)E+=h.parts[C]instanceof Array?n(h.parts[C][0])+"-"+n(h.parts[C][1]):n(h.parts[C]);return"["+(h.inverted?"^":"")+E+"]"},any:function(h){return"any character"},end:function(h){return"end of input"},other:function(h){return h.description}};function s(h){return h.charCodeAt(0).toString(16).toUpperCase()}function a(h){return h.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(E){return"\\x0"+s(E)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(E){return"\\x"+s(E)})}function n(h){return h.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(E){return"\\x0"+s(E)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(E){return"\\x"+s(E)})}function c(h){return r[h.type](h)}function f(h){var E=new Array(h.length),C,S;for(C=0;C<h.length;C++)E[C]=c(h[C]);if(E.sort(),E.length>0){for(C=1,S=1;C<E.length;C++)E[C-1]!==E[C]&&(E[S]=E[C],S++);E.length=S}switch(E.length){case 1:return E[0];case 2:return E[0]+" or "+E[1];default:return E.slice(0,-1).join(", ")+", or "+E[E.length-1]}}function p(h){return h?'"'+a(h)+'"':"end of input"}return"Expected "+f(e)+" but "+p(t)+" found."};function T6e(e,t){t=t!==void 0?t:{};var r={},s={resolution:ke},a=ke,n="/",c=Be("/",!1),f=function(Me,P){return{from:Me,descriptor:P}},p=function(Me){return{descriptor:Me}},h="@",E=Be("@",!1),C=function(Me,P){return{fullName:Me,description:P}},S=function(Me){return{fullName:Me}},x=function(){return Ce()},I=/^[^\/@]/,T=me(["/","@"],!0,!1),O=/^[^\/]/,U=me(["/"],!0,!1),V=0,$=0,ie=[{line:1,column:1}],fe=0,ae=[],ge=0,he;if("startRule"in t){if(!(t.startRule in s))throw new Error(`Can't start parsing from rule "`+t.startRule+'".');a=s[t.startRule]}function Ce(){return e.substring($,V)}function Ee(){return ot($,V)}function d(Me,P){throw P=P!==void 0?P:ot($,V),Ne([be(Me)],e.substring($,V),P)}function Se(Me,P){throw P=P!==void 0?P:ot($,V),tt(Me,P)}function Be(Me,P){return{type:"literal",text:Me,ignoreCase:P}}function me(Me,P,w){return{type:"class",parts:Me,inverted:P,ignoreCase:w}}function ue(){return{type:"any"}}function Z(){return{type:"end"}}function be(Me){return{type:"other",description:Me}}function Qe(Me){var P=ie[Me],w;if(P)return P;for(w=Me-1;!ie[w];)w--;for(P=ie[w],P={line:P.line,column:P.column};w<Me;)e.charCodeAt(w)===10?(P.line++,P.column=1):P.column++,w++;return ie[Me]=P,P}function ot(Me,P){var w=Qe(Me),D=Qe(P);return{start:{offset:Me,line:w.line,column:w.column},end:{offset:P,line:D.line,column:D.column}}}function _(Me){V<fe||(V>fe&&(fe=V,ae=[]),ae.push(Me))}function tt(Me,P){return new bg(Me,null,null,P)}function Ne(Me,P,w){return new bg(bg.buildMessage(Me,P),Me,P,w)}function ke(){var Me,P,w,D;return Me=V,P=De(),P!==r?(e.charCodeAt(V)===47?(w=n,V++):(w=r,ge===0&&_(c)),w!==r?(D=De(),D!==r?($=Me,P=f(P,D),Me=P):(V=Me,Me=r)):(V=Me,Me=r)):(V=Me,Me=r),Me===r&&(Me=V,P=De(),P!==r&&($=Me,P=p(P)),Me=P),Me}function De(){var Me,P,w,D;return Me=V,P=je(),P!==r?(e.charCodeAt(V)===64?(w=h,V++):(w=r,ge===0&&_(E)),w!==r?(D=ct(),D!==r?($=Me,P=C(P,D),Me=P):(V=Me,Me=r)):(V=Me,Me=r)):(V=Me,Me=r),Me===r&&(Me=V,P=je(),P!==r&&($=Me,P=S(P)),Me=P),Me}function je(){var Me,P,w,D,y;return Me=V,e.charCodeAt(V)===64?(P=h,V++):(P=r,ge===0&&_(E)),P!==r?(w=Re(),w!==r?(e.charCodeAt(V)===47?(D=n,V++):(D=r,ge===0&&_(c)),D!==r?(y=Re(),y!==r?($=Me,P=x(),Me=P):(V=Me,Me=r)):(V=Me,Me=r)):(V=Me,Me=r)):(V=Me,Me=r),Me===r&&(Me=V,P=Re(),P!==r&&($=Me,P=x()),Me=P),Me}function Re(){var Me,P,w;if(Me=V,P=[],I.test(e.charAt(V))?(w=e.charAt(V),V++):(w=r,ge===0&&_(T)),w!==r)for(;w!==r;)P.push(w),I.test(e.charAt(V))?(w=e.charAt(V),V++):(w=r,ge===0&&_(T));else P=r;return P!==r&&($=Me,P=x()),Me=P,Me}function ct(){var Me,P,w;if(Me=V,P=[],O.test(e.charAt(V))?(w=e.charAt(V),V++):(w=r,ge===0&&_(U)),w!==r)for(;w!==r;)P.push(w),O.test(e.charAt(V))?(w=e.charAt(V),V++):(w=r,ge===0&&_(U));else P=r;return P!==r&&($=Me,P=x()),Me=P,Me}if(he=a(),he!==r&&V===e.length)return he;throw he!==r&&V<e.length&&_(Z()),Ne(ae,fe<e.length?e.charAt(fe):null,fe<e.length?ot(fe,fe+1):ot(fe,fe))}K$.exports={SyntaxError:bg,parse:T6e}});function mx(e){let t=e.match(/^\*{1,2}\/(.*)/);if(t)throwLine truncated
\x85\u2028\u2029`.indexOf(this.buffer.charAt(a-1))===-1;)if(a-=1,this.position-a>r/2-1){s=" ... ",a+=5;break}for(n="",c=this.position;c<this.buffer.length&&`\0\r
\x85\u2028\u2029`.indexOf(this.buffer.charAt(c))===-1;)if(c+=1,c-this.position>r/2-1){n=" ... ",c-=5;break}return f=this.buffer.slice(a,c),eee.repeat(" ",t)+s+f+n+`
`+eee.repeat(" ",t+this.position-a+s.length)+"^"};FU.prototype.toString=function(t){var r,s="";return this.name&&(s+='in "'+this.name+'" '),s+="at line "+(this.line+1)+", column "+(this.column+1),t||(r=this.getSnippet(),r&&(s+=`:
`+r)),s};tee.exports=FU});var xs=G((kPt,iee)=>{"use strict";var nee=EE(),U6e=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],_6e=["scalar","sequence","mapping"];function H6e(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(s){t[String(s)]=r})}),t}function j6e(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(U6e.indexOf(r)===-1)throw new nee('Unknown option "'+r+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(r){return r},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=H6e(t.styleAliases||null),_6e.indexOf(this.kind)===-1)throw new nee('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}iee.exports=j6e});var xg=G((QPt,oee)=>{"use strict";var see=Pg(),Ex=EE(),G6e=xs();function NU(e,t,r){var s=[];return e.include.forEach(function(a){r=NU(a,t,r)}),e[t].forEach(function(a){r.forEach(function(n,c){n.tag===a.tag&&n.kind===a.kind&&s.push(c)}),r.push(a)}),r.filter(function(a,n){return s.indexOf(n)===-1})}function q6e(){var e={scalar:{},sequence:{},mapping:{},fallback:{}},t,r;function s(a){e[a.kind][a.tag]=e.fallback[a.tag]=a}for(t=0,r=arguments.length;t<r;t+=1)arguments[t].forEach(s);return e}function IE(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(t){if(t.loadKind&&t.loadKind!=="scalar")throw new Ex("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=NU(this,"implicit",[]),this.compiledExplicit=NU(this,"explicit",[]),this.compiledTypeMap=q6e(this.compiledImplicit,this.compiledExplicit)}IE.DEFAULT=null;IE.create=function(){var t,r;switch(arguments.length){case 1:t=IE.DEFAULT,r=arguments[0];break;case 2:t=arguments[0],r=arguments[1];break;default:throw new Ex("Wrong number of arguments for Schema.create function")}if(t=see.toArray(t),r=see.toArray(r),!t.every(function(s){return s instanceof IE}))throw new Ex("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!r.every(function(s){return s instanceof G6e}))throw new Ex("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new IE({include:t,explicit:r})};oee.exports=IE});var lee=G((RPt,aee)=>{"use strict";var Y6e=xs();aee.exports=new Y6e("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}})});var uee=G((TPt,cee)=>{"use strict";var W6e=xs();cee.exports=new W6e("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}})});var Aee=G((FPt,fee)=>{"use strict";var V6e=xs();fee.exports=new V6e("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}})});var Ix=G((NPt,pee)=>{"use strict";var K6e=xg();pee.exports=new K6e({explicit:[lee(),uee(),Aee()]})});var dee=G((OPt,hee)=>{"use strict";var J6e=xs();function z6e(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function X6e(){return null}function Z6e(e){return e===null}hee.exports=new J6e("tag:yaml.org,2002:null",{kind:"scalar",resolve:z6e,construct:X6e,predicate:Z6e,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var mee=G((LPt,gee)=>{"use strict";var $6e=xs();function eGe(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function tGe(e){return e==="true"||e==="True"||e==="TRUE"}function rGe(e){return Object.prototype.toString.call(e)==="[object Boolean]"}gee.exports=new $6e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:eGe,construct:tGe,predicate:rGe,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})});var Eee=G((MPt,yee)=>{"use strict";var nGe=Pg(),iGe=xs();function sGe(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function oGe(e){return 48<=e&&e<=55}function aGe(e){return 48<=e&&e<=57}function lGe(e){if(e===null)return!1;var t=e.length,r=0,s=!1,a;if(!t)return!1;if(a=e[r],(a==="-"||a==="+")&&(a=e[++r]),a==="0"){if(r+1===t)return!0;if(a=e[++r],a==="b"){for(r++;r<t;r++)if(a=e[r],a!=="_"){if(a!=="0"&&a!=="1")return!1;s=!0}return s&&a!=="_"}if(a==="x"){for(r++;r<t;r++)if(a=e[r],a!=="_"){if(!sGe(e.charCodeAt(r)))return!1;s=!0}return s&&a!=="_"}for(;r<t;r++)if(a=e[r],a!=="_"){if(!oGe(e.charCodeAt(r)))return!1;s=!0}return s&&a!=="_"}if(a==="_")return!1;for(;r<t;r++)if(a=e[r],a!=="_"){if(a===":")break;if(!aGe(e.charCodeAt(r)))return!1;s=!0}return!s||a==="_"?!1:a!==":"?!0:/^( Line truncated
\r`;function DGe(e){if(e===null)return!1;var t,r,s=0,a=e.length,n=MU;for(r=0;r<a;r++)if(t=n.indexOf(e.charAt(r)),!(t>64)){if(t<0)return!1;s+=6}return s%8===0}function PGe(e){var t,r,s=e.replace(/[\r\n=]/g,""),a=s.length,n=MU,c=0,f=[];for(t=0;t<a;t++)t%4===0&&t&&(f.push(c>>16&255),f.push(c>>8&255),f.push(c&255)),c=c<<6|n.indexOf(s.charAt(t));return r=a%4*6,r===0?(f.push(c>>16&255),f.push(c>>8&255),f.push(c&255)):r===18?(f.push(c>>10&255),f.push(c>>2&255)):r===12&&f.push(c>>4&255),kg?kg.from?kg.from(f):new kg(f):f}function xGe(e){var t="",r=0,s,a,n=e.length,c=MU;for(s=0;s<n;s++)s%3===0&&s&&(t+=c[r>>18&63],t+=c[r>>12&63],t+=c[r>>6&63],t+=c[r&63]),r=(r<<8)+e[s];return a=n%3,a===0?(t+=c[r>>18&63],t+=c[r>>12&63],t+=c[r>>6&63],t+=c[r&63]):a===2?(t+=c[r>>10&63],t+=c[r>>4&63],t+=c[r<<2&63],t+=c[64]):a===1&&(t+=c[r>>2&63],t+=c[r<<4&63],t+=c[64],t+=c[64]),t}function kGe(e){return kg&&kg.isBuffer(e)}Ree.exports=new bGe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:DGe,construct:PGe,predicate:kGe,represent:xGe})});var Nee=G((WPt,Fee)=>{"use strict";var QGe=xs(),RGe=Object.prototype.hasOwnProperty,TGe=Object.prototype.toString;function FGe(e){if(e===null)return!0;var t=[],r,s,a,n,c,f=e;for(r=0,s=f.length;r<s;r+=1){if(a=f[r],c=!1,TGe.call(a)!=="[object Object]")return!1;for(n in a)if(RGe.call(a,n))if(!c)c=!0;else return!1;if(!c)return!1;if(t.indexOf(n)===-1)t.push(n);else return!1}return!0}function NGe(e){return e!==null?e:[]}Fee.exports=new QGe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:FGe,construct:NGe})});var Lee=G((VPt,Oee)=>{"use strict";var OGe=xs(),LGe=Object.prototype.toString;function MGe(e){if(e===null)return!0;var t,r,s,a,n,c=e;for(n=new Array(c.length),t=0,r=c.length;t<r;t+=1){if(s=c[t],LGe.call(s)!=="[object Object]"||(a=Object.keys(s),a.length!==1))return!1;n[t]=[a[0],s[a[0]]]}return!0}function UGe(e){if(e===null)return[];var t,r,s,a,n,c=e;for(n=new Array(c.length),t=0,r=c.length;t<r;t+=1)s=c[t],a=Object.keys(s),n[t]=[a[0],s[a[0]]];return n}Oee.exports=new OGe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:MGe,construct:UGe})});var Uee=G((KPt,Mee)=>{"use strict";var _Ge=xs(),HGe=Object.prototype.hasOwnProperty;function jGe(e){if(e===null)return!0;var t,r=e;for(t in r)if(HGe.call(r,t)&&r[t]!==null)return!1;return!0}function GGe(e){return e!==null?e:{}}Mee.exports=new _Ge("tag:yaml.org,2002:set",{kind:"mapping",resolve:jGe,construct:GGe})});var CE=G((JPt,_ee)=>{"use strict";var qGe=xg();_ee.exports=new qGe({include:[LU()],implicit:[Pee(),kee()],explicit:[Tee(),Nee(),Lee(),Uee()]})});var jee=G((zPt,Hee)=>{"use strict";var YGe=xs();function WGe(){return!0}function VGe(){}function KGe(){return""}function JGe(e){return typeof e>"u"}Hee.exports=new YGe("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:WGe,construct:VGe,predicate:JGe,represent:KGe})});var qee=G((XPt,Gee)=>{"use strict";var zGe=xs();function XGe(e){if(e===null||e.length===0)return!1;var t=e,r=/\/([gim]*)$/.exec(e),s="";return!(t[0]==="/"&&(r&&(s=r[1]),s.length>3||t[t.length-s.length-1]!=="/"))}function ZGe(e){var t=e,r=/\/([gim]*)$/.exec(e),s="";return t[0]==="/"&&(r&&(s=r[1]),t=t.slice(1,t.length-s.length-1)),new RegExp(t,s)}function $Ge(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function e5e(e){return Object.prototype.toString.call(e)==="[object RegExp]"}Gee.exports=new zGe("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:XGe,construct:ZGe,predicate:e5e,represent:$Ge})});var Vee=G((ZPt,Wee)=>{"use strict";var Cx;try{Yee=Ie,Cx=Yee("esprima")}catch{typeof window<"u"&&(Cx=window.esprima)}var Yee,t5e=xs();function r5e(e){if(e===null)return!1;try{var t="("+e+")",r=Cx.parse(t,{range:!0});return!(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&r.body[0].expression.type!=="FunctionExpression")}catch{return!1}}function n5e(e){var t="("+e+")",r=Cx.parse(t,{range:!0}),s=[],a;if(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&r.body[0].expression.type!=="FunctionExpression")throw new Error("Failed to resolve function");return r.body[0].expression.params.forEach(function(n){s.push(n.name)}),a=r.body[0].expression.body.range,r.body[0].expression.body.type==="BlockStatement"?new Function(s,t.slice(a[0]+1,a[1]-1)):new Function(s,"return "+t.slice(a[0],a[1]))}function i5e(e){return e.toString()}function s5e(e){return Object.prototype.toString.call(e)==="[object Function]"}Wee.exports=new t5e("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:r5e,construct:n5e,predicate:s5e,represent:i5e})});var _2=G((ext,Jee)=>{"use strict";var Kee=xg();Jee.exports=Kee.DEFAULT=new Kee({include:[CE()],explicit:[jee(),qee(),Vee()]})});var hte=G((txt,H2)=>{"use strict";var Bp=Pg(),rte=EE(),o5e=ree(),nte=CE(),a5e=_2(),s0=Object.prototype.hasOwnProperty,wx=1,ite=2,ste=3,Bx=4,UU=1,l5e=2,zee=3,c5e=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84 Line truncated
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function d5e(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var lte=new Array(256),cte=new Array(256);for(Qg=0;Qg<256;Qg++)lte[Qg]=Zee(Qg)?1:0,cte[Qg]=Zee(Qg);var Qg;function g5e(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||a5e,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function ute(e,t){return new rte(t,new o5e(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function Nr(e,t){throw ute(e,t)}function vx(e,t){e.onWarning&&e.onWarning.call(null,ute(e,t))}var $ee={YAML:function(t,r,s){var a,n,c;t.version!==null&&Nr(t,"duplication of %YAML directive"),s.length!==1&&Nr(t,"YAML directive accepts exactly one argument"),a=/^([0-9]+)\.([0-9]+)$/.exec(s[0]),a===null&&Nr(t,"ill-formed argument of the YAML directive"),n=parseInt(a[1],10),c=parseInt(a[2],10),n!==1&&Nr(t,"unacceptable YAML version of the document"),t.version=s[0],t.checkLineBreaks=c<2,c!==1&&c!==2&&vx(t,"unsupported YAML version of the document")},TAG:function(t,r,s){var a,n;s.length!==2&&Nr(t,"TAG directive accepts exactly two arguments"),a=s[0],n=s[1],ote.test(a)||Nr(t,"ill-formed tag handle (first argument) of the TAG directive"),s0.call(t.tagMap,a)&&Nr(t,'there is a previously declared suffix for "'+a+'" tag handle'),ate.test(n)||Nr(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[a]=n}};function i0(e,t,r,s){var a,n,c,f;if(t<r){if(f=e.input.slice(t,r),s)for(a=0,n=f.length;a<n;a+=1)c=f.charCodeAt(a),c===9||32<=c&&c<=1114111||Nr(e,"expected valid JSON character");else c5e.test(f)&&Nr(e,"the stream contains non-printable characters");e.result+=f}}function ete(e,t,r,s){var a,n,c,f;for(Bp.isObject(r)||Nr(e,"cannot merge mappings; the provided source object is unacceptable"),a=Object.keys(r),c=0,f=a.length;c<f;c+=1)n=a[c],s0.call(t,n)||(t[n]=r[n],s[n]=!0)}function BE(e,t,r,s,a,n,c,f){var p,h;if(Array.isArray(a))for(a=Array.prototype.slice.call(a),p=0,h=a.length;p<h;p+=1)Array.isArray(a[p])&&Nr(e,"nested arrays are not supported inside keys"),typeof a=="object"&&Xee(a[p])==="[object Object]"&&(a[p]="[object Object]");if(typeof a=="object"&&Xee(a)==="[object Object]"&&(a="[object Object]"),a=String(a),t===null&&(t={}),s==="tag:yaml.org,2002:merge")if(Array.isArray(n))for(p=0,h=n.length;p<h;p+=1)ete(e,t,n[p],r);else ete(e,t,n,r);else!e.json&&!s0.call(r,a)&&s0.call(t,a)&&(e.line=c||e.line,e.position=f||e.position,Nr(e,"duplicated mapping key")),t[a]=n,delete r[a];return t}function _U(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):Nr(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function cs(e,t,r){for(var s=0,a=e.input.charCodeAt(e.position);a!==0;){for(;Rg(a);)a=e.input.charCodeAt(++e.position);if(t&&a===35)do a=e.input.charCodeAt(++e.position);while(a!==10&&a!==13&&a!==0);if(Yf(a))for(_U(e),a=e.input.charCodeAt(e.position),s++,e.lineIndent=0;a===32;)e.lineIndent++,a=e.input.charCodeAt(++e.position);else break}return r!==-1&&s!==0&&e.lineIndent<r&&vx(e,"deficient indentation"),s}function Sx(e){var t=e.position,r;return r=e.input.charCodeAt(t),!!((r===45||r===46)&&r===e.input.charCodeAt(t+1)&&r===e.input.charCodeAt(t+2)&&(t+=3,r=e.input.charCodeAt(t),r===0||fl(r)))}function HU(e,t){t===1?e.result+=" ":t>1&&(e.result+=Bp.repeat(`
`,t-1))}function m5e(e,t,r){var s,a,n,c,f,p,h,E,C=e.kind,S=e.result,x;if(x=e.input.charCodeAt(e.position),fl(x)||wE(x)||x===35||x===38||x===42||x===33||x===124||x===62||x===39||x===34||x===37||x===64||x===96||(x===63||x===45)&&(a=e.input.charCodeAt(e.position+1),fl(a)||r&&wE(a)))return!1;for(e.kind="scalar",e.result="",n=c=e.position,f=!1;x!==0;){if(x===58){if(a=e.input.charCodeAt(e.position+1),fl(a)||r&&wE(a))break}else if(x===35){if(s=e.input.charCodeAt(e.position-1),fl(s))break}else{if(e.position===e.lineStart&&Sx(e)||r&&wE(x))break;if(Yf(x))if(p=e.line,h=e.lineStart,E=e.lineIndent,cs(e,!1,-1),e.lineIndent>=t){f=!0,x=e.input.charCodeAt(e.position);continue}else{e.position=c,e.line=p,e.lineStart=h,e.lineIndent=E;break}}f&&(i0(e,n,c,!1),HU(e,e.line-p),n=c=e.position,f=!1),Rg(x)||(c=e.position+1),x=e.input.charCodeAt(++e.position)}return i0(e,n,c,!1),e.result?!0:(e.kind=C,e.result=S,!1)}function y5e(e,t){var r,s,a;if(r=e.input.charCodeAt(e.position),r!==39)return!1;for(e.kind="scalar",e.result="",e.position++,s=a=e.position;(r=e.input.charCodeAt(e.position))!==0;)if(r===39)if(i0(e,s,e.position,!0),r=e.input.charCodeAt(++e.position),r===39)s=e.position,e.position++,a=e.position;else return!0;else Yf(r)?(i0(e,s,a,!0),HU(e,cs(e,!1,t)),s=a=e.position):e.position===e.lineStart&&Sx(e)?Nr(e,"unexpected end of the document within a single quoted scalar"):(e.position++,a=e.position);Nr(e,"unexpected end of the stream within a single quoted scalar")}function E5e(e,t){var r,s,a,n,c,f;if(f=e.input.charCodeAt(e.position),f!==34)return!1;for(e.kind="scalar",e.result="",e.position++,r=s=e.position;(f=e.input.charCodeAt(e.position))!==0;){if(f===34)return i0(e,r,e.position,!0),e.position++,!0;if(f===92){if(i0(e,r,e.position,!0),f=e.input.charCodeAt(++e.position),Yf(f))cs(e,!1,t);else if(f<256&&lte[f])e.result+=cte[f],e.position++;else if((c=p5e(f))>0){for(a=c,n=0;a>0;a--)f=e.input.charCodeAt(++e.position),(c=A5e(f))>=0?n=(n<<4)+c:Nr(e,"expected hexadecimal character");e.result+=d5e(n),e.position++}else Nr(e,"unknown escape sequence");r=s=e.position}else Yf(f)?(i0(e,r,s,!0),HU(e,cs(e,!1,t)),r=s=e.position):e.position===e.lineStart&&Sx(e)?Nr(e,"unexpected end of the document within a double quoted scalar"):(e.position++,s=e.position)}Nr(e,"unexpected end of the stream within a double quoted scalar")}function I5e(e,t){var r=!0,s,a=e.tag,n,c=e.anchor,f,p,h,E,C,S={},x,I,T,O;if(O=e.input.charCodeAt(e.position),O===91)p=93,C=!1,n=[];else if(O===123)p=125,C=!0,n={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=n),O=e.input.charCodeAt(++e.position);O!==0;){if(cs(e,!0,t),O=e.input.charCodeAt(e.position),O===p)return e.position++,e.tag=a,e.anchor=c,e.kind=C?"mapping":"sequence",e.result=n,!0;r||Nr(e,"missed comma between flow collection entries"),I=x=T=null,h=E=!1,O===63&&(f=e.input.charCodeAt(e.position+1),fl(f)&&(h=E=!0,e.position++,cs(e,!0,t))),s=e.line,vE(e,t,wx,!1,!0),I=e.tag,x=e.result,cs(e,!0,t),O=e.input.charCodeAt(e.position),(E||e.line===s)&&O===58&&(h=!0,O=e.input.charCodeAt(++e.position),cs(e,!0,t),vE(e,t,wx,!1,!0),T=e.result),C?BE(e,n,S,I,x,T):h?n.push(BE(e,null,S,I,x,T)):n.push(x),cs(e,!0,t),O=e.input.charCodeAt(e.position),O===44?(r=!0,O=e.input.charCodeAt(++e.position)):r=!1}Nr(e,"unexpected end of the stream within a flow collection")}function C5e(e,t){var r,s,a=UU,n=!1,c=!1,f=t,p=0,h=!1,E,C;if(C=e.input.charCodeAt(e.position),C===124)s=!1;else if(C===62)s=!0;else return!1;for(e.kind="scalar",e.result="";C!==0;)if(C=e.input.charCodeAt(++e.position),C===43||C===45)UU===a?a=C===43?zee:l5e:Nr(e,"repeat of a chomping mode identifier");else if((E=h5e(C))>=0)E===0?Nr(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?Nr(e,"repeat of an indentation width identifier"):(f=t+E-1,c=!0);else break;if(Rg(C)){do C=e.input.charCodeAt(++e.position);while(Rg(C));if(C===35)do C=e.input.charCodeAt(++e.position);while(!Yf(C)&&C!==0)}for(;C!==0;){for(_U(e),e.lineIndent=0,C=e.input.charCodeAt(e.position);(!c||e.lineIndent<f)&&C===32;)e.lineIndent++,C=e.input.charCodeAt(++e.position);if(!c&&e.lineIndent>f&&(f=e.lineIndent),Yf(C)){p++;continue}if(e.lineIndent<f){a===zee?e.result+=Bp.repeat(`
`,n?1+p:p):a===UU&&n&&(e.result+=`
`);break}for(s?Rg(C)?(h=!0,e.result+=Bp.repeat(`
`,n?1+p:p)):h?(h=!1,e.result+=Bp.repeat(`
`,p+1)):p===0?n&&(e.result+=" "):e.result+=Bp.repeat(`
`,p):e.result+=Bp.repeat(`
`,n?1+p:p),n=!0,c=!0,p=0,r=e.position;!Yf(C)&&C!==0;)C=e.input.charCodeAt(++e.position);i0(e,r,e.position,!1)}return!0}function tte(e,t){var r,s=e.tag,a=e.anchor,n=[],c,f=!1,p;for(e.anchor!==null&&(e.anchorMap[e.anchor]=n),p=e.input.charCodeAt(e.position);p!==0&&!(p!==45||(c=e.input.charCodeAt(e.position+1),!fl(c)));){if(f=!0,e.position++,cs(e,!0,-1)&&e.lineIndent<=t){n.push(null),p=e.input.charCodeAt(e.position);continue}if(r=e.line,vE(e,t,ste,!1,!0),n.push(e.result),cs(e,!0,-1),p=e.input.charCodeAt(e.position),(e.line===r||e.lineIndent>t)&&p!==0)Nr(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return f?(e.tag=s,e.anchor=a,e.kind="sequence",e.result=n,!0):!1}function w5e(e,t,r){var s,a,n,c,f=e.tag,p=e.anchor,h={},E={},C=null,S=null,x=null,I=!1,T=!1,O;for(e.anchor!==null&&(e.anchorMap[e.anchor]=h),O=e.input.charCodeAt(e.position);O!==0;){if(s=e.input.charCodeAt(e.position+1),n=e.line,c=e.position,(O===63||O===58)&&fl(s))O===63?(I&&(BE(e,h,E,C,S,null),C=S=x=null),T=!0,I=!0,a=!0):I?(I=!1,a=!0):Nr(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,O=s;else if(vE(e,r,ite,!1,!0))if(e.line===n){for(O=e.input.charCodeAt(e.position);Rg(O);)O=e.input.charCodeAt(++e.position);if(O===58)O=e.input.charCodeAt(++e.position),fl(O)||Nr(e,"a whitespace character is expected after the key-value separator within a block mapping"),I&&(BE(e,h,E,C,S,null),C=S=x=null),T=!0,I=!1,a=!1,C=e.tag,S=e.result;else if(T)Nr(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=f,e.anchor=p,!0}else if(T)Nr(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=f,e.anchor=p,!0;else break;if((e.line===n||e.lineIndent>t)&&(vE(e,t,Bx,!0,a)&&(I?S=e.result:x=e.result),I||(BE(e,h,E,C,S,x,n,c),C=S=x=null),cs(e,!0,-1),O=e.input.charCodeAt(e.position)),e.lineIndent>t&&O!==0)Nr(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return I&&BE(e,h,E,C,S,null),T&&(e.tag=f,e.anchor=p,e.kind="mapping",e.result=h),T}function B5e(e){var t,r=!1,s=!1,a,n,c;if(c=e.input.charCodeAt(e.position),c!==33)return!1;if(e.tag!==null&&Nr(e,"duplication of a tag property"),c=e.input.charCodeAt(++e.position),c===60?(r=!0,c=e.input.charCodeAt(++e.position)):c===33?(s=!0,a="!!",c=e.input.charCodeAt(++e.position)):a="!",t=e.position,r){do c=e.input.charCodeAt(++e.position);while(c!==0&&c!==62);e.position<e.length?(n=e.input.slice(t,e.position),c=e.input.charCodeAt(++e.position)):Nr(e,"unexpected end of the stream within a verbatim tag")}else{for(;c!==0&&!fl(c);)c===33&&(s?Nr(e,"tag suffix cannot contain exclamation marks"):(a=e.input.slice(t-1,e.position+1),ote.test(a)||Nr(e,"named tag handle cannot contain such characters"),s=!0,t=e.position+1)),c=e.input.charCodeAt(++e.position);n=e.input.slice(t,e.position),f5e.test(n)&&Nr(e,"tag suffix cannot contain flow indicator characters")}return n&&!ate.test(n)&&Nr(e,"tag name cannot contain such characters: "+n),r?e.tag=n:s0.call(e.tagMap,a)?e.tag=e.tagMap[a]+n:a==="!"?e.tag="!"+n:a==="!!"?e.tag="tag:yaml.org,2002:"+n:Nr(e,'undeclared tag handle "'+a+'"'),!0}function v5e(e){var t,r;if(r=e.input.charCodeAt(e.position),r!==38)return!1;for(e.anchor!==null&&Nr(e,"duplication of an anchor property"),r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!fl(r)&&!wE(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&Nr(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function S5e(e){var t,r,s;if(s=e.input.charCodeAt(e.position),s!==42)return!1;for(s=e.input.charCodeAt(++e.position),t=e.position;s!==0&&!fl(s)&&!wE(s);)s=e.input.charCodeAt(++e.position);return e.position===t&&Nr(e,"name of an alias node must contain at least one character"),r=e.input.slice(t,e.position),s0.call(e.anchorMap,r)||Nr(e,'unidentified alias "'+r+'"'),e.result=e.anchorMap[r],cs(e,!0,-1),!0}function vE(e,t,r,s,a){var n,c,f,p=1,h=!1,E=!1,C,S,x,I,T;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,n=c=f=Bx===r||ste===r,s&&cs(e,!0,-1)&&(h=!0,e.lineIndent>t?p=1:e.lineIndent===t?p=0:e.lineIndent<t&&(p=-1)),p===1)for(;B5e(e)||v5e(e);)cs(e,!0,-1)?(h=!0,f=n,e.lineIndent>t?p=1:e.lineIndent===t?p=0:e.lineIndent<t&&(p=-1)):f=!1;if(f&&(f=h||a),(p===1||Bx===r)&&(wx===r||ite===r?I=t:I=t+1,T=e.position-e.lineStart,p===1?f&&(tte(e,T)||w5e(e,T,I))||I5e(e,I)?E=!0:(c&&C5e(e,I)||y5e(e,I)||E5e(e,I)?E=!0:S5e(e)?(E=!0,(e.tag!==null||e.anchor!==null)&&Nr(e,"alias node should not have any properties")):m5e(e,I,wx===r)&&(E=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):p===0&&(E=f&&tte(e,T))),e.tag!==null&&e.tag!=="!")if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&Nr(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),C=0,S=e.implicitTypes.length;C<S;C+=1)if(x=e.implicitTypes[C],x.resolve(e.result)){e.result=x.construct(e.result),e. Line truncated
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var r=new g5e(e,t),s=e.indexOf("\0");for(s!==-1&&(r.position=s,Nr(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)b5e(r);return r.documents}function Ate(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var s=fte(e,r);if(typeof t!="function")return s;for(var a=0,n=s.length;a<n;a+=1)t(s[a])}function pte(e,t){var r=fte(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new rte("expected a single document in the stream, but found more")}}function D5e(e,t,r){return typeof t=="object"&&t!==null&&typeof r>"u"&&(r=t,t=null),Ate(e,t,Bp.extend({schema:nte},r))}function P5e(e,t){return pte(e,Bp.extend({schema:nte},t))}H2.exports.loadAll=Ate;H2.exports.load=pte;H2.exports.safeLoadAll=D5e;H2.exports.safeLoad=P5e});var Lte=G((rxt,YU)=>{"use strict";var G2=Pg(),q2=EE(),x5e=_2(),k5e=CE(),wte=Object.prototype.toString,Bte=Object.prototype.hasOwnProperty,Q5e=9,j2=10,R5e=13,T5e=32,F5e=33,N5e=34,vte=35,O5e=37,L5e=38,M5e=39,U5e=42,Ste=44,_5e=45,bte=58,H5e=61,j5e=62,G5e=63,q5e=64,Dte=91,Pte=93,Y5e=96,xte=123,W5e=124,kte=125,Vo={};Vo[0]="\\0";Vo[7]="\\a";Vo[8]="\\b";Vo[9]="\\t";Vo[10]="\\n";Vo[11]="\\v";Vo[12]="\\f";Vo[13]="\\r";Vo[27]="\\e";Vo[34]='\\"';Vo[92]="\\\\";Vo[133]="\\N";Vo[160]="\\_";Vo[8232]="\\L";Vo[8233]="\\P";var V5e=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function K5e(e,t){var r,s,a,n,c,f,p;if(t===null)return{};for(r={},s=Object.keys(t),a=0,n=s.length;a<n;a+=1)c=s[a],f=String(t[c]),c.slice(0,2)==="!!"&&(c="tag:yaml.org,2002:"+c.slice(2)),p=e.compiledTypeMap.fallback[c],p&&Bte.call(p.styleAliases,f)&&(f=p.styleAliases[f]),r[c]=f;return r}function dte(e){var t,r,s;if(t=e.toString(16).toUpperCase(),e<=255)r="x",s=2;else if(e<=65535)r="u",s=4;else if(e<=4294967295)r="U",s=8;else throw new q2("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+G2.repeat("0",s-t.length)+t}function J5e(e){this.schema=e.schema||x5e,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=G2.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=K5e(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function gte(e,t){for(var r=G2.repeat(" ",t),s=0,a=-1,n="",c,f=e.length;s<f;)a=e.indexOf(`
`,s),a===-1?(c=e.slice(s),s=f):(c=e.slice(s,a+1),s=a+1),c.length&&c!==`
`&&(n+=r),n+=c;return n}function jU(e,t){return`
`+G2.repeat(" ",e.indent*t)}function z5e(e,t){var r,s,a;for(r=0,s=e.implicitTypes.length;r<s;r+=1)if(a=e.implicitTypes[r],a.resolve(t))return!0;return!1}function qU(e){return e===T5e||e===Q5e}function SE(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==65279||65536<=e&&e<=1114111}function X5e(e){return SE(e)&&!qU(e)&&e!==65279&&e!==R5e&&e!==j2}function mte(e,t){return SE(e)&&e!==65279&&e!==Ste&&e!==Dte&&e!==Pte&&e!==xte&&e!==kte&&e!==bte&&(e!==vte||t&&X5e(t))}function Z5e(e){return SE(e)&&e!==65279&&!qU(e)&&e!==_5e&&e!==G5e&&e!==bte&&e!==Ste&&e!==Dte&&e!==Pte&&e!==xte&&e!==kte&&e!==vte&&e!==L5e&&e!==U5e&&e!==F5e&&e!==W5e&&e!==H5e&&e!==j5e&&e!==M5e&&e!==N5e&&e!==O5e&&e!==q5e&&e!==Y5e}function Qte(e){var t=/^\n* /;return t.test(e)}var Rte=1,Tte=2,Fte=3,Nte=4,bx=5;function $5e(e,t,r,s,a){var n,c,f,p=!1,h=!1,E=s!==-1,C=-1,S=Z5e(e.charCodeAt(0))&&!qU(e.charCodeAt(e.length-1));if(t)for(n=0;n<e.length;n++){if(c=e.charCodeAt(n),!SE(c))return bx;f=n>0?e.charCodeAt(n-1):null,S=S&&mte(c,f)}else{for(n=0;n<e.length;n++){if(c=e.charCodeAt(n),c===j2)p=!0,E&&(h=h||n-C-1>s&&e[C+1]!==" ",C=n);else if(!SE(c))return bx;f=n>0?e.charCodeAt(n-1):null,S=S&&mte(c,f)}h=h||E&&n-C-1>s&&e[C+1]!==" "}return!p&&!h?S&&!a(e)?Rte:Tte:r>9&&Qte(e)?bx:h?Nte:Fte}function e9e(e,t,r,s){e.dump=function(){if(t.length===0)return"''";if(!e.noCompatMode&&V5e.indexOf(t)!==-1)return"'"+t+"'";var a=e.indent*Math.max(1,r),n=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),c=s||e.flowLevel>-1&&r>=e.flowLevel;function f(p){return z5e(e,p)}switch($5e(t,c,e.indent,n,f)){case Rte:return t;case Tte:return"'"+t.replace(/'/g,"''")+"'";case Fte:return"|"+yte(t,e.indent)+Ete(gte(t,a));case Nte:return">"+yte(t,e.indent)+Ete(gte(t9e(t,n),a));case bx:return'"'+r9e(t,n)+'"';default:throw new q2("impossible error: invalid scalar style")}}()}function yte(e,t){var r=Qte(e)?String(t):"",s=e[e.length-1]===`
`,a=s&&(e[e.length-2]===`
`||e===`
`),n=a?"+":s?"":"-";return r+n+`
`}function Ete(e){return e[e.length-1]===`
`?e.slice(0,-1):e}function t9e(e,t){for(var r=/(\n+)([^\n]*)/g,s=function(){var h=e.indexOf(`
`);return h=h!==-1?h:e.length,r.lastIndex=h,Ite(e.slice(0,h),t)}(),a=e[0]===`
`||e[0]===" ",n,c;c=r.exec(e);){var f=c[1],p=c[2];n=p[0]===" ",s+=f+(!a&&!n&&p!==""?`
`:"")+Ite(p,t),a=n}return s}function Ite(e,t){if(e===""||e[0]===" ")return e;for(var r=/ [^ ]/g,s,a=0,n,c=0,f=0,p="";s=r.exec(e);)f=s.index,f-a>t&&(n=c>a?c:f,p+=`
`+e.slice(a,n),a=n+1),c=f;return p+=`
`,e.length-a>t&&c>a?p+=e.slice(a,c)+`
`+e.slice(c+1):p+=e.slice(a),p.slice(1)}function r9e(e){for(var t="",r,s,a,n=0;n<e.length;n++){if(r=e.charCodeAt(n),r>=55296&&r<=56319&&(s=e.charCodeAt(n+1),s>=56320&&s<=57343)){t+=dte((r-55296)*1024+s-56320+65536),n++;continue}a=Vo[r],t+=!a&&SE(r)?e[n]:a||dte(r)}return t}function n9e(e,t,r){var s="",a=e.tag,n,c;for(n=0,c=r.length;n<c;n+=1)Tg(e,t,r[n],!1,!1)&&(n!==0&&(s+=","+(e.condenseFlow?"":" ")),s+=e.dump);e.tag=a,e.dump="["+s+"]"}function i9e(e,t,r,s){var a="",n=e.tag,c,f;for(c=0,f=r.length;c<f;c+=1)Tg(e,t+1,r[c],!0,!0)&&((!s||c!==0)&&(a+=jU(e,t)),e.dump&&j2===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=n,e.dump=a||"[]"}function s9e(e,t,r){var s="",a=e.tag,n=Object.keys(r),c,f,p,h,E;for(c=0,f=n.length;c<f;c+=1)E="",c!==0&&(E+=", "),e.condenseFlow&&(E+='"'),p=n[c],h=r[p],Tg(e,t,p,!1,!1)&&(e.dump.length>1024&&(E+="? "),E+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Tg(e,t,h,!1,!1)&&(E+=e.dump,s+=E));e.tag=a,e.dump="{"+s+"}"}function o9e(e,t,r,s){var a="",n=e.tag,c=Object.keys(r),f,p,h,E,C,S;if(e.sortKeys===!0)c.sort();else if(typeof e.sortKeys=="function")c.sort(e.sortKeys);else if(e.sortKeys)throw new q2("sortKeys must be a boolean or a function");for(f=0,p=c.length;f<p;f+=1)S="",(!s||f!==0)&&(S+=jU(e,t)),h=c[f],E=r[h],Tg(e,t+1,h,!0,!0,!0)&&(C=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,C&&(e.dump&&j2===e.dump.charCodeAt(0)?S+="?":S+="? "),S+=e.dump,C&&(S+=jU(e,t)),Tg(e,t+1,E,!0,C)&&(e.dump&&j2===e.dump.charCodeAt(0)?S+=":":S+=": ",S+=e.dump,a+=S));e.tag=n,e.dump=a||"{}"}function Cte(e,t,r){var s,a,n,c,f,p;for(a=r?e.explicitTypes:e.implicitTypes,n=0,c=a.length;n<c;n+=1)if(f=a[n],(f.instanceOf||f.predicate)&&(!f.instanceOf||typeof t=="object"&&t instanceof f.instanceOf)&&(!f.predicate||f.predicate(t))){if(e.tag=r?f.tag:"?",f.represent){if(p=e.styleMap[f.tag]||f.defaultStyle,wte.call(f.represent)==="[object Function]")s=f.represent(t,p);else if(Bte.call(f.represent,p))s=f.represent[p](t,p);else throw new q2("!<"+f.tag+'> tag resolver accepts not "'+p+'" style');e.dump=s}return!0}return!1}function Tg(e,t,r,s,a,n){e.tag=null,e.dump=r,Cte(e,r,!1)||Cte(e,r,!0);var c=wte.call(e.dump);s&&(s=e.flowLevel<0||e.flowLevel>t);var f=c==="[object Object]"||c==="[object Array]",p,h;if(f&&(p=e.duplicates.indexOf(r),h=p!==-1),(e.tag!==null&&e.tag!=="?"||h||e.indent!==2&&t>0)&&(a=!1),h&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(f&&h&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),c==="[object Object]")s&&Object.keys(e.dump).length!==0?(o9e(e,t,e.dump,a),h&&(e.dump="&ref_"+p+e.dump)):(s9e(e,t,e.dump),h&&(e.dump="&ref_"+p+" "+e.dump));else if(c==="[object Array]"){var E=e.noArrayIndent&&t>0?t-1:t;s&&e.dump.length!==0?(i9e(e,E,e.dump,a),h&&(e.dump="&ref_"+p+e.dump)):(n9e(e,E,e.dump),h&&(e.dump="&ref_"+p+" "+e.dump))}else if(c==="[object String]")e.tag!=="?"&&e9e(e,e.dump,t,n);else{if(e.skipInvalid)return!1;throw new q2("unacceptable kind of an object to dump "+c)}e.tag!==null&&e.tag!=="?"&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function a9e(e,t){var r=[],s=[],a,n;for(GU(e,r,s),a=0,n=s.length;a<n;a+=1)t.duplicates.push(r[s[a]]);t.usedDuplicates=new Array(n)}function GU(e,t,r){var s,a,n;if(e!==null&&typeof e=="object")if(a=t.indexOf(e),a!==-1)r.indexOf(a)===-1&&r.push(a);else if(t.push(e),Array.isArray(e))for(a=0,n=e.length;a<n;a+=1)GU(e[a],t,r);else for(s=Object.keys(e),a=0,n=s.length;a<n;a+=1)GU(e[s[a]],t,r)}function Ote(e,t){t=t||{};var r=new J5e(t);return r.noRefs||a9e(e,r),Tg(r,0,e,!0,!0)?r.dump+`
`:""}function l9e(e,t){return Ote(e,G2.extend({schema:k5e},t))}YU.exports.dump=Ote;YU.exports.safeDump=l9e});var Ute=G((nxt,Yi)=>{"use strict";var Dx=hte(),Mte=Lte();function Px(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}Yi.exports.Type=xs();Yi.exports.Schema=xg();Yi.exports.FAILSAFE_SCHEMA=Ix();Yi.exports.JSON_SCHEMA=OU();Yi.exports.CORE_SCHEMA=LU();Yi.exports.DEFAULT_SAFE_SCHEMA=CE();Yi.exports.DEFAULT_FULL_SCHEMA=_2();Yi.exports.load=Dx.load;Yi.exports.loadAll=Dx.loadAll;Yi.exports.safeLoad=Dx.safeLoad;Yi.exports.safeLoadAll=Dx.safeLoadAll;Yi.exports.dump=Mte.dump;Yi.exports.safeDump=Mte.safeDump;Yi.exports.YAMLException=EE();Yi.exports.MINIMAL_SCHEMA=Ix();Yi.exports.SAFE_SCHEMA=CE();Yi.exports.DEFAULT_SCHEMA=_2();Yi.exports.scan=Px("scan");Yi.exports.parse=Px("parse");Yi.exports.compose=Px("compose");Yi.exports.addConstructor=Px("addConstructor")});var Hte=G((ixt,_te)=>{"use strict";var c9e=Ute();_te.exports=c9e});var Gte=G((sxt,jte)=>{"use strict";function u9e(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}function Fg(e,t,r,s){this.message=e,this.expected=t,this.found=r,this.location=s,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Fg)}u9e(Fg,Error);Fg.buildMessage=function(e,t){var r={literal:function(h){return'"'+a(h.text)+'"'},class:function(h){var E="",C;for(C=0;C<h.parts.length;C++)E+=h.parts[C]instanceof Array?n(h.parts[C][0])+"-"+n(h.parts[C][1]):n(h.parts[C]);return"["+(h.inverted?"^":"")+E+"]"},any:function(h){return"any character"},end:function(h){return"end of input"},other:function(h){return h.description}};function s(h){return h.charCodeAt(0).toString(16).toUpperCase()}function a(h){return h.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(E){return"\\x0"+s(E)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(E){return"\\x"+s(E)})}function n(h){return h.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(E){return"\\x0"+s(E)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(E){return"\\x"+s(E)})}function c(h){return r[h.type](h)}function f(h){var E=new Array(h.length),C,S;for(C=0;C<h.length;C++)E[C]=c(h[C]);if(E.sort(),E.length>0){for(C=1,S=1;C<E.length;C++)E[C-1]!==E[C]&&(E[S]=E[C],S++);E.length=S}switch(E.length){case 1:return E[0];case 2:return E[0]+" or "+E[1];default:return E.slice(0,-1).join(", ")+", or "+E[E.length-1]}}function p(h){return h?'"'+a(h)+'"':"end of input"}return"Expected "+f(e)+" but "+p(t)+" found."};function f9e(e,t){t=t!==void 0?t:{};var r={},s={Start:fc},a=fc,n=function(te){return[].concat(...te)},c="-",f=yn("-",!1),p=function(te){return te},h=function(te){return Object.assign({},...te)},E="#",C=yn("#",!1),S=fu(),x=function(){return{}},I=":",T=yn(":",!1),O=function(te,ye){return{[te]:ye}},U=",",V=yn(",",!1),$=function(te,ye){return ye},ie=function(te,ye,Oe){return Object.assign({},...[te].concat(ye).map(mt=>({[mt]:Oe})))},fe=function(te){return te},ae=function(te){return te},ge=Wa("correct indentation"),he=" ",Ce=yn(" ",!1),Ee=function(te){return te.length===lr*St},d=function(te){return te.length===(lr+1)*St},Se=function(){return lr++,!0},Be=function(){return lr--,!0},me=function(){return ha()},ue=Wa("pseudostring"),Z=/^[^\r\n\t ?:,\][{}#&*!|>'"%@`\-]/,be=Zn(["\r",`
`," "," ","?",":",",","]","[","{","}","#","&","*","!","|",">","'",'"',"%","@","`","-"],!0,!1),Qe=/^[^\r\n\t ,\][{}:#"']/,ot=Zn(["\r",`
`," "," ",",","]","[","{","}",":","#",'"',"'"],!0,!1),_=function(){return ha().replace(/^ *| *$/g,"")},tt="--",Ne=yn("--",!1),ke=/^[a-zA-Z\/0-9]/,De=Zn([["a","z"],["A","Z"],"/",["0","9"]],!1,!1),je=/^[^\r\n\t :,]/,Re=Zn(["\r",`
`," "," ",":",","],!0,!1),ct="null",Me=yn("null",!1),P=function(){return null},w="true",D=yn("true",!1),y=function(){return!0},F="false",z=yn("false",!1),X=function(){return!1},ee=Wa("string"),se='"',xe=yn('"',!1),Fe=function(){return""},ut=function(te){return te},Ct=function(te){return te.join("")},Yt=/^[^"\\\0-\x1F\x7F]/,ir=Zn(['"',"\\",["\0",""],"\x7F"],!0,!1),Pt='\\"',mn=yn('\\"',!1),Pr=function(){return'"'},Cr="\\\\",Lr=yn("\\\\",!1),on=function(){return"\\"},ci="\\/",Do=yn("\\/",!1),is=function(){return"/"},ao="\\b",Po=yn("\\b",!1),ji=function(){return"\b"},lo="\\f",xo=yn("\\f",!1),FA=function(){return"\f"},df="\\n",mh=yn("\\n",!1),yh=function(){return`
`},co="\\r",qn=yn("\\r",!1),Ns=function(){return"\r"},uo="\\t",ou=yn("\\t",!1),au=function(){return" "},lu="\\u",NA=yn("\\u",!1),OA=function(te,ye,Oe,mt){return String.fromCharCode(parseInt(`0x${te}${ye}${Oe}${mt}`))},Aa=/^[0-9a-fA-F]/,pa=Zn([["0","9"],["a","f"],["A","F"]],!1,!1),LA=Wa("blank space"),gr=/^[ \t]/,ko=Zn([" "," "],!1,!1),qa=Wa("white space"),Ue=/^[ \t\n\r]/,wr=Zn([" "," ",`
`,"\r"],!1,!1),gf=`\r
`,MA=yn(`\r
`,!1),UA=`
`,cu=yn(`
`,!1),uu="\r",cc=yn("\r",!1),we=0,Ot=0,uc=[{line:1,column:1}],Oi=0,fo=[],Tt=0,Rn;if("startRule"in t){if(!(t.startRule in s))throw new Error(`Can't start parsing from rule "`+t.startRule+'".');a=s[t.startRule]}function ha(){return e.substring(Ot,we)}function Gi(){return Ka(Ot,we)}function Li(te,ye){throw ye=ye!==void 0?ye:Ka(Ot,we),mf([Wa(te)],e.substring(Ot,we),ye)}function Ya(te,ye){throw ye=ye!==void 0?ye:Ka(Ot,we),Ja(te,ye)}function yn(te,ye){return{type:"literal",text:te,ignoreCase:ye}}function Zn(te,ye,Oe){return{type:"class",parts:te,inverted:ye,ignoreCase:Oe}}function fu(){return{type:"any"}}function Eh(){return{type:"end"}}function Wa(te){return{type:"other",description:te}}function Va(te){var ye=uc[te],Oe;if(ye)return ye;for(Oe=te-1;!uc[Oe];)Oe--;for(ye=uc[Oe],ye={line:ye.line,column:ye.column};Oe<te;)e.charCodeAt(Oe)===10?(ye.line++,ye.column=1):ye.column++,Oe++;return uc[te]=ye,ye}function Ka(te,ye){var Oe=Va(te),mt=Va(ye);return{start:{offset:te,line:Oe.line,column:Oe.column},end:{offset:ye,line:mt.line,column:mt.column}}}function $e(te){we<Oi||(we>Oi&&(Oi=we,fo=[]),fo.push(te))}function Ja(te,ye){return new Fg(te,null,null,ye)}function mf(te,ye,Oe){return new Fg(Fg.buildMessage(te,ye),te,ye,Oe)}function fc(){var te;return te=_A(),te}function Sn(){var te,ye,Oe;for(te=we,ye=[],Oe=da();Oe!==r;)ye.push(Oe),Oe=da();return ye!==r&&(Ot=te,ye=n(ye)),te=ye,te}function da(){var te,ye,Oe,mt,Et;return te=we,ye=Ql(),ye!==r?(e.charCodeAt(we)===45?(Oe=c,we++):(Oe=r,Tt===0&&$e(f)),Oe!==r?(mt=Fn(),mt!==r?(Et=ga(),Et!==r?(Ot=te,ye=p(Et),te=ye):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r),te}function _A(){var te,ye,Oe;for(te=we,ye=[],Oe=HA();Oe!==r;)ye.push(Oe),Oe=HA();return ye!==r&&(Ot=te,ye=h(ye)),te=ye,te}function HA(){var te,ye,Oe,mt,Et,Dt,tr,pn,ui;if(te=we,ye=Fn(),ye===r&&(ye=null),ye!==r){if(Oe=we,e.charCodeAt(we)===35?(mt=E,we++):(mt=r,Tt===0&&$e(C)),mt!==r){if(Et=[],Dt=we,tr=we,Tt++,pn=at(),Tt--,pn===r?tr=void 0:(we=tr,tr=r),tr!==r?(e.length>we?(pn=e.charAt(we),we++):(pn=r,Tt===0&&$e(S)),pn!==r?(tr=[tr,pn],Dt=tr):(we=Dt,Dt=r)):(we=Dt,Dt=r),Dt!==r)for(;Dt!==r;)Et.push(Dt),Dt=we,tr=we,Tt++,pn=at(),Tt--,pn===r?tr=void 0:(we=tr,tr=r),tr!==r?(e.length>we?(pn=e.charAt(we),we++):(pn=r,Tt===0&&$e(S)),pn!==r?(tr=[tr,pn],Dt=tr):(we=Dt,Dt=r)):(we=Dt,Dt=r);else Et=r;Et!==r?(mt=[mt,Et],Oe=mt):(we=Oe,Oe=r)}else we=Oe,Oe=r;if(Oe===r&&(Oe=null),Oe!==r){if(mt=[],Et=ze(),Et!==r)for(;Et!==r;)mt.push(Et),Et=ze();else mt=r;mt!==r?(Ot=te,ye=x(),te=ye):(we=te,te=r)}else we=te,te=r}else we=te,te=r;if(te===r&&(te=we,ye=Ql(),ye!==r?(Oe=za(),Oe!==r?(mt=Fn(),mt===r&&(mt=null),mt!==r?(e.charCodeAt(we)===58?(Et=I,we++):(Et=r,Tt===0&&$e(T)),Et!==r?(Dt=Fn(),Dt===r&&(Dt=null),Dt!==r?(tr=ga(),tr!==r?(Ot=te,ye=O(Oe,tr),te=ye):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r),te===r&&(te=we,ye=Ql(),ye!==r?(Oe=ss(),Oe!==r?(mt=Fn(),mt===r&&(mt=null),mt!==r?(e.charCodeAt(we)===58?(Et=I,we++):(Et=r,Tt===0&&$e(T)),Et!==r?(Dt=Fn(),Dt===r&&(Dt=null),Dt!==r?(tr=ga(),tr!==r?(Ot=te,ye=O(Oe,tr),te=ye):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r),te===r))){if(te=we,ye=Ql(),ye!==r)if(Oe=ss(),Oe!==r)if(mt=Fn(),mt!==r)if(Et=Au(),Et!==r){if(Dt=[],tr=ze(),tr!==r)for(;tr!==r;)Dt.push(tr),tr=ze();else Dt=r;Dt!==r?(Ot=te,ye=O(Oe,Et),te=ye):(we=te,te=r)}else we=te,te=r;else we=te,te=r;else we=te,te=r;else we=te,te=r;if(te===r)if(te=we,ye=Ql(),ye!==r)if(Oe=ss(),Oe!==r){if(mt=[],Et=we,Dt=Fn(),Dt===r&&(Dt=null),Dt!==r?(e.charCodeAt(we)===44?(tr=U,we++):(tr=r,Tt===0&&$e(V)),tr!==r?(pn=Fn(),pn===r&&(pn=null),pn!==r?(ui=ss(),ui!==r?(Ot=Et,Dt=$(Oe,ui),Et=Dt):(we=Et,Et=r)):(we=Et,Et=r)):(we=Et,Et=r)):(we=Et,Et=r),Et!==r)for(;Et!==r;)mt.push(Et),Et=we,Dt=Fn(),Dt===r&&(Dt=null),Dt!==r?(e.charCodeAt(we)===44?(tr=U,we++):(tr=r,Tt===0&&$e(V)),tr!==r?(pn=Fn(),pn===r&&(pn=null),pn!==r?(ui=ss(),ui!==r?(Ot=Et,Dt=$(Oe,ui),Et=Dt):(we=Et,Et=r)):(we=Et,Et=r)):(we=Et,Et=r)):(we=Et,Et=r);else mt=r;mt!==r?(Et=Fn(),Et===r&&(Et=null),Et!==r?(e.charCodeAt(we)===58?(Dt=I,we++):(Dt=r,Tt===0&&$e(T)),Dt!==r?(tr=Fn(),tr===r&&(tr=null),tr!==r?(pn=ga(),pn!==r?(Ot=te,ye=ie(Oe,mt,pn),te=ye):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)}else we=te,te=r;else we=te,te=r}return te}function ga(){var te,ye,Oe,mt,Et,Dt,tr;if(te=we,ye=we,Tt++,Oe=we,mt=at(),mt!==r?(Et=Ut(),Et!==r?(e.charCodeAt(we)===45?(Dt=c,we++):(Dt=r,Tt===0&&$e(f)),Dt!==r?(tr=Fn(),tr!==r?(mt=[mt,Et,Dt,tr],Oe=mt):(we=Oe,Oe=r)):(we=Oe,Oe=r)):(we=Oe,Oe=r)):(we=Oe,Oe=r),Tt--,Oe!==r?(we=ye,ye=void 0):ye=r,ye!==r?(Oe=ze(),Oe!==r?(mt=Tn(),mt!==r?(Et=Sn(),Et!==r?(Dt=ma(),Dt!==r?(Ot=te,ye=fe(Et),te=ye):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r),te===r&&(te=we,ye=at(),ye!==r?(Oe=Tn(),Oe!==r?(mt=_A(),mt!==r?(Et=ma(),Et!==r?(Ot=te,ye=fe(mt),te=ye):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r),te===r))if(te=we,ye=Ac(),ye!==r){if(Oe=[],mt=ze(),mt!==r)for(;mt!==r;)Oe.push(mt),mt=ze();else Oe=r;Oe!==r?(Ot=te,ye=aLine truncated
`;if(typeof e=="number"||typeof e=="boolean")return`${e.toString()}
`;if(typeof e=="string")return`${Yte(e)}
`;if(Array.isArray(e)){if(e.length===0)return`[]
`;let s=" ".repeat(t);return`
${e.map(n=>`${s}- ${WU(n,t+1,!1)}`).join("")}`}if(typeof e=="object"&&e){let[s,a]=e instanceof xx?[e.data,!1]:[e,!0],n=" ".repeat(t),c=Object.keys(s);a&&c.sort((p,h)=>{let E=qte.indexOf(p),C=qte.indexOf(h);return E===-1&&C===-1?p<h?-1:p>h?1:0:E!==-1&&C===-1?-1:E===-1&&C!==-1?1:E-C});let f=c.filter(p=>!Vte(s[p])).map((p,h)=>{let E=s[p],C=Yte(p),S=WU(E,t+1,!0),x=h>0||r?n:"",I=C.length>1024?`? ${C}
${x}:`:`${C}:`,T=S.startsWith(`
`)?S:` ${S}`;return`${x}${I}${T}`}).join(t===0?`
`:"")||`
`;return r?`
${f}`:`${f}`}throw new Error(`Unsupported value type (${e})`)}function Al(e){try{let t=WU(e,0,!1);return t!==`
`?t:""}catch(t){throw t.location&&(t.message=t.message.replace(/(\.)?$/,` (line ${t.location.start.line}, column ${t.location.start.column})$1`)),t}}function p9e(e){return e.endsWith(`
`)||(e+=`
`),(0,Wte.parse)(e)}function d9e(e){if(h9e.test(e))return p9e(e);let t=(0,kx.safeLoad)(e,{schema:kx.FAILSAFE_SCHEMA,json:!0});if(t==null)return{};if(typeof t!="object")throw new Error(`Expected an indexed object, got a ${typeof t} instead. Does your file follow Yaml's rules?`);if(Array.isArray(t))throw new Error("Expected an indexed object, got an array instead. Does your file follow Yaml's rules?");return t}function us(e){return d9e(e)}var kx,Wte,A9e,qte,xx,h9e,Kte=Xe(()=>{kx=et(Hte()),Wte=et(Gte()),A9e=/^(?![-?:,\][{}#&*!|>'"%@` \t\r\n]).([ \t]*(?![,\][{}:# \t\r\n]).)*$/,qte=["__metadata","version","resolution","dependencies","peerDependencies","dependenciesMeta","peerDependenciesMeta","binaries"],xx=class{constructor(t){this.data=t}};Al.PreserveOrdering=xx;h9e=/^(#.*(\r?\n))*?#\s+yarn\s+lockfile\s+v1\r?\n/i});var Y2={};Vt(Y2,{parseResolution:()=>mx,parseShell:()=>hx,parseSyml:()=>us,stringifyArgument:()=>RU,stringifyArgumentSegment:()=>TU,stringifyArithmeticExpression:()=>gx,stringifyCommand:()=>QU,stringifyCommandChain:()=>yE,stringifyCommandChainThen:()=>kU,stringifyCommandLine:()=>dx,stringifyCommandLineThen:()=>xU,stringifyEnvSegment:()=>px,stringifyRedirectArgument:()=>M2,stringifyResolution:()=>yx,stringifyShell:()=>mE,stringifyShellLine:()=>mE,stringifySyml:()=>Al,stringifyValueArgument:()=>Sg});var Sc=Xe(()=>{V$();X$();Kte()});var zte=G((uxt,VU)=>{"use strict";var g9e=e=>{let t=!1,r=!1,s=!1;for(let a=0;a<e.length;a++){let n=e[a];t&&/[a-zA-Z]/.test(n)&&n.toUpperCase()===n?(e=e.slice(0,a)+"-"+e.slice(a),t=!1,s=r,r=!0,a++):r&&s&&/[a-zA-Z]/.test(n)&&n.toLowerCase()===n?(e=e.slice(0,a-1)+"-"+e.slice(a-1),s=r,r=!1,t=!0):(t=n.toLowerCase()===n&&n.toUpperCase()!==n,s=r,r=n.toUpperCase()===n&&n.toLowerCase()!==n)}return e},Jte=(e,t)=>{if(!(typeof e=="string"||Array.isArray(e)))throw new TypeError("Expected the input to be `string | string[]`");t=Object.assign({pascalCase:!1},t);let r=a=>t.pascalCase?a.charAt(0).toUpperCase()+a.slice(1):a;return Array.isArray(e)?e=e.map(a=>a.trim()).filter(a=>a.length).join("-"):e=e.trim(),e.length===0?"":e.length===1?t.pascalCase?e.toUpperCase():e.toLowerCase():(e!==e.toLowerCase()&&(e=g9e(e)),e=e.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(a,n)=>n.toUpperCase()).replace(/\d+(\w|$)/g,a=>a.toUpperCase()),r(e))};VU.exports=Jte;VU.exports.default=Jte});var Xte=G((fxt,m9e)=>{m9e.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB Line truncated
${this.candidates.map(({usage:a})=>`$ ${a}`).join(`
`)}`}else if(this.candidates.length===1){let[{usage:s}]=this.candidates;this.message=`Command not found; did you mean:
$ ${s}
${XU(t)}`}else this.message=`Command not found; did you mean one of:
${this.candidates.map(({usage:s},a)=>`${`${a}.`.padStart(4)} ${s}`).join(`
`)}
${XU(t)}`}},Tx=class extends Error{constructor(t,r){super(),this.input=t,this.usages=r,this.clipanion={type:"none"},this.name="AmbiguousSyntaxError",this.message=`Cannot find which to pick amongst the following alternatives:
${this.usages.map((s,a)=>`${`${a}.`.padStart(4)} ${s}`).join(`
`)}
${XU(t)}`}},XU=e=>`While running ${e.filter(t=>t!==ii.EndOfInput&&t!==ii.EndOfPartialInput).map(t=>{let r=JSON.stringify(t);return t.match(/\s/)||t.length===0||r!==`"${t}"`?r:t}).join(" ")}`});function y9e(e){let t=e.split(`
`),r=t.filter(a=>a.match(/\S/)),s=r.length>0?r.reduce((a,n)=>Math.min(a,n.length-n.trimStart().length),Number.MAX_VALUE):0;return t.map(a=>a.slice(s).trimRight()).join(`
`)}function Ko(e,{format:t,paragraphs:r}){return e=e.replace(/\r\n?/g,`
`),e=y9e(e),e=e.replace(/^\n+|\n+$/g,""),e=e.replace(/^(\s*)-([^\n]*?)\n+/gm,`$1-$2
`),e=e.replace(/\n(\n)?\n*/g,(s,a)=>a||" "),r&&(e=e.split(/\n/).map(s=>{let a=s.match(/^\s*[*-][\t ]+(.*)/);if(!a)return s.match(/(.{1,80})(?: |$)/g).join(`
`);let n=s.length-s.trimStart().length;return a[1].match(new RegExp(`(.{1,${78-n}})(?: |$)`,"g")).map((c,f)=>" ".repeat(n)+(f===0?"- ":" ")+c).join(`
`)}).join(`
`)),e=e.replace(/(`+)((?:.|[\n])*?)\1/g,(s,a,n)=>t.code(a+n+a)),e=e.replace(/(\*\*)((?:.|[\n])*?)\1/g,(s,a,n)=>t.bold(a+n+a)),e?`${e}
`:""}var ZU,tre,rre,$U=Xe(()=>{ZU=Array(80).fill("\u2501");for(let e=0;e<=24;++e)ZU[ZU.length-e]=`\x1B[38;5;${232+e}m\u2501`;tre={header:e=>`\x1B[1m\u2501\u2501\u2501 ${e}${e.length<75?` ${ZU.slice(e.length+5).join("")}`:":"}\x1B[0m`,bold:e=>`\x1B[1m${e}\x1B[22m`,error:e=>`\x1B[31m\x1B[1m${e}\x1B[22m\x1B[39m`,code:e=>`\x1B[36m${e}\x1B[39m`},rre={header:e=>e,bold:e=>e,error:e=>e,code:e=>e}});function va(e){return{...e,[W2]:!0}}function Wf(e,t){return typeof e>"u"?[e,t]:typeof e=="object"&&e!==null&&!Array.isArray(e)?[void 0,e]:[e,t]}function Nx(e,{mergeName:t=!1}={}){let r=e.match(/^([^:]+): (.*)$/m);if(!r)return"validation failed";let[,s,a]=r;return t&&(a=a[0].toLowerCase()+a.slice(1)),a=s!=="."||!t?`${s.replace(/^\.(\[|$)/,"$1")}: ${a}`:`: ${a}`,a}function V2(e,t){return t.length===1?new st(`${e}${Nx(t[0],{mergeName:!0})}`):new st(`${e}:
${t.map(r=>`
- ${Nx(r)}`).join("")}`)}function Lg(e,t,r){if(typeof r>"u")return t;let s=[],a=[],n=f=>{let p=t;return t=f,n.bind(null,p)};if(!r(t,{errors:s,coercions:a,coercion:n}))throw V2(`Invalid value for ${e}`,s);for(let[,f]of a)f();return t}var W2,vp=Xe(()=>{Fx();W2=Symbol("clipanion/isOption")});var qs={};Vt(qs,{KeyRelationship:()=>Vf,TypeAssertionError:()=>a0,applyCascade:()=>J2,as:()=>L9e,assert:()=>F9e,assertWithErrors:()=>N9e,cascade:()=>l0,fn:()=>M9e,hasAtLeastOneKey:()=>o_,hasExactLength:()=>are,hasForbiddenKeys:()=>nqe,hasKeyRelationship:()=>X2,hasMaxLength:()=>_9e,hasMinLength:()=>U9e,hasMutuallyExclusiveKeys:()=>iqe,hasRequiredKeys:()=>rqe,hasUniqueItems:()=>H9e,isArray:()=>Ox,isAtLeast:()=>i_,isAtMost:()=>q9e,isBase64:()=>Z9e,isBoolean:()=>b9e,isDate:()=>P9e,isDict:()=>Q9e,isEnum:()=>Qs,isHexColor:()=>X9e,isISO8601:()=>z9e,isInExclusiveRange:()=>W9e,isInInclusiveRange:()=>Y9e,isInstanceOf:()=>T9e,isInteger:()=>s_,isJSON:()=>$9e,isLiteral:()=>ire,isLowerCase:()=>V9e,isMap:()=>k9e,isNegative:()=>j9e,isNullable:()=>tqe,isNumber:()=>r_,isObject:()=>sre,isOneOf:()=>n_,isOptional:()=>eqe,isPartial:()=>R9e,isPayload:()=>D9e,isPositive:()=>G9e,isRecord:()=>Mx,isSet:()=>x9e,isString:()=>Jf,isTuple:()=>Lx,isUUID4:()=>J9e,isUnknown:()=>t_,isUpperCase:()=>K9e,makeTrait:()=>ore,makeValidator:()=>Wr,matchesRegExp:()=>Sp,softAssert:()=>O9e});function si(e){return e===null?"null":e===void 0?"undefined":e===""?"an empty string":typeof e=="symbol"?`<${e.toString()}>`:Array.isArray(e)?"an array":JSON.stringify(e)}function DE(e,t){if(e.length===0)return"nothing";if(e.length===1)return si(e[0]);let r=e.slice(0,-1),s=e[e.length-1],a=e.length>2?`, ${t} `:` ${t} `;return`${r.map(n=>si(n)).join(", ")}${a}${si(s)}`}function o0(e,t){var r,s,a;return typeof t=="number"?`${(r=e?.p)!==null&&r!==void 0?r:"."}[${t}]`:E9e.test(t)?`${(s=e?.p)!==null&&s!==void 0?s:""}.${t}`:`${(a=e?.p)!==null&&a!==void 0?a:"."}[${JSON.stringify(t)}]`}function e_(e,t,r){return e===1?t:r}function yr({errors:e,p:t}={},r){return e?.push(`${t??"."}: ${r}`),!1}function v9e(e,t){return r=>{e[t]=r}}function Kf(e,t){return r=>{let s=e[t];return e[t]=r,Kf(e,t).bind(null,s)}}function K2(e,t,r){let s=()=>(e(r()),a),a=()=>(e(t),s);return s}function t_(){return Wr({test:(e,t)=>!0})}function ire(e){return Wr({test:(t,r)=>t!==e?yr(r,`Expected ${si(e)} (got ${si(t)})`):!0})}function Jf(){return Wr({test:(e,t)=>typeof e!="string"?yr(t,`Expected a string (got ${si(e)})`):!0})}function Qs(e){let t=Array.isArray(e)?e:Object.values(e),r=t.every(a=>typeof a=="string"||typeof a=="number"),s=new Set(t);return s.size===1?ire([...s][0]):Wr({test:(a,n)=>s.has(a)?!0:r?yr(n,`Expected one of ${DE(t,"or")} (got ${si(a)})`):yr(n,`Expected a valid enumeration value (got ${si(a)})`)})}function b9e(){return Wr({test:(e,t)=>{var r;if(typeof e!="boolean"){if(typeof t?.coercions<"u"){if(typeof t?.coercion>"u")return yr(t,"Unbound coercion result");let s=S9e.get(e);if(typeof s<"u")return t.coercions.push([(r=t.p)!==null&&r!==void 0?r:".",t.coercion.bind(null,s)]),!0}return yr(t,`Expected a boolean (got ${si(e)})`)}return!0}})}function r_(){return Wr({test:(e,t)=>{var r;if(typeof e!="number"){if(typeof t?.coercions<"u"){if(typeof t?.coercion>"u")return yr(t,"Unbound coercion result");let s;if(typeof e=="string"){let a;try{a=JSON.parse(e)}catch{}if(typeof a=="number")if(JSON.stringify(a)===e)s=a;else return yr(t,`Received a number that can't be safely represented by the runtime (${e})`)}if(typeof s<"u")return t.coercions.push([(r=t.p)!==null&&r!==void 0?r:".",t.coercion.bind(null,s)]),!0}return yr(t,`Expected a number (got ${si(e)})`)}return!0}})}function D9e(e){return Wr({test:(t,r)=>{var s;if(typeof r?.coercions>"u")return yr(r,"The isPayload predicate can only be used with coercion enabled");if(typeof r.coercion>"u")return yr(r,"Unbound coercion result");if(typeof t!="string")return yr(r,`Expected a string (got ${si(t)})`);let a;try{a=JSON.parse(t)}catch{return yr(r,`Expected a JSON string (got ${si(t)})`)}let n={value:a};return e(a,Object.assign(Object.assign({},r),{coercion:Kf(n,"value")}))?(r.coercions.push([(s=r.p)!==null&&s!==void 0?s:".",r.coercion.bind(null,n.value)]),!0):!1}})}function P9e(){return Wr({test:(e,t)=>{var r;if(!(e instanceof Date)){if(typeof t?.coercions<"u"){if(typeof t?.coercion>"u")return yr(t,"Unbound coercion result");let s;if(typeof e=="string"&&nre.test(e))s=new Date(e);else{let a;if(typeof e=="string"){let n;try{n=JSON.parse(e)}catch{}typeof n=="number"&&(a=n)}else typeof e=="number"&&(a=e);if(typeof a<"u")if(Number.isSafeInteger(a)||!Number.isSafeInteger(a*1e3))s=new Date(a*1e3);else return yr(t,`Received a timestamp that can't be safely represented by the runtime (${e})`)}if(typeof s<"u")return t.coercions.push([(r=t.p)!==null&&r!==void 0?r:".",t.coercion.bind(null,s)]),!0}return yr(t,`Expected a date (got ${si(e)})`)}return!0}})}function Ox(e,{delimiter:t}={}){return Wr({test:(r,s)=>{var a;let n=r;if(typeof r=="string"&&typeof t<"u"&&typeof s?.coercions<"u"){iLine truncated
`;for(let s of t)r+=`
- ${s}`}super(r)}};z2={missing:(e,t)=>e.has(t),undefined:(e,t,r)=>e.has(t)&&typeof r[t]<"u",nil:(e,t,r)=>e.has(t)&&r[t]!=null,falsy:(e,t,r)=>e.has(t)&&!!r[t]};(function(e){e.Forbids="Forbids",e.Requires="Requires"})(Vf||(Vf={}));sqe={[Vf.Forbids]:{expect:!1,message:"forbids using"},[Vf.Requires]:{expect:!0,message:"requires using"}}});var it,c0=Xe(()=>{vp();it=class{constructor(){this.help=!1}static Usage(t){return t}async catch(t){throw t}async validateAndExecute(){let r=this.constructor.schema;if(Array.isArray(r)){let{isDict:a,isUnknown:n,applyCascade:c}=await Promise.resolve().then(()=>(Jo(),qs)),f=c(a(n()),r),p=[],h=[];if(!f(this,{errors:p,coercions:h}))throw V2("Invalid option schema",p);for(let[,C]of h)C()}else if(r!=null)throw new Error("Invalid command schema");let s=await this.execute();return typeof s<"u"?s:0}};it.isOption=W2;it.Default=[]});function pl(e){zU&&console.log(e)}function cre(){let e={nodes:[]};for(let t=0;t<Cn.CustomNode;++t)e.nodes.push(Vl());return e}function oqe(e){let t=cre(),r=[],s=t.nodes.length;for(let a of e){r.push(s);for(let n=0;n<a.nodes.length;++n)fre(n)||t.nodes.push(hqe(a.nodes[n],s));s+=a.nodes.length-Cn.CustomNode+1}for(let a of r)PE(t,Cn.InitialNode,a);return t}function Nu(e,t){return e.nodes.push(t),e.nodes.length-1}function aqe(e){let t=new Set,r=s=>{if(t.has(s))return;t.add(s);let a=e.nodes[s];for(let c of Object.values(a.statics))for(let{to:f}of c)r(f);for(let[,{to:c}]of a.dynamics)r(c);for(let{to:c}of a.shortcuts)r(c);let n=new Set(a.shortcuts.map(({to:c})=>c));for(;a.shortcuts.length>0;){let{to:c}=a.shortcuts.shift(),f=e.nodes[c];for(let[p,h]of Object.entries(f.statics)){let E=Object.prototype.hasOwnProperty.call(a.statics,p)?a.statics[p]:a.statics[p]=[];for(let C of h)E.some(({to:S})=>C.to===S)||E.push(C)}for(let[p,h]of f.dynamics)a.dynamics.some(([E,{to:C}])=>p===E&&h.to===C)||a.dynamics.push([p,h]);for(let p of f.shortcuts)n.has(p.to)||(a.shortcuts.push(p),n.add(p.to))}};r(Cn.InitialNode)}function lqe(e,{prefix:t=""}={}){if(zU){pl(`${t}Nodes are:`);for(let r=0;r<e.nodes.length;++r)pl(`${t} ${r}: ${JSON.stringify(e.nodes[r])}`)}}function cqe(e,t,r=!1){pl(`Running a vm on ${JSON.stringify(t)}`);let s=[{node:Cn.InitialNode,state:{candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,options:[],path:[],positionals:[],remainder:null,selectedIndex:null,partial:!1,tokens:[]}}];lqe(e,{prefix:" "});let a=[ii.StartOfInput,...t];for(let n=0;n<a.length;++n){let c=a[n],f=c===ii.EndOfInput||c===ii.EndOfPartialInput,p=n-1;pl(` Processing ${JSON.stringify(c)}`);let h=[];for(let{node:E,state:C}of s){pl(` Current node is ${E}`);let S=e.nodes[E];if(E===Cn.ErrorNode){h.push({node:E,state:C});continue}console.assert(S.shortcuts.length===0,"Shortcuts should have been eliminated by now");let x=Object.prototype.hasOwnProperty.call(S.statics,c);if(!r||n<a.length-1||x)if(x){let I=S.statics[c];for(let{to:T,reducer:O}of I)h.push({node:T,state:typeof O<"u"?Ux(l_,O,C,c,p):C}),pl(` Static transition to ${T} found`)}else pl(" No static transition found");else{let I=!1;for(let T of Object.keys(S.statics))if(T.startsWith(c)){if(c===T)for(let{to:O,reducer:U}of S.statics[T])h.push({node:O,state:typeof U<"u"?Ux(l_,U,C,c,p):C}),pl(` Static transition to ${O} found`);else for(let{to:O}of S.statics[T])h.push({node:O,state:{...C,remainder:T.slice(c.length)}}),pl(` Static transition to ${O} found (partial match)`);I=!0}I||pl(" No partial static transition found")}if(!f)for(let[I,{to:T,reducer:O}]of S.dynamics)Ux(dqe,I,C,c,p)&&(h.push({node:T,state:typeof O<"u"?Ux(l_,O,C,c,p):C}),pl(` Dynamic transition to ${T} found (via ${I})`))}if(h.length===0&&f&&t.length===1)return[{node:Cn.InitialNode,state:lre}];if(h.length===0)throw new bE(t,s.filter(({node:E})=>E!==Cn.ErrorNode).map(({state:E})=>({usage:E.candidateUsage,reason:null})));if(h.every(({node:E})=>E===Cn.ErrorNode))throw new bE(t,h.map(({state:E})=>({usage:E.candidateUsage,reason:E.errorMessage})));s=fqe(h)}if(s.length>0){pl(" Results:");for(let n of s)pl(` - ${n.node} -> ${JSON.stringify(n.state)}`)}else pl(" No results");return s}function uqe(e,t,{endToken:r=ii.EndOfInput}={}){let s=cqe(e,[...t,r]);return Aqe(t,s.map(({state:a})=>a))}function fqe(e){let t=0;for(let{state:r}of e)r.path.length>t&&(t=r.path.length);return e.filter(({state:r})=>r.path.length===t)}function Aqe(e,t){let r=t.filter(S=>S.selectedIndex!==null),s=r.filter(S=>!S.partial);if(s.length>0&&(r=s),r.length===0)throw new Error;let a=r.filter(S=>S.selectedIndex===Og||S.requiredOptions.every(x=>x.some(I=>S.options.find(T=>T.name===I))));if(a.length===0)throw new bE(e,r.map(S=>({usage:S.candidateUsage,reason:null})));let n=0;for(let S of a)S.path.length>n&&(n=S.path.length);let c=a.filter(S=>S.path.length===n),f=S=>S.positionals.filter(({extra:x})=>!x).length+S.options.length,p=c.map(S=>({state:S,positionalCount:f(S)})),h=0;for(let{positionalCount:S}of p)S>h&&(h=S);let E=p.filter(({positionalCount:S})=>S===h).map(({state:S Line truncated
`),this.context.stdout.write(`
`);let r=0;for(let s of this.commands)this.context.stdout.write(this.cli.usage(this.contexts[s].commandClass,{prefix:`${r++}. `.padStart(5)}));this.context.stdout.write(`
`),this.context.stdout.write(`Run again with -h=<index> to see the longer details of any of those commands.
`)}}}});async function Ere(...e){let{resolvedOptions:t,resolvedCommandClasses:r,resolvedArgv:s,resolvedContext:a}=Cre(e);return ba.from(r,t).runExit(s,a)}async function Ire(...e){let{resolvedOptions:t,resolvedCommandClasses:r,resolvedArgv:s,resolvedContext:a}=Cre(e);return ba.from(r,t).run(s,a)}function Cre(e){let t,r,s,a;switch(typeof process<"u"&&typeof process.argv<"u"&&(s=process.argv.slice(2)),e.length){case 1:r=e[0];break;case 2:e[0]&&e[0].prototype instanceof it||Array.isArray(e[0])?(r=e[0],Array.isArray(e[1])?s=e[1]:a=e[1]):(t=e[0],r=e[1]);break;case 3:Array.isArray(e[2])?(t=e[0],r=e[1],s=e[2]):e[0]&&e[0].prototype instanceof it||Array.isArray(e[0])?(r=e[0],s=e[1],a=e[2]):(t=e[0],r=e[1],a=e[2]);break;default:t=e[0],r=e[1],s=e[2],a=e[3];break}if(typeof s>"u")throw new Error("The argv parameter must be provided when running Clipanion outside of a Node context");return{resolvedOptions:t,resolvedCommandClasses:r,resolvedArgv:s,resolvedContext:a}}function yre(e){return e()}var mre,ba,wre=Xe(()=>{Rx();Hx();$U();dre();c0();gre();mre=Symbol("clipanion/errorCommand");ba=class e{constructor({binaryLabel:t,binaryName:r="...",binaryVersion:s,enableCapture:a=!1,enableColors:n}={}){this.registrations=new Map,this.builder=new _x({binaryName:r}),this.binaryLabel=t,this.binaryName=r,this.binaryVersion=s,this.enableCapture=a,this.enableColors=n}static from(t,r={}){let s=new e(r),a=Array.isArray(t)?t:[t];for(let n of a)s.register(n);return s}register(t){var r;let s=new Map,a=new t;for(let p in a){let h=a[p];typeof h=="object"&&h!==null&&h[it.isOption]&&s.set(p,h)}let n=this.builder.command(),c=n.cliIndex,f=(r=t.paths)!==null&&r!==void 0?r:a.paths;if(typeof f<"u")for(let p of f)n.addPath(p);this.registrations.set(t,{specs:s,builder:n,index:c});for(let[p,{definition:h}]of s.entries())h(n,p);n.setContext({commandClass:t})}process(t,r){let{input:s,context:a,partial:n}=typeof t=="object"&&Array.isArray(t)?{input:t,context:r}:t,{contexts:c,process:f}=this.builder.compile(),p=f(s,{partial:n}),h={...e.defaultContext,...a};switch(p.selectedIndex){case Og:{let E=Gx.from(p,c);return E.context=h,E.tokens=p.tokens,E}default:{let{commandClass:E}=c[p.selectedIndex],C=this.registrations.get(E);if(typeof C>"u")throw new Error("Assertion failed: Expected the command class to have been registered.");let S=new E;S.context=h,S.tokens=p.tokens,S.path=p.path;try{for(let[x,{transformer:I}]of C.specs.entries())S[x]=I(C.builder,x,p,h);return S}catch(x){throw x[mre]=S,x}}break}}async run(t,r){var s,a;let n,c={...e.defaultContext,...r},f=(s=this.enableColors)!==null&&s!==void 0?s:c.colorDepth>1;if(!Array.isArray(t))n=t;else try{n=this.process(t,c)}catch(E){return c.stdout.write(this.error(E,{colored:f})),1}if(n.help)return c.stdout.write(this.usage(n,{colored:f,detailed:!0})),0;n.context=c,n.cli={binaryLabel:this.binaryLabel,binaryName:this.binaryName,binaryVersion:this.binaryVersion,enableCapture:this.enableCapture,enableColors:this.enableColors,definitions:()=>this.definitions(),definition:E=>this.definition(E),error:(E,C)=>this.error(E,C),format:E=>this.format(E),process:(E,C)=>this.process(E,{...c,...C}),run:(E,C)=>this.run(E,{...c,...C}),usage:(E,C)=>this.usage(E,C)};let p=this.enableCapture&&(a=hre(c))!==null&&a!==void 0?a:yre,h;try{h=await p(()=>n.validateAndExecute().catch(E=>n.catch(E).then(()=>0)))}catch(E){return c.stdout.write(this.error(E,{colored:f,command:n})),1}return h}async runExit(t,r){process.exitCode=await this.run(t,r)}definition(t,{colored:r=!1}={}){if(!t.usage)return null;let{usage:s}=this.getUsageByRegistration(t,{detailed:!1}),{usage:a,options:n}=this.getUsageByRegistration(t,{detailed:!0,inlineOptions:!1}),c=typeof t.usage.category<"u"?Ko(t.usage.category,{format:this.format(r),paragraphs:!1}):void 0,f=typeof t.usage.description<"u"?Ko(t.usage.description,{format:this.format(r),paragraphs:!1}):void 0,p=typeof t.usage.details<"u"?Ko(t.usage.details,{format:this.format(r),paragraphs:!0}):void 0,h=typeof t.usage.examples<"u"?t.usage.examples.map(([E,C])=>[Ko(E,{format:this.format(r),paragraphs:!1}),C.replace(/\$0/g,this.binaryName)]):void 0;return{path:s,usage:a,category:c,description:f,details:p,examples:h,options:n}}definitions({colored:t=!1}={}){let r=[];for(let s of this.registrations.keys()){let a=this.definition(s,{colored:t});a&&r.push(a)}return r}usage(t=null,{colored:r,detailed:s=!1,prefix:a="$ "}={}){var n;if(t===null){for(let p of this.registrations.keys()){let h=p.paths,E=typeof p.usage<"u";if(!h||h.length===0||h.length===1&&h[0].length===0||((n=h?.some(x=>x.length===0))!==null&&n!==void 0?n:!1))if(t){t=null;break}else t=p;else if(E){t=null;continue}}t&&(s=!0)}let c=t!==null&&t instanceof it?t.constructor:t,f="";if(c)if(s){let{description:p="",details:h="",examples:E=[]}=c.usage||{};p!==""&&(f+=Ko(p,{format:this.format(r),paragraphs:!1}).replace(/^./,x=>x.toUpperCase()),f+=`
`),(h!==""||E.length>0)&&(f+=`${this.format(r).header("Usage")}
`,f+=`
`);let{usage:C,options:S}=this.getUsageByRegistration(c,{inlineOptions:!1});if(f+=`${this.format(r).bold(a)}${C}
`,S.length>0){f+=`
`,f+=`${this.format(r).header("Options")}
`;let x=S.reduce((I,T)=>Math.max(I,T.definition.length),0);f+=`
`;for(let{definition:I,description:T}of S)f+=` ${this.format(r).bold(I.padEnd(x))} ${Ko(T,{format:this.format(r),paragraphs:!1})}`}if(h!==""&&(f+=`
`,f+=`${this.format(r).header("Details")}
`,f+=`
`,f+=Ko(h,{format:this.format(r),paragraphs:!0})),E.length>0){f+=`
`,f+=`${this.format(r).header("Examples")}
`;for(let[x,I]of E)f+=`
`,f+=Ko(x,{format:this.format(r),paragraphs:!1}),f+=`${I.replace(/^/m,` ${this.format(r).bold(a)}`).replace(/\$0/g,this.binaryName)}
`}}else{let{usage:p}=this.getUsageByRegistration(c);f+=`${this.format(r).bold(a)}${p}
`}else{let p=new Map;for(let[S,{index:x}]of this.registrations.entries()){if(typeof S.usage>"u")continue;let I=typeof S.usage.category<"u"?Ko(S.usage.category,{format:this.format(r),paragraphs:!1}):null,T=p.get(I);typeof T>"u"&&p.set(I,T=[]);let{usage:O}=this.getUsageByIndex(x);T.push({commandClass:S,usage:O})}let h=Array.from(p.keys()).sort((S,x)=>S===null?-1:x===null?1:S.localeCompare(x,"en",{usage:"sort",caseFirst:"upper"})),E=typeof this.binaryLabel<"u",C=typeof this.binaryVersion<"u";E||C?(E&&C?f+=`${this.format(r).header(`${this.binaryLabel} - ${this.binaryVersion}`)}
`:E?f+=`${this.format(r).header(`${this.binaryLabel}`)}
`:f+=`${this.format(r).header(`${this.binaryVersion}`)}
`,f+=` ${this.format(r).bold(a)}${this.binaryName} <command>
`):f+=`${this.format(r).bold(a)}${this.binaryName} <command>
`;for(let S of h){let x=p.get(S).slice().sort((T,O)=>T.usage.localeCompare(O.usage,"en",{usage:"sort",caseFirst:"upper"})),I=S!==null?S.trim():"General commands";f+=`
`,f+=`${this.format(r).header(`${I}`)}
`;for(let{commandClass:T,usage:O}of x){let U=T.usage.description||"undocumented";f+=`
`,f+=` ${this.format(r).bold(O)}
`,f+=` ${Ko(U,{format:this.format(r),paragraphs:!1})}`}}f+=`
`,f+=Ko("You can also print more details about any of these commands by calling them with the `-h,--help` flag right after the command name.",{format:this.format(r),paragraphs:!0})}return f}error(t,r){var s,{colored:a,command:n=(s=t[mre])!==null&&s!==void 0?s:null}=r===void 0?{}:r;(!t||typeof t!="object"||!("stack"in t))&&(t=new Error(`Execution failed with a non-error rejection (rejected value: ${JSON.stringify(t)})`));let c="",f=t.name.replace(/([a-z])([A-Z])/g,"$1 $2");f==="Error"&&(f="Internal Error"),c+=`${this.format(a).error(f)}: ${t.message}
`;let p=t.clipanion;return typeof p<"u"?p.type==="usage"&&(c+=`
`,c+=this.usage(n)):t.stack&&(c+=`${t.stack.replace(/^.*\n/,"")}
`),c}format(t){var r;return((r=t??this.enableColors)!==null&&r!==void 0?r:e.defaultContext.colorDepth>1)?tre:rre}getUsageByRegistration(t,r){let s=this.registrations.get(t);if(typeof s>"u")throw new Error("Assertion failed: Unregistered command");return this.getUsageByIndex(s.index,r)}getUsageByIndex(t,r){return this.builder.getBuilderByIndex(t).usage(r)}};ba.defaultContext={env:process.env,stdin:process.stdin,stdout:process.stdout,stderr:process.stderr,colorDepth:pre()}});var Z2,Bre=Xe(()=>{c0();Z2=class extends it{async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.definitions(),null,2)}
`)}};Z2.paths=[["--clipanion=definitions"]]});var $2,vre=Xe(()=>{c0();$2=class extends it{async execute(){this.context.stdout.write(this.cli.usage())}};$2.paths=[["-h"],["--help"]]});function qx(e={}){return va({definition(t,r){var s;t.addProxy({name:(s=e.name)!==null&&s!==void 0?s:r,required:e.required})},transformer(t,r,s){return s.positionals.map(({value:a})=>a)}})}var u_=Xe(()=>{vp()});var eB,Sre=Xe(()=>{c0();u_();eB=class extends it{constructor(){super(...arguments),this.args=qx()}async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.process(this.args).tokens,null,2)}
`)}};eB.paths=[["--clipanion=tokens"]]});var tB,bre=Xe(()=>{c0();tB=class extends it{async execute(){var t;this.context.stdout.write(`${(t=this.cli.binaryVersion)!==null&&t!==void 0?t:"<unknown>"}
`)}};tB.paths=[["-v"],["--version"]]});var f_={};Vt(f_,{DefinitionsCommand:()=>Z2,HelpCommand:()=>$2,TokensCommand:()=>eB,VersionCommand:()=>tB});var Dre=Xe(()=>{Bre();vre();Sre();bre()});function Pre(e,t,r){let[s,a]=Wf(t,r??{}),{arity:n=1}=a,c=e.split(","),f=new Set(c);return va({definition(p){p.addOption({names:c,arity:n,hidden:a?.hidden,description:a?.description,required:a.required})},transformer(p,h,E){let C,S=typeof s<"u"?[...s]:void 0;for(let{name:x,value:I}of E.options)f.has(x)&&(C=x,S=S??[],S.push(I));return typeof S<"u"?Lg(C??h,S,a.validator):S}})}var xre=Xe(()=>{vp()});function kre(e,t,r){let[s,a]=Wf(t,r??{}),n=e.split(","),c=new Set(n);return va({definition(f){f.addOption({names:n,allowBinding:!1,arity:0,hidden:a.hidden,description:a.description,required:a.required})},transformer(f,p,h){let E=s;for(let{name:C,value:S}of h.options)c.has(C)&&(E=S);return E}})}var Qre=Xe(()=>{vp()});function Rre(e,t,r){let[s,a]=Wf(t,r??{}),n=e.split(","),c=new Set(n);return va({definition(f){f.addOption({names:n,allowBinding:!1,arity:0,hidden:a.hidden,description:a.description,required:a.required})},transformer(f,p,h){let E=s;for(let{name:C,value:S}of h.options)c.has(C)&&(E??(E=0),S?E+=1:E=0);return E}})}var Tre=Xe(()=>{vp()});function Fre(e={}){return va({definition(t,r){var s;t.addRest({name:(s=e.name)!==null&&s!==void 0?s:r,required:e.required})},transformer(t,r,s){let a=c=>{let f=s.positionals[c];return f.extra===Kl||f.extra===!1&&c<t.arity.leading.length},n=0;for(;n<s.positionals.length&&a(n);)n+=1;return s.positionals.splice(0,n).map(({value:c})=>c)}})}var Nre=Xe(()=>{Hx();vp()});function gqe(e,t,r){let[s,a]=Wf(t,r??{}),{arity:n=1}=a,c=e.split(","),f=new Set(c);return va({definition(p){p.addOption({names:c,arity:a.tolerateBoolean?0:n,hidden:a.hidden,description:a.description,required:a.required})},transformer(p,h,E,C){let S,x=s;typeof a.env<"u"&&C.env[a.env]&&(S=a.env,x=C.env[a.env]);for(let{name:I,value:T}of E.options)f.has(I)&&(S=I,x=T);return typeof x=="string"?Lg(S??h,x,a.validator):x}})}function mqe(e={}){let{required:t=!0}=e;return va({definition(r,s){var a;r.addPositional({name:(a=e.name)!==null&&a!==void 0?a:s,required:e.required})},transformer(r,s,a){var n;for(let c=0;c<a.positionals.length;++c){if(a.positionals[c].extra===Kl||t&&a.positionals[c].extra===!0||!t&&a.positionals[c].extra===!1)continue;let[f]=a.positionals.splice(c,1);return Lg((n=e.name)!==null&&n!==void 0?n:s,f.value,e.validator)}}})}function Ore(e,...t){return typeof e=="string"?gqe(e,...t):mqe(e)}var Lre=Xe(()=>{Hx();vp()});var pe={};Vt(pe,{Array:()=>Pre,Boolean:()=>kre,Counter:()=>Rre,Proxy:()=>qx,Rest:()=>Fre,String:()=>Ore,applyValidator:()=>Lg,cleanValidationError:()=>Nx,formatError:()=>V2,isOptionSymbol:()=>W2,makeCommandOption:()=>va,rerouteArguments:()=>Wf});var Mre=Xe(()=>{vp();u_();xre();Qre();Tre();Nre();Lre()});var rB={};Vt(rB,{Builtins:()=>f_,Cli:()=>ba,Command:()=>it,Option:()=>pe,UsageError:()=>st,formatMarkdownish:()=>Ko,run:()=>Ire,runExit:()=>Ere});var jt=Xe(()=>{Fx();$U();c0();wre();Dre();Mre()});var Ure=G((ykt,yqe)=>{yqe.exports={name:"dotenv",version:"16.3.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://github.com/motdotla/dotenv?sponsor=1",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@definitelytyped/dtslint":"^0.0.133","@types/node":"^18.11.3",decache:"^4.6.1",sinon:"^14.0.1",standard:"^17.0.0","standard-markdown":"^7.1.0","standard-version":"^9.5.0",tap:"^16.3.0",tar:"^6.1.11",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var Gre=G((Ekt,bp)=>{var _re=Ie("fs"),p_=Ie("path"),Eqe=Ie("os"),Iqe=Ie("crypto"),Cqe=Ure(),h_=Cqe.version,wqe=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Bqe(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
`);let s;for(;(s=wqe.exec(r))!=null;){let a=s[1],n=s[2]||"";n=n.trim();let c=n[0];n=n.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),c==='"'&&(n=n.replace(/\\n/g,`
`),n=n.replace(/\\r/g,"\r")),t[a]=n}return t}function vqe(e){let t=jre(e),r=Ws.configDotenv({path:t});if(!r.parsed)throw new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);let s=Hre(e).split(","),a=s.length,n;for(let c=0;c<a;c++)try{let f=s[c].trim(),p=Dqe(r,f);n=Ws.decrypt(p.ciphertext,p.key);break}catch(f){if(c+1>=a)throw f}return Ws.parse(n)}function Sqe(e){console.log(`[dotenv@${h_}][INFO] ${e}`)}function bqe(e){console.log(`[dotenv@${h_}][WARN] ${e}`)}function A_(e){console.log(`[dotenv@${h_}][DEBUG] ${e}`)}function Hre(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function Dqe(e,t){let r;try{r=new URL(t)}catch(f){throw f.code==="ERR_INVALID_URL"?new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:[email protected]/vault/.env.vault?environment=development"):f}let s=r.password;if(!s)throw new Error("INVALID_DOTENV_KEY: Missing key part");let a=r.searchParams.get("environment");if(!a)throw new Error("INVALID_DOTENV_KEY: Missing environment part");let n=`DOTENV_VAULT_${a.toUpperCase()}`,c=e.parsed[n];if(!c)throw new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${n} in your .env.vault file.`);return{ciphertext:c,key:s}}function jre(e){let t=p_.resolve(process.cwd(),".env");return e&&e.path&&e.path.length>0&&(t=e.path),t.endsWith(".vault")?t:`${t}.vault`}function Pqe(e){return e[0]==="~"?p_.join(Eqe.homedir(),e.slice(1)):e}function xqe(e){Sqe("Loading env from encrypted .env.vault");let t=Ws._parseVault(e),r=process.env;return e&&e.processEnv!=null&&(r=e.processEnv),Ws.populate(r,t,e),{parsed:t}}function kqe(e){let t=p_.resolve(process.cwd(),".env"),r="utf8",s=!!(e&&e.debug);e&&(e.path!=null&&(t=Pqe(e.path)),e.encoding!=null&&(r=e.encoding));try{let a=Ws.parse(_re.readFileSync(t,{encoding:r})),n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),Ws.populate(n,a,e),{parsed:a}}catch(a){return s&&A_(`Failed to load ${t} ${a.message}`),{error:a}}}function Qqe(e){let t=jre(e);return Hre(e).length===0?Ws.configDotenv(e):_re.existsSync(t)?Ws._configVault(e):(bqe(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),Ws.configDotenv(e))}function Rqe(e,t){let r=Buffer.from(t.slice(-64),"hex"),s=Buffer.from(e,"base64"),a=s.slice(0,12),n=s.slice(-16);s=s.slice(12,-16);try{let c=Iqe.createDecipheriv("aes-256-gcm",r,a);return c.setAuthTag(n),`${c.update(s)}${c.final()}`}catch(c){let f=c instanceof RangeError,p=c.message==="Invalid key length",h=c.message==="Unsupported state or unable to authenticate data";if(f||p){let E="INVALID_DOTENV_KEY: It must be 64 characters long (or more)";throw new Error(E)}else if(h){let E="DECRYPTION_FAILED: Please check your DOTENV_KEY";throw new Error(E)}else throw console.error("Error: ",c.code),console.error("Error: ",c.message),c}}function Tqe(e,t,r={}){let s=!!(r&&r.debug),a=!!(r&&r.override);if(typeof t!="object")throw new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");for(let n of Object.keys(t))Object.prototype.hasOwnProperty.call(e,n)?(a===!0&&(e[n]=t[n]),s&&A_(a===!0?`"${n}" is already defined and WAS overwritten`:`"${n}" is already defined and was NOT overwritten`)):e[n]=t[n]}var Ws={configDotenv:kqe,_configVault:xqe,_parseVault:vqe,config:Qqe,decrypt:Rqe,parse:Bqe,populate:Tqe};bp.exports.configDotenv=Ws.configDotenv;bp.exports._configVault=Ws._configVault;bp.exports._parseVault=Ws._parseVault;bp.exports.config=Ws.config;bp.exports.decrypt=Ws.decrypt;bp.exports.parse=Ws.parse;bp.exports.populate=Ws.populate;bp.exports=Ws});var Yre=G((Ikt,qre)=>{"use strict";qre.exports=(e,...t)=>new Promise(r=>{r(e(...t))})});var Mg=G((Ckt,d_)=>{"use strict";var Fqe=Yre(),Wre=e=>{if(e<1)throw new TypeError("Expected `concurrency` to be a number from 1 and up");let t=[],r=0,s=()=>{r--,t.length>0&&t.shift()()},a=(f,p,...h)=>{r++;let E=Fqe(f,...h);p(E),E.then(s,s)},n=(f,p,...h)=>{r<e?a(f,p,...h):t.push(a.bind(null,f,p,...h))},c=(f,...p)=>new Promise(h=>n(f,h,...p));return Object.defineProperties(c,{activeCount:{get:()=>r},pendingCount:{get:()=>t.length}}),c};d_.exports=Wre;d_.exports.default=Wre});function zf(e){return`YN${e.toString(10).padStart(4,"0")}`}function Yx(e){let t=Number(e.slice(2));if(typeof pr[t]>"u")throw new Error(`Unknown message name: "${e}"`);return t}var pr,Wx=Xe(()=>{pr=(Ue=>(Ue[Ue.UNNAMED=0]="UNNAMED",Ue[Ue.EXCEPTION=1]="EXCEPTION",Ue[Ue.MISSING_PEER_DEPENDENCY=2]="MISSING_PEER_DEPENDENCY",Ue[Ue.CYCLIC_DEPENDENCIES=3]="CYCLIC_DEPENDENCIES",Ue[Ue.DISABLED_BUILD_SCRIPTS=4]="DISABLED_BUILD_SCRIPTS",Ue[Ue.BUILD_DISABLED=5]="BUILD_DISABLED",Ue[Ue.SOFT_LINK_BUILD=6]="SOFT_LINK_BUILD",Ue[Ue.MUST_BUILD=7]="MUST_BUILD",Ue[Ue.MUST_REBUILD=8]="MUST_REBUILD",Ue[Ue.BUILD_FAILED=9]="BUILD_FAILED",Ue[Ue.RESOLVER_NOT_FOUND=10]="RESOLVER_NOT_FOUND",Ue[Ue.FETCHER_NOT_FOUND=11]="FETCHER_NOT_FOUND",Ue[Ue.LINKER_NOT_FOUND=12]="LINKER_NOT_FO Line truncated
`,"\r","(",")","!","|","&","^"],!0,!1),ae=function(ee){return t.queryPattern.test(ee)},ge=function(ee){return t.checkFn(ee)},he=Re("whitespace"),Ce=/^[ \t\n\r]/,Ee=ke([" "," ",`
`,"\r"],!1,!1),d=0,Se=0,Be=[{line:1,column:1}],me=0,ue=[],Z=0,be;if("startRule"in t){if(!(t.startRule in s))throw new Error(`Can't start parsing from rule "`+t.startRule+'".');a=s[t.startRule]}function Qe(){return e.substring(Se,d)}function ot(){return Me(Se,d)}function _(ee,se){throw se=se!==void 0?se:Me(Se,d),D([Re(ee)],e.substring(Se,d),se)}function tt(ee,se){throw se=se!==void 0?se:Me(Se,d),w(ee,se)}function Ne(ee,se){return{type:"literal",text:ee,ignoreCase:se}}function ke(ee,se,xe){return{type:"class",parts:ee,inverted:se,ignoreCase:xe}}function De(){return{type:"any"}}function je(){return{type:"end"}}function Re(ee){return{type:"other",description:ee}}function ct(ee){var se=Be[ee],xe;if(se)return se;for(xe=ee-1;!Be[xe];)xe--;for(se=Be[xe],se={line:se.line,column:se.column};xe<ee;)e.charCodeAt(xe)===10?(se.line++,se.column=1):se.column++,xe++;return Be[ee]=se,se}function Me(ee,se){var xe=ct(ee),Fe=ct(se);return{start:{offset:ee,line:xe.line,column:xe.column},end:{offset:se,line:Fe.line,column:Fe.column}}}function P(ee){d<me||(d>me&&(me=d,ue=[]),ue.push(ee))}function w(ee,se){return new Gg(ee,null,null,se)}function D(ee,se,xe){return new Gg(Gg.buildMessage(ee,se),ee,se,xe)}function y(){var ee,se,xe,Fe,ut,Ct,Yt,ir;if(ee=d,se=F(),se!==r){for(xe=[],Fe=d,ut=X(),ut!==r?(e.charCodeAt(d)===124?(Ct=n,d++):(Ct=r,Z===0&&P(c)),Ct===r&&(e.charCodeAt(d)===38?(Ct=f,d++):(Ct=r,Z===0&&P(p)),Ct===r&&(e.charCodeAt(d)===94?(Ct=h,d++):(Ct=r,Z===0&&P(E)))),Ct!==r?(Yt=X(),Yt!==r?(ir=F(),ir!==r?(ut=[ut,Ct,Yt,ir],Fe=ut):(d=Fe,Fe=r)):(d=Fe,Fe=r)):(d=Fe,Fe=r)):(d=Fe,Fe=r);Fe!==r;)xe.push(Fe),Fe=d,ut=X(),ut!==r?(e.charCodeAt(d)===124?(Ct=n,d++):(Ct=r,Z===0&&P(c)),Ct===r&&(e.charCodeAt(d)===38?(Ct=f,d++):(Ct=r,Z===0&&P(p)),Ct===r&&(e.charCodeAt(d)===94?(Ct=h,d++):(Ct=r,Z===0&&P(E)))),Ct!==r?(Yt=X(),Yt!==r?(ir=F(),ir!==r?(ut=[ut,Ct,Yt,ir],Fe=ut):(d=Fe,Fe=r)):(d=Fe,Fe=r)):(d=Fe,Fe=r)):(d=Fe,Fe=r);xe!==r?(Se=ee,se=C(se,xe),ee=se):(d=ee,ee=r)}else d=ee,ee=r;return ee}function F(){var ee,se,xe,Fe,ut,Ct;return ee=d,e.charCodeAt(d)===33?(se=S,d++):(se=r,Z===0&&P(x)),se!==r?(xe=F(),xe!==r?(Se=ee,se=I(xe),ee=se):(d=ee,ee=r)):(d=ee,ee=r),ee===r&&(ee=d,e.charCodeAt(d)===40?(se=T,d++):(se=r,Z===0&&P(O)),se!==r?(xe=X(),xe!==r?(Fe=y(),Fe!==r?(ut=X(),ut!==r?(e.charCodeAt(d)===41?(Ct=U,d++):(Ct=r,Z===0&&P(V)),Ct!==r?(Se=ee,se=$(Fe),ee=se):(d=ee,ee=r)):(d=ee,ee=r)):(d=ee,ee=r)):(d=ee,ee=r)):(d=ee,ee=r),ee===r&&(ee=z())),ee}function z(){var ee,se,xe,Fe,ut;if(ee=d,se=X(),se!==r){if(xe=d,Fe=[],ie.test(e.charAt(d))?(ut=e.charAt(d),d++):(ut=r,Z===0&&P(fe)),ut!==r)for(;ut!==r;)Fe.push(ut),ie.test(e.charAt(d))?(ut=e.charAt(d),d++):(ut=r,Z===0&&P(fe));else Fe=r;Fe!==r?xe=e.substring(xe,d):xe=Fe,xe!==r?(Se=d,Fe=ae(xe),Fe?Fe=void 0:Fe=r,Fe!==r?(Se=ee,se=ge(xe),ee=se):(d=ee,ee=r)):(d=ee,ee=r)}else d=ee,ee=r;return ee}function X(){var ee,se;for(Z++,ee=[],Ce.test(e.charAt(d))?(se=e.charAt(d),d++):(se=r,Z===0&&P(Ee));se!==r;)ee.push(se),Ce.test(e.charAt(d))?(se=e.charAt(d),d++):(se=r,Z===0&&P(Ee));return Z--,ee===r&&(se=r,Z===0&&P(he)),ee}if(be=a(),be!==r&&d===e.length)return be;throw be!==r&&d<e.length&&P(je()),D(ue,me<e.length?e.charAt(me):null,me<e.length?Me(me,me+1):Me(me,me))}qie.exports={SyntaxError:Gg,parse:TVe}});var Wie=G(ik=>{var{parse:FVe}=Yie();ik.makeParser=(e=/[a-z]+/)=>(t,r)=>FVe(t,{queryPattern:e,checkFn:r});ik.parse=ik.makeParser()});var Kie=G((mQt,Vie)=>{"use strict";Vie.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyLine truncated
`:`
`)+r,a=s+1,s=e.indexOf(`
`,a)}while(s!==-1);return n+=e.substr(a),n};fse.exports={stringReplaceAll:VVe,stringEncaseCRLFWithFirstIndex:KVe}});var mse=G((SQt,gse)=>{"use strict";var JVe=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,pse=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,zVe=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,XVe=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,ZVe=new Map([["n",`
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function dse(e){let t=e[0]==="u",r=e[1]==="{";return t&&!r&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):t&&r?String.fromCodePoint(parseInt(e.slice(2,-1),16)):ZVe.get(e)||e}function $Ve(e,t){let r=[],s=t.trim().split(/\s*,\s*/g),a;for(let n of s){let c=Number(n);if(!Number.isNaN(c))r.push(c);else if(a=n.match(zVe))r.push(a[2].replace(XVe,(f,p,h)=>p?dse(p):h));else throw new Error(`Invalid Chalk template style argument: ${n} (in style '${e}')`)}return r}function e7e(e){pse.lastIndex=0;let t=[],r;for(;(r=pse.exec(e))!==null;){let s=r[1];if(r[2]){let a=$Ve(s,r[2]);t.push([s].concat(a))}else t.push([s])}return t}function hse(e,t){let r={};for(let a of t)for(let n of a.styles)r[n[0]]=a.inverse?null:n.slice(1);let s=e;for(let[a,n]of Object.entries(r))if(Array.isArray(n)){if(!(a in s))throw new Error(`Unknown Chalk style: ${a}`);s=n.length>0?s[a](...n):s[a]}return s}gse.exports=(e,t)=>{let r=[],s=[],a=[];if(t.replace(JVe,(n,c,f,p,h,E)=>{if(c)a.push(dse(c));else if(p){let C=a.join("");a=[],s.push(r.length===0?C:hse(e,r)(C)),r.push({inverse:f,styles:e7e(p)})}else if(h){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");s.push(hse(e,r)(a.join(""))),a=[],r.pop()}else a.push(E)}),s.push(a.join("")),r.length>0){let n=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(n)}return s.join("")}});var LE=G((bQt,Bse)=>{"use strict";var pB=ak(),{stdout:G_,stderr:q_}=use(),{stringReplaceAll:t7e,stringEncaseCRLFWithFirstIndex:r7e}=Ase(),{isArray:lk}=Array,Ese=["ansi","ansi","ansi256","ansi16m"],OE=Object.create(null),n7e=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=G_?G_.level:0;e.level=t.level===void 0?r:t.level},Y_=class{constructor(t){return Ise(t)}},Ise=e=>{let t={};return n7e(t,e),t.template=(...r)=>wse(t.template,...r),Object.setPrototypeOf(t,ck.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=Y_,t.template};function ck(e){return Ise(e)}for(let[e,t]of Object.entries(pB))OE[e]={get(){let r=uk(this,W_(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:r}),r}};OE.visible={get(){let e=uk(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Cse=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of Cse)OE[e]={get(){let{level:t}=this;return function(...r){let s=W_(pB.color[Ese[t]][e](...r),pB.color.close,this._styler);return uk(this,s,this._isEmpty)}}};for(let e of Cse){let t="bg"+e[0].toUpperCase()+e.slice(1);OE[t]={get(){let{level:r}=this;return function(...s){let a=W_(pB.bgColor[Ese[r]][e](...s),pB.bgColor.close,this._styler);return uk(this,a,this._isEmpty)}}}}var i7e=Object.defineProperties(()=>{},{...OE,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),W_=(e,t,r)=>{let s,a;return r===void 0?(s=e,a=t):(s=r.openAll+e,a=t+r.closeAll),{open:e,close:t,openAll:s,closeAll:a,parent:r}},uk=(e,t,r)=>{let s=(...a)=>lk(a[0])&&lk(a[0].raw)?yse(s,wse(s,...a)):yse(s,a.length===1?""+a[0]:a.join(" "));return Object.setPrototypeOf(s,i7e),s._generator=e,s._styler=t,s._isEmpty=r,s},yse=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let r=e._styler;if(r===void 0)return t;let{openAll:s,closeAll:a}=r;if(t.indexOf("\x1B")!==-1)for(;r!==void 0;)t=t7e(t,r.close,r.open),r=r.parent;let n=t.indexOf(`
`);return n!==-1&&(t=r7e(t,a,s,n)),s+t+a},j_,wse=(e,...t)=>{let[r]=t;if(!lk(r)||!lk(r.raw))return t.join(" ");let s=t.slice(1),a=[r.raw[0]];for(let n=1;n<r.length;n++)a.push(String(s[n-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[n]));return j_===void 0&&(j_=mse()),j_(e,a.join(""))};Object.defineProperties(ck.prototype,OE);var fk=ck();fk.supportsColor=G_;fk.stderr=ck({level:q_?q_.level:0});fk.stderr.supportsColor=q_;Bse.exports=fk});var Ak=G(xc=>{"use strict";xc.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;xc.find=(e,t)=>e.nodes.find(r=>r.type===t);xc.exceedsLimit=(e,t,r=1,s)=>s===!1||!xc.isInteger(e)||!xc.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=s;xc.escapeNode=(e,t=0,r)=>{let s=e.nodes[t];s&&(r&&s.type===r||s.type==="open"||s.type==="close")&&s.escaped!==!0&&(s.value="\\"+s.value,s.escaped=!0)};xc.encloseBrace=e=>e.type!=="brace"||e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0);xc.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1;xc.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;xc.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);xc.flatten=(...e)=>{let t=[],r=s=>{for(let a=0;a<s.length;a++){let n=s[a];Array.isArray(n)?r(n,t):n!==void 0&&t.push(n)}return t};return r(e),t}});var pk=G((PQt,Sse)=>{"use strict";var vse=Ak();Sse.exports=(e,t={})=>{let r=(s,a={})=>{let n=t.escapeInvalid&&vse.isInvalidBrace(a),c=s.invalid===!0&&t.escapeInvalid===!0,f="";if(s.value)return(n||c)&&vse.isOpenOrClose(s)?"\\"+s.value:s.value;if(s.value)return s.value;if(s.nodes)for(let p of s.nodes)f+=r(p);return f};return r(e)}});var Dse=G((xQt,bse)=>{"use strict";bse.exports=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var Ose=G((kQt,Nse)=>{"use strict";var Pse=Dse(),qg=(e,t,r)=>{if(Pse(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(Pse(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let s={relaxZeros:!0,...r};typeof s.strictZeros=="boolean"&&(s.relaxZeros=s.strictZeros===!1);let a=String(s.relaxZeros),n=String(s.shorthand),c=String(s.capture),f=String(s.wrap),p=e+":"+t+"="+a+n+c+f;if(qg.cache.hasOwnProperty(p))return qg.cache[p].result;let h=Math.min(e,t),E=Math.max(e,t);if(Math.abs(h-E)===1){let T=e+"|"+t;return s.capture?`(${T})`:s.wrap===!1?T:`(?:${T})`}let C=Fse(e)||Fse(t),S={min:e,max:t,a:h,b:E},x=[],I=[];if(C&&(S.isPadded=C,S.maxLen=String(S.max).length),h<0){let T=E<0?Math.abs(E):1;I=xse(T,Math.abs(h),S,s),h=S.a=0}return E>=0&&(x=xse(h,E,S,s)),S.negatives=I,S.positives=x,S.result=s7e(I,x,s),s.capture===!0?S.result=`(${S.result})`:s.wrap!==!1&&x.length+I.length>1&&(S.result=`(?:${S.result})`),qg.cache[p]=S,S.result};function s7e(e,t,r){let s=V_(e,t,"-",!1,r)||[],a=V_(t,e,"",!1,r)||[],n=V_(e,t,"-?",!0,r)||[];return s.concat(n).concat(a).join("|")}function o7e(e,t){let r=1,s=1,a=Qse(e,r),n=new Set([t]);for(;e<=a&&a<=t;)n.add(a),r+=1,a=Qse(e,r);for(a=Rse(t+1,s)-1;e<a&&a<=t;)n.add(a),s+=1,a=Rse(t+1,s)-1;return n=[...n],n.sort(c7e),n}function a7e(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let s=l7e(e,t),a=s.length,n="",c=0;for(let f=0;f<a;f++){let[p,h]=s[f];p===h?n+=p:p!=="0"||h!=="9"?n+=u7e(p,h,r):c++}return c&&(n+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:n,count:[c],digits:a}}function xse(e,t,r,s){let a=o7e(e,t),n=[],c=e,f;for(let p=0;p<a.length;p++){let h=a[p],E=a7e(String(c),String(h),s),C="";if(!r.isPadded&&f&&f.pattern===E.pattern){f.count.length>1&&f.count.pop(),f.count.push(E.count[0]),f.string=f.pattern+Tse(f.count),c=h+1;continue}r.isPadded&&(C=f7e(h,r,s)),E.string=C+E.pattern+Tse(E.count),n.push(E),c=h+1,f=E}return n}function V_(e,t,r,s,a){let n=[];for(let c of e){let{string:f}=c;!s&&!kse(t,"string",f)&&n.push(r+f),s&&kse(t,"string",f)&&n.push(r+f)}return n}function l7e(e,t){let r=[];for(let s=0;s<e.length;s++)r.push([e[s],t[s]]);return r}function c7e(e,t){return e>t?1:t>e?-1:0}function kse(e,t,r){return e.some(s=>s[t]===r)}function Qse(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function Rse(e,t){return e-e%Math.pow(10,t)}function Tse(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function u7e(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function Fse(e){return/^-?(0+)\d/.test(e)}function f7e(e,t,r){if(!t.isPadded)return e;let s=Math.abs(t.maxLen-String(e).length),a=r.relaxZeros!==!1;switch(s){case 0:return"";case 1:return a?"0?":"0";case 2:return a?"0{0,2}":"00";default:return a?`0{0,${s}}`:`0{${s}}`}}qg.cache={};qg.clearCache=()=>qg.cache={};Nse.exports=qg});var z_=G((QQt,qse)=>{"use strict";var A7e=Ie("util"),Use=Ose(),Lse=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),p7e=e=>t=>e===!0?Number(t):String(t),K_=e=>typeof e=="numb Line truncated
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var noe=G((NQt,roe)=>{"use strict";var v7e=pk(),{MAX_LENGTH:$se,CHAR_BACKSLASH:X_,CHAR_BACKTICK:S7e,CHAR_COMMA:b7e,CHAR_DOT:D7e,CHAR_LEFT_PARENTHESES:P7e,CHAR_RIGHT_PARENTHESES:x7e,CHAR_LEFT_CURLY_BRACE:k7e,CHAR_RIGHT_CURLY_BRACE:Q7e,CHAR_LEFT_SQUARE_BRACKET:eoe,CHAR_RIGHT_SQUARE_BRACKET:toe,CHAR_DOUBLE_QUOTE:R7e,CHAR_SINGLE_QUOTE:T7e,CHAR_NO_BREAK_SPACE:F7e,CHAR_ZERO_WIDTH_NOBREAK_SPACE:N7e}=Zse(),O7e=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},s=typeof r.maxLength=="number"?Math.min($se,r.maxLength):$se;if(e.length>s)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${s})`);let a={type:"root",input:e,nodes:[]},n=[a],c=a,f=a,p=0,h=e.length,E=0,C=0,S,x={},I=()=>e[E++],T=O=>{if(O.type==="text"&&f.type==="dot"&&(f.type="text"),f&&f.type==="text"&&O.type==="text"){f.value+=O.value;return}return c.nodes.push(O),O.parent=c,O.prev=f,f=O,O};for(T({type:"bos"});E<h;)if(c=n[n.length-1],S=I(),!(S===N7e||S===F7e)){if(S===X_){T({type:"text",value:(t.keepEscaping?S:"")+I()});continue}if(S===toe){T({type:"text",value:"\\"+S});continue}if(S===eoe){p++;let O=!0,U;for(;E<h&&(U=I());){if(S+=U,U===eoe){p++;continue}if(U===X_){S+=I();continue}if(U===toe&&(p--,p===0))break}T({type:"text",value:S});continue}if(S===P7e){c=T({type:"paren",nodes:[]}),n.push(c),T({type:"text",value:S});continue}if(S===x7e){if(c.type!=="paren"){T({type:"text",value:S});continue}c=n.pop(),T({type:"text",value:S}),c=n[n.length-1];continue}if(S===R7e||S===T7e||S===S7e){let O=S,U;for(t.keepQuotes!==!0&&(S="");E<h&&(U=I());){if(U===X_){S+=U+I();continue}if(U===O){t.keepQuotes===!0&&(S+=U);break}S+=U}T({type:"text",value:S});continue}if(S===k7e){C++;let U={type:"brace",open:!0,close:!1,dollar:f.value&&f.value.slice(-1)==="$"||c.dollar===!0,depth:C,commas:0,ranges:0,nodes:[]};c=T(U),n.push(c),T({type:"open",value:S});continue}if(S===Q7e){if(c.type!=="brace"){T({type:"text",value:S});continue}let O="close";c=n.pop(),c.close=!0,T({type:O,value:S}),C--,c=n[n.length-1];continue}if(S===b7e&&C>0){if(c.ranges>0){c.ranges=0;let O=c.nodes.shift();c.nodes=[O,{type:"text",value:v7e(c)}]}T({type:"comma",value:S}),c.commas++;continue}if(S===D7e&&C>0&&c.commas===0){let O=c.nodes;if(C===0||O.length===0){T({type:"text",value:S});continue}if(f.type==="dot"){if(c.range=[],f.value+=S,f.type="range",c.nodes.length!==3&&c.nodes.length!==5){c.invalid=!0,c.ranges=0,f.type="text";continue}c.ranges++,c.args=[];continue}if(f.type==="range"){O.pop();let U=O[O.length-1];U.value+=f.value+S,f=U,c.ranges--;continue}T({type:"dot",value:S});continue}T({type:"text",value:S})}do if(c=n.pop(),c.type!=="root"){c.nodes.forEach(V=>{V.nodes||(V.type==="open"&&(V.isOpen=!0),V.type==="close"&&(V.isClose=!0),V.nodes||(V.type="text"),V.invalid=!0)});let O=n[n.length-1],U=O.nodes.indexOf(c);O.nodes.splice(U,1,...c.nodes)}while(n.length>0);return T({type:"eos"}),a};roe.exports=O7e});var ooe=G((OQt,soe)=>{"use strict";var ioe=pk(),L7e=Vse(),M7e=zse(),U7e=noe(),Jl=(e,t={})=>{let r=[];if(Array.isArray(e))for(let s of e){let a=Jl.create(s,t);Array.isArray(a)?r.push(...a):r.push(a)}else r=[].concat(Jl.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};Jl.parse=(e,t={})=>U7e(e,t);Jl.stringify=(e,t={})=>ioe(typeof e=="string"?Jl.parse(e,t):e,t);Jl.compile=(e,t={})=>(typeof e=="string"&&(e=Jl.parse(e,t)),L7e(e,t));Jl.expand=(e,t={})=>{typeof e=="string"&&(e=Jl.parse(e,t));let r=M7e(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};Jl.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?Jl.compile(e,t):Jl.expand(e,t);soe.exports=Jl});var dB=G((LQt,foe)=>{"use strict";var _7e=Ie("path"),Xf="\\\\/",aoe=`[^${Xf}]`,kp="\\.",H7e="\\+",j7e="\\?",dk="\\/",G7e="(?=.)",loe="[^/]",Z_=`(?:${dk}|$)`,coe=`(?:^|${dk})`,$_=`${kp}{1,2}${Z_}`,q7e=`(?!${kp})`,Y7e=`(?!${coe}${$_})`,W7e=`(?!${kp}{0,1}${Z_})`,V7e=`(?!${$_})`,K7e=`[^.${dk}]`,J7e=`${loe}*?`,uoe={DOT_LITERAL:kp,PLUS_LITERAL:H7e,QMARK_LITERAL:j7e,SLASH_LITERAL:dk,ONE_CHAR:G7e,QMARK:loe,END_ANCHOR:Z_,DOTS_SLASH:$_,NO_DOT:q7e,NO_DOTS:Y7e,NO_DOT_SLASH:W7e,NO_DOTS_SLASH:V7e,QMARK_NO_DOT:K7e,STAR:J7e,START_ANCHOR:coe},z7e={...uoe,SLASH_LITERAL:`[${Xf}]`,QMARK:aoe,STAR:`${aoe}*?`,DOTS_SLASH:`${kp}{1,2}(?:[${Xf}]|$)`,NO_DOT:`(?!${kp})`,NO_DOTS:`(?!(?:^|[${Xf}])${kp}{1,2}(?:[${Xf}]|$))`,NO_DOT_SLASH:`(?!${kp}{0,1}(?:[${Xf}]|$))`,NO_DOTS_SLASH:`(?!${kp}{1,2}(?:[${Xf}]|$))`,QMARK_NO_DOT:`[^.${Xf}]`,START_ANCHOR:`(?:^|[${Xf}])`,END_ANCHOR:`(?:[${Xf}]|$)`},X7e={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&' Line truncated
`),f!==-1){let p=a+c.substring(0,f);c=c.substring(f+1),a="",t!==null?this.reportInfo(null,`${t} ${p}`):this.reportInfo(null,p)}while(f!==-1);a+=c}),r.on("end",()=>{let n=s.end();n!==""&&(t!==null?this.reportInfo(null,`${t} ${n}`):this.reportInfo(null,n))}),r}}});var AI,B8=Xe(()=>{Nc();$o();AI=class{constructor(t){this.fetchers=t}supports(t,r){return!!this.tryFetcher(t,r)}getLocalPath(t,r){return this.getFetcher(t,r).getLocalPath(t,r)}async fetch(t,r){return await this.getFetcher(t,r).fetch(t,r)}tryFetcher(t,r){let s=this.fetchers.find(a=>a.supports(t,r));return s||null}getFetcher(t,r){let s=this.fetchers.find(a=>a.supports(t,r));if(!s)throw new Lt(11,`${Vr(r.project.configuration,t)} isn't supported by any available fetcher`);return s}}});var nm,v8=Xe(()=>{$o();nm=class{constructor(t){this.resolvers=t.filter(r=>r)}supportsDescriptor(t,r){return!!this.tryResolverByDescriptor(t,r)}supportsLocator(t,r){return!!this.tryResolverByLocator(t,r)}shouldPersistResolution(t,r){return this.getResolverByLocator(t,r).shouldPersistResolution(t,r)}bindDescriptor(t,r,s){return this.getResolverByDescriptor(t,s).bindDescriptor(t,r,s)}getResolutionDependencies(t,r){return this.getResolverByDescriptor(t,r).getResolutionDependencies(t,r)}async getCandidates(t,r,s){return await this.getResolverByDescriptor(t,s).getCandidates(t,r,s)}async getSatisfying(t,r,s,a){return this.getResolverByDescriptor(t,a).getSatisfying(t,r,s,a)}async resolve(t,r){return await this.getResolverByLocator(t,r).resolve(t,r)}tryResolverByDescriptor(t,r){let s=this.resolvers.find(a=>a.supportsDescriptor(t,r));return s||null}getResolverByDescriptor(t,r){let s=this.resolvers.find(a=>a.supportsDescriptor(t,r));if(!s)throw new Error(`${ai(r.project.configuration,t)} isn't supported by any available resolver`);return s}tryResolverByLocator(t,r){let s=this.resolvers.find(a=>a.supportsLocator(t,r));return s||null}getResolverByLocator(t,r){let s=this.resolvers.find(a=>a.supportsLocator(t,r));if(!s)throw new Error(`${Vr(r.project.configuration,t)} isn't supported by any available resolver`);return s}}});var pI,S8=Xe(()=>{bt();$o();pI=class{supports(t){return!!t.reference.startsWith("virtual:")}getLocalPath(t,r){let s=t.reference.indexOf("#");if(s===-1)throw new Error("Invalid virtual package reference");let a=t.reference.slice(s+1),n=Js(t,a);return r.fetcher.getLocalPath(n,r)}async fetch(t,r){let s=t.reference.indexOf("#");if(s===-1)throw new Error("Invalid virtual package reference");let a=t.reference.slice(s+1),n=Js(t,a),c=await r.fetcher.fetch(n,r);return await this.ensureVirtualLink(t,c,r)}getLocatorFilename(t){return lI(t)}async ensureVirtualLink(t,r,s){let a=r.packageFs.getRealPath(),n=s.project.configuration.get("virtualFolder"),c=this.getLocatorFilename(t),f=Eo.makeVirtualPath(n,c,a),p=new Gf(f,{baseFs:r.packageFs,pathUtils:K});return{...r,packageFs:p}}}});var OQ,_ce=Xe(()=>{OQ=class e{static{this.protocol="virtual:"}static isVirtualDescriptor(t){return!!t.range.startsWith(e.protocol)}static isVirtualLocator(t){return!!t.reference.startsWith(e.protocol)}supportsDescriptor(t,r){return e.isVirtualDescriptor(t)}supportsLocator(t,r){return e.isVirtualLocator(t)}shouldPersistResolution(t,r){return!1}bindDescriptor(t,r,s){throw new Error('Assertion failed: calling "bindDescriptor" on a virtual descriptor is unsupported')}getResolutionDependencies(t,r){throw new Error('Assertion failed: calling "getResolutionDependencies" on a virtual descriptor is unsupported')}async getCandidates(t,r,s){throw new Error('Assertion failed: calling "getCandidates" on a virtual descriptor is unsupported')}async getSatisfying(t,r,s,a){throw new Error('Assertion failed: calling "getSatisfying" on a virtual descriptor is unsupported')}async resolve(t,r){throw new Error('Assertion failed: calling "resolve" on a virtual locator is unsupported')}}});var hI,b8=Xe(()=>{bt();rm();hI=class{supports(t){return!!t.reference.startsWith(Ii.protocol)}getLocalPath(t,r){return this.getWorkspace(t,r).cwd}async fetch(t,r){let s=this.getWorkspace(t,r).cwd;return{packageFs:new Pn(s),prefixPath:vt.dot,localPath:s}}getWorkspace(t,r){return r.project.getWorkspaceByCwd(t.reference.slice(Ii.protocol.length))}}});function HB(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Hce(e){return typeof e>"u"?3:HB(e)?0:Array.isArray(e)?1:2}function x8(e,t){return Object.hasOwn(e,t)}function oZe(e){return HB(e)&&x8(e,"onConflict")&&typeof e.onConflict=="string"}function aZe(e){if(typeof e>"u")return{onConflict:"default",value:e};if(!oZe(e))return{onConflict:"default",value:e};if(x8(e,"value"))return e;let{onConflict:t,...r}=e;return{onConflict:t,value:r}}function jce(e,t){let r=HB(e)&&x8(e,t)?e[t]:void 0;return aZe(r)}function dI(e,t){return[e,t,Gce]}function k8(e){return Array.isArray(e)?e[2]===Gce:!1}function D8(e,t){if(HB(e)){let r={};for(let s of Object.keys(e))r[s]=D8(e[s],t);return dI(t,r)}return Array.isArray(e)?dI(t,e.map(r=>D8(r,t))):dI(t,e)}function P8(e,t,r,s,a){let n,c=[],f=a,p=0;for(let E=a-Line truncated
Please report this to https://github.com/szmarczak/http2-wrapper/`);I(T)}return}s[0].resolve(x);return}}if(c in this.queue){if(f in this.queue[c]){this.queue[c][f].listeners.push(...s),this._tryToCreateNewSession(c,f);return}}else this.queue[c]={};let p=()=>{c in this.queue&&this.queue[c][f]===h&&(delete this.queue[c][f],Object.keys(this.queue[c]).length===0&&delete this.queue[c])},h=()=>{let E=`${f}:${c}`,C=!1;try{let S=v$e.connect(t,{createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(E),...r});S[Ta]=0,S[II]=!1;let x=()=>S[Ta]<S.remoteSettings.maxConcurrentStreams,I=!0;S.socket.once("session",O=>{this.tlsSessionCache.set(E,O)}),S.once("error",O=>{for(let{reject:U}of s)U(O);this.tlsSessionCache.delete(E)}),S.setTimeout(this.timeout,()=>{S.destroy()}),S.once("close",()=>{if(C){I&&this._freeSessionsCount--,this._sessionsCount--;let O=this.sessions[c];O.splice(O.indexOf(S),1),O.length===0&&delete this.sessions[c]}else{let O=new Error("Session closed without receiving a SETTINGS frame");O.code="HTTP2WRAPPER_NOSETTINGS";for(let{reject:U}of s)U(O);p()}this._tryToCreateNewSession(c,f)});let T=()=>{if(!(!(c in this.queue)||!x())){for(let O of S[Oc])if(O in this.queue[c]){let{listeners:U}=this.queue[c][O];for(;U.length!==0&&x();)U.shift().resolve(S);let V=this.queue[c];if(V[O].listeners.length===0&&(delete V[O],Object.keys(V).length===0)){delete this.queue[c];break}if(!x())break}}};S.on("origin",()=>{S[Oc]=S.originSet,x()&&(T(),uH(this.sessions[c],S))}),S.once("remoteSettings",()=>{if(S.ref(),S.unref(),this._sessionsCount++,h.destroyed){let O=new Error("Agent has been destroyed");for(let U of s)U.reject(O);S.destroy();return}S[Oc]=S.originSet;{let O=this.sessions;if(c in O){let U=O[c];U.splice(D$e(U,S,P$e),0,S)}else O[c]=[S]}this._freeSessionsCount+=1,C=!0,this.emit("session",S),T(),p(),S[Ta]===0&&this._freeSessionsCount>this.maxFreeSessions&&S.close(),s.length!==0&&(this.getSession(f,r,s),s.length=0),S.on("remoteSettings",()=>{T(),uH(this.sessions[c],S)})}),S[zue]=S.request,S.request=(O,U)=>{if(S[II])throw new Error("The session is gracefully closing. No new streams are allowed.");let V=S[zue](O,U);return S.ref(),++S[Ta],S[Ta]===S.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,V.once("close",()=>{if(I=x(),--S[Ta],!S.destroyed&&!S.closed&&(x$e(this.sessions[c],S),x()&&!S.closed)){I||(this._freeSessionsCount++,I=!0);let $=S[Ta]===0;$&&S.unref(),$&&(this._freeSessionsCount>this.maxFreeSessions||S[II])?S.close():(uH(this.sessions[c],S),T())}}),V}}catch(S){for(let x of s)x.reject(S);p()}};h.listeners=s,h.completed=!1,h.destroyed=!1,this.queue[c][f]=h,this._tryToCreateNewSession(c,f)})}request(t,r,s,a){return new Promise((n,c)=>{this.getSession(t,r,[{reject:c,resolve:f=>{try{n(f.request(s,a))}catch(p){c(p)}}}])})}createConnection(t,r){return e.connect(t,r)}static connect(t,r){r.ALPNProtocols=["h2"];let s=t.port||443,a=t.hostname||t.host;return typeof r.servername>"u"&&(r.servername=a),B$e.connect(s,a,r)}closeFreeSessions(){for(let t of Object.values(this.sessions))for(let r of t)r[Ta]===0&&r.close()}destroy(t){for(let r of Object.values(this.sessions))for(let s of r)s.destroy(t);for(let r of Object.values(this.queue))for(let s of Object.values(r))s.destroyed=!0;this.queue={}}get freeSessions(){return Xue({agent:this,isFree:!0})}get busySessions(){return Xue({agent:this,isFree:!1})}};sm.kCurrentStreamsCount=Ta;sm.kGracefullyClosing=II;$ue.exports={Agent:sm,globalAgent:new sm}});var pH=G((mOt,efe)=>{"use strict";var{Readable:k$e}=Ie("stream"),AH=class extends k$e{constructor(t,r){super({highWaterMark:r,autoDestroy:!1}),this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=t,this.connection=t,this._dumped=!1}_destroy(t){this.req._request.destroy(t)}setTimeout(t,r){return this.req.setTimeout(t,r),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.resume())}_read(){this.req&&this.req._request.resume()}};efe.exports=AH});var hH=G((yOt,tfe)=>{"use strict";tfe.exports=e=>{let t={protocol:e.protocol,hostname:typeof e.hostname=="string"&&e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,host:e.host,hash:e.hash,search:e.search,pathname:e.pathname,href:e.href,path:`${e.pathname||""}${e.search||""}`};return typeof e.port=="string"&&e.port.length!==0&&(t.port=Number(e.port)),(e.username||e.password)&&(t.auth=`${e.username||""}:${e.password||""}`),t}});var nfe=G((EOt,rfe)=>{"use strict";rfe.exports=(e,t,r)=>{for(let s of r)e.on(s,(...a)=>t.emit(s,...a))}});var sfe=G((IOt,ife)=>{"use strict";ife.exports=e=>{switch(e){case":method":case":scheme":case":authority":case":path":return!0;default:return!1}}});var afe=G((wOt,ofe)=>{"use strict";var CI=(e,t,r)=>{ofe.exports[t]=class extends e{constructor(...a){super(typeof r=="string"?r:r(a Line truncated
`).reverse(),f=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split(`
`).reverse();for(;f.length!==0&&f[0]===c[0];)c.shift();this.stack=`${this.stack.slice(0,n)}${c.reverse().join(`
`)}${f.reverse().join(`
`)}`}}};_n.RequestError=ps;var nR=class extends ps{constructor(t){super(`Redirected ${t.options.maxRedirects} times. Aborting.`,{},t),this.name="MaxRedirectsError"}};_n.MaxRedirectsError=nR;var iR=class extends ps{constructor(t){super(`Response code ${t.statusCode} (${t.statusMessage})`,{},t.request),this.name="HTTPError"}};_n.HTTPError=iR;var sR=class extends ps{constructor(t,r){super(t.message,t,r),this.name="CacheError"}};_n.CacheError=sR;var oR=class extends ps{constructor(t,r){super(t.message,t,r),this.name="UploadError"}};_n.UploadError=oR;var aR=class extends ps{constructor(t,r,s){super(t.message,t,s),this.name="TimeoutError",this.event=t.event,this.timings=r}};_n.TimeoutError=aR;var XB=class extends ps{constructor(t,r){super(t.message,t,r),this.name="ReadError"}};_n.ReadError=XB;var lR=class extends ps{constructor(t){super(`Unsupported protocol "${t.url.protocol}"`,{},t),this.name="UnsupportedProtocolError"}};_n.UnsupportedProtocolError=lR;var Uet=["socket","connect","continue","information","upgrade","timeout"],cR=class extends Gfe.Duplex{constructor(t,r={},s){super({autoDestroy:!1,highWaterMark:0}),this[BI]=0,this[SI]=0,this.requestInitialized=!1,this[eR]=new Set,this.redirects=[],this[bI]=!1,this[tR]=!1,this[zB]=[],this.retryCount=0,this._progressCallbacks=[];let a=()=>this._unlockWrite(),n=()=>this._lockWrite();this.on("pipe",h=>{h.prependListener("data",a),h.on("data",n),h.prependListener("end",a),h.on("end",n)}),this.on("unpipe",h=>{h.off("data",a),h.off("data",n),h.off("end",a),h.off("end",n)}),this.on("pipe",h=>{h instanceof MH.IncomingMessage&&(this.options.headers={...h.headers,...this.options.headers})});let{json:c,body:f,form:p}=r;if((c||f||p)&&this._lockWrite(),_n.kIsNormalizedAlready in r)this.options=r;else try{this.options=this.constructor.normalizeArguments(t,r,s)}catch(h){lt.default.nodeStream(r.body)&&r.body.destroy(),this.destroy(h);return}(async()=>{var h;try{this.options.body instanceof met.ReadStream&&await Oet(this.options.body);let{url:E}=this.options;if(!E)throw new TypeError("Missing `url` property");if(this.requestUrl=E.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(h=this[Co])===null||h===void 0||h.destroy();return}for(let C of this[zB])C();this[zB].length=0,this.requestInitialized=!0}catch(E){if(E instanceof ps){this._beforeError(E);return}this.destroyed||this.destroy(E)}})()}static normalizeArguments(t,r,s){var a,n,c,f,p;let h=r;if(lt.default.object(t)&&!lt.default.urlInstance(t))r={...s,...t,...r};else{if(t&&r&&r.url!==void 0)throw new TypeError("The `url` option is mutually exclusive with the `input` argument");r={...s,...r},t!==void 0&&(r.url=t),lt.default.urlInstance(r.url)&&(r.url=new v0.URL(r.url.toString()))}if(r.cache===!1&&(r.cache=void 0),r.dnsCache===!1&&(r.dnsCache=void 0),lt.assert.any([lt.default.string,lt.default.undefined],r.method),lt.assert.any([lt.default.object,lt.default.undefined],r.headers),lt.assert.any([lt.default.string,lt.default.urlInstance,lt.default.undefined],r.prefixUrl),lt.assert.any([lt.default.object,lt.default.undefined],r.cookieJar),lt.assert.any([lt.default.object,lt.default.string,lt.default.undefined],r.searchParams),lt.assert.any([lt.default.object,lt.default.string,lt.default.undefined],r.cache),lt.assert.any([lt.default.object,lt.default.number,lt.default.undefined],r.timeout),lt.assert.any([lt.default.object,lt.default.undefined],r.context),lt.assert.any([lt.default.object,lt.default.undefined],r.hooks),lt.assert.any([lt.default.boolean,lt.default.undefined],r.decompress),lt.assert.any([lt.default.boolean,lt.default.undefined],r.ignoreInvalidCookies),lt.assert.any([lt.default.boolean,lt.default.undefined],r.followRedirect),lt.assert.any([lt.default.number,lt.default.undefined],r.maxRedirects),lt.assert.any([lt.default.boolean,lt.default.undefined],r.throwHttpErrors),lt.assert.any([lt.default.boolean,lt.default.undefined],r.http2),lt.assert.any([lt.default.boolean,lt.default.undefined],r.allowGetBody),lt.assert.any([lt.default.string,lt.default.undefined],r.localAddress),lt.assert.any([Jfe.isDnsLookupIpVersion,lt.default.undefined],r.dnsLookupIpVersion),lt.assert.any([lt.default.object,lt.default.undefined],r.https),lt.assert.any([lt.default.boolean,lt.default.undefined],r.rejectUnauthorized),r.https&&(lt.assert.any([lt.default.boolean,lt.default.undefined],r.https.rejectUnauthorized),lt.assert.any([lt.default.function_,lt.default.undefined],r.https.checkServerIdentity),lt.assert.any([lt.default.string,lt.default.object,lt.default.array,lt.default.undefined],r.https.certificateAuthority),lt.assert.any([lt.default.string,lt.default.object,lt.default.array,lt.default.undefined],r.https.key),lt.assert.any([lt.default.string,lt.default.object,lt.default.array,lt.default.undefined],r.https.certificate),lt.assert.any([lt.default.string,lt.default.undefined],r.https.passphrase),lt.assert.any([lt.default.string,lt.default.buffer,lt.default.array,lt.default.undefined],r.httpLine truncated
`)[3];return vtt(t)}function tj(){return typeof gR.default.availableParallelism<"u"?gR.default.availableParallelism():Math.max(1,gR.default.cpus().length)}var gR,mtt,DAe,ytt,Ett,PAe,xAe,wtt,Btt,mR=Xe(()=>{bt();gR=et(Ie("os"));yR();Qc();mtt=Number(process.versions.node.split(".")[0]),DAe=new Map([["darwin","open"],["linux","xdg-open"],["win32","explorer.exe"]]).get(process.platform),ytt=typeof DAe<"u"?async e=>{try{return await rj(DAe,[e],{cwd:K.cwd()}),!0}catch{return!1}}:void 0,Ett="/usr/bin/ldd";wtt=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Btt=/\((\S*)(?::(\d+))(?::(\d+))\)/});function lj(e,t,r,s,a){let n=jB(r);if(s.isArray||s.type==="ANY"&&Array.isArray(n))return Array.isArray(n)?n.map((c,f)=>nj(e,`${t}[${f}]`,c,s,a)):String(n).split(/,/).map(c=>nj(e,t,c,s,a));if(Array.isArray(n))throw new Error(`Non-array configuration settings "${t}" cannot be an array`);return nj(e,t,r,s,a)}function nj(e,t,r,s,a){let n=jB(r);switch(s.type){case"ANY":return LQ(n);case"SHAPE":return xtt(e,t,r,s,a);case"MAP":return ktt(e,t,r,s,a)}if(n===null&&!s.isNullable&&s.default!==null)throw new Error(`Non-nullable configuration settings "${t}" cannot be set to null`);if("values"in s&&s.values?.includes(n))return n;let f=(()=>{if(s.type==="BOOLEAN"&&typeof n!="string")return bB(n);if(typeof n!="string")throw new Error(`Expected configuration setting "${t}" to be a string, got ${typeof n}`);let p=Jk(n,{env:e.env});switch(s.type){case"ABSOLUTE_PATH":{let h=a,E=Q8(r);return E&&E[0]!=="<"&&(h=K.dirname(E)),K.resolve(h,Ae.toPortablePath(p))}case"LOCATOR_LOOSE":return Np(p,!1);case"NUMBER":return parseInt(p);case"LOCATOR":return Np(p);case"BOOLEAN":return bB(p);case"DURATION":return zk(p,s.unit);default:return p}})();if("values"in s&&s.values&&!s.values.includes(f))throw new Error(`Invalid value, expected one of ${s.values.join(", ")}`);return f}function xtt(e,t,r,s,a){let n=jB(r);if(typeof n!="object"||Array.isArray(n))throw new st(`Object configuration settings "${t}" must be an object`);let c=cj(e,s,{ignoreArrays:!0});if(n===null)return c;for(let[f,p]of Object.entries(n)){let h=`${t}.${f}`;if(!s.properties[f])throw new st(`Unrecognized configuration settings found: ${t}.${f} - run "yarn config" to see the list of settings supported in Yarn`);c.set(f,lj(e,h,p,s.properties[f],a))}return c}function ktt(e,t,r,s,a){let n=jB(r),c=new Map;if(typeof n!="object"||Array.isArray(n))throw new st(`Map configuration settings "${t}" must be an object`);if(n===null)return c;for(let[f,p]of Object.entries(n)){let h=s.normalizeKeys?s.normalizeKeys(f):f,E=`${t}['${h}']`,C=s.valueDefinition;c.set(h,lj(e,E,p,C,a))}return c}function cj(e,t,{ignoreArrays:r=!1}={}){switch(t.type){case"SHAPE":{if(t.isArray&&!r)return[];let s=new Map;for(let[a,n]of Object.entries(t.properties))s.set(a,cj(e,n));return s}case"MAP":return t.isArray&&!r?[]:new Map;case"ABSOLUTE_PATH":return t.default===null?null:e.projectCwd===null?Array.isArray(t.default)?t.default.map(s=>K.normalize(s)):K.isAbsolute(t.default)?K.normalize(t.default):t.isNullable?null:void 0:Array.isArray(t.default)?t.default.map(s=>K.resolve(e.projectCwd,s)):K.resolve(e.projectCwd,t.default);case"DURATION":return zk(t.default,t.unit);default:return t.default}}function IR(e,t,r){if(t.type==="SECRET"&&typeof e=="string"&&r.hideSecrets)return Ptt;if(t.type==="ABSOLUTE_PATH"&&typeof e=="string"&&r.getNativePaths)return Ae.fromPortablePath(e);if(t.isArray&&Array.isArray(e)){let s=[];for(let a of e)s.push(IR(a,t,r));return s}if(t.type==="MAP"&&e instanceof Map){if(e.size===0)return;let s=new Map;for(let[a,n]of e.entries()){let c=IR(n,t.valueDefinition,r);typeof c<"u"&&s.set(a,c)}return s}if(t.type==="SHAPE"&&e instanceof Map){if(e.size===0)return;let s=new Map;for(let[a,n]of e.entries()){let c=t.properties[a],f=IR(n,c,r);typeof f<"u"&&s.set(a,f)}return s}return e}function Qtt(){let e={};for(let[t,r]of Object.entries(process.env))t=t.toLowerCase(),t.startsWith(CR)&&(t=(0,QAe.default)(t.slice(CR.length)),e[t]=r);return e}function sj(){let e=`${CR}rc_filename`;for(let[t,r]of Object.entries(process.env))if(t.toLowerCase()===e&&typeof r=="string")return r;return oj}async function kAe(e){try{return await le.readFilePromise(e)}catch{return Buffer.of()}}async function Rtt(e,t){return Buffer.compare(...await Promise.all([kAe(e),kAe(t)]))===0}async function Ttt(e,t){let[r,s]=await Promise.all([le.statPromise(e),le.statPromise(t)]);return r.dev===s.dev&&r.ino===s.ino}async function Ntt({configuration:e,selfPath:t}){let r=e.get("yarnPath");return e.get("ignorePath")||r===null||r===t||await Ftt(r,t)?null:r}var QAe,Hp,RAe,TAe,FAe,ij,btt,rv,Dtt,jp,CR,oj,Ptt,DI,NAe,aj,wR,ER,Ftt,Je,nv=Xe(()=>{bt();Sc();QAe=et(zte()),Hp=et(Ng());jt();RAe=et(Gre()),TAe=Ie("module"),FAe=et(Mg()),ij=Ie("stream");Pce();fI();B8();v8();S8();_ce();b8();rm();Yce();UQ();Rc();w0();dR();Qc();mR();Lp();$o();btt=function(){if(!Hp.GITHUB_ACTIONS||!process.env.GITHUB_EVE Line truncated
`);return{stdout:n,stderr:c}}makeResolver(){let t=[];for(let r of this.plugins.values())for(let s of r.resolvers||[])t.push(new s);return new nm([new OQ,new Ii,...t])}makeFetcher(){let t=[];for(let r of this.plugins.values())for(let s of r.fetchers||[])t.push(new s);return new AI([new pI,new hI,...t])}getLinkers(){let t=[];for(let r of this.plugins.values())for(let s of r.linkers||[])t.push(new s);return t}getSupportedArchitectures(){let t=tv(),r=this.get("supportedArchitectures"),s=r.get("os");s!==null&&(s=s.map(c=>c==="current"?t.os:c));let a=r.get("cpu");a!==null&&(a=a.map(c=>c==="current"?t.cpu:c));let n=r.get("libc");return n!==null&&(n=Zl(n,c=>c==="current"?t.libc??Zl.skip:c)),{os:s,cpu:a,libc:n}}isInteractive({interactive:t,stdout:r}){return r.isTTY?t??this.get("preferInteractive"):!1}async getPackageExtensions(){if(this.packageExtensions!==null)return this.packageExtensions;this.packageExtensions=new Map;let t=this.packageExtensions,r=(s,a,{userProvided:n=!1}={})=>{if(!yl(s.range))throw new Error("Only semver ranges are allowed as keys for the packageExtensions setting");let c=new _t;c.load(a,{yamlCompatibilityMode:!0});let f=SB(t,s.identHash),p=[];f.push([s.range,p]);let h={status:"inactive",userProvided:n,parentDescriptor:s};for(let E of c.dependencies.values())p.push({...h,type:"Dependency",descriptor:E});for(let E of c.peerDependencies.values())p.push({...h,type:"PeerDependency",descriptor:E});for(let[E,C]of c.peerDependenciesMeta)for(let[S,x]of Object.entries(C))p.push({...h,type:"PeerDependencyMeta",selector:E,key:S,value:x})};await this.triggerHook(s=>s.registerPackageExtensions,this,r);for(let[s,a]of this.get("packageExtensions"))r(B0(s,!0),Kk(a),{userProvided:!0});return t}normalizeLocator(t){return yl(t.reference)?Js(t,`${this.get("defaultProtocol")}${t.reference}`):jp.test(t.reference)?Js(t,`${this.get("defaultProtocol")}${t.reference}`):t}normalizeDependency(t){return yl(t.range)?Un(t,`${this.get("defaultProtocol")}${t.range}`):jp.test(t.range)?Un(t,`${this.get("defaultProtocol")}${t.range}`):t}normalizeDependencyMap(t){return new Map([...t].map(([r,s])=>[r,this.normalizeDependency(s)]))}normalizePackage(t,{packageExtensions:r}){let s=TB(t),a=r.get(t.identHash);if(typeof a<"u"){let c=t.version;if(c!==null){for(let[f,p]of a)if(rA(c,f))for(let h of p)switch(h.status==="inactive"&&(h.status="redundant"),h.type){case"Dependency":typeof s.dependencies.get(h.descriptor.identHash)>"u"&&(h.status="active",s.dependencies.set(h.descriptor.identHash,this.normalizeDependency(h.descriptor)));break;case"PeerDependency":typeof s.peerDependencies.get(h.descriptor.identHash)>"u"&&(h.status="active",s.peerDependencies.set(h.descriptor.identHash,h.descriptor));break;case"PeerDependencyMeta":{let E=s.peerDependenciesMeta.get(h.selector);(typeof E>"u"||!Object.hasOwn(E,h.key)||E[h.key]!==h.value)&&(h.status="active",$l(s.peerDependenciesMeta,h.selector,()=>({}))[h.key]=h.value)}break;default:Q4(h)}}}let n=c=>c.scope?`${c.scope}__${c.name}`:`${c.name}`;for(let c of s.peerDependenciesMeta.keys()){let f=ka(c);s.peerDependencies.has(f.identHash)||s.peerDependencies.set(f.identHash,Un(f,"*"))}for(let c of s.peerDependencies.values()){if(c.scope==="types")continue;let f=n(c),p=Qa("types",f),h=fn(p);s.peerDependencies.has(p.identHash)||s.peerDependenciesMeta.has(h)||s.dependencies.has(p.identHash)||(s.peerDependencies.set(p.identHash,Un(p,"*")),s.peerDependenciesMeta.set(h,{optional:!0}))}return s.dependencies=new Map(Ks(s.dependencies,([,c])=>gl(c))),s.peerDependencies=new Map(Ks(s.peerDependencies,([,c])=>gl(c))),s}getLimit(t){return $l(this.limits,t,()=>(0,FAe.default)(this.get(t)))}async triggerHook(t,...r){for(let s of this.plugins.values()){let a=s.hooks;if(!a)continue;let n=t(a);n&&await n(...r)}}async triggerMultipleHooks(t,r){for(let s of r)await this.triggerHook(t,...s)}async reduceHook(t,r,...s){let a=r;for(let n of this.plugins.values()){let c=n.hooks;if(!c)continue;let f=t(c);f&&(a=await f(a,...s))}return a}async firstHook(t,...r){for(let s of this.plugins.values()){let a=s.hooks;if(!a)continue;let n=t(a);if(!n)continue;let c=await n(...r);if(typeof c<"u")return c}return null}}});var Yr={};Vt(Yr,{EndStrategy:()=>pj,ExecError:()=>BR,PipeError:()=>iv,execvp:()=>rj,pipevp:()=>qu});function am(e){return e!==null&&typeof e.fd=="number"}function uj(){}function fj(){for(let e of lm)e.kill()}async function qu(e,t,{cwd:r,env:s=process.env,strict:a=!1,stdin:n=null,stdout:c,stderr:f,end:p=2}){let h=["pipe","pipe","pipe"];n===null?h[0]="ignore":am(n)&&(h[0]=n),am(c)&&(h[1]=c),am(f)&&(h[2]=f);let E=(0,Aj.default)(e,t,{cwd:Ae.fromPortablePath(r),env:{...s,PWD:Ae.fromPortablePath(r)},stdio:h});lm.add(E),lm.size===1&&(process.on("SIGINT",uj),process.on("SIGTERM",fj)),!am(n)&&n!==null&&n.pipe(E.stdin),am(c)||E.stdout.pipe(c,{end:!1}),am(f)||E.stderr.pipe(f,{end:!1});let C=()=>{for(let S of new Set([c,f]))am(S)||S.end()};return new Promise((S,x)=>{E.on("error",I=>{lm.delete(E),lm.size===0&&(process.off("SIGINT",uj),pro Line truncated
This command will run a command using Yarn's portable shell.
Make sure to escape glob patterns, redirections, and other features that might be expanded by your own shell.
Note: To escape something from Yarn's shell, you might have to escape it twice, the first time from your own shell.
Note: Don't use this command in Yarn scripts, as Yarn's shell is automatically used.
For a list of features, visit: https://github.com/yarnpkg/berry/blob/master/packages/yarnpkg-shell/README.md.
`,examples:[["Run a simple command","$0 echo Hello"],["Run a command with a glob pattern","$0 echo '*.js'"],["Run a command with a redirection","$0 echo Hello World '>' hello.txt"],["Run a command with an escaped glob pattern (The double escape is needed in Unix shells)",`$0 echo '"*.js"'`],["Run a command with a variable (Double quotes are needed in Unix shells, to prevent them from expanding the variable)",'$0 "GREETING=Hello echo $GREETING World"']]}}async execute(){let r=this.args.length>0?`${this.commandName} ${this.args.join(" ")}`:this.commandName;return await xI(r,[],{cwd:Ae.toPortablePath(this.cwd),stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})}}});var ec,ZAe=Xe(()=>{ec=class extends Error{constructor(t){super(t),this.name="ShellError"}}});var kR={};Vt(kR,{fastGlobOptions:()=>tpe,isBraceExpansion:()=>Dj,isGlobPattern:()=>jtt,match:()=>Gtt,micromatchOptions:()=>xR});function jtt(e){if(!PR.default.scan(e,xR).isGlob)return!1;try{PR.default.parse(e,xR)}catch{return!1}return!0}function Gtt(e,{cwd:t,baseFs:r}){return(0,$Ae.default)(e,{...tpe,cwd:Ae.fromPortablePath(t),fs:fx(epe.default,new r0(r))})}function Dj(e){return PR.default.scan(e,xR).isBrace}var $Ae,epe,PR,xR,tpe,rpe=Xe(()=>{bt();$Ae=et(SQ()),epe=et(Ie("fs")),PR=et(Xo()),xR={strictBrackets:!0},tpe={onlyDirectories:!1,onlyFiles:!1}});function Pj(){}function xj(){for(let e of um)e.kill()}function ope(e,t,r,s){return a=>{let n=a[0]instanceof sA.Transform?"pipe":a[0],c=a[1]instanceof sA.Transform?"pipe":a[1],f=a[2]instanceof sA.Transform?"pipe":a[2],p=(0,ipe.default)(e,t,{...s,stdio:[n,c,f]});return um.add(p),um.size===1&&(process.on("SIGINT",Pj),process.on("SIGTERM",xj)),a[0]instanceof sA.Transform&&a[0].pipe(p.stdin),a[1]instanceof sA.Transform&&p.stdout.pipe(a[1],{end:!1}),a[2]instanceof sA.Transform&&p.stderr.pipe(a[2],{end:!1}),{stdin:p.stdin,promise:new Promise(h=>{p.on("error",E=>{switch(um.delete(p),um.size===0&&(process.off("SIGINT",Pj),process.off("SIGTERM",xj)),E.code){case"ENOENT":a[2].write(`command not found: ${e}
`),h(127);break;case"EACCES":a[2].write(`permission denied: ${e}
`),h(128);break;default:a[2].write(`uncaught error: ${E.message}
`),h(1);break}}),p.on("close",E=>{um.delete(p),um.size===0&&(process.off("SIGINT",Pj),process.off("SIGTERM",xj)),h(E!==null?E:129)})})}}}function ape(e){return t=>{let r=t[0]==="pipe"?new sA.PassThrough:t[0];return{stdin:r,promise:Promise.resolve().then(()=>e({stdin:r,stdout:t[1],stderr:t[2]}))}}}function QR(e,t){return Qj.start(e,t)}function npe(e,t=null){let r=new sA.PassThrough,s=new spe.StringDecoder,a="";return r.on("data",n=>{let c=s.write(n),f;do if(f=c.indexOf(`
`),f!==-1){let p=a+c.substring(0,f);c=c.substring(f+1),a="",e(t!==null?`${t} ${p}`:p)}while(f!==-1);a+=c}),r.on("end",()=>{let n=s.end();n!==""&&e(t!==null?`${t} ${n}`:n)}),r}function lpe(e,{prefix:t}){return{stdout:npe(r=>e.stdout.write(`${r}
`),e.stdout.isTTY?t:null),stderr:npe(r=>e.stderr.write(`${r}
`),e.stderr.isTTY?t:null)}}var ipe,sA,spe,um,Uc,kj,Qj,Rj=Xe(()=>{ipe=et(PU()),sA=Ie("stream"),spe=Ie("string_decoder"),um=new Set;Uc=class{constructor(t){this.stream=t}close(){}get(){return this.stream}},kj=class{constructor(){this.stream=null}close(){if(this.stream===null)throw new Error("Assertion failed: No stream attached");this.stream.end()}attach(t){this.stream=t}get(){if(this.stream===null)throw new Error("Assertion failed: No stream attached");return this.stream}},Qj=class e{constructor(t,r){this.stdin=null;this.stdout=null;this.stderr=null;this.pipe=null;this.ancestor=t,this.implementation=r}static start(t,{stdin:r,stdout:s,stderr:a}){let n=new e(null,t);return n.stdin=r,n.stdout=s,n.stderr=a,n}pipeTo(t,r=1){let s=new e(this,t),a=new kj;return s.pipe=a,s.stdout=this.stdout,s.stderr=this.stderr,(r&1)===1?this.stdout=a:this.ancestor!==null&&(this.stderr=this.ancestor.stdout),(r&2)===2?this.stderr=a:this.ancestor!==null&&(this.stderr=this.ancestor.stderr),s}async exec(){let t=["ignore","ignore","ignore"];if(this.pipe)t[0]="pipe";else{if(this.stdin===null)throw new Error("Assertion failed: No input stream registered");t[0]=this.stdin.get()}let r;if(this.stdout===null)throw new Error("Assertion failed: No output stream registered");r=this.stdout,t[1]=r.get();let s;if(this.stderr===null)throw new Error("Assertion failed: No error stream registered");s=this.stderr,t[2]=s.get();let a=this.implementation(t);return this.pipe&&this.pipe.attach(a.stdin),await a.promise.then(n=>(r.close(),s.close(),n))}async run(){let t=[];for(let s=this;s;s=s.ancestor)t.push(s.exec());return(await Promise.all(t))[0]}}});var pv={};Vt(pv,{EntryCommand:()=>lv,ShellError:()=>ec,execute:()=>xI,globUtils:()=>kR});function cpe(e,t,r){let s=new tc.PassThrough({autoDestroy:!0});switch(e){case 0:(t&1)===1&&r.stdin.pipe(s,{end:!1}),(t&2)===2&&r.stdin instanceof tc.Writable&&s.pipe(r.stdin,{end:!1});break;case 1:(t&1)===1&&r.stdout.pipe(s,{end:!1}),(t&2)===2&&s.pipe(r.stdout,{end:!1});break;case 2:(t&1)===1&&r.stderr.pipe(s,{end:!1}),(t&2)===2&&s.pipe(r.stderr,{end:!1});break;default:throw new ec(`Bad file descriptor: "${e}"`)}return s}function TR(e,t={}){let r={...e,...t};return r.environment={...e.environment,...t.environment},r.variables={...e.variables,...t.variables},r}async function Ytt(e,t,r){let s=[],a=new tc.PassThrough;return a.on("data",n=>s.push(n)),await FR(e,t,TR(r,{stdout:a})),Buffer.concat(s).toString().replace(/[\r\n]+$/,"")}async function upe(e,t,r){let s=e.map(async n=>{let c=await fm(n.args,t,r);return{name:n.name,value:c.join(" ")}});return(await Promise.all(s)).reduce((n,c)=>(n[c.name]=c.value,n),{})}function RR(e){return e.match(/[^ \r\n\t]+/g)||[]}async function gpe(e,t,r,s,a=s){switch(e.name){case"$":s(String(process.pid));break;case"#":s(String(t.args.length));break;case"@":if(e.quoted)for(let n of t.args)a(n);else for(let n of t.args){let c=RR(n);for(let f=0;f<c.length-1;++f)a(c[f]);s(c[c.length-1])}break;case"*":{let n=t.args.join(" ");if(e.quoted)s(n);else for(let c of RR(n))a(c)}break;case"PPID":s(String(process.ppid));break;case"RANDOM":s(String(Math.floor(Math.random()*32768)));break;default:{let n=parseInt(e.name,10),c,f=Number.isFinite(n);if(f?n>=0&&n<t.args.length&&(c=t.args[n]):Object.hasOwn(r.variables,e.name)?c=r.variables[e.name]:Object.hasOwn(r.environment,e.name)&&(c=r.environment[e.name]),typeof c<"u"&&e.alternativeValue?c=(await fm(e.alternativeValue,t,r)).join(" "):typeof c>"u"&&(e.defaultValue?c=(await fm(e.defaultValue,t,r)).join(" "):e.alternativeValue&&(c="")),typeof c>"u")throw f?new ec(`Unbound argument #${n}`):new ec(`Unbound variable "${e.name}"`);if(e.quoted)s(c);else{let p=RR(c);for(let E=0;E<p.length-1;++E)a(p[E]);let h=p[p.length-1];typeof h<"u"&&s(h)}}break}}async function uv(e,t,r){if(e.type==="number"){if(Number.isInteger(e.value))return e.value;throw new Error(`Invalid number: "${e.value}", only integers are allowed`)}else if(e.type==="variable"){let s=[];await gpe({...e,quoted:!0},t,r,n=>s.push(n));let a=Number(s.join(" "));return Number.isNaN(a)?uv({type:"variable",name:s.join(" ")},t,r):uv({type:"number",value:a},t,r)}else return Wtt[e.type](await uv(e.left,t,r),await uv(e.right,t,r))}async function fm(e,t,r){let s=new Map,a=[],n=[],c=E=>{n.push(E)},f=()=>{n.length>0&&a.push(n.join("")),n=[]},p=E=>{c(E),f()},h=(E,C,S)=>{let x=JSON.stringify({type:E,fd:C}),I=s.get(x);typeof I>"u"&&s.set(x,I=[]),I.push(S)};for(let E of e){let C=!1;switch(E.type){case"redirection":{let S=await fm(E.args,t,r);for(let x of S)h(E.subtype,E.fd,x)}break;case"argument":for(let S of E.segments)switch(S.type){case"text":c(S.text);break;case"glob":c(S.pattern),C=!0;break;case"shell":{let x=await Ytt(S.shell,t,r);if(S.quoted)c(x);else{let I=RR(x);for(let T=0;T<I.length-1;++T)p(I[T]);c(I[I.length-1])}}break;case"variable":await gpe(S,t,r,c,p);break;case"arithmetic":c(String(await uv(S.arithmetic,t,r)));break}break}if(f(),C){let S=a.pop();if(typeof S>"u")throw new Error("Assertion failed: Expected a glob pa Line truncated
`)).finally(()=>{r.stdout.isTTY&&r.stdout.write(`Job ${p}, '${c(yE(e))}' has ended
`)})),0}return await Ape(e,t,r)}async function ztt(e,t,r,{background:s=!1}={}){let a,n=f=>{a=f,r.variables["?"]=String(f)},c=async f=>{try{return await Jtt(f.chain,t,r,{background:s&&typeof f.then>"u"})}catch(p){if(!(p instanceof ec))throw p;return r.stderr.write(`${p.message}
`),1}};for(n(await c(e));e.then;){if(r.exitCode!==null)return r.exitCode;switch(e.then.type){case"&&":a===0&&n(await c(e.then.line));break;case"||":a!==0&&n(await c(e.then.line));break;default:throw new Error(`Assertion failed: Unsupported command type: "${e.then.type}"`)}e=e.then.line}return a}async function FR(e,t,r){let s=r.backgroundJobs;r.backgroundJobs=[];let a=0;for(let{command:n,type:c}of e){if(a=await ztt(n,t,r,{background:c==="&"}),r.exitCode!==null)return r.exitCode;r.variables["?"]=String(a)}return await Promise.all(r.backgroundJobs),r.backgroundJobs=s,a}function mpe(e){switch(e.type){case"variable":return e.name==="@"||e.name==="#"||e.name==="*"||Number.isFinite(parseInt(e.name,10))||"defaultValue"in e&&!!e.defaultValue&&e.defaultValue.some(t=>Av(t))||"alternativeValue"in e&&!!e.alternativeValue&&e.alternativeValue.some(t=>Av(t));case"arithmetic":return Tj(e.arithmetic);case"shell":return Fj(e.shell);default:return!1}}function Av(e){switch(e.type){case"redirection":return e.args.some(t=>Av(t));case"argument":return e.segments.some(t=>mpe(t));default:throw new Error(`Assertion failed: Unsupported argument type: "${e.type}"`)}}function Tj(e){switch(e.type){case"variable":return mpe(e);case"number":return!1;default:return Tj(e.left)||Tj(e.right)}}function Fj(e){return e.some(({command:t})=>{for(;t;){let r=t.chain;for(;r;){let s;switch(r.type){case"subshell":s=Fj(r.subshell);break;case"command":s=r.envs.some(a=>a.args.some(n=>Av(n)))||r.args.some(a=>Av(a));break}if(s)return!0;if(!r.then)break;r=r.then.chain}if(!t.then)break;t=t.then.line}return!1})}async function xI(e,t=[],{baseFs:r=new Kn,builtins:s={},cwd:a=Ae.toPortablePath(process.cwd()),env:n=process.env,stdin:c=process.stdin,stdout:f=process.stdout,stderr:p=process.stderr,variables:h={},glob:E=kR}={}){let C={};for(let[I,T]of Object.entries(n))typeof T<"u"&&(C[I]=T);let S=new Map(qtt);for(let[I,T]of Object.entries(s))S.set(I,T);c===null&&(c=new tc.PassThrough,c.end());let x=hx(e,E);if(!Fj(x)&&x.length>0&&t.length>0){let{command:I}=x[x.length-1];for(;I.then;)I=I.then.line;let T=I.chain;for(;T.then;)T=T.then.chain;T.type==="command"&&(T.args=T.args.concat(t.map(O=>({type:"argument",segments:[{type:"text",text:O}]}))))}return await FR(x,{args:t,baseFs:r,builtins:S,initialStdin:c,initialStdout:f,initialStderr:p,glob:E},{cwd:a,environment:C,exitCode:null,procedures:{},stdin:c,stdout:f,stderr:p,variables:Object.assign({},h,{"?":0}),nextBackgroundJobIndex:1,backgroundJobs:[]})}var ppe,hpe,tc,dpe,qtt,Wtt,cv=Xe(()=>{bt();Sc();ppe=et(LE()),hpe=Ie("os"),tc=Ie("stream"),dpe=Ie("timers/promises");XAe();ZAe();rpe();Rj();Rj();qtt=new Map([["cd",async([e=(0,hpe.homedir)(),...t],r,s)=>{let a=K.resolve(s.cwd,Ae.toPortablePath(e));if(!(await r.baseFs.statPromise(a).catch(c=>{throw c.code==="ENOENT"?new ec(`cd: no such file or directory: ${e}`):c})).isDirectory())throw new ec(`cd: not a directory: ${e}`);return s.cwd=a,0}],["pwd",async(e,t,r)=>(r.stdout.write(`${Ae.fromPortablePath(r.cwd)}
`),0)],[":",async(e,t,r)=>0],["true",async(e,t,r)=>0],["false",async(e,t,r)=>1],["exit",async([e,...t],r,s)=>s.exitCode=parseInt(e??s.variables["?"],10)],["echo",async(e,t,r)=>(r.stdout.write(`${e.join(" ")}
`),0)],["sleep",async([e],t,r)=>{if(typeof e>"u")throw new ec("sleep: missing operand");let s=Number(e);if(Number.isNaN(s))throw new ec(`sleep: invalid time interval '${e}'`);return await(0,dpe.setTimeout)(1e3*s,0)}],["unset",async(e,t,r)=>{for(let s of e)delete r.environment[s],delete r.variables[s];return 0}],["__ysh_run_procedure",async(e,t,r)=>{let s=r.procedures[e[0]];return await QR(s,{stdin:new Uc(r.stdin),stdout:new Uc(r.stdout),stderr:new Uc(r.stderr)}).run()}],["__ysh_set_redirects",async(e,t,r)=>{let s=r.stdin,a=r.stdout,n=r.stderr,c=[],f=[],p=[],h=0;for(;e[h]!=="--";){let C=e[h++],{type:S,fd:x}=JSON.parse(C),I=V=>{switch(x){case null:case 0:c.push(V);break;default:throw new Error(`Unsupported file descriptor: "${x}"`)}},T=V=>{switch(x){case null:case 1:f.push(V);break;case 2:p.push(V);break;default:throw new Error(`Unsupported file descriptor: "${x}"`)}},O=Number(e[h++]),U=h+O;for(let V=h;V<U;++h,++V)switch(S){case"<":I(()=>t.baseFs.createReadStream(K.resolve(r.cwd,Ae.toPortablePath(e[V]))));break;case"<<<":I(()=>{let $=new tc.PassThrough;return process.nextTick(()=>{$.write(`${e[V]}
`),$.end()}),$});break;case"<&":I(()=>cpe(Number(e[V]),1,r));break;case">":case">>":{let $=K.resolve(r.cwd,Ae.toPortablePath(e[V]));T($==="/dev/null"?new tc.Writable({autoDestroy:!0,emitClose:!0,write(ie,fe,ae){setImmediate(ae)}}):t.baseFs.createWriteStream($,S===">>"?{flags:"a"}:void 0))}break;case">&":T(cpe(Number(e[V]),2,r));break;default:throw new Error(`Assertion failed: Unsupported redirection type: "${S}"`)}}if(c.length>0){let C=new tc.PassThrough;s=C;let S=x=>{if(x===c.length)C.end();else{let I=c[x]();I.pipe(C,{end:!1}),I.on("end",()=>{S(x+1)})}};S(0)}if(f.length>0){let C=new tc.PassThrough;a=C;for(let S of f)C.pipe(S)}if(p.length>0){let C=new tc.PassThrough;n=C;for(let S of p)C.pipe(S)}let E=await QR(fv(e.slice(h+1),t,r),{stdin:new Uc(s),stdout:new Uc(a),stderr:new Uc(n)}).run();return await Promise.all(f.map(C=>new Promise((S,x)=>{C.on("error",I=>{x(I)}),C.on("close",()=>{S()}),C.end()}))),await Promise.all(p.map(C=>new Promise((S,x)=>{C.on("error",I=>{x(I)}),C.on("close",()=>{S()}),C.end()}))),E}]]);Wtt={addition:(e,t)=>e+t,subtraction:(e,t)=>e-t,multiplication:(e,t)=>e*t,division:(e,t)=>Math.trunc(e/t)}});var ype=G((zMt,NR)=>{function Xtt(){var e=0,t=1,r=2,s=3,a=4,n=5,c=6,f=7,p=8,h=9,E=10,C=11,S=12,x=13,I=14,T=15,O=16,U=17,V=0,$=1,ie=2,fe=3,ae=4;function ge(d,Se){return 55296<=d.charCodeAt(Se)&&d.charCodeAt(Se)<=56319&&56320<=d.charCodeAt(Se+1)&&d.charCodeAt(Se+1)<=57343}function he(d,Se){Se===void 0&&(Se=0);var Be=d.charCodeAt(Se);if(55296<=Be&&Be<=56319&&Se<d.length-1){var me=Be,ue=d.charCodeAt(Se+1);return 56320<=ue&&ue<=57343?(me-55296)*1024+(ue-56320)+65536:me}if(56320<=Be&&Be<=57343&&Se>=1){var me=d.charCodeAt(Se-1),ue=Be;return 55296<=me&&me<=56319?(me-55296)*1024+(ue-56320)+65536:ue}return Be}function Ce(d,Se,Be){var me=[d].concat(Se).concat([Be]),ue=me[me.length-2],Z=Be,be=me.lastIndexOf(I);if(be>1&&me.slice(1,be).every(function(_){return _==s})&&[s,x,U].indexOf(d)==-1)return ie;var Qe=me.lastIndexOf(a);if(Qe>0&&me.slice(1,Qe).every(function(_){return _==a})&&[S,a].indexOf(ue)==-1)return me.filter(function(_){return _==a}).length%2==1?fe:ae;if(ue==e&&Z==t)return V;if(ue==r||ue==e||ue==t)return Z==I&&Se.every(function(_){return _==s})?ie:$;if(Z==r||Z==e||Z==t)return $;if(ue==c&&(Z==c||Z==f||Z==h||Z==E))return V;if((ue==h||ue==f)&&(Z==f||Z==p))return V;if((ue==E||ue==p)&&Z==p)return V;if(Z==s||Z==T)return V;if(Z==n)return V;if(ue==S)return V;var ot=me.indexOf(s)!=-1?me.lastIndexOf(s)-1:me.length-2;return[x,U].indexOf(me[ot])!=-1&&me.slice(ot+1,-1).every(function(_){return _==s})&&Z==I||ue==T&&[O,U].indexOf(Z)!=-1?V:Se.indexOf(a)!=-1?ie:ue==a&&Z==a?V:$}this.nextBreak=function(d,Se){if(Se===void 0&&(Se=0),Se<0)return 0;if(Se>=d.length-1)return d.length;for(var Be=Ee(he(d,Se)),me=[],ue=Se+1;ue<d.length;ue++)if(!ge(d,ue-1)){var Z=Ee(he(d,ue));if(Ce(Be,me,Z))return ue;me.push(Z)}return d.length},this.splitGraphemes=function(d){for(var Se=[],Be=0,me;(me=this.nextBreak(d,Be))<d.length;)Se.push(d.slice(Be,me)),Be=me;return Be<d.length&&Se.push(d.slice(Be)),Se},this.iterateGraphemes=function(d){var Se=0,Be={next:function(){var me,ue;return(ue=this.nextBreak(d,Se))<d.length?(me=d.slice(Se,ue),Se=ue,{value:me,done:!1}):Se<d.length?(me=d.slice(Se),Se=d.length,{value:me,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(Be[Symbol.iterator]=function(){return Be}),Be},this.countGraphemes=function(d){for(var Se=0,Be=0,me;(me=this.nextBreak(d,Be))<d.length;)Be=me,Se++;return Be<d.length&&Se++,Se};function Ee(d){return 1536<=d&&d<=1541||d==1757||d==1807||d==2274||d==3406||d==69821||70082<=d&&d<=70083||d==72250||72326<=d&&d<=72329||d==73030?S:d==13?e:d==10?t:0<=d&&d<=9||11<=d&&d<=12||14<=d&&d<=31||127<=d&&d<=159||d==173||d==1564||d==6158||d==8203||8206<=d&&d<=8207||d==8232||d==8233||8234<=d&&d<=8238||8288<=d&&d<=8292||d==8293||8294<=d&&d<=8303||55296<=d&&d<=57343||d==65279||65520<=d&&d<=65528||65529<=d&&d<=65531||113824<=d&&d<=113827||119155<=d&&d<=119162||d==917504||d==917505||917506<=d&&d<=917535||917632<=d&&d<=917759||918e3<=d&&d<=921599?r:768<=d&&d<=879||1155<=d&&d<=1159||1160<=d&&d<=1161||1425<=d&&d<=1469||d==1471||1473<=d&&d<=1474||1476<=d&&d<=1477||d==1479||1552<=d&&d<=1562||1611<=d&&d<=1631||d==1648||1750<=d&&d<=1756||1759<=d&&d<=1764||1767<=d&&d<=1768||1770<=d&&d<=1773||d==1809||1840<=d&&d<=1866||1958<=d&&d<=1968||2027<=d&&d<=2035||2070<=d&&d<=2073||2075<=d&&d<=2083||2085<=d&&d<=2087||2089<=d&&d<=2093||2137<=d&&d<=2139||2260<=d&&d<=2273||2275<=d&&d<=2306||d==2362||d==2364||2369<=d&&d<=2376||d==2381||2385<=d&&d<=2391||2402<=d&&d<=2403||d==2433||d==2492||d==2494||2497<=d&&d<=2500||d==2509||d==2519||2530<=d&&d<=2531||2561<=d&&d<=2562||d==2620||2625<=d&&d<=2626||2631<=d&&d<=2632||2635<=d&&d<=2637||d==2641||2672<=d&&d<=2673||d==2677||2689<=d&&d<=2690||d==2748||2753<=d&&d<=2757||2759<=d&&d<=2760||d==2765||2786<=d&&d<=2787||2810<=d&&d<=2815||d==2817||d==2876||d==2878||d==2879||2881<=d&&d<=2884||d==2893||d==2902||d==2903||2914<=d&&d<=2915||d==2946||d==3006||d==3008|| Line truncated
`,end:e=>`::endgroup::
`}:LR.default.TRAVIS?{start:e=>`travis_fold:start:${e}
`,end:e=>`travis_fold:end:${e}
`}:LR.default.GITLAB?{start:e=>`section_start:${Math.floor(Date.now()/1e3)}:${e.toLowerCase().replace(/\W+/g,"_")}[collapsed=true]\r\x1B[0K${e}
`,end:e=>`section_end:${Math.floor(Date.now()/1e3)}:${e.toLowerCase().replace(/\W+/g,"_")}\r\x1B[0K`}:null,Spe=P0!==null,Bpe=new Date,trt=["iTerm.app","Apple_Terminal","WarpTerminal","vscode"].includes(process.env.TERM_PROGRAM)||!!process.env.WT_SESSION,rrt=e=>e,MR=rrt({patrick:{date:[17,3],chars:["\u{1F340}","\u{1F331}"],size:40},simba:{date:[19,7],chars:["\u{1F981}","\u{1F334}"],size:40},jack:{date:[31,10],chars:["\u{1F383}","\u{1F987}"],size:40},hogsfather:{date:[31,12],chars:["\u{1F389}","\u{1F384}"],size:40},default:{chars:["=","-"],size:80}}),nrt=trt&&Object.keys(MR).find(e=>{let t=MR[e];return!(t.date&&(t.date[0]!==Bpe.getDate()||t.date[1]!==Bpe.getMonth()+1))})||"default";Ft=class extends Io{constructor({configuration:r,stdout:s,json:a=!1,forceSectionAlignment:n=!1,includeNames:c=!0,includePrefix:f=!0,includeFooter:p=!0,includeLogs:h=!a,includeInfos:E=h,includeWarnings:C=h}){super();this.uncommitted=new Set;this.warningCount=0;this.errorCount=0;this.timerFooter=[];this.startTime=Date.now();this.indent=0;this.level=0;this.progress=new Map;this.progressTime=0;this.progressFrame=0;this.progressTimeout=null;this.progressStyle=null;this.progressMaxScaledSize=null;if(xB(this,{configuration:r}),this.configuration=r,this.forceSectionAlignment=n,this.includeNames=c,this.includePrefix=f,this.includeFooter=p,this.includeInfos=E,this.includeWarnings=C,this.json=a,this.stdout=s,r.get("enableProgressBars")&&!a&&s.isTTY&&s.columns>22){let S=r.get("progressBarStyle")||nrt;if(!Object.hasOwn(MR,S))throw new Error("Assertion failed: Invalid progress bar style");this.progressStyle=MR[S];let x=Math.min(this.getRecommendedLength(),80);this.progressMaxScaledSize=Math.floor(this.progressStyle.size*x/80)}}static async start(r,s){let a=new this(r),n=process.emitWarning;process.emitWarning=(c,f)=>{if(typeof c!="string"){let h=c;c=h.message,f=f??h.name}let p=typeof f<"u"?`${f}: ${c}`:c;a.reportWarning(0,p)},r.includeVersion&&a.reportInfo(0,Xg(r.configuration,`Yarn ${An}`,2));try{await s(a)}catch(c){a.reportExceptionOnce(c)}finally{await a.finalize(),process.emitWarning=n}return a}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}getRecommendedLength(){let s=this.progressStyle!==null?this.stdout.columns-1:super.getRecommendedLength();return Math.max(40,s-12-this.indent*2)}startSectionSync({reportHeader:r,reportFooter:s,skipIfEmpty:a},n){let c={committed:!1,action:()=>{r?.()}};a?this.uncommitted.add(c):(c.action(),c.committed=!0);let f=Date.now();try{return n()}catch(p){throw this.reportExceptionOnce(p),p}finally{let p=Date.now();this.uncommitted.delete(c),c.committed&&s?.(p-f)}}async startSectionPromise({reportHeader:r,reportFooter:s,skipIfEmpty:a},n){let c={committed:!1,action:()=>{r?.()}};a?this.uncommitted.add(c):(c.action(),c.committed=!0);let f=Date.now();try{return await n()}catch(p){throw this.reportExceptionOnce(p),p}finally{let p=Date.now();this.uncommitted.delete(c),c.committed&&s?.(p-f)}}startTimerImpl(r,s,a){return{cb:typeof s=="function"?s:a,reportHeader:()=>{this.level+=1,this.reportInfo(null,`\u250C ${r}`),this.indent+=1,P0!==null&&!this.json&&this.includeInfos&&this.stdout.write(P0.start(r))},reportFooter:f=>{if(this.indent-=1,P0!==null&&!this.json&&this.includeInfos){this.stdout.write(P0.end(r));for(let p of this.timerFooter)p()}this.configuration.get("enableTimers")&&f>200?this.reportInfo(null,`\u2514 Completed in ${Gt(this.configuration,f,dt.DURATION)}`):this.reportInfo(null,"\u2514 Completed"),this.level-=1},skipIfEmpty:(typeof s=="function"?{}:s).skipIfEmpty}}startTimerSync(r,s,a){let{cb:n,...c}=this.startTimerImpl(r,s,a);return this.startSectionSync(c,n)}async startTimerPromise(r,s,a){let{cb:n,...c}=this.startTimerImpl(r,s,a);return this.startSectionPromise(c,n)}reportSeparator(){this.indent===0?this.writeLine(""):this.reportInfo(null,"")}reportInfo(r,s){if(!this.includeInfos)return;this.commit();let a=this.formatNameWithHyperlink(r),n=a?`${a}: `:"",c=`${this.formatPrefix(n,"blueBright")}${s}`;this.json?this.reportJson({type:"info",name:r,displayName:this.formatName(r),indent:this.formatIndent(),data:s}):this.writeLine(c)}reportWarning(r,s){if(this.warningCount+=1,!this.includeWarnings)return;this.commit();let a=this.formatNameWithHyperlink(r),n=a?`${a}: `:"";this.json?this.reportJson({type:"warning",name:r,displayName:this.formatName(r),indent:this.formatIndent(),data:s}):this.writeLine(`${this.formatPrefix(n,"yellowBright")}${s}`)}reportError(r,s){this.errorCount+=1,this.timerFooter.push(()=>this.reportErrorImpl(r,s)),this.reportErrorImpl(r,s)}reportErrorImpl(r,s){this.commit();let a=this.formatNameWithHyperlink(r),n=a?`${a}: `:"";this.json?this.reportJson({type:"error",name:r,displayName:this.formatName(r),indent:this.formatIndent(),data:s}):this.writeLine(`${this.formatPrefix(n,"redBright")}${s}`,{truncate:!1})}reportFold(r,s){if(!P0)return;let a=`${P0.start(r)}${s}${P0.end(r)}`;this.timerFooter.push(()=>this.stdout.write(a))}reportProgress(r){if(this.progressStyle===null)ret Line truncated
`),this.writeProgress()}writeLines(r,{truncate:s}={}){this.clearProgress({delta:r.length});for(let a of r)this.stdout.write(`${this.truncate(a,{truncate:s})}
`);this.writeProgress()}commit(){let r=this.uncommitted;this.uncommitted=new Set;for(let s of r)s.committed=!0,s.action()}clearProgress({delta:r=0,clear:s=!1}){this.progressStyle!==null&&this.progress.size+r>0&&(this.stdout.write(`\x1B[${this.progress.size+r}A`),(r>0||s)&&this.stdout.write("\x1B[0J"))}writeProgress(){if(this.progressStyle===null||(this.progressTimeout!==null&&clearTimeout(this.progressTimeout),this.progressTimeout=null,this.progress.size===0))return;let r=Date.now();r-this.progressTime>wpe&&(this.progressFrame=(this.progressFrame+1)%Cpe.length,this.progressTime=r);let s=Cpe[this.progressFrame];for(let a of this.progress.values()){let n="";if(typeof a.lastScaledSize<"u"){let h=this.progressStyle.chars[0].repeat(a.lastScaledSize),E=this.progressStyle.chars[1].repeat(this.progressMaxScaledSize-a.lastScaledSize);n=` ${h}${E}`}let c=this.formatName(null),f=c?`${c}: `:"",p=a.definition.title?` ${a.definition.title}`:"";this.stdout.write(`${Gt(this.configuration,"\u27A4","blueBright")} ${f}${s}${n}${p}
`)}this.progressTimeout=setTimeout(()=>{this.refreshProgress({force:!0})},wpe)}refreshProgress({delta:r=0,force:s=!1}={}){let a=!1,n=!1;if(s||this.progress.size===0)a=!0;else for(let c of this.progress.values()){let f=typeof c.definition.progress<"u"?Math.trunc(this.progressMaxScaledSize*c.definition.progress):void 0,p=c.lastScaledSize;c.lastScaledSize=f;let h=c.lastTitle;if(c.lastTitle=c.definition.title,f!==p||(n=h!==c.definition.title)){a=!0;break}}a&&(this.clearProgress({delta:r,clear:n}),this.writeProgress())}truncate(r,{truncate:s}={}){return this.progressStyle===null&&(s=!1),typeof s>"u"&&(s=this.configuration.get("preferTruncatedLines")),s&&(r=(0,vpe.default)(r,0,this.stdout.columns-1)),r}formatName(r){return this.includeNames?bpe(r,{configuration:this.configuration,json:this.json}):""}formatPrefix(r,s){return this.includePrefix?`${Gt(this.configuration,"\u27A4",s)} ${r}${this.formatIndent()}`:""}formatNameWithHyperlink(r){return this.includeNames?Nj(r,{configuration:this.configuration,json:this.json}):""}formatIndent(){return this.level>0||!this.forceSectionAlignment?"\u2502 ".repeat(this.indent):`${ert} `}}});var wn={};Vt(wn,{PackageManager:()=>Ppe,detectPackageManager:()=>xpe,executePackageAccessibleBinary:()=>Fpe,executePackageScript:()=>UR,executePackageShellcode:()=>Oj,executeWorkspaceAccessibleBinary:()=>urt,executeWorkspaceLifecycleScript:()=>Rpe,executeWorkspaceScript:()=>Qpe,getPackageAccessibleBinaries:()=>_R,getWorkspaceAccessibleBinaries:()=>Tpe,hasPackageScript:()=>art,hasWorkspaceScript:()=>Lj,isNodeScript:()=>Mj,makeScriptEnv:()=>gv,maybeExecuteWorkspaceLifecycleScript:()=>crt,prepareExternalProject:()=>ort});async function x0(e,t,r,s=[]){if(process.platform==="win32"){let a=`@goto #_undefined_# 2>NUL || @title %COMSPEC% & @setlocal & @"${r}" ${s.map(n=>`"${n.replace('"','""')}"`).join(" ")} %*`;await le.writeFilePromise(K.format({dir:e,name:t,ext:".cmd"}),a)}await le.writeFilePromise(K.join(e,t),`#!/bin/sh
exec "${r}" ${s.map(a=>`'${a.replace(/'/g,`'"'"'`)}'`).join(" ")} "$@"
`,{mode:493})}async function xpe(e){let t=await _t.tryFind(e);if(t?.packageManager){let s=QQ(t.packageManager);if(s?.name){let a=`found ${JSON.stringify({packageManager:t.packageManager})} in manifest`,[n]=s.reference.split(".");switch(s.name){case"yarn":return{packageManagerField:!0,packageManager:Number(n)===1?"Yarn Classic":"Yarn",reason:a};case"npm":return{packageManagerField:!0,packageManager:"npm",reason:a};case"pnpm":return{packageManagerField:!0,packageManager:"pnpm",reason:a}}}}let r;try{r=await le.readFilePromise(K.join(e,Ir.lockfile),"utf8")}catch{}return r!==void 0?r.match(/^__metadata:$/m)?{packageManager:"Yarn",reason:'"__metadata" key found in yarn.lock'}:{packageManager:"Yarn Classic",reason:'"__metadata" key not found in yarn.lock, must be a Yarn classic lockfile'}:le.existsSync(K.join(e,"package-lock.json"))?{packageManager:"npm",reason:`found npm's "package-lock.json" lockfile`}:le.existsSync(K.join(e,"pnpm-lock.yaml"))?{packageManager:"pnpm",reason:`found pnpm's "pnpm-lock.yaml" lockfile`}:null}async function gv({project:e,locator:t,binFolder:r,ignoreCorepack:s,lifecycleScript:a,baseEnv:n=e?.configuration.env??process.env}){let c={};for(let[E,C]of Object.entries(n))typeof C<"u"&&(c[E.toLowerCase()!=="path"?E:"PATH"]=C);let f=Ae.fromPortablePath(r);c.BERRY_BIN_FOLDER=Ae.fromPortablePath(f);let p=process.env.COREPACK_ROOT&&!s?Ae.join(process.env.COREPACK_ROOT,"dist/yarn.js"):process.argv[1];if(await Promise.all([x0(r,"node",process.execPath),...An!==null?[x0(r,"run",process.execPath,[p,"run"]),x0(r,"yarn",process.execPath,[p]),x0(r,"yarnpkg",process.execPath,[p]),x0(r,"node-gyp",process.execPath,[p,"run","--top-level","node-gyp"])]:[]]),e&&(c.INIT_CWD=Ae.fromPortablePath(e.configuration.startingCwd),c.PROJECT_CWD=Ae.fromPortablePath(e.cwd)),c.PATH=c.PATH?`${f}${Ae.delimiter}${c.PATH}`:`${f}`,c.npm_execpath=`${f}${Ae.sep}yarn`,c.npm_node_execpath=`${f}${Ae.sep}node`,t){if(!e)throw new Error("Assertion failed: Missing project");let E=e.tryWorkspaceByLocator(t),C=E?E.manifest.version??"":e.storedPackages.get(t.locatorHash).version??"";c.npm_package_name=fn(t),c.npm_package_version=C;let S;if(E)S=E.cwd;else{let x=e.storedPackages.get(t.locatorHash);if(!x)throw new Error(`Package for ${Vr(e.configuration,t)} not found in the project`);let I=e.configuration.getLinkers(),T={project:e,report:new Ft({stdout:new k0.PassThrough,configuration:e.configuration})},O=I.find(U=>U.supportsPackage(x,T));if(!O)throw new Error(`The package ${Vr(e.configuration,x)} isn't supported by any of the available linkers`);S=await O.findPackageLocation(x,T)}c.npm_package_json=Ae.fromPortablePath(K.join(S,Ir.manifest))}let h=An!==null?`yarn/${An}`:`yarn/${Rp("@yarnpkg/core").version}-core`;return c.npm_config_user_agent=`${h} npm/? node/${process.version} ${process.platform} ${process.arch}`,a&&(c.npm_lifecycle_event=a),e&&await e.configuration.triggerHook(E=>E.setupScriptEnvironment,e,c,async(E,C,S)=>await x0(r,E,C,S)),c}async function ort(e,t,{configuration:r,report:s,workspace:a=null,locator:n=null}){await srt(async()=>{await le.mktempPromise(async c=>{let f=K.join(c,"pack.log"),p=null,{stdout:h,stderr:E}=r.getSubprocessStreams(f,{prefix:Ae.fromPortablePath(e),report:s}),C=n&&ju(n)?aI(n):n,S=C?ml(C):"an external project";h.write(`Packing ${S} from sources
`);let x=await xpe(e),I;x!==null?(h.write(`Using ${x.packageManager} for bootstrap. Reason: ${x.reason}
`),I=x.packageManager):(h.write(`No package manager configuration detected; defaulting to Yarn
`),I="Yarn");let T=I==="Yarn"&&!x?.packageManagerField;await le.mktempPromise(async O=>{let U=await gv({binFolder:O,ignoreCorepack:T,baseEnv:{...process.env,COREPACK_ENABLE_AUTO_PIN:"0"}}),$=new Map([["Yarn Classic",async()=>{let fe=a!==null?["workspace",a]:[],ae=K.join(e,Ir.manifest),ge=await le.readFilePromise(ae),he=await qu(process.execPath,[process.argv[1],"set","version","classic","--only-if-needed","--yarn-path"],{cwd:e,env:U,stdin:p,stdout:h,stderr:E,end:1});if(he.code!==0)return he.code;await le.writeFilePromise(ae,ge),await le.appendFilePromise(K.join(e,".npmignore"),`/.yarn
`),h.write(`
`),delete U.NODE_ENV;let Ce=await qu("yarn",["install"],{cwd:e,env:U,stdin:p,stdout:h,stderr:E,end:1});if(Ce.code!==0)return Ce.code;h.write(`
`);let Ee=await qu("yarn",[...fe,"pack","--filename",Ae.fromPortablePath(t)],{cwd:e,env:U,stdin:p,stdout:h,stderr:E});return Ee.code!==0?Ee.code:0}],["Yarn",async()=>{let fe=a!==null?["workspace",a]:[];U.YARN_ENABLE_INLINE_BUILDS="1";let ae=K.join(e,Ir.lockfile);await le.existsPromise(ae)||await le.writeFilePromise(ae,"");let ge=await qu("yarn",[...fe,"pack","--install-if-needed","--filename",Ae.fromPortablePath(t)],{cwd:e,env:U,stdin:p,stdout:h,stderr:E});return ge.code!==0?ge.code:0}],["npm",async()=>{if(a!==null){let Se=new k0.PassThrough,Be=zE(Se);Se.pipe(h,{end:!1});let me=await qu("npm",["--version"],{cwd:e,env:U,stdin:p,stdout:Se,stderr:E,end:0});if(Se.end(),me.code!==0)return h.end(),E.end(),me.code;let ue=(await Be).toString().trim();if(!rA(ue,">=7.x")){let Z=Qa(null,"npm"),be=Un(Z,ue),Qe=Un(Z,">=7.x");throw new Error(`Workspaces aren't supported by ${ai(r,be)}; please upgrade to ${ai(r,Qe)} (npm has been detected as the primary package manager for ${Gt(r,e,dt.PATH)})`)}}let fe=a!==null?["--workspace",a]:[];delete U.npm_config_user_agent,delete U.npm_config_production,delete U.NPM_CONFIG_PRODUCTION,delete U.NODE_ENV;let ae=await qu("npm",["install","--legacy-peer-deps"],{cwd:e,env:U,stdin:p,stdout:h,stderr:E,end:1});if(ae.code!==0)return ae.code;let ge=new k0.PassThrough,he=zE(ge);ge.pipe(h);let Ce=await qu("npm",["pack","--silent",...fe],{cwd:e,env:U,stdin:p,stdout:ge,stderr:E});if(Ce.code!==0)return Ce.code;let Ee=(await he).toString().trim().replace(/^.*\n/s,""),d=K.resolve(e,Ae.toPortablePath(Ee));return await le.renamePromise(d,t),0}]]).get(I);if(typeof $>"u")throw new Error("Assertion failed: Unsupported workflow");let ie=await $();if(!(ie===0||typeof ie>"u"))throw le.detachTemp(c),new Lt(58,`Packing the package failed (exit code ${ie}, logs can be found here: ${Gt(r,f,dt.PATH)})`)})})})}async function art(e,t,{project:r}){let s=r.tryWorkspaceByLocator(e);if(s!==null)return Lj(s,t);let a=r.storedPackages.get(e.locatorHash);if(!a)throw new Error(`Package for ${Vr(r.configuration,e)} not found in the project`);return await nA.openPromise(async n=>{let c=r.configuration,f=r.configuration.getLinkers(),p={project:r,report:new Ft({stdout:new k0.PassThrough,configuration:c})},h=f.find(x=>x.supportsPackage(a,p));if(!h)throw new Error(`The package ${Vr(r.configuration,a)} isn't supported by any of the available linkers`);let E=await h.findPackageLocation(a,p),C=new Pn(E,{baseFs:n});return(await _t.find(vt.dot,{baseFs:C})).scripts.has(t)})}async function UR(e,t,r,{cwd:s,project:a,stdin:n,stdout:c,stderr:f}){return await le.mktempPromise(async p=>{let{manifest:h,env:E,cwd:C}=await kpe(e,{project:a,binFolder:p,cwd:s,lifecycleScript:t}),S=h.scripts.get(t);if(typeof S>"u")return 1;let x=async()=>await xI(S,r,{cwd:C,env:E,stdin:n,stdout:c,stderr:f});return await(await a.configuration.reduceHook(T=>T.wrapScriptExecution,x,a,e,t,{script:S,args:r,cwd:C,env:E,stdin:n,stdout:c,stderr:f}))()})}async function Oj(e,t,r,{cwd:s,project:a,stdin:n,stdout:c,stderr:f}){return await le.mktempPromise(async p=>{let{env:h,cwd:E}=await kpe(e,{project:a,binFolder:p,cwd:s});return await xI(t,r,{cwd:E,env:h,stdin:n,stdout:c,stderr:f})})}async function lrt(e,{binFolder:t,cwd:r,lifecycleScript:s}){let a=await gv({project:e.project,locator:e.anchoredLocator,binFolder:t,lifecycleScript:s});return await Uj(t,await Tpe(e)),typeof r>"u"&&(r=K.dirname(await le.realpathPromise(K.join(e.cwd,"package.json")))),{manifest:e.manifest,binFolder:t,env:a,cwd:r}}async function kpe(e,{project:t,binFolder:r,cwd:s,lifecycleScript:a}){let n=t.tryWorkspaceByLocator(e);if(n!==null)return lrt(n,{binFolder:r,cwd:s,lifecycleScript:a});let c=t.storedPackages.get(e.locatorHash);if(!c)throw new Error(`Package for ${Vr(t.configuration,e)} not found in the project`);return await nA.openPromise(async f=>{let p=t.configuration,h=t.configuration.getLinkers(),E={project:t,report:new Ft({stdout:new k0.PassThrough,configuration:p})},C=h.find(O=>O.supportsPackage(c,E));if(!C)throw new Error(`The package ${Vr(t.configuration,c)} isn't supported by any of the available linkers`);let S=await gv({project:t,locator:e,binFolder:r,lifecycleScript:a});await Uj(r,await _R(e,{project:t}));let x=await C.findPackageLocation(c,E),I=new Pn(x,{baseFs:f}),T=await _t.find(vt.dot,{baseFs:I});return typeof s>"u"&&(s=x),{manifest:T,binFolder:r,env:S,cwd:s}})}async function Qpe(e,t,r,{cwd:s,stdin:a,stdout:n,stderr:c}){return await UR(e.anchoredLocator,t,r,{cwd:s,project:e.project,stdin:a,stdout:n,stderr:c})}function Lj(e,t){return e.manifest.scripts.has(t)}async function Rpe(e,t,{cwd:r,report:s}){let{configuration:a}=e.project,n=null;await le.mktempPromise(async c=>{let f=K.join(c,`${t}.log`),p=`# This file contains the result of Yarn calling the "${t}" lifecycle script inside a workspace ("${Ae.fromPortablePath(e.cwd)}")
`,{stdout:h,stderr:E}=a.getSubprocessStreams(f,{report:s,prefix:Vr(a,e.anchoredLocator),header:p});s.reportInfo(36,`Calling the "${t}" lifecycle script`);let C=await Qpe(e,t,[],{cwd:r,stdin:n,stdout:h,stderr:E});if(h.end(),E.end(),C!==0)throw le.detachTemp(c),new Lt(36,`${BB(t)} script failed (exit code ${Gt(a,C,dt.NUMBER)}, logs can be found here: ${Gt(a,f,dt.PATH)}); run ${Gt(a,`yarn ${t}`,dt.CODE)} to investigate`)})}async function crt(e,t,r){Lj(e,t)&&await Rpe(e,t,r)}function Mj(e){let t=K.extname(e);if(t.match(/\.[cm]?[jt]sx?$/))return!0;if(t===".exe"||t===".bin")return!1;let r=Buffer.alloc(4),s;try{s=le.openSync(e,"r")}catch{return!0}try{le.readSync(s,r,0,r.length,0)}finally{le.closeSync(s)}let a=r.readUint32BE();return!(a===3405691582||a===3489328638||a===2135247942||(a&4294901760)===1297743872)}async function _R(e,{project:t}){let r=t.configuration,s=new Map,a=t.storedPackages.get(e.locatorHash);if(!a)throw new Error(`Package for ${Vr(r,e)} not found in the project`);let n=new k0.Writable,c=r.getLinkers(),f={project:t,report:new Ft({configuration:r,stdout:n})},p=new Set([e.locatorHash]);for(let E of a.dependencies.values()){let C=t.storedResolutions.get(E.descriptorHash);if(!C)throw new Error(`Assertion failed: The resolution (${ai(r,E)}) should have been registered`);p.add(C)}let h=await Promise.all(Array.from(p,async E=>{let C=t.storedPackages.get(E);if(!C)throw new Error(`Assertion failed: The package (${E}) should have been registered`);if(C.bin.size===0)return Zl.skip;let S=c.find(I=>I.supportsPackage(C,f));if(!S)return Zl.skip;let x=null;try{x=await S.findPackageLocation(C,f)}catch(I){if(I.code==="LOCATOR_NOT_INSTALLED")return Zl.skip;throw I}return{dependency:C,packageLocation:x}}));for(let E of h){if(E===Zl.skip)continue;let{dependency:C,packageLocation:S}=E;for(let[x,I]of C.bin){let T=K.resolve(S,I);s.set(x,[C,Ae.fromPortablePath(T),Mj(T)])}}return s}async function Tpe(e){return await _R(e.anchoredLocator,{project:e.project})}async function Uj(e,t){await Promise.all(Array.from(t,([r,[,s,a]])=>a?x0(e,r,process.execPath,[s]):x0(e,r,s,[])))}async function Fpe(e,t,r,{cwd:s,project:a,stdin:n,stdout:c,stderr:f,nodeArgs:p=[],packageAccessibleBinaries:h}){h??=await _R(e,{project:a});let E=h.get(t);if(!E)throw new Error(`Binary not found (${t}) for ${Vr(a.configuration,e)}`);return await le.mktempPromise(async C=>{let[,S]=E,x=await gv({project:a,locator:e,binFolder:C});await Uj(x.BERRY_BIN_FOLDER,h);let I=Mj(Ae.toPortablePath(S))?qu(process.execPath,[...p,S,...r],{cwd:s,env:x,stdin:n,stdout:c,stderr:f}):qu(S,r,{cwd:s,env:x,stdin:n,stdout:c,stderr:f}),T;try{T=await I}finally{await le.removePromise(x.BERRY_BIN_FOLDER)}return T.code})}async function urt(e,t,r,{cwd:s,stdin:a,stdout:n,stderr:c,packageAccessibleBinaries:f}){return await Fpe(e.anchoredLocator,t,r,{project:e.project,cwd:s,stdin:a,stdout:n,stderr:c,packageAccessibleBinaries:f})}var Dpe,k0,Ppe,irt,srt,_j=Xe(()=>{bt();bt();iA();cv();Xl();Dpe=et(Mg()),k0=Ie("stream");fI();Nc();dv();hv();yR();Rc();Qc();Lp();$o();Ppe=(a=>(a.Yarn1="Yarn Classic",a.Yarn2="Yarn",a.Npm="npm",a.Pnpm="pnpm",a))(Ppe||{});irt=2,srt=(0,Dpe.default)(irt)});function Bnt(e,t,r){let s=t,a=t?t.next:e.head,n=new q6(r,s,a,e);return n.next===void 0&&(e.tail=n),n.prev===void 0&&(e.head=n),e.length++,n}function vnt(e,t){e.tail=new q6(t,e.tail,void 0,e),e.head||(e.head=e.tail),e.length++}function Snt(e,t){e.head=new q6(t,void 0,e.head,e),e.tail||(e.tail=e.head),e.length++}var fhe,Oa,gT,O6,Ahe,M6,wm,yT,dhe,AT,U0,Upe,ghe,Cm,whe,Mv,Ku,y6,Dhe,b6,W6,The,V6,Bn,gs,K6,Hv,_I,Il,Mhe,Uv,J6,El,X6,frt,Art,Npe,prt,hrt,drt,qp,Yp,Q0,HR,mv,jR,Ope,GR,Lpe,Yu,QI,zs,yv,NI,Xs,Na,Zs,Hj,qR,na,es,jj,Gj,Mpe,qj,oA,Yj,YR,Ev,Am,rc,Iv,grt,mrt,yrt,Ert,phe,Irt,Crt,wrt,Dm,Brt,H0,zu,Cv,Jn,Wj,Jp,Vj,h6,d6,Qv,WR,UI,HI,Kj,OI,j0,Ju,N0,aA,LI,Jj,Kp,wv,zj,tT,pm,rT,Bm,L6,vrt,mT,hhe,Srt,brt,Drt,Prt,xrt,krt,Qrt,U6,_v,Rrt,uA,Trt,_pe,Frt,Xj,vm,VR,Zj,_6,mhe,Nrt,Ort,yhe,Lrt,Mrt,Ehe,Urt,_rt,Hrt,jrt,Grt,qrt,Yrt,Wrt,Ihe,Che,Vrt,nT,Krt,ET,H6,Sm,Jrt,hm,$j,zrt,O0,Xrt,Zrt,$rt,L0,ent,tnt,rnt,e6,nnt,dm,pT,int,snt,ont,ant,cn,vhe,IT,lnt,g6,m6,cnt,_c,gm,Wp,t6,Hpe,lA,Bv,R0,jpe,Ci,Vp,T0,r6,mm,ds,KR,JR,n6,Gpe,qpe,vv,i6,zR,RI,F0,XR,ym,ZR,$R,Ype,unt,bm,Rv,fnt,She,Ant,pnt,CT,bhe,hnt,Wpe,j6,wT,G6,dnt,gnt,Vpe,mnt,Phe,ynt,Kpe,Jpe,zpe,E6,Xpe,Sv,iT,I6,sT,C6,w6,B6,v6,M0,hT,S6,s6,cA,xhe,Ent,Int,Cnt,wnt,q6,Zpe,$pe,oT,bv,Wu,Em,Im,Dv,o6,Vu,a6,aT,ehe,D6,P6,lT,cT,the,l6,uT,khe,c6,BT,Y6,bnt,Dnt,Qhe,Rhe,Pnt,xnt,EUt,knt,Qnt,Rnt,Tnt,Fnt,Fhe,Nnt,Ont,Lnt,Nhe,x6,dT,Mnt,Ohe,Unt,Lhe,Uhe,vT,_nt,Hnt,k6,_he,jnt,Gnt,u6,rhe,TI,qnt,Ynt,Wnt,Vnt,Knt,Jnt,nhe,Q6,ihe,R6,Hc,T6,F6,fT,she,ohe,kv,ahe,lhe,f6,_0,$s,eT,che,FI,A6,p6,N6,Tv,Fv,Nv,Ov,znt,Lv,Xnt,Znt,$nt,uhe,z6,Pv,Hhe,eit,tit,IUt,rit,nit,iit,sit,oit,xv,CUt,ait,jhe=Xe(()=>{fhe=et(Ie("events"),1),Oa=et(Ie("fs"),1),gT=Ie("node:events"),O6=et(Ie("node:stream"),1),Ahe=Ie("node:string_decoder"),M6=et(Ie("node:path"),1),wm=et(Ie("node:fs"),1),yT=Ie("path"),dhe=Ie("events"),AT=et(Ie("assert"),1),U0=Ie("buffer"),Upe=et(Ie("zlib"),1), Line truncated
`,n=Buffer.byteLength(a),c=Math.floor(Math.log(n)/Math.log(10))+1;return n+c>=Math.pow(10,c)&&(c+=1),c+n+a}static parse(t,r,s=!1){return new Bhe(int(snt(t),r),s)}},int=(e,t)=>t?Object.assign({},t,e):e,snt=e=>e.replace(/\n$/,"").split(`
`).reduce(ont,Object.create(null)),ont=(e,t)=>{let r=parseInt(t,10);if(r!==Buffer.byteLength(t)+1)return e;t=t.slice((r+" ").length);let s=t.split("="),a=s.shift();if(!a)return e;let n=a.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),c=s.join("=");return e[n]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n)?new Date(Number(c)*1e3):/^[0-9]+$/.test(c)?+c:c,e},ant=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,cn=ant!=="win32"?e=>e:e=>e&&e.replace(/\\/g,"/"),vhe=class extends Dm{extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=!1;ignore=!1;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=!1;absolute;unsupported=!1;constructor(e,t,r){switch(super({}),this.pause(),this.extended=t,this.globalExtended=r,this.header=e,this.remain=e.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=e.type,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}if(!e.path)throw new Error("no path provided for tar.ReadEntry");this.path=cn(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=this.remain,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath?cn(e.linkpath):void 0,this.uname=e.uname,this.gname=e.gname,t&&this.#e(t),r&&this.#e(r,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");let r=this.remain,s=this.blockRemain;return this.remain=Math.max(0,r-t),this.blockRemain=Math.max(0,s-t),this.ignore?!0:r>=t?super.write(e):super.write(e.subarray(0,r))}#e(e,t=!1){e.path&&(e.path=cn(e.path)),e.linkpath&&(e.linkpath=cn(e.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(e).filter(([r,s])=>!(s==null||r==="path"&&t))))}},IT=(e,t,r,s={})=>{e.file&&(s.file=e.file),e.cwd&&(s.cwd=e.cwd),s.code=r instanceof Error&&r.code||t,s.tarCode=t,!e.strict&&s.recoverable!==!1?(r instanceof Error&&(s=Object.assign(r,s),r=r.message),e.emit("warn",t,r,s)):r instanceof Error?e.emit("error",Object.assign(r,s)):e.emit("error",Object.assign(new Error(`${t}: ${r}`),s))},lnt=1024*1024,g6=Buffer.from([31,139]),m6=Buffer.from([40,181,47,253]),cnt=Math.max(g6.length,m6.length),_c=Symbol("state"),gm=Symbol("writeEntry"),Wp=Symbol("readEntry"),t6=Symbol("nextEntry"),Hpe=Symbol("processEntry"),lA=Symbol("extendedHeader"),Bv=Symbol("globalExtendedHeader"),R0=Symbol("meta"),jpe=Symbol("emitMeta"),Ci=Symbol("buffer"),Vp=Symbol("queue"),T0=Symbol("ended"),r6=Symbol("emittedEnd"),mm=Symbol("emit"),ds=Symbol("unzip"),KR=Symbol("consumeChunk"),JR=Symbol("consumeChunkSub"),n6=Symbol("consumeBody"),Gpe=Symbol("consumeMeta"),qpe=Symbol("consumeHeader"),vv=Symbol("consuming"),i6=Symbol("bufferConcat"),zR=Symbol("maybeEnd"),RI=Symbol("writing"),F0=Symbol("aborted"),XR=Symbol("onDone"),ym=Symbol("sawValidEntry"),ZR=Symbol("sawNullBlock"),$R=Symbol("sawEOF"),Ype=Symbol("closeStream"),unt=()=>!0,bm=class extends dhe.EventEmitter{file;strict;maxMetaEntrySize;filter;brotli;zstd;writable=!0;readable=!1;[Vp]=[];[Ci];[Wp];[gm];[_c]="begin";[R0]="";[lA];[Bv];[T0]=!1;[ds];[F0]=!1;[ym];[ZR]=!1;[$R]=!1;[RI]=!1;[vv]=!1;[r6]=!1;constructor(e={}){super(),this.file=e.file||"",this.on(XR,()=>{(this[_c]==="begin"||this[ym]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(XR,e.ondone):this.on(XR,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||lnt,this.filter=typeof e.filter=="function"?e.filter:unt;let t=e.file&&(e.file.endsWith(".tar.br")||e.file.endsWith(".tbr"));this.brotli=!(e.gzip||e.zstd)&&e.brotli!==void 0?e.brotli:t?void 0:!1;let r=e.file&&(e.file.endsWith(".tar.zst")||e.file.endsWith(".tzst"));this.zstd=!(e.gzip||e.brotli)&&e.zstd!==void 0?e.zstd:r?!0:void 0,this.on("end",()=>this[Ype]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onReadEntry=="function"&&this.on("entry",e.onReadEntry)}warn(e,t,r={}){IT(this,e,t,r)}[qpe](e,t){this[ym]===void 0&&(this[ym]=!1);let r;try{r=new Sm(e,t,this[lA],this[Bv])}catch(s){return this.warn("TAR_ENTRY_INVALID",s)}if(r.nullBlock)this[ZR]?(this[$R]=!0,this[_c]==="begin"&&(this[_c]="header"),this[mm]("eof")):(this[ZR]=!0,this[mm]("nullBlock"));else if(this[ZR]=!1,!r.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:r});else if(!r.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:r});else{let s=r.type;if(/^(Symbolic)?Link$/.test(s)&&!r.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:r});else if(!/^(Symbolic)?Link$/.test(s)&&!/^(Global)?ExtendedHeader$/.test Line truncated
`}),f},s})});var ts={};Vt(ts,{emitList:()=>hit,emitTree:()=>n0e,treeNodeToJson:()=>r0e,treeNodeToTreeify:()=>t0e});function t0e(e,{configuration:t}){let r={},s=0,a=(n,c)=>{let f=Array.isArray(n)?n.entries():Object.entries(n);for(let[p,h]of f){if(!h)continue;let{label:E,value:C,children:S}=h,x=[];typeof E<"u"&&x.push(Xg(t,E,2)),typeof C<"u"&&x.push(Gt(t,C[0],C[1])),x.length===0&&x.push(Xg(t,`${p}`,2));let I=x.join(": ").trim(),T=`\0${s++}\0`,O=c[`${T}${I}`]={};typeof S<"u"&&a(S,O)}};if(typeof e.children>"u")throw new Error("The root node must only contain children");return a(e.children,r),r}function r0e(e){let t=r=>{if(typeof r.children>"u"){if(typeof r.value>"u")throw new Error("Assertion failed: Expected a value to be set if the children are missing");return Zg(r.value[0],r.value[1])}let s=Array.isArray(r.children)?r.children.entries():Object.entries(r.children??{}),a=Array.isArray(r.children)?[]:{};for(let[n,c]of s)c&&(a[dit(n)]=t(c));return typeof r.value>"u"?a:{value:Zg(r.value[0],r.value[1]),children:a}};return t(e)}function hit(e,{configuration:t,stdout:r,json:s}){let a=e.map(n=>({value:n}));n0e({children:a},{configuration:t,stdout:r,json:s})}function n0e(e,{configuration:t,stdout:r,json:s,separators:a=0}){if(s){let c=Array.isArray(e.children)?e.children.values():Object.values(e.children??{});for(let f of c)f&&r.write(`${JSON.stringify(r0e(f))}
`);return}let n=(0,e0e.asTree)(t0e(e,{configuration:t}),!1,!1);if(n=n.replace(/\0[0-9]+\0/g,""),a>=1&&(n=n.replace(/^([├└]─)/gm,`\u2502
$1`).replace(/^│\n/,"")),a>=2)for(let c=0;c<2;++c)n=n.replace(/^([│ ].{2}[├│ ].{2}[^\n]+\n)(([│ ]).{2}[├└].{2}[^\n]*\n[│ ].{2}[│ ].{2}[├└]─)/gm,`$1$3 \u2502
$2`).replace(/^│\n/,"");if(a>=3)throw new Error("Only the first two levels are accepted by treeUtils.emitTree");r.write(n)}function dit(e){return typeof e=="string"?e.replace(/^\0[0-9]+\0/,""):e}var e0e,i0e=Xe(()=>{e0e=et($he());Rc()});var ST,s0e=Xe(()=>{ST=class{constructor(t){this.releaseFunction=t;this.map=new Map}addOrCreate(t,r){let s=this.map.get(t);if(typeof s<"u"){if(s.refCount<=0)throw new Error(`Race condition in RefCountedMap. While adding a new key the refCount is: ${s.refCount} for ${JSON.stringify(t)}`);return s.refCount++,{value:s.value,release:()=>this.release(t)}}else{let a=r();return this.map.set(t,{refCount:1,value:a}),{value:a,release:()=>this.release(t)}}}release(t){let r=this.map.get(t);if(!r)throw new Error(`Unbalanced calls to release. No known instances of: ${JSON.stringify(t)}`);let s=r.refCount;if(s<=0)throw new Error(`Unbalanced calls to release. Too many release vs alloc refcount would become: ${s-1} of ${JSON.stringify(t)}`);s==1?(this.map.delete(t),this.releaseFunction(r.value)):r.refCount--}}});function qv(e){let t=e.match(git);if(!t?.groups)throw new Error("Assertion failed: Expected the checksum to match the requested pattern");let r=t.groups.cacheVersion?parseInt(t.groups.cacheVersion):null;return{cacheKey:t.groups.cacheKey??null,cacheVersion:r,cacheSpec:t.groups.cacheSpec??null,hash:t.groups.hash}}var o0e,iG,sG,bT,zr,git,oG=Xe(()=>{Ge();bt();bt();iA();o0e=Ie("crypto"),iG=et(Ie("fs"));s0e();Nc();w0();Qc();$o();sG=XE(process.env.YARN_CACHE_CHECKPOINT_OVERRIDE??process.env.YARN_CACHE_VERSION_OVERRIDE??9),bT=XE(process.env.YARN_CACHE_VERSION_OVERRIDE??10),zr=class e{constructor(t,{configuration:r,immutable:s=r.get("enableImmutableCache"),check:a=!1}){this.markedFiles=new Set;this.mutexes=new Map;this.refCountedZipFsCache=new ST(t=>{t.discardAndClose()});this.cacheId=`-${(0,o0e.randomBytes)(8).toString("hex")}.tmp`;this.configuration=r,this.cwd=t,this.immutable=s,this.check=a;let{cacheSpec:n,cacheKey:c}=e.getCacheKey(r);this.cacheSpec=n,this.cacheKey=c}static async find(t,{immutable:r,check:s}={}){let a=new e(t.get("cacheFolder"),{configuration:t,immutable:r,check:s});return await a.setup(),a}static getCacheKey(t){let r=t.get("compressionLevel"),s=r!=="mixed"?`c${r}`:"";return{cacheKey:[bT,s].join(""),cacheSpec:s}}get mirrorCwd(){if(!this.configuration.get("enableMirror"))return null;let t=`${this.configuration.get("globalFolder")}/cache`;return t!==this.cwd?t:null}getVersionFilename(t){return`${lI(t)}-${this.cacheKey}.zip`}getChecksumFilename(t,r){let a=qv(r).hash.slice(0,10);return`${lI(t)}-${a}.zip`}isChecksumCompatible(t){if(t===null)return!1;let{cacheVersion:r,cacheSpec:s}=qv(t);if(r===null||r<sG)return!1;let a=this.configuration.get("cacheMigrationMode");return!(r<bT&&a==="always"||s!==this.cacheSpec&&a!=="required-only")}getLocatorPath(t,r){return this.mirrorCwd===null?K.resolve(this.cwd,this.getVersionFilename(t)):r===null?K.resolve(this.cwd,this.getVersionFilename(t)):K.resolve(this.cwd,this.getChecksumFilename(t,r))}getLocatorMirrorPath(t){let r=this.mirrorCwd;return r!==null?K.resolve(r,this.getVersionFilename(t)):null}async setup(){if(!this.configuration.get("enableGlobalCache"))if(this.immutable){if(!await le.existsPromise(this.cwd))throw new Lt(56,"Cache path does not exist.")}else{await le.mkdirPromise(this.cwd,{recursive:!0});let t=K.resolve(this.cwd,".gitignore");await le.changeFilePromise(t,`/.gitignore
*.flock
*.tmp
`)}(this.mirrorCwd||!this.immutable)&&await le.mkdirPromise(this.mirrorCwd||this.cwd,{recursive:!0})}async fetchPackageFromCache(t,r,{onHit:s,onMiss:a,loader:n,...c}){let f=this.getLocatorMirrorPath(t),p=new Kn,h=()=>{let he=new hs,Ce=K.join(vt.root,E8(t));return he.mkdirSync(Ce,{recursive:!0}),he.writeJsonSync(K.join(Ce,Ir.manifest),{name:fn(t),mocked:!0}),he},E=async(he,{isColdHit:Ce,controlPath:Ee=null})=>{if(Ee===null&&c.unstablePackages?.has(t.locatorHash))return{isValid:!0,hash:null};let d=r&&!Ce?qv(r).cacheKey:this.cacheKey,Se=!c.skipIntegrityCheck||!r?`${d}/${await DQ(he)}`:r;if(Ee!==null){let me=!c.skipIntegrityCheck||!r?`${this.cacheKey}/${await DQ(Ee)}`:r;if(Se!==me)throw new Lt(18,"The remote archive doesn't match the local checksum - has the local cache been corrupted?")}let Be=null;switch(r!==null&&Se!==r&&(this.check?Be="throw":qv(r).cacheKey!==qv(Se).cacheKey?Be="update":Be=this.configuration.get("checksumBehavior")),Be){case null:case"update":return{isValid:!0,hash:Se};case"ignore":return{isValid:!0,hash:r};case"reset":return{isValid:!1,hash:r};default:case"throw":throw new Lt(18,"The remote archive doesn't match the expected checksum")}},C=async he=>{if(!n)throw new Error(`Cache check required but no loader configured for ${Vr(this.configuration,t)}`);let Ce=await n(),Ee=Ce.getRealPath();Ce.saveAndClose(),await le.chmodPromise(Ee,420);let d=await E(he,{controlPath:Ee,isColdHit:!1});if(!d.isValid)throw new Error("Assertion failed: Expected a valid checksum");return d.hash},S=async()=>{if(f===null||!await le.existsPromise(f)){let he=await n(),Ce=he.getRealPath();return he.saveAndClose(),{source:"loader",path:Ce}}return{source:"mirror",path:f}},x=async()=>{if(!n)throw new Error(`Cache entry required but missing for ${Vr(this.configuration,t)}`);if(this.immutable)throw new Lt(56,`Cache entry required but missing for ${Vr(this.configuration,t)}`);let{path:he,source:Ce}=await S(),{hash:Ee}=await E(he,{isColdHit:!0}),d=this.getLocatorPath(t,Ee),Se=[];Ce!=="mirror"&&f!==null&&Se.push(async()=>{let me=`${f}${this.cacheId}`;await le.copyFilePromise(he,me,iG.default.constants.COPYFILE_FICLONE),await le.chmodPromise(me,420),await le.renamePromise(me,f)}),(!c.mirrorWriteOnly||f===null)&&Se.push(async()=>{let me=`${d}${this.cacheId}`;await le.copyFilePromise(he,me,iG.default.constants.COPYFILE_FICLONE),await le.chmodPromise(me,420),await le.renamePromise(me,d)});let Be=c.mirrorWriteOnly?f??d:d;return await Promise.all(Se.map(me=>me())),[!1,Be,Ee]},I=async()=>{let Ce=(async()=>{let Ee=c.unstablePackages?.has(t.locatorHash),d=Ee||!r||this.isChecksumCompatible(r)?this.getLocatorPath(t,r):null,Se=d!==null?this.markedFiles.has(d)||await p.existsPromise(d):!1,Be=!!c.mockedPackages?.has(t.locatorHash)&&(!this.check||!Se),me=Be||Se,ue=me?s:a;if(ue&&ue(),me){let Z=null,be=d;if(!Be)if(this.check)Z=await C(be);else{let Qe=await E(be,{isColdHit:!1});if(Qe.isValid)Z=Qe.hash;else return x()}return[Be,be,Z]}else{if(this.immutable&&Ee)throw new Lt(56,`Cache entry required but missing for ${Vr(this.configuration,t)}; consider defining ${ce.pretty(this.configuration,"supportedArchitectures",ce.Type.CODE)} to cache packages for multiple systems`);return x()}})();this.mutexes.set(t.locatorHash,Ce);try{return await Ce}finally{this.mutexes.delete(t.locatorHash)}};for(let he;he=this.mutexes.get(t.locatorHash);)await he;let[T,O,U]=await I();T||this.markedFiles.add(O);let V=()=>this.refCountedZipFsCache.addOrCreate(O,()=>T?h():new hs(O,{baseFs:p,readOnly:!0})),$,ie=new AE(()=>T4(()=>($=V(),$.value),he=>`Failed to open the cache entry for ${Vr(this.configuration,t)}: ${he}`),K),fe=new Gf(O,{baseFs:ie,pathUtils:K}),ae=()=>{$?.release()},ge=c.unstablePackages?.has(t.locatorHash)?null:U;return[fe,ae,ge]}},git=/^(?:(?<cacheKey>(?<cacheVersion>[0-9]+)(?<cacheSpec>.*))\/)?(?<hash>.*)$/});var DT,a0e=Xe(()=>{DT=(r=>(r[r.SCRIPT=0]="SCRIPT",r[r.SHELLCODE=1]="SHELLCODE",r))(DT||{})});var mit,jI,aG=Xe(()=>{bt();Sc();Lp();$o();mit=[[/^(git(?:\+(?:https|ssh))?:\/\/.*(?:\.git)?)#(.*)$/,(e,t,r,s)=>`${r}#commit=${s}`],[/^https:\/\/((?:[^/]+?)@)?codeload\.github\.com\/([^/]+\/[^/]+)\/tar\.gz\/([0-9a-f]+)$/,(e,t,r="",s,a)=>`https://${r}github.com/${s}.git#commit=${a}`],[/^https:\/\/((?:[^/]+?)@)?github\.com\/([^/]+\/[^/]+?)(?:\.git)?#([0-9a-f]+)$/,(e,t,r="",s,a)=>`https://${r}github.com/${s}.git#commit=${a}`],[/^https?:\/\/[^/]+\/(?:[^/]+\/)*(?:@.+(?:\/|(?:%2f)))?([^/]+)\/(?:-|download)\/\1-[^/]+\.tgz(?:#|$)/,e=>`npm:${e}`],[/^https:\/\/npm\.pkg\.github\.com\/download\/(?:@[^/]+)\/(?:[^/]+)\/(?:[^/]+)\/(?:[0-9a-f]+)(?:#|$)/,e=>`npm:${e}`],[/^https:\/\/npm\.fontawesome\.com\/(?:@[^/]+)\/([^/]+)\/-\/([^/]+)\/\1-\2.tgz(?:#|$)/,e=>`npm:${e}`],[/^https?:\/\/[^/]+\/.*\/(@[^/]+)\/([^/]+)\/-\/\1\/\2-(?:[.\d\w-]+)\.tgz(?:#|$)/,(e,t)=>RQ({protocol:"npm:",source:null,selector:e,params:{__archiveUrl:t}})],[/^[^/]+\.tgz#[0-9a-f]+$/,e=>`npm:${e}`]],jI=class{constructor(t){this.resolver=t;this.resolutions=null}async setup(t,{report:r}){let s=K.join(t.cwd,Ir.loc Line truncated
`)}reportProgress(r){return{...Promise.resolve().then(async()=>{for await(let{}of r);}),stop:()=>{}}}reportJson(r){}reportFold(r,s){}async finalize(){this.errorCount>0&&(this.stdout.write(`
`),this.stdout.write(`${Gt(this.configuration,"\u27A4","redBright")} Errors happened when preparing the environment required to run this command.
`),this.suggestInstall&&this.stdout.write(`${Gt(this.configuration,"\u27A4","redBright")} This might be caused by packages being missing from the lockfile, in which case running "yarn install" might help.
`))}formatNameWithHyperlink(r){return Nj(r,{configuration:this.configuration,json:!1})}}});var GI,lG=Xe(()=>{$o();GI=class{constructor(t){this.resolver=t}supportsDescriptor(t,r){return!!(r.project.storedResolutions.get(t.descriptorHash)||r.project.originalPackages.has(xQ(t).locatorHash))}supportsLocator(t,r){return!!(r.project.originalPackages.has(t.locatorHash)&&!r.project.lockfileNeedsRefresh)}shouldPersistResolution(t,r){throw new Error("The shouldPersistResolution method shouldn't be called on the lockfile resolver, which would always answer yes")}bindDescriptor(t,r,s){return t}getResolutionDependencies(t,r){return this.resolver.getResolutionDependencies(t,r)}async getCandidates(t,r,s){let a=s.project.storedResolutions.get(t.descriptorHash);if(a){let c=s.project.originalPackages.get(a);if(c)return[c]}let n=s.project.originalPackages.get(xQ(t).locatorHash);if(n)return[n];throw new Error("Resolution expected from the lockfile data")}async getSatisfying(t,r,s,a){let[n]=await this.getCandidates(t,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(t,r){let s=r.project.originalPackages.get(t.locatorHash);if(!s)throw new Error("The lockfile resolver isn't meant to resolve packages - they should already have been stored into a cache");return s}}});function zp(){}function yit(e,t,r,s,a){for(var n=0,c=t.length,f=0,p=0;n<c;n++){var h=t[n];if(h.removed){if(h.value=e.join(s.slice(p,p+h.count)),p+=h.count,n&&t[n-1].added){var C=t[n-1];t[n-1]=t[n],t[n]=C}}else{if(!h.added&&a){var E=r.slice(f,f+h.count);E=E.map(function(x,I){var T=s[p+I];return T.length>x.length?T:x}),h.value=e.join(E)}else h.value=e.join(r.slice(f,f+h.count));f+=h.count,h.added||(p+=h.count)}}var S=t[c-1];return c>1&&typeof S.value=="string"&&(S.added||S.removed)&&e.equals("",S.value)&&(t[c-2].value+=S.value,t.pop()),t}function Eit(e){return{newPos:e.newPos,components:e.components.slice(0)}}function Iit(e,t){if(typeof e=="function")t.callback=e;else if(e)for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function f0e(e,t,r){return r=Iit(r,{ignoreWhitespace:!0}),pG.diff(e,t,r)}function Cit(e,t,r){return hG.diff(e,t,r)}function PT(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?PT=function(t){return typeof t}:PT=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},PT(e)}function cG(e){return vit(e)||Sit(e)||bit(e)||Dit()}function vit(e){if(Array.isArray(e))return uG(e)}function Sit(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function bit(e,t){if(e){if(typeof e=="string")return uG(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uG(e,t)}}function uG(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r<t;r++)s[r]=e[r];return s}function Dit(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fG(e,t,r,s,a){t=t||[],r=r||[],s&&(e=s(a,e));var n;for(n=0;n<t.length;n+=1)if(t[n]===e)return r[n];var c;if(Pit.call(e)==="[object Array]"){for(t.push(e),c=new Array(e.length),r.push(c),n=0;n<e.length;n+=1)c[n]=fG(e[n],t,r,s,a);return t.pop(),r.pop(),c}if(e&&e.toJSON&&(e=e.toJSON()),PT(e)==="object"&&e!==null){t.push(e),c={},r.push(c);var f=[],p;for(p in e)e.hasOwnProperty(p)&&f.push(p);for(f.sort(),n=0;n<f.length;n+=1)p=f[n],c[p]=fG(e[p],t,r,s,p);t.pop(),r.pop()}else c=e;return c}function A0e(e,t,r,s,a,n,c){c||(c={}),typeof c.context>"u"&&(c.context=4);var f=Cit(r,s,c);if(!f)return;f.push({value:"",lines:[]});function p(U){return U.map(function(V){return" "+V})}for(var h=[],E=0,C=0,S=[],x=1,I=1,T=function(V){var $=f[V],ie=$.lines||$.value.replace(/\n$/,"").split(`
`);if($.lines=ie,$.added||$.removed){var fe;if(!E){var ae=f[V-1];E=x,C=I,ae&&(S=c.context>0?p(ae.lines.slice(-c.context)):[],E-=S.length,C-=S.length)}(fe=S).push.apply(fe,cG(ie.map(function(me){return($.added?"+":"-")+me}))),$.added?I+=ie.length:x+=ie.length}else{if(E)if(ie.length<=c.context*2&&V<f.length-2){var ge;(ge=S).push.apply(ge,cG(p(ie)))}else{var he,Ce=Math.min(ie.length,c.context);(he=S).push.apply(he,cG(p(ie.slice(0,Ce))));var Ee={oldStart:E,oldLines:x-E+Ce,newStart:C,newLines:I-C+Ce,lines:S};if(V>=f.length-2&&ie.length<=c.context){var d=/\n$/.test(r),Se=/\n$/.test(s),Be=ie.length==0&&S.length>Ee.oldLines;!d&&Be&&r.length>0&&S.splice(Ee.oldLines,0,"\\ No newline at end of file"),(!d&&!Be||!Se)&&S.push("\\ No newline at end of file")}h.push(Ee),E=0,C=0,S=[]}x+=ie.length,I+=ie.length}},O=0;O<f.length;O++)T(O);return{oldFileName:e,newFileName:t,oldHeader:a,newHeader:n,hunks:h}}var T_t,c0e,u0e,pG,hG,wit,Bit,Pit,Yv,AG,dG=Xe(()=>{zp.prototype={diff:function(t,r){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=s.callback;typeof s=="function"&&(a=s,s={}),this.options=s;var n=this;function c(T){return a?(setTimeout(function(){a(void 0,T)},0),!0):T}t=this.castInput(t),r=this.castInput(r),t=this.removeEmpty(this.tokenize(t)),r=this.removeEmpty(this.tokenize(r));var f=r.length,p=t.length,h=1,E=f+p;s.maxEditLength&&(E=Math.min(E,s.maxEditLength));var C=[{newPos:-1,components:[]}],S=this.extractCommon(C[0],r,t,0);if(C[0].newPos+1>=f&&S+1>=p)return c([{value:this.join(r),count:r.length}]);function x(){for(var T=-1*h;T<=h;T+=2){var O=void 0,U=C[T-1],V=C[T+1],$=(V?V.newPos:0)-T;U&&(C[T-1]=void 0);var ie=U&&U.newPos+1<f,fe=V&&0<=$&&$<p;if(!ie&&!fe){C[T]=void 0;continue}if(!ie||fe&&U.newPos<V.newPos?(O=Eit(V),n.pushComponent(O.components,void 0,!0)):(O=U,O.newPos++,n.pushComponent(O.components,!0,void 0)),$=n.extractCommon(O,r,t,T),O.newPos+1>=f&&$+1>=p)return c(yit(n,O.components,r,t,n.useLongestToken));C[T]=O}h++}if(a)(function T(){setTimeout(function(){if(h>E)return a();x()||T()},0)})();else for(;h<=E;){var I=x();if(I)return I}},pushComponent:function(t,r,s){var a=t[t.length-1];a&&a.added===r&&a.removed===s?t[t.length-1]={count:a.count+1,added:r,removed:s}:t.push({count:1,added:r,removed:s})},extractCommon:function(t,r,s,a){for(var n=r.length,c=s.length,f=t.newPos,p=f-a,h=0;f+1<n&&p+1<c&&this.equals(r[f+1],s[p+1]);)f++,p++,h++;return h&&t.components.push({count:h}),t.newPos=f,p},equals:function(t,r){return this.options.comparator?this.options.comparator(t,r):t===r||this.options.ignoreCase&&t.toLowerCase()===r.toLowerCase()},removeEmpty:function(t){for(var r=[],s=0;s<t.length;s++)t[s]&&r.push(t[s]);return r},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};T_t=new zp;c0e=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,u0e=/\S/,pG=new zp;pG.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!u0e.test(e)&&!u0e.test(t)};pG.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),r=0;r<t.length-1;r++)!t[r+1]&&t[r+2]&&c0e.test(t[r])&&c0e.test(t[r+2])&&(t[r]+=t[r+2],t.splice(r+1,2),r--);return t};hG=new zp;hG.tokenize=function(e){var t=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(var s=0;s<r.length;s++){var a=r[s];s%2&&!this.options.newlineIsToken?t[t.length-1]+=a:(this.options.ignoreWhitespace&&(a=a.trim()),t.push(a))}return t};wit=new zp;wit.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};Bit=new zp;Bit.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};Pit=Object.prototype.toString,Yv=new zp;Yv.useLongestToken=!0;Yv.tokenize=hG.tokenize;Yv.castInput=function(e){var t=this.options,r=t.undefinedReplacement,s=t.stringifyReplacer,a=s===void 0?function(n,c){return typeof c>"u"?r:c}:s;return typeof e=="string"?e:JSON.stringify(fG(e,null,null,a),a," ")};Yv.equals=function(e,t){return zp.prototype.equals.call(Yv,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};AG=new zp;AG.tokenize=function(e){return e.slice()};AG.join=AG.removeEmpty=function(e){return e}});var xT,p0e=Xe(()=>{Nc();xT=class{constructor(t){this.resolver=t}supportsDescriptor(t,r){return this.resolver.supportsDescriptor(t,r)}supportsLocator(t,r){return this.resolver.supportsLocator(t,r)}shouldPersistResolution(t,r){return this.resolver.shouldPersistResolution(t,r)}bindDescriptor(t,r,s){return this.resolver.bindDescriptor(t,r,s)}getResolutionDependencies(t,r){return this.resolver.getResolutionDependencies(t,r)}async getCandidates(t,r,s){throw new Lt(20,`This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile`)}async getSatisfying(t,r,s,a){throw new Lt(20,`This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile`)}async resolve(t,r){throw new Lt(20,`This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile`)}}}); Line truncated
`;await le.changeFilePromise(r,s,{automaticNewlines:!0}),this.manifest.raw=t}}});function Fit({project:e,allDescriptors:t,allResolutions:r,allPackages:s,accessibleLocators:a=new Set,optionalBuilds:n=new Set,peerRequirements:c=new Map,peerWarnings:f=[],peerRequirementNodes:p=new Map,volatileDescriptors:h=new Set}){let E=new Map,C=[],S=new Map,x=new Map,I=new Map,T=new Map,O=new Map,U=new Map(e.workspaces.map(ae=>{let ge=ae.anchoredLocator.locatorHash,he=s.get(ge);if(typeof he>"u")throw new Error("Assertion failed: The workspace should have an associated package");return[ge,TB(he)]})),V=()=>{let ae=le.mktempSync(),ge=K.join(ae,"stacktrace.log"),he=String(C.length+1).length,Ce=C.map((Ee,d)=>`${`${d+1}.`.padStart(he," ")} ${ml(Ee)}
`).join("");throw le.writeFileSync(ge,Ce),le.detachTemp(ae),new Lt(45,`Encountered a stack overflow when resolving peer dependencies; cf ${Ae.fromPortablePath(ge)}`)},$=ae=>{let ge=r.get(ae.descriptorHash);if(typeof ge>"u")throw new Error("Assertion failed: The resolution should have been registered");let he=s.get(ge);if(!he)throw new Error("Assertion failed: The package could not be found");return he},ie=(ae,ge,he,{top:Ce,optional:Ee})=>{C.length>1e3&&V(),C.push(ge);let d=fe(ae,ge,he,{top:Ce,optional:Ee});return C.pop(),d},fe=(ae,ge,he,{top:Ce,optional:Ee})=>{if(Ee||n.delete(ge.locatorHash),a.has(ge.locatorHash))return;a.add(ge.locatorHash);let d=s.get(ge.locatorHash);if(!d)throw new Error(`Assertion failed: The package (${Vr(e.configuration,ge)}) should have been registered`);let Se=new Set,Be=new Map,me=[],ue=[],Z=[],be=[];for(let Qe of Array.from(d.dependencies.values())){if(d.peerDependencies.has(Qe.identHash)&&d.locatorHash!==Ce)continue;if(Fp(Qe))throw new Error("Assertion failed: Virtual packages shouldn't be encountered when virtualizing a branch");h.delete(Qe.descriptorHash);let ot=Ee;if(!ot){let Re=d.dependenciesMeta.get(fn(Qe));if(typeof Re<"u"){let ct=Re.get(null);typeof ct<"u"&&ct.optional&&(ot=!0)}}let _=r.get(Qe.descriptorHash);if(!_)throw new Error(`Assertion failed: The resolution (${ai(e.configuration,Qe)}) should have been registered`);let tt=U.get(_)||s.get(_);if(!tt)throw new Error(`Assertion failed: The package (${_}, resolved from ${ai(e.configuration,Qe)}) should have been registered`);if(tt.peerDependencies.size===0){ie(Qe,tt,new Map,{top:Ce,optional:ot});continue}let Ne,ke,De=new Set,je=new Map;me.push(()=>{Ne=m8(Qe,ge.locatorHash),ke=y8(tt,ge.locatorHash),d.dependencies.set(Qe.identHash,Ne),r.set(Ne.descriptorHash,ke.locatorHash),t.set(Ne.descriptorHash,Ne),s.set(ke.locatorHash,ke),Qp(T,ke.locatorHash).add(Ne.descriptorHash),Se.add(ke.locatorHash)}),ue.push(()=>{O.set(ke.locatorHash,je);for(let Re of ke.peerDependencies.values()){let Me=$l(Be,Re.identHash,()=>{let P=he.get(Re.identHash)??null,w=d.dependencies.get(Re.identHash);return!w&&NB(ge,Re)&&(ae.identHash===ge.identHash?w=ae:(w=Un(ge,ae.range),t.set(w.descriptorHash,w),r.set(w.descriptorHash,ge.locatorHash),h.delete(w.descriptorHash),P=null)),w||(w=Un(Re,"missing:")),{subject:ge,ident:Re,provided:w,root:!P,requests:new Map,hash:`p${As(ge.locatorHash,Re.identHash).slice(0,6)}`}}).provided;if(Me.range==="missing:"&&ke.dependencies.has(Re.identHash)){ke.peerDependencies.delete(Re.identHash);continue}if(je.set(Re.identHash,{requester:ke,descriptor:Re,meta:ke.peerDependenciesMeta.get(fn(Re)),children:new Map}),ke.dependencies.set(Re.identHash,Me),Fp(Me)){let P=r.get(Me.descriptorHash);Qp(I,P).add(ke.locatorHash)}S.set(Me.identHash,Me),Me.range==="missing:"&&De.add(Me.identHash)}ke.dependencies=new Map(Ks(ke.dependencies,([Re,ct])=>fn(ct)))}),Z.push(()=>{if(!s.has(ke.locatorHash))return;let Re=E.get(tt.locatorHash);typeof Re=="number"&&Re>=2&&V();let ct=E.get(tt.locatorHash),Me=typeof ct<"u"?ct+1:1;E.set(tt.locatorHash,Me),ie(Ne,ke,je,{top:Ce,optional:ot}),E.set(tt.locatorHash,Me-1)}),be.push(()=>{let Re=r.get(Ne.descriptorHash);if(typeof Re>"u")throw new Error("Assertion failed: Expected the descriptor to be registered");let ct=O.get(Re);if(typeof ct>"u")throw new Error("Assertion failed: Expected the peer requests to be registered");for(let Me of Be.values()){let P=ct.get(Me.ident.identHash);P&&(Me.requests.set(Ne.descriptorHash,P),p.set(Me.hash,Me),Me.root||he.get(Me.ident.identHash)?.children.set(Ne.descriptorHash,P))}if(s.has(ke.locatorHash))for(let Me of De)ke.dependencies.delete(Me)})}for(let Qe of[...me,...ue])Qe();for(let Qe of Se){Se.delete(Qe);let ot=s.get(Qe),_=As(aI(ot).locatorHash,...Array.from(ot.dependencies.values(),De=>{let je=De.range!=="missing:"?r.get(De.descriptorHash):"missing:";if(typeof je>"u")throw new Error(`Assertion failed: Expected the resolution for ${ai(e.configuration,De)} to have been registered`);return je===Ce?`${je} (top)`:je})),tt=x.get(_);if(typeof tt>"u"){x.set(_,ot);continue}let Ne=Qp(T,tt.locatorHash);for(let De of T.get(ot.locatorHash)??[])r.set(De,tt.locatorHash),Ne.add(De);s.delete(ot.locatorHash),a.delete(ot.locatorHash),Se.delete(ot.locatorHash);let ke=I.get(ot.locatorHash);if(ke!==void 0){let De=Qp(I,tt.locatorHash);for(let je of ke)De.add(je),Se.add(je)}}for(let Qe of[...Z,...be])Qe()};for(let ae of e.workspaces){let ge=ae.anchoredLocator;h.delete(ae.anchoredDescriptor.descriptorHash),ie(ae.anchoredDescriptor,ge,new Map,{top:ge.locatorHash,optional:!1})}for(let ae of p.values()){if(!ae.root)continue;let ge=s.get(ae.subject.locatorHash);if(typeof ge>"u")continue;for(let Ce of ae.requests.values()){let Ee=`p${As(ae.subject.locatorHash,fn(ae.ident),Ce.requester.locatorHash).slice(0,6)}`;c.set(Ee,{subject:ae.subject.locatorHash,requested:ae.ident,rootRequester:Ce.requester.locatorHash,allRequesters:Array.from(_B(Ce),d=>d.requester.locatorHash)})}let he=[..._B(ae)];if(ae.provided.range Line truncated
${[C,S,x].join(`
`)}`)}async setupResolutions(){this.storedResolutions=new Map,this.storedDescriptors=new Map,this.storedPackages=new Map,this.lockFileChecksum=null;let t=K.join(this.cwd,Ir.lockfile),r=this.configuration.get("defaultLanguageName");if(le.existsSync(t)){let s=await le.readFilePromise(t,"utf8");this.lockFileChecksum=g0e(s);let a=us(s);if(a.__metadata){let n=a.__metadata.version,c=a.__metadata.cacheKey;this.lockfileLastVersion=n,this.lockfileNeedsRefresh=n<RT;for(let f of Object.keys(a)){if(f==="__metadata")continue;let p=a[f];if(typeof p.resolution>"u")throw new Error(`Assertion failed: Expected the lockfile entry to have a resolution field (${f})`);let h=Np(p.resolution,!0),E=new _t;E.load(p,{yamlCompatibilityMode:!0});let C=E.version,S=E.languageName||r,x=p.linkType.toUpperCase(),I=p.conditions??null,T=E.dependencies,O=E.peerDependencies,U=E.dependenciesMeta,V=E.peerDependenciesMeta,$=E.bin;if(p.checksum!=null){let fe=typeof c<"u"&&!p.checksum.includes("/")?`${c}/${p.checksum}`:p.checksum;this.storedChecksums.set(h.locatorHash,fe)}let ie={...h,version:C,languageName:S,linkType:x,conditions:I,dependencies:T,peerDependencies:O,dependenciesMeta:U,peerDependenciesMeta:V,bin:$};this.originalPackages.set(ie.locatorHash,ie);for(let fe of f.split(kit)){let ae=B0(fe);n<=6&&(ae=this.configuration.normalizeDependency(ae),ae=Un(ae,ae.range.replace(/^patch:[^@]+@(?!npm(:|%3A))/,"$1npm%3A"))),this.storedDescriptors.set(ae.descriptorHash,ae),this.storedResolutions.set(ae.descriptorHash,h.locatorHash)}}}else s.includes("yarn lockfile v1")&&(this.lockfileLastVersion=-1)}}async setupWorkspaces(){this.workspaces=[],this.workspacesByCwd=new Map,this.workspacesByIdent=new Map;let t=new Set,r=(0,QT.default)(4),s=async(a,n)=>{if(t.has(n))return a;t.add(n);let c=new qI(n,{project:this});await r(()=>c.setup());let f=a.then(()=>{this.addWorkspace(c)});return Array.from(c.workspacesCwds).reduce(s,f)};await s(Promise.resolve(),this.cwd)}addWorkspace(t){let r=this.workspacesByIdent.get(t.anchoredLocator.identHash);if(typeof r<"u")throw new Error(`Duplicate workspace name ${$i(this.configuration,t.anchoredLocator)}: ${Ae.fromPortablePath(t.cwd)} conflicts with ${Ae.fromPortablePath(r.cwd)}`);this.workspaces.push(t),this.workspacesByCwd.set(t.cwd,t),this.workspacesByIdent.set(t.anchoredLocator.identHash,t)}get topLevelWorkspace(){return this.getWorkspaceByCwd(this.cwd)}tryWorkspaceByCwd(t){K.isAbsolute(t)||(t=K.resolve(this.cwd,t)),t=K.normalize(t).replace(/\/+$/,"");let r=this.workspacesByCwd.get(t);return r||null}getWorkspaceByCwd(t){let r=this.tryWorkspaceByCwd(t);if(!r)throw new Error(`Workspace not found (${t})`);return r}tryWorkspaceByFilePath(t){let r=null;for(let s of this.workspaces)K.relative(s.cwd,t).startsWith("../")||r&&r.cwd.length>=s.cwd.length||(r=s);return r||null}getWorkspaceByFilePath(t){let r=this.tryWorkspaceByFilePath(t);if(!r)throw new Error(`Workspace not found (${t})`);return r}tryWorkspaceByIdent(t){let r=this.workspacesByIdent.get(t.identHash);return typeof r>"u"?null:r}getWorkspaceByIdent(t){let r=this.tryWorkspaceByIdent(t);if(!r)throw new Error(`Workspace not found (${$i(this.configuration,t)})`);return r}tryWorkspaceByDescriptor(t){if(t.range.startsWith(Ii.protocol)){let s=t.range.slice(Ii.protocol.length);if(s!=="^"&&s!=="~"&&s!=="*"&&!yl(s))return this.tryWorkspaceByCwd(s)}let r=this.tryWorkspaceByIdent(t);return r===null||(Fp(t)&&(t=FB(t)),!r.accepts(t.range))?null:r}getWorkspaceByDescriptor(t){let r=this.tryWorkspaceByDescriptor(t);if(r===null)throw new Error(`Workspace not found (${ai(this.configuration,t)})`);return r}tryWorkspaceByLocator(t){let r=this.tryWorkspaceByIdent(t);return r===null||(ju(t)&&(t=aI(t)),r.anchoredLocator.locatorHash!==t.locatorHash)?null:r}getWorkspaceByLocator(t){let r=this.tryWorkspaceByLocator(t);if(!r)throw new Error(`Workspace not found (${Vr(this.configuration,t)})`);return r}deleteDescriptor(t){this.storedResolutions.delete(t),this.storedDescriptors.delete(t)}deleteLocator(t){this.originalPackages.delete(t),this.storedPackages.delete(t),this.accessibleLocators.delete(t)}forgetResolution(t){if("descriptorHash"in t){let r=this.storedResolutions.get(t.descriptorHash);this.deleteDescriptor(t.descriptorHash);let s=new Set(this.storedResolutions.values());typeof r<"u"&&!s.has(r)&&this.deleteLocator(r)}if("locatorHash"in t){this.deleteLocator(t.locatorHash);for(let[r,s]of this.storedResolutions)s===t.locatorHash&&this.deleteDescriptor(r)}}forgetTransientResolutions(){let t=this.configuration.makeResolver(),r=new Map;for(let[s,a]of this.storedResolutions.entries()){let n=r.get(a);n||r.set(a,n=new Set),n.add(s)}for(let s of this.originalPackages.values()){let a;try{a=t.shouldPersistResolution(s,{project:this,resolver:t})}catch{a=!1}if(!a){this.deleteLocator(s.locatorHash);let n=r.get(s.locatorHash);if(n){r.delete(s.locatorHash);for(let c of n)this.deleteDescriptor(c)}}}}forgetVirtualResolutions(){for(let t of this.storedPackages.values())for(let[r,s]of t.dependencies)Fp(s)&&t.depLine truncated
`;switch(tt.type){case 0:Ne+=`# Script name: ${tt.script}
`;break;case 1:Ne+=`# Script code: ${tt.script}
`;break}let ke=null;if(!await le.mktempPromise(async je=>{let Re=K.join(je,"build.log"),{stdout:ct,stderr:Me}=this.configuration.getSubprocessStreams(Re,{header:Ne,prefix:Vr(this.configuration,Z),report:r}),P;try{switch(tt.type){case 0:P=await UR(Z,tt.script,[],{cwd:_,project:this,stdin:ke,stdout:ct,stderr:Me});break;case 1:P=await Oj(Z,tt.script,[],{cwd:_,project:this,stdin:ke,stdout:ct,stderr:Me});break}}catch(y){Me.write(y.stack),P=1}if(ct.end(),Me.end(),P===0)return!0;le.detachTemp(je);let w=`${Vr(this.configuration,Z)} couldn't be built successfully (exit code ${Gt(this.configuration,P,dt.NUMBER)}, logs can be found here: ${Gt(this.configuration,Re,dt.PATH)})`,D=this.optionalBuilds.has(Z.locatorHash);return D?r.reportInfo(9,w):r.reportError(9,w),Spe&&r.reportFold(Ae.fromPortablePath(Re),le.readFileSync(Re,"utf8")),D}))return!1}return!0});me.push(...ot,Promise.allSettled(ot).then(_=>{ie.delete(ue),_.every(tt=>tt.status==="fulfilled"&&tt.value===!0)&&Ee.set(Z.locatorHash,Qe)}))}if(await Mu(me),Be===ie.size){let ue=Array.from(ie).map(Z=>{let be=this.storedPackages.get(Z);if(!be)throw new Error("Assertion failed: The package should have been registered");return Vr(this.configuration,be)}).join(", ");r.reportError(3,`Some packages have circular dependencies that make their build order unsatisfiable - as a result they won't be built (affected packages are: ${ue})`);break}}this.storedBuildState=Ee,this.skippedBuilds=O}async installWithNewReport(t,r){return(await Ft.start({configuration:this.configuration,json:t.json,stdout:t.stdout,forceSectionAlignment:!0,includeLogs:!t.json&&!t.quiet,includeVersion:!0},async a=>{await this.install({...r,report:a})})).exitCode()}async install(t){let r=this.configuration.get("nodeLinker");Je.telemetry?.reportInstall(r);let s=!1;if(await t.report.startTimerPromise("Project validation",{skipIfEmpty:!0},async()=>{this.configuration.get("enableOfflineMode")&&t.report.reportWarning(90,"Offline work is enabled; Yarn won't fetch packages from the remote registry if it can avoid it"),await this.configuration.triggerHook(E=>E.validateProject,this,{reportWarning:(E,C)=>{t.report.reportWarning(E,C)},reportError:(E,C)=>{t.report.reportError(E,C),s=!0}})}),s)return;let a=await this.configuration.getPackageExtensions();for(let E of a.values())for(let[,C]of E)for(let S of C)S.status="inactive";let n=K.join(this.cwd,Ir.lockfile),c=null;if(t.immutable)try{c=await le.readFilePromise(n,"utf8")}catch(E){throw E.code==="ENOENT"?new Lt(28,"The lockfile would have been created by this install, which is explicitly forbidden."):E}await t.report.startTimerPromise("Resolution step",async()=>{await this.resolveEverything(t)}),await t.report.startTimerPromise("Post-resolution validation",{skipIfEmpty:!0},async()=>{Oit(this,t.report);for(let[,E]of a)for(let[,C]of E)for(let S of C)if(S.userProvided){let x=Gt(this.configuration,S,dt.PACKAGE_EXTENSION);switch(S.status){case"inactive":t.report.reportWarning(68,`${x}: No matching package in the dependency tree; you may not need this rule anymore.`);break;case"redundant":t.report.reportWarning(69,`${x}: This rule seems redundant when applied on the original package; the extension may have been applied upstream.`);break}}if(c!==null){let E=Ig(c,this.generateLockfile());if(E!==c){let C=A0e(n,n,c,E,void 0,void 0,{maxEditLength:100});if(C){t.report.reportSeparator();for(let S of C.hunks){t.report.reportInfo(null,`@@ -${S.oldStart},${S.oldLines} +${S.newStart},${S.newLines} @@`);for(let x of S.lines)x.startsWith("+")?t.report.reportError(28,Gt(this.configuration,x,dt.ADDED)):x.startsWith("-")?t.report.reportError(28,Gt(this.configuration,x,dt.REMOVED)):t.report.reportInfo(null,Gt(this.configuration,x,"grey"))}t.report.reportSeparator()}throw new Lt(28,"The lockfile would have been modified by this install, which is explicitly forbidden.")}}});for(let E of a.values())for(let[,C]of E)for(let S of C)S.userProvided&&S.status==="active"&&Je.telemetry?.reportPackageExtension(Zg(S,dt.PACKAGE_EXTENSION));await t.report.startTimerPromise("Fetch step",async()=>{await this.fetchEverything(t)});let f=t.immutable?[...new Set(this.configuration.get("immutablePatterns"))].sort():[],p=await Promise.all(f.map(async E=>PQ(E,{cwd:this.cwd})));(typeof t.persistProject>"u"||t.persistProject)&&await this.persist(),await t.report.startTimerPromise("Link step",async()=>{if(t.mode==="update-lockfile"){t.report.reportWarning(73,`Skipped due to ${Gt(this.configuration,"mode=update-lockfile",dt.CODE)}`);return}await this.linkEverything(t);let E=await Promise.all(f.map(async C=>PQ(C,{cwd:this.cwd})));for(let C=0;C<f.length;++C)p[C]!==E[C]&&t.report.reportError(64,`The checksum for ${f[C]} has been modified by this install, which is explicitly forbidden.`)}),await this.persistInstallStateFile();let h=!1;await t.report.startTimerPromise("Post-install validation",{skipIfEmpty:!0},async()=>{await this.configuration.triggerHook(E=>E.validateProjectAfterInstall,this,{reportWarning:(E,C)=>{t.report.r Line truncated
`,`# Manual changes might be lost - proceed with caution!
`].join("")}
`+Al(r)}async persistLockfile(){let t=K.join(this.cwd,Ir.lockfile),r="";try{r=await le.readFilePromise(t,"utf8")}catch{}let s=this.generateLockfile(),a=Ig(r,s);a!==r&&(await le.writeFilePromise(t,a),this.lockFileChecksum=g0e(a),this.lockfileNeedsRefresh=!1)}async persistInstallStateFile(){let t=[];for(let c of Object.values(yG))t.push(...c);let r=zg(this,t),s=EG.default.serialize(r),a=As(s);if(this.installStateChecksum===a)return;let n=this.configuration.get("installStatePath");await le.mkdirPromise(K.dirname(n),{recursive:!0}),await le.writeFilePromise(n,await Rit(s)),this.installStateChecksum=a}async restoreInstallState({restoreLinkersCustomData:t=!0,restoreResolutions:r=!0,restoreBuildState:s=!0}={}){let a=this.configuration.get("installStatePath"),n;try{let c=await Tit(await le.readFilePromise(a));n=EG.default.deserialize(c),this.installStateChecksum=As(c)}catch{r&&await this.applyLightResolution();return}t&&typeof n.linkersCustomData<"u"&&(this.linkersCustomData=n.linkersCustomData),s&&Object.assign(this,zg(n,yG.restoreBuildState)),r&&(n.lockFileChecksum===this.lockFileChecksum?Object.assign(this,zg(n,yG.restoreResolutions)):await this.applyLightResolution())}async applyLightResolution(){await this.resolveEverything({lockfileOnly:!0,report:new Qi}),await this.persistInstallStateFile()}async persist(){let t=(0,QT.default)(4);await Promise.all([this.persistLockfile(),...this.workspaces.map(r=>t(()=>r.persistManifest()))])}async cacheCleanup({cache:t,report:r}){if(this.configuration.get("enableGlobalCache"))return null;let s=new Set([".gitignore"]);if(!F8(t.cwd,this.cwd)||!await le.existsPromise(t.cwd))return null;let a=[];for(let c of await le.readdirPromise(t.cwd)){if(s.has(c))continue;let f=K.resolve(t.cwd,c);t.markedFiles.has(f)||(t.immutable?r.reportError(56,`${Gt(this.configuration,K.basename(f),"magenta")} appears to be unused and would be marked for deletion, but the cache is immutable`):a.push(le.lstatPromise(f).then(async p=>(await le.removePromise(f),p.size))))}if(a.length===0)return null;let n=await Promise.all(a);return{count:a.length,size:n.reduce((c,f)=>c+f,0)}}}});function Lit(e){let s=Math.floor(e.timeNow/864e5),a=e.updateInterval*864e5,n=e.state.lastUpdate??e.timeNow+a+Math.floor(a*e.randomInitialInterval),c=n+a,f=e.state.lastTips??s*864e5,p=f+864e5+8*36e5-e.timeZone,h=c<=e.timeNow,E=p<=e.timeNow,C=null;return(h||E||!e.state.lastUpdate||!e.state.lastTips)&&(C={},C.lastUpdate=h?e.timeNow:n,C.lastTips=f,C.blocks=h?{}:e.state.blocks,C.displayedTips=e.state.displayedTips),{nextState:C,triggerUpdate:h,triggerTips:E,nextTips:E?s*864e5:f}}var YI,E0e=Xe(()=>{bt();hv();w0();dR();Qc();Lp();YI=class{constructor(t,r){this.values=new Map;this.hits=new Map;this.enumerators=new Map;this.nextTips=0;this.displayedTips=[];this.shouldCommitTips=!1;this.configuration=t;let s=this.getRegistryPath();this.isNew=!le.existsSync(s),this.shouldShowTips=!1,this.sendReport(r),this.startBuffer()}commitTips(){this.shouldShowTips&&(this.shouldCommitTips=!0)}selectTip(t){let r=new Set(this.displayedTips),s=f=>f&&An?rA(An,f):!1,a=t.map((f,p)=>p).filter(f=>t[f]&&s(t[f]?.selector));if(a.length===0)return null;let n=a.filter(f=>!r.has(f));if(n.length===0){let f=Math.floor(a.length*.2);this.displayedTips=f>0?this.displayedTips.slice(-f):[],n=a.filter(p=>!r.has(p))}let c=n[Math.floor(Math.random()*n.length)];return this.displayedTips.push(c),this.commitTips(),t[c]}reportVersion(t){this.reportValue("version",t.replace(/-git\..*/,"-git"))}reportCommandName(t){this.reportValue("commandName",t||"<none>")}reportPluginName(t){this.reportValue("pluginName",t)}reportProject(t){this.reportEnumerator("projectCount",t)}reportInstall(t){this.reportHit("installCount",t)}reportPackageExtension(t){this.reportValue("packageExtension",t)}reportWorkspaceCount(t){this.reportValue("workspaceCount",String(t))}reportDependencyCount(t){this.reportValue("dependencyCount",String(t))}reportValue(t,r){Qp(this.values,t).add(r)}reportEnumerator(t,r){Qp(this.enumerators,t).add(As(r))}reportHit(t,r="*"){let s=R4(this.hits,t),a=$l(s,r,()=>0);s.set(r,a+1)}getRegistryPath(){let t=this.configuration.get("globalFolder");return K.join(t,"telemetry.json")}sendReport(t){let r=this.getRegistryPath(),s;try{s=le.readJsonSync(r)}catch{s={}}let{nextState:a,triggerUpdate:n,triggerTips:c,nextTips:f}=Lit({state:s,timeNow:Date.now(),timeZone:new Date().getTimezoneOffset()*60*1e3,randomInitialInterval:Math.random(),updateInterval:this.configuration.get("telemetryInterval")});if(this.nextTips=f,this.displayedTips=s.displayedTips??[],a!==null)try{le.mkdirSync(K.dirname(r),{recursive:!0}),le.writeJsonSync(r,a)}catch{return!1}if(c&&this.configuration.get("enableTips")&&(this.shouldShowTips=!0),n){let p=s.blocks??{};if(Object.keys(p).length===0){let h=`https://browser-http-intake.logs.datadoghq.eu/v1/input/${t}?ddsource=yarn`,E=C=>$H(h,C,{configuration:this.configuration}).catch(()=>{});for(let[C,S]of Object.entries(s.blocks??{})){if(Object.keys(S).length===0)continue;let x=S;x Line truncated
`),h=c.length;for(h>0&&c.includes("unstyle")&&(c=[...new Set(["unstyle",...c])].reverse());h-- >0;)f=r(e.styles[c[h]],f,p);return f},a=(n,c,f)=>{e.styles[n]=t({name:n,codes:c}),(e.keys[f]||(e.keys[f]=[])).push(n),Reflect.defineProperty(e,n,{configurable:!0,enumerable:!0,set(h){e.alias(n,h)},get(){let h=E=>s(E,h.stack);return Reflect.setPrototypeOf(h,e),h.stack=this.stack?this.stack.concat(n):[n],h}})};return a("reset",[0,0],"modifier"),a("bold",[1,22],"modifier"),a("dim",[2,22],"modifier"),a("italic",[3,23],"modifier"),a("underline",[4,24],"modifier"),a("inverse",[7,27],"modifier"),a("hidden",[8,28],"modifier"),a("strikethrough",[9,29],"modifier"),a("black",[30,39],"color"),a("red",[31,39],"color"),a("green",[32,39],"color"),a("yellow",[33,39],"color"),a("blue",[34,39],"color"),a("magenta",[35,39],"color"),a("cyan",[36,39],"color"),a("white",[37,39],"color"),a("gray",[90,39],"color"),a("grey",[90,39],"color"),a("bgBlack",[40,49],"bg"),a("bgRed",[41,49],"bg"),a("bgGreen",[42,49],"bg"),a("bgYellow",[43,49],"bg"),a("bgBlue",[44,49],"bg"),a("bgMagenta",[45,49],"bg"),a("bgCyan",[46,49],"bg"),a("bgWhite",[47,49],"bg"),a("blackBright",[90,39],"bright"),a("redBright",[91,39],"bright"),a("greenBright",[92,39],"bright"),a("yellowBright",[93,39],"bright"),a("blueBright",[94,39],"bright"),a("magentaBright",[95,39],"bright"),a("cyanBright",[96,39],"bright"),a("whiteBright",[97,39],"bright"),a("bgBlackBright",[100,49],"bgBright"),a("bgRedBright",[101,49],"bgBright"),a("bgGreenBright",[102,49],"bgBright"),a("bgYellowBright",[103,49],"bgBright"),a("bgBlueBright",[104,49],"bgBright"),a("bgMagentaBright",[105,49],"bgBright"),a("bgCyanBright",[106,49],"bgBright"),a("bgWhiteBright",[107,49],"bgBright"),e.ansiRegex=jit,e.hasColor=e.hasAnsi=n=>(e.ansiRegex.lastIndex=0,typeof n=="string"&&n!==""&&e.ansiRegex.test(n)),e.alias=(n,c)=>{let f=typeof c=="string"?e[c]:c;if(typeof f!="function")throw new TypeError("Expected alias to be the name of an existing color (string) or a function");f.stack||(Reflect.defineProperty(f,"name",{value:n}),e.styles[n]=f,f.stack=[n]),Reflect.defineProperty(e,n,{configurable:!0,enumerable:!0,set(p){e.alias(n,p)},get(){let p=h=>s(h,p.stack);return Reflect.setPrototypeOf(p,e),p.stack=this.stack?this.stack.concat(f.stack):f.stack,p}})},e.theme=n=>{if(!Hit(n))throw new TypeError("Expected theme to be an object");for(let c of Object.keys(n))e.alias(c,n[c]);return e},e.alias("unstyle",n=>typeof n=="string"&&n!==""?(e.ansiRegex.lastIndex=0,n.replace(e.ansiRegex,"")):""),e.alias("noop",n=>n),e.none=e.clear=e.noop,e.stripColor=e.unstyle,e.symbols=S0e(),e.define=a,e};BG.exports=b0e();BG.exports.create=b0e});var ia=G(hn=>{"use strict";var Git=Object.prototype.toString,jc=Xu(),D0e=!1,vG=[],P0e={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};hn.longest=(e,t)=>e.reduce((r,s)=>Math.max(r,t?s[t].length:s.length),0);hn.hasColor=e=>!!e&&jc.hasColor(e);var NT=hn.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);hn.nativeType=e=>Git.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"");hn.isAsyncFn=e=>hn.nativeType(e)==="asyncfunction";hn.isPrimitive=e=>e!=null&&typeof e!="object"&&typeof e!="function";hn.resolve=(e,t,...r)=>typeof t=="function"?t.call(e,...r):t;hn.scrollDown=(e=[])=>[...e.slice(1),e[0]];hn.scrollUp=(e=[])=>[e.pop(),...e];hn.reorder=(e=[])=>{let t=e.slice();return t.sort((r,s)=>r.index>s.index?1:r.index<s.index?-1:0),t};hn.swap=(e,t,r)=>{let s=e.length,a=r===s?0:r<0?s-1:r,n=e[t];e[t]=e[a],e[a]=n};hn.width=(e,t=80)=>{let r=e&&e.columns?e.columns:t;return e&&typeof e.getWindowSize=="function"&&(r=e.getWindowSize()[0]),process.platform==="win32"?r-1:r};hn.height=(e,t=20)=>{let r=e&&e.rows?e.rows:t;return e&&typeof e.getWindowSize=="function"&&(r=e.getWindowSize()[1]),r};hn.wordWrap=(e,t={})=>{if(!e)return e;typeof t=="number"&&(t={width:t});let{indent:r="",newline:s=`
`+r,width:a=80}=t,n=(s+r).match(/[^\S\n]/g)||[];a-=n.length;let c=`.{1,${a}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,f=e.trim(),p=new RegExp(c,"g"),h=f.match(p)||[];return h=h.map(E=>E.replace(/\n$/,"")),t.padEnd&&(h=h.map(E=>E.padEnd(a," "))),t.padStart&&(h=h.map(E=>E.padStart(a," "))),r+h.join(s)};hn.unmute=e=>{let t=e.stack.find(s=>jc.keys.color.includes(s));return t?jc[t]:e.stack.find(s=>s.slice(2)==="bg")?jc[t.slice(2)]:s=>s};hn.pascal=e=>e?e[0].toUpperCase()+e.slice(1):"";hn.inverse=e=>{if(!e||!e.stack)return e;let t=e.stack.find(s=>jc.keys.color.includes(s));if(t){let s=jc["bg"+hn.pascal(t)];return s?s.black:e}let r=e.stack.find(s=>s.slice(0,2)==="bg");return r?jc[r.slice(2).toLowerCase()]||e:jc.none};hn.complement=e=>{if(!e||!e.stack)return e;let t=e.stack.find(s=>jc.keys.color.includes(s)),r=e.stack.find(s=>s.slice(0,2)==="bg");if(t&&!r)return jc[P0e[t]||t];if(r){let s=r.slice(2).toLowerCase(),a=P0e[s];return a&&jc["bg"+hn.pascal(a)]||e}return jc.none};hn.meridiem=e=>{let t=e.getHours(),r=e.getMinutes(),s=t>=12?"pm":"am";t=t%12;let a=t===0?12:t,n=r<10?"0"+r:r;return a+":"+n+" "+s};hn.set=(e={},t="",r)=>t.split(".").reduce((s,a,n,c)=>{let f=c.length-1>n?s[a]||{}:r;return!hn.isObject(f)&&n<c.length-1&&(f={}),s[a]=f},e);hn.get=(e={},t="",r)=>{let s=e[t]==null?t.split(".").reduce((a,n)=>a&&a[n],e):e[t];return s??r};hn.mixin=(e,t)=>{if(!NT(e))return t;if(!NT(t))return e;for(let r of Object.keys(t)){let s=Object.getOwnPropertyDescriptor(t,r);if(s.hasOwnProperty("value"))if(e.hasOwnProperty(r)&&NT(s.value)){let a=Object.getOwnPropertyDescriptor(e,r);NT(a.value)?e[r]=hn.merge({},e[r],t[r]):Reflect.defineProperty(e,r,s)}else Reflect.defineProperty(e,r,s);else Reflect.defineProperty(e,r,s)}return e};hn.merge=(...e)=>{let t={};for(let r of e)hn.mixin(t,r);return t};hn.mixinEmitter=(e,t)=>{let r=t.constructor.prototype;for(let s of Object.keys(r)){let a=r[s];typeof a=="function"?hn.define(e,s,a.bind(t)):hn.define(e,s,a)}};hn.onExit=e=>{let t=(r,s)=>{D0e||(D0e=!0,vG.forEach(a=>a()),r===!0&&process.exit(128+s))};vG.length===0&&(process.once("SIGTERM",t.bind(null,!0,15)),process.once("SIGINT",t.bind(null,!0,2)),process.once("exit",t)),vG.push(e)};hn.define=(e,t,r)=>{Reflect.defineProperty(e,t,{value:r})};hn.defineExport=(e,t,r)=>{let s;Reflect.defineProperty(e,t,{enumerable:!0,configurable:!0,set(a){s=a},get(){return s?s():r()}})}});var x0e=G(JI=>{"use strict";JI.ctrl={a:"first",b:"backward",c:"cancel",d:"deleteForward",e:"last",f:"forward",g:"reset",i:"tab",k:"cutForward",l:"reset",n:"newItem",m:"cancel",j:"submit",p:"search",r:"remove",s:"save",u:"undo",w:"cutLeft",x:"toggleCursor",v:"paste"};JI.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"};JI.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"};JI.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"};JI.keys={pageup:"pageUp",pagedown:"pageDown",home:"home",end:"end",cancel:"cancel",delete:"deleteForward",backspace:"delete",down:"down",enter:"submit",escape:"cancel",left:"left",space:"space",number:"number",return:"submit",right:"right",tab:"next",up:"up"}});var R0e=G((u3t,Q0e)=>{"use strict";var k0e=Ie("readline"),qit=x0e(),Yit=/^(?:\x1b)([a-zA-Z0-9])$/,Wit=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,Vit={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"};function Kit(e){return["[a","[b","[c","[d","[e","[2$","[3$","[5$","[6$","[7$","[8$","[Z"].includes(e)}function Jit(e){return["Oa","Ob","Oc","Od","Oe","[2^","[3^","[5^","[6^","[7^","[8^"].includes(e)}var OT=(e="",t={})=>{let r,s={name:t.name,ctrl:!1,meta:!1,shift:!1,option:!1,sequence:e,raw:e,...t};if(Buffer.isBuffer(e)?e[0]>127&&e[1]===void 0?(e[0]-=128,e="\x1B"+String(e)):e=String(e):e!==void 0&&typeof e!="string"?e=String(e):e||(e=s.sequence||""),s.sequence=s.sequence||e||s.name,e==="\r")s.raw=void 0,s.name="return";else if(e===`
`)s.name="enter";else if(e===" ")s.name="tab";else if(e==="\b"||e==="\x7F"||e==="\x1B\x7F"||e==="\x1B\b")s.name="backspace",s.meta=e.charAt(0)==="\x1B";else if(e==="\x1B"||e==="\x1B\x1B")s.name="escape",s.meta=e.length===2;else if(e===" "||e==="\x1B ")s.name="space",s.meta=e.length===2;else if(e<="")s.name=String.fromCharCode(e.charCodeAt(0)+97-1),s.ctrl=!0;else if(e.length===1&&e>="0"&&e<="9")s.name="number";else if(e.length===1&&e>="a"&&e<="z")s.name=e;else if(e.length===1&&e>="A"&&e<="Z")s.name=e.toLowerCase(),s.shift=!0;else if(r=Yit.exec(e))s.meta=!0,s.shift=/^[A-Z]$/.test(r[1]);else if(r=Wit.exec(e)){let a=[...e];a[0]==="\x1B"&&a[1]==="\x1B"&&(s.option=!0);let n=[r[1],r[2],r[4],r[6]].filter(Boolean).join(""),c=(r[3]||r[5]||1)-1;s.ctrl=!!(c&4),s.meta=!!(c&10),s.shift=!!(c&1),s.code=n,s.name=Vit[n],s.shift=Kit(n)||s.shift,s.ctrl=Jit(n)||s.ctrl}return s};OT.listen=(e={},t)=>{let{stdin:r}=e;if(!r||r!==process.stdin&&!r.isTTY)throw new Error("Invalid stream passed");let s=k0e.createInterface({terminal:!0,input:r});k0e.emitKeypressEvents(r,s);let a=(f,p)=>t(f,OT(f,p),s),n=r.isRaw;return r.isTTY&&r.setRawMode(!0),r.on("keypress",a),s.resume(),()=>{r.isTTY&&r.setRawMode(n),r.removeListener("keypress",a),s.pause(),s.close()}};OT.action=(e,t,r)=>{let s={...qit,...r};return t.ctrl?(t.action=s.ctrl[t.name],t):t.option&&s.option?(t.action=s.option[t.name],t):t.shift?(t.action=s.shift[t.name],t):(t.action=s.keys[t.name],t)};Q0e.exports=OT});var F0e=G((f3t,T0e)=>{"use strict";T0e.exports=e=>{e.timers=e.timers||{};let t=e.options.timers;if(t)for(let r of Object.keys(t)){let s=t[r];typeof s=="number"&&(s={interval:s}),zit(e,r,s)}};function zit(e,t,r={}){let s=e.timers[t]={name:t,start:Date.now(),ms:0,tick:0},a=r.interval||120;s.frames=r.frames||[],s.loading=!0;let n=setInterval(()=>{s.ms=Date.now()-s.start,s.tick++,e.render()},a);return s.stop=()=>{s.loading=!1,clearInterval(n)},Reflect.defineProperty(s,"interval",{value:n}),e.once("close",()=>s.stop()),s.stop}});var O0e=G((A3t,N0e)=>{"use strict";var{define:Xit,width:Zit}=ia(),SG=class{constructor(t){let r=t.options;Xit(this,"_prompt",t),this.type=t.type,this.name=t.name,this.message="",this.header="",this.footer="",this.error="",this.hint="",this.input="",this.cursor=0,this.index=0,this.lines=0,this.tick=0,this.prompt="",this.buffer="",this.width=Zit(r.stdout||process.stdout),Object.assign(this,r),this.name=this.name||this.message,this.message=this.message||this.name,this.symbols=t.symbols,this.styles=t.styles,this.required=new Set,this.cancelled=!1,this.submitted=!1}clone(){let t={...this};return t.status=this.status,t.buffer=Buffer.from(t.buffer),delete t.clone,t}set color(t){this._color=t}get color(){let t=this.prompt.styles;if(this.cancelled)return t.cancelled;if(this.submitted)return t.submitted;let r=this._color||t[this.status];return typeof r=="function"?r:t.pending}set loading(t){this._loading=t}get loading(){return typeof this._loading=="boolean"?this._loading:this.loadingChoices?"choices":!1}get status(){return this.cancelled?"cancelled":this.submitted?"submitted":"pending"}};N0e.exports=SG});var M0e=G((p3t,L0e)=>{"use strict";var bG=ia(),wo=Xu(),DG={default:wo.noop,noop:wo.noop,set inverse(e){this._inverse=e},get inverse(){return this._inverse||bG.inverse(this.primary)},set complement(e){this._complement=e},get complement(){return this._complement||bG.complement(this.primary)},primary:wo.cyan,success:wo.green,danger:wo.magenta,strong:wo.bold,warning:wo.yellow,muted:wo.dim,disabled:wo.gray,dark:wo.dim.gray,underline:wo.underline,set info(e){this._info=e},get info(){return this._info||this.primary},set em(e){this._em=e},get em(){return this._em||this.primary.underline},set heading(e){this._heading=e},get heading(){return this._heading||this.muted.underline},set pending(e){this._pending=e},get pending(){return this._pending||this.primary},set submitted(e){this._submitted=e},get submitted(){return this._submitted||this.success},set cancelled(e){this._cancelled=e},get cancelled(){return this._cancelled||this.danger},set typing(e){this._typing=e},get typing(){return this._typing||this.dim},set placeholder(e){this._placeholder=e},get placeholder(){return this._placeholder||this.primary.dim},set highlight(e){this._highlight=e},get highlight(){return this._highlight||this.inverse}};DG.merge=(e={})=>{e.styles&&typeof e.styles.enabled=="boolean"&&(wo.enabled=e.styles.enabled),e.styles&&typeof e.styles.visible=="boolean"&&(wo.visible=e.styles.visible);let t=bG.merge({},DG,e.styles);delete t.merge;for(let r of Object.keys(wo))t.hasOwnProperty(r)||Reflect.defineProperty(t,r,{get:()=>wo[r]});for(let r of Object.keys(wo.styles))t.hasOwnProperty(r)||Reflect.defineProperty(t,r,{get:()=>wo[r]});return t};L0e.exports=DG});var _0e=G((h3t,U0e)=>{"use strict";var PG=process.platform==="win32",Xp=Xu(),$it=ia(),xG={...Xp.symbols,upDownDoubleArrow:"\u21D5",upDownDoubleArrow2:"\u2B0D",upDownArrow:"\u2195",asterisk:"*",asterism:"\u2042",bulletWhite:"\u25E6",electricArrow:"\u2301", Line truncated
`),h=p[0],E=p[p.length-1],S=(s+(r?" "+r:"")).length,x=S<h.length?h.slice(S+1):"";return{header:c,prompt:h,after:x,rest:p.slice(1),last:E}}async submit(){this.state.submitted=!0,this.state.validating=!0,this.options.onSubmit&&await this.options.onSubmit.call(this,this.name,this.value,this);let t=this.state.error||await this.validate(this.value,this.state);if(t!==!0){let r=`
`+this.symbols.pointer+" ";typeof t=="string"?r+=t.trim():r+="Invalid input",this.state.error=`
`+this.styles.danger(r),this.state.submitted=!1,await this.render(),await this.alert(),this.state.validating=!1,this.state.error=void 0;return}this.state.validating=!1,await this.render(),await this.close(),this.value=await this.result(this.value),this.emit("submit",this.value)}async cancel(t){this.state.cancelled=this.state.submitted=!0,await this.render(),await this.close(),typeof this.options.onCancel=="function"&&await this.options.onCancel.call(this,this.name,this.value,this),this.emit("cancel",await this.error(t))}async close(){this.state.closed=!0;try{let t=this.sections(),r=Math.ceil(t.prompt.length/this.width);t.rest&&this.write(xm.cursor.down(t.rest.length)),this.write(`
`.repeat(r))}catch{}this.emit("close")}start(){!this.stop&&this.options.show!==!1&&(this.stop=TG.listen(this,this.keypress.bind(this)),this.once("close",this.stop))}async skip(){return this.skipped=this.options.skip===!0,typeof this.options.skip=="function"&&(this.skipped=await this.options.skip.call(this,this.name,this.value)),this.skipped}async initialize(){let{format:t,options:r,result:s}=this;if(this.format=()=>t.call(this,this.value),this.result=()=>s.call(this,this.value),typeof r.initial=="function"&&(this.initial=await r.initial.call(this,this)),typeof r.onRun=="function"&&await r.onRun.call(this,this),typeof r.onSubmit=="function"){let a=r.onSubmit.bind(this),n=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>(await a(this.name,this.value,this),n())}await this.start(),await this.render()}render(){throw new Error("expected prompt to have a custom render method")}run(){return new Promise(async(t,r)=>{if(this.once("submit",t),this.once("cancel",r),await this.skip())return this.render=()=>{},this.submit();await this.initialize(),this.emit("run")})}async element(t,r,s){let{options:a,state:n,symbols:c,timers:f}=this,p=f&&f[t];n.timer=p;let h=a[t]||n[t]||c[t],E=r&&r[t]!=null?r[t]:await h;if(E==="")return E;let C=await this.resolve(E,n,r,s);return!C&&r&&r[t]?this.resolve(h,n,r,s):C}async prefix(){let t=await this.element("prefix")||this.symbols,r=this.timers&&this.timers.prefix,s=this.state;return s.timer=r,Cl.isObject(t)&&(t=t[s.status]||t.pending),Cl.hasColor(t)?t:(this.styles[s.status]||this.styles.pending)(t)}async message(){let t=await this.element("message");return Cl.hasColor(t)?t:this.styles.strong(t)}async separator(){let t=await this.element("separator")||this.symbols,r=this.timers&&this.timers.separator,s=this.state;s.timer=r;let a=t[s.status]||t.pending||s.separator,n=await this.resolve(a,s);return Cl.isObject(n)&&(n=n[s.status]||n.pending),Cl.hasColor(n)?n:this.styles.muted(n)}async pointer(t,r){let s=await this.element("pointer",t,r);if(typeof s=="string"&&Cl.hasColor(s))return s;if(s){let a=this.styles,n=this.index===r,c=n?a.primary:h=>h,f=await this.resolve(s[n?"on":"off"]||s,this.state),p=Cl.hasColor(f)?f:c(f);return n?p:" ".repeat(f.length)}}async indicator(t,r){let s=await this.element("indicator",t,r);if(typeof s=="string"&&Cl.hasColor(s))return s;if(s){let a=this.styles,n=t.enabled===!0,c=n?a.success:a.dark,f=s[n?"on":"off"]||s;return Cl.hasColor(f)?f:c(f)}return""}body(){return null}footer(){if(this.state.status==="pending")return this.element("footer")}header(){if(this.state.status==="pending")return this.element("header")}async hint(){if(this.state.status==="pending"&&!this.isValue(this.state.input)){let t=await this.element("hint");return Cl.hasColor(t)?t:this.styles.muted(t)}}error(t){return this.state.submitted?"":t||this.state.error}format(t){return t}result(t){return t}validate(t){return this.options.required===!0?this.isValue(t):!0}isValue(t){return t!=null&&t!==""}resolve(t,...r){return Cl.resolve(this,t,...r)}get base(){return e.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||Cl.height(this.stdout,25)}get width(){return this.options.columns||Cl.width(this.stdout,80)}get size(){return{width:this.width,height:this.height}}set cursor(t){this.state.cursor=t}get cursor(){return this.state.cursor}set input(t){this.state.input=t}get input(){return this.state.input}set value(t){this.state.value=t}get value(){let{input:t,value:r}=this.state,s=[r,t].find(this.isValue.bind(this));return this.isValue(s)?s:this.initial}static get prompt(){return t=>new this(t).run()}};function lst(e){let t=a=>e[a]===void 0||typeof e[a]=="function",r=["actions","choices","initial","margin","roles","styles","symbols","theme","timers","value"],s=["body","footer","error","header","hint","indicator","message","prefix","separator","skip"];for(let a of Object.keys(e.options)){if(r.includes(a)||/^on[A-Z]/.test(a))continue;let n=e.options[a];typeof n=="function"&&t(a)?s.includes(a)||(e[a]=n.bind(e)):typeof e[a]!="function"&&(e[a]=n)}}function cst(e){typeof e=="number"&&(e=[e,e,e,e]);let t=[].concat(e||[]),r=a=>a%2===0?`
`:" ",s=[];for(let a=0;a<4;a++){let n=r(a);t[a]?s.push(n.repeat(t[a])):s.push("")}return s}J0e.exports=FG});var Z0e=G((m3t,X0e)=>{"use strict";var ust=ia(),z0e={default(e,t){return t},checkbox(e,t){throw new Error("checkbox role is not implemented yet")},editable(e,t){throw new Error("editable role is not implemented yet")},expandable(e,t){throw new Error("expandable role is not implemented yet")},heading(e,t){return t.disabled="",t.indicator=[t.indicator," "].find(r=>r!=null),t.message=t.message||"",t},input(e,t){throw new Error("input role is not implemented yet")},option(e,t){return z0e.default(e,t)},radio(e,t){throw new Error("radio role is not implemented yet")},separator(e,t){return t.disabled="",t.indicator=[t.indicator," "].find(r=>r!=null),t.message=t.message||e.symbols.line.repeat(5),t},spacer(e,t){return t}};X0e.exports=(e,t={})=>{let r=ust.merge({},z0e,t.roles);return r[e]||r.default}});var Jv=G((y3t,tde)=>{"use strict";var fst=Xu(),Ast=zI(),pst=Z0e(),LT=ia(),{reorder:NG,scrollUp:hst,scrollDown:dst,isObject:$0e,swap:gst}=LT,OG=class extends Ast{constructor(t){super(t),this.cursorHide(),this.maxSelected=t.maxSelected||1/0,this.multiple=t.multiple||!1,this.initial=t.initial||0,this.delay=t.delay||0,this.longest=0,this.num=""}async initialize(){typeof this.options.initial=="function"&&(this.initial=await this.options.initial.call(this)),await this.reset(!0),await super.initialize()}async reset(){let{choices:t,initial:r,autofocus:s,suggest:a}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(t)),this.choices.forEach(n=>n.enabled=!1),typeof a!="function"&&this.selectable.length===0)throw new Error("At least one choice must be selectable");$0e(r)&&(r=Object.keys(r)),Array.isArray(r)?(s!=null&&(this.index=this.findIndex(s)),r.forEach(n=>this.enable(this.find(n))),await this.render()):(s!=null&&(r=s),typeof r=="string"&&(r=this.findIndex(r)),typeof r=="number"&&r>-1&&(this.index=Math.max(0,Math.min(r,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(t,r){this.state.loadingChoices=!0;let s=[],a=0,n=async(c,f)=>{typeof c=="function"&&(c=await c.call(this)),c instanceof Promise&&(c=await c);for(let p=0;p<c.length;p++){let h=c[p]=await this.toChoice(c[p],a++,f);s.push(h),h.choices&&await n(h.choices,h)}return s};return n(t,r).then(c=>(this.state.loadingChoices=!1,c))}async toChoice(t,r,s){if(typeof t=="function"&&(t=await t.call(this,this)),t instanceof Promise&&(t=await t),typeof t=="string"&&(t={name:t}),t.normalized)return t;t.normalized=!0;let a=t.value;if(t=pst(t.role,this.options)(this,t),typeof t.disabled=="string"&&!t.hint&&(t.hint=t.disabled,t.disabled=!0),t.disabled===!0&&t.hint==null&&(t.hint="(disabled)"),t.index!=null)return t;t.name=t.name||t.key||t.title||t.value||t.message,t.message=t.message||t.name||"",t.value=[t.value,t.name].find(this.isValue.bind(this)),t.input="",t.index=r,t.cursor=0,LT.define(t,"parent",s),t.level=s?s.level+1:1,t.indent==null&&(t.indent=s?s.indent+" ":t.indent||""),t.path=s?s.path+"."+t.name:t.name,t.enabled=!!(this.multiple&&!this.isDisabled(t)&&(t.enabled||this.isSelected(t))),this.isDisabled(t)||(this.longest=Math.max(this.longest,fst.unstyle(t.message).length));let c={...t};return t.reset=(f=c.input,p=c.value)=>{for(let h of Object.keys(c))t[h]=c[h];t.input=f,t.value=p},a==null&&typeof t.initial=="function"&&(t.input=await t.initial.call(this,this.state,t,r)),t}async onChoice(t,r){this.emit("choice",t,r,this),typeof t.onChoice=="function"&&await t.onChoice.call(this,this.state,t,r)}async addChoice(t,r,s){let a=await this.toChoice(t,r,s);return this.choices.push(a),this.index=this.choices.length-1,this.limit=this.choices.length,a}async newItem(t,r,s){let a={name:"New choice name?",editable:!0,newChoice:!0,...t},n=await this.addChoice(a,r,s);return n.updateChoice=()=>{delete n.newChoice,n.name=n.message=n.input,n.input="",n.cursor=0},this.render()}indent(t){return t.indent==null?t.level>1?" ".repeat(t.level-1):"":t.indent}dispatch(t,r){if(this.multiple&&this[r.name])return this[r.name]();this.alert()}focus(t,r){return typeof r!="boolean"&&(r=t.enabled),r&&!t.enabled&&this.selected.length>=this.maxSelected?this.alert():(this.index=t.index,t.enabled=r&&!this.isDisabled(t),t)}space(){return this.multiple?(this.toggle(this.focused),this.render()):this.alert()}a(){if(this.maxSelected<this.choices.length)return this.alert();let t=this.selectable.every(r=>r.enabled);return this.choices.forEach(r=>r.enabled=!t),this.render()}i(){return this.choices.length-this.selected.length>this.maxSelected?this.alert():(this.choices.forEach(t=>t.enabled=!t.enabled),this.render())}g(t=this.focused){return this.choices.some(r=>!!r.parent)?(this.toggle(t.parent&&!t.choices?t.parent:t),this.render()):this.a()}toggle(t,r){if(!t.enabled&&this.selected.length>=this.maxSelected)return this.alert();typeof r!="boolean"&&(r=!t.enabled),t.enabled=r,t.choices&&t. Line truncated
`),a;return this.options.choicesHeader&&(a=await this.resolve(this.options.choicesHeader,this.state)),[a,s].filter(Boolean).join(`
`)}format(){return!this.state.submitted||this.state.cancelled?"":Array.isArray(this.selected)?this.selected.map(t=>this.styles.primary(t.name)).join(", "):this.styles.primary(this.selected.name)}async render(){let{submitted:t,size:r}=this.state,s="",a=await this.header(),n=await this.prefix(),c=await this.separator(),f=await this.message();this.options.promptLine!==!1&&(s=[n,f,c,""].join(" "),this.state.prompt=s);let p=await this.format(),h=await this.error()||await this.hint(),E=await this.renderChoices(),C=await this.footer();p&&(s+=p),h&&!s.includes(h)&&(s+=" "+h),t&&!p&&!E.trim()&&this.multiple&&this.emptyError!=null&&(s+=this.styles.danger(this.emptyError)),this.clear(r),this.write([a,s,E,C].filter(Boolean).join(`
`)),this.write(this.margin[2]),this.restore()}};rde.exports=MG});var ide=G((I3t,nde)=>{"use strict";var yst=Y0(),Est=(e,t)=>{let r=e.toLowerCase();return s=>{let n=s.toLowerCase().indexOf(r),c=t(s.slice(n,n+r.length));return n>=0?s.slice(0,n)+c+s.slice(n+r.length):s}},UG=class extends yst{constructor(t){super(t),this.cursorShow()}moveCursor(t){this.state.cursor+=t}dispatch(t){return this.append(t)}space(t){return this.options.multiple?super.space(t):this.append(t)}append(t){let{cursor:r,input:s}=this.state;return this.input=s.slice(0,r)+t+s.slice(r),this.moveCursor(1),this.complete()}delete(){let{cursor:t,input:r}=this.state;return r?(this.input=r.slice(0,t-1)+r.slice(t),this.moveCursor(-1),this.complete()):this.alert()}deleteForward(){let{cursor:t,input:r}=this.state;return r[t]===void 0?this.alert():(this.input=`${r}`.slice(0,t)+`${r}`.slice(t+1),this.complete())}number(t){return this.append(t)}async complete(){this.completing=!0,this.choices=await this.suggest(this.input,this.state._choices),this.state.limit=void 0,this.index=Math.min(Math.max(this.visible.length-1,0),this.index),await this.render(),this.completing=!1}suggest(t=this.input,r=this.state._choices){if(typeof this.options.suggest=="function")return this.options.suggest.call(this,t,r);let s=t.toLowerCase();return r.filter(a=>a.message.toLowerCase().includes(s))}pointer(){return""}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted)return this.selected.map(t=>this.styles.primary(t.message)).join(", ");if(this.state.submitted){let t=this.value=this.input=this.focused.value;return this.styles.primary(t)}return this.input}async render(){if(this.state.status!=="pending")return super.render();let t=this.options.highlight?this.options.highlight.bind(this):this.styles.placeholder,r=Est(this.input,t),s=this.choices;this.choices=s.map(a=>({...a,message:r(a.message)})),await super.render(),this.choices=s}submit(){return this.options.multiple&&(this.value=this.selected.map(t=>t.name)),super.submit()}};nde.exports=UG});var HG=G((C3t,sde)=>{"use strict";var _G=ia();sde.exports=(e,t={})=>{e.cursorHide();let{input:r="",initial:s="",pos:a,showCursor:n=!0,color:c}=t,f=c||e.styles.placeholder,p=_G.inverse(e.styles.primary),h=T=>p(e.styles.black(T)),E=r,C=" ",S=h(C);if(e.blink&&e.blink.off===!0&&(h=T=>T,S=""),n&&a===0&&s===""&&r==="")return h(C);if(n&&a===0&&(r===s||r===""))return h(s[0])+f(s.slice(1));s=_G.isPrimitive(s)?`${s}`:"",r=_G.isPrimitive(r)?`${r}`:"";let x=s&&s.startsWith(r)&&s!==r,I=x?h(s[r.length]):S;if(a!==r.length&&n===!0&&(E=r.slice(0,a)+h(r[a])+r.slice(a+1),I=""),n===!1&&(I=""),x){let T=e.styles.unstyle(E+I);return E+I+f(s.slice(T.length))}return E+I}});var MT=G((w3t,ode)=>{"use strict";var Ist=Xu(),Cst=Y0(),wst=HG(),jG=class extends Cst{constructor(t){super({...t,multiple:!0}),this.type="form",this.initial=this.options.initial,this.align=[this.options.align,"right"].find(r=>r!=null),this.emptyError="",this.values={}}async reset(t){return await super.reset(),t===!0&&(this._index=this.index),this.index=this._index,this.values={},this.choices.forEach(r=>r.reset&&r.reset()),this.render()}dispatch(t){return!!t&&this.append(t)}append(t){let r=this.focused;if(!r)return this.alert();let{cursor:s,input:a}=r;return r.value=r.input=a.slice(0,s)+t+a.slice(s),r.cursor++,this.render()}delete(){let t=this.focused;if(!t||t.cursor<=0)return this.alert();let{cursor:r,input:s}=t;return t.value=t.input=s.slice(0,r-1)+s.slice(r),t.cursor--,this.render()}deleteForward(){let t=this.focused;if(!t)return this.alert();let{cursor:r,input:s}=t;if(s[r]===void 0)return this.alert();let a=`${s}`.slice(0,r)+`${s}`.slice(r+1);return t.value=t.input=a,this.render()}right(){let t=this.focused;return t?t.cursor>=t.input.length?this.alert():(t.cursor++,this.render()):this.alert()}left(){let t=this.focused;return t?t.cursor<=0?this.alert():(t.cursor--,this.render()):this.alert()}space(t,r){return this.dispatch(t,r)}number(t,r){return this.dispatch(t,r)}next(){let t=this.focused;if(!t)return this.alert();let{initial:r,input:s}=t;return r&&r.startsWith(s)&&s!==r?(t.value=t.input=r,t.cursor=t.value.length,this.render()):super.next()}prev(){let t=this.focused;return t?t.cursor===0?super.prev():(t.value=t.input="",t.cursor=0,this.render()):this.alert()}separator(){return""}format(t){return this.state.submitted?"":super.format(t)}pointer(){return""}indicator(t){return t.input?"\u29BF":"\u2299"}async choiceSeparator(t,r){let s=await this.resolve(t.separator,this.state,t,r)||":";return s?" "+this.styles.disabled(s):""}async renderChoice(t,r){await this.onChoice(t,r);let{state:s,styles:a}=this,{cursor:n,initial:c="",name:f,hint:p,input:h=""}=t,{muted:E,submitted:C,primary:S,danger:x}=a,I=p,T=this.index===r,O=t.validate||(()=>!0),U=await this.choiceSeparator(t,r),V=t.message;this.align==="right"&&(V=V.padStart(this.longest+1," ")),this.align==="left"&&(V=V.padEnd(this.longest+1," "));let $=this.values[f]=h||c,ie=h?"success":"dark";await O.call(t,$,this. Line truncated
`)),this.restore()}set value(t){super.value=t}get value(){return this.cast(super.value)}};Ade.exports=qG});var hde=G((b3t,pde)=>{"use strict";var kst=UT(),YG=class extends kst{constructor(t){super(t),this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}};pde.exports=YG});var gde=G((D3t,dde)=>{"use strict";var Qst=Y0(),Rst=MT(),XI=Rst.prototype,WG=class extends Qst{constructor(t){super({...t,multiple:!0}),this.align=[this.options.align,"left"].find(r=>r!=null),this.emptyError="",this.values={}}dispatch(t,r){let s=this.focused,a=s.parent||{};return!s.editable&&!a.editable&&(t==="a"||t==="i")?super[t]():XI.dispatch.call(this,t,r)}append(t,r){return XI.append.call(this,t,r)}delete(t,r){return XI.delete.call(this,t,r)}space(t){return this.focused.editable?this.append(t):super.space()}number(t){return this.focused.editable?this.append(t):super.number(t)}next(){return this.focused.editable?XI.next.call(this):super.next()}prev(){return this.focused.editable?XI.prev.call(this):super.prev()}async indicator(t,r){let s=t.indicator||"",a=t.editable?s:super.indicator(t,r);return await this.resolve(a,this.state,t,r)||""}indent(t){return t.role==="heading"?"":t.editable?" ":" "}async renderChoice(t,r){return t.indent="",t.editable?XI.renderChoice.call(this,t,r):super.renderChoice(t,r)}error(){return""}footer(){return this.state.error}async validate(){let t=!0;for(let r of this.choices){if(typeof r.validate!="function"||r.role==="heading")continue;let s=r.parent?this.value[r.parent.name]:this.value;if(r.editable?s=r.value===r.name?r.initial||"":r.value:this.isDisabled(r)||(s=r.enabled===!0),t=await r.validate(s,this.state),t!==!0)break}return t!==!0&&(this.state.error=typeof t=="string"?t:"Invalid Input"),t}submit(){if(this.focused.newChoice===!0)return super.submit();if(this.choices.some(t=>t.newChoice))return this.alert();this.value={};for(let t of this.choices){let r=t.parent?this.value[t.parent.name]:this.value;if(t.role==="heading"){this.value[t.name]={};continue}t.editable?r[t.name]=t.value===t.name?t.initial||"":t.value:this.isDisabled(t)||(r[t.name]=t.enabled===!0)}return this.base.submit.call(this)}};dde.exports=WG});var km=G((P3t,mde)=>{"use strict";var Tst=zI(),Fst=HG(),{isPrimitive:Nst}=ia(),VG=class extends Tst{constructor(t){super(t),this.initial=Nst(this.initial)?String(this.initial):"",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[]}async keypress(t,r={}){let s=this.state.prevKeypress;return this.state.prevKeypress=r,this.options.multiline===!0&&r.name==="return"&&(!s||s.name!=="return")?this.append(`
`,r):super.keypress(t,r)}moveCursor(t){this.cursor+=t}reset(){return this.input=this.value="",this.cursor=0,this.render()}dispatch(t,r){if(!t||r.ctrl||r.code)return this.alert();this.append(t)}append(t){let{cursor:r,input:s}=this.state;this.input=`${s}`.slice(0,r)+t+`${s}`.slice(r),this.moveCursor(String(t).length),this.render()}insert(t){this.append(t)}delete(){let{cursor:t,input:r}=this.state;if(t<=0)return this.alert();this.input=`${r}`.slice(0,t-1)+`${r}`.slice(t),this.moveCursor(-1),this.render()}deleteForward(){let{cursor:t,input:r}=this.state;if(r[t]===void 0)return this.alert();this.input=`${r}`.slice(0,t)+`${r}`.slice(t+1),this.render()}cutForward(){let t=this.cursor;if(this.input.length<=t)return this.alert();this.state.clipboard.push(this.input.slice(t)),this.input=this.input.slice(0,t),this.render()}cutLeft(){let t=this.cursor;if(t===0)return this.alert();let r=this.input.slice(0,t),s=this.input.slice(t),a=r.split(" ");this.state.clipboard.push(a.pop()),this.input=a.join(" "),this.cursor=this.input.length,this.input+=s,this.render()}paste(){if(!this.state.clipboard.length)return this.alert();this.insert(this.state.clipboard.pop()),this.render()}toggleCursor(){this.state.prevCursor?(this.cursor=this.state.prevCursor,this.state.prevCursor=0):(this.state.prevCursor=this.cursor,this.cursor=0),this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.input.length-1,this.render()}next(){let t=this.initial!=null?String(this.initial):"";if(!t||!t.startsWith(this.input))return this.alert();this.input=this.initial,this.cursor=this.initial.length,this.render()}prev(){if(!this.input)return this.alert();this.reset()}backward(){return this.left()}forward(){return this.right()}right(){return this.cursor>=this.input.length?this.alert():(this.moveCursor(1),this.render())}left(){return this.cursor<=0?this.alert():(this.moveCursor(-1),this.render())}isValue(t){return!!t}async format(t=this.value){let r=await this.resolve(this.initial,this.state);return this.state.submitted?this.styles.submitted(t||r):Fst(this,{input:t,initial:r,pos:this.cursor})}async render(){let t=this.state.size,r=await this.prefix(),s=await this.separator(),a=await this.message(),n=[r,a,s].filter(Boolean).join(" ");this.state.prompt=n;let c=await this.header(),f=await this.format(),p=await this.error()||await this.hint(),h=await this.footer();p&&!f.includes(p)&&(f+=" "+p),n+=" "+f,this.clear(t),this.write([c,n,h].filter(Boolean).join(`
`)),this.restore()}};mde.exports=VG});var Ede=G((x3t,yde)=>{"use strict";var Ost=e=>e.filter((t,r)=>e.lastIndexOf(t)===r),_T=e=>Ost(e).filter(Boolean);yde.exports=(e,t={},r="")=>{let{past:s=[],present:a=""}=t,n,c;switch(e){case"prev":case"undo":return n=s.slice(0,s.length-1),c=s[s.length-1]||"",{past:_T([r,...n]),present:c};case"next":case"redo":return n=s.slice(1),c=s[0]||"",{past:_T([...n,r]),present:c};case"save":return{past:_T([...s,r]),present:""};case"remove":return c=_T(s.filter(f=>f!==r)),a="",c.length&&(a=c.pop()),{past:c,present:a};default:throw new Error(`Invalid action: "${e}"`)}}});var JG=G((k3t,Cde)=>{"use strict";var Lst=km(),Ide=Ede(),KG=class extends Lst{constructor(t){super(t);let r=this.options.history;if(r&&r.store){let s=r.values||this.initial;this.autosave=!!r.autosave,this.store=r.store,this.data=this.store.get("values")||{past:[],present:s},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(t){return this.store?(this.data=Ide(t,this.data,this.input),this.data.present?(this.input=this.data.present,this.cursor=this.input.length,this.render()):this.alert()):this.alert()}altUp(){return this.completion("prev")}altDown(){return this.completion("next")}prev(){return this.save(),super.prev()}save(){this.store&&(this.data=Ide("save",this.data,this.input),this.store.set("values",this.data))}submit(){return this.store&&this.autosave===!0&&this.save(),super.submit()}};Cde.exports=KG});var Bde=G((Q3t,wde)=>{"use strict";var Mst=km(),zG=class extends Mst{format(){return""}};wde.exports=zG});var Sde=G((R3t,vde)=>{"use strict";var Ust=km(),XG=class extends Ust{constructor(t={}){super(t),this.sep=this.options.separator||/, */,this.initial=t.initial||""}split(t=this.value){return t?String(t).split(this.sep):[]}format(){let t=this.state.submitted?this.styles.primary:r=>r;return this.list.map(t).join(", ")}async submit(t){let r=this.state.error||await this.validate(this.list,this.state);return r!==!0?(this.state.error=r,super.submit()):(this.value=this.list,super.submit())}get list(){return this.split()}};vde.exports=XG});var Dde=G((T3t,bde)=>{"use strict";var _st=Y0(),ZG=class extends _st{constructor(t){super({...t,multiple:!0})}};bde.exports=ZG});var e5=G((F3t,Pde)=>{"use strict";var Hst=km(),$G=class extends Hst{constructor(t={}){super({style:"number",...t}),this.min=this.isValue(t.min)?this.toNumber(t.min):-1/0,this.max=this.isValue(t.max)?this.toNumber(t.max):1/0,this.delay=t.delay!=null?t.delay:1e3,this.float=t.float!==!1,this.round=t.round===!0||t.float===!1,this.major=t.major||10,this.minor=t.minor||1,this.initial=t.initial!=null?t.initial:"",this.input=String(this.initial),this.cursor=this.input.length,this.cursorShow()}append(t){return!/[-+.]/.test(t)||t==="."&&this.input.includes(".")?this.alert("invalid number"):super.append(t)}number(t){return super.append(t)}next(){return this.input&&this.input!==this.initial?this.alert():this.isValue(this.initial)?(this.input=this.initial,this.cursor=String(this.initial).length,this.render()):this.alert()}up(t){let r=t||this.minor,s=this.toNumber(this.input);return s>this.max+r?this.alert():(this.input=`${s+r}`,this.render())}down(t){let r=t||this.minor,s=this.toNumber(this.input);return s<this.min-r?this.alert():(this.input=`${s-r}`,this.render())}shiftDown(){return this.down(this.major)}shiftUp(){return this.up(this.major)}format(t=this.input){return typeof this.options.format=="function"?this.options.format.call(this,t):this.styles.info(t)}toNumber(t=""){return this.float?+t:Math.round(+t)}isValue(t){return/^[-+]?[0-9]+((\.)|(\.[0-9]+))?$/.test(t)}submit(){let t=[this.input,this.initial].find(r=>this.isValue(r));return this.value=this.toNumber(t||0),super.submit()}};Pde.exports=$G});var kde=G((N3t,xde)=>{xde.exports=e5()});var Rde=G((O3t,Qde)=>{"use strict";var jst=km(),t5=class extends jst{constructor(t){super(t),this.cursorShow()}format(t=this.input){return this.keypressed?(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(t.length)):""}};Qde.exports=t5});var Nde=G((L3t,Fde)=>{"use strict";var Gst=Xu(),qst=Jv(),Tde=ia(),r5=class extends qst{constructor(t={}){super(t),this.widths=[].concat(t.messageWidth||50),this.align=[].concat(t.align||"left"),this.linebreak=t.linebreak||!1,this.edgeLength=t.edgeLength||3,this.newline=t.newline||`
`;let r=t.startNumber||1;typeof this.scale=="number"&&(this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map((s,a)=>({name:a+r})))}async reset(){return this.tableized=!1,await super.reset(),this.render()}tableize(){if(this.tableized===!0)return;this.tableized=!0;let t=0;for(let r of this.choices){t=Math.max(t,r.message.length),r.scaleIndex=r.initial||2,r.scale=[];for(let s=0;s<this.scale.length;s++)r.scale.push({index:s})}this.widths[0]=Math.min(this.widths[0],t+3)}async dispatch(t,r){if(this.multiple)return this[r.name]?await this[r.name](t,r):await super.dispatch(t,r);this.alert()}heading(t,r,s){return this.styles.strong(t)}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let t=this.focused;return t.scaleIndex>=this.scale.length-1?this.alert():(t.scaleIndex++,this.render())}left(){let t=this.focused;return t.scaleIndex<=0?this.alert():(t.scaleIndex--,this.render())}indent(){return""}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.index)).join(", "):""}pointer(){return""}renderScaleKey(){return this.scaleKey===!1||this.state.submitted?"":["",...this.scale.map(s=>` ${s.name} - ${s.message}`)].map(s=>this.styles.muted(s)).join(`
`)}renderScaleHeading(t){let r=this.scale.map(p=>p.name);typeof this.options.renderScaleHeading=="function"&&(r=this.options.renderScaleHeading.call(this,t));let s=this.scaleLength-r.join("").length,a=Math.round(s/(r.length-1)),c=r.map(p=>this.styles.strong(p)).join(" ".repeat(a)),f=" ".repeat(this.widths[0]);return this.margin[3]+f+this.margin[1]+c}scaleIndicator(t,r,s){if(typeof this.options.scaleIndicator=="function")return this.options.scaleIndicator.call(this,t,r,s);let a=t.scaleIndex===r.index;return r.disabled?this.styles.hint(this.symbols.radio.disabled):a?this.styles.success(this.symbols.radio.on):this.symbols.radio.off}renderScale(t,r){let s=t.scale.map(n=>this.scaleIndicator(t,n,r)),a=this.term==="Hyper"?"":" ";return s.join(a+this.symbols.line.repeat(this.edgeLength))}async renderChoice(t,r){await this.onChoice(t,r);let s=this.index===r,a=await this.pointer(t,r),n=await t.hint;n&&!Tde.hasColor(n)&&(n=this.styles.muted(n));let c=I=>this.margin[3]+I.replace(/\s+$/,"").padEnd(this.widths[0]," "),f=this.newline,p=this.indent(t),h=await this.resolve(t.message,this.state,t,r),E=await this.renderScale(t,r),C=this.margin[1]+this.margin[3];this.scaleLength=Gst.unstyle(E).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-C.length);let x=Tde.wordWrap(h,{width:this.widths[0],newline:f}).split(`
`).map(I=>c(I)+this.margin[1]);return s&&(E=this.styles.info(E),x=x.map(I=>this.styles.info(I))),x[0]+=E,this.linebreak&&x.push(""),[p+a,x.join(`
`)].filter(Boolean)}async renderChoices(){if(this.state.submitted)return"";this.tableize();let t=this.visible.map(async(a,n)=>await this.renderChoice(a,n)),r=await Promise.all(t),s=await this.renderScaleHeading();return this.margin[0]+[s,...r.map(a=>a.join(" "))].join(`
`)}async render(){let{submitted:t,size:r}=this.state,s=await this.prefix(),a=await this.separator(),n=await this.message(),c="";this.options.promptLine!==!1&&(c=[s,n,a,""].join(" "),this.state.prompt=c);let f=await this.header(),p=await this.format(),h=await this.renderScaleKey(),E=await this.error()||await this.hint(),C=await this.renderChoices(),S=await this.footer(),x=this.emptyError;p&&(c+=p),E&&!c.includes(E)&&(c+=" "+E),t&&!p&&!C.trim()&&this.multiple&&x!=null&&(c+=this.styles.danger(x)),this.clear(r),this.write([f,c,h,C,S].filter(Boolean).join(`
`)),this.state.submitted||this.write(this.margin[2]),this.restore()}submit(){this.value={};for(let t of this.choices)this.value[t.name]=t.scaleIndex;return this.base.submit.call(this)}};Fde.exports=r5});var Mde=G((M3t,Lde)=>{"use strict";var Ode=Xu(),Yst=(e="")=>typeof e=="string"?e.replace(/^['"]|['"]$/g,""):"",i5=class{constructor(t){this.name=t.key,this.field=t.field||{},this.value=Yst(t.initial||this.field.initial||""),this.message=t.message||this.name,this.cursor=0,this.input="",this.lines=[]}},Wst=async(e={},t={},r=s=>s)=>{let s=new Set,a=e.fields||[],n=e.template,c=[],f=[],p=[],h=1;typeof n=="function"&&(n=await n());let E=-1,C=()=>n[++E],S=()=>n[E+1],x=I=>{I.line=h,c.push(I)};for(x({type:"bos",value:""});E<n.length-1;){let I=C();if(/^[^\S\n ]$/.test(I)){x({type:"text",value:I});continue}if(I===`
`){x({type:"newline",value:I}),h++;continue}if(I==="\\"){I+=C(),x({type:"text",value:I});continue}if((I==="$"||I==="#"||I==="{")&&S()==="{"){let O=C();I+=O;let U={type:"template",open:I,inner:"",close:"",value:I},V;for(;V=C();){if(V==="}"){S()==="}"&&(V+=C()),U.value+=V,U.close=V;break}V===":"?(U.initial="",U.key=U.inner):U.initial!==void 0&&(U.initial+=V),U.value+=V,U.inner+=V}U.template=U.open+(U.initial||U.inner)+U.close,U.key=U.key||U.inner,t.hasOwnProperty(U.key)&&(U.initial=t[U.key]),U=r(U),x(U),p.push(U.key),s.add(U.key);let $=f.find(ie=>ie.name===U.key);U.field=a.find(ie=>ie.name===U.key),$||($=new i5(U),f.push($)),$.lines.push(U.line-1);continue}let T=c[c.length-1];T.type==="text"&&T.line===h?T.value+=I:x({type:"text",value:I})}return x({type:"eos",value:""}),{input:n,tabstops:c,unique:s,keys:p,items:f}};Lde.exports=async e=>{let t=e.options,r=new Set(t.required===!0?[]:t.required||[]),s={...t.values,...t.initial},{tabstops:a,items:n,keys:c}=await Wst(t,s),f=n5("result",e,t),p=n5("format",e,t),h=n5("validate",e,t,!0),E=e.isValue.bind(e);return async(C={},S=!1)=>{let x=0;C.required=r,C.items=n,C.keys=c,C.output="";let I=async(V,$,ie,fe)=>{let ae=await h(V,$,ie,fe);return ae===!1?"Invalid field "+ie.name:ae};for(let V of a){let $=V.value,ie=V.key;if(V.type!=="template"){$&&(C.output+=$);continue}if(V.type==="template"){let fe=n.find(Ee=>Ee.name===ie);t.required===!0&&C.required.add(fe.name);let ae=[fe.input,C.values[fe.value],fe.value,$].find(E),he=(fe.field||{}).message||V.inner;if(S){let Ee=await I(C.values[ie],C,fe,x);if(Ee&&typeof Ee=="string"||Ee===!1){C.invalid.set(ie,Ee);continue}C.invalid.delete(ie);let d=await f(C.values[ie],C,fe,x);C.output+=Ode.unstyle(d);continue}fe.placeholder=!1;let Ce=$;$=await p($,C,fe,x),ae!==$?(C.values[ie]=ae,$=e.styles.typing(ae),C.missing.delete(he)):(C.values[ie]=void 0,ae=`<${he}>`,$=e.styles.primary(ae),fe.placeholder=!0,C.required.has(ie)&&C.missing.add(he)),C.missing.has(he)&&C.validating&&($=e.styles.warning(ae)),C.invalid.has(ie)&&C.validating&&($=e.styles.danger(ae)),x===C.index&&(Ce!==$?$=e.styles.underline($):$=e.styles.heading(Ode.unstyle($))),x++}$&&(C.output+=$)}let T=C.output.split(`
`).map(V=>" "+V),O=n.length,U=0;for(let V of n)C.invalid.has(V.name)&&V.lines.forEach($=>{T[$][0]===" "&&(T[$]=C.styles.danger(C.symbols.bullet)+T[$].slice(1))}),e.isValue(C.values[V.name])&&U++;return C.completed=(U/O*100).toFixed(0),C.output=T.join(`
`),C.output}};function n5(e,t,r,s){return(a,n,c,f)=>typeof c.field[e]=="function"?c.field[e].call(t,a,n,c,f):[s,a].find(p=>t.isValue(p))}});var _de=G((U3t,Ude)=>{"use strict";var Vst=Xu(),Kst=Mde(),Jst=zI(),s5=class extends Jst{constructor(t){super(t),this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await Kst(this),await super.initialize()}async reset(t){this.state.keys=[],this.state.invalid=new Map,this.state.missing=new Set,this.state.completed=0,this.state.values={},t!==!0&&(await this.initialize(),await this.render())}moveCursor(t){let r=this.getItem();this.cursor+=t,r.cursor+=t}dispatch(t,r){if(!r.code&&!r.ctrl&&t!=null&&this.getItem()){this.append(t,r);return}this.alert()}append(t,r){let s=this.getItem(),a=s.input.slice(0,this.cursor),n=s.input.slice(this.cursor);this.input=s.input=`${a}${t}${n}`,this.moveCursor(1),this.render()}delete(){let t=this.getItem();if(this.cursor<=0||!t.input)return this.alert();let r=t.input.slice(this.cursor),s=t.input.slice(0,this.cursor-1);this.input=t.input=`${s}${r}`,this.moveCursor(-1),this.render()}increment(t){return t>=this.state.keys.length-1?0:t+1}decrement(t){return t<=0?this.state.keys.length-1:t-1}first(){this.state.index=0,this.render()}last(){this.state.index=this.state.keys.length-1,this.render()}right(){if(this.cursor>=this.input.length)return this.alert();this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1),this.render()}prev(){this.state.index=this.decrement(this.state.index),this.getItem(),this.render()}next(){this.state.index=this.increment(this.state.index),this.getItem(),this.render()}up(){this.prev()}down(){this.next()}format(t){let r=this.state.completed<100?this.styles.warning:this.styles.success;return this.state.submitted===!0&&this.state.completed!==100&&(r=this.styles.danger),r(`${this.state.completed}% completed`)}async render(){let{index:t,keys:r=[],submitted:s,size:a}=this.state,n=[this.options.newline,`
`].find(V=>V!=null),c=await this.prefix(),f=await this.separator(),p=await this.message(),h=[c,p,f].filter(Boolean).join(" ");this.state.prompt=h;let E=await this.header(),C=await this.error()||"",S=await this.hint()||"",x=s?"":await this.interpolate(this.state),I=this.state.key=r[t]||"",T=await this.format(I),O=await this.footer();T&&(h+=" "+T),S&&!T&&this.state.completed===0&&(h+=" "+S),this.clear(a);let U=[E,h,x,O,C.trim()];this.write(U.filter(Boolean).join(n)),this.restore()}getItem(t){let{items:r,keys:s,index:a}=this.state,n=r.find(c=>c.name===s[a]);return n&&n.input!=null&&(this.input=n.input,this.cursor=n.cursor),n}async submit(){typeof this.interpolate!="function"&&await this.initialize(),await this.interpolate(this.state,!0);let{invalid:t,missing:r,output:s,values:a}=this.state;if(t.size){let f="";for(let[p,h]of t)f+=`Invalid ${p}: ${h}
`;return this.state.error=f,super.submit()}if(r.size)return this.state.error="Required: "+[...r.keys()].join(", "),super.submit();let c=Vst.unstyle(s).split(`
`).map(f=>f.slice(1)).join(`
`);return this.value={values:a,result:c},super.submit()}};Ude.exports=s5});var jde=G((_3t,Hde)=>{"use strict";var zst="(Use <shift>+<up/down> to sort)",Xst=Y0(),o5=class extends Xst{constructor(t){super({...t,reorder:!1,sort:!0,multiple:!0}),this.state.hint=[this.options.hint,zst].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(t,r){let s=await super.renderChoice(t,r),a=this.symbols.identicalTo+" ",n=this.index===r&&this.sorting?this.styles.muted(a):" ";return this.options.drag===!1&&(n=""),this.options.numbered===!0?n+`${r+1} - `+s:n+s}get selected(){return this.choices}submit(){return this.value=this.choices.map(t=>t.value),super.submit()}};Hde.exports=o5});var qde=G((H3t,Gde)=>{"use strict";var Zst=Jv(),a5=class extends Zst{constructor(t={}){if(super(t),this.emptyError=t.emptyError||"No items were selected",this.term=process.env.TERM_PROGRAM,!this.options.header){let r=["","4 - Strongly Agree","3 - Agree","2 - Neutral","1 - Disagree","0 - Strongly Disagree",""];r=r.map(s=>this.styles.muted(s)),this.state.header=r.join(`
`)}}async toChoices(...t){if(this.createdScales)return!1;this.createdScales=!0;let r=await super.toChoices(...t);for(let s of r)s.scale=$st(5,this.options),s.scaleIdx=2;return r}dispatch(){this.alert()}space(){let t=this.focused,r=t.scale[t.scaleIdx],s=r.selected;return t.scale.forEach(a=>a.selected=!1),r.selected=!s,this.render()}indicator(){return""}pointer(){return""}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let t=this.focused;return t.scaleIdx>=t.scale.length-1?this.alert():(t.scaleIdx++,this.render())}left(){let t=this.focused;return t.scaleIdx<=0?this.alert():(t.scaleIdx--,this.render())}indent(){return" "}async renderChoice(t,r){await this.onChoice(t,r);let s=this.index===r,a=this.term==="Hyper",n=a?9:8,c=a?"":" ",f=this.symbols.line.repeat(n),p=" ".repeat(n+(a?0:1)),h=$=>($?this.styles.success("\u25C9"):"\u25EF")+c,E=r+1+".",C=s?this.styles.heading:this.styles.noop,S=await this.resolve(t.message,this.state,t,r),x=this.indent(t),I=x+t.scale.map(($,ie)=>h(ie===t.scaleIdx)).join(f),T=$=>$===t.scaleIdx?C($):$,O=x+t.scale.map(($,ie)=>T(ie)).join(p),U=()=>[E,S].filter(Boolean).join(" "),V=()=>[U(),I,O," "].filter(Boolean).join(`
`);return s&&(I=this.styles.cyan(I),O=this.styles.cyan(O)),V()}async renderChoices(){if(this.state.submitted)return"";let t=this.visible.map(async(s,a)=>await this.renderChoice(s,a)),r=await Promise.all(t);return r.length||r.push(this.styles.danger("No matching choices")),r.join(`
`)}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.scaleIdx)).join(", "):""}async render(){let{submitted:t,size:r}=this.state,s=await this.prefix(),a=await this.separator(),n=await this.message(),c=[s,n,a].filter(Boolean).join(" ");this.state.prompt=c;let f=await this.header(),p=await this.format(),h=await this.error()||await this.hint(),E=await this.renderChoices(),C=await this.footer();(p||!h)&&(c+=" "+p),h&&!c.includes(h)&&(c+=" "+h),t&&!p&&!E&&this.multiple&&this.type!=="form"&&(c+=this.styles.danger(this.emptyError)),this.clear(r),this.write([c,f,E,C].filter(Boolean).join(`
`)),this.restore()}submit(){this.value={};for(let t of this.choices)this.value[t.name]=t.scaleIdx;return this.base.submit.call(this)}};function $st(e,t={}){if(Array.isArray(t.scale))return t.scale.map(s=>({...s}));let r=[];for(let s=1;s<e+1;s++)r.push({i:s,selected:!1});return r}Gde.exports=a5});var Wde=G((j3t,Yde)=>{Yde.exports=JG()});var Kde=G((G3t,Vde)=>{"use strict";var eot=UT(),l5=class extends eot{async initialize(){await super.initialize(),this.value=this.initial=!!this.options.initial,this.disabled=this.options.disabled||"no",this.enabled=this.options.enabled||"yes",await this.render()}reset(){this.value=this.initial,this.render()}delete(){this.alert()}toggle(){this.value=!this.value,this.render()}enable(){if(this.value===!0)return this.alert();this.value=!0,this.render()}disable(){if(this.value===!1)return this.alert();this.value=!1,this.render()}up(){this.toggle()}down(){this.toggle()}right(){this.toggle()}left(){this.toggle()}next(){this.toggle()}prev(){this.toggle()}dispatch(t="",r){switch(t.toLowerCase()){case" ":return this.toggle();case"1":case"y":case"t":return this.enable();case"0":case"n":case"f":return this.disable();default:return this.alert()}}format(){let t=s=>this.styles.primary.underline(s);return[this.value?this.disabled:t(this.disabled),this.value?t(this.enabled):this.enabled].join(this.styles.muted(" / "))}async render(){let{size:t}=this.state,r=await this.header(),s=await this.prefix(),a=await this.separator(),n=await this.message(),c=await this.format(),f=await this.error()||await this.hint(),p=await this.footer(),h=[s,n,a,c].join(" ");this.state.prompt=h,f&&!h.includes(f)&&(h+=" "+f),this.clear(t),this.write([r,h,p].filter(Boolean).join(`
`)),this.write(this.margin[2]),this.restore()}};Vde.exports=l5});var zde=G((q3t,Jde)=>{"use strict";var tot=Y0(),c5=class extends tot{constructor(t){if(super(t),typeof this.options.correctChoice!="number"||this.options.correctChoice<0)throw new Error("Please specify the index of the correct answer from the list of choices")}async toChoices(t,r){let s=await super.toChoices(t,r);if(s.length<2)throw new Error("Please give at least two choices to the user");if(this.options.correctChoice>s.length)throw new Error("Please specify the index of the correct answer from the list of choices");return s}check(t){return t.index===this.options.correctChoice}async result(t){return{selectedAnswer:t,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}};Jde.exports=c5});var Zde=G(u5=>{"use strict";var Xde=ia(),Ts=(e,t)=>{Xde.defineExport(u5,e,t),Xde.defineExport(u5,e.toLowerCase(),t)};Ts("AutoComplete",()=>ide());Ts("BasicAuth",()=>fde());Ts("Confirm",()=>hde());Ts("Editable",()=>gde());Ts("Form",()=>MT());Ts("Input",()=>JG());Ts("Invisible",()=>Bde());Ts("List",()=>Sde());Ts("MultiSelect",()=>Dde());Ts("Numeral",()=>kde());Ts("Password",()=>Rde());Ts("Scale",()=>Nde());Ts("Select",()=>Y0());Ts("Snippet",()=>_de());Ts("Sort",()=>jde());Ts("Survey",()=>qde());Ts("Text",()=>Wde());Ts("Toggle",()=>Kde());Ts("Quiz",()=>zde())});var ege=G((W3t,$de)=>{$de.exports={ArrayPrompt:Jv(),AuthPrompt:GG(),BooleanPrompt:UT(),NumberPrompt:e5(),StringPrompt:km()}});var Xv=G((V3t,rge)=>{"use strict";var tge=Ie("assert"),A5=Ie("events"),W0=ia(),$u=class extends A5{constructor(t,r){super(),this.options=W0.merge({},t),this.answers={...r}}register(t,r){if(W0.isObject(t)){for(let a of Object.keys(t))this.register(a,t[a]);return this}tge.equal(typeof r,"function","expected a function");let s=t.toLowerCase();return r.prototype instanceof this.Prompt?this.prompts[s]=r:this.prompts[s]=r(this.Prompt,this),this}async prompt(t=[]){for(let r of[].concat(t))try{typeof r=="function"&&(r=await r.call(this)),await this.ask(W0.merge({},this.options,r))}catch(s){return Promise.reject(s)}return this.answers}async ask(t){typeof t=="function"&&(t=await t.call(this));let r=W0.merge({},this.options,t),{type:s,name:a}=t,{set:n,get:c}=W0;if(typeof s=="function"&&(s=await s.call(this,t,this.answers)),!s)return this.answers[a];tge(this.prompts[s],`Prompt "${s}" is not registered`);let f=new this.prompts[s](r),p=c(this.answers,a);f.state.answers=this.answers,f.enquirer=this,a&&f.on("submit",E=>{this.emit("answer",a,E,f),n(this.answers,a,E)});let h=f.emit.bind(f);return f.emit=(...E)=>(this.emit.call(this,...E),h(...E)),this.emit("prompt",f,this),r.autofill&&p!=null?(f.value=f.input=p,r.autofill==="show"&&await f.submit()):p=f.value=await f.run(),p}use(t){return t.call(this,this),this}set Prompt(t){this._Prompt=t}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(t){this._Prompt=t}static get Prompt(){return this._Prompt||zI()}static get prompts(){return Zde()}static get types(){return ege()}static get prompt(){let t=(r,...s)=>{let a=new this(...s),n=a.emit.bind(a);return a.emit=(...c)=>(t.emit(...c),n(...c)),a.prompt(r)};return W0.mixinEmitter(t,new A5),t}};W0.mixinEmitter($u,new A5);var f5=$u.prompts;for(let e of Object.keys(f5)){let t=e.toLowerCase(),r=s=>new f5[e](s).run();$u.prompt[t]=r,$u[t]=r,$u[e]||Reflect.defineProperty($u,e,{get:()=>f5[e]})}var zv=e=>{W0.defineExport($u,e,()=>$u.types[e])};zv("ArrayPrompt");zv("AuthPrompt");zv("BooleanPrompt");zv("NumberPrompt");zv("StringPrompt");rge.exports=$u});var uge=G((gHt,uot)=>{uot.exports={name:"@yarnpkg/cli",version:"4.16.0",license:"BSD-2-Clause",main:"./sources/index.ts",exports:{".":"./sources/index.ts","./polyfills":"./sources/polyfills.ts","./package.json":"./package.json"},dependencies:{"@yarnpkg/core":"workspace:^","@yarnpkg/fslib":"workspace:^","@yarnpkg/libzip":"workspace:^","@yarnpkg/parsers":"workspace:^","@yarnpkg/plugin-catalog":"workspace:^","@yarnpkg/plugin-compat":"workspace:^","@yarnpkg/plugin-constraints":"workspace:^","@yarnpkg/plugin-dlx":"workspace:^","@yarnpkg/plugin-essentials":"workspace:^","@yarnpkg/plugin-exec":"workspace:^","@yarnpkg/plugin-file":"workspace:^","@yarnpkg/plugin-git":"workspace:^","@yarnpkg/plugin-github":"workspace:^","@yarnpkg/plugin-http":"workspace:^","@yarnpkg/plugin-init":"workspace:^","@yarnpkg/plugin-interactive-tools":"workspace:^","@yarnpkg/plugin-jsr":"workspace:^","@yarnpkg/plugin-link":"workspace:^","@yarnpkg/plugin-nm":"workspace:^","@yarnpkg/plugin-npm":"workspace:^","@yarnpkg/plugin-npm-cli":"workspace:^","@yarnpkg/plugin-pack":"workspace:^","@yarnpkg/plugin-patch":"workspace:^","@yarnpkg/plugin-pnp":"workspace:^","@yarnpkg/plugin-pnpm":"workspace:^","@yarnpkg/plugin-stage":"workspace:^","@yarnpkg/plugin-typescript":"workspace:^","@yarnpkg/plugin-version":"workspace:^","@yarnpkg/plugin-workspace-tools":"workspace:^","@yarnpkg/shell":"workspa Line truncated
${V} at ${$}`:`
${V}`}).join("");h.push({text:`Conflict detected in constraint targeting ${ce.pretty(e.configuration,x,ce.Type.CODE)}; conflicting values are:${T}`,fixable:!1})}else{let[[T]]=I,O=xa(S,x);if(JSON.stringify(O)===JSON.stringify(T))continue;if(!s){let U=typeof O>"u"?`Missing field ${ce.pretty(e.configuration,x,ce.Type.CODE)}; expected ${ce.pretty(e.configuration,T,ce.Type.INSPECT)}`:typeof T>"u"?`Extraneous field ${ce.pretty(e.configuration,x,ce.Type.CODE)} currently set to ${ce.pretty(e.configuration,O,ce.Type.INSPECT)}`:`Invalid field ${ce.pretty(e.configuration,x,ce.Type.CODE)}; expected ${ce.pretty(e.configuration,T,ce.Type.INSPECT)}, found ${ce.pretty(e.configuration,O,ce.Type.INSPECT)}`;h.push({text:U,fixable:!0});continue}typeof T>"u"?h0(S,x):Jg(S,x,T),E=!0}E&&a.set(C,S)}h.length>0&&n.set(C,h)}return{changedWorkspaces:a,remainingErrors:n}}function zge(e,{configuration:t}){let r={children:[]};for(let[s,a]of e){let n=[];for(let f of a){let p=f.text.split(/\n/);f.fixable&&(p[0]=`${ce.pretty(t,"\u2699","gray")} ${p[0]}`),n.push({value:ce.tuple(ce.Type.NO_HINT,p[0]),children:p.slice(1).map(h=>({value:ce.tuple(ce.Type.NO_HINT,h)}))})}let c={value:ce.tuple(ce.Type.LOCATOR,s.anchoredLocator),children:qe.sortMap(n,f=>f.value[1])};r.children.push(c)}return r.children=qe.sortMap(r.children,s=>s.value[1]),r}var MC,sat,oat,aat,lS=Xe(()=>{Ge();Xl();MC=class{constructor(t){this.indexedFields=t;this.items=[];this.indexes={};this.clear()}clear(){this.items=[];for(let t of this.indexedFields)this.indexes[t]=new Map}insert(t){this.items.push(t);for(let r of this.indexedFields){let s=Object.hasOwn(t,r)?t[r]:void 0;if(typeof s>"u")continue;qe.getArrayWithDefault(this.indexes[r],s).push(t)}return t}find(t){if(typeof t>"u")return this.items;let r=Object.entries(t);if(r.length===0)return this.items;let s=[],a;for(let[c,f]of r){let p=c,h=Object.hasOwn(this.indexes,p)?this.indexes[p]:void 0;if(typeof h>"u"){s.push([p,f]);continue}let E=new Set(h.get(f)??[]);if(E.size===0)return[];if(typeof a>"u")a=E;else for(let C of a)E.has(C)||a.delete(C);if(a.size===0)break}let n=[...a??[]];return s.length>0&&(n=n.filter(c=>{for(let[f,p]of s)if(!(typeof p<"u"?Object.hasOwn(c,f)&&c[f]===p:Object.hasOwn(c,f)===!1))return!1;return!0})),n}},sat=/^[0-9]+$/,oat=/^[a-zA-Z0-9_]+$/,aat=new Set(["scripts",..._t.allDependencies])});var Xge=G(($9t,V5)=>{var uat;(function(e){var t=function(){return{"append/2":[new e.type.Rule(new e.type.Term("append",[new e.type.Var("X"),new e.type.Var("L")]),new e.type.Term("foldl",[new e.type.Term("append",[]),new e.type.Var("X"),new e.type.Term("[]",[]),new e.type.Var("L")]))],"append/3":[new e.type.Rule(new e.type.Term("append",[new e.type.Term("[]",[]),new e.type.Var("X"),new e.type.Var("X")]),null),new e.type.Rule(new e.type.Term("append",[new e.type.Term(".",[new e.type.Var("H"),new e.type.Var("T")]),new e.type.Var("X"),new e.type.Term(".",[new e.type.Var("H"),new e.type.Var("S")])]),new e.type.Term("append",[new e.type.Var("T"),new e.type.Var("X"),new e.type.Var("S")]))],"member/2":[new e.type.Rule(new e.type.Term("member",[new e.type.Var("X"),new e.type.Term(".",[new e.type.Var("X"),new e.type.Var("_")])]),null),new e.type.Rule(new e.type.Term("member",[new e.type.Var("X"),new e.type.Term(".",[new e.type.Var("_"),new e.type.Var("Xs")])]),new e.type.Term("member",[new e.type.Var("X"),new e.type.Var("Xs")]))],"permutation/2":[new e.type.Rule(new e.type.Term("permutation",[new e.type.Term("[]",[]),new e.type.Term("[]",[])]),null),new e.type.Rule(new e.type.Term("permutation",[new e.type.Term(".",[new e.type.Var("H"),new e.type.Var("T")]),new e.type.Var("S")]),new e.type.Term(",",[new e.type.Term("permutation",[new e.type.Var("T"),new e.type.Var("P")]),new e.type.Term(",",[new e.type.Term("append",[new e.type.Var("X"),new e.type.Var("Y"),new e.type.Var("P")]),new e.type.Term("append",[new e.type.Var("X"),new e.type.Term(".",[new e.type.Var("H"),new e.type.Var("Y")]),new e.type.Var("S")])])]))],"maplist/2":[new e.type.Rule(new e.type.Term("maplist",[new e.type.Var("_"),new e.type.Term("[]",[])]),null),new e.type.Rule(new e.type.Term("maplist",[new e.type.Var("P"),new e.type.Term(".",[new e.type.Var("X"),new e.type.Var("Xs")])]),new e.type.Term(",",[new e.type.Term("call",[new e.type.Var("P"),new e.type.Var("X")]),new e.type.Term("maplist",[new e.type.Var("P"),new e.type.Var("Xs")])]))],"maplist/3":[new e.type.Rule(new e.type.Term("maplist",[new e.type.Var("_"),new e.type.Term("[]",[]),new e.type.Term("[]",[])]),null),new e.type.Rule(new e.type.Term("maplist",[new e.type.Var("P"),new e.type.Term(".",[new e.type.Var("A"),new e.type.Var("As")]),new e.type.Term(".",[new e.type.Var("B"),new e.type.Var("Bs")])]),new e.type.Term(",",[new e.type.Term("call",[new e.type.Var("P"),new e.type.Var("A"),new e.type.Var("B")]),new e.type.Term("maplist",[new e.type.Var("P"),new e.type.Var("As"),new e.type.Var("Bs")])]))],"maplist/4":[new e.type.Rule(new e.type.Term("maplist",[new e.type.Var("_"),new e.type.Term("[]",[]),new e.type.Ter Line truncated
`+p:"")),c.error.method="_execFileSync",c.error.program=a,c.error.args=n,c.error.extMessage=p,c.error.exitCode=+f),li.unlinkSync(h),li.unlinkSync(E),li.unlinkSync(C),li.unlinkSync(S),c}function hat(e){var t,r={},s,a={env:process.env,encoding:e.encoding};if(V0||(Tm?process.env.PSModulePath?(V0="powershell.exe",VT=["-ExecutionPolicy","Bypass","-File",__dirname+"\\read.ps1"]):(V0="cscript.exe",VT=["//nologo",__dirname+"\\read.cs.js"]):(V0="/bin/sh",VT=[__dirname+"/read.sh"])),Tm&&!process.env.PSModulePath&&(a.stdio=[process.stdin]),z5.execFileSync){t=rme(e),cS&&cS("execFileSync",t);try{r.input=z5.execFileSync(V0,t,a)}catch(n){s=n.stderr?(n.stderr+"").trim():"",r.error=new Error(eme+(s?`
`+s:"")),r.error.method="execFileSync",r.error.program=V0,r.error.args=t,r.error.extMessage=s,r.error.exitCode=n.status,r.error.code=n.code,r.error.signal=n.signal}}else r=pat(e,a);return r.error||(r.input=r.input.replace(/^\s*'|'\s*$/g,""),e.display=""),r}function $5(e){var t="",r=e.display,s=!e.display&&e.keyIn&&e.hideEchoBack&&!e.mask;function a(){var n=hat(e);if(n.error)throw n.error;return n.input}return Z5&&Z5(e),function(){var n,c,f;function p(){return n||(n=process.binding("fs"),c=process.binding("constants")),n}if(typeof $p=="string")if($p=null,Tm){if(f=function(h){var E=h.replace(/^\D+/,"").split("."),C=0;return(E[0]=+E[0])&&(C+=E[0]*1e4),(E[1]=+E[1])&&(C+=E[1]*100),(E[2]=+E[2])&&(C+=E[2]),C}(process.version),!(f>=20302&&f<40204||f>=5e4&&f<50100||f>=50600&&f<60200)&&process.stdin.isTTY)process.stdin.pause(),$p=process.stdin.fd,_C=process.stdin._handle;else try{$p=p().open("CONIN$",c.O_RDWR,parseInt("0666",8)),_C=new Zge($p,!0)}catch{}if(process.stdout.isTTY)tf=process.stdout.fd;else{try{tf=li.openSync("\\\\.\\CON","w")}catch{}if(typeof tf!="number")try{tf=p().open("CONOUT$",c.O_RDWR,parseInt("0666",8))}catch{}}}else{if(process.stdin.isTTY){process.stdin.pause();try{$p=li.openSync("/dev/tty","r"),_C=process.stdin._handle}catch{}}else try{$p=li.openSync("/dev/tty","r"),_C=new Zge($p,!1)}catch{}if(process.stdout.isTTY)tf=process.stdout.fd;else try{tf=li.openSync("/dev/tty","w")}catch{}}}(),function(){var n,c,f=!e.hideEchoBack&&!e.keyIn,p,h,E,C,S;KT="";function x(I){return I===$ge?!0:_C.setRawMode(I)!==0?!1:($ge=I,!0)}if(tme||!_C||typeof tf!="number"&&(e.display||!f)){t=a();return}if(e.display&&(li.writeSync(tf,e.display),e.display=""),!e.displayOnly){if(!x(!f)){t=a();return}for(h=e.keyIn?1:e.bufferSize,p=Buffer.allocUnsafe&&Buffer.alloc?Buffer.alloc(h):new Buffer(h),e.keyIn&&e.limit&&(c=new RegExp("[^"+e.limit+"]","g"+(e.caseSensitive?"":"i")));;){E=0;try{E=li.readSync($p,p,0,h)}catch(I){if(I.code!=="EOF"){x(!1),t+=a();return}}if(E>0?(C=p.toString(e.encoding,0,E),KT+=C):(C=`
`,KT+="\0"),C&&typeof(S=(C.match(/^(.*?)[\r\n]/)||[])[1])=="string"&&(C=S,n=!0),C&&(C=C.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"")),C&&c&&(C=C.replace(c,"")),C&&(f||(e.hideEchoBack?e.mask&&li.writeSync(tf,new Array(C.length+1).join(e.mask)):li.writeSync(tf,C)),t+=C),!e.keyIn&&n||e.keyIn&&t.length>=h)break}!f&&!s&&li.writeSync(tf,`
`),x(!1)}}(),e.print&&!s&&e.print(r+(e.displayOnly?"":(e.hideEchoBack?new Array(t.length+1).join(e.mask):t)+`
`),e.encoding),e.displayOnly?"":r9=e.keepWhitespace||e.keyIn?t:t.trim()}function dat(e,t){var r=[];function s(a){a!=null&&(Array.isArray(a)?a.forEach(s):(!t||t(a))&&r.push(a))}return s(e),r}function n9(e){return e.replace(/[\x00-\x7f]/g,function(t){return"\\x"+("00"+t.charCodeAt().toString(16)).substr(-2)})}function eo(){var e=Array.prototype.slice.call(arguments),t,r;return e.length&&typeof e[0]=="boolean"&&(r=e.shift(),r&&(t=Object.keys(X5),e.unshift(X5))),e.reduce(function(s,a){return a==null||(a.hasOwnProperty("noEchoBack")&&!a.hasOwnProperty("hideEchoBack")&&(a.hideEchoBack=a.noEchoBack,delete a.noEchoBack),a.hasOwnProperty("noTrim")&&!a.hasOwnProperty("keepWhitespace")&&(a.keepWhitespace=a.noTrim,delete a.noTrim),r||(t=Object.keys(a)),t.forEach(function(n){var c;if(a.hasOwnProperty(n))switch(c=a[n],n){case"mask":case"limitMessage":case"defaultInput":case"encoding":c=c!=null?c+"":"",c&&n!=="limitMessage"&&(c=c.replace(/[\r\n]/g,"")),s[n]=c;break;case"bufferSize":!isNaN(c=parseInt(c,10))&&typeof c=="number"&&(s[n]=c);break;case"displayOnly":case"keyIn":case"hideEchoBack":case"caseSensitive":case"keepWhitespace":case"history":case"cd":s[n]=!!c;break;case"limit":case"trueValue":case"falseValue":s[n]=dat(c,function(f){var p=typeof f;return p==="string"||p==="number"||p==="function"||f instanceof RegExp}).map(function(f){return typeof f=="string"?f.replace(/[\r\n]/g,""):f});break;case"print":case"phContent":case"preCheck":s[n]=typeof c=="function"?c:void 0;break;case"prompt":case"display":s[n]=c??"";break}})),s},{})}function e9(e,t,r){return t.some(function(s){var a=typeof s;return a==="string"?r?e===s:e.toLowerCase()===s.toLowerCase():a==="number"?parseFloat(e)===s:a==="function"?s(e):s instanceof RegExp?s.test(e):!1})}function i9(e,t){var r=K0.normalize(Tm?(process.env.HOMEDRIVE||"")+(process.env.HOMEPATH||""):process.env.HOME||"").replace(/[\/\\]+$/,"");return e=K0.normalize(e),t?e.replace(/^~(?=\/|\\|$)/,r):e.replace(new RegExp("^"+n9(r)+"(?=\\/|\\\\|$)",Tm?"i":""),"~")}function HC(e,t){var r="(?:\\(([\\s\\S]*?)\\))?(\\w+|.-.)(?:\\(([\\s\\S]*?)\\))?",s=new RegExp("(\\$)?(\\$<"+r+">)","g"),a=new RegExp("(\\$)?(\\$\\{"+r+"\\})","g");function n(c,f,p,h,E,C){var S;return f||typeof(S=t(E))!="string"?p:S?(h||"")+S+(C||""):""}return e.replace(s,n).replace(a,n)}function nme(e,t,r){var s,a=[],n=-1,c=0,f="",p;function h(E,C){return C.length>3?(E.push(C[0]+"..."+C[C.length-1]),p=!0):C.length&&(E=E.concat(C)),E}return s=e.reduce(function(E,C){return E.concat((C+"").split(""))},[]).reduce(function(E,C){var S,x;return t||(C=C.toLowerCase()),S=/^\d$/.test(C)?1:/^[A-Z]$/.test(C)?2:/^[a-z]$/.test(C)?3:0,r&&S===0?f+=C:(x=C.charCodeAt(0),S&&S===n&&x===c+1?a.push(C):(E=h(E,a),a=[C],n=S),c=x),E},[]),s=h(s,a),f&&(s.push(f),p=!0),{values:s,suppressed:p}}function ime(e,t){return e.join(e.length>2?", ":t?" / ":"/")}function sme(e,t){var r,s,a={},n;if(t.phContent&&(r=t.phContent(e,t)),typeof r!="string")switch(e){case"hideEchoBack":case"mask":case"defaultInput":case"caseSensitive":case"keepWhitespace":case"encoding":case"bufferSize":case"history":case"cd":r=t.hasOwnProperty(e)?typeof t[e]=="boolean"?t[e]?"on":"off":t[e]+"":"";break;case"limit":case"trueValue":case"falseValue":s=t[t.hasOwnProperty(e+"Src")?e+"Src":e],t.keyIn?(a=nme(s,t.caseSensitive),s=a.values):s=s.filter(function(c){var f=typeof c;return f==="string"||f==="number"}),r=ime(s,a.suppressed);break;case"limitCount":case"limitCountNotZero":r=t[t.hasOwnProperty("limitSrc")?"limitSrc":"limit"].length,r=r||e!=="limitCountNotZero"?r+"":"";break;case"lastInput":r=r9;break;case"cwd":case"CWD":case"cwdHome":r=process.cwd(),e==="CWD"?r=K0.basename(r):e==="cwdHome"&&(r=i9(r));break;case"date":case"time":case"localeDate":case"localeTime":r=new Date()["to"+e.replace(/^./,function(c){return c.toUpperCase()})+"String"]();break;default:typeof(n=(e.match(/^history_m(\d+)$/)||[])[1])=="string"&&(r=Rm[Rm.length-n]||"")}return r}function ome(e){var t=/^(.)-(.)$/.exec(e),r="",s,a,n,c;if(!t)return null;for(s=t[1].charCodeAt(0),a=t[2].charCodeAt(0),c=s<a?1:-1,n=s;n!==a+c;n+=c)r+=String.fromCharCode(n);return r}function t9(e){var t=new RegExp(/(\s*)(?:("|')(.*?)(?:\2|$)|(\S+))/g),r,s="",a=[],n;for(e=e.trim();r=t.exec(e);)n=r[3]||r[4]||"",r[1]&&(a.push(s),s=""),s+=n;return s&&a.push(s),a}function ame(e,t){return t.trueValue.length&&e9(e,t.trueValue,t.caseSensitive)?!0:t.falseValue.length&&e9(e,t.falseValue,t.caseSensitive)?!1:e}function lme(e){var t,r,s,a,n,c,f;function p(E){return sme(E,e)}function h(E){e.display+=(/[^\r\n]$/.test(e.display)?`
`:"")+E}for(e.limitSrc=e.limit,e.displaySrc=e.display,e.limit="",e.display=HC(e.display+"",p);;){if(t=$5(e),r=!1,s="",e.defaultInput&&!t&&(t=e.defaultInput),e.history&&((a=/^\s*\!(?:\!|-1)(:p)?\s*$/.exec(t))?(n=Rm[0]||"",a[1]?r=!0:t=n,h(n+`
`),r||(e.displayOnly=!0,$5(e),e.displayOnly=!1)):t&&t!==Rm[Rm.length-1]&&(Rm=[t])),!r&&e.cd&&t)switch(c=t9(t),c[0].toLowerCase()){case"cd":if(c[1])try{process.chdir(i9(c[1],!0))}catch(E){h(E+"")}r=!0;break;case"pwd":h(process.cwd()),r=!0;break}if(!r&&e.preCheck&&(f=e.preCheck(t,e),t=f.res,f.forceNext&&(r=!0)),!r){if(!e.limitSrc.length||e9(t,e.limitSrc,e.caseSensitive))break;e.limitMessage&&(s=HC(e.limitMessage,p))}h((s?s+`
`:"")+HC(e.displaySrc+"",p))}return ame(t,e)}en._DBG_set_useExt=function(e){tme=e};en._DBG_set_checkOptions=function(e){Z5=e};en._DBG_set_checkMethod=function(e){cS=e};en._DBG_clearHistory=function(){r9="",Rm=[]};en.setDefaultOptions=function(e){return X5=eo(!0,e),eo(!0)};en.question=function(e,t){return lme(eo(eo(!0,t),{display:e}))};en.prompt=function(e){var t=eo(!0,e);return t.display=t.prompt,lme(t)};en.keyIn=function(e,t){var r=eo(eo(!0,t),{display:e,keyIn:!0,keepWhitespace:!0});return r.limitSrc=r.limit.filter(function(s){var a=typeof s;return a==="string"||a==="number"}).map(function(s){return HC(s+"",ome)}),r.limit=n9(r.limitSrc.join("")),["trueValue","falseValue"].forEach(function(s){r[s]=r[s].reduce(function(a,n){var c=typeof n;return c==="string"||c==="number"?a=a.concat((n+"").split("")):a.push(n),a},[])}),r.display=HC(r.display+"",function(s){return sme(s,r)}),ame($5(r),r)};en.questionEMail=function(e,t){return e==null&&(e="Input e-mail address: "),en.question(e,eo({hideEchoBack:!1,limit:/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,limitMessage:"Input valid e-mail address, please.",trueValue:null,falseValue:null},t,{keepWhitespace:!1,cd:!1}))};en.questionNewPassword=function(e,t){var r,s,a,n=eo({hideEchoBack:!0,mask:"*",limitMessage:`It can include: $<charlist>
And the length must be: $<length>`,trueValue:null,falseValue:null,caseSensitive:!0},t,{history:!1,cd:!1,phContent:function(x){return x==="charlist"?r.text:x==="length"?s+"..."+a:null}}),c,f,p,h,E,C,S;for(t=t||{},c=HC(t.charlist?t.charlist+"":"$<!-~>",ome),(isNaN(s=parseInt(t.min,10))||typeof s!="number")&&(s=12),(isNaN(a=parseInt(t.max,10))||typeof a!="number")&&(a=24),h=new RegExp("^["+n9(c)+"]{"+s+","+a+"}$"),r=nme([c],n.caseSensitive,!0),r.text=ime(r.values,r.suppressed),f=t.confirmMessage!=null?t.confirmMessage:"Reinput a same one to confirm it: ",p=t.unmatchMessage!=null?t.unmatchMessage:"It differs from first one. Hit only the Enter key if you want to retry from first one.",e==null&&(e="Input new password: "),E=n.limitMessage;!S;)n.limit=h,n.limitMessage=E,C=en.question(e,n),n.limit=[C,""],n.limitMessage=p,S=en.question(f,n);return C};function cme(e,t,r){var s;function a(n){return s=r(n),!isNaN(s)&&typeof s=="number"}return en.question(e,eo({limitMessage:"Input valid number, please."},t,{limit:a,cd:!1})),s}en.questionInt=function(e,t){return cme(e,t,function(r){return parseInt(r,10)})};en.questionFloat=function(e,t){return cme(e,t,parseFloat)};en.questionPath=function(e,t){var r,s="",a=eo({hideEchoBack:!1,limitMessage:`$<error(
)>Input valid path, please.$<( Min:)min>$<( Max:)max>`,history:!0,cd:!0},t,{keepWhitespace:!1,limit:function(n){var c,f,p;n=i9(n,!0),s="";function h(E){E.split(/\/|\\/).reduce(function(C,S){var x=K0.resolve(C+=S+K0.sep);if(!li.existsSync(x))li.mkdirSync(x);else if(!li.statSync(x).isDirectory())throw new Error("Non directory already exists: "+x);return C},"")}try{if(c=li.existsSync(n),r=c?li.realpathSync(n):K0.resolve(n),!t.hasOwnProperty("exists")&&!c||typeof t.exists=="boolean"&&t.exists!==c)return s=(c?"Already exists":"No such file or directory")+": "+r,!1;if(!c&&t.create&&(t.isDirectory?h(r):(h(K0.dirname(r)),li.closeSync(li.openSync(r,"w"))),r=li.realpathSync(r)),c&&(t.min||t.max||t.isFile||t.isDirectory)){if(f=li.statSync(r),t.isFile&&!f.isFile())return s="Not file: "+r,!1;if(t.isDirectory&&!f.isDirectory())return s="Not directory: "+r,!1;if(t.min&&f.size<+t.min||t.max&&f.size>+t.max)return s="Size "+f.size+" is out of range: "+r,!1}if(typeof t.validate=="function"&&(p=t.validate(r))!==!0)return typeof p=="string"&&(s=p),!1}catch(E){return s=E+"",!1}return!0},phContent:function(n){return n==="error"?s:n!=="min"&&n!=="max"?null:t.hasOwnProperty(n)?t[n]+"":""}});return t=t||{},e==null&&(e='Input path (you can "cd" and "pwd"): '),en.question(e,a),r};function ume(e,t){var r={},s={};return typeof e=="object"?(Object.keys(e).forEach(function(a){typeof e[a]=="function"&&(s[t.caseSensitive?a:a.toLowerCase()]=e[a])}),r.preCheck=function(a){var n;return r.args=t9(a),n=r.args[0]||"",t.caseSensitive||(n=n.toLowerCase()),r.hRes=n!=="_"&&s.hasOwnProperty(n)?s[n].apply(a,r.args.slice(1)):s.hasOwnProperty("_")?s._.apply(a,r.args):null,{res:a,forceNext:!1}},s.hasOwnProperty("_")||(r.limit=function(){var a=r.args[0]||"";return t.caseSensitive||(a=a.toLowerCase()),s.hasOwnProperty(a)})):r.preCheck=function(a){return r.args=t9(a),r.hRes=typeof e=="function"?e.apply(a,r.args):!0,{res:a,forceNext:!1}},r}en.promptCL=function(e,t){var r=eo({hideEchoBack:!1,limitMessage:"Requested command is not available.",caseSensitive:!1,history:!0},t),s=ume(e,r);return r.limit=s.limit,r.preCheck=s.preCheck,en.prompt(r),s.args};en.promptLoop=function(e,t){for(var r=eo({hideEchoBack:!1,trueValue:null,falseValue:null,caseSensitive:!1,history:!0},t);!e(en.prompt(r)););};en.promptCLLoop=function(e,t){var r=eo({hideEchoBack:!1,limitMessage:"Requested command is not available.",caseSensitive:!1,history:!0},t),s=ume(e,r);for(r.limit=s.limit,r.preCheck=s.preCheck;en.prompt(r),!s.hRes;);};en.promptSimShell=function(e){return en.prompt(eo({hideEchoBack:!1,history:!0},e,{prompt:function(){return Tm?"$<cwd>>":(process.env.USER||"")+(process.env.HOSTNAME?"@"+process.env.HOSTNAME.replace(/\..*$/,""):"")+":$<cwdHome>$ "}()}))};function fme(e,t,r){var s;return e==null&&(e="Are you sure? "),(!t||t.guide!==!1)&&(e+="")&&(e=e.replace(/\s*:?\s*$/,"")+" [y/n]: "),s=en.keyIn(e,eo(t,{hideEchoBack:!1,limit:r,trueValue:"y",falseValue:"n",caseSensitive:!1})),typeof s=="boolean"?s:""}en.keyInYN=function(e,t){return fme(e,t)};en.keyInYNStrict=function(e,t){return fme(e,t,"yn")};en.keyInPause=function(e,t){e==null&&(e="Continue..."),(!t||t.guide!==!1)&&(e+="")&&(e=e.replace(/\s+$/,"")+" (Hit any key)"),en.keyIn(e,eo({limit:null},t,{hideEchoBack:!0,mask:""}))};en.keyInSelect=function(e,t,r){var s=eo({hideEchoBack:!1},r,{trueValue:null,falseValue:null,caseSensitive:!1,phContent:function(p){return p==="itemsCount"?e.length+"":p==="firstItem"?(e[0]+"").trim():p==="lastItem"?(e[e.length-1]+"").trim():null}}),a="",n={},c=49,f=`
`;if(!Array.isArray(e)||!e.length||e.length>35)throw"`items` must be Array (max length: 35).";return e.forEach(function(p,h){var E=String.fromCharCode(c);a+=E,n[E]=h,f+="["+E+"] "+(p+"").trim()+`
`,c=c===57?97:c+1}),(!r||r.cancel!==!1)&&(a+="0",n[0]=-1,f+="[0] "+(r&&r.cancel!=null&&typeof r.cancel!="boolean"?(r.cancel+"").trim():"CANCEL")+`
`),s.limit=a,f+=`
`,t==null&&(t="Choose one from list: "),(t+="")&&((!r||r.guide!==!1)&&(t=t.replace(/\s*:?\s*$/,"")+" [$<limit>]: "),f+=t),n[en.keyIn(f,s).toLowerCase()]};en.getRawInput=function(){return KT};function uS(e,t){var r;return t.length&&(r={},r[e]=t[0]),en.setDefaultOptions(r)[e]}en.setPrint=function(){return uS("print",arguments)};en.setPrompt=function(){return uS("prompt",arguments)};en.setEncoding=function(){return uS("encoding",arguments)};en.setMask=function(){return uS("mask",arguments)};en.setBufferSize=function(){return uS("bufferSize",arguments)}});var s9=G((tqt,nc)=>{(function(){var e={major:0,minor:2,patch:66,status:"beta"};tau_file_system={files:{},open:function(w,D,y){var F=tau_file_system.files[w];if(!F){if(y==="read")return null;F={path:w,text:"",type:D,get:function(z,X){return X===this.text.length||X>this.text.length?"end_of_file":this.text.substring(X,X+z)},put:function(z,X){return X==="end_of_file"?(this.text+=z,!0):X==="past_end_of_file"?null:(this.text=this.text.substring(0,X)+z+this.text.substring(X+z.length),!0)},get_byte:function(z){if(z==="end_of_stream")return-1;var X=Math.floor(z/2);if(this.text.length<=X)return-1;var ee=n(this.text[Math.floor(z/2)],0);return z%2===0?ee&255:ee/256>>>0},put_byte:function(z,X){var ee=X==="end_of_stream"?this.text.length:Math.floor(X/2);if(this.text.length<ee)return null;var se=this.text.length===ee?-1:n(this.text[Math.floor(X/2)],0);return X%2===0?(se=se/256>>>0,se=(se&255)<<8|z&255):(se=se&255,se=(z&255)<<8|se&255),this.text.length===ee?this.text+=c(se):this.text=this.text.substring(0,ee)+c(se)+this.text.substring(ee+1),!0},flush:function(){return!0},close:function(){var z=tau_file_system.files[this.path];return z?!0:null}},tau_file_system.files[w]=F}return y==="write"&&(F.text=""),F}},tau_user_input={buffer:"",get:function(w,D){for(var y;tau_user_input.buffer.length<w;)y=window.prompt(),y&&(tau_user_input.buffer+=y);return y=tau_user_input.buffer.substr(0,w),tau_user_input.buffer=tau_user_input.buffer.substr(w),y}},tau_user_output={put:function(w,D){return console.log(w),!0},flush:function(){return!0}},nodejs_file_system={open:function(w,D,y){var F=Ie("fs"),z=F.openSync(w,y[0]);return y==="read"&&!F.existsSync(w)?null:{get:function(X,ee){var se=new Buffer(X);return F.readSync(z,se,0,X,ee),se.toString()},put:function(X,ee){var se=Buffer.from(X);if(ee==="end_of_file")F.writeSync(z,se);else{if(ee==="past_end_of_file")return null;F.writeSync(z,se,0,se.length,ee)}return!0},get_byte:function(X){return null},put_byte:function(X,ee){return null},flush:function(){return!0},close:function(){return F.closeSync(z),!0}}}},nodejs_user_input={buffer:"",get:function(w,D){for(var y,F=Ame();nodejs_user_input.buffer.length<w;)nodejs_user_input.buffer+=F.question();return y=nodejs_user_input.buffer.substr(0,w),nodejs_user_input.buffer=nodejs_user_input.buffer.substr(w),y}},nodejs_user_output={put:function(w,D){return process.stdout.write(w),!0},flush:function(){return!0}};var t;Array.prototype.indexOf?t=function(w,D){return w.indexOf(D)}:t=function(w,D){for(var y=w.length,F=0;F<y;F++)if(D===w[F])return F;return-1};var r=function(w,D){if(w.length!==0){for(var y=w[0],F=w.length,z=1;z<F;z++)y=D(y,w[z]);return y}},s;Array.prototype.map?s=function(w,D){return w.map(D)}:s=function(w,D){for(var y=[],F=w.length,z=0;z<F;z++)y.push(D(w[z]));return y};var a;Array.prototype.filter?a=function(w,D){return w.filter(D)}:a=function(w,D){for(var y=[],F=w.length,z=0;z<F;z++)D(w[z])&&y.push(w[z]);return y};var n;String.prototype.codePointAt?n=function(w,D){return w.codePointAt(D)}:n=function(w,D){return w.charCodeAt(D)};var c;String.fromCodePoint?c=function(){return String.fromCodePoint.apply(null,arguments)}:c=function(){return String.fromCharCode.apply(null,arguments)};var f=0,p=1,h=/(\\a)|(\\b)|(\\f)|(\\n)|(\\r)|(\\t)|(\\v)|\\x([0-9a-fA-F]+)\\|\\([0-7]+)\\|(\\\\)|(\\')|('')|(\\")|(\\`)|(\\.)|(.)/g,E={"\\a":7,"\\b":8,"\\f":12,"\\n":10,"\\r":13,"\\t":9,"\\v":11};function C(w){var D=[],y=!1;return w.replace(h,function(F,z,X,ee,se,xe,Fe,ut,Ct,Yt,ir,Pt,mn,Pr,Cr,Lr,on){switch(!0){case Ct!==void 0:return D.push(parseInt(Ct,16)),"";case Yt!==void 0:return D.push(parseInt(Yt,8)),"";case ir!==void 0:case Pt!==void 0:case mn!==void 0:case Pr!==void 0:case Cr!==void 0:return D.push(n(F.substr(1),0)),"";case on!==void 0:return D.push(n(on,0)),"";case Lr!==void 0:y=!0;default:return D.push(E[F]),""}}),y?null:D}function S(w,D){var y="";if(w.length<2)return w;try{w=w.replace(/\\([0-7]+)\\/g,function(ee,se){return c(parseInt(se,8))}),w=w.replace(/\\x([0-9a-fA-F]+)\\/g,function(ee,se){return c(parseInt(se,16))})}catch{return null}for(var F=0;F<w.length;F++){var z=w.charAt(F),X=w.charAt(F+1);if(z===D&&X===D)F++,y+=D;else if(z==="\\")if(["a","b","f","n","r","t","v","'",'"',"\\","a","\b","\f",`
`,"\r"," ","\v"].indexOf(X)!==-1)switch(F+=1,X){case"a":y+="a";break;case"b":y+="\b";break;case"f":y+="\f";break;case"n":y+=`
`;break;case"r":y+="\r";break;case"t":y+=" ";break;case"v":y+="\v";break;case"'":y+="'";break;case'"':y+='"';break;case"\\":y+="\\";break}else return null;else y+=z}return y}function x(w){for(var D="",y=0;y<w.length;y++)switch(w.charAt(y)){case"'":D+="\\'";break;case"\\":D+="\\\\";break;case"\b":D+="\\b";break;case"\f":D+="\\f";break;case`
`:D+="\\n";break;case"\r":D+="\\r";break;case" ":D+="\\t";break;case"\v":D+="\\v";break;default:D+=w.charAt(y);break}return D}function I(w){var D=w.substr(2);switch(w.substr(0,2).toLowerCase()){case"0x":return parseInt(D,16);case"0b":return parseInt(D,2);case"0o":return parseInt(D,8);case"0'":return C(D)[0];default:return parseFloat(w)}}var T={whitespace:/^\s*(?:(?:%.*)|(?:\/\*(?:\n|\r|.)*?\*\/)|(?:\s+))\s*/,variable:/^(?:[A-Z_][a-zA-Z0-9_]*)/,atom:/^(\!|,|;|[a-z][0-9a-zA-Z_]*|[#\$\&\*\+\-\.\/\:\<\=\>\?\@\^\~\\]+|'(?:[^']*?(?:\\(?:x?\d+)?\\)*(?:'')*(?:\\')*)*')/,number:/^(?:0o[0-7]+|0x[0-9a-fA-F]+|0b[01]+|0'(?:''|\\[abfnrtv\\'"`]|\\x?\d+\\|[^\\])|\d+(?:\.\d+(?:[eE][+-]?\d+)?)?)/,string:/^(?:"([^"]|""|\\")*"|`([^`]|``|\\`)*`)/,l_brace:/^(?:\[)/,r_brace:/^(?:\])/,l_bracket:/^(?:\{)/,r_bracket:/^(?:\})/,bar:/^(?:\|)/,l_paren:/^(?:\()/,r_paren:/^(?:\))/};function O(w,D){return w.get_flag("char_conversion").id==="on"?D.replace(/./g,function(y){return w.get_char_conversion(y)}):D}function U(w){this.thread=w,this.text="",this.tokens=[]}U.prototype.set_last_tokens=function(w){return this.tokens=w},U.prototype.new_text=function(w){this.text=w,this.tokens=[]},U.prototype.get_tokens=function(w){var D,y=0,F=0,z=0,X=[],ee=!1;if(w){var se=this.tokens[w-1];y=se.len,D=O(this.thread,this.text.substr(se.len)),F=se.line,z=se.start}else D=this.text;if(/^\s*$/.test(D))return null;for(;D!=="";){var xe=[],Fe=!1;if(/^\n/.exec(D)!==null){F++,z=0,y++,D=D.replace(/\n/,""),ee=!0;continue}for(var ut in T)if(T.hasOwnProperty(ut)){var Ct=T[ut].exec(D);Ct&&xe.push({value:Ct[0],name:ut,matches:Ct})}if(!xe.length)return this.set_last_tokens([{value:D,matches:[],name:"lexical",line:F,start:z}]);var se=r(xe,function(Pr,Cr){return Pr.value.length>=Cr.value.length?Pr:Cr});switch(se.start=z,se.line=F,D=D.replace(se.value,""),z+=se.value.length,y+=se.value.length,se.name){case"atom":se.raw=se.value,se.value.charAt(0)==="'"&&(se.value=S(se.value.substr(1,se.value.length-2),"'"),se.value===null&&(se.name="lexical",se.value="unknown escape sequence"));break;case"number":se.float=se.value.substring(0,2)!=="0x"&&se.value.match(/[.eE]/)!==null&&se.value!=="0'.",se.value=I(se.value),se.blank=Fe;break;case"string":var Yt=se.value.charAt(0);se.value=S(se.value.substr(1,se.value.length-2),Yt),se.value===null&&(se.name="lexical",se.value="unknown escape sequence");break;case"whitespace":var ir=X[X.length-1];ir&&(ir.space=!0),Fe=!0;continue;case"r_bracket":X.length>0&&X[X.length-1].name==="l_bracket"&&(se=X.pop(),se.name="atom",se.value="{}",se.raw="{}",se.space=!1);break;case"r_brace":X.length>0&&X[X.length-1].name==="l_brace"&&(se=X.pop(),se.name="atom",se.value="[]",se.raw="[]",se.space=!1);break}se.len=y,X.push(se),Fe=!1}var Pt=this.set_last_tokens(X);return Pt.length===0?null:Pt};function V(w,D,y,F,z){if(!D[y])return{type:f,value:P.error.syntax(D[y-1],"expression expected",!0)};var X;if(F==="0"){var ee=D[y];switch(ee.name){case"number":return{type:p,len:y+1,value:new P.type.Num(ee.value,ee.float)};case"variable":return{type:p,len:y+1,value:new P.type.Var(ee.value)};case"string":var se;switch(w.get_flag("double_quotes").id){case"atom":se=new _(ee.value,[]);break;case"codes":se=new _("[]",[]);for(var xe=ee.value.length-1;xe>=0;xe--)se=new _(".",[new P.type.Num(n(ee.value,xe),!1),se]);break;case"chars":se=new _("[]",[]);for(var xe=ee.value.length-1;xe>=0;xe--)se=new _(".",[new P.type.Term(ee.value.charAt(xe),[]),se]);break}return{type:p,len:y+1,value:se};case"l_paren":var Pt=V(w,D,y+1,w.__get_max_priority(),!0);return Pt.type!==p?Pt:D[Pt.len]&&D[Pt.len].name==="r_paren"?(Pt.len++,Pt):{type:f,derived:!0,value:P.error.syntax(D[Pt.len]?D[Pt.len]:D[Pt.len-1],") or operator expected",!D[Pt.len])};case"l_bracket":var Pt=V(w,D,y+1,w.__get_max_priority(),!0);return Pt.type!==p?Pt:D[Pt.len]&&D[Pt.len].name==="r_bracket"?(Pt.len++,Pt.value=new _("{}",[Pt.value]),Pt):{type:f,derived:!0,value:P.error.syntax(D[Pt.len]?D[Pt.len]:D[Pt.len-1],"} or operator expected",!D[Pt.len])}}var Fe=$(w,D,y,z);return Fe.type===p||Fe.derived||(Fe=ie(w,D,y),Fe.type===p||Fe.derived)?Fe:{type:f,derived:!1,value:P.error.syntax(D[y],"unexpected token")}}var ut=w.__get_max_priority(),Ct=w.__get_next_priority(F),Yt=y;if(D[y].name==="atom"&&D[y+1]&&(D[y].space||D[y+1].name!=="l_paren")){var ee=D[y++],ir=w.__lookup_operator_classes(F,ee.value);if(ir&&ir.indexOf("fy")>-1){var Pt=V(w,D,y,F,z);if(Pt.type!==f)return ee.value==="-"&&!ee.space&&P.type.is_number(Pt.value)?{value:new P.type.Num(-Pt.value.value,Pt.value.is_float),len:Pt.len,type:p}:{value:new P.type.Term(ee.value,[Pt.value]),len:Pt.len,type:p};X=Pt}else if(ir&&ir.indexOf("fx")>-1){var Pt=V(w,D,y,Ct,z);if(Pt.type!==f)return{value:new P.type.Term(ee.value,[Pt.value]),len:Pt.len,type:p};X=Pt}}y=Yt;var Pt=V(w,D,y,Ct,z);if(Pt.type===p){y=Pt.len;var ee=D[y];if(D[y]&&(D[y].name==="atom"&&w.__lookup_operator_classes(F,ee.value)||D[y].name==="bar"&&w.__lookup_operator_classes(F,"|"))){var mn=Ct,Pr=F,ir=w.__lookup_operator_classes(F,ee.value);ifLine truncated
`;D+=`
`;for(key in this.rules)for(y=0;y<this.rules[key].length;y++)D+=this.rules[key][y].toString(w),D+=`
`;return D},be.prototype.clone=function(){return new be(this.id)},Qe.prototype.clone=function(){return new Qe(this.value,this.is_float)},_.prototype.clone=function(){return new _(this.id,s(this.args,function(w){return w.clone()}))},Ne.prototype.clone=function(){return new Stram(this.stream,this.mode,this.alias,this.type,this.reposition,this.eof_action)},ke.prototype.clone=function(){var w={};for(var D in this.links)this.links.hasOwnProperty(D)&&(w[D]=this.links[D].clone());return new ke(w)},De.prototype.clone=function(){return new De(this.goal.clone(),this.substitution.clone(),this.parent)},je.prototype.clone=function(){return new je(this.head.clone(),this.body!==null?this.body.clone():null)},be.prototype.equals=function(w){return P.type.is_variable(w)&&this.id===w.id},Qe.prototype.equals=function(w){return P.type.is_number(w)&&this.value===w.value&&this.is_float===w.is_float},_.prototype.equals=function(w){if(!P.type.is_term(w)||this.indicator!==w.indicator)return!1;for(var D=0;D<this.args.length;D++)if(!this.args[D].equals(w.args[D]))return!1;return!0},Ne.prototype.equals=function(w){return P.type.is_stream(w)&&this.id===w.id},ke.prototype.equals=function(w){var D;if(!P.type.is_substitution(w))return!1;for(D in this.links)if(this.links.hasOwnProperty(D)&&(!w.links[D]||!this.links[D].equals(w.links[D])))return!1;for(D in w.links)if(w.links.hasOwnProperty(D)&&!this.links[D])return!1;return!0},De.prototype.equals=function(w){return P.type.is_state(w)&&this.goal.equals(w.goal)&&this.substitution.equals(w.substitution)&&this.parent===w.parent},je.prototype.equals=function(w){return P.type.is_rule(w)&&this.head.equals(w.head)&&(this.body===null&&w.body===null||this.body!==null&&this.body.equals(w.body))},be.prototype.rename=function(w){return w.get_free_variable(this)},Qe.prototype.rename=function(w){return this},_.prototype.rename=function(w){return new _(this.id,s(this.args,function(D){return D.rename(w)}))},Ne.prototype.rename=function(w){return this},je.prototype.rename=function(w){return new je(this.head.rename(w),this.body!==null?this.body.rename(w):null)},be.prototype.variables=function(){return[this.id]},Qe.prototype.variables=function(){return[]},_.prototype.variables=function(){return[].concat.apply([],s(this.args,function(w){return w.variables()}))},Ne.prototype.variables=function(){return[]},je.prototype.variables=function(){return this.body===null?this.head.variables():this.head.variables().concat(this.body.variables())},be.prototype.apply=function(w){return w.lookup(this.id)?w.lookup(this.id):this},Qe.prototype.apply=function(w){return this},_.prototype.apply=function(w){if(this.indicator==="./2"){for(var D=[],y=this;y.indicator==="./2";)D.push(y.args[0].apply(w)),y=y.args[1];for(var F=y.apply(w),z=D.length-1;z>=0;z--)F=new _(".",[D[z],F]);return F}return new _(this.id,s(this.args,function(X){return X.apply(w)}),this.ref)},Ne.prototype.apply=function(w){return this},je.prototype.apply=function(w){return new je(this.head.apply(w),this.body!==null?this.body.apply(w):null)},ke.prototype.apply=function(w){var D,y={};for(D in this.links)this.links.hasOwnProperty(D)&&(y[D]=this.links[D].apply(w));return new ke(y)},_.prototype.select=function(){for(var w=this;w.indicator===",/2";)w=w.args[0];return w},_.prototype.replace=function(w){return this.indicator===",/2"?this.args[0].indicator===",/2"?new _(",",[this.args[0].replace(w),this.args[1]]):w===null?this.args[1]:new _(",",[w,this.args[1]]):w},_.prototype.search=function(w){if(P.type.is_term(w)&&w.ref!==void 0&&this.ref===w.ref)return!0;for(var D=0;D<this.args.length;D++)if(P.type.is_term(this.args[D])&&this.args[D].search(w))return!0;return!1},Re.prototype.get_current_input=function(){return this.current_input},ct.prototype.get_current_input=function(){return this.session.get_current_input()},Re.prototype.get_current_output=function(){return this.current_output},ct.prototype.get_current_output=function(){return this.session.get_current_output()},Re.prototype.set_current_input=function(w){this.current_input=w},ct.prototype.set_current_input=function(w){return this.session.set_current_input(w)},Re.prototype.set_current_output=function(w){this.current_input=w},ct.prototype.set_current_output=function(w){return this.session.set_current_output(w)},Re.prototype.get_stream_by_alias=function(w){return this.streams[w]},ct.prototype.get_stream_by_alias=function(w){return this.session.get_stream_by_alias(w)},Re.prototype.file_system_open=function(w,D,y){return this.file_system.open(w,D,y)},ct.prototype.file_system_open=function(w,D,y){return this.session.file_system_open(w,D,y)},Re.prototype.get_char_conversion=function(w){return this.__char_conversion[w]||w},ct.prototype.get_char_conversion=function(w){return this.session.get_char_conversion(w)},Re.prototype.parse=function(w){return this.thread.parse(w)},ct.prototype.parse=function(w){var D=new U(this);D.new_text(w);var y=D.get_tokens();if(y===null)return!1;var F=V(this,y,0,this.__get_max_priority(),!1);return F Line truncated
`,[])])])),D.substitution,D)])},"nl/1":function(w,D,y){var F=y.args[0];w.prepend([new De(D.goal.replace(new _("put_char",[F,new _(`
`,[])])),D.substitution,D)])},"get_byte/1":function(w,D,y){var F=y.args[0];w.prepend([new De(D.goal.replace(new _(",",[new _("current_input",[new be("S")]),new _("get_byte",[new be("S"),F])])),D.substitution,D)])},"get_byte/2":function(w,D,y){var F=y.args[0],z=y.args[1],X=P.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(P.type.is_variable(F))w.throw_error(P.error.instantiation(y.indicator));else if(!P.type.is_variable(z)&&!P.type.is_byte(z))w.throw_error(P.error.type("in_byte",char,y.indicator));else if(!P.type.is_stream(F)&&!P.type.is_atom(F))w.throw_error(P.error.domain("stream_or_alias",F,y.indicator));else if(!P.type.is_stream(X)||X.stream===null)w.throw_error(P.error.existence("stream",F,y.indicator));else if(X.output)w.throw_error(P.error.permission("input","stream",F,y.indicator));else if(X.type==="text")w.throw_error(P.error.permission("input","text_stream",F,y.indicator));else if(X.position==="past_end_of_stream"&&X.eof_action==="error")w.throw_error(P.error.permission("input","past_end_of_stream",F,y.indicator));else{var ee;if(X.position==="end_of_stream")ee="end_of_file",X.position="past_end_of_stream";else{if(ee=X.stream.get_byte(X.position),ee===null){w.throw_error(P.error.representation("byte",y.indicator));return}X.position++}w.prepend([new De(D.goal.replace(new _("=",[new Qe(ee,!1),z])),D.substitution,D)])}},"peek_byte/1":function(w,D,y){var F=y.args[0];w.prepend([new De(D.goal.replace(new _(",",[new _("current_input",[new be("S")]),new _("peek_byte",[new be("S"),F])])),D.substitution,D)])},"peek_byte/2":function(w,D,y){var F=y.args[0],z=y.args[1],X=P.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(P.type.is_variable(F))w.throw_error(P.error.instantiation(y.indicator));else if(!P.type.is_variable(z)&&!P.type.is_byte(z))w.throw_error(P.error.type("in_byte",char,y.indicator));else if(!P.type.is_stream(F)&&!P.type.is_atom(F))w.throw_error(P.error.domain("stream_or_alias",F,y.indicator));else if(!P.type.is_stream(X)||X.stream===null)w.throw_error(P.error.existence("stream",F,y.indicator));else if(X.output)w.throw_error(P.error.permission("input","stream",F,y.indicator));else if(X.type==="text")w.throw_error(P.error.permission("input","text_stream",F,y.indicator));else if(X.position==="past_end_of_stream"&&X.eof_action==="error")w.throw_error(P.error.permission("input","past_end_of_stream",F,y.indicator));else{var ee;if(X.position==="end_of_stream")ee="end_of_file",X.position="past_end_of_stream";else if(ee=X.stream.get_byte(X.position),ee===null){w.throw_error(P.error.representation("byte",y.indicator));return}w.prepend([new De(D.goal.replace(new _("=",[new Qe(ee,!1),z])),D.substitution,D)])}},"put_byte/1":function(w,D,y){var F=y.args[0];w.prepend([new De(D.goal.replace(new _(",",[new _("current_output",[new be("S")]),new _("put_byte",[new be("S"),F])])),D.substitution,D)])},"put_byte/2":function(w,D,y){var F=y.args[0],z=y.args[1],X=P.type.is_stream(F)?F:w.get_stream_by_alias(F.id);P.type.is_variable(F)||P.type.is_variable(z)?w.throw_error(P.error.instantiation(y.indicator)):P.type.is_byte(z)?!P.type.is_variable(F)&&!P.type.is_stream(F)&&!P.type.is_atom(F)?w.throw_error(P.error.domain("stream_or_alias",F,y.indicator)):!P.type.is_stream(X)||X.stream===null?w.throw_error(P.error.existence("stream",F,y.indicator)):X.input?w.throw_error(P.error.permission("output","stream",F,y.indicator)):X.type==="text"?w.throw_error(P.error.permission("output","text_stream",F,y.indicator)):X.stream.put_byte(z.value,X.position)&&(typeof X.position=="number"&&X.position++,w.success(D)):w.throw_error(P.error.type("byte",z,y.indicator))},"read/1":function(w,D,y){var F=y.args[0];w.prepend([new De(D.goal.replace(new _(",",[new _("current_input",[new be("S")]),new _("read_term",[new be("S"),F,new _("[]",[])])])),D.substitution,D)])},"read/2":function(w,D,y){var F=y.args[0],z=y.args[1];w.prepend([new De(D.goal.replace(new _("read_term",[F,z,new _("[]",[])])),D.substitution,D)])},"read_term/2":function(w,D,y){var F=y.args[0],z=y.args[1];w.prepend([new De(D.goal.replace(new _(",",[new _("current_input",[new be("S")]),new _("read_term",[new be("S"),F,z])])),D.substitution,D)])},"read_term/3":function(w,D,y){var F=y.args[0],z=y.args[1],X=y.args[2],ee=P.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(P.type.is_variable(F)||P.type.is_variable(X))w.throw_error(P.error.instantiation(y.indicator));else if(!P.type.is_list(X))w.throw_error(P.error.type("list",X,y.indicator));else if(!P.type.is_stream(F)&&!P.type.is_atom(F))w.throw_error(P.error.domain("stream_or_alias",F,y.indicator));else if(!P.type.is_stream(ee)||ee.stream===null)w.throw_error(P.error.existence("stream",F,y.indicator));else if(ee.output)w.throw_error(P.error.permission("input","stream",F,y.indicator));else if(ee.type==="binary")w.throw_error(P.error.permission("input","binary_stream",F,y.indicator));else if(ee.position==="past_end_of_stream"&&ee.eof_action==="error")w.throw_error(P.error.permission("input","past_end_of_stream",F,y.indicator));else{for(v Line truncated
`;for(let r of this.project.workspacesByCwd.values()){let s=r.relativeCwd;t+=`workspace(${z0(s)}).
`,t+=`workspace_ident(${z0(s)}, ${z0(j.stringifyIdent(r.anchoredLocator))}).
`,t+=`workspace_version(${z0(s)}, ${z0(r.manifest.version)}).
`;for(let a of yme)for(let n of r.manifest[a].values())t+=`workspace_has_dependency(${z0(s)}, ${z0(j.stringifyIdent(n))}, ${z0(n.range)}, ${a}).
`}return t+=`workspace(_) :- false.
`,t+=`workspace_ident(_, _) :- false.
`,t+=`workspace_version(_, _) :- false.
`,t+=`workspace_has_dependency(_, _, _, _) :- false.
`,t}getDeclarations(){let t="";return t+=`gen_enforced_dependency(_, _, _, _) :- false.
`,t+=`gen_enforced_field(_, _, _) :- false.
`,t}get fullSource(){return`${this.getProjectDatabase()}
${this.source}
${this.getDeclarations()}`}createSession(){return new a9(this.project,this.fullSource)}async processClassic(){let t=this.createSession();return{enforcedDependencies:await this.genEnforcedDependencies(t),enforcedFields:await this.genEnforcedFields(t)}}async process(){let{enforcedDependencies:t,enforcedFields:r}=await this.processClassic(),s=new Map;for(let{workspace:a,dependencyIdent:n,dependencyRange:c,dependencyType:f}of t){let p=aS([f,j.stringifyIdent(n)]),h=qe.getMapWithDefault(s,a.cwd);qe.getMapWithDefault(h,p).set(c??void 0,new Set)}for(let{workspace:a,fieldPath:n,fieldValue:c}of r){let f=aS(n),p=qe.getMapWithDefault(s,a.cwd);qe.getMapWithDefault(p,f).set(JSON.parse(c)??void 0,new Set)}return{manifestUpdates:s,reportedErrors:new Map}}async genEnforcedDependencies(t){let r=[];for await(let s of t.makeQuery("workspace(WorkspaceCwd), dependency_type(DependencyType), gen_enforced_dependency(WorkspaceCwd, DependencyIdent, DependencyRange, DependencyType).")){let a=K.resolve(this.project.cwd,Fm(s.links.WorkspaceCwd)),n=Fm(s.links.DependencyIdent),c=Fm(s.links.DependencyRange),f=Fm(s.links.DependencyType);if(a===null||n===null)throw new Error("Invalid rule");let p=this.project.getWorkspaceByCwd(a),h=j.parseIdent(n);r.push({workspace:p,dependencyIdent:h,dependencyRange:c,dependencyType:f})}return qe.sortMap(r,[({dependencyRange:s})=>s!==null?"0":"1",({workspace:s})=>j.stringifyIdent(s.anchoredLocator),({dependencyIdent:s})=>j.stringifyIdent(s)])}async genEnforcedFields(t){let r=[];for await(let s of t.makeQuery("workspace(WorkspaceCwd), gen_enforced_field(WorkspaceCwd, FieldPath, FieldValue).")){let a=K.resolve(this.project.cwd,Fm(s.links.WorkspaceCwd)),n=Fm(s.links.FieldPath),c=Eat(s.links.FieldValue);if(a===null||n===null)throw new Error("Invalid rule");let f=this.project.getWorkspaceByCwd(a);r.push({workspace:f,fieldPath:n,fieldValue:c})}return qe.sortMap(r,[({workspace:s})=>j.stringifyIdent(s.anchoredLocator),({fieldPath:s})=>s])}async*query(t){let r=this.createSession();for await(let s of r.makeQuery(t)){let a={};for(let[n,c]of Object.entries(s.links))n!=="_"&&(a[n]=Fm(c));yield a}}}});var kme=G(ZT=>{"use strict";Object.defineProperty(ZT,"__esModule",{value:!0});function DS(e){let t=[...e.caches],r=t.shift();return r===void 0?xme():{get(s,a,n={miss:()=>Promise.resolve()}){return r.get(s,a,n).catch(()=>DS({caches:t}).get(s,a,n))},set(s,a){return r.set(s,a).catch(()=>DS({caches:t}).set(s,a))},delete(s){return r.delete(s).catch(()=>DS({caches:t}).delete(s))},clear(){return r.clear().catch(()=>DS({caches:t}).clear())}}}function xme(){return{get(e,t,r={miss:()=>Promise.resolve()}){return t().then(a=>Promise.all([a,r.miss(a)])).then(([a])=>a)},set(e,t){return Promise.resolve(t)},delete(e){return Promise.resolve()},clear(){return Promise.resolve()}}}ZT.createFallbackableCache=DS;ZT.createNullCache=xme});var Rme=G((MWt,Qme)=>{Qme.exports=kme()});var Tme=G(w9=>{"use strict";Object.defineProperty(w9,"__esModule",{value:!0});function Mat(e={serializable:!0}){let t={};return{get(r,s,a={miss:()=>Promise.resolve()}){let n=JSON.stringify(r);if(n in t)return Promise.resolve(e.serializable?JSON.parse(t[n]):t[n]);let c=s(),f=a&&a.miss||(()=>Promise.resolve());return c.then(p=>f(p)).then(()=>c)},set(r,s){return t[JSON.stringify(r)]=e.serializable?JSON.stringify(s):s,Promise.resolve(s)},delete(r){return delete t[JSON.stringify(r)],Promise.resolve()},clear(){return t={},Promise.resolve()}}}w9.createInMemoryCache=Mat});var Nme=G((_Wt,Fme)=>{Fme.exports=Tme()});var Lme=G(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});function Uat(e,t,r){let s={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers(){return e===B9.WithinHeaders?s:{}},queryParameters(){return e===B9.WithinQueryParameters?s:{}}}}function _at(e){let t=0,r=()=>(t++,new Promise(s=>{setTimeout(()=>{s(e(r))},Math.min(100*t,1e3))}));return e(r)}function Ome(e,t=(r,s)=>Promise.resolve()){return Object.assign(e,{wait(r){return Ome(e.then(s=>Promise.all([t(s,r),s])).then(s=>s[1]))}})}function Hat(e){let t=e.length-1;for(t;t>0;t--){let r=Math.floor(Math.random()*(t+1)),s=e[t];e[t]=e[r],e[r]=s}return e}function jat(e,t){return t&&Object.keys(t).forEach(r=>{e[r]=t[r](e)}),e}function Gat(e,...t){let r=0;return e.replace(/%s/g,()=>encodeURIComponent(t[r++]))}var qat="4.22.1",Yat=e=>()=>e.transporter.requester.destroy(),B9={WithinQueryParameters:0,WithinHeaders:1};rf.AuthMode=B9;rf.addMethods=jat;rf.createAuth=Uat;rf.createRetryablePromise=_at;rf.createWaitablePromise=Ome;rf.destroy=Yat;rf.encode=Gat;rf.shuffle=Hat;rf.version=qat});var PS=G((jWt,Mme)=>{Mme.exports=Lme()});var Ume=G(v9=>{"use strict";Object.defineProperty(v9,"__esModule",{value:!0});var Wat={Delete:"DELETE",Get:"GET",Post:"POST",Put:"PUT"};v9.MethodEnum=Wat});var xS=G((qWt,_me)=>{_me.exports=Ume()});var tye=G(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});var jme=xS();function S9(e,t){let r=e||{},s=r.data||{};return Object.keys(r).forEach(a=>{["timeout","head Line truncated
`;f!==s&&(s=f,e.write(ZEe.default.eraseLines(r)+f),r=f.split(`
`).length)};return n.clear=()=>{e.write(ZEe.default.eraseLines(r)),s="",r=0},n.done=()=>{s="",r=0,t||($Ee.default.show(),a=!1)},n};HS.default={create:_ut}});var rIe=G((RVt,Hut)=>{Hut.exports=[{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI",pr:"SYSTEM_PULLREQUEST_PULLREQUESTID"},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY_BUILD_BASE",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Shippable",constant:"SHIPPABLE",env:"SHIPPABLE",pr:{IS_PULL_REQUEST:"true"}},{name:"Solano CI",constant:"SOLANO",env:"TDDIUM",pr:"TDDIUM_PR_ID"},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}}]});var sIe=G(ic=>{"use strict";var iIe=rIe(),pA=process.env;Object.defineProperty(ic,"_vendors",{value:iIe.map(function(e){return e.constant})});ic.name=null;ic.isPR=null;iIe.forEach(function(e){var t=Array.isArray(e.env)?e.env:[e.env],r=t.every(function(s){return nIe(s)});if(ic[e.constant]=r,r)switch(ic.name=e.name,typeof e.pr){case"string":ic.isPR=!!pA[e.pr];break;case"object":"env"in e.pr?ic.isPR=e.pr.env in pA&&pA[e.pr.env]!==e.pr.ne:"any"in e.pr?ic.isPR=e.pr.any.some(function(s){return!!pA[s]}):ic.isPR=nIe(e.pr);break;default:ic.isPR=null}});ic.isCI=!!(pA.CI||pA.CONTINUOUS_INTEGRATION||pA.BUILD_NUMBER||pA.RUN_ID||ic.name);function nIe(e){return typeof e=="string"?!!pA[e]:Object.keys(e).every(function(t){return pA[t]===e[t]})}});var aIe=G((FVt,oIe)=>{"use strict";oIe.exports=sIe().isCI});var cIe=G((NVt,lIe)=>{"use strict";var jut=e=>{let t=new Set;do for(let r of Reflect.ownKeys(e))t.add([e,r]);while((e=Reflect.getPrototypeOf(e))&&e!==Object.prototype);return t};lIe.exports=(e,{include:t,exclude:r}={})=>{let s=a=>{let n=c=>typeof c=="string"?a===c:c.test(a);return t?t.some(n):r?!r.some(n):!0};for(let[a,n]of jut(e.constructor.prototype)){if(n==="constructor"||!s(n))continue;let c=Reflect.getOwnPropertyDescriptor(a,n);c&&typeof c.value=="function"&&(e[n]=e[n].bind(e))}return e}});var dIe=G(zn=>{"use strict";var uw,qS,yF,uq;typeof performance=="object"&&typeof performance.now=="function"?(uIe=performance,zn.unstable_now=function(){return uIe.now()}):(iq=Date,fIe=iq.now(),zn.unstable_now=function(){return iq.now()-fIe});var uIe,iq,fIe;typeof window>"u"||typeof MessageChannel!="function"?(cw=null,sq=null,oq=function(){if(cw!==null)try{var e=zn.unstable_now();cw(!0,e),cw=null}catch(t){throw setTimeout(oq,0),t}},uw=function(e){cw!==null?setTimeout(uw,0,e):(cw=e,setTimeout(oq,0))},qS=function(e,t){sq=setTimeout(e,t)},yF=function(){clearTimeout(sq)},zn.unstable_shouldYield=function(){return!1},uq=zn.unstable_forceFrameRate=function(){}):(AIe=window.setTimeout,pIe=window.clearTimeout,typeof console<"u"&&(hIe=window.cancelAnimationFrame,typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof hIe!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")),jS=!1,GS=null,dF=-1,aq=5,lq=0,zn.unstable_shouldYield=function(){return zn.unstable_now()>=lq},uq=function(){},zn.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):aq=0<e?Math Line truncated
`+uu+v}var we=!1;function Ot(v,b){if(!v||we)return"";we=!0;var Q=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(b)if(b=function(){throw Error()},Object.defineProperty(b.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(b,[])}catch(ht){var H=ht}Reflect.construct(v,[],b)}else{try{b.call()}catch(ht){H=ht}v.call(b.prototype)}else{try{throw Error()}catch(ht){H=ht}v()}}catch(ht){if(ht&&H&&typeof ht.stack=="string"){for(var W=ht.stack.split(`
`),ne=H.stack.split(`
`),ve=W.length-1,_e=ne.length-1;1<=ve&&0<=_e&&W[ve]!==ne[_e];)_e--;for(;1<=ve&&0<=_e;ve--,_e--)if(W[ve]!==ne[_e]){if(ve!==1||_e!==1)do if(ve--,_e--,0>_e||W[ve]!==ne[_e])return`
`+W[ve].replace(" at new "," at ");while(1<=ve&&0<=_e);break}}}finally{we=!1,Error.prepareStackTrace=Q}return(v=v?v.displayName||v.name:"")?cc(v):""}var uc=[],Oi=-1;function fo(v){return{current:v}}function Tt(v){0>Oi||(v.current=uc[Oi],uc[Oi]=null,Oi--)}function Rn(v,b){Oi++,uc[Oi]=v.current,v.current=b}var ha={},Gi=fo(ha),Li=fo(!1),Ya=ha;function yn(v,b){var Q=v.type.contextTypes;if(!Q)return ha;var H=v.stateNode;if(H&&H.__reactInternalMemoizedUnmaskedChildContext===b)return H.__reactInternalMemoizedMaskedChildContext;var W={},ne;for(ne in Q)W[ne]=b[ne];return H&&(v=v.stateNode,v.__reactInternalMemoizedUnmaskedChildContext=b,v.__reactInternalMemoizedMaskedChildContext=W),W}function Zn(v){return v=v.childContextTypes,v!=null}function fu(){Tt(Li),Tt(Gi)}function Eh(v,b,Q){if(Gi.current!==ha)throw Error(c(168));Rn(Gi,b),Rn(Li,Q)}function Wa(v,b,Q){var H=v.stateNode;if(v=b.childContextTypes,typeof H.getChildContext!="function")return Q;H=H.getChildContext();for(var W in H)if(!(W in v))throw Error(c(108,d(b)||"Unknown",W));return s({},Q,H)}function Va(v){return v=(v=v.stateNode)&&v.__reactInternalMemoizedMergedChildContext||ha,Ya=Gi.current,Rn(Gi,v),Rn(Li,Li.current),!0}function Ka(v,b,Q){var H=v.stateNode;if(!H)throw Error(c(169));Q?(v=Wa(v,b,Ya),H.__reactInternalMemoizedMergedChildContext=v,Tt(Li),Tt(Gi),Rn(Gi,v)):Tt(Li),Rn(Li,Q)}var $e=null,Ja=null,mf=n.unstable_now;mf();var fc=0,Sn=8;function da(v){if(1&v)return Sn=15,1;if(2&v)return Sn=14,2;if(4&v)return Sn=13,4;var b=24&v;return b!==0?(Sn=12,b):v&32?(Sn=11,32):(b=192&v,b!==0?(Sn=10,b):v&256?(Sn=9,256):(b=3584&v,b!==0?(Sn=8,b):v&4096?(Sn=7,4096):(b=4186112&v,b!==0?(Sn=6,b):(b=62914560&v,b!==0?(Sn=5,b):v&67108864?(Sn=4,67108864):v&134217728?(Sn=3,134217728):(b=805306368&v,b!==0?(Sn=2,b):1073741824&v?(Sn=1,1073741824):(Sn=8,v))))))}function _A(v){switch(v){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}function HA(v){switch(v){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(c(358,v))}}function ga(v,b){var Q=v.pendingLanes;if(Q===0)return Sn=0;var H=0,W=0,ne=v.expiredLanes,ve=v.suspendedLanes,_e=v.pingedLanes;if(ne!==0)H=ne,W=Sn=15;else if(ne=Q&134217727,ne!==0){var ht=ne&~ve;ht!==0?(H=da(ht),W=Sn):(_e&=ne,_e!==0&&(H=da(_e),W=Sn))}else ne=Q&~ve,ne!==0?(H=da(ne),W=Sn):_e!==0&&(H=da(_e),W=Sn);if(H===0)return 0;if(H=31-ss(H),H=Q&((0>H?0:1<<H)<<1)-1,b!==0&&b!==H&&!(b&ve)){if(da(b),W<=Sn)return b;Sn=W}if(b=v.entangledLanes,b!==0)for(v=v.entanglements,b&=H;0<b;)Q=31-ss(b),W=1<<Q,H|=v[Q],b&=~W;return H}function Ql(v){return v=v.pendingLanes&-1073741825,v!==0?v:v&1073741824?1073741824:0}function Ut(v,b){switch(v){case 15:return 1;case 14:return 2;case 12:return v=Tn(24&~b),v===0?Ut(10,b):v;case 10:return v=Tn(192&~b),v===0?Ut(8,b):v;case 8:return v=Tn(3584&~b),v===0&&(v=Tn(4186112&~b),v===0&&(v=512)),v;case 2:return b=Tn(805306368&~b),b===0&&(b=268435456),b}throw Error(c(358,v))}function Tn(v){return v&-v}function ma(v){for(var b=[],Q=0;31>Q;Q++)b.push(v);return b}function za(v,b,Q){v.pendingLanes|=b;var H=b-1;v.suspendedLanes&=H,v.pingedLanes&=H,v=v.eventTimes,b=31-ss(b),v[b]=Q}var ss=Math.clz32?Math.clz32:pc,Ac=Math.log,Au=Math.LN2;function pc(v){return v===0?32:31-(Ac(v)/Au|0)|0}var Xa=n.unstable_runWithPriority,Mi=n.unstable_scheduleCallback,vs=n.unstable_cancelCallback,Rl=n.unstable_shouldYield,yf=n.unstable_requestPaint,hc=n.unstable_now,Bi=n.unstable_getCurrentPriorityLevel,Fn=n.unstable_ImmediatePriority,dc=n.unstable_UserBlockingPriority,ze=n.unstable_NormalPriority,at=n.unstable_LowPriority,St=n.unstable_IdlePriority,lr={},te=yf!==void 0?yf:function(){},ye=null,Oe=null,mt=!1,Et=hc(),Dt=1e4>Et?hc:function(){return hc()-Et};function tr(){switch(Bi()){case Fn:return 99;case dc:return 98;case ze:return 97;case at:return 96;case St:return 95;default:throw Error(c(332))}}function pn(v){switch(v){case 99:return Fn;case 98:return dc;case 97:return ze;case 96:return at;case 95:return St;default:throw Error(c(332))}}function ui(v,b){return v=pn(v),Xa(v,b)}function qi(v,b,Q){return v=pn(v),Mi(v,b,Q)}function Nn(){if(Oe!==null){var v=Oe;Oe=null,vs(v)}Za()}function Za(){if(!mt&&ye!==null){mt=!0;var v=0;try{var b=ye;ui(99,function(){for(;v<b.length;v++){var Q=b[v];do Q=Q(!0);while(Q!==null)}}),ye=null}catch(Q){throw ye!==null&&(ye=ye.slice(v+1)),Mi(Fn,Nn),Q}finally{mt=!1}}}var By=f.ReactCurrentBatchConfig;function J1(v,b){return v===b&&(v!==0||1/v===1/b)||v!==v&&b!==b}var Qo=typeof Object.is=="function"?Object.is:J1,vy=Object.prototype.hasOwnProperty;function Ih(v,b){if(Qo(v,b))return!0;if(typeof v!="object"||v===null||typeof b!="object"||b===null)return!1;var Q=Object.keys(v),H=Object.keys(b);if(Q.length!==H.length)return!1;for(H=0;H<Q.length;H++)if(!vy.call(b,Q[H])||!Qo(v[Q[H]],b[Q[H]]))return!1;return!0}function z1(v){switch(v.tag){case 5:return cc(v.type);case 16:return cc("Lazy" Line truncated
Error generating stack: `+ne.message+`
`+ne.stack}return{value:v,source:b,stack:W}}function Kd(v,b){try{console.error(b.value)}catch(Q){setTimeout(function(){throw Q})}}var RL=typeof WeakMap=="function"?WeakMap:Map;function t2(v,b,Q){Q=Fl(-1,Q),Q.tag=3,Q.payload={element:null};var H=b.value;return Q.callback=function(){Wy||(Wy=!0,d2=H),Kd(v,b)},Q}function Jd(v,b,Q){Q=Fl(-1,Q),Q.tag=3;var H=v.type.getDerivedStateFromError;if(typeof H=="function"){var W=b.value;Q.payload=function(){return Kd(v,b),H(W)}}var ne=v.stateNode;return ne!==null&&typeof ne.componentDidCatch=="function"&&(Q.callback=function(){typeof H!="function"&&(mc===null?mc=new Set([this]):mc.add(this),Kd(v,b));var ve=b.stack;this.componentDidCatch(b.value,{componentStack:ve!==null?ve:""})}),Q}var TL=typeof WeakSet=="function"?WeakSet:Set;function r2(v){var b=v.ref;if(b!==null)if(typeof b=="function")try{b(null)}catch(Q){Rf(v,Q)}else b.current=null}function Ny(v,b){switch(b.tag){case 0:case 11:case 15:case 22:return;case 1:if(b.flags&256&&v!==null){var Q=v.memoizedProps,H=v.memoizedState;v=b.stateNode,b=v.getSnapshotBeforeUpdate(b.elementType===b.type?Q:Ro(b.type,Q),H),v.__reactInternalSnapshotBeforeUpdate=b}return;case 3:F&&b.flags&256&&Ns(b.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(c(163))}function Th(v,b){if(b=b.updateQueue,b=b!==null?b.lastEffect:null,b!==null){var Q=b=b.next;do{if((Q.tag&v)===v){var H=Q.destroy;Q.destroy=void 0,H!==void 0&&H()}Q=Q.next}while(Q!==b)}}function hP(v,b,Q){switch(Q.tag){case 0:case 11:case 15:case 22:if(b=Q.updateQueue,b=b!==null?b.lastEffect:null,b!==null){v=b=b.next;do{if((v.tag&3)===3){var H=v.create;v.destroy=H()}v=v.next}while(v!==b)}if(b=Q.updateQueue,b=b!==null?b.lastEffect:null,b!==null){v=b=b.next;do{var W=v;H=W.next,W=W.tag,W&4&&W&1&&(PP(Q,v),jL(Q,v)),v=H}while(v!==b)}return;case 1:v=Q.stateNode,Q.flags&4&&(b===null?v.componentDidMount():(H=Q.elementType===Q.type?b.memoizedProps:Ro(Q.type,b.memoizedProps),v.componentDidUpdate(H,b.memoizedState,v.__reactInternalSnapshotBeforeUpdate))),b=Q.updateQueue,b!==null&&Dy(Q,b,v);return;case 3:if(b=Q.updateQueue,b!==null){if(v=null,Q.child!==null)switch(Q.child.tag){case 5:v=Qe(Q.child.stateNode);break;case 1:v=Q.child.stateNode}Dy(Q,b,v)}return;case 5:v=Q.stateNode,b===null&&Q.flags&4&&ao(v,Q.type,Q.memoizedProps,Q);return;case 6:return;case 4:return;case 12:return;case 13:X&&Q.memoizedState===null&&(Q=Q.alternate,Q!==null&&(Q=Q.memoizedState,Q!==null&&(Q=Q.dehydrated,Q!==null&&cu(Q))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(c(163))}function dP(v,b){if(F)for(var Q=v;;){if(Q.tag===5){var H=Q.stateNode;b?mh(H):co(Q.stateNode,Q.memoizedProps)}else if(Q.tag===6)H=Q.stateNode,b?yh(H):qn(H,Q.memoizedProps);else if((Q.tag!==23&&Q.tag!==24||Q.memoizedState===null||Q===v)&&Q.child!==null){Q.child.return=Q,Q=Q.child;continue}if(Q===v)break;for(;Q.sibling===null;){if(Q.return===null||Q.return===v)return;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}}function Oy(v,b){if(Ja&&typeof Ja.onCommitFiberUnmount=="function")try{Ja.onCommitFiberUnmount($e,b)}catch{}switch(b.tag){case 0:case 11:case 14:case 15:case 22:if(v=b.updateQueue,v!==null&&(v=v.lastEffect,v!==null)){var Q=v=v.next;do{var H=Q,W=H.destroy;if(H=H.tag,W!==void 0)if(H&4)PP(b,Q);else{H=b;try{W()}catch(ne){Rf(H,ne)}}Q=Q.next}while(Q!==v)}break;case 1:if(r2(b),v=b.stateNode,typeof v.componentWillUnmount=="function")try{v.props=b.memoizedProps,v.state=b.memoizedState,v.componentWillUnmount()}catch(ne){Rf(b,ne)}break;case 5:r2(b);break;case 4:F?EP(v,b):z&&z&&(b=b.stateNode.containerInfo,v=ou(b),NA(b,v))}}function gP(v,b){for(var Q=b;;)if(Oy(v,Q),Q.child===null||F&&Q.tag===4){if(Q===b)break;for(;Q.sibling===null;){if(Q.return===null||Q.return===b)return;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}else Q.child.return=Q,Q=Q.child}function Ly(v){v.alternate=null,v.child=null,v.dependencies=null,v.firstEffect=null,v.lastEffect=null,v.memoizedProps=null,v.memoizedState=null,v.pendingProps=null,v.return=null,v.updateQueue=null}function mP(v){return v.tag===5||v.tag===3||v.tag===4}function yP(v){if(F){e:{for(var b=v.return;b!==null;){if(mP(b))break e;b=b.return}throw Error(c(160))}var Q=b;switch(b=Q.stateNode,Q.tag){case 5:var H=!1;break;case 3:b=b.containerInfo,H=!0;break;case 4:b=b.containerInfo,H=!0;break;default:throw Error(c(161))}Q.flags&16&&(df(b),Q.flags&=-17);e:t:for(Q=v;;){for(;Q.sibling===null;){if(Q.return===null||mP(Q.return)){Q=null;break e}Q=Q.return}for(Q.sibling.return=Q.return,Q=Q.sibling;Q.tag!==5&&Q.tag!==6&&Q.tag!==18;){if(Q.flags&2||Q.child===null||Q.tag===4)continue t;Q.child.return=Q,Q=Q.child}if(!(Q.flags&2)){Q=Q.stateNode;break e}}H?n2(v,Q,b):i2(v,Q,b)}}function n2(v,b,Q){var H=v.tag,W=H===5||H===6;if(W)v=W?v.stateNode:v.stateNode.instance,b?lo(Q,v,b):Do(Q,v);else if(H!==4&&(v=v.child,v!==null))for(n2(v,b,Q),v=v.sibling;v!==null;)n2(v,b,Q),v=v.sibling}function i2(v,b,Q){var H=v.tag,W=H===5||H===6;if(W)v=W?v.stateNode:v.stateNode.instance,b?ji(Q,v,b):ci(Q,v);els Line truncated
Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}bs!==5&&(bs=2),ht=Vd(ht,_e),Zt=ve;do{switch(Zt.tag){case 3:ne=ht,Zt.flags|=4096,b&=-b,Zt.lanes|=b;var ri=t2(Zt,ne,b);by(Zt,ri);break e;case 1:ne=ht;var Rr=Zt.type,On=Zt.stateNode;if(!(Zt.flags&64)&&(typeof Rr.getDerivedStateFromError=="function"||On!==null&&typeof On.componentDidCatch=="function"&&(mc===null||!mc.has(On)))){Zt.flags|=4096,b&=-b,Zt.lanes|=b;var jn=Jd(Zt,ne,b);by(Zt,jn);break e}}Zt=Zt.return}while(Zt!==null)}DP(Q)}catch(Xr){b=Xr,Xi===Q&&Q!==null&&(Xi=Q=Q.return);continue}break}while(!0)}function SP(){var v=qy.current;return qy.current=kt,v===null?kt:v}function sg(v,b){var Q=xr;xr|=16;var H=SP();po===v&&Ms===b||Lh(v,b);do try{ML();break}catch(W){vP(v,W)}while(!0);if(Nd(),xr=Q,qy.current=H,Xi!==null)throw Error(c(261));return po=null,Ms=0,bs}function ML(){for(;Xi!==null;)bP(Xi)}function UL(){for(;Xi!==null&&!Rl();)bP(Xi)}function bP(v){var b=QP(v.alternate,v,tp);v.memoizedProps=v.pendingProps,b===null?DP(v):Xi=b,l2.current=null}function DP(v){var b=v;do{var Q=b.alternate;if(v=b.return,b.flags&2048){if(Q=QL(b),Q!==null){Q.flags&=2047,Xi=Q;return}v!==null&&(v.firstEffect=v.lastEffect=null,v.flags|=2048)}else{if(Q=kL(Q,b,tp),Q!==null){Xi=Q;return}if(Q=b,Q.tag!==24&&Q.tag!==23||Q.memoizedState===null||tp&1073741824||!(Q.mode&4)){for(var H=0,W=Q.child;W!==null;)H|=W.lanes|W.childLanes,W=W.sibling;Q.childLanes=H}v!==null&&!(v.flags&2048)&&(v.firstEffect===null&&(v.firstEffect=b.firstEffect),b.lastEffect!==null&&(v.lastEffect!==null&&(v.lastEffect.nextEffect=b.firstEffect),v.lastEffect=b.lastEffect),1<b.flags&&(v.lastEffect!==null?v.lastEffect.nextEffect=b:v.firstEffect=b,v.lastEffect=b))}if(b=b.sibling,b!==null){Xi=b;return}Xi=b=v}while(b!==null);bs===0&&(bs=5)}function rp(v){var b=tr();return ui(99,_L.bind(null,v,b)),null}function _L(v,b){do Bu();while(eg!==null);if(xr&48)throw Error(c(327));var Q=v.finishedWork;if(Q===null)return null;if(v.finishedWork=null,v.finishedLanes=0,Q===v.current)throw Error(c(177));v.callbackNode=null;var H=Q.lanes|Q.childLanes,W=H,ne=v.pendingLanes&~W;v.pendingLanes=W,v.suspendedLanes=0,v.pingedLanes=0,v.expiredLanes&=W,v.mutableReadLanes&=W,v.entangledLanes&=W,W=v.entanglements;for(var ve=v.eventTimes,_e=v.expirationTimes;0<ne;){var ht=31-ss(ne),Wt=1<<ht;W[ht]=0,ve[ht]=-1,_e[ht]=-1,ne&=~Wt}if(Cu!==null&&!(H&24)&&Cu.has(v)&&Cu.delete(v),v===po&&(Xi=po=null,Ms=0),1<Q.flags?Q.lastEffect!==null?(Q.lastEffect.nextEffect=Q,H=Q.firstEffect):H=Q:H=Q.firstEffect,H!==null){W=xr,xr|=32,l2.current=null,ng=tt(v.containerInfo),ig=!1,sr=H;do try{HL()}catch(Ye){if(sr===null)throw Error(c(330));Rf(sr,Ye),sr=sr.nextEffect}while(sr!==null);ng=null,sr=H;do try{for(ve=v;sr!==null;){var Sr=sr.flags;if(Sr&16&&F&&df(sr.stateNode),Sr&128){var Mr=sr.alternate;if(Mr!==null){var Zt=Mr.ref;Zt!==null&&(typeof Zt=="function"?Zt(null):Zt.current=null)}}switch(Sr&1038){case 2:yP(sr),sr.flags&=-3;break;case 6:yP(sr),sr.flags&=-3,s2(sr.alternate,sr);break;case 1024:sr.flags&=-1025;break;case 1028:sr.flags&=-1025,s2(sr.alternate,sr);break;case 4:s2(sr.alternate,sr);break;case 8:_e=ve,ne=sr,F?EP(_e,ne):gP(_e,ne);var $n=ne.alternate;Ly(ne),$n!==null&&Ly($n)}sr=sr.nextEffect}}catch(Ye){if(sr===null)throw Error(c(330));Rf(sr,Ye),sr=sr.nextEffect}while(sr!==null);ig&&ut(),Ne(v.containerInfo),v.current=Q,sr=H;do try{for(Sr=v;sr!==null;){var Ei=sr.flags;if(Ei&36&&hP(Sr,sr.alternate,sr),Ei&128){Mr=void 0;var sl=sr.ref;if(sl!==null){var rt=sr.stateNode;switch(sr.tag){case 5:Mr=Qe(rt);break;default:Mr=rt}typeof sl=="function"?sl(Mr):sl.current=Mr}}sr=sr.nextEffect}}catch(Ye){if(sr===null)throw Error(c(330));Rf(sr,Ye),sr=sr.nextEffect}while(sr!==null);sr=null,te(),xr=W}else v.current=Q;if(Qf)Qf=!1,eg=v,tg=b;else for(sr=H;sr!==null;)b=sr.nextEffect,sr.nextEffect=null,sr.flags&8&&(Ei=sr,Ei.sibling=null,Ei.stateNode=null),sr=b;if(H=v.pendingLanes,H===0&&(mc=null),H===1?v===y2?rg++:(rg=0,y2=v):rg=0,Q=Q.stateNode,Ja&&typeof Ja.onCommitFiberRoot=="function")try{Ja.onCommitFiberRoot($e,Q,void 0,(Q.current.flags&64)===64)}catch{}if(Ca(v,Dt()),Wy)throw Wy=!1,v=d2,d2=null,v;return xr&8||Nn(),null}function HL(){for(;sr!==null;){var v=sr.alternate;ig||ng===null||(sr.flags&8?be(sr,ng)&&(ig=!0,Fe()):sr.tag===13&&FL(v,sr)&&be(sr,ng)&&(ig=!0,Fe()));var b=sr.flags;b&256&&Ny(v,sr),!(b&512)||Qf||(Qf=!0,qi(97,function(){return Bu(),null})),sr=sr.nextEffect}}function Bu(){if(tg!==90){var v=97<tg?97:tg;return tg=90,ui(v,qL)}return!1}function jL(v,b){g2.push(b,v),Qf||(Qf=!0,qi(97,function(){return Bu(),null}))}function PP(v,b){m2.push(b,v),Qf||(Qf=!0,qi(97,function(){return Bu(),null}))}function qL(){if(eg===null)return!1;var v=eg;if(eg=null,xr&48)throw Error(c(331));var b=xr;xr|=32;var Q=m2;m2=[];for(var H=0;H<Q.length;H+=2){var W=Q[H],ne=Q[H+1],ve=W.destroy;if(W.destroy=void 0,typeof ve=="function")try{ve()}catch(ht){if(ne===null)throw Error(c(330));Rf(ne,ht)}}for(Q=g2,g2=[],H=0;H<Q.length;H+=2){W=Q[H],ne=Q[H+1];try{va Line truncated
`+(H.join(" > ")+`
No matching component was found for:
`)+v.join(" > ")}return null},r.getPublicRootInstance=function(v){if(v=v.current,!v.child)return null;switch(v.child.tag){case 5:return Qe(v.child.stateNode);default:return v.child.stateNode}},r.injectIntoDevTools=function(v){if(v={bundleType:v.bundleType,version:v.version,rendererPackageName:v.rendererPackageName,rendererConfig:v.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:f.ReactCurrentDispatcher,findHostInstanceByFiber:JL,findFiberByHostInstance:v.findFiberByHostInstance||zL,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")v=!1;else{var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!b.isDisabled&&b.supportsFiber)try{$e=b.inject(v),Ja=b}catch{}v=!0}return v},r.observeVisibleRects=function(v,b,Q,H){if(!Yt)throw Error(c(363));v=a2(v,b);var W=on(v,Q,H).disconnect;return{disconnect:function(){W()}}},r.registerMutableSourceForHydration=function(v,b){var Q=b._getVersion;Q=Q(b._source),v.mutableSourceEagerHydrationData==null?v.mutableSourceEagerHydrationData=[b,Q]:v.mutableSourceEagerHydrationData.push(b,Q)},r.runWithPriority=function(v,b){var Q=fc;try{return fc=v,b()}finally{fc=Q}},r.shouldSuspend=function(){return!1},r.unbatchedUpdates=function(v,b){var Q=xr;xr&=-2,xr|=8;try{return v(b)}finally{xr=Q,xr===0&&(kf(),Nn())}},r.updateContainer=function(v,b,Q,H){var W=b.current,ne=Lo(),ve=Ds(W);e:if(Q){Q=Q._reactInternals;t:{if(Se(Q)!==Q||Q.tag!==1)throw Error(c(170));var _e=Q;do{switch(_e.tag){case 3:_e=_e.stateNode.context;break t;case 1:if(Zn(_e.type)){_e=_e.stateNode.__reactInternalMemoizedMergedChildContext;break t}}_e=_e.return}while(_e!==null);throw Error(c(171))}if(Q.tag===1){var ht=Q.type;if(Zn(ht)){Q=Wa(Q,ht,_e);break e}}Q=_e}else Q=ha;return b.context===null?b.context=Q:b.pendingContext=Q,b=Fl(ne,ve),b.payload={element:v},H=H===void 0?null:H,H!==null&&(b.callback=H),Nl(W,b),_l(W,ve,ne),ve},r}});var EIe=G((UVt,yIe)=>{"use strict";yIe.exports=mIe()});var CIe=G((_Vt,IIe)=>{"use strict";var Yut={ALIGN_COUNT:8,ALIGN_AUTO:0,ALIGN_FLEX_START:1,ALIGN_CENTER:2,ALIGN_FLEX_END:3,ALIGN_STRETCH:4,ALIGN_BASELINE:5,ALIGN_SPACE_BETWEEN:6,ALIGN_SPACE_AROUND:7,DIMENSION_COUNT:2,DIMENSION_WIDTH:0,DIMENSION_HEIGHT:1,DIRECTION_COUNT:3,DIRECTION_INHERIT:0,DIRECTION_LTR:1,DIRECTION_RTL:2,DISPLAY_COUNT:2,DISPLAY_FLEX:0,DISPLAY_NONE:1,EDGE_COUNT:9,EDGE_LEFT:0,EDGE_TOP:1,EDGE_RIGHT:2,EDGE_BOTTOM:3,EDGE_START:4,EDGE_END:5,EDGE_HORIZONTAL:6,EDGE_VERTICAL:7,EDGE_ALL:8,EXPERIMENTAL_FEATURE_COUNT:1,EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS:0,FLEX_DIRECTION_COUNT:4,FLEX_DIRECTION_COLUMN:0,FLEX_DIRECTION_COLUMN_REVERSE:1,FLEX_DIRECTION_ROW:2,FLEX_DIRECTION_ROW_REVERSE:3,JUSTIFY_COUNT:6,JUSTIFY_FLEX_START:0,JUSTIFY_CENTER:1,JUSTIFY_FLEX_END:2,JUSTIFY_SPACE_BETWEEN:3,JUSTIFY_SPACE_AROUND:4,JUSTIFY_SPACE_EVENLY:5,LOG_LEVEL_COUNT:6,LOG_LEVEL_ERROR:0,LOG_LEVEL_WARN:1,LOG_LEVEL_INFO:2,LOG_LEVEL_DEBUG:3,LOG_LEVEL_VERBOSE:4,LOG_LEVEL_FATAL:5,MEASURE_MODE_COUNT:3,MEASURE_MODE_UNDEFINED:0,MEASURE_MODE_EXACTLY:1,MEASURE_MODE_AT_MOST:2,NODE_TYPE_COUNT:2,NODE_TYPE_DEFAULT:0,NODE_TYPE_TEXT:1,OVERFLOW_COUNT:3,OVERFLOW_VISIBLE:0,OVERFLOW_HIDDEN:1,OVERFLOW_SCROLL:2,POSITION_TYPE_COUNT:2,POSITION_TYPE_RELATIVE:0,POSITION_TYPE_ABSOLUTE:1,PRINT_OPTIONS_COUNT:3,PRINT_OPTIONS_LAYOUT:1,PRINT_OPTIONS_STYLE:2,PRINT_OPTIONS_CHILDREN:4,UNIT_COUNT:4,UNIT_UNDEFINED:0,UNIT_POINT:1,UNIT_PERCENT:2,UNIT_AUTO:3,WRAP_COUNT:3,WRAP_NO_WRAP:0,WRAP_WRAP:1,WRAP_WRAP_REVERSE:2};IIe.exports=Yut});var SIe=G((HVt,vIe)=>{"use strict";var Wut=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},CF=function(){function e(t,r){for(var s=0;s<r.length;s++){var a=r[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,r,s){return r&&e(t.prototype,r),s&&e(t,s),t}}();function gq(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var sf=CIe(),Vut=function(){function e(t,r,s,a,n,c){mq(this,e),this.left=t,this.right=r,this.top=s,this.bottom=a,this.width=n,this.height=c}return CF(e,[{key:"fromJS",value:function(r){r(this.left,this.right,this.top,this.bottom,this.width,this.height)}},{key:"toString",value:function(){return"<Layout#"+this.left+":"+this.right+";"+this.top+":"+this.bottom+";"+this.width+":"+this.height+">"}}]),e}(),wIe=function(){CF(e,null,[{key:"fromJS",value:function(r){var s=r.width,a=r.height;return new e(s,a)}}]);function e(t,r){mq(this,e),this.width=t,this.height=r}return CF(e,[{key:"fromJS",value:function(r){r(this.width,this.height)}},{key:"toStri Line truncated
`+Module.extraStackTrace()),demangleAll(e)}Module.stackTrace=stackTrace;var HEAP,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferViews(){Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer)}var STATIC_BASE,STATICTOP,staticSealed,STACK_BASE,STACKTOP,STACK_MAX,DYNAMIC_BASE,DYNAMICTOP_PTR;STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0,staticSealed=!1;function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function enlargeMemory(){abortOnCannotGrowMemory()}var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||134217728;TOTAL_MEMORY<TOTAL_STACK&&Module.printErr("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+TOTAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")"),Module.buffer?buffer=Module.buffer:buffer=new ArrayBuffer(TOTAL_MEMORY),updateGlobalBufferViews();function getTotalMemory(){return TOTAL_MEMORY}if(HEAP32[0]=1668509029,HEAP16[1]=25459,HEAPU8[2]!==115||HEAPU8[3]!==99)throw"Runtime error: expected the system to be little-endian!";Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;function callRuntimeCallbacks(e){for(;e.length>0;){var t=e.shift();if(typeof t=="function"){t();continue}var r=t.func;typeof r=="number"?t.arg===void 0?Module.dynCall_v(r):Module.dynCall_vi(r,t.arg):r(t.arg===void 0?null:t.arg)}}var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}Module.addOnPreRun=addOnPreRun;function addOnInit(e){__ATINIT__.unshift(e)}Module.addOnInit=addOnInit;function addOnPreMain(e){__ATMAIN__.unshift(e)}Module.addOnPreMain=addOnPreMain;function addOnExit(e){__ATEXIT__.unshift(e)}Module.addOnExit=addOnExit;function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}Module.addOnPostRun=addOnPostRun;function intArrayFromString(e,t,r){var s=r>0?r:lengthBytesUTF8(e)+1,a=new Array(s),n=stringToUTF8Array(e,a,0,a.length);return t&&(a.length=n),a}Module.intArrayFromString=intArrayFromString;function intArrayToString(e){for(var t=[],r=0;r<e.length;r++){var s=e[r];s>255&&(s&=255),t.push(String.fromCharCode(s))}return t.join("")}Module.intArrayToString=intArrayToString;function writeStringToMemory(e,t,r){Runtime.warnOnce("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!");var s,a;r&&(a=t+lengthBytesUTF8(e),s=HEAP8[a]),stringToUTF8(e,t,1/0),r&&(HEAP8[a]=s)}Module.writeStringToMemory=writeStringToMemory;function writeArrayToMemory(e,t){HEAP8.set(e,t)}Module.writeArrayToMemory=writeArrayToMemory;function writeAsciiToMemory(e,t,r){for(var s=0;s<e.length;++s)HEAP8[t++>>0]=e.charCodeAt(s);r||(HEAP8[t>>0]=0)}if(Module.writeAsciiToMemory=writeAsciiToMemory,(!Math.imul||Math.imul(4294967295,5)!==-5)&&(Math.imul=function e(t,r){var s=t>>>16,a=t&65535,n=r>>>16,c=r&65535;return a*c+(s*c+a*n<<16)|0}),Math.imul=Math.imul,!Math.fround){var froundBuffer=new Float32Array(1);Math.fround=function(e){return froundBuffer[0]=e,froundBuffer[0]}}Math.fround=Math.fround,Math.clz32||(Math.clz32=function(e){e=e>>>0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.clz32=Math.clz32,Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Math.trunc=Math.trunc;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.cei Line truncated
If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.`,r="abort("+e+") at "+stackTrace()+t;throw abortDecorators&&abortDecorators.forEach(function(s){r=s(r,e)}),r}if(Module.abort=Module.abort=abort,Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run()})});var _m=G((GVt,DIe)=>{"use strict";var Kut=SIe(),Jut=bIe(),yq=!1,Eq=null;Jut({},function(e,t){if(!yq){if(yq=!0,e)throw e;Eq=t}});if(!yq)throw new Error("Failed to load the yoga module - it needed to be loaded synchronously, but didn't");DIe.exports=Kut(Eq.bind,Eq.lib)});var Cq=G((qVt,Iq)=>{"use strict";var PIe=e=>Number.isNaN(e)?!1:e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141);Iq.exports=PIe;Iq.exports.default=PIe});var kIe=G((YVt,xIe)=>{"use strict";xIe.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E Line truncated
`))t=Math.max(t,$ut(r));return t};Bq.exports=RIe;Bq.exports.default=RIe});var TIe=G(KS=>{"use strict";var eft=KS&&KS.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(KS,"__esModule",{value:!0});var tft=eft(vq()),Sq={};KS.default=e=>{if(e.length===0)return{width:0,height:0};if(Sq[e])return Sq[e];let t=tft.default(e),r=e.split(`
`).length;return Sq[e]={width:t,height:r},{width:t,height:r}}});var FIe=G(JS=>{"use strict";var rft=JS&&JS.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(JS,"__esModule",{value:!0});var kn=rft(_m()),nft=(e,t)=>{"position"in t&&e.setPositionType(t.position==="absolute"?kn.default.POSITION_TYPE_ABSOLUTE:kn.default.POSITION_TYPE_RELATIVE)},ift=(e,t)=>{"marginLeft"in t&&e.setMargin(kn.default.EDGE_START,t.marginLeft||0),"marginRight"in t&&e.setMargin(kn.default.EDGE_END,t.marginRight||0),"marginTop"in t&&e.setMargin(kn.default.EDGE_TOP,t.marginTop||0),"marginBottom"in t&&e.setMargin(kn.default.EDGE_BOTTOM,t.marginBottom||0)},sft=(e,t)=>{"paddingLeft"in t&&e.setPadding(kn.default.EDGE_LEFT,t.paddingLeft||0),"paddingRight"in t&&e.setPadding(kn.default.EDGE_RIGHT,t.paddingRight||0),"paddingTop"in t&&e.setPadding(kn.default.EDGE_TOP,t.paddingTop||0),"paddingBottom"in t&&e.setPadding(kn.default.EDGE_BOTTOM,t.paddingBottom||0)},oft=(e,t)=>{var r;"flexGrow"in t&&e.setFlexGrow((r=t.flexGrow)!==null&&r!==void 0?r:0),"flexShrink"in t&&e.setFlexShrink(typeof t.flexShrink=="number"?t.flexShrink:1),"flexDirection"in t&&(t.flexDirection==="row"&&e.setFlexDirection(kn.default.FLEX_DIRECTION_ROW),t.flexDirection==="row-reverse"&&e.setFlexDirection(kn.default.FLEX_DIRECTION_ROW_REVERSE),t.flexDirection==="column"&&e.setFlexDirection(kn.default.FLEX_DIRECTION_COLUMN),t.flexDirection==="column-reverse"&&e.setFlexDirection(kn.default.FLEX_DIRECTION_COLUMN_REVERSE)),"flexBasis"in t&&(typeof t.flexBasis=="number"?e.setFlexBasis(t.flexBasis):typeof t.flexBasis=="string"?e.setFlexBasisPercent(Number.parseInt(t.flexBasis,10)):e.setFlexBasis(NaN)),"alignItems"in t&&((t.alignItems==="stretch"||!t.alignItems)&&e.setAlignItems(kn.default.ALIGN_STRETCH),t.alignItems==="flex-start"&&e.setAlignItems(kn.default.ALIGN_FLEX_START),t.alignItems==="center"&&e.setAlignItems(kn.default.ALIGN_CENTER),t.alignItems==="flex-end"&&e.setAlignItems(kn.default.ALIGN_FLEX_END)),"alignSelf"in t&&((t.alignSelf==="auto"||!t.alignSelf)&&e.setAlignSelf(kn.default.ALIGN_AUTO),t.alignSelf==="flex-start"&&e.setAlignSelf(kn.default.ALIGN_FLEX_START),t.alignSelf==="center"&&e.setAlignSelf(kn.default.ALIGN_CENTER),t.alignSelf==="flex-end"&&e.setAlignSelf(kn.default.ALIGN_FLEX_END)),"justifyContent"in t&&((t.justifyContent==="flex-start"||!t.justifyContent)&&e.setJustifyContent(kn.default.JUSTIFY_FLEX_START),t.justifyContent==="center"&&e.setJustifyContent(kn.default.JUSTIFY_CENTER),t.justifyContent==="flex-end"&&e.setJustifyContent(kn.default.JUSTIFY_FLEX_END),t.justifyContent==="space-between"&&e.setJustifyContent(kn.default.JUSTIFY_SPACE_BETWEEN),t.justifyContent==="space-around"&&e.setJustifyContent(kn.default.JUSTIFY_SPACE_AROUND))},aft=(e,t)=>{var r,s;"width"in t&&(typeof t.width=="number"?e.setWidth(t.width):typeof t.width=="string"?e.setWidthPercent(Number.parseInt(t.width,10)):e.setWidthAuto()),"height"in t&&(typeof t.height=="number"?e.setHeight(t.height):typeof t.height=="string"?e.setHeightPercent(Number.parseInt(t.height,10)):e.setHeightAuto()),"minWidth"in t&&(typeof t.minWidth=="string"?e.setMinWidthPercent(Number.parseInt(t.minWidth,10)):e.setMinWidth((r=t.minWidth)!==null&&r!==void 0?r:0)),"minHeight"in t&&(typeof t.minHeight=="string"?e.setMinHeightPercent(Number.parseInt(t.minHeight,10)):e.setMinHeight((s=t.minHeight)!==null&&s!==void 0?s:0))},lft=(e,t)=>{"display"in t&&e.setDisplay(t.display==="flex"?kn.default.DISPLAY_FLEX:kn.default.DISPLAY_NONE)},cft=(e,t)=>{if("borderStyle"in t){let r=typeof t.borderStyle=="string"?1:0;e.setBorder(kn.default.EDGE_TOP,r),e.setBorder(kn.default.EDGE_BOTTOM,r),e.setBorder(kn.default.EDGE_LEFT,r),e.setBorder(kn.default.EDGE_RIGHT,r)}};JS.default=(e,t={})=>{nft(e,t),ift(e,t),sft(e,t),oft(e,t),aft(e,t),lft(e,t),cft(e,t)}});var LIe=G((zVt,OIe)=>{"use strict";var zS=VS(),uft=yk(),fft=ak(),Dq=new Set(["\x1B","\x9B"]),Aft=39,NIe=e=>`${Dq.values().next().value}[${e}m`,pft=e=>e.split(" ").map(t=>zS(t)),bq=(e,t,r)=>{let s=[...t],a=!1,n=zS(uft(e[e.length-1]));for(let[c,f]of s.entries()){let p=zS(f);if(n+p<=r?e[e.length-1]+=f:(e.push(f),n=0),Dq.has(f))a=!0;else if(a&&f==="m"){a=!1;continue}a||(n+=p,n===r&&c<s.length-1&&(e.push(""),n=0))}!n&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},hft=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(zS(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},dft=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let s="",a="",n,c=pft(e),f=[""];for(let[p,h]of e.split(" ").entries()){r.trim!==!1&&(f[f.length-1]=f[f.length-1].trimLeft());let E=zS(f[f.length-1]);if(p!==0&&(E>=t&&(r.wordWrap===!1||r.trim===!1)&&(f.push(""),E=0),(E>0||r.trim===!1)&&(f[f.length-1]+=" ",E++)),r.hard&&c[p]>t){let C=t-E,S=1+Math.floor((c[p]-C-1)/t);Math.floor((c[p]-1)/t)<S&&f.push(""),bq(f,h,t);continue}if(E+c[p]>t&&E>0&&c[p]>0){if(r.wordWrap===!1&&E<t){bq(f,h,t);continue}f.push("")}if(E+c[p]>t&&r.wordWrap===!1){bq(f,h,t);continue}f[f. Line truncated
`);for(let[p,h]of[...s].entries()){if(a+=h,Dq.has(h)){let C=parseFloat(/\d[^m]*/.exec(s.slice(p,p+4)));n=C===Aft?null:C}let E=fft.codes.get(Number(n));n&&E&&(s[p+1]===`
`?a+=NIe(E):h===`
`&&(a+=NIe(n)))}return a};OIe.exports=(e,t,r)=>String(e).normalize().replace(/\r\n/g,`
`).split(`
`).map(s=>dft(s,t,r)).join(`
`)});var _Ie=G((XVt,UIe)=>{"use strict";var MIe="[\uD800-\uDBFF][\uDC00-\uDFFF]",gft=e=>e&&e.exact?new RegExp(`^${MIe}$`):new RegExp(MIe,"g");UIe.exports=gft});var Pq=G((ZVt,qIe)=>{"use strict";var mft=Cq(),yft=_Ie(),HIe=ak(),GIe=["\x1B","\x9B"],wF=e=>`${GIe[0]}[${e}m`,jIe=(e,t,r)=>{let s=[];e=[...e];for(let a of e){let n=a;a.match(";")&&(a=a.split(";")[0][0]+"0");let c=HIe.codes.get(parseInt(a,10));if(c){let f=e.indexOf(c.toString());f>=0?e.splice(f,1):s.push(wF(t?c:n))}else if(t){s.push(wF(0));break}else s.push(wF(n))}if(t&&(s=s.filter((a,n)=>s.indexOf(a)===n),r!==void 0)){let a=wF(HIe.codes.get(parseInt(r,10)));s=s.reduce((n,c)=>c===a?[c,...n]:[...n,c],[])}return s.join("")};qIe.exports=(e,t,r)=>{let s=[...e.normalize()],a=[];r=typeof r=="number"?r:s.length;let n=!1,c,f=0,p="";for(let[h,E]of s.entries()){let C=!1;if(GIe.includes(E)){let S=/\d[^m]*/.exec(e.slice(h,h+18));c=S&&S.length>0?S[0]:void 0,f<r&&(n=!0,c!==void 0&&a.push(c))}else n&&E==="m"&&(n=!1,C=!0);if(!n&&!C&&++f,!yft({exact:!0}).test(E)&&mft(E.codePointAt())&&++f,f>t&&f<=r)p+=E;else if(f===t&&!n&&c!==void 0)p=jIe(a);else if(f>=r){p+=jIe(a,!0,c);break}}return p}});var WIe=G(($Vt,YIe)=>{"use strict";var ed=Pq(),Eft=VS();function BF(e,t,r){if(e.charAt(t)===" ")return t;for(let s=1;s<=3;s++)if(r){if(e.charAt(t+s)===" ")return t+s}else if(e.charAt(t-s)===" ")return t-s;return t}YIe.exports=(e,t,r)=>{r={position:"end",preferTruncationOnSpace:!1,...r};let{position:s,space:a,preferTruncationOnSpace:n}=r,c="\u2026",f=1;if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if(typeof t!="number")throw new TypeError(`Expected \`columns\` to be a number, got ${typeof t}`);if(t<1)return"";if(t===1)return c;let p=Eft(e);if(p<=t)return e;if(s==="start"){if(n){let h=BF(e,p-t+1,!0);return c+ed(e,h,p).trim()}return a===!0&&(c+=" ",f=2),c+ed(e,p-t+f,p)}if(s==="middle"){a===!0&&(c=" "+c+" ",f=3);let h=Math.floor(t/2);if(n){let E=BF(e,h),C=BF(e,p-(t-h)+1,!0);return ed(e,0,E)+c+ed(e,C,p).trim()}return ed(e,0,h)+c+ed(e,p-(t-h)+f,p)}if(s==="end"){if(n){let h=BF(e,t-1);return ed(e,0,h)+c}return a===!0&&(c=" "+c,f=2),ed(e,0,t-f)+c}throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${s}`)}});var kq=G(XS=>{"use strict";var VIe=XS&&XS.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(XS,"__esModule",{value:!0});var Ift=VIe(LIe()),Cft=VIe(WIe()),xq={};XS.default=(e,t,r)=>{let s=e+String(t)+String(r);if(xq[s])return xq[s];let a=e;if(r==="wrap"&&(a=Ift.default(e,t,{trim:!1,hard:!0})),r.startsWith("truncate")){let n="end";r==="truncate-middle"&&(n="middle"),r==="truncate-start"&&(n="start"),a=Cft.default(e,t,{position:n})}return xq[s]=a,a}});var Rq=G(Qq=>{"use strict";Object.defineProperty(Qq,"__esModule",{value:!0});var KIe=e=>{let t="";if(e.childNodes.length>0)for(let r of e.childNodes){let s="";r.nodeName==="#text"?s=r.nodeValue:((r.nodeName==="ink-text"||r.nodeName==="ink-virtual-text")&&(s=KIe(r)),s.length>0&&typeof r.internal_transform=="function"&&(s=r.internal_transform(s))),t+=s}return t};Qq.default=KIe});var Tq=G(Di=>{"use strict";var ZS=Di&&Di.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Di,"__esModule",{value:!0});Di.setTextNodeValue=Di.createTextNode=Di.setStyle=Di.setAttribute=Di.removeChildNode=Di.insertBeforeNode=Di.appendChildNode=Di.createNode=Di.TEXT_NAME=void 0;var wft=ZS(_m()),JIe=ZS(TIe()),Bft=ZS(FIe()),vft=ZS(kq()),Sft=ZS(Rq());Di.TEXT_NAME="#text";Di.createNode=e=>{var t;let r={nodeName:e,style:{},attributes:{},childNodes:[],parentNode:null,yogaNode:e==="ink-virtual-text"?void 0:wft.default.Node.create()};return e==="ink-text"&&((t=r.yogaNode)===null||t===void 0||t.setMeasureFunc(bft.bind(null,r))),r};Di.appendChildNode=(e,t)=>{var r;t.parentNode&&Di.removeChildNode(t.parentNode,t),t.parentNode=e,e.childNodes.push(t),t.yogaNode&&((r=e.yogaNode)===null||r===void 0||r.insertChild(t.yogaNode,e.yogaNode.getChildCount())),(e.nodeName==="ink-text"||e.nodeName==="ink-virtual-text")&&vF(e)};Di.insertBeforeNode=(e,t,r)=>{var s,a;t.parentNode&&Di.removeChildNode(t.parentNode,t),t.parentNode=e;let n=e.childNodes.indexOf(r);if(n>=0){e.childNodes.splice(n,0,t),t.yogaNode&&((s=e.yogaNode)===null||s===void 0||s.insertChild(t.yogaNode,n));return}e.childNodes.push(t),t.yogaNode&&((a=e.yogaNode)===null||a===void 0||a.insertChild(t.yogaNode,e.yogaNode.getChildCount())),(e.nodeName==="ink-text"||e.nodeName==="ink-virtual-text")&&vF(e)};Di.removeChildNode=(e,t)=>{var r,s;t.yogaNode&&((s=(r=t.parentNode)===null||r===void 0?void 0:r.yogaNode)===null||s===void 0||s.removeChild(t.yogaNode)),t.parentNode=null;let a=e.childNodes.indexOf(t);a>=0&&e.childNodes.splice(a,1),(e.nodeName==="ink-text"||e.nodeName==="ink-virtual-text")&&vF(e)};Di.setAttribute=(e,t,r)=>{e.attributes[t]=r};Di.setStyle=(e,t)=>{e.style=t,e.yogaNode&&Bft.default(e.yogaNode,t)};Di.createTextNode=e=>{let t={nodeName:"#text",nodeValue:e,yogaLine truncated
`).repeat(n-2),E=Oq.default(f.bottomLeft+f.horizontal.repeat(a-2)+f.bottomRight,c,"foreground");s.write(e,t,p,{transformers:[]}),s.write(e,t+1,h,{transformers:[]}),s.write(e+a-1,t+1,h,{transformers:[]}),s.write(e,t+n-1,E,{transformers:[]})}}});var fCe=G(ib=>{"use strict";var Hm=ib&&ib.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ib,"__esModule",{value:!0});var Fft=Hm(_m()),Nft=Hm(vq()),Oft=Hm(nCe()),Lft=Hm(kq()),Mft=Hm(iCe()),Uft=Hm(Rq()),_ft=Hm(cCe()),Hft=(e,t)=>{var r;let s=(r=e.childNodes[0])===null||r===void 0?void 0:r.yogaNode;if(s){let a=s.getComputedLeft(),n=s.getComputedTop();t=`
`.repeat(n)+Oft.default(t,a)}return t},uCe=(e,t,r)=>{var s;let{offsetX:a=0,offsetY:n=0,transformers:c=[],skipStaticElements:f}=r;if(f&&e.internal_static)return;let{yogaNode:p}=e;if(p){if(p.getDisplay()===Fft.default.DISPLAY_NONE)return;let h=a+p.getComputedLeft(),E=n+p.getComputedTop(),C=c;if(typeof e.internal_transform=="function"&&(C=[e.internal_transform,...c]),e.nodeName==="ink-text"){let S=Uft.default(e);if(S.length>0){let x=Nft.default(S),I=Mft.default(p);if(x>I){let T=(s=e.style.textWrap)!==null&&s!==void 0?s:"wrap";S=Lft.default(S,I,T)}S=Hft(e,S),t.write(h,E,S,{transformers:C})}return}if(e.nodeName==="ink-box"&&_ft.default(h,E,e,t),e.nodeName==="ink-root"||e.nodeName==="ink-box")for(let S of e.childNodes)uCe(S,t,{offsetX:h,offsetY:E,transformers:C,skipStaticElements:f})}};ib.default=uCe});var hCe=G(sb=>{"use strict";var pCe=sb&&sb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sb,"__esModule",{value:!0});var ACe=pCe(Pq()),jft=pCe(VS()),Lq=class{constructor(t){this.writes=[];let{width:r,height:s}=t;this.width=r,this.height=s}write(t,r,s,a){let{transformers:n}=a;s&&this.writes.push({x:t,y:r,text:s,transformers:n})}get(){let t=[];for(let s=0;s<this.height;s++)t.push(" ".repeat(this.width));for(let s of this.writes){let{x:a,y:n,text:c,transformers:f}=s,p=c.split(`
`),h=0;for(let E of p){let C=t[n+h];if(!C)continue;let S=jft.default(E);for(let x of f)E=x(E);t[n+h]=ACe.default(C,0,a)+E+ACe.default(C,a+S),h++}}return{output:t.map(s=>s.trimRight()).join(`
`),height:t.length}}};sb.default=Lq});var mCe=G(ob=>{"use strict";var Mq=ob&&ob.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ob,"__esModule",{value:!0});var Gft=Mq(_m()),dCe=Mq(fCe()),gCe=Mq(hCe());ob.default=(e,t)=>{var r;if(e.yogaNode.setWidth(t),e.yogaNode){e.yogaNode.calculateLayout(void 0,void 0,Gft.default.DIRECTION_LTR);let s=new gCe.default({width:e.yogaNode.getComputedWidth(),height:e.yogaNode.getComputedHeight()});dCe.default(e,s,{skipStaticElements:!0});let a;!((r=e.staticNode)===null||r===void 0)&&r.yogaNode&&(a=new gCe.default({width:e.staticNode.yogaNode.getComputedWidth(),height:e.staticNode.yogaNode.getComputedHeight()}),dCe.default(e.staticNode,a,{skipStaticElements:!1}));let{output:n,height:c}=s.get();return{output:n,outputHeight:c,staticOutput:a?`${a.get().output}
`:""}}return{output:"",outputHeight:0,staticOutput:""}}});var CCe=G((p7t,ICe)=>{"use strict";var yCe=Ie("stream"),ECe=["assert","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],Uq={},qft=e=>{let t=new yCe.PassThrough,r=new yCe.PassThrough;t.write=a=>e("stdout",a),r.write=a=>e("stderr",a);let s=new console.Console(t,r);for(let a of ECe)Uq[a]=console[a],console[a]=s[a];return()=>{for(let a of ECe)console[a]=Uq[a];Uq={}}};ICe.exports=qft});var Hq=G(_q=>{"use strict";Object.defineProperty(_q,"__esModule",{value:!0});_q.default=new WeakMap});var Gq=G(jq=>{"use strict";Object.defineProperty(jq,"__esModule",{value:!0});var Yft=dn(),wCe=Yft.createContext({exit:()=>{}});wCe.displayName="InternalAppContext";jq.default=wCe});var Yq=G(qq=>{"use strict";Object.defineProperty(qq,"__esModule",{value:!0});var Wft=dn(),BCe=Wft.createContext({stdin:void 0,setRawMode:()=>{},isRawModeSupported:!1,internal_exitOnCtrlC:!0});BCe.displayName="InternalStdinContext";qq.default=BCe});var Vq=G(Wq=>{"use strict";Object.defineProperty(Wq,"__esModule",{value:!0});var Vft=dn(),vCe=Vft.createContext({stdout:void 0,write:()=>{}});vCe.displayName="InternalStdoutContext";Wq.default=vCe});var Jq=G(Kq=>{"use strict";Object.defineProperty(Kq,"__esModule",{value:!0});var Kft=dn(),SCe=Kft.createContext({stderr:void 0,write:()=>{}});SCe.displayName="InternalStderrContext";Kq.default=SCe});var DF=G(zq=>{"use strict";Object.defineProperty(zq,"__esModule",{value:!0});var Jft=dn(),bCe=Jft.createContext({activeId:void 0,add:()=>{},remove:()=>{},activate:()=>{},deactivate:()=>{},enableFocus:()=>{},disableFocus:()=>{},focusNext:()=>{},focusPrevious:()=>{},focus:()=>{}});bCe.displayName="InternalFocusContext";zq.default=bCe});var PCe=G((I7t,DCe)=>{"use strict";var zft=/[|\\{}()[\]^$+*?.-]/g;DCe.exports=e=>{if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(zft,"\\$&")}});var RCe=G((C7t,QCe)=>{"use strict";var Xft=PCe(),Zft=typeof process=="object"&&process&&typeof process.cwd=="function"?process.cwd():".",kCe=[].concat(Ie("module").builtinModules,"bootstrap_node","node").map(e=>new RegExp(`(?:\\((?:node:)?${e}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${e}(?:\\.js)?:\\d+:\\d+$)`));kCe.push(/\((?:node:)?internal\/[^:]+:\d+:\d+\)$/,/\s*at (?:node:)?internal\/[^:]+:\d+:\d+$/,/\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/);var Xq=class e{constructor(t){t={ignoredPackages:[],...t},"internals"in t||(t.internals=e.nodeInternals()),"cwd"in t||(t.cwd=Zft),this._cwd=t.cwd.replace(/\\/g,"/"),this._internals=[].concat(t.internals,$ft(t.ignoredPackages)),this._wrapCallSite=t.wrapCallSite||!1}static nodeInternals(){return[...kCe]}clean(t,r=0){r=" ".repeat(r),Array.isArray(t)||(t=t.split(`
`)),!/^\s*at /.test(t[0])&&/^\s*at /.test(t[1])&&(t=t.slice(1));let s=!1,a=null,n=[];return t.forEach(c=>{if(c=c.replace(/\\/g,"/"),this._internals.some(p=>p.test(c)))return;let f=/^\s*at /.test(c);s?c=c.trimEnd().replace(/^(\s+)at /,"$1"):(c=c.trim(),f&&(c=c.slice(3))),c=c.replace(`${this._cwd}/`,""),c&&(f?(a&&(n.push(a),a=null),n.push(c)):(s=!0,a=c))}),n.map(c=>`${r}${c}
`).join("")}captureString(t,r=this.captureString){typeof t=="function"&&(r=t,t=1/0);let{stackTraceLimit:s}=Error;t&&(Error.stackTraceLimit=t);let a={};Error.captureStackTrace(a,r);let{stack:n}=a;return Error.stackTraceLimit=s,this.clean(n)}capture(t,r=this.capture){typeof t=="function"&&(r=t,t=1/0);let{prepareStackTrace:s,stackTraceLimit:a}=Error;Error.prepareStackTrace=(f,p)=>this._wrapCallSite?p.map(this._wrapCallSite):p,t&&(Error.stackTraceLimit=t);let n={};Error.captureStackTrace(n,r);let{stack:c}=n;return Object.assign(Error,{prepareStackTrace:s,stackTraceLimit:a}),c}at(t=this.at){let[r]=this.capture(1,t);if(!r)return{};let s={line:r.getLineNumber(),column:r.getColumnNumber()};xCe(s,r.getFileName(),this._cwd),r.isConstructor()&&(s.constructor=!0),r.isEval()&&(s.evalOrigin=r.getEvalOrigin()),r.isNative()&&(s.native=!0);let a;try{a=r.getTypeName()}catch{}a&&a!=="Object"&&a!=="[object Object]"&&(s.type=a);let n=r.getFunctionName();n&&(s.function=n);let c=r.getMethodName();return c&&n!==c&&(s.method=c),s}parseLine(t){let r=t&&t.match(eAt);if(!r)return null;let s=r[1]==="new",a=r[2],n=r[3],c=r[4],f=Number(r[5]),p=Number(r[6]),h=r[7],E=r[8],C=r[9],S=r[10]==="native",x=r[11]===")",I,T={};if(E&&(T.line=Number(E)),C&&(T.column=Number(C)),x&&h){let O=0;for(let U=h.length-1;U>0;U--)if(h.charAt(U)===")")O++;else if(h.charAt(U)==="("&&h.charAt(U-1)===" "&&(O--,O===-1&&h.charAt(U-1)===" ")){let V=h.slice(0,U-1);h=h.slice(U+1),a+=` (${V}`;break}}if(a){let O=a.match(tAt);O&&(a=O[1],I=O[2])}return xCe(T,h,this._cwd),s&&(T.constructor=!0),n&&(T.evalOrigin=n,T.evalLine=f,T.evalColumn=p,T.evalFile=c&&c.replace(/\\/g,"/")),S&&(T.native=!0),a&&(T.function=a),I&&a!==I&&(T.method=I),T}};function xCe(e,t,r){t&&(t=t.replace(/\\/g,"/"),t.startsWith(`${r}/`)&&(t=t.slice(r.length+1)),e.file=t)}function $ft(e){if(e.length===0)return[];let t=e.map(r=>Xft(r));return new RegExp(`[/\\\\]node_modules[/\\\\](?:${t.join("|")})[/\\\\][^:]+:\\d+:\\d+`)}var eAt=new RegExp("^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"),tAt=/^(.*?) \[as (.*?)\]$/;QCe.exports=Xq});var FCe=G((w7t,TCe)=>{"use strict";TCe.exports=(e,t)=>e.replace(/^\t+/gm,r=>" ".repeat(r.length*(t||2)))});var OCe=G((B7t,NCe)=>{"use strict";var rAt=FCe(),nAt=(e,t)=>{let r=[],s=e-t,a=e+t;for(let n=s;n<=a;n++)r.push(n);return r};NCe.exports=(e,t,r)=>{if(typeof e!="string")throw new TypeError("Source code is missing.");if(!t||t<1)throw new TypeError("Line number must start from `1`.");if(e=rAt(e).split(/\r?\n/),!(t>e.length))return r={around:3,...r},nAt(t,r.around).filter(s=>e[s-1]!==void 0).map(s=>({line:s,value:e[s-1]}))}});var PF=G(of=>{"use strict";var iAt=of&&of.__createBinding||(Object.create?function(e,t,r,s){s===void 0&&(s=r),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,s){s===void 0&&(s=r),e[s]=t[r]}),sAt=of&&of.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),oAt=of&&of.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&iAt(t,e,r);return sAt(t,e),t},aAt=of&&of.__rest||function(e,t){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(e);a<s.length;a++)t.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(e,s[a])&&(r[s[a]]=e[s[a]]);return r};Object.defineProperty(of,"__esModule",{value:!0});var LCe=oAt(dn()),Zq=LCe.forwardRef((e,t)=>{var{children:r}=e,s=aAt(e,["children"]);let a=Object.assign(Object.assign({},s),{marginLeft:s.marginLeft||s.marginX||s.margin||0,marginRight:s.marginRight||s.marginX||s.margin||0,marginTop:s.marginTop||s.marginY||s.margin||0,marginBottom:s.marginBottom||s.marginY||s.margin||0,paddingLeft:s.paddingLeft||s.paddingX||s.padding||0,paddingRight:s.paddingRight||s.paddingX||s.padding||0,paddingTop:s.paddingTop||s.paddingY||s.padding||0,paddingBottom:s.paddingBottom||s.paddingY||s.padding||0});return LCe.default.createElement("ink-box",{ref:t,style:a},r)});Zq.displayName="Box";Zq.defaultProps={flexDirection:"row",flexGrow:0,flexShrink:1};of.default=Zq});var tY=G(ab=>{"use strict";var $q=ab&&ab.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ab,"__esModule",{value:!0});var lAt=$q(dn()),fw=$q(LE()),MCe=$q(Nq()),eY=({color:e,backgroundColor:t,dimColor:r,bold:s,italic:a,underline:n,strikethrough:c,inverse:f,wrap:p,children:h})=>{if(h==null)return null;let E=C=>(r&&(C=fw.default.dim(C)),e&&(C=MCe.default(C,e,"foreground")),t&&(C=MCe.default(C,t,"background")),s&&(C=fw.default.bold(C)),a&&(C=fw.default.italic(C)),n&&(C=fw.default.underline(C)),c&&(C=fw.default.strikethrough(C)),f&&(C=fw.default.inverse(C)),C);return lAt.default.createElement("ink-text",{style:{flexGrow:0,flexSLine truncated
`).slice(1):void 0,r=t?HCe.parseLine(t[0]):void 0,s,a=0;if(r?.file&&r?.line&&UCe.existsSync(r.file)){let n=UCe.readFileSync(r.file,"utf8");if(s=AAt.default(n,r.line),s)for(let{line:c}of s)a=Math.max(a,String(c).length)}return Fs.default.createElement(th.default,{flexDirection:"column",padding:1},Fs.default.createElement(th.default,null,Fs.default.createElement(dA.default,{backgroundColor:"red",color:"white"}," ","ERROR"," "),Fs.default.createElement(dA.default,null," ",e.message)),r&&Fs.default.createElement(th.default,{marginTop:1},Fs.default.createElement(dA.default,{dimColor:!0},r.file,":",r.line,":",r.column)),r&&s&&Fs.default.createElement(th.default,{marginTop:1,flexDirection:"column"},s.map(({line:n,value:c})=>Fs.default.createElement(th.default,{key:n},Fs.default.createElement(th.default,{width:a+1},Fs.default.createElement(dA.default,{dimColor:n!==r.line,backgroundColor:n===r.line?"red":void 0,color:n===r.line?"white":void 0},String(n).padStart(a," "),":")),Fs.default.createElement(dA.default,{key:n,backgroundColor:n===r.line?"red":void 0,color:n===r.line?"white":void 0}," "+c)))),e.stack&&Fs.default.createElement(th.default,{marginTop:1,flexDirection:"column"},e.stack.split(`
`).slice(1).map(n=>{let c=HCe.parseLine(n);return c?Fs.default.createElement(th.default,{key:n},Fs.default.createElement(dA.default,{dimColor:!0},"- "),Fs.default.createElement(dA.default,{dimColor:!0,bold:!0},c.function),Fs.default.createElement(dA.default,{dimColor:!0,color:"gray"}," ","(",c.file,":",c.line,":",c.column,")")):Fs.default.createElement(th.default,{key:n},Fs.default.createElement(dA.default,{dimColor:!0},"- "),Fs.default.createElement(dA.default,{dimColor:!0,bold:!0},n))})))};af.default=pAt});var qCe=G(lf=>{"use strict";var hAt=lf&&lf.__createBinding||(Object.create?function(e,t,r,s){s===void 0&&(s=r),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,s){s===void 0&&(s=r),e[s]=t[r]}),dAt=lf&&lf.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),gAt=lf&&lf.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&hAt(t,e,r);return dAt(t,e),t},Gm=lf&&lf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lf,"__esModule",{value:!0});var jm=gAt(dn()),GCe=Gm(nq()),mAt=Gm(Gq()),yAt=Gm(Yq()),EAt=Gm(Vq()),IAt=Gm(Jq()),CAt=Gm(DF()),wAt=Gm(jCe()),BAt=" ",vAt="\x1B[Z",SAt="\x1B",xF=class extends jm.PureComponent{constructor(){super(...arguments),this.state={isFocusEnabled:!0,activeFocusId:void 0,focusables:[],error:void 0},this.rawModeEnabledCount=0,this.handleSetRawMode=t=>{let{stdin:r}=this.props;if(!this.isRawModeSupported())throw r===process.stdin?new Error(`Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.
Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`):new Error(`Raw mode is not supported on the stdin provided to Ink.
Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`);if(r.setEncoding("utf8"),t){this.rawModeEnabledCount===0&&(r.addListener("data",this.handleInput),r.resume(),r.setRawMode(!0)),this.rawModeEnabledCount++;return}--this.rawModeEnabledCount===0&&(r.setRawMode(!1),r.removeListener("data",this.handleInput),r.pause())},this.handleInput=t=>{t===""&&this.props.exitOnCtrlC&&this.handleExit(),t===SAt&&this.state.activeFocusId&&this.setState({activeFocusId:void 0}),this.state.isFocusEnabled&&this.state.focusables.length>0&&(t===BAt&&this.focusNext(),t===vAt&&this.focusPrevious())},this.handleExit=t=>{this.isRawModeSupported()&&this.handleSetRawMode(!1),this.props.onExit(t)},this.enableFocus=()=>{this.setState({isFocusEnabled:!0})},this.disableFocus=()=>{this.setState({isFocusEnabled:!1})},this.focus=t=>{this.setState(r=>r.focusables.some(a=>a?.id===t)?{activeFocusId:t}:r)},this.focusNext=()=>{this.setState(t=>{var r;let s=(r=t.focusables[0])===null||r===void 0?void 0:r.id;return{activeFocusId:this.findNextFocusable(t)||s}})},this.focusPrevious=()=>{this.setState(t=>{var r;let s=(r=t.focusables[t.focusables.length-1])===null||r===void 0?void 0:r.id;return{activeFocusId:this.findPreviousFocusable(t)||s}})},this.addFocusable=(t,{autoFocus:r})=>{this.setState(s=>{let a=s.activeFocusId;return!a&&r&&(a=t),{activeFocusId:a,focusables:[...s.focusables,{id:t,isActive:!0}]}})},this.removeFocusable=t=>{this.setState(r=>({activeFocusId:r.activeFocusId===t?void 0:r.activeFocusId,focusables:r.focusables.filter(s=>s.id!==t)}))},this.activateFocusable=t=>{this.setState(r=>({focusables:r.focusables.map(s=>s.id!==t?s:{id:t,isActive:!0})}))},this.deactivateFocusable=t=>{this.setState(r=>({activeFocusId:r.activeFocusId===t?void 0:r.activeFocusId,focusables:r.focusables.map(s=>s.id!==t?s:{id:t,isActive:!1})}))},this.findNextFocusable=t=>{var r;let s=t.focusables.findIndex(a=>a.id===t.activeFocusId);for(let a=s+1;a<t.focusables.length;a++)if(!((r=t.focusables[a])===null||r===void 0)&&r.isActive)return t.focusables[a].id},this.findPreviousFocusable=t=>{var r;let s=t.focusables.findIndex(a=>a.id===t.activeFocusId);for(let a=s-1;a>=0;a--)if(!((r=t.focusables[a])===null||r===void 0)&&r.isActive)return t.focusables[a].id}}static getDerivedStateFromError(t){return{error:t}}isRawModeSupported(){return this.props.stdin.isTTY}render(){return jm.default.createElement(mAt.default.Provider,{value:{exit:this.handleExit}},jm.default.createElement(yAt.default.Provider,{value:{stdin:this.props.stdin,setRawMode:this.handleSetRawMode,isRawModeSupported:this.isRawModeSupported(),internal_exitOnCtrlC:this.props.exitOnCtrlC}},jm.default.createElement(EAt.default.Provider,{value:{stdout:this.props.stdout,write:this.props.writeToStdout}},jm.default.createElement(IAt.default.Provider,{value:{stderr:this.props.stderr,write:this.props.writeToStderr}},jm.default.createElement(CAt.default.Provider,{value:{activeId:this.state.activeFocusId,add:this.addFocusable,remove:this.removeFocusable,activate:this.activateFocusable,deactivate:this.deactivateFocusable,enableFocus:this.enableFocus,disableFocus:this.disableFocus,focusNext:this.focusNext,focusPrevious:this.focusPrevious,focus:this.focus}},this.state.error?jm.default.createElement(wAt.default,{error:this.state.error}):this.props.children)))))}componentDidMount(){GCe.default.hide(this.props.stdout)}componentWillUnmount(){GCe.default.show(this.props.stdout),this.isRawModeSupported()&&this.handleSetRawMode(!1)}componentDidCatch(t){this.handleExit(t)}};lf.default=xF;xF.displayName="InternalApp"});var VCe=G(cf=>{"use strict";var bAt=cf&&cf.__createBinding||(Object.create?function(e,t,r,s){s===void 0&&(s=r),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,s){s===void 0&&(s=r),e[s]=t[r]}),DAt=cf&&cf.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),PAt=cf&&cf.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&bAt(t,e,r);return DAt(t,e),t},uf=cf&&cf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cf,"__esModule",{value:!0});var xAt=uf(dn()),YCe=UEe(),kAt=uf(tIe()),QAt=uf(Z9()),RAt=uf(aIe()),TAt=uf(cIe()),rY=uf(tCe()),FAt=uf(mCe()),NAt=uf(rq()),OAt=uf(CCe()),LAt=PAt(Tq()),MAt=uf(Hq()),UAt=uf(qCe()),Aw=process.env.CI==="false"?!1:RAt.default,WCe=()=>{},nY=class{constructor(t){this.resolveExitPromise=()=>{},this.rejectExitPromise=()=>{},this.unsubscribeExit=()=>{},this.onRender=()=>{if(this.isUnmounted)return;let{output:r,outputHeight:s,staticOutput:a}=FAt.default(this.rootNode,this.options.stdout.columns||80),n=a&&a!==`
`;if(this.options.debug){n&&(this.fullStaticOutput+=a),this.options.stdout.write(this.fullStaticOutput+r);return}if(Aw){n&&this.options.stdout.write(a),this.lastOutput=r;return}if(n&&(this.fullStaticOutput+=a),s>=this.options.stdout.rows){this.options.stdout.write(QAt.default.clearTerminal+this.fullStaticOutput+r),this.lastOutput=r;return}n&&(this.log.clear(),this.options.stdout.write(a),this.log(r)),!n&&r!==this.lastOutput&&this.throttledLog(r),this.lastOutput=r},TAt.default(this),this.options=t,this.rootNode=LAt.createNode("ink-root"),this.rootNode.onRender=t.debug?this.onRender:YCe(this.onRender,32,{leading:!0,trailing:!0}),this.rootNode.onImmediateRender=this.onRender,this.log=kAt.default.create(t.stdout),this.throttledLog=t.debug?this.log:YCe(this.log,void 0,{leading:!0,trailing:!0}),this.isUnmounted=!1,this.lastOutput="",this.fullStaticOutput="",this.container=rY.default.createContainer(this.rootNode,0,!1,null),this.unsubscribeExit=NAt.default(this.unmount,{alwaysLast:!1}),t.patchConsole&&this.patchConsole(),Aw||(t.stdout.on("resize",this.onRender),this.unsubscribeResize=()=>{t.stdout.off("resize",this.onRender)})}render(t){let r=xAt.default.createElement(UAt.default,{stdin:this.options.stdin,stdout:this.options.stdout,stderr:this.options.stderr,writeToStdout:this.writeToStdout,writeToStderr:this.writeToStderr,exitOnCtrlC:this.options.exitOnCtrlC,onExit:this.unmount},t);rY.default.updateContainer(r,this.container,null,WCe)}writeToStdout(t){if(!this.isUnmounted){if(this.options.debug){this.options.stdout.write(t+this.fullStaticOutput+this.lastOutput);return}if(Aw){this.options.stdout.write(t);return}this.log.clear(),this.options.stdout.write(t),this.log(this.lastOutput)}}writeToStderr(t){if(!this.isUnmounted){if(this.options.debug){this.options.stderr.write(t),this.options.stdout.write(this.fullStaticOutput+this.lastOutput);return}if(Aw){this.options.stderr.write(t);return}this.log.clear(),this.options.stderr.write(t),this.log(this.lastOutput)}}unmount(t){this.isUnmounted||(this.onRender(),this.unsubscribeExit(),typeof this.restoreConsole=="function"&&this.restoreConsole(),typeof this.unsubscribeResize=="function"&&this.unsubscribeResize(),Aw?this.options.stdout.write(this.lastOutput+`
`):this.options.debug||this.log.done(),this.isUnmounted=!0,rY.default.updateContainer(null,this.container,null,WCe),MAt.default.delete(this.options.stdout),t instanceof Error?this.rejectExitPromise(t):this.resolveExitPromise())}waitUntilExit(){return this.exitPromise||(this.exitPromise=new Promise((t,r)=>{this.resolveExitPromise=t,this.rejectExitPromise=r})),this.exitPromise}clear(){!Aw&&!this.options.debug&&this.log.clear()}patchConsole(){this.options.debug||(this.restoreConsole=OAt.default((t,r)=>{t==="stdout"&&this.writeToStdout(r),t==="stderr"&&(r.startsWith("The above error occurred")||this.writeToStderr(r))}))}};cf.default=nY});var JCe=G(ub=>{"use strict";var KCe=ub&&ub.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ub,"__esModule",{value:!0});var _At=KCe(VCe()),kF=KCe(Hq()),HAt=Ie("stream"),jAt=(e,t)=>{let r=Object.assign({stdout:process.stdout,stdin:process.stdin,stderr:process.stderr,debug:!1,exitOnCtrlC:!0,patchConsole:!0},GAt(t)),s=qAt(r.stdout,()=>new _At.default(r));return s.render(e),{rerender:s.render,unmount:()=>s.unmount(),waitUntilExit:s.waitUntilExit,cleanup:()=>kF.default.delete(r.stdout),clear:s.clear}};ub.default=jAt;var GAt=(e={})=>e instanceof HAt.Stream?{stdout:e,stdin:process.stdin}:e,qAt=(e,t)=>{let r;return kF.default.has(e)?r=kF.default.get(e):(r=t(),kF.default.set(e,r)),r}});var XCe=G(rh=>{"use strict";var YAt=rh&&rh.__createBinding||(Object.create?function(e,t,r,s){s===void 0&&(s=r),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,s){s===void 0&&(s=r),e[s]=t[r]}),WAt=rh&&rh.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),VAt=rh&&rh.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&YAt(t,e,r);return WAt(t,e),t};Object.defineProperty(rh,"__esModule",{value:!0});var fb=VAt(dn()),zCe=e=>{let{items:t,children:r,style:s}=e,[a,n]=fb.useState(0),c=fb.useMemo(()=>t.slice(a),[t,a]);fb.useLayoutEffect(()=>{n(t.length)},[t.length]);let f=c.map((h,E)=>r(h,a+E)),p=fb.useMemo(()=>Object.assign({position:"absolute",flexDirection:"column"},s),[s]);return fb.default.createElement("ink-box",{internal_static:!0,style:p},f)};zCe.displayName="Static";rh.default=zCe});var $Ce=G(Ab=>{"use strict";var KAt=Ab&&Ab.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ab,"__esModule",{value:!0});var JAt=KAt(dn()),ZCe=({children:e,transform:t})=>e==null?null:JAt.default.createElement("ink-text",{style:{flexGrow:0,flexShrink:1,flexDirection:"row"},internal_transform:t},e);ZCe.displayName="Transform";Ab.default=ZCe});var twe=G(pb=>{"use strict";var zAt=pb&&pb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pb,"__esModule",{value:!0});var XAt=zAt(dn()),ewe=({count:e=1})=>XAt.default.createElement("ink-text",null,`
`.repeat(e));ewe.displayName="Newline";pb.default=ewe});var iwe=G(hb=>{"use strict";var rwe=hb&&hb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hb,"__esModule",{value:!0});var ZAt=rwe(dn()),$At=rwe(PF()),nwe=()=>ZAt.default.createElement($At.default,{flexGrow:1});nwe.displayName="Spacer";hb.default=nwe});var QF=G(db=>{"use strict";var ept=db&&db.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(db,"__esModule",{value:!0});var tpt=dn(),rpt=ept(Yq()),npt=()=>tpt.useContext(rpt.default);db.default=npt});var owe=G(gb=>{"use strict";var ipt=gb&&gb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gb,"__esModule",{value:!0});var swe=dn(),spt=ipt(QF()),opt=(e,t={})=>{let{stdin:r,setRawMode:s,internal_exitOnCtrlC:a}=spt.default();swe.useEffect(()=>{if(t.isActive!==!1)return s(!0),()=>{s(!1)}},[t.isActive,s]),swe.useEffect(()=>{if(t.isActive===!1)return;let n=c=>{let f=String(c),p={upArrow:f==="\x1B[A",downArrow:f==="\x1B[B",leftArrow:f==="\x1B[D",rightArrow:f==="\x1B[C",pageDown:f==="\x1B[6~",pageUp:f==="\x1B[5~",return:f==="\r",escape:f==="\x1B",ctrl:!1,shift:!1,tab:f===" "||f==="\x1B[Z",backspace:f==="\b",delete:f==="\x7F"||f==="\x1B[3~",meta:!1};f<=""&&!p.return&&(f=String.fromCharCode(f.charCodeAt(0)+97-1),p.ctrl=!0),f.startsWith("\x1B")&&(f=f.slice(1),p.meta=!0);let h=f>="A"&&f<="Z",E=f>="\u0410"&&f<="\u042F";f.length===1&&(h||E)&&(p.shift=!0),p.tab&&f==="[Z"&&(p.shift=!0),(p.tab||p.backspace||p.delete)&&(f=""),(!(f==="c"&&p.ctrl)||!a)&&e(f,p)};return r?.on("data",n),()=>{r?.off("data",n)}},[t.isActive,r,a,e])};gb.default=opt});var awe=G(mb=>{"use strict";var apt=mb&&mb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mb,"__esModule",{value:!0});var lpt=dn(),cpt=apt(Gq()),upt=()=>lpt.useContext(cpt.default);mb.default=upt});var lwe=G(yb=>{"use strict";var fpt=yb&&yb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(yb,"__esModule",{value:!0});var Apt=dn(),ppt=fpt(Vq()),hpt=()=>Apt.useContext(ppt.default);yb.default=hpt});var cwe=G(Eb=>{"use strict";var dpt=Eb&&Eb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Eb,"__esModule",{value:!0});var gpt=dn(),mpt=dpt(Jq()),ypt=()=>gpt.useContext(mpt.default);Eb.default=ypt});var fwe=G(Cb=>{"use strict";var uwe=Cb&&Cb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Cb,"__esModule",{value:!0});var Ib=dn(),Ept=uwe(DF()),Ipt=uwe(QF()),Cpt=({isActive:e=!0,autoFocus:t=!1,id:r}={})=>{let{isRawModeSupported:s,setRawMode:a}=Ipt.default(),{activeId:n,add:c,remove:f,activate:p,deactivate:h,focus:E}=Ib.useContext(Ept.default),C=Ib.useMemo(()=>r??Math.random().toString().slice(2,7),[r]);return Ib.useEffect(()=>(c(C,{autoFocus:t}),()=>{f(C)}),[C,t]),Ib.useEffect(()=>{e?p(C):h(C)},[e,C]),Ib.useEffect(()=>{if(!(!s||!e))return a(!0),()=>{a(!1)}},[e]),{isFocused:!!C&&n===C,focus:E}};Cb.default=Cpt});var Awe=G(wb=>{"use strict";var wpt=wb&&wb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wb,"__esModule",{value:!0});var Bpt=dn(),vpt=wpt(DF()),Spt=()=>{let e=Bpt.useContext(vpt.default);return{enableFocus:e.enableFocus,disableFocus:e.disableFocus,focusNext:e.focusNext,focusPrevious:e.focusPrevious,focus:e.focus}};wb.default=Spt});var pwe=G(iY=>{"use strict";Object.defineProperty(iY,"__esModule",{value:!0});iY.default=e=>{var t,r,s,a;return{width:(r=(t=e.yogaNode)===null||t===void 0?void 0:t.getComputedWidth())!==null&&r!==void 0?r:0,height:(a=(s=e.yogaNode)===null||s===void 0?void 0:s.getComputedHeight())!==null&&a!==void 0?a:0}}});var Yc=G(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});var bpt=JCe();Object.defineProperty(vo,"render",{enumerable:!0,get:function(){return bpt.default}});var Dpt=PF();Object.defineProperty(vo,"Box",{enumerable:!0,get:function(){return Dpt.default}});var Ppt=tY();Object.defineProperty(vo,"Text",{enumerable:!0,get:function(){return Ppt.default}});var xpt=XCe();Object.defineProperty(vo,"Static",{enumerable:!0,get:function(){return xpt.default}});var kpt=$Ce();Object.defineProperty(vo,"Transform",{enumerable:!0,get:function(){return kpt.default}});var Qpt=twe();Object.defineProperty(vo,"Newline",{enumerable:!0,get:function(){return Qpt.default}});var Rpt=iwe();Object.defineProperty(vo,"Spacer",{enumerable:!0,get:function(){return Rpt.default}});var Tpt=owe();Object.defineProperty(vo,"useInput",{enumerable:!0,get:function(){return Tpt.default}});var Fpt=awe();Object.defineProperty(vo,"useApp",{enumerable:!0,get:function(){return Fpt.default}});var Npt=QF();Object.defineProperty(vo,"useStdin",{enumerable:!0,get:function(){return Npt.default}});var Opt=lwe();Object.defineProperty(vo,"useStdout",{enumerable:!0,get:function(){return Opt.default}});var Lpt=cwe();Object.defineProperty(vo,"useStderr",{enumerable:!0,get:function(){ Line truncated
`:"";return c?C+=`@IF EXIST ${c} (\r
${c} ${p} ${a} ${E}%*\r
) ELSE (\r
@SETLOCAL\r
@SET PATHEXT=%PATHEXT:;.JS;=;%\r
${f} ${p} ${a} ${E}%*\r
)\r
`:C+=`@${f} ${p} ${a} ${E}%*\r
`,C}function n0t(e,t,r){let s=Vc.relative(Vc.dirname(t),e),a=r.prog&&r.prog.split("\\").join("/"),n;s=s.split("\\").join("/");let c=Vc.isAbsolute(s)?`"${s}"`:`"$basedir/${s}"`,f=r.args||"",p=zY(r.nodePath).posix;a?(n=`"$basedir/${r.prog}"`,s=c):(a=c,f="",s="");let h=r.progArgs?`${r.progArgs.join(" ")} `:"",E=`#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\\\,/,g')")
case \`uname\` in
*CYGWIN*) basedir=\`cygpath -w "$basedir"\`;;
esac
`,C=r.nodePath?`export NODE_PATH="${p}"
`:"";return n?E+=`${C}if [ -x ${n} ]; then
exec ${n} ${f} ${s} ${h}"$@"
else
exec ${a} ${f} ${s} ${h}"$@"
fi
`:E+=`${C}${a} ${f} ${s} ${h}"$@"
exit $?
`,E}function i0t(e,t,r){let s=Vc.relative(Vc.dirname(t),e),a=r.prog&&r.prog.split("\\").join("/"),n=a&&`"${a}$exe"`,c;s=s.split("\\").join("/");let f=Vc.isAbsolute(s)?`"${s}"`:`"$basedir/${s}"`,p=r.args||"",h=zY(r.nodePath),E=h.win32,C=h.posix;n?(c=`"$basedir/${r.prog}$exe"`,s=f):(n=f,p="",s="");let S=r.progArgs?`${r.progArgs.join(" ")} `:"",x=`#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
${r.nodePath?`$env_node_path=$env:NODE_PATH
$env:NODE_PATH="${E}"
`:""}if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}`;return r.nodePath&&(x+=` else {
$env:NODE_PATH="${C}"
}`),c?x+=`
$ret=0
if (Test-Path ${c}) {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & ${c} ${p} ${s} ${S}$args
} else {
& ${c} ${p} ${s} ${S}$args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & ${n} ${p} ${s} ${S}$args
} else {
& ${n} ${p} ${s} ${S}$args
}
$ret=$LASTEXITCODE
}
${r.nodePath?`$env:NODE_PATH=$env_node_path
`:""}exit $ret
`:x+=`
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & ${n} ${p} ${s} ${S}$args
} else {
& ${n} ${p} ${s} ${S}$args
}
${r.nodePath?`$env:NODE_PATH=$env_node_path
`:""}exit $LASTEXITCODE
`,x}function s0t(e,t){return t.fs_.chmod(e,493)}function zY(e){if(!e)return{win32:"",posix:""};let t=typeof e=="string"?e.split(Vc.delimiter):Array.from(e),r={};for(let s=0;s<t.length;s++){let a=t[s].split("/").join("\\"),n=S1e()?t[s].split("\\").join("/").replace(/^([^:\\/]*):/,(c,f)=>`/mnt/${f.toLowerCase()}`):t[s];r.win32=r.win32?`${r.win32};${a}`:a,r.posix=r.posix?`${r.posix}:${n}`:n,r[s]={win32:a,posix:n}}return r}D1e.exports=JY});var fW=G((e$t,V1e)=>{V1e.exports=Ie("stream")});var X1e=G((t$t,z1e)=>{"use strict";function K1e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,s)}return r}function H0t(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?K1e(Object(r),!0).forEach(function(s){j0t(e,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K1e(Object(r)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(r,s))})}return e}function j0t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function G0t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J1e(e,t){for(var r=0;r<t.length;r++){var s=t[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function q0t(e,t,r){return t&&J1e(e.prototype,t),r&&J1e(e,r),e}var Y0t=Ie("buffer"),tN=Y0t.Buffer,W0t=Ie("util"),AW=W0t.inspect,V0t=AW&&AW.custom||"inspect";function K0t(e,t,r){tN.prototype.copy.call(e,t,r)}z1e.exports=function(){function e(){G0t(this,e),this.head=null,this.tail=null,this.length=0}return q0t(e,[{key:"push",value:function(r){var s={data:r,next:null};this.length>0?this.tail.next=s:this.head=s,this.tail=s,++this.length}},{key:"unshift",value:function(r){var s={data:r,next:this.head};this.length===0&&(this.tail=s),this.head=s,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var s=this.head,a=""+s.data;s=s.next;)a+=r+s.data;return a}},{key:"concat",value:function(r){if(this.length===0)return tN.alloc(0);for(var s=tN.allocUnsafe(r>>>0),a=this.head,n=0;a;)K0t(a.data,s,n),n+=a.data.length,a=a.next;return s}},{key:"consume",value:function(r,s){var a;return r<this.head.data.length?(a=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?a=this.shift():a=s?this._getString(r):this._getBuffer(r),a}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var s=this.head,a=1,n=s.data;for(r-=n.length;s=s.next;){var c=s.data,f=r>c.length?c.length:r;if(f===c.length?n+=c:n+=c.slice(0,r),r-=f,r===0){f===c.length?(++a,s.next?this.head=s.next:this.head=this.tail=null):(this.head=s,s.data=c.slice(f));break}++a}return this.length-=a,n}},{key:"_getBuffer",value:function(r){var s=tN.allocUnsafe(r),a=this.head,n=1;for(a.data.copy(s),r-=a.data.length;a=a.next;){var c=a.data,f=r>c.length?c.length:r;if(c.copy(s,s.length-r,0,f),r-=f,r===0){f===c.length?(++n,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=c.slice(f));break}++n}return this.length-=n,s}},{key:V0t,value:function(r,s){return AW(this,H0t({},s,{depth:0,customInspect:!1}))}}]),e}()});var hW=G((r$t,$1e)=>{"use strict";function J0t(e,t){var r=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(pW,this,e)):process.nextTick(pW,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(n){!t&&n?r._writableState?r._writableState.errorEmitted?process.nextTick(rN,r):(r._writableState.errorEmitted=!0,process.nextTick(Z1e,r,n)):process.nextTick(Z1e,r,n):t?(process.nextTick(rN,r),t(n)):process.nextTick(rN,r)}),this)}function Z1e(e,t){pW(e,t),rN(e)}function rN(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function z0t(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),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 pW(e,t){e.emit("error",t)}function X0t(e,t){var r=e._readableState,s=e._writableState;r&& Line truncated
`)),e.linkname&&(t+=jW(" linkpath="+e.linkname+`
`));var r=e.pax;if(r)for(var s in r)t+=jW(" "+s+"="+r[s]+`
`);return Buffer.from(t)};Tw.decodePax=function(e){for(var t={};e.length;){for(var r=0;r<e.length&&e[r]!==32;)r++;var s=parseInt(e.slice(0,r).toString(),10);if(!s)return t;var a=e.slice(r+1,s-1).toString(),n=a.indexOf("=");if(n===-1)return t;t[a.slice(0,n)]=a.slice(n+1),e=e.slice(s)}return t};Tw.encode=function(e){var t=Ggt(512),r=e.name,s="";if(e.typeflag===5&&r[r.length-1]!=="/"&&(r+="/"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var a=r.indexOf("/");if(a===-1)return null;s+=s?"/"+r.slice(0,a):r.slice(0,a),r=r.slice(a+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(s)>155||e.linkname&&Buffer.byteLength(e.linkname)>100?null:(t.write(r),t.write(dd(e.mode&Jgt,6),100),t.write(dd(e.uid,6),108),t.write(dd(e.gid,6),116),t.write(dd(e.size,11),124),t.write(dd(e.mtime.getTime()/1e3|0,11),136),t[156]=$2e+Zgt(e.type),e.linkname&&t.write(e.linkname,157),eBe.copy(t,AD),Wgt.copy(t,GW),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(dd(e.devmajor||0,6),329),t.write(dd(e.devminor||0,6),337),s&&t.write(s,345),t.write(dd(rBe(t),6),148),t)};Tw.decode=function(e,t,r){var s=e[156]===0?0:e[156]-$2e,a=Rw(e,0,100,t),n=gd(e,100,8),c=gd(e,108,8),f=gd(e,116,8),p=gd(e,124,12),h=gd(e,136,12),E=Xgt(s),C=e[157]===0?null:Rw(e,157,100,t),S=Rw(e,265,32),x=Rw(e,297,32),I=gd(e,329,8),T=gd(e,337,8),O=rBe(e);if(O===8*32)return null;if(O!==gd(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(eBe.compare(e,AD,AD+6)===0)e[345]&&(a=Rw(e,345,155,t)+"/"+a);else if(!(Vgt.compare(e,AD,AD+6)===0&&Kgt.compare(e,GW,GW+2)===0)){if(!r)throw new Error("Invalid tar header: unknown format.")}return s===0&&a&&a[a.length-1]==="/"&&(s=5),{name:a,mode:n,uid:c,gid:f,size:p,mtime:new Date(1e3*h),type:E,linkname:C,uname:S,gname:x,devmajor:I,devminor:T}}});var cBe=G((w$t,lBe)=>{var iBe=Ie("util"),emt=Z2e(),pD=qW(),sBe=Qw().Writable,oBe=Qw().PassThrough,aBe=function(){},nBe=function(e){return e&=511,e&&512-e},tmt=function(e,t){var r=new mN(e,t);return r.end(),r},rmt=function(e,t){return t.path&&(e.name=t.path),t.linkpath&&(e.linkname=t.linkpath),t.size&&(e.size=parseInt(t.size,10)),e.pax=t,e},mN=function(e,t){this._parent=e,this.offset=t,oBe.call(this,{autoDestroy:!1})};iBe.inherits(mN,oBe);mN.prototype.destroy=function(e){this._parent.destroy(e)};var uh=function(e){if(!(this instanceof uh))return new uh(e);sBe.call(this,e),e=e||{},this._offset=0,this._buffer=emt(),this._missing=0,this._partial=!1,this._onparse=aBe,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var t=this,r=t._buffer,s=function(){t._continue()},a=function(S){if(t._locked=!1,S)return t.destroy(S);t._stream||s()},n=function(){t._stream=null;var S=nBe(t._header.size);S?t._parse(S,c):t._parse(512,C),t._locked||s()},c=function(){t._buffer.consume(nBe(t._header.size)),t._parse(512,C),s()},f=function(){var S=t._header.size;t._paxGlobal=pD.decodePax(r.slice(0,S)),r.consume(S),n()},p=function(){var S=t._header.size;t._pax=pD.decodePax(r.slice(0,S)),t._paxGlobal&&(t._pax=Object.assign({},t._paxGlobal,t._pax)),r.consume(S),n()},h=function(){var S=t._header.size;this._gnuLongPath=pD.decodeLongPath(r.slice(0,S),e.filenameEncoding),r.consume(S),n()},E=function(){var S=t._header.size;this._gnuLongLinkPath=pD.decodeLongPath(r.slice(0,S),e.filenameEncoding),r.consume(S),n()},C=function(){var S=t._offset,x;try{x=t._header=pD.decode(r.slice(0,512),e.filenameEncoding,e.allowUnknownFormat)}catch(I){t.emit("error",I)}if(r.consume(512),!x){t._parse(512,C),s();return}if(x.type==="gnu-long-path"){t._parse(x.size,h),s();return}if(x.type==="gnu-long-link-path"){t._parse(x.size,E),s();return}if(x.type==="pax-global-header"){t._parse(x.size,f),s();return}if(x.type==="pax-header"){t._parse(x.size,p),s();return}if(t._gnuLongPath&&(x.name=t._gnuLongPath,t._gnuLongPath=null),t._gnuLongLinkPath&&(x.linkname=t._gnuLongLinkPath,t._gnuLongLinkPath=null),t._pax&&(t._header=x=rmt(x,t._pax),t._pax=null),t._locked=!0,!x.size||x.type==="directory"){t._parse(512,C),t.emit("entry",x,tmt(t,S),a);return}t._stream=new mN(t,S),t.emit("entry",x,t._stream,a),t._parse(x.size,n),s()};this._onheader=C,this._parse(512,C)};iBe.inherits(uh,sBe);uh.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.emit("close"))};uh.prototype._parse=function(e,t){this._destroyed||(this._offset+=e,this._missing=e,t===this._onheader&&(this._partial=!1),this._onparse=t)};uh.prototype._continue=function(){if(!this._destroyed){var e=this._cb;this._cb=aBe,this._overflow?this._write(this._overflow,void 0,e):e()}};uh.prototype._write=function(e,t,r){if(!this._destroyed){var s=this._stream,a=this._buffer,n=this._missing;if(e.length&&(this._partial=!0),e.length<n)return this._missing-=e.length,this._overflow=null,s?s.write(e,r):(a.append(e), Line truncated
Wanted: ${this.expectedSize}
Found: ${this.size}`);s.code="EBADSIZE",s.found=this.size,s.expected=this.expectedSize,s.sri=this.sri,this.emit("error",s)}else if(this.sri&&!r){let s=new Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${t}. (${this.size} bytes)`);s.code="EINTEGRITY",s.found=t,s.expected=this.digests,s.algorithm=this.algorithm,s.sri=this.sri,this.emit("error",s)}else this.#t=this.size,this.emit("size",this.size),this.#e=t,this.emit("integrity",t),r&&(this.#s=r,this.emit("verified",r))}},ph=class{get isHash(){return!0}constructor(t,r){let s=r?.strict;this.source=t.trim(),this.digest="",this.algorithm="",this.options=[];let a=this.source.match(s?Fmt:Tmt);if(!a||s&&!aV.includes(a[1]))return;this.algorithm=a[1],this.digest=a[2];let n=a[3];n&&(this.options=n.slice(1).split("?"))}hexDigest(){return this.digest&&Buffer.from(this.digest,"base64").toString("hex")}toJSON(){return this.toString()}match(t,r){let s=oc(t,r);if(!s)return!1;if(s.isIntegrity){let a=s.pickAlgorithm(r,[this.algorithm]);if(!a)return!1;let n=s[a].find(c=>c.digest===this.digest);return n||!1}return s.digest===this.digest?s:!1}toString(t){return t?.strict&&!(aV.includes(this.algorithm)&&this.digest.match(Rmt)&&this.options.every(r=>r.match(Nmt)))?"":`${this.algorithm}-${this.digest}${CD(this.options)}`}};function QBe(e,t,r,s){let a=e!=="",n=!1,c="",f=s.length-1;for(let h=0;h<f;h++){let E=ph.prototype.toString.call(s[h],r);E&&(n=!0,c+=E,c+=t)}let p=ph.prototype.toString.call(s[f],r);return p&&(n=!0,c+=p),a&&n?e+t+c:e+c}var ny=class{get isIntegrity(){return!0}toJSON(){return this.toString()}isEmpty(){return Object.keys(this).length===0}toString(t){let r=t?.sep||" ",s="";if(t?.strict){r=r.replace(/\S+/g," ");for(let a of aV)this[a]&&(s=QBe(s,r,t,this[a]))}else for(let a of Object.keys(this))s=QBe(s,r,t,this[a]);return s}concat(t,r){let s=typeof t=="string"?t:ED(t,r);return oc(`${this.toString(r)} ${s}`,r)}hexDigest(){return oc(this,{single:!0}).hexDigest()}merge(t,r){let s=oc(t,r);for(let a in s)if(this[a]){if(!this[a].find(n=>s[a].find(c=>n.digest===c.digest)))throw new Error("hashes do not match, cannot update integrity")}else this[a]=s[a]}match(t,r){let s=oc(t,r);if(!s)return!1;let a=s.pickAlgorithm(r,Object.keys(this));return!!a&&this[a]&&s[a]&&this[a].find(n=>s[a].find(c=>n.digest===c.digest))||!1}pickAlgorithm(t,r){let s=t?.pickAlgorithm||Gmt,a=Object.keys(this).filter(n=>r?.length?r.includes(n):!0);return a.length?a.reduce((n,c)=>s(n,c)||n):null}};BA.exports.parse=oc;function oc(e,t){if(!e)return null;if(typeof e=="string")return oV(e,t);if(e.algorithm&&e.digest){let r=new ny;return r[e.algorithm]=[e],oV(ED(r,t),t)}else return oV(ED(e,t),t)}function oV(e,t){if(t?.single)return new ph(e,t);let r=e.trim().split(/\s+/).reduce((s,a)=>{let n=new ph(a,t);if(n.algorithm&&n.digest){let c=n.algorithm;s[c]||(s[c]=[]),s[c].push(n)}return s},new ny);return r.isEmpty()?null:r}BA.exports.stringify=ED;function ED(e,t){return e.algorithm&&e.digest?ph.prototype.toString.call(e,t):typeof e=="string"?ED(oc(e,t),t):ny.prototype.toString.call(e,t)}BA.exports.fromHex=Omt;function Omt(e,t,r){let s=CD(r?.options);return oc(`${t}-${Buffer.from(e,"hex").toString("base64")}${s}`,r)}BA.exports.fromData=Lmt;function Lmt(e,t){let r=t?.algorithms||[...cV],s=CD(t?.options);return r.reduce((a,n)=>{let c=ID.createHash(n).update(e).digest("base64"),f=new ph(`${n}-${c}${s}`,t);if(f.algorithm&&f.digest){let p=f.algorithm;a[p]||(a[p]=[]),a[p].push(f)}return a},new ny)}BA.exports.fromStream=Mmt;function Mmt(e,t){let r=uV(t);return new Promise((s,a)=>{e.pipe(r),e.on("error",a),r.on("error",a);let n;r.on("integrity",c=>{n=c}),r.on("end",()=>s(n)),r.resume()})}BA.exports.checkData=Umt;function Umt(e,t,r){if(t=oc(t,r),!t||!Object.keys(t).length){if(r?.error)throw Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"});return!1}let s=t.pickAlgorithm(r),a=ID.createHash(s).update(e).digest("base64"),n=oc({algorithm:s,digest:a}),c=n.match(t,r);if(r=r||{},c||!r.error)return c;if(typeof r.size=="number"&&e.length!==r.size){let f=new Error(`data size mismatch when checking ${t}.
Wanted: ${r.size}
Found: ${e.length}`);throw f.code="EBADSIZE",f.found=e.length,f.expected=r.size,f.sri=t,f}else{let f=new Error(`Integrity checksum failed when using ${s}: Wanted ${t}, but got ${n}. (${e.length} bytes)`);throw f.code="EINTEGRITY",f.found=n,f.expected=t,f.algorithm=s,f.sri=t,f}}BA.exports.checkStream=_mt;function _mt(e,t,r){if(r=r||Object.create(null),r.integrity=t,t=oc(t,r),!t||!Object.keys(t).length)return Promise.reject(Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"}));let s=uV(r);return new Promise((a,n)=>{e.pipe(s),e.on("error",n),s.on("error",n);let c;s.on("verified",f=>{c=f}),s.on("end",()=>a(c)),s.resume()})}BA.exports.integrityStream=uV;function uV(e=Object.create(null)){return new lV(e)}BA.exports.create=Hmt;function Hmt(e){let t=e?.algorithms||[...cV],r=CD(e?.options),s=t.map(ID.createHash);return{update:function(a,n){return s.forEach(c=>c.update(a,n)),this},digest:function(){return t.reduce((n,c)=>{let f=s.shift().digest("base64"),p=new ph(`${c}-${f}${r}`,e);if(p.algorithm&&p.digest){let h=p.algorithm;n[h]||(n[h]=[]),n[h].push(p)}return n},new ny)}}}var jmt=ID.getHashes(),RBe=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(e=>jmt.includes(e));function Gmt(e,t){return RBe.indexOf(e.toLowerCase())>=RBe.indexOf(t.toLowerCase())?e:t}});var fV=G(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});yd.Signature=yd.Envelope=void 0;yd.Envelope={fromJSON(e){return{payload:QN(e.payload)?Buffer.from(FBe(e.payload)):Buffer.alloc(0),payloadType:QN(e.payloadType)?globalThis.String(e.payloadType):"",signatures:globalThis.Array.isArray(e?.signatures)?e.signatures.map(t=>yd.Signature.fromJSON(t)):[]}},toJSON(e){let t={};return e.payload.length!==0&&(t.payload=NBe(e.payload)),e.payloadType!==""&&(t.payloadType=e.payloadType),e.signatures?.length&&(t.signatures=e.signatures.map(r=>yd.Signature.toJSON(r))),t}};yd.Signature={fromJSON(e){return{sig:QN(e.sig)?Buffer.from(FBe(e.sig)):Buffer.alloc(0),keyid:QN(e.keyid)?globalThis.String(e.keyid):""}},toJSON(e){let t={};return e.sig.length!==0&&(t.sig=NBe(e.sig)),e.keyid!==""&&(t.keyid=e.keyid),t}};function FBe(e){return Uint8Array.from(globalThis.Buffer.from(e,"base64"))}function NBe(e){return globalThis.Buffer.from(e).toString("base64")}function QN(e){return e!=null}});var LBe=G(RN=>{"use strict";Object.defineProperty(RN,"__esModule",{value:!0});RN.Timestamp=void 0;RN.Timestamp={fromJSON(e){return{seconds:OBe(e.seconds)?globalThis.String(e.seconds):"0",nanos:OBe(e.nanos)?globalThis.Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!=="0"&&(t.seconds=e.seconds),e.nanos!==0&&(t.nanos=Math.round(e.nanos)),t}};function OBe(e){return e!=null}});var Uw=G(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.TimeRange=_r.X509CertificateChain=_r.SubjectAlternativeName=_r.X509Certificate=_r.DistinguishedName=_r.ObjectIdentifierValuePair=_r.ObjectIdentifier=_r.PublicKeyIdentifier=_r.PublicKey=_r.RFC3161SignedTimestamp=_r.LogId=_r.MessageSignature=_r.HashOutput=_r.SubjectAlternativeNameType=_r.PublicKeyDetails=_r.HashAlgorithm=void 0;_r.hashAlgorithmFromJSON=UBe;_r.hashAlgorithmToJSON=_Be;_r.publicKeyDetailsFromJSON=HBe;_r.publicKeyDetailsToJSON=jBe;_r.subjectAlternativeNameTypeFromJSON=GBe;_r.subjectAlternativeNameTypeToJSON=qBe;var qmt=LBe(),bl;(function(e){e[e.HASH_ALGORITHM_UNSPECIFIED=0]="HASH_ALGORITHM_UNSPECIFIED",e[e.SHA2_256=1]="SHA2_256",e[e.SHA2_384=2]="SHA2_384",e[e.SHA2_512=3]="SHA2_512",e[e.SHA3_256=4]="SHA3_256",e[e.SHA3_384=5]="SHA3_384"})(bl||(_r.HashAlgorithm=bl={}));function UBe(e){switch(e){case 0:case"HASH_ALGORITHM_UNSPECIFIED":return bl.HASH_ALGORITHM_UNSPECIFIED;case 1:case"SHA2_256":return bl.SHA2_256;case 2:case"SHA2_384":return bl.SHA2_384;case 3:case"SHA2_512":return bl.SHA2_512;case 4:case"SHA3_256":return bl.SHA3_256;case 5:case"SHA3_384":return bl.SHA3_384;default:throw new globalThis.Error("Unrecognized enum value "+e+" for enum HashAlgorithm")}}function _Be(e){switch(e){case bl.HASH_ALGORITHM_UNSPECIFIED:return"HASH_ALGORITHM_UNSPECIFIED";case bl.SHA2_256:return"SHA2_256";case bl.SHA2_384:return"SHA2_384";case bl.SHA2_512:return"SHA2_512";case bl.SHA3_256:return"SHA3_256";case bl.SHA3_384:return"SHA3_384";default:throw new globalThis.Error("Unrecognized enum value "+e+" for enum HashAlgorithm")}}var sn;(function(e){e[e.PUBLIC_KEY_DETAILS_UNSPECIFIED=0]="PUBLIC_KEY_DETAILS_UNSPECIFIED",e[e.PKCS1_RSA_PKCS1V5=1]="PKCS1_RSA_PKCS1V5",e[e.PKCS1_RSA_PSS=2]="PKCS1_RSA_PSS",e[e.PKIX_RSA_PKCS1V5=3]="PKIX_RSA_PKCS1V5",e[e.PKIX_RSA_PSS=4]="PKIX_RSA_PSS",e[e.PKIX_RSA_PKCS1V15_2048_SHA256=9]="PKIX_RSA_PKCS1V15_2048_SHA256",e[e.PKIX_RSA_PKCS1V15_3072_SHA256=10]="PKIX_RSA_PKCS1V15_3072_SHA256",e[e.PKIX_RSA_PKCS1V15_4096_SHA256=11]="PKIX_RSA_PKCS1V15_4096_SHA256",e[e.PKIX_RSA_PSS_2048_SHA256=16]="PKIX_RSA_PSS_2048_SHA256",e[e.PKIX_RSA_PSS_3072_SHA256=17]="PKIX_RSA_PSS_3072_SHA256",e[e.PKIX_RS Line truncated
`).forEach(r=>{r.match(Oyt)||r.match(Lyt)||(t+=r)}),Buffer.from(t,"base64")}function Uyt(e,t="CERTIFICATE"){let s=e.toString("base64").match(/.{1,64}/g)||"";return[`-----BEGIN ${t}-----`,...s,`-----END ${t}-----`].join(`
`).concat(`
`)}});var eO=G(qw=>{"use strict";Object.defineProperty(qw,"__esModule",{value:!0});qw.SHA2_HASH_ALGOS=qw.ECDSA_SIGNATURE_ALGOS=void 0;qw.ECDSA_SIGNATURE_ALGOS={"1.2.840.10045.4.3.1":"sha224","1.2.840.10045.4.3.2":"sha256","1.2.840.10045.4.3.3":"sha384","1.2.840.10045.4.3.4":"sha512"};qw.SHA2_HASH_ALGOS={"2.16.840.1.101.3.4.2.1":"sha256","2.16.840.1.101.3.4.2.2":"sha384","2.16.840.1.101.3.4.2.3":"sha512"}});var kV=G(tO=>{"use strict";Object.defineProperty(tO,"__esModule",{value:!0});tO.RFC3161TimestampVerificationError=void 0;var xV=class extends Error{};tO.RFC3161TimestampVerificationError=xV});var Ive=G(DA=>{"use strict";var _yt=DA&&DA.__createBinding||(Object.create?function(e,t,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(t,r);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,s,a)}:function(e,t,r,s){s===void 0&&(s=r),e[s]=t[r]}),Hyt=DA&&DA.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),jyt=DA&&DA.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&_yt(t,e,r);return Hyt(t,e),t};Object.defineProperty(DA,"__esModule",{value:!0});DA.TSTInfo=void 0;var Eve=jyt(Gw()),Gyt=eO(),qyt=kV(),QV=class{constructor(t){this.root=t}get version(){return this.root.subs[0].toInteger()}get genTime(){return this.root.subs[4].toDate()}get messageImprintHashAlgorithm(){let t=this.messageImprintObj.subs[0].subs[0].toOID();return Gyt.SHA2_HASH_ALGOS[t]}get messageImprintHashedMessage(){return this.messageImprintObj.subs[1].value}get raw(){return this.root.toDER()}verify(t){let r=Eve.digest(this.messageImprintHashAlgorithm,t);if(!Eve.bufferEqual(r,this.messageImprintHashedMessage))throw new qyt.RFC3161TimestampVerificationError("message imprint does not match artifact")}get messageImprintObj(){return this.root.subs[2]}};DA.TSTInfo=QV});var wve=G(PA=>{"use strict";var Yyt=PA&&PA.__createBinding||(Object.create?function(e,t,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(t,r);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,s,a)}:function(e,t,r,s){s===void 0&&(s=r),e[s]=t[r]}),Wyt=PA&&PA.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Vyt=PA&&PA.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Yyt(t,e,r);return Wyt(t,e),t};Object.defineProperty(PA,"__esModule",{value:!0});PA.RFC3161Timestamp=void 0;var Kyt=XN(),RV=Vyt(Gw()),Cve=eO(),DD=kV(),Jyt=Ive(),zyt="1.2.840.113549.1.7.2",Xyt="1.2.840.113549.1.9.16.1.4",Zyt="1.2.840.113549.1.9.4",TV=class e{constructor(t){this.root=t}static parse(t){let r=Kyt.ASN1Obj.parseBuffer(t);return new e(r)}get status(){return this.pkiStatusInfoObj.subs[0].toInteger()}get contentType(){return this.contentTypeObj.toOID()}get eContentType(){return this.eContentTypeObj.toOID()}get signingTime(){return this.tstInfo.genTime}get signerIssuer(){return this.signerSidObj.subs[0].value}get signerSerialNumber(){return this.signerSidObj.subs[1].value}get signerDigestAlgorithm(){let t=this.signerDigestAlgorithmObj.subs[0].toOID();return Cve.SHA2_HASH_ALGOS[t]}get signatureAlgorithm(){let t=this.signatureAlgorithmObj.subs[0].toOID();return Cve.ECDSA_SIGNATURE_ALGOS[t]}get signatureValue(){return this.signatureValueObj.value}get tstInfo(){return new Jyt.TSTInfo(this.eContentObj.subs[0].subs[0])}verify(t,r){if(!this.timeStampTokenObj)throw new DD.RFC3161TimestampVerificationError("timeStampToken is missing");if(this.contentType!==zyt)throw new DD.RFC3161TimestampVerificationError(`incorrect content type: ${this.contentType}`);if(this.eContentType!==Xyt)throw new DD.RFC3161TimestampVerificationError(`incorrect encapsulated content type: ${this.eContentType}`);this.tstInfo.verify(t),this.verifyMessageDigest(),this.verifySignature(r)}verifyMessageDigest(){let t=RV.digest(this.signerDigestAlgorithm,this.tstInfo.raw),r=this.messageDigestAttributeObj.subs[1].subs[0].value;if(!RV.bufferEqual(t,r))throw new DD.RFC3161TimestampVerificationError("signed data does not match tstInfo")}verifySignature(t){let r=this.signedAttrsObj.toDER();if(r[0]=49,!RV.verify(r,t,this.signatureValue,this.signatureAlgorithm))throw new DD.RFC3161TimestampVerificationError("signature verification failed")}get pkiStatusInfoObj(){return this.root.subs[0]}get timeStampTokenObj(){return this.root.subs[1]}get contentTypeObj(){return this.timeStampTokenObj.subs[0]}get signedDataObj(){return this.timeStampTokenObj.subs.find(r=>r.tag.isContextSpecific(0)).subs[0]}get encapContentInfoObj(){return this.signedDataObj.subs[2]}get signerInfosObj(){let t=this.signedDataObj;return t.subs[t.subs.length-1]}get sig Line truncated
globstar while`,t,S,r,x,I),this.matchOne(t.slice(S),r.slice(x),s))return this.debug("globstar found match!",S,p,I),!0;if(I==="."||I===".."||!a.dot&&I.charAt(0)==="."){this.debug("dot detected!",t,S,r,x);break}this.debug("globstar swallow a segment, and continue"),S++}return!!(s&&(this.debug(`
>>> no match, partial?`,t,S,r,x),S===p))}let T;if(typeof E=="string"?(T=C===E,this.debug("string match",E,C,T)):(T=E.test(C),this.debug("pattern match",E,C,T)),!T)return!1}if(c===p&&f===h)return!0;if(c===p)return s;if(f===h)return c===p-1&&t[c]==="";throw new Error("wtf?")}braceExpand(){return(0,hr.braceExpand)(this.pattern,this.options)}parse(t){(0,RO.assertValidPattern)(t);let r=this.options;if(t==="**")return hr.GLOBSTAR;if(t==="")return"";let s,a=null;(s=t.match(mwt))?a=r.dot?Ewt:ywt:(s=t.match(awt))?a=(r.nocase?r.dot?fwt:uwt:r.dot?cwt:lwt)(s[1]):(s=t.match(Iwt))?a=(r.nocase?r.dot?wwt:Cwt:r.dot?Bwt:vwt)(s):(s=t.match(Awt))?a=r.dot?hwt:pwt:(s=t.match(dwt))&&(a=gwt);let n=hbe.AST.fromGlob(t,this.options).toMMPattern();return a&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:a}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let r=this.options,s=r.noglobstar?bwt:r.dot?Dwt:Pwt,a=new Set(r.nocase?["i"]:[]),n=t.map(p=>{let h=p.map(E=>{if(E instanceof RegExp)for(let C of E.flags.split(""))a.add(C);return typeof E=="string"?Fwt(E):E===hr.GLOBSTAR?hr.GLOBSTAR:E._src});return h.forEach((E,C)=>{let S=h[C+1],x=h[C-1];E!==hr.GLOBSTAR||x===hr.GLOBSTAR||(x===void 0?S!==void 0&&S!==hr.GLOBSTAR?h[C+1]="(?:\\/|"+s+"\\/)?"+S:h[C]=s:S===void 0?h[C-1]=x+"(?:\\/|"+s+")?":S!==hr.GLOBSTAR&&(h[C-1]=x+"(?:\\/|\\/"+s+"\\/)"+S,h[C+1]=hr.GLOBSTAR))}),h.filter(E=>E!==hr.GLOBSTAR).join("/")}).join("|"),[c,f]=t.length>1?["(?:",")"]:["",""];n="^"+c+n+f+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...a].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,r=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&r)return!0;let s=this.options;this.isWindows&&(t=t.split("\\").join("/"));let a=this.slashSplit(t);this.debug(this.pattern,"split",a);let n=this.set;this.debug(this.pattern,"set",n);let c=a[a.length-1];if(!c)for(let f=a.length-2;!c&&f>=0;f--)c=a[f];for(let f=0;f<n.length;f++){let p=n[f],h=a;if(s.matchBase&&p.length===1&&(h=[c]),this.matchOne(h,p,r))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return hr.minimatch.defaults(t).Minimatch}};hr.Minimatch=hy;var Nwt=R7();Object.defineProperty(hr,"AST",{enumerable:!0,get:function(){return Nwt.AST}});var Owt=T7();Object.defineProperty(hr,"escape",{enumerable:!0,get:function(){return Owt.escape}});var Lwt=DO();Object.defineProperty(hr,"unescape",{enumerable:!0,get:function(){return Lwt.unescape}});hr.minimatch.AST=hbe.AST;hr.minimatch.Minimatch=hy;hr.minimatch.escape=iwt.escape;hr.minimatch.unescape=swt.unescape});var O7=G(ru=>{"use strict";var Ebe=ru&&ru.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ru,"__esModule",{value:!0});ru.SuccinctRoles=ru.DelegatedRole=ru.Role=ru.TOP_LEVEL_ROLE_NAMES=void 0;var Ibe=Ebe(Ie("crypto")),Mwt=ybe(),TO=Ebe(Ie("util")),FO=QA(),dy=hf();ru.TOP_LEVEL_ROLE_NAMES=["root","targets","snapshot","timestamp"];var jD=class e{constructor(t){let{keyIDs:r,threshold:s,unrecognizedFields:a}=t;if(Uwt(r))throw new FO.ValueError("duplicate key IDs found");if(s<1)throw new FO.ValueError("threshold must be at least 1");this.keyIDs=r,this.threshold=s,this.unrecognizedFields=a||{}}equals(t){return t instanceof e?this.threshold===t.threshold&&TO.default.isDeepStrictEqual(this.keyIDs,t.keyIDs)&&TO.default.isDeepStrictEqual(this.unrecognizedFields,t.unrecognizedFields):!1}toJSON(){return{keyids:this.keyIDs,threshold:this.threshold,...this.unrecognizedFields}}static fromJSON(t){let{keyids:r,threshold:s,...a}=t;if(!dy.guard.isStringArray(r))throw new TypeError("keyids must be an array");if(typeof s!="number")throw new TypeError("threshold must be a number");return new e({keyIDs:r,threshold:s,unrecognizedFields:a})}};ru.Role=jD;function Uwt(e){return new Set(e).size!==e.length}var F7=class e extends jD{constructor(t){super(t);let{name:r,terminating:s,paths:a,pathHashPrefixes:n}=t;if(this.name=r,this.terminating=s,t.paths&&t.pathHashPrefixes)throw new FO.ValueError("paths and pathHashPrefixes are mutually exclusive");this.paths=a,this.pathHashPrefixes=n}equals(t){return t instanceof e?super.equals(t)&&this.name===t.name&&this.terminating===t.terminating&&TO.default.isDeepStrictEqual(this.paths,t.paths)&&TO.default.isDeepStrictEqual(this.pathHashPrefixes,t.pathHashPrefixes):!1}isDelegatedPath(t){if(this.paths)return this.paths.some(r=>Hwt(t,r));if(this.pathHashPrefixes){let s=Ibe.default.createHash("sha256").update(t).digest("hex");return this.pathHashPrefixes.some(a=>s.startsWith(a))}return!1}toJSON(){let t={...super.toJSON(),name:this.name,terminating:this.terminating};return this.paths&&(t.paths=this.paths),this.pathHashPrefixes&&(t.path_hash_prefixes=this.pathHashPrefixes),t}static fro Line truncated
`).join(`
`+n),e.push(a+"m+"+WO.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=G1t()+t+" "+e[0]}function G1t(){return oo.inspectOpts.hideDate?"":new Date().toISOString()+" "}function q1t(...e){return process.stderr.write(YO.formatWithOptions(oo.inspectOpts,...e)+`
`)}function Y1t(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function W1t(){return process.env.DEBUG}function V1t(e){e.inspectOpts={};let t=Object.keys(oo.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=oo.inspectOpts[t[r]]}WO.exports=rK()(oo);var{formatters:Nbe}=WO.exports;Nbe.o=function(e){return this.inspectOpts.colors=this.useColors,YO.inspect(e,this.inspectOpts).split(`
`).map(t=>t.trim()).join(" ")};Nbe.O=function(e){return this.inspectOpts.colors=this.useColors,YO.inspect(e,this.inspectOpts)}});var iK=G((jtr,nK)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?nK.exports=Fbe():nK.exports=Obe()});var KO=G(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.DownloadHTTPError=Ji.DownloadLengthMismatchError=Ji.DownloadError=Ji.ExpiredMetadataError=Ji.EqualVersionError=Ji.BadVersionError=Ji.RepositoryError=Ji.PersistError=Ji.RuntimeError=Ji.ValueError=void 0;var sK=class extends Error{};Ji.ValueError=sK;var oK=class extends Error{};Ji.RuntimeError=oK;var aK=class extends Error{};Ji.PersistError=aK;var qD=class extends Error{};Ji.RepositoryError=qD;var VO=class extends qD{};Ji.BadVersionError=VO;var lK=class extends VO{};Ji.EqualVersionError=lK;var cK=class extends qD{};Ji.ExpiredMetadataError=cK;var YD=class extends Error{};Ji.DownloadError=YD;var uK=class extends YD{};Ji.DownloadLengthMismatchError=uK;var fK=class extends YD{constructor(t,r){super(t),this.statusCode=r}};Ji.DownloadHTTPError=fK});var Mbe=G(u1=>{"use strict";var pK=u1&&u1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(u1,"__esModule",{value:!0});u1.withTempFile=void 0;var AK=pK(Ie("fs/promises")),K1t=pK(Ie("os")),Lbe=pK(Ie("path")),J1t=async e=>z1t(async t=>e(Lbe.default.join(t,"tempfile")));u1.withTempFile=J1t;var z1t=async e=>{let t=await AK.default.realpath(K1t.default.tmpdir()),r=await AK.default.mkdtemp(t+Lbe.default.sep);try{return await e(r)}finally{await AK.default.rm(r,{force:!0,recursive:!0,maxRetries:3})}}});var dK=G(Qd=>{"use strict";var zO=Qd&&Qd.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qd,"__esModule",{value:!0});Qd.DefaultFetcher=Qd.BaseFetcher=void 0;var X1t=zO(iK()),Ube=zO(Ie("fs")),Z1t=zO(cO()),$1t=zO(Ie("util")),_be=KO(),e2t=Mbe(),t2t=(0,X1t.default)("tuf:fetch"),JO=class{async downloadFile(t,r,s){return(0,e2t.withTempFile)(async a=>{let n=await this.fetch(t),c=0,f=Ube.default.createWriteStream(a);try{for await(let p of n){let h=Buffer.from(p);if(c+=h.length,c>r)throw new _be.DownloadLengthMismatchError("Max length reached");await r2t(f,h)}}finally{await $1t.default.promisify(f.close).bind(f)()}return s(a)})}async downloadBytes(t,r){return this.downloadFile(t,r,async s=>{let a=Ube.default.createReadStream(s),n=[];for await(let c of a)n.push(c);return Buffer.concat(n)})}};Qd.BaseFetcher=JO;var hK=class extends JO{constructor(t={}){super(),this.timeout=t.timeout,this.retry=t.retry}async fetch(t){t2t("GET %s",t);let r=await(0,Z1t.default)(t,{timeout:this.timeout,retry:this.retry});if(!r.ok||!r?.body)throw new _be.DownloadHTTPError("Failed to download",r.status);return r.body}};Qd.DefaultFetcher=hK;var r2t=async(e,t)=>new Promise((r,s)=>{e.write(t,a=>{a&&s(a),r(!0)})})});var Hbe=G(XO=>{"use strict";Object.defineProperty(XO,"__esModule",{value:!0});XO.defaultConfig=void 0;XO.defaultConfig={maxRootRotations:256,maxDelegations:32,rootMaxLength:512e3,timestampMaxLength:16384,snapshotMaxLength:2e6,targetsMaxLength:5e6,prefixTargetsWithHash:!0,fetchTimeout:1e5,fetchRetries:void 0,fetchRetry:2}});var jbe=G(ZO=>{"use strict";Object.defineProperty(ZO,"__esModule",{value:!0});ZO.TrustedMetadataStore=void 0;var Bs=jO(),Hi=KO(),gK=class{constructor(t){this.trustedSet={},this.referenceTime=new Date,this.loadTrustedRoot(t)}get root(){if(!this.trustedSet.root)throw new ReferenceError("No trusted root metadata");return this.trustedSet.root}get timestamp(){return this.trustedSet.timestamp}get snapshot(){return this.trustedSet.snapshot}get targets(){return this.trustedSet.targets}getRole(t){return this.trustedSet[t]}updateRoot(t){let r=JSON.parse(t.toString("utf8")),s=Bs.Metadata.fromJSON(Bs.MetadataKind.Root,r);if(s.signed.type!=Bs.MetadataKind.Root)throw new Hi.RepositoryError(`Expected 'root', got ${s.signed.type}`);if(this.root.verifyDelegate(Bs.MetadataKind.Root,s),s.signed.version!=this.root.signed.version+1)throw new Hi.BadVersionError(`Expected version ${this.root.signed.version+1}, got ${s.signed.version}`);return s.verifyDelegate(Bs.MetadataKind.Root,s),this.trustedSet.root=s,s}updateTimestamp(t){if(this.snapshot)throw new Hi.RuntimeError("Cannot update timestamp after snapshot");if(this.root.signed.isExpired(this.referenceTime))throw new Hi.ExpiredMetadataError("Final root.json is expired");let r=JSON.parse(t.toString("utf8")),s=Bs.Metadata.fromJSON(Bs.MetadataKind.Timestamp,r);if(s.signed.type!=Bs.MetadataKind.Timestamp)throw new Hi.RepositoryError(`Expected 'timestamp', got ${s.signed.type}`);if(this.root.verifyDelegate(Bs.MetadataKind.Timestamp,s),this.timestamp){if(s.signed.version<this.timestamp.signed.version)throw new Hi.BadVersionError(`New timestamp version ${s.signed.version} is less than current version ${this.timestamp.signed.version}`);if(s.signed.version===this.timestamp.signed.version)throw new Hi.EqualVersionError(`New timestamp version ${s.sLine truncated
`,uBt=/\u2014 (\S+) (\S+)\n/g;function fBt(e,t){let r=(0,cBt.filterTLogAuthorities)(t,{targetDate:new Date(Number(e.integratedTime)*1e3)}),s=e.inclusionProof,a=MK.fromString(s.checkpoint.envelope),n=UK.fromString(a.note);if(!ABt(a,r))throw new h1.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"invalid checkpoint signature"});if(!LK.crypto.bufferEqual(n.logHash,s.rootHash))throw new h1.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"root hash mismatch"})}function ABt(e,t){let r=Buffer.from(e.note,"utf-8");return e.signatures.every(s=>{let a=t.find(n=>LK.crypto.bufferEqual(n.logID.subarray(0,4),s.keyHint));return a?LK.crypto.verify(r,a.publicKey,s.signature):!1})}var MK=class e{constructor(t,r){this.note=t,this.signatures=r}static fromString(t){if(!t.includes(OK))throw new h1.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"missing checkpoint separator"});let r=t.indexOf(OK),s=t.slice(0,r+1),n=t.slice(r+OK.length).matchAll(uBt),c=Array.from(n,f=>{let[,p,h]=f,E=Buffer.from(h,"base64");if(E.length<5)throw new h1.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"malformed checkpoint signature"});return{name:p,keyHint:E.subarray(0,4),signature:E.subarray(4)}});if(c.length===0)throw new h1.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"no signatures found in checkpoint"});return new e(s,c)}},UK=class e{constructor(t,r,s,a){this.origin=t,this.logSize=r,this.logHash=s,this.rest=a}static fromString(t){let r=t.trimEnd().split(`
`);if(r.length<3)throw new h1.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"too few lines in checkpoint header"});let s=r[0],a=BigInt(r[1]),n=Buffer.from(r[2],"base64"),c=r.slice(3);return new e(s,a,n,c)}}});var fDe=G(qK=>{"use strict";Object.defineProperty(qK,"__esModule",{value:!0});qK.verifyMerkleInclusion=dBt;var GK=xl(),HK=bo(),pBt=Buffer.from([0]),hBt=Buffer.from([1]);function dBt(e){let t=e.inclusionProof,r=BigInt(t.logIndex),s=BigInt(t.treeSize);if(r<0n||r>=s)throw new HK.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:`invalid index: ${r}`});let{inner:a,border:n}=gBt(r,s);if(t.hashes.length!==a+n)throw new HK.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"invalid hash count"});let c=t.hashes.slice(0,a),f=t.hashes.slice(a),p=wBt(e.canonicalizedBody),h=yBt(mBt(p,c,r),f);if(!GK.crypto.bufferEqual(h,t.rootHash))throw new HK.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"calculated root hash does not match inclusion proof"})}function gBt(e,t){let r=EBt(e,t),s=IBt(e>>BigInt(r));return{inner:r,border:s}}function mBt(e,t,r){return t.reduce((s,a,n)=>r>>BigInt(n)&BigInt(1)?jK(a,s):jK(s,a),e)}function yBt(e,t){return t.reduce((r,s)=>jK(s,r),e)}function EBt(e,t){return CBt(e^t-BigInt(1))}function IBt(e){return e.toString(2).split("1").length-1}function CBt(e){return e===0n?0:e.toString(2).length}function jK(e,t){return GK.crypto.digest("sha256",hBt,e,t)}function wBt(e){return GK.crypto.digest("sha256",pBt,e)}});var pDe=G(YK=>{"use strict";Object.defineProperty(YK,"__esModule",{value:!0});YK.verifyTLogSET=SBt;var ADe=xl(),BBt=bo(),vBt=Ey();function SBt(e,t){if(!(0,vBt.filterTLogAuthorities)(t,{logID:e.logId.keyId,targetDate:new Date(Number(e.integratedTime)*1e3)}).some(a=>{let n=bBt(e),c=Buffer.from(ADe.json.canonicalize(n),"utf8"),f=e.inclusionPromise.signedEntryTimestamp;return ADe.crypto.verify(c,a.publicKey,f)}))throw new BBt.VerificationError({code:"TLOG_INCLUSION_PROMISE_ERROR",message:"inclusion promise could not be verified"})}function bBt(e){let{integratedTime:t,logIndex:r,logId:s,canonicalizedBody:a}=e;return{body:a.toString("base64"),integratedTime:Number(t),logIndex:Number(r),logID:s.keyId.toString("hex")}}});var hDe=G(KK=>{"use strict";Object.defineProperty(KK,"__esModule",{value:!0});KK.verifyRFC3161Timestamp=xBt;var WK=xl(),VK=bo(),DBt=FK(),PBt=Ey();function xBt(e,t,r){let s=e.signingTime;if(r=(0,PBt.filterCertAuthorities)(r,{start:s,end:s}),r=QBt(r,{serialNumber:e.signerSerialNumber,issuer:e.signerIssuer}),!r.some(n=>{try{return kBt(e,t,n),!0}catch{return!1}}))throw new VK.VerificationError({code:"TIMESTAMP_ERROR",message:"timestamp could not be verified"})}function kBt(e,t,r){let[s,...a]=r.certChain,n=WK.crypto.createPublicKey(s.publicKey),c=e.signingTime;try{new DBt.CertificateChainVerifier({untrustedCert:s,trustedCerts:a}).verify()}catch{throw new VK.VerificationError({code:"TIMESTAMP_ERROR",message:"invalid certificate chain"})}if(!r.certChain.every(p=>p.validForDate(c)))throw new VK.VerificationError({code:"TIMESTAMP_ERROR",message:"timestamp was signed with an expired certificate"});e.verify(t,n)}function QBt(e,t){return e.filter(r=>r.certChain.length>0&&WK.crypto.bufferEqual(r.certChain[0].serialNumber,t.serialNumber)&&WK.crypto.bufferEqual(r.certChain[0].issuer,t.issuer))}});var dDe=G(AL=>{"use strict";Object.defineProperty(AL,"__esModule",{value:!0});AL.verifyTSATimestamp=LBt;AL.verifyTLogTimestamp=MBt;var RBt=bo(),TBt=uDe(),FBt=fDe(),NBt=pDe(),OBt=hDe();function LBt(e,t,r){return(0,OBt.verifyRFC3161Timestamp)(e,t,r),{type:"timestamp-authority",logID:e.signerSerialNumber,timestamp:e.signingTime}}function MBt(e,t){let r=!1;if(UBt(e)&&((0,NBt.verifyTLogSET)(e,t),r=!0),_Bt(e)&&((0,FBt.verifyMerkleInclusion)(e),(0,TBt.verifyCheckpoint)(e,t),r=!0),!r)throw new RBt.VerificationError({code:"TLOG_MISSING_INCLUSION_ERROR",message:"inclusion could not be verified"});return{type:"transparency-log",logID:e.logId.keyId,timestamp:new Date(Number(e.integratedTime)*1e3)}}function UBt(e){return e.inclusionPromise!==void 0}function _Bt(e){return e.inclusionProof!==void 0}});var gDe=G(JK=>{"use strict";Object.defineProperty(JK,"__esModule",{value:!0});JK.verifyDSSETLogBody=HBt;var pL=bo();function HBt(e,t){switch(e.apiVersion){case"0.0.1":return jBt(e,t);default:throw new pL.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported dsse version: ${e.apiVersion}`})}}function jBt(e,t){if(e.spec.signatures?.length!==1)throw new pL.VerificationError({code:"TLOG_BODY_ERROR",message:"signature count mismatch"});let r=e.spec.signatures[0].signature;if(!t.compareSignature(Buffer.from(r,"base64")))throw new pL.VerificationError({code:"TLOG_BODY_ERROR",message:"tlog entry signature mismatch"});let s=e.spec.payloadHash?.value||"";if(!t.compareDigest(Buffer.from(s,"hex")))throw new pL.VerificationError({code:"TLOG_BODY_ERROR",message:"DSSE payload hash mismatch"})}});var mDe=G(XK=>{"use strict";Object.defineProperty(XK,"__esModule",{value:!0});XK.verify Line truncated
Try running the command again with the package name prefixed: ${ce.pretty(r,"yarn add",ce.Type.CODE)} ${ce.pretty(r,j.makeDescriptor(j.makeIdent(null,"my-package"),`${ie[0]}...`),ce.Type.DESCRIPTOR)}`);if(!$)throw new st(`The ${ce.pretty(r,V,ce.Type.CODE)} string didn't match the required format (package-name@range). Did you perhaps forget to explicitly reference the package name?`);let fe=aot(a,$,{dev:this.dev,peer:this.peer,preferDev:this.preferDev,optional:this.optional});return await Promise.all(fe.map(async ge=>{let he=await eS($,{project:s,workspace:a,cache:n,fixed:c,target:ge,modifier:h,strategies:E,maxResults:C});return{request:$,suggestedDescriptors:he,target:ge}}))})).then(V=>V.flat()),I=await fA.start({configuration:r,stdout:this.context.stdout,suggestInstall:!1},async V=>{for(let{request:$,suggestedDescriptors:{suggestions:ie,rejections:fe}}of x)if(ie.filter(ge=>ge.descriptor!==null).length===0){let[ge]=fe;if(typeof ge>"u")throw new Error("Assertion failed: Expected an error to have been set");s.configuration.get("enableNetwork")?V.reportError(27,`${j.prettyDescriptor(r,$)} can't be resolved to a satisfying range`):V.reportError(27,`${j.prettyDescriptor(r,$)} can't be resolved to a satisfying range (note: network resolution has been disabled)`),V.reportSeparator(),V.reportExceptionOnce(ge)}});if(I.hasErrors())return I.exitCode();let T=!1,O=[],U=[];for(let{suggestedDescriptors:{suggestions:V},target:$}of x){let ie,fe=V.filter(Ce=>Ce.descriptor!==null),ae=fe[0].descriptor,ge=fe.every(Ce=>j.areDescriptorsEqual(Ce.descriptor,ae));fe.length===1||ge?ie=ae:(T=!0,{answer:ie}=await(0,lge.prompt)({type:"select",name:"answer",message:"Which range do you want to use?",choices:V.map(({descriptor:Ce,name:Ee,reason:d})=>Ce?{name:Ee,hint:d,descriptor:Ce}:{name:Ee,hint:d,disabled:!0}),onCancel:()=>process.exit(130),result(Ce){return this.find(Ce,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let he=a.manifest[$].get(ie.identHash);(typeof he>"u"||he.descriptorHash!==ie.descriptorHash)&&(a.manifest[$].set(ie.identHash,ie),this.optional&&($==="dependencies"?a.manifest.ensureDependencyMeta({...ie,range:"unknown"}).optional=!0:$==="peerDependencies"&&(a.manifest.ensurePeerDependencyMeta({...ie,range:"unknown"}).optional=!0)),typeof he>"u"?O.push([a,$,ie,E]):U.push([a,$,he,ie]))}return await r.triggerMultipleHooks(V=>V.afterWorkspaceDependencyAddition,O),await r.triggerMultipleHooks(V=>V.afterWorkspaceDependencyReplacement,U),T&&this.context.stdout.write(`
`),await s.installWithNewReport({json:this.json,stdout:this.context.stdout,quiet:this.context.quiet},{cache:n,mode:this.mode})}};function aot(e,t,{dev:r,peer:s,preferDev:a,optional:n}){let c=e.manifest.dependencies.has(t.identHash),f=e.manifest.devDependencies.has(t.identHash),p=e.manifest.peerDependencies.has(t.identHash);if((r||s)&&c)throw new st(`Package "${j.prettyIdent(e.project.configuration,t)}" is already listed as a regular dependency - remove the -D,-P flags or remove it from your dependencies first`);if(!r&&!s&&p)throw new st(`Package "${j.prettyIdent(e.project.configuration,t)}" is already listed as a peer dependency - use either of -D or -P, or remove it from your peer dependencies first`);if(n&&f)throw new st(`Package "${j.prettyIdent(e.project.configuration,t)}" is already listed as a dev dependency - remove the -O flag or remove it from your dev dependencies first`);if(n&&!s&&p)throw new st(`Package "${j.prettyIdent(e.project.configuration,t)}" is already listed as a peer dependency - remove the -O flag or add the -P flag or remove it from your peer dependencies first`);if((r||a)&&n)throw new st(`Package "${j.prettyIdent(e.project.configuration,t)}" cannot simultaneously be a dev dependency and an optional dependency`);let h=[];return s&&h.push("peerDependencies"),(r||a)&&h.push("devDependencies"),n&&h.push("dependencies"),h.length>0?h:f?["devDependencies"]:p?["peerDependencies"]:["dependencies"]}Ge();Ge();jt();var $I=class extends ft{constructor(){super(...arguments);this.verbose=pe.Boolean("-v,--verbose",!1,{description:"Print both the binary name and the locator of the package that provides the binary"});this.json=pe.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.name=pe.String({required:!1})}static{this.paths=[["bin"]]}static{this.usage=it.Usage({description:"get the path to a binary script",details:`
When used without arguments, this command will print the list of all the binaries available in the current workspace. Adding the \`-v,--verbose\` flag will cause the output to contain both the binary name and the locator of the package that provides the binary.
When an argument is specified, this command will just print the path to the binary on the standard output and exit. Note that the reported path may be stored within a zip archive.
`,examples:[["List all the available binaries","$0 bin"],["Print the path to a specific binary","$0 bin eslint"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,locator:a}=await Rt.find(r,this.context.cwd);if(await s.restoreInstallState(),this.name){let f=(await wn.getPackageAccessibleBinaries(a,{project:s})).get(this.name);if(!f)throw new st(`Couldn't find a binary named "${this.name}" for package "${j.prettyLocator(r,a)}"`);let[,p]=f;return this.context.stdout.write(`${p}
`),0}return(await Ft.start({configuration:r,json:this.json,stdout:this.context.stdout},async c=>{let f=await wn.getPackageAccessibleBinaries(a,{project:s}),h=Array.from(f.keys()).reduce((E,C)=>Math.max(E,C.length),0);for(let[E,[C,S]]of f)c.reportJson({name:E,source:j.stringifyIdent(C),path:S});if(this.verbose)for(let[E,[C]]of f)c.reportInfo(null,`${E.padEnd(h," ")} ${j.prettyLocator(r,C)}`);else for(let E of f.keys())c.reportInfo(null,E)})).exitCode()}};Ge();bt();jt();var eC=class extends ft{constructor(){super(...arguments);this.mirror=pe.Boolean("--mirror",!1,{description:"Remove the global cache files instead of the local cache files"});this.all=pe.Boolean("--all",!1,{description:"Remove both the global cache files and the local cache files of the current project"})}static{this.paths=[["cache","clean"],["cache","clear"]]}static{this.usage=it.Usage({description:"remove the shared cache files",details:`
This command will remove all the files from the cache.
`,examples:[["Remove all the local archives","$0 cache clean"],["Remove all the archives stored in the ~/.yarn directory","$0 cache clean --mirror"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins);if(!r.get("enableCacheClean"))throw new st("Cache cleaning is currently disabled. To enable it, set `enableCacheClean: true` in your configuration file. Note: Cache cleaning is typically not required and should be avoided when using Zero-Installs.");let s=await zr.find(r);return(await Ft.start({configuration:r,stdout:this.context.stdout},async()=>{let n=(this.all||this.mirror)&&s.mirrorCwd!==null,c=!this.mirror;n&&(await le.removePromise(s.mirrorCwd),await r.triggerHook(f=>f.cleanGlobalArtifacts,r)),c&&await le.removePromise(s.cwd)})).exitCode()}};Ge();jt();Xl();var m5=Ie("util"),tC=class extends ft{constructor(){super(...arguments);this.why=pe.Boolean("--why",!1,{description:"Print the explanation for why a setting has its value"});this.json=pe.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.unsafe=pe.Boolean("--no-redacted",!1,{description:"Don't redact secrets (such as tokens) from the output"});this.name=pe.String()}static{this.paths=[["config","get"]]}static{this.usage=it.Usage({description:"read a configuration settings",details:`
This command will print a configuration setting.
Secrets (such as tokens) will be redacted from the output by default. If this behavior isn't desired, set the \`--no-redacted\` to get the untransformed value.
`,examples:[["Print a simple configuration setting","yarn config get yarnPath"],["Print a complex configuration setting","yarn config get packageExtensions"],["Print a nested field from the configuration",`yarn config get 'npmScopes["my-company"].npmRegistryServer'`],["Print a token from the configuration","yarn config get npmAuthToken --no-redacted"],["Print a configuration setting as JSON","yarn config get packageExtensions --json"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),s=this.name.replace(/[.[].*$/,""),a=this.name.replace(/^[^.[]*/,"");if(typeof r.settings.get(s)>"u")throw new st(`Couldn't find a configuration settings named "${s}"`);let c=r.getSpecial(s,{hideSecrets:!this.unsafe,getNativePaths:!0}),f=qe.convertMapsToIndexableObjects(c),p=a?xa(f,a):f,h=await Ft.start({configuration:r,includeFooter:!1,json:this.json,stdout:this.context.stdout},async E=>{E.reportJson(p)});if(!this.json){if(typeof p=="string")return this.context.stdout.write(`${p}
`),h.exitCode();m5.inspect.styles.name="cyan",this.context.stdout.write(`${(0,m5.inspect)(p,{depth:1/0,colors:r.get("enableColors"),compact:!1})}
`)}return h.exitCode()}};Ge();jt();Xl();var y5=Ie("util"),rC=class extends ft{constructor(){super(...arguments);this.json=pe.Boolean("--json",!1,{description:"Set complex configuration settings to JSON values"});this.home=pe.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=pe.String();this.value=pe.String()}static{this.paths=[["config","set"]]}static{this.usage=it.Usage({description:"change a configuration settings",details:`
This command will set a configuration setting.
When used without the \`--json\` flag, it can only set a simple configuration setting (a string, a number, or a boolean).
When used with the \`--json\` flag, it can set both simple and complex configuration settings, including Arrays and Objects.
`,examples:[["Set a simple configuration setting (a string, a number, or a boolean)","yarn config set initScope myScope"],["Set a simple configuration setting (a string, a number, or a boolean) using the `--json` flag",'yarn config set initScope --json \\"myScope\\"'],["Set a complex configuration setting (an Array) using the `--json` flag",`yarn config set unsafeHttpWhitelist --json '["*.example.com", "example.com"]'`],["Set a complex configuration setting (an Object) using the `--json` flag",`yarn config set packageExtensions --json '{ "@babel/parser@*": { "dependencies": { "@babel/types": "*" } } }'`],["Set a nested configuration setting",'yarn config set npmScopes.company.npmRegistryServer "https://npm.example.com"'],["Set a nested configuration setting using indexed access for non-simple keys",`yarn config set 'npmRegistries["//npm.example.com"].npmAuthToken' "ffffffff-ffff-ffff-ffff-ffffffffffff"`]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),s=()=>{if(!r.projectCwd)throw new st("This command must be run from within a project folder");return r.projectCwd},a=this.name.replace(/[.[].*$/,""),n=this.name.replace(/^[^.[]*\.?/,"");if(typeof r.settings.get(a)>"u")throw new st(`Couldn't find a configuration settings named "${a}"`);if(a==="enableStrictSettings")throw new st("This setting only affects the file it's in, and thus cannot be set from the CLI");let f=this.json?JSON.parse(this.value):this.value;await(this.home?I=>Je.updateHomeConfiguration(I):I=>Je.updateConfiguration(s(),I))(I=>{if(n){let T=p0(I);return Jg(T,this.name,f),T}else return{...I,[a]:f}});let E=(await Je.find(this.context.cwd,this.context.plugins)).getSpecial(a,{hideSecrets:!0,getNativePaths:!0}),C=qe.convertMapsToIndexableObjects(E),S=n?xa(C,n):C;return(await Ft.start({configuration:r,includeFooter:!1,stdout:this.context.stdout},async I=>{y5.inspect.styles.name="cyan",I.reportInfo(0,`Successfully set ${this.name} to ${(0,y5.inspect)(S,{depth:1/0,colors:r.get("enableColors"),compact:!1})}`)})).exitCode()}};Ge();jt();Xl();var nC=class extends ft{constructor(){super(...arguments);this.home=pe.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=pe.String()}static{this.paths=[["config","unset"]]}static{this.usage=it.Usage({description:"unset a configuration setting",details:`
This command will unset a configuration setting.
`,examples:[["Unset a simple configuration setting","yarn config unset initScope"],["Unset a complex configuration setting","yarn config unset packageExtensions"],["Unset a nested configuration setting","yarn config unset npmScopes.company.npmRegistryServer"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),s=()=>{if(!r.projectCwd)throw new st("This command must be run from within a project folder");return r.projectCwd},a=this.name.replace(/[.[].*$/,""),n=this.name.replace(/^[^.[]*\.?/,"");if(typeof r.settings.get(a)>"u")throw new st(`Couldn't find a configuration settings named "${a}"`);let f=this.home?h=>Je.updateHomeConfiguration(h):h=>Je.updateConfiguration(s(),h);return(await Ft.start({configuration:r,includeFooter:!1,stdout:this.context.stdout},async h=>{let E=!1;await f(C=>{if(!IB(C,this.name))return h.reportWarning(0,`Configuration doesn't contain setting ${this.name}; there is nothing to unset`),E=!0,C;let S=n?p0(C):{...C};return h0(S,this.name),S}),E||h.reportInfo(0,`Successfully unset ${this.name}`)})).exitCode()}};Ge();bt();jt();var jT=Ie("util"),iC=class extends ft{constructor(){super(...arguments);this.noDefaults=pe.Boolean("--no-defaults",!1,{description:"Omit the default values from the display"});this.json=pe.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.verbose=pe.Boolean("-v,--verbose",{hidden:!0});this.why=pe.Boolean("--why",{hidden:!0});this.names=pe.Rest()}static{this.paths=[["config"]]}static{this.usage=it.Usage({description:"display the current configuration",details:`
This command prints the current active configuration settings.
`,examples:[["Print the active configuration settings","$0 config"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins,{strict:!1}),s=await kI({configuration:r,stdout:this.context.stdout,forceError:this.json},[{option:this.verbose,message:"The --verbose option is deprecated, the settings' descriptions are now always displayed"},{option:this.why,message:"The --why option is deprecated, the settings' sources are now always displayed"}]);if(s!==null)return s;let a=this.names.length>0?[...new Set(this.names)].sort():[...r.settings.keys()].sort(),n,c=await Ft.start({configuration:r,json:this.json,stdout:this.context.stdout,includeFooter:!1},async f=>{if(r.invalid.size>0&&!this.json){for(let[p,h]of r.invalid)f.reportError(34,`Invalid configuration key "${p}" in ${h}`);f.reportSeparator()}if(this.json)for(let p of a){if(this.noDefaults&&!r.sources.has(p))continue;let h=r.settings.get(p);typeof h>"u"&&f.reportError(34,`No configuration key named "${p}"`);let E=r.getSpecial(p,{hideSecrets:!0,getNativePaths:!0}),C=r.sources.get(p)??"<default>",S=C&&C[0]!=="<"?Ae.fromPortablePath(C):C;f.reportJson({key:p,effective:E,source:S,...h})}else{let p={breakLength:1/0,colors:r.get("enableColors"),maxArrayLength:2},h={},E={children:h};for(let C of a){if(this.noDefaults&&!r.sources.has(C))continue;let S=r.settings.get(C),x=r.sources.get(C)??"<default>",I=r.getSpecial(C,{hideSecrets:!0,getNativePaths:!0}),T={Description:{label:"Description",value:ce.tuple(ce.Type.MARKDOWN,{text:S.description,format:this.cli.format(),paragraphs:!1})},Source:{label:"Source",value:ce.tuple(x[0]==="<"?ce.Type.CODE:ce.Type.PATH,x)}};h[C]={value:ce.tuple(ce.Type.CODE,C),children:T};let O=(U,V)=>{for(let[$,ie]of V)if(ie instanceof Map){let fe={};U[$]={children:fe},O(fe,ie)}else U[$]={label:$,value:ce.tuple(ce.Type.NO_HINT,(0,jT.inspect)(ie,p))}};I instanceof Map?O(T,I):T.Value={label:"Value",value:ce.tuple(ce.Type.NO_HINT,(0,jT.inspect)(I,p))}}a.length!==1&&(n=void 0),ts.emitTree(E,{configuration:r,json:this.json,stdout:this.context.stdout,separators:2})}});if(!this.json&&typeof n<"u"){let f=a[0],p=(0,jT.inspect)(r.getSpecial(f,{hideSecrets:!0,getNativePaths:!0}),{colors:r.get("enableColors")});this.context.stdout.write(`
`),this.context.stdout.write(`${p}
`)}return c.exitCode()}};Ge();jt();Jo();var GT={};Vt(GT,{Strategy:()=>tS,acceptedStrategies:()=>lot,dedupe:()=>E5});Ge();Ge();var cge=et(Xo()),tS=(t=>(t.HIGHEST="highest",t))(tS||{}),lot=new Set(Object.values(tS)),cot={highest:async(e,t,{resolver:r,fetcher:s,resolveOptions:a,fetchOptions:n})=>{let c=new Map;for(let[p,h]of e.storedResolutions){let E=e.storedDescriptors.get(p);if(typeof E>"u")throw new Error(`Assertion failed: The descriptor (${p}) should have been registered`);qe.getSetWithDefault(c,E.identHash).add(h)}let f=new Map(qe.mapAndFilter(e.storedDescriptors.values(),p=>j.isVirtualDescriptor(p)?qe.mapAndFilter.skip:[p.descriptorHash,qe.makeDeferred()]));for(let p of e.storedDescriptors.values()){let h=f.get(p.descriptorHash);if(typeof h>"u")throw new Error(`Assertion failed: The descriptor (${p.descriptorHash}) should have been registered`);let E=e.storedResolutions.get(p.descriptorHash);if(typeof E>"u")throw new Error(`Assertion failed: The resolution (${p.descriptorHash}) should have been registered`);let C=e.originalPackages.get(E);if(typeof C>"u")throw new Error(`Assertion failed: The package (${E}) should have been registered`);Promise.resolve().then(async()=>{let S=r.getResolutionDependencies(p,a),x=Object.fromEntries(await qe.allSettledSafe(Object.entries(S).map(async([$,ie])=>{let fe=f.get(ie.descriptorHash);if(typeof fe>"u")throw new Error(`Assertion failed: The descriptor (${ie.descriptorHash}) should have been registered`);let ae=await fe.promise;if(!ae)throw new Error("Assertion failed: Expected the dependency to have been through the dedupe process itself");return[$,ae.updatedPackage]})));if(t.length&&!cge.default.isMatch(j.stringifyIdent(p),t)||!r.shouldPersistResolution(C,a))return C;let I=c.get(p.identHash);if(typeof I>"u")throw new Error(`Assertion failed: The resolutions (${p.identHash}) should have been registered`);if(I.size===1)return C;let T=[...I].map($=>{let ie=e.originalPackages.get($);if(typeof ie>"u")throw new Error(`Assertion failed: The package (${$}) should have been registered`);return ie}),O=await r.getSatisfying(p,x,T,a),U=O.locators?.[0];if(typeof U>"u"||!O.sorted)return C;let V=e.originalPackages.get(U.locatorHash);if(typeof V>"u")throw new Error(`Assertion failed: The package (${U.locatorHash}) should have been registered`);return V}).then(async S=>{let x=await e.preparePackage(S,{resolver:r,resolveOptions:a});h.resolve({descriptor:p,currentPackage:C,updatedPackage:S,resolvedPackage:x})}).catch(S=>{h.reject(S)})}return[...f.values()].map(p=>p.promise)}};async function E5(e,{strategy:t,patterns:r,cache:s,report:a}){let{configuration:n}=e,c=new Qi,f=n.makeResolver(),p=n.makeFetcher(),h={cache:s,checksums:e.storedChecksums,fetcher:p,project:e,report:c,cacheOptions:{skipIntegrityCheck:!0}},E={project:e,resolver:f,report:c,fetchOptions:h};return await a.startTimerPromise("Deduplication step",async()=>{let C=cot[t],S=await C(e,r,{resolver:f,resolveOptions:E,fetcher:p,fetchOptions:h}),x=Io.progressViaCounter(S.length);await a.reportProgress(x);let I=0;await Promise.all(S.map(U=>U.then(V=>{if(V===null||V.currentPackage.locatorHash===V.updatedPackage.locatorHash)return;I++;let{descriptor:$,currentPackage:ie,updatedPackage:fe}=V;a.reportInfo(0,`${j.prettyDescriptor(n,$)} can be deduped from ${j.prettyLocator(n,ie)} to ${j.prettyLocator(n,fe)}`),a.reportJson({descriptor:j.stringifyDescriptor($),currentResolution:j.stringifyLocator(ie),updatedResolution:j.stringifyLocator(fe)}),e.storedResolutions.set($.descriptorHash,fe.locatorHash)}).finally(()=>x.tick())));let T;switch(I){case 0:T="No packages";break;case 1:T="One package";break;default:T=`${I} packages`}let O=ce.pretty(n,t,ce.Type.CODE);return a.reportInfo(0,`${T} can be deduped using the ${O} strategy`),I})}var sC=class extends ft{constructor(){super(...arguments);this.strategy=pe.String("-s,--strategy","highest",{description:"The strategy to use when deduping dependencies",validator:Qs(tS)});this.check=pe.Boolean("-c,--check",!1,{description:"Exit with exit code 1 when duplicates are found, without persisting the dependency tree"});this.json=pe.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.mode=pe.String("--mode",{description:"Change what artifacts installs generate",validator:Qs(La)});this.patterns=pe.Rest()}static{this.paths=[["dedupe"]]}static{this.usage=it.Usage({description:"deduplicate dependencies with overlapping ranges",details:"\n Duplicates are defined as descriptors with overlapping ranges being resolved and locked to different locators. They are a natural consequence of Yarn's deterministic installs, but they can sometimes pile up and unnecessarily increase the size of your project.\n\n This command dedupes dependencies in the current project using different strategies (only one is implemented at the moment):\n\n - `highest`: Reuses (where possible) the locators with the highest versions. This means that dependencies can only be upgraded, never downgraded. Line truncated
`)}};var aC=class extends ft{static{this.paths=[["help"],["--help"],["-h"]]}async execute(){this.context.stdout.write(this.cli.usage(null))}};Ge();bt();jt();var lC=class extends ft{constructor(){super(...arguments);this.leadingArgument=pe.String();this.args=pe.Proxy()}async execute(){if(this.leadingArgument.match(/[\\/]/)&&!j.tryParseIdent(this.leadingArgument)){let r=K.resolve(this.context.cwd,Ae.toPortablePath(this.leadingArgument));return await this.cli.run(this.args,{cwd:r})}else return await this.cli.run(["run",this.leadingArgument,...this.args])}};Ge();var cC=class extends ft{static{this.paths=[["-v"],["--version"]]}async execute(){this.context.stdout.write(`${An||"<unknown>"}
`)}};Ge();Ge();jt();var uC=class extends ft{constructor(){super(...arguments);this.commandName=pe.String();this.args=pe.Proxy()}static{this.paths=[["exec"]]}static{this.usage=it.Usage({description:"execute a shell script",details:`
This command simply executes a shell script within the context of the root directory of the active workspace using the portable shell.
It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment).
`,examples:[["Execute a single shell command","$0 exec echo Hello World"],["Execute a shell script",'$0 exec "tsc & babel src --out-dir lib"']]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,locator:a}=await Rt.find(r,this.context.cwd);return await s.restoreInstallState(),await wn.executePackageShellcode(a,this.commandName,this.args,{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,project:s})}};Ge();jt();Jo();var fC=class extends ft{constructor(){super(...arguments);this.hash=pe.String({required:!1,validator:l0(Jf(),[Sp(/^p[0-9a-f]{6}$/)])})}static{this.paths=[["explain","peer-requirements"]]}static{this.usage=it.Usage({description:"explain a set of peer requirements",details:`
A peer requirement represents all peer requests that a subject must satisfy when providing a requested package to requesters.
When the hash argument is specified, this command prints a detailed explanation of the peer requirement corresponding to the hash and whether it is satisfied or not.
When used without arguments, this command lists all peer requirements and the corresponding hash that can be used to get detailed information about a given requirement.
**Note:** A hash is a seven-letter code consisting of the letter 'p' followed by six characters that can be obtained from peer dependency warnings or from the list of all peer requirements(\`yarn explain peer-requirements\`).
`,examples:[["Explain the corresponding peer requirement for a hash","$0 explain peer-requirements p1a4ed"],["List all peer requirements","$0 explain peer-requirements"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s}=await Rt.find(r,this.context.cwd);return await s.restoreInstallState({restoreResolutions:!1}),await s.applyLightResolution(),typeof this.hash<"u"?await fot(this.hash,s,{stdout:this.context.stdout}):await Aot(s,{stdout:this.context.stdout})}};async function fot(e,t,r){let s=t.peerRequirementNodes.get(e);if(typeof s>"u")throw new Error(`No peerDependency requirements found for hash: "${e}"`);let a=new Set,n=p=>a.has(p.requester.locatorHash)?{value:ce.tuple(ce.Type.DEPENDENT,{locator:p.requester,descriptor:p.descriptor}),children:p.children.size>0?[{value:ce.tuple(ce.Type.NO_HINT,"...")}]:[]}:(a.add(p.requester.locatorHash),{value:ce.tuple(ce.Type.DEPENDENT,{locator:p.requester,descriptor:p.descriptor}),children:Object.fromEntries(Array.from(p.children.values(),h=>[j.stringifyLocator(h.requester),n(h)]))}),c=t.peerWarnings.find(p=>p.hash===e);return(await Ft.start({configuration:t.configuration,stdout:r.stdout,includeFooter:!1,includePrefix:!1},async p=>{let h=ce.mark(t.configuration),E=c?h.Cross:h.Check;if(p.reportInfo(0,`Package ${ce.pretty(t.configuration,s.subject,ce.Type.LOCATOR)} is requested to provide ${ce.pretty(t.configuration,s.ident,ce.Type.IDENT)} by its descendants`),p.reportSeparator(),p.reportInfo(0,ce.pretty(t.configuration,s.subject,ce.Type.LOCATOR)),ts.emitTree({children:Object.fromEntries(Array.from(s.requests.values(),C=>[j.stringifyLocator(C.requester),n(C)]))},{configuration:t.configuration,stdout:r.stdout,json:!1}),p.reportSeparator(),s.provided.range==="missing:"){let C=c?"":" , but all peer requests are optional";p.reportInfo(0,`${E} Package ${ce.pretty(t.configuration,s.subject,ce.Type.LOCATOR)} does not provide ${ce.pretty(t.configuration,s.ident,ce.Type.IDENT)}${C}.`)}else{let C=t.storedResolutions.get(s.provided.descriptorHash);if(!C)throw new Error("Assertion failed: Expected the descriptor to be registered");let S=t.storedPackages.get(C);if(!S)throw new Error("Assertion failed: Expected the package to be registered");p.reportInfo(0,`${E} Package ${ce.pretty(t.configuration,s.subject,ce.Type.LOCATOR)} provides ${ce.pretty(t.configuration,s.ident,ce.Type.IDENT)} with version ${j.prettyReference(t.configuration,S.version??"0.0.0")}, ${c?"which does not satisfy all requests.":"which satisfies all requests"}`),c?.type===3&&(c.range?p.reportInfo(0,` The combined requested range is ${ce.pretty(t.configuration,c.range,ce.Type.RANGE)}`):p.reportInfo(0," Unfortunately, the requested ranges have no overlap"))}})).exitCode()}async function Aot(e,t){return(await Ft.start({configuration:e.configuration,stdout:t.stdout,includeFooter:!1,includePrefix:!1},async s=>{let a=ce.mark(e.configuration),n=qe.sortMap(e.peerRequirementNodes,[([,c])=>j.stringifyLocator(c.subject),([,c])=>j.stringifyIdent(c.ident)]);for(let[,c]of n.values()){if(!c.root)continue;let f=e.peerWarnings.find(E=>E.hash===c.hash),p=[...j.allPeerRequests(c)],h;if(p.length>2?h=` and ${p.length-1} other dependencies`:p.length===2?h=" and 1 other dependency":h="",c.provided.range!=="missing:"){let E=e.storedResolutions.get(c.provided.descriptorHash);if(!E)throw new Error("Assertion failed: Expected the resolution to have been registered");let C=e.storedPackages.get(E);if(!C)throw new Error("Assertion failed: Expected the provided package to have been registered");let S=`${ce.pretty(e.configuration,c.hash,ce.Type.CODE)} \u2192 ${f?a.Cross:a.Check} ${j.prettyLocator(e.configuration,c.subject)} provides ${j.prettyLocator(e.configuration,C)} to ${j.prettyLocator(e.configuration,p[0].requester)}${h}`;f?s.reportWarning(0,S):s.reportInfo(0,S)}else{let E=`${ce.pretty(e.configuration,c.hash,ce.Type.CODE)} \u2192 ${f?a.Cross:a.Check} ${j.prettyLocator(e.configuration,c.subject)} doesn't provide ${j.prettyIdent(e.configuration,c.ident)} to ${j.prettyLocator(e.configuration,p[0].requester)}${h}`;f?s.reportWarning(0,E):s.reportInfo(0,E)}}})).exitCode()}Ge();jt();Jo();Ge();Ge();bt();jt();var fge=et(hi()),AC=class extends ft{constructor(){super(...arguments);this.useYarnPath=pe.Boolean("--yarn-path",{description:"Set the yarnPath setting even if the version can be accessed by Corepack"});this.onlyIfNeeded=pe.Boolean("--only-if-needed",!1,{description:"Only lock the Yarn version if it isn't already locked"});this.version=pe.String()}static{this.paths=[["set","version"]]}static{this.usage=it.Usage({description:"lock the Yarn version used by the project",details:"\n This command will set a specific release of Yarn to be used by Corepack: https://nodejs.org/api/corepack.html.\n\n By default it only will set the `packageManager` field at the root of your project, but if the referenced release cannot be represented this way, if you already have `yarnPath` configured, or if you set th Line truncated
${t}`)})}let f=e.projectCwd??e.startingCwd,p=K.resolve(f,".yarn/releases"),h=K.resolve(p,`yarn-${t}.cjs`),E=K.relative(e.startingCwd,h),C=qe.isTaggedYarnVersion(t),S=e.get("yarnPath"),x=!C,I=x||!!S||!!a;if(a===!1){if(x)throw new Lt(0,"You explicitly opted out of yarnPath usage in your command line, but the version you specified cannot be represented by Corepack");I=!1}else!I&&!process.env.COREPACK_ROOT&&(s.reportWarning(0,`You don't seem to have ${ce.applyHyperlink(e,"Corepack","https://nodejs.org/api/corepack.html")} enabled; we'll have to rely on ${ce.applyHyperlink(e,"yarnPath","https://yarnpkg.com/configuration/yarnrc#yarnPath")} instead`),I=!0);if(I){let $=await c();s.reportInfo(0,`Saving the new release in ${ce.pretty(e,E,"magenta")}`),await le.removePromise(K.dirname(h)),await le.mkdirPromise(K.dirname(h),{recursive:!0}),await le.writeFilePromise(h,$,{mode:493}),await Je.updateConfiguration(f,{yarnPath:K.relative(f,h)})}else await le.removePromise(K.dirname(h)),await Je.updateConfiguration(f,{yarnPath:Je.deleteProperty});let T=await _t.tryFind(f)||new _t;T.packageManager=`yarn@${C?t:await rS(e,"stable")}`;let O={};T.exportTo(O);let U=K.join(f,_t.fileName),V=`${JSON.stringify(O,null,T.indent)}
`;return await le.changeFilePromise(U,V,{automaticNewlines:!0}),{bundleVersion:t}}function Age(e){return pr[Yx(e)]}var hot=/## (?<code>YN[0-9]{4}) - `(?<name>[A-Z_]+)`\n\n(?<details>(?:.(?!##))+)/gs;async function dot(e){let r=`https://repo.yarnpkg.com/${qe.isTaggedYarnVersion(An)?An:await rS(e,"canary")}/packages/docusaurus/docs/advanced/01-general-reference/error-codes.mdx`,s=await nn.get(r,{configuration:e});return new Map(Array.from(s.toString().matchAll(hot),({groups:a})=>{if(!a)throw new Error("Assertion failed: Expected the match to have been successful");let n=Age(a.code);if(a.name!==n)throw new Error(`Assertion failed: Invalid error code data: Expected "${a.name}" to be named "${n}"`);return[a.code,a.details]}))}var pC=class extends ft{constructor(){super(...arguments);this.code=pe.String({required:!1,validator:J2(Jf(),[Sp(/^YN[0-9]{4}$/)])});this.json=pe.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["explain"]]}static{this.usage=it.Usage({description:"explain an error code",details:`
When the code argument is specified, this command prints its name and its details.
When used without arguments, this command lists all error codes and their names.
`,examples:[["Explain an error code","$0 explain YN0006"],["List all error codes","$0 explain"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins);if(typeof this.code<"u"){let s=Age(this.code),a=ce.pretty(r,s,ce.Type.CODE),n=this.cli.format().header(`${this.code} - ${a}`),f=(await dot(r)).get(this.code),p=typeof f<"u"?ce.jsonOrPretty(this.json,r,ce.tuple(ce.Type.MARKDOWN,{text:f,format:this.cli.format(),paragraphs:!0})):`This error code does not have a description.
You can help us by editing this page on GitHub \u{1F642}:
${ce.jsonOrPretty(this.json,r,ce.tuple(ce.Type.URL,"https://github.com/yarnpkg/berry/blob/master/packages/docusaurus/docs/advanced/01-general-reference/error-codes.mdx"))}
`;this.json?this.context.stdout.write(`${JSON.stringify({code:this.code,name:s,details:p})}
`):this.context.stdout.write(`${n}
${p}
`)}else{let s={children:qe.mapAndFilter(Object.entries(pr),([a,n])=>Number.isNaN(Number(a))?qe.mapAndFilter.skip:{label:zf(Number(a)),value:ce.tuple(ce.Type.CODE,n)})};ts.emitTree(s,{configuration:r,stdout:this.context.stdout,json:this.json})}}};Ge();bt();jt();var pge=et(Xo()),hC=class extends ft{constructor(){super(...arguments);this.all=pe.Boolean("-A,--all",!1,{description:"Print versions of a package from the whole project"});this.recursive=pe.Boolean("-R,--recursive",!1,{description:"Print information for all packages, including transitive dependencies"});this.extra=pe.Array("-X,--extra",[],{description:"An array of requests of extra data provided by plugins"});this.cache=pe.Boolean("--cache",!1,{description:"Print information about the cache entry of a package (path, size, checksum)"});this.dependents=pe.Boolean("--dependents",!1,{description:"Print all dependents for each matching package"});this.manifest=pe.Boolean("--manifest",!1,{description:"Print data obtained by looking at the package archive (license, homepage, ...)"});this.nameOnly=pe.Boolean("--name-only",!1,{description:"Only print the name for the matching packages"});this.virtuals=pe.Boolean("--virtuals",!1,{description:"Print each instance of the virtual packages"});this.json=pe.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.patterns=pe.Rest()}static{this.paths=[["info"]]}static{this.usage=it.Usage({description:"see information related to packages",details:"\n This command prints various information related to the specified packages, accepting glob patterns.\n\n By default, if the locator reference is missing, Yarn will default to print the information about all the matching direct dependencies of the package for the active workspace. To instead print all versions of the package that are direct dependencies of any of your workspaces, use the `-A,--all` flag. Adding the `-R,--recursive` flag will also report transitive dependencies.\n\n Some fields will be hidden by default in order to keep the output readable, but can be selectively displayed by using additional options (`--dependents`, `--manifest`, `--virtuals`, ...) described in the option descriptions.\n\n Note that this command will only print the information directly related to the selected packages - if you wish to know why the package is there in the first place, use `yarn why` which will do just that (it also provides a `-R,--recursive` flag that may be of some help).\n ",examples:[["Show information about Lodash","$0 info lodash"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd),n=await zr.find(r);if(!a&&!this.all)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let c=new Set(this.extra);this.cache&&c.add("cache"),this.dependents&&c.add("dependents"),this.manifest&&c.add("manifest");let f=(ie,{recursive:fe})=>{let ae=ie.anchoredLocator.locatorHash,ge=new Map,he=[ae];for(;he.length>0;){let Ce=he.shift();if(ge.has(Ce))continue;let Ee=s.storedPackages.get(Ce);if(typeof Ee>"u")throw new Error("Assertion failed: Expected the package to be registered");if(ge.set(Ce,Ee),j.isVirtualLocator(Ee)&&he.push(j.devirtualizeLocator(Ee).locatorHash),!(!fe&&Ce!==ae))for(let d of Ee.dependencies.values()){let Se=s.storedResolutions.get(d.descriptorHash);if(typeof Se>"u")throw new Error("Assertion failed: Expected the resolution to be registered");he.push(Se)}}return ge.values()},p=({recursive:ie})=>{let fe=new Map;for(let ae of s.workspaces)for(let ge of f(ae,{recursive:ie}))fe.set(ge.locatorHash,ge);return fe.values()},h=({all:ie,recursive:fe})=>ie&&fe?s.storedPackages.values():ie?p({recursive:fe}):f(a,{recursive:fe}),E=({all:ie,recursive:fe})=>{let ae=h({all:ie,recursive:fe}),ge=this.patterns.map(Ee=>{let d=j.parseLocator(Ee),Se=pge.default.makeRe(j.stringifyIdent(d)),Be=j.isVirtualLocator(d),me=Be?j.devirtualizeLocator(d):d;return ue=>{let Z=j.stringifyIdent(ue);if(!Se.test(Z))return!1;if(d.reference==="unknown")return!0;let be=j.isVirtualLocator(ue),Qe=be?j.devirtualizeLocator(ue):ue;return!(Be&&be&&d.reference!==ue.reference||me.reference!==Qe.reference)}}),he=qe.sortMap([...ae],Ee=>j.stringifyLocator(Ee));return{selection:he.filter(Ee=>ge.length===0||ge.some(d=>d(Ee))),sortedLookup:he}},{selection:C,sortedLookup:S}=E({all:this.all,recursive:this.recursive});if(C.length===0)throw new st("No package matched your request");let x=new Map;if(this.dependents)for(let ie of S)for(let fe of ie.dependencies.values()){let ae=s.storedResolutions.get(fe.descriptorHash);if(typeof ae>"u")throw new Error("Assertion failed: Expected the resolution to be registered");qe.getArrayWithDefault(x,ae).push(ie)}let I=new Map;for(let ie of S){if(!j.isVirtualLocator(ie))continue;let fe=j.devirtualizeLocator(ie);qe.getArrayWithDefault(I,fe.locatorHash).push(ie)}let T={},O={children:T},U=r.makeFetcher(),V={project:s,fetcher:U,cache:n,checksums:s.storedChecksum Line truncated
This command simply runs Node. It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment).
The Node process will use the exact same version of Node as the one used to run Yarn itself, which might be a good way to ensure that your commands always use a consistent Node version.
`,examples:[["Run a Node script","$0 node ./my-script.js"]]})}async execute(){return this.cli.run(["exec","node",...this.args])}};Ge();jt();var yC=class extends ft{constructor(){super(...arguments);this.json=pe.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["plugin","check"]]}static{this.usage=it.Usage({category:"Plugin-related commands",description:"find all third-party plugins that differ from their own spec",details:`
Check only the plugins from https.
If this command detects any plugin differences in the CI environment, it will throw an error.
`,examples:[["find all third-party plugins that differ from their own spec","$0 plugin check"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),s=await Je.findRcFiles(this.context.cwd);return(await Ft.start({configuration:r,json:this.json,stdout:this.context.stdout},async n=>{for(let c of s)if(c.data?.plugins)for(let f of c.data.plugins){if(!f.checksum||!f.spec.match(/^https?:/))continue;let p=await nn.get(f.spec,{configuration:r}),h=Mn.makeHash(p);if(f.checksum===h)continue;let E=ce.pretty(r,f.path,ce.Type.PATH),C=ce.pretty(r,f.spec,ce.Type.URL),S=`${E} is different from the file provided by ${C}`;n.reportJson({...f,newChecksum:h}),n.reportError(0,S)}})).exitCode()}};Ge();Ge();bt();jt();var yge=Ie("os");Ge();bt();jt();var hge=Ie("os");Ge();Sc();jt();var Iot="https://raw.githubusercontent.com/yarnpkg/berry/master/plugins.yml";async function Qm(e,t){let r=await nn.get(Iot,{configuration:e}),s=us(r.toString());return Object.fromEntries(Object.entries(s).filter(([a,n])=>!t||kr.satisfiesWithPrereleases(t,n.range??"<4.0.0-rc.1")))}var EC=class extends ft{constructor(){super(...arguments);this.json=pe.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["plugin","list"]]}static{this.usage=it.Usage({category:"Plugin-related commands",description:"list the available official plugins",details:"\n This command prints the plugins available directly from the Yarn repository. Only those plugins can be referenced by name in `yarn plugin import`.\n ",examples:[["List the official plugins","$0 plugin list"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins);return(await Ft.start({configuration:r,json:this.json,stdout:this.context.stdout},async a=>{let n=await Qm(r,An);for(let[c,{experimental:f,...p}]of Object.entries(n)){let h=c;f&&(h+=" [experimental]"),a.reportJson({name:c,experimental:f,...p}),a.reportInfo(null,h)}})).exitCode()}};var Cot=/^[0-9]+$/,wot=process.platform==="win32";function dge(e){return Cot.test(e)?`pull/${e}/head`:e}var Bot=({repository:e,branch:t},r)=>[["git","init",Ae.fromPortablePath(r)],["git","remote","add","origin",e],["git","fetch","origin","--depth=1",dge(t)],["git","reset","--hard","FETCH_HEAD"]],vot=({branch:e})=>[["git","fetch","origin","--depth=1",dge(e),"--force"],["git","reset","--hard","FETCH_HEAD"],["git","clean","-dfx","-e","packages/yarnpkg-cli/bundles"]],Sot=({plugins:e,noMinify:t},r,s)=>[["yarn","build:cli",...new Array().concat(...e.map(a=>["--plugin",K.resolve(s,a)])),...t?["--no-minify"]:[],"|"],[wot?"move":"mv","packages/yarnpkg-cli/bundles/yarn.js",Ae.fromPortablePath(r),"|"]],IC=class extends ft{constructor(){super(...arguments);this.installPath=pe.String("--path",{description:"The path where the repository should be cloned to"});this.repository=pe.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=pe.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.plugins=pe.Array("--plugin",[],{description:"An array of additional plugins that should be included in the bundle"});this.dryRun=pe.Boolean("-n,--dry-run",!1,{description:"If set, the bundle will be built but not added to the project"});this.noMinify=pe.Boolean("--no-minify",!1,{description:"Build a bundle for development (debugging) - non-minified and non-mangled"});this.force=pe.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.skipPlugins=pe.Boolean("--skip-plugins",!1,{description:"Skip updating the contrib plugins"})}static{this.paths=[["set","version","from","sources"]]}static{this.usage=it.Usage({description:"build Yarn from master",details:`
This command will clone the Yarn repository into a temporary folder, then build it. The resulting bundle will then be copied into the local project.
By default, it also updates all contrib plugins to the same commit the bundle is built from. This behavior can be disabled by using the \`--skip-plugins\` flag.
`,examples:[["Build Yarn from master","$0 set version from sources"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s}=await Rt.find(r,this.context.cwd),a=typeof this.installPath<"u"?K.resolve(this.context.cwd,Ae.toPortablePath(this.installPath)):K.resolve(Ae.toPortablePath((0,hge.tmpdir)()),"yarnpkg-sources",Mn.makeHash(this.repository).slice(0,6));return(await Ft.start({configuration:r,stdout:this.context.stdout},async c=>{await w5(this,{configuration:r,report:c,target:a}),c.reportSeparator(),c.reportInfo(0,"Building a fresh bundle"),c.reportSeparator();let f=await Yr.execvp("git",["rev-parse","--short","HEAD"],{cwd:a,strict:!0}),p=K.join(a,`packages/yarnpkg-cli/bundles/yarn-${f.stdout.trim()}.js`);le.existsSync(p)||(await nS(Sot(this,p,a),{configuration:r,context:this.context,target:a}),c.reportSeparator());let h=await le.readFilePromise(p);if(!this.dryRun){let{bundleVersion:E}=await I5(r,null,async()=>h,{report:c});this.skipPlugins||await bot(this,E,{project:s,report:c,target:a})}})).exitCode()}};async function nS(e,{configuration:t,context:r,target:s}){for(let[a,...n]of e){let c=n[n.length-1]==="|";if(c&&n.pop(),c)await Yr.pipevp(a,n,{cwd:s,stdin:r.stdin,stdout:r.stdout,stderr:r.stderr,strict:!0});else{r.stdout.write(`${ce.pretty(t,` $ ${[a,...n].join(" ")}`,"grey")}
`);try{await Yr.execvp(a,n,{cwd:s,strict:!0})}catch(f){throw r.stdout.write(f.stdout||f.stack),f}}}}async function w5(e,{configuration:t,report:r,target:s}){let a=!1;if(!e.force&&le.existsSync(K.join(s,".git"))){r.reportInfo(0,"Fetching the latest commits"),r.reportSeparator();try{await nS(vot(e),{configuration:t,context:e.context,target:s}),a=!0}catch{r.reportSeparator(),r.reportWarning(0,"Repository update failed; we'll try to regenerate it")}}a||(r.reportInfo(0,"Cloning the remote repository"),r.reportSeparator(),await le.removePromise(s),await le.mkdirPromise(s,{recursive:!0}),await nS(Bot(e,s),{configuration:t,context:e.context,target:s}))}async function bot(e,t,{project:r,report:s,target:a}){let n=await Qm(r.configuration,t),c=new Set(Object.keys(n));for(let f of r.configuration.plugins.keys())c.has(f)&&await B5(f,e,{project:r,report:s,target:a})}Ge();Ge();bt();jt();var gge=et(hi()),mge=Ie("vm");var CC=class extends ft{constructor(){super(...arguments);this.name=pe.String();this.checksum=pe.Boolean("--checksum",!0,{description:"Whether to care if this plugin is modified"})}static{this.paths=[["plugin","import"]]}static{this.usage=it.Usage({category:"Plugin-related commands",description:"download a plugin",details:`
This command downloads the specified plugin from its remote location and updates the configuration to reference it in further CLI invocations.
Three types of plugin references are accepted:
- If the plugin is stored within the Yarn repository, it can be referenced by name.
- Third-party plugins can be referenced directly through their public urls.
- Local plugins can be referenced by their path on the disk.
If the \`--no-checksum\` option is set, Yarn will no longer care if the plugin is modified.
Plugins cannot be downloaded from the npm registry, and aren't allowed to have dependencies (they need to be bundled into a single file, possibly thanks to the \`@yarnpkg/builder\` package).
`,examples:[['Download and activate the "@yarnpkg/plugin-exec" plugin',"$0 plugin import @yarnpkg/plugin-exec"],['Download and activate the "@yarnpkg/plugin-exec" plugin (shorthand)',"$0 plugin import exec"],["Download and activate a community plugin","$0 plugin import https://example.org/path/to/plugin.js"],["Activate a local plugin","$0 plugin import ./path/to/plugin.js"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins);return(await Ft.start({configuration:r,stdout:this.context.stdout},async a=>{let{project:n}=await Rt.find(r,this.context.cwd),c,f;if(this.name.match(/^\.{0,2}[\\/]/)||Ae.isAbsolute(this.name)){let p=K.resolve(this.context.cwd,Ae.toPortablePath(this.name));a.reportInfo(0,`Reading ${ce.pretty(r,p,ce.Type.PATH)}`),c=K.relative(n.cwd,p),f=await le.readFilePromise(p)}else{let p;if(this.name.match(/^https?:/)){try{new URL(this.name)}catch{throw new Lt(52,`Plugin specifier "${this.name}" is neither a plugin name nor a valid url`)}c=this.name,p=this.name}else{let h=j.parseLocator(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-"));if(h.reference!=="unknown"&&!gge.default.valid(h.reference))throw new Lt(0,"Official plugins only accept strict version references. Use an explicit URL if you wish to download them from another location.");let E=j.stringifyIdent(h),C=await Qm(r,An);if(!Object.hasOwn(C,E)){let S=`Couldn't find a plugin named ${j.prettyIdent(r,h)} on the remote registry.
`;throw r.plugins.has(E)?S+=`A plugin named ${j.prettyIdent(r,h)} is already installed; possibly attempting to import a built-in plugin.`:S+=`Note that only the plugins referenced on our website (${ce.pretty(r,"https://github.com/yarnpkg/berry/blob/master/plugins.yml",ce.Type.URL)}) can be referenced by their name; any other plugin will have to be referenced through its public url (for example ${ce.pretty(r,"https://github.com/yarnpkg/berry/raw/master/packages/plugin-typescript/bin/%40yarnpkg/plugin-typescript.js",ce.Type.URL)}).`,new Lt(51,S)}c=E,p=C[E].url,h.reference!=="unknown"?p=p.replace(/\/master\//,`/${E}/${h.reference}/`):An!==null&&(p=p.replace(/\/master\//,`/@yarnpkg/cli/${An}/`))}a.reportInfo(0,`Downloading ${ce.pretty(r,p,"green")}`),f=await nn.get(p,{configuration:r})}await v5(c,f,{checksum:this.checksum,project:n,report:a})})).exitCode()}};async function v5(e,t,{checksum:r=!0,project:s,report:a}){let{configuration:n}=s,c={},f={exports:c};(0,mge.runInNewContext)(t.toString(),{module:f,exports:c});let h=`.yarn/plugins/${f.exports.name}.cjs`,E=K.resolve(s.cwd,h);a.reportInfo(0,`Saving the new plugin in ${ce.pretty(n,h,"magenta")}`),await le.mkdirPromise(K.dirname(E),{recursive:!0}),await le.writeFilePromise(E,t);let C={path:h,spec:e};r&&(C.checksum=Mn.makeHash(t)),await Je.addPlugin(s.cwd,[C])}var Dot=({pluginName:e,noMinify:t},r)=>[["yarn",`build:${e}`,...t?["--no-minify"]:[],"|"]],wC=class extends ft{constructor(){super(...arguments);this.installPath=pe.String("--path",{description:"The path where the repository should be cloned to"});this.repository=pe.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=pe.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.noMinify=pe.Boolean("--no-minify",!1,{description:"Build a plugin for development (debugging) - non-minified and non-mangled"});this.force=pe.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.name=pe.String()}static{this.paths=[["plugin","import","from","sources"]]}static{this.usage=it.Usage({category:"Plugin-related commands",description:"build a plugin from sources",details:`
This command clones the Yarn repository into a temporary folder, builds the specified contrib plugin and updates the configuration to reference it in further CLI invocations.
The plugins can be referenced by their short name if sourced from the official Yarn repository.
`,examples:[['Build and activate the "@yarnpkg/plugin-exec" plugin',"$0 plugin import from sources @yarnpkg/plugin-exec"],['Build and activate the "@yarnpkg/plugin-exec" plugin (shorthand)',"$0 plugin import from sources exec"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),s=typeof this.installPath<"u"?K.resolve(this.context.cwd,Ae.toPortablePath(this.installPath)):K.resolve(Ae.toPortablePath((0,yge.tmpdir)()),"yarnpkg-sources",Mn.makeHash(this.repository).slice(0,6));return(await Ft.start({configuration:r,stdout:this.context.stdout},async n=>{let{project:c}=await Rt.find(r,this.context.cwd),f=j.parseIdent(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-")),p=j.stringifyIdent(f),h=await Qm(r,An);if(!Object.hasOwn(h,p))throw new Lt(51,`Couldn't find a plugin named "${p}" on the remote registry. Note that only the plugins referenced on our website (https://github.com/yarnpkg/berry/blob/master/plugins.yml) can be built and imported from sources.`);let E=p;await w5(this,{configuration:r,report:n,target:s}),await B5(E,this,{project:c,report:n,target:s})})).exitCode()}};async function B5(e,{context:t,noMinify:r},{project:s,report:a,target:n}){let c=e.replace(/@yarnpkg\//,""),{configuration:f}=s;a.reportSeparator(),a.reportInfo(0,`Building a fresh ${c}`),a.reportSeparator(),await nS(Dot({pluginName:c,noMinify:r},n),{configuration:f,context:t,target:n}),a.reportSeparator();let p=K.resolve(n,`packages/${c}/bundles/${e}.js`),h=await le.readFilePromise(p);await v5(e,h,{project:s,report:a})}Ge();bt();jt();var BC=class extends ft{constructor(){super(...arguments);this.name=pe.String()}static{this.paths=[["plugin","remove"]]}static{this.usage=it.Usage({category:"Plugin-related commands",description:"remove a plugin",details:`
This command deletes the specified plugin from the .yarn/plugins folder and removes it from the configuration.
**Note:** The plugins have to be referenced by their name property, which can be obtained using the \`yarn plugin runtime\` command. Shorthands are not allowed.
`,examples:[["Remove a plugin imported from the Yarn repository","$0 plugin remove @yarnpkg/plugin-typescript"],["Remove a plugin imported from a local file","$0 plugin remove my-local-plugin"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s}=await Rt.find(r,this.context.cwd);return(await Ft.start({configuration:r,stdout:this.context.stdout},async n=>{let c=this.name,f=j.parseIdent(c);if(!r.plugins.has(c))throw new st(`${j.prettyIdent(r,f)} isn't referenced by the current configuration`);let p=`.yarn/plugins/${c}.cjs`,h=K.resolve(s.cwd,p);le.existsSync(h)&&(n.reportInfo(0,`Removing ${ce.pretty(r,p,ce.Type.PATH)}...`),await le.removePromise(h)),n.reportInfo(0,"Updating the configuration..."),await Je.updateConfiguration(s.cwd,{plugins:E=>{if(!Array.isArray(E))return E;let C=E.filter(S=>S.path!==p);return C.length===0?Je.deleteProperty:C.length===E.length?E:C}})})).exitCode()}};Ge();jt();var vC=class extends ft{constructor(){super(...arguments);this.json=pe.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["plugin","runtime"]]}static{this.usage=it.Usage({category:"Plugin-related commands",description:"list the active plugins",details:`
This command prints the currently active plugins. Will be displayed both builtin plugins and external plugins.
`,examples:[["List the currently active plugins","$0 plugin runtime"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins);return(await Ft.start({configuration:r,json:this.json,stdout:this.context.stdout},async a=>{for(let n of r.plugins.keys()){let c=this.context.plugins.plugins.has(n),f=n;c&&(f+=" [builtin]"),a.reportJson({name:n,builtin:c}),a.reportInfo(null,`${f}`)}})).exitCode()}};Ge();Ge();jt();var SC=class extends ft{constructor(){super(...arguments);this.idents=pe.Rest()}static{this.paths=[["rebuild"]]}static{this.usage=it.Usage({description:"rebuild the project's native packages",details:`
This command will automatically cause Yarn to forget about previous compilations of the given packages and to run them again.
Note that while Yarn forgets the compilation, the previous artifacts aren't erased from the filesystem and may affect the next builds (in good or bad). To avoid this, you may remove the .yarn/unplugged folder, or any other relevant location where packages might have been stored (Yarn may offer a way to do that automatically in the future).
By default all packages will be rebuilt, but you can filter the list by specifying the names of the packages you want to clear from memory.
`,examples:[["Rebuild all packages","$0 rebuild"],["Rebuild fsevents only","$0 rebuild fsevents"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd),n=await zr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);let c=new Set;for(let f of this.idents)c.add(j.parseIdent(f).identHash);if(await s.restoreInstallState({restoreResolutions:!1}),await s.resolveEverything({cache:n,report:new Qi}),c.size>0)for(let f of s.storedPackages.values())c.has(f.identHash)&&(s.storedBuildState.delete(f.locatorHash),s.skippedBuilds.delete(f.locatorHash));else s.storedBuildState.clear(),s.skippedBuilds.clear();return await s.installWithNewReport({stdout:this.context.stdout,quiet:this.context.quiet},{cache:n})}};Ge();Ge();Ge();jt();var S5=et(Xo());Jo();var bC=class extends ft{constructor(){super(...arguments);this.all=pe.Boolean("-A,--all",!1,{description:"Apply the operation to all workspaces from the current project"});this.mode=pe.String("--mode",{description:"Change what artifacts installs generate",validator:Qs(La)});this.patterns=pe.Rest()}static{this.paths=[["remove"]]}static{this.usage=it.Usage({description:"remove dependencies from the project",details:`
This command will remove the packages matching the specified patterns from the current workspace.
If the \`--mode=<mode>\` option is set, Yarn will change which artifacts are generated. The modes currently supported are:
- \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
- \`update-lockfile\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.
This command accepts glob patterns as arguments (if valid Idents and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.
`,examples:[["Remove a dependency from the current project","$0 remove lodash"],["Remove a dependency from all workspaces at once","$0 remove lodash --all"],["Remove all dependencies starting with `eslint-`","$0 remove 'eslint-*'"],["Remove all dependencies with the `@babel` scope","$0 remove '@babel/*'"],["Remove all dependencies matching `react-dom` or `react-helmet`","$0 remove 'react-{dom,helmet}'"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd),n=await zr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState({restoreResolutions:!1});let c=this.all?s.workspaces:[a],f=["dependencies","devDependencies","peerDependencies"],p=[],h=!1,E=[];for(let I of this.patterns){let T=!1,O=j.parseIdent(I);for(let U of c){let V=[...U.manifest.peerDependenciesMeta.keys()];for(let $ of(0,S5.default)(V,I))U.manifest.peerDependenciesMeta.delete($),h=!0,T=!0;for(let $ of f){let ie=U.manifest.getForScope($),fe=[...ie.values()].map(ae=>j.stringifyIdent(ae));for(let ae of(0,S5.default)(fe,j.stringifyIdent(O))){let{identHash:ge}=j.parseIdent(ae),he=ie.get(ge);if(typeof he>"u")throw new Error("Assertion failed: Expected the descriptor to be registered");U.manifest[$].delete(ge),E.push([U,$,he]),h=!0,T=!0}}}T||p.push(I)}let C=p.length>1?"Patterns":"Pattern",S=p.length>1?"don't":"doesn't",x=this.all?"any":"this";if(p.length>0)throw new st(`${C} ${ce.prettyList(r,p,ce.Type.CODE)} ${S} match any packages referenced by ${x} workspace`);return h?(await r.triggerMultipleHooks(I=>I.afterWorkspaceDependencyRemoval,E),await s.installWithNewReport({stdout:this.context.stdout},{cache:n,mode:this.mode})):0}};Ge();Ge();jt();var Ege=Ie("util"),DC=class extends ft{constructor(){super(...arguments);this.json=pe.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["run"]]}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);return(await Ft.start({configuration:r,stdout:this.context.stdout,json:this.json},async c=>{let f=a.manifest.scripts,p=qe.sortMap(f.keys(),C=>C),h={breakLength:1/0,colors:r.get("enableColors"),maxArrayLength:2},E=p.reduce((C,S)=>Math.max(C,S.length),0);for(let[C,S]of f.entries())c.reportInfo(null,`${C.padEnd(E," ")} ${(0,Ege.inspect)(S,h)}`),c.reportJson({name:C,script:S})})).exitCode()}};Ge();Ge();jt();var PC=class extends ft{constructor(){super(...arguments);this.inspect=pe.String("--inspect",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.inspectBrk=pe.String("--inspect-brk",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.topLevel=pe.Boolean("-T,--top-level",!1,{description:"Check the root workspace for scripts and/or binaries instead of the current one"});this.binariesOnly=pe.Boolean("-B,--binaries-only",!1,{description:"Ignore any user defined scripts and only check for binaries"});this.require=pe.String("--require",{description:"Forwarded to the underlying Node process when executing a binary"});this.silent=pe.Boolean("--silent",{hidden:!0});this.scriptName=pe.String();this.args=pe.Proxy()}static{this.paths=[["run"]]}static{this.usage=it.Usage({description:"run a script defined in the package.json",details:`
This command will run a tool. The exact tool that will be executed will depend on the current state of your workspace:
- If the \`scripts\` field from your local package.json contains a matching script name, its definition will get executed.
- Otherwise, if one of the local workspace's dependencies exposes a binary with a matching name, this binary will get executed.
- Otherwise, if the specified name contains a colon character and if one of the workspaces in the project contains exactly one script with a matching name, then this script will get executed.
Whatever happens, the cwd of the spawned process will be the workspace that declares the script (which makes it possible to call commands cross-workspaces using the third syntax).
`,examples:[["Run the tests from the local workspace","$0 run test"],['Same thing, but without the "run" keyword',"$0 test"],["Inspect Webpack while running","$0 run --inspect-brk webpack"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a,locator:n}=await Rt.find(r,this.context.cwd);await s.restoreInstallState();let c=this.topLevel?s.topLevelWorkspace.anchoredLocator:n;if(!this.binariesOnly&&await wn.hasPackageScript(c,this.scriptName,{project:s}))return await wn.executePackageScript(c,this.scriptName,this.args,{project:s,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});let f=await wn.getPackageAccessibleBinaries(c,{project:s});if(f.get(this.scriptName)){let h=[];return this.inspect&&(typeof this.inspect=="string"?h.push(`--inspect=${this.inspect}`):h.push("--inspect")),this.inspectBrk&&(typeof this.inspectBrk=="string"?h.push(`--inspect-brk=${this.inspectBrk}`):h.push("--inspect-brk")),this.require&&h.push(`--require=${this.require}`),await wn.executePackageAccessibleBinary(c,this.scriptName,this.args,{cwd:this.context.cwd,project:s,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,nodeArgs:h,packageAccessibleBinaries:f})}if(!this.topLevel&&!this.binariesOnly&&a&&this.scriptName.includes(":")){let E=(await Promise.all(s.workspaces.map(async C=>C.manifest.scripts.has(this.scriptName)?C:null))).filter(C=>C!==null);if(E.length===1)return await wn.executeWorkspaceScript(E[0],this.scriptName,this.args,{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})}if(this.topLevel)throw this.scriptName==="node-gyp"?new st(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${j.prettyLocator(r,n)}). This typically happens because some package depends on "node-gyp" to build itself, but didn't list it in their dependencies. To fix that, please run "yarn add node-gyp" into your top-level workspace. You also can open an issue on the repository of the specified package to suggest them to use an optional peer dependency.`):new st(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${j.prettyLocator(r,n)}).`);{if(this.scriptName==="global")throw new st("The 'yarn global' commands have been removed in 2.x - consider using 'yarn dlx' or a third-party plugin instead");let h=[this.scriptName].concat(this.args);for(let[E,C]of WI)for(let S of C)if(h.length>=S.length&&JSON.stringify(h.slice(0,S.length))===JSON.stringify(S))throw new st(`Couldn't find a script named "${this.scriptName}", but a matching command can be found in the ${E} plugin. You can install it with "yarn plugin import ${E}".`);throw new st(`Couldn't find a script named "${this.scriptName}".`)}}};Ge();Ge();jt();var xC=class extends ft{constructor(){super(...arguments);this.descriptor=pe.String();this.resolution=pe.String()}static{this.paths=[["set","resolution"]]}static{this.usage=it.Usage({description:"enforce a package resolution",details:'\n This command updates the resolution table so that `descriptor` is resolved by `resolution`.\n\n Note that by default this command only affect the current resolution table - meaning that this "manual override" will disappear if you remove the lockfile, or if the package disappear from the table. If you wish to make the enforced resolution persist whatever happens, edit the `resolutions` field in your top-level manifest.\n\n Note that no attempt is made at validating that `resolution` is a valid resolution entry for `descriptor`.\n ',examples:[["Force all instances of lodash@npm:^1.2.3 to resolve to 1.5.0","$0 set resolution lodash@npm:^1.2.3 npm:1.5.0"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd),n=await zr.find(r);if(await s.restoreInstallState({restoreResolutions:!1}),!a)throw new ar(s.cwd,this.context.cwd);let c=j.parseDescriptor(this.descriptor,!0),f=j.makeDescriptor(c,this.resolution);return s.storedDescriptors.set(c.descriptorHash,c),s.storedDescriptors.set(f.descriptorHash,f),s.resolutionAliases.set(c.descriptorHash,f.descriptorHash),await s.installWithNewReport({stdout:this.context.stdout},{cache:n})}};Ge();bt();jt();var Ige=et(Xo()),kC=class extends ft{constructor(){super(...arguments);this.all=pe.Boolean("-A,--all",!1,{description:"Unlink all workspaces belonging to the target project from the current one"});this.leadingArguments=pe.Rest()}static{this.paths=[["unlink"]]}static{this.usage=it.Usage({description:"disconnect the local project from another one",details:`
This command will remove any resolutions in the project-level manifest that would have been added via a yarn link with similar arguments.
`,examples:[["Unregister a remote workspace in the current project","$0 unlink ~/ts-loader"],["Unregister all workspaces from a remote project in the current project","$0 unlink ~/jest --all"],["Unregister all previously linked workspaces","$0 unlink --all"],["Unregister all workspaces matching a glob","$0 unlink '@babel/*' 'pkg-{a,b}'"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd),n=await zr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);let c=s.topLevelWorkspace,f=new Set;if(this.leadingArguments.length===0&&this.all)for(let{pattern:p,reference:h}of c.manifest.resolutions)h.startsWith("portal:")&&f.add(p.descriptor.fullName);if(this.leadingArguments.length>0)for(let p of this.leadingArguments){let h=K.resolve(this.context.cwd,Ae.toPortablePath(p));if(qe.isPathLike(p)){let E=await Je.find(h,this.context.plugins,{useRc:!1,strict:!1}),{project:C,workspace:S}=await Rt.find(E,h);if(!S)throw new ar(C.cwd,h);if(this.all){for(let x of C.workspaces)x.manifest.name&&f.add(j.stringifyIdent(x.anchoredLocator));if(f.size===0)throw new st("No workspace found to be unlinked in the target project")}else{if(!S.manifest.name)throw new st("The target workspace doesn't have a name and thus cannot be unlinked");f.add(j.stringifyIdent(S.anchoredLocator))}}else{let E=[...c.manifest.resolutions.map(({pattern:C})=>C.descriptor.fullName)];for(let C of(0,Ige.default)(E,p))f.add(C)}}return c.manifest.resolutions=c.manifest.resolutions.filter(({pattern:p})=>!f.has(p.descriptor.fullName)),await s.installWithNewReport({stdout:this.context.stdout,quiet:this.context.quiet},{cache:n})}};Ge();Ge();Ge();jt();var Cge=et(Xv()),b5=et(Xo());Jo();var QC=class extends ft{constructor(){super(...arguments);this.interactive=pe.Boolean("-i,--interactive",{description:"Offer various choices, depending on the detected upgrade paths"});this.fixed=pe.Boolean("-F,--fixed",!1,{description:"Store dependency tags as-is instead of resolving them"});this.exact=pe.Boolean("-E,--exact",!1,{description:"Don't use any semver modifier on the resolved range"});this.tilde=pe.Boolean("-T,--tilde",!1,{description:"Use the `~` semver modifier on the resolved range"});this.caret=pe.Boolean("-C,--caret",!1,{description:"Use the `^` semver modifier on the resolved range"});this.recursive=pe.Boolean("-R,--recursive",!1,{description:"Resolve again ALL resolutions for those packages"});this.noTimeGate=pe.Boolean("--no-time-gate",!1,{description:"Disable the minimum release age check for this command"});this.mode=pe.String("--mode",{description:"Change what artifacts installs generate",validator:Qs(La)});this.patterns=pe.Rest()}static{this.paths=[["up"]]}static{this.usage=it.Usage({description:"upgrade dependencies across the project",details:"\n This command upgrades the packages matching the list of specified patterns to their latest available version across the whole project (regardless of whether they're part of `dependencies` or `devDependencies` - `peerDependencies` won't be affected). This is a project-wide command: all workspaces will be upgraded in the process.\n\n If `-R,--recursive` is set the command will change behavior and no other switch will be allowed. When operating under this mode `yarn up` will force all ranges matching the selected packages to be resolved again (often to the highest available versions) before being stored in the lockfile. It however won't touch your manifests anymore, so depending on your needs you might want to run both `yarn up` and `yarn up -R` to cover all bases.\n\n If `-i,--interactive` is set (or if the `preferInteractive` settings is toggled on) the command will offer various choices, depending on the detected upgrade paths. Some upgrades require this flag in order to resolve ambiguities.\n\n The, `-C,--caret`, `-E,--exact` and `-T,--tilde` options have the same meaning as in the `add` command (they change the modifier used when the range is missing or a tag, and are ignored when the range is explicitly set).\n\n If the `--mode=<mode>` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n Generally you can see `yarn up` as a counterpart to what was `yarn upgrade --latest` in Yarn 1 (ie it ignores the ranges previously li Line truncated
${ae}`):O.reportError(27,`${j.prettyDescriptor(r,U)} can't be resolved to a satisfying range (note: network resolution has been disabled)
${ae}`)}else ie.length>1&&!f&&O.reportError(27,`${j.prettyDescriptor(r,U)} has multiple possible upgrade strategies; use -i to disambiguate manually`)}});if(x.hasErrors())return x.exitCode();let I=!1,T=[];for(let[O,U,,{suggestions:V}]of S){let $,ie=V.filter(he=>he.descriptor!==null),fe=ie[0].descriptor,ae=ie.every(he=>j.areDescriptorsEqual(he.descriptor,fe));ie.length===1||ae?$=fe:(I=!0,{answer:$}=await(0,Cge.prompt)({type:"select",name:"answer",message:`Which range do you want to use in ${j.prettyWorkspace(r,O)} \u276F ${U}?`,choices:V.map(({descriptor:he,name:Ce,reason:Ee})=>he?{name:Ce,hint:Ee,descriptor:he}:{name:Ce,hint:Ee,disabled:!0}),onCancel:()=>process.exit(130),result(he){return this.find(he,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let ge=O.manifest[U].get($.identHash);if(typeof ge>"u")throw new Error("Assertion failed: This descriptor should have a matching entry");if(ge.descriptorHash!==$.descriptorHash)O.manifest[U].set($.identHash,$),T.push([O,U,ge,$]);else{let he=r.makeResolver(),Ce={project:s,resolver:he},Ee=r.normalizeDependency(ge),d=he.bindDescriptor(Ee,O.anchoredLocator,Ce);s.forgetResolution(d)}}return await r.triggerMultipleHooks(O=>O.afterWorkspaceDependencyReplacement,T),I&&this.context.stdout.write(`
`),await s.installWithNewReport({stdout:this.context.stdout},{cache:n,mode:this.mode})}};Ge();Ge();jt();var RC=class extends ft{constructor(){super(...arguments);this.recursive=pe.Boolean("-R,--recursive",!1,{description:"List, for each workspace, what are all the paths that lead to the dependency"});this.json=pe.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.peers=pe.Boolean("--peers",!1,{description:"Also print the peer dependencies that match the specified name"});this.package=pe.String()}static{this.paths=[["why"]]}static{this.usage=it.Usage({description:"display the reason why a package is needed",details:`
This command prints the exact reasons why a package appears in the dependency tree. Specify a version or range to determine why the dependency tree contains a specific version of a package. This is particularly useful when trying to find out why your project depends on lower versions.
If \`-R,--recursive\` is set, the listing will go in depth and will list, for each workspaces, what are all the paths that lead to the dependency. Note that the display is somewhat optimized in that it will not print the package listing twice for a single package, so if you see a leaf named "Foo" when looking for "Bar", it means that "Foo" already got printed higher in the tree.
`,examples:[["Explain why lodash is used in your project","$0 why lodash"],["Explain why version 3.3.1 of lodash is in your project","$0 why [email protected]"],["Explain why version 3.X of lodash is in your project","$0 why lodash@^3"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let n=j.parseDescriptor(this.package,!1);if(n.range!=="unknown"&&kr.validRange(n.range)===null)throw new st(`Expected a valid semver range, got ${n.range}`);let c=this.recursive?xot(s,n,{configuration:r,peers:this.peers}):Pot(s,n,{configuration:r,peers:this.peers});ts.emitTree(c,{configuration:r,stdout:this.context.stdout,json:this.json,separators:1})}};function Pot(e,t,{configuration:r,peers:s}){let a=qe.sortMap(e.storedPackages.values(),f=>j.stringifyLocator(f)),n={},c={children:n};for(let f of a){let p={};for(let E of f.dependencies.values()){if(!s&&f.peerDependencies.has(E.identHash))continue;let C=e.storedResolutions.get(E.descriptorHash);if(!C)throw new Error("Assertion failed: The resolution should have been registered");let S=e.storedPackages.get(C);if(!S)throw new Error("Assertion failed: The package should have been registered");if(!j.areIdentsEqual(S,t)||!j.isPackageInRange(S,t.range))continue;{let I=j.stringifyLocator(f);n[I]={value:[f,ce.Type.LOCATOR],children:p}}let x=j.stringifyLocator(S);p[x]={value:[{descriptor:E,locator:S},ce.Type.DEPENDENT]}}}return c}function xot(e,t,{configuration:r,peers:s}){let a=qe.sortMap(e.workspaces,S=>j.stringifyLocator(S.anchoredLocator)),n=new Set,c=new Set,f=S=>{if(n.has(S.locatorHash))return c.has(S.locatorHash);if(n.add(S.locatorHash),j.areIdentsEqual(S,t)&&j.isPackageInRange(S,t.range))return c.add(S.locatorHash),!0;let x=!1;for(let I of S.dependencies.values()){if(!s&&S.peerDependencies.has(I.identHash))continue;let T=e.storedResolutions.get(I.descriptorHash);if(!T)throw new Error("Assertion failed: The resolution should have been registered");let O=e.storedPackages.get(T);if(!O)throw new Error("Assertion failed: The package should have been registered");f(O)&&(x=!0)}return x&&c.add(S.locatorHash),x};for(let S of a)f(S.anchoredPackage);let p=new Set,h={},E={children:h},C=(S,x,I)=>{if(!c.has(S.locatorHash))return;let T=I!==null?ce.tuple(ce.Type.DEPENDENT,{locator:S,descriptor:I}):ce.tuple(ce.Type.LOCATOR,S),O={},U={value:T,children:O},V=j.stringifyLocator(S);if(x[V]=U,!(I!==null&&e.tryWorkspaceByLocator(S))&&!p.has(S.locatorHash)){p.add(S.locatorHash);for(let $ of S.dependencies.values()){if(!s&&S.peerDependencies.has($.identHash))continue;let ie=e.storedResolutions.get($.descriptorHash);if(!ie)throw new Error("Assertion failed: The resolution should have been registered");let fe=e.storedPackages.get(ie);if(!fe)throw new Error("Assertion failed: The package should have been registered");C(fe,O,$)}}};for(let S of a)C(S.anchoredPackage,h,null);return E}Ge();var O5={};Vt(O5,{GitFetcher:()=>sS,GitResolver:()=>oS,default:()=>zot,gitUtils:()=>Ma});Ge();bt();var Ma={};Vt(Ma,{TreeishProtocols:()=>iS,clone:()=>N5,fetchBase:()=>jge,fetchChangedFiles:()=>Gge,fetchChangedWorkspaces:()=>Kot,fetchRoot:()=>Hge,isGitUrl:()=>NC,lsRemote:()=>_ge,normalizeLocator:()=>Vot,normalizeRepoUrl:()=>TC,resolveUrl:()=>F5,splitRepoUrl:()=>Zp,validateRepoUrl:()=>T5});Ge();bt();jt();Xl();var Mge=et(Nge()),FC=et(Ie("querystring")),Q5=et(hi());function k5(e,t,r){let s=e.indexOf(r);return e.lastIndexOf(t,s>-1?s:1/0)}function Oge(e){try{return new URL(e)}catch{return}}function Yot(e){let t=k5(e,"@","#"),r=k5(e,":","#");return r>t&&(e=`${e.slice(0,r)}/${e.slice(r+1)}`),k5(e,":","#")===-1&&e.indexOf("//")===-1&&(e=`ssh://${e}`),e}function Lge(e){return Oge(e)||Oge(Yot(e))}function TC(e,{git:t=!1}={}){if(e=e.replace(/^git\+https:/,"https:"),e=e.replace(/^(?:github:|https:\/\/github\.com\/|git:\/\/github\.com\/)?(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)(?:\.git)?(#.*)?$/,"https://github.com/$1/$2.git$3"),e=e.replace(/^https:\/\/github\.com\/(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)\/tarball\/(.+)?$/,"https://github.com/$1/$2.git#$3"),t){let r=Lge(e);r&&(e=r.href),e=e.replace(/^git\+([^:]+):/,"$1:")}return e}function Uge(){return{...process.env,GIT_SSH_COMMAND:process.env.GIT_SSH_COMMAND||`${process.env.GIT_SSH||"ssh"} -o BatchMode=yes`}}var Wot=[/^ssh:/,/^git(?:\+[^:]+)?:/,/^(?:git\+)?https?:[^#]+\/[^#]+(?:\.git)(?:#.*)?$/,/^git@[^#]+\/[^#]+\.git(?:#.*)?$/,/^(?:github:|https:\/\/github\.com\/)?(?!\.{1,2}\/)([a-zA-Z._0-9-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z._0-9-]+?)(?:\.git)?(?:#.*)?$/,/^https:\/\/github\.com\/(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)\/tarball\/(.+)?$/],iS=(a=>(a.Commit="commit",a.Head="head",a.Tag="tag",a.Semver="semver",a))(iS||{});function NC(e){return e?Wot.some(t=>!!e.match(t)):!1}function Zp(e){e=TC(e);let t=e.indexOf("#");if(t===-1)return{repo:e,treeish:{proto Line truncated
This command will run a given sub-command on a single workspace.
`,examples:[["Add a package to a single workspace","yarn workspace components add -D react"],["Run build script on a single workspace","yarn workspace components run build"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);let n=s.workspaces,c=new Map(n.map(p=>[j.stringifyIdent(p.anchoredLocator),p])),f=c.get(this.workspaceName);if(f===void 0){let p=Array.from(c.keys()).sort();throw new st(`Workspace '${this.workspaceName}' not found. Did you mean any of the following:
- ${p.join(`
- `)}?`)}return this.cli.run([this.commandName,...this.args],{cwd:f.cwd})}};var Xot={configuration:{enableImmutableInstalls:{description:"If true (the default on CI), prevents the install command from modifying the lockfile",type:"BOOLEAN",default:qge.isCI},defaultSemverRangePrefix:{description:"The default save prefix: '^', '~' or ''",type:"STRING",values:["^","~",""],default:"^"},preferReuse:{description:"If true, `yarn add` will attempt to reuse the most common dependency range in other workspaces.",type:"BOOLEAN",default:!1}},commands:[eC,tC,rC,nC,xC,IC,AC,OC,oC,aC,lC,cC,ZI,$I,iC,sC,uC,fC,pC,hC,dC,gC,kC,mC,yC,wC,CC,BC,EC,vC,SC,bC,DC,PC,QC,RC,LC]},Zot=Xot;var H5={};Vt(H5,{default:()=>rat});Ge();Ge();var M5="catalog:";var U5=e=>e.startsWith(M5),$ot=e=>e.range.slice(M5.length)||null,Yge=e=>e===null?"default catalog":`catalog "${e}"`,eat=e=>e.scope?`@${e.scope}/${e.name}`:e.name,_5=(e,t,r,s)=>{let a=$ot(t),n;if(a===null)n=e.configuration.get("catalog");else try{let E=e.configuration.get("catalogs");E&&(n=E.get(a))}catch{n=void 0}if(!n||n.size===0)throw new Lt(82,`${j.prettyDescriptor(e.configuration,t)}: ${Yge(a)} not found or empty`);let c=eat(t),f=n.get(c);if(!f)throw new Lt(82,`${j.prettyDescriptor(e.configuration,t)}: entry not found in ${Yge(a)}`);let p=e.configuration.normalizeDependency(j.makeDescriptor(t,f));return r.supportsDescriptor(p,s)?r.bindDescriptor(p,e.topLevelWorkspace.anchoredLocator,s):p};var tat={configuration:{catalog:{description:"The default catalog of packages",type:"MAP",valueDefinition:{description:"The catalog of packages",type:"STRING"}},catalogs:{description:"Named catalogs of packages",type:"MAP",valueDefinition:{description:"A named catalog",type:"MAP",valueDefinition:{description:"Package version in the catalog",type:"STRING"}}}},hooks:{beforeWorkspacePacking:(e,t)=>{let r=e.project,s=r.configuration.makeResolver(),a={project:r,resolver:s,report:new Qi};for(let n of _t.allDependencies){let c=t[n];if(c)for(let[f,p]of Object.entries(c)){if(typeof p!="string"||!U5(p))continue;let h=j.parseIdent(f),E=j.makeDescriptor(h,p),C=_5(r,E,s,a),{protocol:S,source:x,params:I,selector:T}=j.parseRange(j.convertToManifestRange(C.range));S===e.project.configuration.get("defaultProtocol")&&(S=null),c[f]=j.makeRange({protocol:S,source:x,params:I,selector:T})}}},reduceDependency:async(e,t,r,s,{resolver:a,resolveOptions:n})=>U5(e.range)?_5(t,e,a,n):e}},rat=tat;var W5={};Vt(W5,{default:()=>iat});Ge();var Qt={optional:!0},j5=[["@tailwindcss/aspect-ratio@<0.2.1",{peerDependencies:{tailwindcss:"^2.0.2"}}],["@tailwindcss/line-clamp@<0.2.1",{peerDependencies:{tailwindcss:"^2.0.2"}}],["@fullhuman/[email protected] || 3.1.3-alpha.0",{peerDependencies:{postcss:"^8.0.0"}}],["@samverschueren/stream-to-observable@<0.3.1",{peerDependenciesMeta:{rxjs:Qt,zenObservable:Qt}}],["any-observable@<0.5.1",{peerDependenciesMeta:{rxjs:Qt,zenObservable:Qt}}],["@pm2/agent@<1.0.4",{dependencies:{debug:"*"}}],["debug@<4.2.0",{peerDependenciesMeta:{"supports-color":Qt}}],["got@<11",{dependencies:{"@types/responselike":"^1.0.0","@types/keyv":"^3.1.1"}}],["cacheable-lookup@<4.1.2",{dependencies:{"@types/keyv":"^3.1.1"}}],["http-link-dataloader@*",{peerDependencies:{graphql:"^0.13.1 || ^14.0.0"}}],["typescript-language-server@*",{dependencies:{"vscode-jsonrpc":"^5.0.1","vscode-languageserver-protocol":"^3.15.0"}}],["postcss-syntax@*",{peerDependenciesMeta:{"postcss-html":Qt,"postcss-jsx":Qt,"postcss-less":Qt,"postcss-markdown":Qt,"postcss-scss":Qt}}],["jss-plugin-rule-value-function@<=10.1.1",{dependencies:{"tiny-warning":"^1.0.2"}}],["ink-select-input@<4.1.0",{peerDependencies:{react:"^16.8.2"}}],["license-webpack-plugin@<2.3.18",{peerDependenciesMeta:{webpack:Qt}}],["snowpack@>=3.3.0",{dependencies:{"node-gyp":"^7.1.0"}}],["promise-inflight@*",{peerDependenciesMeta:{bluebird:Qt}}],["reactcss@*",{peerDependencies:{react:"*"}}],["react-color@<=2.19.0",{peerDependencies:{react:"*"}}],["gatsby-plugin-i18n@*",{dependencies:{ramda:"^0.24.1"}}],["useragent@^2.0.0",{dependencies:{request:"^2.88.0",yamlparser:"0.0.x",semver:"5.5.x"}}],["@apollographql/apollo-tools@<=0.5.2",{peerDependencies:{graphql:"^14.2.1 || ^15.0.0"}}],["material-table@^2.0.0",{dependencies:{"@babel/runtime":"^7.11.2"}}],["@babel/parser@*",{dependencies:{"@babel/types":"^7.8.3"}}],["fork-ts-checker-webpack-plugin@<=6.3.4",{peerDependencies:{eslint:">= 6",typescript:">= 2.7",webpack:">= 4","vue-template-compiler":"*"},peerDependenciesMeta:{eslint:Qt,"vue-template-compiler":Qt}}],["rc-animate@<=3.1.1",{peerDependencies:{react:">=16.9.0","react-dom":">=16.9.0"}}],["react-bootstrap-table2-paginator@*",{dependencies:{classnames:"^2.2.6"}}],["react-draggable@<=4.4.3",{peerDependencies:{react:">= 16.3.0","react-dom":">= 16.3.0"}}],["apollo-upload-client@<14",{peerDependencies:{graphql:"14 - 15"}}],["react-instantsearch-core@<=6.7.0",{peerDependencies:{algoliasearch:">= 3.1 < 5"}}],["react-instantsearch-dom@<=6.7.0",{dependencies:{"react-fast-compare":"^3.0.0"}}],Line truncated
This command will output all matches to the given prolog query.
`,examples:[["List all dependencies throughout the workspace","yarn constraints query 'workspace_has_dependency(_, DependencyName, _, _).'"]]})}async execute(){let{Constraints:r}=await Promise.resolve().then(()=>(AS(),fS)),s=await Je.find(this.context.cwd,this.context.plugins),{project:a}=await Rt.find(s,this.context.cwd),n=await r.find(a),c=this.query;return c.endsWith(".")||(c=`${c}.`),(await Ft.start({configuration:s,json:this.json,stdout:this.context.stdout},async p=>{for await(let h of n.query(c)){let E=Array.from(Object.entries(h)),C=E.length,S=E.reduce((x,[I])=>Math.max(x,I.length),0);for(let x=0;x<C;x++){let[I,T]=E[x];p.reportInfo(null,`${Cat(x,C)}${I.padEnd(S," ")} = ${Iat(T)}`)}p.reportJson(h)}})).exitCode()}};function Iat(e){return typeof e!="string"?`${e}`:e.match(/^[a-zA-Z][a-zA-Z0-9_]+$/)?e:`'${e}'`}function Cat(e,t){let r=e===0,s=e===t-1;return r&&s?"":r?"\u250C ":s?"\u2514 ":"\u2502 "}Ge();jt();var qC=class extends ft{constructor(){super(...arguments);this.verbose=pe.Boolean("-v,--verbose",!1,{description:"Also print the fact database automatically compiled from the workspace manifests"})}static{this.paths=[["constraints","source"]]}static{this.usage=it.Usage({category:"Constraints-related commands",description:"print the source code for the constraints",details:"\n This command will print the Prolog source code used by the constraints engine. Adding the `-v,--verbose` flag will print the *full* source code, including the fact database automatically compiled from the workspace manifests.\n ",examples:[["Prints the source code","yarn constraints source"],["Print the source code and the fact database","yarn constraints source -v"]]})}async execute(){let{Constraints:r}=await Promise.resolve().then(()=>(AS(),fS)),s=await Je.find(this.context.cwd,this.context.plugins),{project:a}=await Rt.find(s,this.context.cwd),n=await r.find(a);this.context.stdout.write(this.verbose?n.fullSource:n.source)}};Ge();Ge();jt();lS();var YC=class extends ft{constructor(){super(...arguments);this.fix=pe.Boolean("--fix",!1,{description:"Attempt to automatically fix unambiguous issues, following a multi-pass process"});this.json=pe.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["constraints"]]}static{this.usage=it.Usage({category:"Constraints-related commands",description:"check that the project constraints are met",details:`
This command will run constraints on your project and emit errors for each one that is found but isn't met. If any error is emitted the process will exit with a non-zero exit code.
If the \`--fix\` flag is used, Yarn will attempt to automatically fix the issues the best it can, following a multi-pass process (with a maximum of 10 iterations). Some ambiguous patterns cannot be autofixed, in which case you'll have to manually specify the right resolution.
For more information as to how to write constraints, please consult our dedicated page on our website: https://yarnpkg.com/features/constraints.
`,examples:[["Check that all constraints are satisfied","yarn constraints"],["Autofix all unmet constraints","yarn constraints --fix"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s}=await Rt.find(r,this.context.cwd);await s.restoreInstallState();let a=await s.loadUserConfig(),n;if(a?.constraints)n=new UC(s);else{let{Constraints:h}=await Promise.resolve().then(()=>(AS(),fS));n=await h.find(s)}let c,f=!1,p=!1;for(let h=this.fix?10:1;h>0;--h){let E=await n.process();if(!E)break;let{changedWorkspaces:C,remainingErrors:S}=YT(s,E,{fix:this.fix}),x=[];for(let[I,T]of C){let O=I.manifest.indent;I.manifest=new _t,I.manifest.indent=O,I.manifest.load(T),x.push(I.persistManifest())}if(await Promise.all(x),!(C.size>0&&h>1)){c=zge(S,{configuration:r}),f=!1,p=!0;for(let[,I]of S)for(let T of I)T.fixable?f=!0:p=!1}}if(c.children.length===0)return 0;if(f){let h=p?`Those errors can all be fixed by running ${ce.pretty(r,"yarn constraints --fix",ce.Type.CODE)}`:`Errors prefixed by '\u2699' can be fixed by running ${ce.pretty(r,"yarn constraints --fix",ce.Type.CODE)}`;await Ft.start({configuration:r,stdout:this.context.stdout,includeNames:!1,includeFooter:!1},async E=>{E.reportInfo(0,h),E.reportSeparator()})}return c.children=qe.sortMap(c.children,h=>h.value[1]),ts.emitTree(c,{configuration:r,stdout:this.context.stdout,json:this.json,separators:1}),1}};lS();var wat={configuration:{enableConstraintsChecks:{description:"If true, constraints will run during installs",type:"BOOLEAN",default:!1},constraintsPath:{description:"The path of the constraints file.",type:"ABSOLUTE_PATH",default:"./constraints.pro"}},commands:[GC,qC,YC],hooks:{async validateProjectAfterInstall(e,{reportError:t}){if(!e.configuration.get("enableConstraintsChecks"))return;let r=await e.loadUserConfig(),s;if(r?.constraints)s=new UC(e);else{let{Constraints:c}=await Promise.resolve().then(()=>(AS(),fS));s=await c.find(e)}let a=await s.process();if(!a)return;let{remainingErrors:n}=YT(e,a);if(n.size!==0)if(e.configuration.isCI)for(let[c,f]of n)for(let p of f)t(84,`${ce.pretty(e.configuration,c.anchoredLocator,ce.Type.IDENT)}: ${p.text}`);else t(84,`Constraint check failed; run ${ce.pretty(e.configuration,"yarn constraints",ce.Type.CODE)} for more details`)}}},Bat=wat;var u9={};Vt(u9,{CreateCommand:()=>WC,DlxCommand:()=>VC,default:()=>Sat});Ge();jt();var WC=class extends ft{constructor(){super(...arguments);this.pkg=pe.String("-p,--package",{description:"The package to run the provided command from"});this.quiet=pe.Boolean("-q,--quiet",!1,{description:"Only report critical errors instead of printing the full install logs"});this.command=pe.String();this.args=pe.Proxy()}static{this.paths=[["create"]]}async execute(){let r=[];this.pkg&&r.push("--package",this.pkg),this.quiet&&r.push("--quiet");let s=this.command.replace(/^(@[^@/]+)(@|$)/,"$1/create$2"),a=j.parseDescriptor(s),n=a.name.match(/^create(-|$)/)?a:a.scope?j.makeIdent(a.scope,`create-${a.name}`):j.makeIdent(null,`create-${a.name}`),c=j.stringifyIdent(n);return a.range!=="unknown"&&(c+=`@${a.range}`),this.cli.run(["dlx",...r,c,...this.args])}};Ge();Ge();bt();jt();var VC=class extends ft{constructor(){super(...arguments);this.packages=pe.Array("-p,--package",{description:"The package(s) to install before running the command"});this.quiet=pe.Boolean("-q,--quiet",!1,{description:"Only report critical errors instead of printing the full install logs"});this.command=pe.String();this.args=pe.Proxy()}static{this.paths=[["dlx"]]}static{this.usage=it.Usage({description:"run a package in a temporary environment",details:"\n This command will install a package within a temporary environment, and run its binary script if it contains any. The binary will run within the current cwd.\n\n By default Yarn will download the package named `command`, but this can be changed through the use of the `-p,--package` flag which will instruct Yarn to still run the same command but from a different package.\n\n Using `yarn dlx` as a replacement of `yarn add` isn't recommended, as it makes your project non-deterministic (Yarn doesn't keep track of the packages installed through `dlx` - neither their name, nor their version).\n ",examples:[["Use create-vite to scaffold a new Vite project","yarn dlx create-vite"],["Install multiple packages for a single command",`yarn dlx -p typescript -p ts-node ts-node --transpile-only -e "console.log('hello!')"`]]})}async execute(){return Je.telemetry=null,await le.mktempPromise(async r=>{let s=K.join(r,`dlx-${process.pid}`);await le.mkdirPromise(s),await le.writeFilePromise(K.join(s,"package.json"),`{}
`),await le.writeFilePromise(K.join(s,"yarn.lock"),"");let a=K.join(s,".yarnrc.yml"),n=await Je.findProjectCwd(this.context.cwd),f={enableGlobalCache:!(await Je.find(this.context.cwd,null,{strict:!1})).get("enableGlobalCache"),enableTelemetry:!1,logFilters:[{code:zf(68),level:ce.LogLevel.Discard}]},p=n!==null?K.join(n,".yarnrc.yml"):null;p!==null&&le.existsSync(p)?(await le.copyFilePromise(p,a),await Je.updateConfiguration(s,O=>{let U=qe.toMerged(O,f);return Array.isArray(O.plugins)&&(U.plugins=O.plugins.map(V=>{let $=typeof V=="string"?V:V.path,ie=Ae.isAbsolute($)?$:Ae.resolve(Ae.fromPortablePath(n),$);return typeof V=="string"?ie:{path:ie,spec:V.spec}})),U})):await le.writeJsonPromise(a,f);let h=this.packages??[this.command],E=j.parseDescriptor(this.command).name,C=await this.cli.run(["add","--fixed","--",...h],{cwd:s,quiet:this.quiet});if(C!==0)return C;this.quiet||this.context.stdout.write(`
`);let S=await Je.find(s,this.context.plugins),{project:x,workspace:I}=await Rt.find(S,s);if(I===null)throw new ar(x.cwd,s);await x.restoreInstallState();let T=await wn.getWorkspaceAccessibleBinaries(I);return T.has(E)===!1&&T.size===1&&typeof this.packages>"u"&&(E=Array.from(T)[0][0]),await wn.executeWorkspaceAccessibleBinary(I,E,this.args,{packageAccessibleBinaries:T,cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})})}};var vat={commands:[WC,VC]},Sat=vat;var p9={};Vt(p9,{ExecFetcher:()=>hS,ExecResolver:()=>dS,default:()=>Pat,execUtils:()=>JT});Ge();Ge();Ge();bt();var AA="exec:";var JT={};Vt(JT,{loadGeneratorFile:()=>pS,makeLocator:()=>A9,makeSpec:()=>wme,parseSpec:()=>f9});Ge();bt();function f9(e){let{params:t,selector:r}=j.parseRange(e),s=Ae.toPortablePath(r);return{parentLocator:t&&typeof t.locator=="string"?j.parseLocator(t.locator):null,path:s}}function wme({parentLocator:e,path:t,generatorHash:r,protocol:s}){let a=e!==null?{locator:j.stringifyLocator(e)}:{},n=typeof r<"u"?{hash:r}:{};return j.makeRange({protocol:s,source:t,selector:t,params:{...n,...a}})}function A9(e,{parentLocator:t,path:r,generatorHash:s,protocol:a}){return j.makeLocator(e,wme({parentLocator:t,path:r,generatorHash:s,protocol:a}))}async function pS(e,t,r){let{parentLocator:s,path:a}=j.parseFileStyleRange(e,{protocol:t}),n=K.isAbsolute(a)?{packageFs:new Pn(vt.root),prefixPath:vt.dot,localPath:vt.root}:await r.fetcher.fetch(s,r),c=n.localPath?{packageFs:new Pn(vt.root),prefixPath:K.relative(vt.root,n.localPath)}:n;n!==c&&n.releaseFs&&n.releaseFs();let f=c.packageFs,p=K.join(c.prefixPath,a);return await f.readFilePromise(p,"utf8")}var hS=class{supports(t,r){return!!t.reference.startsWith(AA)}getLocalPath(t,r){let{parentLocator:s,path:a}=j.parseFileStyleRange(t.reference,{protocol:AA});if(K.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(s,r);return n===null?null:K.resolve(n,a)}async fetch(t,r){let s=r.checksums.get(t.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(t,s,{onHit:()=>r.report.reportCacheHit(t),onMiss:()=>r.report.reportCacheMiss(t),loader:()=>this.fetchFromDisk(t,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:j.getIdentVendorPath(t),localPath:this.getLocalPath(t,r),checksum:c}}async fetchFromDisk(t,r){let s=r.project.getDependencyMeta(t,null);if(!r.project.configuration.get("enableScripts")&&!s.built)throw new Lt(4,`${j.prettyLocator(r.project.configuration,t)} can't be built with the exec: protocol because all scripts have been disabled.`);let a=await pS(t.reference,AA,r);return le.mktempPromise(async n=>{let c=K.join(n,"generator.js");return await le.writeFilePromise(c,a),le.mktempPromise(async f=>{if(await this.generatePackage(f,t,c,r),!le.existsSync(K.join(f,"build")))throw new Error("The script should have generated a build directory");return await ms.makeArchiveFromDirectory(K.join(f,"build"),{prefixPath:j.getIdentVendorPath(t),compressionLevel:r.project.configuration.get("compressionLevel")})})})}async generatePackage(t,r,s,a){return await le.mktempPromise(async n=>{let c=await wn.makeScriptEnv({project:a.project,binFolder:n}),f=K.join(t,"runtime.js");return await le.mktempPromise(async p=>{let h=K.join(p,"buildfile.log"),E=K.join(t,"generator"),C=K.join(t,"build");await le.mkdirPromise(E),await le.mkdirPromise(C);let S={tempDir:Ae.fromPortablePath(E),buildDir:Ae.fromPortablePath(C),locator:j.stringifyLocator(r)};await le.writeFilePromise(f,`
// Expose 'Module' as a global variable
Object.defineProperty(global, 'Module', {
get: () => require('module'),
configurable: true,
enumerable: false,
});
// Expose non-hidden built-in modules as global variables
for (const name of Module.builtinModules.filter((name) => name !== 'module' && !name.startsWith('_'))) {
Object.defineProperty(global, name, {
get: () => require(name),
configurable: true,
enumerable: false,
});
}
// Expose the 'execEnv' global variable
Object.defineProperty(global, 'execEnv', {
value: {
...${JSON.stringify(S)},
},
enumerable: true,
});
`);let x=c.NODE_OPTIONS||"",I=/\s*--require\s+\S*\.pnp\.c?js\s*/g;x=x.replace(I," ").trim(),c.NODE_OPTIONS=x;let{stdout:T,stderr:O}=a.project.configuration.getSubprocessStreams(h,{header:`# This file contains the result of Yarn generating a package (${j.stringifyLocator(r)})
`,prefix:j.prettyLocator(a.project.configuration,r),report:a.report}),{code:U}=await Yr.pipevp(process.execPath,["--require",Ae.fromPortablePath(f),Ae.fromPortablePath(s),j.stringifyIdent(r)],{cwd:t,env:c,stdin:null,stdout:T,stderr:O});if(U!==0)throw le.detachTemp(p),new Error(`Package generation failed (exit code ${U}, logs can be found here: ${ce.pretty(a.project.configuration,h,ce.Type.PATH)})`)})})}};Ge();Ge();Ge();var bat=2,dS=class{supportsDescriptor(t,r){return!!t.range.startsWith(AA)}supportsLocator(t,r){return!!t.reference.startsWith(AA)}shouldPersistResolution(t,r){return!1}bindDescriptor(t,r,s){if(s.project.tryWorkspaceByLocator(r)===null)throw new Lt(57,`${j.prettyLocator(s.project.configuration,r)} lists ${j.prettyDescriptor(s.project.configuration,t)} as dependency, but only workspaces can depend on exec: packages.`);return j.bindDescriptor(t,{locator:j.stringifyLocator(r)})}getResolutionDependencies(t,r){return{}}async getCandidates(t,r,s){if(!s.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let{path:a,parentLocator:n}=f9(t.range);if(n===null)throw new Error("Assertion failed: The descriptor should have been bound");let c=await pS(j.makeRange({protocol:AA,source:a,selector:a,params:{locator:j.stringifyLocator(n)}}),AA,s.fetchOptions),f=Mn.makeHash(`${bat}`,c).slice(0,6);return[A9(t,{parentLocator:n,path:a,generatorHash:f,protocol:AA})]}async getSatisfying(t,r,s,a){let[n]=await this.getCandidates(t,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(t,r){if(!r.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let s=await r.fetchOptions.fetcher.fetch(t,r.fetchOptions),a=await qe.releaseAfterUseAsync(async()=>await _t.find(s.prefixPath,{baseFs:s.packageFs}),s.releaseFs);return{...t,version:a.version||"0.0.0",languageName:a.languageName||r.project.configuration.get("defaultLanguageName"),linkType:"HARD",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};var Dat={fetchers:[hS],resolvers:[dS]},Pat=Dat;var d9={};Vt(d9,{FileFetcher:()=>ES,FileResolver:()=>IS,TarballFileFetcher:()=>CS,TarballFileResolver:()=>wS,default:()=>Qat,fileUtils:()=>Nm});Ge();bt();var KC=/^(?:[a-zA-Z]:[\\/]|\.{0,2}\/)/,gS=/^[^?]*\.(?:tar\.gz|tgz)(?:::.*)?$/,rs="file:";var Nm={};Vt(Nm,{fetchArchiveFromLocator:()=>yS,makeArchiveFromLocator:()=>zT,makeBufferFromLocator:()=>h9,makeLocator:()=>JC,makeSpec:()=>Bme,parseSpec:()=>mS});Ge();bt();function mS(e){let{params:t,selector:r}=j.parseRange(e),s=Ae.toPortablePath(r);return{parentLocator:t&&typeof t.locator=="string"?j.parseLocator(t.locator):null,path:s}}function Bme({parentLocator:e,path:t,hash:r,protocol:s}){let a=e!==null?{locator:j.stringifyLocator(e)}:{},n=typeof r<"u"?{hash:r}:{};return j.makeRange({protocol:s,source:t,selector:t,params:{...n,...a}})}function JC(e,{parentLocator:t,path:r,hash:s,protocol:a}){return j.makeLocator(e,Bme({parentLocator:t,path:r,hash:s,protocol:a}))}async function yS(e,t){let{parentLocator:r,path:s}=j.parseFileStyleRange(e.reference,{protocol:rs}),a=K.isAbsolute(s)?{packageFs:new Pn(vt.root),prefixPath:vt.dot,localPath:vt.root}:await t.fetcher.fetch(r,t),n=a.localPath?{packageFs:new Pn(vt.root),prefixPath:K.relative(vt.root,a.localPath)}:a;a!==n&&a.releaseFs&&a.releaseFs();let c=n.packageFs,f=K.join(n.prefixPath,s);return await qe.releaseAfterUseAsync(async()=>await c.readFilePromise(f),n.releaseFs)}async function zT(e,{protocol:t,fetchOptions:r,inMemory:s=!1}){let{parentLocator:a,path:n}=j.parseFileStyleRange(e.reference,{protocol:t}),c=K.isAbsolute(n)?{packageFs:new Pn(vt.root),prefixPath:vt.dot,localPath:vt.root}:await r.fetcher.fetch(a,r),f=c.localPath?{packageFs:new Pn(vt.root),prefixPath:K.relative(vt.root,c.localPath)}:c;c!==f&&c.releaseFs&&c.releaseFs();let p=f.packageFs,h=K.join(f.prefixPath,n);return await qe.releaseAfterUseAsync(async()=>await ms.makeArchiveFromDirectory(h,{baseFs:p,prefixPath:j.getIdentVendorPath(e),compressionLevel:r.project.configuration.get("compressionLevel"),inMemory:s}),f.releaseFs)}async function h9(e,{protocol:t,fetchOptions:r}){return(await zT(e,{protocol:t,fetchOptions:r,inMemory:!0})).getBufferAndClose()}var ES=class{supports(t,r){return!!t.reference.startsWith(rs)}getLocalPath(t,r){let{parentLocator:s,path:a}=j.parseFileStyleRange(t.reference,{protocol:rs});if(K.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(s,r);return n===null?null:K.resolve(n,a)}async fetch(t,r){let s=r.checksums.get(t.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(t,s,{onHit:()=>r.report.reportCacheHit(t),onMiss:()=>r.report.reportCacheMiss(t,`${j.prettyLocator(r.project.configuration,t)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.fetchFro Line truncated
`,{automaticNewlines:!0});let h=[p],E=K.join(this.context.cwd,"README.md");if(le.existsSync(E)||(await le.writeFilePromise(E,`# ${j.stringifyIdent(n.name)}
`),h.push(E)),!s||s.cwd===this.context.cwd){let C=K.join(this.context.cwd,Ir.lockfile);le.existsSync(C)||(await le.writeFilePromise(C,""),h.push(C));let x=[".yarn/*","!.yarn/patches","!.yarn/plugins","!.yarn/releases","!.yarn/sdks","!.yarn/versions","","# Whether you use PnP or not, the node_modules folder is often used to store","# build artifacts that should be gitignored","node_modules","","# Swap the comments on the following lines if you wish to use zero-installs","# In that case, don't forget to run `yarn config set enableGlobalCache false`!","# Documentation here: https://yarnpkg.com/features/caching#zero-installs","","#!.yarn/cache",".pnp.*"].map(fe=>`${fe}
`).join(""),I=K.join(this.context.cwd,".gitignore");le.existsSync(I)||(await le.writeFilePromise(I,x),h.push(I));let O=["/.yarn/** linguist-vendored","/.yarn/releases/* binary","/.yarn/plugins/**/* binary","/.pnp.* binary linguist-generated"].map(fe=>`${fe}
`).join(""),U=K.join(this.context.cwd,".gitattributes");le.existsSync(U)||(await le.writeFilePromise(U,O),h.push(U));let V={"*":{charset:"utf-8",endOfLine:"lf",indentSize:2,indentStyle:"space",insertFinalNewline:!0}};qe.mergeIntoTarget(V,r.get("initEditorConfig"));let $=`root = true
`;for(let[fe,ae]of Object.entries(V)){$+=`
[${fe}]
`;for(let[ge,he]of Object.entries(ae)){let Ce=ge.replace(/[A-Z]/g,Ee=>`_${Ee.toLowerCase()}`);$+=`${Ce} = ${he}
`}}let ie=K.join(this.context.cwd,".editorconfig");le.existsSync(ie)||(await le.writeFilePromise(ie,$),h.push(ie)),await this.cli.run(["install"],{quiet:!0}),await this.initialize(),le.existsSync(K.join(this.context.cwd,".git"))||(await Yr.execvp("git",["init"],{cwd:this.context.cwd}),await Yr.execvp("git",["add","--",...h],{cwd:this.context.cwd}),await Yr.execvp("git",["commit","--allow-empty","-m","First commit"],{cwd:this.context.cwd}))}}};var zC=class extends X0{constructor(){super(...arguments);this.initializer=pe.String();this.argv=pe.Proxy()}static{this.paths=[["init"]]}async initialize(){this.context.stdout.write(`
`),await this.cli.run(["dlx",this.initializer,...this.argv],{quiet:!0})}};var Oat={configuration:{initScope:{description:"Scope used when creating packages via the init command",type:"STRING",default:null},initFields:{description:"Additional fields to set when creating packages via the init command",type:"MAP",valueDefinition:{description:"",type:"ANY"}},initEditorConfig:{description:"Extra rules to define in the generator editorconfig",type:"MAP",valueDefinition:{description:"",type:"ANY"}}},commands:[X0,zC]},Lat=Oat;var mY={};Vt(mY,{SearchCommand:()=>hw,UpgradeInteractiveCommand:()=>dw,default:()=>Vpt});Ge();var Pme=et(Ie("os"));function XC({stdout:e}){if(Pme.default.endianness()==="BE")throw new Error("Interactive commands cannot be used on big-endian systems because ink depends on yoga-layout-prebuilt which only supports little-endian architectures");if(!e.isTTY)throw new Error("Interactive commands can only be used inside a TTY environment")}jt();var _ye=et(M9()),U9={appId:"OFCNCOG2CU",apiKey:"6fe4476ee5a1832882e326b506d14126",indexName:"npm-search"},Fct=(0,_ye.default)(U9.appId,U9.apiKey).initIndex(U9.indexName),_9=async(e,t=0)=>await Fct.search(e,{analyticsTags:["yarn-plugin-interactive-tools"],attributesToRetrieve:["name","version","owner","repository","humanDownloadsLast30Days"],page:t,hitsPerPage:10});var bb=["regular","dev","peer"],hw=class extends ft{static{this.paths=[["search"]]}static{this.usage=it.Usage({category:"Interactive commands",description:"open the search interface",details:`
This command opens a fullscreen terminal interface where you can search for and install packages from the npm registry.
`,examples:[["Open the search window","yarn search"]]})}async execute(){XC(this.context);let{Gem:t}=await Promise.resolve().then(()=>(RF(),oY)),{ScrollableItems:r}=await Promise.resolve().then(()=>(OF(),NF)),{useKeypress:s}=await Promise.resolve().then(()=>(pw(),aY)),{useMinistore:a}=await Promise.resolve().then(()=>(AY(),fY)),{renderForm:n}=await Promise.resolve().then(()=>(_F(),UF)),{default:c}=await Promise.resolve().then(()=>et(Swe())),{Box:f,Text:p}=await Promise.resolve().then(()=>et(Yc())),{default:h,useEffect:E,useState:C}=await Promise.resolve().then(()=>et(dn())),S=await Je.find(this.context.cwd,this.context.plugins),x=()=>h.createElement(f,{flexDirection:"row"},h.createElement(f,{flexDirection:"column",width:48},h.createElement(f,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<up>"),"/",h.createElement(p,{bold:!0,color:"cyanBright"},"<down>")," to move between packages.")),h.createElement(f,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<space>")," to select a package.")),h.createElement(f,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<space>")," again to change the target."))),h.createElement(f,{flexDirection:"column"},h.createElement(f,{marginLeft:1},h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<enter>")," to install the selected packages.")),h.createElement(f,{marginLeft:1},h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<ctrl+c>")," to abort.")))),I=()=>h.createElement(h.Fragment,null,h.createElement(f,{width:15},h.createElement(p,{bold:!0,underline:!0,color:"gray"},"Owner")),h.createElement(f,{width:11},h.createElement(p,{bold:!0,underline:!0,color:"gray"},"Version")),h.createElement(f,{width:10},h.createElement(p,{bold:!0,underline:!0,color:"gray"},"Downloads"))),T=()=>h.createElement(f,{width:17},h.createElement(p,{bold:!0,underline:!0,color:"gray"},"Target")),O=({hit:he,active:Ce})=>{let[Ee,d]=a(he.name,null);s({active:Ce},(me,ue)=>{if(ue.name!=="space")return;if(!Ee){d(bb[0]);return}let Z=bb.indexOf(Ee)+1;Z===bb.length?d(null):d(bb[Z])},[Ee,d]);let Se=j.parseIdent(he.name),Be=j.prettyIdent(S,Se);return h.createElement(f,null,h.createElement(f,{width:45},h.createElement(p,{bold:!0,wrap:"wrap"},Be)),h.createElement(f,{width:14,marginLeft:1},h.createElement(p,{bold:!0,wrap:"truncate"},he.owner.name)),h.createElement(f,{width:10,marginLeft:1},h.createElement(p,{italic:!0,wrap:"truncate"},he.version)),h.createElement(f,{width:16,marginLeft:1},h.createElement(p,null,he.humanDownloadsLast30Days)))},U=({name:he,active:Ce})=>{let[Ee]=a(he,null),d=j.parseIdent(he);return h.createElement(f,null,h.createElement(f,{width:47},h.createElement(p,{bold:!0}," - ",j.prettyIdent(S,d))),bb.map(Se=>h.createElement(f,{key:Se,width:14,marginLeft:1},h.createElement(p,null," ",h.createElement(t,{active:Ee===Se})," ",h.createElement(p,{bold:!0},Se)))))},V=()=>h.createElement(f,{marginTop:1},h.createElement(p,null,"Powered by Algolia.")),ie=await n(({useSubmit:he})=>{let Ce=a();he(Ce);let Ee=Array.from(Ce.keys()).filter(_=>Ce.get(_)!==null),[d,Se]=C(""),[Be,me]=C(0),[ue,Z]=C([]),be=_=>{_.match(/\t| /)||Se(_)},Qe=async()=>{me(0);let _=await _9(d);_.query===d&&Z(_.hits)},ot=async()=>{let _=await _9(d,Be+1);_.query===d&&_.page-1===Be&&(me(_.page),Z([...ue,..._.hits]))};return E(()=>{d?Qe():Z([])},[d]),h.createElement(f,{flexDirection:"column"},h.createElement(x,null),h.createElement(f,{flexDirection:"row",marginTop:1},h.createElement(p,{bold:!0},"Search: "),h.createElement(f,{width:41},h.createElement(c,{value:d,onChange:be,placeholder:"i.e. babel, webpack, react...",showCursor:!1})),h.createElement(I,null)),ue.length?h.createElement(r,{radius:2,loop:!1,children:ue.map(_=>h.createElement(O,{key:_.name,hit:_,active:!1})),willReachEnd:ot}):h.createElement(p,{color:"gray"},"Start typing..."),h.createElement(f,{flexDirection:"row",marginTop:1},h.createElement(f,{width:49},h.createElement(p,{bold:!0},"Selected:")),h.createElement(T,null)),Ee.length?Ee.map(_=>h.createElement(U,{key:_,name:_,active:!1})):h.createElement(p,{color:"gray"},"No selected packages..."),h.createElement(V,null))},{},{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});if(typeof ie>"u")return 1;let fe=Array.from(ie.keys()).filter(he=>ie.get(he)==="regular"),ae=Array.from(ie.keys()).filter(he=>ie.get(he)==="dev"),ge=Array.from(ie.keys()).filter(he=>ie.get(he)==="peer");return fe.length&&await this.cli.run(["add",...fe]),ae.length&&await this.cli.run(["add","--dev",...ae]),ge&&await this.cli.run(["add","--peer",...ge]),0}};Ge();jt();dG();var Rwe=et(hi());Jo();var Qwe=/^((?:[\^~]|>=?)?)([0-9]+)(\.[0-9]+)(\.[0-9]+)((?:-\S+)?)$/;function Twe(e,t){return e.length>0?[e.slice(0,t)].concat(Twe(e.slice(t),t)):[]}var dw=class extends ft{constructor(){super(...arguments);this.mode=pe.String("--mode",{description:"Change what artifacts installs genera Line truncated
${E}, next tree:
${Tb(f)}`);let S=Lwe(f);if(S)throw new Error(`${S}, after hoisting finished:
${Tb(f)}`)}return n.debugLevel>=2&&console.log(Tb(f)),aht(f)},eht=e=>{let t=e[e.length-1],r=new Map,s=new Set,a=n=>{if(!s.has(n)){s.add(n);for(let c of n.hoistedDependencies.values())r.set(c.name,c);for(let c of n.dependencies.values())n.peerNames.has(c.name)||a(c)}};return a(t),r},tht=e=>{let t=e[e.length-1],r=new Map,s=new Set,a=new Set,n=(c,f)=>{if(s.has(c))return;s.add(c);for(let h of c.hoistedDependencies.values())if(!f.has(h.name)){let E;for(let C of e)E=C.dependencies.get(h.name),E&&r.set(E.name,E)}let p=new Set;for(let h of c.dependencies.values())p.add(h.name);for(let h of c.dependencies.values())c.peerNames.has(h.name)||n(h,p)};return n(t,a),r},Nwe=(e,t)=>{if(t.decoupled)return t;let{name:r,references:s,ident:a,locator:n,dependencies:c,originalDependencies:f,hoistedDependencies:p,peerNames:h,reasons:E,isHoistBorder:C,hoistPriority:S,dependencyKind:x,hoistedFrom:I,hoistedTo:T}=t,O={name:r,references:new Set(s),ident:a,locator:n,dependencies:new Map(c),originalDependencies:new Map(f),hoistedDependencies:new Map(p),peerNames:new Set(h),reasons:new Map(E),decoupled:!0,isHoistBorder:C,hoistPriority:S,dependencyKind:x,hoistedFrom:new Map(I),hoistedTo:new Map(T)},U=O.dependencies.get(r);return U&&U.ident==O.ident&&O.dependencies.set(r,O),e.dependencies.set(O.name,O),O},rht=(e,t)=>{let r=new Map([[e.name,[e.ident]]]);for(let a of e.dependencies.values())e.peerNames.has(a.name)||r.set(a.name,[a.ident]);let s=Array.from(t.keys());s.sort((a,n)=>{let c=t.get(a),f=t.get(n);if(f.hoistPriority!==c.hoistPriority)return f.hoistPriority-c.hoistPriority;{let p=c.dependents.size+c.peerDependents.size;return f.dependents.size+f.peerDependents.size-p}});for(let a of s){let n=a.substring(0,a.indexOf("@",1)),c=a.substring(n.length+1);if(!e.peerNames.has(n)){let f=r.get(n);f||(f=[],r.set(n,f)),f.indexOf(c)<0&&f.push(c)}}return r},CY=e=>{let t=new Set,r=(s,a=new Set)=>{if(!a.has(s)){a.add(s);for(let n of s.peerNames)if(!e.peerNames.has(n)){let c=e.dependencies.get(n);c&&!t.has(c)&&r(c,a)}t.add(s)}};for(let s of e.dependencies.values())e.peerNames.has(s.name)||r(s);return t},BY=(e,t,r,s,a,n=new Set)=>{let c=t[t.length-1];if(n.has(c))return{anotherRoundNeeded:!1,isGraphChanged:!1};n.add(c);let f=lht(c),p=rht(c,f),h=e==c?new Map:a.fastLookupPossible?eht(t):tht(t),E,C=!1,S=!1,x=new Map(Array.from(p.entries()).map(([T,O])=>[T,O[0]])),I=new Map;do{let T=sht(e,t,r,h,x,p,s,I,a);T.isGraphChanged&&(S=!0),T.anotherRoundNeeded&&(C=!0),E=!1;for(let[O,U]of p)U.length>1&&!c.dependencies.has(O)&&(x.delete(O),U.shift(),x.set(O,U[0]),E=!0)}while(E);for(let T of c.dependencies.values())if(!c.peerNames.has(T.name)&&!r.has(T.locator)){r.add(T.locator);let O=BY(e,[...t,T],r,I,a);O.isGraphChanged&&(S=!0),O.anotherRoundNeeded&&(C=!0),r.delete(T.locator)}return{anotherRoundNeeded:C,isGraphChanged:S}},nht=e=>{for(let[t,r]of e.dependencies)if(!e.peerNames.has(t)&&r.ident!==e.ident)return!0;return!1},iht=(e,t,r,s,a,n,c,f,{outputReason:p,fastLookupPossible:h})=>{let E,C=null,S=new Set;p&&(E=`${Array.from(t).map(O=>So(O)).join("\u2192")}`);let x=r[r.length-1],T=!(s.ident===x.ident);if(p&&!T&&(C="- self-reference"),T&&(T=s.dependencyKind!==1,p&&!T&&(C="- workspace")),T&&s.dependencyKind===2&&(T=!nht(s),p&&!T&&(C="- external soft link with unhoisted dependencies")),T&&(T=!e.peerNames.has(s.name),p&&!T&&(C=`- cannot shadow peer: ${So(e.originalDependencies.get(s.name).locator)} at ${E}`)),T){let O=!1,U=a.get(s.name);if(O=!U||U.ident===s.ident,p&&!O&&(C=`- filled by: ${So(U.locator)} at ${E}`),O)for(let V=r.length-1;V>=1;V--){let ie=r[V].dependencies.get(s.name);if(ie&&ie.ident!==s.ident){O=!1;let fe=f.get(x);fe||(fe=new Set,f.set(x,fe)),fe.add(s.name),p&&(C=`- filled by ${So(ie.locator)} at ${r.slice(0,V).map(ae=>So(ae.locator)).join("\u2192")}`);break}}T=O}if(T&&(T=n.get(s.name)===s.ident,p&&!T&&(C=`- filled by: ${So(c.get(s.name)[0])} at ${E}`)),T){let O=!0,U=new Set(s.peerNames);for(let V=r.length-1;V>=1;V--){let $=r[V];for(let ie of U){if($.peerNames.has(ie)&&$.originalDependencies.has(ie))continue;let fe=$.dependencies.get(ie);fe&&e.dependencies.get(ie)!==fe&&(V===r.length-1?S.add(fe):(S=null,O=!1,p&&(C=`- peer dependency ${So(fe.locator)} from parent ${So($.locator)} was not hoisted to ${E}`))),U.delete(ie)}if(!O)break}T=O}if(T&&!h)for(let O of s.hoistedDependencies.values()){let U=a.get(O.name)||e.dependencies.get(O.name);if(!U||O.ident!==U.ident){T=!1,p&&(C=`- previously hoisted dependency mismatch, needed: ${So(O.locator)}, available: ${So(U?.locator)}`);break}}return S!==null&&S.size>0?{isHoistable:2,dependsOn:S,reason:C}:{isHoistable:T?0:1,reason:C}},GF=e=>`${e.name}@${e.locator}`,sht=(e,t,r,s,a,n,c,f,p)=>{let h=t[t.length-1],E=new Set,C=!1,S=!1,x=(U,V,$,ie,fe)=>{if(E.has(ie))return;let ae=[...V,GF(ie)],ge=[...$,GF(ie)],he=new Map,Ce=new Map;for(let me of CY(ie)){let ue=iht(h,r,[h,...U,ie],me,s,a,n,f,{outputReason:p.debugLevel>=2,fastLookupPossible:p.fastLookupPossible});if(Ce.set(me,ue),ue.isHoistable===2)for(let Z of ue.dependsOn){let be=he. Line truncated
${Tb(e)}`)}let Be=CY(ie);for(let me of Be)if(Ee.has(me)){let ue=Ce.get(me);if((a.get(me.name)===me.ident||!ie.reasons.has(me.name))&&ue.isHoistable!==0&&ie.reasons.set(me.name,ue.reason),!me.isHoistBorder&&ge.indexOf(GF(me))<0){E.add(ie);let be=Nwe(ie,me);x([...U,ie],ae,ge,be,T),E.delete(ie)}}},I,T=new Set(CY(h)),O=Array.from(t).map(U=>GF(U));do{I=T,T=new Set;for(let U of I){if(U.locator===h.locator||U.isHoistBorder)continue;let V=Nwe(h,U);x([],Array.from(r),O,V,T)}}while(T.size>0);return{anotherRoundNeeded:C,isGraphChanged:S}},Lwe=e=>{let t=[],r=new Set,s=new Set,a=(n,c,f)=>{if(r.has(n)||(r.add(n),s.has(n)))return;let p=new Map(c);for(let h of n.dependencies.values())n.peerNames.has(h.name)||p.set(h.name,h);for(let h of n.originalDependencies.values()){let E=p.get(h.name),C=()=>`${Array.from(s).concat([n]).map(S=>So(S.locator)).join("\u2192")}`;if(n.peerNames.has(h.name)){let S=c.get(h.name);(S!==E||!S||S.ident!==h.ident)&&t.push(`${C()} - broken peer promise: expected ${h.ident} but found ${S&&S.ident}`)}else{let S=f.hoistedFrom.get(n.name),x=n.hoistedTo.get(h.name),I=`${S?` hoisted from ${S.join(", ")}`:""}`,T=`${x?` hoisted to ${x}`:""}`,O=`${C()}${I}`;E?E.ident!==h.ident&&t.push(`${O} - broken require promise for ${h.name}${T}: expected ${h.ident}, but found: ${E.ident}`):t.push(`${O} - broken require promise: no required dependency ${h.name}${T} found`)}}s.add(n);for(let h of n.dependencies.values())n.peerNames.has(h.name)||a(h,p,n);s.delete(n)};return a(e,e.dependencies,e),t.join(`
`)},oht=(e,t)=>{let{identName:r,name:s,reference:a,peerNames:n}=e,c={name:s,references:new Set([a]),locator:wY(r,a),ident:Fwe(r,a),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(n),reasons:new Map,decoupled:!0,isHoistBorder:!0,hoistPriority:0,dependencyKind:1,hoistedFrom:new Map,hoistedTo:new Map},f=new Map([[e,c]]),p=(h,E)=>{let C=f.get(h),S=!!C;if(!C){let{name:x,identName:I,reference:T,peerNames:O,hoistPriority:U,dependencyKind:V}=h,$=t.hoistingLimits.get(E.locator);C={name:x,references:new Set([T]),locator:wY(I,T),ident:Fwe(I,T),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(O),reasons:new Map,decoupled:!0,isHoistBorder:$?$.has(x):!1,hoistPriority:U||0,dependencyKind:V||0,hoistedFrom:new Map,hoistedTo:new Map},f.set(h,C)}if(E.dependencies.set(h.name,C),E.originalDependencies.set(h.name,C),S){let x=new Set,I=T=>{if(!x.has(T)){x.add(T),T.decoupled=!1;for(let O of T.dependencies.values())T.peerNames.has(O.name)||I(O)}};I(C)}else for(let x of h.dependencies)p(x,C)};for(let h of e.dependencies)p(h,c);return c},vY=e=>e.substring(0,e.indexOf("@",1)),aht=e=>{let t={name:e.name,identName:vY(e.locator),references:new Set(e.references),dependencies:new Set},r=new Set([e]),s=(a,n,c)=>{let f=r.has(a),p;if(n===a)p=c;else{let{name:h,references:E,locator:C}=a;p={name:h,identName:vY(C),references:E,dependencies:new Set}}if(c.dependencies.add(p),!f){r.add(a);for(let h of a.dependencies.values())a.peerNames.has(h.name)||s(h,a,p);r.delete(a)}};for(let a of e.dependencies.values())s(a,e,t);return t},lht=e=>{let t=new Map,r=new Set([e]),s=c=>`${c.name}@${c.ident}`,a=c=>{let f=s(c),p=t.get(f);return p||(p={dependents:new Set,peerDependents:new Set,hoistPriority:0},t.set(f,p)),p},n=(c,f)=>{let p=!!r.has(f);if(a(f).dependents.add(c.ident),!p){r.add(f);for(let E of f.dependencies.values()){let C=a(E);C.hoistPriority=Math.max(C.hoistPriority,E.hoistPriority),f.peerNames.has(E.name)?C.peerDependents.add(f.ident):n(f,E)}}};for(let c of e.dependencies.values())e.peerNames.has(c.name)||n(e,c);return t},So=e=>{if(!e)return"none";let t=e.indexOf("@",1),r=e.substring(0,t);r.endsWith("$wsroot$")&&(r=`wh:${r.replace("$wsroot$","")}`);let s=e.substring(t+1);if(s==="workspace:.")return".";if(s){let a=(s.indexOf("#")>0?s.split("#")[1]:s).replace("npm:","");return s.startsWith("virtual")&&(r=`v:${r}`),a.startsWith("workspace")&&(r=`w:${r}`,a=""),`${r}${a?`@${a}`:""}`}else return`${r}`};var Tb=e=>{let t=0,r=(a,n,c="")=>{if(t>5e4||n.has(a))return"";t++;let f=Array.from(a.dependencies.values()).sort((h,E)=>h.name===E.name?0:h.name>E.name?1:-1),p="";n.add(a);for(let h=0;h<f.length;h++){let E=f[h];if(!a.peerNames.has(E.name)&&E!==a){let C=a.reasons.get(E.name),S=vY(E.locator);p+=`${c}${h<f.length-1?"\u251C\u2500":"\u2514\u2500"}${(n.has(E)?">":"")+(S!==E.name?`a:${E.name}:`:"")+So(E.locator)+(C?` ${C}`:"")}
`,p+=r(E,n,`${c}${h<f.length-1?"\u2502 ":" "}`)}}return n.delete(a),p};return r(e,new Set)+(t>5e4?`
Tree is too large, part of the tree has been dunped
`:"")};var Fb=(s=>(s.WORKSPACES="workspaces",s.DEPENDENCIES="dependencies",s.NONE="none",s))(Fb||{}),Mwe="node_modules",nd="$wsroot$";var Nb=(e,t)=>{let{packageTree:r,hoistingLimits:s,errors:a,preserveSymlinksRequired:n}=uht(e,t),c=null;if(a.length===0){let f=Owe(r,{hoistingLimits:s});c=Aht(e,f,t)}return{tree:c,errors:a,preserveSymlinksRequired:n}},gA=e=>`${e.name}@${e.reference}`,bY=e=>{let t=new Map;for(let[r,s]of e.entries())if(!s.dirList){let a=t.get(s.locator);a||(a={target:s.target,linkType:s.linkType,locations:[],aliases:s.aliases},t.set(s.locator,a)),a.locations.push(r)}for(let r of t.values())r.locations=r.locations.sort((s,a)=>{let n=s.split(K.delimiter).length,c=a.split(K.delimiter).length;return a===s?0:n!==c?c-n:a>s?1:-1});return t},Uwe=(e,t)=>{let r=j.isVirtualLocator(e)?j.devirtualizeLocator(e):e,s=j.isVirtualLocator(t)?j.devirtualizeLocator(t):t;return j.areLocatorsEqual(r,s)},SY=(e,t,r,s)=>{if(e.linkType!=="SOFT")return!1;let a=Ae.toPortablePath(r.resolveVirtual&&t.reference&&t.reference.startsWith("virtual:")?r.resolveVirtual(e.packageLocation):e.packageLocation);return K.contains(s,a)===null},cht=e=>{let t=e.getPackageInformation(e.topLevel);if(t===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");if(e.findPackageLocator(t.packageLocation)===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let s=Ae.toPortablePath(t.packageLocation.slice(0,-1)),a=new Map,n={children:new Map},c=e.getDependencyTreeRoots(),f=new Map,p=new Set,h=(S,x)=>{let I=gA(S);if(p.has(I))return;p.add(I);let T=e.getPackageInformation(S);if(T){let O=x?gA(x):"";if(gA(S)!==O&&T.linkType==="SOFT"&&!S.reference.startsWith("link:")&&!SY(T,S,e,s)){let U=_we(T,S,e);(!f.get(U)||S.reference.startsWith("workspace:"))&&f.set(U,S)}for(let[U,V]of T.packageDependencies)V!==null&&(T.packagePeers.has(U)||h(e.getLocator(U,V),S))}};for(let S of c)h(S,null);let E=s.split(K.sep);for(let S of f.values()){let x=e.getPackageInformation(S),T=Ae.toPortablePath(x.packageLocation.slice(0,-1)).split(K.sep).slice(E.length),O=n;for(let U of T){let V=O.children.get(U);V||(V={children:new Map},O.children.set(U,V)),O=V}O.workspaceLocator=S}let C=(S,x)=>{if(S.workspaceLocator){let I=gA(x),T=a.get(I);T||(T=new Set,a.set(I,T)),T.add(S.workspaceLocator)}for(let I of S.children.values())C(I,S.workspaceLocator||x)};for(let S of n.children.values())C(S,n.workspaceLocator);return a},uht=(e,t)=>{let r=[],s=!1,a=new Map,n=cht(e),c=e.getPackageInformation(e.topLevel);if(c===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");let f=e.findPackageLocator(c.packageLocation);if(f===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let p=Ae.toPortablePath(c.packageLocation.slice(0,-1)),h={name:f.name,identName:f.name,reference:f.reference,peerNames:c.packagePeers,dependencies:new Set,dependencyKind:1},E=new Map,C=(x,I)=>`${gA(I)}:${x}`,S=(x,I,T,O,U,V,$,ie)=>{let fe=C(x,T),ae=E.get(fe),ge=!!ae;!ge&&T.name===f.name&&T.reference===f.reference&&(ae=h,E.set(fe,h));let he=SY(I,T,e,p);if(!ae){let me=0;he?me=2:I.linkType==="SOFT"&&T.name.endsWith(nd)&&(me=1),ae={name:x,identName:T.name,reference:T.reference,dependencies:new Set,peerNames:me===1?new Set:I.packagePeers,dependencyKind:me},E.set(fe,ae)}let Ce;if(he?Ce=2:U.linkType==="SOFT"?Ce=1:Ce=0,ae.hoistPriority=Math.max(ae.hoistPriority||0,Ce),ie&&!he){let me=gA({name:O.identName,reference:O.reference}),ue=a.get(me)||new Set;a.set(me,ue),ue.add(ae.name)}let Ee=new Map(I.packageDependencies);if(t.project){let me=t.project.workspacesByCwd.get(Ae.toPortablePath(I.packageLocation.slice(0,-1)));if(me){let ue=new Set([...Array.from(me.manifest.peerDependencies.values(),Z=>j.stringifyIdent(Z)),...Array.from(me.manifest.peerDependenciesMeta.keys())]);for(let Z of ue)Ee.has(Z)||(Ee.set(Z,V.get(Z)||null),ae.peerNames.add(Z))}}let d=gA({name:T.name.replace(nd,""),reference:T.reference}),Se=n.get(d);if(Se)for(let me of Se)Ee.set(`${me.name}${nd}`,me.reference);(I!==U||I.linkType!=="SOFT"||!he&&(!t.selfReferencesByCwd||t.selfReferencesByCwd.get($)))&&O.dependencies.add(ae);let Be=T!==f&&I.linkType==="SOFT"&&!T.name.endsWith(nd)&&!he;if(!ge&&!Be){let me=new Map;for(let[ue,Z]of Ee)if(Z!==null){let be=e.getLocator(ue,Z),Qe=e.getLocator(ue.replace(nd,""),Z),ot=e.getPackageInformation(Qe);if(ot===null)throw new Error("Assertion failed: Expected the package to have been registered");let _=SY(ot,be,e,p);if(t.validateExternalSoftLinks&&t.project&&_){ot.packageDependencies.size>0&&(s=!0);for(let[je,Re]of ot.packageDependencies)if(Re!==null){let ct=j.parseLocator(Array.isArray(Re)?`${Re[0]}@${Re[1]}`:`${je}@${Re}`);if(gA(ct)!==gA(be)){let Me=Ee.get(je);if(Me){let P=j.parseLocator(Array.isArray(Me)?`${Me[0]}@${Me[1]}`:`${je}@${Me}`);Uwe(P,ct)||r.push({messageName:71,text:`Cannot link ${j.prettyIdent(t.project.configuration,j.parseIdent(be.name))} into ${j.prettyLine truncated
`;for(let n=0,c=e.length;n<c;++n)a+=s+qF(String(n),e[n],t,s).replace(/^ +/,""),n+1<c&&(a+=","),a+=`
`;return a+=r,a+="]",a}function dht(e,t,r){let s=Object.keys(e),a="";a+="{";for(let n=0,c=s.length,f=0;n<c;++n){let p=s[n],h=e[p];typeof h>"u"||(f!==0&&(a+=", "),a+=JSON.stringify(p),a+=": ",a+=qF(p,h,t,r).replace(/^ +/g,""),f+=1)}return a+="}",a}function ght(e,t,r){let s=Object.keys(e),a=`${r} `,n="";n+=r,n+=`{
`;let c=0;for(let f=0,p=s.length;f<p;++f){let h=s[f],E=e[h];typeof E>"u"||(c!==0&&(n+=",",n+=`
`),n+=a,n+=JSON.stringify(h),n+=": ",n+=qF(h,E,t,a).replace(/^ +/g,""),c+=1)}return c!==0&&(n+=`
`),n+=r,n+="}",n}function qF(e,t,r,s){let{next:a}=Hwe[r],n=a[e]||a["*"];return jwe(t,n,s)}function jwe(e,t,r){let{collapsed:s}=Hwe[t];return Array.isArray(e)?s?pht(e,t,r):hht(e,t,r):typeof e=="object"&&e!==null?s?dht(e,t,r):ght(e,t,r):JSON.stringify(e)}function Gwe(e){return jwe(e,"TOP_LEVEL","")}function Ob(e,t){let r=Array.from(e);Array.isArray(t)||(t=[t]);let s=[];for(let n of t)s.push(r.map(c=>n(c)));let a=r.map((n,c)=>c);return a.sort((n,c)=>{for(let f of s){let p=f[n]<f[c]?-1:f[n]>f[c]?1:0;if(p!==0)return p}return 0}),a.map(n=>r[n])}function mht(e){let t=new Map,r=Ob(e.fallbackExclusionList||[],[({name:s,reference:a})=>s,({name:s,reference:a})=>a]);for(let{name:s,reference:a}of r){let n=t.get(s);typeof n>"u"&&t.set(s,n=new Set),n.add(a)}return Array.from(t).map(([s,a])=>[s,Array.from(a)])}function yht(e){return Ob(e.fallbackPool||[],([t])=>t)}function Eht(e){let t=[],r=e.dependencyTreeRoots.find(s=>e.packageRegistry.get(s.name)?.get(s.reference)?.packageLocation==="./");for(let[s,a]of Ob(e.packageRegistry,([n])=>n===null?"0":`1${n}`)){if(s===null)continue;let n=[];t.push([s,n]);for(let[c,{packageLocation:f,packageDependencies:p,packagePeers:h,linkType:E,discardFromLookup:C}]of Ob(a,([S])=>S===null?"0":`1${S}`)){if(c===null)continue;let S=[];s!==null&&c!==null&&!p.has(s)&&S.push([s,c]);for(let[U,V]of p)S.push([U,V]);let x=Ob(S,([U])=>U),I=h&&h.size>0?Array.from(h):void 0,O={packageLocation:f,packageDependencies:x,packagePeers:I,linkType:E,discardFromLookup:C||void 0};n.push([c,O]),r&&s===r.name&&c===r.reference&&t.unshift([null,[[null,O]]])}}return t}function Lb(e){return{__info:["This file is automatically generated. Do not touch it, or risk","your modifications being lost."],dependencyTreeRoots:e.dependencyTreeRoots,enableTopLevelFallback:e.enableTopLevelFallback||!1,ignorePatternData:e.ignorePattern||null,pnpZipBackend:e.pnpZipBackend,fallbackExclusionList:mht(e),fallbackPool:yht(e),packageRegistryData:Eht(e)}}var Wwe=et(Ywe());function Vwe(e,t){return[e?`${e}
`:"",`/* eslint-disable */
`,`// @ts-nocheck
`,`"use strict";
`,`
`,t,`
`,(0,Wwe.default)()].join("")}function Iht(e){return JSON.stringify(e,null,2)}function Cht(e){return`'${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,`\\
`)}'`}function wht(e){return[`const RAW_RUNTIME_STATE =
`,`${Cht(Gwe(e))};
`,`function $$SETUP_STATE(hydrateRuntimeState, basePath) {
`,` return hydrateRuntimeState(JSON.parse(RAW_RUNTIME_STATE), {basePath: basePath || __dirname});
`,`}
`].join("")}function Bht(){return[`function $$SETUP_STATE(hydrateRuntimeState, basePath) {
`,` const fs = require('fs');
`,` const path = require('path');
`,` const pnpDataFilepath = path.resolve(__dirname, ${JSON.stringify(Ir.pnpData)});
`,` return hydrateRuntimeState(JSON.parse(fs.readFileSync(pnpDataFilepath, 'utf8')), {basePath: basePath || __dirname});
`,`}
`].join("")}function Kwe(e){let t=Lb(e),r=wht(t);return Vwe(e.shebang,r)}function Jwe(e){let t=Lb(e),r=Bht(),s=Vwe(e.shebang,r);return{dataFile:Iht(t),loaderFile:s}}bt();function PY(e,{basePath:t}){let r=Ae.toPortablePath(t),s=K.resolve(r),a=e.ignorePatternData!==null?new RegExp(e.ignorePatternData):null,n=new Map,c=new Map(e.packageRegistryData.map(([C,S])=>[C,new Map(S.map(([x,I])=>{if(C===null!=(x===null))throw new Error("Assertion failed: The name and reference should be null, or neither should");let T=I.discardFromLookup??!1,O={name:C,reference:x},U=n.get(I.packageLocation);U?(U.discardFromLookup=U.discardFromLookup&&T,T||(U.locator=O)):n.set(I.packageLocation,{locator:O,discardFromLookup:T});let V=null;return[x,{packageDependencies:new Map(I.packageDependencies),packagePeers:new Set(I.packagePeers),linkType:I.linkType,discardFromLookup:T,get packageLocation(){return V||(V=K.join(s,I.packageLocation))}}]}))])),f=new Map(e.fallbackExclusionList.map(([C,S])=>[C,new Set(S)])),p=new Map(e.fallbackPool),h=e.dependencyTreeRoots,E=e.enableTopLevelFallback;return{basePath:r,dependencyTreeRoots:h,enableTopLevelFallback:E,fallbackExclusionList:f,pnpZipBackend:e.pnpZipBackend,fallbackPool:p,ignorePattern:a,packageLocatorsByLocations:n,packageRegistry:c}}bt();bt();var oh=Ie("module"),Km=Ie("url"),UY=Ie("util");var aa=Ie("url");var $we=et(Ie("assert"));var xY=Array.isArray,Mb=JSON.stringify,Ub=Object.getOwnPropertyNames,Vm=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),kY=(e,t)=>RegExp.prototype.exec.call(e,t),QY=(e,...t)=>RegExp.prototype[Symbol.replace].apply(e,t),id=(e,...t)=>String.prototype.endsWith.apply(e,t),RY=(e,...t)=>String.prototype.includes.apply(e,t),TY=(e,...t)=>String.prototype.lastIndexOf.apply(e,t),_b=(e,...t)=>String.prototype.indexOf.apply(e,t),zwe=(e,...t)=>String.prototype.replace.apply(e,t),sd=(e,...t)=>String.prototype.slice.apply(e,t),mA=(e,...t)=>String.prototype.startsWith.apply(e,t),Xwe=Map,Zwe=JSON.parse;function Hb(e,t,r){return class extends r{constructor(...s){super(t(...s)),this.code=e,this.name=`${r.name} [${e}]`}}}var e1e=Hb("ERR_PACKAGE_IMPORT_NOT_DEFINED",(e,t,r)=>`Package import specifier "${e}" is not defined${t?` in package ${t}package.json`:""} imported from ${r}`,TypeError),FY=Hb("ERR_INVALID_MODULE_SPECIFIER",(e,t,r=void 0)=>`Invalid module "${e}" ${t}${r?` imported from ${r}`:""}`,TypeError),t1e=Hb("ERR_INVALID_PACKAGE_TARGET",(e,t,r,s=!1,a=void 0)=>{let n=typeof r=="string"&&!s&&r.length&&!mA(r,"./");return t==="."?((0,$we.default)(s===!1),`Invalid "exports" main target ${Mb(r)} defined in the package config ${e}package.json${a?` imported from ${a}`:""}${n?'; targets must start with "./"':""}`):`Invalid "${s?"imports":"exports"}" target ${Mb(r)} defined for '${t}' in the package config ${e}package.json${a?` imported from ${a}`:""}${n?'; targets must start with "./"':""}`},Error),jb=Hb("ERR_INVALID_PACKAGE_CONFIG",(e,t,r)=>`Invalid package config ${e}${t?` while importing ${t}`:""}${r?`. ${r}`:""}`,Error),r1e=Hb("ERR_PACKAGE_PATH_NOT_EXPORTED",(e,t,r=void 0)=>t==="."?`No "exports" main defined in ${e}package.json${r?` imported from ${r}`:""}`:`Package subpath '${t}' is not defined by "exports" in ${e}package.json${r?` imported from ${r}`:""}`,Error);var WF=Ie("url");function n1e(e,t){let r=Object.create(null);for(let s=0;s<t.length;s++){let a=t[s];Vm(e,a)&&(r[a]=e[a])}return r}var YF=new Xwe;function vht(e,t,r,s){let a=YF.get(e);if(a!==void 0)return a;let n=s(e);if(n===void 0){let x={pjsonPath:e,exists:!1,main:void 0,name:void 0,type:"none",exports:void 0,imports:void 0};return YF.set(e,x),x}let c;try{c=Zwe(n)}catch(x){throw new jb(e,(r?`"${t}" from `:"")+(0,WF.fileURLToPath)(r||t),x.message)}let{imports:f,main:p,name:h,type:E}=n1e(c,["imports","main","name","type"]),C=Vm(c,"exports")?c.exports:void 0;(typeof f!="object"||f===null)&&(f=void 0),typeof p!="string"&&(p=void 0),typeof h!="string"&&(h=void 0),E!=="module"&&E!=="commonjs"&&(E="none");let S={pjsonPath:e,exists:!0,main:p,name:h,type:E,exports:C,imports:f};return YF.set(e,S),S}function i1e(e,t){let r=new URL("./package.json",e);for(;;){let n=r.pathname;if(id(n,"node_modules/package.json"))break;let c=vht((0,WF.fileURLToPath)(r),e,void 0,t);if(c.exists)return c;let f=r;if(r=new URL("../package.json",r),r.pathname===f.pathname)break}let s=(0,WF.fileURLToPath)(r),a={pjsonPath:s,exists:!1,main:void 0,name:void 0,type:"none",exports:void 0,imports:void 0};return YF.set(s,a),a}function Sht(e,t,r){throw new e1e(e,t&&(0,aa.fileURLToPath)(new URL(".",t)),(0,aa.fileURLToPath)(r))}function bht(e,t,r,s){let a=`request is not a valid subpath for the "${r?"imports":"exports"}" resolution of ${(0,aa.fileURLToPath)(t)}`;throw new FY(e,a,s&&(0,aa.fileURLToPath)(s))}function Gb(e,t,r,s,a){throw typeof t=="object"&&t!==null?t=Mb(t,null,""):t=`${t}`,new t1e((0,aa.fileURLToPath)(new URL(".",r)),e,t,s,a&&(0,aa.fileURLToPath)(a))}var s1e=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f Line truncated
`),r;c=e[++n]}else if(c===" "&&!s){a=!0;continue}else if(c==='"'){s=!s;continue}a?(r.push(c),a=!1):r[r.length-1]+=c}return s&&t.push(`invalid value for NODE_OPTIONS (unterminated string)
`),r}bt();var[ro,Sl,Nht]=process.versions.node.split(".").map(e=>parseInt(e,10)),g1e=ro>19||ro===19&&Sl>=2||ro===18&&Sl>=13,ezt=ro===20&&Sl<6||ro===19&&Sl>=3,tzt=ro>19||ro===19&&Sl>=6,rzt=ro>=21||ro===20&&Sl>=10||ro===18&&Sl>=19,nzt=ro>=21||ro===20&&Sl>=10||ro===18&&Sl>=20,izt=ro>=22,szt=ro===26&&Sl<1||ro===25&&Sl>=7||ro===24&&Sl===15||ro===22&&(Sl>22||Sl===22&&Nht>=3);function MY(e){if(process.env.WATCH_REPORT_DEPENDENCIES&&process.send){let t=e.map(r=>Ae.fromPortablePath(Eo.resolveVirtual(r)));if(g1e)process.send({"watch:require":t});else for(let r of t)process.send({"watch:require":r})}}function _Y(e,t){let r=Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK)>0,s=Number(process.env.PNP_DEBUG_LEVEL),a=/^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/,n=/^(\/|\.{1,2}(\/|$))/,c=/\/$/,f=/^\.{0,2}\//,p={name:null,reference:null},h=[],E=new Set;if(e.enableTopLevelFallback===!0&&h.push(p),t.compatibilityMode!==!1)for(let Ne of["react-scripts","gatsby"]){let ke=e.packageRegistry.get(Ne);if(ke)for(let De of ke.keys()){if(De===null)throw new Error("Assertion failed: This reference shouldn't be null");h.push({name:Ne,reference:De})}}let{ignorePattern:C,packageRegistry:S,packageLocatorsByLocations:x}=e;function I(Ne,ke){return{fn:Ne,args:ke,error:null,result:null}}function T(Ne){let ke=process.stderr?.hasColors?.()??process.stdout.isTTY,De=(ct,Me)=>`\x1B[${ct}m${Me}\x1B[0m`,je=Ne.error;console.error(je?De("31;1",`\u2716 ${Ne.error?.message.replace(/\n.*/s,"")}`):De("33;1","\u203C Resolution")),Ne.args.length>0&&console.error();for(let ct of Ne.args)console.error(` ${De("37;1","In \u2190")} ${(0,UY.inspect)(ct,{colors:ke,compact:!0})}`);Ne.result&&(console.error(),console.error(` ${De("37;1","Out \u2192")} ${(0,UY.inspect)(Ne.result,{colors:ke,compact:!0})}`));let Re=new Error().stack.match(/(?<=^ +)at.*/gm)?.slice(2)??[];if(Re.length>0){console.error();for(let ct of Re)console.error(` ${De("38;5;244",ct)}`)}console.error()}function O(Ne,ke){if(t.allowDebug===!1)return ke;if(Number.isFinite(s)){if(s>=2)return(...De)=>{let je=I(Ne,De);try{return je.result=ke(...De)}catch(Re){throw je.error=Re}finally{T(je)}};if(s>=1)return(...De)=>{try{return ke(...De)}catch(je){let Re=I(Ne,De);throw Re.error=je,T(Re),je}}}return ke}function U(Ne){let ke=d(Ne);if(!ke)throw Es("INTERNAL","Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)");return ke}function V(Ne){if(Ne.name===null)return!0;for(let ke of e.dependencyTreeRoots)if(ke.name===Ne.name&&ke.reference===Ne.reference)return!0;return!1}let $=new Set(["node","require",...d1e("--conditions")]);function ie(Ne,ke=$,De){let je=me(K.join(Ne,"internal.js"),{resolveIgnored:!0,includeDiscardFromLookup:!0});if(je===null)throw Es("INTERNAL",`The locator that owns the "${Ne}" path can't be found inside the dependency tree (this is probably an internal error)`);let{packageLocation:Re}=U(je),ct=K.join(Re,Ir.manifest);if(!t.fakeFs.existsSync(ct))return null;let Me=JSON.parse(t.fakeFs.readFileSync(ct,"utf8"));if(Me.exports==null)return null;let P=K.contains(Re,Ne);if(P===null)throw Es("INTERNAL","unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)");P!=="."&&!f.test(P)&&(P=`./${P}`);try{let w=c1e({packageJSONUrl:(0,Km.pathToFileURL)(Ae.fromPortablePath(ct)),packageSubpath:P,exports:Me.exports,base:De?(0,Km.pathToFileURL)(Ae.fromPortablePath(De)):null,conditions:ke});return Ae.toPortablePath((0,Km.fileURLToPath)(w))}catch(w){throw Es("EXPORTS_RESOLUTION_FAILED",w.message,{unqualifiedPath:ff(Ne),locator:je,pkgJson:Me,subpath:ff(P),conditions:ke},w.code)}}function fe(Ne,ke,{extensions:De}){let je;try{ke.push(Ne),je=t.fakeFs.statSync(Ne)}catch{}if(je&&!je.isDirectory())return t.fakeFs.realpathSync(Ne);if(je&&je.isDirectory()){let Re;try{Re=JSON.parse(t.fakeFs.readFileSync(K.join(Ne,Ir.manifest),"utf8"))}catch{}let ct;if(Re&&Re.main&&(ct=K.resolve(Ne,Re.main)),ct&&ct!==Ne){let Me=fe(ct,ke,{extensions:De});if(Me!==null)return Me}}for(let Re=0,ct=De.length;Re<ct;Re++){let Me=`${Ne}${De[Re]}`;if(ke.push(Me),t.fakeFs.existsSync(Me))return Me}if(je&&je.isDirectory())for(let Re=0,ct=De.length;Re<ct;Re++){let Me=K.format({dir:Ne,name:"index",ext:De[Re]});if(ke.push(Me),t.fakeFs.existsSync(Me))return Me}return null}function ae(Ne){let ke=new oh.Module(Ne,null);return ke.filename=Ne,ke.paths=oh.Module._nodeModulePaths(Ne),ke}function ge(Ne,ke){return ke.endsWith("/")&&(ke=K.join(ke,"internal.js")),oh.Module._resolveFilename(Ae.fromPortablePath(Ne),ae(Ae.fromPortablePath(ke)),!1,{plugnplay:!1})}function he(Ne){if(C===null)return!1;let ke=K.contains(e.basePath,Ne);return ke===null?!1:!!C.test(ke.replace(/\/$/,""))}let Ce={std:3,resolveVirtual:1,getAllLocators:1},Ee=p;function d({name:Ne,reference:ke}){let De=S.get(Ne);if(!De)return null;let je=De.get(ke);return je||null}function Se({name:Ne,reference:ke}){let De=[];for(let[je,Re]of S)if(je!==null)for(let[ct,Me]of Re)ct===null|Line truncated
Require request: "${je}"
Required by: ${Re}
`,{request:je,issuer:Re});return Ae.toPortablePath(P)}let ct,Me=Ne.match(a);if(Me){if(!ke)throw Es("API_ERROR","The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:je,issuer:Re});let[,P,w]=Me,D=me(ke);if(!D){let Fe=ge(Ne,ke);if(Fe===!1)throw Es("BUILTIN_NODE_RESOLUTION_FAILED",`The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree).
Require path: "${je}"
Required by: ${Re}
`,{request:je,issuer:Re});return Ae.toPortablePath(Fe)}let F=U(D).packageDependencies.get(P),z=null;if(F==null&&D.name!==null){let Fe=e.fallbackExclusionList.get(D.name);if(!Fe||!Fe.has(D.reference)){for(let Ct=0,Yt=h.length;Ct<Yt;++Ct){let Pt=U(h[Ct]).packageDependencies.get(P);if(Pt!=null){r?z=Pt:F=Pt;break}}if(e.enableTopLevelFallback&&F==null&&z===null){let Ct=e.fallbackPool.get(P);Ct!=null&&(z=Ct)}}}let X=null;if(F===null)if(V(D))X=Es("MISSING_PEER_DEPENDENCY",`Your application tried to access ${P} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed.
Required package: ${P}${P!==je?` (via "${je}")`:""}
Required by: ${Re}
`,{request:je,issuer:Re,dependencyName:P});else{let Fe=Be(P,D);Fe.every(ut=>V(ut))?X=Es("MISSING_PEER_DEPENDENCY",`${D.name} tried to access ${P} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound.
Required package: ${P}${P!==je?` (via "${je}")`:""}
Required by: ${D.name}@${D.reference} (via ${Re})
${Fe.map(ut=>`Ancestor breaking the chain: ${ut.name}@${ut.reference}
`).join("")}
`,{request:je,issuer:Re,issuerLocator:Object.assign({},D),dependencyName:P,brokenAncestors:Fe}):X=Es("MISSING_PEER_DEPENDENCY",`${D.name} tried to access ${P} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.
Required package: ${P}${P!==je?` (via "${je}")`:""}
Required by: ${D.name}@${D.reference} (via ${Re})
${Fe.map(ut=>`Ancestor breaking the chain: ${ut.name}@${ut.reference}
`).join("")}
`,{request:je,issuer:Re,issuerLocator:Object.assign({},D),dependencyName:P,brokenAncestors:Fe})}else F===void 0&&(!De&&(0,oh.isBuiltin)(Ne)?V(D)?X=Es("UNDECLARED_DEPENDENCY",`Your application tried to access ${P}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${P} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound.
Required package: ${P}${P!==je?` (via "${je}")`:""}
Required by: ${Re}
`,{request:je,issuer:Re,dependencyName:P}):X=Es("UNDECLARED_DEPENDENCY",`${D.name} tried to access ${P}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${P} isn't otherwise declared in ${D.name}'s dependencies, this makes the require call ambiguous and unsound.
Required package: ${P}${P!==je?` (via "${je}")`:""}
Required by: ${Re}
`,{request:je,issuer:Re,issuerLocator:Object.assign({},D),dependencyName:P}):V(D)?X=Es("UNDECLARED_DEPENDENCY",`Your application tried to access ${P}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.
Required package: ${P}${P!==je?` (via "${je}")`:""}
Required by: ${Re}
`,{request:je,issuer:Re,dependencyName:P}):X=Es("UNDECLARED_DEPENDENCY",`${D.name} tried to access ${P}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Required package: ${P}${P!==je?` (via "${je}")`:""}
Required by: ${D.name}@${D.reference} (via ${Re})
`,{request:je,issuer:Re,issuerLocator:Object.assign({},D),dependencyName:P}));if(F==null){if(z===null||X===null)throw X||new Error("Assertion failed: Expected an error to have been set");F=z;let Fe=X.message.replace(/\n.*/g,"");X.message=Fe,!E.has(Fe)&&s!==0&&(E.add(Fe),process.emitWarning(X))}let ee=Array.isArray(F)?{name:F[0],reference:F[1]}:{name:P,reference:F},se=U(ee);if(!se.packageLocation)throw Es("MISSING_DEPENDENCY",`A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod.
Required package: ${ee.name}@${ee.reference}${ee.name!==je?` (via "${je}")`:""}
Required by: ${D.name}@${D.reference} (via ${Re})
`,{request:je,issuer:Re,dependencyLocator:Object.assign({},ee)});let xe=se.packageLocation;w?ct=K.join(xe,w):ct=xe}else if(K.isAbsolute(Ne))ct=K.normalize(Ne);else{if(!ke)throw Es("API_ERROR","The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:je,issuer:Re});let P=K.resolve(ke);ke.match(c)?ct=K.normalize(K.join(P,Ne)):ct=K.normalize(K.join(K.dirname(P),Ne))}return K.normalize(ct)}function be(Ne,ke,De=$,je){if(n.test(Ne))return ke;let Re=ie(ke,De,je);return Re?K.normalize(Re):ke}function Qe(Ne,{extensions:ke=Object.keys(oh.Module._extensions)}={}){let De=[],je=fe(Ne,De,{extensions:ke});if(je)return MY([je]),K.normalize(je);{MY(De);let Re=ff(Ne),ct=me(Ne);if(ct){let{packageLocation:Me}=U(ct),P=!0;try{t.fakeFs.accessSync(Me)}catch(w){if(w?.code==="ENOENT")P=!1;else{let D=(w?.message??w??"empty exception thrown").replace(/^[A-Z]/,y=>y.toLowerCase());throw Es("QUALIFIED_PATH_RESOLUTION_FAILED",`Required package exists but could not be accessed (${D}).
Missing package: ${ct.name}@${ct.reference}
Expected package location: ${ff(Me)}
`,{unqualifiedPath:Re,extensions:ke})}}if(!P){let w=Me.includes("/unplugged/")?"Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).":"Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.";throw Es("QUALIFIED_PATH_RESOLUTION_FAILED",`${w}
Missing package: ${ct.name}@${ct.reference}
Expected package location: ${ff(Me)}
`,{unqualifiedPath:Re,extensions:ke})}}throw Es("QUALIFIED_PATH_RESOLUTION_FAILED",`Qualified path resolution failed: we looked for the following paths, but none could be accessed.
Source path: ${Re}
${De.map(Me=>`Not found: ${ff(Me)}
`).join("")}`,{unqualifiedPath:Re,extensions:ke})}}function ot(Ne,ke,De){if(!ke)throw new Error("Assertion failed: An issuer is required to resolve private import mappings");let je=u1e({name:Ne,base:(0,Km.pathToFileURL)(Ae.fromPortablePath(ke)),conditions:De.conditions??$,readFileSyncFn:ue});if(je instanceof URL)return Qe(Ae.toPortablePath((0,Km.fileURLToPath)(je)),{extensions:De.extensions});if(je.startsWith("#"))throw new Error("Mapping from one private import to another isn't allowed");return _(je,ke,De)}function _(Ne,ke,De={}){try{if(Ne.startsWith("#"))return ot(Ne,ke,De);let{considerBuiltins:je,extensions:Re,conditions:ct}=De,Me=Z(Ne,ke,{considerBuiltins:je});if(Ne==="pnpapi")return Me;if(Me===null)return null;let P=()=>ke!==null?he(ke):!1,w=(!je||!(0,oh.isBuiltin)(Ne))&&!P()?be(Ne,Me,ct,ke):Me;return Qe(w,{extensions:Re})}catch(je){throw Object.hasOwn(je,"pnpCode")&&Object.assign(je.data,{request:ff(Ne),issuer:ke&&ff(ke)}),je}}function tt(Ne){let ke=K.normalize(Ne),De=Eo.resolveVirtual(ke);return De!==ke?De:null}return{VERSIONS:Ce,topLevel:Ee,getLocator:(Ne,ke)=>Array.isArray(ke)?{name:ke[0],reference:ke[1]}:{name:Ne,reference:ke},getDependencyTreeRoots:()=>[...e.dependencyTreeRoots],getAllLocators(){let Ne=[];for(let[ke,De]of S)for(let je of De.keys())ke!==null&&je!==null&&Ne.push({name:ke,reference:je});return Ne},getPackageInformation:Ne=>{let ke=d(Ne);if(ke===null)return null;let De=Ae.fromPortablePath(ke.packageLocation);return{...ke,packageLocation:De}},findPackageLocator:Ne=>me(Ae.toPortablePath(Ne)),resolveToUnqualified:O("resolveToUnqualified",(Ne,ke,De)=>{let je=ke!==null?Ae.toPortablePath(ke):null,Re=Z(Ae.toPortablePath(Ne),je,De);return Re===null?null:Ae.fromPortablePath(Re)}),resolveUnqualified:O("resolveUnqualified",(Ne,ke)=>Ae.fromPortablePath(Qe(Ae.toPortablePath(Ne),ke))),resolveRequest:O("resolveRequest",(Ne,ke,De)=>{let je=ke!==null?Ae.toPortablePath(ke):null,Re=_(Ae.toPortablePath(Ne),je,De);return Re===null?null:Ae.fromPortablePath(Re)}),resolveVirtual:O("resolveVirtual",Ne=>{let ke=tt(Ae.toPortablePath(Ne));return ke!==null?Ae.fromPortablePath(ke):null})}}bt();var m1e=(e,t,r)=>{let s=Lb(e),a=PY(s,{basePath:t}),n=Ae.join(t,Ir.pnpCjs);return _Y(a,{fakeFs:r,pnpapiResolution:n})};var jY=et(E1e());jt();var yA={};Vt(yA,{checkManifestCompatibility:()=>I1e,extractBuildRequest:()=>VF,getExtractHint:()=>GY,hasBindingGyp:()=>qY});Ge();bt();function I1e(e){return j.isPackageCompatible(e,Ui.getArchitectureSet())}function VF(e,t,r,{configuration:s}){let a=[];for(let n of["preinstall","install","postinstall"])t.manifest.scripts.has(n)&&a.push({type:0,script:n});return!t.manifest.scripts.has("install")&&t.misc.hasBindingGyp&&a.push({type:1,script:"node-gyp rebuild"}),a.length===0?null:e.linkType!=="HARD"?{skipped:!0,explain:n=>n.reportWarningOnce(6,`${j.prettyLocator(s,e)} lists build scripts, but is referenced through a soft link. Soft links don't support build scripts, so they'll be ignored.`)}:r&&r.built===!1?{skipped:!0,explain:n=>n.reportInfoOnce(5,`${j.prettyLocator(s,e)} lists build scripts, but its build has been explicitly disabled through configuration.`)}:!s.get("enableScripts")&&!r.built?{skipped:!0,explain:n=>n.reportWarningOnce(4,`${j.prettyLocator(s,e)} lists build scripts, but all build scripts have been disabled.`)}:I1e(e)?{skipped:!1,directives:a}:{skipped:!0,explain:n=>n.reportWarningOnce(76,`${j.prettyLocator(s,e)} The ${Ui.getArchitectureName()} architecture is incompatible with this package, build skipped.`)}}var Lht=new Set([".exe",".bin",".h",".hh",".hpp",".c",".cc",".cpp",".java",".jar",".node"]);function GY(e){return e.packageFs.getExtractHint({relevantExtensions:Lht})}function qY(e){let t=K.join(e.prefixPath,"binding.gyp");return e.packageFs.existsSync(t)}var Wb={};Vt(Wb,{getUnpluggedPath:()=>Yb});Ge();bt();function Yb(e,{configuration:t}){return K.resolve(t.get("pnpUnpluggedFolder"),j.slugifyLocator(e))}var Mht=new Set([j.makeIdent(null,"open").identHash,j.makeIdent(null,"opn").identHash]),od=class{constructor(){this.mode="strict";this.pnpCache=new Map}getCustomDataKey(){return JSON.stringify({name:"PnpLinker",version:2})}supportsPackage(t,r){return this.isEnabled(r)}async findPackageLocation(t,r){if(!this.isEnabled(r))throw new Error("Assertion failed: Expected the PnP linker to be enabled");let s=ad(r.project).cjs;if(!le.existsSync(s))throw new st(`The project in ${ce.pretty(r.project.configuration,`${r.project.cwd}/package.json`,ce.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let a=qe.getFactoryWithDefault(this.pnpCache,s,()=>qe.dynamicRequire(s,{cachingStrategy:qe.CachingStrategy.FsTime})),n={name:j.stringifyIdent(t),reference:t.reference},c=a.getPackageInformation(n);if(!c)throw new st(`Couldn't find ${j.prettyLocator(r.project.configuration,t)} in the currently installed PnP map - running an install might help`);return Ae.toPortablePath(c.packageLocation)}async findPackageLocator(t,r){if(!this.isEnabled(r))return null;Line truncated
`,n+=`# cause your node_modules installation to become invalidated.
`,n+=`
`,n+=`__metadata:
`,n+=` version: ${T1e}
`,n+=` nmMode: ${s.value}
`;let c=Array.from(t.keys()).sort(),f=j.stringifyLocator(e.topLevelWorkspace.anchoredLocator);for(let E of c){let C=t.get(E);n+=`
`,n+=`${JSON.stringify(E)}:
`,n+=` locations:
`;for(let S of C.locations){let x=K.contains(e.cwd,S);if(x===null)throw new Error(`Assertion failed: Expected the path to be within the project (${S})`);n+=` - ${JSON.stringify(x)}
`}if(C.aliases.length>0){n+=` aliases:
`;for(let S of C.aliases)n+=` - ${JSON.stringify(S)}
`}if(E===f&&r.size>0){n+=` bin:
`;for(let[S,x]of r){let I=K.contains(e.cwd,S);if(I===null)throw new Error(`Assertion failed: Expected the path to be within the project (${S})`);n+=` ${JSON.stringify(I)}:
`;for(let[T,O]of x){let U=K.relative(K.join(S,Pi),O);n+=` ${JSON.stringify(T)}: ${JSON.stringify(U)}
`}}}}let p=e.cwd,h=K.join(p,Pi,eW);try{a&&await le.removePromise(h),await le.changeFilePromise(h,n,{automaticNewlines:!0})}finally{a0t(e)}}async function u0t(e){let t=e.cwd,r=K.join(t,Pi,eW);try{let s=await le.statPromise(r);return`${s.mtimeMs}:${s.size}`}catch{return null}}async function F1e(e,{unrollAliases:t=!1}={}){let r=e.cwd,s=K.join(r,Pi,eW),a;try{a=await le.statPromise(s)}catch{}if(!a)return null;let n=us(await le.readFilePromise(s,"utf8"));if(n.__metadata.version>T1e)return null;let c=n.__metadata.nmMode||"classic",f=new Map,p=new Map;delete n.__metadata;for(let[h,E]of Object.entries(n)){let C=E.locations.map(x=>K.join(r,x)),S=E.bin;if(S)for(let[x,I]of Object.entries(S)){let T=K.join(r,Ae.toPortablePath(x)),O=qe.getMapWithDefault(p,T);for(let[U,V]of Object.entries(I))O.set(U,Ae.toPortablePath([T,Pi,V].join(K.sep)))}if(f.set(h,{target:vt.dot,linkType:"HARD",locations:C,aliases:E.aliases||[]}),t&&E.aliases)for(let x of E.aliases){let{scope:I,name:T}=j.parseLocator(h),O=j.makeLocator(j.makeIdent(I,T),x),U=j.stringifyLocator(O);f.set(U,{target:vt.dot,linkType:"HARD",locations:C,aliases:[]})}}return{locatorMap:f,binSymlinks:p,locationTree:N1e(f,{skipPrefix:e.cwd}),nmMode:c,mtimeMs:a.mtimeMs}}var Cw=async(e,t)=>{if(e.split(K.sep).indexOf(Pi)<0)throw new Error(`Assertion failed: trying to remove dir that doesn't contain node_modules: ${e}`);try{let r;if(!t.innerLoop&&(r=await le.lstatPromise(e),!r.isDirectory()&&!r.isSymbolicLink()||r.isSymbolicLink()&&!t.isWorkspaceDir)){await le.unlinkPromise(e);return}let s=await le.readdirPromise(e,{withFileTypes:!0});for(let n of s){let c=K.join(e,n.name);n.isDirectory()?(n.name!==Pi||t&&t.innerLoop)&&await Cw(c,{innerLoop:!0,contentsOnly:!1}):await le.unlinkPromise(c)}let a=!t.innerLoop&&t.isWorkspaceDir&&r?.isSymbolicLink();!t.contentsOnly&&!a&&await le.rmdirPromise(e)}catch(r){if(r.code!=="ENOENT"&&r.code!=="ENOTEMPTY")throw r}},x1e=4,zF=(e,{skipPrefix:t})=>{let r=K.contains(t,e);if(r===null)throw new Error(`Assertion failed: Writing attempt prevented to ${e} which is outside project root: ${t}`);let s=r.split(K.sep).filter(p=>p!==""),a=s.indexOf(Pi),n=s.slice(0,a).join(K.sep),c=K.join(t,n),f=s.slice(a);return{locationRoot:c,segments:f}},N1e=(e,{skipPrefix:t})=>{let r=new Map;if(e===null)return r;let s=()=>({children:new Map,linkType:"HARD"});for(let[a,n]of e.entries()){if(n.linkType==="SOFT"&&K.contains(t,n.target)!==null){let f=qe.getFactoryWithDefault(r,n.target,s);f.locator=a,f.linkType=n.linkType}for(let c of n.locations){let{locationRoot:f,segments:p}=zF(c,{skipPrefix:t}),h=qe.getFactoryWithDefault(r,f,s);for(let E=0;E<p.length;++E){let C=p[E];if(C!=="."){let S=qe.getFactoryWithDefault(h.children,C,s);h.children.set(C,S),h=S}E===p.length-1&&(h.locator=a,h.linkType=n.linkType)}}}return r},rW=async(e,t,r)=>{if(process.platform==="win32"&&r==="junctions"){let s;try{s=await le.lstatPromise(e)}catch{}if(!s||s.isDirectory()){await le.symlinkPromise(e,t,"junction");return}}await le.symlinkPromise(K.relative(K.dirname(t),e),t)};async function O1e(e,t,r){let s=K.join(e,`${$Y.default.randomBytes(16).toString("hex")}.tmp`);try{await le.writeFilePromise(s,r);try{await le.linkPromise(s,t)}catch{}}finally{await le.unlinkPromise(s)}}async function f0t({srcPath:e,dstPath:t,entry:r,globalHardlinksStore:s,baseFs:a,nmMode:n}){if(r.kind==="file"){if(n.value==="hardlinks-global"&&s&&r.digest){let f=K.join(s,r.digest.substring(0,2),`${r.digest.substring(2)}.dat`),p;try{let h=await le.statPromise(f);if(h&&(!r.mtimeMs||h.mtimeMs>r.mtimeMs||h.mtimeMs<r.mtimeMs-o0t))if(await Mn.checksumFile(f,{baseFs:le,algorithm:"sha1"})!==r.digest){let C=K.join(s,`${$Y.default.randomBytes(16).toString("hex")}.tmp`);await le.renamePromise(f,C);let S=await a.readFilePromise(e);await le.writeFilePromise(C,S);try{await le.linkPromise(C,f),r.mtimeMs=new Date().getTime(),await le.unlinkPromise(C)}catch{}}else r.mtimeMs||(r.mtimeMs=Math.ceil(h.mtimeMs));await le.linkPromise(f,t),p=!0}catch{p=!1}if(!p){let h=await a.readFilePromise(e);await O1e(s,f,h),r.mtimeMs=new Date().getTime();try{await le.linkPromise(f,t)}catch(E){E&&E.code&&E.code=="EXDEV"&&(n.value="hardlinks-local",await a.copyFilePromise(e,t))}}}else await a.copyFilePromise(e,t);let c=r.mode&511;c!==420&&await le.chmodPromise(t,c)}}var A0t=async(e,t,{baseFs:r,globalHardlinksStore:s,nmMode:a,windowsLinkType:n,packageChecksum:c})=>{await le.mkdirPromise(e,{recursive:!0});let f=async(E=vt.dot)=>{let C=K.join(t,E),S=await r.readdirPromise(C,{withFileTypes:!0}),x=new Map;for(let I of S){let T=K.join(E,I.name),O,U=K.join(C,I.name);if(I.isFile()){if(O={kind:"file",mode:(await r.lstatPromise(U)).mode},a.value==="hardlinks-global"){let V=await Mn.checksumFile(U,{baseFs:r,algorithm:"sha1"});O.digest=V}}else if(I.isDirectory())O={kind:"directory"};else if(I.isSymbolicLink())O={kind:"symlink",symlinkTo:await r.readlinkPromise(U)};else throw new Error(`Unsupported file type (file: ${U}, mode: 0o${await r.statSync(U).mode.toString(8).padStart(6,"0")})`);if(x. Line truncated
`)),process.env.YARN_IS_TEST_ENV)return process.env.YARN_INJECT_NPM_2FA_TOKEN||"";let{otp:s}=await(0,lW.prompt)({type:"password",name:"otp",message:"One-time password:",required:!0,onCancel:()=>process.exit(130)});return process.stdout.write(`
`),s}function ZF(e){if(e.originalError?.name!=="HTTPError")return!1;try{return(e.originalError?.response.headers["www-authenticate"].split(/,\s*/).map(r=>r.toLowerCase())).includes("otp")}catch{return!1}}function vw(e){return{"npm-otp":e}}async function U0t(e,{configuration:t,ident:r}){let s=null;if(process.env.GITLAB_CI)s=process.env.NPM_ID_TOKEN||null;else if(process.env.CIRCLECI)s=process.env.NPM_ID_TOKEN||null;else if(process.env.GITHUB_ACTIONS){if(!(process.env.ACTIONS_ID_TOKEN_REQUEST_URL&&process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN))return null;let a=`npm:${new URL(e).host.replace("registry.yarnpkg.com","registry.npmjs.org").replace("yarn.npmjs.org","registry.npmjs.org")}`,n=new URL(process.env.ACTIONS_ID_TOKEN_REQUEST_URL);n.searchParams.append("audience",a),s=(await nn.get(n.href,{configuration:t,jsonResponse:!0,headers:{Authorization:`Bearer ${process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN}`}})).value}if(!s)return null;try{return(await nn.post(`${e}/-/npm/v1/oidc/token/exchange/package${zb(r)}`,null,{configuration:t,jsonResponse:!0,headers:{Authorization:`Bearer ${s}`}})).token||null}catch{}return null}var Zb=class{supports(t,r){if(!t.reference.startsWith(ti))return!1;let{selector:s,params:a}=j.parseRange(t.reference);return!(!Y1e.default.valid(s)||a===null||typeof a.__archiveUrl!="string")}getLocalPath(t,r){return null}async fetch(t,r){let s=r.checksums.get(t.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(t,s,{onHit:()=>r.report.reportCacheHit(t),onMiss:()=>r.report.reportCacheMiss(t,`${j.prettyLocator(r.project.configuration,t)} can't be found in the cache and will be fetched from the remote server`),loader:()=>this.fetchFromNetwork(t,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:j.getIdentVendorPath(t),checksum:c}}async fetchFromNetwork(t,r){let{params:s}=j.parseRange(t.reference);if(s===null||typeof s.__archiveUrl!="string")throw new Error("Assertion failed: The archiveUrl querystring parameter should have been available");let a=await Xm(s.__archiveUrl,{customErrorMessage:zm,configuration:r.project.configuration,ident:t});return await ms.convertToZip(a,{configuration:r.project.configuration,prefixPath:j.getIdentVendorPath(t),stripComponents:1})}};Ge();var $b=class{supportsDescriptor(t,r){return!(!t.range.startsWith(ti)||!j.tryParseDescriptor(t.range.slice(ti.length),!0))}supportsLocator(t,r){return!1}shouldPersistResolution(t,r){throw new Error("Unreachable")}bindDescriptor(t,r,s){return t}getResolutionDependencies(t,r){let s=r.project.configuration.normalizeDependency(j.parseDescriptor(t.range.slice(ti.length),!0));return r.resolver.getResolutionDependencies(s,r)}async getCandidates(t,r,s){let a=s.project.configuration.normalizeDependency(j.parseDescriptor(t.range.slice(ti.length),!0));return await s.resolver.getCandidates(a,r,s)}async getSatisfying(t,r,s,a){let n=a.project.configuration.normalizeDependency(j.parseDescriptor(t.range.slice(ti.length),!0));return a.resolver.getSatisfying(n,r,s,a)}resolve(t,r){throw new Error("Unreachable")}};Ge();Ge();var W1e=et(hi());var ah=class e{supports(t,r){if(!t.reference.startsWith(ti))return!1;let s=new URL(t.reference);return!(!W1e.default.valid(s.pathname)||s.searchParams.has("__archiveUrl"))}getLocalPath(t,r){return null}async fetch(t,r){let s=r.checksums.get(t.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(t,s,{onHit:()=>r.report.reportCacheHit(t),onMiss:()=>r.report.reportCacheMiss(t,`${j.prettyLocator(r.project.configuration,t)} can't be found in the cache and will be fetched from the remote registry`),loader:()=>this.fetchFromNetwork(t,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:j.getIdentVendorPath(t),checksum:c}}async fetchFromNetwork(t,r){let s;try{s=await Xm(e.getLocatorUrl(t),{customErrorMessage:zm,configuration:r.project.configuration,ident:t})}catch{s=await Xm(e.getLocatorUrl(t).replace(/%2f/g,"/"),{customErrorMessage:zm,configuration:r.project.configuration,ident:t})}return await ms.convertToZip(s,{configuration:r.project.configuration,prefixPath:j.getIdentVendorPath(t),stripComponents:1})}static isConventionalTarballUrl(t,r,{configuration:s}){let a=ww(t.scope,{configuration:s}),n=e.getLocatorUrl(t);return r=r.replace(/^https?:(\/\/(?:[^/]+\.)?npmjs.org(?:$|\/))/,"https:$1"),a=a.replace(/^https:\/\/registry\.npmjs\.org($|\/)/,"https://registry.yarnpkg.com$1"),r=r.replace(/^https:\/\/registry\.npmjs\.org($|\/)/,"https://registry.yarnpkg.com$1"),r===a+n||r===a+n.replace(/%2f/g,"/")}static getLocatorUrl(t){let r=kr.clean(t.reference.slice(ti.length));if(r===null)throw new Lt(10,"The npm semver resolver got selected, but the version isn't semver");let s=encodeURIComponent(t.name),a=encodeURIComponent(r);return`${zb(t)}/-/${s}-${a}.tgz`}};Ge();Ge();Ge();var uW=et(hi());var $F=j.makeIdent(null,"node-gyp"),_0t=/\b(node-gyp|prebuild-install)\b/,eD=class{supportsDescriptor(t,r){return t.range.startsWith(ti)?!!kr.validRange(t.range.slice(ti.length)):!1}supportsLocator(t,r){if(!t.rLine truncated
https://docs.gitlab.com/ee/ci/secrets/id_token_authentication.html`);r={_type:wvt,subject:e,predicateType:vvt,predicate:{buildType:`${Pvt}/${xvt}`,builder:{id:`${Bt.CI_PROJECT_URL}/-/runners/${Bt.CI_RUNNER_ID}`},invocation:{configSource:{uri:`git+${Bt.CI_PROJECT_URL}`,digest:{sha1:Bt.CI_COMMIT_SHA},entryPoint:Bt.CI_JOB_NAME},parameters:{CI:Bt.CI,CI_API_GRAPHQL_URL:Bt.CI_API_GRAPHQL_URL,CI_API_V4_URL:Bt.CI_API_V4_URL,CI_BUILD_BEFORE_SHA:Bt.CI_BUILD_BEFORE_SHA,CI_BUILD_ID:Bt.CI_BUILD_ID,CI_BUILD_NAME:Bt.CI_BUILD_NAME,CI_BUILD_REF:Bt.CI_BUILD_REF,CI_BUILD_REF_NAME:Bt.CI_BUILD_REF_NAME,CI_BUILD_REF_SLUG:Bt.CI_BUILD_REF_SLUG,CI_BUILD_STAGE:Bt.CI_BUILD_STAGE,CI_COMMIT_BEFORE_SHA:Bt.CI_COMMIT_BEFORE_SHA,CI_COMMIT_BRANCH:Bt.CI_COMMIT_BRANCH,CI_COMMIT_REF_NAME:Bt.CI_COMMIT_REF_NAME,CI_COMMIT_REF_PROTECTED:Bt.CI_COMMIT_REF_PROTECTED,CI_COMMIT_REF_SLUG:Bt.CI_COMMIT_REF_SLUG,CI_COMMIT_SHA:Bt.CI_COMMIT_SHA,CI_COMMIT_SHORT_SHA:Bt.CI_COMMIT_SHORT_SHA,CI_COMMIT_TIMESTAMP:Bt.CI_COMMIT_TIMESTAMP,CI_COMMIT_TITLE:Bt.CI_COMMIT_TITLE,CI_CONFIG_PATH:Bt.CI_CONFIG_PATH,CI_DEFAULT_BRANCH:Bt.CI_DEFAULT_BRANCH,CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX:Bt.CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX,CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX:Bt.CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX,CI_DEPENDENCY_PROXY_SERVER:Bt.CI_DEPENDENCY_PROXY_SERVER,CI_DEPENDENCY_PROXY_USER:Bt.CI_DEPENDENCY_PROXY_USER,CI_JOB_ID:Bt.CI_JOB_ID,CI_JOB_NAME:Bt.CI_JOB_NAME,CI_JOB_NAME_SLUG:Bt.CI_JOB_NAME_SLUG,CI_JOB_STAGE:Bt.CI_JOB_STAGE,CI_JOB_STARTED_AT:Bt.CI_JOB_STARTED_AT,CI_JOB_URL:Bt.CI_JOB_URL,CI_NODE_TOTAL:Bt.CI_NODE_TOTAL,CI_PAGES_DOMAIN:Bt.CI_PAGES_DOMAIN,CI_PAGES_URL:Bt.CI_PAGES_URL,CI_PIPELINE_CREATED_AT:Bt.CI_PIPELINE_CREATED_AT,CI_PIPELINE_ID:Bt.CI_PIPELINE_ID,CI_PIPELINE_IID:Bt.CI_PIPELINE_IID,CI_PIPELINE_SOURCE:Bt.CI_PIPELINE_SOURCE,CI_PIPELINE_URL:Bt.CI_PIPELINE_URL,CI_PROJECT_CLASSIFICATION_LABEL:Bt.CI_PROJECT_CLASSIFICATION_LABEL,CI_PROJECT_DESCRIPTION:Bt.CI_PROJECT_DESCRIPTION,CI_PROJECT_ID:Bt.CI_PROJECT_ID,CI_PROJECT_NAME:Bt.CI_PROJECT_NAME,CI_PROJECT_NAMESPACE:Bt.CI_PROJECT_NAMESPACE,CI_PROJECT_NAMESPACE_ID:Bt.CI_PROJECT_NAMESPACE_ID,CI_PROJECT_PATH:Bt.CI_PROJECT_PATH,CI_PROJECT_PATH_SLUG:Bt.CI_PROJECT_PATH_SLUG,CI_PROJECT_REPOSITORY_LANGUAGES:Bt.CI_PROJECT_REPOSITORY_LANGUAGES,CI_PROJECT_ROOT_NAMESPACE:Bt.CI_PROJECT_ROOT_NAMESPACE,CI_PROJECT_TITLE:Bt.CI_PROJECT_TITLE,CI_PROJECT_URL:Bt.CI_PROJECT_URL,CI_PROJECT_VISIBILITY:Bt.CI_PROJECT_VISIBILITY,CI_REGISTRY:Bt.CI_REGISTRY,CI_REGISTRY_IMAGE:Bt.CI_REGISTRY_IMAGE,CI_REGISTRY_USER:Bt.CI_REGISTRY_USER,CI_RUNNER_DESCRIPTION:Bt.CI_RUNNER_DESCRIPTION,CI_RUNNER_ID:Bt.CI_RUNNER_ID,CI_RUNNER_TAGS:Bt.CI_RUNNER_TAGS,CI_SERVER_HOST:Bt.CI_SERVER_HOST,CI_SERVER_NAME:Bt.CI_SERVER_NAME,CI_SERVER_PORT:Bt.CI_SERVER_PORT,CI_SERVER_PROTOCOL:Bt.CI_SERVER_PROTOCOL,CI_SERVER_REVISION:Bt.CI_SERVER_REVISION,CI_SERVER_SHELL_SSH_HOST:Bt.CI_SERVER_SHELL_SSH_HOST,CI_SERVER_SHELL_SSH_PORT:Bt.CI_SERVER_SHELL_SSH_PORT,CI_SERVER_URL:Bt.CI_SERVER_URL,CI_SERVER_VERSION:Bt.CI_SERVER_VERSION,CI_SERVER_VERSION_MAJOR:Bt.CI_SERVER_VERSION_MAJOR,CI_SERVER_VERSION_MINOR:Bt.CI_SERVER_VERSION_MINOR,CI_SERVER_VERSION_PATCH:Bt.CI_SERVER_VERSION_PATCH,CI_TEMPLATE_REGISTRY_HOST:Bt.CI_TEMPLATE_REGISTRY_HOST,GITLAB_CI:Bt.GITLAB_CI,GITLAB_FEATURES:Bt.GITLAB_FEATURES,GITLAB_USER_ID:Bt.GITLAB_USER_ID,GITLAB_USER_LOGIN:Bt.GITLAB_USER_LOGIN,RUNNER_GENERATE_ARTIFACTS_METADATA:Bt.RUNNER_GENERATE_ARTIFACTS_METADATA},environment:{name:Bt.CI_RUNNER_DESCRIPTION,architecture:Bt.CI_RUNNER_EXECUTABLE_ARCH,server:Bt.CI_SERVER_URL,project:Bt.CI_PROJECT_PATH,job:{id:Bt.CI_JOB_ID},pipeline:{id:Bt.CI_PIPELINE_ID,ref:Bt.CI_CONFIG_PATH}}},metadata:{buildInvocationId:`${Bt.CI_JOB_URL}`,completeness:{parameters:!0,environment:!0,materials:!1},reproducible:!1},materials:[{uri:`git+${Bt.CI_PROJECT_URL}`,digest:{sha1:Bt.CI_COMMIT_SHA}}]}}}else throw new Lt(91,"Provenance generation is only supported in GitHub Actions and GitLab CI");return TDe.attest(Buffer.from(JSON.stringify(r)),Cvt,t)};async function kvt(e,t,{access:r,tag:s,registry:a,gitHead:n,provenance:c}){let f=e.manifest.name,p=e.manifest.version,h=j.stringifyIdent(f),E=NDe.default.fromData(t,{algorithms:["sha1","sha512"]}),C=r??ODe(e,f),S=await LDe(e),x=await CA.genPackageManifest(e),I=`${h}-${p}.tgz`,T=new URL(`${Kc(a)}/${h}/-/${I}`),O={[I]:{content_type:"application/octet-stream",data:t.toString("base64"),length:t.length}};if(c){let U={name:`pkg:npm/${h.replace(/^@/,"%40")}@${p}`,digest:{sha512:E.sha512[0].hexDigest()}},V=await FDe([U]),$=JSON.stringify(V);O[`${h}-${p}.sigstore`]={content_type:V.mediaType,data:$,length:$.length}}return{_id:h,_attachments:O,name:h,access:C,"dist-tags":{[s]:p},versions:{[p]:{...x,_id:`${h}@${p}`,name:h,version:p,gitHead:n,dist:{shasum:E.sha1[0].hexDigest(),integrity:E.sha512[0].toString(),tarball:T.toString()}}},readme:S}}async function Qvt(e){try{let{stdout:t}=await Yr.execvp("git",["rev-parse","--revs-only","HEAD"],{cwd:e});return t.trim()===""?void 0:t.trim()}catch{return}}fu Line truncated
`;try{a=await le.readFilePromise(t,"utf8")}catch(n){if(n.code==="ENOENT")return a;throw n}return a}var iJ={npmAlwaysAuth:{description:"URL of the selected npm registry (note: npm enterprise isn't supported)",type:"BOOLEAN",default:!1},npmAuthIdent:{description:"Authentication identity for the npm registry (_auth in npm and yarn v1)",type:"SECRET",default:null},npmAuthToken:{description:"Authentication token for the npm registry (_authToken in npm and yarn v1)",type:"SECRET",default:null}},MDe={npmAuditRegistry:{description:"Registry to query for audit reports",type:"STRING",default:null},npmPublishRegistry:{description:"Registry to push packages to",type:"STRING",default:null},npmRegistryServer:{description:"URL of the selected npm registry (note: npm enterprise isn't supported)",type:"STRING",default:"https://registry.yarnpkg.com"}},Rvt={npmMinimalAgeGate:{description:"Minimum age of a package version according to the publish date on the npm registry to be considered for installation",type:"DURATION",unit:"m",default:"1d"},npmPreapprovedPackages:{description:"Array of package descriptors or package name glob patterns to exclude from the minimum release age check",type:"STRING",isArray:!0,default:[]}},Tvt={configuration:{...iJ,...MDe,...Rvt,npmScopes:{description:"Settings per package scope",type:"MAP",valueDefinition:{description:"",type:"SHAPE",properties:{...iJ,...MDe}}},npmRegistries:{description:"Settings per registry",type:"MAP",normalizeKeys:Kc,valueDefinition:{description:"",type:"SHAPE",properties:{...iJ}}}},fetchers:[Zb,ah],resolvers:[$b,eD,tD]},Fvt=Tvt;var dJ={};Vt(dJ,{NpmAuditCommand:()=>I1,NpmInfoCommand:()=>C1,NpmLoginCommand:()=>w1,NpmLogoutCommand:()=>v1,NpmPublishCommand:()=>S1,NpmStageApproveCommand:()=>b1,NpmStageListCommand:()=>D1,NpmStageRejectCommand:()=>P1,NpmTagAddCommand:()=>k1,NpmTagListCommand:()=>x1,NpmTagRemoveCommand:()=>Q1,NpmWhoamiCommand:()=>R1,default:()=>Vvt,npmAuditTypes:()=>eP,npmAuditUtils:()=>yL});Ge();Ge();jt();var uJ=et(Xo());Jo();var eP={};Vt(eP,{Environment:()=>ZD,Severity:()=>$D});var ZD=(s=>(s.All="all",s.Production="production",s.Development="development",s))(ZD||{}),$D=(n=>(n.Info="info",n.Low="low",n.Moderate="moderate",n.High="high",n.Critical="critical",n))($D||{});var yL={};Vt(yL,{allSeverities:()=>E1,getPackages:()=>cJ,getReportTree:()=>aJ,getSeverityInclusions:()=>oJ,getTopLevelDependencies:()=>lJ});Ge();var UDe=et(hi());var E1=["info","low","moderate","high","critical"];function oJ(e){if(typeof e>"u")return new Set(E1);let t=E1.indexOf(e),r=E1.slice(t);return new Set(r)}function aJ(e){let t={},r={children:t};for(let[s,a]of qe.sortMap(Object.entries(e),n=>n[0]))for(let n of qe.sortMap(a,c=>`${c.id}`))t[`${s}/${n.id}`]={value:ce.tuple(ce.Type.IDENT,j.parseIdent(s)),children:{ID:typeof n.id<"u"&&{label:"ID",value:ce.tuple(ce.Type.ID,n.id)},Issue:{label:"Issue",value:ce.tuple(ce.Type.NO_HINT,n.title)},URL:typeof n.url<"u"&&{label:"URL",value:ce.tuple(ce.Type.URL,n.url)},Severity:{label:"Severity",value:ce.tuple(ce.Type.NO_HINT,n.severity)},"Vulnerable Versions":{label:"Vulnerable Versions",value:ce.tuple(ce.Type.RANGE,n.vulnerable_versions)},"Tree Versions":{label:"Tree Versions",children:[...n.versions].sort(UDe.default.compare).map(c=>({value:ce.tuple(ce.Type.REFERENCE,c)}))},Dependents:{label:"Dependents",children:qe.sortMap(n.dependents,c=>j.stringifyLocator(c)).map(c=>({value:ce.tuple(ce.Type.LOCATOR,c)}))}}};return r}function lJ(e,t,{all:r,environment:s}){let a=[],n=r?e.workspaces:[t],c=["all","production"].includes(s),f=["all","development"].includes(s);for(let p of n)for(let h of p.anchoredPackage.dependencies.values())(p.manifest.devDependencies.has(h.identHash)?!f:!c)||a.push({workspace:p,dependency:h});return a}function cJ(e,t,{recursive:r}){let s=new Map,a=new Set,n=[],c=e.configuration.makeResolver(),f={project:e,resolver:c},p=(h,E)=>{let C=e.storedResolutions.get(E.descriptorHash);if(typeof C>"u")throw new Error("Assertion failed: The resolution should have been registered");if(!a.has(C))a.add(C);else return;let S=e.storedPackages.get(C);if(typeof S>"u")throw new Error("Assertion failed: The package should have been registered");let x=j.ensureDevirtualizedDescriptor(E);if(c.supportsDescriptor(x,f)){let T=c.getResolutionDependencies(x,f);if(Object.keys(T).length>0)for(let O of Object.values(T))p(h,O)}if(j.ensureDevirtualizedLocator(S).reference.startsWith("npm:")&&S.version!==null){let T=j.stringifyIdent(S),O=qe.getMapWithDefault(s,T);qe.getArrayWithDefault(O,S.version).push(h)}if(r)for(let T of S.dependencies.values())n.push([S,T])};for(let{workspace:h,dependency:E}of t)n.push([h.anchoredLocator,E]);for(;n.length>0;){let[h,E]=n.shift();p(h,E)}return s}var I1=class extends ft{constructor(){super(...arguments);this.all=pe.Boolean("-A,--all",!1,{description:"Audit dependencies from all workspaces"});this.recursive=pe.Boolean("-R,--recursive",!1,{description:"Audit transitive dependencies as well"});this.environment=pe.String("--environment","all" Line truncated
This command checks for known security reports on the packages you use. The reports are by default extracted from the npm registry, and may or may not be relevant to your actual program (not all vulnerabilities affect all code paths).
For consistency with our other commands the default is to only check the direct dependencies for the active workspace. To extend this search to all workspaces, use \`-A,--all\`. To extend this search to both direct and transitive dependencies, use \`-R,--recursive\`.
Applying the \`--severity\` flag will limit the audit table to vulnerabilities of the corresponding severity and above. Valid values are ${E1.map(r=>`\`${r}\``).join(", ")}.
If the \`--json\` flag is set, Yarn will print the output exactly as received from the registry. Regardless of this flag, the process will exit with a non-zero exit code if a report is found for the selected packages.
If certain packages produce false positives for a particular environment, the \`--exclude\` flag can be used to exclude any number of packages from the audit. This can also be set in the configuration file with the \`npmAuditExcludePackages\` option.
If particular advisories are needed to be ignored, the \`--ignore\` flag can be used with Advisory ID's to ignore any number of advisories in the audit report. This can also be set in the configuration file with the \`npmAuditIgnoreAdvisories\` option.
To understand the dependency tree requiring vulnerable packages, check the raw report with the \`--json\` flag or use \`yarn why package\` to get more information as to who depends on them.
`,examples:[["Checks for known security issues with the installed packages. The output is a list of known issues.","yarn npm audit"],["Audit dependencies in all workspaces","yarn npm audit --all"],["Limit auditing to `dependencies` (excludes `devDependencies`)","yarn npm audit --environment production"],["Show audit report as valid JSON","yarn npm audit --json"],["Audit all direct and transitive dependencies","yarn npm audit --recursive"],["Output moderate (or more severe) vulnerabilities","yarn npm audit --severity moderate"],["Exclude certain packages","yarn npm audit --exclude package1 --exclude package2"],["Ignore specific advisories","yarn npm audit --ignore 1234567 --ignore 7654321"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let n=lJ(s,a,{all:this.all,environment:this.environment}),c=cJ(s,n,{recursive:this.recursive}),f=Array.from(new Set([...r.get("npmAuditExcludePackages"),...this.excludes])),p=Object.create(null);for(let[O,U]of c)f.some(V=>uJ.default.isMatch(O,V))||(p[O]=[...U.keys()]);let h=gn.getAuditRegistry({configuration:r}),E,C=await fA.start({configuration:r,stdout:this.context.stdout},async()=>{let O=Qr.post("/-/npm/v1/security/advisories/bulk",p,{authType:Qr.AuthType.BEST_EFFORT,configuration:r,jsonResponse:!0,registry:h}),U=this.noDeprecations?[]:await Promise.all(Array.from(Object.entries(p),async([$,ie])=>{let fe=await Qr.getPackageMetadata(j.parseIdent($),{project:s});return qe.mapAndFilter(ie,ae=>{let{deprecated:ge}=fe.versions[ae];return ge?[$,ae,ge]:qe.mapAndFilter.skip})})),V=await O;for(let[$,ie,fe]of U.flat(1))Object.hasOwn(V,$)&&V[$].some(ae=>kr.satisfiesWithPrereleases(ie,ae.vulnerable_versions))||(V[$]??=[],V[$].push({id:`${$} (deprecation)`,title:(typeof fe=="string"?fe:"").trim()||"This package has been deprecated.",severity:"moderate",vulnerable_versions:ie}));E=V});if(C.hasErrors())return C.exitCode();let S=oJ(this.severity),x=Array.from(new Set([...r.get("npmAuditIgnoreAdvisories"),...this.ignores])),I=Object.create(null);for(let[O,U]of Object.entries(E)){let V=U.filter($=>!uJ.default.isMatch(`${$.id}`,x)&&S.has($.severity));V.length>0&&(I[O]=V.map($=>{let ie=c.get(O);if(typeof ie>"u")throw new Error("Assertion failed: Expected the registry to only return packages that were requested");let fe=[...ie.keys()].filter(ge=>kr.satisfiesWithPrereleases(ge,$.vulnerable_versions)),ae=new Map;for(let ge of fe)for(let he of ie.get(ge))ae.set(he.locatorHash,he);return{...$,versions:fe,dependents:[...ae.values()]}}))}let T=Object.keys(I).length>0;return T?(ts.emitTree(aJ(I),{configuration:r,json:this.json,stdout:this.context.stdout,separators:2}),1):(await Ft.start({configuration:r,includeFooter:!1,json:this.json,stdout:this.context.stdout},async O=>{O.reportInfo(1,"No audit suggestions")}),T?1:0)}};Ge();Ge();bt();jt();var fJ=et(hi()),AJ=Ie("util"),C1=class extends ft{constructor(){super(...arguments);this.fields=pe.String("-f,--fields",{description:"A comma-separated list of manifest fields that should be displayed"});this.json=pe.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.packages=pe.Rest()}static{this.paths=[["npm","info"]]}static{this.usage=it.Usage({category:"Npm-related commands",description:"show information about a package",details:"\n This command fetches information about a package from the npm registry and prints it in a tree format.\n\n The package does not have to be installed locally, but needs to have been published (in particular, local changes will be ignored even for workspaces).\n\n Append `@<range>` to the package argument to provide information specific to the latest version that satisfies the range or to the corresponding tagged version. If the range is invalid or if there is no version satisfying the range, the command will print a warning and fall back to the latest version.\n\n If the `-f,--fields` option is set, it's a comma-separated list of fields which will be used to only display part of the package information.\n\n By default, this command won't return the `dist`, `readme`, and `users` fields, since they are often very long. To explicitly request those fields, explicitly list them with the `--fields` flag or request the output in JSON mode.\n ",examples:[["Show all available information about react (except the `dist`, `readme`, and `users` fields)","yarn npm info react"],["Show all available information about react as valid JSON (including the `dist`, `readme`, and `users` fields)","yarn npm info react --json"],["Show all available information about [email protected]","yarn npm info [email protected]"],["Show all available information about react@next","yarn npm info react@next"],["Show the description of react","yarn npm info react --fields description"],["Show all available versions of react","yarn npm info react --fields versi Line truncated
`),this.context.stdout.write(`${(0,AJ.inspect)(p,{depth:1/0,colors:!0,compact:!1})}
`);return f.exitCode()}};function pJ(e){if(Array.isArray(e)){let t=[];for(let r of e)r=pJ(r),r&&t.push(r);return t}else if(typeof e=="object"&&e!==null){let t={};for(let r of Object.keys(e)){if(r.startsWith("_"))continue;let s=pJ(e[r]);s&&(t[r]=s)}return t}else return e||null}Ge();Ge();jt();var hJ=et(Xv()),w1=class extends ft{constructor(){super(...arguments);this.scope=pe.String("-s,--scope",{description:"Login to the registry configured for a given scope"});this.publish=pe.Boolean("--publish",!1,{description:"Login to the publish registry"});this.alwaysAuth=pe.Boolean("--always-auth",{description:"Set the npmAlwaysAuth configuration"});this.webLogin=pe.Boolean("--web-login",{description:"Enable web login"})}static{this.paths=[["npm","login"]]}static{this.usage=it.Usage({category:"Npm-related commands",description:"store new login info to access the npm registry",details:"\n This command will ask you for your username, password, and 2FA One-Time-Password (when it applies). It will then modify your local configuration (in your home folder, never in the project itself) to reference the new tokens thus generated.\n\n Adding the `-s,--scope` flag will cause the authentication to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\n\n Adding the `--publish` flag will cause the authentication to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\n ",examples:[["Login to the default registry","yarn npm login"],["Login to the registry linked to the @my-scope registry","yarn npm login --scope my-scope"],["Login to the publish registry for the current package","yarn npm login --publish"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),s=await EL({configuration:r,cwd:this.context.cwd,publish:this.publish,scope:this.scope});return(await Ft.start({configuration:r,stdout:this.context.stdout,includeFooter:!1},async n=>{let c=await Uvt({registry:s,configuration:r,report:n,webLogin:this.webLogin,stdin:this.context.stdin,stdout:this.context.stdout});return await Hvt(s,c,{alwaysAuth:this.alwaysAuth,scope:this.scope}),n.reportInfo(0,"Successfully logged in")})).exitCode()}};async function EL({scope:e,publish:t,configuration:r,cwd:s}){return e&&t?gn.getScopeRegistry(e,{configuration:r,type:gn.RegistryType.PUBLISH_REGISTRY}):e?gn.getScopeRegistry(e,{configuration:r}):t?gn.getPublishRegistry((await VI(r,s)).manifest,{configuration:r}):gn.getDefaultRegistry({configuration:r})}async function Nvt(e,t){let r;try{r=await Qr.post("/-/v1/login",null,{configuration:t,registry:e,authType:Qr.AuthType.NO_AUTH,jsonResponse:!0,headers:{"npm-auth-type":"web"}})}catch{return null}return r}async function Ovt(e,t){let r=await nn.request(e,null,{configuration:t,jsonResponse:!0});if(r.statusCode===202){let s=r.headers["retry-after"]??"1";return{type:"waiting",sleep:parseInt(s,10)}}return r.statusCode===200?{type:"success",token:r.body.token}:null}async function Lvt({registry:e,configuration:t,report:r}){let s=await Nvt(e,t);if(!s)return null;if(Ui.openUrl){r.reportInfo(0,"Starting the web login process..."),r.reportSeparator();let{openNow:a}=await(0,hJ.prompt)({type:"confirm",name:"openNow",message:"Do you want to try to open your browser now?",required:!0,initial:!0,onCancel:()=>process.exit(130)});r.reportSeparator(),(!a||!await Ui.openUrl(s.loginUrl))&&(r.reportWarning(0,"We failed to automatically open the url; you'll have to open it yourself in your browser of choice:"),r.reportWarning(0,ce.pretty(t,s.loginUrl,ce.Type.URL)),r.reportSeparator())}for(;;){let a=await Ovt(s.doneUrl,t);if(a===null)return null;if(a.type==="waiting")await new Promise(n=>setTimeout(n,a.sleep*1e3));else return a.token}}var Mvt=["https://registry.yarnpkg.com","https://registry.npmjs.org"];async function Uvt(e){if(e.webLogin??Mvt.includes(e.registry)){let t=await Lvt(e);if(t!==null)return t}return await _vt(e)}async function _vt({registry:e,configuration:t,report:r,stdin:s,stdout:a}){let n=await jvt({configuration:t,registry:e,report:r,stdin:s,stdout:a}),c=`/-/user/org.couchdb.user:${encodeURIComponent(n.name)}`,f={_id:`org.couchdb.user:${n.name}`,name:n.name,password:n.password,type:"user",roles:[],date:new Date().toISOString()},p={attemptedAs:n.name,configuration:t,registry:e,jsonResponse:!0,authType:Qr.AuthType.NO_AUTH};try{return(await Qr.put(c,f,p)).token}catch(x){if(!(x.originalError?.name==="HTTPError"&&x.originalError?.response.statusCode===409))throw x}let h={...p,authType:Qr.AuthType.NO_AUTH,headers:{authorization:`Basic ${Buffer.from(`${n.name}:${n.password}`).toString("base64")}`}},E=await Qr.get(c,h);for(let[x,I]of Object.entries(E))(!f[x]||x==="roles")&&(f[x]=I);let C=`${c}/-rev/${f._rev}`;return(await Qr.put(C,f,h)).token}async function Hvt(e,t,{alwaysAuth:r,scope:s}){let a=c=>f=>{let p=qe.isIndexableObject(f)?f:{},h=p[c],E=qe.isIndexableObject(h)?h:{};return{...p,[c]:{...E,...r!==void 0?{npLine truncated
This command will list all staged package versions awaiting approval on the npm registry.
If a package name is provided, only staged versions of that package will be listed.
`,examples:[["List all staged packages","yarn npm stage list"],["List staged versions of a specific package","yarn npm stage list my-pkg"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),s=gn.getDefaultRegistry({configuration:r,type:gn.RegistryType.PUBLISH_REGISTRY}),a=await Yvt(r,s,this.package??void 0);if(await Ft.start({configuration:r,stdout:this.context.stdout,json:this.json,includeFooter:!1,includePrefix:!1},async c=>{a.length>0?(c.reportInfo(0,`The following packages are awaiting approval. Use ${ce.pretty(r,"yarn npm stage approve <stageId>",ce.Type.CODE)} to approve them.`),c.reportSeparator()):this.package?c.reportInfo(0,`No staged versions found for package ${this.package}`):c.reportInfo(0,"No staged packages found")}),a.length===0)return;let n={children:a.map(c=>{let f=j.parseIdent(c.packageName);return{value:ce.tuple(ce.Type.RESOLUTION,{descriptor:j.makeDescriptor(f,c.tag),locator:j.makeLocator(f,c.version)}),children:{ID:{label:"ID",value:ce.tuple(ce.Type.CODE,c.id)},Staged:{label:"Staged on",value:ce.tuple(ce.Type.NO_HINT,c.createdAt)}}}})};ts.emitTree(n,{configuration:r,json:this.json,stdout:this.context.stdout,separators:1})}};async function Yvt(e,t,r){let s=[],a=0,n=100;for(;;){let c={page:String(a),perPage:String(n)};r&&(c.package=r);let f=new URLSearchParams(c).toString(),p=await Qr.get(`/-/stage?${f}`,{configuration:e,registry:t,jsonResponse:!0,authType:Qr.AuthType.ALWAYS_AUTH});if(s.push(...p.items),s.length>=p.total||p.items.length<n)break;a++}return s}Ge();jt();Jo();var P1=class extends ft{constructor(){super(...arguments);this.stageId=pe.String({validator:l0(Jf(),[Sp(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i)])});this.otp=pe.String("--otp",{description:"The OTP token to use with the command"})}static{this.paths=[["npm","stage","reject"]]}static{this.usage=it.Usage({category:"Npm-related commands",description:"reject a staged package version",details:"\n This command will reject a staged package version, permanently removing it from the registry staging area. This operation requires 2FA and will prompt for an OTP token if one is not provided via the `--otp` flag.\n ",examples:[["Reject a staged package","yarn npm stage reject 1de6f3db-2ed9-4d72-b3dd-8f0e2b474a2f"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),s=gn.getDefaultRegistry({configuration:r,type:gn.RegistryType.PUBLISH_REGISTRY});return(await Ft.start({configuration:r,stdout:this.context.stdout},async n=>{let c=ce.pretty(r,this.stageId,ce.Type.CODE);n.reportInfo(0,`Rejecting staged package ${ce.pretty(r,c,ce.Type.CODE)}...`),n.reportSeparator(),await Qr.del(`/-/stage/${this.stageId}`,{configuration:r,registry:s,otp:this.otp,authType:Qr.AuthType.ALWAYS_AUTH}),n.reportInfo(0,`Staged package ${ce.pretty(r,c,ce.Type.CODE)} has been rejected.`)})).exitCode()}};Ge();jt();var HDe=et(hi());Ge();bt();jt();var x1=class extends ft{constructor(){super(...arguments);this.json=pe.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.package=pe.String({required:!1})}static{this.paths=[["npm","tag","list"]]}static{this.usage=it.Usage({category:"Npm-related commands",description:"list all dist-tags of a package",details:`
This command will list all tags of a package from the npm registry.
If the package is not specified, Yarn will default to the current workspace.
`,examples:[["List all tags of package `my-pkg`","yarn npm tag list my-pkg"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd),n;if(typeof this.package<"u")n=j.parseIdent(this.package);else{if(!a)throw new ar(s.cwd,this.context.cwd);if(!a.manifest.name)throw new st(`Missing 'name' field in ${Ae.fromPortablePath(K.join(a.cwd,Ir.manifest))}`);n=a.manifest.name}let c=await tP(n,r),p={children:qe.sortMap(Object.entries(c),([h])=>h).map(([h,E])=>({value:ce.tuple(ce.Type.RESOLUTION,{descriptor:j.makeDescriptor(n,h),locator:j.makeLocator(n,E)})}))};return ts.emitTree(p,{configuration:r,json:this.json,stdout:this.context.stdout})}};async function tP(e,t){let r=`/-/package${Qr.getIdentUrl(e)}/dist-tags`;return Qr.get(r,{configuration:t,ident:e,jsonResponse:!0,customErrorMessage:Qr.customPackageError})}var k1=class extends ft{constructor(){super(...arguments);this.package=pe.String();this.tag=pe.String()}static{this.paths=[["npm","tag","add"]]}static{this.usage=it.Usage({category:"Npm-related commands",description:"add a tag for a specific version of a package",details:`
This command will add a tag to the npm registry for a specific version of a package. If the tag already exists, it will be overwritten.
`,examples:[["Add a `beta` tag for version `2.3.4-beta.4` of package `my-pkg`","yarn npm tag add [email protected] beta"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);let n=j.parseDescriptor(this.package,!0),c=n.range;if(!HDe.default.valid(c))throw new st(`The range ${ce.pretty(r,n.range,ce.Type.RANGE)} must be a valid semver version`);let f=gn.getPublishRegistry(a.manifest,{configuration:r}),p=ce.pretty(r,n,ce.Type.IDENT),h=ce.pretty(r,c,ce.Type.RANGE),E=ce.pretty(r,this.tag,ce.Type.CODE);return(await Ft.start({configuration:r,stdout:this.context.stdout},async S=>{let x=await tP(n,r);Object.hasOwn(x,this.tag)&&x[this.tag]===c&&S.reportWarning(0,`Tag ${E} is already set to version ${h}`);let I=`/-/package${Qr.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await Qr.put(I,c,{configuration:r,registry:f,ident:n,jsonRequest:!0,jsonResponse:!0}),S.reportInfo(0,`Tag ${E} added to version ${h} of package ${p}`)})).exitCode()}};Ge();jt();var Q1=class extends ft{constructor(){super(...arguments);this.package=pe.String();this.tag=pe.String()}static{this.paths=[["npm","tag","remove"]]}static{this.usage=it.Usage({category:"Npm-related commands",description:"remove a tag from a package",details:`
This command will remove a tag from a package from the npm registry.
`,examples:[["Remove the `beta` tag from package `my-pkg`","yarn npm tag remove my-pkg beta"]]})}async execute(){if(this.tag==="latest")throw new st("The 'latest' tag cannot be removed.");let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);let n=j.parseIdent(this.package),c=gn.getPublishRegistry(a.manifest,{configuration:r}),f=ce.pretty(r,this.tag,ce.Type.CODE),p=ce.pretty(r,n,ce.Type.IDENT),h=await tP(n,r);if(!Object.hasOwn(h,this.tag))throw new st(`${f} is not a tag of package ${p}`);return(await Ft.start({configuration:r,stdout:this.context.stdout},async C=>{let S=`/-/package${Qr.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await Qr.del(S,{configuration:r,registry:c,ident:n,jsonResponse:!0}),C.reportInfo(0,`Tag ${f} removed from package ${p}`)})).exitCode()}};Ge();Ge();jt();var R1=class extends ft{constructor(){super(...arguments);this.scope=pe.String("-s,--scope",{description:"Print username for the registry configured for a given scope"});this.publish=pe.Boolean("--publish",!1,{description:"Print username for the publish registry"})}static{this.paths=[["npm","whoami"]]}static{this.usage=it.Usage({category:"Npm-related commands",description:"display the name of the authenticated user",details:"\n Print the username associated with the current authentication settings to the standard output.\n\n When using `-s,--scope`, the username printed will be the one that matches the authentication settings of the registry associated with the given scope (those settings can be overriden using the `npmRegistries` map, and the registry associated with the scope is configured via the `npmScopes` map).\n\n When using `--publish`, the registry we'll select will by default be the one used when publishing packages (`publishConfig.registry` or `npmPublishRegistry` if available, otherwise we'll fallback to the regular `npmRegistryServer`).\n ",examples:[["Print username for the default registry","yarn npm whoami"],["Print username for the registry on a given scope","yarn npm whoami --scope company"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),s;return this.scope&&this.publish?s=gn.getScopeRegistry(this.scope,{configuration:r,type:gn.RegistryType.PUBLISH_REGISTRY}):this.scope?s=gn.getScopeRegistry(this.scope,{configuration:r}):this.publish?s=gn.getPublishRegistry((await VI(r,this.context.cwd)).manifest,{configuration:r}):s=gn.getDefaultRegistry({configuration:r}),(await Ft.start({configuration:r,stdout:this.context.stdout},async n=>{let c;try{c=await Qr.get("/-/whoami",{configuration:r,registry:s,authType:Qr.AuthType.ALWAYS_AUTH,jsonResponse:!0,ident:this.scope?j.makeIdent(this.scope,""):void 0})}catch(f){if(f.response?.statusCode===401||f.response?.statusCode===403){n.reportError(41,"Authentication failed - your credentials may have expired");return}else throw f}n.reportInfo(0,c.username)})).exitCode()}};var Wvt={configuration:{npmPublishAccess:{description:"Default access of the published packages",type:"STRING",default:null},npmPublishProvenance:{description:"Whether to generate provenance for the published packages",type:"BOOLEAN",default:!1},npmAuditExcludePackages:{description:"Array of glob patterns of packages to exclude from npm audit",type:"STRING",default:[],isArray:!0},npmAuditIgnoreAdvisories:{description:"Array of glob patterns of advisory IDs to exclude from npm audit",type:"STRING",default:[],isArray:!0}},commands:[I1,C1,w1,v1,S1,b1,D1,P1,k1,x1,Q1,R1]},Vvt=Wvt;var wJ={};Vt(wJ,{PatchCommand:()=>M1,PatchCommitCommand:()=>L1,PatchFetcher:()=>oP,PatchResolver:()=>aP,default:()=>fSt,patchUtils:()=>Cy});Ge();Ge();bt();iA();var Cy={};Vt(Cy,{applyPatchFile:()=>CL,diffFolders:()=>IJ,ensureUnpatchedDescriptor:()=>gJ,ensureUnpatchedLocator:()=>BL,extractPackageToDisk:()=>EJ,extractPatchFlags:()=>KDe,isParentRequired:()=>yJ,isPatchDescriptor:()=>wL,isPatchLocator:()=>Fd,loadPatchFiles:()=>sP,makeDescriptor:()=>vL,makeLocator:()=>mJ,makePatchHash:()=>CJ,parseDescriptor:()=>nP,parseLocator:()=>iP,parsePatchFile:()=>rP,unpatchDescriptor:()=>lSt,unpatchLocator:()=>cSt});Ge();bt();Ge();bt();var Kvt=/^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@.*/;function T1(e){return K.relative(vt.root,K.resolve(vt.root,Ae.toPortablePath(e)))}function Jvt(e){let t=e.trim().match(Kvt);if(!t)throw new Error(`Bad header line: '${e}'`);return{original:{start:Math.max(Number(t[1]),1),length:Number(t[3]||1)},patched:{start:Math.max(Number(t[4]),1),length:Number(t[6]||1)}}}var zvt=420,Xvt=493;var jDe=()=>({semverExclusivity:null,diffLineFromPath:null,diffLineToPath:null,oldMode:null,newMode:null,deletedFileMode:null,newFileMode:null,renameFrom:null,renameTo:null,beforeHash:null,afterHash:null,fromPath:null,toPath:null,hunks:null}),Zvt=e=>({header:Jvt(e),parts:[]}),$vt={"@":"header","-":"deletion","+":"insertion"," ":"context","\\":"pragma",undefined:"context"};function eSt(e){leLine truncated
`)+(a.hunk.parts[0].noNewlineAtEndOfFile?"":`
`):"";await t.mkdirpPromise(K.dirname(a.path),{chmod:493,utimes:[pi.SAFE_TIME,pi.SAFE_TIME]}),await t.writeFilePromise(a.path,n,{mode:a.mode}),await t.utimesPromise(a.path,pi.SAFE_TIME,pi.SAFE_TIME)}break;case"patch":await N1(t,a.path,async()=>{await sSt(a,{baseFs:t,dryRun:r})});break;case"mode change":{let c=(await t.statPromise(a.path)).mode;if(GDe(a.newMode)!==GDe(c))continue;await N1(t,a.path,async()=>{await t.chmodPromise(a.path,a.newMode)})}break;default:qe.assertNever(a);break}}function GDe(e){return(e&64)>0}function qDe(e){return e.replace(/\s+$/,"")}function iSt(e,t){return qDe(e)===qDe(t)}async function sSt({hunks:e,path:t},{baseFs:r,dryRun:s=!1}){let a=await r.statSync(t).mode,c=(await r.readFileSync(t,"utf8")).split(/\n/),f=[],p=0,h=0;for(let C of e){let S=Math.max(h,C.header.patched.start+p),x=Math.max(0,S-h),I=Math.max(0,c.length-S-C.header.original.length),T=Math.max(x,I),O=0,U=0,V=null;for(;O<=T;){if(O<=x&&(U=S-O,V=YDe(C,c,U),V!==null)){O=-O;break}if(O<=I&&(U=S+O,V=YDe(C,c,U),V!==null))break;O+=1}if(V===null)throw new F1(e.indexOf(C),C);f.push(V),p+=O,h=U+C.header.original.length}if(s)return;let E=0;for(let C of f)for(let S of C)switch(S.type){case"splice":{let x=S.index+E;c.splice(x,S.numToDelete,...S.linesToInsert),E+=S.linesToInsert.length-S.numToDelete}break;case"pop":c.pop();break;case"push":c.push(S.line);break;default:qe.assertNever(S);break}await r.writeFilePromise(t,c.join(`
`),{mode:a})}function YDe(e,t,r){let s=[];for(let a of e.parts)switch(a.type){case"context":case"deletion":{for(let n of a.lines){let c=t[r];if(c==null||!iSt(c,n))return null;r+=1}a.type==="deletion"&&(s.push({type:"splice",index:r-a.lines.length,numToDelete:a.lines.length,linesToInsert:[]}),a.noNewlineAtEndOfFile&&s.push({type:"push",line:""}))}break;case"insertion":s.push({type:"splice",index:r,numToDelete:0,linesToInsert:a.lines}),a.noNewlineAtEndOfFile&&s.push({type:"pop"});break;default:qe.assertNever(a.type);break}return s}var aSt=/^builtin<([^>]+)>$/;function O1(e,t){let{protocol:r,source:s,selector:a,params:n}=j.parseRange(e);if(r!=="patch:")throw new Error("Invalid patch range");if(s===null)throw new Error("Patch locators must explicitly define their source");let c=a?a.split(/&/).map(E=>Ae.toPortablePath(E)):[],f=n&&typeof n.locator=="string"?j.parseLocator(n.locator):null,p=n&&typeof n.version=="string"?n.version:null,h=t(s);return{parentLocator:f,sourceItem:h,patchPaths:c,sourceVersion:p}}function wL(e){return e.range.startsWith("patch:")}function Fd(e){return e.reference.startsWith("patch:")}function nP(e){let{sourceItem:t,...r}=O1(e.range,j.parseDescriptor);return{...r,sourceDescriptor:t}}function iP(e){let{sourceItem:t,...r}=O1(e.reference,j.parseLocator);return{...r,sourceLocator:t}}function lSt(e){let{sourceItem:t}=O1(e.range,j.parseDescriptor);return t}function cSt(e){let{sourceItem:t}=O1(e.reference,j.parseLocator);return t}function gJ(e){if(!wL(e))return e;let{sourceItem:t}=O1(e.range,j.parseDescriptor);return t}function BL(e){if(!Fd(e))return e;let{sourceItem:t}=O1(e.reference,j.parseLocator);return t}function WDe({parentLocator:e,sourceItem:t,patchPaths:r,sourceVersion:s,patchHash:a},n){let c=e!==null?{locator:j.stringifyLocator(e)}:{},f=typeof s<"u"?{version:s}:{},p=typeof a<"u"?{hash:a}:{};return j.makeRange({protocol:"patch:",source:n(t),selector:r.join("&"),params:{...f,...p,...c}})}function vL(e,{parentLocator:t,sourceDescriptor:r,patchPaths:s}){return j.makeDescriptor(e,WDe({parentLocator:t,sourceItem:r,patchPaths:s},j.stringifyDescriptor))}function mJ(e,{parentLocator:t,sourcePackage:r,patchPaths:s,patchHash:a}){return j.makeLocator(e,WDe({parentLocator:t,sourceItem:r,sourceVersion:r.version,patchPaths:s,patchHash:a},j.stringifyLocator))}function VDe({onAbsolute:e,onRelative:t,onProject:r,onBuiltin:s},a){let n=a.lastIndexOf("!");n!==-1&&(a=a.slice(n+1));let c=a.match(aSt);return c!==null?s(c[1]):a.startsWith("~/")?r(a.slice(2)):K.isAbsolute(a)?e(a):t(a)}function KDe(e){let t=e.lastIndexOf("!");return{optional:(t!==-1?new Set(e.slice(0,t).split(/!/)):new Set).has("optional")}}function yJ(e){return VDe({onAbsolute:()=>!1,onRelative:()=>!0,onProject:()=>!1,onBuiltin:()=>!1},e)}async function sP(e,t,r){let s=e!==null?await r.fetcher.fetch(e,r):null,a=s&&s.localPath?{packageFs:new Pn(vt.root),prefixPath:K.relative(vt.root,s.localPath)}:s;s&&s!==a&&s.releaseFs&&s.releaseFs();let n=await qe.releaseAfterUseAsync(async()=>await Promise.all(t.map(async c=>{let f=KDe(c),p=await VDe({onAbsolute:async h=>await le.readFilePromise(h,"utf8"),onRelative:async h=>{if(a===null)throw new Error("Assertion failed: The parent locator should have been fetched");return await a.packageFs.readFilePromise(K.join(a.prefixPath,h),"utf8")},onProject:async h=>await le.readFilePromise(K.join(r.project.cwd,h),"utf8"),onBuiltin:async h=>await r.project.configuration.firstHook(E=>E.getBuiltinPatch,r.project,h)},c);return{...f,source:p}})));for(let c of n)typeof c.source=="string"&&(c.source=c.source.replace(/\r\n?/g,`
`));return n}async function EJ(e,{cache:t,project:r}){let s=r.storedPackages.get(e.locatorHash);if(typeof s>"u")throw new Error("Assertion failed: Expected the package to be registered");let a=BL(e),n=r.storedChecksums,c=new Qi,f=await le.mktempPromise(),p=K.join(f,"source"),h=K.join(f,"user"),E=K.join(f,".yarn-patch.json"),C=r.configuration.makeFetcher(),S=[];try{let x,I;if(e.locatorHash===a.locatorHash){let T=await C.fetch(e,{cache:t,project:r,fetcher:C,checksums:n,report:c});S.push(()=>T.releaseFs?.()),x=T,I=T}else x=await C.fetch(e,{cache:t,project:r,fetcher:C,checksums:n,report:c}),S.push(()=>x.releaseFs?.()),I=await C.fetch(e,{cache:t,project:r,fetcher:C,checksums:n,report:c}),S.push(()=>I.releaseFs?.());await Promise.all([le.copyPromise(p,x.prefixPath,{baseFs:x.packageFs}),le.copyPromise(h,I.prefixPath,{baseFs:I.packageFs}),le.writeJsonPromise(E,{locator:j.stringifyLocator(e),version:s.version})])}finally{for(let x of S)x()}return le.detachTemp(f),h}async function IJ(e,t){let r=Ae.fromPortablePath(e).replace(/\\/g,"/"),s=Ae.fromPortablePath(t).replace(/\\/g,"/"),{stdout:a,stderr:n}=await Yr.execvp("git",["-c","core.safecrlf=false","-c","core.quotePath=false","diff","--src-prefix=a/","--dst-prefix=b/","--ignore-cr-at-eol","--full-index","--no-index","--no-renames","--text",r,s],{cwd:Ae.toPortablePath(process.cwd()),env:{...process.env,GIT_CONFIG_NOSYSTEM:"1",HOME:"",XDG_CONFIG_HOME:"",USERPROFILE:""}});if(n.length>0)throw new Error(`Unable to diff directories. Make sure you have a recent version of 'git' available in PATH.
The following error was reported by 'git':
${n}`);let c=r.startsWith("/")?f=>f.slice(1):f=>f;return a.replace(new RegExp(`(a|b)(${qe.escapeRegExp(`/${c(r)}/`)})`,"g"),"$1/").replace(new RegExp(`(a|b)${qe.escapeRegExp(`/${c(s)}/`)}`,"g"),"$1/").replace(new RegExp(qe.escapeRegExp(`${r}/`),"g"),"").replace(new RegExp(qe.escapeRegExp(`${s}/`),"g"),"")}function CJ(e,t){let r=[];for(let{source:s}of e){if(s===null)continue;let a=rP(s);for(let n of a){let{semverExclusivity:c,...f}=n;c!==null&&t!==null&&!kr.satisfiesWithPrereleases(t,c)||r.push(JSON.stringify(f))}}return Mn.makeHash(`${3}`,...r).slice(0,6)}Ge();function JDe(e,{configuration:t,report:r}){for(let s of e.parts)for(let a of s.lines)switch(s.type){case"context":r.reportInfo(null,` ${ce.pretty(t,a,"grey")}`);break;case"deletion":r.reportError(28,`- ${ce.pretty(t,a,ce.Type.REMOVED)}`);break;case"insertion":r.reportError(28,`+ ${ce.pretty(t,a,ce.Type.ADDED)}`);break;default:qe.assertNever(s.type)}}var oP=class{supports(t,r){return!!Fd(t)}getLocalPath(t,r){return null}async fetch(t,r){let s=r.checksums.get(t.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(t,s,{onHit:()=>r.report.reportCacheHit(t),onMiss:()=>r.report.reportCacheMiss(t,`${j.prettyLocator(r.project.configuration,t)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.patchPackage(t,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:j.getIdentVendorPath(t),localPath:this.getLocalPath(t,r),checksum:c}}async patchPackage(t,r){let{parentLocator:s,sourceLocator:a,sourceVersion:n,patchPaths:c}=iP(t),f=await sP(s,c,r),p=await le.mktempPromise(),h=K.join(p,"current.zip"),E=await r.fetcher.fetch(a,r),C=j.getIdentVendorPath(t),S=new hs(h,{create:!0,level:r.project.configuration.get("compressionLevel")});await qe.releaseAfterUseAsync(async()=>{await S.copyPromise(C,E.prefixPath,{baseFs:E.packageFs,stableSort:!0})},E.releaseFs),S.saveAndClose();for(let{source:x,optional:I}of f){if(x===null)continue;let T=new hs(h,{level:r.project.configuration.get("compressionLevel")}),O=new Pn(K.resolve(vt.root,C),{baseFs:T});try{await CL(rP(x),{baseFs:O,version:n})}catch(U){if(!(U instanceof F1))throw U;let V=r.project.configuration.get("enableInlineHunks"),$=!V&&!I?" (set enableInlineHunks for details)":"",ie=`${j.prettyLocator(r.project.configuration,t)}: ${U.message}${$}`,fe=ae=>{V&&JDe(U.hunk,{configuration:r.project.configuration,report:ae})};if(T.discardAndClose(),I){r.report.reportWarningOnce(66,ie,{reportExtra:fe});continue}else throw new Lt(66,ie,fe)}T.saveAndClose()}return new hs(h,{level:r.project.configuration.get("compressionLevel")})}};Ge();var aP=class{supportsDescriptor(t,r){return!!wL(t)}supportsLocator(t,r){return!!Fd(t)}shouldPersistResolution(t,r){return!1}bindDescriptor(t,r,s){let{patchPaths:a}=nP(t);return a.every(n=>!yJ(n))?t:j.bindDescriptor(t,{locator:j.stringifyLocator(r)})}getResolutionDependencies(t,r){let{sourceDescriptor:s}=nP(t);return{sourceDescriptor:r.project.configuration.normalizeDependency(s)}}async getCandidates(t,r,s){if(!s.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let{parentLocator:a,patchPaths:n}=nP(t),c=await sP(a,n,s.fetchOptions),f=r.sourceDescriptor;if(typeof f>"u")throw new Error("Assertion failed: The dependency should have been resolved");let p=CJ(c,f.version);return[mJ(t,{parentLocator:a,sourcePackage:f,patchPaths:n,patchHash:p})]}async getSatisfying(t,r,s,a){let[n]=await this.getCandidates(t,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(t,r){let{sourceLocator:s}=iP(t);return{...await r.resolver.resolve(s,r),...t}}};Ge();bt();jt();var L1=class extends ft{constructor(){super(...arguments);this.save=pe.Boolean("-s,--save",!1,{description:"Add the patch to your resolution entries"});this.patchFolder=pe.String()}static{this.paths=[["patch-commit"]]}static{this.usage=it.Usage({description:"generate a patch out of a directory",details:"\n By default, this will print a patchfile on stdout based on the diff between the folder passed in and the original version of the package. Such file is suitable for consumption with the `patch:` protocol.\n\n With the `-s,--save` option set, the patchfile won't be printed on stdout anymore and will instead be stored within a local file (by default kept within `.yarn/patches`, but configurable via the `patchFolder` setting). A `resolutions` entry will also be added to your top-level manifest, referencing the patched package via the `patch:` protocol.\n\n Note that only folders generated by `yarn patch` are accepted as valid input for `yarn patch-commit`.\n "})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let n=K.resolve(this.context.cwd,Ae.toPortablePath(this.patchFolder)),c=K.join(n,"../source"),f=K.join(n,"../.yarn-patch.json");if(!le.existsSynLine truncated
${f.map(p=>`
- ${j.prettyLocator(r,p)}`).join("")}`);c=f[0]}if(!s.storedPackages.has(c.locatorHash))throw new st("No package found in the project for the given locator");await Ft.start({configuration:r,json:this.json,stdout:this.context.stdout},async f=>{let p=BL(c),h=await EJ(c,{cache:n,project:s});f.reportJson({locator:j.stringifyLocator(p),path:Ae.fromPortablePath(h)});let E=this.update?" along with its current modifications":"";f.reportInfo(0,`Package ${j.prettyLocator(r,p)} got extracted with success${E}!`),f.reportInfo(0,`You can now edit the following folder: ${ce.pretty(r,Ae.fromPortablePath(h),"magenta")}`),f.reportInfo(0,`Once you are done run ${ce.pretty(r,`yarn patch-commit -s ${process.platform==="win32"?'"':""}${Ae.fromPortablePath(h)}${process.platform==="win32"?'"':""}`,"cyan")} and Yarn will store a patchfile based on your changes.`)})}};var uSt={configuration:{enableInlineHunks:{description:"If true, the installs will print unmatched patch hunks",type:"BOOLEAN",default:!1},patchFolder:{description:"Folder where the patch files must be written",type:"ABSOLUTE_PATH",default:"./.yarn/patches"}},commands:[L1,M1],fetchers:[oP],resolvers:[aP]},fSt=uSt;var SJ={};Vt(SJ,{PnpmLinker:()=>lP,default:()=>mSt});Ge();bt();jt();var lP=class{getCustomDataKey(){return JSON.stringify({name:"PnpmLinker",version:3})}supportsPackage(t,r){return this.isEnabled(r)}async findPackageLocation(t,r){if(!this.isEnabled(r))throw new Error("Assertion failed: Expected the pnpm linker to be enabled");let s=this.getCustomDataKey(),a=r.project.linkersCustomData.get(s);if(!a)throw new st(`The project in ${ce.pretty(r.project.configuration,`${r.project.cwd}/package.json`,ce.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let n=a.pathsByLocator.get(t.locatorHash);if(typeof n>"u")throw new st(`Couldn't find ${j.prettyLocator(r.project.configuration,t)} in the currently installed pnpm map - running an install might help`);return n.packageLocation}async findPackageLocator(t,r){if(!this.isEnabled(r))return null;let s=this.getCustomDataKey(),a=r.project.linkersCustomData.get(s);if(!a)throw new st(`The project in ${ce.pretty(r.project.configuration,`${r.project.cwd}/package.json`,ce.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let n=t.match(/(^.*\/node_modules\/(@[^/]*\/)?[^/]+)(\/.*$)/);if(n){let p=a.locatorByPath.get(n[1]);if(p)return p}let c=t,f=t;do{f=c,c=K.dirname(f);let p=a.locatorByPath.get(f);if(p)return p}while(c!==f);return null}makeInstaller(t){return new BJ(t)}isEnabled(t){return t.project.configuration.get("nodeLinker")==="pnpm"}},BJ=class{constructor(t){this.opts=t;this.customData={pathsByLocator:new Map,locatorByPath:new Map};this.asyncActions=new qe.AsyncActions(t.project.configuration.get("pnpmInstallConcurrency")),this.indexFolderPromise=nx(le,{indexPath:K.join(t.project.configuration.get("globalFolder"),"index")})}attachCustomData(t){}async installPackage(t,r,s){switch(t.linkType){case"SOFT":return this.installPackageSoft(t,r,s);case"HARD":return this.installPackageHard(t,r,s)}throw new Error("Assertion failed: Unsupported package link type")}async installPackageSoft(t,r,s){let a=K.resolve(r.packageFs.getRealPath(),r.prefixPath),n=this.opts.project.tryWorkspaceByLocator(t)?K.join(a,Ir.nodeModules):null;return this.customData.pathsByLocator.set(t.locatorHash,{packageLocation:a,dependenciesLocation:n}),{packageLocation:a,buildRequest:null}}async installPackageHard(t,r,s){let a=pSt(t,{project:this.opts.project}),n=a.packageLocation;this.customData.locatorByPath.set(n,j.stringifyLocator(t)),this.customData.pathsByLocator.set(t.locatorHash,a),s.holdFetchResult(this.asyncActions.set(t.locatorHash,async()=>{await le.mkdirPromise(n,{recursive:!0}),await le.copyPromise(n,r.prefixPath,{baseFs:r.packageFs,overwrite:!1,linkStrategy:{type:"HardlinkFromIndex",indexPath:await this.indexFolderPromise,autoRepair:!0}})}));let f=j.isVirtualLocator(t)?j.devirtualizeLocator(t):t,p={manifest:await _t.tryFind(r.prefixPath,{baseFs:r.packageFs})??new _t,misc:{hasBindingGyp:yA.hasBindingGyp(r)}},h=this.opts.project.getDependencyMeta(f,t.version),E=yA.extractBuildRequest(t,p,h,{configuration:this.opts.project.configuration});return{packageLocation:n,buildRequest:E}}async attachInternalDependencies(t,r){if(this.opts.project.configuration.get("nodeLinker")!=="pnpm"||!zDe(t,{project:this.opts.project}))return;let s=this.customData.pathsByLocator.get(t.locatorHash);if(typeof s>"u")throw new Error(`Assertion failed: Expected the package to have been registered (${j.stringifyLocator(t)})`);let{dependenciesLocation:a}=s;a&&this.asyncActions.reduce(t.locatorHash,async n=>{await le.mkdirPromise(a,{recursive:!0});let c=await hSt(a),f=new Map(c),p=[n],h=(C,S)=>{let x=S;zDe(S,{project:this.opts.project})||(this.opts.report.reportWarningOnce(0,"The pnpm linker doesn't support providing different versions to workspaces' peer dependencies"),x=j.devirtualizeLocator(S));let I=this.customDLine truncated
${ESt}
`,"--",...s],{cwd:e,strict:!0})},async makeReset(e,t){let r=t.map(s=>Ae.fromPortablePath(s.path));await Yr.execvp("git",["reset","HEAD","--",...r],{cwd:e,strict:!0})}};var vSt=[ePe],U1=class extends ft{constructor(){super(...arguments);this.commit=pe.Boolean("-c,--commit",!1,{description:"Commit the staged files"});this.reset=pe.Boolean("-r,--reset",!1,{description:"Remove all files from the staging area"});this.dryRun=pe.Boolean("-n,--dry-run",!1,{description:"Print the commit message and the list of modified files without staging / committing"});this.update=pe.Boolean("-u,--update",!1,{hidden:!0})}static{this.paths=[["stage"]]}static{this.usage=it.Usage({description:"add all yarn files to your vcs",details:"\n This command will add to your staging area the files belonging to Yarn (typically any modified `package.json` and `.yarnrc.yml` files, but also linker-generated files, cache data, etc). It will take your ignore list into account, so the cache files won't be added if the cache is ignored in a `.gitignore` file (assuming you use Git).\n\n Running `--reset` will instead remove them from the staging area (the changes will still be there, but won't be committed until you stage them back).\n\n Since the staging area is a non-existent concept in Mercurial, Yarn will always create a new commit when running this command on Mercurial repositories. You can get this behavior when using Git by using the `--commit` flag which will directly create a commit.\n ",examples:[["Adds all modified project files to the staging area","yarn stage"],["Creates a new commit containing all modified project files","yarn stage --commit"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s}=await Rt.find(r,this.context.cwd),{driver:a,root:n}=await SSt(s.cwd),c=[r.get("cacheFolder"),r.get("globalFolder"),r.get("virtualFolder"),r.get("yarnPath")];await r.triggerHook(C=>C.populateYarnPaths,s,C=>{c.push(C)});let f=new Set;for(let C of c)for(let S of bSt(n,C))f.add(S);let p=new Set([r.get("rcFilename"),Ir.lockfile,Ir.manifest]),h=await a.filterChanges(n,f,p),E=await a.genCommitMessage(n,h);if(this.dryRun)if(this.commit)this.context.stdout.write(`${E}
`);else for(let C of h)this.context.stdout.write(`${Ae.fromPortablePath(C.path)}
`);else if(this.reset){let C=await a.filterChanges(n,f,p,{staged:!0});C.length===0?this.context.stdout.write("No staged changes found!"):await a.makeReset(n,C)}else h.length===0?this.context.stdout.write("No changes found!"):this.commit?await a.makeCommit(n,h,E):(await a.makeStage(n,h),this.context.stdout.write(E))}};async function SSt(e){let t=null,r=null;for(let s of vSt)if((r=await s.findRoot(e))!==null){t=s;break}if(t===null||r===null)throw new st("No stage driver has been found for your current project");return{driver:t,root:r}}function bSt(e,t){let r=[];if(t===null)return r;for(;;){(t===e||t.startsWith(`${e}/`))&&r.push(t);let s;try{s=le.statSync(t)}catch{break}if(s.isSymbolicLink())t=K.resolve(K.dirname(t),le.readlinkSync(t));else break}return r}var DSt={commands:[U1]},PSt=DSt;var TJ={};Vt(TJ,{default:()=>OSt});Ge();Ge();bt();var nPe=et(hi());Ge();var tPe=et(M9()),xSt="e8e1bd300d860104bb8c58453ffa1eb4",kSt="OFCNCOG2CU",rPe=async(e,t)=>{let r=j.stringifyIdent(e),a=QSt(t).initIndex("npm-search");try{return(await a.getObject(r,{attributesToRetrieve:["types"]})).types?.ts==="definitely-typed"}catch{return!1}},QSt=e=>(0,tPe.default)(kSt,xSt,{requester:{async send(r){try{let s=await nn.request(r.url,r.data||null,{configuration:e,headers:r.headers});return{content:s.body,isTimedOut:!1,status:s.statusCode}}catch(s){return{content:s.response.body,isTimedOut:!1,status:s.response.statusCode}}}}});var iPe=e=>e.scope?`${e.scope}__${e.name}`:`${e.name}`,RSt=async(e,t,r,s)=>{if(r.scope==="types")return;let{project:a}=e,{configuration:n}=a;if(!(n.get("tsEnableAutoTypes")??(le.existsSync(K.join(e.cwd,"tsconfig.json"))||le.existsSync(K.join(a.cwd,"tsconfig.json")))))return;let f=n.makeResolver(),p={project:a,resolver:f,report:new Qi};if(!await rPe(r,n))return;let E=iPe(r),C=j.parseRange(r.range).selector;if(!kr.validRange(C)){let O=n.normalizeDependency(r),U=await f.getCandidates(O,{},p);C=j.parseRange(U[0].reference).selector}let S=nPe.default.coerce(C);if(S===null)return;let x=`${ef.Modifier.CARET}${S.major}`,I=j.makeDescriptor(j.makeIdent("types",E),x),T=qe.mapAndFind(a.workspaces,O=>{let U=O.manifest.dependencies.get(r.identHash)?.descriptorHash,V=O.manifest.devDependencies.get(r.identHash)?.descriptorHash;if(U!==r.descriptorHash&&V!==r.descriptorHash)return qe.mapAndFind.skip;let $=[];for(let ie of _t.allDependencies){let fe=O.manifest[ie].get(I.identHash);typeof fe>"u"||$.push([ie,fe])}return $.length===0?qe.mapAndFind.skip:$});if(typeof T<"u")for(let[O,U]of T)e.manifest[O].set(U.identHash,U);else{try{let O=n.normalizeDependency(I);if((await f.getCandidates(O,{},p)).length===0)return}catch{return}e.manifest[ef.Target.DEVELOPMENT].set(I.identHash,I)}},TSt=async(e,t,r)=>{if(r.scope==="types")return;let{project:s}=e,{configuration:a}=s;if(!(a.get("tsEnableAutoTypes")??(le.existsSync(K.join(e.cwd,"tsconfig.json"))||le.existsSync(K.join(s.cwd,"tsconfig.json")))))return;let c=iPe(r),f=j.makeIdent("types",c);for(let p of _t.allDependencies)typeof e.manifest[p].get(f.identHash)>"u"||e.manifest[p].delete(f.identHash)},FSt=(e,t)=>{t.publishConfig&&t.publishConfig.typings&&(t.typings=t.publishConfig.typings),t.publishConfig&&t.publishConfig.types&&(t.types=t.publishConfig.types)},NSt={configuration:{tsEnableAutoTypes:{description:"Whether Yarn should auto-install @types/ dependencies on 'yarn add'",type:"BOOLEAN",isNullable:!0,default:null}},hooks:{afterWorkspaceDependencyAddition:RSt,afterWorkspaceDependencyRemoval:TSt,beforeWorkspacePacking:FSt}},OSt=NSt;var MJ={};Vt(MJ,{VersionApplyCommand:()=>G1,VersionCheckCommand:()=>q1,VersionCommand:()=>Y1,default:()=>HSt,versionUtils:()=>j1});Ge();Ge();jt();var j1={};Vt(j1,{Decision:()=>_1,applyPrerelease:()=>sPe,applyReleases:()=>LJ,applyStrategy:()=>cP,clearVersionFiles:()=>FJ,getUndecidedDependentWorkspaces:()=>fP,getUndecidedWorkspaces:()=>DL,openVersionFile:()=>H1,requireMoreDecisions:()=>MSt,resolveVersionFiles:()=>uP,suggestStrategy:()=>OJ,updateVersionFiles:()=>NJ,validateReleaseDecision:()=>wy});Ge();bt();Sc();jt();Xl();var TA=et(hi()),LSt=/^(>=|[~^]|)(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?$/,_1=(h=>(h.UNDECIDED="undecided",h.DECLINE="decline",h.MAJOR="major",h.MINOR="minor",h.PATCH="patch",h.PREMAJOR="premajor",h.PREMINOR="preminor",h.PREPATCH="prepatch",h.PRERELEASE="prerelease",h))(_1||{});function wy(e){let t=TA.default.valid(e);return t||qe.validateEnum(v4(_1,"UNDECIDED"),e)}async function uP(e,{prerelease:t=null}={}){let r=new Map,s=e.configuration.get("deferredVersionFolder");if(!le.existsSync(s))return r;let a=await le.readdirPromise(s);for(let n of a){if(!n.endsWith(".yml"))continue;let c=K.join(s,n),f=await le.readFilePromise(c,"utf8"),p=us(f);for(let[h,E]of Object.entries(p.releases||{})){if(E==="decline")continue;let C=j.parseIdent(h),S=e.tryWorkspaceByIdent(C);if(S===null)throw new Error(`Assertion failed: Expected a release definition fiLine truncated
- ${f.map(x=>Ae.fromPortablePath(x)).join(`
- `)}`);let p=new Set(qe.mapAndFilter(n,x=>{let I=e.tryWorkspaceByFilePath(x);return I===null?qe.mapAndFilter.skip:I}));if(f.length===0&&p.size===0&&!t)return null;let h=f.length===1?f[0]:K.join(c,`${Mn.makeHash(Math.random().toString()).slice(0,8)}.yml`),E=le.existsSync(h)?await le.readFilePromise(h,"utf8"):"{}",C=us(E),S=new Map;for(let x of C.declined||[]){let I=j.parseIdent(x),T=e.getWorkspaceByIdent(I);S.set(T,"decline")}for(let[x,I]of Object.entries(C.releases||{})){let T=j.parseIdent(x),O=e.getWorkspaceByIdent(T);S.set(O,wy(I))}return{project:e,root:s,baseHash:a!==null?a.hash:null,baseTitle:a!==null?a.title:null,changedFiles:new Set(n),changedWorkspaces:p,releaseRoots:new Set([...p].filter(x=>x.manifest.version!==null)),releases:S,async saveAll(){let x={},I=[],T=[];for(let O of e.workspaces){if(O.manifest.version===null)continue;let U=j.stringifyIdent(O.anchoredLocator),V=S.get(O);V==="decline"?I.push(U):typeof V<"u"?x[U]=wy(V):p.has(O)&&T.push(U)}await le.mkdirPromise(K.dirname(h),{recursive:!0}),await le.changeFilePromise(h,Al(new Al.PreserveOrdering({releases:Object.keys(x).length>0?x:void 0,declined:I.length>0?I:void 0,undecided:T.length>0?T:void 0})))}}}function MSt(e){return DL(e).size>0||fP(e).length>0}function DL(e){let t=new Set;for(let r of e.changedWorkspaces)r.manifest.version!==null&&(e.releases.has(r)||t.add(r));return t}function fP(e,{include:t=new Set}={}){let r=[],s=new Map(qe.mapAndFilter([...e.releases],([n,c])=>c==="decline"?qe.mapAndFilter.skip:[n.anchoredLocator.locatorHash,n])),a=new Map(qe.mapAndFilter([...e.releases],([n,c])=>c!=="decline"?qe.mapAndFilter.skip:[n.anchoredLocator.locatorHash,n]));for(let n of e.project.workspaces)if(!(!t.has(n)&&(a.has(n.anchoredLocator.locatorHash)||s.has(n.anchoredLocator.locatorHash)))&&n.manifest.version!==null)for(let c of _t.hardDependencies)for(let f of n.manifest.getForScope(c).values()){let p=e.project.tryWorkspaceByDescriptor(f);p!==null&&s.has(p.anchoredLocator.locatorHash)&&r.push([n,p])}return r}function OJ(e,t){let r=TA.default.clean(t);for(let s of Object.values(_1))if(s!=="undecided"&&s!=="decline"&&TA.default.inc(e,s)===r)return s;return null}function cP(e,t){if(TA.default.valid(t))return t;if(e===null)throw new st(`Cannot apply the release strategy "${t}" unless the workspace already has a valid version`);if(!TA.default.valid(e))throw new st(`Cannot apply the release strategy "${t}" on a non-semver version (${e})`);let r=TA.default.inc(e,t);if(r===null)throw new st(`Cannot apply the release strategy "${t}" on the specified version (${e})`);return r}function LJ(e,t,{report:r,exact:s}){let a=new Map;for(let n of e.workspaces)for(let c of _t.allDependencies)for(let f of n.manifest[c].values()){let p=e.tryWorkspaceByDescriptor(f);if(p===null||!t.has(p))continue;qe.getArrayWithDefault(a,p).push([n,c,f.identHash])}for(let[n,c]of t){let f=n.manifest.version;n.manifest.version=c,TA.default.prerelease(c)===null?delete n.manifest.raw.stableVersion:n.manifest.raw.stableVersion||(n.manifest.raw.stableVersion=f);let p=n.manifest.name!==null?j.stringifyIdent(n.manifest.name):null;r.reportInfo(0,`${j.prettyLocator(e.configuration,n.anchoredLocator)}: Bumped to ${c}`),r.reportJson({cwd:Ae.fromPortablePath(n.cwd),ident:p,oldVersion:f,newVersion:c});let h=a.get(n);if(!(typeof h>"u"))for(let[E,C,S]of h){let x=E.manifest[C].get(S);if(typeof x>"u")throw new Error("Assertion failed: The dependency should have existed");let I=x.range,T=!1;if(I.startsWith(Ii.protocol)&&(I=I.slice(Ii.protocol.length),T=!0,I===n.relativeCwd))continue;let O=I.match(LSt);if(!O){r.reportWarning(0,`Couldn't auto-upgrade range ${I} (in ${j.prettyLocator(e.configuration,E.anchoredLocator)})`);continue}let U=s?`${c}`:`${O[1]}${c}`;T&&(U=`${Ii.protocol}${U}`);let V=j.makeDescriptor(x,U);E.manifest[C].set(S,V)}}}var USt=new Map([["%n",{extract:e=>e.length>=1?[e[0],e.slice(1)]:null,generate:(e=0)=>`${e+1}`}]]);function sPe(e,{current:t,prerelease:r}){let s=new TA.default.SemVer(t),a=s.prerelease.slice(),n=[];s.prerelease=[],s.format()!==e&&(a.length=0);let c=!0,f=r.split(/\./g);for(let p of f){let h=USt.get(p);if(typeof h>"u")n.push(p),a[0]===p?a.shift():c=!1;else{let E=c?h.extract(a):null;E!==null&&typeof E[0]=="number"?(n.push(h.generate(E[0])),a=E[1]):(n.push(h.generate()),c=!1)}}return s.prerelease&&(s.prerelease=[]),`${e}-${n.join(".")}`}var G1=class extends ft{constructor(){super(...arguments);this.all=pe.Boolean("--all",!1,{description:"Apply the deferred version changes on all workspaces"});this.dryRun=pe.Boolean("--dry-run",!1,{description:"Print the versions without actually generating the package archive"});this.prerelease=pe.String("--prerelease",{description:"Add a prerelease identifier to new versions",tolerateBoolean:!0});this.exact=pe.Boolean("--exact",!1,{description:"Use the exact version of each package, removes any range. Useful for nightly releases where the range might match another version."});this.recursive=pe.Boolean("-R,--recursive",{description:"ReleLine truncated
This command will apply the deferred version changes and remove their definitions from the repository.
Note that if \`--prerelease\` is set, the given prerelease identifier (by default \`rc.%n\`) will be used on all new versions and the version definitions will be kept as-is.
By default only the current workspace will be bumped, but you can configure this behavior by using one of:
- \`--recursive\` to also apply the version bump on its dependencies
- \`--all\` to apply the version bump on all packages in the repository
Note that this command will also update the \`workspace:\` references across all your local workspaces, thus ensuring that they keep referring to the same workspaces even after the version bump.
`,examples:[["Apply the version change to the local workspace","yarn version apply"],["Apply the version change to all the workspaces in the local workspace","yarn version apply --all"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Rt.find(r,this.context.cwd),n=await zr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState({restoreResolutions:!1});let c=await Ft.start({configuration:r,json:this.json,stdout:this.context.stdout},async f=>{let p=this.prerelease?typeof this.prerelease!="boolean"?this.prerelease:"rc.%n":null,h=await uP(s,{prerelease:p}),E=new Map;if(this.all)E=h;else{let C=this.recursive?a.getRecursiveWorkspaceDependencies():[a];for(let S of C){let x=h.get(S);typeof x<"u"&&E.set(S,x)}}if(E.size===0){let C=h.size>0?" Did you want to add --all?":"";f.reportWarning(0,`The current workspace doesn't seem to require a version bump.${C}`);return}LJ(s,E,{report:f,exact:this.exact}),this.dryRun||(p||(this.all?await FJ(s):await NJ(s,[...E.keys()])),f.reportSeparator())});return this.dryRun||c.hasErrors()?c.exitCode():await s.installWithNewReport({json:this.json,stdout:this.context.stdout},{cache:n})}};Ge();bt();jt();var PL=et(hi());var q1=class extends ft{constructor(){super(...arguments);this.interactive=pe.Boolean("-i,--interactive",{description:"Open an interactive interface used to set version bumps"})}static{this.paths=[["version","check"]]}static{this.usage=it.Usage({category:"Release-related commands",description:"check that all the relevant packages have been bumped",details:"\n **Warning:** This command currently requires Git.\n\n This command will check that all the packages covered by the files listed in argument have been properly bumped or declined to bump.\n\n In the case of a bump, the check will also cover transitive packages - meaning that should `Foo` be bumped, a package `Bar` depending on `Foo` will require a decision as to whether `Bar` will need to be bumped. This check doesn't cross packages that have declined to bump.\n\n In case no arguments are passed to the function, the list of modified files will be generated by comparing the HEAD against `master`.\n ",examples:[["Check whether the modified packages need a bump","yarn version check"]]})}async execute(){return this.interactive?await this.executeInteractive():await this.executeStandard()}async executeInteractive(){XC(this.context);let{Gem:r}=await Promise.resolve().then(()=>(RF(),oY)),{ScrollableItems:s}=await Promise.resolve().then(()=>(OF(),NF)),{FocusRequest:a}=await Promise.resolve().then(()=>(cY(),mwe)),{useListInput:n}=await Promise.resolve().then(()=>(FF(),ywe)),{renderForm:c}=await Promise.resolve().then(()=>(_F(),UF)),{Box:f,Text:p}=await Promise.resolve().then(()=>et(Yc())),{default:h,useCallback:E,useState:C}=await Promise.resolve().then(()=>et(dn())),S=await Je.find(this.context.cwd,this.context.plugins),{project:x,workspace:I}=await Rt.find(S,this.context.cwd);if(!I)throw new ar(x.cwd,this.context.cwd);await x.restoreInstallState();let T=await H1(x);if(T===null||T.releaseRoots.size===0)return 0;if(T.root===null)throw new st("This command can only be run on Git repositories");let O=()=>h.createElement(f,{flexDirection:"row",paddingBottom:1},h.createElement(f,{flexDirection:"column",width:60},h.createElement(f,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<up>"),"/",h.createElement(p,{bold:!0,color:"cyanBright"},"<down>")," to select workspaces.")),h.createElement(f,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<left>"),"/",h.createElement(p,{bold:!0,color:"cyanBright"},"<right>")," to select release strategies."))),h.createElement(f,{flexDirection:"column"},h.createElement(f,{marginLeft:1},h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<enter>")," to save.")),h.createElement(f,{marginLeft:1},h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<ctrl+c>")," to abort.")))),U=({workspace:ge,active:he,decision:Ce,setDecision:Ee})=>{let d=ge.manifest.raw.stableVersion??ge.manifest.version;if(d===null)throw new Error(`Assertion failed: The version should have been set (${j.prettyLocator(S,ge.anchoredLocator)})`);if(PL.default.prerelease(d)!==null)throw new Error(`Assertion failed: Prerelease identifiers shouldn't be found (${d})`);let Se=["undecided","decline","patch","minor","major"];n(Ce,Se,{active:he,minus:"left",plus:"right",set:Ee});let Be=Ce==="undecided"?h.createElement(p,{color:"yellow"},d):Ce==="decline"?h.createElement(p,{color:"green"},d):h.createElement(p,null,h.createElement(p,{color:"magenta"},d)," \u2192 ",h.createElement(p,{color:"green"},PL.default.valid(Ce)?Ce:PL.default.inc(d,Ce)));return h.createElement(f,{flexDirection:"column"},h.createElement(f,null,h.createElement(p,null,j.prettyLocator(S,ge.anchoredLocator)," - ",Be)),h.createElement(f,null,Se.map(meLine truncated
`)},p=()=>{let Ee=this.from.map(d=>V1.default.matcher(d));return s.workspaces.filter(d=>{let Se=j.stringifyIdent(d.anchoredLocator),Be=d.relativeCwd;return Ee.some(me=>me(Se)||me(Be))})},h=[];if(this.since?(f("Option --since is set; selecting the changed workspaces as root for workspace selection"),h=Array.from(await Ma.fetchChangedWorkspaces({ref:this.since,project:s}))):this.from?(f("Option --from is set; selecting the specified workspaces"),h=[...p()]):this.worktree?(f("Option --worktree is set; selecting the current workspace"),h=[a]):this.recursive?(f("Option --recursive is set; selecting the current workspace"),h=[a]):this.all&&(f("Option --all is set; selecting all workspaces"),h=[...s.workspaces]),this.dryRun&&!this.all){for(let Ee of h)f(`
- ${Ee.relativeCwd}
${j.prettyLocator(r,Ee.anchoredLocator)}`);h.length>0&&f("")}let E;if(this.recursive?this.since?(f("Option --recursive --since is set; recursively selecting all dependent workspaces"),E=new Set(h.map(Ee=>[...Ee.getRecursiveWorkspaceDependents()]).flat())):(f("Option --recursive is set; recursively selecting all transitive dependencies"),E=new Set(h.map(Ee=>[...Ee.getRecursiveWorkspaceDependencies()]).flat())):this.worktree?(f("Option --worktree is set; recursively selecting all nested workspaces"),E=new Set(h.map(Ee=>[...Ee.getRecursiveWorkspaceChildren()]).flat())):E=null,E!==null&&(h=[...new Set([...h,...E])],this.dryRun))for(let Ee of E)f(`
- ${Ee.relativeCwd}
${j.prettyLocator(r,Ee.anchoredLocator)}`);let C=[],S=!1;if(c?.includes(":")){for(let Ee of s.workspaces)if(Ee.manifest.scripts.has(c)&&(S=!S,S===!1))break}for(let Ee of h){if(c&&!Ee.manifest.scripts.has(c)&&!S&&!(await wn.getWorkspaceAccessibleBinaries(Ee)).has(c)){f(`Excluding ${Ee.relativeCwd} because it doesn't have a "${c}" script`);continue}if(!(c===r.env.npm_lifecycle_event&&Ee.cwd===a.cwd)){if(this.include.length>0&&!V1.default.isMatch(j.stringifyIdent(Ee.anchoredLocator),this.include)&&!V1.default.isMatch(Ee.relativeCwd,this.include)){f(`Excluding ${Ee.relativeCwd} because it doesn't match the --include filter`);continue}if(this.exclude.length>0&&(V1.default.isMatch(j.stringifyIdent(Ee.anchoredLocator),this.exclude)||V1.default.isMatch(Ee.relativeCwd,this.exclude))){f(`Excluding ${Ee.relativeCwd} because it matches the --exclude filter`);continue}if(this.publicOnly&&Ee.manifest.private===!0){f(`Excluding ${Ee.relativeCwd} because it's a private workspace and --no-private was set`);continue}C.push(Ee)}}if(C.sort((Ee,d)=>j.stringifyIdent(Ee.anchoredLocator).localeCompare(j.stringifyIdent(d.anchoredLocator))),this.dryRun)return 0;let x=this.verbose??(this.context.stdout.isTTY?1/0:0),I=x>0,T=x>1,O=this.parallel?this.jobs==="unlimited"?1/0:Number(this.jobs)||Math.ceil(Ui.availableParallelism()/2):1,U=O===1?!1:this.parallel,V=U?this.interlaced:!0,$=(0,aPe.default)(O),ie=new Map,fe=new Set,ae=0,ge=null,he=!1,Ce=await Ft.start({configuration:r,stdout:this.context.stdout,includePrefix:!1},async Ee=>{let d=async(Se,{commandIndex:Be})=>{if(he)return-1;!U&&T&&Be>1&&Ee.reportSeparator();let me=jSt(Se,{configuration:r,label:I,commandIndex:Be}),[ue,Z]=oPe(Ee,{prefix:me,interlaced:V}),[be,Qe]=oPe(Ee,{prefix:me,interlaced:V});try{T&&Ee.reportInfo(null,`${me?`${me} `:""}Process started`);let ot=Date.now(),_=await this.cli.run([this.commandName,...this.args],{cwd:Se.cwd,stdout:ue,stderr:be})||0;ue.end(),be.end(),await Z,await Qe;let tt=Date.now();if(T){let Ne=r.get("enableTimers")?`, completed in ${ce.pretty(r,tt-ot,ce.Type.DURATION)}`:"";Ee.reportInfo(null,`${me?`${me} `:""}Process exited (exit code ${_})${Ne}`)}return _===130&&(he=!0,ge=_),_}catch(ot){throw ue.end(),be.end(),await Z,await Qe,ot}};for(let Se of C)ie.set(Se.anchoredLocator.locatorHash,Se);for(;ie.size>0&&!Ee.hasErrors();){let Se=[];for(let[Z,be]of ie){if(fe.has(be.anchoredDescriptor.descriptorHash))continue;let Qe=!0;if(this.topological||this.topologicalDev){let ot=this.topologicalDev?new Map([...be.manifest.dependencies,...be.manifest.devDependencies]):be.manifest.dependencies;for(let _ of ot.values()){let tt=s.tryWorkspaceByDescriptor(_);if(Qe=tt===null||!ie.has(tt.anchoredLocator.locatorHash),!Qe)break}}if(Qe&&(fe.add(be.anchoredDescriptor.descriptorHash),Se.push($(async()=>{let ot=await d(be,{commandIndex:++ae});return ie.delete(Z),fe.delete(be.anchoredDescriptor.descriptorHash),{workspace:be,exitCode:ot}})),!U))break}if(Se.length===0){let Z=Array.from(ie.values()).map(be=>j.prettyLocator(r,be.anchoredLocator)).join(", ");Ee.reportError(3,`Dependency cycle detected (${Z})`);return}let Be=await Promise.all(Se);Be.forEach(({workspace:Z,exitCode:be})=>{be!==0&&Ee.reportError(0,`The command failed in workspace ${j.prettyLocator(r,Z.anchoredLocator)} with exit code ${be}`)});let ue=Be.map(Z=>Z.exitCode).find(Z=>Z!==0);(this.topological||this.topologicalDev)&&typeof ue<"u"&&Ee.reportError(0,"The command failed for workspaces that are depended upon by other workspaces; can't satisfy the dependency graph")}});return ge!==null?ge:Ce.exitCode()}};function oPe(e,{prefix:t,interlaced:r}){let s=e.createStreamReporter(t),a=new qe.DefaultStream;a.pipe(s,{end:!1}),a.on("finish",()=>{s.end()});let n=new Promise(f=>{s.on("finish",()=>{f(a.active)})});if(r)return[a,n];let c=new qe.BufferStream;return c.pipe(a,{end:!1}),c.on("finish",()=>{a.end()}),[c,n]}function jSt(e,{configuration:t,commandIndex:r,label:s}){if(!s)return null;let n=`[${j.stringifyIdent(e.anchoredLocator)}]:`,c=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],f=c[r%c.length];return ce.pretty(t,n,f)}var GSt={commands:[W1,K1]},qSt=GSt;var KI=()=>({modules:new Map([["@yarnpkg/cli",Vv],["@yarnpkg/core",Wv],["@yarnpkg/fslib",L2],["@yarnpkg/libzip",av],["@yarnpkg/parsers",Y2],["@yarnpkg/shell",pv],["clipanion",rB],["semver",YSt],["typanion",qs],["@yarnpkg/plugin-essentials",L5],["@yarnpkg/plugin-catalog",H5],["@yarnpkg/plugin-compat",W5],["@yarnpkg/plugin-constraints",c9],["@yarnpkg/plugin-dlx",u9],["@yarnpkg/plugin-exec",p9],["@yarnpkg/plugin-file",d9],["@yarnpkg/plugin-git",O5],["@yarnpkg/plugin-github",y9],["@yarnpkg/plugin-http",E9],["@yarnpkg/plugin-init",I9],["@yarnpkg/plugin-interactive-tools",mY],["@yarnpkg/plugin-jsr",EY],["@yarnpkg/plugin-link",IY],["@yarnpkg/plugin-nm",sW],["@yarnpkg/plugin-npm",sJ],["@yarnpkg/plugin-npm-cli",dJ],["@yarnpkg/plugin-pack",ZW],["@yarnpkg/plugin-patch",wJ],["@yarnpkg/plugin-pnp",WY],["@yarnpkg/plugin-pnpm",SJ],["@yarnpkg/plugin-stage",RJ],["@yarnpkg/plugin-tLine truncated
Please report this issue at https://github.com/yarnpkg/berry/issues.`)}process.once("beforeExit",n);try{process.exitCode=42,process.exitCode=await zSt(a,e,{selfPath:r,pluginConfiguration:s})}catch(c){ba.defaultContext.stdout.write(a.error(c)),process.exitCode=1}finally{process.off("beforeExit",n),await le.rmtempPromise()}}FT(process.argv.slice(2),{cwd:K.cwd(),selfPath:Ae.toPortablePath(Ae.resolve(process.argv[1])),pluginConfiguration:KI()});})();
/**
@license
Copyright (c) 2015, Rebecca Turner
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
/**
@license
Copyright Node.js contributors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
*/
/**
@license
The MIT License (MIT)
Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/**
@license
Copyright Joyent, Inc. and other Node contributors.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*! Bundled license information:
is-number/index.js:
(*!
* is-number <https://github.com/jonschlinkert/is-number>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Released under the MIT License.
*)
to-regex-range/index.js:
(*!
* to-regex-range <https://github.com/micromatch/to-regex-range>
*
* Copyright (c) 2015-present, Jon Schlinkert.
* Released under the MIT License.
*)
fill-range/index.js:
(*!
* fill-range <https://github.com/jonschlinkert/fill-range>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Licensed under the MIT License.
*)
is-extglob/index.js:
(*!
* is-extglob <https://github.com/jonschlinkert/is-extglob>
*
* Copyright (c) 2014-2016, Jon Schlinkert.
* Licensed under the MIT License.
*)
is-glob/index.js:
(*!
* is-glob <https://github.com/jonschlinkert/is-glob>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*)
queue-microtask/index.js:
(*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
run-parallel/index.js:
(*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
git-url-parse/lib/index.js:
(*!
* buildToken
* Builds OAuth token prefix (helper function)
*
* @name buildToken
* @function
* @param {GitUrl} obj The parsed Git url object.
* @return {String} token prefix
*)
object-assign/index.js:
(*
object-assign
(c) Sindre Sorhus
@license MIT
*)
react/cjs/react.production.min.js:
(** @license React v17.0.2
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
scheduler/cjs/scheduler.production.min.js:
(** @license React v0.20.2
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
react-reconciler/cjs/react-reconciler.production.min.js:
(** @license React v0.26.2
* react-reconciler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
is-windows/index.js:
(*!
* is-windows <https://github.com/jonschlinkert/is-windows>
*
* Copyright © 2015-2018, Jon Schlinkert.
* Released under the MIT License.
*)
*/
+16
View File
@@ -0,0 +1,16 @@
approvedGitRepositories:
- "**"
compressionLevel: mixed
defaultSemverRangePrefix: ""
enableGlobalCache: false
enableScripts: true
nodeLinker: node-modules
npmMinimalAgeGate: 3d
yarnPath: .yarn/releases/yarn-4.16.0.cjs
-65
View File
@@ -1,65 +0,0 @@
# Home Assistant Frontend Agent Guide
You are helping develop the Home Assistant frontend. This repository is a TypeScript application built from Lit-based Web Components for the Home Assistant web UI.
## Essential Commands
```bash
pnpm lint # ESLint + Prettier + TypeScript + Lit
pnpm format # Auto-fix ESLint + Prettier
pnpm lint:types # TypeScript compiler, run without file arguments
pnpm test # Vitest
pnpm dev # App dev server, supports --background/--status/--stop/--logs
pnpm dev:serve # Local serving dev server, supports -c core URL, -p port, and dev flags
```
Never run `tsc` or `pnpm lint:types` with file arguments. When `tsc` receives file arguments, it ignores `tsconfig.json` and can emit `.js` files into `src/`. Always run `pnpm lint:types` without arguments. For individual file type checking, rely on editor diagnostics.
## Architecture
- The frontend uses custom elements built with Lit and TypeScript strict mode.
- Components communicate with the backend through the Home Assistant WebSocket API.
- Use `ha-` for Home Assistant components, `hui-` for Lovelace UI components, and `dialog-` for dialogs.
- Prefer `ha-*` components and current Web Awesome wrappers. Avoid adding new legacy `mwc-*` usage.
- Leaf components should consume narrow Lit contexts instead of taking the broad `hass` object unless they are containers that own and provide `hass`.
## Development Standards
- Use strict TypeScript, proper interfaces, and `import type` for type-only imports.
- Avoid `any`; model data with existing Home Assistant types or narrow new types.
- Keep imports organized and remove unused imports.
- Do not use `console`; use existing logging or user-visible error patterns.
- Use `@state()` for internal Lit state and `@property()` for public API.
- Do not query or manipulate DOM manually when Lit decorators, component refs, or render state are appropriate.
- Scope styles to components, use theme custom properties, and keep layouts mobile-first and RTL-safe.
- All user-facing text must be localized through the translation system.
- Do not write tests just because you changed some code. Write a test when there is real logic that could break without anyone noticing, and explain what the test protects.
## Project Skills
Detailed guidance lives in `.agents/skills/<name>/SKILL.md`. Load every matching skill before detailed implementation or review. For reviews, load `ha-frontend-review` alongside all companions that apply to the changed code or behavior:
- `ha-frontend-contexts`: Lit contexts, `hass` migration, and rerender-sensitive state access.
- `ha-frontend-components`: dialogs, forms, alerts, shortcuts, tooltips, panels, and Lovelace cards.
- `ha-frontend-events`: event handler typing, custom event dispatch, and event-map declarations.
- `ha-frontend-types`: backend data contracts, optional schemas, shared types, assertions, and lifecycle types.
- `ha-frontend-lit`: reactive fields, DOM queries, lifecycle behavior, and render-derived state.
- `ha-frontend-styling`: theme variables, spacing tokens, responsive layout, RTL, and view transitions.
- `ha-frontend-testing`: lint, typecheck, Vitest, Playwright e2e dev servers, and benchmarks.
- `ha-frontend-user-facing-text`: localization, terminology, sentence case, and Home Assistant text style.
- `ha-frontend-review`: PR template use, existing review feedback, review checklist, recurring issues, and UI/UX evidence including gallery specifications.
- `ha-frontend-ux-readiness`: UI/UX routing that complements frontend review for new user experiences.
- `ha-frontend-gallery`: gallery pages, demos, sidebar structure, content, and verification.
- `ha-frontend-demo`: standalone demo structure, configurations, navigation, shared stubs, and verification.
## Pull Requests
When creating a pull request, use `.github/PULL_REQUEST_TEMPLATE.md` as the PR body. Preserve template sections, check only the appropriate type-of-change boxes, and do not check checklist items on behalf of the user. If the PR includes UI changes, remind the user to add screenshots or a short video.
## AI policy
This project follows the [Open Home Foundation AI Policy](AI_POLICY.md).
Autonomous contributions are not accepted: a human must review, understand,
and be able to explain every change before it is submitted. Do not open
issues or pull requests autonomously, and do not post comments on behalf of
a user without their review.
Symlink
+1
View File
@@ -0,0 +1 @@
.github/copilot-instructions.md
-45
View File
@@ -1,45 +0,0 @@
# Open Home Foundation - AI Policy
We support using AI (i.e., LLMs) as tools when contributing to Open Home Foundation projects. However, you are responsible for any contributions you submit, and we are responsible for any contributions we merge and release. We hold a high bar for all contributions to our projects.
Our maintainers dedicate their time and expertise to reviewing contributions. Submitting AI-generated content that you have not personally reviewed and understood wastes that time and will not be accepted.
## Autonomous agents
**We do not allow autonomous agents to be used for contributing to our projects.** We will close any pull requests or issues that we believe were created autonomously, and may mark automated comments as spam. This includes contributions that bypass the provided issue or pull request templates.
## Communication on issues, pull requests, and code reviews
We don't mind if you use AI tools to help you write. However, do not have tools post unreviewed content on your behalf. Keep responses to the minimum needed to communicate your intent. We may hide any comments that we believe are unreviewed AI output.
If you are opening a pull request, we expect you to be able to explain the proposed changes in your own words. This includes the pull request description and responses to questions. If you use AI to help generate the pull request summary, you must review it for technical accuracy.
**Do not use AI to generate answers to questions from maintainers.** You should understand and be able to explain your own work. Using AI to improve grammar or clarity is fine, but the substance of your responses must be your own.
If you wish to include context from an interaction with AI in your comments, it must be in a quote block (e.g., using `>`) and disclosed as such. It must be accompanied by your own commentary explaining the relevance and implications of the context. Do not share long snippets.
## Non-native English speakers
We understand that AI is useful when communicating as a non-native English speaker. Using AI to improve the grammar or clarity of text you have written yourself is fine. If you are using AI to translate your comments, please ensure the translation accurately reflects your intent. Including your original text in a details block shows the effort behind your contribution, helps maintainers verify the translation if needed, and keeps the conversation readable.
## Code and documentation contributions
AI can be a helpful tool for writing code and documentation. However, due to the foundational open source nature of our projects, we require a human in the loop who understands the work produced by AI.
All contributions must be reviewed and understood by the contributor before submission. You should be able to explain every change in a pull request you submit. Pull requests that appear to be unreviewed AI output will be closed without review.
## Our use of AI
Some of our projects use AI tools to assist with code reviews, issue triaging, reporting, and other project management tasks. These tools may leave comments on pull requests or issues. As with any automated tooling, these comments are not always correct.
If an AI tool leaves a comment on your contribution, treat it as you would any other review comment. If you believe it is incorrect, say so; a brief explanation is sufficient. Maintainers always have the final say. If in doubt, ask a maintainer.
## Enforcement
Contributions that do not follow this policy will be closed. Repeated violations may result in being blocked from contributing to OHF projects. If you believe your contribution was closed in error, you are welcome to reach out to a maintainer to discuss.
---
The canonical version of this policy is published at
<https://developers.home-assistant.io/docs/ai_policy>. In case of differences,
the published version applies.
+1 -1
View File
@@ -1 +1 @@
AGENTS.md
.github/copilot-instructions.md
+1 -1
View File
@@ -12,7 +12,7 @@ This is the repository for the official [Home Assistant](https://home-assistant.
- Initial setup: `script/setup`
- Development: [Instructions](https://developers.home-assistant.io/docs/frontend/development/)
- Production build: `pnpm build`
- Production build: `script/build_frontend`
- Gallery: `cd gallery && script/develop_gallery`
## Frontend development
+1 -9
View File
@@ -34,14 +34,6 @@ In production, the following responsibilities are added:
- Minify HTML
- Bundle multiple imports so that the browser can fetch less files
- Generate a second version that is compatible with older browsers (legacy build)
- Generate a second version that is ES5 compatible
Configuration for all these steps are specified in [bundle.js](bundle.js).
## Auditing browser support changes
`node build-scripts/list-plugins-and-polyfills.js` prints, per browserslist
environment (modern/legacy), the Babel transforms preset-env enables and the
Core-JS polyfills that may be injected — as collapsible markdown ready to
paste into a PR. Use it to show the bundle impact when changing
`.browserslistrc` or the Babel configuration.
-56
View File
@@ -1,56 +0,0 @@
// Gulp transform that brotli-compresses files, several at a time.
//
// Drop-in replacement for gulp-brotli. zlib already does the work off the main
// thread, but that plugin wraps it in through2, which waits for each file
// before starting the next, so only one compression is ever in flight. The
// compressed bytes are unchanged; only how many run at once differs.
//
// The real ceiling is libuv's threadpool, which zlib runs on. It sizes itself
// from UV_THREADPOOL_SIZE before any JavaScript runs, so it can only be raised
// from the environment, never from inside the build.
import { availableParallelism } from "node:os";
import { buffer as readStream } from "node:stream/consumers";
import { promisify } from "node:util";
import { brotliCompress, constants } from "node:zlib";
import { withCache } from "./compress-cache.mjs";
import { ParallelTransform } from "./parallel-transform.mjs";
const EXTENSION = ".br";
const compress = promisify(brotliCompress);
/**
* @param {object} [options]
* @param {boolean} [options.skipLarger] Drop files that compression grows.
* @param {object} [options.params] Brotli parameters, passed to zlib as-is.
*/
export default ({ skipLarger = false, params } = {}) => {
// Isolate cache entries by anything that changes the output bytes: the brotli
// quality, and the node major that produced them.
const quality = params?.[constants.BROTLI_PARAM_QUALITY] ?? "default";
const namespace = `brotli-q${quality}-node${process.versions.node.split(".")[0]}`;
return new ParallelTransform(availableParallelism(), async (file) => {
if (file.isNull()) {
return file;
}
if (file.isStream()) {
file.contents = await readStream(file.contents);
}
const compressed = await withCache(namespace, file.contents, async () => {
const out = await compress(file.contents, { params });
// Dropped rather than passed through, as gulp-brotli did: the
// uncompressed file is already in the output directory.
return skipLarger && out.length >= file.contents.length ? undefined : out;
});
if (compressed === undefined) {
return undefined;
}
file.contents = compressed;
file.path += EXTENSION;
return file;
});
};
-311
View File
@@ -1,311 +0,0 @@
// Manage a Home Assistant frontend production build with an agent-friendly
// interface, matching build-scripts/dev-server.mjs.
//
// node build-scripts/build-manager.mjs [--modern] [mode]
//
// (no mode) Run in the foreground.
// --background Start detached, print the pid, then exit and leave it
// running.
// --status Report whether a managed build is running.
// --stop Stop a managed build.
// --logs [--follow] Print (or follow) the background build log.
//
// --modern Build only the modern frontend_latest bundle.
import path from "node:path";
import { fileURLToPath } from "node:url";
import {
LIFECYCLE_MODE_FLAGS,
acquireProcessRecord,
isProcessRecordAlive,
outputLog,
offerToStopProcessRecord,
processStartTime,
readProcessRecord,
releaseProcessRecord,
runCli,
spawnDetachedToLog,
spawnForeground,
terminateDetachedProcess,
terminateProcess,
waitFor,
writeProcessRecord,
} from "./managed-process.mjs";
import {
buildCacheDir,
describeOutputOwner,
workflowLockEnv,
workflowLockFile,
} from "./output-lock.mjs";
const repoRoot = path.resolve(
path.dirname(fileURLToPath(import.meta.url)),
".."
);
const gulpBin = path.join(repoRoot, "node_modules", ".bin", "gulp");
const stateDir = path.join(buildCacheDir, "ha-build");
const logFile = path.join(stateDir, "build.log");
const lockFile = workflowLockFile;
const usage = () => {
process.stderr.write(
"Usage: node build-scripts/build-manager.mjs [--modern] " +
"[--background | --status | --stop | --logs [--follow]]\n"
);
};
const parseArgs = (argv) => {
const args = {
mode: "foreground",
modes: [],
follow: false,
modern: false,
unknown: [],
};
for (const arg of argv) {
if (LIFECYCLE_MODE_FLAGS.has(arg)) {
args.mode = LIFECYCLE_MODE_FLAGS.get(arg);
args.modes.push(arg);
} else if (arg === "--modern") {
args.modern = true;
} else if (arg === "--follow") {
args.follow = true;
} else {
args.unknown.push(arg);
}
}
return args;
};
const hints = () =>
" Stop: pnpm build --stop\n" +
" Status: pnpm build --status\n" +
" Logs: pnpm build --logs\n";
const devCommand = (suite) => {
switch (suite) {
case "app-serve":
return "dev:serve";
case "demo":
return "dev:demo";
case "gallery":
return "dev:gallery";
case "e2e-app":
return "test:e2e:app:dev";
default:
return "dev";
}
};
const readBuild = () => readProcessRecord(lockFile);
const releaseBuild = (token) => releaseProcessRecord(lockFile, token);
const stopCommandFor = (owner) =>
owner?.kind === "build"
? "pnpm build --stop"
: owner?.kind === "dev"
? `pnpm ${devCommand(owner.suite)} --stop`
: undefined;
const acquireBuild = async (modern, foreground) => {
const token = `${process.pid}-${Date.now()}-${Math.random()}`;
const record = {
pid: process.pid,
startTime: processStartTime(process.pid),
processGroup: false,
foreground,
kind: "build",
modern,
starting: true,
token,
};
const result = acquireProcessRecord(lockFile, record);
if (result.acquired) {
return { token };
}
reportExisting(result.existing);
return (await offerToStopProcessRecord({
file: lockFile,
owner: result.existing,
ownerDescription: describeOutputOwner(result.existing),
stopCommand: stopCommandFor(result.existing),
}))
? acquireBuild(modern, foreground)
: { existing: result.existing };
};
const updateBuild = (token, child, processGroup) => {
const existing = readBuild();
if (existing?.token !== token) {
throw Error("Frontend build lock ownership was lost during startup.");
}
writeProcessRecord(lockFile, {
...existing,
pid: child.pid,
startTime: processStartTime(child.pid),
processGroup,
starting: false,
});
};
const taskFor = (modern) => (modern ? "build-app-modern" : "build-app");
const reportExisting = (existing) => {
if (existing?.kind === "output") {
process.stdout.write(
`${describeOutputOwner(existing)} already owns the build and development workflow` +
`${existing.pid ? ` (pid ${existing.pid})` : ""}.\n`
);
return;
}
if (existing?.kind === "dev") {
const command = devCommand(existing.suite);
process.stdout.write(
`Dev server (${existing.suite}) already running` +
`${existing.pid ? ` (pid ${existing.pid})` : ""}.\n` +
` Stop: pnpm ${command} --stop\n` +
` Status: pnpm ${command} --status\n` +
` Logs: pnpm ${command} --logs\n`
);
return;
}
process.stdout.write(
`Frontend ${existing?.modern ? "modern " : ""}build already running` +
`${existing?.pid ? ` (pid ${existing.pid})` : ""}.\n${hints()}`
);
};
const runForeground = async (modern) => {
const lock = await acquireBuild(modern, true);
if (!lock.token) {
return 1;
}
try {
return await spawnForeground({
cmd: gulpBin,
args: [taskFor(modern)],
cwd: repoRoot,
env: workflowLockEnv(lock.token),
processGroup: true,
onSpawn: (child) => updateBuild(lock.token, child, true),
});
} finally {
releaseBuild(lock.token);
}
};
const runBackground = async (modern) => {
const lock = await acquireBuild(modern, false);
if (!lock.token) {
return 1;
}
let child;
try {
child = await spawnDetachedToLog({
cmd: gulpBin,
args: [taskFor(modern)],
cwd: repoRoot,
env: workflowLockEnv(lock.token),
logFile,
});
updateBuild(lock.token, child, true);
process.stdout.write(
`Started ${modern ? "modern " : ""}frontend build (pid ${child.pid})\n` +
hints()
);
return 0;
} catch (err) {
if (child) {
await terminateDetachedProcess(child);
}
releaseBuild(lock.token);
throw err;
}
};
const runStatus = () => {
const existing = readBuild();
if (existing?.kind === "build" && isProcessRecordAlive(existing)) {
process.stdout.write(
`Frontend ${existing.modern ? "modern " : ""}build running (pid ${existing.pid}).\n`
);
} else {
if (existing?.kind === "build") {
releaseBuild(existing.token);
}
process.stdout.write("Frontend build not running.\n");
}
return 0;
};
const runStop = async () => {
let existing = readBuild();
if (existing?.kind !== "build") {
process.stdout.write("Frontend build not running.\n");
return 0;
}
if (existing?.starting) {
const token = existing.token;
await waitFor(
() => {
const current = readBuild();
return !current?.starting || current.token !== token;
},
100,
5000
);
existing = readBuild();
}
if (
!existing ||
existing.kind !== "build" ||
!isProcessRecordAlive(existing)
) {
if (existing) releaseBuild(existing.token);
process.stdout.write("Frontend build not running.\n");
return 0;
}
if (
!(await terminateProcess({
pid: existing.pid,
processGroup: existing.processGroup,
isStopped: () => !isProcessRecordAlive(existing),
}))
) {
process.stderr.write(
`Failed to stop frontend build (pid ${existing.pid}). Stop it manually.\n`
);
return 1;
}
releaseBuild(existing.token);
process.stdout.write(`Stopped frontend build (pid ${existing.pid}).\n`);
return 0;
};
const runLogs = (follow) =>
outputLog(logFile, follow, `No frontend build log yet (${logFile}).\n`);
const main = async () => {
const args = parseArgs(process.argv.slice(2));
if (args.unknown.length) {
process.stderr.write(`Unknown arguments: ${args.unknown.join(" ")}\n`);
usage();
return 1;
}
if (args.modes.length > 1 || (args.follow && args.mode !== "logs")) {
process.stderr.write("Invalid combination of build arguments.\n");
usage();
return 1;
}
const handlers = {
foreground: () => runForeground(args.modern),
background: () => runBackground(args.modern),
status: runStatus,
stop: runStop,
logs: () => runLogs(args.follow),
};
return handlers[args.mode]();
};
runCli(main);
-15
View File
@@ -1,15 +0,0 @@
{
"_comment": "Initial JS budget (raw/uncompressed bytes) for the cold-load critical entrypoints. Enforced by build-scripts/check-bundle-size.cjs in CI. Re-seed after an intentional change with `--update --headroom=<percent>`.",
"frontend-modern": {
"app": 593517,
"core": 54884,
"authorize": 557490,
"onboarding": 676131
},
"frontend-legacy": {
"app": 738388,
"core": 188119,
"authorize": 716748,
"onboarding": 840680
}
}
+45 -97
View File
@@ -1,3 +1,4 @@
/* global require, module, __dirname, process */
const path = require("path");
const env = require("./env.cjs");
const paths = require("./paths.cjs");
@@ -31,44 +32,13 @@ module.exports.emptyPackages = ({ isLandingPageBuild }) =>
),
].filter(Boolean);
// MapLibre runs its tile work in a worker that it spawns from a URL. The
// package ships that worker as untranspiled ES2022, so it is bundled here as
// its own entry per build target, like the rest of MapLibre. One self-contained
// file: the worker cannot import chunks, and a classic-compatible script runs
// wherever the main bundle does, module workers or not. The layer keeps the
// page's polyfills out of it; see `babelOptions`.
const MAP_WORKER_NAME = "maplibre-gl-worker";
module.exports.mapWorkerName = MAP_WORKER_NAME;
module.exports.mapWorkerEntry = () => ({
[MAP_WORKER_NAME]: {
import: "maplibre-gl/dist/maplibre-gl-worker.mjs",
chunkLoading: false,
layer: "worker",
},
});
// MapLibre is handed the URL at build time, so the name cannot carry a content
// hash. The frontend version stands in for it, in the file name rather than a
// query string: the service worker precaches everything under the bundle
// directory as immutable and matches it with the query stripped, so a `?v=`
// would keep serving the worker of the first version it ever cached.
module.exports.mapWorkerFilename = () =>
`${MAP_WORKER_NAME}.${env.version()}.js`;
module.exports.definedVars = ({
isProdBuild,
latestBuild,
publicPath,
defineOverlay,
}) => ({
module.exports.definedVars = ({ isProdBuild, latestBuild, defineOverlay }) => ({
__DEV__: !isProdBuild,
__BUILD__: JSON.stringify(latestBuild ? "modern" : "legacy"),
__VERSION__: JSON.stringify(env.version()),
__DEMO__: false,
__BACKWARDS_COMPAT__: false,
__STATIC_PATH__: "/static/",
__MAPLIBRE_WORKER_URL__: JSON.stringify(
`${publicPath}${module.exports.mapWorkerFilename()}`
),
__HASS_URL__: `\`${
"HASS_URL" in process.env
? process.env.HASS_URL
@@ -94,10 +64,8 @@ module.exports.htmlMinifierOptions = {
};
module.exports.terserOptions = ({ latestBuild, isTestBuild }) => ({
// Highest syntax the minifier may emit; it never downlevels. Every browser
// in [modern] is well past ES2020 (universal since spring 2020); the
// [legacy] floors (Chrome 59 / Safari 12) top out at ES2017.
ecma: latestBuild ? 2020 : 2017,
safari10: !latestBuild,
ecma: latestBuild ? 2015 : 5,
module: latestBuild,
format: { comments: false },
sourceMap: !isTestBuild,
@@ -116,7 +84,12 @@ module.exports.swcOptions = () => ({
},
});
module.exports.babelOptions = ({ latestBuild, isTestBuild, sw, worker }) => ({
module.exports.babelOptions = ({
latestBuild,
isProdBuild,
isTestBuild,
sw,
}) => ({
babelrc: false,
compact: false,
assumptions: {
@@ -129,22 +102,14 @@ module.exports.babelOptions = ({ latestBuild, isTestBuild, sw, worker }) => ({
[
"@babel/preset-env",
{
useBuiltIns: "usage",
corejs: dependencies["core-js"],
bugfixes: true,
shippedProposals: true,
},
],
],
plugins: [
// Inject Core-JS polyfills on demand. Babel 8 removed preset-env's
// `useBuiltIns`/`corejs` options, so the equivalent polyfill provider is
// configured directly here (`usage-global` matches the old `useBuiltIns: "usage"`).
[
"babel-plugin-polyfill-corejs3",
{
method: "usage-global",
version: dependencies["core-js"],
shippedProposals: true,
},
],
[
path.join(BABEL_PLUGINS, "inline-constants-plugin.cjs"),
{
@@ -152,14 +117,32 @@ module.exports.babelOptions = ({ latestBuild, isTestBuild, sw, worker }) => ({
ignoreModuleNotFound: true,
},
],
// Import helpers from runtime package.
// `moduleName` is pinned so helpers resolve from `@babel/runtime`: the
// corejs3 polyfill provider above otherwise redirects them to the
// (uninstalled) `@babel/runtime-corejs3`, which preset-env used to suppress
// internally when it owned the polyfill injection via `useBuiltIns`.
// Minify template literals for production
isProdBuild && [
"template-html-minifier",
{
modules: {
...Object.fromEntries(
["lit", "lit-element", "lit-html"].map((m) => [
m,
[
"html",
{ name: "svg", encapsulation: "svg" },
{ name: "css", encapsulation: "style" },
],
])
),
"@polymer/polymer/lib/utils/html-tag.js": ["html"],
},
strictCSS: true,
htmlMinifier: module.exports.htmlMinifierOptions,
failOnError: false, // we can turn this off in case of false positives
},
],
// Import helpers and regenerator from runtime package
[
"@babel/plugin-transform-runtime",
{ version: dependencies["@babel/runtime"], moduleName: "@babel/runtime" },
{ version: dependencies["@babel/runtime"] },
],
"@babel/plugin-transform-class-properties",
"@babel/plugin-transform-private-methods",
@@ -170,11 +153,9 @@ module.exports.babelOptions = ({ latestBuild, isTestBuild, sw, worker }) => ({
],
sourceMaps: !isTestBuild,
overrides: [
// Add plugin to inject various polyfills, excluding the polyfills
// themselves to prevent self-injection. Not in a worker: these polyfill
// the page (Intl locale data, DOM APIs) and assume one, so injecting them
// into a worker's graph makes its bootstrap fail before it starts.
!worker && {
{
// Add plugin to inject various polyfills, excluding the polyfills
// themselves to prevent self-injection.
plugins: [
[
path.join(BABEL_PLUGINS, "custom-polyfill-plugin.js"),
@@ -188,6 +169,8 @@ module.exports.babelOptions = ({ latestBuild, isTestBuild, sw, worker }) => ({
"@lit-labs/virtualizer/polyfills",
"@webcomponents/scoped-custom-element-registry",
"element-internals-polyfill",
"proxy-polyfill",
"unfetch",
].map((p) => new RegExp(`/node_modules/${p}/`)),
],
},
@@ -204,7 +187,7 @@ module.exports.babelOptions = ({ latestBuild, isTestBuild, sw, worker }) => ({
"@formatjs/(?:ecma402-abstract|intl-\\w+)",
].map((p) => new RegExp(`/node_modules/${p}/`)),
},
].filter(Boolean),
],
});
const nameSuffix = (latestBuild) => (latestBuild ? "-modern" : "-legacy");
@@ -254,7 +237,6 @@ module.exports.config = {
onboarding: "./src/entrypoints/onboarding.ts",
core: "./src/entrypoints/core.ts",
"custom-panel": "./src/entrypoints/custom-panel.ts",
...module.exports.mapWorkerEntry(),
},
outputPath: outputPath(paths.app_output_root, latestBuild),
publicPath: publicPath(latestBuild),
@@ -266,12 +248,11 @@ module.exports.config = {
};
},
demo({ isProdBuild, latestBuild, isStatsBuild, isTestBuild }) {
demo({ isProdBuild, latestBuild, isStatsBuild }) {
return {
name: "demo" + nameSuffix(latestBuild),
entry: {
main: path.resolve(paths.demo_dir, "src/entrypoint.ts"),
...module.exports.mapWorkerEntry(),
},
outputPath: outputPath(paths.demo_output_root, latestBuild),
publicPath: publicPath(latestBuild),
@@ -282,7 +263,6 @@ module.exports.config = {
isProdBuild,
latestBuild,
isStatsBuild,
isTestBuild,
};
},
@@ -292,13 +272,11 @@ module.exports.config = {
media: path.resolve(paths.cast_dir, "src/media/entrypoint.ts"),
};
// Only the receiver renders maps, and it is built for modern browsers only
if (latestBuild) {
entry.receiver = path.resolve(
paths.cast_dir,
"src/receiver/entrypoint.ts"
);
Object.assign(entry, module.exports.mapWorkerEntry());
}
return {
@@ -314,18 +292,16 @@ module.exports.config = {
};
},
gallery({ isProdBuild, latestBuild, isTestBuild }) {
gallery({ isProdBuild, latestBuild }) {
return {
name: "gallery" + nameSuffix(latestBuild),
entry: {
entrypoint: path.resolve(paths.gallery_dir, "src/entrypoint.js"),
...module.exports.mapWorkerEntry(),
},
outputPath: outputPath(paths.gallery_output_root, latestBuild),
publicPath: publicPath(latestBuild),
isProdBuild,
latestBuild,
isTestBuild,
defineOverlay: {
__DEMO__: true,
},
@@ -345,32 +321,4 @@ module.exports.config = {
isLandingPageBuild: true,
};
},
e2eTestApp({ isProdBuild, latestBuild, isStatsBuild, isTestBuild }) {
return {
name: "e2e-test-app" + nameSuffix(latestBuild),
entry: {
dashboard: path.resolve(
paths.e2eTestApp_dir,
"src/dashboard-entrypoint.ts"
),
main: path.resolve(paths.e2eTestApp_dir, "src/entrypoint.ts"),
onboarding: path.resolve(
paths.e2eTestApp_dir,
"src/onboarding-entrypoint.ts"
),
...module.exports.mapWorkerEntry(),
},
outputPath: outputPath(paths.e2eTestApp_output_root, latestBuild),
publicPath: publicPath(latestBuild),
defineOverlay: {
__VERSION__: JSON.stringify(`E2E-TEST-${env.version()}`),
__DEMO__: true,
},
isProdBuild,
latestBuild,
isStatsBuild,
isTestBuild,
};
},
};
-155
View File
@@ -1,155 +0,0 @@
/* global require, process, __dirname */
// Enforce a strict size budget on the initial JS of the most critical
// entrypoints (`app` and `core`). These two are downloaded on every cold load
// before anything interactive can happen, so unintended growth here hurts
// first-load performance directly.
//
// In production rspack does not split initial chunks (splitChunks only operates
// on `!chunk.canBeInitial()`), so each entrypoint resolves to a single initial
// JS asset. We read the per-build stats written by StatsWriterPlugin and compare
// the entrypoint's initial JS size against a committed budget.
//
// Usage:
// node build-scripts/check-bundle-size.cjs # enforce, exit 1 on regression
// node build-scripts/check-bundle-size.cjs --update # rewrite budgets from current sizes
// node build-scripts/check-bundle-size.cjs --update --headroom=3 # current + 3% headroom
const fs = require("fs");
const path = require("path");
const paths = require("./paths.cjs");
// Entrypoints whose initial JS we hold to a strict budget. These are all
// downloaded on a user-facing cold load before anything interactive can happen:
// `app`/`core` for the main app, plus the standalone `authorize` and
// `onboarding` pages. `custom-panel` is intentionally excluded (only loaded
// when a custom panel is opened).
const TRACKED_ENTRYPOINTS = ["app", "core", "authorize", "onboarding"];
// App build stats files, as written by StatsWriterPlugin (`${name}.json`).
const BUILDS = ["frontend-modern", "frontend-legacy"];
const BUDGET_FILE = path.join(__dirname, "bundle-budget.json");
const STATS_DIR = path.join(paths.build_dir, "stats");
const readStats = (build) => {
const file = path.join(STATS_DIR, `${build}.json`);
if (!fs.existsSync(file)) {
throw new Error(
`Missing stats file: ${path.relative(process.cwd(), file)}.\n` +
`Run a production build first (e.g. \`gulp build-app\`), then re-run this check.`
);
}
return JSON.parse(fs.readFileSync(file, "utf8"));
};
// Initial JS bytes for an entrypoint = sum of the .js asset sizes of its initial
// entry chunk(s). Sizes are raw (uncompressed) bytes, matching the stats output.
const entrypointInitialJS = (stats, entrypoint) => {
const assetSize = new Map(stats.assets.map((a) => [a.name, a.size]));
let total = 0;
let found = false;
for (const chunk of stats.chunks) {
if (!chunk.entry || !chunk.initial) {
continue;
}
if (!(chunk.names || []).includes(entrypoint)) {
continue;
}
found = true;
for (const file of chunk.files || []) {
if (file.endsWith(".js") && assetSize.has(file)) {
total += assetSize.get(file);
}
}
}
if (!found) {
throw new Error(`Entrypoint "${entrypoint}" not found in bundle stats.`);
}
return total;
};
const kib = (bytes) => `${(bytes / 1024).toFixed(1)} KiB`;
const main = () => {
const update = process.argv.includes("--update");
const headroomArg = process.argv.find((a) => a.startsWith("--headroom="));
const headroom = headroomArg ? Number(headroomArg.split("=")[1]) : 0;
const current = {};
for (const build of BUILDS) {
const stats = readStats(build);
current[build] = {};
for (const entrypoint of TRACKED_ENTRYPOINTS) {
current[build][entrypoint] = entrypointInitialJS(stats, entrypoint);
}
}
if (update) {
const budget = { _comment: BUDGET_COMMENT };
for (const build of BUILDS) {
budget[build] = {};
for (const entrypoint of TRACKED_ENTRYPOINTS) {
budget[build][entrypoint] = Math.ceil(
current[build][entrypoint] * (1 + headroom / 100)
);
}
}
fs.writeFileSync(BUDGET_FILE, `${JSON.stringify(budget, null, 2)}\n`);
console.log(
`Updated ${path.relative(process.cwd(), BUDGET_FILE)} from current sizes` +
(headroom ? ` (+${headroom}% headroom).` : ".")
);
return;
}
if (!fs.existsSync(BUDGET_FILE)) {
throw new Error(
`Missing budget file ${path.relative(process.cwd(), BUDGET_FILE)}.\n` +
`Seed it from a production build with: node build-scripts/check-bundle-size.cjs --update --headroom=3`
);
}
const budget = JSON.parse(fs.readFileSync(BUDGET_FILE, "utf8"));
let failed = false;
console.log("Initial JS budget (entry chunks, raw bytes):\n");
for (const build of BUILDS) {
for (const entrypoint of TRACKED_ENTRYPOINTS) {
const actual = current[build][entrypoint];
const limit = budget[build] && budget[build][entrypoint];
if (typeof limit !== "number") {
failed = true;
console.log(
` ✗ ${build} / ${entrypoint}: no budget set (current ${kib(actual)})`
);
continue;
}
const ok = actual <= limit;
const delta = (((actual - limit) / limit) * 100).toFixed(1);
console.log(
` ${ok ? "✓" : "✗"} ${build} / ${entrypoint}: ` +
`${kib(actual)} / ${kib(limit)}${ok ? "" : ` (+${delta}% over budget)`}`
);
if (!ok) {
failed = true;
}
}
}
if (failed) {
console.error(
"\nInitial JS budget exceeded for a critical entrypoint.\n" +
"Investigate what was pulled into the entry chunk (a static import that should be lazy?).\n" +
"If the growth is intentional, re-seed the budget:\n" +
" node build-scripts/check-bundle-size.cjs --update --headroom=3"
);
process.exit(1);
}
console.log("\nAll tracked entrypoints within budget.");
};
const BUDGET_COMMENT =
"Initial JS budget (raw/uncompressed bytes) for the cold-load critical entrypoints. " +
"Enforced by build-scripts/check-bundle-size.cjs in CI. " +
"Re-seed after an intentional change with `--update --headroom=<percent>`.";
main();
-212
View File
@@ -1,212 +0,0 @@
// Content-addressed cache for compression output.
//
// brotli (quality 11) and zopfli are the slowest part of a production build,
// and they redo every file from scratch on every run. But production chunks are
// content-hashed in their filenames, so a chunk that didn't change produces
// byte-identical input here. Keying the compressed output by a hash of the
// input bytes lets an unchanged file skip compression entirely, and lets a
// nightly build warm the cache a release reuses the next day.
//
// Disabled unless COMPRESS_CACHE_DIR points at a directory. Local builds set
// nothing and behave exactly as before. The compressed bytes are unchanged
// either way; only whether they were recomputed differs.
import { createHash } from "node:crypto";
import { existsSync } from "node:fs";
import {
mkdir,
readFile,
readdir,
rename,
rm,
stat,
utimes,
writeFile,
} from "node:fs/promises";
import path from "node:path";
const rootDir = process.env.COMPRESS_CACHE_DIR;
export const cacheEnabled = Boolean(rootDir);
// Total cache size to keep across builds, least-recently-used first when over.
// The cache is shared between branches (a dev nightly warms it for a release,
// which builds from rc/master), so pruning must NOT drop everything the current
// build didn't touch — that would make each branch evict the other's
// branch-specific files every run. Instead the current build is pinned and the
// rest is kept up to this budget, so nothing is dropped unless the cache is
// genuinely too large. Override with COMPRESS_CACHE_MAX_BYTES.
const DEFAULT_MAX_BYTES = 1024 * 1024 * 1024; // 1 GiB
const maxBytes = () => {
// A valid, explicit budget wins — including 0, which keeps only the current
// build (evict everything else). An unset or invalid value uses the default.
const configured = Number(process.env.COMPRESS_CACHE_MAX_BYTES);
return Number.isFinite(configured) && configured >= 0
? configured
: DEFAULT_MAX_BYTES;
};
// Every cache key touched this build, hits and writes alike, so a prune can pin
// the current dist and never evict a file this build depends on.
const touched = new Set();
// Per-namespace directory, created lazily and only once.
const dirs = new Map();
let tmpCounter = 0;
const sha256 = (contents) =>
createHash("sha256").update(contents).digest("hex");
const namespaceDir = (namespace) => {
let dir = dirs.get(namespace);
if (!dir) {
const dirPath = path.join(rootDir, namespace);
dir = { path: dirPath, ready: undefined };
dirs.set(namespace, dir);
}
return dir;
};
const ensureDir = (dir) => {
dir.ready ??= mkdir(dir.path, { recursive: true });
return dir.ready;
};
// Written via a unique temp file and renamed into place so a concurrent reader
// in the same build never sees a half-written entry (rename is atomic on the
// same filesystem).
const writeAtomic = async (dir, name, contents) => {
await ensureDir(dir);
tmpCounter += 1;
const tmp = path.join(dir.path, `.${process.pid}-${tmpCounter}.tmp`);
const dest = path.join(dir.path, name);
await writeFile(tmp, contents);
try {
await rename(tmp, dest);
} catch (error) {
// Two files with identical contents can miss and write the same entry at
// once. On POSIX the rename just overwrites, but Windows rejects a rename
// onto an existing path. Either way the destination already holds the same
// bytes (content-addressed), so drop our temp and treat it as done.
if (existsSync(dest)) {
await rm(tmp, { force: true });
} else {
throw error;
}
}
};
/**
* Return the cached compression result for `contents`, or run `compute` and
* cache what it returns. `compute` resolves to a Buffer for compressed output,
* or `undefined` when the file should be dropped (brotli skipLarger); both
* outcomes are cached, so a dropped file is not recompressed on the next build.
*
* @param {string} namespace Isolates entries by algorithm, parameters and tool
* version, so a change to any of them can never return a stale result.
* @param {Buffer} contents Uncompressed input bytes, used as the cache key.
* @param {() => Promise<Buffer | undefined>} compute Runs on a cache miss.
* @returns {Promise<Buffer | undefined>}
*/
export const withCache = async (namespace, contents, compute) => {
if (!cacheEnabled) {
return compute();
}
const dir = namespaceDir(namespace);
const hash = sha256(contents);
touched.add(`${namespace}/${hash}`);
const dataPath = path.join(dir.path, hash);
const dropName = `${hash}.drop`;
try {
return await readFile(dataPath);
} catch {
// Miss (or unreadable) — fall through and compute.
}
if (existsSync(path.join(dir.path, dropName))) {
return undefined;
}
const result = await compute();
if (result === undefined) {
await writeAtomic(dir, dropName, "");
} else {
await writeAtomic(dir, hash, result);
}
return result;
};
/**
* Keep the cache under `maxBytes`, evicting least-recently-used entries first.
* Files this build touched are always kept (and their timestamp refreshed, so
* shared files stay warm across branches); the remainder — including another
* branch's entries — is kept up to the budget. No-op when the cache is disabled
* or nothing was compressed, so it never wipes a warm cache on a build that
* skipped compression.
*/
export const pruneCache = async () => {
if (!cacheEnabled || touched.size === 0 || !existsSync(rootDir)) {
return;
}
const now = new Date();
const pinned = [];
const others = [];
// Scan every namespace on disk, not just the ones this build used, so entries
// from an old tool version (a different namespace) are eligible for eviction.
const namespaces = await readdir(rootDir, { withFileTypes: true });
await Promise.all(
namespaces.map(async (ns) => {
if (!ns.isDirectory()) {
return;
}
const nsDir = path.join(rootDir, ns.name);
const entries = await readdir(nsDir);
await Promise.all(
entries.map(async (entry) => {
const entryPath = path.join(nsDir, entry);
// Stray temp files from an interrupted write are never valid entries.
if (entry.endsWith(".tmp")) {
await rm(entryPath, { force: true });
return;
}
const hash = entry.endsWith(".drop") ? entry.slice(0, -5) : entry;
const info = await stat(entryPath);
if (touched.has(`${ns.name}/${hash}`)) {
pinned.push({ entryPath, size: info.size });
} else {
others.push({ entryPath, size: info.size, mtimeMs: info.mtimeMs });
}
})
);
})
);
// Pinned files stay and are refreshed so they rank as most-recently-used for
// future prunes; they always count against the budget first.
let kept = 0;
await Promise.all(
pinned.map(async ({ entryPath, size }) => {
kept += size;
// A failed timestamp refresh only affects future LRU ordering, not
// correctness, so it is safe to ignore.
await utimes(entryPath, now, now).catch(() => undefined);
})
);
// Keep the most-recently-used others until the budget is spent; drop the rest.
others.sort((a, b) => b.mtimeMs - a.mtimeMs);
const budget = maxBytes();
const toDelete = [];
for (const entry of others) {
if (kept + entry.size <= budget) {
kept += entry.size;
} else {
toDelete.push(entry.entryPath);
}
}
await Promise.all(toDelete.map((p) => rm(p, { force: true })));
};
-761
View File
@@ -1,761 +0,0 @@
// Manage a Home Assistant frontend dev server with an agent-friendly interface.
//
// node build-scripts/dev-server.mjs --suite <suite> [mode] [extra args]
//
// (no mode) Run in the foreground.
// --background Start detached, wait until it is ready, print the URL
// (when it has one) and pid, then exit and leave it running.
// --status Report whether the suite's dev server is running.
// --stop Stop a running background dev server.
// --logs [--follow] Print (or follow) the background dev server log.
// --fetch-translations
// Fetch nightly translations before starting (app,
// app-serve, demo, and gallery only).
//
// Extra args (for example -p or -c on app-serve) are forwarded to the underlying
// script. Suites use one of two liveness models:
//
// health demo, gallery, e2e-app: a fixed port plus the /__ha_dev_status
// endpoint each dev server exposes (see runDevServer in
// build-scripts/gulp/rspack.js).
// process app (pnpm dev) and app-serve (pnpm dev:serve): plain pnpm dev has
// no port, so these treat the first "Build done" log line as ready.
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import {
LIFECYCLE_MODE_FLAGS,
acquireProcessRecord,
detectCodingAgent,
isProcessRecordAlive,
outputLog,
offerToStopProcessRecord,
processStartTime,
readProcessRecord,
releaseProcessRecord,
runCli,
sleep,
spawnDetachedToLog,
spawnForeground,
terminateDetachedProcess,
terminateProcess,
writeProcessRecord,
} from "./managed-process.mjs";
import {
buildCacheDir,
describeOutputOwner,
workflowLockEnv,
workflowLockFile,
} from "./output-lock.mjs";
const repoRoot = path.resolve(
path.dirname(fileURLToPath(import.meta.url)),
".."
);
const gulpBin = path.join(repoRoot, "node_modules", ".bin", "gulp");
const developAndServeScript = path.join(
repoRoot,
"script",
"develop_and_serve"
);
const logDir = path.join(buildCacheDir, "ha-dev-server");
// Each suite names its pnpm alias (for hints), a liveness model, and how to
// spawn it. health suites carry a fixed port; process suites carry the log line
// that means "ready" and, for app-serve, forward extra args to the script.
const SUITES = new Map([
[
"e2e-app",
{
alias: "test:e2e:app:dev",
liveness: "health",
port: 8095,
spawn: { cmd: gulpBin, args: ["develop-e2e-test-app"] },
},
],
[
"demo",
{
alias: "dev:demo",
fetchTranslations: true,
liveness: "health",
port: 8090,
spawn: { cmd: gulpBin, args: ["develop-demo"] },
},
],
[
"gallery",
{
alias: "dev:gallery",
fetchTranslations: true,
liveness: "health",
port: 8100,
spawn: { cmd: gulpBin, args: ["develop-gallery"] },
},
],
[
"app",
{
alias: "dev",
fetchTranslations: true,
liveness: "process",
readyLog: /Build done @/,
spawn: { cmd: gulpBin, args: ["develop-app"] },
},
],
[
"app-serve",
{
alias: "dev:serve",
liveness: "process",
acceptsArgs: true,
fetchTranslations: true,
readyLog: /Build done @/,
spawn: { cmd: developAndServeScript, args: [] },
},
],
]);
// Cover a cold build on a slow machine before the server starts listening.
// Override with HA_DEV_SERVER_TIMEOUT (seconds).
const readyTimeoutSeconds = Number(process.env.HA_DEV_SERVER_TIMEOUT || "180");
const READY_TIMEOUT_MS =
Number.isFinite(readyTimeoutSeconds) && readyTimeoutSeconds > 0
? readyTimeoutSeconds * 1000
: 180_000;
const usage = () => {
const suites = [...SUITES.keys()].join("|");
process.stderr.write(
`Usage: node build-scripts/dev-server.mjs --suite <${suites}> ` +
`[--background | --status | --stop | --logs [--follow]] ` +
`[--fetch-translations]\n`
);
};
const parseArgs = (argv) => {
const args = {
fetchTranslations: false,
mode: "foreground",
follow: false,
modes: [],
suite: undefined,
passthrough: [],
};
for (let i = 0; i < argv.length; i++) {
const arg = argv[i];
switch (arg) {
case "--suite":
args.suite = argv[++i];
break;
case "--follow":
args.follow = true;
break;
case "--fetch-translations":
args.fetchTranslations = true;
break;
default:
if (LIFECYCLE_MODE_FLAGS.has(arg)) {
args.mode = LIFECYCLE_MODE_FLAGS.get(arg);
args.modes.push(arg);
} else {
// Anything unrecognised is forwarded to the underlying script.
args.passthrough.push(arg);
}
}
}
return args;
};
const translationPrebuildEnv = (token) => {
const env = workflowLockEnv(token);
delete env.SKIP_FETCH_NIGHTLY_TRANSLATIONS;
return env;
};
const suiteEnv = (token, fetchTranslations = false) => ({
...workflowLockEnv(token),
...(fetchTranslations && { SKIP_FETCH_NIGHTLY_TRANSLATIONS: "1" }),
});
const runPrebuild = (token, fetchTranslations = false) =>
fetchTranslations
? spawnForeground({
cmd: gulpBin,
args: ["setup-and-fetch-nightly-translations"],
cwd: repoRoot,
env: translationPrebuildEnv(token),
processGroup: true,
})
: Promise.resolve(0);
const logFileFor = (suite) => path.join(logDir, `${suite}.log`);
const acquireSuite = (suite) => {
const token = `${process.pid}-${Date.now()}-${Math.random()}`;
const record = {
pid: process.pid,
startTime: processStartTime(process.pid),
processGroup: false,
kind: "dev",
suite,
starting: true,
token,
};
const result = acquireProcessRecord(workflowLockFile, record);
return result.acquired ? { token } : { existing: result.existing };
};
const updateSuite = (suite, token, child, port) => {
const existing = readProcessRecord(workflowLockFile);
if (existing?.token !== token) {
throw Error(`Dev server (${suite}) ownership was lost during startup.`);
}
writeProcessRecord(workflowLockFile, {
...existing,
pid: child.pid,
startTime: processStartTime(child.pid),
processGroup: true,
starting: false,
port,
});
};
const releaseSuite = (token) => releaseProcessRecord(workflowLockFile, token);
const readSuite = (suite) => {
const existing = readProcessRecord(workflowLockFile);
if (existing?.kind !== "dev" || existing.suite !== suite) {
return undefined;
}
if (isProcessRecordAlive(existing)) {
return existing;
}
releaseSuite(existing.token);
return undefined;
};
const hints = (suite) => {
const alias = `pnpm ${SUITES.get(suite).alias}`;
return (
` Stop: ${alias} --stop\n` +
` Status: ${alias} --status\n` +
` Logs: ${alias} --logs\n`
);
};
const reportProcessConflict = (suite, existing) => {
if (existing?.kind === "output") {
process.stdout.write(
`${describeOutputOwner(existing)} already owns the app output` +
`${existing.pid ? ` (pid ${existing.pid})` : ""}.\n`
);
return;
}
if (existing?.kind === "build") {
process.stdout.write(
`Frontend build already running${existing.pid ? ` (pid ${existing.pid})` : ""}. ` +
"Stop it with pnpm build --stop.\n"
);
return;
}
process.stdout.write(
`Dev server (${existing?.suite ?? suite}) already running` +
`${urlSuffix(existing?.port)} ` +
`${existing?.pid ? `(pid ${existing.pid})` : ""}\n` +
hints(existing?.suite ?? suite)
);
};
const stopCommandFor = (owner) =>
owner?.kind === "build"
? "pnpm build --stop"
: owner?.kind === "dev"
? `pnpm ${SUITES.get(owner.suite)?.alias ?? "dev"} --stop`
: undefined;
const acquireSuiteForStart = async (suite) => {
const lock = acquireSuite(suite);
if (lock.token) {
return lock;
}
reportProcessConflict(suite, lock.existing);
if (
await offerToStopProcessRecord({
file: workflowLockFile,
owner: lock.existing,
ownerDescription: describeOutputOwner(lock.existing),
stopCommand: stopCommandFor(lock.existing),
})
) {
return acquireSuiteForStart(suite);
}
return {
code:
lock.existing?.kind === "dev" &&
lock.existing.suite === suite &&
!lock.existing.starting
? 0
: 1,
};
};
// --- shared spawning and lifecycle ------------------------------------------
const urlSuffix = (port) => (port ? ` at http://localhost:${port}` : "");
// Poll until the server is ready, the child exits, or we time out. Prints the
// progress dots and outcome; returns 0 when ready, 1 otherwise. onExit runs if
// the child dies before it is ready (used to clear a stale pidfile).
const awaitReady = async ({ suite, child, logFile, port, isReady, onExit }) => {
let childExited = false;
child.on("exit", () => {
childExited = true;
});
const deadline = Date.now() + READY_TIMEOUT_MS;
process.stdout.write(`Starting ${suite} dev server`);
const poll = async () => {
if (childExited) {
process.stdout.write("\n");
process.stderr.write(
`Dev server (${suite}) exited before it was ready. See ${logFile}\n`
);
onExit?.();
return 1;
}
if (await isReady()) {
process.stdout.write("\n");
process.stdout.write(
`Dev server (${suite}) running${urlSuffix(port)} ` +
`(pid ${child.pid})\n${hints(suite)}`
);
return 0;
}
if (Date.now() >= deadline) {
return undefined;
}
process.stdout.write(".");
await sleep(1000);
return poll();
};
const result = await poll();
if (result !== undefined) {
return result;
}
process.stdout.write("\n");
process.stderr.write(
`Dev server (${suite}) did not become ready within ${
READY_TIMEOUT_MS / 1000
}s. See ${logFile}\n`
);
const stopped = await terminateProcess({
pid: child.pid,
isStopped: () => childExited,
});
if (stopped) {
onExit?.();
}
return 1;
};
// Stop a running background server: SIGTERM, wait for it to go, then SIGKILL.
// isStopped reports when it is gone; onStopped runs on success (pidfile cleanup).
const terminate = async (suite, pid, isStopped, onStopped) => {
if (!(await terminateProcess({ pid, isStopped }))) {
process.stderr.write(
`Failed to stop dev server (${suite}) (pid ${pid}). Stop it manually.\n`
);
return 1;
}
onStopped?.();
process.stdout.write(`Stopped dev server (${suite}) (pid ${pid}).\n`);
return 0;
};
// --- health liveness (port + /__ha_dev_status) ------------------------------
/**
* Probe the health endpoint. Dev servers bind IPv4 or IPv6 localhost depending
* on the OS, so try each; the port is "free" only if every address refuses.
* @returns {Promise<{state: "ours" | "foreign" | "free", suite?: string}>}
*/
const PROBE_HOSTS = ["localhost", "127.0.0.1", "[::1]"];
const probe = async (port, timeoutMs = 1000) => {
const probeHost = async (index, sawResponse) => {
const host = PROBE_HOSTS[index];
if (!host) {
return sawResponse ? { state: "foreign" } : { state: "free" };
}
const controller = new AbortController();
const timer = setTimeout(() => controller.abort(), timeoutMs);
try {
const res = await fetch(`http://${host}:${port}/__ha_dev_status`, {
signal: controller.signal,
});
sawResponse = true;
if (res.ok) {
const body = await res.json().catch(() => null);
if (body && body.server === "ha-frontend-dev") {
return { state: "ours", suite: body.suite };
}
}
} catch {
// Try the next address.
} finally {
clearTimeout(timer);
}
return probeHost(index + 1, sawResponse);
};
return probeHost(0, false);
};
const isHttpServing = async (port, timeoutMs = 1000) => {
const probeHost = async (index) => {
const host = PROBE_HOSTS[index];
if (!host) {
return false;
}
const controller = new AbortController();
const timer = setTimeout(() => controller.abort(), timeoutMs);
try {
const response = await fetch(`http://${host}:${port}`, {
signal: controller.signal,
});
if (response.ok) {
return true;
}
} catch {
// Try the next address.
} finally {
clearTimeout(timer);
}
return probeHost(index + 1);
};
return probeHost(0);
};
const runForegroundHealth = async (suite, cfg, fetchTranslations = false) => {
const { port } = cfg;
const lock = await acquireSuiteForStart(suite);
if (!lock.token) {
return lock.code;
}
const status = await probe(port);
if (status.state === "ours") {
releaseSuite(lock.token);
process.stderr.write(
`Port ${port} is already serving the ${status.suite ?? "unknown"} dev server.\n`
);
return 1;
}
if (status.state === "foreign") {
releaseSuite(lock.token);
process.stderr.write(
`Port ${port} is in use by another process; not the ${suite} dev server.\n`
);
return 1;
}
try {
const prebuildCode = await runPrebuild(lock.token, fetchTranslations);
if (prebuildCode !== 0) {
return prebuildCode;
}
return await spawnForeground({
cmd: cfg.spawn.cmd,
args: cfg.spawn.args,
cwd: repoRoot,
env: suiteEnv(lock.token, fetchTranslations),
processGroup: true,
onSpawn: (child) => updateSuite(suite, lock.token, child, port),
});
} finally {
releaseSuite(lock.token);
}
};
const runBackgroundHealth = async (suite, cfg, fetchTranslations = false) => {
const { port } = cfg;
const lock = await acquireSuiteForStart(suite);
if (!lock.token) {
return lock.code;
}
const preflight = await probe(port);
if (preflight.state === "ours") {
releaseSuite(lock.token);
process.stderr.write(
`Port ${port} is already serving the ${preflight.suite ?? "unknown"} dev server.\n`
);
return 1;
}
if (preflight.state === "foreign") {
releaseSuite(lock.token);
process.stderr.write(
`Port ${port} is in use by another process; not the ${suite} dev server.\n`
);
return 1;
}
let child;
try {
const prebuildCode = await runPrebuild(lock.token, fetchTranslations);
if (prebuildCode !== 0) {
releaseSuite(lock.token);
return prebuildCode;
}
const logFile = logFileFor(suite);
child = await spawnDetachedToLog({
cmd: cfg.spawn.cmd,
args: cfg.spawn.args,
cwd: repoRoot,
env: suiteEnv(lock.token, fetchTranslations),
logFile,
});
updateSuite(suite, lock.token, child, port);
return awaitReady({
suite,
child,
logFile,
port,
isReady: async () => {
const status = await probe(port, 1000);
return status.state === "ours" && status.suite === suite;
},
onExit: () => releaseSuite(lock.token),
});
} catch (err) {
if (child) {
await terminateDetachedProcess(child);
}
releaseSuite(lock.token);
throw err;
}
};
const logIsReady = (logFile, readyLog) => {
try {
return readyLog.test(fs.readFileSync(logFile, "utf8"));
} catch {
return false;
}
};
// app-serve serves on 8124 by default (8123 in a devcontainer), or whatever -p
// the caller passed. Used only to show a URL; liveness comes from the pidfile.
const resolveServePort = (passthrough) => {
for (let i = passthrough.length - 1; i >= 0; i--) {
const arg = passthrough[i];
if (arg === "-p" || arg.startsWith("-p")) {
const port = Number(arg === "-p" ? passthrough[i + 1] : arg.slice(2));
if (Number.isInteger(port) && port > 0) {
return port;
}
}
}
return process.env.DEVCONTAINER ? 8123 : 8124;
};
const spawnArgs = (cfg, passthrough) => [
...cfg.spawn.args,
...(cfg.acceptsArgs ? passthrough : []),
];
const runForegroundProcess = async (
suite,
cfg,
passthrough,
fetchTranslations = false
) => {
const lock = await acquireSuiteForStart(suite);
if (!lock.token) {
return lock.code;
}
try {
const prebuildCode = await runPrebuild(lock.token, fetchTranslations);
if (prebuildCode !== 0) {
return prebuildCode;
}
return await spawnForeground({
cmd: cfg.spawn.cmd,
args: spawnArgs(cfg, passthrough),
cwd: repoRoot,
env: suiteEnv(lock.token, fetchTranslations),
processGroup: true,
onSpawn: (child) => updateSuite(suite, lock.token, child),
});
} finally {
releaseSuite(lock.token);
}
};
const runBackgroundProcess = async (
suite,
cfg,
passthrough,
fetchTranslations = false
) => {
const lock = await acquireSuiteForStart(suite);
if (!lock.token) {
return lock.code;
}
let child;
try {
const prebuildCode = await runPrebuild(lock.token, fetchTranslations);
if (prebuildCode !== 0) {
releaseSuite(lock.token);
return prebuildCode;
}
const logFile = logFileFor(suite);
child = await spawnDetachedToLog({
cmd: cfg.spawn.cmd,
args: spawnArgs(cfg, passthrough),
cwd: repoRoot,
env: suiteEnv(lock.token, fetchTranslations),
logFile,
});
const port = cfg.acceptsArgs ? resolveServePort(passthrough) : cfg.port;
updateSuite(suite, lock.token, child, port);
return awaitReady({
suite,
child,
logFile,
port,
isReady: async () =>
logIsReady(logFile, cfg.readyLog) &&
(!cfg.acceptsArgs || (await isHttpServing(port))),
onExit: () => releaseSuite(lock.token),
});
} catch (err) {
if (child) {
await terminateDetachedProcess(child);
}
releaseSuite(lock.token);
throw err;
}
};
const runStatusSuite = async (suite, cfg) => {
const existing = readSuite(suite);
if (existing) {
process.stdout.write(
`Dev server (${existing.suite ?? suite}) running${urlSuffix(existing.port ?? cfg.port)} ` +
`(pid ${existing.pid})\n`
);
} else {
process.stdout.write(`Dev server (${suite}) not running.\n`);
}
return 0;
};
const runStopSuite = async (suite) => {
const existing = readSuite(suite);
if (!existing) {
process.stdout.write(`Dev server (${suite}) not running.\n`);
return 0;
}
const { pid } = existing;
const activeSuite = existing.suite ?? suite;
return terminate(
activeSuite,
pid,
() => !isProcessRecordAlive(existing),
() => releaseSuite(existing.token)
);
};
// --- shared -----------------------------------------------------------------
const runLogs = (suite, follow) => {
const activeSuite = readSuite(suite)?.suite ?? suite;
return outputLog(
logFileFor(activeSuite),
follow,
`No log for the ${activeSuite} dev server yet (${logFileFor(activeSuite)}).\n`
);
};
const main = async () => {
const args = parseArgs(process.argv.slice(2));
const cfg = SUITES.get(args.suite);
if (!cfg) {
usage();
return 1;
}
if (args.modes.length > 1 || (args.follow && args.mode !== "logs")) {
process.stderr.write("Invalid combination of lifecycle arguments.\n");
usage();
return 1;
}
if (
args.fetchTranslations &&
(!["foreground", "background"].includes(args.mode) ||
!cfg.fetchTranslations)
) {
process.stderr.write(
"--fetch-translations is only supported when starting app, app-serve, demo, or gallery.\n"
);
usage();
return 1;
}
if (args.passthrough.length && !cfg.acceptsArgs) {
process.stderr.write(
`Ignoring unexpected arguments: ${args.passthrough.join(" ")}\n`
);
}
// A plain dev:<suite> under a coding agent backgrounds itself; explicit modes
// are untouched.
let { mode } = args;
if (
mode === "foreground" &&
!["0", "false"].includes(process.env.HA_DEV_BACKGROUND)
) {
const agent = detectCodingAgent();
if (agent) {
process.stdout.write(
`Detected coding agent (${agent}); starting in the background. ` +
`Set HA_DEV_BACKGROUND=0 to force foreground.\n`
);
mode = "background";
}
}
if (mode === "logs") {
return runLogs(args.suite, args.follow);
}
if (mode === "status") {
return runStatusSuite(args.suite, cfg);
}
if (mode === "stop") {
return runStopSuite(args.suite);
}
const handlers =
cfg.liveness === "health"
? {
foreground: () =>
runForegroundHealth(args.suite, cfg, args.fetchTranslations),
background: () =>
runBackgroundHealth(args.suite, cfg, args.fetchTranslations),
}
: {
foreground: () =>
runForegroundProcess(
args.suite,
cfg,
args.passthrough,
args.fetchTranslations
),
background: () =>
runBackgroundProcess(
args.suite,
cfg,
args.passthrough,
args.fetchTranslations
),
};
return handlers[mode]();
};
runCli(main);
-4
View File
@@ -1,13 +1,9 @@
// @ts-check
import globals from "globals";
import tseslint from "typescript-eslint";
import rootConfig from "../eslint.config.mjs";
export default tseslint.config(...rootConfig, {
languageOptions: {
globals: globals.node,
},
rules: {
"no-console": "off",
"import-x/no-extraneous-dependencies": "off",
@@ -1,3 +1,4 @@
/* global module */
// Browser-only replacement for core-js/internals/get-built-in-node-module.
// The original helper evaluates `Function('return require("...")')()`
// when it detects a Node environment, which causes a runtime
-29
View File
@@ -1,6 +1,5 @@
import gulp from "gulp";
import env from "../env.cjs";
import { createWorkflowLockTask } from "../output-lock.mjs";
import "./clean.js";
import "./compress.js";
import "./entry-html.js";
@@ -18,7 +17,6 @@ gulp.task(
async function setEnv() {
process.env.NODE_ENV = "development";
},
createWorkflowLockTask("develop-app"),
"clean",
gulp.parallel(
"gen-service-worker-app-dev",
@@ -38,7 +36,6 @@ gulp.task(
async function setEnv() {
process.env.NODE_ENV = "production";
},
createWorkflowLockTask("build-app"),
"clean",
gulp.parallel(
"gen-icons-json",
@@ -50,32 +47,6 @@ gulp.task(
"rspack-prod-app",
gulp.parallel("gen-pages-app-prod", "gen-service-worker-app-prod"),
// Don't compress running tests
...(env.isTestBuild() || env.isStatsBuild()
? []
: ["compress-app", "prune-compress-cache"])
)
);
gulp.task(
"build-app-modern",
gulp.series(
async function setEnv() {
process.env.NODE_ENV = "production";
},
createWorkflowLockTask("build-app-modern"),
"clean",
gulp.parallel(
"gen-icons-json",
"build-translations",
"build-locale-data",
"gen-licenses"
),
"copy-static-app",
"rspack-prod-app-modern",
gulp.parallel(
"gen-pages-app-prod-modern",
"gen-service-worker-app-prod-modern"
),
...(env.isTestBuild() || env.isStatsBuild() ? [] : ["compress-app"])
)
);
-7
View File
@@ -45,10 +45,3 @@ gulp.task(
])
)
);
gulp.task(
"clean-e2e-test-app",
gulp.parallel("clean-translations", async () =>
deleteSync([paths.e2eTestApp_output_root, paths.build_dir])
)
);
+2 -7
View File
@@ -2,10 +2,9 @@
import { constants } from "node:zlib";
import gulp from "gulp";
import brotli from "../brotli.mjs";
import { pruneCache } from "../compress-cache.mjs";
import brotli from "gulp-brotli";
import zopfli from "gulp-zopfli-green";
import paths from "../paths.cjs";
import zopfli from "../zopfli.mjs";
const filesGlob = "*.{js,json,css,svg,xml}";
const brotliOptions = {
@@ -58,7 +57,3 @@ gulp.task(
compressAppOtherZopfli
)
);
// Keep the compression cache under its size budget (LRU, this build pinned).
// No-op unless COMPRESS_CACHE_DIR is set.
gulp.task("prune-compress-cache", () => pruneCache());
-19
View File
@@ -1,5 +1,4 @@
import gulp from "gulp";
import { createWorkflowLockTask } from "../output-lock.mjs";
import "./clean.js";
import "./entry-html.js";
import "./gather-static.js";
@@ -14,7 +13,6 @@ gulp.task(
async function setEnv() {
process.env.NODE_ENV = "development";
},
createWorkflowLockTask("develop-demo"),
"clean-demo",
"translations-enable-merge-backend",
gulp.parallel(
@@ -34,7 +32,6 @@ gulp.task(
async function setEnv() {
process.env.NODE_ENV = "production";
},
createWorkflowLockTask("build-demo"),
"clean-demo",
// Cast needs to be backwards compatible and older HA has no translations
"translations-enable-merge-backend",
@@ -45,22 +42,6 @@ gulp.task(
)
);
gulp.task(
"build-demo-e2e",
gulp.series(
async function setEnv() {
process.env.NODE_ENV = "production";
},
"clean-demo",
// Cast needs to be backwards compatible and older HA has no translations
"translations-enable-merge-backend",
gulp.parallel("gen-icons-json", "build-translations", "build-locale-data"),
"copy-static-demo",
"rspack-prod-demo-e2e",
"gen-pages-demo-prod-e2e"
)
);
gulp.task(
"analyze-demo",
gulp.series(
+1 -15
View File
@@ -155,22 +155,8 @@ gulp.task("fetch-lokalise", async function () {
fs.mkdir(inDirBackend, { recursive: true }),
]);
// The backend project only provides entity_component translations, which are
// merged into the demo, gallery, cast and e2e builds. The shipped app fetches
// them live from core, so builds that only produce the app (release, release
// landing-page) can skip this second, whole-project export to save time.
const projects = Object.entries(lokaliseProjects).filter(
([project]) =>
!(project === "backend" && process.env.SKIP_BACKEND_TRANSLATIONS)
);
if (projects.length !== Object.keys(lokaliseProjects).length) {
console.log(
"Skipping backend translations download (SKIP_BACKEND_TRANSLATIONS)"
);
}
await Promise.all(
projects.map(async ([project, projectId]) => {
Object.entries(lokaliseProjects).map(async ([project, projectId]) => {
try {
const exportProcess = await lokaliseApi
.files()
-59
View File
@@ -1,59 +0,0 @@
import gulp from "gulp";
import { createWorkflowLockTask } from "../output-lock.mjs";
import "./clean.js";
import "./entry-html.js";
import "./gather-static.js";
import "./gen-icons-json.js";
import "./translations.js";
import "./rspack.js";
gulp.task(
"develop-e2e-test-app",
gulp.series(
async function setEnv() {
process.env.NODE_ENV = "development";
},
createWorkflowLockTask("develop-e2e-test-app"),
"clean-e2e-test-app",
"translations-enable-merge-backend",
gulp.parallel(
"gen-icons-json",
"gen-pages-e2e-test-app-dev",
"build-translations",
"build-locale-data"
),
"copy-static-e2e-test-app",
"rspack-dev-server-e2e-test-app"
)
);
gulp.task(
"build-e2e-test-app",
gulp.series(
async function setEnv() {
process.env.NODE_ENV = "production";
},
createWorkflowLockTask("build-e2e-test-app"),
"clean-e2e-test-app",
"translations-enable-merge-backend",
gulp.parallel("gen-icons-json", "build-translations", "build-locale-data"),
"copy-static-e2e-test-app",
"rspack-prod-e2e-test-app",
"gen-pages-e2e-test-app-prod"
)
);
gulp.task(
"build-e2e-test-app-e2e",
gulp.series(
async function setEnv() {
process.env.NODE_ENV = "production";
},
"clean-e2e-test-app",
"translations-enable-merge-backend",
gulp.parallel("gen-icons-json", "build-translations", "build-locale-data"),
"copy-static-e2e-test-app",
"rspack-prod-e2e-test-app-e2e",
"gen-pages-e2e-test-app-prod"
)
);
+5 -64
View File
@@ -1,3 +1,4 @@
/* global process */
// Tasks to generate entry HTML
import {
@@ -25,7 +26,7 @@ const SAFARI_TO_MACOS = {
16: [11, 0, 0],
17: [12, 0, 0],
18: [13, 0, 0],
26: [14, 6, 0],
26: [26, 0, 0],
};
const getCommonTemplateVars = () => {
@@ -58,12 +59,6 @@ const getCommonTemplateVars = () => {
return {
modernRegex: compileRegex(browserRegexes.concat(haMacOSRegex)).toString(),
hassUrl: process.env.HASS_URL || "",
// Single source for the stale-build recovery patterns, shared with the
// bundled src/util/recover-stale-build.ts and injected into the inline
// boot guard (_bootstrap_recovery.html.template).
staleBuildPatterns: fs.readJsonSync(
resolve(paths.root_dir, "src/util/stale-build-patterns.json")
),
};
};
@@ -89,7 +84,7 @@ const minifyHtml = (content, ext) => {
...htmlMinifierOptions,
conservativeCollapse: false,
minifyJS: terserOptions({
latestBuild: false, // Shared scripts must satisfy the legacy targets
latestBuild: false, // Shared scripts should be ES5
isTestBuild: true, // Don't need source maps
}),
}).then((wrapped) =>
@@ -113,9 +108,6 @@ const genPagesDevTask =
resolve(inputRoot, inputSub, `${page}.template`),
{
...commonVars,
// Dev entries are unhashed, so the stale-index recovery guard has
// nothing to key off and rebuild churn could cause spurious reloads.
useCacheRecovery: false,
latestEntryJS: entries.map(
(entry) => `${publicRoot}/frontend_latest/${entry}.js`
),
@@ -155,15 +147,10 @@ const genPagesProdTask =
resolve(inputRoot, inputSub, `${page}.template`),
{
...commonVars,
// Recover from a stale index.html that pins deleted hashed entry
// bundles (see _bootstrap_recovery.html.template).
useCacheRecovery: true,
latestEntryJS: entries.map((entry) => latestManifest[`${entry}.js`]),
es5EntryJS: outputES5
? entries.map((entry) => es5Manifest[`${entry}.js`])
: [],
es5EntryJS: entries.map((entry) => es5Manifest[`${entry}.js`]),
latestCustomPanelJS: latestManifest["custom-panel.js"],
es5CustomPanelJS: outputES5 ? es5Manifest["custom-panel.js"] : "",
es5CustomPanelJS: es5Manifest["custom-panel.js"],
}
);
minifiedHTML.push(
@@ -198,17 +185,6 @@ gulp.task(
)
);
gulp.task(
"gen-pages-app-prod-modern",
genPagesProdTask(
APP_PAGE_ENTRIES,
paths.root_dir,
paths.app_output_root,
paths.app_output_latest,
undefined
)
);
const CAST_PAGE_ENTRIES = {
"faq.html": ["launcher"],
"index.html": ["launcher"],
@@ -250,16 +226,6 @@ gulp.task(
)
);
gulp.task(
"gen-pages-demo-prod-e2e",
genPagesProdTask(
DEMO_PAGE_ENTRIES,
paths.demo_dir,
paths.demo_output_root,
paths.demo_output_latest
)
);
const GALLERY_PAGE_ENTRIES = { "index.html": ["entrypoint"] };
gulp.task(
@@ -302,28 +268,3 @@ gulp.task(
paths.landingPage_output_es5
)
);
const E2E_TEST_APP_PAGE_ENTRIES = {
"index.html": ["main"],
"dashboard.html": ["dashboard"],
"onboarding.html": ["onboarding"],
};
gulp.task(
"gen-pages-e2e-test-app-dev",
genPagesDevTask(
E2E_TEST_APP_PAGE_ENTRIES,
paths.e2eTestApp_dir,
paths.e2eTestApp_output_root
)
);
gulp.task(
"gen-pages-e2e-test-app-prod",
genPagesProdTask(
E2E_TEST_APP_PAGE_ENTRIES,
paths.e2eTestApp_dir,
paths.e2eTestApp_output_root,
paths.e2eTestApp_output_latest
)
);
@@ -52,23 +52,6 @@ gulp.task("fetch-nightly-translations", async function () {
currentArtifact = null;
}
try {
await fetchTranslations(currentArtifact);
} catch (err) {
// Local builds should work offline or without valid GitHub credentials,
// so fall back to English only. CI must fail instead of silently
// building without translations.
if (process.env.CI) {
throw err;
}
console.warn(
"Failed to fetch nightly translations, continuing with English only:",
err?.message || err
);
}
});
async function fetchTranslations(currentArtifact) {
// To store file writing promises
const createExtractDir = mkdir(EXTRACT_DIR, { recursive: true });
const writings = [];
@@ -147,6 +130,11 @@ async function fetchTranslations(currentArtifact) {
if (!latestArtifact) {
throw Error("Latest nightly workflow run has no translations artifact");
}
writings.push(
createExtractDir.then(
writeFile(ARTIFACT_FILE, JSON.stringify(latestArtifact, null, 2))
)
);
// Remove the current translations
const deleteCurrent = Promise.all(writings).then(
@@ -172,12 +160,7 @@ async function fetchTranslations(currentArtifact) {
await new Promise((resolve, reject) => {
extractStream.on("close", resolve).on("error", reject);
});
// Record the artifact only after successful extraction, so a failed fetch
// is retried by the next build instead of being considered current.
await createExtractDir;
await writeFile(ARTIFACT_FILE, JSON.stringify(latestArtifact, null, 2));
}
});
gulp.task(
"setup-and-fetch-nightly-translations",
+3 -23
View File
@@ -1,10 +1,9 @@
import fs from "fs";
import { glob } from "glob";
import gulp from "gulp";
import { load as loadYaml } from "js-yaml";
import yaml from "js-yaml";
import { marked } from "marked";
import path from "path";
import { createWorkflowLockTask } from "../output-lock.mjs";
import paths from "../paths.cjs";
import "./clean.js";
import "./entry-html.js";
@@ -48,7 +47,7 @@ gulp.task("gather-gallery-pages", async function gatherPages() {
if (descriptionContent.startsWith("---")) {
const metadataEnd = descriptionContent.indexOf("---", 3);
metadata = loadYaml(descriptionContent.substring(3, metadataEnd));
metadata = yaml.load(descriptionContent.substring(3, metadataEnd));
descriptionContent = descriptionContent
.substring(metadataEnd + 3)
.trim();
@@ -104,29 +103,12 @@ gulp.task("gather-gallery-pages", async function gatherPages() {
if (!toProcess) {
console.error("Unknown category", group.category);
if (!group.subsections && !group.pages) {
if (!group.pages) {
group.pages = [];
}
continue;
}
if (group.subsections) {
// Listed pages keep their per-subsection order.
for (const subsection of group.subsections) {
for (const page of subsection.pages) {
if (!toProcess.delete(page)) {
console.error("Found unreferenced demo", page);
}
}
}
// Any remaining pages land in a trailing "Other" subsection.
const leftover = Array.from(toProcess).sort();
if (leftover.length) {
group.subsections.push({ header: "Other", pages: leftover });
}
continue;
}
// Any pre-defined groups will not be sorted.
if (group.pages) {
for (const page of group.pages) {
@@ -165,7 +147,6 @@ gulp.task(
async function setEnv() {
process.env.NODE_ENV = "development";
},
createWorkflowLockTask("develop-gallery"),
"clean-gallery",
"translations-enable-merge-backend",
gulp.parallel(
@@ -197,7 +178,6 @@ gulp.task(
async function setEnv() {
process.env.NODE_ENV = "production";
},
createWorkflowLockTask("build-gallery"),
"clean-gallery",
"translations-enable-merge-backend",
gulp.parallel(
+39 -35
View File
@@ -4,7 +4,6 @@ import fs from "fs-extra";
import gulp from "gulp";
import path from "path";
import paths from "../paths.cjs";
import { ensureMapAssets, mapAssetsDir } from "./map-assets.js";
const npmPath = (...parts) =>
path.resolve(paths.root_dir, "node_modules", ...parts);
@@ -42,6 +41,37 @@ function copyMdiIcons(staticDir) {
fs.copySync(polyPath("build/mdi"), staticPath("mdi"));
}
function copyPolyfills(staticDir) {
const staticPath = genStaticPath(staticDir);
// For custom panels using ES5 builds that don't use Babel 7+
copyFileDir(
npmPath("@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"),
staticPath("polyfills/")
);
// Web Component polyfills and adapters
copyFileDir(
npmPath("@webcomponents/webcomponentsjs/webcomponents-bundle.js"),
staticPath("polyfills/")
);
copyFileDir(
npmPath("@webcomponents/webcomponentsjs/webcomponents-bundle.js.map"),
staticPath("polyfills/")
);
// Lit polyfill support
fs.copySync(
npmPath("lit/polyfill-support.js"),
path.join(staticPath("polyfills/"), "lit-polyfill-support.js")
);
// dialog-polyfill css
copyFileDir(
npmPath("dialog-polyfill/dialog-polyfill.css"),
staticPath("polyfills/")
);
}
function copyFonts(staticDir) {
const staticPath = genStaticPath(staticDir);
// Local fonts
@@ -59,7 +89,7 @@ function copyQrScannerWorker(staticDir) {
copyFileDir(npmPath("qr-scanner/qr-scanner-worker.min.js"), staticPath("js"));
}
async function copyMapPanel(staticDir) {
function copyMapPanel(staticDir) {
const staticPath = genStaticPath(staticDir);
copyFileDir(
npmPath("leaflet/dist/leaflet.css"),
@@ -73,16 +103,6 @@ async function copyMapPanel(staticDir) {
npmPath("leaflet/dist/images"),
staticPath("images/leaflet/images/")
);
// Style, glyphs and sprites for the vector base map
await ensureMapAssets();
fs.copySync(mapAssetsDir, staticPath("map/"));
copyFileDir(
npmPath("@mapbox/mapbox-gl-rtl-text/dist/mapbox-gl-rtl-text.js"),
staticPath("map/")
);
// Controls and popups of the native MapLibre engine
copyFileDir(npmPath("maplibre-gl/dist/maplibre-gl.css"), staticPath("map/"));
}
function copyZXingWasm(staticDir) {
@@ -112,13 +132,14 @@ gulp.task("copy-static-app", async () => {
const staticDir = paths.app_output_static;
// Basic static files
fs.copySync(polyPath("public"), paths.app_output_root);
copyPolyfills(staticDir);
copyFonts(staticDir);
copyTranslations(staticDir);
copyLocaleData(staticDir);
copyMdiIcons(staticDir);
// Panel assets
await copyMapPanel(staticDir);
copyMapPanel(staticDir);
// Qr Scanner assets
copyZXingWasm(staticDir);
@@ -133,7 +154,8 @@ gulp.task("copy-static-demo", async () => {
);
// Copy demo static files
fs.copySync(path.resolve(paths.demo_dir, "public"), paths.demo_output_root);
await copyMapPanel(paths.demo_output_static);
copyPolyfills(paths.demo_output_static);
copyMapPanel(paths.demo_output_static);
copyFonts(paths.demo_output_static);
copyTranslations(paths.demo_output_static);
copyLocaleData(paths.demo_output_static);
@@ -145,7 +167,8 @@ gulp.task("copy-static-cast", async () => {
fs.copySync(polyPath("public/static"), paths.cast_output_static);
// Copy cast static files
fs.copySync(path.resolve(paths.cast_dir, "public"), paths.cast_output_root);
await copyMapPanel(paths.cast_output_static);
copyPolyfills(paths.cast_output_static);
copyMapPanel(paths.cast_output_static);
copyFonts(paths.cast_output_static);
copyTranslations(paths.cast_output_static);
copyLocaleData(paths.cast_output_static);
@@ -161,7 +184,7 @@ gulp.task("copy-static-gallery", async () => {
paths.gallery_output_root
);
await copyMapPanel(paths.gallery_output_static);
copyMapPanel(paths.gallery_output_static);
copyFonts(paths.gallery_output_static);
copyTranslations(paths.gallery_output_static);
copyLocaleData(paths.gallery_output_static);
@@ -178,22 +201,3 @@ gulp.task("copy-static-landing-page", async () => {
copyFonts(paths.landingPage_output_static);
copyTranslations(paths.landingPage_output_static);
});
gulp.task("copy-static-e2e-test-app", async () => {
// Copy app static files (icons, polyfills, etc.)
fs.copySync(
polyPath("public/static"),
path.resolve(paths.e2eTestApp_output_root, "static")
);
// Copy e2e test app public files (manifest, sw stubs)
const e2ePublic = path.resolve(paths.e2eTestApp_dir, "public");
if (fs.existsSync(e2ePublic)) {
fs.copySync(e2ePublic, paths.e2eTestApp_output_root);
}
await copyMapPanel(paths.e2eTestApp_output_static);
copyFonts(paths.e2eTestApp_output_static);
copyTranslations(paths.e2eTestApp_output_static);
copyLocaleData(paths.e2eTestApp_output_static);
copyMdiIcons(paths.e2eTestApp_output_static);
});
-40
View File
@@ -1,40 +0,0 @@
import { writeFile } from "node:fs/promises";
import { join } from "node:path";
import process from "node:process";
import gulp from "gulp";
import paths from "../paths.cjs";
const SOURCE_URL =
process.env.SENSOR_METADATA_URL ||
"https://raw.githubusercontent.com/home-assistant/core/refs/heads/dev/homeassistant/generated/device_classes.json";
const TARGET = join(paths.root_dir, "src", "data", "device_classes.ts");
gulp.task("gen-device-classes", async () => {
const response = await fetch(SOURCE_URL);
if (!response.ok) {
throw new Error(`Failed to fetch ${SOURCE_URL}: ${response.status}`);
}
const data = await response.json();
const domainDeviceClasses = data ?? {};
if (!Object.keys(domainDeviceClasses).length) {
throw new Error(`No device classes found in ${SOURCE_URL}`);
}
const content = `// This file is auto-generated from Home Assistant Core's
// entity platform device classes. Do not edit by hand.
// Regenerate with \`script/gen_device_classes\`.
export const DOMAIN_DEVICE_CLASSES: Record<string, string[]> = {
${Object.entries(domainDeviceClasses)
.map(
([domain, deviceClasses]) =>
` "${domain}": [${deviceClasses.map((deviceClass) => `"${deviceClass}"`).join(", ")}],`
)
.join("\n")}
};
`;
await writeFile(TARGET, content);
});
@@ -1,83 +0,0 @@
import { writeFile } from "node:fs/promises";
import { join } from "node:path";
import process from "node:process";
import gulp from "gulp";
import paths from "../paths.cjs";
const SOURCE_URL =
process.env.SENSOR_METADATA_URL ||
"https://raw.githubusercontent.com/home-assistant/core/dev/homeassistant/generated/sensor.json";
const TARGET = join(
paths.root_dir,
"src",
"data",
"sensor_entity_constants.ts"
);
gulp.task("gen-sensor-entity-constants", async () => {
const response = await fetch(SOURCE_URL);
if (!response.ok) {
throw new Error(`Failed to fetch ${SOURCE_URL}: ${response.status}`);
}
const data = await response.json();
const numericDeviceClasses = [...(data.numeric_device_classes ?? [])].sort();
const deviceClassUnits = data.device_class_units ?? {};
const convertibleClassUnits = data.convertible_units ?? {};
const stateClasses = data.state_classes ?? [];
const stateClassUnits = data.state_class_units ?? {};
if (
!numericDeviceClasses.length ||
!stateClasses.length ||
!Object.keys(deviceClassUnits).length ||
!Object.keys(stateClassUnits).length
) {
throw new Error(
`No sensor device classes, state classes or units found in ${SOURCE_URL}`
);
}
const content = `// This file is auto-generated from Home Assistant Core's \`DEVICE_CLASS_UNITS\`
// and \`STATE_CLASS_UNITS\`) and \`SensorDeviceClass\`
// (all values minus \`NON_NUMERIC_DEVICE_CLASSES\`). Do not edit by hand.
// Regenerate with \`script/gen_sensor_entity_constants\`.
export const SENSOR_NUMERIC_DEVICE_CLASSES: string[] = [
${numericDeviceClasses.map((deviceClass) => ` "${deviceClass}",`).join("\n")}
];
export const SENSOR_DEVICE_CLASS_UNITS: Record<string, (string | null)[]> = {
${Object.entries(deviceClassUnits)
.map(
([deviceClass, units]) =>
` ${deviceClass}: [${units.map((u) => (u === null ? "null" : `"${u}"`)).join(", ")}],`
)
.join("\n")}
};
export const SENSOR_DEVICE_CLASS_CONVERTIBLE_UNITS: Record<string, (string | null)[]> = {
${Object.entries(convertibleClassUnits)
.map(
([deviceClass, units]) =>
` ${deviceClass}: [${units.map((u) => (u === null ? "null" : `"${u}"`)).join(", ")}],`
)
.join("\n")}
};
export const SENSOR_STATE_CLASSES: string[] = [
${stateClasses.map((stateClass) => ` "${stateClass}",`).join("\n")}
];
export const SENSOR_STATE_CLASS_UNITS: Record<string, string[]> = {
${Object.entries(stateClassUnits)
.map(
([stateClass, units]) =>
` ${stateClass}: [${units.map((u) => (u === null ? "null" : `"${u}"`)).join(", ")}],`
)
.join("\n")}
};
`;
await writeFile(TARGET, content);
});
-5
View File
@@ -4,18 +4,13 @@ import "./clean.js";
import "./compress.js";
import "./demo.js";
import "./download-translations.js";
import "./e2e-test-app.js";
import "./entry-html.js";
import "./fetch-nightly-translations.js";
import "./gallery.js";
import "./gather-static.js";
import "./gen-device-classes.js";
import "./gen-icons-json.js";
import "./gen-sensor-entity-constants.js";
import "./landing-page.js";
import "./locale-data.js";
import "./map-assets.js";
import "./map-sprites.js";
import "./rspack.js";
import "./service-worker.js";
import "./translations.js";
+30 -43
View File
@@ -1,6 +1,6 @@
// Gulp task to generate third-party license notices.
import { readFile, access, readdir } from "fs/promises";
import { readFile, access } from "fs/promises";
import { generateLicenseFile } from "generate-license-file";
import gulp from "gulp";
import path from "path";
@@ -11,71 +11,58 @@ const OUTPUT_FILE = path.join(
"third-party-licenses.txt"
);
const NODE_MODULES = path.resolve(paths.root_dir, "node_modules");
// The echarts package ships an Apache-2.0 NOTICE file that must be
// redistributed alongside the compiled output per Apache License §4(d).
const NOTICE_FILES = [path.join(NODE_MODULES, "echarts/NOTICE")];
const NOTICE_FILES = [
path.resolve(paths.root_dir, "node_modules/echarts/NOTICE"),
];
// Some packages need a manual license override (e.g. they ship multiple
// license files and we must pick the right one for the bundled code).
// type-fest ships two license files (MIT for code, CC0 for types).
// We use the MIT license since that covers the bundled code.
//
// Each entry is pinned to a specific version. If a package is updated,
// this list must be reviewed and the version updated after verifying
// that the new version's license still matches. The build will fail if
// the pinned version is no longer installed.
// that the new version's license still matches. The build will fail
// if the installed version does not match the pinned version.
const LICENSE_OVERRIDES = [
{
// type-fest ships two license files (MIT for code, CC0 for types).
// We use the MIT license since that covers the bundled code.
packageName: "type-fest",
version: "5.8.0",
licenseFile: "license-mit",
version: "5.7.0",
licensePath: path.resolve(
paths.root_dir,
"node_modules/type-fest/license-mit"
),
},
];
// Locate the directory of an installed package matching an exact version.
//
// pnpm stores every installed version under
// node_modules/.pnpm/<name>@<version>[(peers)]/node_modules/<name>, with the
// "/" of scoped names replaced by "+". Looking there finds the pinned version
// whether or not it is the one linked at the top level.
async function findPackageDir(packageName, version) {
const storeDir = path.join(NODE_MODULES, ".pnpm");
const prefix = `${packageName.replace("/", "+")}@${version}`;
const entries = await readdir(storeDir).catch(() => []);
for (const entry of entries) {
if (entry !== prefix && !entry.startsWith(`${prefix}(`)) {
continue;
}
const dir = path.join(storeDir, entry, "node_modules", packageName);
// eslint-disable-next-line no-await-in-loop
const pkg = await readFile(path.join(dir, "package.json"), "utf-8")
.then(JSON.parse)
.catch(() => null);
if (pkg?.version === version) {
return dir;
}
}
return null;
}
gulp.task("gen-licenses", async () => {
const licenseOverrides = {};
for (const { packageName, version, licenseFile } of LICENSE_OVERRIDES) {
// eslint-disable-next-line no-await-in-loop
const packageDir = await findPackageDir(packageName, version);
for (const { packageName, version, licensePath } of LICENSE_OVERRIDES) {
const pkgJsonPath = path.resolve(
paths.root_dir,
`node_modules/${packageName}/package.json`
);
if (!packageDir) {
let packageJSON;
try {
// eslint-disable-next-line no-await-in-loop
packageJSON = JSON.parse(await readFile(pkgJsonPath, "utf-8"));
} catch {
throw new Error(
`License override for "${packageName}" is pinned to version ${version}, but that version is not installed. ` +
`package.json for "${packageName}" not found or unreadable at ${pkgJsonPath}`
);
}
if (packageJSON.version !== version) {
throw new Error(
`License override for "${packageName}" is pinned to version ${version}, but found version ${packageJSON.version}. ` +
`Please verify the new version's license and update the override in build-scripts/gulp/licenses.js.`
);
}
const licensePath = path.join(packageDir, licenseFile);
try {
// eslint-disable-next-line no-await-in-loop
await access(licensePath);
+3 -10
View File
@@ -47,23 +47,16 @@ const convertToJSON = async (
`Intl\\.${obj}\\.${addFunc}\\((?<data>.*)\\)`,
"s"
);
const encodedData = localeData.match(
/JSON\.parse\((?<data>"(?:[^"\\]|\\.)*")\)/
)?.groups?.data;
localeData = firstBlock.match(dataRegex)?.groups?.data;
if (!localeData && !encodedData) {
if (!localeData) {
throw Error(`Failed to extract data for language ${lang} from ${pkg}`);
}
// Parse to validate JSON, then stringify to minify
try {
localeData = JSON.stringify(
JSON.parse(encodedData ? JSON.parse(encodedData) : localeData)
);
localeData = JSON.stringify(JSON.parse(localeData));
await writeFile(join(outDir, `${pkg}/${lang}.json`), localeData);
} catch (e) {
throw Error(`Failed to parse JSON for language ${lang} from ${pkg}: ${e}`, {
cause: e,
});
throw Error(`Failed to parse JSON for language ${lang} from ${pkg}: ${e}`);
}
};
-120
View File
@@ -1,120 +0,0 @@
// Generates the MapLibre styles for the vector base map. Only the styles:
// glyphs and tiles come from core's proxy, the sprite sheet ships with the
// frontend (see map-sprites.js). They are generated here because core has no
// node toolchain to run @versatiles/style with.
//
// Only the default pair is written out; anything else is built in the browser
// from the same builder, which is why the preparation is shared with the
// frontend and why the asset URLs are written alongside the styles.
import { createHash } from "node:crypto";
import { readFile, writeFile } from "node:fs/promises";
import path from "node:path";
import { osm } from "@versatiles/style";
import fs from "fs-extra";
import gulp from "gulp";
import paths from "../paths.cjs";
import { finalizeMapStyle } from "../../src/common/map/map-style-transforms.ts";
import {
HA_MAP_COLORS,
HA_MAP_COLORS_DARK,
} from "../../src/common/map/ha-map-palette.ts";
import {
missingSprites,
SHEET_FILES,
SPRITE_SHEET,
spritesDir,
} from "./map-sprites.js";
const PROXY_PATH = "/api/map_tiles";
const outputDir = path.resolve(paths.build_dir, "map");
// Core serves /static with a month of max-age, so a re-vendored sheet would
// otherwise be read from cache next to a style expecting the new one.
const sheetHash = async () => {
const contents = await Promise.all(
SHEET_FILES.map((file) => readFile(path.join(spritesDir, file)))
);
const hash = createHash("sha256");
contents.forEach((content) => hash.update(content));
return hash.digest("hex").slice(0, 8);
};
const styleUrls = (spriteVersion) => ({
// Keeps the generated URLs origin relative.
base: "",
glyphsPattern: `${PROXY_PATH}/fonts/{fontstack}/{range}.pbf`,
sprite: [
{
id: SPRITE_SHEET,
url: `/static/map/sprites/${SPRITE_SHEET}?v=${spriteVersion}`,
},
],
});
const checkSprites = (name, style, sheet) => {
const missing = missingSprites(style, sheet);
if (missing.length) {
throw new Error(
`Style "${name}" references icons missing from the bundled ${SPRITE_SHEET} ` +
`sprite sheet: ${missing.join(", ")}. Run \`pnpm exec gulp update-map-sprites\` ` +
`and commit the result.`
);
}
return style;
};
// The styles a card can pick, each as a light and a dark palette. Kept in sync
// with MAP_STYLES in src/common/map/map-styles.ts.
const STYLES = ["colorful", "natural", "muted", "gray", "toner"];
const PALETTES = STYLES.flatMap((style) => [style, `${style}-dark`]);
// Colors baked in, so the map a dashboard shows without configuration costs
// no builder and no second request.
const SHIPPED = [
["light", "colorful", HA_MAP_COLORS],
["dark", "colorful-dark", HA_MAP_COLORS_DARK],
];
const generateStyles = async () => {
const sheet = await fs.readJson(
path.join(spritesDir, `${SPRITE_SHEET}.json`)
);
const urls = styleUrls(await sheetHash());
// Built so a bump that needs an icon the sheet lacks fails here, not in a
// browser. Recoloring cannot add icons, so the palettes cover it.
PALETTES.forEach((theme) => checkSprites(theme, osm({ theme, urls }), sheet));
return urls;
};
const buildMapAssets = async () => {
await fs.emptyDir(outputDir);
const urls = await generateStyles();
await Promise.all([
// Read by src/common/map/build-map-style.ts, which cannot know the hash
// of the sprite sheet this build vendored.
writeFile(path.join(outputDir, "urls.json"), JSON.stringify(urls)),
...SHIPPED.map(([name, theme, colors]) =>
writeFile(
path.join(outputDir, `${name}.json`),
JSON.stringify(finalizeMapStyle(name, osm({ theme, colors, urls })))
)
),
]);
};
// Shared so it does not have to be wired into every pipeline separately.
let pending;
export const ensureMapAssets = () => {
pending ??= buildMapAssets();
return pending;
};
gulp.task("build-map-assets", ensureMapAssets);
// Runs in the required lint job so a @versatiles/style bump that needs new
// icons cannot merge before the sheet is re-vendored on that branch.
gulp.task("check-map-sprites", generateStyles);
export const mapAssetsDir = outputDir;
-80
View File
@@ -1,80 +0,0 @@
import { spawn } from "node:child_process";
import { createRequire } from "node:module";
import path from "node:path";
import { Readable } from "node:stream";
import { pipeline } from "node:stream/promises";
import gulp from "gulp";
import paths from "../paths.cjs";
const require = createRequire(import.meta.url);
export const SPRITE_SHEET = "base";
export const spritesDir = path.resolve(
paths.root_dir,
"public",
"static",
"map",
"sprites"
);
export const SHEET_FILES = [".json", ".png", "@2x.json", "@2x.png"].map(
(suffix) => `${SPRITE_SHEET}${suffix}`
);
// The only style properties that resolve to a sprite image.
const IMAGE_PROPERTIES = [
"icon-image",
"fill-pattern",
"line-pattern",
"fill-extrusion-pattern",
"background-pattern",
];
const collectStrings = (value, into) => {
if (typeof value === "string") {
into.push(value);
} else if (Array.isArray(value)) {
value.forEach((item) => collectStrings(item, into));
} else if (value && typeof value === "object") {
Object.values(value).forEach((item) => collectStrings(item, into));
}
return into;
};
export const spriteIds = (style) => {
const prefix = `${SPRITE_SHEET}:`;
const strings = style.layers.flatMap((layer) =>
IMAGE_PROPERTIES.flatMap((property) =>
collectStrings([layer.layout?.[property], layer.paint?.[property]], [])
)
);
return new Set(
strings
.filter((value) => value.startsWith(prefix))
.map((value) => value.slice(prefix.length))
);
};
export const missingSprites = (style, sheet) =>
[...spriteIds(style)].filter((id) => !(id in sheet));
gulp.task("update-map-sprites", async () => {
const { version } = require("@versatiles/style/package.json");
const url = `https://github.com/versatiles-org/versatiles-style/releases/download/v${version}/sprites.tar.gz`;
const response = await fetch(url);
if (!response.ok || !response.body) {
throw new Error(`Failed to fetch ${url}: ${response.status}`);
}
const tar = spawn("tar", ["-xzf", "-", "-C", spritesDir, ...SHEET_FILES], {
stdio: ["pipe", "inherit", "inherit"],
});
const exited = new Promise((resolve, reject) => {
tar.on("error", reject);
tar.on("close", (code) =>
code === 0 ? resolve() : reject(new Error(`tar exited with ${code}`))
);
});
await pipeline(Readable.fromWeb(response.body), tar.stdin);
await exited;
});
-45
View File
@@ -1,45 +0,0 @@
import merge from "lodash.merge";
const isMergeableObject = (value) =>
typeof value === "object" && value !== null && !Array.isArray(value);
// Keys that must never be written to, to avoid prototype pollution when the
// overlay comes from an untrusted source (JSON.parse can produce an own
// `__proto__` key from `{"__proto__": ...}`).
const FORBIDDEN_KEYS = new Set(["__proto__", "constructor", "prototype"]);
// Deep-merge `overlay` onto `base`, keeping only keys that already exist as own
// properties of `base`. Overlay keys with no counterpart in the base - e.g.
// translations for source strings that have since been removed from or renamed
// in en.json but still linger in Lokalise - are dropped so we don't ship stale
// keys. `base` is mutated and returned.
export const restrictedMerge = (base, overlay) => {
for (const key of Object.keys(overlay)) {
// Own-property check (not `in`) so inherited keys like `__proto__` or
// `toString` from the overlay are ignored rather than merged.
if (FORBIDDEN_KEYS.has(key) || !Object.hasOwn(base, key)) {
continue;
}
const baseValue = base[key];
const overlayValue = overlay[key];
if (isMergeableObject(baseValue) && isMergeableObject(overlayValue)) {
restrictedMerge(baseValue, overlayValue);
} else if (
!isMergeableObject(baseValue) &&
!isMergeableObject(overlayValue)
) {
base[key] = overlayValue;
}
// Mismatched shapes keep the base (English) value as a safe fallback.
}
return base;
};
// Merge translation `objects` onto `startObj`. When `prune` is set, the result
// is restricted to the key shape of `startObj` (the English master), so keys
// that no longer exist in en.json are not shipped. Otherwise keys are merged
// additively (used when building the English master itself, which starts empty).
export const mergeTranslations = (startObj, objects, prune = false) =>
prune
? objects.reduce(restrictedMerge, startObj)
: merge(startObj, ...objects);
+10 -116
View File
@@ -14,7 +14,6 @@ import {
createDemoConfig,
createGalleryConfig,
createLandingPageConfig,
createE2eTestAppConfig,
} from "../rspack.cjs";
const bothBuilds = (createConfigFunc, params) => [
@@ -34,10 +33,7 @@ const isWsl =
* compiler: import("@rspack/core").Compiler,
* contentBase: string,
* port: number,
* listenHost?: string,
* open?: boolean,
* logUrlAfterFirstBuild?: boolean,
* suite?: string,
* listenHost?: string
* }}
*/
const runDevServer = async ({
@@ -45,32 +41,16 @@ const runDevServer = async ({
contentBase,
port,
listenHost = undefined,
open = true,
logUrlAfterFirstBuild = false,
proxy = undefined,
suite = undefined,
}) => {
if (listenHost === undefined) {
// For dev container, we need to listen on all hosts
listenHost = env.isDevContainer() ? "0.0.0.0" : "localhost";
}
const url = `http://localhost:${port}`;
let loggedUrl = false;
if (logUrlAfterFirstBuild) {
compiler.hooks.done.tap("log-dev-server-url", () => {
if (loggedUrl) {
return;
}
loggedUrl = true;
setTimeout(() => {
log("[rspack-dev-server]", `Project is running at ${url}`);
}, 0);
});
}
const server = new RspackDevServer(
{
hot: false,
open,
open: true,
host: listenHost,
port,
static: {
@@ -83,19 +63,6 @@ const runDevServer = async ({
!error?.message?.includes("ResizeObserver loop"),
},
},
setupMiddlewares: (middlewares) => {
// Status endpoint so the dev-server manager can confirm this is our
// server for the expected suite. Unshifted to beat the static handler.
middlewares.unshift({
name: "ha-dev-status",
path: "/__ha_dev_status",
middleware: (_req, res) => {
res.setHeader("Content-Type", "application/json");
res.end(JSON.stringify({ server: "ha-frontend-dev", suite, port }));
},
});
return middlewares;
},
proxy,
},
compiler
@@ -103,12 +70,10 @@ const runDevServer = async ({
await server.start();
// Server listening
if (!logUrlAfterFirstBuild) {
log("[rspack-dev-server]", `Project is running at ${url}`);
}
log("[rspack-dev-server]", `Project is running at http://localhost:${port}`);
};
const doneHandler = () => (err, stats) => {
const doneHandler = (done) => (err, stats) => {
if (err) {
log.error(err.stack || err);
if (err.details) {
@@ -122,26 +87,18 @@ const doneHandler = () => (err, stats) => {
}
log(`Build done @ ${new Date().toLocaleTimeString()}`);
if (done) {
done();
}
};
const prodBuild = (conf) =>
new Promise((resolve, reject) => {
new Promise((resolve) => {
rspack(
conf,
// Resolve promise when done. Because we pass a callback, rspack closes itself
(err, stats) => {
if (err) {
reject(err);
} else if (stats.hasErrors()) {
reject(Error(stats.toString("errors-only")));
} else {
if (stats.hasWarnings()) {
console.log(stats.toString("minimal"));
}
log(`Build done @ ${new Date().toLocaleTimeString()}`);
resolve();
}
}
doneHandler(resolve)
);
});
@@ -168,17 +125,6 @@ gulp.task("rspack-prod-app", () =>
)
);
gulp.task("rspack-prod-app-modern", () =>
prodBuild(
createAppConfig({
isProdBuild: true,
isStatsBuild: env.isStatsBuild(),
isTestBuild: env.isTestBuild(),
latestBuild: true,
})
)
);
gulp.task("rspack-dev-server-demo", () =>
runDevServer({
compiler: rspack(
@@ -186,8 +132,6 @@ gulp.task("rspack-dev-server-demo", () =>
),
contentBase: paths.demo_output_root,
port: 8090,
open: false,
suite: "demo",
})
);
@@ -196,18 +140,6 @@ gulp.task("rspack-prod-demo", () =>
bothBuilds(createDemoConfig, {
isProdBuild: true,
isStatsBuild: env.isStatsBuild(),
isTestBuild: env.isTestBuild(),
})
)
);
gulp.task("rspack-prod-demo-e2e", () =>
prodBuild(
createDemoConfig({
isProdBuild: true,
latestBuild: true,
isStatsBuild: env.isStatsBuild(),
isTestBuild: env.isTestBuild(),
})
)
);
@@ -221,7 +153,6 @@ gulp.task("rspack-dev-server-cast", () =>
port: 8080,
// Accessible from the network, because that's how Cast hits it.
listenHost: "0.0.0.0",
suite: "cast",
})
);
@@ -241,9 +172,6 @@ gulp.task("rspack-dev-server-gallery", () =>
contentBase: paths.gallery_output_root,
port: 8100,
listenHost: "0.0.0.0",
open: false,
logUrlAfterFirstBuild: true,
suite: "gallery",
})
);
@@ -252,7 +180,6 @@ gulp.task("rspack-prod-gallery", () =>
createGalleryConfig({
isProdBuild: true,
latestBuild: true,
isTestBuild: env.isTestBuild(),
})
)
);
@@ -283,36 +210,3 @@ gulp.task("rspack-prod-landing-page", () =>
})
)
);
gulp.task("rspack-dev-server-e2e-test-app", () =>
runDevServer({
compiler: rspack(
createE2eTestAppConfig({ isProdBuild: false, latestBuild: true })
),
contentBase: paths.e2eTestApp_output_root,
port: 8095,
open: false,
suite: "e2e-app",
})
);
gulp.task("rspack-prod-e2e-test-app", () =>
prodBuild(
bothBuilds(createE2eTestAppConfig, {
isProdBuild: true,
isStatsBuild: env.isStatsBuild(),
isTestBuild: env.isTestBuild(),
})
)
);
gulp.task("rspack-prod-e2e-test-app-e2e", () =>
prodBuild(
createE2eTestAppConfig({
isProdBuild: true,
latestBuild: true,
isStatsBuild: env.isStatsBuild(),
isTestBuild: env.isTestBuild(),
})
)
);
+3 -10
View File
@@ -34,9 +34,9 @@ gulp.task("gen-service-worker-app-dev", async () => {
);
});
const genServiceWorker = (builds) =>
gulp.task("gen-service-worker-app-prod", () =>
Promise.all(
builds.map(async ([outPath, build]) => {
Object.entries(SW_MAP).map(async ([outPath, build]) => {
const manifest = JSON.parse(
await readFile(join(outPath, "manifest.json"), "utf-8")
);
@@ -83,12 +83,5 @@ const genServiceWorker = (builds) =>
await symlink(basename(swDest), swOld);
}
})
);
gulp.task("gen-service-worker-app-prod", () =>
genServiceWorker(Object.entries(SW_MAP))
);
gulp.task("gen-service-worker-app-prod-modern", () =>
genServiceWorker([[paths.app_output_latest, "modern"]])
)
);
+7 -13
View File
@@ -1,7 +1,10 @@
/* eslint-disable max-classes-per-file */
import { deleteAsync } from "del";
import { glob } from "glob";
import gulp from "gulp";
import rename from "gulp-rename";
import merge from "lodash.merge";
import { createHash } from "node:crypto";
import { mkdir, readFile } from "node:fs/promises";
import { basename, join } from "node:path";
@@ -9,7 +12,6 @@ import { PassThrough, Transform } from "node:stream";
import { finished } from "node:stream/promises";
import env from "../env.cjs";
import paths from "../paths.cjs";
import { mergeTranslations } from "./merge-translations.js";
import "./fetch-nightly-translations.js";
const inFrontendDir = "translations/frontend";
@@ -56,12 +58,11 @@ class CustomJSON extends Transform {
class MergeJSON extends Transform {
_objects = [];
constructor(stem, startObj = {}, reviver = null, prune = false) {
constructor(stem, startObj = {}, reviver = null) {
super({ objectMode: true, allowHalfOpen: false });
this._stem = stem;
this._startObj = structuredClone(startObj);
this._reviver = reviver;
this._prune = prune;
}
// eslint-disable-next-line @typescript-eslint/naming-convention
@@ -73,11 +74,7 @@ class MergeJSON extends Transform {
// eslint-disable-next-line @typescript-eslint/naming-convention
async _flush(callback) {
const mergedObj = mergeTranslations(
this._startObj,
this._objects,
this._prune
);
const mergedObj = merge(this._startObj, ...this._objects);
this._outFile.contents = Buffer.from(JSON.stringify(mergedObj));
this._outFile.stem = this._stem;
callback(null, this._outFile);
@@ -137,9 +134,6 @@ const lokaliseTransform = (data, path, original = data) => {
gulp.task("clean-translations", () => deleteAsync([workDir]));
// Keep translationMetadata.json, the dev server's rspack watcher imports it.
const cleanTranslationOutput = () => deleteAsync([outDir]);
const makeWorkDir = () => mkdir(workDir, { recursive: true });
const createTestTranslation = () =>
@@ -265,7 +259,7 @@ const createTranslations = async () => {
}
const mergeStream = gulp
.src(mergeFiles, { allowEmpty: true })
.pipe(new MergeJSON(locale, enMaster, emptyReviver, true));
.pipe(new MergeJSON(locale, enMaster, emptyReviver));
mergesFinished.push(finished(mergeStream));
mergeStream.pipe(hashStream, { end: false });
}
@@ -310,7 +304,7 @@ gulp.task(
gulp.series(
gulp.parallel(
"fetch-nightly-translations",
gulp.series(cleanTranslationOutput, makeWorkDir)
gulp.series("clean-translations", makeWorkDir)
),
createTestTranslation,
createMasterTranslation,
+31 -72
View File
@@ -1,55 +1,38 @@
#!/usr/bin/env node
// Script to print Babel plugins and Core JS polyfills that will be used by browserslist environments
import { transformSync } from "@babel/core";
import compilationTargets, {
getInclusionReasons,
} from "@babel/helper-compilation-targets";
import { version as babelVersion } from "@babel/core";
import presetEnv from "@babel/preset-env";
import compilationTargets from "@babel/helper-compilation-targets";
import coreJSCompat from "core-js-compat";
import { logPlugin } from "@babel/preset-env/lib/debug.js";
import shippedPolyfills from "../node_modules/babel-plugin-polyfill-corejs3/lib/shipped-proposals.js";
import { babelOptions } from "./bundle.cjs";
const detailsOpen = (heading) =>
`<details>\n<summary><h4>${heading}</h4></summary>\n`;
const detailsClose = "</details>\n";
// Copied from @babel/preset-env's internal `logPlugin`, which Babel 8 no
// longer exposes (the package rolls up into lib/index.js and exports nothing
// but the preset). Prints an item with the targets that require it.
const logPlugin = (item, targetVersions, list) => {
const filteredList = getInclusionReasons(item, targetVersions, list);
const support = list[item];
if (!support) {
console.log(` ${item}`);
return;
}
let formattedTargets = `{`;
let first = true;
for (const target of Object.keys(filteredList)) {
if (!first) formattedTargets += `,`;
first = false;
formattedTargets += ` ${target}`;
if (support[target]) formattedTargets += ` < ${support[target]}`;
}
formattedTargets += ` }`;
console.log(` ${item} ${formattedTargets}`);
const dummyAPI = {
version: babelVersion,
// eslint-disable-next-line @typescript-eslint/no-empty-function
assertVersion: () => {},
caller: (callback) =>
callback({
name: "Dummy Bundler",
supportsStaticESM: true,
supportsDynamicImport: true,
supportsTopLevelAwait: true,
supportsExportNamespaceFrom: true,
}),
targets: () => ({}),
};
// Copied from babel-plugin-polyfill-corejs3's generated
// corejs3ShippedProposalsList, which v1 no longer exposes (it is inlined in
// the package's rolled-up bundle).
const shippedProposalsList = new Set([
"esnext.array.group",
"esnext.array.group-to-map",
"esnext.iterator.zip",
"esnext.iterator.zip-keyed",
"esnext.symbol.metadata",
]);
// Generate filter function based on proposal/method inputs
// Copied and adapted from babel-plugin-polyfill-corejs3/esm/index.mjs
const polyfillFilter = (method, proposals, shippedProposals) => (name) => {
if (proposals || method === "entry-global") return true;
if (shippedProposals && shippedProposalsList.has(name)) {
if (shippedProposals && shippedPolyfills.default.has(name)) {
return true;
}
if (name.startsWith("esnext.")) {
@@ -64,52 +47,28 @@ const polyfillFilter = (method, proposals, shippedProposals) => (name) => {
for (const buildType of ["Modern", "Legacy"]) {
const browserslistEnv = buildType.toLowerCase();
const babelOpts = babelOptions({ latestBuild: browserslistEnv === "modern" });
const presetEnvOpts = babelOpts.presets.find(
(preset) => Array.isArray(preset) && preset[0] === "@babel/preset-env"
)?.[1];
// Core-JS polyfills are injected by babel-plugin-polyfill-corejs3 (Babel 8
// removed preset-env's `useBuiltIns`), so read its options here.
const corejsOpts = babelOpts.plugins.find(
(plugin) =>
Array.isArray(plugin) && plugin[0] === "babel-plugin-polyfill-corejs3"
)?.[1];
const presetEnvOpts = babelOpts.presets[0][1];
// Transforming an empty file with preset-env in debug mode logs the included
// plugins. The caller declares the same capabilities babel-loader does, so
// plugins gated on bundler support (e.g. transform-export-namespace-from)
// match the build.
presetEnvOpts.debug = true;
// Invoking preset-env in debug mode will log the included plugins
console.log(detailsOpen(`${buildType} Build Babel Plugins`));
transformSync("", {
...babelOpts,
configFile: false,
filename: "audit.js",
caller: {
name: "list-plugins-and-polyfills",
supportsStaticESM: true,
supportsDynamicImport: true,
supportsTopLevelAwait: true,
supportsExportNamespaceFrom: true,
},
presetEnv.default(dummyAPI, {
...presetEnvOpts,
browserslistEnv,
debug: true,
});
console.log(detailsClose);
// Manually log the Core-JS polyfills using the same technique
if (corejsOpts) {
if (presetEnvOpts.useBuiltIns) {
console.log(detailsOpen(`${buildType} Build Core-JS Polyfills`));
const targets = compilationTargets(babelOpts.targets, {
const targets = compilationTargets.default(babelOpts?.targets, {
browserslistEnv,
});
// `version` limits the list to modules the installed core-js ships,
// mirroring the provider's own filtering.
const polyfillList = coreJSCompat({
targets,
version: corejsOpts.version,
}).list.filter(
const polyfillList = coreJSCompat({ targets }).list.filter(
polyfillFilter(
corejsOpts.method,
corejsOpts.proposals,
corejsOpts.shippedProposals
`${presetEnvOpts.useBuiltIns}-global`,
presetEnvOpts?.corejs?.proposals,
presetEnvOpts?.shippedProposals
)
);
console.log(
Loaded 100 of 2358 files, more files were not shown because too many files have changed in this diff. Show more