Compare commits

..
Author SHA1 Message Date
Aidan Timson 23a82918f4 Reduce extra lines on agents file 2026-07-21 08:45:27 +01:00
2209 changed files with 56537 additions and 179496 deletions

No files matched your search

+9 -16
View File
@@ -7,8 +7,6 @@ description: Home Assistant frontend component patterns. Use when implementing o
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:
@@ -25,10 +23,11 @@ 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 `@state() private _open = false` to control visibility.
- Set `_open = true` in `showDialog()` and `_open = false` in `closeDialog()`.
- Return `nothing` while required params are absent.
- Fire `dialog-closed` in the close handler.
- 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.
@@ -65,7 +64,7 @@ Use `computeLabel`, `computeError`, and `computeHelper` for translated labels, v
.data=${this._data}
.schema=${this._schema}
.error=${this._errors}
.computeLabel=${(schema) => this._localize(`ui.panel.${schema.name}`)}
.computeLabel=${(schema) => this.hass.localize(`ui.panel.${schema.name}`)}
@value-changed=${this._valueChanged}
></ha-form>
```
@@ -79,16 +78,10 @@ Use `ha-alert` for user-visible status messaging.
- 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>
`;
```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>
```
## Shortcuts And Tooltips
+17 -36
View File
@@ -16,7 +16,6 @@ Container components may keep `hass` when they own it and feed providers. Leaf c
## Core Files
- Context definitions: `src/data/context/index.ts`
- `consume` decorator, `ContextSubscriptionController`, and `consumeContext` / `ContextController` for reactive controllers: `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`
@@ -24,38 +23,27 @@ Container components may keep `hass` when they own it and feed providers. Leaf c
## 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 |
| `reducedMotionContext` | `prefers-reduced-motion` media query |
| 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.hassUrl` |
| `apiContext` | `hass.callService`, `hass.callApi`, `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`.
Lazy contexts subscribe on first consumer and tear down after the last consumer: `labelsContext`, `fullEntitiesContext`, `configEntriesContext`, and `manifestsContext`.
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 reactive controllers, extend `ContextController` and decorate fields with `consumeContext({ context, subscribe, transform })` from the same file. `transform` stores one part of the context value, and `contextUpdated()` runs only when that part changes. `@state()` and `@transform` do not work on controller fields; call `host.requestUpdate()` when the host needs to rerender. Example: `src/data/service-info-controller.ts`.
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:
Use entity-scoped helpers when the component watches an entity id held on the host:
```ts
@state() @consumeEntityState({ entityIdPath: ["_config", "entity"] })
@@ -68,13 +56,6 @@ private _entity?: EntityRegistryDisplayEntry;
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
@@ -84,7 +65,7 @@ For a single field from a grouped context, pair `@consume` with `@transform`:
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.
Use `@transform` with `watch` when the transformer depends on a host property, such as a computed entity id. `consumeEntityState` only watches 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.
@@ -93,5 +74,5 @@ To consume a whole group untransformed, omit `@transform` and type the field as
- 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()`.
- Context fields are marked `@state()` so updates trigger rendering.
- Tests and mocks only provide the data the component actually consumes.
-69
View File
@@ -1,69 +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.
## Core Data
The service descriptions in `src/fake_data/demo_services.ts` and the trigger and condition descriptions and icons in `demo/src/stubs/automation_platforms_*.ts` are generated from Home Assistant Core. Do not edit them by hand. Run `script/gen_demo_core_data` to regenerate them from the core `dev` branch, and add a domain to the lists in `build-scripts/gulp/gen-demo-core-data.js` when the demo needs its services, triggers, or conditions. Their translations come from the backend translations merged into the demo build.
## 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"]>;
}
}
```
-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/)
+6 -60
View File
@@ -1,18 +1,12 @@
---
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.
description: Home Assistant frontend PR and review guidance. 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.
@@ -26,9 +20,9 @@ When creating a pull request, use `.github/PULL_REQUEST_TEMPLATE.md` as the body
## 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.
- `yarn lint` passes when practical for the scope.
- `yarn test` or focused relevant tests are green when practical for the scope.
- Tests are added or updated for new data processing and utilities where applicable.
- 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.
@@ -37,33 +31,6 @@ When creating a pull request, use `.github/PULL_REQUEST_TEMPLATE.md` as the body
## 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.
@@ -98,30 +65,9 @@ Configuration and props:
- 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.
- Identify behavioral regressions, bugs, accessibility issues, and missing tests first.
- Keep style-only comments secondary unless they affect maintainability or user experience.
- Prefer small, direct fixes over large refactors during review follow-up.
- Cross-load `ha-frontend-contexts`, `ha-frontend-components`, `ha-frontend-styling`, `ha-frontend-testing`, or `ha-frontend-user-facing-text` when a finding falls in that area.
+26 -56
View File
@@ -1,69 +1,41 @@
---
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.
description: Home Assistant frontend validation workflow. Use when 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
yarn lint # ESLint + Prettier + TypeScript + Lit
yarn format # Auto-fix ESLint + Prettier
yarn lint:types # TypeScript compiler, run without file arguments
yarn test # Vitest
yarn dev # App dev server
yarn 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/`.
Never run `tsc` or `yarn 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
## Unit And Utility Tests
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.
- Add or update Vitest tests for data processing, utility code, and behavior that can be tested without a browser.
- Mock WebSocket connections and API calls at boundaries.
- Cover loading, error, unavailable, and missing-entity states where relevant.
- Test accessibility-sensitive behavior when it can be asserted without brittle DOM internals.
## Dev Servers
`pnpm dev` builds and watches the app, served by a running Home Assistant core configured through `development_repo`.
`yarn 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.
`yarn 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.
Dev server commands support `--background`, `--status`, `--stop`, and `--logs [--follow]`.
## Playwright E2E
@@ -71,30 +43,28 @@ Each suite has its own dev server port. Playwright reuses an existing server loc
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` |
| Suite | Server | Test command |
| ------- | ------------------------------- | ----------------------- |
| App | `yarn test:e2e:app:dev` on 8095 | `yarn test:e2e:app` |
| Demo | `yarn dev:demo` on 8090 | `yarn test:e2e:demo` |
| Gallery | `yarn dev:gallery` on 8100 | `yarn 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.
Use `-g "<title>" --project=chromium` to narrow a run. `yarn test:e2e` runs all three suites. 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.
For chart data transforms such as history, statistics, energy, and downsampling, follow `test/benchmarks/README.md`.
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.
Use seeded fixtures, characterization snapshot tests, and `yarn test:bench` before and after optimization. Optimizations must keep output bit-identical.
## 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.
- Type-only or utility change: run focused Vitest if available, then `yarn 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.
- Broad refactor: run `yarn 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.
@@ -16,7 +16,7 @@ Use this skill for all user-facing text, translations, labels, buttons, dialog c
- Give translators enough context through key naming and placeholders.
```ts
this._localize("ui.panel.config.updates.updates_refreshed", {
this.hass.localize("ui.panel.config.updates.updates_refreshed", {
count: 5,
});
```
@@ -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
-15
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,7 +90,6 @@ body:
# Details
- type: textarea
id: entity_state
attributes:
label: State of relevant entities
description: >
@@ -110,7 +98,6 @@ body:
information in the Details view of the More info dialog.
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: >
-4
View File
@@ -11,9 +11,6 @@ inputs:
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
@@ -24,4 +21,3 @@ runs:
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
IS_TEST: ${{ inputs.is-test }}
RSPACK_CACHE: ${{ inputs.rspack-cache }}
@@ -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/**') }}
+5 -44
View File
@@ -1,62 +1,23 @@
name: Setup Node and install
description: Set up Node from .nvmrc and install pnpm dependencies
description: Set up Node from .nvmrc and install yarn dependencies
inputs:
immutable:
description: Pass --frozen-lockfile to pnpm install
description: Pass --immutable to yarn install
default: "true"
cache:
description: Cache the pnpm store
description: Enable the yarn cache in setup-node
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 }}-
cache: ${{ inputs.cache == 'true' && 'yarn' || '' }}
- 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' }}
run: yarn install ${{ inputs.immutable == 'true' && '--immutable' || '' }}
+24
View File
@@ -0,0 +1,24 @@
version: 2
updates:
- package-ecosystem: "github-actions"
# Dependabot only scans .github/workflows by default; composite actions
# under .github/actions must be listed explicitly to stay updated.
# https://github.com/dependabot/dependabot-core/issues/6704
directories:
- "/"
- "/.github/actions/setup"
- "/.github/actions/build"
- "/.github/actions/netlify-deploy"
schedule:
interval: weekly
time: "06:00"
cooldown:
default-days: 7
open-pull-requests-limit: 10
groups:
codeql-action:
patterns:
- "github/codeql-action/*"
labels:
- Dependencies
- GitHub Actions
+3 -229
View File
@@ -1,23 +1,3 @@
# Path rules for .github/workflows/labeler.yaml, which runs actions/labeler on
# every pull request. A label is added when a pull request changes a matching
# file, and removed again when it no longer does, including one added by hand.
#
# Do not add these labels here. .github/scripts/label-content.mts applies and
# removes them from paths and code. A rule here would remove them whenever its
# paths don't match, even when the script's code check does:
#
# - Companion App
# - Home Assistant Link
# - Labs
# - Supervisor
Activity:
- changed-files:
- any-glob-to-any-file:
- src/panels/logbook/**
- src/panels/lovelace/**/*logbook*
- src/data/logbook.ts
Agents:
- changed-files:
- any-glob-to-any-file:
@@ -36,36 +16,6 @@ Agents:
- .github/skills/**
- .github/workflows/copilot-setup-steps.yml
AI:
- changed-files:
- any-glob-to-any-file:
- "src/panels/config/core/{ha-config-section-ai,ai-task-pref,mcp-pref}.ts"
- src/components/ha-suggest-with-ai-button.ts
- "src/data/{ai_task,llm}.ts"
Areas:
- changed-files:
- any-glob-to-any-file:
- src/panels/config/areas/**
- src/data/area/**
- "src/data/{area_floor_picker,floor_registry,ws-area_registry,ws-floor_registry}.ts"
Automations:
- changed-files:
- any-glob-to-any-file:
- "src/panels/config/{automation,script,scene,blueprint}/**"
- src/components/automation/**
- src/components/trace/**
- src/data/trace*.ts
- "src/data/{automation,automation_i18n,script,script_i18n,scene,blueprint,trigger,condition,action}.ts"
Backups:
- changed-files:
- any-glob-to-any-file:
- src/panels/config/backup/**
- src/data/backup*.ts
- src/onboarding/onboarding-restore-backup.ts
Build:
- changed-files:
- any-glob-to-any-file:
@@ -73,37 +23,12 @@ Build:
- .browserslistrc
- gulpfile.js
Calendar:
- changed-files:
- any-glob-to-any-file:
- src/panels/calendar/**
- src/panels/lovelace/**/*calendar*
- src/data/calendar.ts
Cast:
- changed-files:
- any-glob-to-any-file:
- cast/src/**
- src/cast/**
Connectivity:
- changed-files:
- any-glob-to-any-file:
- src/panels/config/connectivity/**
- src/panels/config/tags/**
- "src/panels/config/integrations/integration-panels/{bluetooth,infrared,matter,modbus,mqtt,radio_frequency,serial,thread,zha,zwave_js}/**"
- "src/data/{bluetooth,infrared,matter,matter-lock,modbus,mqtt,otbr,radio_frequency,tag,thread,usb,zha,zwave_js,zwave_js-credentials}.ts"
Dashboards:
- changed-files:
- any-glob-to-any-file:
- src/panels/lovelace/**
- "src/panels/{home,climate,light,security,maintenance,map}/**"
- src/panels/config/lovelace/**
- "src/panels/config/dashboard/{dashboard-card,dialog-new-dashboard,show-dialog-new-dashboard}.ts"
- src/data/lovelace/**
- src/data/lovelace*.ts
Demo:
- changed-files:
- any-glob-to-any-file:
@@ -123,38 +48,15 @@ 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:
- "^renovate/"
- "^dependabot/"
Devices:
- changed-files:
- any-glob-to-any-file:
- src/panels/config/devices/**
- src/data/device/device_registry.ts
- src/data/ws-device_registry.ts
Energy:
- changed-files:
- any-glob-to-any-file:
- src/panels/energy/**
- src/panels/config/energy/**
- src/panels/lovelace/cards/energy/**
- src/panels/lovelace/**/*energy*
- src/data/energy*.ts
Entities:
- changed-files:
- any-glob-to-any-file:
- src/panels/config/entities/**
- src/data/entity/entity_registry*.ts
- src/data/ws-entity_registry_display.ts
GitHub Actions:
- changed-files:
- any-glob-to-any-file:
@@ -162,100 +64,6 @@ GitHub Actions:
- .github/workflows/**
- .github/*.yml
Helpers:
- changed-files:
- any-glob-to-any-file:
- src/panels/config/helpers/**
- src/data/helpers_crud.ts
History:
- changed-files:
- any-glob-to-any-file:
- src/panels/history/**
- src/panels/lovelace/**/*history*
- src/data/history.ts
Integrations:
- changed-files:
- any-glob-to-any-file:
- src/panels/config/integrations/**
- src/panels/config/application_credentials/**
- src/dialogs/config-flow/**
- src/data/application_credential.ts
- src/data/config_entries.ts
- "src/data/{config_flow,data_entry_flow,options_flow,sub_config_flow}.ts"
Labels:
- changed-files:
- any-glob-to-any-file:
- src/panels/config/labels/**
- src/data/label/**
Landing Page:
- changed-files:
- any-glob-to-any-file:
- landing-page/**
Marketplace:
- changed-files:
- any-glob-to-any-file:
- src/panels/marketplace/**
- src/data/marketplace/**
- src/panels/config/integrations/offer-marketplace-uninstall.ts
Media:
- changed-files:
- any-glob-to-any-file:
- src/panels/media-browser/**
- src/components/media-player/**
- src/data/media_source.ts
Notifications:
- changed-files:
- any-glob-to-any-file:
- src/dialogs/notifications/**
- src/data/persistent_notification.ts
Onboarding:
- changed-files:
- any-glob-to-any-file:
- src/onboarding/**
- src/auth/**
- src/data/onboarding.ts
- src/data/auth.ts
People:
- changed-files:
- any-glob-to-any-file:
- "src/panels/config/{person,users}/**"
- "src/data/{person,user,ws-user}.ts"
Profile:
- changed-files:
- any-glob-to-any-file:
- src/panels/profile/**
Search:
- changed-files:
- any-glob-to-any-file:
- src/dialogs/quick-bar/**
- src/state/quick-bar-mixin.ts
- "src/data/{quick_bar,search}.ts"
Sidebar:
- changed-files:
- any-glob-to-any-file:
- src/components/ha-sidebar.ts
- src/dialogs/sidebar/**
System:
- changed-files:
- any-glob-to-any-file:
- "src/panels/config/{core,hardware,info,logs,network,repairs,storage}/**"
- src/panels/config/dashboard/ha-config-updates.ts
- "src/dialogs/{repairs-flow,restart}/**"
- "src/data/{analytics,entity_id_format,error_log,hardware,network,repairs,system_health,system_log,system_log_report,update}.ts"
"Tests: E2E":
- changed-files:
- any-glob-to-any-file:
@@ -285,37 +93,3 @@ System:
- any-glob-to-any-file:
- test/*.ts
- "test/!(e2e)/**"
Theming:
- changed-files:
- any-glob-to-any-file:
- src/resources/theme/**
- src/state/themes-mixin.ts
- src/common/dom/apply_themes_on_element.ts
- "src/data/{theme,ws-themes}.ts"
To-do:
- changed-files:
- any-glob-to-any-file:
- src/panels/todo/**
- src/panels/lovelace/**/*todo*
- src/data/todo.ts
Tools:
- changed-files:
- any-glob-to-any-file:
- src/panels/config/tools/**
Voice:
- changed-files:
- any-glob-to-any-file:
- src/panels/config/voice-assistants/**
- "src/dialogs/{voice-assistant-setup,voice-command-dialog}/**"
- src/components/ha-assist-chat.ts
- "src/data/{assist_pipeline,assist_satellite,conversation,stt,tts,wake_word}.ts"
Zones:
- changed-files:
- any-glob-to-any-file:
- src/panels/config/zone/**
- src/data/zone.ts
+38
View File
@@ -0,0 +1,38 @@
#!/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();
}
}
-289
View File
@@ -1,289 +0,0 @@
#!/usr/bin/env node
// Checks npm registry metadata for the direct dependencies in package.json:
// deprecation, source repository and provenance. On pull requests only newly
// added packages are checked, and a deprecated one fails the check. Scheduled
// and manual runs report on every direct dependency without failing. Invoked
// from the `npm-metadata` job in .github/workflows/dependency-review.yaml via
// actions/github-script:
//
// const { default: checkNpmMetadata } =
// await import(`${process.env.GITHUB_WORKSPACE}/.github/scripts/check-npm-metadata.mts`);
// await checkNpmMetadata({ github, context, core });
import type { Octokit } from "@octokit/rest";
import type {
Context,
Core,
GitHubScriptArgs,
PullRequestPayload,
} from "./github-script.d.ts";
import { withRetry } from "./github-retry.mts";
// Scheduled and manual runs have no pull request
type Payload = Partial<PullRequestPayload>;
type Section =
| "dependencies"
| "devDependencies"
| "optionalDependencies"
| "peerDependencies";
type PackageJson = Partial<Record<Section, Record<string, string>>>;
interface Dependency {
name: string;
// The package npm installs, which differs from name for npm: aliases
registryName: string;
version: string;
section: Section;
}
// The fields read from a version document on registry.npmjs.org
interface NpmManifest {
deprecated?: string;
repository?: string | { url?: string };
dist?: { attestations?: object };
}
interface Result {
name: string;
version: string;
section: Section;
skipped?: string;
deprecated?: string;
repository?: string;
provenance?: boolean;
}
const SECTIONS: Section[] = [
"dependencies",
"devDependencies",
"optionalDependencies",
"peerDependencies",
];
const EXACT_VERSION = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/;
const NPM_ALIAS = /^npm:((?:@[^/]+\/)?[^@]+)@(.+)$/;
const CONCURRENCY = 8;
// Returns undefined when the registry reports 404, and throws on any other
// failure so a registry outage fails the job instead of skipping the check.
const fetchJson = async <T,>(url: string): Promise<T | undefined> => {
const response = await fetch(url);
if (response.status === 404) {
return undefined;
}
if (!response.ok) {
throw new Error(
`Request to ${url} failed: ${response.status} ${response.statusText}`
);
}
return JSON.parse(await response.text());
};
const readPackageJson = async (
github: Octokit,
context: Context<Payload>,
ref: string
): Promise<PackageJson> => {
const { data } = await withRetry(`package.json lookup at ${ref}`, () =>
github.rest.repos.getContent({
...context.repo,
path: "package.json",
ref,
mediaType: { format: "raw" },
})
);
// The raw media type returns the file contents as a string, but Octokit
// types the response as the JSON form
if (typeof data !== "string") {
throw new Error("Expected raw package.json contents");
}
return JSON.parse(data);
};
const listDependencies = (pkg: PackageJson): Dependency[] =>
SECTIONS.flatMap((section) =>
Object.entries(pkg[section] ?? {}).map(([name, spec]) => {
// npm: aliases install another package, e.g. npm:[email protected]
const alias = spec.match(NPM_ALIAS);
return {
name,
registryName: alias?.[1] ?? name,
version: alias?.[2] ?? spec,
section,
};
})
);
const repositoryUrl = (repository: NpmManifest["repository"]) => {
const url = typeof repository === "string" ? repository : repository?.url;
return url?.replace(/^git\+/, "").replace(/\.git$/, "");
};
const checkPackage = async ({
name,
registryName,
version,
section,
}: Dependency): Promise<Result> => {
const result = {
name: registryName === name ? name : `${name} (npm:${registryName})`,
version,
section,
};
if (!EXACT_VERSION.test(version)) {
return { ...result, skipped: "not an exact version" };
}
const manifest = await fetchJson<NpmManifest>(
`https://registry.npmjs.org/${encodeURIComponent(registryName)}/${version}`
);
if (!manifest) {
return { ...result, skipped: "not found on the npm registry" };
}
return {
...result,
deprecated: manifest.deprecated,
repository: repositoryUrl(manifest.repository),
provenance: Boolean(manifest.dist?.attestations),
};
};
const checkAll = async (dependencies: Dependency[]) => {
const results: Result[] = [];
for (let i = 0; i < dependencies.length; i += CONCURRENCY) {
results.push(
// eslint-disable-next-line no-await-in-loop
...(await Promise.all(
dependencies.slice(i, i + CONCURRENCY).map(checkPackage)
))
);
}
return results;
};
const writeSummary = async (core: Core, heading: string, results: Result[]) => {
await core.summary
.addHeading(heading, 2)
.addTable([
[
"Package",
"Version",
"Section",
"Deprecated",
"Provenance",
"Repository",
].map((data) => ({ data, header: true })),
...results.map((result) =>
result.skipped
? [
result.name,
result.version,
result.section,
`skipped: ${result.skipped}`,
"-",
"-",
]
: [
result.name,
result.version,
result.section,
result.deprecated ? "yes" : "no",
result.provenance ? "yes" : "no",
result.repository ?? "none",
]
),
])
.write();
};
export default async function checkNpmMetadata({
github,
context,
core,
}: GitHubScriptArgs<Payload>) {
const pr = context.payload.pull_request;
if (!pr) {
const pkg = await readPackageJson(github, context, context.sha);
const results = await checkAll(listDependencies(pkg));
const flagged = (result: Result) =>
Number(
Boolean(result.skipped || result.deprecated || !result.repository)
);
results.sort(
(a, b) => flagged(b) - flagged(a) || a.name.localeCompare(b.name)
);
await writeSummary(core, "Direct dependencies", results);
return;
}
const [base, head] = await Promise.all([
readPackageJson(github, context, pr.base.sha),
readPackageJson(github, context, pr.head.sha),
]);
// Compare the packages npm installs, so pointing an npm: alias at another
// package counts as new, but moving a package between sections does not
const existing = new Set(
listDependencies(base).map(({ registryName }) => registryName)
);
const added = listDependencies(head).filter(
({ registryName }) => !existing.has(registryName)
);
if (added.length === 0) {
core.info("No new dependencies");
return;
}
const results = await checkAll(added);
const annotation = { file: "package.json" };
for (const result of results) {
const label = `${result.name}@${result.version}`;
if (result.skipped) {
core.warning(`${label}: ${result.skipped}, not checked`, annotation);
continue;
}
if (result.deprecated) {
core.error(`${label} is deprecated: ${result.deprecated}`, annotation);
}
if (!result.repository) {
core.warning(`${label} has no source repository`, annotation);
}
if (!result.provenance) {
core.notice(`${label} was published without provenance`, annotation);
}
}
await writeSummary(core, "New dependencies", results);
if (results.some((result) => result.deprecated)) {
core.setFailed("New dependencies must not be deprecated on npm");
}
}
@@ -6,20 +6,14 @@
// via actions/github-script:
//
// const { default: checkStandards } =
// await import(`${process.env.GITHUB_WORKSPACE}/.github/scripts/check-pull-request-standards.mts`);
// await import(`${process.env.GITHUB_WORKSPACE}/.github/scripts/check-pull-request-standards.mjs`);
// await checkStandards({ github, context, core });
import type {
GitHubScriptArgs,
PullRequestPayload,
} from "./github-script.d.ts";
import { withRetry } from "./github-retry.mts";
export default async function checkPullRequestStandards({
github,
context,
core,
}: GitHubScriptArgs<PullRequestPayload>) {
}) {
const pr = context.payload.pull_request;
// Exempt bots (Copilot agent, dependabot), drafts, and maintainers.
@@ -32,12 +26,10 @@ export default async function checkPullRequestStandards({
return;
}
try {
await withRetry("organization membership check", () =>
github.rest.orgs.checkMembershipForUser({
org: "home-assistant",
username: pr.user.login,
})
);
await github.rest.orgs.checkMembershipForUser({
org: "home-assistant",
username: pr.user.login,
});
core.info(`Skipping organization member: ${pr.user.login}`);
return;
} catch (_error) {
@@ -60,16 +52,11 @@ export default async function checkPullRequestStandards({
const normalized = body.toLowerCase();
// Ignore 404s from mutations that race manual edits or cancelled runs.
const ignoreMissing = async <T,>(fn: () => Promise<T>) => {
const ignoreMissing = async (fn) => {
try {
await fn();
} catch (error) {
if (
typeof error === "object" &&
error !== null &&
"status" in error &&
error.status === 404
) {
if (error.status === 404) {
core.info("Target already removed, nothing to do");
return;
}
@@ -78,7 +65,7 @@ export default async function checkPullRequestStandards({
};
// Hide/restore our comment via GraphQL (REST cannot minimize).
const setMinimized = async (subjectId: string, minimized: boolean) => {
const setMinimized = async (subjectId, minimized) => {
const mutation = minimized
? `mutation($id: ID!) {
minimizeComment(input: { subjectId: $id, classifier: RESOLVED }) {
@@ -91,18 +78,16 @@ export default async function checkPullRequestStandards({
}
}`;
try {
await withRetry(`comment ${minimized ? "minimize" : "restore"}`, () =>
github.graphql(mutation, { id: subjectId })
);
await github.graphql(mutation, { id: subjectId });
} catch (error) {
core.info(
`Could not ${minimized ? "minimize" : "restore"} comment: ${error instanceof Error ? error.message : error}`
`Could not ${minimized ? "minimize" : "restore"} comment: ${error.message}`
);
}
};
// Content of a "## <name>" section, or null when the heading is absent.
const section = (name: string) => {
const section = (name) => {
const match = body.match(
new RegExp(`##\\s${name}([\\s\\S]*?)(?=\\n##\\s|$)`, "i")
);
@@ -137,16 +122,13 @@ export default async function checkPullRequestStandards({
const isValid = problems.length === 0;
const comments = await withRetry("comment list", () =>
github.paginate(github.rest.issues.listComments, {
owner,
repo,
issue_number,
per_page: 100,
})
);
const existing = comments.find((c) => c.body?.includes(marker));
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) {
@@ -154,14 +136,12 @@ export default async function checkPullRequestStandards({
if (hasLabel) {
await ignoreMissing(() =>
withRetry("label removal", () =>
github.rest.issues.removeLabel({
owner,
repo,
issue_number,
name: label,
})
)
github.rest.issues.removeLabel({
owner,
repo,
issue_number,
name: label,
})
);
}
if (existing) {
@@ -173,14 +153,12 @@ export default async function checkPullRequestStandards({
core.info(`Pull request standards not met:\n- ${problems.join("\n- ")}`);
if (!hasLabel) {
await withRetry("label addition", () =>
github.rest.issues.addLabels({
owner,
repo,
issue_number,
labels: [label],
})
);
await github.rest.issues.addLabels({
owner,
repo,
issue_number,
labels: [label],
});
}
const message =
@@ -196,17 +174,14 @@ export default async function checkPullRequestStandards({
`for more on creating a great pull request (see point 6).`;
if (existing) {
await withRetry("comment update", () =>
github.rest.issues.updateComment({
owner,
repo,
comment_id: existing.id,
body: message,
})
);
await github.rest.issues.updateComment({
owner,
repo,
comment_id: existing.id,
body: message,
});
await setMinimized(existing.node_id, false);
} else {
// Not retried, as a retry after GitHub created the comment would post it twice
await github.rest.issues.createComment({
owner,
repo,
@@ -5,35 +5,29 @@
// actions/github-script:
//
// const { default: checkTaskAuthorization } =
// await import(`${process.env.GITHUB_WORKSPACE}/.github/scripts/check-task-authorization.mts`);
// await import(`${process.env.GITHUB_WORKSPACE}/.github/scripts/check-task-authorization.mjs`);
// await checkTaskAuthorization({ github, context, core });
import type { GitHubScriptArgs, IssuePayload } from "./github-script.d.ts";
import { withRetry } from "./github-retry.mts";
export default async function checkTaskAuthorization({
github,
context,
core,
}: GitHubScriptArgs<IssuePayload>) {
}) {
const issueAuthor = context.payload.issue.user.login;
// Check if user is an organization member
try {
await withRetry("organization membership check", () =>
github.rest.orgs.checkMembershipForUser({
org: "home-assistant",
username: issueAuthor,
})
);
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. Not retried, as a retry after GitHub
// created the comment would post it twice.
// Close the issue with a comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
@@ -47,22 +41,18 @@ export default async function checkTaskAuthorization({
`If you believe you should have access to create Task issues, please contact the maintainers.`,
});
await withRetry("issue close", () =>
github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
state: "closed",
})
);
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 withRetry("auto-closed label", () =>
github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ["auto-closed"],
})
);
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ["auto-closed"],
});
}
-69
View File
@@ -1,69 +0,0 @@
// Retries GitHub API requests with jittered exponential backoff. Shared by the
// workflow scripts in this directory, test/e2e/post-report-comment.mjs and the
// fetch-nightly-translations gulp task. Only wrap requests that are safe to
// repeat: a create that fails after GitHub has applied it would run twice.
//
// This replaces @octokit/plugin-retry, which only retries HTTP error statuses
// on a fixed 1s, 4s, 9s delay with no jitter or logging. GitHub can also
// answer 200 with briefly stale data, such as the nightly translations lookup
// returning an old run with no artifact, and the plugin cannot retry that.
// github-script also leaves its built-in retries off by default.
const RETRIES = 3;
const BASE_DELAY = 1000; // ms
const MAX_DELAY = 10000; // ms
const TRANSIENT_STATUSES = new Set([408, 429, 500, 502, 503, 504]);
// Throw from a request to retry a response GitHub may answer differently on
// the next attempt, such as briefly stale data
export class RetryableError extends Error {}
// Octokit reports network failures as status 500
const isRetryable = (err: unknown) => {
if (err instanceof RetryableError) {
return true;
}
if (!(err instanceof Error) || !("status" in err)) {
return false;
}
const status = Number(err.status);
return (
TRANSIENT_STATUSES.has(status) ||
(status === 403 && /rate limit/i.test(err.message))
);
};
export async function withRetry<T>(
label: string,
request: () => Promise<T>
): Promise<T> {
for (let attempt = 1; ; attempt++) {
try {
// eslint-disable-next-line no-await-in-loop
return await request();
} catch (err) {
if (attempt > RETRIES || !isRetryable(err)) {
throw err;
}
const delay =
Math.min(BASE_DELAY * 2 ** (attempt - 1), MAX_DELAY) *
(0.8 + Math.random() * 0.4);
// eslint-disable-next-line no-console
console.log(
`Retrying ${label} after ${(delay / 1000).toFixed(1)}s (attempt ${attempt}/${RETRIES}): ${err instanceof Error ? err.message : err}`
);
// eslint-disable-next-line no-await-in-loop
await new Promise((resolve) => {
setTimeout(resolve, delay);
});
}
}
}
-61
View File
@@ -1,61 +0,0 @@
// The arguments actions/github-script passes to the scripts in this directory,
// limited to the parts they use.
import type { Octokit } from "@octokit/rest";
export type SummaryTableCell = string | { data: string; header?: boolean };
export interface Summary {
addHeading(text: string, level?: number): Summary;
addRaw(text: string): Summary;
addTable(rows: SummaryTableCell[][]): Summary;
write(): Promise<Summary>;
}
export interface AnnotationProperties {
file?: string;
}
export interface Core {
info(message: string): void;
notice(message: string, properties?: AnnotationProperties): void;
warning(message: string, properties?: AnnotationProperties): void;
error(message: string, properties?: AnnotationProperties): void;
setFailed(message: string): void;
summary: Summary;
}
export interface User {
login: string;
type: string;
}
export interface PullRequestPayload {
pull_request: {
number: number;
body: string | null;
draft: boolean;
user: User;
labels: { name: string }[];
base: { sha: string };
head: { sha: string };
};
}
export interface IssuePayload {
issue: {
user: User;
};
}
export interface Context<Payload> {
sha: string;
repo: { owner: string; repo: string };
issue: { owner: string; repo: string; number: number };
payload: Payload;
}
export interface GitHubScriptArgs<Payload> {
github: Octokit;
context: Context<Payload>;
core: Core;
}
-56
View File
@@ -1,56 +0,0 @@
/**
* Builds a section of a workflow run's summary: a heading, a table of rows and
* the warnings raised along the way.
*
* Warnings are also logged as annotations, so a script can report problems
* without failing its step.
*/
import type { AnnotationProperties, Core } from "./github-script.d.ts";
interface SummaryOptions {
heading: string;
columns: string[];
// Shown instead of the table when no rows were added
empty: string;
}
export const createSummary = (
core: Core,
{ heading, columns, empty }: SummaryOptions
) => {
const rows: string[][] = [];
const warnings: string[] = [];
return {
addRow: (...cells: string[]) => {
rows.push(cells);
},
warn: (message: string, properties?: AnnotationProperties) => {
core.warning(message, properties);
warnings.push(message);
},
write: async () => {
core.summary.addHeading(heading, 2);
if (rows.length > 0) {
core.summary.addTable([
columns.map((data) => ({ data, header: true })),
...rows,
]);
} else {
core.summary.addRaw(`${empty}\n`);
}
if (warnings.length > 0) {
core.summary
.addHeading("Warnings", 3)
.addRaw(`${warnings.map((warning) => `- ${warning}`).join("\n")}\n`);
}
await core.summary.write();
},
};
};
-324
View File
@@ -1,324 +0,0 @@
#!/usr/bin/env node
/**
* Applies the Companion App, Home Assistant Link, Labs and Supervisor labels
* to pull requests.
*
* These areas are often changed from code outside their folders, which
* actions/labeler can't see, so this script owns them and .github/labeler.yml
* leaves them out.
*
* A label matches when the pull request:
* - changes a file in one of the area's paths, or
* - adds or removes a line that uses the area's API, such as gating a feature
* behind Labs or only showing it on Supervisor installs.
*
* Like actions/labeler, a label is removed once the pull request no longer
* matches, including one added by hand.
*
* Invoked from the `triage` job in .github/workflows/labeler.yaml.
*/
import type {
GitHubScriptArgs,
PullRequestPayload,
} from "./github-script.d.ts";
import { withRetry } from "./github-retry.mts";
import { createSummary } from "./github-summary.mts";
const RULES: { label: string; paths: RegExp[]; pattern: RegExp }[] = [
{
label: "Companion App",
paths: [
/^src\/external_app\//,
/^src\/data\/external\.ts$/,
/^src\/util\/is_ios\.ts$/,
],
// Reads or messages the companion app the frontend is running in, or
// imports its modules. Matches imports of data/external rather than
// isExternal, which is also a common local name.
pattern:
/\bauth\??\.external\b(?:[!?]*\.\w+)*(?:\([^)]*)?|\bfireExternalBusMessage\([^)]*|(?:\bimport\s[^;]*?from\s*|\bimport\(\s*)["'][^"']*\/(?:external_app\/[^"']*|data\/external)["']/g,
},
{
label: "Home Assistant Link",
paths: [
/^src\/panels\/config\/cloud\//,
/^src\/data\/cloud\//,
/^src\/data\/cloud\.ts$/,
],
// Only runs when Home Assistant Link is set up
pattern: /isComponentLoaded\([^)]*["']cloud["']/g,
},
{
label: "Labs",
paths: [/^src\/panels\/config\/labs\//, /^src\/data\/labs\.ts$/],
// Gates a feature behind, or toggles, a Labs preview feature
pattern:
/\b(?:subscribeLabFeatures?|fetchLabFeatures|labsUpdatePreviewFeature)\([^)]*/g,
},
{
label: "Supervisor",
paths: [
/^src\/panels\/config\/apps\//,
/^src\/panels\/app\//,
/^src\/data\/hassio\//,
/^src\/data\/supervisor\//,
],
// Only runs on installs with the Supervisor
pattern: /isComponentLoaded\([^)]*["']hassio["']/g,
},
];
interface HunkSide {
lines: string[];
changed: boolean[];
}
interface CodeChange {
code: string;
filename: string;
}
const parseHunks = (patch: string) => {
const hunks: { before: HunkSide; after: HunkSide }[] = [];
for (const line of patch.split("\n")) {
if (line.startsWith("@@")) {
hunks.push({
before: { lines: [], changed: [] },
after: { lines: [], changed: [] },
});
continue;
}
const hunk = hunks.at(-1);
if (!hunk || line.startsWith("\\")) {
continue;
}
const text = line.slice(1);
if (!line.startsWith("+")) {
hunk.before.lines.push(text);
hunk.before.changed.push(line.startsWith("-"));
}
if (!line.startsWith("-")) {
hunk.after.lines.push(text);
hunk.after.changed.push(line.startsWith("+"));
}
}
return hunks;
};
// Ignores whitespace and trailing commas outside strings, as Prettier changes
// them when wrapping
const normaliseCode = (code: string) => {
const parts = code.split(
/("(?:[^"\\\n]|\\.)*"|'(?:[^'\\\n]|\\.)*'|`(?:[^`\\]|\\.)*`)/
);
return parts
.map((part, i) => {
if (i % 2 === 1) {
return part;
}
const stripped = part.replace(/\s+/g, "").replace(/,(?=[}\])])/g, "");
return i === parts.length - 1 ? stripped.replace(/,$/, "") : stripped;
})
.join("");
};
// Matches whole calls, which can span lines, that touch a changed line
const changedMatches = (side: HunkSide, pattern: RegExp) => {
const text = side.lines.join("\n");
const matches: string[] = [];
for (const match of text.matchAll(pattern)) {
const first = text.slice(0, match.index).split("\n").length - 1;
const last = first + match[0].split("\n").length - 1;
if (side.changed.slice(first, last + 1).some(Boolean)) {
matches.push(normaliseCode(match[0]));
}
}
return matches;
};
// Matches that were only moved, reindented or reformatted cancel out in pairs,
// returning a file with a match that doesn't
const unmatchedChange = (added: CodeChange[], removed: CodeChange[]) => {
const remaining = [...removed];
for (const change of added) {
const index = remaining.findIndex(({ code }) => code === change.code);
if (index === -1) {
return change.filename;
}
remaining.splice(index, 1);
}
return remaining[0]?.filename;
};
const describeError = (cause: unknown) =>
cause instanceof Error ? cause.message : String(cause);
const isNotFound = (cause: unknown) =>
cause instanceof Error && "status" in cause && cause.status === 404;
export default async function labelContent({
github,
context,
core,
}: GitHubScriptArgs<PullRequestPayload>) {
const pr = context.payload.pull_request;
const summary = createSummary(core, {
heading: "Content labels",
columns: ["Label", "Change", "Reason"],
empty: "No content labels changed.",
});
if (process.env.LABELER_OUTCOME === "failure") {
summary.warn(
"Applying labels from .github/labeler.yml failed, see its step"
);
}
// Bot pull requests, such as Prettier bumps, rewrite code they don't change
const checkCode = pr.user.type !== "Bot";
const { owner, repo } = context.repo;
let files;
let existing: Set<string>;
try {
// Read the current labels, as the event's snapshot can be stale by now
const [fileList, labels] = await Promise.all([
withRetry("pull request files", () =>
github.paginate(github.rest.pulls.listFiles, {
owner,
repo,
pull_number: pr.number,
per_page: 100,
})
),
withRetry("pull request labels", () =>
github.paginate(github.rest.issues.listLabelsOnIssue, {
owner,
repo,
issue_number: pr.number,
per_page: 100,
})
),
]);
files = fileList;
existing = new Set(labels.map((l) => l.name));
} catch (error) {
summary.warn(
`Could not read the pull request's files and labels: ${describeError(error)}`
);
await summary.write();
return;
}
const add: { label: string; reason: string }[] = [];
const remove: string[] = [];
for (const rule of RULES) {
const added: CodeChange[] = [];
const removed: CodeChange[] = [];
if (checkCode) {
for (const { filename, patch } of files) {
for (const { before, after } of parseHunks(patch ?? "")) {
for (const code of changedMatches(after, rule.pattern)) {
added.push({ code, filename });
}
for (const code of changedMatches(before, rule.pattern)) {
removed.push({ code, filename });
}
}
}
}
// Renames count for both locations, as moving a file out of an area changes it
const match =
files.find(({ filename, previous_filename }) =>
rule.paths.some(
(path) =>
path.test(filename) ||
(previous_filename !== undefined && path.test(previous_filename))
)
)?.filename ?? unmatchedChange(added, removed);
if (match && !existing.has(rule.label)) {
core.info(`Adding ${rule.label} for ${match}`);
add.push({ label: rule.label, reason: match });
} else if (!match && existing.has(rule.label)) {
core.info(`Removing ${rule.label}, no longer matched`);
remove.push(rule.label);
}
}
const removals = await Promise.allSettled(
remove.map((name) =>
withRetry("label removal", () =>
github.rest.issues.removeLabel({
owner,
repo,
issue_number: pr.number,
name,
})
)
)
);
removals.forEach((removal, i) => {
const name = remove[i];
// Already removed, such as by hand or a run that raced this one
if (removal.status === "fulfilled" || isNotFound(removal.reason)) {
summary.addRow(name, "Removed", "No longer matched");
} else {
summary.warn(
`Could not remove ${name}: ${describeError(removal.reason)}`
);
}
});
if (add.length > 0) {
try {
await withRetry("label addition", () =>
github.rest.issues.addLabels({
owner,
repo,
issue_number: pr.number,
labels: add.map(({ label }) => label),
})
);
for (const { label, reason } of add) {
summary.addRow(label, "Added", reason);
}
} catch (error) {
summary.warn(
`Could not add ${add.map(({ label }) => label).join(", ")}: ${describeError(error)}`
);
}
}
await summary.write();
}
-19
View File
@@ -1,19 +0,0 @@
{
"compilerOptions": {
"target": "ES2024",
"lib": ["ES2024"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
// actions/github-script imports these directly, relying on Node's type stripping
"erasableSyntaxOnly": true,
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"skipLibCheck": true,
"types": ["node"]
},
"include": ["*.mts", "*.d.ts"]
}
+1 -1
View File
@@ -32,7 +32,7 @@ jobs:
ACTIONLINT_VERSION: 1.7.12
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Run actionlint
+35
View File
@@ -0,0 +1,35 @@
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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
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 });
+4 -4
View File
@@ -18,13 +18,13 @@ 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 }}
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: dev
persist-credentials: false
@@ -50,13 +50,13 @@ jobs:
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 }}
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: master
persist-credentials: false
+14 -51
View File
@@ -1,7 +1,6 @@
name: CI
on:
workflow_dispatch:
push:
branches:
- dev
@@ -22,32 +21,18 @@ 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Node with shared dependencies
- name: Setup Node and install
uses: ./.github/actions/setup
with:
node-modules-cache: true
- 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
@@ -63,41 +48,35 @@ 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Node with shared dependencies
- name: Setup Node and install
uses: ./.github/actions/setup
with:
node-modules-cache: true
- 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
needs:
@@ -106,33 +85,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Node with shared dependencies
- name: Setup Node and install
uses: ./.github/actions/setup
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 }}-
- name: Build Application
uses: ./.github/actions/build
with:
target: build-app
github-token: ${{ secrets.GITHUB_TOKEN }}
is-test: true
rspack-cache: readonly
- name: Upload bundle stats
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
@@ -140,7 +103,7 @@ jobs:
path: build/stats/*.json
if-no-files-found: error
- name: Check entrypoint bundle size budget
run: pnpm run check-bundlesize
run: yarn run check-bundlesize
- name: Upload frontend build
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
+3 -3
View File
@@ -27,17 +27,17 @@ jobs:
steps:
- name: Check out code from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Initialize CodeQL
uses: github/codeql-action/init@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
uses: github/codeql-action/init@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
with:
languages: javascript-typescript
build-mode: none
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2
uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
with:
category: "/language:javascript-typescript"
-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
+4 -4
View File
@@ -19,13 +19,13 @@ 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 }}
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: dev
persist-credentials: false
@@ -50,13 +50,13 @@ jobs:
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 }}
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: master
persist-credentials: false
-55
View File
@@ -1,55 +0,0 @@
name: Dependency review
on:
pull_request:
branches:
- dev
paths:
- package.json
- pnpm-lock.yaml
- pnpm-workspace.yaml
schedule:
- cron: "0 6 1 * *" # Monthly report on all direct dependencies
workflow_dispatch:
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
dependency-review:
name: Review dependency changes
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read # To compare the dependency graph between base and head
steps:
- name: Dependency review
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
with:
license-check: false # Covered by pnpm lint:licenses
fail-on-severity: high
show-openssf-scorecard: true
warn-on-openssf-scorecard-level: 3
npm-metadata:
name: Check npm metadata
runs-on: ubuntu-latest
permissions:
contents: read # To read package.json
steps:
- name: Check out workflow scripts
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
sparse-checkout: .github/scripts
- name: Check npm metadata
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const { default: checkNpmMetadata } = await import(
`${process.env.GITHUB_WORKSPACE}/.github/scripts/check-npm-metadata.mts`
);
await checkNpmMetadata({ github, context, core });
+1 -2
View File
@@ -13,14 +13,13 @@ env:
jobs:
deploy:
if: github.repository == 'home-assistant/frontend'
runs-on: ubuntu-latest
environment:
name: Design
url: ${{ steps.deploy.outputs.netlify_url }}
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
+1 -1
View File
@@ -24,7 +24,7 @@ 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
+49 -226
View File
@@ -22,60 +22,24 @@ 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.64.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
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Node with shared dependencies
- name: Setup Node and install
uses: ./.github/actions/setup
with:
node-modules-cache: true
- name: Build demo
uses: ./.github/actions/build
with:
target: build-demo-e2e
target: build-demo
github-token: ${{ secrets.GITHUB_TOKEN }}
is-test: true
- name: Upload demo build
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
@@ -88,25 +52,21 @@ jobs:
# ── 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
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Node with shared dependencies
- name: Setup Node and install
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
target: build-e2e-test-app
github-token: ${{ secrets.GITHUB_TOKEN }}
is-test: true
- name: Upload e2e test app build
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
@@ -119,25 +79,21 @@ jobs:
# ── 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
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Node with shared dependencies
- name: Setup Node and install
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
@@ -147,39 +103,41 @@ jobs:
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
# ── Run Playwright tests locally against Chromium ──────────────────────────
e2e-local:
name: E2E (local Chromium)
needs: [build-demo, build-e2e-test-app, build-gallery]
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.64.0-noble
options: --user 1001 --ipc=host
defaults:
run:
shell: bash
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
shardIndex:
- 1
- 2
shardTotal:
- 2
# Fail fast if anything hangs. The whole suite should take < 15 minutes on
# Chromium; anything longer is almost certainly an install or webServer
# hang.
timeout-minutes: 30
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Node with shared dependencies
- name: Setup Node and install
uses: ./.github/actions/setup
# Resolve the installed Playwright version so the browser cache tracks
# Playwright itself, not every unrelated dependency bump.
- name: Resolve Playwright version
id: playwright-version
run: echo "version=$(node -p 'require("@playwright/test/package.json").version')" >> "$GITHUB_OUTPUT"
# Cache the downloaded browser build keyed on the installed Playwright
# version, so re-runs skip the ~170 MB download unless Playwright changes.
- name: Cache Playwright browsers
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
node-modules-cache: true
node-modules-cache-key: node-modules-container-v1
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}
- name: Install Playwright browsers
run: yarn playwright install --with-deps chromium
timeout-minutes: 10
- name: Download demo build
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
@@ -187,169 +145,54 @@ jobs:
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.64.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.64.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 }}
- name: Run Playwright tests (local)
run: yarn test:e2e
timeout-minutes: 15
- name: Upload gallery blob report
- name: Upload 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
name: blob-report-local
path: test/e2e/reports/
retention-days: 3
# ── Merge local blob reports and post PR comment ───────────────────────────
report:
name: Report
needs:
- e2e-demo
- e2e-app
- e2e-gallery
needs: [e2e-local]
runs-on: ubuntu-latest
if: ${{ always() }}
if: ${{ !cancelled() }}
permissions:
contents: read
pull-requests: write
steps:
- name: Check out files from GitHub
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Node with shared dependencies
- name: Setup Node and install
uses: ./.github/actions/setup
with:
node-modules-cache: true
- name: Download demo blob reports
- name: Download blob report (local)
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: blob-report-local
path: test/e2e/reports/
- name: Stage blobs for merge
run: node test/e2e/collect-blob-reports.mjs
@@ -366,11 +209,7 @@ jobs:
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')
if: github.event_name == 'pull_request' && needs.e2e-local.result == 'failure'
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
@@ -378,19 +217,3 @@ jobs:
`${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"
+2 -25
View File
@@ -1,11 +1,6 @@
name: "Pull Request Labeler"
on: pull_request_target # zizmor: ignore[dangerous-triggers] -- safe: checks out base repo scripts only and reads PR files through the API, never PR head code
# Runs one at a time per pull request, so an older run can't undo a newer one
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
on: pull_request_target # zizmor: ignore[dangerous-triggers] -- safe: only runs actions/labeler, no PR code checkout
jobs:
triage:
@@ -15,24 +10,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Apply labels
id: labeler
continue-on-error: true
uses: actions/labeler@bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13 # v7.0.0
uses: actions/labeler@b8dd2d9be0f68b860e7dae5dae7d772984eacd6d # v6.2.0
with:
sync-labels: true
- name: Check out workflow scripts
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
sparse-checkout: .github/scripts
- name: Apply content labels
continue-on-error: true
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
env:
LABELER_OUTCOME: ${{ steps.labeler.outcome }}
with:
script: |
const { default: labelContent } = await import(
`${process.env.GITHUB_WORKSPACE}/.github/scripts/label-content.mts`
);
await labelContent({ github, context, core });
-1
View File
@@ -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
+5 -80
View File
@@ -14,19 +14,18 @@ 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: ${{ env.PYTHON_VERSION }}
@@ -39,69 +38,21 @@ jobs:
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 +61,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:
@@ -24,7 +24,7 @@ jobs:
pull-requests: write # To label and comment on pull requests
steps:
- name: Check out workflow scripts
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
sparse-checkout: .github/scripts
@@ -33,6 +33,6 @@ jobs:
with:
script: |
const { default: checkStandards } = await import(
`${process.env.GITHUB_WORKSPACE}/.github/scripts/check-pull-request-standards.mts`
`${process.env.GITHUB_WORKSPACE}/.github/scripts/check-pull-request-standards.mjs`
);
await checkStandards({ github, context, core });
+4 -4
View File
@@ -14,11 +14,11 @@ 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
uses: relative-ci/agent-action@711f3a8fa1b928e6afde280011110c9b0a224a60 # v3.2.4
uses: relative-ci/agent-action@fcf45416581928e8dd62eded78ce98c78e5149f8 # v3.2.3
with:
key: ${{ secrets.RELATIVE_CI_KEY_frontend_modern }}
token: ${{ github.token }}
@@ -27,11 +27,11 @@ 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
uses: relative-ci/agent-action@711f3a8fa1b928e6afde280011110c9b0a224a60 # v3.2.4
uses: relative-ci/agent-action@fcf45416581928e8dd62eded78ce98c78e5149f8 # v3.2.3
with:
key: ${{ secrets.RELATIVE_CI_KEY_frontend_legacy }}
token: ${{ github.token }}
+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@72967cdc98ddd3160f1fc3dff619de365e137dd0 # v7.9.0
- uses: release-drafter/release-drafter@4d75298e00d9e34c483e5ff8c68d0ea1c1940c1e # v7.5.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+12 -45
View File
@@ -26,17 +26,17 @@ jobs:
if: github.repository_owner == 'home-assistant'
steps:
- name: Checkout the repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Verify version
uses: home-assistant/actions/helpers/verify-version@06749dd8c0b54f350bc69c8752456cee498808a3 # master
uses: home-assistant/actions/helpers/verify-version@f4ca6f671bd429efb108c0f2fa0ae8af0215986c # master
- name: Setup Node and install
uses: ./.github/actions/setup
@@ -48,44 +48,15 @@ jobs:
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,21 +76,19 @@ 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
@@ -136,13 +105,13 @@ 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Node and install
@@ -154,8 +123,6 @@ jobs:
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
+8 -19
View File
@@ -15,33 +15,22 @@ jobs:
name: Add no-stale label
runs-on: ubuntu-latest
permissions:
contents: read # To check out workflow scripts
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: Check out workflow scripts
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
sparse-checkout: .github/scripts
- name: Add no-stale label
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
script: |
const { withRetry } = await import(
`${process.env.GITHUB_WORKSPACE}/.github/scripts/github-retry.mts`
);
await withRetry("no-stale label", () =>
github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['no-stale']
})
);
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
@@ -53,7 +42,7 @@ jobs:
if: github.event.issue.type.name == 'Task'
steps:
- name: Check out workflow scripts
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
sparse-checkout: .github/scripts
@@ -62,6 +51,6 @@ jobs:
with:
script: |
const { default: checkTaskAuthorization } = await import(
`${process.env.GITHUB_WORKSPACE}/.github/scripts/check-task-authorization.mts`
`${process.env.GITHUB_WORKSPACE}/.github/scripts/check-task-authorization.mjs`
);
await checkTaskAuthorization({ github, context, core });
+3 -5
View File
@@ -12,15 +12,13 @@ permissions:
jobs:
stale:
if: github.repository == 'home-assistant/frontend'
runs-on: ubuntu-latest
steps:
- name: Stale policy
uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v11.0.0
- name: 90 days stale policy
uses: actions/stale@1e223db275d687790206a7acac4d1a11bd6fe629 # v10.4.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-issue-stale: 90
days-before-pr-stale: 60
days-before-stale: 90
days-before-close: 7
operations-per-run: 25
remove-stale-when-updated: true
@@ -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`.
@@ -0,0 +1,47 @@
name: Sync numeric device classes
# Mirrors Home Assistant Core's numeric `SensorDeviceClass` list into the
# build-time default in src/data/sensor_numeric_device_classes.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:
name: Sync
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout the repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Node and install
uses: ./.github/actions/setup
- name: Regenerate numeric device classes
run: ./script/gen_numeric_device_classes
- name: Format
run: yarn prettier --write src/data/sensor_numeric_device_classes.ts
- name: Create pull request
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
branch: chore/sync-numeric-device-classes
commit-message: Update numeric sensor device classes
title: Update numeric sensor device classes
body: |
Regenerated `SENSOR_NUMERIC_DEVICE_CLASSES` from Home Assistant Core's
`SensorDeviceClass`.
Automated by `.github/workflows/sync-numeric-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`.
+1 -2
View File
@@ -15,11 +15,10 @@ 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
+9 -5
View File
@@ -6,15 +6,20 @@ 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
.pnpm-store/
# Python stuff
*.py[cod]
@@ -67,4 +72,3 @@ test/e2e/app/dist/
.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.18.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,22 @@
diff --git a/mwc-formfield-base.js b/mwc-formfield-base.js
index 7b763326d7d51835ad52646bfbc80fe21989abd3..f2baa8224e6d03df1fdb0b9fd03f5c6d77fc8747 100644
--- a/mwc-formfield-base.js
+++ b/mwc-formfield-base.js
@@ -9,7 +9,7 @@ import { BaseElement } from '@material/mwc-base/base-element.js';
import { FormElement } from '@material/mwc-base/form-element.js';
import { observer } from '@material/mwc-base/observer.js';
import { html } from 'lit';
-import { property, query, queryAssignedNodes } from 'lit/decorators.js';
+import { property, query, queryAssignedElements } from 'lit/decorators.js';
import { classMap } from 'lit/directives/class-map.js';
export class FormfieldBase extends BaseElement {
constructor() {
@@ -96,7 +96,7 @@ __decorate([
query('.mdc-form-field')
], FormfieldBase.prototype, "mdcRoot", void 0);
__decorate([
- queryAssignedNodes('', true, '*')
+ queryAssignedElements({ slot: "", flatten: true, selector: "*" })
], FormfieldBase.prototype, "slottedInputs", void 0);
__decorate([
query('label')
@@ -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 Oje=Object.create;var uU=Object.defineProperty;var Lje=Object.getOwnPropertyDescriptor;var Mje=Object.getOwnPropertyNames;var Uje=Object.getPrototypeOf,_je=Object.prototype.hasOwnProperty;var Ce=(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 Ze=(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)uU(e,r,{get:t[r],enumerable:!0})},Hje=(e,t,r,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Mje(t))!_je.call(e,a)&&a!==r&&uU(e,a,{get:()=>t[a],enumerable:!(s=Lje(t,a))||s.enumerable});return e};var et=(e,t,r)=>(r=e!=null?Oje(Uje(e)):{},Hje(t||!e||!e.__esModule?uU(r,"default",{value:e,enumerable:!0}):r,e));var pi={};Vt(pi,{SAFE_TIME:()=>SX,S_IFDIR:()=>ex,S_IFLNK:()=>tx,S_IFMT:()=>Hf,S_IFREG:()=>R2});var Hf,ex,R2,tx,SX,bX=Ze(()=>{Hf=61440,ex=16384,R2=32768,tx=40960,SX=456789e3});var or={};Vt(or,{EBADF:()=>Yo,EBUSY:()=>jje,EEXIST:()=>Kje,EINVAL:()=>qje,EISDIR:()=>Vje,ENOENT:()=>Yje,ENOSYS:()=>Gje,ENOTDIR:()=>Wje,ENOTEMPTY:()=>zje,EOPNOTSUPP:()=>Zje,EROFS:()=>Jje,ERR_DIR_CLOSED:()=>fU});function vc(e,t){return Object.assign(new Error(`${e}: ${t}`),{code:e})}function jje(e){return vc("EBUSY",e)}function Gje(e,t){return vc("ENOSYS",`${e}, ${t}`)}function qje(e){return vc("EINVAL",`invalid argument, ${e}`)}function Yo(e){return vc("EBADF",`bad file descriptor, ${e}`)}function Yje(e){return vc("ENOENT",`no such file or directory, ${e}`)}function Wje(e){return vc("ENOTDIR",`not a directory, ${e}`)}function Vje(e){return vc("EISDIR",`illegal operation on a directory, ${e}`)}function Kje(e){return vc("EEXIST",`file already exists, ${e}`)}function Jje(e){return vc("EROFS",`read-only filesystem, ${e}`)}function zje(e){return vc("ENOTEMPTY",`directory not empty, ${e}`)}function Zje(e){return vc("EOPNOTSUPP",`operation not supported, ${e}`)}function fU(){return vc("ERR_DIR_CLOSED","Directory handle was closed")}var rx=Ze(()=>{});var ll={};Vt(ll,{BigIntStatsEntry:()=>uE,DEFAULT_MODE:()=>hU,DirEntry:()=>AU,StatEntry:()=>cE,areStatsEqual:()=>dU,clearStats:()=>nx,convertToBigIntStats:()=>$je,makeDefaultStats:()=>DX,makeEmptyStats:()=>Xje});function DX(){return new cE}function Xje(){return nx(DX())}function nx(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):pU.types.isDate(r)&&(e[t]=new Date(0))}return e}function $je(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)):pU.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 dU(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 pU,hU,AU,cE,uE,gU=Ze(()=>{pU=et(Ce("util")),hU=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=hU;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 I0(e,t){return t.replace(/\r?\n/g,A6e(e))}var OX,LX,Ip,jf,C0=Ze(()=>{OX=Ce("crypto"),LX=Ce("os");EU();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,OX.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 kX(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(ix(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?I0(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?I0(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(Y)}}});var Gs,Cp=Ze(()=>{C0();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(O){return O},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),Rt=function(){return`
`},Tn="\\r",ha=ur("\\r",!1),Gi=function(){return"\r"},Li="\\t",Ya=ur("\\t",!1),yn=function(){return" "},Xn="\\v",fu=ur("\\v",!1),Eh=function(){return"\v"},Wa=/^[\\'"?]/,Va=zi(["\\","'",'"',"?"],!1,!1),Ka=function(O){return String.fromCharCode(parseInt(O,16))},$e="\\x",Ja=ur("\\x",!1),mf="\\u",fc=ur("\\u",!1),Sn="\\U",da=ur("\\U",!1),_A=function(O){return String.fromCodePoint(parseInt(O,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),Rn=Cf(),ma="{}",za=ur("{}",!1),ss=function(){return"{}"},Ac="-",Au=ur("-",!1),pc="+",Za=ur("+",!1),Mi=".",vs=ur(".",!1),Tl=function(O,J,re){return{type:"number",value:(O==="-"?-1:1)*parseFloat(J.join("")+"."+re.join(""))}},yf=function(O,J){return{type:"number",value:(O==="-"?-1:1)*parseInt(J.join(""))}},hc=function(O){return{type:"variable",...O}},vi=function(O){return{type:"variable",name:O}},Fn=function(O){return O},dc="*",ze=ur("*",!1),at="/",St=ur("/",!1),lr=function(O,J,re){return{type:J==="*"?"multiplication":"division",right:re}},te=function(O,J){return J.reduce((re,de)=>({left:re,...de}),O)},Ee=function(O,J,re){return{type:J==="+"?"addition":"subtraction",right:re}},Oe="$((",mt=ur("$((",!1),Et="))",Dt=ur("))",!1),tr=function(O){return O},pn="$(",ui=ur("$(",!1),qi=function(O){return O},Nn="${",Xa=ur("${",!1),By=":-",z1=ur(":-",!1),Qo=function(O,J){return{name:O,defaultValue:J}},vy=":-}",Ih=ur(":-}",!1),Z1=function(O){return{name:O,defaultValue:[]}},To=":+",Ch=ur(":+",!1),wh=function(O,J){return{name:O,alternativeValue:J}},pu=":+}",Bh=ur(":+}",!1),Ng=function(O){return{name:O,alternativeValue:[]}},Og=function(O){return{name:O}},Lg="$",Sy=ur("$",!1),Ef=function(O){return t.isGlobPattern(O)},Ro=function(O){return O},Rl=/^[a-zA-Z0-9_]/,vh=zi([["a","z"],["A","Z"],["0","9"],"_"],!1,!1),Mg=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),W=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,W)}function Ug(){return wf(xt,W)}function X1(O,J){throw J=J!==void 0?J:wf(xt,W),WA([_g(O)],e.substring(xt,W),J)}function Sh(O,J){throw J=J!==void 0?J:wf(xt,W),mi(O,J)}function ur(O,J){return{type:"literal",text:O,ignoreCase:J}}function zi(O,J,re){return{type:"class",parts:O,inverted:J,ignoreCase:re}}function Cf(){return{type:"any"}}function $a(){return{type:"end"}}function _g(O){return{type:"other",description:O}}function du(O){var J=YA[O],re;if(J)return J;for(re=O-1;!YA[re];)re--;for(J=YA[re],J={line:J.line,column:J.column};re<O;)e.charCodeAt(re)===10?(J.line++,J.column=1):J.column++,re++;return YA[O]=J,J}function wf(O,J){var re=du(O),de=du(J);return{start:{offset:O,line:re.line,column:re.column},end:{offset:J,line:de.line,column:de.column}}}function Bt(O){W<Fo||(W>Fo&&(Fo=W,If=[]),If.push(O))}function mi(O,J){return new v0(O,null,null,J)}function WA(O,J,re){return new v0(v0.buildMessage(O,J),O,J,re)}function el(){var O,J,re;for(O=W,J=[],re=kt();re!==r;)J.push(re),re=kt();return J!==r?(re=ya(),re===r&&(re=null),re!==r?(xt=O,J=n(re),O=J):(W=O,O=r)):(W=O,O=r),O}function ya(){var O,J,re,de,Ke;if(O=W,J=bh(),J!==r){for(re=[],de=kt();de!==r;)re.push(de),de=kt();re!==r?(de=Hg(),de!==r?(Ke=tl(),Ke===r&&(Ke=null),Ke!==r?(xt=O,J=c(J,de,Ke),O=J):(W=O,O=r)):(W=O,O=r)):(W=O,O=r)}else W=O,O=r;if(O===r)if(O=W,J=bh(),J!==r){for(re=[],de=kt();de!==r;)re.push(de),de=kt();re!==r?(de=Hg(),de===r&&(de=null),de!==r?(xt=O,J=f(J,de),O=J):(W=O,O=r)):(W=O,O=r)}else W=O,O=r;return O}function tl(){var O,J,re,de,Ke;for(O=W,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=O,J=p(re),O=J):(W=O,O=r)}else W=O,O=r;else W=O,O=r;return O}function Hg(){var O;return e.charCodeAt(W)===59?(O=h,W++):(O=r,yt===0&&Bt(E)),O===r&&(e.charCodeAt(W)===38?(O=C,W++):(O=r,yt===0&&Bt(S))),O}function bh(){var O,J,re;return O=W,J=VA(),J!==r?(re=jg(),re===r&&(re=null),re!==r?(xt=O,J=x(J,re),O=J):(W=O,O=r)):(W=O,O=r),O}function jg(){var O,J,re,de,Ke,pt,mr;for(O=W,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=O,J=I(re,Ke),O=J):(W=O,O=r)}else W=O,O=r;else W=O,O=r}else W=O,O=r;else W=O,O=r;return O}function ky(){var O;return e.substr(W,2)===R?(O=R,W+=2):(O=r,yt===0&&Bt(N)),O===r&&(e.substr(W,2)===U?(O=U,W+=2):(O=r,yt===0&&Bt(K))),O}function VA(){var O,J,re;return O=W,J=Bf(),J!==r?(re=Gg(),re===r&&(re=null),re!==r?(xt=O,J=$(J,re),O=J):(W=O,O=r)):(W=O,O=r),O}function Gg(){var O,J,re,de,Ke,pt,mr;for(O=W,J=[],re=kt();re!==r;)J.push(re),re=kt();if(J!==r)iLine truncated
`,"\\n"],["\r","\\r"],[" ","\\t"],["\v","\\v"],["\0","\\0"]]),Y6e=new Map([["\\","\\\\"],["$","\\$"],['"','\\"'],...Array.from(eee,([e,t])=>[e,`"$'${t}'"`])]),tee=e=>eee.get(e)??`\\x${e.charCodeAt(0).toString(16).padStart(2,"0")}`,W6e=e=>Y6e.get(e)??`"$'${tee(e)}'"`});var iee=G((ZPt,nee)=>{"use strict";function V6e(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}function b0(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,b0)}V6e(b0,Error);b0.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 K6e(e,t){t=t!==void 0?t:{};var r={},s={resolution:Qe},a=Qe,n="/",c=Ie("/",!1),f=function(Me,P){return{from:Me,descriptor:P}},p=function(Me){return{descriptor:Me}},h="@",E=Ie("@",!1),C=function(Me,P){return{fullName:Me,description:P}},S=function(Me){return{fullName:Me}},x=function(){return De()},I=/^[^\/@]/,R=me(["/","@"],!0,!1),N=/^[^\/]/,U=me(["/"],!0,!1),K=0,$=0,ie=[{line:1,column:1}],fe=0,le=[],ge=0,pe;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 De(){return e.substring($,K)}function ye(){return it($,K)}function d(Me,P){throw P=P!==void 0?P:it($,K),Fe([be(Me)],e.substring($,K),P)}function ve(Me,P){throw P=P!==void 0?P:it($,K),tt(Me,P)}function Ie(Me,P){return{type:"literal",text:Me,ignoreCase:P}}function me(Me,P,w){return{type:"class",parts:Me,inverted:P,ignoreCase:w}}function ce(){return{type:"any"}}function X(){return{type:"end"}}function be(Me){return{type:"other",description:Me}}function ke(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 it(Me,P){var w=ke(Me),D=ke(P);return{start:{offset:Me,line:w.line,column:w.column},end:{offset:P,line:D.line,column:D.column}}}function _(Me){K<fe||(K>fe&&(fe=K,le=[]),le.push(Me))}function tt(Me,P){return new b0(Me,null,null,P)}function Fe(Me,P,w){return new b0(b0.buildMessage(Me,P),Me,P,w)}function Qe(){var Me,P,w,D;return Me=K,P=Se(),P!==r?(e.charCodeAt(K)===47?(w=n,K++):(w=r,ge===0&&_(c)),w!==r?(D=Se(),D!==r?($=Me,P=f(P,D),Me=P):(K=Me,Me=r)):(K=Me,Me=r)):(K=Me,Me=r),Me===r&&(Me=K,P=Se(),P!==r&&($=Me,P=p(P)),Me=P),Me}function Se(){var Me,P,w,D;return Me=K,P=je(),P!==r?(e.charCodeAt(K)===64?(w=h,K++):(w=r,ge===0&&_(E)),w!==r?(D=ct(),D!==r?($=Me,P=C(P,D),Me=P):(K=Me,Me=r)):(K=Me,Me=r)):(K=Me,Me=r),Me===r&&(Me=K,P=je(),P!==r&&($=Me,P=S(P)),Me=P),Me}function je(){var Me,P,w,D,y;return Me=K,e.charCodeAt(K)===64?(P=h,K++):(P=r,ge===0&&_(E)),P!==r?(w=Te(),w!==r?(e.charCodeAt(K)===47?(D=n,K++):(D=r,ge===0&&_(c)),D!==r?(y=Te(),y!==r?($=Me,P=x(),Me=P):(K=Me,Me=r)):(K=Me,Me=r)):(K=Me,Me=r)):(K=Me,Me=r),Me===r&&(Me=K,P=Te(),P!==r&&($=Me,P=x()),Me=P),Me}function Te(){var Me,P,w;if(Me=K,P=[],I.test(e.charAt(K))?(w=e.charAt(K),K++):(w=r,ge===0&&_(R)),w!==r)for(;w!==r;)P.push(w),I.test(e.charAt(K))?(w=e.charAt(K),K++):(w=r,ge===0&&_(R));else P=r;return P!==r&&($=Me,P=x()),Me=P,Me}function ct(){var Me,P,w;if(Me=K,P=[],N.test(e.charAt(K))?(w=e.charAt(K),K++):(w=r,ge===0&&_(U)),w!==r)for(;w!==r;)P.push(w),N.test(e.charAt(K))?(w=e.charAt(K),K++):(w=r,ge===0&&_(U));else P=r;return P!==r&&($=Me,P=x()),Me=P,Me}if(pe=a(),pe!==r&&K===e.length)return pe;throw pe!==r&&K<e.length&&_(X()),Fe(le,fe<e.length?e.charAt(fe):null,fe<e.length?it(fe,fe+1):it(fe,fe))}nee.exports={SyntaxError:b0,parse:K6e}});function Ex(e){let t=e.match(/^\*{1,2}\/(.*)/);if(Line 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),cee.repeat(" ",t)+s+f+n+`
`+cee.repeat(" ",t+this.position-a+s.length)+"^"};UU.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};uee.exports=UU});var xs=G((rxt,pee)=>{"use strict";var Aee=EE(),eGe=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],tGe=["scalar","sequence","mapping"];function rGe(e){var t={};return e!==null&&Object.keys(e).forEach(function(r){e[r].forEach(function(s){t[String(s)]=r})}),t}function nGe(e,t){if(t=t||{},Object.keys(t).forEach(function(r){if(eGe.indexOf(r)===-1)throw new Aee('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=rGe(t.styleAliases||null),tGe.indexOf(this.kind)===-1)throw new Aee('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}pee.exports=nGe});var x0=G((nxt,dee)=>{"use strict";var hee=P0(),Cx=EE(),iGe=xs();function _U(e,t,r){var s=[];return e.include.forEach(function(a){r=_U(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 sGe(){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 Cx("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=_U(this,"implicit",[]),this.compiledExplicit=_U(this,"explicit",[]),this.compiledTypeMap=sGe(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 Cx("Wrong number of arguments for Schema.create function")}if(t=hee.toArray(t),r=hee.toArray(r),!t.every(function(s){return s instanceof IE}))throw new Cx("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!r.every(function(s){return s instanceof iGe}))throw new Cx("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new IE({include:t,explicit:r})};dee.exports=IE});var mee=G((ixt,gee)=>{"use strict";var oGe=xs();gee.exports=new oGe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}})});var Eee=G((sxt,yee)=>{"use strict";var aGe=xs();yee.exports=new aGe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}})});var Cee=G((oxt,Iee)=>{"use strict";var lGe=xs();Iee.exports=new lGe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}})});var wx=G((axt,wee)=>{"use strict";var cGe=x0();wee.exports=new cGe({explicit:[mee(),Eee(),Cee()]})});var vee=G((lxt,Bee)=>{"use strict";var uGe=xs();function fGe(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function AGe(){return null}function pGe(e){return e===null}Bee.exports=new uGe("tag:yaml.org,2002:null",{kind:"scalar",resolve:fGe,construct:AGe,predicate:pGe,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var bee=G((cxt,See)=>{"use strict";var hGe=xs();function dGe(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 gGe(e){return e==="true"||e==="True"||e==="TRUE"}function mGe(e){return Object.prototype.toString.call(e)==="[object Boolean]"}See.exports=new hGe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:dGe,construct:gGe,predicate:mGe,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 Pee=G((uxt,Dee)=>{"use strict";var yGe=P0(),EGe=xs();function IGe(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function CGe(e){return 48<=e&&e<=55}function wGe(e){return 48<=e&&e<=57}function BGe(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(!IGe(e.charCodeAt(r)))return!1;s=!0}return s&&a!=="_"}for(;r<t;r++)if(a=e[r],a!=="_"){if(!CGe(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(!wGe(e.charCodeAt(r)))return!1;s=!0}return!s||a==="_"?!1:a!==":"?!0:/^( Line truncated
\r`;function jGe(e){if(e===null)return!1;var t,r,s=0,a=e.length,n=GU;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 GGe(e){var t,r,s=e.replace(/[\r\n=]/g,""),a=s.length,n=GU,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),k0?k0.from?k0.from(f):new k0(f):f}function qGe(e){var t="",r=0,s,a,n=e.length,c=GU;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 YGe(e){return k0&&k0.isBuffer(e)}Hee.exports=new HGe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:jGe,construct:GGe,predicate:YGe,represent:qGe})});var qee=G((yxt,Gee)=>{"use strict";var WGe=xs(),VGe=Object.prototype.hasOwnProperty,KGe=Object.prototype.toString;function JGe(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,KGe.call(a)!=="[object Object]")return!1;for(n in a)if(VGe.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 zGe(e){return e!==null?e:[]}Gee.exports=new WGe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:JGe,construct:zGe})});var Wee=G((Ext,Yee)=>{"use strict";var ZGe=xs(),XGe=Object.prototype.toString;function $Ge(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],XGe.call(s)!=="[object Object]"||(a=Object.keys(s),a.length!==1))return!1;n[t]=[a[0],s[a[0]]]}return!0}function e5e(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}Yee.exports=new ZGe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:$Ge,construct:e5e})});var Kee=G((Ixt,Vee)=>{"use strict";var t5e=xs(),r5e=Object.prototype.hasOwnProperty;function n5e(e){if(e===null)return!0;var t,r=e;for(t in r)if(r5e.call(r,t)&&r[t]!==null)return!1;return!0}function i5e(e){return e!==null?e:{}}Vee.exports=new t5e("tag:yaml.org,2002:set",{kind:"mapping",resolve:n5e,construct:i5e})});var CE=G((Cxt,Jee)=>{"use strict";var s5e=x0();Jee.exports=new s5e({include:[jU()],implicit:[Lee(),Uee()],explicit:[jee(),qee(),Wee(),Kee()]})});var Zee=G((wxt,zee)=>{"use strict";var o5e=xs();function a5e(){return!0}function l5e(){}function c5e(){return""}function u5e(e){return typeof e>"u"}zee.exports=new o5e("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:a5e,construct:l5e,predicate:u5e,represent:c5e})});var $ee=G((Bxt,Xee)=>{"use strict";var f5e=xs();function A5e(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 p5e(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 h5e(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function d5e(e){return Object.prototype.toString.call(e)==="[object RegExp]"}Xee.exports=new f5e("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:A5e,construct:p5e,predicate:d5e,represent:h5e})});var rte=G((vxt,tte)=>{"use strict";var Bx;try{ete=Ce,Bx=ete("esprima")}catch{typeof window<"u"&&(Bx=window.esprima)}var ete,g5e=xs();function m5e(e){if(e===null)return!1;try{var t="("+e+")",r=Bx.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 y5e(e){var t="("+e+")",r=Bx.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 E5e(e){return e.toString()}function I5e(e){return Object.prototype.toString.call(e)==="[object Function]"}tte.exports=new g5e("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:m5e,construct:y5e,predicate:I5e,represent:E5e})});var H2=G((bxt,ite)=>{"use strict";var nte=x0();ite.exports=nte.DEFAULT=new nte({include:[CE()],explicit:[Zee(),$ee(),rte()]})});var Bte=G((Dxt,j2)=>{"use strict";var Bp=P0(),fte=EE(),C5e=fee(),Ate=CE(),w5e=H2(),sd=Object.prototype.hasOwnProperty,vx=1,pte=2,hte=3,Sx=4,qU=1,B5e=2,ste=3,v5e=/[\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 k5e(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var mte=new Array(256),yte=new Array(256);for(Q0=0;Q0<256;Q0++)mte[Q0]=ate(Q0)?1:0,yte[Q0]=ate(Q0);var Q0;function Q5e(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||w5e,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 Ete(e,t){return new fte(t,new C5e(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function Nr(e,t){throw Ete(e,t)}function bx(e,t){e.onWarning&&e.onWarning.call(null,Ete(e,t))}var lte={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&&bx(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],dte.test(a)||Nr(t,"ill-formed tag handle (first argument) of the TAG directive"),sd.call(t.tagMap,a)&&Nr(t,'there is a previously declared suffix for "'+a+'" tag handle'),gte.test(n)||Nr(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[a]=n}};function id(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 v5e.test(f)&&Nr(e,"the stream contains non-printable characters");e.result+=f}}function cte(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],sd.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"&&ote(a[p])==="[object Object]"&&(a[p]="[object Object]");if(typeof a=="object"&&ote(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)cte(e,t,n[p],r);else cte(e,t,n,r);else!e.json&&!sd.call(r,a)&&sd.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 YU(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(;T0(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(YU(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&&bx(e,"deficient indentation"),s}function Dx(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 WU(e,t){t===1?e.result+=" ":t>1&&(e.result+=Bp.repeat(`
`,t-1))}function T5e(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&&Dx(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&&(id(e,n,c,!1),WU(e,e.line-p),n=c=e.position,f=!1),T0(x)||(c=e.position+1),x=e.input.charCodeAt(++e.position)}return id(e,n,c,!1),e.result?!0:(e.kind=C,e.result=S,!1)}function R5e(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(id(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)?(id(e,s,a,!0),WU(e,cs(e,!1,t)),s=a=e.position):e.position===e.lineStart&&Dx(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 F5e(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 id(e,r,e.position,!0),e.position++,!0;if(f===92){if(id(e,r,e.position,!0),f=e.input.charCodeAt(++e.position),Yf(f))cs(e,!1,t);else if(f<256&&mte[f])e.result+=yte[f],e.position++;else if((c=P5e(f))>0){for(a=c,n=0;a>0;a--)f=e.input.charCodeAt(++e.position),(c=D5e(f))>=0?n=(n<<4)+c:Nr(e,"expected hexadecimal character");e.result+=k5e(n),e.position++}else Nr(e,"unknown escape sequence");r=s=e.position}else Yf(f)?(id(e,r,s,!0),WU(e,cs(e,!1,t)),r=s=e.position):e.position===e.lineStart&&Dx(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 N5e(e,t){var r=!0,s,a=e.tag,n,c=e.anchor,f,p,h,E,C,S={},x,I,R,N;if(N=e.input.charCodeAt(e.position),N===91)p=93,C=!1,n=[];else if(N===123)p=125,C=!0,n={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=n),N=e.input.charCodeAt(++e.position);N!==0;){if(cs(e,!0,t),N=e.input.charCodeAt(e.position),N===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=R=null,h=E=!1,N===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,vx,!1,!0),I=e.tag,x=e.result,cs(e,!0,t),N=e.input.charCodeAt(e.position),(E||e.line===s)&&N===58&&(h=!0,N=e.input.charCodeAt(++e.position),cs(e,!0,t),vE(e,t,vx,!1,!0),R=e.result),C?BE(e,n,S,I,x,R):h?n.push(BE(e,null,S,I,x,R)):n.push(x),cs(e,!0,t),N=e.input.charCodeAt(e.position),N===44?(r=!0,N=e.input.charCodeAt(++e.position)):r=!1}Nr(e,"unexpected end of the stream within a flow collection")}function O5e(e,t){var r,s,a=qU,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)qU===a?a=C===43?ste:B5e:Nr(e,"repeat of a chomping mode identifier");else if((E=x5e(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(T0(C)){do C=e.input.charCodeAt(++e.position);while(T0(C));if(C===35)do C=e.input.charCodeAt(++e.position);while(!Yf(C)&&C!==0)}for(;C!==0;){for(YU(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===ste?e.result+=Bp.repeat(`
`,n?1+p:p):a===qU&&n&&(e.result+=`
`);break}for(s?T0(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);id(e,r,e.position,!1)}return!0}function ute(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,hte,!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 L5e(e,t,r){var s,a,n,c,f=e.tag,p=e.anchor,h={},E={},C=null,S=null,x=null,I=!1,R=!1,N;for(e.anchor!==null&&(e.anchorMap[e.anchor]=h),N=e.input.charCodeAt(e.position);N!==0;){if(s=e.input.charCodeAt(e.position+1),n=e.line,c=e.position,(N===63||N===58)&&fl(s))N===63?(I&&(BE(e,h,E,C,S,null),C=S=x=null),R=!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,N=s;else if(vE(e,r,pte,!1,!0))if(e.line===n){for(N=e.input.charCodeAt(e.position);T0(N);)N=e.input.charCodeAt(++e.position);if(N===58)N=e.input.charCodeAt(++e.position),fl(N)||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),R=!0,I=!1,a=!1,C=e.tag,S=e.result;else if(R)Nr(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=f,e.anchor=p,!0}else if(R)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,Sx,!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),N=e.input.charCodeAt(e.position)),e.lineIndent>t&&N!==0)Nr(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return I&&BE(e,h,E,C,S,null),R&&(e.tag=f,e.anchor=p,e.kind="mapping",e.result=h),R}function M5e(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),dte.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),b5e.test(n)&&Nr(e,"tag suffix cannot contain flow indicator characters")}return n&&!gte.test(n)&&Nr(e,"tag name cannot contain such characters: "+n),r?e.tag=n:sd.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 U5e(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 _5e(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),sd.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,R;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,n=c=f=Sx===r||hte===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(;M5e(e)||U5e(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||Sx===r)&&(vx===r||pte===r?I=t:I=t+1,R=e.position-e.lineStart,p===1?f&&(ute(e,R)||L5e(e,R,I))||N5e(e,I)?E=!0:(c&&O5e(e,I)||R5e(e,I)||F5e(e,I)?E=!0:_5e(e)?(E=!0,(e.tag!==null||e.anchor!==null)&&Nr(e,"alias node should not have any properties")):T5e(e,I,vx===r)&&(E=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):p===0&&(E=f&&ute(e,R))),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 Q5e(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;)H5e(r);return r.documents}function Cte(e,t,r){t!==null&&typeof t=="object"&&typeof r>"u"&&(r=t,t=null);var s=Ite(e,r);if(typeof t!="function")return s;for(var a=0,n=s.length;a<n;a+=1)t(s[a])}function wte(e,t){var r=Ite(e,t);if(r.length!==0){if(r.length===1)return r[0];throw new fte("expected a single document in the stream, but found more")}}function j5e(e,t,r){return typeof t=="object"&&t!==null&&typeof r>"u"&&(r=t,t=null),Cte(e,t,Bp.extend({schema:Ate},r))}function G5e(e,t){return wte(e,Bp.extend({schema:Ate},t))}j2.exports.loadAll=Cte;j2.exports.load=wte;j2.exports.safeLoadAll=j5e;j2.exports.safeLoad=G5e});var Wte=G((Pxt,zU)=>{"use strict";var q2=P0(),Y2=EE(),q5e=H2(),Y5e=CE(),Qte=Object.prototype.toString,Tte=Object.prototype.hasOwnProperty,W5e=9,G2=10,V5e=13,K5e=32,J5e=33,z5e=34,Rte=35,Z5e=37,X5e=38,$5e=39,e9e=42,Fte=44,t9e=45,Nte=58,r9e=61,n9e=62,i9e=63,s9e=64,Ote=91,Lte=93,o9e=96,Mte=123,a9e=124,Ute=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 l9e=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function c9e(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&&Tte.call(p.styleAliases,f)&&(f=p.styleAliases[f]),r[c]=f;return r}function vte(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 Y2("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+q2.repeat("0",s-t.length)+t}function u9e(e){this.schema=e.schema||q5e,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=q2.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=c9e(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 Ste(e,t){for(var r=q2.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 VU(e,t){return`
`+q2.repeat(" ",e.indent*t)}function f9e(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 JU(e){return e===K5e||e===W5e}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 A9e(e){return SE(e)&&!JU(e)&&e!==65279&&e!==V5e&&e!==G2}function bte(e,t){return SE(e)&&e!==65279&&e!==Fte&&e!==Ote&&e!==Lte&&e!==Mte&&e!==Ute&&e!==Nte&&(e!==Rte||t&&A9e(t))}function p9e(e){return SE(e)&&e!==65279&&!JU(e)&&e!==t9e&&e!==i9e&&e!==Nte&&e!==Fte&&e!==Ote&&e!==Lte&&e!==Mte&&e!==Ute&&e!==Rte&&e!==X5e&&e!==e9e&&e!==J5e&&e!==a9e&&e!==r9e&&e!==n9e&&e!==$5e&&e!==z5e&&e!==Z5e&&e!==s9e&&e!==o9e}function _te(e){var t=/^\n* /;return t.test(e)}var Hte=1,jte=2,Gte=3,qte=4,Px=5;function h9e(e,t,r,s,a){var n,c,f,p=!1,h=!1,E=s!==-1,C=-1,S=p9e(e.charCodeAt(0))&&!JU(e.charCodeAt(e.length-1));if(t)for(n=0;n<e.length;n++){if(c=e.charCodeAt(n),!SE(c))return Px;f=n>0?e.charCodeAt(n-1):null,S=S&&bte(c,f)}else{for(n=0;n<e.length;n++){if(c=e.charCodeAt(n),c===G2)p=!0,E&&(h=h||n-C-1>s&&e[C+1]!==" ",C=n);else if(!SE(c))return Px;f=n>0?e.charCodeAt(n-1):null,S=S&&bte(c,f)}h=h||E&&n-C-1>s&&e[C+1]!==" "}return!p&&!h?S&&!a(e)?Hte:jte:r>9&&_te(e)?Px:h?qte:Gte}function d9e(e,t,r,s){e.dump=function(){if(t.length===0)return"''";if(!e.noCompatMode&&l9e.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 f9e(e,p)}switch(h9e(t,c,e.indent,n,f)){case Hte:return t;case jte:return"'"+t.replace(/'/g,"''")+"'";case Gte:return"|"+Dte(t,e.indent)+Pte(Ste(t,a));case qte:return">"+Dte(t,e.indent)+Pte(Ste(g9e(t,n),a));case Px:return'"'+m9e(t,n)+'"';default:throw new Y2("impossible error: invalid scalar style")}}()}function Dte(e,t){var r=_te(e)?String(t):"",s=e[e.length-1]===`
`,a=s&&(e[e.length-2]===`
`||e===`
`),n=a?"+":s?"":"-";return r+n+`
`}function Pte(e){return e[e.length-1]===`
`?e.slice(0,-1):e}function g9e(e,t){for(var r=/(\n+)([^\n]*)/g,s=function(){var h=e.indexOf(`
`);return h=h!==-1?h:e.length,r.lastIndex=h,xte(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!==""?`
`:"")+xte(p,t),a=n}return s}function xte(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 m9e(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+=vte((r-55296)*1024+s-56320+65536),n++;continue}a=Vo[r],t+=!a&&SE(r)?e[n]:a||vte(r)}return t}function y9e(e,t,r){var s="",a=e.tag,n,c;for(n=0,c=r.length;n<c;n+=1)R0(e,t,r[n],!1,!1)&&(n!==0&&(s+=","+(e.condenseFlow?"":" ")),s+=e.dump);e.tag=a,e.dump="["+s+"]"}function E9e(e,t,r,s){var a="",n=e.tag,c,f;for(c=0,f=r.length;c<f;c+=1)R0(e,t+1,r[c],!0,!0)&&((!s||c!==0)&&(a+=VU(e,t)),e.dump&&G2===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=n,e.dump=a||"[]"}function I9e(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],R0(e,t,p,!1,!1)&&(e.dump.length>1024&&(E+="? "),E+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),R0(e,t,h,!1,!1)&&(E+=e.dump,s+=E));e.tag=a,e.dump="{"+s+"}"}function C9e(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 Y2("sortKeys must be a boolean or a function");for(f=0,p=c.length;f<p;f+=1)S="",(!s||f!==0)&&(S+=VU(e,t)),h=c[f],E=r[h],R0(e,t+1,h,!0,!0,!0)&&(C=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,C&&(e.dump&&G2===e.dump.charCodeAt(0)?S+="?":S+="? "),S+=e.dump,C&&(S+=VU(e,t)),R0(e,t+1,E,!0,C)&&(e.dump&&G2===e.dump.charCodeAt(0)?S+=":":S+=": ",S+=e.dump,a+=S));e.tag=n,e.dump=a||"{}"}function kte(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,Qte.call(f.represent)==="[object Function]")s=f.represent(t,p);else if(Tte.call(f.represent,p))s=f.represent[p](t,p);else throw new Y2("!<"+f.tag+'> tag resolver accepts not "'+p+'" style');e.dump=s}return!0}return!1}function R0(e,t,r,s,a,n){e.tag=null,e.dump=r,kte(e,r,!1)||kte(e,r,!0);var c=Qte.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?(C9e(e,t,e.dump,a),h&&(e.dump="&ref_"+p+e.dump)):(I9e(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?(E9e(e,E,e.dump,a),h&&(e.dump="&ref_"+p+e.dump)):(y9e(e,E,e.dump),h&&(e.dump="&ref_"+p+" "+e.dump))}else if(c==="[object String]")e.tag!=="?"&&d9e(e,e.dump,t,n);else{if(e.skipInvalid)return!1;throw new Y2("unacceptable kind of an object to dump "+c)}e.tag!==null&&e.tag!=="?"&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function w9e(e,t){var r=[],s=[],a,n;for(KU(e,r,s),a=0,n=s.length;a<n;a+=1)t.duplicates.push(r[s[a]]);t.usedDuplicates=new Array(n)}function KU(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)KU(e[a],t,r);else for(s=Object.keys(e),a=0,n=s.length;a<n;a+=1)KU(e[s[a]],t,r)}function Yte(e,t){t=t||{};var r=new u9e(t);return r.noRefs||w9e(e,r),R0(r,0,e,!0,!0)?r.dump+`
`:""}function B9e(e,t){return Yte(e,q2.extend({schema:Y5e},t))}zU.exports.dump=Yte;zU.exports.safeDump=B9e});var Kte=G((xxt,Yi)=>{"use strict";var xx=Bte(),Vte=Wte();function kx(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}Yi.exports.Type=xs();Yi.exports.Schema=x0();Yi.exports.FAILSAFE_SCHEMA=wx();Yi.exports.JSON_SCHEMA=HU();Yi.exports.CORE_SCHEMA=jU();Yi.exports.DEFAULT_SAFE_SCHEMA=CE();Yi.exports.DEFAULT_FULL_SCHEMA=H2();Yi.exports.load=xx.load;Yi.exports.loadAll=xx.loadAll;Yi.exports.safeLoad=xx.safeLoad;Yi.exports.safeLoadAll=xx.safeLoadAll;Yi.exports.dump=Vte.dump;Yi.exports.safeDump=Vte.safeDump;Yi.exports.YAMLException=EE();Yi.exports.MINIMAL_SCHEMA=wx();Yi.exports.SAFE_SCHEMA=CE();Yi.exports.DEFAULT_SCHEMA=H2();Yi.exports.scan=kx("scan");Yi.exports.parse=kx("parse");Yi.exports.compose=kx("compose");Yi.exports.addConstructor=kx("addConstructor")});var zte=G((kxt,Jte)=>{"use strict";var v9e=Kte();Jte.exports=v9e});var Xte=G((Qxt,Zte)=>{"use strict";function S9e(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}function F0(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,F0)}S9e(F0,Error);F0.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 b9e(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=":",R=yn(":",!1),N=function(te,Ee){return{[te]:Ee}},U=",",K=yn(",",!1),$=function(te,Ee){return Ee},ie=function(te,Ee,Oe){return Object.assign({},...[te].concat(Ee).map(mt=>({[mt]:Oe})))},fe=function(te){return te},le=function(te){return te},ge=Wa("correct indentation"),pe=" ",De=yn(" ",!1),ye=function(te){return te.length===lr*St},d=function(te){return te.length===(lr+1)*St},ve=function(){return lr++,!0},Ie=function(){return lr--,!0},me=function(){return ha()},ce=Wa("pseudostring"),X=/^[^\r\n\t ?:,\][{}#&*!|>'"%@`\-]/,be=Xn(["\r",`
`," "," ","?",":",",","]","[","{","}","#","&","*","!","|",">","'",'"',"%","@","`","-"],!0,!1),ke=/^[^\r\n\t ,\][{}:#"']/,it=Xn(["\r",`
`," "," ",",","]","[","{","}",":","#",'"',"'"],!0,!1),_=function(){return ha().replace(/^ *| *$/g,"")},tt="--",Fe=yn("--",!1),Qe=/^[a-zA-Z\/0-9]/,Se=Xn([["a","z"],["A","Z"],"/",["0","9"]],!1,!1),je=/^[^\r\n\t :,]/,Te=Xn(["\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),Z=function(){return!1},ee=Wa("string"),se='"',xe=yn('"',!1),Ne=function(){return""},ut=function(te){return te},Ct=function(te){return te.join("")},Yt=/^[^"\\\0-\x1F\x7F]/,ir=Xn(['"',"\\",["\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,Ee,Oe,mt){return String.fromCharCode(parseInt(`0x${te}${Ee}${Oe}${mt}`))},Aa=/^[0-9a-fA-F]/,pa=Xn([["0","9"],["a","f"],["A","F"]],!1,!1),LA=Wa("blank space"),gr=/^[ \t]/,ko=Xn([" "," "],!1,!1),qa=Wa("white space"),Ue=/^[ \t\n\r]/,wr=Xn([" "," ",`
`,"\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=[],Rt=0,Tn;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,Ee){throw Ee=Ee!==void 0?Ee:Ka(Ot,we),mf([Wa(te)],e.substring(Ot,we),Ee)}function Ya(te,Ee){throw Ee=Ee!==void 0?Ee:Ka(Ot,we),Ja(te,Ee)}function yn(te,Ee){return{type:"literal",text:te,ignoreCase:Ee}}function Xn(te,Ee,Oe){return{type:"class",parts:te,inverted:Ee,ignoreCase:Oe}}function fu(){return{type:"any"}}function Eh(){return{type:"end"}}function Wa(te){return{type:"other",description:te}}function Va(te){var Ee=uc[te],Oe;if(Ee)return Ee;for(Oe=te-1;!uc[Oe];)Oe--;for(Ee=uc[Oe],Ee={line:Ee.line,column:Ee.column};Oe<te;)e.charCodeAt(Oe)===10?(Ee.line++,Ee.column=1):Ee.column++,Oe++;return uc[te]=Ee,Ee}function Ka(te,Ee){var Oe=Va(te),mt=Va(Ee);return{start:{offset:te,line:Oe.line,column:Oe.column},end:{offset:Ee,line:mt.line,column:mt.column}}}function $e(te){we<Oi||(we>Oi&&(Oi=we,fo=[]),fo.push(te))}function Ja(te,Ee){return new F0(te,null,null,Ee)}function mf(te,Ee,Oe){return new F0(F0.buildMessage(te,Ee),te,Ee,Oe)}function fc(){var te;return te=_A(),te}function Sn(){var te,Ee,Oe;for(te=we,Ee=[],Oe=da();Oe!==r;)Ee.push(Oe),Oe=da();return Ee!==r&&(Ot=te,Ee=n(Ee)),te=Ee,te}function da(){var te,Ee,Oe,mt,Et;return te=we,Ee=Ql(),Ee!==r?(e.charCodeAt(we)===45?(Oe=c,we++):(Oe=r,Rt===0&&$e(f)),Oe!==r?(mt=Fn(),mt!==r?(Et=ga(),Et!==r?(Ot=te,Ee=p(Et),te=Ee):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r),te}function _A(){var te,Ee,Oe;for(te=we,Ee=[],Oe=HA();Oe!==r;)Ee.push(Oe),Oe=HA();return Ee!==r&&(Ot=te,Ee=h(Ee)),te=Ee,te}function HA(){var te,Ee,Oe,mt,Et,Dt,tr,pn,ui;if(te=we,Ee=Fn(),Ee===r&&(Ee=null),Ee!==r){if(Oe=we,e.charCodeAt(we)===35?(mt=E,we++):(mt=r,Rt===0&&$e(C)),mt!==r){if(Et=[],Dt=we,tr=we,Rt++,pn=at(),Rt--,pn===r?tr=void 0:(we=tr,tr=r),tr!==r?(e.length>we?(pn=e.charAt(we),we++):(pn=r,Rt===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,Rt++,pn=at(),Rt--,pn===r?tr=void 0:(we=tr,tr=r),tr!==r?(e.length>we?(pn=e.charAt(we),we++):(pn=r,Rt===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,Ee=x(),te=Ee):(we=te,te=r)}else we=te,te=r}else we=te,te=r;if(te===r&&(te=we,Ee=Ql(),Ee!==r?(Oe=za(),Oe!==r?(mt=Fn(),mt===r&&(mt=null),mt!==r?(e.charCodeAt(we)===58?(Et=I,we++):(Et=r,Rt===0&&$e(R)),Et!==r?(Dt=Fn(),Dt===r&&(Dt=null),Dt!==r?(tr=ga(),tr!==r?(Ot=te,Ee=N(Oe,tr),te=Ee):(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,Ee=Ql(),Ee!==r?(Oe=ss(),Oe!==r?(mt=Fn(),mt===r&&(mt=null),mt!==r?(e.charCodeAt(we)===58?(Et=I,we++):(Et=r,Rt===0&&$e(R)),Et!==r?(Dt=Fn(),Dt===r&&(Dt=null),Dt!==r?(tr=ga(),tr!==r?(Ot=te,Ee=N(Oe,tr),te=Ee):(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,Ee=Ql(),Ee!==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,Ee=N(Oe,Et),te=Ee):(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,Ee=Ql(),Ee!==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,Rt===0&&$e(K)),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,Rt===0&&$e(K)),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,Rt===0&&$e(R)),Dt!==r?(tr=Fn(),tr===r&&(tr=null),tr!==r?(pn=ga(),pn!==r?(Ot=te,Ee=ie(Oe,mt,pn),te=Ee):(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,Ee,Oe,mt,Et,Dt,tr;if(te=we,Ee=we,Rt++,Oe=we,mt=at(),mt!==r?(Et=Ut(),Et!==r?(e.charCodeAt(we)===45?(Dt=c,we++):(Dt=r,Rt===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),Rt--,Oe!==r?(we=Ee,Ee=void 0):Ee=r,Ee!==r?(Oe=ze(),Oe!==r?(mt=Rn(),mt!==r?(Et=Sn(),Et!==r?(Dt=ma(),Dt!==r?(Ot=te,Ee=fe(Et),te=Ee):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r),te===r&&(te=we,Ee=at(),Ee!==r?(Oe=Rn(),Oe!==r?(mt=_A(),mt!==r?(Et=ma(),Et!==r?(Ot=te,Ee=fe(mt),te=Ee):(we=te,te=r)):(we=te,te=r)):(we=te,te=r)):(we=te,te=r),te===r))if(te=we,Ee=Ac(),Ee!==r){if(Oe=[],mt=ze(),mt!==r)for(;mt!==r;)Oe.push(mt),mt=ze();else Oe=r;Oe!==r?(Ot=te,Ee=lLine truncated
`;if(typeof e=="number"||typeof e=="boolean")return`${e.toString()}
`;if(typeof e=="string")return`${ere(e)}
`;if(Array.isArray(e)){if(e.length===0)return`[]
`;let s=" ".repeat(t);return`
${e.map(n=>`${s}- ${ZU(n,t+1,!1)}`).join("")}`}if(typeof e=="object"&&e){let[s,a]=e instanceof Qx?[e.data,!1]:[e,!0],n=" ".repeat(t),c=Object.keys(s);a&&c.sort((p,h)=>{let E=$te.indexOf(p),C=$te.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=>!rre(s[p])).map((p,h)=>{let E=s[p],C=ere(p),S=ZU(E,t+1,!0),x=h>0||r?n:"",I=C.length>1024?`? ${C}
${x}:`:`${C}:`,R=S.startsWith(`
`)?S:` ${S}`;return`${x}${I}${R}`}).join(t===0?`
`:"")||`
`;return r?`
${f}`:`${f}`}throw new Error(`Unsupported value type (${e})`)}function Al(e){try{let t=ZU(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,tre.parse)(e)}function k9e(e){if(x9e.test(e))return P9e(e);let t=(0,Tx.safeLoad)(e,{schema:Tx.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 k9e(e)}var Tx,tre,D9e,$te,Qx,x9e,nre=Ze(()=>{Tx=et(zte()),tre=et(Xte()),D9e=/^(?![-?:,\][{}#&*!|>'"%@` \t\r\n]).([ \t]*(?![,\][{}:# \t\r\n]).)*$/,$te=["__metadata","version","resolution","dependencies","peerDependencies","dependenciesMeta","peerDependenciesMeta","binaries"],Qx=class{constructor(t){this.data=t}};Al.PreserveOrdering=Qx;x9e=/^(#.*(\r?\n))*?#\s+yarn\s+lockfile\s+v1\r?\n/i});var W2={};Vt(W2,{parseResolution:()=>Ex,parseShell:()=>gx,parseSyml:()=>us,stringifyArgument:()=>LU,stringifyArgumentSegment:()=>MU,stringifyArithmeticExpression:()=>yx,stringifyCommand:()=>OU,stringifyCommandChain:()=>yE,stringifyCommandChainThen:()=>NU,stringifyCommandLine:()=>mx,stringifyCommandLineThen:()=>FU,stringifyEnvSegment:()=>dx,stringifyRedirectArgument:()=>U2,stringifyResolution:()=>Ix,stringifyShell:()=>mE,stringifyShellLine:()=>mE,stringifySyml:()=>Al,stringifyValueArgument:()=>S0});var Sc=Ze(()=>{ree();oee();nre()});var sre=G((Oxt,XU)=>{"use strict";var Q9e=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},ire=(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=Q9e(e)),e=e.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(a,n)=>n.toUpperCase()).replace(/\d+(\w|$)/g,a=>a.toUpperCase()),r(e))};XU.exports=ire;XU.exports.default=ire});var ore=G((Lxt,T9e)=>{T9e.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:"RELEASEH 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}
${r_(t)}`}else this.message=`Command not found; did you mean one of:
${this.candidates.map(({usage:s},a)=>`${`${a}.`.padStart(4)} ${s}`).join(`
`)}
${r_(t)}`}},Nx=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(`
`)}
${r_(t)}`}},r_=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 R9e(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=R9e(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 n_,ure,fre,i_=Ze(()=>{n_=Array(80).fill("\u2501");for(let e=0;e<=24;++e)n_[n_.length-e]=`\x1B[38;5;${232+e}m\u2501`;ure={header:e=>`\x1B[1m\u2501\u2501\u2501 ${e}${e.length<75?` ${n_.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`},fre={header:e=>e,bold:e=>e,error:e=>e,code:e=>e}});function va(e){return{...e,[V2]:!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 Lx(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 K2(e,t){return t.length===1?new ot(`${e}${Lx(t[0],{mergeName:!0})}`):new ot(`${e}:
${t.map(r=>`
- ${Lx(r)}`).join("")}`)}function L0(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 K2(`Invalid value for ${e}`,s);for(let[,f]of a)f();return t}var V2,vp=Ze(()=>{Ox();V2=Symbol("clipanion/isOption")});var qs={};Vt(qs,{KeyRelationship:()=>Vf,TypeAssertionError:()=>ad,applyCascade:()=>z2,as:()=>X9e,assert:()=>J9e,assertWithErrors:()=>z9e,cascade:()=>ld,fn:()=>$9e,hasAtLeastOneKey:()=>f_,hasExactLength:()=>gre,hasForbiddenKeys:()=>yqe,hasKeyRelationship:()=>X2,hasMaxLength:()=>tqe,hasMinLength:()=>eqe,hasMutuallyExclusiveKeys:()=>Eqe,hasRequiredKeys:()=>mqe,hasUniqueItems:()=>rqe,isArray:()=>Mx,isAtLeast:()=>c_,isAtMost:()=>sqe,isBase64:()=>pqe,isBoolean:()=>H9e,isDate:()=>G9e,isDict:()=>W9e,isEnum:()=>Qs,isHexColor:()=>Aqe,isISO8601:()=>fqe,isInExclusiveRange:()=>aqe,isInInclusiveRange:()=>oqe,isInstanceOf:()=>K9e,isInteger:()=>u_,isJSON:()=>hqe,isLiteral:()=>pre,isLowerCase:()=>lqe,isMap:()=>Y9e,isNegative:()=>nqe,isNullable:()=>gqe,isNumber:()=>a_,isObject:()=>hre,isOneOf:()=>l_,isOptional:()=>dqe,isPartial:()=>V9e,isPayload:()=>j9e,isPositive:()=>iqe,isRecord:()=>_x,isSet:()=>q9e,isString:()=>Jf,isTuple:()=>Ux,isUUID4:()=>uqe,isUnknown:()=>o_,isUpperCase:()=>cqe,makeTrait:()=>dre,makeValidator:()=>Wr,matchesRegExp:()=>Sp,softAssert:()=>Z9e});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 od(e,t){var r,s,a;return typeof t=="number"?`${(r=e?.p)!==null&&r!==void 0?r:"."}[${t}]`:F9e.test(t)?`${(s=e?.p)!==null&&s!==void 0?s:""}.${t}`:`${(a=e?.p)!==null&&a!==void 0?a:"."}[${JSON.stringify(t)}]`}function s_(e,t,r){return e===1?t:r}function Er({errors:e,p:t}={},r){return e?.push(`${t??"."}: ${r}`),!1}function U9e(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 J2(e,t,r){let s=()=>(e(r()),a),a=()=>(e(t),s);return s}function o_(){return Wr({test:(e,t)=>!0})}function pre(e){return Wr({test:(t,r)=>t!==e?Er(r,`Expected ${si(e)} (got ${si(t)})`):!0})}function Jf(){return Wr({test:(e,t)=>typeof e!="string"?Er(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?pre([...s][0]):Wr({test:(a,n)=>s.has(a)?!0:r?Er(n,`Expected one of ${DE(t,"or")} (got ${si(a)})`):Er(n,`Expected a valid enumeration value (got ${si(a)})`)})}function H9e(){return Wr({test:(e,t)=>{var r;if(typeof e!="boolean"){if(typeof t?.coercions<"u"){if(typeof t?.coercion>"u")return Er(t,"Unbound coercion result");let s=_9e.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 Er(t,`Expected a boolean (got ${si(e)})`)}return!0}})}function a_(){return Wr({test:(e,t)=>{var r;if(typeof e!="number"){if(typeof t?.coercions<"u"){if(typeof t?.coercion>"u")return Er(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 Er(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 Er(t,`Expected a number (got ${si(e)})`)}return!0}})}function j9e(e){return Wr({test:(t,r)=>{var s;if(typeof r?.coercions>"u")return Er(r,"The isPayload predicate can only be used with coercion enabled");if(typeof r.coercion>"u")return Er(r,"Unbound coercion result");if(typeof t!="string")return Er(r,`Expected a string (got ${si(t)})`);let a;try{a=JSON.parse(t)}catch{return Er(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 G9e(){return Wr({test:(e,t)=>{var r;if(!(e instanceof Date)){if(typeof t?.coercions<"u"){if(typeof t?.coercion>"u")return Er(t,"Unbound coercion result");let s;if(typeof e=="string"&&Are.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 Er(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 Er(t,`Expected a date (got ${si(e)})`)}return!0}})}function Mx(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={}));Iqe={[Vf.Forbids]:{expect:!1,message:"forbids using"},[Vf.Requires]:{expect:!0,message:"requires using"}}});var st,cd=Ze(()=>{vp();st=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 K2("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}};st.isOption=V2;st.Default=[]});function pl(e){t_&&console.log(e)}function yre(){let e={nodes:[]};for(let t=0;t<Cn.CustomNode;++t)e.nodes.push(Vl());return e}function Cqe(e){let t=yre(),r=[],s=t.nodes.length;for(let a of e){r.push(s);for(let n=0;n<a.nodes.length;++n)Ire(n)||t.nodes.push(xqe(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 wqe(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 Bqe(e,{prefix:t=""}={}){if(t_){pl(`${t}Nodes are:`);for(let r=0;r<e.nodes.length;++r)pl(`${t} ${r}: ${JSON.stringify(e.nodes[r])}`)}}function vqe(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:[]}}];Bqe(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:R,reducer:N}of I)h.push({node:R,state:typeof N<"u"?Hx(p_,N,C,c,p):C}),pl(` Static transition to ${R} found`)}else pl(" No static transition found");else{let I=!1;for(let R of Object.keys(S.statics))if(R.startsWith(c)){if(c===R)for(let{to:N,reducer:U}of S.statics[R])h.push({node:N,state:typeof U<"u"?Hx(p_,U,C,c,p):C}),pl(` Static transition to ${N} found`);else for(let{to:N}of S.statics[R])h.push({node:N,state:{...C,remainder:R.slice(c.length)}}),pl(` Static transition to ${N} found (partial match)`);I=!0}I||pl(" No partial static transition found")}if(!f)for(let[I,{to:R,reducer:N}]of S.dynamics)Hx(kqe,I,C,c,p)&&(h.push({node:R,state:typeof N<"u"?Hx(p_,N,C,c,p):C}),pl(` Dynamic transition to ${R} found (via ${I})`))}if(h.length===0&&f&&t.length===1)return[{node:Cn.InitialNode,state:mre}];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=bqe(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 Sqe(e,t,{endToken:r=ii.EndOfInput}={}){let s=vqe(e,[...t,r]);return Dqe(t,s.map(({state:a})=>a))}function bqe(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 Dqe(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===O0||S.requiredOptions.every(x=>x.some(I=>S.options.find(R=>R.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 Pre(...e){let{resolvedOptions:t,resolvedCommandClasses:r,resolvedArgv:s,resolvedContext:a}=kre(e);return ba.from(r,t).runExit(s,a)}async function xre(...e){let{resolvedOptions:t,resolvedCommandClasses:r,resolvedArgv:s,resolvedContext:a}=kre(e);return ba.from(r,t).run(s,a)}function kre(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 st||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 st||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 Dre(e){return e()}var bre,ba,Qre=Ze(()=>{Fx();Gx();i_();vre();cd();Sre();bre=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 jx({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[st.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 O0:{let E=Yx.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[bre]=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=Bre(c))!==null&&a!==void 0?a:Dre,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 st?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,R)=>Math.max(I,R.definition.length),0);f+=`
`;for(let{definition:I,description:R}of S)f+=` ${this.format(r).bold(I.padEnd(x))} ${Ko(R,{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,R=p.get(I);typeof R>"u"&&p.set(I,R=[]);let{usage:N}=this.getUsageByIndex(x);R.push({commandClass:S,usage:N})}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((R,N)=>R.usage.localeCompare(N.usage,"en",{usage:"sort",caseFirst:"upper"})),I=S!==null?S.trim():"General commands";f+=`
`,f+=`${this.format(r).header(`${I}`)}
`;for(let{commandClass:R,usage:N}of x){let U=R.usage.description||"undocumented";f+=`
`,f+=` ${this.format(r).bold(N)}
`,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[bre])!==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)?ure:fre}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:wre()}});var $2,Tre=Ze(()=>{cd();$2=class extends st{async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.definitions(),null,2)}
`)}};$2.paths=[["--clipanion=definitions"]]});var eB,Rre=Ze(()=>{cd();eB=class extends st{async execute(){this.context.stdout.write(this.cli.usage())}};eB.paths=[["-h"],["--help"]]});function Wx(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 d_=Ze(()=>{vp()});var tB,Fre=Ze(()=>{cd();d_();tB=class extends st{constructor(){super(...arguments),this.args=Wx()}async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.process(this.args).tokens,null,2)}
`)}};tB.paths=[["--clipanion=tokens"]]});var rB,Nre=Ze(()=>{cd();rB=class extends st{async execute(){var t;this.context.stdout.write(`${(t=this.cli.binaryVersion)!==null&&t!==void 0?t:"<unknown>"}
`)}};rB.paths=[["-v"],["--version"]]});var g_={};Vt(g_,{DefinitionsCommand:()=>$2,HelpCommand:()=>eB,TokensCommand:()=>tB,VersionCommand:()=>rB});var Ore=Ze(()=>{Tre();Rre();Fre();Nre()});function Lre(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"?L0(C??h,S,a.validator):S}})}var Mre=Ze(()=>{vp()});function Ure(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 _re=Ze(()=>{vp()});function Hre(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 jre=Ze(()=>{vp()});function Gre(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 qre=Ze(()=>{Gx();vp()});function Qqe(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:R}of E.options)f.has(I)&&(S=I,x=R);return typeof x=="string"?L0(S??h,x,a.validator):x}})}function Tqe(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 L0((n=e.name)!==null&&n!==void 0?n:s,f.value,e.validator)}}})}function Yre(e,...t){return typeof e=="string"?Qqe(e,...t):Tqe(e)}var Wre=Ze(()=>{Gx();vp()});var he={};Vt(he,{Array:()=>Lre,Boolean:()=>Ure,Counter:()=>Hre,Proxy:()=>Wx,Rest:()=>Gre,String:()=>Yre,applyValidator:()=>L0,cleanValidationError:()=>Lx,formatError:()=>K2,isOptionSymbol:()=>V2,makeCommandOption:()=>va,rerouteArguments:()=>Wf});var Vre=Ze(()=>{vp();d_();Mre();_re();jre();qre();Wre()});var nB={};Vt(nB,{Builtins:()=>g_,Cli:()=>ba,Command:()=>st,Option:()=>he,UsageError:()=>ot,formatMarkdownish:()=>Ko,run:()=>xre,runExit:()=>Pre});var jt=Ze(()=>{Ox();i_();cd();Qre();Ore();Vre()});var Kre=G((qkt,Rqe)=>{Rqe.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 Xre=G((Ykt,bp)=>{var Jre=Ce("fs"),y_=Ce("path"),Fqe=Ce("os"),Nqe=Ce("crypto"),Oqe=Kre(),E_=Oqe.version,Lqe=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Mqe(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
`);let s;for(;(s=Lqe.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 Uqe(e){let t=Zre(e),r=Ws.configDotenv({path:t});if(!r.parsed)throw new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);let s=zre(e).split(","),a=s.length,n;for(let c=0;c<a;c++)try{let f=s[c].trim(),p=jqe(r,f);n=Ws.decrypt(p.ciphertext,p.key);break}catch(f){if(c+1>=a)throw f}return Ws.parse(n)}function _qe(e){console.log(`[dotenv@${E_}][INFO] ${e}`)}function Hqe(e){console.log(`[dotenv@${E_}][WARN] ${e}`)}function m_(e){console.log(`[dotenv@${E_}][DEBUG] ${e}`)}function zre(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 jqe(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 Zre(e){let t=y_.resolve(process.cwd(),".env");return e&&e.path&&e.path.length>0&&(t=e.path),t.endsWith(".vault")?t:`${t}.vault`}function Gqe(e){return e[0]==="~"?y_.join(Fqe.homedir(),e.slice(1)):e}function qqe(e){_qe("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 Yqe(e){let t=y_.resolve(process.cwd(),".env"),r="utf8",s=!!(e&&e.debug);e&&(e.path!=null&&(t=Gqe(e.path)),e.encoding!=null&&(r=e.encoding));try{let a=Ws.parse(Jre.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&&m_(`Failed to load ${t} ${a.message}`),{error:a}}}function Wqe(e){let t=Zre(e);return zre(e).length===0?Ws.configDotenv(e):Jre.existsSync(t)?Ws._configVault(e):(Hqe(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),Ws.configDotenv(e))}function Vqe(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=Nqe.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 Kqe(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&&m_(a===!0?`"${n}" is already defined and WAS overwritten`:`"${n}" is already defined and was NOT overwritten`)):e[n]=t[n]}var Ws={configDotenv:Yqe,_configVault:qqe,_parseVault:Uqe,config:Wqe,decrypt:Vqe,parse:Mqe,populate:Kqe};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 ene=G((Wkt,$re)=>{"use strict";$re.exports=(e,...t)=>new Promise(r=>{r(e(...t))})});var M0=G((Vkt,I_)=>{"use strict";var Jqe=ene(),tne=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=Jqe(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};I_.exports=tne;I_.exports.default=tne});function zf(e){return`YN${e.toString(10).padStart(4,"0")}`}function Vx(e){let t=Number(e.slice(2));if(typeof pr[t]>"u")throw new Error(`Unknown message name: "${e}"`);return t}var pr,Kx=Ze(()=>{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),le=function(ee){return t.queryPattern.test(ee)},ge=function(ee){return t.checkFn(ee)},pe=Te("whitespace"),De=/^[ \t\n\r]/,ye=Qe([" "," ",`
`,"\r"],!1,!1),d=0,ve=0,Ie=[{line:1,column:1}],me=0,ce=[],X=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 ke(){return e.substring(ve,d)}function it(){return Me(ve,d)}function _(ee,se){throw se=se!==void 0?se:Me(ve,d),D([Te(ee)],e.substring(ve,d),se)}function tt(ee,se){throw se=se!==void 0?se:Me(ve,d),w(ee,se)}function Fe(ee,se){return{type:"literal",text:ee,ignoreCase:se}}function Qe(ee,se,xe){return{type:"class",parts:ee,inverted:se,ignoreCase:xe}}function Se(){return{type:"any"}}function je(){return{type:"end"}}function Te(ee){return{type:"other",description:ee}}function ct(ee){var se=Ie[ee],xe;if(se)return se;for(xe=ee-1;!Ie[xe];)xe--;for(se=Ie[xe],se={line:se.line,column:se.column};xe<ee;)e.charCodeAt(xe)===10?(se.line++,se.column=1):se.column++,xe++;return Ie[ee]=se,se}function Me(ee,se){var xe=ct(ee),Ne=ct(se);return{start:{offset:ee,line:xe.line,column:xe.column},end:{offset:se,line:Ne.line,column:Ne.column}}}function P(ee){d<me||(d>me&&(me=d,ce=[]),ce.push(ee))}function w(ee,se){return new G0(ee,null,null,se)}function D(ee,se,xe){return new G0(G0.buildMessage(ee,se),ee,se,xe)}function y(){var ee,se,xe,Ne,ut,Ct,Yt,ir;if(ee=d,se=F(),se!==r){for(xe=[],Ne=d,ut=Z(),ut!==r?(e.charCodeAt(d)===124?(Ct=n,d++):(Ct=r,X===0&&P(c)),Ct===r&&(e.charCodeAt(d)===38?(Ct=f,d++):(Ct=r,X===0&&P(p)),Ct===r&&(e.charCodeAt(d)===94?(Ct=h,d++):(Ct=r,X===0&&P(E)))),Ct!==r?(Yt=Z(),Yt!==r?(ir=F(),ir!==r?(ut=[ut,Ct,Yt,ir],Ne=ut):(d=Ne,Ne=r)):(d=Ne,Ne=r)):(d=Ne,Ne=r)):(d=Ne,Ne=r);Ne!==r;)xe.push(Ne),Ne=d,ut=Z(),ut!==r?(e.charCodeAt(d)===124?(Ct=n,d++):(Ct=r,X===0&&P(c)),Ct===r&&(e.charCodeAt(d)===38?(Ct=f,d++):(Ct=r,X===0&&P(p)),Ct===r&&(e.charCodeAt(d)===94?(Ct=h,d++):(Ct=r,X===0&&P(E)))),Ct!==r?(Yt=Z(),Yt!==r?(ir=F(),ir!==r?(ut=[ut,Ct,Yt,ir],Ne=ut):(d=Ne,Ne=r)):(d=Ne,Ne=r)):(d=Ne,Ne=r)):(d=Ne,Ne=r);xe!==r?(ve=ee,se=C(se,xe),ee=se):(d=ee,ee=r)}else d=ee,ee=r;return ee}function F(){var ee,se,xe,Ne,ut,Ct;return ee=d,e.charCodeAt(d)===33?(se=S,d++):(se=r,X===0&&P(x)),se!==r?(xe=F(),xe!==r?(ve=ee,se=I(xe),ee=se):(d=ee,ee=r)):(d=ee,ee=r),ee===r&&(ee=d,e.charCodeAt(d)===40?(se=R,d++):(se=r,X===0&&P(N)),se!==r?(xe=Z(),xe!==r?(Ne=y(),Ne!==r?(ut=Z(),ut!==r?(e.charCodeAt(d)===41?(Ct=U,d++):(Ct=r,X===0&&P(K)),Ct!==r?(ve=ee,se=$(Ne),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,Ne,ut;if(ee=d,se=Z(),se!==r){if(xe=d,Ne=[],ie.test(e.charAt(d))?(ut=e.charAt(d),d++):(ut=r,X===0&&P(fe)),ut!==r)for(;ut!==r;)Ne.push(ut),ie.test(e.charAt(d))?(ut=e.charAt(d),d++):(ut=r,X===0&&P(fe));else Ne=r;Ne!==r?xe=e.substring(xe,d):xe=Ne,xe!==r?(ve=d,Ne=le(xe),Ne?Ne=void 0:Ne=r,Ne!==r?(ve=ee,se=ge(xe),ee=se):(d=ee,ee=r)):(d=ee,ee=r)}else d=ee,ee=r;return ee}function Z(){var ee,se;for(X++,ee=[],De.test(e.charAt(d))?(se=e.charAt(d),d++):(se=r,X===0&&P(ye));se!==r;)ee.push(se),De.test(e.charAt(d))?(se=e.charAt(d),d++):(se=r,X===0&&P(ye));return X--,ee===r&&(se=r,X===0&&P(pe)),ee}if(be=a(),be!==r&&d===e.length)return be;throw be!==r&&d<e.length&&P(je()),D(ce,me<e.length?e.charAt(me):null,me<e.length?Me(me,me+1):Me(me,me))}$ie.exports={SyntaxError:G0,parse:KVe}});var tse=G(ok=>{var{parse:JVe}=ese();ok.makeParser=(e=/[a-z]+/)=>(t,r)=>JVe(t,{queryPattern:e,checkFn:r});ok.parse=ok.makeParser()});var nse=G((GQt,rse)=>{"use strict";rse.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};Ise.exports={stringReplaceAll:l7e,stringEncaseCRLFWithFirstIndex:c7e}});var bse=G((ZQt,Sse)=>{"use strict";var u7e=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,wse=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,f7e=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,A7e=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,p7e=new Map([["n",`
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function vse(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)):p7e.get(e)||e}function h7e(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(f7e))r.push(a[2].replace(A7e,(f,p,h)=>p?vse(p):h));else throw new Error(`Invalid Chalk template style argument: ${n} (in style '${e}')`)}return r}function d7e(e){wse.lastIndex=0;let t=[],r;for(;(r=wse.exec(e))!==null;){let s=r[1];if(r[2]){let a=h7e(s,r[2]);t.push([s].concat(a))}else t.push([s])}return t}function Bse(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}Sse.exports=(e,t)=>{let r=[],s=[],a=[];if(t.replace(u7e,(n,c,f,p,h,E)=>{if(c)a.push(vse(c));else if(p){let C=a.join("");a=[],s.push(r.length===0?C:Bse(e,r)(C)),r.push({inverse:f,styles:d7e(p)})}else if(h){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");s.push(Bse(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((XQt,Tse)=>{"use strict";var hB=ck(),{stdout:K_,stderr:J_}=Ese(),{stringReplaceAll:g7e,stringEncaseCRLFWithFirstIndex:m7e}=Cse(),{isArray:uk}=Array,Pse=["ansi","ansi","ansi256","ansi16m"],OE=Object.create(null),y7e=(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=K_?K_.level:0;e.level=t.level===void 0?r:t.level},z_=class{constructor(t){return xse(t)}},xse=e=>{let t={};return y7e(t,e),t.template=(...r)=>Qse(t.template,...r),Object.setPrototypeOf(t,fk.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=z_,t.template};function fk(e){return xse(e)}for(let[e,t]of Object.entries(hB))OE[e]={get(){let r=Ak(this,Z_(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:r}),r}};OE.visible={get(){let e=Ak(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var kse=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of kse)OE[e]={get(){let{level:t}=this;return function(...r){let s=Z_(hB.color[Pse[t]][e](...r),hB.color.close,this._styler);return Ak(this,s,this._isEmpty)}}};for(let e of kse){let t="bg"+e[0].toUpperCase()+e.slice(1);OE[t]={get(){let{level:r}=this;return function(...s){let a=Z_(hB.bgColor[Pse[r]][e](...s),hB.bgColor.close,this._styler);return Ak(this,a,this._isEmpty)}}}}var E7e=Object.defineProperties(()=>{},{...OE,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),Z_=(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}},Ak=(e,t,r)=>{let s=(...a)=>uk(a[0])&&uk(a[0].raw)?Dse(s,Qse(s,...a)):Dse(s,a.length===1?""+a[0]:a.join(" "));return Object.setPrototypeOf(s,E7e),s._generator=e,s._styler=t,s._isEmpty=r,s},Dse=(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=g7e(t,r.close,r.open),r=r.parent;let n=t.indexOf(`
`);return n!==-1&&(t=m7e(t,a,s,n)),s+t+a},V_,Qse=(e,...t)=>{let[r]=t;if(!uk(r)||!uk(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 V_===void 0&&(V_=bse()),V_(e,a.join(""))};Object.defineProperties(fk.prototype,OE);var pk=fk();pk.supportsColor=K_;pk.stderr=fk({level:J_?J_.level:0});pk.stderr.supportsColor=J_;Tse.exports=pk});var hk=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 dk=G((eTt,Fse)=>{"use strict";var Rse=hk();Fse.exports=(e,t={})=>{let r=(s,a={})=>{let n=t.escapeInvalid&&Rse.isInvalidBrace(a),c=s.invalid===!0&&t.escapeInvalid===!0,f="";if(s.value)return(n||c)&&Rse.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 Ose=G((tTt,Nse)=>{"use strict";Nse.exports=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var Yse=G((rTt,qse)=>{"use strict";var Lse=Ose(),q0=(e,t,r)=>{if(Lse(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(Lse(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(q0.cache.hasOwnProperty(p))return q0.cache[p].result;let h=Math.min(e,t),E=Math.max(e,t);if(Math.abs(h-E)===1){let R=e+"|"+t;return s.capture?`(${R})`:s.wrap===!1?R:`(?:${R})`}let C=Gse(e)||Gse(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 R=E<0?Math.abs(E):1;I=Mse(R,Math.abs(h),S,s),h=S.a=0}return E>=0&&(x=Mse(h,E,S,s)),S.negatives=I,S.positives=x,S.result=I7e(I,x,s),s.capture===!0?S.result=`(${S.result})`:s.wrap!==!1&&x.length+I.length>1&&(S.result=`(?:${S.result})`),q0.cache[p]=S,S.result};function I7e(e,t,r){let s=X_(e,t,"-",!1,r)||[],a=X_(t,e,"",!1,r)||[],n=X_(e,t,"-?",!0,r)||[];return s.concat(n).concat(a).join("|")}function C7e(e,t){let r=1,s=1,a=_se(e,r),n=new Set([t]);for(;e<=a&&a<=t;)n.add(a),r+=1,a=_se(e,r);for(a=Hse(t+1,s)-1;e<a&&a<=t;)n.add(a),s+=1,a=Hse(t+1,s)-1;return n=[...n],n.sort(v7e),n}function w7e(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let s=B7e(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+=S7e(p,h,r):c++}return c&&(n+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:n,count:[c],digits:a}}function Mse(e,t,r,s){let a=C7e(e,t),n=[],c=e,f;for(let p=0;p<a.length;p++){let h=a[p],E=w7e(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+jse(f.count),c=h+1;continue}r.isPadded&&(C=b7e(h,r,s)),E.string=C+E.pattern+jse(E.count),n.push(E),c=h+1,f=E}return n}function X_(e,t,r,s,a){let n=[];for(let c of e){let{string:f}=c;!s&&!Use(t,"string",f)&&n.push(r+f),s&&Use(t,"string",f)&&n.push(r+f)}return n}function B7e(e,t){let r=[];for(let s=0;s<e.length;s++)r.push([e[s],t[s]]);return r}function v7e(e,t){return e>t?1:t>e?-1:0}function Use(e,t,r){return e.some(s=>s[t]===r)}function _se(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function Hse(e,t){return e-e%Math.pow(10,t)}function jse(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function S7e(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function Gse(e){return/^-?(0+)\d/.test(e)}function b7e(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}}`}}q0.cache={};q0.clearCache=()=>q0.cache={};qse.exports=q0});var t4=G((nTt,$se)=>{"use strict";var D7e=Ce("util"),Kse=Yse(),Wse=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),P7e=e=>t=>e===!0?Number(t):String(t),$_=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 Aoe=G((aTt,foe)=>{"use strict";var U7e=dk(),{MAX_LENGTH:loe,CHAR_BACKSLASH:r4,CHAR_BACKTICK:_7e,CHAR_COMMA:H7e,CHAR_DOT:j7e,CHAR_LEFT_PARENTHESES:G7e,CHAR_RIGHT_PARENTHESES:q7e,CHAR_LEFT_CURLY_BRACE:Y7e,CHAR_RIGHT_CURLY_BRACE:W7e,CHAR_LEFT_SQUARE_BRACKET:coe,CHAR_RIGHT_SQUARE_BRACKET:uoe,CHAR_DOUBLE_QUOTE:V7e,CHAR_SINGLE_QUOTE:K7e,CHAR_NO_BREAK_SPACE:J7e,CHAR_ZERO_WIDTH_NOBREAK_SPACE:z7e}=aoe(),Z7e=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},s=typeof r.maxLength=="number"?Math.min(loe,r.maxLength):loe;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++],R=N=>{if(N.type==="text"&&f.type==="dot"&&(f.type="text"),f&&f.type==="text"&&N.type==="text"){f.value+=N.value;return}return c.nodes.push(N),N.parent=c,N.prev=f,f=N,N};for(R({type:"bos"});E<h;)if(c=n[n.length-1],S=I(),!(S===z7e||S===J7e)){if(S===r4){R({type:"text",value:(t.keepEscaping?S:"")+I()});continue}if(S===uoe){R({type:"text",value:"\\"+S});continue}if(S===coe){p++;let N=!0,U;for(;E<h&&(U=I());){if(S+=U,U===coe){p++;continue}if(U===r4){S+=I();continue}if(U===uoe&&(p--,p===0))break}R({type:"text",value:S});continue}if(S===G7e){c=R({type:"paren",nodes:[]}),n.push(c),R({type:"text",value:S});continue}if(S===q7e){if(c.type!=="paren"){R({type:"text",value:S});continue}c=n.pop(),R({type:"text",value:S}),c=n[n.length-1];continue}if(S===V7e||S===K7e||S===_7e){let N=S,U;for(t.keepQuotes!==!0&&(S="");E<h&&(U=I());){if(U===r4){S+=U+I();continue}if(U===N){t.keepQuotes===!0&&(S+=U);break}S+=U}R({type:"text",value:S});continue}if(S===Y7e){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=R(U),n.push(c),R({type:"open",value:S});continue}if(S===W7e){if(c.type!=="brace"){R({type:"text",value:S});continue}let N="close";c=n.pop(),c.close=!0,R({type:N,value:S}),C--,c=n[n.length-1];continue}if(S===H7e&&C>0){if(c.ranges>0){c.ranges=0;let N=c.nodes.shift();c.nodes=[N,{type:"text",value:U7e(c)}]}R({type:"comma",value:S}),c.commas++;continue}if(S===j7e&&C>0&&c.commas===0){let N=c.nodes;if(C===0||N.length===0){R({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"){N.pop();let U=N[N.length-1];U.value+=f.value+S,f=U,c.ranges--;continue}R({type:"dot",value:S});continue}R({type:"text",value:S})}do if(c=n.pop(),c.type!=="root"){c.nodes.forEach(K=>{K.nodes||(K.type==="open"&&(K.isOpen=!0),K.type==="close"&&(K.isClose=!0),K.nodes||(K.type="text"),K.invalid=!0)});let N=n[n.length-1],U=N.nodes.indexOf(c);N.nodes.splice(U,1,...c.nodes)}while(n.length>0);return R({type:"eos"}),a};foe.exports=Z7e});var doe=G((lTt,hoe)=>{"use strict";var poe=dk(),X7e=roe(),$7e=soe(),eKe=Aoe(),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={})=>eKe(e,t);Jl.stringify=(e,t={})=>poe(typeof e=="string"?Jl.parse(e,t):e,t);Jl.compile=(e,t={})=>(typeof e=="string"&&(e=Jl.parse(e,t)),X7e(e,t));Jl.expand=(e,t={})=>{typeof e=="string"&&(e=Jl.parse(e,t));let r=$7e(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);hoe.exports=Jl});var gB=G((cTt,Ioe)=>{"use strict";var tKe=Ce("path"),Zf="\\\\/",goe=`[^${Zf}]`,kp="\\.",rKe="\\+",nKe="\\?",mk="\\/",iKe="(?=.)",moe="[^/]",n4=`(?:${mk}|$)`,yoe=`(?:^|${mk})`,i4=`${kp}{1,2}${n4}`,sKe=`(?!${kp})`,oKe=`(?!${yoe}${i4})`,aKe=`(?!${kp}{0,1}${n4})`,lKe=`(?!${i4})`,cKe=`[^.${mk}]`,uKe=`${moe}*?`,Eoe={DOT_LITERAL:kp,PLUS_LITERAL:rKe,QMARK_LITERAL:nKe,SLASH_LITERAL:mk,ONE_CHAR:iKe,QMARK:moe,END_ANCHOR:n4,DOTS_SLASH:i4,NO_DOT:sKe,NO_DOTS:oKe,NO_DOT_SLASH:aKe,NO_DOTS_SLASH:lKe,QMARK_NO_DOT:cKe,STAR:uKe,START_ANCHOR:yoe},fKe={...Eoe,SLASH_LITERAL:`[${Zf}]`,QMARK:goe,STAR:`${goe}*?`,DOTS_SLASH:`${kp}{1,2}(?:[${Zf}]|$)`,NO_DOT:`(?!${kp})`,NO_DOTS:`(?!(?:^|[${Zf}])${kp}{1,2}(?:[${Zf}]|$))`,NO_DOT_SLASH:`(?!${kp}{0,1}(?:[${Zf}]|$))`,NO_DOTS_SLASH:`(?!${kp}{1,2}(?:[${Zf}]|$))`,QMARK_NO_DOT:`[^.${Zf}]`,START_ANCHOR:`(?:^|[${Zf}])`,END_ANCHOR:`(?:[${Zf}]|$)`},AKe={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,P8=Ze(()=>{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,x8=Ze(()=>{$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,k8=Ze(()=>{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:Y});return{...r,packageFs:p}}}});var MQ,Jce=Ze(()=>{MQ=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,Q8=Ze(()=>{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:wt.dot,localPath:s}}getWorkspace(t,r){return r.project.getWorkspaceByCwd(t.reference.slice(Ii.protocol.length))}}});function jB(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function zce(e){return typeof e>"u"?3:jB(e)?0:Array.isArray(e)?1:2}function F8(e,t){return Object.hasOwn(e,t)}function CXe(e){return jB(e)&&F8(e,"onConflict")&&typeof e.onConflict=="string"}function wXe(e){if(typeof e>"u")return{onConflict:"default",value:e};if(!CXe(e))return{onConflict:"default",value:e};if(F8(e,"value"))return e;let{onConflict:t,...r}=e;return{onConflict:t,value:r}}function Zce(e,t){let r=jB(e)&&F8(e,t)?e[t]:void 0;return wXe(r)}function dI(e,t){return[e,t,Xce]}function N8(e){return Array.isArray(e)?e[2]===Xce:!1}function T8(e,t){if(jB(e)){let r={};for(let s of Object.keys(e))r[s]=T8(e[s],t);return dI(t,r)}return Array.isArray(e)?dI(t,e.map(r=>T8(r,t))):dI(t,e)}function R8(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(R)}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=U$e.connect(t,{createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(E),...r});S[Ra]=0,S[II]=!1;let x=()=>S[Ra]<S.remoteSettings.maxConcurrentStreams,I=!0;S.socket.once("session",N=>{this.tlsSessionCache.set(E,N)}),S.once("error",N=>{for(let{reject:U}of s)U(N);this.tlsSessionCache.delete(E)}),S.setTimeout(this.timeout,()=>{S.destroy()}),S.once("close",()=>{if(C){I&&this._freeSessionsCount--,this._sessionsCount--;let N=this.sessions[c];N.splice(N.indexOf(S),1),N.length===0&&delete this.sessions[c]}else{let N=new Error("Session closed without receiving a SETTINGS frame");N.code="HTTP2WRAPPER_NOSETTINGS";for(let{reject:U}of s)U(N);p()}this._tryToCreateNewSession(c,f)});let R=()=>{if(!(!(c in this.queue)||!x())){for(let N of S[Oc])if(N in this.queue[c]){let{listeners:U}=this.queue[c][N];for(;U.length!==0&&x();)U.shift().resolve(S);let K=this.queue[c];if(K[N].listeners.length===0&&(delete K[N],Object.keys(K).length===0)){delete this.queue[c];break}if(!x())break}}};S.on("origin",()=>{S[Oc]=S.originSet,x()&&(R(),dH(this.sessions[c],S))}),S.once("remoteSettings",()=>{if(S.ref(),S.unref(),this._sessionsCount++,h.destroyed){let N=new Error("Agent has been destroyed");for(let U of s)U.reject(N);S.destroy();return}S[Oc]=S.originSet;{let N=this.sessions;if(c in N){let U=N[c];U.splice(j$e(U,S,G$e),0,S)}else N[c]=[S]}this._freeSessionsCount+=1,C=!0,this.emit("session",S),R(),p(),S[Ra]===0&&this._freeSessionsCount>this.maxFreeSessions&&S.close(),s.length!==0&&(this.getSession(f,r,s),s.length=0),S.on("remoteSettings",()=>{R(),dH(this.sessions[c],S)})}),S[sfe]=S.request,S.request=(N,U)=>{if(S[II])throw new Error("The session is gracefully closing. No new streams are allowed.");let K=S[sfe](N,U);return S.ref(),++S[Ra],S[Ra]===S.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,K.once("close",()=>{if(I=x(),--S[Ra],!S.destroyed&&!S.closed&&(q$e(this.sessions[c],S),x()&&!S.closed)){I||(this._freeSessionsCount++,I=!0);let $=S[Ra]===0;$&&S.unref(),$&&(this._freeSessionsCount>this.maxFreeSessions||S[II])?S.close():(dH(this.sessions[c],S),R())}}),K}}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),M$e.connect(s,a,r)}closeFreeSessions(){for(let t of Object.values(this.sessions))for(let r of t)r[Ra]===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 ofe({agent:this,isFree:!0})}get busySessions(){return ofe({agent:this,isFree:!1})}};sm.kCurrentStreamsCount=Ra;sm.kGracefullyClosing=II;lfe.exports={Agent:sm,globalAgent:new sm}});var yH=G((GOt,cfe)=>{"use strict";var{Readable:Y$e}=Ce("stream"),mH=class extends Y$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()}};cfe.exports=mH});var EH=G((qOt,ufe)=>{"use strict";ufe.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 Afe=G((YOt,ffe)=>{"use strict";ffe.exports=(e,t,r)=>{for(let s of r)e.on(s,(...a)=>t.emit(s,...a))}});var hfe=G((WOt,pfe)=>{"use strict";pfe.exports=e=>{switch(e){case":method":case":scheme":case":authority":case":path":return!0;default:return!1}}});var gfe=G((KOt,dfe)=>{"use strict";var CI=(e,t,r)=>{dfe.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 sT=class extends ps{constructor(t){super(`Redirected ${t.options.maxRedirects} times. Aborting.`,{},t),this.name="MaxRedirectsError"}};_n.MaxRedirectsError=sT;var oT=class extends ps{constructor(t){super(`Response code ${t.statusCode} (${t.statusMessage})`,{},t.request),this.name="HTTPError"}};_n.HTTPError=oT;var aT=class extends ps{constructor(t,r){super(t.message,t,r),this.name="CacheError"}};_n.CacheError=aT;var lT=class extends ps{constructor(t,r){super(t.message,t,r),this.name="UploadError"}};_n.UploadError=lT;var cT=class extends ps{constructor(t,r,s){super(t.message,t,s),this.name="TimeoutError",this.event=t.event,this.timings=r}};_n.TimeoutError=cT;var XB=class extends ps{constructor(t,r){super(t.message,t,r),this.name="ReadError"}};_n.ReadError=XB;var uT=class extends ps{constructor(t){super(`Unsupported protocol "${t.url.protocol}"`,{},t),this.name="UnsupportedProtocolError"}};_n.UnsupportedProtocolError=uT;var ett=["socket","connect","continue","information","upgrade","timeout"],fT=class extends Xfe.Duplex{constructor(t,r={},s){super({autoDestroy:!1,highWaterMark:0}),this[BI]=0,this[SI]=0,this.requestInitialized=!1,this[rT]=new Set,this.redirects=[],this[bI]=!1,this[nT]=!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 GH.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 Ret.ReadStream&&await Zet(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 vd.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([iAe.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 Utt(t)}function oj(){return typeof yT.default.availableParallelism<"u"?yT.default.availableParallelism():Math.max(1,yT.default.cpus().length)}var yT,Ttt,OAe,Rtt,Ftt,LAe,MAe,Ltt,Mtt,ET=Ze(()=>{bt();yT=et(Ce("os"));IT();Qc();Ttt=Number(process.versions.node.split(".")[0]),OAe=new Map([["darwin","open"],["linux","xdg-open"],["win32","explorer.exe"]]).get(process.platform),Rtt=typeof OAe<"u"?async e=>{try{return await aj(OAe,[e],{cwd:Y.cwd()}),!0}catch{return!1}}:void 0,Ftt="/usr/bin/ldd";Ltt=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Mtt=/\((\S*)(?::(\d+))(?::(\d+))\)/});function pj(e,t,r,s,a){let n=GB(r);if(s.isArray||s.type==="ANY"&&Array.isArray(n))return Array.isArray(n)?n.map((c,f)=>lj(e,`${t}[${f}]`,c,s,a)):String(n).split(/,/).map(c=>lj(e,t,c,s,a));if(Array.isArray(n))throw new Error(`Non-array configuration settings "${t}" cannot be an array`);return lj(e,t,r,s,a)}function lj(e,t,r,s,a){let n=GB(r);switch(s.type){case"ANY":return UQ(n);case"SHAPE":return qtt(e,t,r,s,a);case"MAP":return Ytt(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 DB(n);if(typeof n!="string")throw new Error(`Expected configuration setting "${t}" to be a string, got ${typeof n}`);let p=Zk(n,{env:e.env});switch(s.type){case"ABSOLUTE_PATH":{let h=a,E=O8(r);return E&&E[0]!=="<"&&(h=Y.dirname(E)),Y.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 DB(p);case"DURATION":return Xk(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 qtt(e,t,r,s,a){let n=GB(r);if(typeof n!="object"||Array.isArray(n))throw new ot(`Object configuration settings "${t}" must be an object`);let c=hj(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 ot(`Unrecognized configuration settings found: ${t}.${f} - run "yarn config" to see the list of settings supported in Yarn`);c.set(f,pj(e,h,p,s.properties[f],a))}return c}function Ytt(e,t,r,s,a){let n=GB(r),c=new Map;if(typeof n!="object"||Array.isArray(n))throw new ot(`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,pj(e,E,p,C,a))}return c}function hj(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,hj(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=>Y.normalize(s)):Y.isAbsolute(t.default)?Y.normalize(t.default):t.isNullable?null:void 0:Array.isArray(t.default)?t.default.map(s=>Y.resolve(e.projectCwd,s)):Y.resolve(e.projectCwd,t.default);case"DURATION":return Xk(t.default,t.unit);default:return t.default}}function wT(e,t,r){if(t.type==="SECRET"&&typeof e=="string"&&r.hideSecrets)return Gtt;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(wT(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=wT(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=wT(n,c,r);typeof f<"u"&&s.set(a,f)}return s}return e}function Wtt(){let e={};for(let[t,r]of Object.entries(process.env))t=t.toLowerCase(),t.startsWith(BT)&&(t=(0,_Ae.default)(t.slice(BT.length)),e[t]=r);return e}function uj(){let e=`${BT}rc_filename`;for(let[t,r]of Object.entries(process.env))if(t.toLowerCase()===e&&typeof r=="string")return r;return fj}async function UAe(e){try{return await ae.readFilePromise(e)}catch{return Buffer.of()}}async function Vtt(e,t){return Buffer.compare(...await Promise.all([UAe(e),UAe(t)]))===0}async function Ktt(e,t){let[r,s]=await Promise.all([ae.statPromise(e),ae.statPromise(t)]);return r.dev===s.dev&&r.ino===s.ino}async function ztt({configuration:e,selfPath:t}){let r=e.get("yarnPath");return e.get("ignorePath")||r===null||r===t||await Jtt(r,t)?null:r}var _Ae,Hp,HAe,jAe,GAe,cj,Htt,nv,jtt,jp,BT,fj,Gtt,DI,qAe,Aj,vT,CT,Jtt,Je,iv=Ze(()=>{bt();Sc();_Ae=et(sre()),Hp=et(N0());jt();HAe=et(Xre()),jAe=Ce("module"),GAe=et(M0()),cj=Ce("stream");Lce();fI();P8();x8();k8();Jce();Q8();rm();eue();HQ();Tc();wd();mT();Qc();ET();Lp();$o();Htt=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 MQ,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=rv(),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=Xl(n,c=>c==="current"?t.libc??Xl.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=bB(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(Bd(s,!0),zk(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=FB(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:O4(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,GAe.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:()=>yj,ExecError:()=>ST,PipeError:()=>sv,execvp:()=>aj,pipevp:()=>qu});function am(e){return e!==null&&typeof e.fd=="number"}function dj(){}function gj(){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,mj.default)(e,t,{cwd:Ae.fromPortablePath(r),env:{...s,PWD:Ae.fromPortablePath(r)},stdio:h});lm.add(E),lm.size===1&&(process.on("SIGINT",dj),process.on("SIGTERM",gj)),!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",dj),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,ape=Ze(()=>{ec=class extends Error{constructor(t){super(t),this.name="ShellError"}}});var TT={};Vt(TT,{fastGlobOptions:()=>upe,isBraceExpansion:()=>Tj,isGlobPattern:()=>nrt,match:()=>irt,micromatchOptions:()=>QT});function nrt(e){if(!kT.default.scan(e,QT).isGlob)return!1;try{kT.default.parse(e,QT)}catch{return!1}return!0}function irt(e,{cwd:t,baseFs:r}){return(0,lpe.default)(e,{...upe,cwd:Ae.fromPortablePath(t),fs:px(cpe.default,new rd(r))})}function Tj(e){return kT.default.scan(e,QT).isBrace}var lpe,cpe,kT,QT,upe,fpe=Ze(()=>{bt();lpe=et(DQ()),cpe=et(Ce("fs")),kT=et(Zo()),QT={strictBrackets:!0},upe={onlyDirectories:!1,onlyFiles:!1}});function Rj(){}function Fj(){for(let e of um)e.kill()}function dpe(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,ppe.default)(e,t,{...s,stdio:[n,c,f]});return um.add(p),um.size===1&&(process.on("SIGINT",Rj),process.on("SIGTERM",Fj)),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",Rj),process.off("SIGTERM",Fj)),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",Rj),process.off("SIGTERM",Fj)),h(E!==null?E:129)})})}}}function gpe(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 RT(e,t){return Oj.start(e,t)}function Ape(e,t=null){let r=new sA.PassThrough,s=new hpe.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 mpe(e,{prefix:t}){return{stdout:Ape(r=>e.stdout.write(`${r}
`),e.stdout.isTTY?t:null),stderr:Ape(r=>e.stderr.write(`${r}
`),e.stderr.isTTY?t:null)}}var ppe,sA,hpe,um,Uc,Nj,Oj,Lj=Ze(()=>{ppe=et(RU()),sA=Ce("stream"),hpe=Ce("string_decoder"),um=new Set;Uc=class{constructor(t){this.stream=t}close(){}get(){return this.stream}},Nj=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}},Oj=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 Nj;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 hv={};Vt(hv,{EntryCommand:()=>cv,ShellError:()=>ec,execute:()=>xI,globUtils:()=>TT});function ype(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 NT(e,t={}){let r={...e,...t};return r.environment={...e.environment,...t.environment},r.variables={...e.variables,...t.variables},r}async function ort(e,t,r){let s=[],a=new tc.PassThrough;return a.on("data",n=>s.push(n)),await OT(e,t,NT(r,{stdout:a})),Buffer.concat(s).toString().replace(/[\r\n]+$/,"")}async function Epe(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 FT(e){return e.match(/[^ \r\n\t]+/g)||[]}async function Spe(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=FT(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 FT(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=FT(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 fv(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 Spe({...e,quoted:!0},t,r,n=>s.push(n));let a=Number(s.join(" "));return Number.isNaN(a)?fv({type:"variable",name:s.join(" ")},t,r):fv({type:"number",value:a},t,r)}else return art[e.type](await fv(e.left,t,r),await fv(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 ort(S.shell,t,r);if(S.quoted)c(x);else{let I=FT(x);for(let R=0;R<I.length-1;++R)p(I[R]);c(I[I.length-1])}}break;case"variable":await Spe(S,t,r,c,p);break;case"arithmetic":c(String(await fv(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 Cpe(e,t,r)}async function frt(e,t,r,{background:s=!1}={}){let a,n=f=>{a=f,r.variables["?"]=String(f)},c=async f=>{try{return await urt(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 OT(e,t,r){let s=r.backgroundJobs;r.backgroundJobs=[];let a=0;for(let{command:n,type:c}of e){if(a=await frt(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 bpe(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=>pv(t))||"alternativeValue"in e&&!!e.alternativeValue&&e.alternativeValue.some(t=>pv(t));case"arithmetic":return Mj(e.arithmetic);case"shell":return Uj(e.shell);default:return!1}}function pv(e){switch(e.type){case"redirection":return e.args.some(t=>pv(t));case"argument":return e.segments.some(t=>bpe(t));default:throw new Error(`Assertion failed: Unsupported argument type: "${e.type}"`)}}function Mj(e){switch(e.type){case"variable":return bpe(e);case"number":return!1;default:return Mj(e.left)||Mj(e.right)}}function Uj(e){return e.some(({command:t})=>{for(;t;){let r=t.chain;for(;r;){let s;switch(r.type){case"subshell":s=Uj(r.subshell);break;case"command":s=r.envs.some(a=>a.args.some(n=>pv(n)))||r.args.some(a=>pv(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=TT}={}){let C={};for(let[I,R]of Object.entries(n))typeof R<"u"&&(C[I]=R);let S=new Map(srt);for(let[I,R]of Object.entries(s))S.set(I,R);c===null&&(c=new tc.PassThrough,c.end());let x=gx(e,E);if(!Uj(x)&&x.length>0&&t.length>0){let{command:I}=x[x.length-1];for(;I.then;)I=I.then.line;let R=I.chain;for(;R.then;)R=R.then.chain;R.type==="command"&&(R.args=R.args.concat(t.map(N=>({type:"argument",segments:[{type:"text",text:N}]}))))}return await OT(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 wpe,Bpe,tc,vpe,srt,art,uv=Ze(()=>{bt();Sc();wpe=et(LE()),Bpe=Ce("os"),tc=Ce("stream"),vpe=Ce("timers/promises");ope();ape();fpe();Lj();Lj();srt=new Map([["cd",async([e=(0,Bpe.homedir)(),...t],r,s)=>{let a=Y.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,vpe.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 RT(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=K=>{switch(x){case null:case 0:c.push(K);break;default:throw new Error(`Unsupported file descriptor: "${x}"`)}},R=K=>{switch(x){case null:case 1:f.push(K);break;case 2:p.push(K);break;default:throw new Error(`Unsupported file descriptor: "${x}"`)}},N=Number(e[h++]),U=h+N;for(let K=h;K<U;++h,++K)switch(S){case"<":I(()=>t.baseFs.createReadStream(Y.resolve(r.cwd,Ae.toPortablePath(e[K]))));break;case"<<<":I(()=>{let $=new tc.PassThrough;return process.nextTick(()=>{$.write(`${e[K]}
`),$.end()}),$});break;case"<&":I(()=>ype(Number(e[K]),1,r));break;case">":case">>":{let $=Y.resolve(r.cwd,Ae.toPortablePath(e[K]));R($==="/dev/null"?new tc.Writable({autoDestroy:!0,emitClose:!0,write(ie,fe,le){setImmediate(le)}}):t.baseFs.createWriteStream($,S===">>"?{flags:"a"}:void 0))}break;case">&":R(ype(Number(e[K]),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 RT(Av(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}]]);art={addition:(e,t)=>e+t,subtraction:(e,t)=>e-t,multiplication:(e,t)=>e*t,division:(e,t)=>Math.trunc(e/t)}});var Dpe=G((wUt,LT)=>{function Art(){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,R=15,N=16,U=17,K=0,$=1,ie=2,fe=3,le=4;function ge(d,ve){return 55296<=d.charCodeAt(ve)&&d.charCodeAt(ve)<=56319&&56320<=d.charCodeAt(ve+1)&&d.charCodeAt(ve+1)<=57343}function pe(d,ve){ve===void 0&&(ve=0);var Ie=d.charCodeAt(ve);if(55296<=Ie&&Ie<=56319&&ve<d.length-1){var me=Ie,ce=d.charCodeAt(ve+1);return 56320<=ce&&ce<=57343?(me-55296)*1024+(ce-56320)+65536:me}if(56320<=Ie&&Ie<=57343&&ve>=1){var me=d.charCodeAt(ve-1),ce=Ie;return 55296<=me&&me<=56319?(me-55296)*1024+(ce-56320)+65536:ce}return Ie}function De(d,ve,Ie){var me=[d].concat(ve).concat([Ie]),ce=me[me.length-2],X=Ie,be=me.lastIndexOf(I);if(be>1&&me.slice(1,be).every(function(_){return _==s})&&[s,x,U].indexOf(d)==-1)return ie;var ke=me.lastIndexOf(a);if(ke>0&&me.slice(1,ke).every(function(_){return _==a})&&[S,a].indexOf(ce)==-1)return me.filter(function(_){return _==a}).length%2==1?fe:le;if(ce==e&&X==t)return K;if(ce==r||ce==e||ce==t)return X==I&&ve.every(function(_){return _==s})?ie:$;if(X==r||X==e||X==t)return $;if(ce==c&&(X==c||X==f||X==h||X==E))return K;if((ce==h||ce==f)&&(X==f||X==p))return K;if((ce==E||ce==p)&&X==p)return K;if(X==s||X==R)return K;if(X==n)return K;if(ce==S)return K;var it=me.indexOf(s)!=-1?me.lastIndexOf(s)-1:me.length-2;return[x,U].indexOf(me[it])!=-1&&me.slice(it+1,-1).every(function(_){return _==s})&&X==I||ce==R&&[N,U].indexOf(X)!=-1?K:ve.indexOf(a)!=-1?ie:ce==a&&X==a?K:$}this.nextBreak=function(d,ve){if(ve===void 0&&(ve=0),ve<0)return 0;if(ve>=d.length-1)return d.length;for(var Ie=ye(pe(d,ve)),me=[],ce=ve+1;ce<d.length;ce++)if(!ge(d,ce-1)){var X=ye(pe(d,ce));if(De(Ie,me,X))return ce;me.push(X)}return d.length},this.splitGraphemes=function(d){for(var ve=[],Ie=0,me;(me=this.nextBreak(d,Ie))<d.length;)ve.push(d.slice(Ie,me)),Ie=me;return Ie<d.length&&ve.push(d.slice(Ie)),ve},this.iterateGraphemes=function(d){var ve=0,Ie={next:function(){var me,ce;return(ce=this.nextBreak(d,ve))<d.length?(me=d.slice(ve,ce),ve=ce,{value:me,done:!1}):ve<d.length?(me=d.slice(ve),ve=d.length,{value:me,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(Ie[Symbol.iterator]=function(){return Ie}),Ie},this.countGraphemes=function(d){for(var ve=0,Ie=0,me;(me=this.nextBreak(d,Ie))<d.length;)Ie=me,ve++;return Ie<d.length&&ve++,ve};function ye(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::
`}:UT.default.TRAVIS?{start:e=>`travis_fold:start:${e}
`,end:e=>`travis_fold:end:${e}
`}:UT.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,Fpe=Pd!==null,Tpe=new Date,grt=["iTerm.app","Apple_Terminal","WarpTerminal","vscode"].includes(process.env.TERM_PROGRAM)||!!process.env.WT_SESSION,mrt=e=>e,_T=mrt({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}}),yrt=grt&&Object.keys(_T).find(e=>{let t=_T[e];return!(t.date&&(t.date[0]!==Tpe.getDate()||t.date[1]!==Tpe.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(kB(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")||yrt;if(!Object.hasOwn(_T,S))throw new Error("Assertion failed: Invalid progress bar style");this.progressStyle=_T[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,Z0(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,Pd!==null&&!this.json&&this.includeInfos&&this.stdout.write(Pd.start(r))},reportFooter:f=>{if(this.indent-=1,Pd!==null&&!this.json&&this.includeInfos){this.stdout.write(Pd.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(!Pd)return;let a=`${Pd.start(r)}${s}${Pd.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>Qpe&&(this.progressFrame=(this.progressFrame+1)%kpe.length,this.progressTime=r);let s=kpe[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})},Qpe)}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,Rpe.default)(r,0,this.stdout.columns-1)),r}formatName(r){return this.includeNames?Npe(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?_j(r,{configuration:this.configuration,json:this.json}):""}formatIndent(){return this.level>0||!this.forceSectionAlignment?"\u2502 ".repeat(this.indent):`${drt} `}}});var wn={};Vt(wn,{PackageManager:()=>Lpe,detectPackageManager:()=>Mpe,executePackageAccessibleBinary:()=>Gpe,executePackageScript:()=>HT,executePackageShellcode:()=>Hj,executeWorkspaceAccessibleBinary:()=>Srt,executeWorkspaceLifecycleScript:()=>Hpe,executeWorkspaceScript:()=>_pe,getPackageAccessibleBinaries:()=>jT,getWorkspaceAccessibleBinaries:()=>jpe,hasPackageScript:()=>wrt,hasWorkspaceScript:()=>jj,isNodeScript:()=>Gj,makeScriptEnv:()=>mv,maybeExecuteWorkspaceLifecycleScript:()=>vrt,prepareExternalProject:()=>Crt});async function xd(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 ae.writeFilePromise(Y.format({dir:e,name:t,ext:".cmd"}),a)}await ae.writeFilePromise(Y.join(e,t),`#!/bin/sh
exec "${r}" ${s.map(a=>`'${a.replace(/'/g,`'"'"'`)}'`).join(" ")} "$@"
`,{mode:493})}async function Mpe(e){let t=await _t.tryFind(e);if(t?.packageManager){let s=RQ(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 ae.readFilePromise(Y.join(e,yr.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'}:ae.existsSync(Y.join(e,"package-lock.json"))?{packageManager:"npm",reason:`found npm's "package-lock.json" lockfile`}:ae.existsSync(Y.join(e,"pnpm-lock.yaml"))?{packageManager:"pnpm",reason:`found pnpm's "pnpm-lock.yaml" lockfile`}:null}async function mv({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([xd(r,"node",process.execPath),...An!==null?[xd(r,"run",process.execPath,[p,"run"]),xd(r,"yarn",process.execPath,[p]),xd(r,"yarnpkg",process.execPath,[p]),xd(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(),R={project:e,report:new Ft({stdout:new kd.PassThrough,configuration:e.configuration})},N=I.find(U=>U.supportsPackage(x,R));if(!N)throw new Error(`The package ${Vr(e.configuration,x)} isn't supported by any of the available linkers`);S=await N.findPackageLocation(x,R)}c.npm_package_json=Ae.fromPortablePath(Y.join(S,yr.manifest))}let h=An!==null?`yarn/${An}`:`yarn/${Tp("@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 xd(r,E,C,S)),c}async function Crt(e,t,{configuration:r,report:s,workspace:a=null,locator:n=null}){await Irt(async()=>{await ae.mktempPromise(async c=>{let f=Y.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 Mpe(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 R=I==="Yarn"&&!x?.packageManagerField;await ae.mktempPromise(async N=>{let U=await mv({binFolder:N,ignoreCorepack:R,baseEnv:{...process.env,COREPACK_ENABLE_AUTO_PIN:"0"}}),$=new Map([["Yarn Classic",async()=>{let fe=a!==null?["workspace",a]:[],le=Y.join(e,yr.manifest),ge=await ae.readFilePromise(le),pe=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(pe.code!==0)return pe.code;await ae.writeFilePromise(le,ge),await ae.appendFilePromise(Y.join(e,".npmignore"),`/.yarn
`),h.write(`
`),delete U.NODE_ENV;let De=await qu("yarn",["install"],{cwd:e,env:U,stdin:p,stdout:h,stderr:E,end:1});if(De.code!==0)return De.code;h.write(`
`);let ye=await qu("yarn",[...fe,"pack","--filename",Ae.fromPortablePath(t)],{cwd:e,env:U,stdin:p,stdout:h,stderr:E});return ye.code!==0?ye.code:0}],["Yarn",async()=>{let fe=a!==null?["workspace",a]:[];U.YARN_ENABLE_INLINE_BUILDS="1";let le=Y.join(e,yr.lockfile);await ae.existsPromise(le)||await ae.writeFilePromise(le,"");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 ve=new kd.PassThrough,Ie=zE(ve);ve.pipe(h,{end:!1});let me=await qu("npm",["--version"],{cwd:e,env:U,stdin:p,stdout:ve,stderr:E,end:0});if(ve.end(),me.code!==0)return h.end(),E.end(),me.code;let ce=(await Ie).toString().trim();if(!rA(ce,">=7.x")){let X=Qa(null,"npm"),be=Un(X,ce),ke=Un(X,">=7.x");throw new Error(`Workspaces aren't supported by ${ai(r,be)}; please upgrade to ${ai(r,ke)} (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 le=await qu("npm",["install","--legacy-peer-deps"],{cwd:e,env:U,stdin:p,stdout:h,stderr:E,end:1});if(le.code!==0)return le.code;let ge=new kd.PassThrough,pe=zE(ge);ge.pipe(h);let De=await qu("npm",["pack","--silent",...fe],{cwd:e,env:U,stdin:p,stdout:ge,stderr:E});if(De.code!==0)return De.code;let ye=(await pe).toString().trim().replace(/^.*\n/s,""),d=Y.resolve(e,Ae.toPortablePath(ye));return await ae.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 ae.detachTemp(c),new Lt(58,`Packing the package failed (exit code ${ie}, logs can be found here: ${Gt(r,f,dt.PATH)})`)})})})}async function wrt(e,t,{project:r}){let s=r.tryWorkspaceByLocator(e);if(s!==null)return jj(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 kd.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(wt.dot,{baseFs:C})).scripts.has(t)})}async function HT(e,t,r,{cwd:s,project:a,stdin:n,stdout:c,stderr:f}){return await ae.mktempPromise(async p=>{let{manifest:h,env:E,cwd:C}=await Upe(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(R=>R.wrapScriptExecution,x,a,e,t,{script:S,args:r,cwd:C,env:E,stdin:n,stdout:c,stderr:f}))()})}async function Hj(e,t,r,{cwd:s,project:a,stdin:n,stdout:c,stderr:f}){return await ae.mktempPromise(async p=>{let{env:h,cwd:E}=await Upe(e,{project:a,binFolder:p,cwd:s});return await xI(t,r,{cwd:E,env:h,stdin:n,stdout:c,stderr:f})})}async function Brt(e,{binFolder:t,cwd:r,lifecycleScript:s}){let a=await mv({project:e.project,locator:e.anchoredLocator,binFolder:t,lifecycleScript:s});return await qj(t,await jpe(e)),typeof r>"u"&&(r=Y.dirname(await ae.realpathPromise(Y.join(e.cwd,"package.json")))),{manifest:e.manifest,binFolder:t,env:a,cwd:r}}async function Upe(e,{project:t,binFolder:r,cwd:s,lifecycleScript:a}){let n=t.tryWorkspaceByLocator(e);if(n!==null)return Brt(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 kd.PassThrough,configuration:p})},C=h.find(N=>N.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 mv({project:t,locator:e,binFolder:r,lifecycleScript:a});await qj(r,await jT(e,{project:t}));let x=await C.findPackageLocation(c,E),I=new Pn(x,{baseFs:f}),R=await _t.find(wt.dot,{baseFs:I});return typeof s>"u"&&(s=x),{manifest:R,binFolder:r,env:S,cwd:s}})}async function _pe(e,t,r,{cwd:s,stdin:a,stdout:n,stderr:c}){return await HT(e.anchoredLocator,t,r,{cwd:s,project:e.project,stdin:a,stdout:n,stderr:c})}function jj(e,t){return e.manifest.scripts.has(t)}async function Hpe(e,t,{cwd:r,report:s}){let{configuration:a}=e.project,n=null;await ae.mktempPromise(async c=>{let f=Y.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 _pe(e,t,[],{cwd:r,stdin:n,stdout:h,stderr:E});if(h.end(),E.end(),C!==0)throw ae.detachTemp(c),new Lt(36,`${vB(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 vrt(e,t,r){jj(e,t)&&await Hpe(e,t,r)}function Gj(e){let t=Y.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=ae.openSync(e,"r")}catch{return!0}try{ae.readSync(s,r,0,r.length,0)}finally{ae.closeSync(s)}let a=r.readUint32BE();return!(a===3405691582||a===3489328638||a===2135247942||(a&4294901760)===1297743872)}async function jT(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 kd.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 Xl.skip;let S=c.find(I=>I.supportsPackage(C,f));if(!S)return Xl.skip;let x=null;try{x=await S.findPackageLocation(C,f)}catch(I){if(I.code==="LOCATOR_NOT_INSTALLED")return Xl.skip;throw I}return{dependency:C,packageLocation:x}}));for(let E of h){if(E===Xl.skip)continue;let{dependency:C,packageLocation:S}=E;for(let[x,I]of C.bin){let R=Y.resolve(S,I);s.set(x,[C,Ae.fromPortablePath(R),Gj(R)])}}return s}async function jpe(e){return await jT(e.anchoredLocator,{project:e.project})}async function qj(e,t){await Promise.all(Array.from(t,([r,[,s,a]])=>a?xd(e,r,process.execPath,[s]):xd(e,r,s,[])))}async function Gpe(e,t,r,{cwd:s,project:a,stdin:n,stdout:c,stderr:f,nodeArgs:p=[],packageAccessibleBinaries:h}){h??=await jT(e,{project:a});let E=h.get(t);if(!E)throw new Error(`Binary not found (${t}) for ${Vr(a.configuration,e)}`);return await ae.mktempPromise(async C=>{let[,S]=E,x=await mv({project:a,locator:e,binFolder:C});await qj(x.BERRY_BIN_FOLDER,h);let I=Gj(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}),R;try{R=await I}finally{await ae.removePromise(x.BERRY_BIN_FOLDER)}return R.code})}async function Srt(e,t,r,{cwd:s,stdin:a,stdout:n,stderr:c,packageAccessibleBinaries:f}){return await Gpe(e.anchoredLocator,t,r,{project:e.project,cwd:s,stdin:a,stdout:n,stderr:c,packageAccessibleBinaries:f})}var Ope,kd,Lpe,Ert,Irt,Yj=Ze(()=>{bt();bt();iA();uv();Zl();Ope=et(M0()),kd=Ce("stream");fI();Nc();gv();dv();IT();Tc();Qc();Lp();$o();Lpe=(a=>(a.Yarn1="Yarn Classic",a.Yarn2="Yarn",a.Npm="npm",a.Pnpm="pnpm",a))(Lpe||{});Ert=2,Irt=(0,Ope.default)(Ert)});function Mnt(e,t,r){let s=t,a=t?t.next:e.head,n=new J6(r,s,a,e);return n.next===void 0&&(e.tail=n),n.prev===void 0&&(e.head=n),e.length++,n}function Unt(e,t){e.tail=new J6(t,e.tail,void 0,e),e.head||(e.head=e.tail),e.length++}function _nt(e,t){e.head=new J6(t,void 0,e.head,e),e.tail||(e.tail=e.head),e.length++}var Ihe,Oa,yR,H6,Che,G6,wm,IR,vhe,hR,Ud,Kpe,She,Cm,Qhe,Uv,Ku,B6,Ohe,Q6,Z6,jhe,X6,Bn,gs,$6,jv,_I,Il,Vhe,_v,eG,El,rG,brt,Drt,qpe,Prt,xrt,krt,qp,Yp,Qd,GT,yv,qT,Ype,YT,Wpe,Yu,QI,zs,Ev,NI,Zs,Na,Xs,Wj,WT,na,es,Vj,Kj,Vpe,Jj,oA,zj,VT,Iv,Am,rc,Cv,Qrt,Trt,Rrt,Frt,whe,Nrt,Ort,Lrt,Dm,Mrt,Hd,zu,wv,Jn,Zj,Jp,Xj,E6,I6,Tv,KT,UI,HI,$j,OI,jd,Ju,Nd,aA,LI,e6,Kp,Bv,t6,nR,pm,iR,Bm,j6,Urt,ER,Bhe,_rt,Hrt,jrt,Grt,qrt,Yrt,Wrt,q6,Hv,Vrt,uA,Krt,Jpe,Jrt,r6,vm,JT,n6,Y6,bhe,zrt,Zrt,Dhe,Xrt,$rt,Phe,ent,tnt,rnt,nnt,int,snt,ont,ant,xhe,khe,lnt,sR,cnt,CR,W6,Sm,unt,hm,i6,fnt,Od,Ant,pnt,hnt,Ld,dnt,gnt,mnt,s6,ynt,dm,dR,Ent,Int,Cnt,wnt,cn,Rhe,wR,Bnt,C6,w6,vnt,_c,gm,Wp,o6,zpe,lA,vv,Td,Zpe,Ci,Vp,Rd,a6,mm,ds,zT,ZT,l6,Xpe,$pe,Sv,c6,XT,TI,Fd,$T,ym,eR,tR,ehe,Snt,bm,Rv,bnt,Fhe,Dnt,Pnt,BR,Nhe,xnt,the,V6,vR,K6,knt,Qnt,rhe,Tnt,Lhe,Rnt,nhe,ihe,she,v6,ohe,bv,oR,S6,aR,b6,D6,P6,x6,Md,gR,k6,u6,cA,Mhe,Fnt,Nnt,Ont,Lnt,J6,ahe,lhe,lR,Dv,Wu,Em,Im,Pv,f6,Vu,A6,cR,che,T6,R6,uR,fR,uhe,p6,AR,Uhe,h6,SR,z6,Hnt,jnt,_he,Hhe,Gnt,qnt,YUt,Ynt,Wnt,Vnt,Knt,Jnt,Ghe,znt,Znt,Xnt,qhe,F6,mR,$nt,Yhe,eit,Whe,Khe,bR,tit,rit,N6,Jhe,nit,iit,d6,fhe,RI,sit,oit,ait,lit,cit,uit,Ahe,O6,phe,L6,Hc,M6,U6,pR,hhe,dhe,Qv,ghe,mhe,g6,_d,$s,rR,yhe,FI,m6,y6,_6,Fv,Nv,Ov,Lv,fit,Mv,Ait,pit,hit,Ehe,tG,xv,zhe,dit,git,WUt,mit,yit,Eit,Iit,Cit,kv,VUt,wit,Zhe=Ze(()=>{Ihe=et(Ce("events"),1),Oa=et(Ce("fs"),1),yR=Ce("node:events"),H6=et(Ce("node:stream"),1),Che=Ce("node:string_decoder"),G6=et(Ce("node:path"),1),wm=et(Ce("node:fs"),1),IR=Ce("path"),vhe=Ce("events"),hR=et(Ce("assert"),1),Ud=Ce("buffer"),Kpe=et(Ce("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 The(Ent(Int(t),r),s)}},Ent=(e,t)=>t?Object.assign({},t,e):e,Int=e=>e.replace(/\n$/,"").split(`
`).reduce(Cnt,Object.create(null)),Cnt=(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},wnt=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,cn=wnt!=="win32"?e=>e:e=>e&&e.replace(/\\/g,"/"),Rhe=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))))}},wR=(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))},Bnt=1024*1024,C6=Buffer.from([31,139]),w6=Buffer.from([40,181,47,253]),vnt=Math.max(C6.length,w6.length),_c=Symbol("state"),gm=Symbol("writeEntry"),Wp=Symbol("readEntry"),o6=Symbol("nextEntry"),zpe=Symbol("processEntry"),lA=Symbol("extendedHeader"),vv=Symbol("globalExtendedHeader"),Td=Symbol("meta"),Zpe=Symbol("emitMeta"),Ci=Symbol("buffer"),Vp=Symbol("queue"),Rd=Symbol("ended"),a6=Symbol("emittedEnd"),mm=Symbol("emit"),ds=Symbol("unzip"),zT=Symbol("consumeChunk"),ZT=Symbol("consumeChunkSub"),l6=Symbol("consumeBody"),Xpe=Symbol("consumeMeta"),$pe=Symbol("consumeHeader"),Sv=Symbol("consuming"),c6=Symbol("bufferConcat"),XT=Symbol("maybeEnd"),TI=Symbol("writing"),Fd=Symbol("aborted"),$T=Symbol("onDone"),ym=Symbol("sawValidEntry"),eR=Symbol("sawNullBlock"),tR=Symbol("sawEOF"),ehe=Symbol("closeStream"),Snt=()=>!0,bm=class extends vhe.EventEmitter{file;strict;maxMetaEntrySize;filter;brotli;zstd;writable=!0;readable=!1;[Vp]=[];[Ci];[Wp];[gm];[_c]="begin";[Td]="";[lA];[vv];[Rd]=!1;[ds];[Fd]=!1;[ym];[eR]=!1;[tR]=!1;[TI]=!1;[Sv]=!1;[a6]=!1;constructor(e={}){super(),this.file=e.file||"",this.on($T,()=>{(this[_c]==="begin"||this[ym]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on($T,e.ondone):this.on($T,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||Bnt,this.filter=typeof e.filter=="function"?e.filter:Snt;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[ehe]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onReadEntry=="function"&&this.on("entry",e.onReadEntry)}warn(e,t,r={}){wR(this,e,t,r)}[$pe](e,t){this[ym]===void 0&&(this[ym]=!1);let r;try{r=new Sm(e,t,this[lA],this[vv])}catch(s){return this.warn("TAR_ENTRY_INVALID",s)}if(r.nullBlock)this[eR]?(this[tR]=!0,this[_c]==="begin"&&(this[_c]="header"),this[mm]("eof")):(this[eR]=!0,this[mm]("nullBlock"));else if(this[eR]=!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:()=>xit,emitTree:()=>Ade,treeNodeToJson:()=>fde,treeNodeToTreeify:()=>ude});function ude(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(Z0(t,E,2)),typeof C<"u"&&x.push(Gt(t,C[0],C[1])),x.length===0&&x.push(Z0(t,`${p}`,2));let I=x.join(": ").trim(),R=`\0${s++}\0`,N=c[`${R}${I}`]={};typeof S<"u"&&a(S,N)}};if(typeof e.children>"u")throw new Error("The root node must only contain children");return a(e.children,r),r}function fde(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 X0(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[kit(n)]=t(c));return typeof r.value>"u"?a:{value:X0(r.value[0],r.value[1]),children:a}};return t(e)}function xit(e,{configuration:t,stdout:r,json:s}){let a=e.map(n=>({value:n}));Ade({children:a},{configuration:t,stdout:r,json:s})}function Ade(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(fde(f))}
`);return}let n=(0,cde.asTree)(ude(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 kit(e){return typeof e=="string"?e.replace(/^\0[0-9]+\0/,""):e}var cde,pde=Ze(()=>{cde=et(lde());Tc()});var DR,hde=Ze(()=>{DR=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 Yv(e){let t=e.match(Qit);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 dde,cG,uG,PR,zr,Qit,fG=Ze(()=>{Ge();bt();bt();iA();dde=Ce("crypto"),cG=et(Ce("fs"));hde();Nc();wd();Qc();$o();uG=ZE(process.env.YARN_CACHE_CHECKPOINT_OVERRIDE??process.env.YARN_CACHE_VERSION_OVERRIDE??9),PR=ZE(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 DR(t=>{t.discardAndClose()});this.cacheId=`-${(0,dde.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:[PR,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=Yv(r).hash.slice(0,10);return`${lI(t)}-${a}.zip`}isChecksumCompatible(t){if(t===null)return!1;let{cacheVersion:r,cacheSpec:s}=Yv(t);if(r===null||r<uG)return!1;let a=this.configuration.get("cacheMigrationMode");return!(r<PR&&a==="always"||s!==this.cacheSpec&&a!=="required-only")}getLocatorPath(t,r){return this.mirrorCwd===null?Y.resolve(this.cwd,this.getVersionFilename(t)):r===null?Y.resolve(this.cwd,this.getVersionFilename(t)):Y.resolve(this.cwd,this.getChecksumFilename(t,r))}getLocatorMirrorPath(t){let r=this.mirrorCwd;return r!==null?Y.resolve(r,this.getVersionFilename(t)):null}async setup(){if(!this.configuration.get("enableGlobalCache"))if(this.immutable){if(!await ae.existsPromise(this.cwd))throw new Lt(56,"Cache path does not exist.")}else{await ae.mkdirPromise(this.cwd,{recursive:!0});let t=Y.resolve(this.cwd,".gitignore");await ae.changeFilePromise(t,`/.gitignore
*.flock
*.tmp
`)}(this.mirrorCwd||!this.immutable)&&await ae.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 pe=new hs,De=Y.join(wt.root,v8(t));return pe.mkdirSync(De,{recursive:!0}),pe.writeJsonSync(Y.join(De,yr.manifest),{name:fn(t),mocked:!0}),pe},E=async(pe,{isColdHit:De,controlPath:ye=null})=>{if(ye===null&&c.unstablePackages?.has(t.locatorHash))return{isValid:!0,hash:null};let d=r&&!De?Yv(r).cacheKey:this.cacheKey,ve=!c.skipIntegrityCheck||!r?`${d}/${await xQ(pe)}`:r;if(ye!==null){let me=!c.skipIntegrityCheck||!r?`${this.cacheKey}/${await xQ(ye)}`:r;if(ve!==me)throw new Lt(18,"The remote archive doesn't match the local checksum - has the local cache been corrupted?")}let Ie=null;switch(r!==null&&ve!==r&&(this.check?Ie="throw":Yv(r).cacheKey!==Yv(ve).cacheKey?Ie="update":Ie=this.configuration.get("checksumBehavior")),Ie){case null:case"update":return{isValid:!0,hash:ve};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 pe=>{if(!n)throw new Error(`Cache check required but no loader configured for ${Vr(this.configuration,t)}`);let De=await n(),ye=De.getRealPath();De.saveAndClose(),await ae.chmodPromise(ye,420);let d=await E(pe,{controlPath:ye,isColdHit:!1});if(!d.isValid)throw new Error("Assertion failed: Expected a valid checksum");return d.hash},S=async()=>{if(f===null||!await ae.existsPromise(f)){let pe=await n(),De=pe.getRealPath();return pe.saveAndClose(),{source:"loader",path:De}}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:pe,source:De}=await S(),{hash:ye}=await E(pe,{isColdHit:!0}),d=this.getLocatorPath(t,ye),ve=[];De!=="mirror"&&f!==null&&ve.push(async()=>{let me=`${f}${this.cacheId}`;await ae.copyFilePromise(pe,me,cG.default.constants.COPYFILE_FICLONE),await ae.chmodPromise(me,420),await ae.renamePromise(me,f)}),(!c.mirrorWriteOnly||f===null)&&ve.push(async()=>{let me=`${d}${this.cacheId}`;await ae.copyFilePromise(pe,me,cG.default.constants.COPYFILE_FICLONE),await ae.chmodPromise(me,420),await ae.renamePromise(me,d)});let Ie=c.mirrorWriteOnly?f??d:d;return await Promise.all(ve.map(me=>me())),[!1,Ie,ye]},I=async()=>{let De=(async()=>{let ye=c.unstablePackages?.has(t.locatorHash),d=ye||!r||this.isChecksumCompatible(r)?this.getLocatorPath(t,r):null,ve=d!==null?this.markedFiles.has(d)||await p.existsPromise(d):!1,Ie=!!c.mockedPackages?.has(t.locatorHash)&&(!this.check||!ve),me=Ie||ve,ce=me?s:a;if(ce&&ce(),me){let X=null,be=d;if(!Ie)if(this.check)X=await C(be);else{let ke=await E(be,{isColdHit:!1});if(ke.isValid)X=ke.hash;else return x()}return[Ie,be,X]}else{if(this.immutable&&ye)throw new Lt(56,`Cache entry required but missing for ${Vr(this.configuration,t)}; consider defining ${ue.pretty(this.configuration,"supportedArchitectures",ue.Type.CODE)} to cache packages for multiple systems`);return x()}})();this.mutexes.set(t.locatorHash,De);try{return await De}finally{this.mutexes.delete(t.locatorHash)}};for(let pe;pe=this.mutexes.get(t.locatorHash);)await pe;let[R,N,U]=await I();R||this.markedFiles.add(N);let K=()=>this.refCountedZipFsCache.addOrCreate(N,()=>R?h():new hs(N,{baseFs:p,readOnly:!0})),$,ie=new AE(()=>M4(()=>($=K(),$.value),pe=>`Failed to open the cache entry for ${Vr(this.configuration,t)}: ${pe}`),Y),fe=new Gf(N,{baseFs:ie,pathUtils:Y}),le=()=>{$?.release()},ge=c.unstablePackages?.has(t.locatorHash)?null:U;return[fe,le,ge]}},Qit=/^(?:(?<cacheKey>(?<cacheVersion>[0-9]+)(?<cacheSpec>.*))\/)?(?<hash>.*)$/});var xR,gde=Ze(()=>{xR=(r=>(r[r.SCRIPT=0]="SCRIPT",r[r.SHELLCODE=1]="SHELLCODE",r))(xR||{})});var Tit,jI,AG=Ze(()=>{bt();Sc();Lp();$o();Tit=[[/^(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)=>FQ({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=Y.join(t.cwd,yr.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 _j(r,{configuration:this.configuration,json:!1})}}});var GI,pG=Ze(()=>{$o();GI=class{constructor(t){this.resolver=t}supportsDescriptor(t,r){return!!(r.project.storedResolutions.get(t.descriptorHash)||r.project.originalPackages.has(QQ(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(QQ(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 Rit(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 R=s[p+I];return R.length>x.length?R: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 Fit(e){return{newPos:e.newPos,components:e.components.slice(0)}}function Nit(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 Ide(e,t,r){return r=Nit(r,{ignoreWhitespace:!0}),yG.diff(e,t,r)}function Oit(e,t,r){return EG.diff(e,t,r)}function kR(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?kR=function(t){return typeof t}:kR=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kR(e)}function hG(e){return Uit(e)||_it(e)||Hit(e)||jit()}function Uit(e){if(Array.isArray(e))return dG(e)}function _it(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Hit(e,t){if(e){if(typeof e=="string")return dG(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 dG(e,t)}}function dG(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 jit(){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 gG(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(Git.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]=gG(e[n],t,r,s,a);return t.pop(),r.pop(),c}if(e&&e.toJSON&&(e=e.toJSON()),kR(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]=gG(e[p],t,r,s,p);t.pop(),r.pop()}else c=e;return c}function Cde(e,t,r,s,a,n,c){c||(c={}),typeof c.context>"u"&&(c.context=4);var f=Oit(r,s,c);if(!f)return;f.push({value:"",lines:[]});function p(U){return U.map(function(K){return" "+K})}for(var h=[],E=0,C=0,S=[],x=1,I=1,R=function(K){var $=f[K],ie=$.lines||$.value.replace(/\n$/,"").split(`
`);if($.lines=ie,$.added||$.removed){var fe;if(!E){var le=f[K-1];E=x,C=I,le&&(S=c.context>0?p(le.lines.slice(-c.context)):[],E-=S.length,C-=S.length)}(fe=S).push.apply(fe,hG(ie.map(function(me){return($.added?"+":"-")+me}))),$.added?I+=ie.length:x+=ie.length}else{if(E)if(ie.length<=c.context*2&&K<f.length-2){var ge;(ge=S).push.apply(ge,hG(p(ie)))}else{var pe,De=Math.min(ie.length,c.context);(pe=S).push.apply(pe,hG(p(ie.slice(0,De))));var ye={oldStart:E,oldLines:x-E+De,newStart:C,newLines:I-C+De,lines:S};if(K>=f.length-2&&ie.length<=c.context){var d=/\n$/.test(r),ve=/\n$/.test(s),Ie=ie.length==0&&S.length>ye.oldLines;!d&&Ie&&r.length>0&&S.splice(ye.oldLines,0,"\\ No newline at end of file"),(!d&&!Ie||!ve)&&S.push("\\ No newline at end of file")}h.push(ye),E=0,C=0,S=[]}x+=ie.length,I+=ie.length}},N=0;N<f.length;N++)R(N);return{oldFileName:e,newFileName:t,oldHeader:a,newHeader:n,hunks:h}}var s4t,yde,Ede,yG,EG,Lit,Mit,Git,Wv,mG,IG=Ze(()=>{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(R){return a?(setTimeout(function(){a(void 0,R)},0),!0):R}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 R=-1*h;R<=h;R+=2){var N=void 0,U=C[R-1],K=C[R+1],$=(K?K.newPos:0)-R;U&&(C[R-1]=void 0);var ie=U&&U.newPos+1<f,fe=K&&0<=$&&$<p;if(!ie&&!fe){C[R]=void 0;continue}if(!ie||fe&&U.newPos<K.newPos?(N=Fit(K),n.pushComponent(N.components,void 0,!0)):(N=U,N.newPos++,n.pushComponent(N.components,!0,void 0)),$=n.extractCommon(N,r,t,R),N.newPos+1>=f&&$+1>=p)return c(Rit(n,N.components,r,t,n.useLongestToken));C[R]=N}h++}if(a)(function R(){setTimeout(function(){if(h>E)return a();x()||R()},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("")}};s4t=new zp;yde=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,Ede=/\S/,yG=new zp;yG.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!Ede.test(e)&&!Ede.test(t)};yG.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]&&yde.test(t[r])&&yde.test(t[r+2])&&(t[r]+=t[r+2],t.splice(r+1,2),r--);return t};EG=new zp;EG.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};Lit=new zp;Lit.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};Mit=new zp;Mit.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};Git=Object.prototype.toString,Wv=new zp;Wv.useLongestToken=!0;Wv.tokenize=EG.tokenize;Wv.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(gG(e,null,null,a),a," ")};Wv.equals=function(e,t){return zp.prototype.equals.call(Wv,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};mG=new zp;mG.tokenize=function(e){return e.slice()};mG.join=mG.removeEmpty=function(e){return e}});var QR,wde=Ze(()=>{Nc();QR=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 ae.changeFilePromise(r,s,{automaticNewlines:!0}),this.manifest.raw=t}}});function Jit({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,R=new Map,N=new Map,U=new Map(e.workspaces.map(le=>{let ge=le.anchoredLocator.locatorHash,pe=s.get(ge);if(typeof pe>"u")throw new Error("Assertion failed: The workspace should have an associated package");return[ge,FB(pe)]})),K=()=>{let le=ae.mktempSync(),ge=Y.join(le,"stacktrace.log"),pe=String(C.length+1).length,De=C.map((ye,d)=>`${`${d+1}.`.padStart(pe," ")} ${ml(ye)}
`).join("");throw ae.writeFileSync(ge,De),ae.detachTemp(le),new Lt(45,`Encountered a stack overflow when resolving peer dependencies; cf ${Ae.fromPortablePath(ge)}`)},$=le=>{let ge=r.get(le.descriptorHash);if(typeof ge>"u")throw new Error("Assertion failed: The resolution should have been registered");let pe=s.get(ge);if(!pe)throw new Error("Assertion failed: The package could not be found");return pe},ie=(le,ge,pe,{top:De,optional:ye})=>{C.length>1e3&&K(),C.push(ge);let d=fe(le,ge,pe,{top:De,optional:ye});return C.pop(),d},fe=(le,ge,pe,{top:De,optional:ye})=>{if(ye||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 ve=new Set,Ie=new Map,me=[],ce=[],X=[],be=[];for(let ke of Array.from(d.dependencies.values())){if(d.peerDependencies.has(ke.identHash)&&d.locatorHash!==De)continue;if(Fp(ke))throw new Error("Assertion failed: Virtual packages shouldn't be encountered when virtualizing a branch");h.delete(ke.descriptorHash);let it=ye;if(!it){let Te=d.dependenciesMeta.get(fn(ke));if(typeof Te<"u"){let ct=Te.get(null);typeof ct<"u"&&ct.optional&&(it=!0)}}let _=r.get(ke.descriptorHash);if(!_)throw new Error(`Assertion failed: The resolution (${ai(e.configuration,ke)}) should have been registered`);let tt=U.get(_)||s.get(_);if(!tt)throw new Error(`Assertion failed: The package (${_}, resolved from ${ai(e.configuration,ke)}) should have been registered`);if(tt.peerDependencies.size===0){ie(ke,tt,new Map,{top:De,optional:it});continue}let Fe,Qe,Se=new Set,je=new Map;me.push(()=>{Fe=w8(ke,ge.locatorHash),Qe=B8(tt,ge.locatorHash),d.dependencies.set(ke.identHash,Fe),r.set(Fe.descriptorHash,Qe.locatorHash),t.set(Fe.descriptorHash,Fe),s.set(Qe.locatorHash,Qe),Qp(R,Qe.locatorHash).add(Fe.descriptorHash),ve.add(Qe.locatorHash)}),ce.push(()=>{N.set(Qe.locatorHash,je);for(let Te of Qe.peerDependencies.values()){let Me=$l(Ie,Te.identHash,()=>{let P=pe.get(Te.identHash)??null,w=d.dependencies.get(Te.identHash);return!w&&OB(ge,Te)&&(le.identHash===ge.identHash?w=le:(w=Un(ge,le.range),t.set(w.descriptorHash,w),r.set(w.descriptorHash,ge.locatorHash),h.delete(w.descriptorHash),P=null)),w||(w=Un(Te,"missing:")),{subject:ge,ident:Te,provided:w,root:!P,requests:new Map,hash:`p${As(ge.locatorHash,Te.identHash).slice(0,6)}`}}).provided;if(Me.range==="missing:"&&Qe.dependencies.has(Te.identHash)){Qe.peerDependencies.delete(Te.identHash);continue}if(je.set(Te.identHash,{requester:Qe,descriptor:Te,meta:Qe.peerDependenciesMeta.get(fn(Te)),children:new Map}),Qe.dependencies.set(Te.identHash,Me),Fp(Me)){let P=r.get(Me.descriptorHash);Qp(I,P).add(Qe.locatorHash)}S.set(Me.identHash,Me),Me.range==="missing:"&&Se.add(Me.identHash)}Qe.dependencies=new Map(Ks(Qe.dependencies,([Te,ct])=>fn(ct)))}),X.push(()=>{if(!s.has(Qe.locatorHash))return;let Te=E.get(tt.locatorHash);typeof Te=="number"&&Te>=2&&K();let ct=E.get(tt.locatorHash),Me=typeof ct<"u"?ct+1:1;E.set(tt.locatorHash,Me),ie(Fe,Qe,je,{top:De,optional:it}),E.set(tt.locatorHash,Me-1)}),be.push(()=>{let Te=r.get(Fe.descriptorHash);if(typeof Te>"u")throw new Error("Assertion failed: Expected the descriptor to be registered");let ct=N.get(Te);if(typeof ct>"u")throw new Error("Assertion failed: Expected the peer requests to be registered");for(let Me of Ie.values()){let P=ct.get(Me.ident.identHash);P&&(Me.requests.set(Fe.descriptorHash,P),p.set(Me.hash,Me),Me.root||pe.get(Me.ident.identHash)?.children.set(Fe.descriptorHash,P))}if(s.has(Qe.locatorHash))for(let Me of Se)Qe.dependencies.delete(Me)})}for(let ke of[...me,...ce])ke();for(let ke of ve){ve.delete(ke);let it=s.get(ke),_=As(aI(it).locatorHash,...Array.from(it.dependencies.values(),Se=>{let je=Se.range!=="missing:"?r.get(Se.descriptorHash):"missing:";if(typeof je>"u")throw new Error(`Assertion failed: Expected the resolution for ${ai(e.configuration,Se)} to have been registered`);return je===De?`${je} (top)`:je})),tt=x.get(_);if(typeof tt>"u"){x.set(_,it);continue}let Fe=Qp(R,tt.locatorHash);for(let Se of R.get(it.locatorHash)??[])r.set(Se,tt.locatorHash),Fe.add(Se);s.delete(it.locatorHash),a.delete(it.locatorHash),ve.delete(it.locatorHash);let Qe=I.get(it.locatorHash);if(Qe!==void 0){let Se=Qp(I,tt.locatorHash);for(let je of Qe)Se.add(je),ve.add(je)}}for(let ke of[...X,...be])ke()};for(let le of e.workspaces){let ge=le.anchoredLocator;h.delete(le.anchoredDescriptor.descriptorHash),ie(le.anchoredDescriptor,ge,new Map,{top:ge.locatorHash,optional:!1})}for(let le of p.values()){if(!le.root)continue;let ge=s.get(le.subject.locatorHash);if(typeof ge>"u")continue;for(let De of le.requests.values()){let ye=`p${As(le.subject.locatorHash,fn(le.ident),De.requester.locatorHash).slice(0,6)}`;c.set(ye,{subject:le.subject.locatorHash,requested:le.ident,rootRequester:De.requester.locatorHash,allRequesters:Array.from(HB(De),d=>d.requester.locatorHash)})}let pe=[...HB(le)];if(le.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=Y.join(this.cwd,yr.lockfile),r=this.configuration.get("defaultLanguageName");if(ae.existsSync(t)){let s=await ae.readFilePromise(t,"utf8");this.lockFileChecksum=Sde(s);let a=us(s);if(a.__metadata){let n=a.__metadata.version,c=a.__metadata.cacheKey;this.lockfileLastVersion=n,this.lockfileNeedsRefresh=n<FR;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,R=E.dependencies,N=E.peerDependencies,U=E.dependenciesMeta,K=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:R,peerDependencies:N,dependenciesMeta:U,peerDependenciesMeta:K,bin:$};this.originalPackages.set(ie.locatorHash,ie);for(let fe of f.split(Yit)){let le=Bd(fe);n<=6&&(le=this.configuration.normalizeDependency(le),le=Un(le,le.range.replace(/^patch:[^@]+@(?!npm(:|%3A))/,"$1npm%3A"))),this.storedDescriptors.set(le.descriptorHash,le),this.storedResolutions.set(le.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,RR.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){Y.isAbsolute(t)||(t=Y.resolve(this.cwd,t)),t=Y.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)Y.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=NB(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:Fe+=`# Script name: ${tt.script}
`;break;case 1:Fe+=`# Script code: ${tt.script}
`;break}let Qe=null;if(!await ae.mktempPromise(async je=>{let Te=Y.join(je,"build.log"),{stdout:ct,stderr:Me}=this.configuration.getSubprocessStreams(Te,{header:Fe,prefix:Vr(this.configuration,X),report:r}),P;try{switch(tt.type){case 0:P=await HT(X,tt.script,[],{cwd:_,project:this,stdin:Qe,stdout:ct,stderr:Me});break;case 1:P=await Hj(X,tt.script,[],{cwd:_,project:this,stdin:Qe,stdout:ct,stderr:Me});break}}catch(y){Me.write(y.stack),P=1}if(ct.end(),Me.end(),P===0)return!0;ae.detachTemp(je);let w=`${Vr(this.configuration,X)} couldn't be built successfully (exit code ${Gt(this.configuration,P,dt.NUMBER)}, logs can be found here: ${Gt(this.configuration,Te,dt.PATH)})`,D=this.optionalBuilds.has(X.locatorHash);return D?r.reportInfo(9,w):r.reportError(9,w),Fpe&&r.reportFold(Ae.fromPortablePath(Te),ae.readFileSync(Te,"utf8")),D}))return!1}return!0});me.push(...it,Promise.allSettled(it).then(_=>{ie.delete(ce),_.every(tt=>tt.status==="fulfilled"&&tt.value===!0)&&ye.set(X.locatorHash,ke)}))}if(await Mu(me),Ie===ie.size){let ce=Array.from(ie).map(X=>{let be=this.storedPackages.get(X);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: ${ce})`);break}}this.storedBuildState=ye,this.skippedBuilds=N}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=Y.join(this.cwd,yr.lockfile),c=null;if(t.immutable)try{c=await ae.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()=>{Zit(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=I0(c,this.generateLockfile());if(E!==c){let C=Cde(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(X0(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=>kQ(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=>kQ(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=Y.join(this.cwd,yr.lockfile),r="";try{r=await ae.readFilePromise(t,"utf8")}catch{}let s=this.generateLockfile(),a=I0(r,s);a!==r&&(await ae.writeFilePromise(t,a),this.lockFileChecksum=Sde(a),this.lockfileNeedsRefresh=!1)}async persistInstallStateFile(){let t=[];for(let c of Object.values(BG))t.push(...c);let r=z0(this,t),s=vG.default.serialize(r),a=As(s);if(this.installStateChecksum===a)return;let n=this.configuration.get("installStatePath");await ae.mkdirPromise(Y.dirname(n),{recursive:!0}),await ae.writeFilePromise(n,await Vit(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 Kit(await ae.readFilePromise(a));n=vG.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,z0(n,BG.restoreBuildState)),r&&(n.lockFileChecksum===this.lockFileChecksum?Object.assign(this,z0(n,BG.restoreResolutions)):await this.applyLightResolution())}async applyLightResolution(){await this.resolveEverything({lockfileOnly:!0,report:new Qi}),await this.persistInstallStateFile()}async persist(){let t=(0,RR.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(!U8(t.cwd,this.cwd)||!await ae.existsPromise(t.cwd))return null;let a=[];for(let c of await ae.readdirPromise(t.cwd)){if(s.has(c))continue;let f=Y.resolve(t.cwd,c);t.markedFiles.has(f)||(t.immutable?r.reportError(56,`${Gt(this.configuration,Y.basename(f),"magenta")} appears to be unused and would be marked for deletion, but the cache is immutable`):a.push(ae.lstatPromise(f).then(async p=>(await ae.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 Xit(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,Pde=Ze(()=>{bt();dv();wd();mT();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=!ae.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=L4(this.hits,t),a=$l(s,r,()=>0);s.set(r,a+1)}getRegistryPath(){let t=this.configuration.get("globalFolder");return Y.join(t,"telemetry.json")}sendReport(t){let r=this.getRegistryPath(),s;try{s=ae.readJsonSync(r)}catch{s={}}let{nextState:a,triggerUpdate:n,triggerTips:c,nextTips:f}=Xit({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{ae.mkdirSync(Y.dirname(r),{recursive:!0}),ae.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=>ij(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=nst,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(!rst(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=Fde(),e.define=a,e};PG.exports=Nde();PG.exports.create=Nde});var ia=G(hn=>{"use strict";var ist=Object.prototype.toString,jc=Zu(),Ode=!1,xG=[],Lde={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 LR=hn.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);hn.nativeType=e=>ist.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[Lde[t]||t];if(r){let s=r.slice(2).toLowerCase(),a=Lde[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(!LR(e))return t;if(!LR(t))return e;for(let r of Object.keys(t)){let s=Object.getOwnPropertyDescriptor(t,r);if(s.hasOwnProperty("value"))if(e.hasOwnProperty(r)&&LR(s.value)){let a=Object.getOwnPropertyDescriptor(e,r);LR(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)=>{Ode||(Ode=!0,xG.forEach(a=>a()),r===!0&&process.exit(128+s))};xG.length===0&&(process.once("SIGTERM",t.bind(null,!0,15)),process.once("SIGINT",t.bind(null,!0,2)),process.once("exit",t)),xG.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 Mde=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 Hde=G((O3t,_de)=>{"use strict";var Ude=Ce("readline"),sst=Mde(),ost=/^(?:\x1b)([a-zA-Z0-9])$/,ast=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,lst={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 cst(e){return["[a","[b","[c","[d","[e","[2$","[3$","[5$","[6$","[7$","[8$","[Z"].includes(e)}function ust(e){return["Oa","Ob","Oc","Od","Oe","[2^","[3^","[5^","[6^","[7^","[8^"].includes(e)}var MR=(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=ost.exec(e))s.meta=!0,s.shift=/^[A-Z]$/.test(r[1]);else if(r=ast.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=lst[n],s.shift=cst(n)||s.shift,s.ctrl=ust(n)||s.ctrl}return s};MR.listen=(e={},t)=>{let{stdin:r}=e;if(!r||r!==process.stdin&&!r.isTTY)throw new Error("Invalid stream passed");let s=Ude.createInterface({terminal:!0,input:r});Ude.emitKeypressEvents(r,s);let a=(f,p)=>t(f,MR(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()}};MR.action=(e,t,r)=>{let s={...sst,...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)};_de.exports=MR});var Gde=G((L3t,jde)=>{"use strict";jde.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}),fst(e,r,s)}};function fst(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 Yde=G((M3t,qde)=>{"use strict";var{define:Ast,width:pst}=ia(),kG=class{constructor(t){let r=t.options;Ast(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=pst(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"}};qde.exports=kG});var Vde=G((U3t,Wde)=>{"use strict";var QG=ia(),wo=Zu(),TG={default:wo.noop,noop:wo.noop,set inverse(e){this._inverse=e},get inverse(){return this._inverse||QG.inverse(this.primary)},set complement(e){this._complement=e},get complement(){return this._complement||QG.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}};TG.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=QG.merge({},TG,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};Wde.exports=TG});var Jde=G((_3t,Kde)=>{"use strict";var RG=process.platform==="win32",Zp=Zu(),hst=ia(),FG={...Zp.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=MG.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 Bst(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 vst(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}ige.exports=UG});var age=G((G3t,oge)=>{"use strict";var Sst=ia(),sge={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 sge.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}};oge.exports=(e,t={})=>{let r=Sst.merge({},sge,t.roles);return r[e]||r.default}});var zv=G((q3t,uge)=>{"use strict";var bst=Zu(),Dst=zI(),Pst=age(),UR=ia(),{reorder:_G,scrollUp:xst,scrollDown:kst,isObject:lge,swap:Qst}=UR,HG=class extends Dst{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");lge(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,UR.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,bst.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()}};fge.exports=GG});var pge=G((W3t,Age)=>{"use strict";var Rst=Yd(),Fst=(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}},qG=class extends Rst{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=Fst(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()}};Age.exports=qG});var WG=G((V3t,hge)=>{"use strict";var YG=ia();hge.exports=(e,t={})=>{e.cursorHide();let{input:r="",initial:s="",pos:a,showCursor:n=!0,color:c}=t,f=c||e.styles.placeholder,p=YG.inverse(e.styles.primary),h=R=>p(e.styles.black(R)),E=r,C=" ",S=h(C);if(e.blink&&e.blink.off===!0&&(h=R=>R,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=YG.isPrimitive(s)?`${s}`:"",r=YG.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 R=e.styles.unstyle(E+I);return E+I+f(s.slice(R.length))}return E+I}});var _R=G((K3t,dge)=>{"use strict";var Nst=Zu(),Ost=Yd(),Lst=WG(),VG=class extends Ost{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,R=this.index===r,N=t.validate||(()=>!0),U=await this.choiceSeparator(t,r),K=t.message;this.align==="right"&&(K=K.padStart(this.longest+1," ")),this.align==="left"&&(K=K.padEnd(this.longest+1," "));let $=this.values[f]=h||c,ie=h?"success":"dark";await N.call(t,$,this. Line truncated
`)),this.restore()}set value(t){super.value=t}get value(){return this.cast(super.value)}};Cge.exports=JG});var Bge=G((X3t,wge)=>{"use strict";var Yst=HR(),zG=class extends Yst{constructor(t){super(t),this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}};wge.exports=zG});var Sge=G(($3t,vge)=>{"use strict";var Wst=Yd(),Vst=_R(),ZI=Vst.prototype,ZG=class extends Wst{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]():ZI.dispatch.call(this,t,r)}append(t,r){return ZI.append.call(this,t,r)}delete(t,r){return ZI.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?ZI.next.call(this):super.next()}prev(){return this.focused.editable?ZI.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?ZI.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)}};vge.exports=ZG});var km=G((e8t,bge)=>{"use strict";var Kst=zI(),Jst=WG(),{isPrimitive:zst}=ia(),XG=class extends Kst{constructor(t){super(t),this.initial=zst(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):Jst(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()}};bge.exports=XG});var Pge=G((t8t,Dge)=>{"use strict";var Zst=e=>e.filter((t,r)=>e.lastIndexOf(t)===r),jR=e=>Zst(e).filter(Boolean);Dge.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:jR([r,...n]),present:c};case"next":case"redo":return n=s.slice(1),c=s[0]||"",{past:jR([...n,r]),present:c};case"save":return{past:jR([...s,r]),present:""};case"remove":return c=jR(s.filter(f=>f!==r)),a="",c.length&&(a=c.pop()),{past:c,present:a};default:throw new Error(`Invalid action: "${e}"`)}}});var e5=G((r8t,kge)=>{"use strict";var Xst=km(),xge=Pge(),$G=class extends Xst{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=xge(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=xge("save",this.data,this.input),this.store.set("values",this.data))}submit(){return this.store&&this.autosave===!0&&this.save(),super.submit()}};kge.exports=$G});var Tge=G((n8t,Qge)=>{"use strict";var $st=km(),t5=class extends $st{format(){return""}};Qge.exports=t5});var Fge=G((i8t,Rge)=>{"use strict";var eot=km(),r5=class extends eot{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()}};Rge.exports=r5});var Oge=G((s8t,Nge)=>{"use strict";var tot=Yd(),n5=class extends tot{constructor(t){super({...t,multiple:!0})}};Nge.exports=n5});var s5=G((o8t,Lge)=>{"use strict";var rot=km(),i5=class extends rot{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()}};Lge.exports=i5});var Uge=G((a8t,Mge)=>{Mge.exports=s5()});var Hge=G((l8t,_ge)=>{"use strict";var not=km(),o5=class extends not{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)):""}};_ge.exports=o5});var qge=G((c8t,Gge)=>{"use strict";var iot=Zu(),sot=zv(),jge=ia(),a5=class extends sot{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&&!jge.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=iot.unstyle(E).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-C.length);let x=jge.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)}};Gge.exports=a5});var Vge=G((u8t,Wge)=>{"use strict";var Yge=Zu(),oot=(e="")=>typeof e=="string"?e.replace(/^['"]|['"]$/g,""):"",c5=class{constructor(t){this.name=t.key,this.field=t.field||{},this.value=oot(t.initial||this.field.initial||""),this.message=t.message||this.name,this.cursor=0,this.input="",this.lines=[]}},aot=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 N=C();I+=N;let U={type:"template",open:I,inner:"",close:"",value:I},K;for(;K=C();){if(K==="}"){S()==="}"&&(K+=C()),U.value+=K,U.close=K;break}K===":"?(U.initial="",U.key=U.inner):U.initial!==void 0&&(U.initial+=K),U.value+=K,U.inner+=K}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 c5(U),f.push($)),$.lines.push(U.line-1);continue}let R=c[c.length-1];R.type==="text"&&R.line===h?R.value+=I:x({type:"text",value:I})}return x({type:"eos",value:""}),{input:n,tabstops:c,unique:s,keys:p,items:f}};Wge.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 aot(t,s),f=l5("result",e,t),p=l5("format",e,t),h=l5("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(K,$,ie,fe)=>{let le=await h(K,$,ie,fe);return le===!1?"Invalid field "+ie.name:le};for(let K of a){let $=K.value,ie=K.key;if(K.type!=="template"){$&&(C.output+=$);continue}if(K.type==="template"){let fe=n.find(ye=>ye.name===ie);t.required===!0&&C.required.add(fe.name);let le=[fe.input,C.values[fe.value],fe.value,$].find(E),pe=(fe.field||{}).message||K.inner;if(S){let ye=await I(C.values[ie],C,fe,x);if(ye&&typeof ye=="string"||ye===!1){C.invalid.set(ie,ye);continue}C.invalid.delete(ie);let d=await f(C.values[ie],C,fe,x);C.output+=Yge.unstyle(d);continue}fe.placeholder=!1;let De=$;$=await p($,C,fe,x),le!==$?(C.values[ie]=le,$=e.styles.typing(le),C.missing.delete(pe)):(C.values[ie]=void 0,le=`<${pe}>`,$=e.styles.primary(le),fe.placeholder=!0,C.required.has(ie)&&C.missing.add(pe)),C.missing.has(pe)&&C.validating&&($=e.styles.warning(le)),C.invalid.has(ie)&&C.validating&&($=e.styles.danger(le)),x===C.index&&(De!==$?$=e.styles.underline($):$=e.styles.heading(Yge.unstyle($))),x++}$&&(C.output+=$)}let R=C.output.split(`
`).map(K=>" "+K),N=n.length,U=0;for(let K of n)C.invalid.has(K.name)&&K.lines.forEach($=>{R[$][0]===" "&&(R[$]=C.styles.danger(C.symbols.bullet)+R[$].slice(1))}),e.isValue(C.values[K.name])&&U++;return C.completed=(U/N*100).toFixed(0),C.output=R.join(`
`),C.output}};function l5(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 Jge=G((f8t,Kge)=>{"use strict";var lot=Zu(),cot=Vge(),uot=zI(),u5=class extends uot{constructor(t){super(t),this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await cot(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(K=>K!=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]||"",R=await this.format(I),N=await this.footer();R&&(h+=" "+R),S&&!R&&this.state.completed===0&&(h+=" "+S),this.clear(a);let U=[E,h,x,N,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=lot.unstyle(s).split(`
`).map(f=>f.slice(1)).join(`
`);return this.value={values:a,result:c},super.submit()}};Kge.exports=u5});var Zge=G((A8t,zge)=>{"use strict";var fot="(Use <shift>+<up/down> to sort)",Aot=Yd(),f5=class extends Aot{constructor(t){super({...t,reorder:!1,sort:!0,multiple:!0}),this.state.hint=[this.options.hint,fot].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()}};zge.exports=f5});var $ge=G((p8t,Xge)=>{"use strict";var pot=zv(),A5=class extends pot{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=hot(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),R=$=>$===t.scaleIdx?C($):$,N=x+t.scale.map(($,ie)=>R(ie)).join(p),U=()=>[E,S].filter(Boolean).join(" "),K=()=>[U(),I,N," "].filter(Boolean).join(`
`);return s&&(I=this.styles.cyan(I),N=this.styles.cyan(N)),K()}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 hot(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}Xge.exports=A5});var t0e=G((h8t,e0e)=>{e0e.exports=e5()});var n0e=G((d8t,r0e)=>{"use strict";var dot=HR(),p5=class extends dot{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()}};r0e.exports=p5});var s0e=G((g8t,i0e)=>{"use strict";var got=Yd(),h5=class extends got{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)}}};i0e.exports=h5});var a0e=G(d5=>{"use strict";var o0e=ia(),Rs=(e,t)=>{o0e.defineExport(d5,e,t),o0e.defineExport(d5,e.toLowerCase(),t)};Rs("AutoComplete",()=>pge());Rs("BasicAuth",()=>Ige());Rs("Confirm",()=>Bge());Rs("Editable",()=>Sge());Rs("Form",()=>_R());Rs("Input",()=>e5());Rs("Invisible",()=>Tge());Rs("List",()=>Fge());Rs("MultiSelect",()=>Oge());Rs("Numeral",()=>Uge());Rs("Password",()=>Hge());Rs("Scale",()=>qge());Rs("Select",()=>Yd());Rs("Snippet",()=>Jge());Rs("Sort",()=>Zge());Rs("Survey",()=>$ge());Rs("Text",()=>t0e());Rs("Toggle",()=>n0e());Rs("Quiz",()=>s0e())});var c0e=G((y8t,l0e)=>{l0e.exports={ArrayPrompt:zv(),AuthPrompt:KG(),BooleanPrompt:HR(),NumberPrompt:s5(),StringPrompt:km()}});var Xv=G((E8t,f0e)=>{"use strict";var u0e=Ce("assert"),m5=Ce("events"),Wd=ia(),$u=class extends m5{constructor(t,r){super(),this.options=Wd.merge({},t),this.answers={...r}}register(t,r){if(Wd.isObject(t)){for(let a of Object.keys(t))this.register(a,t[a]);return this}u0e.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(Wd.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=Wd.merge({},this.options,t),{type:s,name:a}=t,{set:n,get:c}=Wd;if(typeof s=="function"&&(s=await s.call(this,t,this.answers)),!s)return this.answers[a];u0e(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 a0e()}static get types(){return c0e()}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 Wd.mixinEmitter(t,new m5),t}};Wd.mixinEmitter($u,new m5);var g5=$u.prompts;for(let e of Object.keys(g5)){let t=e.toLowerCase(),r=s=>new g5[e](s).run();$u.prompt[t]=r,$u[t]=r,$u[e]||Reflect.defineProperty($u,e,{get:()=>g5[e]})}var Zv=e=>{Wd.defineExport($u,e,()=>$u.types[e])};Zv("ArrayPrompt");Zv("AuthPrompt");Zv("BooleanPrompt");Zv("NumberPrompt");Zv("StringPrompt");f0e.exports=$u});var E0e=G((jHt,Sot)=>{Sot.exports={name:"@yarnpkg/cli",version:"4.17.1",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
${K} at ${$}`:`
${K}`}).join("");h.push({text:`Conflict detected in constraint targeting ${ue.pretty(e.configuration,x,ue.Type.CODE)}; conflicting values are:${R}`,fixable:!1})}else{let[[R]]=I,N=xa(S,x);if(JSON.stringify(N)===JSON.stringify(R))continue;if(!s){let U=typeof N>"u"?`Missing field ${ue.pretty(e.configuration,x,ue.Type.CODE)}; expected ${ue.pretty(e.configuration,R,ue.Type.INSPECT)}`:typeof R>"u"?`Extraneous field ${ue.pretty(e.configuration,x,ue.Type.CODE)} currently set to ${ue.pretty(e.configuration,N,ue.Type.INSPECT)}`:`Invalid field ${ue.pretty(e.configuration,x,ue.Type.CODE)}; expected ${ue.pretty(e.configuration,R,ue.Type.INSPECT)}, found ${ue.pretty(e.configuration,N,ue.Type.INSPECT)}`;h.push({text:U,fixable:!0});continue}typeof R>"u"?hd(S,x):J0(S,x,R),E=!0}E&&a.set(C,S)}h.length>0&&n.set(C,h)}return{changedWorkspaces:a,remainingErrors:n}}function sme(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]=`${ue.pretty(t,"\u2699","gray")} ${p[0]}`),n.push({value:ue.tuple(ue.Type.NO_HINT,p[0]),children:p.slice(1).map(h=>({value:ue.tuple(ue.Type.NO_HINT,h)}))})}let c={value:ue.tuple(ue.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 UC,Iat,Cat,wat,cS=Ze(()=>{Ge();Zl();UC=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}},Iat=/^[0-9]+$/,Cat=/^[a-zA-Z0-9_]+$/,wat=new Set(["scripts",..._t.allDependencies])});var ome=G((Sqt,$5)=>{var Sat;(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 xat(e){var t,r={},s,a={env:process.env,encoding:e.encoding};if(Vd||(Rm?process.env.PSModulePath?(Vd="powershell.exe",JR=["-ExecutionPolicy","Bypass","-File",__dirname+"\\read.ps1"]):(Vd="cscript.exe",JR=["//nologo",__dirname+"\\read.cs.js"]):(Vd="/bin/sh",JR=[__dirname+"/read.sh"])),Rm&&!process.env.PSModulePath&&(a.stdio=[process.stdin]),r9.execFileSync){t=fme(e),uS&&uS("execFileSync",t);try{r.input=r9.execFileSync(Vd,t,a)}catch(n){s=n.stderr?(n.stderr+"").trim():"",r.error=new Error(cme+(s?`
`+s:"")),r.error.method="execFileSync",r.error.program=Vd,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 s9(e){var t="",r=e.display,s=!e.display&&e.keyIn&&e.hideEchoBack&&!e.mask;function a(){var n=xat(e);if(n.error)throw n.error;return n.input}return i9&&i9(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,Rm){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,HC=process.stdin._handle;else try{$p=p().open("CONIN$",c.O_RDWR,parseInt("0666",8)),HC=new ame($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"),HC=process.stdin._handle}catch{}}else try{$p=li.openSync("/dev/tty","r"),HC=new ame($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;zR="";function x(I){return I===lme?!0:HC.setRawMode(I)!==0?!1:(lme=I,!0)}if(ume||!HC||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),zR+=C):(C=`
`,zR+="\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?"":l9=e.keepWhitespace||e.keyIn?t:t.trim()}function kat(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 c9(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(n9),e.unshift(n9))),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]=kat(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 o9(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 u9(e,t){var r=Kd.normalize(Rm?(process.env.HOMEDRIVE||"")+(process.env.HOMEPATH||""):process.env.HOME||"").replace(/[\/\\]+$/,"");return e=Kd.normalize(e),t?e.replace(/^~(?=\/|\\|$)/,r):e.replace(new RegExp("^"+c9(r)+"(?=\\/|\\\\|$)",Rm?"i":""),"~")}function jC(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 Ame(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 pme(e,t){return e.join(e.length>2?", ":t?" / ":"/")}function hme(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=Ame(s,t.caseSensitive),s=a.values):s=s.filter(function(c){var f=typeof c;return f==="string"||f==="number"}),r=pme(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=l9;break;case"cwd":case"CWD":case"cwdHome":r=process.cwd(),e==="CWD"?r=Kd.basename(r):e==="cwdHome"&&(r=u9(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=Tm[Tm.length-n]||"")}return r}function dme(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 a9(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 gme(e,t){return t.trueValue.length&&o9(e,t.trueValue,t.caseSensitive)?!0:t.falseValue.length&&o9(e,t.falseValue,t.caseSensitive)?!1:e}function mme(e){var t,r,s,a,n,c,f;function p(E){return hme(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=jC(e.display+"",p);;){if(t=s9(e),r=!1,s="",e.defaultInput&&!t&&(t=e.defaultInput),e.history&&((a=/^\s*\!(?:\!|-1)(:p)?\s*$/.exec(t))?(n=Tm[0]||"",a[1]?r=!0:t=n,h(n+`
`),r||(e.displayOnly=!0,s9(e),e.displayOnly=!1)):t&&t!==Tm[Tm.length-1]&&(Tm=[t])),!r&&e.cd&&t)switch(c=a9(t),c[0].toLowerCase()){case"cd":if(c[1])try{process.chdir(u9(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||o9(t,e.limitSrc,e.caseSensitive))break;e.limitMessage&&(s=jC(e.limitMessage,p))}h((s?s+`
`:"")+jC(e.displaySrc+"",p))}return gme(t,e)}en._DBG_set_useExt=function(e){ume=e};en._DBG_set_checkOptions=function(e){i9=e};en._DBG_set_checkMethod=function(e){uS=e};en._DBG_clearHistory=function(){l9="",Tm=[]};en.setDefaultOptions=function(e){return n9=eo(!0,e),eo(!0)};en.question=function(e,t){return mme(eo(eo(!0,t),{display:e}))};en.prompt=function(e){var t=eo(!0,e);return t.display=t.prompt,mme(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 jC(s+"",dme)}),r.limit=c9(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=jC(r.display+"",function(s){return hme(s,r)}),gme(s9(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=jC(t.charlist?t.charlist+"":"$<!-~>",dme),(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("^["+c9(c)+"]{"+s+","+a+"}$"),r=Ame([c],n.caseSensitive,!0),r.text=pme(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 yme(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 yme(e,t,function(r){return parseInt(r,10)})};en.questionFloat=function(e,t){return yme(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=u9(n,!0),s="";function h(E){E.split(/\/|\\/).reduce(function(C,S){var x=Kd.resolve(C+=S+Kd.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):Kd.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(Kd.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 Eme(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=a9(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=a9(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=Eme(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=Eme(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 Rm?"$<cwd>>":(process.env.USER||"")+(process.env.HOSTNAME?"@"+process.env.HOSTNAME.replace(/\..*$/,""):"")+":$<cwdHome>$ "}()}))};function Ime(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 Ime(e,t)};en.keyInYNStrict=function(e,t){return Ime(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 zR};function fS(e,t){var r;return t.length&&(r={},r[e]=t[0]),en.setDefaultOptions(r)[e]}en.setPrint=function(){return fS("print",arguments)};en.setPrompt=function(){return fS("prompt",arguments)};en.setEncoding=function(){return fS("encoding",arguments)};en.setMask=function(){return fS("mask",arguments)};en.setBufferSize=function(){return fS("bufferSize",arguments)}});var f9=G((Dqt,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,Z){return Z===this.text.length||Z>this.text.length?"end_of_file":this.text.substring(Z,Z+z)},put:function(z,Z){return Z==="end_of_file"?(this.text+=z,!0):Z==="past_end_of_file"?null:(this.text=this.text.substring(0,Z)+z+this.text.substring(Z+z.length),!0)},get_byte:function(z){if(z==="end_of_stream")return-1;var Z=Math.floor(z/2);if(this.text.length<=Z)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,Z){var ee=Z==="end_of_stream"?this.text.length:Math.floor(Z/2);if(this.text.length<ee)return null;var se=this.text.length===ee?-1:n(this.text[Math.floor(Z/2)],0);return Z%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=Ce("fs"),z=F.openSync(w,y[0]);return y==="read"&&!F.existsSync(w)?null:{get:function(Z,ee){var se=new Buffer(Z);return F.readSync(z,se,0,Z,ee),se.toString()},put:function(Z,ee){var se=Buffer.from(Z);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(Z){return null},put_byte:function(Z,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=Cme();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,Z,ee,se,xe,Ne,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),Z=w.charAt(F+1);if(z===D&&Z===D)F++,y+=D;else if(z==="\\")if(["a","b","f","n","r","t","v","'",'"',"\\","a","\b","\f",`
`,"\r"," ","\v"].indexOf(Z)!==-1)switch(F+=1,Z){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 R={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 N(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,Z=[],ee=!1;if(w){var se=this.tokens[w-1];y=se.len,D=N(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=[],Ne=!1;if(/^\n/.exec(D)!==null){F++,z=0,y++,D=D.replace(/\n/,""),ee=!0;continue}for(var ut in R)if(R.hasOwnProperty(ut)){var Ct=R[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=Ne;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=Z[Z.length-1];ir&&(ir.space=!0),Ne=!0;continue;case"r_bracket":Z.length>0&&Z[Z.length-1].name==="l_bracket"&&(se=Z.pop(),se.name="atom",se.value="{}",se.raw="{}",se.space=!1);break;case"r_brace":Z.length>0&&Z[Z.length-1].name==="l_brace"&&(se=Z.pop(),se.name="atom",se.value="[]",se.raw="[]",se.space=!1);break}se.len=y,Z.push(se),Ne=!1}var Pt=this.set_last_tokens(Z);return Pt.length===0?null:Pt};function K(w,D,y,F,z){if(!D[y])return{type:f,value:P.error.syntax(D[y-1],"expression expected",!0)};var Z;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=K(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=K(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 Ne=$(w,D,y,z);return Ne.type===p||Ne.derived||(Ne=ie(w,D,y),Ne.type===p||Ne.derived)?Ne:{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=K(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};Z=Pt}else if(ir&&ir.indexOf("fx")>-1){var Pt=K(w,D,y,Ct,z);if(Pt.type!==f)return{value:new P.type.Term(ee.value,[Pt.value]),len:Pt.len,type:p};Z=Pt}}y=Yt;var Pt=K(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)},ke.prototype.clone=function(){return new ke(this.value,this.is_float)},_.prototype.clone=function(){return new _(this.id,s(this.args,function(w){return w.clone()}))},Fe.prototype.clone=function(){return new Stram(this.stream,this.mode,this.alias,this.type,this.reposition,this.eof_action)},Qe.prototype.clone=function(){var w={};for(var D in this.links)this.links.hasOwnProperty(D)&&(w[D]=this.links[D].clone());return new Qe(w)},Se.prototype.clone=function(){return new Se(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},ke.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},Fe.prototype.equals=function(w){return P.type.is_stream(w)&&this.id===w.id},Qe.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},Se.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)},ke.prototype.rename=function(w){return this},_.prototype.rename=function(w){return new _(this.id,s(this.args,function(D){return D.rename(w)}))},Fe.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]},ke.prototype.variables=function(){return[]},_.prototype.variables=function(){return[].concat.apply([],s(this.args,function(w){return w.variables()}))},Fe.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},ke.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(Z){return Z.apply(w)}),this.ref)},Fe.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)},Qe.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 Qe(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},Te.prototype.get_current_input=function(){return this.current_input},ct.prototype.get_current_input=function(){return this.session.get_current_input()},Te.prototype.get_current_output=function(){return this.current_output},ct.prototype.get_current_output=function(){return this.session.get_current_output()},Te.prototype.set_current_input=function(w){this.current_input=w},ct.prototype.set_current_input=function(w){return this.session.set_current_input(w)},Te.prototype.set_current_output=function(w){this.current_input=w},ct.prototype.set_current_output=function(w){return this.session.set_current_output(w)},Te.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)},Te.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)},Te.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)},Te.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=K(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 Se(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 Se(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],Z=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(Z)||Z.stream===null)w.throw_error(P.error.existence("stream",F,y.indicator));else if(Z.output)w.throw_error(P.error.permission("input","stream",F,y.indicator));else if(Z.type==="text")w.throw_error(P.error.permission("input","text_stream",F,y.indicator));else if(Z.position==="past_end_of_stream"&&Z.eof_action==="error")w.throw_error(P.error.permission("input","past_end_of_stream",F,y.indicator));else{var ee;if(Z.position==="end_of_stream")ee="end_of_file",Z.position="past_end_of_stream";else{if(ee=Z.stream.get_byte(Z.position),ee===null){w.throw_error(P.error.representation("byte",y.indicator));return}Z.position++}w.prepend([new Se(D.goal.replace(new _("=",[new ke(ee,!1),z])),D.substitution,D)])}},"peek_byte/1":function(w,D,y){var F=y.args[0];w.prepend([new Se(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],Z=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(Z)||Z.stream===null)w.throw_error(P.error.existence("stream",F,y.indicator));else if(Z.output)w.throw_error(P.error.permission("input","stream",F,y.indicator));else if(Z.type==="text")w.throw_error(P.error.permission("input","text_stream",F,y.indicator));else if(Z.position==="past_end_of_stream"&&Z.eof_action==="error")w.throw_error(P.error.permission("input","past_end_of_stream",F,y.indicator));else{var ee;if(Z.position==="end_of_stream")ee="end_of_file",Z.position="past_end_of_stream";else if(ee=Z.stream.get_byte(Z.position),ee===null){w.throw_error(P.error.representation("byte",y.indicator));return}w.prepend([new Se(D.goal.replace(new _("=",[new ke(ee,!1),z])),D.substitution,D)])}},"put_byte/1":function(w,D,y){var F=y.args[0];w.prepend([new Se(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],Z=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(Z)||Z.stream===null?w.throw_error(P.error.existence("stream",F,y.indicator)):Z.input?w.throw_error(P.error.permission("output","stream",F,y.indicator)):Z.type==="text"?w.throw_error(P.error.permission("output","text_stream",F,y.indicator)):Z.stream.put_byte(z.value,Z.position)&&(typeof Z.position=="number"&&Z.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 Se(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 Se(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 Se(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],Z=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(Z))w.throw_error(P.error.instantiation(y.indicator));else if(!P.type.is_list(Z))w.throw_error(P.error.type("list",Z,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(${zd(s)}).
`,t+=`workspace_ident(${zd(s)}, ${zd(H.stringifyIdent(r.anchoredLocator))}).
`,t+=`workspace_version(${zd(s)}, ${zd(r.manifest.version)}).
`;for(let a of Dme)for(let n of r.manifest[a].values())t+=`workspace_has_dependency(${zd(s)}, ${zd(H.stringifyIdent(n))}, ${zd(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 p9(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=lS([f,H.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=lS(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=Y.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=H.parseIdent(n);r.push({workspace:p,dependencyIdent:h,dependencyRange:c,dependencyType:f})}return qe.sortMap(r,[({dependencyRange:s})=>s!==null?"0":"1",({workspace:s})=>H.stringifyIdent(s.anchoredLocator),({dependencyIdent:s})=>H.stringifyIdent(s)])}async genEnforcedFields(t){let r=[];for await(let s of t.makeQuery("workspace(WorkspaceCwd), gen_enforced_field(WorkspaceCwd, FieldPath, FieldValue).")){let a=Y.resolve(this.project.cwd,Fm(s.links.WorkspaceCwd)),n=Fm(s.links.FieldPath),c=Fat(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})=>H.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 Ume=G(eF=>{"use strict";Object.defineProperty(eF,"__esModule",{value:!0});function PS(e){let t=[...e.caches],r=t.shift();return r===void 0?Mme():{get(s,a,n={miss:()=>Promise.resolve()}){return r.get(s,a,n).catch(()=>PS({caches:t}).get(s,a,n))},set(s,a){return r.set(s,a).catch(()=>PS({caches:t}).set(s,a))},delete(s){return r.delete(s).catch(()=>PS({caches:t}).delete(s))},clear(){return r.clear().catch(()=>PS({caches:t}).clear())}}}function Mme(){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()}}}eF.createFallbackableCache=PS;eF.createNullCache=Mme});var Hme=G((uVt,_me)=>{_me.exports=Ume()});var jme=G(P9=>{"use strict";Object.defineProperty(P9,"__esModule",{value:!0});function $at(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()}}}P9.createInMemoryCache=$at});var qme=G((AVt,Gme)=>{Gme.exports=jme()});var Wme=G(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});function elt(e,t,r){let s={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers(){return e===x9.WithinHeaders?s:{}},queryParameters(){return e===x9.WithinQueryParameters?s:{}}}}function tlt(e){let t=0,r=()=>(t++,new Promise(s=>{setTimeout(()=>{s(e(r))},Math.min(100*t,1e3))}));return e(r)}function Yme(e,t=(r,s)=>Promise.resolve()){return Object.assign(e,{wait(r){return Yme(e.then(s=>Promise.all([t(s,r),s])).then(s=>s[1]))}})}function rlt(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 nlt(e,t){return t&&Object.keys(t).forEach(r=>{e[r]=t[r](e)}),e}function ilt(e,...t){let r=0;return e.replace(/%s/g,()=>encodeURIComponent(t[r++]))}var slt="4.22.1",olt=e=>()=>e.transporter.requester.destroy(),x9={WithinQueryParameters:0,WithinHeaders:1};rf.AuthMode=x9;rf.addMethods=nlt;rf.createAuth=elt;rf.createRetryablePromise=tlt;rf.createWaitablePromise=Yme;rf.destroy=olt;rf.encode=ilt;rf.shuffle=rlt;rf.version=slt});var xS=G((hVt,Vme)=>{Vme.exports=Wme()});var Kme=G(k9=>{"use strict";Object.defineProperty(k9,"__esModule",{value:!0});var alt={Delete:"DELETE",Get:"GET",Post:"POST",Put:"PUT"};k9.MethodEnum=alt});var kS=G((gVt,Jme)=>{Jme.exports=Kme()});var uye=G(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});var Zme=kS();function Q9(e,t){let r=e||{},s=r.data||{};return Object.keys(r).forEach(a=>{["timeout","head Line truncated
`;f!==s&&(s=f,e.write(aIe.default.eraseLines(r)+f),r=f.split(`
`).length)};return n.clear=()=>{e.write(aIe.default.eraseLines(r)),s="",r=0},n.done=()=>{s="",r=0,t||(lIe.default.show(),a=!1)},n};jS.default={create:tft}});var fIe=G((i7t,rft)=>{rft.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 hIe=G(ic=>{"use strict";var pIe=fIe(),pA=process.env;Object.defineProperty(ic,"_vendors",{value:pIe.map(function(e){return e.constant})});ic.name=null;ic.isPR=null;pIe.forEach(function(e){var t=Array.isArray(e.env)?e.env:[e.env],r=t.every(function(s){return AIe(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=AIe(e.pr);break;default:ic.isPR=null}});ic.isCI=!!(pA.CI||pA.CONTINUOUS_INTEGRATION||pA.BUILD_NUMBER||pA.RUN_ID||ic.name);function AIe(e){return typeof e=="string"?!!pA[e]:Object.keys(e).every(function(t){return pA[t]===e[t]})}});var gIe=G((o7t,dIe)=>{"use strict";dIe.exports=hIe().isCI});var yIe=G((a7t,mIe)=>{"use strict";var nft=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};mIe.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 nft(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 vIe=G(zn=>{"use strict";var fw,YS,IF,gq;typeof performance=="object"&&typeof performance.now=="function"?(EIe=performance,zn.unstable_now=function(){return EIe.now()}):(uq=Date,IIe=uq.now(),zn.unstable_now=function(){return uq.now()-IIe});var EIe,uq,IIe;typeof window>"u"||typeof MessageChannel!="function"?(uw=null,fq=null,Aq=function(){if(uw!==null)try{var e=zn.unstable_now();uw(!0,e),uw=null}catch(t){throw setTimeout(Aq,0),t}},fw=function(e){uw!==null?setTimeout(fw,0,e):(uw=e,setTimeout(Aq,0))},YS=function(e,t){fq=setTimeout(e,t)},IF=function(){clearTimeout(fq)},zn.unstable_shouldYield=function(){return!1},gq=zn.unstable_forceFrameRate=function(){}):(CIe=window.setTimeout,wIe=window.clearTimeout,typeof console<"u"&&(BIe=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 BIe!="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")),GS=!1,qS=null,mF=-1,pq=5,hq=0,zn.unstable_shouldYield=function(){return zn.unstable_now()>=hq},gq=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"):pq=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 j=ht}Reflect.construct(v,[],b)}else{try{b.call()}catch(ht){j=ht}v.call(b.prototype)}else{try{throw Error()}catch(ht){j=ht}v()}}catch(ht){if(ht&&j&&typeof ht.stack=="string"){for(var V=ht.stack.split(`
`),ne=j.stack.split(`
`),Be=V.length-1,_e=ne.length-1;1<=Be&&0<=_e&&V[Be]!==ne[_e];)_e--;for(;1<=Be&&0<=_e;Be--,_e--)if(V[Be]!==ne[_e]){if(Be!==1||_e!==1)do if(Be--,_e--,0>_e||V[Be]!==ne[_e])return`
`+V[Be].replace(" at new "," at ");while(1<=Be&&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 Rt(v){0>Oi||(v.current=uc[Oi],uc[Oi]=null,Oi--)}function Tn(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 j=v.stateNode;if(j&&j.__reactInternalMemoizedUnmaskedChildContext===b)return j.__reactInternalMemoizedMaskedChildContext;var V={},ne;for(ne in Q)V[ne]=b[ne];return j&&(v=v.stateNode,v.__reactInternalMemoizedUnmaskedChildContext=b,v.__reactInternalMemoizedMaskedChildContext=V),V}function Xn(v){return v=v.childContextTypes,v!=null}function fu(){Rt(Li),Rt(Gi)}function Eh(v,b,Q){if(Gi.current!==ha)throw Error(c(168));Tn(Gi,b),Tn(Li,Q)}function Wa(v,b,Q){var j=v.stateNode;if(v=b.childContextTypes,typeof j.getChildContext!="function")return Q;j=j.getChildContext();for(var V in j)if(!(V in v))throw Error(c(108,d(b)||"Unknown",V));return s({},Q,j)}function Va(v){return v=(v=v.stateNode)&&v.__reactInternalMemoizedMergedChildContext||ha,Ya=Gi.current,Tn(Gi,v),Tn(Li,Li.current),!0}function Ka(v,b,Q){var j=v.stateNode;if(!j)throw Error(c(169));Q?(v=Wa(v,b,Ya),j.__reactInternalMemoizedMergedChildContext=v,Rt(Li),Rt(Gi),Tn(Gi,v)):Rt(Li),Tn(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 j=0,V=0,ne=v.expiredLanes,Be=v.suspendedLanes,_e=v.pingedLanes;if(ne!==0)j=ne,V=Sn=15;else if(ne=Q&134217727,ne!==0){var ht=ne&~Be;ht!==0?(j=da(ht),V=Sn):(_e&=ne,_e!==0&&(j=da(_e),V=Sn))}else ne=Q&~Be,ne!==0?(j=da(ne),V=Sn):_e!==0&&(j=da(_e),V=Sn);if(j===0)return 0;if(j=31-ss(j),j=Q&((0>j?0:1<<j)<<1)-1,b!==0&&b!==j&&!(b&Be)){if(da(b),V<=Sn)return b;Sn=V}if(b=v.entangledLanes,b!==0)for(v=v.entanglements,b&=j;0<b;)Q=31-ss(b),V=1<<Q,j|=v[Q],b&=~V;return j}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=Rn(24&~b),v===0?Ut(10,b):v;case 10:return v=Rn(192&~b),v===0?Ut(8,b):v;case 8:return v=Rn(3584&~b),v===0&&(v=Rn(4186112&~b),v===0&&(v=512)),v;case 2:return b=Rn(805306368&~b),b===0&&(b=268435456),b}throw Error(c(358,v))}function Rn(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 j=b-1;v.suspendedLanes&=j,v.pingedLanes&=j,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 Za=n.unstable_runWithPriority,Mi=n.unstable_scheduleCallback,vs=n.unstable_cancelCallback,Tl=n.unstable_shouldYield,yf=n.unstable_requestPaint,hc=n.unstable_now,vi=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(){},Ee=null,Oe=null,mt=!1,Et=hc(),Dt=1e4>Et?hc:function(){return hc()-Et};function tr(){switch(vi()){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),Za(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)}Xa()}function Xa(){if(!mt&&Ee!==null){mt=!0;var v=0;try{var b=Ee;ui(99,function(){for(;v<b.length;v++){var Q=b[v];do Q=Q(!0);while(Q!==null)}}),Ee=null}catch(Q){throw Ee!==null&&(Ee=Ee.slice(v+1)),Mi(Fn,Nn),Q}finally{mt=!1}}}var By=f.ReactCurrentBatchConfig;function z1(v,b){return v===b&&(v!==0||1/v===1/b)||v!==v&&b!==b}var Qo=typeof Object.is=="function"?Object.is:z1,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),j=Object.keys(b);if(Q.length!==j.length)return!1;for(j=0;j<Q.length;j++)if(!vy.call(b,Q[j])||!Qo(v[Q[j]],b[Q[j]]))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:V}}function Kg(v,b){try{console.error(b.value)}catch(Q){setTimeout(function(){throw Q})}}var LL=typeof WeakMap=="function"?WeakMap:Map;function r2(v,b,Q){Q=Fl(-1,Q),Q.tag=3,Q.payload={element:null};var j=b.value;return Q.callback=function(){Wy||(Wy=!0,g2=j),Kg(v,b)},Q}function Jg(v,b,Q){Q=Fl(-1,Q),Q.tag=3;var j=v.type.getDerivedStateFromError;if(typeof j=="function"){var V=b.value;Q.payload=function(){return Kg(v,b),j(V)}}var ne=v.stateNode;return ne!==null&&typeof ne.componentDidCatch=="function"&&(Q.callback=function(){typeof j!="function"&&(mc===null?mc=new Set([this]):mc.add(this),Kg(v,b));var Be=b.stack;this.componentDidCatch(b.value,{componentStack:Be!==null?Be:""})}),Q}var ML=typeof WeakSet=="function"?WeakSet:Set;function n2(v){var b=v.ref;if(b!==null)if(typeof b=="function")try{b(null)}catch(Q){Tf(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,j=v.memoizedState;v=b.stateNode,b=v.getSnapshotBeforeUpdate(b.elementType===b.type?Q:To(b.type,Q),j),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 Rh(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 j=Q.destroy;Q.destroy=void 0,j!==void 0&&j()}Q=Q.next}while(Q!==b)}}function gP(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 j=v.create;v.destroy=j()}v=v.next}while(v!==b)}if(b=Q.updateQueue,b=b!==null?b.lastEffect:null,b!==null){v=b=b.next;do{var V=v;j=V.next,V=V.tag,V&4&&V&1&&(kP(Q,v),KL(Q,v)),v=j}while(v!==b)}return;case 1:v=Q.stateNode,Q.flags&4&&(b===null?v.componentDidMount():(j=Q.elementType===Q.type?b.memoizedProps:To(Q.type,b.memoizedProps),v.componentDidUpdate(j,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=ke(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:Z&&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 mP(v,b){if(F)for(var Q=v;;){if(Q.tag===5){var j=Q.stateNode;b?mh(j):co(Q.stateNode,Q.memoizedProps)}else if(Q.tag===6)j=Q.stateNode,b?yh(j):qn(j,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 j=Q,V=j.destroy;if(j=j.tag,V!==void 0)if(j&4)kP(b,Q);else{j=b;try{V()}catch(ne){Tf(j,ne)}}Q=Q.next}while(Q!==v)}break;case 1:if(n2(b),v=b.stateNode,typeof v.componentWillUnmount=="function")try{v.props=b.memoizedProps,v.state=b.memoizedState,v.componentWillUnmount()}catch(ne){Tf(b,ne)}break;case 5:n2(b);break;case 4:F?CP(v,b):z&&z&&(b=b.stateNode.containerInfo,v=ou(b),NA(b,v))}}function yP(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 EP(v){return v.tag===5||v.tag===3||v.tag===4}function IP(v){if(F){e:{for(var b=v.return;b!==null;){if(EP(b))break e;b=b.return}throw Error(c(160))}var Q=b;switch(b=Q.stateNode,Q.tag){case 5:var j=!1;break;case 3:b=b.containerInfo,j=!0;break;case 4:b=b.containerInfo,j=!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||EP(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}}j?i2(v,Q,b):s2(v,Q,b)}}function i2(v,b,Q){var j=v.tag,V=j===5||j===6;if(V)v=V?v.stateNode:v.stateNode.instance,b?lo(Q,v,b):Do(Q,v);else if(j!==4&&(v=v.child,v!==null))for(i2(v,b,Q),v=v.sibling;v!==null;)i2(v,b,Q),v=v.sibling}function s2(v,b,Q){var j=v.tag,V=j===5||j===6;if(V)v=V?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=Vg(ht,_e),Xt=Be;do{switch(Xt.tag){case 3:ne=ht,Xt.flags|=4096,b&=-b,Xt.lanes|=b;var ri=r2(Xt,ne,b);by(Xt,ri);break e;case 1:ne=ht;var Tr=Xt.type,On=Xt.stateNode;if(!(Xt.flags&64)&&(typeof Tr.getDerivedStateFromError=="function"||On!==null&&typeof On.componentDidCatch=="function"&&(mc===null||!mc.has(On)))){Xt.flags|=4096,b&=-b,Xt.lanes|=b;var jn=Jg(Xt,ne,b);by(Xt,jn);break e}}Xt=Xt.return}while(Xt!==null)}xP(Q)}catch(Zr){b=Zr,Zi===Q&&Q!==null&&(Zi=Q=Q.return);continue}break}while(!0)}function DP(){var v=qy.current;return qy.current=kt,v===null?kt:v}function s0(v,b){var Q=xr;xr|=16;var j=DP();po===v&&Ms===b||Lh(v,b);do try{qL();break}catch(V){bP(v,V)}while(!0);if(Ng(),xr=Q,qy.current=j,Zi!==null)throw Error(c(261));return po=null,Ms=0,bs}function qL(){for(;Zi!==null;)PP(Zi)}function YL(){for(;Zi!==null&&!Tl();)PP(Zi)}function PP(v){var b=RP(v.alternate,v,tp);v.memoizedProps=v.pendingProps,b===null?xP(v):Zi=b,c2.current=null}function xP(v){var b=v;do{var Q=b.alternate;if(v=b.return,b.flags&2048){if(Q=OL(b),Q!==null){Q.flags&=2047,Zi=Q;return}v!==null&&(v.firstEffect=v.lastEffect=null,v.flags|=2048)}else{if(Q=NL(Q,b,tp),Q!==null){Zi=Q;return}if(Q=b,Q.tag!==24&&Q.tag!==23||Q.memoizedState===null||tp&1073741824||!(Q.mode&4)){for(var j=0,V=Q.child;V!==null;)j|=V.lanes|V.childLanes,V=V.sibling;Q.childLanes=j}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){Zi=b;return}Zi=b=v}while(b!==null);bs===0&&(bs=5)}function rp(v){var b=tr();return ui(99,WL.bind(null,v,b)),null}function WL(v,b){do Bu();while(e0!==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 j=Q.lanes|Q.childLanes,V=j,ne=v.pendingLanes&~V;v.pendingLanes=V,v.suspendedLanes=0,v.pingedLanes=0,v.expiredLanes&=V,v.mutableReadLanes&=V,v.entangledLanes&=V,V=v.entanglements;for(var Be=v.eventTimes,_e=v.expirationTimes;0<ne;){var ht=31-ss(ne),Wt=1<<ht;V[ht]=0,Be[ht]=-1,_e[ht]=-1,ne&=~Wt}if(Cu!==null&&!(j&24)&&Cu.has(v)&&Cu.delete(v),v===po&&(Zi=po=null,Ms=0),1<Q.flags?Q.lastEffect!==null?(Q.lastEffect.nextEffect=Q,j=Q.firstEffect):j=Q:j=Q.firstEffect,j!==null){V=xr,xr|=32,c2.current=null,n0=tt(v.containerInfo),i0=!1,sr=j;do try{VL()}catch(Ye){if(sr===null)throw Error(c(330));Tf(sr,Ye),sr=sr.nextEffect}while(sr!==null);n0=null,sr=j;do try{for(Be=v;sr!==null;){var Sr=sr.flags;if(Sr&16&&F&&df(sr.stateNode),Sr&128){var Mr=sr.alternate;if(Mr!==null){var Xt=Mr.ref;Xt!==null&&(typeof Xt=="function"?Xt(null):Xt.current=null)}}switch(Sr&1038){case 2:IP(sr),sr.flags&=-3;break;case 6:IP(sr),sr.flags&=-3,o2(sr.alternate,sr);break;case 1024:sr.flags&=-1025;break;case 1028:sr.flags&=-1025,o2(sr.alternate,sr);break;case 4:o2(sr.alternate,sr);break;case 8:_e=Be,ne=sr,F?CP(_e,ne):yP(_e,ne);var $n=ne.alternate;Ly(ne),$n!==null&&Ly($n)}sr=sr.nextEffect}}catch(Ye){if(sr===null)throw Error(c(330));Tf(sr,Ye),sr=sr.nextEffect}while(sr!==null);i0&&ut(),Fe(v.containerInfo),v.current=Q,sr=j;do try{for(Sr=v;sr!==null;){var Ei=sr.flags;if(Ei&36&&gP(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=ke(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));Tf(sr,Ye),sr=sr.nextEffect}while(sr!==null);sr=null,te(),xr=V}else v.current=Q;if(Qf)Qf=!1,e0=v,t0=b;else for(sr=j;sr!==null;)b=sr.nextEffect,sr.nextEffect=null,sr.flags&8&&(Ei=sr,Ei.sibling=null,Ei.stateNode=null),sr=b;if(j=v.pendingLanes,j===0&&(mc=null),j===1?v===E2?r0++:(r0=0,E2=v):r0=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=g2,g2=null,v;return xr&8||Nn(),null}function VL(){for(;sr!==null;){var v=sr.alternate;i0||n0===null||(sr.flags&8?be(sr,n0)&&(i0=!0,Ne()):sr.tag===13&&UL(v,sr)&&be(sr,n0)&&(i0=!0,Ne()));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(t0!==90){var v=97<t0?97:t0;return t0=90,ui(v,JL)}return!1}function KL(v,b){m2.push(b,v),Qf||(Qf=!0,qi(97,function(){return Bu(),null}))}function kP(v,b){y2.push(b,v),Qf||(Qf=!0,qi(97,function(){return Bu(),null}))}function JL(){if(e0===null)return!1;var v=e0;if(e0=null,xr&48)throw Error(c(331));var b=xr;xr|=32;var Q=y2;y2=[];for(var j=0;j<Q.length;j+=2){var V=Q[j],ne=Q[j+1],Be=V.destroy;if(V.destroy=void 0,typeof Be=="function")try{Be()}catch(ht){if(ne===null)throw Error(c(330));Tf(ne,ht)}}for(Q=m2,m2=[],j=0;j<Q.length;j+=2){V=Q[j],ne=Q[j+1];try{va Line truncated
`+(j.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 ke(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:eM,findFiberByHostInstance:v.findFiberByHostInstance||tM,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,j){if(!Yt)throw Error(c(363));v=l2(v,b);var V=on(v,Q,j).disconnect;return{disconnect:function(){V()}}},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,j){var V=b.current,ne=Lo(),Be=Ds(V);e:if(Q){Q=Q._reactInternals;t:{if(ve(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(Xn(_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(Xn(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,Be),b.payload={element:v},j=j===void 0?null:j,j!==null&&(b.callback=j),Nl(V,b),_l(V,Be,ne),Be},r}});var PIe=G((f7t,DIe)=>{"use strict";DIe.exports=bIe()});var kIe=G((A7t,xIe)=>{"use strict";var oft={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};xIe.exports=oft});var FIe=G((p7t,RIe)=>{"use strict";var aft=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},BF=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 wq(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var sf=kIe(),lft=function(){function e(t,r,s,a,n,c){Bq(this,e),this.left=t,this.right=r,this.top=s,this.bottom=a,this.width=n,this.height=c}return BF(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}(),QIe=function(){BF(e,null,[{key:"fromJS",value:function(r){var s=r.width,a=r.height;return new e(s,a)}}]);function e(t,r){Bq(this,e),this.width=t,this.height=r}return BF(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((d7t,OIe)=>{"use strict";var cft=FIe(),uft=NIe(),vq=!1,Sq=null;uft({},function(e,t){if(!vq){if(vq=!0,e)throw e;Sq=t}});if(!vq)throw new Error("Failed to load the yoga module - it needed to be loaded synchronously, but didn't");OIe.exports=cft(Sq.bind,Sq.lib)});var Dq=G((g7t,bq)=>{"use strict";var LIe=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);bq.exports=LIe;bq.exports.default=LIe});var UIe=G((m7t,MIe)=>{"use strict";MIe.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,hft(r));return t};xq.exports=HIe;xq.exports.default=HIe});var jIe=G(JS=>{"use strict";var dft=JS&&JS.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(JS,"__esModule",{value:!0});var gft=dft(kq()),Qq={};JS.default=e=>{if(e.length===0)return{width:0,height:0};if(Qq[e])return Qq[e];let t=gft.default(e),r=e.split(`
`).length;return Qq[e]={width:t,height:r},{width:t,height:r}}});var GIe=G(zS=>{"use strict";var mft=zS&&zS.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(zS,"__esModule",{value:!0});var kn=mft(_m()),yft=(e,t)=>{"position"in t&&e.setPositionType(t.position==="absolute"?kn.default.POSITION_TYPE_ABSOLUTE:kn.default.POSITION_TYPE_RELATIVE)},Eft=(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)},Ift=(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)},Cft=(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))},wft=(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))},Bft=(e,t)=>{"display"in t&&e.setDisplay(t.display==="flex"?kn.default.DISPLAY_FLEX:kn.default.DISPLAY_NONE)},vft=(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)}};zS.default=(e,t={})=>{yft(e,t),Eft(e,t),Ift(e,t),Cft(e,t),wft(e,t),Bft(e,t),vft(e,t)}});var WIe=G((w7t,YIe)=>{"use strict";var ZS=KS(),Sft=Ik(),bft=ck(),Rq=new Set(["\x1B","\x9B"]),Dft=39,qIe=e=>`${Rq.values().next().value}[${e}m`,Pft=e=>e.split(" ").map(t=>ZS(t)),Tq=(e,t,r)=>{let s=[...t],a=!1,n=ZS(Sft(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),Rq.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())},xft=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("")},kft=(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(""),Tq(f,h,t);continue}if(E+c[p]>t&&E>0&&c[p]>0){if(r.wordWrap===!1&&E<t){Tq(f,h,t);continue}f.push("")}if(E+c[p]>t&&r.wordWrap===!1){Tq(f,h,t);continue}f[f. Line truncated
`);for(let[p,h]of[...s].entries()){if(a+=h,Rq.has(h)){let C=parseFloat(/\d[^m]*/.exec(s.slice(p,p+4)));n=C===Dft?null:C}let E=bft.codes.get(Number(n));n&&E&&(s[p+1]===`
`?a+=qIe(E):h===`
`&&(a+=qIe(n)))}return a};YIe.exports=(e,t,r)=>String(e).normalize().replace(/\r\n/g,`
`).split(`
`).map(s=>kft(s,t,r)).join(`
`)});var JIe=G((B7t,KIe)=>{"use strict";var VIe="[\uD800-\uDBFF][\uDC00-\uDFFF]",Qft=e=>e&&e.exact?new RegExp(`^${VIe}$`):new RegExp(VIe,"g");KIe.exports=Qft});var Fq=G((v7t,$Ie)=>{"use strict";var Tft=Dq(),Rft=JIe(),zIe=ck(),XIe=["\x1B","\x9B"],vF=e=>`${XIe[0]}[${e}m`,ZIe=(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=zIe.codes.get(parseInt(a,10));if(c){let f=e.indexOf(c.toString());f>=0?e.splice(f,1):s.push(vF(t?c:n))}else if(t){s.push(vF(0));break}else s.push(vF(n))}if(t&&(s=s.filter((a,n)=>s.indexOf(a)===n),r!==void 0)){let a=vF(zIe.codes.get(parseInt(r,10)));s=s.reduce((n,c)=>c===a?[c,...n]:[...n,c],[])}return s.join("")};$Ie.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(XIe.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,!Rft({exact:!0}).test(E)&&Tft(E.codePointAt())&&++f,f>t&&f<=r)p+=E;else if(f===t&&!n&&c!==void 0)p=ZIe(a);else if(f>=r){p+=ZIe(a,!0,c);break}}return p}});var tCe=G((S7t,eCe)=>{"use strict";var eg=Fq(),Fft=KS();function SF(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}eCe.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=Fft(e);if(p<=t)return e;if(s==="start"){if(n){let h=SF(e,p-t+1,!0);return c+eg(e,h,p).trim()}return a===!0&&(c+=" ",f=2),c+eg(e,p-t+f,p)}if(s==="middle"){a===!0&&(c=" "+c+" ",f=3);let h=Math.floor(t/2);if(n){let E=SF(e,h),C=SF(e,p-(t-h)+1,!0);return eg(e,0,E)+c+eg(e,C,p).trim()}return eg(e,0,h)+c+eg(e,p-(t-h)+f,p)}if(s==="end"){if(n){let h=SF(e,t-1);return eg(e,0,h)+c}return a===!0&&(c=" "+c,f=2),eg(e,0,t-f)+c}throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${s}`)}});var Oq=G(XS=>{"use strict";var rCe=XS&&XS.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(XS,"__esModule",{value:!0});var Nft=rCe(WIe()),Oft=rCe(tCe()),Nq={};XS.default=(e,t,r)=>{let s=e+String(t)+String(r);if(Nq[s])return Nq[s];let a=e;if(r==="wrap"&&(a=Nft.default(e,t,{trim:!1,hard:!0})),r.startsWith("truncate")){let n="end";r==="truncate-middle"&&(n="middle"),r==="truncate-start"&&(n="start"),a=Oft.default(e,t,{position:n})}return Nq[s]=a,a}});var Mq=G(Lq=>{"use strict";Object.defineProperty(Lq,"__esModule",{value:!0});var nCe=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=nCe(r)),s.length>0&&typeof r.internal_transform=="function"&&(s=r.internal_transform(s))),t+=s}return t};Lq.default=nCe});var Uq=G(Pi=>{"use strict";var $S=Pi&&Pi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.setTextNodeValue=Pi.createTextNode=Pi.setStyle=Pi.setAttribute=Pi.removeChildNode=Pi.insertBeforeNode=Pi.appendChildNode=Pi.createNode=Pi.TEXT_NAME=void 0;var Lft=$S(_m()),iCe=$S(jIe()),Mft=$S(GIe()),Uft=$S(Oq()),_ft=$S(Mq());Pi.TEXT_NAME="#text";Pi.createNode=e=>{var t;let r={nodeName:e,style:{},attributes:{},childNodes:[],parentNode:null,yogaNode:e==="ink-virtual-text"?void 0:Lft.default.Node.create()};return e==="ink-text"&&((t=r.yogaNode)===null||t===void 0||t.setMeasureFunc(Hft.bind(null,r))),r};Pi.appendChildNode=(e,t)=>{var r;t.parentNode&&Pi.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")&&bF(e)};Pi.insertBeforeNode=(e,t,r)=>{var s,a;t.parentNode&&Pi.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")&&bF(e)};Pi.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")&&bF(e)};Pi.setAttribute=(e,t,r)=>{e.attributes[t]=r};Pi.setStyle=(e,t)=>{e.style=t,e.yogaNode&&Mft.default(e.yogaNode,t)};Pi.createTextNode=e=>{let t={nodeName:"#text",nodeValue:e,yogaLine truncated
`).repeat(n-2),E=jq.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 ICe=G(sb=>{"use strict";var Hm=sb&&sb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sb,"__esModule",{value:!0});var Jft=Hm(_m()),zft=Hm(kq()),Zft=Hm(ACe()),Xft=Hm(Oq()),$ft=Hm(pCe()),eAt=Hm(Mq()),tAt=Hm(yCe()),rAt=(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)+Zft.default(t,a)}return t},ECe=(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()===Jft.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=eAt.default(e);if(S.length>0){let x=zft.default(S),I=$ft.default(p);if(x>I){let R=(s=e.style.textWrap)!==null&&s!==void 0?s:"wrap";S=Xft.default(S,I,R)}S=rAt(e,S),t.write(h,E,S,{transformers:C})}return}if(e.nodeName==="ink-box"&&tAt.default(h,E,e,t),e.nodeName==="ink-root"||e.nodeName==="ink-box")for(let S of e.childNodes)ECe(S,t,{offsetX:h,offsetY:E,transformers:C,skipStaticElements:f})}};sb.default=ECe});var BCe=G(ob=>{"use strict";var wCe=ob&&ob.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ob,"__esModule",{value:!0});var CCe=wCe(Fq()),nAt=wCe(KS()),Gq=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=nAt.default(E);for(let x of f)E=x(E);t[n+h]=CCe.default(C,0,a)+E+CCe.default(C,a+S),h++}}return{output:t.map(s=>s.trimRight()).join(`
`),height:t.length}}};ob.default=Gq});var bCe=G(ab=>{"use strict";var qq=ab&&ab.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ab,"__esModule",{value:!0});var iAt=qq(_m()),vCe=qq(ICe()),SCe=qq(BCe());ab.default=(e,t)=>{var r;if(e.yogaNode.setWidth(t),e.yogaNode){e.yogaNode.calculateLayout(void 0,void 0,iAt.default.DIRECTION_LTR);let s=new SCe.default({width:e.yogaNode.getComputedWidth(),height:e.yogaNode.getComputedHeight()});vCe.default(e,s,{skipStaticElements:!0});let a;!((r=e.staticNode)===null||r===void 0)&&r.yogaNode&&(a=new SCe.default({width:e.staticNode.yogaNode.getComputedWidth(),height:e.staticNode.yogaNode.getComputedHeight()}),vCe.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 kCe=G((U7t,xCe)=>{"use strict";var DCe=Ce("stream"),PCe=["assert","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],Yq={},sAt=e=>{let t=new DCe.PassThrough,r=new DCe.PassThrough;t.write=a=>e("stdout",a),r.write=a=>e("stderr",a);let s=new console.Console(t,r);for(let a of PCe)Yq[a]=console[a],console[a]=s[a];return()=>{for(let a of PCe)console[a]=Yq[a];Yq={}}};xCe.exports=sAt});var Vq=G(Wq=>{"use strict";Object.defineProperty(Wq,"__esModule",{value:!0});Wq.default=new WeakMap});var Jq=G(Kq=>{"use strict";Object.defineProperty(Kq,"__esModule",{value:!0});var oAt=dn(),QCe=oAt.createContext({exit:()=>{}});QCe.displayName="InternalAppContext";Kq.default=QCe});var Zq=G(zq=>{"use strict";Object.defineProperty(zq,"__esModule",{value:!0});var aAt=dn(),TCe=aAt.createContext({stdin:void 0,setRawMode:()=>{},isRawModeSupported:!1,internal_exitOnCtrlC:!0});TCe.displayName="InternalStdinContext";zq.default=TCe});var $q=G(Xq=>{"use strict";Object.defineProperty(Xq,"__esModule",{value:!0});var lAt=dn(),RCe=lAt.createContext({stdout:void 0,write:()=>{}});RCe.displayName="InternalStdoutContext";Xq.default=RCe});var tY=G(eY=>{"use strict";Object.defineProperty(eY,"__esModule",{value:!0});var cAt=dn(),FCe=cAt.createContext({stderr:void 0,write:()=>{}});FCe.displayName="InternalStderrContext";eY.default=FCe});var xF=G(rY=>{"use strict";Object.defineProperty(rY,"__esModule",{value:!0});var uAt=dn(),NCe=uAt.createContext({activeId:void 0,add:()=>{},remove:()=>{},activate:()=>{},deactivate:()=>{},enableFocus:()=>{},disableFocus:()=>{},focusNext:()=>{},focusPrevious:()=>{},focus:()=>{}});NCe.displayName="InternalFocusContext";rY.default=NCe});var LCe=G((W7t,OCe)=>{"use strict";var fAt=/[|\\{}()[\]^$+*?.-]/g;OCe.exports=e=>{if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(fAt,"\\$&")}});var HCe=G((V7t,_Ce)=>{"use strict";var AAt=LCe(),pAt=typeof process=="object"&&process&&typeof process.cwd=="function"?process.cwd():".",UCe=[].concat(Ce("module").builtinModules,"bootstrap_node","node").map(e=>new RegExp(`(?:\\((?:node:)?${e}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${e}(?:\\.js)?:\\d+:\\d+$)`));UCe.push(/\((?:node:)?internal\/[^:]+:\d+:\d+\)$/,/\s*at (?:node:)?internal\/[^:]+:\d+:\d+$/,/\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/);var nY=class e{constructor(t){t={ignoredPackages:[],...t},"internals"in t||(t.internals=e.nodeInternals()),"cwd"in t||(t.cwd=pAt),this._cwd=t.cwd.replace(/\\/g,"/"),this._internals=[].concat(t.internals,hAt(t.ignoredPackages)),this._wrapCallSite=t.wrapCallSite||!1}static nodeInternals(){return[...UCe]}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()};MCe(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(dAt);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,R={};if(E&&(R.line=Number(E)),C&&(R.column=Number(C)),x&&h){let N=0;for(let U=h.length-1;U>0;U--)if(h.charAt(U)===")")N++;else if(h.charAt(U)==="("&&h.charAt(U-1)===" "&&(N--,N===-1&&h.charAt(U-1)===" ")){let K=h.slice(0,U-1);h=h.slice(U+1),a+=` (${K}`;break}}if(a){let N=a.match(gAt);N&&(a=N[1],I=N[2])}return MCe(R,h,this._cwd),s&&(R.constructor=!0),n&&(R.evalOrigin=n,R.evalLine=f,R.evalColumn=p,R.evalFile=c&&c.replace(/\\/g,"/")),S&&(R.native=!0),a&&(R.function=a),I&&a!==I&&(R.method=I),R}};function MCe(e,t,r){t&&(t=t.replace(/\\/g,"/"),t.startsWith(`${r}/`)&&(t=t.slice(r.length+1)),e.file=t)}function hAt(e){if(e.length===0)return[];let t=e.map(r=>AAt(r));return new RegExp(`[/\\\\]node_modules[/\\\\](?:${t.join("|")})[/\\\\][^:]+:\\d+:\\d+`)}var dAt=new RegExp("^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"),gAt=/^(.*?) \[as (.*?)\]$/;_Ce.exports=nY});var GCe=G((K7t,jCe)=>{"use strict";jCe.exports=(e,t)=>e.replace(/^\t+/gm,r=>" ".repeat(r.length*(t||2)))});var YCe=G((J7t,qCe)=>{"use strict";var mAt=GCe(),yAt=(e,t)=>{let r=[],s=e-t,a=e+t;for(let n=s;n<=a;n++)r.push(n);return r};qCe.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=mAt(e).split(/\r?\n/),!(t>e.length))return r={around:3,...r},yAt(t,r.around).filter(s=>e[s-1]!==void 0).map(s=>({line:s,value:e[s-1]}))}});var kF=G(of=>{"use strict";var EAt=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]}),IAt=of&&of.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),CAt=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)&&EAt(t,e,r);return IAt(t,e),t},wAt=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 WCe=CAt(dn()),iY=WCe.forwardRef((e,t)=>{var{children:r}=e,s=wAt(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 WCe.default.createElement("ink-box",{ref:t,style:a},r)});iY.displayName="Box";iY.defaultProps={flexDirection:"row",flexGrow:0,flexShrink:1};of.default=iY});var aY=G(lb=>{"use strict";var sY=lb&&lb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lb,"__esModule",{value:!0});var BAt=sY(dn()),Aw=sY(LE()),VCe=sY(Hq()),oY=({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=Aw.default.dim(C)),e&&(C=VCe.default(C,e,"foreground")),t&&(C=VCe.default(C,t,"background")),s&&(C=Aw.default.bold(C)),a&&(C=Aw.default.italic(C)),n&&(C=Aw.default.underline(C)),c&&(C=Aw.default.strikethrough(C)),f&&(C=Aw.default.inverse(C)),C);return BAt.default.createElement("ink-text",{style:{flexGrow:0,flexSLine truncated
`).slice(1):void 0,r=t?zCe.parseLine(t[0]):void 0,s,a=0;if(r?.file&&r?.line&&KCe.existsSync(r.file)){let n=KCe.readFileSync(r.file,"utf8");if(s=DAt.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=zCe.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 $Ce=G(lf=>{"use strict";var xAt=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]}),kAt=lf&&lf.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),QAt=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)&&xAt(t,e,r);return kAt(t,e),t},Gm=lf&&lf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lf,"__esModule",{value:!0});var jm=QAt(dn()),XCe=Gm(cq()),TAt=Gm(Jq()),RAt=Gm(Zq()),FAt=Gm($q()),NAt=Gm(tY()),OAt=Gm(xF()),LAt=Gm(ZCe()),MAt=" ",UAt="\x1B[Z",_At="\x1B",QF=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===_At&&this.state.activeFocusId&&this.setState({activeFocusId:void 0}),this.state.isFocusEnabled&&this.state.focusables.length>0&&(t===MAt&&this.focusNext(),t===UAt&&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(TAt.default.Provider,{value:{exit:this.handleExit}},jm.default.createElement(RAt.default.Provider,{value:{stdin:this.props.stdin,setRawMode:this.handleSetRawMode,isRawModeSupported:this.isRawModeSupported(),internal_exitOnCtrlC:this.props.exitOnCtrlC}},jm.default.createElement(FAt.default.Provider,{value:{stdout:this.props.stdout,write:this.props.writeToStdout}},jm.default.createElement(NAt.default.Provider,{value:{stderr:this.props.stderr,write:this.props.writeToStderr}},jm.default.createElement(OAt.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(LAt.default,{error:this.state.error}):this.props.children)))))}componentDidMount(){XCe.default.hide(this.props.stdout)}componentWillUnmount(){XCe.default.show(this.props.stdout),this.isRawModeSupported()&&this.handleSetRawMode(!1)}componentDidCatch(t){this.handleExit(t)}};lf.default=QF;QF.displayName="InternalApp"});var rwe=G(cf=>{"use strict";var HAt=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]}),jAt=cf&&cf.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),GAt=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)&&HAt(t,e,r);return jAt(t,e),t},uf=cf&&cf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cf,"__esModule",{value:!0});var qAt=uf(dn()),ewe=KEe(),YAt=uf(uIe()),WAt=uf(iq()),VAt=uf(gIe()),KAt=uf(yIe()),lY=uf(uCe()),JAt=uf(bCe()),zAt=uf(lq()),ZAt=uf(kCe()),XAt=GAt(Uq()),$At=uf(Vq()),ept=uf($Ce()),pw=process.env.CI==="false"?!1:VAt.default,twe=()=>{},cY=class{constructor(t){this.resolveExitPromise=()=>{},this.rejectExitPromise=()=>{},this.unsubscribeExit=()=>{},this.onRender=()=>{if(this.isUnmounted)return;let{output:r,outputHeight:s,staticOutput:a}=JAt.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(pw){n&&this.options.stdout.write(a),this.lastOutput=r;return}if(n&&(this.fullStaticOutput+=a),s>=this.options.stdout.rows){this.options.stdout.write(WAt.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},KAt.default(this),this.options=t,this.rootNode=XAt.createNode("ink-root"),this.rootNode.onRender=t.debug?this.onRender:ewe(this.onRender,32,{leading:!0,trailing:!0}),this.rootNode.onImmediateRender=this.onRender,this.log=YAt.default.create(t.stdout),this.throttledLog=t.debug?this.log:ewe(this.log,void 0,{leading:!0,trailing:!0}),this.isUnmounted=!1,this.lastOutput="",this.fullStaticOutput="",this.container=lY.default.createContainer(this.rootNode,0,!1,null),this.unsubscribeExit=zAt.default(this.unmount,{alwaysLast:!1}),t.patchConsole&&this.patchConsole(),pw||(t.stdout.on("resize",this.onRender),this.unsubscribeResize=()=>{t.stdout.off("resize",this.onRender)})}render(t){let r=qAt.default.createElement(ept.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);lY.default.updateContainer(r,this.container,null,twe)}writeToStdout(t){if(!this.isUnmounted){if(this.options.debug){this.options.stdout.write(t+this.fullStaticOutput+this.lastOutput);return}if(pw){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(pw){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(),pw?this.options.stdout.write(this.lastOutput+`
`):this.options.debug||this.log.done(),this.isUnmounted=!0,lY.default.updateContainer(null,this.container,null,twe),$At.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(){!pw&&!this.options.debug&&this.log.clear()}patchConsole(){this.options.debug||(this.restoreConsole=ZAt.default((t,r)=>{t==="stdout"&&this.writeToStdout(r),t==="stderr"&&(r.startsWith("The above error occurred")||this.writeToStderr(r))}))}};cf.default=cY});var iwe=G(fb=>{"use strict";var nwe=fb&&fb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fb,"__esModule",{value:!0});var tpt=nwe(rwe()),TF=nwe(Vq()),rpt=Ce("stream"),npt=(e,t)=>{let r=Object.assign({stdout:process.stdout,stdin:process.stdin,stderr:process.stderr,debug:!1,exitOnCtrlC:!0,patchConsole:!0},ipt(t)),s=spt(r.stdout,()=>new tpt.default(r));return s.render(e),{rerender:s.render,unmount:()=>s.unmount(),waitUntilExit:s.waitUntilExit,cleanup:()=>TF.default.delete(r.stdout),clear:s.clear}};fb.default=npt;var ipt=(e={})=>e instanceof rpt.Stream?{stdout:e,stdin:process.stdin}:e,spt=(e,t)=>{let r;return TF.default.has(e)?r=TF.default.get(e):(r=t(),TF.default.set(e,r)),r}});var owe=G(rh=>{"use strict";var opt=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]}),apt=rh&&rh.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),lpt=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)&&opt(t,e,r);return apt(t,e),t};Object.defineProperty(rh,"__esModule",{value:!0});var Ab=lpt(dn()),swe=e=>{let{items:t,children:r,style:s}=e,[a,n]=Ab.useState(0),c=Ab.useMemo(()=>t.slice(a),[t,a]);Ab.useLayoutEffect(()=>{n(t.length)},[t.length]);let f=c.map((h,E)=>r(h,a+E)),p=Ab.useMemo(()=>Object.assign({position:"absolute",flexDirection:"column"},s),[s]);return Ab.default.createElement("ink-box",{internal_static:!0,style:p},f)};swe.displayName="Static";rh.default=swe});var lwe=G(pb=>{"use strict";var cpt=pb&&pb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pb,"__esModule",{value:!0});var upt=cpt(dn()),awe=({children:e,transform:t})=>e==null?null:upt.default.createElement("ink-text",{style:{flexGrow:0,flexShrink:1,flexDirection:"row"},internal_transform:t},e);awe.displayName="Transform";pb.default=awe});var uwe=G(hb=>{"use strict";var fpt=hb&&hb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hb,"__esModule",{value:!0});var Apt=fpt(dn()),cwe=({count:e=1})=>Apt.default.createElement("ink-text",null,`
`.repeat(e));cwe.displayName="Newline";hb.default=cwe});var pwe=G(db=>{"use strict";var fwe=db&&db.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(db,"__esModule",{value:!0});var ppt=fwe(dn()),hpt=fwe(kF()),Awe=()=>ppt.default.createElement(hpt.default,{flexGrow:1});Awe.displayName="Spacer";db.default=Awe});var RF=G(gb=>{"use strict";var dpt=gb&&gb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gb,"__esModule",{value:!0});var gpt=dn(),mpt=dpt(Zq()),ypt=()=>gpt.useContext(mpt.default);gb.default=ypt});var dwe=G(mb=>{"use strict";var Ept=mb&&mb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mb,"__esModule",{value:!0});var hwe=dn(),Ipt=Ept(RF()),Cpt=(e,t={})=>{let{stdin:r,setRawMode:s,internal_exitOnCtrlC:a}=Ipt.default();hwe.useEffect(()=>{if(t.isActive!==!1)return s(!0),()=>{s(!1)}},[t.isActive,s]),hwe.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])};mb.default=Cpt});var gwe=G(yb=>{"use strict";var wpt=yb&&yb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(yb,"__esModule",{value:!0});var Bpt=dn(),vpt=wpt(Jq()),Spt=()=>Bpt.useContext(vpt.default);yb.default=Spt});var mwe=G(Eb=>{"use strict";var bpt=Eb&&Eb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Eb,"__esModule",{value:!0});var Dpt=dn(),Ppt=bpt($q()),xpt=()=>Dpt.useContext(Ppt.default);Eb.default=xpt});var ywe=G(Ib=>{"use strict";var kpt=Ib&&Ib.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ib,"__esModule",{value:!0});var Qpt=dn(),Tpt=kpt(tY()),Rpt=()=>Qpt.useContext(Tpt.default);Ib.default=Rpt});var Iwe=G(wb=>{"use strict";var Ewe=wb&&wb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wb,"__esModule",{value:!0});var Cb=dn(),Fpt=Ewe(xF()),Npt=Ewe(RF()),Opt=({isActive:e=!0,autoFocus:t=!1,id:r}={})=>{let{isRawModeSupported:s,setRawMode:a}=Npt.default(),{activeId:n,add:c,remove:f,activate:p,deactivate:h,focus:E}=Cb.useContext(Fpt.default),C=Cb.useMemo(()=>r??Math.random().toString().slice(2,7),[r]);return Cb.useEffect(()=>(c(C,{autoFocus:t}),()=>{f(C)}),[C,t]),Cb.useEffect(()=>{e?p(C):h(C)},[e,C]),Cb.useEffect(()=>{if(!(!s||!e))return a(!0),()=>{a(!1)}},[e]),{isFocused:!!C&&n===C,focus:E}};wb.default=Opt});var Cwe=G(Bb=>{"use strict";var Lpt=Bb&&Bb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bb,"__esModule",{value:!0});var Mpt=dn(),Upt=Lpt(xF()),_pt=()=>{let e=Mpt.useContext(Upt.default);return{enableFocus:e.enableFocus,disableFocus:e.disableFocus,focusNext:e.focusNext,focusPrevious:e.focusPrevious,focus:e.focus}};Bb.default=_pt});var wwe=G(uY=>{"use strict";Object.defineProperty(uY,"__esModule",{value:!0});uY.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 Hpt=iwe();Object.defineProperty(vo,"render",{enumerable:!0,get:function(){return Hpt.default}});var jpt=kF();Object.defineProperty(vo,"Box",{enumerable:!0,get:function(){return jpt.default}});var Gpt=aY();Object.defineProperty(vo,"Text",{enumerable:!0,get:function(){return Gpt.default}});var qpt=owe();Object.defineProperty(vo,"Static",{enumerable:!0,get:function(){return qpt.default}});var Ypt=lwe();Object.defineProperty(vo,"Transform",{enumerable:!0,get:function(){return Ypt.default}});var Wpt=uwe();Object.defineProperty(vo,"Newline",{enumerable:!0,get:function(){return Wpt.default}});var Vpt=pwe();Object.defineProperty(vo,"Spacer",{enumerable:!0,get:function(){return Vpt.default}});var Kpt=dwe();Object.defineProperty(vo,"useInput",{enumerable:!0,get:function(){return Kpt.default}});var Jpt=gwe();Object.defineProperty(vo,"useApp",{enumerable:!0,get:function(){return Jpt.default}});var zpt=RF();Object.defineProperty(vo,"useStdin",{enumerable:!0,get:function(){return zpt.default}});var Zpt=mwe();Object.defineProperty(vo,"useStdout",{enumerable:!0,get:function(){return Zpt.default}});var Xpt=ywe();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 bdt(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=oW(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 Ddt(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=oW(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 Pdt(e,t){return t.fs_.chmod(e,493)}function oW(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=N1e()?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}L1e.exports=sW});var IW=G((Q$t,i2e)=>{i2e.exports=Ce("stream")});var l2e=G((T$t,a2e)=>{"use strict";function s2e(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 fgt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?s2e(Object(r),!0).forEach(function(s){Agt(e,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s2e(Object(r)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(r,s))})}return e}function Agt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pgt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o2e(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 hgt(e,t,r){return t&&o2e(e.prototype,t),r&&o2e(e,r),e}var dgt=Ce("buffer"),sN=dgt.Buffer,ggt=Ce("util"),CW=ggt.inspect,mgt=CW&&CW.custom||"inspect";function ygt(e,t,r){sN.prototype.copy.call(e,t,r)}a2e.exports=function(){function e(){pgt(this,e),this.head=null,this.tail=null,this.length=0}return hgt(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 sN.alloc(0);for(var s=sN.allocUnsafe(r>>>0),a=this.head,n=0;a;)ygt(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=sN.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:mgt,value:function(r,s){return CW(this,fgt({},s,{depth:0,customInspect:!1}))}}]),e}()});var BW=G((R$t,u2e)=>{"use strict";function Egt(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(wW,this,e)):process.nextTick(wW,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(oN,r):(r._writableState.errorEmitted=!0,process.nextTick(c2e,r,n)):process.nextTick(c2e,r,n):t?(process.nextTick(oN,r),t(n)):process.nextTick(oN,r)}),this)}function c2e(e,t){wW(e,t),oN(e)}function oN(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function Igt(){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 wW(e,t){e.emit("error",t)}function Cgt(e,t){var r=e._readableState,s=e._writableState;r&& Line truncated
`)),e.linkname&&(t+=ZW(" linkpath="+e.linkname+`
`));var r=e.pax;if(r)for(var s in r)t+=ZW(" "+s+"="+r[s]+`
`);return Buffer.from(t)};Fw.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};Fw.encode=function(e){var t=pmt(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(dg(e.mode&Emt,6),100),t.write(dg(e.uid,6),108),t.write(dg(e.gid,6),116),t.write(dg(e.size,11),124),t.write(dg(e.mtime.getTime()/1e3|0,11),136),t[156]=uBe+wmt(e.type),e.linkname&&t.write(e.linkname,157),fBe.copy(t,pD),gmt.copy(t,XW),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(dg(e.devmajor||0,6),329),t.write(dg(e.devminor||0,6),337),s&&t.write(s,345),t.write(dg(pBe(t),6),148),t)};Fw.decode=function(e,t,r){var s=e[156]===0?0:e[156]-uBe,a=Rw(e,0,100,t),n=gg(e,100,8),c=gg(e,108,8),f=gg(e,116,8),p=gg(e,124,12),h=gg(e,136,12),E=Cmt(s),C=e[157]===0?null:Rw(e,157,100,t),S=Rw(e,265,32),x=Rw(e,297,32),I=gg(e,329,8),R=gg(e,337,8),N=pBe(e);if(N===8*32)return null;if(N!==gg(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(fBe.compare(e,pD,pD+6)===0)e[345]&&(a=Rw(e,345,155,t)+"/"+a);else if(!(mmt.compare(e,pD,pD+6)===0&&ymt.compare(e,XW,XW+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:R}}});var IBe=G(($$t,EBe)=>{var dBe=Ce("util"),vmt=cBe(),hD=$W(),gBe=Tw().Writable,mBe=Tw().PassThrough,yBe=function(){},hBe=function(e){return e&=511,e&&512-e},Smt=function(e,t){var r=new CN(e,t);return r.end(),r},bmt=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},CN=function(e,t){this._parent=e,this.offset=t,mBe.call(this,{autoDestroy:!1})};dBe.inherits(CN,mBe);CN.prototype.destroy=function(e){this._parent.destroy(e)};var uh=function(e){if(!(this instanceof uh))return new uh(e);gBe.call(this,e),e=e||{},this._offset=0,this._buffer=vmt(),this._missing=0,this._partial=!1,this._onparse=yBe,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=hBe(t._header.size);S?t._parse(S,c):t._parse(512,C),t._locked||s()},c=function(){t._buffer.consume(hBe(t._header.size)),t._parse(512,C),s()},f=function(){var S=t._header.size;t._paxGlobal=hD.decodePax(r.slice(0,S)),r.consume(S),n()},p=function(){var S=t._header.size;t._pax=hD.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=hD.decodeLongPath(r.slice(0,S),e.filenameEncoding),r.consume(S),n()},E=function(){var S=t._header.size;this._gnuLongLinkPath=hD.decodeLongPath(r.slice(0,S),e.filenameEncoding),r.consume(S),n()},C=function(){var S=t._offset,x;try{x=t._header=hD.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=bmt(x,t._pax),t._pax=null),t._locked=!0,!x.size||x.type==="directory"){t._parse(512,C),t.emit("entry",x,Smt(t,S),a);return}t._stream=new CN(t,S),t.emit("entry",x,t._stream,a),t._parse(x.size,n),s()};this._onheader=C,this._parse(512,C)};dBe.inherits(uh,gBe);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=yBe,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?iyt:nyt);if(!a||s&&!gV.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&&!(gV.includes(this.algorithm)&&this.digest.match(ryt)&&this.options.every(r=>r.match(syt)))?"":`${this.algorithm}-${this.digest}${wD(this.options)}`}};function jBe(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 gV)this[a]&&(s=jBe(s,r,t,this[a]))}else for(let a of Object.keys(this))s=jBe(s,r,t,this[a]);return s}concat(t,r){let s=typeof t=="string"?t:ID(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||pyt,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 dV(e,t);if(e.algorithm&&e.digest){let r=new ny;return r[e.algorithm]=[e],dV(ID(r,t),t)}else return dV(ID(e,t),t)}function dV(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=ID;function ID(e,t){return e.algorithm&&e.digest?ph.prototype.toString.call(e,t):typeof e=="string"?ID(oc(e,t),t):ny.prototype.toString.call(e,t)}BA.exports.fromHex=oyt;function oyt(e,t,r){let s=wD(r?.options);return oc(`${t}-${Buffer.from(e,"hex").toString("base64")}${s}`,r)}BA.exports.fromData=ayt;function ayt(e,t){let r=t?.algorithms||[...yV],s=wD(t?.options);return r.reduce((a,n)=>{let c=CD.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=lyt;function lyt(e,t){let r=EV(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=cyt;function cyt(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=CD.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=uyt;function uyt(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=EV(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=EV;function EV(e=Object.create(null)){return new mV(e)}BA.exports.create=fyt;function fyt(e){let t=e?.algorithms||[...yV],r=wD(e?.options),s=t.map(CD.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 Ayt=CD.getHashes(),GBe=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(e=>Ayt.includes(e));function pyt(e,t){return GBe.indexOf(e.toLowerCase())>=GBe.indexOf(t.toLowerCase())?e:t}});var IV=G(yg=>{"use strict";Object.defineProperty(yg,"__esModule",{value:!0});yg.Signature=yg.Envelope=void 0;yg.Envelope={fromJSON(e){return{payload:NN(e.payload)?Buffer.from(YBe(e.payload)):Buffer.alloc(0),payloadType:NN(e.payloadType)?globalThis.String(e.payloadType):"",signatures:globalThis.Array.isArray(e?.signatures)?e.signatures.map(t=>yg.Signature.fromJSON(t)):[]}},toJSON(e){let t={};return e.payload.length!==0&&(t.payload=WBe(e.payload)),e.payloadType!==""&&(t.payloadType=e.payloadType),e.signatures?.length&&(t.signatures=e.signatures.map(r=>yg.Signature.toJSON(r))),t}};yg.Signature={fromJSON(e){return{sig:NN(e.sig)?Buffer.from(YBe(e.sig)):Buffer.alloc(0),keyid:NN(e.keyid)?globalThis.String(e.keyid):""}},toJSON(e){let t={};return e.sig.length!==0&&(t.sig=WBe(e.sig)),e.keyid!==""&&(t.keyid=e.keyid),t}};function YBe(e){return Uint8Array.from(globalThis.Buffer.from(e,"base64"))}function WBe(e){return globalThis.Buffer.from(e).toString("base64")}function NN(e){return e!=null}});var KBe=G(ON=>{"use strict";Object.defineProperty(ON,"__esModule",{value:!0});ON.Timestamp=void 0;ON.Timestamp={fromJSON(e){return{seconds:VBe(e.seconds)?globalThis.String(e.seconds):"0",nanos:VBe(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 VBe(e){return e!=null}});var _w=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=zBe;_r.hashAlgorithmToJSON=ZBe;_r.publicKeyDetailsFromJSON=XBe;_r.publicKeyDetailsToJSON=$Be;_r.subjectAlternativeNameTypeFromJSON=eve;_r.subjectAlternativeNameTypeToJSON=tve;var hyt=KBe(),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 zBe(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 ZBe(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(oEt)||r.match(aEt)||(t+=r)}),Buffer.from(t,"base64")}function cEt(e,t="CERTIFICATE"){let s=e.toString("base64").match(/.{1,64}/g)||"";return[`-----BEGIN ${t}-----`,...s,`-----END ${t}-----`].join(`
`).concat(`
`)}});var iO=G(Yw=>{"use strict";Object.defineProperty(Yw,"__esModule",{value:!0});Yw.SHA2_HASH_ALGOS=Yw.ECDSA_SIGNATURE_ALGOS=void 0;Yw.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"};Yw.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 UV=G(sO=>{"use strict";Object.defineProperty(sO,"__esModule",{value:!0});sO.RFC3161TimestampVerificationError=void 0;var MV=class extends Error{};sO.RFC3161TimestampVerificationError=MV});var Qve=G(DA=>{"use strict";var uEt=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]}),fEt=DA&&DA.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),AEt=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)&&uEt(t,e,r);return fEt(t,e),t};Object.defineProperty(DA,"__esModule",{value:!0});DA.TSTInfo=void 0;var kve=AEt(qw()),pEt=iO(),hEt=UV(),_V=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 pEt.SHA2_HASH_ALGOS[t]}get messageImprintHashedMessage(){return this.messageImprintObj.subs[1].value}get raw(){return this.root.toDER()}verify(t){let r=kve.digest(this.messageImprintHashAlgorithm,t);if(!kve.bufferEqual(r,this.messageImprintHashedMessage))throw new hEt.RFC3161TimestampVerificationError("message imprint does not match artifact")}get messageImprintObj(){return this.root.subs[2]}};DA.TSTInfo=_V});var Rve=G(PA=>{"use strict";var dEt=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]}),gEt=PA&&PA.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),mEt=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)&&dEt(t,e,r);return gEt(t,e),t};Object.defineProperty(PA,"__esModule",{value:!0});PA.RFC3161Timestamp=void 0;var yEt=tO(),HV=mEt(qw()),Tve=iO(),PD=UV(),EEt=Qve(),IEt="1.2.840.113549.1.7.2",CEt="1.2.840.113549.1.9.16.1.4",wEt="1.2.840.113549.1.9.4",jV=class e{constructor(t){this.root=t}static parse(t){let r=yEt.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 Tve.SHA2_HASH_ALGOS[t]}get signatureAlgorithm(){let t=this.signatureAlgorithmObj.subs[0].toOID();return Tve.ECDSA_SIGNATURE_ALGOS[t]}get signatureValue(){return this.signatureValueObj.value}get tstInfo(){return new EEt.TSTInfo(this.eContentObj.subs[0].subs[0])}verify(t,r){if(!this.timeStampTokenObj)throw new PD.RFC3161TimestampVerificationError("timeStampToken is missing");if(this.contentType!==IEt)throw new PD.RFC3161TimestampVerificationError(`incorrect content type: ${this.contentType}`);if(this.eContentType!==CEt)throw new PD.RFC3161TimestampVerificationError(`incorrect encapsulated content type: ${this.eContentType}`);this.tstInfo.verify(t),this.verifyMessageDigest(),this.verifySignature(r)}verifyMessageDigest(){let t=HV.digest(this.signerDigestAlgorithm,this.tstInfo.raw),r=this.messageDigestAttributeObj.subs[1].subs[0].value;if(!HV.bufferEqual(t,r))throw new PD.RFC3161TimestampVerificationError("signed data does not match tstInfo")}verifySignature(t){let r=this.signedAttrsObj.toDER();if(r[0]=49,!HV.verify(r,t,this.signatureValue,this.signatureAlgorithm))throw new PD.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 R;if(typeof E=="string"?(R=C===E,this.debug("string match",E,C,R)):(R=E.test(C),this.debug("pattern match",E,C,R)),!R)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,OO.assertValidPattern)(t);let r=this.options;if(t==="**")return hr.GLOBSTAR;if(t==="")return"";let s,a=null;(s=t.match(Hwt))?a=r.dot?Gwt:jwt:(s=t.match(Qwt))?a=(r.nocase?r.dot?Nwt:Fwt:r.dot?Rwt:Twt)(s[1]):(s=t.match(qwt))?a=(r.nocase?r.dot?Wwt:Ywt:r.dot?Vwt:Kwt)(s):(s=t.match(Owt))?a=r.dot?Mwt:Lwt:(s=t.match(Uwt))&&(a=_wt);let n=Sbe.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?zwt:r.dot?Zwt:Xwt,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"?i1t(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 s1t=H7();Object.defineProperty(hr,"AST",{enumerable:!0,get:function(){return s1t.AST}});var o1t=j7();Object.defineProperty(hr,"escape",{enumerable:!0,get:function(){return o1t.escape}});var a1t=QO();Object.defineProperty(hr,"unescape",{enumerable:!0,get:function(){return a1t.unescape}});hr.minimatch.AST=Sbe.AST;hr.minimatch.Minimatch=hy;hr.minimatch.escape=Pwt.escape;hr.minimatch.unescape=xwt.unescape});var Y7=G(ru=>{"use strict";var kbe=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 Qbe=kbe(Ce("crypto")),l1t=xbe(),LO=kbe(Ce("util")),MO=QA(),dy=hf();ru.TOP_LEVEL_ROLE_NAMES=["root","targets","snapshot","timestamp"];var GD=class e{constructor(t){let{keyIDs:r,threshold:s,unrecognizedFields:a}=t;if(c1t(r))throw new MO.ValueError("duplicate key IDs found");if(s<1)throw new MO.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&&LO.default.isDeepStrictEqual(this.keyIDs,t.keyIDs)&&LO.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=GD;function c1t(e){return new Set(e).size!==e.length}var G7=class e extends GD{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 MO.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&&LO.default.isDeepStrictEqual(this.paths,t.paths)&&LO.default.isDeepStrictEqual(this.pathHashPrefixes,t.pathHashPrefixes):!1}isDelegatedPath(t){if(this.paths)return this.paths.some(r=>f1t(t,r));if(this.pathHashPrefixes){let s=Qbe.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+"+zO.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=p2t()+t+" "+e[0]}function p2t(){return oo.inspectOpts.hideDate?"":new Date().toISOString()+" "}function h2t(...e){return process.stderr.write(JO.formatWithOptions(oo.inspectOpts,...e)+`
`)}function d2t(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function g2t(){return process.env.DEBUG}function m2t(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]]}zO.exports=fK()(oo);var{formatters:Wbe}=zO.exports;Wbe.o=function(e){return this.inspectOpts.colors=this.useColors,JO.inspect(e,this.inspectOpts).split(`
`).map(t=>t.trim()).join(" ")};Wbe.O=function(e){return this.inspectOpts.colors=this.useColors,JO.inspect(e,this.inspectOpts)}});var pK=G((Irr,AK)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?AK.exports=Ybe():AK.exports=Vbe()});var XO=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 hK=class extends Error{};Ji.ValueError=hK;var dK=class extends Error{};Ji.RuntimeError=dK;var gK=class extends Error{};Ji.PersistError=gK;var YD=class extends Error{};Ji.RepositoryError=YD;var ZO=class extends YD{};Ji.BadVersionError=ZO;var mK=class extends ZO{};Ji.EqualVersionError=mK;var yK=class extends YD{};Ji.ExpiredMetadataError=yK;var WD=class extends Error{};Ji.DownloadError=WD;var EK=class extends WD{};Ji.DownloadLengthMismatchError=EK;var IK=class extends WD{constructor(t,r){super(t),this.statusCode=r}};Ji.DownloadHTTPError=IK});var Jbe=G(f1=>{"use strict";var wK=f1&&f1.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(f1,"__esModule",{value:!0});f1.withTempFile=void 0;var CK=wK(Ce("fs/promises")),y2t=wK(Ce("os")),Kbe=wK(Ce("path")),E2t=async e=>I2t(async t=>e(Kbe.default.join(t,"tempfile")));f1.withTempFile=E2t;var I2t=async e=>{let t=await CK.default.realpath(y2t.default.tmpdir()),r=await CK.default.mkdtemp(t+Kbe.default.sep);try{return await e(r)}finally{await CK.default.rm(r,{force:!0,recursive:!0,maxRetries:3})}}});var vK=G(Qg=>{"use strict";var eL=Qg&&Qg.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qg,"__esModule",{value:!0});Qg.DefaultFetcher=Qg.BaseFetcher=void 0;var C2t=eL(pK()),zbe=eL(Ce("fs")),w2t=eL(pO()),B2t=eL(Ce("util")),Zbe=XO(),v2t=Jbe(),S2t=(0,C2t.default)("tuf:fetch"),$O=class{async downloadFile(t,r,s){return(0,v2t.withTempFile)(async a=>{let n=await this.fetch(t),c=0,f=zbe.default.createWriteStream(a);try{for await(let p of n){let h=Buffer.from(p);if(c+=h.length,c>r)throw new Zbe.DownloadLengthMismatchError("Max length reached");await b2t(f,h)}}finally{await B2t.default.promisify(f.close).bind(f)()}return s(a)})}async downloadBytes(t,r){return this.downloadFile(t,r,async s=>{let a=zbe.default.createReadStream(s),n=[];for await(let c of a)n.push(c);return Buffer.concat(n)})}};Qg.BaseFetcher=$O;var BK=class extends $O{constructor(t={}){super(),this.timeout=t.timeout,this.retry=t.retry}async fetch(t){S2t("GET %s",t);let r=await(0,w2t.default)(t,{timeout:this.timeout,retry:this.retry});if(!r.ok||!r?.body)throw new Zbe.DownloadHTTPError("Failed to download",r.status);return r.body}};Qg.DefaultFetcher=BK;var b2t=async(e,t)=>new Promise((r,s)=>{e.write(t,a=>{a&&s(a),r(!0)})})});var Xbe=G(tL=>{"use strict";Object.defineProperty(tL,"__esModule",{value:!0});tL.defaultConfig=void 0;tL.defaultConfig={maxRootRotations:256,maxDelegations:32,rootMaxLength:512e3,timestampMaxLength:16384,snapshotMaxLength:2e6,targetsMaxLength:5e6,prefixTargetsWithHash:!0,fetchTimeout:1e5,fetchRetries:void 0,fetchRetry:2}});var $be=G(rL=>{"use strict";Object.defineProperty(rL,"__esModule",{value:!0});rL.TrustedMetadataStore=void 0;var Bs=WO(),Hi=XO(),SK=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
`,FBt=/\u2014 (\S+) (\S+)\n/g;function NBt(e,t){let r=(0,RBt.filterTLogAuthorities)(t,{targetDate:new Date(Number(e.integratedTime)*1e3)}),s=e.inclusionProof,a=VK.fromString(s.checkpoint.envelope),n=KK.fromString(a.note);if(!OBt(a,r))throw new d1.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"invalid checkpoint signature"});if(!WK.crypto.bufferEqual(n.logHash,s.rootHash))throw new d1.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"root hash mismatch"})}function OBt(e,t){let r=Buffer.from(e.note,"utf-8");return e.signatures.every(s=>{let a=t.find(n=>WK.crypto.bufferEqual(n.logID.subarray(0,4),s.keyHint));return a?WK.crypto.verify(r,a.publicKey,s.signature):!1})}var VK=class e{constructor(t,r){this.note=t,this.signatures=r}static fromString(t){if(!t.includes(YK))throw new d1.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"missing checkpoint separator"});let r=t.indexOf(YK),s=t.slice(0,r+1),n=t.slice(r+YK.length).matchAll(FBt),c=Array.from(n,f=>{let[,p,h]=f,E=Buffer.from(h,"base64");if(E.length<5)throw new d1.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 d1.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"no signatures found in checkpoint"});return new e(s,c)}},KK=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 d1.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 wDe=G($K=>{"use strict";Object.defineProperty($K,"__esModule",{value:!0});$K.verifyMerkleInclusion=UBt;var XK=xl(),zK=bo(),LBt=Buffer.from([0]),MBt=Buffer.from([1]);function UBt(e){let t=e.inclusionProof,r=BigInt(t.logIndex),s=BigInt(t.treeSize);if(r<0n||r>=s)throw new zK.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:`invalid index: ${r}`});let{inner:a,border:n}=_Bt(r,s);if(t.hashes.length!==a+n)throw new zK.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=jBt(HBt(p,c,r),f);if(!XK.crypto.bufferEqual(h,t.rootHash))throw new zK.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"calculated root hash does not match inclusion proof"})}function _Bt(e,t){let r=GBt(e,t),s=qBt(e>>BigInt(r));return{inner:r,border:s}}function HBt(e,t,r){return t.reduce((s,a,n)=>r>>BigInt(n)&BigInt(1)?ZK(a,s):ZK(s,a),e)}function jBt(e,t){return t.reduce((r,s)=>ZK(s,r),e)}function GBt(e,t){return YBt(e^t-BigInt(1))}function qBt(e){return e.toString(2).split("1").length-1}function YBt(e){return e===0n?0:e.toString(2).length}function ZK(e,t){return XK.crypto.digest("sha256",MBt,e,t)}function WBt(e){return XK.crypto.digest("sha256",LBt,e)}});var vDe=G(eJ=>{"use strict";Object.defineProperty(eJ,"__esModule",{value:!0});eJ.verifyTLogSET=JBt;var BDe=xl(),VBt=bo(),KBt=Ey();function JBt(e,t){if(!(0,KBt.filterTLogAuthorities)(t,{logID:e.logId.keyId,targetDate:new Date(Number(e.integratedTime)*1e3)}).some(a=>{let n=zBt(e),c=Buffer.from(BDe.json.canonicalize(n),"utf8"),f=e.inclusionPromise.signedEntryTimestamp;return BDe.crypto.verify(c,a.publicKey,f)}))throw new VBt.VerificationError({code:"TLOG_INCLUSION_PROMISE_ERROR",message:"inclusion promise could not be verified"})}function zBt(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 SDe=G(nJ=>{"use strict";Object.defineProperty(nJ,"__esModule",{value:!0});nJ.verifyRFC3161Timestamp=$Bt;var tJ=xl(),rJ=bo(),ZBt=GK(),XBt=Ey();function $Bt(e,t,r){let s=e.signingTime;if(r=(0,XBt.filterCertAuthorities)(r,{start:s,end:s}),r=tvt(r,{serialNumber:e.signerSerialNumber,issuer:e.signerIssuer}),!r.some(n=>{try{return evt(e,t,n),!0}catch{return!1}}))throw new rJ.VerificationError({code:"TIMESTAMP_ERROR",message:"timestamp could not be verified"})}function evt(e,t,r){let[s,...a]=r.certChain,n=tJ.crypto.createPublicKey(s.publicKey),c=e.signingTime;try{new ZBt.CertificateChainVerifier({untrustedCert:s,trustedCerts:a}).verify()}catch{throw new rJ.VerificationError({code:"TIMESTAMP_ERROR",message:"invalid certificate chain"})}if(!r.certChain.every(p=>p.validForDate(c)))throw new rJ.VerificationError({code:"TIMESTAMP_ERROR",message:"timestamp was signed with an expired certificate"});e.verify(t,n)}function tvt(e,t){return e.filter(r=>r.certChain.length>0&&tJ.crypto.bufferEqual(r.certChain[0].serialNumber,t.serialNumber)&&tJ.crypto.bufferEqual(r.certChain[0].issuer,t.issuer))}});var bDe=G(gL=>{"use strict";Object.defineProperty(gL,"__esModule",{value:!0});gL.verifyTSATimestamp=avt;gL.verifyTLogTimestamp=lvt;var rvt=bo(),nvt=CDe(),ivt=wDe(),svt=vDe(),ovt=SDe();function avt(e,t,r){return(0,ovt.verifyRFC3161Timestamp)(e,t,r),{type:"timestamp-authority",logID:e.signerSerialNumber,timestamp:e.signingTime}}function lvt(e,t){let r=!1;if(cvt(e)&&((0,svt.verifyTLogSET)(e,t),r=!0),uvt(e)&&((0,ivt.verifyMerkleInclusion)(e),(0,nvt.verifyCheckpoint)(e,t),r=!0),!r)throw new rvt.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 cvt(e){return e.inclusionPromise!==void 0}function uvt(e){return e.inclusionProof!==void 0}});var DDe=G(iJ=>{"use strict";Object.defineProperty(iJ,"__esModule",{value:!0});iJ.verifyDSSETLogBody=fvt;var mL=bo();function fvt(e,t){switch(e.apiVersion){case"0.0.1":return Avt(e,t);default:throw new mL.VerificationError({code:"TLOG_BODY_ERROR",message:`unsupported dsse version: ${e.apiVersion}`})}}function Avt(e,t){if(e.spec.signatures?.length!==1)throw new mL.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 mL.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 mL.VerificationError({code:"TLOG_BODY_ERROR",message:"DSSE payload hash mismatch"})}});var PDe=G(oJ=>{"use strict";Object.defineProperty(oJ,"__esModule",{value:!0});oJ.verify Line truncated
Try running the command again with the package name prefixed: ${ue.pretty(r,"yarn add",ue.Type.CODE)} ${ue.pretty(r,H.makeDescriptor(H.makeIdent(null,"my-package"),`${ie[0]}...`),ue.Type.DESCRIPTOR)}`);if(!$)throw new ot(`The ${ue.pretty(r,K,ue.Type.CODE)} string didn't match the required format (package-name@range). Did you perhaps forget to explicitly reference the package name?`);let fe=wot(a,$,{dev:this.dev,peer:this.peer,preferDev:this.preferDev,optional:this.optional});return await Promise.all(fe.map(async ge=>{let pe=await tS($,{project:s,workspace:a,cache:n,fixed:c,target:ge,modifier:h,strategies:E,maxResults:C});return{request:$,suggestedDescriptors:pe,target:ge}}))})).then(K=>K.flat()),I=await fA.start({configuration:r,stdout:this.context.stdout,suggestInstall:!1},async K=>{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")?K.reportError(27,`${H.prettyDescriptor(r,$)} can't be resolved to a satisfying range`):K.reportError(27,`${H.prettyDescriptor(r,$)} can't be resolved to a satisfying range (note: network resolution has been disabled)`),K.reportSeparator(),K.reportExceptionOnce(ge)}});if(I.hasErrors())return I.exitCode();let R=!1,N=[],U=[];for(let{suggestedDescriptors:{suggestions:K},target:$}of x){let ie,fe=K.filter(De=>De.descriptor!==null),le=fe[0].descriptor,ge=fe.every(De=>H.areDescriptorsEqual(De.descriptor,le));fe.length===1||ge?ie=le:(R=!0,{answer:ie}=await(0,m0e.prompt)({type:"select",name:"answer",message:"Which range do you want to use?",choices:K.map(({descriptor:De,name:ye,reason:d})=>De?{name:ye,hint:d,descriptor:De}:{name:ye,hint:d,disabled:!0}),onCancel:()=>process.exit(130),result(De){return this.find(De,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let pe=a.manifest[$].get(ie.identHash);(typeof pe>"u"||pe.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 pe>"u"?N.push([a,$,ie,E]):U.push([a,$,pe,ie]))}return await r.triggerMultipleHooks(K=>K.afterWorkspaceDependencyAddition,N),await r.triggerMultipleHooks(K=>K.afterWorkspaceDependencyReplacement,U),R&&this.context.stdout.write(`
`),await s.installWithNewReport({json:this.json,stdout:this.context.stdout,quiet:this.context.quiet},{cache:n,mode:this.mode})}};function wot(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 ot(`Package "${H.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 ot(`Package "${H.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 ot(`Package "${H.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 ot(`Package "${H.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 ot(`Package "${H.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 eC=class extends ft{constructor(){super(...arguments);this.verbose=he.Boolean("-v,--verbose",!1,{description:"Print both the binary name and the locator of the package that provides the binary"});this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.name=he.String({required:!1})}static{this.paths=[["bin"]]}static{this.usage=st.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 Tt.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 ot(`Couldn't find a binary named "${this.name}" for package "${H.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:H.stringifyIdent(C),path:S});if(this.verbose)for(let[E,[C]]of f)c.reportInfo(null,`${E.padEnd(h," ")} ${H.prettyLocator(r,C)}`);else for(let E of f.keys())c.reportInfo(null,E)})).exitCode()}};Ge();bt();jt();var tC=class extends ft{constructor(){super(...arguments);this.mirror=he.Boolean("--mirror",!1,{description:"Remove the global cache files instead of the local cache files"});this.all=he.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=st.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 ot("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 ae.removePromise(s.mirrorCwd),await r.triggerHook(f=>f.cleanGlobalArtifacts,r)),c&&await ae.removePromise(s.cwd)})).exitCode()}};Ge();jt();Zl();var w5=Ce("util"),rC=class extends ft{constructor(){super(...arguments);this.why=he.Boolean("--why",!1,{description:"Print the explanation for why a setting has its value"});this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.unsafe=he.Boolean("--no-redacted",!1,{description:"Don't redact secrets (such as tokens) from the output"});this.name=he.String()}static{this.paths=[["config","get"]]}static{this.usage=st.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 ot(`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();w5.inspect.styles.name="cyan",this.context.stdout.write(`${(0,w5.inspect)(p,{depth:1/0,colors:r.get("enableColors"),compact:!1})}
`)}return h.exitCode()}};Ge();jt();Zl();var B5=Ce("util"),nC=class extends ft{constructor(){super(...arguments);this.json=he.Boolean("--json",!1,{description:"Set complex configuration settings to JSON values"});this.home=he.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=he.String();this.value=he.String()}static{this.paths=[["config","set"]]}static{this.usage=st.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 ot("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 ot(`Couldn't find a configuration settings named "${a}"`);if(a==="enableStrictSettings")throw new ot("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 R=pd(I);return J0(R,this.name,f),R}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=>{B5.inspect.styles.name="cyan",I.reportInfo(0,`Successfully set ${this.name} to ${(0,B5.inspect)(S,{depth:1/0,colors:r.get("enableColors"),compact:!1})}`)})).exitCode()}};Ge();jt();Zl();var iC=class extends ft{constructor(){super(...arguments);this.home=he.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=he.String()}static{this.paths=[["config","unset"]]}static{this.usage=st.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 ot("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 ot(`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(!CB(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?pd(C):{...C};return hd(S,this.name),S}),E||h.reportInfo(0,`Successfully unset ${this.name}`)})).exitCode()}};Ge();bt();jt();var qR=Ce("util"),sC=class extends ft{constructor(){super(...arguments);this.noDefaults=he.Boolean("--no-defaults",!1,{description:"Omit the default values from the display"});this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.verbose=he.Boolean("-v,--verbose",{hidden:!0});this.why=he.Boolean("--why",{hidden:!0});this.names=he.Rest()}static{this.paths=[["config"]]}static{this.usage=st.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}),R={Description:{label:"Description",value:ue.tuple(ue.Type.MARKDOWN,{text:S.description,format:this.cli.format(),paragraphs:!1})},Source:{label:"Source",value:ue.tuple(x[0]==="<"?ue.Type.CODE:ue.Type.PATH,x)}};h[C]={value:ue.tuple(ue.Type.CODE,C),children:R};let N=(U,K)=>{for(let[$,ie]of K)if(ie instanceof Map){let fe={};U[$]={children:fe},N(fe,ie)}else U[$]={label:$,value:ue.tuple(ue.Type.NO_HINT,(0,qR.inspect)(ie,p))}};I instanceof Map?N(R,I):R.Value={label:"Value",value:ue.tuple(ue.Type.NO_HINT,(0,qR.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,qR.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 YR={};Vt(YR,{Strategy:()=>rS,acceptedStrategies:()=>Bot,dedupe:()=>v5});Ge();Ge();var y0e=et(Zo()),rS=(t=>(t.HIGHEST="highest",t))(rS||{}),Bot=new Set(Object.values(rS)),vot={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=>H.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 le=await fe.promise;if(!le)throw new Error("Assertion failed: Expected the dependency to have been through the dedupe process itself");return[$,le.updatedPackage]})));if(t.length&&!y0e.default.isMatch(H.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 R=[...I].map($=>{let ie=e.originalPackages.get($);if(typeof ie>"u")throw new Error(`Assertion failed: The package (${$}) should have been registered`);return ie}),N=await r.getSatisfying(p,x,R,a),U=N.locators?.[0];if(typeof U>"u"||!N.sorted)return C;let K=e.originalPackages.get(U.locatorHash);if(typeof K>"u")throw new Error(`Assertion failed: The package (${U.locatorHash}) should have been registered`);return K}).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 v5(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=vot[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(K=>{if(K===null||K.currentPackage.locatorHash===K.updatedPackage.locatorHash)return;I++;let{descriptor:$,currentPackage:ie,updatedPackage:fe}=K;a.reportInfo(0,`${H.prettyDescriptor(n,$)} can be deduped from ${H.prettyLocator(n,ie)} to ${H.prettyLocator(n,fe)}`),a.reportJson({descriptor:H.stringifyDescriptor($),currentResolution:H.stringifyLocator(ie),updatedResolution:H.stringifyLocator(fe)}),e.storedResolutions.set($.descriptorHash,fe.locatorHash)}).finally(()=>x.tick())));let R;switch(I){case 0:R="No packages";break;case 1:R="One package";break;default:R=`${I} packages`}let N=ue.pretty(n,t,ue.Type.CODE);return a.reportInfo(0,`${R} can be deduped using the ${N} strategy`),I})}var oC=class extends ft{constructor(){super(...arguments);this.strategy=he.String("-s,--strategy","highest",{description:"The strategy to use when deduping dependencies",validator:Qs(rS)});this.check=he.Boolean("-c,--check",!1,{description:"Exit with exit code 1 when duplicates are found, without persisting the dependency tree"});this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.mode=he.String("--mode",{description:"Change what artifacts installs generate",validator:Qs(La)});this.patterns=he.Rest()}static{this.paths=[["dedupe"]]}static{this.usage=st.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 lC=class extends ft{static{this.paths=[["help"],["--help"],["-h"]]}async execute(){this.context.stdout.write(this.cli.usage(null))}};Ge();bt();jt();var cC=class extends ft{constructor(){super(...arguments);this.leadingArgument=he.String();this.args=he.Proxy()}async execute(){if(this.leadingArgument.match(/[\\/]/)&&!H.tryParseIdent(this.leadingArgument)){let r=Y.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 uC=class extends ft{static{this.paths=[["-v"],["--version"]]}async execute(){this.context.stdout.write(`${An||"<unknown>"}
`)}};Ge();Ge();jt();var fC=class extends ft{constructor(){super(...arguments);this.commandName=he.String();this.args=he.Proxy()}static{this.paths=[["exec"]]}static{this.usage=st.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 Tt.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 AC=class extends ft{constructor(){super(...arguments);this.hash=he.String({required:!1,validator:ld(Jf(),[Sp(/^p[0-9a-f]{6}$/)])})}static{this.paths=[["explain","peer-requirements"]]}static{this.usage=st.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 Tt.find(r,this.context.cwd);return await s.restoreInstallState({restoreResolutions:!1}),await s.applyLightResolution(),typeof this.hash<"u"?await bot(this.hash,s,{stdout:this.context.stdout}):await Dot(s,{stdout:this.context.stdout})}};async function bot(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:ue.tuple(ue.Type.DEPENDENT,{locator:p.requester,descriptor:p.descriptor}),children:p.children.size>0?[{value:ue.tuple(ue.Type.NO_HINT,"...")}]:[]}:(a.add(p.requester.locatorHash),{value:ue.tuple(ue.Type.DEPENDENT,{locator:p.requester,descriptor:p.descriptor}),children:Object.fromEntries(Array.from(p.children.values(),h=>[H.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=ue.mark(t.configuration),E=c?h.Cross:h.Check;if(p.reportInfo(0,`Package ${ue.pretty(t.configuration,s.subject,ue.Type.LOCATOR)} is requested to provide ${ue.pretty(t.configuration,s.ident,ue.Type.IDENT)} by its descendants`),p.reportSeparator(),p.reportInfo(0,ue.pretty(t.configuration,s.subject,ue.Type.LOCATOR)),ts.emitTree({children:Object.fromEntries(Array.from(s.requests.values(),C=>[H.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 ${ue.pretty(t.configuration,s.subject,ue.Type.LOCATOR)} does not provide ${ue.pretty(t.configuration,s.ident,ue.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 ${ue.pretty(t.configuration,s.subject,ue.Type.LOCATOR)} provides ${ue.pretty(t.configuration,s.ident,ue.Type.IDENT)} with version ${H.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 ${ue.pretty(t.configuration,c.range,ue.Type.RANGE)}`):p.reportInfo(0," Unfortunately, the requested ranges have no overlap"))}})).exitCode()}async function Dot(e,t){return(await Ft.start({configuration:e.configuration,stdout:t.stdout,includeFooter:!1,includePrefix:!1},async s=>{let a=ue.mark(e.configuration),n=qe.sortMap(e.peerRequirementNodes,[([,c])=>H.stringifyLocator(c.subject),([,c])=>H.stringifyIdent(c.ident)]);for(let[,c]of n.values()){if(!c.root)continue;let f=e.peerWarnings.find(E=>E.hash===c.hash),p=[...H.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=`${ue.pretty(e.configuration,c.hash,ue.Type.CODE)} \u2192 ${f?a.Cross:a.Check} ${H.prettyLocator(e.configuration,c.subject)} provides ${H.prettyLocator(e.configuration,C)} to ${H.prettyLocator(e.configuration,p[0].requester)}${h}`;f?s.reportWarning(0,S):s.reportInfo(0,S)}else{let E=`${ue.pretty(e.configuration,c.hash,ue.Type.CODE)} \u2192 ${f?a.Cross:a.Check} ${H.prettyLocator(e.configuration,c.subject)} doesn't provide ${H.prettyIdent(e.configuration,c.ident)} to ${H.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 I0e=et(hi()),pC=class extends ft{constructor(){super(...arguments);this.useYarnPath=he.Boolean("--yarn-path",{description:"Set the yarnPath setting even if the version can be accessed by Corepack"});this.onlyIfNeeded=he.Boolean("--only-if-needed",!1,{description:"Only lock the Yarn version if it isn't already locked"});this.version=he.String()}static{this.paths=[["set","version"]]}static{this.usage=st.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=Y.resolve(f,".yarn/releases"),h=Y.resolve(p,`yarn-${t}.cjs`),E=Y.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 ${ue.applyHyperlink(e,"Corepack","https://nodejs.org/api/corepack.html")} enabled; we'll have to rely on ${ue.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 ${ue.pretty(e,E,"magenta")}`),await ae.removePromise(Y.dirname(h)),await ae.mkdirPromise(Y.dirname(h),{recursive:!0}),await ae.writeFilePromise(h,$,{mode:493}),await Je.updateConfiguration(f,{yarnPath:Y.relative(f,h)})}else await ae.removePromise(Y.dirname(h)),await Je.updateConfiguration(f,{yarnPath:Je.deleteProperty});let R=await _t.tryFind(f)||new _t;R.packageManager=`yarn@${C?t:await nS(e,"stable")}`;let N={};R.exportTo(N);let U=Y.join(f,_t.fileName),K=`${JSON.stringify(N,null,R.indent)}
`;return await ae.changeFilePromise(U,K,{automaticNewlines:!0}),{bundleVersion:t}}function C0e(e){return pr[Vx(e)]}var xot=/## (?<code>YN[0-9]{4}) - `(?<name>[A-Z_]+)`\n\n(?<details>(?:.(?!##))+)/gs;async function kot(e){let r=`https://repo.yarnpkg.com/${qe.isTaggedYarnVersion(An)?An:await nS(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(xot),({groups:a})=>{if(!a)throw new Error("Assertion failed: Expected the match to have been successful");let n=C0e(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 hC=class extends ft{constructor(){super(...arguments);this.code=he.String({required:!1,validator:z2(Jf(),[Sp(/^YN[0-9]{4}$/)])});this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["explain"]]}static{this.usage=st.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=C0e(this.code),a=ue.pretty(r,s,ue.Type.CODE),n=this.cli.format().header(`${this.code} - ${a}`),f=(await kot(r)).get(this.code),p=typeof f<"u"?ue.jsonOrPretty(this.json,r,ue.tuple(ue.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}:
${ue.jsonOrPretty(this.json,r,ue.tuple(ue.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:ue.tuple(ue.Type.CODE,n)})};ts.emitTree(s,{configuration:r,stdout:this.context.stdout,json:this.json})}}};Ge();bt();jt();var w0e=et(Zo()),dC=class extends ft{constructor(){super(...arguments);this.all=he.Boolean("-A,--all",!1,{description:"Print versions of a package from the whole project"});this.recursive=he.Boolean("-R,--recursive",!1,{description:"Print information for all packages, including transitive dependencies"});this.extra=he.Array("-X,--extra",[],{description:"An array of requests of extra data provided by plugins"});this.cache=he.Boolean("--cache",!1,{description:"Print information about the cache entry of a package (path, size, checksum)"});this.dependents=he.Boolean("--dependents",!1,{description:"Print all dependents for each matching package"});this.manifest=he.Boolean("--manifest",!1,{description:"Print data obtained by looking at the package archive (license, homepage, ...)"});this.nameOnly=he.Boolean("--name-only",!1,{description:"Only print the name for the matching packages"});this.virtuals=he.Boolean("--virtuals",!1,{description:"Print each instance of the virtual packages"});this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.patterns=he.Rest()}static{this.paths=[["info"]]}static{this.usage=st.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 Tt.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 le=ie.anchoredLocator.locatorHash,ge=new Map,pe=[le];for(;pe.length>0;){let De=pe.shift();if(ge.has(De))continue;let ye=s.storedPackages.get(De);if(typeof ye>"u")throw new Error("Assertion failed: Expected the package to be registered");if(ge.set(De,ye),H.isVirtualLocator(ye)&&pe.push(H.devirtualizeLocator(ye).locatorHash),!(!fe&&De!==le))for(let d of ye.dependencies.values()){let ve=s.storedResolutions.get(d.descriptorHash);if(typeof ve>"u")throw new Error("Assertion failed: Expected the resolution to be registered");pe.push(ve)}}return ge.values()},p=({recursive:ie})=>{let fe=new Map;for(let le of s.workspaces)for(let ge of f(le,{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 le=h({all:ie,recursive:fe}),ge=this.patterns.map(ye=>{let d=H.parseLocator(ye),ve=w0e.default.makeRe(H.stringifyIdent(d)),Ie=H.isVirtualLocator(d),me=Ie?H.devirtualizeLocator(d):d;return ce=>{let X=H.stringifyIdent(ce);if(!ve.test(X))return!1;if(d.reference==="unknown")return!0;let be=H.isVirtualLocator(ce),ke=be?H.devirtualizeLocator(ce):ce;return!(Ie&&be&&d.reference!==ce.reference||me.reference!==ke.reference)}}),pe=qe.sortMap([...le],ye=>H.stringifyLocator(ye));return{selection:pe.filter(ye=>ge.length===0||ge.some(d=>d(ye))),sortedLookup:pe}},{selection:C,sortedLookup:S}=E({all:this.all,recursive:this.recursive});if(C.length===0)throw new ot("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 le=s.storedResolutions.get(fe.descriptorHash);if(typeof le>"u")throw new Error("Assertion failed: Expected the resolution to be registered");qe.getArrayWithDefault(x,le).push(ie)}let I=new Map;for(let ie of S){if(!H.isVirtualLocator(ie))continue;let fe=H.devirtualizeLocator(ie);qe.getArrayWithDefault(I,fe.locatorHash).push(ie)}let R={},N={children:R},U=r.makeFetcher(),K={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 EC=class extends ft{constructor(){super(...arguments);this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["plugin","check"]]}static{this.usage=st.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=ue.pretty(r,f.path,ue.Type.PATH),C=ue.pretty(r,f.spec,ue.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 D0e=Ce("os");Ge();bt();jt();var B0e=Ce("os");Ge();Sc();jt();var Not="https://raw.githubusercontent.com/yarnpkg/berry/master/plugins.yml";async function Qm(e,t){let r=await nn.get(Not,{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 IC=class extends ft{constructor(){super(...arguments);this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["plugin","list"]]}static{this.usage=st.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 Oot=/^[0-9]+$/,Lot=process.platform==="win32";function v0e(e){return Oot.test(e)?`pull/${e}/head`:e}var Mot=({repository:e,branch:t},r)=>[["git","init",Ae.fromPortablePath(r)],["git","remote","add","origin",e],["git","fetch","origin","--depth=1",v0e(t)],["git","reset","--hard","FETCH_HEAD"]],Uot=({branch:e})=>[["git","fetch","origin","--depth=1",v0e(e),"--force"],["git","reset","--hard","FETCH_HEAD"],["git","clean","-dfx","-e","packages/yarnpkg-cli/bundles"]],_ot=({plugins:e,noMinify:t},r,s)=>[["yarn","build:cli",...new Array().concat(...e.map(a=>["--plugin",Y.resolve(s,a)])),...t?["--no-minify"]:[],"|"],[Lot?"move":"mv","packages/yarnpkg-cli/bundles/yarn.js",Ae.fromPortablePath(r),"|"]],CC=class extends ft{constructor(){super(...arguments);this.installPath=he.String("--path",{description:"The path where the repository should be cloned to"});this.repository=he.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=he.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.plugins=he.Array("--plugin",[],{description:"An array of additional plugins that should be included in the bundle"});this.dryRun=he.Boolean("-n,--dry-run",!1,{description:"If set, the bundle will be built but not added to the project"});this.noMinify=he.Boolean("--no-minify",!1,{description:"Build a bundle for development (debugging) - non-minified and non-mangled"});this.force=he.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.skipPlugins=he.Boolean("--skip-plugins",!1,{description:"Skip updating the contrib plugins"})}static{this.paths=[["set","version","from","sources"]]}static{this.usage=st.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 Tt.find(r,this.context.cwd),a=typeof this.installPath<"u"?Y.resolve(this.context.cwd,Ae.toPortablePath(this.installPath)):Y.resolve(Ae.toPortablePath((0,B0e.tmpdir)()),"yarnpkg-sources",Mn.makeHash(this.repository).slice(0,6));return(await Ft.start({configuration:r,stdout:this.context.stdout},async c=>{await D5(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=Y.join(a,`packages/yarnpkg-cli/bundles/yarn-${f.stdout.trim()}.js`);ae.existsSync(p)||(await iS(_ot(this,p,a),{configuration:r,context:this.context,target:a}),c.reportSeparator());let h=await ae.readFilePromise(p);if(!this.dryRun){let{bundleVersion:E}=await S5(r,null,async()=>h,{report:c});this.skipPlugins||await Hot(this,E,{project:s,report:c,target:a})}})).exitCode()}};async function iS(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(`${ue.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 D5(e,{configuration:t,report:r,target:s}){let a=!1;if(!e.force&&ae.existsSync(Y.join(s,".git"))){r.reportInfo(0,"Fetching the latest commits"),r.reportSeparator();try{await iS(Uot(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 ae.removePromise(s),await ae.mkdirPromise(s,{recursive:!0}),await iS(Mot(e,s),{configuration:t,context:e.context,target:s}))}async function Hot(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 P5(f,e,{project:r,report:s,target:a})}Ge();Ge();bt();jt();var S0e=et(hi()),b0e=Ce("vm");var wC=class extends ft{constructor(){super(...arguments);this.name=he.String();this.checksum=he.Boolean("--checksum",!0,{description:"Whether to care if this plugin is modified"})}static{this.paths=[["plugin","import"]]}static{this.usage=st.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 Tt.find(r,this.context.cwd),c,f;if(this.name.match(/^\.{0,2}[\\/]/)||Ae.isAbsolute(this.name)){let p=Y.resolve(this.context.cwd,Ae.toPortablePath(this.name));a.reportInfo(0,`Reading ${ue.pretty(r,p,ue.Type.PATH)}`),c=Y.relative(n.cwd,p),f=await ae.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=H.parseLocator(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-"));if(h.reference!=="unknown"&&!S0e.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=H.stringifyIdent(h),C=await Qm(r,An);if(!Object.hasOwn(C,E)){let S=`Couldn't find a plugin named ${H.prettyIdent(r,h)} on the remote registry.
`;throw r.plugins.has(E)?S+=`A plugin named ${H.prettyIdent(r,h)} is already installed; possibly attempting to import a built-in plugin.`:S+=`Note that only the plugins referenced on our website (${ue.pretty(r,"https://github.com/yarnpkg/berry/blob/master/plugins.yml",ue.Type.URL)}) can be referenced by their name; any other plugin will have to be referenced through its public url (for example ${ue.pretty(r,"https://github.com/yarnpkg/berry/raw/master/packages/plugin-typescript/bin/%40yarnpkg/plugin-typescript.js",ue.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 ${ue.pretty(r,p,"green")}`),f=await nn.get(p,{configuration:r})}await x5(c,f,{checksum:this.checksum,project:n,report:a})})).exitCode()}};async function x5(e,t,{checksum:r=!0,project:s,report:a}){let{configuration:n}=s,c={},f={exports:c};(0,b0e.runInNewContext)(t.toString(),{module:f,exports:c});let h=`.yarn/plugins/${f.exports.name}.cjs`,E=Y.resolve(s.cwd,h);a.reportInfo(0,`Saving the new plugin in ${ue.pretty(n,h,"magenta")}`),await ae.mkdirPromise(Y.dirname(E),{recursive:!0}),await ae.writeFilePromise(E,t);let C={path:h,spec:e};r&&(C.checksum=Mn.makeHash(t)),await Je.addPlugin(s.cwd,[C])}var jot=({pluginName:e,noMinify:t},r)=>[["yarn",`build:${e}`,...t?["--no-minify"]:[],"|"]],BC=class extends ft{constructor(){super(...arguments);this.installPath=he.String("--path",{description:"The path where the repository should be cloned to"});this.repository=he.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=he.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.noMinify=he.Boolean("--no-minify",!1,{description:"Build a plugin for development (debugging) - non-minified and non-mangled"});this.force=he.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.name=he.String()}static{this.paths=[["plugin","import","from","sources"]]}static{this.usage=st.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"?Y.resolve(this.context.cwd,Ae.toPortablePath(this.installPath)):Y.resolve(Ae.toPortablePath((0,D0e.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 Tt.find(r,this.context.cwd),f=H.parseIdent(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-")),p=H.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 D5(this,{configuration:r,report:n,target:s}),await P5(E,this,{project:c,report:n,target:s})})).exitCode()}};async function P5(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 iS(jot({pluginName:c,noMinify:r},n),{configuration:f,context:t,target:n}),a.reportSeparator();let p=Y.resolve(n,`packages/${c}/bundles/${e}.js`),h=await ae.readFilePromise(p);await x5(e,h,{project:s,report:a})}Ge();bt();jt();var vC=class extends ft{constructor(){super(...arguments);this.name=he.String()}static{this.paths=[["plugin","remove"]]}static{this.usage=st.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 Tt.find(r,this.context.cwd);return(await Ft.start({configuration:r,stdout:this.context.stdout},async n=>{let c=this.name,f=H.parseIdent(c);if(!r.plugins.has(c))throw new ot(`${H.prettyIdent(r,f)} isn't referenced by the current configuration`);let p=`.yarn/plugins/${c}.cjs`,h=Y.resolve(s.cwd,p);ae.existsSync(h)&&(n.reportInfo(0,`Removing ${ue.pretty(r,p,ue.Type.PATH)}...`),await ae.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 SC=class extends ft{constructor(){super(...arguments);this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["plugin","runtime"]]}static{this.usage=st.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 bC=class extends ft{constructor(){super(...arguments);this.idents=he.Rest()}static{this.paths=[["rebuild"]]}static{this.usage=st.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 Tt.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(H.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 k5=et(Zo());Jo();var DC=class extends ft{constructor(){super(...arguments);this.all=he.Boolean("-A,--all",!1,{description:"Apply the operation to all workspaces from the current project"});this.mode=he.String("--mode",{description:"Change what artifacts installs generate",validator:Qs(La)});this.patterns=he.Rest()}static{this.paths=[["remove"]]}static{this.usage=st.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 Tt.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 R=!1,N=H.parseIdent(I);for(let U of c){let K=[...U.manifest.peerDependenciesMeta.keys()];for(let $ of(0,k5.default)(K,I))U.manifest.peerDependenciesMeta.delete($),h=!0,R=!0;for(let $ of f){let ie=U.manifest.getForScope($),fe=[...ie.values()].map(le=>H.stringifyIdent(le));for(let le of(0,k5.default)(fe,H.stringifyIdent(N))){let{identHash:ge}=H.parseIdent(le),pe=ie.get(ge);if(typeof pe>"u")throw new Error("Assertion failed: Expected the descriptor to be registered");U.manifest[$].delete(ge),E.push([U,$,pe]),h=!0,R=!0}}}R||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 ot(`${C} ${ue.prettyList(r,p,ue.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 P0e=Ce("util"),PC=class extends ft{constructor(){super(...arguments);this.json=he.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 Tt.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,P0e.inspect)(S,h)}`),c.reportJson({name:C,script:S})})).exitCode()}};Ge();Ge();jt();var xC=class extends ft{constructor(){super(...arguments);this.inspect=he.String("--inspect",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.inspectBrk=he.String("--inspect-brk",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.topLevel=he.Boolean("-T,--top-level",!1,{description:"Check the root workspace for scripts and/or binaries instead of the current one"});this.binariesOnly=he.Boolean("-B,--binaries-only",!1,{description:"Ignore any user defined scripts and only check for binaries"});this.require=he.String("--require",{description:"Forwarded to the underlying Node process when executing a binary"});this.silent=he.Boolean("--silent",{hidden:!0});this.scriptName=he.String();this.args=he.Proxy()}static{this.paths=[["run"]]}static{this.usage=st.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 Tt.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 ot(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${H.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 ot(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${H.prettyLocator(r,n)}).`);{if(this.scriptName==="global")throw new ot("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 ot(`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 ot(`Couldn't find a script named "${this.scriptName}".`)}}};Ge();Ge();jt();var kC=class extends ft{constructor(){super(...arguments);this.descriptor=he.String();this.resolution=he.String()}static{this.paths=[["set","resolution"]]}static{this.usage=st.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 Tt.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=H.parseDescriptor(this.descriptor,!0),f=H.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 x0e=et(Zo()),QC=class extends ft{constructor(){super(...arguments);this.all=he.Boolean("-A,--all",!1,{description:"Unlink all workspaces belonging to the target project from the current one"});this.leadingArguments=he.Rest()}static{this.paths=[["unlink"]]}static{this.usage=st.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 Tt.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=Y.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 Tt.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(H.stringifyIdent(x.anchoredLocator));if(f.size===0)throw new ot("No workspace found to be unlinked in the target project")}else{if(!S.manifest.name)throw new ot("The target workspace doesn't have a name and thus cannot be unlinked");f.add(H.stringifyIdent(S.anchoredLocator))}}else{let E=[...c.manifest.resolutions.map(({pattern:C})=>C.descriptor.fullName)];for(let C of(0,x0e.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 k0e=et(Xv()),Q5=et(Zo());Jo();var TC=class extends ft{constructor(){super(...arguments);this.interactive=he.Boolean("-i,--interactive",{description:"Offer various choices, depending on the detected upgrade paths"});this.fixed=he.Boolean("-F,--fixed",!1,{description:"Store dependency tags as-is instead of resolving them"});this.exact=he.Boolean("-E,--exact",!1,{description:"Don't use any semver modifier on the resolved range"});this.tilde=he.Boolean("-T,--tilde",!1,{description:"Use the `~` semver modifier on the resolved range"});this.caret=he.Boolean("-C,--caret",!1,{description:"Use the `^` semver modifier on the resolved range"});this.recursive=he.Boolean("-R,--recursive",!1,{description:"Resolve again ALL resolutions for those packages"});this.noTimeGate=he.Boolean("--no-time-gate",!1,{description:"Disable the minimum release age check for this command"});this.mode=he.String("--mode",{description:"Change what artifacts installs generate",validator:Qs(La)});this.patterns=he.Rest()}static{this.paths=[["up"]]}static{this.usage=st.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
${le}`):N.reportError(27,`${H.prettyDescriptor(r,U)} can't be resolved to a satisfying range (note: network resolution has been disabled)
${le}`)}else ie.length>1&&!f&&N.reportError(27,`${H.prettyDescriptor(r,U)} has multiple possible upgrade strategies; use -i to disambiguate manually`)}});if(x.hasErrors())return x.exitCode();let I=!1,R=[];for(let[N,U,,{suggestions:K}]of S){let $,ie=K.filter(pe=>pe.descriptor!==null),fe=ie[0].descriptor,le=ie.every(pe=>H.areDescriptorsEqual(pe.descriptor,fe));ie.length===1||le?$=fe:(I=!0,{answer:$}=await(0,k0e.prompt)({type:"select",name:"answer",message:`Which range do you want to use in ${H.prettyWorkspace(r,N)} \u276F ${U}?`,choices:K.map(({descriptor:pe,name:De,reason:ye})=>pe?{name:De,hint:ye,descriptor:pe}:{name:De,hint:ye,disabled:!0}),onCancel:()=>process.exit(130),result(pe){return this.find(pe,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let ge=N.manifest[U].get($.identHash);if(typeof ge>"u")throw new Error("Assertion failed: This descriptor should have a matching entry");if(ge.descriptorHash!==$.descriptorHash)N.manifest[U].set($.identHash,$),R.push([N,U,ge,$]);else{let pe=r.makeResolver(),De={project:s,resolver:pe},ye=r.normalizeDependency(ge),d=pe.bindDescriptor(ye,N.anchoredLocator,De);s.forgetResolution(d)}}return await r.triggerMultipleHooks(N=>N.afterWorkspaceDependencyReplacement,R),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=he.Boolean("-R,--recursive",!1,{description:"List, for each workspace, what are all the paths that lead to the dependency"});this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.peers=he.Boolean("--peers",!1,{description:"Also print the peer dependencies that match the specified name"});this.package=he.String()}static{this.paths=[["why"]]}static{this.usage=st.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 Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let n=H.parseDescriptor(this.package,!1);if(n.range!=="unknown"&&kr.validRange(n.range)===null)throw new ot(`Expected a valid semver range, got ${n.range}`);let c=this.recursive?qot(s,n,{configuration:r,peers:this.peers}):Got(s,n,{configuration:r,peers:this.peers});ts.emitTree(c,{configuration:r,stdout:this.context.stdout,json:this.json,separators:1})}};function Got(e,t,{configuration:r,peers:s}){let a=qe.sortMap(e.storedPackages.values(),f=>H.stringifyLocator(f)),n={},c={children:n};for(let f of a){let p={};for(let E of f.dependencies.values()){if(!s&&T5(f,E))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(!H.areIdentsEqual(S,t)||!H.isPackageInRange(S,t.range))continue;{let I=H.stringifyLocator(f);n[I]={value:[f,ue.Type.LOCATOR],children:p}}let x=H.stringifyLocator(S);p[x]={value:[{descriptor:E,locator:S},ue.Type.DEPENDENT]}}}return c}function qot(e,t,{configuration:r,peers:s}){let a=qe.sortMap(e.workspaces,S=>H.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),H.areIdentsEqual(S,t)&&H.isPackageInRange(S,t.range))return c.add(S.locatorHash),!0;let x=!1;for(let I of S.dependencies.values()){if(!s&&T5(S,I))continue;let R=e.storedResolutions.get(I.descriptorHash);if(!R)throw new Error("Assertion failed: The resolution should have been registered");let N=e.storedPackages.get(R);if(!N)throw new Error("Assertion failed: The package should have been registered");f(N)&&(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 R=I!==null?ue.tuple(ue.Type.DEPENDENT,{locator:S,descriptor:I}):ue.tuple(ue.Type.LOCATOR,S),N={},U={value:R,children:N},K=H.stringifyLocator(S);if(x[K]=U,!(I!==null&&e.tryWorkspaceByLocator(S))&&!p.has(S.locatorHash)){p.add(S.locatorHash);for(let $ of S.dependencies.values()){if(!s&&T5(S,$))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,N,$)}}};for(let S of a)C(S.anchoredPackage,h,null);return E}function T5(e,t){return H.isVirtualLocator(e)&&e.peerDependencies.has(t.identHash)}Ge();var j5={};Vt(j5,{GitFetcher:()=>oS,GitResolver:()=>aS,default:()=>fat,gitUtils:()=>Ma});Ge();bt();var Ma={};Vt(Ma,{TreeishProtocols:()=>sS,clone:()=>H5,fetchBase:()=>Z0e,fetchChangedFiles:()=>X0e,fetchChangedWorkspaces:()=>cat,fetchRoot:()=>z0e,isGitUrl:()=>OC,lsRemote:()=>J0e,normalizeLocator:()=>lat,normalizeRepoUrl:()=>FC,resolveUrl:()=>_5,splitRepoUrl:()=>Xp,validateRepoUrl:()=>U5});Ge();bt();jt();Zl();var V0e=et(q0e()),NC=et(Ce("querystring")),L5=et(hi());function O5(e,t,r){let s=e.indexOf(r);return e.lastIndexOf(t,s>-1?s:1/0)}function Y0e(e){try{return new URL(e)}catch{return}}function oat(e){let t=O5(e,"@","#"),r=O5(e,":","#");return r>t&&(e=`${e.slice(0,r)}/${e.slice(r+1)}`),O5(e,":","#")===-1&&e.indexOf("//")===-1&&(e=`ssh://${e}`),e}function W0e(e){return Y0e(e)||Y0e(oat(e))}function FC(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=W0e(e);r&&(e=r.href),e=e.replace(/^git\+([^:]+):/,"$1:")}return e}function K0e(){return{...process.env,GIT_SSH_COMMAND:process.env.GIT_SSH_COMMAND||`${process.env.GIT_SSH||"ssh"} -o BatchMode=yes`}}var aat=[/^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\/(.+)?$/],sS=(a=>(a.Commit="commit",a.Head="head",a.Tag="tag",a.Semver="semver",a))(sS||{});function OC(e){return e?aat.some(t=>!!e.match(t)):!1}function Xp(e){e=FC(e);let t=e.indexOf("#");if(t===-1)return{repo:e,treeish:{protoc 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 Tt.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=>[H.stringifyIdent(p.anchoredLocator),p])),f=c.get(this.workspaceName);if(f===void 0){let p=Array.from(c.keys()).sort();throw new ot(`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 Aat={configuration:{enableImmutableInstalls:{description:"If true (the default on CI), prevents the install command from modifying the lockfile",type:"BOOLEAN",default:$0e.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:[tC,rC,nC,iC,kC,CC,pC,LC,aC,lC,cC,uC,$I,eC,sC,oC,fC,AC,hC,dC,gC,mC,QC,yC,EC,BC,wC,vC,IC,SC,bC,DC,PC,xC,TC,RC,MC]},pat=Aat;var V5={};Vt(V5,{default:()=>mat});Ge();Ge();var q5="catalog:";var Y5=e=>e.startsWith(q5),hat=e=>e.range.slice(q5.length)||null,eme=e=>e===null?"default catalog":`catalog "${e}"`,dat=e=>e.scope?`@${e.scope}/${e.name}`:e.name,W5=(e,t,r,s)=>{let a=hat(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,`${H.prettyDescriptor(e.configuration,t)}: ${eme(a)} not found or empty`);let c=dat(t),f=n.get(c);if(!f)throw new Lt(82,`${H.prettyDescriptor(e.configuration,t)}: entry not found in ${eme(a)}`);let p=e.configuration.normalizeDependency(H.makeDescriptor(t,f));return r.supportsDescriptor(p,s)?r.bindDescriptor(p,e.topLevelWorkspace.anchoredLocator,s):p};var gat={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"||!Y5(p))continue;let h=H.parseIdent(f),E=H.makeDescriptor(h,p),C=W5(r,E,s,a),{protocol:S,source:x,params:I,selector:R}=H.parseRange(H.convertToManifestRange(C.range));S===e.project.configuration.get("defaultProtocol")&&(S=null),c[f]=H.makeRange({protocol:S,source:x,params:I,selector:R})}}},reduceDependency:async(e,t,r,s,{resolver:a,resolveOptions:n})=>Y5(e.range)?W5(t,e,a,n):e}},mat=gat;var X5={};Vt(X5,{default:()=>Eat});Ge();var Qt={optional:!0},K5=[["@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(()=>(pS(),AS)),s=await Je.find(this.context.cwd,this.context.plugins),{project:a}=await Tt.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,R]=E[x];p.reportInfo(null,`${Oat(x,C)}${I.padEnd(S," ")} = ${Nat(R)}`)}p.reportJson(h)}})).exitCode()}};function Nat(e){return typeof e!="string"?`${e}`:e.match(/^[a-zA-Z][a-zA-Z0-9_]+$/)?e:`'${e}'`}function Oat(e,t){let r=e===0,s=e===t-1;return r&&s?"":r?"\u250C ":s?"\u2514 ":"\u2502 "}Ge();jt();var YC=class extends ft{constructor(){super(...arguments);this.verbose=he.Boolean("-v,--verbose",!1,{description:"Also print the fact database automatically compiled from the workspace manifests"})}static{this.paths=[["constraints","source"]]}static{this.usage=st.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(()=>(pS(),AS)),s=await Je.find(this.context.cwd,this.context.plugins),{project:a}=await Tt.find(s,this.context.cwd),n=await r.find(a);this.context.stdout.write(this.verbose?n.fullSource:n.source)}};Ge();Ge();jt();cS();var WC=class extends ft{constructor(){super(...arguments);this.fix=he.Boolean("--fix",!1,{description:"Attempt to automatically fix unambiguous issues, following a multi-pass process"});this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["constraints"]]}static{this.usage=st.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 Tt.find(r,this.context.cwd);await s.restoreInstallState();let a=await s.loadUserConfig(),n;if(a?.constraints)n=new _C(s);else{let{Constraints:h}=await Promise.resolve().then(()=>(pS(),AS));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}=VR(s,E,{fix:this.fix}),x=[];for(let[I,R]of C){let N=I.manifest.indent;I.manifest=new _t,I.manifest.indent=N,I.manifest.load(R),x.push(I.persistManifest())}if(await Promise.all(x),!(C.size>0&&h>1)){c=sme(S,{configuration:r}),f=!1,p=!0;for(let[,I]of S)for(let R of I)R.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 ${ue.pretty(r,"yarn constraints --fix",ue.Type.CODE)}`:`Errors prefixed by '\u2699' can be fixed by running ${ue.pretty(r,"yarn constraints --fix",ue.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}};cS();var Lat={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:[qC,YC,WC],hooks:{async validateProjectAfterInstall(e,{reportError:t}){if(!e.configuration.get("enableConstraintsChecks"))return;let r=await e.loadUserConfig(),s;if(r?.constraints)s=new _C(e);else{let{Constraints:c}=await Promise.resolve().then(()=>(pS(),AS));s=await c.find(e)}let a=await s.process();if(!a)return;let{remainingErrors:n}=VR(e,a);if(n.size!==0)if(e.configuration.isCI)for(let[c,f]of n)for(let p of f)t(84,`${ue.pretty(e.configuration,c.anchoredLocator,ue.Type.IDENT)}: ${p.text}`);else t(84,`Constraint check failed; run ${ue.pretty(e.configuration,"yarn constraints",ue.Type.CODE)} for more details`)}}},Mat=Lat;var g9={};Vt(g9,{CreateCommand:()=>VC,DlxCommand:()=>KC,default:()=>_at});Ge();jt();var VC=class extends ft{constructor(){super(...arguments);this.pkg=he.String("-p,--package",{description:"The package to run the provided command from"});this.quiet=he.Boolean("-q,--quiet",!1,{description:"Only report critical errors instead of printing the full install logs"});this.command=he.String();this.args=he.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=H.parseDescriptor(s),n=a.name.match(/^create(-|$)/)?a:a.scope?H.makeIdent(a.scope,`create-${a.name}`):H.makeIdent(null,`create-${a.name}`),c=H.stringifyIdent(n);return a.range!=="unknown"&&(c+=`@${a.range}`),this.cli.run(["dlx",...r,c,...this.args])}};Ge();Ge();bt();jt();var KC=class extends ft{constructor(){super(...arguments);this.packages=he.Array("-p,--package",{description:"The package(s) to install before running the command"});this.quiet=he.Boolean("-q,--quiet",!1,{description:"Only report critical errors instead of printing the full install logs"});this.command=he.String();this.args=he.Proxy()}static{this.paths=[["dlx"]]}static{this.usage=st.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 ae.mktempPromise(async r=>{let s=Y.join(r,`dlx-${process.pid}`);await ae.mkdirPromise(s),await ae.writeFilePromise(Y.join(s,"package.json"),`{}
`),await ae.writeFilePromise(Y.join(s,"yarn.lock"),"");let a=Y.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:ue.LogLevel.Discard}]},p=n!==null?Y.join(n,".yarnrc.yml"):null;p!==null&&ae.existsSync(p)?(await ae.copyFilePromise(p,a),await Je.updateConfiguration(s,N=>{let U=qe.toMerged(N,f);return Array.isArray(N.plugins)&&(U.plugins=N.plugins.map(K=>{let $=typeof K=="string"?K:K.path,ie=Ae.isAbsolute($)?$:Ae.resolve(Ae.fromPortablePath(n),$);return typeof K=="string"?ie:{path:ie,spec:K.spec}})),U})):await ae.writeJsonPromise(a,f);let h=this.packages??[this.command],E=H.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 Tt.find(S,s);if(I===null)throw new ar(x.cwd,s);await x.restoreInstallState();let R=await wn.getWorkspaceAccessibleBinaries(I);return R.has(E)===!1&&R.size===1&&typeof this.packages>"u"&&(E=Array.from(R)[0][0]),await wn.executeWorkspaceAccessibleBinary(I,E,this.args,{packageAccessibleBinaries:R,cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})})}};var Uat={commands:[VC,KC]},_at=Uat;var E9={};Vt(E9,{ExecFetcher:()=>dS,ExecResolver:()=>gS,default:()=>Gat,execUtils:()=>ZR});Ge();Ge();Ge();bt();var AA="exec:";var ZR={};Vt(ZR,{loadGeneratorFile:()=>hS,makeLocator:()=>y9,makeSpec:()=>Qme,parseSpec:()=>m9});Ge();bt();function m9(e){let{params:t,selector:r}=H.parseRange(e),s=Ae.toPortablePath(r);return{parentLocator:t&&typeof t.locator=="string"?H.parseLocator(t.locator):null,path:s}}function Qme({parentLocator:e,path:t,generatorHash:r,protocol:s}){let a=e!==null?{locator:H.stringifyLocator(e)}:{},n=typeof r<"u"?{hash:r}:{};return H.makeRange({protocol:s,source:t,selector:t,params:{...n,...a}})}function y9(e,{parentLocator:t,path:r,generatorHash:s,protocol:a}){return H.makeLocator(e,Qme({parentLocator:t,path:r,generatorHash:s,protocol:a}))}async function hS(e,t,r){let{parentLocator:s,path:a}=H.parseFileStyleRange(e,{protocol:t}),n=Y.isAbsolute(a)?{packageFs:new Pn(wt.root),prefixPath:wt.dot,localPath:wt.root}:await r.fetcher.fetch(s,r),c=n.localPath?{packageFs:new Pn(wt.root),prefixPath:Y.relative(wt.root,n.localPath)}:n;n!==c&&n.releaseFs&&n.releaseFs();let f=c.packageFs,p=Y.join(c.prefixPath,a);return await f.readFilePromise(p,"utf8")}var dS=class{supports(t,r){return!!t.reference.startsWith(AA)}getLocalPath(t,r){let{parentLocator:s,path:a}=H.parseFileStyleRange(t.reference,{protocol:AA});if(Y.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(s,r);return n===null?null:Y.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:H.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,`${H.prettyLocator(r.project.configuration,t)} can't be built with the exec: protocol because all scripts have been disabled.`);let a=await hS(t.reference,AA,r);return ae.mktempPromise(async n=>{let c=Y.join(n,"generator.js");return await ae.writeFilePromise(c,a),ae.mktempPromise(async f=>{if(await this.generatePackage(f,t,c,r),!ae.existsSync(Y.join(f,"build")))throw new Error("The script should have generated a build directory");return await ms.makeArchiveFromDirectory(Y.join(f,"build"),{prefixPath:H.getIdentVendorPath(t),compressionLevel:r.project.configuration.get("compressionLevel")})})})}async generatePackage(t,r,s,a){return await ae.mktempPromise(async n=>{let c=await wn.makeScriptEnv({project:a.project,binFolder:n}),f=Y.join(t,"runtime.js");return await ae.mktempPromise(async p=>{let h=Y.join(p,"buildfile.log"),E=Y.join(t,"generator"),C=Y.join(t,"build");await ae.mkdirPromise(E),await ae.mkdirPromise(C);let S={tempDir:Ae.fromPortablePath(E),buildDir:Ae.fromPortablePath(C),locator:H.stringifyLocator(r)};await ae.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:R,stderr:N}=a.project.configuration.getSubprocessStreams(h,{header:`# This file contains the result of Yarn generating a package (${H.stringifyLocator(r)})
`,prefix:H.prettyLocator(a.project.configuration,r),report:a.report}),{code:U}=await Yr.pipevp(process.execPath,["--require",Ae.fromPortablePath(f),Ae.fromPortablePath(s),H.stringifyIdent(r)],{cwd:t,env:c,stdin:null,stdout:R,stderr:N});if(U!==0)throw ae.detachTemp(p),new Error(`Package generation failed (exit code ${U}, logs can be found here: ${ue.pretty(a.project.configuration,h,ue.Type.PATH)})`)})})}};Ge();Ge();Ge();var Hat=2,gS=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,`${H.prettyLocator(s.project.configuration,r)} lists ${H.prettyDescriptor(s.project.configuration,t)} as dependency, but only workspaces can depend on exec: packages.`);return H.bindDescriptor(t,{locator:H.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}=m9(t.range);if(n===null)throw new Error("Assertion failed: The descriptor should have been bound");let c=await hS(H.makeRange({protocol:AA,source:a,selector:a,params:{locator:H.stringifyLocator(n)}}),AA,s.fetchOptions),f=Mn.makeHash(`${Hat}`,c).slice(0,6);return[y9(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 jat={fetchers:[dS],resolvers:[gS]},Gat=jat;var C9={};Vt(C9,{FileFetcher:()=>IS,FileResolver:()=>CS,TarballFileFetcher:()=>wS,TarballFileResolver:()=>BS,default:()=>Wat,fileUtils:()=>Nm});Ge();bt();var JC=/^(?:[a-zA-Z]:[\\/]|\.{0,2}\/)/,mS=/^[^?]*\.(?:tar\.gz|tgz)(?:::.*)?$/,rs="file:";var Nm={};Vt(Nm,{fetchArchiveFromLocator:()=>ES,makeArchiveFromLocator:()=>XR,makeBufferFromLocator:()=>I9,makeLocator:()=>zC,makeSpec:()=>Tme,parseSpec:()=>yS});Ge();bt();function yS(e){let{params:t,selector:r}=H.parseRange(e),s=Ae.toPortablePath(r);return{parentLocator:t&&typeof t.locator=="string"?H.parseLocator(t.locator):null,path:s}}function Tme({parentLocator:e,path:t,hash:r,protocol:s}){let a=e!==null?{locator:H.stringifyLocator(e)}:{},n=typeof r<"u"?{hash:r}:{};return H.makeRange({protocol:s,source:t,selector:t,params:{...n,...a}})}function zC(e,{parentLocator:t,path:r,hash:s,protocol:a}){return H.makeLocator(e,Tme({parentLocator:t,path:r,hash:s,protocol:a}))}async function ES(e,t){let{parentLocator:r,path:s}=H.parseFileStyleRange(e.reference,{protocol:rs}),a=Y.isAbsolute(s)?{packageFs:new Pn(wt.root),prefixPath:wt.dot,localPath:wt.root}:await t.fetcher.fetch(r,t),n=a.localPath?{packageFs:new Pn(wt.root),prefixPath:Y.relative(wt.root,a.localPath)}:a;a!==n&&a.releaseFs&&a.releaseFs();let c=n.packageFs,f=Y.join(n.prefixPath,s);return await qe.releaseAfterUseAsync(async()=>await c.readFilePromise(f),n.releaseFs)}async function XR(e,{protocol:t,fetchOptions:r,inMemory:s=!1}){let{parentLocator:a,path:n}=H.parseFileStyleRange(e.reference,{protocol:t}),c=Y.isAbsolute(n)?{packageFs:new Pn(wt.root),prefixPath:wt.dot,localPath:wt.root}:await r.fetcher.fetch(a,r),f=c.localPath?{packageFs:new Pn(wt.root),prefixPath:Y.relative(wt.root,c.localPath)}:c;c!==f&&c.releaseFs&&c.releaseFs();let p=f.packageFs,h=Y.join(f.prefixPath,n);return await qe.releaseAfterUseAsync(async()=>await ms.makeArchiveFromDirectory(h,{baseFs:p,prefixPath:H.getIdentVendorPath(e),compressionLevel:r.project.configuration.get("compressionLevel"),inMemory:s}),f.releaseFs)}async function I9(e,{protocol:t,fetchOptions:r}){return(await XR(e,{protocol:t,fetchOptions:r,inMemory:!0})).getBufferAndClose()}var IS=class{supports(t,r){return!!t.reference.startsWith(rs)}getLocalPath(t,r){let{parentLocator:s,path:a}=H.parseFileStyleRange(t.reference,{protocol:rs});if(Y.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(s,r);return n===null?null:Y.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,`${H.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=Y.join(this.context.cwd,"README.md");if(ae.existsSync(E)||(await ae.writeFilePromise(E,`# ${H.stringifyIdent(n.name)}
`),h.push(E)),!s||s.cwd===this.context.cwd){let C=Y.join(this.context.cwd,yr.lockfile);ae.existsSync(C)||(await ae.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=Y.join(this.context.cwd,".gitignore");ae.existsSync(I)||(await ae.writeFilePromise(I,x),h.push(I));let N=["/.yarn/** linguist-vendored","/.yarn/releases/* binary","/.yarn/plugins/**/* binary","/.pnp.* binary linguist-generated"].map(fe=>`${fe}
`).join(""),U=Y.join(this.context.cwd,".gitattributes");ae.existsSync(U)||(await ae.writeFilePromise(U,N),h.push(U));let K={"*":{charset:"utf-8",endOfLine:"lf",indentSize:2,indentStyle:"space",insertFinalNewline:!0}};qe.mergeIntoTarget(K,r.get("initEditorConfig"));let $=`root = true
`;for(let[fe,le]of Object.entries(K)){$+=`
[${fe}]
`;for(let[ge,pe]of Object.entries(le)){let De=ge.replace(/[A-Z]/g,ye=>`_${ye.toLowerCase()}`);$+=`${De} = ${pe}
`}}let ie=Y.join(this.context.cwd,".editorconfig");ae.existsSync(ie)||(await ae.writeFilePromise(ie,$),h.push(ie)),await this.cli.run(["install"],{quiet:!0}),await this.initialize(),ae.existsSync(Y.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 Zd{constructor(){super(...arguments);this.initializer=he.String();this.argv=he.Proxy()}static{this.paths=[["init"]]}async initialize(){this.context.stdout.write(`
`),await this.cli.run(["dlx",this.initializer,...this.argv],{quiet:!0})}};var Zat={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:[Zd,ZC]},Xat=Zat;var BY={};Vt(BY,{SearchCommand:()=>dw,UpgradeInteractiveCommand:()=>gw,default:()=>lht});Ge();var Lme=et(Ce("os"));function XC({stdout:e}){if(Lme.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 Jye=et(q9()),Y9={appId:"OFCNCOG2CU",apiKey:"6fe4476ee5a1832882e326b506d14126",indexName:"npm-search"},Jct=(0,Jye.default)(Y9.appId,Y9.apiKey).initIndex(Y9.indexName),W9=async(e,t=0)=>await Jct.search(e,{analyticsTags:["yarn-plugin-interactive-tools"],attributesToRetrieve:["name","version","owner","repository","humanDownloadsLast30Days"],page:t,hitsPerPage:10});var Db=["regular","dev","peer"],dw=class extends ft{static{this.paths=[["search"]]}static{this.usage=st.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(()=>(FF(),AY)),{ScrollableItems:r}=await Promise.resolve().then(()=>(MF(),LF)),{useKeypress:s}=await Promise.resolve().then(()=>(hw(),pY)),{useMinistore:a}=await Promise.resolve().then(()=>(yY(),mY)),{renderForm:n}=await Promise.resolve().then(()=>(jF(),HF)),{default:c}=await Promise.resolve().then(()=>et(Fwe())),{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"))),R=()=>h.createElement(f,{width:17},h.createElement(p,{bold:!0,underline:!0,color:"gray"},"Target")),N=({hit:pe,active:De})=>{let[ye,d]=a(pe.name,null);s({active:De},(me,ce)=>{if(ce.name!=="space")return;if(!ye){d(Db[0]);return}let X=Db.indexOf(ye)+1;X===Db.length?d(null):d(Db[X])},[ye,d]);let ve=H.parseIdent(pe.name),Ie=H.prettyIdent(S,ve);return h.createElement(f,null,h.createElement(f,{width:45},h.createElement(p,{bold:!0,wrap:"wrap"},Ie)),h.createElement(f,{width:14,marginLeft:1},h.createElement(p,{bold:!0,wrap:"truncate"},pe.owner.name)),h.createElement(f,{width:10,marginLeft:1},h.createElement(p,{italic:!0,wrap:"truncate"},pe.version)),h.createElement(f,{width:16,marginLeft:1},h.createElement(p,null,pe.humanDownloadsLast30Days)))},U=({name:pe,active:De})=>{let[ye]=a(pe,null),d=H.parseIdent(pe);return h.createElement(f,null,h.createElement(f,{width:47},h.createElement(p,{bold:!0}," - ",H.prettyIdent(S,d))),Db.map(ve=>h.createElement(f,{key:ve,width:14,marginLeft:1},h.createElement(p,null," ",h.createElement(t,{active:ye===ve})," ",h.createElement(p,{bold:!0},ve)))))},K=()=>h.createElement(f,{marginTop:1},h.createElement(p,null,"Powered by Algolia.")),ie=await n(({useSubmit:pe})=>{let De=a();pe(De);let ye=Array.from(De.keys()).filter(_=>De.get(_)!==null),[d,ve]=C(""),[Ie,me]=C(0),[ce,X]=C([]),be=_=>{_.match(/\t| /)||ve(_)},ke=async()=>{me(0);let _=await W9(d);_.query===d&&X(_.hits)},it=async()=>{let _=await W9(d,Ie+1);_.query===d&&_.page-1===Ie&&(me(_.page),X([...ce,..._.hits]))};return E(()=>{d?ke():X([])},[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)),ce.length?h.createElement(r,{radius:2,loop:!1,children:ce.map(_=>h.createElement(N,{key:_.name,hit:_,active:!1})),willReachEnd:it}):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(R,null)),ye.length?ye.map(_=>h.createElement(U,{key:_,name:_,active:!1})):h.createElement(p,{color:"gray"},"No selected packages..."),h.createElement(K,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(pe=>ie.get(pe)==="regular"),le=Array.from(ie.keys()).filter(pe=>ie.get(pe)==="dev"),ge=Array.from(ie.keys()).filter(pe=>ie.get(pe)==="peer");return fe.length&&await this.cli.run(["add",...fe]),le.length&&await this.cli.run(["add","--dev",...le]),ge&&await this.cli.run(["add","--peer",...ge]),0}};Ge();jt();IG();var Hwe=et(hi());Jo();var _we=/^((?:[\^~]|>=?)?)([0-9]+)(\.[0-9]+)(\.[0-9]+)((?:-\S+)?)$/;function jwe(e,t){return e.length>0?[e.slice(0,t)].concat(jwe(e.slice(t),t)):[]}var gw=class extends ft{constructor(){super(...arguments);this.mode=he.String("--mode",{description:"Change what artifacts installs genera Line truncated
${E}, next tree:
${Fb(f)}`);let S=Wwe(f);if(S)throw new Error(`${S}, after hoisting finished:
${Fb(f)}`)}return n.debugLevel>=2&&console.log(Fb(f)),wht(f)},dht=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},ght=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},qwe=(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:R}=t,N={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(R)},U=N.dependencies.get(r);return U&&U.ident==N.ident&&N.dependencies.set(r,N),e.dependencies.set(N.name,N),N},mht=(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},DY=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},xY=(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=Bht(c),p=mht(c,f),h=e==c?new Map:a.fastLookupPossible?dht(t):ght(t),E,C=!1,S=!1,x=new Map(Array.from(p.entries()).map(([R,N])=>[R,N[0]])),I=new Map;do{let R=Iht(e,t,r,h,x,p,s,I,a);R.isGraphChanged&&(S=!0),R.anotherRoundNeeded&&(C=!0),E=!1;for(let[N,U]of p)U.length>1&&!c.dependencies.has(N)&&(x.delete(N),U.shift(),x.set(N,U[0]),E=!0)}while(E);for(let R of c.dependencies.values())if(!c.peerNames.has(R.name)&&!r.has(R.locator)){r.add(R.locator);let N=xY(e,[...t,R],r,I,a);N.isGraphChanged&&(S=!0),N.anotherRoundNeeded&&(C=!0),r.delete(R.locator)}return{anotherRoundNeeded:C,isGraphChanged:S}},yht=e=>{for(let[t,r]of e.dependencies)if(!e.peerNames.has(t)&&r.ident!==e.ident)return!0;return!1},Eht=(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(N=>So(N)).join("\u2192")}`);let x=r[r.length-1],R=!(s.ident===x.ident);if(p&&!R&&(C="- self-reference"),R&&(R=s.dependencyKind!==1,p&&!R&&(C="- workspace")),R&&s.dependencyKind===2&&(R=!yht(s),p&&!R&&(C="- external soft link with unhoisted dependencies")),R&&(R=!e.peerNames.has(s.name),p&&!R&&(C=`- cannot shadow peer: ${So(e.originalDependencies.get(s.name).locator)} at ${E}`)),R){let N=!1,U=a.get(s.name);if(N=!U||U.ident===s.ident,p&&!N&&(C=`- filled by: ${So(U.locator)} at ${E}`),N)for(let K=r.length-1;K>=1;K--){let ie=r[K].dependencies.get(s.name);if(ie&&ie.ident!==s.ident){N=!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,K).map(le=>So(le.locator)).join("\u2192")}`);break}}R=N}if(R&&(R=n.get(s.name)===s.ident,p&&!R&&(C=`- filled by: ${So(c.get(s.name)[0])} at ${E}`)),R){let N=!0,U=new Set(s.peerNames);for(let K=r.length-1;K>=1;K--){let $=r[K];for(let ie of U){if($.peerNames.has(ie)&&$.originalDependencies.has(ie))continue;let fe=$.dependencies.get(ie);fe&&e.dependencies.get(ie)!==fe&&(K===r.length-1?S.add(fe):(S=null,N=!1,p&&(C=`- peer dependency ${So(fe.locator)} from parent ${So($.locator)} was not hoisted to ${E}`))),U.delete(ie)}if(!N)break}R=N}if(R&&!h)for(let N of s.hoistedDependencies.values()){let U=a.get(N.name)||e.dependencies.get(N.name);if(!U||N.ident!==U.ident){R=!1,p&&(C=`- previously hoisted dependency mismatch, needed: ${So(N.locator)}, available: ${So(U?.locator)}`);break}}return S!==null&&S.size>0?{isHoistable:2,dependsOn:S,reason:C}:{isHoistable:R?0:1,reason:C}},YF=e=>`${e.name}@${e.locator}`,Iht=(e,t,r,s,a,n,c,f,p)=>{let h=t[t.length-1],E=new Set,C=!1,S=!1,x=(U,K,$,ie,fe)=>{if(E.has(ie))return;let le=[...K,YF(ie)],ge=[...$,YF(ie)],pe=new Map,De=new Map;for(let me of DY(ie)){let ce=Eht(h,r,[h,...U,ie],me,s,a,n,f,{outputReason:p.debugLevel>=2,fastLookupPossible:p.fastLookupPossible});if(De.set(me,ce),ce.isHoistable===2)for(let X of ce.dependsOn){let be=pe. Line truncated
${Fb(e)}`)}let Ie=DY(ie);for(let me of Ie)if(ye.has(me)){let ce=De.get(me);if((a.get(me.name)===me.ident||!ie.reasons.has(me.name))&&ce.isHoistable!==0&&ie.reasons.set(me.name,ce.reason),!me.isHoistBorder&&ge.indexOf(YF(me))<0){E.add(ie);let be=qwe(ie,me);x([...U,ie],le,ge,be,R),E.delete(ie)}}},I,R=new Set(DY(h)),N=Array.from(t).map(U=>YF(U));do{I=R,R=new Set;for(let U of I){if(U.locator===h.locator||U.isHoistBorder)continue;let K=qwe(h,U);x([],Array.from(r),N,K,R)}}while(R.size>0);return{anotherRoundNeeded:C,isGraphChanged:S}},Wwe=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(", ")}`:""}`,R=`${x?` hoisted to ${x}`:""}`,N=`${C()}${I}`;E?E.ident!==h.ident&&t.push(`${N} - broken require promise for ${h.name}${R}: expected ${h.ident}, but found: ${E.ident}`):t.push(`${N} - broken require promise: no required dependency ${h.name}${R} 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(`
`)},Cht=(e,t)=>{let{identName:r,name:s,reference:a,peerNames:n}=e,c={name:s,references:new Set([a]),locator:PY(r,a),ident:Gwe(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:R,peerNames:N,hoistPriority:U,dependencyKind:K}=h,$=t.hoistingLimits.get(E.locator);C={name:x,references:new Set([R]),locator:PY(I,R),ident:Gwe(I,R),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(N),reasons:new Map,decoupled:!0,isHoistBorder:$?$.has(x):!1,hoistPriority:U||0,dependencyKind:K||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=R=>{if(!x.has(R)){x.add(R),R.decoupled=!1;for(let N of R.dependencies.values())R.peerNames.has(N.name)||I(N)}};I(C)}else for(let x of h.dependencies)p(x,C)};for(let h of e.dependencies)p(h,c);return c},kY=e=>e.substring(0,e.indexOf("@",1)),wht=e=>{let t={name:e.name,identName:kY(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:kY(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},Bht=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 Fb=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=kY(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 Nb=(s=>(s.WORKSPACES="workspaces",s.DEPENDENCIES="dependencies",s.NONE="none",s))(Nb||{}),Vwe="node_modules",ng="$wsroot$";var Ob=(e,t)=>{let{packageTree:r,hoistingLimits:s,errors:a,preserveSymlinksRequired:n}=Sht(e,t),c=null;if(a.length===0){let f=Ywe(r,{hoistingLimits:s});c=Dht(e,f,t)}return{tree:c,errors:a,preserveSymlinksRequired:n}},gA=e=>`${e.name}@${e.reference}`,TY=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(Y.delimiter).length,c=a.split(Y.delimiter).length;return a===s?0:n!==c?c-n:a>s?1:-1});return t},Kwe=(e,t)=>{let r=H.isVirtualLocator(e)?H.devirtualizeLocator(e):e,s=H.isVirtualLocator(t)?H.devirtualizeLocator(t):t;return H.areLocatorsEqual(r,s)},QY=(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 Y.contains(s,a)===null},vht=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 R=e.getPackageInformation(S);if(R){let N=x?gA(x):"";if(gA(S)!==N&&R.linkType==="SOFT"&&!S.reference.startsWith("link:")&&!QY(R,S,e,s)){let U=Jwe(R,S,e);(!f.get(U)||S.reference.startsWith("workspace:"))&&f.set(U,S)}for(let[U,K]of R.packageDependencies)K!==null&&(R.packagePeers.has(U)||h(e.getLocator(U,K),S))}};for(let S of c)h(S,null);let E=s.split(Y.sep);for(let S of f.values()){let x=e.getPackageInformation(S),R=Ae.toPortablePath(x.packageLocation.slice(0,-1)).split(Y.sep).slice(E.length),N=n;for(let U of R){let K=N.children.get(U);K||(K={children:new Map},N.children.set(U,K)),N=K}N.workspaceLocator=S}let C=(S,x)=>{if(S.workspaceLocator){let I=gA(x),R=a.get(I);R||(R=new Set,a.set(I,R)),R.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},Sht=(e,t)=>{let r=[],s=!1,a=new Map,n=vht(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,R,N,U,K,$,ie)=>{let fe=C(x,R),le=E.get(fe),ge=!!le;!ge&&R.name===f.name&&R.reference===f.reference&&(le=h,E.set(fe,h));let pe=QY(I,R,e,p);if(!le){let me=0;pe?me=2:I.linkType==="SOFT"&&R.name.endsWith(ng)&&(me=1),le={name:x,identName:R.name,reference:R.reference,dependencies:new Set,peerNames:me===1?new Set:I.packagePeers,dependencyKind:me},E.set(fe,le)}let De;if(pe?De=2:U.linkType==="SOFT"?De=1:De=0,le.hoistPriority=Math.max(le.hoistPriority||0,De),ie&&!pe){let me=gA({name:N.identName,reference:N.reference}),ce=a.get(me)||new Set;a.set(me,ce),ce.add(le.name)}let ye=new Map(I.packageDependencies);if(t.project){let me=t.project.workspacesByCwd.get(Ae.toPortablePath(I.packageLocation.slice(0,-1)));if(me){let ce=new Set([...Array.from(me.manifest.peerDependencies.values(),X=>H.stringifyIdent(X)),...Array.from(me.manifest.peerDependenciesMeta.keys())]);for(let X of ce)ye.has(X)||(ye.set(X,K.get(X)||null),le.peerNames.add(X))}}let d=gA({name:R.name.replace(ng,""),reference:R.reference}),ve=n.get(d);if(ve)for(let me of ve)ye.set(`${me.name}${ng}`,me.reference);(I!==U||I.linkType!=="SOFT"||!pe&&(!t.selfReferencesByCwd||t.selfReferencesByCwd.get($)))&&N.dependencies.add(le);let Ie=R!==f&&I.linkType==="SOFT"&&!R.name.endsWith(ng)&&!pe;if(!ge&&!Ie){let me=new Map;for(let[ce,X]of ye)if(X!==null){let be=e.getLocator(ce,X),ke=e.getLocator(ce.replace(ng,""),X),it=e.getPackageInformation(ke);if(it===null)throw new Error("Assertion failed: Expected the package to have been registered");let _=QY(it,be,e,p);if(t.validateExternalSoftLinks&&t.project&&_){it.packageDependencies.size>0&&(s=!0);for(let[je,Te]of it.packageDependencies)if(Te!==null){let ct=H.parseLocator(Array.isArray(Te)?`${Te[0]}@${Te[1]}`:`${je}@${Te}`);if(gA(ct)!==gA(be)){let Me=ye.get(je);if(Me){let P=H.parseLocator(Array.isArray(Me)?`${Me[0]}@${Me[1]}`:`${je}@${Me}`);Kwe(P,ct)||r.push({messageName:71,text:`Cannot link ${H.prettyIdent(t.project.configuration,H.parseIdent(be.name))} into ${H.prettyLine truncated
`;for(let n=0,c=e.length;n<c;++n)a+=s+WF(String(n),e[n],t,s).replace(/^ +/,""),n+1<c&&(a+=","),a+=`
`;return a+=r,a+="]",a}function Mht(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+=WF(p,h,t,r).replace(/^ +/g,""),f+=1)}return a+="}",a}function Uht(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+=WF(h,E,t,a).replace(/^ +/g,""),c+=1)}return c!==0&&(n+=`
`),n+=r,n+="}",n}function WF(e,t,r,s){let{next:a}=Zwe[r],n=a[e]||a["*"];return Xwe(t,n,s)}function Xwe(e,t,r){let{collapsed:s}=Zwe[t];return Array.isArray(e)?s?Oht(e,t,r):Lht(e,t,r):typeof e=="object"&&e!==null?s?Mht(e,t,r):Uht(e,t,r):JSON.stringify(e)}function $we(e){return Xwe(e,"TOP_LEVEL","")}function Lb(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 _ht(e){let t=new Map,r=Lb(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 Hht(e){return Lb(e.fallbackPool||[],([t])=>t)}function jht(e){let t=[],r=e.dependencyTreeRoots.find(s=>e.packageRegistry.get(s.name)?.get(s.reference)?.packageLocation==="./");for(let[s,a]of Lb(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 Lb(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,K]of p)S.push([U,K]);let x=Lb(S,([U])=>U),I=h&&h.size>0?Array.from(h):void 0,N={packageLocation:f,packageDependencies:x,packagePeers:I,linkType:E,discardFromLookup:C||void 0};n.push([c,N]),r&&s===r.name&&c===r.reference&&t.unshift([null,[[null,N]]])}}return t}function Mb(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:_ht(e),fallbackPool:Hht(e),packageRegistryData:jht(e)}}var r1e=et(t1e());function n1e(e,t){return[e?`${e}
`:"",`/* eslint-disable */
`,`// @ts-nocheck
`,`"use strict";
`,`
`,t,`
`,(0,r1e.default)()].join("")}function Ght(e){return JSON.stringify(e,null,2)}function qht(e){return`'${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,`\\
`)}'`}function Yht(e){return[`const RAW_RUNTIME_STATE =
`,`${qht($we(e))};
`,`function $$SETUP_STATE(hydrateRuntimeState, basePath) {
`,` return hydrateRuntimeState(JSON.parse(RAW_RUNTIME_STATE), {basePath: basePath || __dirname});
`,`}
`].join("")}function Wht(){return[`function $$SETUP_STATE(hydrateRuntimeState, basePath) {
`,` const fs = require('fs');
`,` const path = require('path');
`,` const pnpDataFilepath = path.resolve(__dirname, ${JSON.stringify(yr.pnpData)});
`,` return hydrateRuntimeState(JSON.parse(fs.readFileSync(pnpDataFilepath, 'utf8')), {basePath: basePath || __dirname});
`,`}
`].join("")}function i1e(e){let t=Mb(e),r=Yht(t);return n1e(e.shebang,r)}function s1e(e){let t=Mb(e),r=Wht(),s=n1e(e.shebang,r);return{dataFile:Ght(t),loaderFile:s}}bt();function LY(e,{basePath:t}){let r=Ae.toPortablePath(t),s=Y.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 R=I.discardFromLookup??!1,N={name:C,reference:x},U=n.get(I.packageLocation);U?(U.discardFromLookup=U.discardFromLookup&&R,R||(U.locator=N)):n.set(I.packageLocation,{locator:N,discardFromLookup:R});let K=null;return[x,{packageDependencies:new Map(I.packageDependencies),packagePeers:new Set(I.packagePeers),linkType:I.linkType,discardFromLookup:R,get packageLocation(){return K||(K=Y.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=Ce("module"),Km=Ce("url"),KY=Ce("util");var aa=Ce("url");var c1e=et(Ce("assert"));var MY=Array.isArray,Ub=JSON.stringify,_b=Object.getOwnPropertyNames,Vm=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),UY=(e,t)=>RegExp.prototype.exec.call(e,t),_Y=(e,...t)=>RegExp.prototype[Symbol.replace].apply(e,t),ig=(e,...t)=>String.prototype.endsWith.apply(e,t),HY=(e,...t)=>String.prototype.includes.apply(e,t),jY=(e,...t)=>String.prototype.lastIndexOf.apply(e,t),Hb=(e,...t)=>String.prototype.indexOf.apply(e,t),o1e=(e,...t)=>String.prototype.replace.apply(e,t),sg=(e,...t)=>String.prototype.slice.apply(e,t),mA=(e,...t)=>String.prototype.startsWith.apply(e,t),a1e=Map,l1e=JSON.parse;function jb(e,t,r){return class extends r{constructor(...s){super(t(...s)),this.code=e,this.name=`${r.name} [${e}]`}}}var u1e=jb("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),GY=jb("ERR_INVALID_MODULE_SPECIFIER",(e,t,r=void 0)=>`Invalid module "${e}" ${t}${r?` imported from ${r}`:""}`,TypeError),f1e=jb("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,c1e.default)(s===!1),`Invalid "exports" main target ${Ub(r)} defined in the package config ${e}package.json${a?` imported from ${a}`:""}${n?'; targets must start with "./"':""}`):`Invalid "${s?"imports":"exports"}" target ${Ub(r)} defined for '${t}' in the package config ${e}package.json${a?` imported from ${a}`:""}${n?'; targets must start with "./"':""}`},Error),Gb=jb("ERR_INVALID_PACKAGE_CONFIG",(e,t,r)=>`Invalid package config ${e}${t?` while importing ${t}`:""}${r?`. ${r}`:""}`,Error),A1e=jb("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 KF=Ce("url");function p1e(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 VF=new a1e;function Vht(e,t,r,s){let a=VF.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 VF.set(e,x),x}let c;try{c=l1e(n)}catch(x){throw new Gb(e,(r?`"${t}" from `:"")+(0,KF.fileURLToPath)(r||t),x.message)}let{imports:f,main:p,name:h,type:E}=p1e(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 VF.set(e,S),S}function h1e(e,t){let r=new URL("./package.json",e);for(;;){let n=r.pathname;if(ig(n,"node_modules/package.json"))break;let c=Vht((0,KF.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,KF.fileURLToPath)(r),a={pjsonPath:s,exists:!1,main:void 0,name:void 0,type:"none",exports:void 0,imports:void 0};return VF.set(s,a),a}function Kht(e,t,r){throw new u1e(e,t&&(0,aa.fileURLToPath)(new URL(".",t)),(0,aa.fileURLToPath)(r))}function Jht(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 GY(e,a,s&&(0,aa.fileURLToPath)(s))}function qb(e,t,r,s,a){throw typeof t=="object"&&t!==null?t=Ub(t,null,""):t=`${t}`,new f1e((0,aa.fileURLToPath)(new URL(".",r)),e,t,s,a&&(0,aa.fileURLToPath)(a))}var d1e=/(^|\\|\/)((\.|%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,idt]=process.versions.node.split(".").map(e=>parseInt(e,10)),b1e=ro>19||ro===19&&Sl>=2||ro===18&&Sl>=13,Qzt=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,Fzt=ro>=21||ro===20&&Sl>=10||ro===18&&Sl>=20,Nzt=ro>=22,Ozt=ro===26&&Sl<1||ro===25&&Sl>=7||ro===24&&Sl===15||ro===22&&(Sl>22||Sl===22&&idt>=3);function VY(e){if(process.env.WATCH_REPORT_DEPENDENCIES&&process.send){let t=e.map(r=>Ae.fromPortablePath(Eo.resolveVirtual(r)));if(b1e)process.send({"watch:require":t});else for(let r of t)process.send({"watch:require":r})}}function JY(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 Fe of["react-scripts","gatsby"]){let Qe=e.packageRegistry.get(Fe);if(Qe)for(let Se of Qe.keys()){if(Se===null)throw new Error("Assertion failed: This reference shouldn't be null");h.push({name:Fe,reference:Se})}}let{ignorePattern:C,packageRegistry:S,packageLocatorsByLocations:x}=e;function I(Fe,Qe){return{fn:Fe,args:Qe,error:null,result:null}}function R(Fe){let Qe=process.stderr?.hasColors?.()??process.stdout.isTTY,Se=(ct,Me)=>`\x1B[${ct}m${Me}\x1B[0m`,je=Fe.error;console.error(je?Se("31;1",`\u2716 ${Fe.error?.message.replace(/\n.*/s,"")}`):Se("33;1","\u203C Resolution")),Fe.args.length>0&&console.error();for(let ct of Fe.args)console.error(` ${Se("37;1","In \u2190")} ${(0,KY.inspect)(ct,{colors:Qe,compact:!0})}`);Fe.result&&(console.error(),console.error(` ${Se("37;1","Out \u2192")} ${(0,KY.inspect)(Fe.result,{colors:Qe,compact:!0})}`));let Te=new Error().stack.match(/(?<=^ +)at.*/gm)?.slice(2)??[];if(Te.length>0){console.error();for(let ct of Te)console.error(` ${Se("38;5;244",ct)}`)}console.error()}function N(Fe,Qe){if(t.allowDebug===!1)return Qe;if(Number.isFinite(s)){if(s>=2)return(...Se)=>{let je=I(Fe,Se);try{return je.result=Qe(...Se)}catch(Te){throw je.error=Te}finally{R(je)}};if(s>=1)return(...Se)=>{try{return Qe(...Se)}catch(je){let Te=I(Fe,Se);throw Te.error=je,R(Te),je}}}return Qe}function U(Fe){let Qe=d(Fe);if(!Qe)throw Es("INTERNAL","Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)");return Qe}function K(Fe){if(Fe.name===null)return!0;for(let Qe of e.dependencyTreeRoots)if(Qe.name===Fe.name&&Qe.reference===Fe.reference)return!0;return!1}let $=new Set(["node","require",...S1e("--conditions")]);function ie(Fe,Qe=$,Se){let je=me(Y.join(Fe,"internal.js"),{resolveIgnored:!0,includeDiscardFromLookup:!0});if(je===null)throw Es("INTERNAL",`The locator that owns the "${Fe}" path can't be found inside the dependency tree (this is probably an internal error)`);let{packageLocation:Te}=U(je),ct=Y.join(Te,yr.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=Y.contains(Te,Fe);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=E1e({packageJSONUrl:(0,Km.pathToFileURL)(Ae.fromPortablePath(ct)),packageSubpath:P,exports:Me.exports,base:Se?(0,Km.pathToFileURL)(Ae.fromPortablePath(Se)):null,conditions:Qe});return Ae.toPortablePath((0,Km.fileURLToPath)(w))}catch(w){throw Es("EXPORTS_RESOLUTION_FAILED",w.message,{unqualifiedPath:ff(Fe),locator:je,pkgJson:Me,subpath:ff(P),conditions:Qe},w.code)}}function fe(Fe,Qe,{extensions:Se}){let je;try{Qe.push(Fe),je=t.fakeFs.statSync(Fe)}catch{}if(je&&!je.isDirectory())return t.fakeFs.realpathSync(Fe);if(je&&je.isDirectory()){let Te;try{Te=JSON.parse(t.fakeFs.readFileSync(Y.join(Fe,yr.manifest),"utf8"))}catch{}let ct;if(Te&&Te.main&&(ct=Y.resolve(Fe,Te.main)),ct&&ct!==Fe){let Me=fe(ct,Qe,{extensions:Se});if(Me!==null)return Me}}for(let Te=0,ct=Se.length;Te<ct;Te++){let Me=`${Fe}${Se[Te]}`;if(Qe.push(Me),t.fakeFs.existsSync(Me))return Me}if(je&&je.isDirectory())for(let Te=0,ct=Se.length;Te<ct;Te++){let Me=Y.format({dir:Fe,name:"index",ext:Se[Te]});if(Qe.push(Me),t.fakeFs.existsSync(Me))return Me}return null}function le(Fe){let Qe=new oh.Module(Fe,null);return Qe.filename=Fe,Qe.paths=oh.Module._nodeModulePaths(Fe),Qe}function ge(Fe,Qe){return Qe.endsWith("/")&&(Qe=Y.join(Qe,"internal.js")),oh.Module._resolveFilename(Ae.fromPortablePath(Fe),le(Ae.fromPortablePath(Qe)),!1,{plugnplay:!1})}function pe(Fe){if(C===null)return!1;let Qe=Y.contains(e.basePath,Fe);return Qe===null?!1:!!C.test(Qe.replace(/\/$/,""))}let De={std:3,resolveVirtual:1,getAllLocators:1},ye=p;function d({name:Fe,reference:Qe}){let Se=S.get(Fe);if(!Se)return null;let je=Se.get(Qe);return je||null}function ve({name:Fe,reference:Qe}){let Se=[];for(let[je,Te]of S)if(je!==null)for(let[ct,Me]of Te)ct===null|Line truncated
Require request: "${je}"
Required by: ${Te}
`,{request:je,issuer:Te});return Ae.toPortablePath(P)}let ct,Me=Fe.match(a);if(Me){if(!Qe)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:Te});let[,P,w]=Me,D=me(Qe);if(!D){let Ne=ge(Fe,Qe);if(Ne===!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: ${Te}
`,{request:je,issuer:Te});return Ae.toPortablePath(Ne)}let F=U(D).packageDependencies.get(P),z=null;if(F==null&&D.name!==null){let Ne=e.fallbackExclusionList.get(D.name);if(!Ne||!Ne.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 Z=null;if(F===null)if(K(D))Z=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: ${Te}
`,{request:je,issuer:Te,dependencyName:P});else{let Ne=Ie(P,D);Ne.every(ut=>K(ut))?Z=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 ${Te})
${Ne.map(ut=>`Ancestor breaking the chain: ${ut.name}@${ut.reference}
`).join("")}
`,{request:je,issuer:Te,issuerLocator:Object.assign({},D),dependencyName:P,brokenAncestors:Ne}):Z=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 ${Te})
${Ne.map(ut=>`Ancestor breaking the chain: ${ut.name}@${ut.reference}
`).join("")}
`,{request:je,issuer:Te,issuerLocator:Object.assign({},D),dependencyName:P,brokenAncestors:Ne})}else F===void 0&&(!Se&&(0,oh.isBuiltin)(Fe)?K(D)?Z=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: ${Te}
`,{request:je,issuer:Te,dependencyName:P}):Z=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: ${Te}
`,{request:je,issuer:Te,issuerLocator:Object.assign({},D),dependencyName:P}):K(D)?Z=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: ${Te}
`,{request:je,issuer:Te,dependencyName:P}):Z=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 ${Te})
`,{request:je,issuer:Te,issuerLocator:Object.assign({},D),dependencyName:P}));if(F==null){if(z===null||Z===null)throw Z||new Error("Assertion failed: Expected an error to have been set");F=z;let Ne=Z.message.replace(/\n.*/g,"");Z.message=Ne,!E.has(Ne)&&s!==0&&(E.add(Ne),process.emitWarning(Z))}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 ${Te})
`,{request:je,issuer:Te,dependencyLocator:Object.assign({},ee)});let xe=se.packageLocation;w?ct=Y.join(xe,w):ct=xe}else if(Y.isAbsolute(Fe))ct=Y.normalize(Fe);else{if(!Qe)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:Te});let P=Y.resolve(Qe);Qe.match(c)?ct=Y.normalize(Y.join(P,Fe)):ct=Y.normalize(Y.join(Y.dirname(P),Fe))}return Y.normalize(ct)}function be(Fe,Qe,Se=$,je){if(n.test(Fe))return Qe;let Te=ie(Qe,Se,je);return Te?Y.normalize(Te):Qe}function ke(Fe,{extensions:Qe=Object.keys(oh.Module._extensions)}={}){let Se=[],je=fe(Fe,Se,{extensions:Qe});if(je)return VY([je]),Y.normalize(je);{VY(Se);let Te=ff(Fe),ct=me(Fe);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:Te,extensions:Qe})}}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:Te,extensions:Qe})}}throw Es("QUALIFIED_PATH_RESOLUTION_FAILED",`Qualified path resolution failed: we looked for the following paths, but none could be accessed.
Source path: ${Te}
${Se.map(Me=>`Not found: ${ff(Me)}
`).join("")}`,{unqualifiedPath:Te,extensions:Qe})}}function it(Fe,Qe,Se){if(!Qe)throw new Error("Assertion failed: An issuer is required to resolve private import mappings");let je=I1e({name:Fe,base:(0,Km.pathToFileURL)(Ae.fromPortablePath(Qe)),conditions:Se.conditions??$,readFileSyncFn:ce});if(je instanceof URL)return ke(Ae.toPortablePath((0,Km.fileURLToPath)(je)),{extensions:Se.extensions});if(je.startsWith("#"))throw new Error("Mapping from one private import to another isn't allowed");return _(je,Qe,Se)}function _(Fe,Qe,Se={}){try{if(Fe.startsWith("#"))return it(Fe,Qe,Se);let{considerBuiltins:je,extensions:Te,conditions:ct}=Se,Me=X(Fe,Qe,{considerBuiltins:je});if(Fe==="pnpapi")return Me;if(Me===null)return null;let P=()=>Qe!==null?pe(Qe):!1,w=(!je||!(0,oh.isBuiltin)(Fe))&&!P()?be(Fe,Me,ct,Qe):Me;return ke(w,{extensions:Te})}catch(je){throw Object.hasOwn(je,"pnpCode")&&Object.assign(je.data,{request:ff(Fe),issuer:Qe&&ff(Qe)}),je}}function tt(Fe){let Qe=Y.normalize(Fe),Se=Eo.resolveVirtual(Qe);return Se!==Qe?Se:null}return{VERSIONS:De,topLevel:ye,getLocator:(Fe,Qe)=>Array.isArray(Qe)?{name:Qe[0],reference:Qe[1]}:{name:Fe,reference:Qe},getDependencyTreeRoots:()=>[...e.dependencyTreeRoots],getAllLocators(){let Fe=[];for(let[Qe,Se]of S)for(let je of Se.keys())Qe!==null&&je!==null&&Fe.push({name:Qe,reference:je});return Fe},getPackageInformation:Fe=>{let Qe=d(Fe);if(Qe===null)return null;let Se=Ae.fromPortablePath(Qe.packageLocation);return{...Qe,packageLocation:Se}},findPackageLocator:Fe=>me(Ae.toPortablePath(Fe)),resolveToUnqualified:N("resolveToUnqualified",(Fe,Qe,Se)=>{let je=Qe!==null?Ae.toPortablePath(Qe):null,Te=X(Ae.toPortablePath(Fe),je,Se);return Te===null?null:Ae.fromPortablePath(Te)}),resolveUnqualified:N("resolveUnqualified",(Fe,Qe)=>Ae.fromPortablePath(ke(Ae.toPortablePath(Fe),Qe))),resolveRequest:N("resolveRequest",(Fe,Qe,Se)=>{let je=Qe!==null?Ae.toPortablePath(Qe):null,Te=_(Ae.toPortablePath(Fe),je,Se);return Te===null?null:Ae.fromPortablePath(Te)}),resolveVirtual:N("resolveVirtual",Fe=>{let Qe=tt(Ae.toPortablePath(Fe));return Qe!==null?Ae.fromPortablePath(Qe):null})}}bt();var D1e=(e,t,r)=>{let s=Mb(e),a=LY(s,{basePath:t}),n=Ae.join(t,yr.pnpCjs);return JY(a,{fakeFs:r,pnpapiResolution:n})};var ZY=et(x1e());jt();var yA={};Vt(yA,{checkManifestCompatibility:()=>k1e,extractBuildRequest:()=>JF,getExtractHint:()=>XY,hasBindingGyp:()=>$Y});Ge();bt();function k1e(e){return H.isPackageCompatible(e,Ui.getArchitectureSet())}function JF(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,`${H.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,`${H.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,`${H.prettyLocator(s,e)} lists build scripts, but all build scripts have been disabled.`)}:k1e(e)?{skipped:!1,directives:a}:{skipped:!0,explain:n=>n.reportWarningOnce(76,`${H.prettyLocator(s,e)} The ${Ui.getArchitectureName()} architecture is incompatible with this package, build skipped.`)}}var odt=new Set([".exe",".bin",".h",".hh",".hpp",".c",".cc",".cpp",".java",".jar",".node"]);function XY(e){return e.packageFs.getExtractHint({relevantExtensions:odt})}function $Y(e){let t=Y.join(e.prefixPath,"binding.gyp");return e.packageFs.existsSync(t)}var Vb={};Vt(Vb,{getUnpluggedPath:()=>Wb});Ge();bt();function Wb(e,{configuration:t}){return Y.resolve(t.get("pnpUnpluggedFolder"),H.slugifyLocator(e))}var adt=new Set([H.makeIdent(null,"open").identHash,H.makeIdent(null,"opn").identHash]),og=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=ag(r.project).cjs;if(!ae.existsSync(s))throw new ot(`The project in ${ue.pretty(r.project.configuration,`${r.project.cwd}/package.json`,ue.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:H.stringifyIdent(t),reference:t.reference},c=a.getPackageInformation(n);if(!c)throw new ot(`Couldn't find ${H.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: ${G1e}
`,n+=` nmMode: ${s.value}
`;let c=Array.from(t.keys()).sort(),f=H.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=Y.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=Y.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[R,N]of x){let U=Y.relative(Y.join(S,wi),N);n+=` ${JSON.stringify(R)}: ${JSON.stringify(U)}
`}}}}let p=e.cwd,h=Y.join(p,wi,uW);try{a&&await ae.removePromise(h),await ae.changeFilePromise(h,n,{automaticNewlines:!0})}finally{Qdt(e)}}async function Fdt(e){let t=e.cwd,r=Y.join(t,wi,uW);try{let s=await ae.statPromise(r);return`${s.mtimeMs}:${s.size}`}catch{return null}}async function q1e(e,{unrollAliases:t=!1}={}){let r=e.cwd,s=Y.join(r,wi,uW),a;try{a=await ae.statPromise(s)}catch{}if(!a)return null;let n=us(await ae.readFilePromise(s,"utf8"));if(n.__metadata.version>G1e)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=>Y.join(r,x)),S=E.bin;if(S)for(let[x,I]of Object.entries(S)){let R=Y.join(r,Ae.toPortablePath(x)),N=qe.getMapWithDefault(p,R);for(let[U,K]of Object.entries(I))N.set(U,Ae.toPortablePath([R,wi,K].join(Y.sep)))}if(f.set(h,{target:wt.dot,linkType:"HARD",locations:C,aliases:E.aliases||[]}),t&&E.aliases)for(let x of E.aliases){let{scope:I,name:R}=H.parseLocator(h),N=H.makeLocator(H.makeIdent(I,R),x),U=H.stringifyLocator(N);f.set(U,{target:wt.dot,linkType:"HARD",locations:C,aliases:[]})}}return{locatorMap:f,binSymlinks:p,locationTree:Y1e(f,{skipPrefix:e.cwd}),nmMode:c,mtimeMs:a.mtimeMs}}var ww=async(e,t)=>{if(e.split(Y.sep).indexOf(wi)<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 ae.lstatPromise(e),!r.isDirectory()&&!r.isSymbolicLink()||r.isSymbolicLink()&&!t.isWorkspaceDir)){await ae.unlinkPromise(e);return}let s=await ae.readdirPromise(e,{withFileTypes:!0});for(let n of s){let c=Y.join(e,n.name);n.isDirectory()?(n.name!==wi||t&&t.innerLoop)&&await ww(c,{innerLoop:!0,contentsOnly:!1}):await ae.unlinkPromise(c)}let a=!t.innerLoop&&t.isWorkspaceDir&&r?.isSymbolicLink();!t.contentsOnly&&!a&&await ae.rmdirPromise(e)}catch(r){if(r.code!=="ENOENT"&&r.code!=="ENOTEMPTY")throw r}},U1e=4,$F=(e,{skipPrefix:t})=>{let r=Y.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(Y.sep).filter(p=>p!==""),a=s.indexOf(wi),n=s.slice(0,a).join(Y.sep),c=Y.join(t,n),f=s.slice(a);return{locationRoot:c,segments:f}},Y1e=(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"&&Y.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}=$F(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},AW=async(e,t,r)=>{if(process.platform==="win32"&&r==="junctions"){let s;try{s=await ae.lstatPromise(e)}catch{}if(!s||s.isDirectory()){await ae.symlinkPromise(e,t,"junction");return}}await ae.symlinkPromise(Y.relative(Y.dirname(t),e),t)};async function W1e(e,t,r){let s=Y.join(e,`${cW.default.randomBytes(16).toString("hex")}.tmp`);try{await ae.writeFilePromise(s,r);try{await ae.linkPromise(s,t)}catch{}}finally{await ae.unlinkPromise(s)}}async function Ndt({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=Y.join(s,r.digest.substring(0,2),`${r.digest.substring(2)}.dat`),p;try{let h=await ae.statPromise(f);if(h&&(!r.mtimeMs||h.mtimeMs>r.mtimeMs||h.mtimeMs<r.mtimeMs-kdt))if(await Mn.checksumFile(f,{baseFs:ae,algorithm:"sha1"})!==r.digest){let C=Y.join(s,`${cW.default.randomBytes(16).toString("hex")}.tmp`);await ae.renamePromise(f,C);let S=await a.readFilePromise(e);await ae.writeFilePromise(C,S);try{await ae.linkPromise(C,f),r.mtimeMs=new Date().getTime(),await ae.unlinkPromise(C)}catch{}}else r.mtimeMs||(r.mtimeMs=Math.ceil(h.mtimeMs));await ae.linkPromise(f,t),p=!0}catch{p=!1}if(!p){let h=await a.readFilePromise(e);await W1e(s,f,h),r.mtimeMs=new Date().getTime();try{await ae.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 ae.chmodPromise(t,c)}}var Odt=async(e,t,{baseFs:r,globalHardlinksStore:s,nmMode:a,windowsLinkType:n,packageChecksum:c})=>{await ae.mkdirPromise(e,{recursive:!0});let f=async(E=wt.dot)=>{let C=Y.join(t,E),S=await r.readdirPromise(C,{withFileTypes:!0}),x=new Map;for(let I of S){let R=Y.join(E,I.name),N,U=Y.join(C,I.name);if(I.isFile()){if(N={kind:"file",mode:(await r.lstatPromise(U)).mode},a.value==="hardlinks-global"){let K=await Mn.checksumFile(U,{baseFs:r,algorithm:"sha1"});N.digest=K}}else if(I.isDirectory())N={kind:"directory"};else if(I.isSymbolicLink())N={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,mW.prompt)({type:"password",name:"otp",message:"One-time password:",required:!0,onCancel:()=>process.exit(130)});return process.stdout.write(`
`),s}function rN(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 Sw(e){return{"npm-otp":e}}async function cgt(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 $b=class{supports(t,r){if(!t.reference.startsWith(ti))return!1;let{selector:s,params:a}=H.parseRange(t.reference);return!(!r2e.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,`${H.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:H.getIdentVendorPath(t),checksum:c}}async fetchFromNetwork(t,r){let{params:s}=H.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 Zm(s.__archiveUrl,{customErrorMessage:zm,configuration:r.project.configuration,ident:t});return await ms.convertToZip(a,{configuration:r.project.configuration,prefixPath:H.getIdentVendorPath(t),stripComponents:1})}};Ge();var eD=class{supportsDescriptor(t,r){return!(!t.range.startsWith(ti)||!H.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(H.parseDescriptor(t.range.slice(ti.length),!0));return r.resolver.getResolutionDependencies(s,r)}async getCandidates(t,r,s){let a=s.project.configuration.normalizeDependency(H.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(H.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 n2e=et(hi());var ah=class e{supports(t,r){if(!t.reference.startsWith(ti))return!1;let s=new URL(t.reference);return!(!n2e.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,`${H.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:H.getIdentVendorPath(t),checksum:c}}async fetchFromNetwork(t,r){let s;try{s=await Zm(e.getLocatorUrl(t),{customErrorMessage:zm,configuration:r.project.configuration,ident:t})}catch{s=await Zm(e.getLocatorUrl(t).replace(/%2f/g,"/"),{customErrorMessage:zm,configuration:r.project.configuration,ident:t})}return await ms.convertToZip(s,{configuration:r.project.configuration,prefixPath:H.getIdentVendorPath(t),stripComponents:1})}static isConventionalTarballUrl(t,r,{configuration:s}){let a=Bw(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 EW=et(hi());var nN=H.makeIdent(null,"node-gyp"),ugt=/\b(node-gyp|prebuild-install)\b/,tD=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:Kvt,predicate:{buildType:`${Xvt}/${$vt}`,builder:{id:`${vt.CI_PROJECT_URL}/-/runners/${vt.CI_RUNNER_ID}`},invocation:{configSource:{uri:`git+${vt.CI_PROJECT_URL}`,digest:{sha1:vt.CI_COMMIT_SHA},entryPoint:vt.CI_JOB_NAME},parameters:{CI:vt.CI,CI_API_GRAPHQL_URL:vt.CI_API_GRAPHQL_URL,CI_API_V4_URL:vt.CI_API_V4_URL,CI_BUILD_BEFORE_SHA:vt.CI_BUILD_BEFORE_SHA,CI_BUILD_ID:vt.CI_BUILD_ID,CI_BUILD_NAME:vt.CI_BUILD_NAME,CI_BUILD_REF:vt.CI_BUILD_REF,CI_BUILD_REF_NAME:vt.CI_BUILD_REF_NAME,CI_BUILD_REF_SLUG:vt.CI_BUILD_REF_SLUG,CI_BUILD_STAGE:vt.CI_BUILD_STAGE,CI_COMMIT_BEFORE_SHA:vt.CI_COMMIT_BEFORE_SHA,CI_COMMIT_BRANCH:vt.CI_COMMIT_BRANCH,CI_COMMIT_REF_NAME:vt.CI_COMMIT_REF_NAME,CI_COMMIT_REF_PROTECTED:vt.CI_COMMIT_REF_PROTECTED,CI_COMMIT_REF_SLUG:vt.CI_COMMIT_REF_SLUG,CI_COMMIT_SHA:vt.CI_COMMIT_SHA,CI_COMMIT_SHORT_SHA:vt.CI_COMMIT_SHORT_SHA,CI_COMMIT_TIMESTAMP:vt.CI_COMMIT_TIMESTAMP,CI_COMMIT_TITLE:vt.CI_COMMIT_TITLE,CI_CONFIG_PATH:vt.CI_CONFIG_PATH,CI_DEFAULT_BRANCH:vt.CI_DEFAULT_BRANCH,CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX:vt.CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX,CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX:vt.CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX,CI_DEPENDENCY_PROXY_SERVER:vt.CI_DEPENDENCY_PROXY_SERVER,CI_DEPENDENCY_PROXY_USER:vt.CI_DEPENDENCY_PROXY_USER,CI_JOB_ID:vt.CI_JOB_ID,CI_JOB_NAME:vt.CI_JOB_NAME,CI_JOB_NAME_SLUG:vt.CI_JOB_NAME_SLUG,CI_JOB_STAGE:vt.CI_JOB_STAGE,CI_JOB_STARTED_AT:vt.CI_JOB_STARTED_AT,CI_JOB_URL:vt.CI_JOB_URL,CI_NODE_TOTAL:vt.CI_NODE_TOTAL,CI_PAGES_DOMAIN:vt.CI_PAGES_DOMAIN,CI_PAGES_URL:vt.CI_PAGES_URL,CI_PIPELINE_CREATED_AT:vt.CI_PIPELINE_CREATED_AT,CI_PIPELINE_ID:vt.CI_PIPELINE_ID,CI_PIPELINE_IID:vt.CI_PIPELINE_IID,CI_PIPELINE_SOURCE:vt.CI_PIPELINE_SOURCE,CI_PIPELINE_URL:vt.CI_PIPELINE_URL,CI_PROJECT_CLASSIFICATION_LABEL:vt.CI_PROJECT_CLASSIFICATION_LABEL,CI_PROJECT_DESCRIPTION:vt.CI_PROJECT_DESCRIPTION,CI_PROJECT_ID:vt.CI_PROJECT_ID,CI_PROJECT_NAME:vt.CI_PROJECT_NAME,CI_PROJECT_NAMESPACE:vt.CI_PROJECT_NAMESPACE,CI_PROJECT_NAMESPACE_ID:vt.CI_PROJECT_NAMESPACE_ID,CI_PROJECT_PATH:vt.CI_PROJECT_PATH,CI_PROJECT_PATH_SLUG:vt.CI_PROJECT_PATH_SLUG,CI_PROJECT_REPOSITORY_LANGUAGES:vt.CI_PROJECT_REPOSITORY_LANGUAGES,CI_PROJECT_ROOT_NAMESPACE:vt.CI_PROJECT_ROOT_NAMESPACE,CI_PROJECT_TITLE:vt.CI_PROJECT_TITLE,CI_PROJECT_URL:vt.CI_PROJECT_URL,CI_PROJECT_VISIBILITY:vt.CI_PROJECT_VISIBILITY,CI_REGISTRY:vt.CI_REGISTRY,CI_REGISTRY_IMAGE:vt.CI_REGISTRY_IMAGE,CI_REGISTRY_USER:vt.CI_REGISTRY_USER,CI_RUNNER_DESCRIPTION:vt.CI_RUNNER_DESCRIPTION,CI_RUNNER_ID:vt.CI_RUNNER_ID,CI_RUNNER_TAGS:vt.CI_RUNNER_TAGS,CI_SERVER_HOST:vt.CI_SERVER_HOST,CI_SERVER_NAME:vt.CI_SERVER_NAME,CI_SERVER_PORT:vt.CI_SERVER_PORT,CI_SERVER_PROTOCOL:vt.CI_SERVER_PROTOCOL,CI_SERVER_REVISION:vt.CI_SERVER_REVISION,CI_SERVER_SHELL_SSH_HOST:vt.CI_SERVER_SHELL_SSH_HOST,CI_SERVER_SHELL_SSH_PORT:vt.CI_SERVER_SHELL_SSH_PORT,CI_SERVER_URL:vt.CI_SERVER_URL,CI_SERVER_VERSION:vt.CI_SERVER_VERSION,CI_SERVER_VERSION_MAJOR:vt.CI_SERVER_VERSION_MAJOR,CI_SERVER_VERSION_MINOR:vt.CI_SERVER_VERSION_MINOR,CI_SERVER_VERSION_PATCH:vt.CI_SERVER_VERSION_PATCH,CI_TEMPLATE_REGISTRY_HOST:vt.CI_TEMPLATE_REGISTRY_HOST,GITLAB_CI:vt.GITLAB_CI,GITLAB_FEATURES:vt.GITLAB_FEATURES,GITLAB_USER_ID:vt.GITLAB_USER_ID,GITLAB_USER_LOGIN:vt.GITLAB_USER_LOGIN,RUNNER_GENERATE_ARTIFACTS_METADATA:vt.RUNNER_GENERATE_ARTIFACTS_METADATA},environment:{name:vt.CI_RUNNER_DESCRIPTION,architecture:vt.CI_RUNNER_EXECUTABLE_ARCH,server:vt.CI_SERVER_URL,project:vt.CI_PROJECT_PATH,job:{id:vt.CI_JOB_ID},pipeline:{id:vt.CI_PIPELINE_ID,ref:vt.CI_CONFIG_PATH}}},metadata:{buildInvocationId:`${vt.CI_JOB_URL}`,completeness:{parameters:!0,environment:!0,materials:!1},reproducible:!1},materials:[{uri:`git+${vt.CI_PROJECT_URL}`,digest:{sha1:vt.CI_COMMIT_SHA}}]}}}else throw new Lt(91,"Provenance generation is only supported in GitHub Actions and GitLab CI");return qDe.attest(Buffer.from(JSON.stringify(r)),Yvt,t)};async function eSt(e,t,{access:r,tag:s,registry:a,gitHead:n,provenance:c}){let f=e.manifest.name,p=e.manifest.version,h=H.stringifyIdent(f),E=WDe.default.fromData(t,{algorithms:["sha1","sha512"]}),C=r??VDe(e,f),S=await KDe(e),x=await CA.genPackageManifest(e),I=`${h}-${p}.tgz`,R=new URL(`${Kc(a)}/${h}/-/${I}`),N={[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()}},K=await YDe([U]),$=JSON.stringify(K);N[`${h}-${p}.sigstore`]={content_type:K.mediaType,data:$,length:$.length}}return{_id:h,_attachments:N,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:R.toString()}}},readme:S}}async function tSt(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 ae.readFilePromise(t,"utf8")}catch(n){if(n.code==="ENOENT")return a;throw n}return a}var pJ={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}},JDe={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"}},zDe={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"}},rSt={npmPreapprovedPackages:{description:"Array of package descriptors or package name glob patterns to exclude from the minimum release age check",type:"STRING",isArray:!0,default:[]}},nSt={configuration:{...pJ,...JDe,...zDe,...rSt,npmScopes:{description:"Settings per package scope",type:"MAP",valueDefinition:{description:"",type:"SHAPE",properties:{...pJ,...JDe,...zDe}}},npmRegistries:{description:"Settings per registry",type:"MAP",normalizeKeys:Kc,valueDefinition:{description:"",type:"SHAPE",properties:{...pJ}}}},fetchers:[$b,ah],resolvers:[eD,tD,rD]},iSt=nSt;var vJ={};Vt(vJ,{NpmAuditCommand:()=>C1,NpmInfoCommand:()=>w1,NpmLoginCommand:()=>B1,NpmLogoutCommand:()=>S1,NpmPublishCommand:()=>b1,NpmStageApproveCommand:()=>D1,NpmStageListCommand:()=>P1,NpmStageRejectCommand:()=>x1,NpmTagAddCommand:()=>Q1,NpmTagListCommand:()=>k1,NpmTagRemoveCommand:()=>T1,NpmWhoamiCommand:()=>R1,default:()=>mSt,npmAuditTypes:()=>tP,npmAuditUtils:()=>wL});Ge();Ge();jt();var EJ=et(Zo());Jo();var tP={};Vt(tP,{Environment:()=>$D,Severity:()=>eP});var $D=(s=>(s.All="all",s.Production="production",s.Development="development",s))($D||{}),eP=(n=>(n.Info="info",n.Low="low",n.Moderate="moderate",n.High="high",n.Critical="critical",n))(eP||{});var wL={};Vt(wL,{allSeverities:()=>I1,getPackages:()=>yJ,getReportTree:()=>gJ,getSeverityInclusions:()=>dJ,getTopLevelDependencies:()=>mJ});Ge();var ZDe=et(hi());var I1=["info","low","moderate","high","critical"];function dJ(e){if(typeof e>"u")return new Set(I1);let t=I1.indexOf(e),r=I1.slice(t);return new Set(r)}function gJ(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:ue.tuple(ue.Type.IDENT,H.parseIdent(s)),children:{ID:typeof n.id<"u"&&{label:"ID",value:ue.tuple(ue.Type.ID,n.id)},Issue:{label:"Issue",value:ue.tuple(ue.Type.NO_HINT,n.title)},URL:typeof n.url<"u"&&{label:"URL",value:ue.tuple(ue.Type.URL,n.url)},Severity:{label:"Severity",value:ue.tuple(ue.Type.NO_HINT,n.severity)},"Vulnerable Versions":{label:"Vulnerable Versions",value:ue.tuple(ue.Type.RANGE,n.vulnerable_versions)},"Tree Versions":{label:"Tree Versions",children:[...n.versions].sort(ZDe.default.compare).map(c=>({value:ue.tuple(ue.Type.REFERENCE,c)}))},Dependents:{label:"Dependents",children:qe.sortMap(n.dependents,c=>H.stringifyLocator(c)).map(c=>({value:ue.tuple(ue.Type.LOCATOR,c)}))}}};return r}function mJ(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 yJ(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=H.ensureDevirtualizedDescriptor(E);if(c.supportsDescriptor(x,f)){let R=c.getResolutionDependencies(x,f);if(Object.keys(R).length>0)for(let N of Object.values(R))p(h,N)}if(H.ensureDevirtualizedLocator(S).reference.startsWith("npm:")&&S.version!==null){let R=H.stringifyIdent(S),N=qe.getMapWithDefault(s,R);qe.getArrayWithDefault(N,S.version).push(h)}if(r)for(let R of S.dependencies.values())n.push([S,R])};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 C1=class extends ft{constructor(){super(...arguments);this.all=he.Boolean("-A,--all",!1,{description:"Audit dependencies from all workspaces"});this.recursive=he.Boolean("-R,--recursive",!1,{description:"Audit transitive dependencies as well"});this.environment=he.String(" 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 ${I1.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 Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let n=mJ(s,a,{all:this.all,environment:this.environment}),c=yJ(s,n,{recursive:this.recursive}),f=Array.from(new Set([...r.get("npmAuditExcludePackages"),...this.excludes])),p=Object.create(null);for(let[N,U]of c)f.some(K=>EJ.default.isMatch(N,K))||(p[N]=[...U.keys()]);let h=gn.getAuditRegistry({configuration:r}),E,C=await fA.start({configuration:r,stdout:this.context.stdout},async()=>{let N=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(H.parseIdent($),{project:s});return qe.mapAndFilter(ie,le=>{let{deprecated:ge}=fe.versions[le];return ge?[$,le,ge]:qe.mapAndFilter.skip})})),K=await N;for(let[$,ie,fe]of U.flat(1))Object.hasOwn(K,$)&&K[$].some(le=>kr.satisfiesWithPrereleases(ie,le.vulnerable_versions))||(K[$]??=[],K[$].push({id:`${$} (deprecation)`,title:(typeof fe=="string"?fe:"").trim()||"This package has been deprecated.",severity:"moderate",vulnerable_versions:ie}));E=K});if(C.hasErrors())return C.exitCode();let S=dJ(this.severity),x=Array.from(new Set([...r.get("npmAuditIgnoreAdvisories"),...this.ignores])),I=Object.create(null);for(let[N,U]of Object.entries(E)){let K=U.filter($=>!EJ.default.isMatch(`${$.id}`,x)&&S.has($.severity));K.length>0&&(I[N]=K.map($=>{let ie=c.get(N);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)),le=new Map;for(let ge of fe)for(let pe of ie.get(ge))le.set(pe.locatorHash,pe);return{...$,versions:fe,dependents:[...le.values()]}}))}let R=Object.keys(I).length>0;return R?(ts.emitTree(gJ(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 N=>{N.reportInfo(1,"No audit suggestions")}),R?1:0)}};Ge();Ge();bt();jt();var IJ=et(hi()),CJ=Ce("util"),w1=class extends ft{constructor(){super(...arguments);this.fields=he.String("-f,--fields",{description:"A comma-separated list of manifest fields that should be displayed"});this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.packages=he.Rest()}static{this.paths=[["npm","info"]]}static{this.usage=st.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,CJ.inspect)(p,{depth:1/0,colors:!0,compact:!1})}
`);return f.exitCode()}};function wJ(e){if(Array.isArray(e)){let t=[];for(let r of e)r=wJ(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=wJ(e[r]);s&&(t[r]=s)}return t}else return e||null}Ge();Ge();jt();var BJ=et(Xv()),B1=class extends ft{constructor(){super(...arguments);this.scope=he.String("-s,--scope",{description:"Login to the registry configured for a given scope"});this.publish=he.Boolean("--publish",!1,{description:"Login to the publish registry"});this.alwaysAuth=he.Boolean("--always-auth",{description:"Set the npmAlwaysAuth configuration"});this.webLogin=he.Boolean("--web-login",{description:"Enable web login"})}static{this.paths=[["npm","login"]]}static{this.usage=st.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 BL({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 cSt({registry:s,configuration:r,report:n,webLogin:this.webLogin,stdin:this.context.stdin,stdout:this.context.stdout});return await fSt(s,c,{alwaysAuth:this.alwaysAuth,scope:this.scope}),n.reportInfo(0,"Successfully logged in")})).exitCode()}};async function BL({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 sSt(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 oSt(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 aSt({registry:e,configuration:t,report:r}){let s=await sSt(e,t);if(!s)return null;if(Ui.openUrl){r.reportInfo(0,"Starting the web login process..."),r.reportSeparator();let{openNow:a}=await(0,BJ.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,ue.pretty(t,s.loginUrl,ue.Type.URL)),r.reportSeparator())}for(;;){let a=await oSt(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 lSt=["https://registry.yarnpkg.com","https://registry.npmjs.org"];async function cSt(e){if(e.webLogin??lSt.includes(e.registry)){let t=await aSt(e);if(t!==null)return t}return await uSt(e)}async function uSt({registry:e,configuration:t,report:r,stdin:s,stdout:a}){let n=await ASt({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 fSt(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 dSt(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 ${ue.pretty(r,"yarn npm stage approve <stageId>",ue.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=H.parseIdent(c.packageName);return{value:ue.tuple(ue.Type.RESOLUTION,{descriptor:H.makeDescriptor(f,c.tag),locator:H.makeLocator(f,c.version)}),children:{ID:{label:"ID",value:ue.tuple(ue.Type.CODE,c.id)},Staged:{label:"Staged on",value:ue.tuple(ue.Type.NO_HINT,c.createdAt)}}}})};ts.emitTree(n,{configuration:r,json:this.json,stdout:this.context.stdout,separators:1})}};async function dSt(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 x1=class extends ft{constructor(){super(...arguments);this.stageId=he.String({validator:ld(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=he.String("--otp",{description:"The OTP token to use with the command"})}static{this.paths=[["npm","stage","reject"]]}static{this.usage=st.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=ue.pretty(r,this.stageId,ue.Type.CODE);n.reportInfo(0,`Rejecting staged package ${ue.pretty(r,c,ue.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 ${ue.pretty(r,c,ue.Type.CODE)} has been rejected.`)})).exitCode()}};Ge();jt();var $De=et(hi());Ge();bt();jt();var k1=class extends ft{constructor(){super(...arguments);this.json=he.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.package=he.String({required:!1})}static{this.paths=[["npm","tag","list"]]}static{this.usage=st.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 Tt.find(r,this.context.cwd),n;if(typeof this.package<"u")n=H.parseIdent(this.package);else{if(!a)throw new ar(s.cwd,this.context.cwd);if(!a.manifest.name)throw new ot(`Missing 'name' field in ${Ae.fromPortablePath(Y.join(a.cwd,yr.manifest))}`);n=a.manifest.name}let c=await rP(n,r),p={children:qe.sortMap(Object.entries(c),([h])=>h).map(([h,E])=>({value:ue.tuple(ue.Type.RESOLUTION,{descriptor:H.makeDescriptor(n,h),locator:H.makeLocator(n,E)})}))};return ts.emitTree(p,{configuration:r,json:this.json,stdout:this.context.stdout})}};async function rP(e,t){let r=`/-/package${Qr.getIdentUrl(e)}/dist-tags`;return Qr.get(r,{configuration:t,ident:e,jsonResponse:!0,customErrorMessage:Qr.customPackageError})}var Q1=class extends ft{constructor(){super(...arguments);this.package=he.String();this.tag=he.String()}static{this.paths=[["npm","tag","add"]]}static{this.usage=st.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 Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);let n=H.parseDescriptor(this.package,!0),c=n.range;if(!$De.default.valid(c))throw new ot(`The range ${ue.pretty(r,n.range,ue.Type.RANGE)} must be a valid semver version`);let f=gn.getPublishRegistry(a.manifest,{configuration:r}),p=ue.pretty(r,n,ue.Type.IDENT),h=ue.pretty(r,c,ue.Type.RANGE),E=ue.pretty(r,this.tag,ue.Type.CODE);return(await Ft.start({configuration:r,stdout:this.context.stdout},async S=>{let x=await rP(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 T1=class extends ft{constructor(){super(...arguments);this.package=he.String();this.tag=he.String()}static{this.paths=[["npm","tag","remove"]]}static{this.usage=st.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 ot("The 'latest' tag cannot be removed.");let r=await Je.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);let n=H.parseIdent(this.package),c=gn.getPublishRegistry(a.manifest,{configuration:r}),f=ue.pretty(r,this.tag,ue.Type.CODE),p=ue.pretty(r,n,ue.Type.IDENT),h=await rP(n,r);if(!Object.hasOwn(h,this.tag))throw new ot(`${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=he.String("-s,--scope",{description:"Print username for the registry configured for a given scope"});this.publish=he.Boolean("--publish",!1,{description:"Print username for the publish registry"})}static{this.paths=[["npm","whoami"]]}static{this.usage=st.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?H.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 gSt={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:[C1,w1,B1,S1,b1,D1,P1,x1,Q1,k1,T1,R1]},mSt=gSt;var QJ={};Vt(QJ,{PatchCommand:()=>U1,PatchCommitCommand:()=>M1,PatchFetcher:()=>aP,PatchResolver:()=>lP,default:()=>OSt,patchUtils:()=>Cy});Ge();Ge();bt();iA();var Cy={};Vt(Cy,{applyPatchFile:()=>SL,diffFolders:()=>xJ,ensureUnpatchedDescriptor:()=>SJ,ensureUnpatchedLocator:()=>DL,extractPackageToDisk:()=>PJ,extractPatchFlags:()=>oPe,isParentRequired:()=>DJ,isPatchDescriptor:()=>bL,isPatchLocator:()=>Fg,loadPatchFiles:()=>oP,makeDescriptor:()=>PL,makeLocator:()=>bJ,makePatchHash:()=>kJ,parseDescriptor:()=>iP,parseLocator:()=>sP,parsePatchFile:()=>nP,unpatchDescriptor:()=>TSt,unpatchLocator:()=>RSt});Ge();bt();Ge();bt();var ySt=/^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@.*/;function F1(e){return Y.relative(wt.root,Y.resolve(wt.root,Ae.toPortablePath(e)))}function ESt(e){let t=e.trim().match(ySt);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 ISt=420,CSt=493;var ePe=()=>({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}),wSt=e=>({header:ESt(e),parts:[]}),BSt={"@":"header","-":"deletion","+":"insertion"," ":"context","\\":"pragma",undefined:"context"};function vSt(e){leLine truncated
`)+(a.hunk.parts[0].noNewlineAtEndOfFile?"":`
`):"";await t.mkdirpPromise(Y.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 O1(t,a.path,async()=>{await xSt(a,{baseFs:t,dryRun:r})});break;case"mode change":{let c=(await t.statPromise(a.path)).mode;if(tPe(a.newMode)!==tPe(c))continue;await O1(t,a.path,async()=>{await t.chmodPromise(a.path,a.newMode)})}break;default:qe.assertNever(a);break}}function tPe(e){return(e&64)>0}function rPe(e){return e.replace(/\s+$/,"")}function PSt(e,t){return rPe(e)===rPe(t)}async function xSt({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),R=Math.max(x,I),N=0,U=0,K=null;for(;N<=R;){if(N<=x&&(U=S-N,K=nPe(C,c,U),K!==null)){N=-N;break}if(N<=I&&(U=S+N,K=nPe(C,c,U),K!==null))break;N+=1}if(K===null)throw new N1(e.indexOf(C),C);f.push(K),p+=N,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 nPe(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||!PSt(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 QSt=/^builtin<([^>]+)>$/;function L1(e,t){let{protocol:r,source:s,selector:a,params:n}=H.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"?H.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 bL(e){return e.range.startsWith("patch:")}function Fg(e){return e.reference.startsWith("patch:")}function iP(e){let{sourceItem:t,...r}=L1(e.range,H.parseDescriptor);return{...r,sourceDescriptor:t}}function sP(e){let{sourceItem:t,...r}=L1(e.reference,H.parseLocator);return{...r,sourceLocator:t}}function TSt(e){let{sourceItem:t}=L1(e.range,H.parseDescriptor);return t}function RSt(e){let{sourceItem:t}=L1(e.reference,H.parseLocator);return t}function SJ(e){if(!bL(e))return e;let{sourceItem:t}=L1(e.range,H.parseDescriptor);return t}function DL(e){if(!Fg(e))return e;let{sourceItem:t}=L1(e.reference,H.parseLocator);return t}function iPe({parentLocator:e,sourceItem:t,patchPaths:r,sourceVersion:s,patchHash:a},n){let c=e!==null?{locator:H.stringifyLocator(e)}:{},f=typeof s<"u"?{version:s}:{},p=typeof a<"u"?{hash:a}:{};return H.makeRange({protocol:"patch:",source:n(t),selector:r.join("&"),params:{...f,...p,...c}})}function PL(e,{parentLocator:t,sourceDescriptor:r,patchPaths:s}){return H.makeDescriptor(e,iPe({parentLocator:t,sourceItem:r,patchPaths:s},H.stringifyDescriptor))}function bJ(e,{parentLocator:t,sourcePackage:r,patchPaths:s,patchHash:a}){return H.makeLocator(e,iPe({parentLocator:t,sourceItem:r,sourceVersion:r.version,patchPaths:s,patchHash:a},H.stringifyLocator))}function sPe({onAbsolute:e,onRelative:t,onProject:r,onBuiltin:s},a){let n=a.lastIndexOf("!");n!==-1&&(a=a.slice(n+1));let c=a.match(QSt);return c!==null?s(c[1]):a.startsWith("~/")?r(a.slice(2)):Y.isAbsolute(a)?e(a):t(a)}function oPe(e){let t=e.lastIndexOf("!");return{optional:(t!==-1?new Set(e.slice(0,t).split(/!/)):new Set).has("optional")}}function DJ(e){return sPe({onAbsolute:()=>!1,onRelative:()=>!0,onProject:()=>!1,onBuiltin:()=>!1},e)}async function oP(e,t,r){let s=e!==null?await r.fetcher.fetch(e,r):null,a=s&&s.localPath?{packageFs:new Pn(wt.root),prefixPath:Y.relative(wt.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=oPe(c),p=await sPe({onAbsolute:async h=>await ae.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(Y.join(a.prefixPath,h),"utf8")},onProject:async h=>await ae.readFilePromise(Y.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 PJ(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=DL(e),n=r.storedChecksums,c=new Qi,f=await ae.mktempPromise(),p=Y.join(f,"source"),h=Y.join(f,"user"),E=Y.join(f,".yarn-patch.json"),C=r.configuration.makeFetcher(),S=[];try{let x,I;if(e.locatorHash===a.locatorHash){let R=await C.fetch(e,{cache:t,project:r,fetcher:C,checksums:n,report:c});S.push(()=>R.releaseFs?.()),x=R,I=R}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([ae.copyPromise(p,x.prefixPath,{baseFs:x.packageFs}),ae.copyPromise(h,I.prefixPath,{baseFs:I.packageFs}),ae.writeJsonPromise(E,{locator:H.stringifyLocator(e),version:s.version})])}finally{for(let x of S)x()}return ae.detachTemp(f),h}async function xJ(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 kJ(e,t){let r=[];for(let{source:s}of e){if(s===null)continue;let a=nP(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 aPe(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,` ${ue.pretty(t,a,"grey")}`);break;case"deletion":r.reportError(28,`- ${ue.pretty(t,a,ue.Type.REMOVED)}`);break;case"insertion":r.reportError(28,`+ ${ue.pretty(t,a,ue.Type.ADDED)}`);break;default:qe.assertNever(s.type)}}function FSt(e){return e instanceof Error&&"code"in e&&e.code==="ENOENT"}var aP=class{supports(t,r){return!!Fg(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,`${H.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:H.getIdentVendorPath(t),localPath:this.getLocalPath(t,r),checksum:c}}async patchPackage(t,r){let{parentLocator:s,sourceLocator:a,sourceVersion:n,patchPaths:c}=sP(t),f=await oP(s,c,r),p=await ae.mktempPromise(),h=Y.join(p,"current.zip"),E=await r.fetcher.fetch(a,r),C=H.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 R=new hs(h,{level:r.project.configuration.get("compressionLevel")}),N=new Pn(Y.resolve(wt.root,C),{baseFs:R});try{await SL(nP(x),{baseFs:N,version:n})}catch(U){let K=U instanceof N1?U:null;if(!(K!==null||I&&FSt(U)))throw U;let ie=r.project.configuration.get("enableInlineHunks"),fe=K!==null&&!ie&&!I?" (set enableInlineHunks for details)":"",le=`${H.prettyLocator(r.project.configuration,t)}: ${U.message}${fe}`,ge=pe=>{K===null||!ie||aPe(K.hunk,{configuration:r.project.configuration,report:pe})};if(R.discardAndClose(),I){r.report.reportWarningOnce(66,le,{reportExtra:ge});continue}else throw new Lt(66,le,ge)}R.saveAndClose()}return new hs(h,{level:r.project.configuration.get("compressionLevel")})}};Ge();var lP=class{supportsDescriptor(t,r){return!!bL(t)}supportsLocator(t,r){return!!Fg(t)}shouldPersistResolution(t,r){return!1}bindDescriptor(t,r,s){let{patchPaths:a}=iP(t);return a.every(n=>!DJ(n))?t:H.bindDescriptor(t,{locator:H.stringifyLocator(r)})}getResolutionDependencies(t,r){let{sourceDescriptor:s}=iP(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}=iP(t),c=await oP(a,n,s.fetchOptions),f=r.sourceDescriptor;if(typeof f>"u")throw new Error("Assertion failed: The dependency should have been resolved");let p=kJ(c,f.version);return[bJ(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}=sP(t);return{...await r.resolver.resolve(s,r),...t}}};Ge();bt();jt();var M1=class extends ft{constructor(){super(...arguments);this.save=he.Boolean("-s,--save",!1,{description:"Add the patch to your resolution entries"});this.patchFolder=he.String()}static{this.paths=[["patch-commit"]]}static{this.usage=st.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 Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let n=Y.resoLine truncated
${f.map(p=>`
- ${H.prettyLocator(r,p)}`).join("")}`);c=f[0]}if(!s.storedPackages.has(c.locatorHash))throw new ot("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=DL(c),h=await PJ(c,{cache:n,project:s});f.reportJson({locator:H.stringifyLocator(p),path:Ae.fromPortablePath(h)});let E=this.update?" along with its current modifications":"";f.reportInfo(0,`Package ${H.prettyLocator(r,p)} got extracted with success${E}!`),f.reportInfo(0,`You can now edit the following folder: ${ue.pretty(r,Ae.fromPortablePath(h),"magenta")}`),f.reportInfo(0,`Once you are done run ${ue.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 NSt={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:[M1,U1],fetchers:[aP],resolvers:[lP]},OSt=NSt;var FJ={};Vt(FJ,{PnpmLinker:()=>uP,default:()=>GSt});Ge();bt();jt();var lPe=".package-map.json",uP=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 ot(`The project in ${ue.pretty(r.project.configuration,`${r.project.cwd}/package.json`,ue.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 ot(`Couldn't find ${H.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 ot(`The project in ${ue.pretty(r.project.configuration,`${r.project.cwd}/package.json`,ue.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=Y.dirname(f);let p=a.locatorByPath.get(f);if(p)return p}while(c!==f);return null}makeInstaller(t){return new TJ(t)}isEnabled(t){return t.project.configuration.get("nodeLinker")==="pnpm"}},TJ=class{constructor(t){this.opts=t;this.customData={pathsByLocator:new Map,locatorByPath:new Map};this.packageMapNodesByLocator=new Map;this.asyncActions=new qe.AsyncActions(t.project.configuration.get("pnpmInstallConcurrency")),this.indexFolderPromise=sx(ae,{indexPath:Y.join(t.project.configuration.get("globalFolder"),"index")})}attachCustomData(t){}registerPackageMapNode(t,{packageLocation:r}){let s=APe(r);this.packageMapNodesByLocator.has(t)||this.packageMapNodesByLocator.set(t,{packageLocation:s,dependencies:new Map})}registerPackageMapDependency(t,r,s){if(!this.packageMapNodesByLocator.has(s.locatorHash))throw new Error(`Assertion failed: Expected the package to have been registered (${H.stringifyLocator(s)})`);t.dependencies.set(r,s.locatorHash)}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=Y.resolve(r.packageFs.getRealPath(),r.prefixPath),n=this.opts.project.tryWorkspaceByLocator(t)?Y.join(a,yr.nodeModules):null,c={packageLocation:a,dependenciesLocation:n};return this.customData.pathsByLocator.set(t.locatorHash,c),this.registerPackageMapNode(t.locatorHash,c),{packageLocation:a,buildRequest:null}}async installPackageHard(t,r,s){let a=LSt(t,{project:this.opts.project}),n=a.packageLocation;this.customData.locatorByPath.set(n,H.stringifyLocator(t)),this.customData.pathsByLocator.set(t.locatorHash,a),this.registerPackageMapNode(t.locatorHash,a),s.holdFetchResult(this.asyncActions.set(t.locatorHash,async()=>{await ae.mkdirPromise(n,{recursive:!0}),await ae.copyPromise(n,r.prefixPath,{baseFs:r.packageFs,overwrite:!1,linkStrategy:{type:"HardlinkFromIndex",indexPath:await this.indexFolderPromise,autoRepair:!0}})}));let f=H.isVirtualLocator(t)?H.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"||!uPe(t,{project:this.opts.project}))return;let s=this.Line truncated
${YSt}
`,"--",...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 zSt=[dPe],_1=class extends ft{constructor(){super(...arguments);this.commit=he.Boolean("-c,--commit",!1,{description:"Commit the staged files"});this.reset=he.Boolean("-r,--reset",!1,{description:"Remove all files from the staging area"});this.dryRun=he.Boolean("-n,--dry-run",!1,{description:"Print the commit message and the list of modified files without staging / committing"});this.update=he.Boolean("-u,--update",!1,{hidden:!0})}static{this.paths=[["stage"]]}static{this.usage=st.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 Tt.find(r,this.context.cwd),{driver:a,root:n}=await ZSt(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 XSt(n,C))f.add(S);let p=new Set([r.get("rcFilename"),yr.lockfile,yr.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 ZSt(e){let t=null,r=null;for(let s of zSt)if((r=await s.findRoot(e))!==null){t=s;break}if(t===null||r===null)throw new ot("No stage driver has been found for your current project");return{driver:t,root:r}}function XSt(e,t){let r=[];if(t===null)return r;for(;;){(t===e||t.startsWith(`${e}/`))&&r.push(t);let s;try{s=ae.statSync(t)}catch{break}if(s.isSymbolicLink())t=Y.resolve(Y.dirname(t),ae.readlinkSync(t));else break}return r}var $St={commands:[_1]},ebt=$St;var jJ={};Vt(jJ,{default:()=>lbt});Ge();Ge();bt();var yPe=et(hi());Ge();var gPe=et(q9()),tbt="e8e1bd300d860104bb8c58453ffa1eb4",rbt="OFCNCOG2CU",mPe=async(e,t)=>{let r=H.stringifyIdent(e),a=nbt(t).initIndex("npm-search");try{return(await a.getObject(r,{attributesToRetrieve:["types"]})).types?.ts==="definitely-typed"}catch{return!1}},nbt=e=>(0,gPe.default)(rbt,tbt,{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 EPe=e=>e.scope?`${e.scope}__${e.name}`:`${e.name}`,ibt=async(e,t,r,s)=>{if(r.scope==="types")return;let{project:a}=e,{configuration:n}=a;if(!(n.get("tsEnableAutoTypes")??(ae.existsSync(Y.join(e.cwd,"tsconfig.json"))||ae.existsSync(Y.join(a.cwd,"tsconfig.json")))))return;let f=n.makeResolver(),p={project:a,resolver:f,report:new Qi};if(!await mPe(r,n))return;let E=EPe(r),C=H.parseRange(r.range).selector;if(!kr.validRange(C)){let N=n.normalizeDependency(r),U=await f.getCandidates(N,{},p);C=H.parseRange(U[0].reference).selector}let S=yPe.default.coerce(C);if(S===null)return;let x=`${ef.Modifier.CARET}${S.major}`,I=H.makeDescriptor(H.makeIdent("types",E),x),R=qe.mapAndFind(a.workspaces,N=>{let U=N.manifest.dependencies.get(r.identHash)?.descriptorHash,K=N.manifest.devDependencies.get(r.identHash)?.descriptorHash;if(U!==r.descriptorHash&&K!==r.descriptorHash)return qe.mapAndFind.skip;let $=[];for(let ie of _t.allDependencies){let fe=N.manifest[ie].get(I.identHash);typeof fe>"u"||$.push([ie,fe])}return $.length===0?qe.mapAndFind.skip:$});if(typeof R<"u")for(let[N,U]of R)e.manifest[N].set(U.identHash,U);else{try{let N=n.normalizeDependency(I);if((await f.getCandidates(N,{},p)).length===0)return}catch{return}e.manifest[ef.Target.DEVELOPMENT].set(I.identHash,I)}},sbt=async(e,t,r)=>{if(r.scope==="types")return;let{project:s}=e,{configuration:a}=s;if(!(a.get("tsEnableAutoTypes")??(ae.existsSync(Y.join(e.cwd,"tsconfig.json"))||ae.existsSync(Y.join(s.cwd,"tsconfig.json")))))return;let c=EPe(r),f=H.makeIdent("types",c);for(let p of _t.allDependencies)typeof e.manifest[p].get(f.identHash)>"u"||e.manifest[p].delete(f.identHash)},obt=(e,t)=>{t.publishConfig&&t.publishConfig.typings&&(t.typings=t.publishConfig.typings),t.publishConfig&&t.publishConfig.types&&(t.types=t.publishConfig.types)},abt={configuration:{tsEnableAutoTypes:{description:"Whether Yarn should auto-install @types/ dependencies on 'yarn add'",type:"BOOLEAN",isNullable:!0,default:null}},hooks:{afterWorkspaceDependencyAddition:ibt,afterWorkspaceDependencyRemoval:sbt,beforeWorkspacePacking:obt}},lbt=abt;var VJ={};Vt(VJ,{VersionApplyCommand:()=>q1,VersionCheckCommand:()=>Y1,VersionCommand:()=>W1,default:()=>pbt,versionUtils:()=>G1});Ge();Ge();jt();var G1={};Vt(G1,{Decision:()=>H1,applyPrerelease:()=>IPe,applyReleases:()=>WJ,applyStrategy:()=>fP,clearVersionFiles:()=>GJ,getUndecidedDependentWorkspaces:()=>pP,getUndecidedWorkspaces:()=>TL,openVersionFile:()=>j1,requireMoreDecisions:()=>ubt,resolveVersionFiles:()=>AP,suggestStrategy:()=>YJ,updateVersionFiles:()=>qJ,validateReleaseDecision:()=>wy});Ge();bt();Sc();jt();Zl();var RA=et(hi()),cbt=/^(>=|[~^]|)(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-]+)*)?$/,H1=(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))(H1||{});function wy(e){let t=RA.default.valid(e);return t||qe.validateEnum(x4(H1,"UNDECIDED"),e)}async function AP(e,{prerelease:t=null}={}){let r=new Map,s=e.configuration.get("deferredVersionFolder");if(!ae.existsSync(s))return r;let a=await ae.readdirPromise(s);for(let n of a){if(!n.endsWith(".yml"))continue;let c=Y.join(s,n),f=await ae.readFilePromise(c,"utf8"),p=us(f);for(let[h,E]of Object.entries(p.releases||{})){if(E==="decline")continue;let C=H.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]:Y.join(c,`${Mn.makeHash(Math.random().toString()).slice(0,8)}.yml`),E=ae.existsSync(h)?await ae.readFilePromise(h,"utf8"):"{}",C=us(E),S=new Map;for(let x of C.declined||[]){let I=H.parseIdent(x),R=e.getWorkspaceByIdent(I);S.set(R,"decline")}for(let[x,I]of Object.entries(C.releases||{})){let R=H.parseIdent(x),N=e.getWorkspaceByIdent(R);S.set(N,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=[],R=[];for(let N of e.workspaces){if(N.manifest.version===null)continue;let U=H.stringifyIdent(N.anchoredLocator),K=S.get(N);K==="decline"?I.push(U):typeof K<"u"?x[U]=wy(K):p.has(N)&&R.push(U)}await ae.mkdirPromise(Y.dirname(h),{recursive:!0}),await ae.changeFilePromise(h,Al(new Al.PreserveOrdering({releases:Object.keys(x).length>0?x:void 0,declined:I.length>0?I:void 0,undecided:R.length>0?R:void 0})))}}}function ubt(e){return TL(e).size>0||pP(e).length>0}function TL(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 pP(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 YJ(e,t){let r=RA.default.clean(t);for(let s of Object.values(H1))if(s!=="undecided"&&s!=="decline"&&RA.default.inc(e,s)===r)return s;return null}function fP(e,t){if(RA.default.valid(t))return t;if(e===null)throw new ot(`Cannot apply the release strategy "${t}" unless the workspace already has a valid version`);if(!RA.default.valid(e))throw new ot(`Cannot apply the release strategy "${t}" on a non-semver version (${e})`);let r=RA.default.inc(e,t);if(r===null)throw new ot(`Cannot apply the release strategy "${t}" on the specified version (${e})`);return r}function WJ(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,RA.default.prerelease(c)===null?delete n.manifest.raw.stableVersion:n.manifest.raw.stableVersion||(n.manifest.raw.stableVersion=f);let p=n.manifest.name!==null?H.stringifyIdent(n.manifest.name):null;r.reportInfo(0,`${H.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,R=!1;if(I.startsWith(Ii.protocol)&&(I=I.slice(Ii.protocol.length),R=!0,I===n.relativeCwd))continue;let N=I.match(cbt);if(!N){r.reportWarning(0,`Couldn't auto-upgrade range ${I} (in ${H.prettyLocator(e.configuration,E.anchoredLocator)})`);continue}let U=s?`${c}`:`${N[1]}${c}`;R&&(U=`${Ii.protocol}${U}`);let K=H.makeDescriptor(x,U);E.manifest[C].set(S,K)}}}var fbt=new Map([["%n",{extract:e=>e.length>=1?[e[0],e.slice(1)]:null,generate:(e=0)=>`${e+1}`}]]);function IPe(e,{current:t,prerelease:r}){let s=new RA.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=fbt.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 q1=class extends ft{constructor(){super(...arguments);this.all=he.Boolean("--all",!1,{description:"Apply the deferred version changes on all workspaces"});this.dryRun=he.Boolean("--dry-run",!1,{description:"Print the versions without actually generating the package archive"});this.prerelease=he.String("--prerelease",{description:"Add a prerelease identifier to new versions",tolerateBoolean:!0});this.exact=he.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=he.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 Tt.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 AP(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}WJ(s,E,{report:f,exact:this.exact}),this.dryRun||(p||(this.all?await GJ(s):await qJ(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 RL=et(hi());var Y1=class extends ft{constructor(){super(...arguments);this.interactive=he.Boolean("-i,--interactive",{description:"Open an interactive interface used to set version bumps"})}static{this.paths=[["version","check"]]}static{this.usage=st.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(()=>(FF(),AY)),{ScrollableItems:s}=await Promise.resolve().then(()=>(MF(),LF)),{FocusRequest:a}=await Promise.resolve().then(()=>(dY(),bwe)),{useListInput:n}=await Promise.resolve().then(()=>(OF(),Dwe)),{renderForm:c}=await Promise.resolve().then(()=>(jF(),HF)),{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 Tt.find(S,this.context.cwd);if(!I)throw new ar(x.cwd,this.context.cwd);await x.restoreInstallState();let R=await j1(x);if(R===null||R.releaseRoots.size===0)return 0;if(R.root===null)throw new ot("This command can only be run on Git repositories");let N=()=>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:pe,decision:De,setDecision:ye})=>{let d=ge.manifest.raw.stableVersion??ge.manifest.version;if(d===null)throw new Error(`Assertion failed: The version should have been set (${H.prettyLocator(S,ge.anchoredLocator)})`);if(RL.default.prerelease(d)!==null)throw new Error(`Assertion failed: Prerelease identifiers shouldn't be found (${d})`);let ve=["undecided","decline","patch","minor","major"];n(De,ve,{active:pe,minus:"left",plus:"right",set:ye});let Ie=De==="undecided"?h.createElement(p,{color:"yellow"},d):De==="decline"?h.createElement(p,{color:"green"},d):h.createElement(p,null,h.createElement(p,{color:"magenta"},d)," \u2192 ",h.createElement(p,{color:"green"},RL.default.valid(De)?De:RL.default.inc(d,De)));return h.createElement(f,{flexDirection:"column"},h.createElement(f,null,h.createElement(p,null,H.prettyLocator(S,ge.anchoredLocator)," - ",Ie)),h.createElement(f,null,ve.map(meLine truncated
`)},p=()=>{let ye=this.from.map(d=>K1.default.matcher(d));return s.workspaces.filter(d=>{let ve=H.stringifyIdent(d.anchoredLocator),Ie=d.relativeCwd;return ye.some(me=>me(ve)||me(Ie))})},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 ye of h)f(`
- ${ye.relativeCwd}
${H.prettyLocator(r,ye.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(ye=>[...ye.getRecursiveWorkspaceDependents()]).flat())):(f("Option --recursive is set; recursively selecting all transitive dependencies"),E=new Set(h.map(ye=>[...ye.getRecursiveWorkspaceDependencies()]).flat())):this.worktree?(f("Option --worktree is set; recursively selecting all nested workspaces"),E=new Set(h.map(ye=>[...ye.getRecursiveWorkspaceChildren()]).flat())):E=null,E!==null&&(h=[...new Set([...h,...E])],this.dryRun))for(let ye of E)f(`
- ${ye.relativeCwd}
${H.prettyLocator(r,ye.anchoredLocator)}`);let C=[],S=!1;if(c?.includes(":")){for(let ye of s.workspaces)if(ye.manifest.scripts.has(c)&&(S=!S,S===!1))break}for(let ye of h){if(c&&!ye.manifest.scripts.has(c)&&!S&&!(await wn.getWorkspaceAccessibleBinaries(ye)).has(c)){f(`Excluding ${ye.relativeCwd} because it doesn't have a "${c}" script`);continue}if(!(c===r.env.npm_lifecycle_event&&ye.cwd===a.cwd)){if(this.include.length>0&&!K1.default.isMatch(H.stringifyIdent(ye.anchoredLocator),this.include)&&!K1.default.isMatch(ye.relativeCwd,this.include)){f(`Excluding ${ye.relativeCwd} because it doesn't match the --include filter`);continue}if(this.exclude.length>0&&(K1.default.isMatch(H.stringifyIdent(ye.anchoredLocator),this.exclude)||K1.default.isMatch(ye.relativeCwd,this.exclude))){f(`Excluding ${ye.relativeCwd} because it matches the --exclude filter`);continue}if(this.publicOnly&&ye.manifest.private===!0){f(`Excluding ${ye.relativeCwd} because it's a private workspace and --no-private was set`);continue}C.push(ye)}}if(C.sort((ye,d)=>H.stringifyIdent(ye.anchoredLocator).localeCompare(H.stringifyIdent(d.anchoredLocator))),this.dryRun)return 0;let x=this.verbose??(this.context.stdout.isTTY?1/0:0),I=x>0,R=x>1,N=this.parallel?this.jobs==="unlimited"?1/0:Number(this.jobs)||Math.ceil(Ui.availableParallelism()/2):1,U=N===1?!1:this.parallel,K=U?this.interlaced:!0,$=(0,wPe.default)(N),ie=new Map,fe=new Set,le=0,ge=null,pe=!1,De=await Ft.start({configuration:r,stdout:this.context.stdout,includePrefix:!1},async ye=>{let d=async(ve,{commandIndex:Ie})=>{if(pe)return-1;!U&&R&&Ie>1&&ye.reportSeparator();let me=hbt(ve,{configuration:r,label:I,commandIndex:Ie}),[ce,X]=CPe(ye,{prefix:me,interlaced:K}),[be,ke]=CPe(ye,{prefix:me,interlaced:K});try{R&&ye.reportInfo(null,`${me?`${me} `:""}Process started`);let it=Date.now(),_=await this.cli.run([this.commandName,...this.args],{cwd:ve.cwd,stdout:ce,stderr:be})||0;ce.end(),be.end(),await X,await ke;let tt=Date.now();if(R){let Fe=r.get("enableTimers")?`, completed in ${ue.pretty(r,tt-it,ue.Type.DURATION)}`:"";ye.reportInfo(null,`${me?`${me} `:""}Process exited (exit code ${_})${Fe}`)}return _===130&&(pe=!0,ge=_),_}catch(it){throw ce.end(),be.end(),await X,await ke,it}};for(let ve of C)ie.set(ve.anchoredLocator.locatorHash,ve);for(;ie.size>0&&!ye.hasErrors();){let ve=[];for(let[X,be]of ie){if(fe.has(be.anchoredDescriptor.descriptorHash))continue;let ke=!0;if(this.topological||this.topologicalDev){let it=this.topologicalDev?new Map([...be.manifest.dependencies,...be.manifest.devDependencies]):be.manifest.dependencies;for(let _ of it.values()){let tt=s.tryWorkspaceByDescriptor(_);if(ke=tt===null||!ie.has(tt.anchoredLocator.locatorHash),!ke)break}}if(ke&&(fe.add(be.anchoredDescriptor.descriptorHash),ve.push($(async()=>{let it=await d(be,{commandIndex:++le});return ie.delete(X),fe.delete(be.anchoredDescriptor.descriptorHash),{workspace:be,exitCode:it}})),!U))break}if(ve.length===0){let X=Array.from(ie.values()).map(be=>H.prettyLocator(r,be.anchoredLocator)).join(", ");ye.reportError(3,`Dependency cycle detected (${X})`);return}let Ie=await Promise.all(ve);Ie.forEach(({workspace:X,exitCode:be})=>{be!==0&&ye.reportError(0,`The command failed in workspace ${H.prettyLocator(r,X.anchoredLocator)} with exit code ${be}`)});let ce=Ie.map(X=>X.exitCode).find(X=>X!==0);(this.topological||this.topologicalDev)&&typeof ce<"u"&&ye.reportError(0,"The command failed for workspaces that are depended upon by other workspaces; can't satisfy the dependency graph")}});return ge!==null?ge:De.exitCode()}};function CPe(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 hbt(e,{configuration:t,commandIndex:r,label:s}){if(!s)return null;let n=`[${H.stringifyIdent(e.anchoredLocator)}]:`,c=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],f=c[r%c.length];return ue.pretty(t,n,f)}var dbt={commands:[V1,J1]},gbt=dbt;var KI=()=>({modules:new Map([["@yarnpkg/cli",Kv],["@yarnpkg/core",Vv],["@yarnpkg/fslib",M2],["@yarnpkg/libzip",lv],["@yarnpkg/parsers",W2],["@yarnpkg/shell",hv],["clipanion",nB],["semver",mbt],["typanion",qs],["@yarnpkg/plugin-essentials",G5],["@yarnpkg/plugin-catalog",V5],["@yarnpkg/plugin-compat",X5],["@yarnpkg/plugin-constraints",d9],["@yarnpkg/plugin-dlx",g9],["@yarnpkg/plugin-exec",E9],["@yarnpkg/plugin-file",C9],["@yarnpkg/plugin-git",j5],["@yarnpkg/plugin-github",v9],["@yarnpkg/plugin-http",S9],["@yarnpkg/plugin-init",b9],["@yarnpkg/plugin-interactive-tools",BY],["@yarnpkg/plugin-jsr",SY],["@yarnpkg/plugin-link",bY],["@yarnpkg/plugin-nm",dW],["@yarnpkg/plugin-npm",hJ],["@yarnpkg/plugin-npm-cli",vJ],["@yarnpkg/plugin-pack",aV],["@yarnpkg/plugin-patch",QJ],["@yarnpkg/plugin-pnp",rW],["@yarnpkg/plugin-pnpm",FJ],["@yarnpkg/plugin-stage",HJ],["@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 wbt(a,e,{selfPath:r,pluginConfiguration:s})}catch(c){ba.defaultContext.stdout.write(a.error(c)),process.exitCode=1}finally{process.off("beforeExit",n),await ae.rmtempPromise()}}OR(process.argv.slice(2),{cwd:Y.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.17.1.cjs
+12 -20
View File
@@ -2,18 +2,20 @@
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.
For gallery-specific documentation, demos, page structure, and examples, read `gallery/AGENTS.md` when working under `gallery/`.
## 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
yarn lint # ESLint + Prettier + TypeScript + Lit
yarn format # Auto-fix ESLint + Prettier
yarn lint:types # TypeScript compiler, run without file arguments
yarn test # Vitest
yarn dev # App dev server, supports --background/--status/--stop/--logs
yarn 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.
Never run `tsc` or `yarn lint:types` with file arguments. When `tsc` receives file arguments, it ignores `tsconfig.json` and can emit `.js` files into `src/`. Always run `yarn lint:types` without arguments. For individual file type checking, rely on editor diagnostics.
## Architecture
@@ -33,24 +35,17 @@ Never run `tsc` or `pnpm lint:types` with file arguments. When `tsc` receives fi
- 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:
Detailed guidance lives in project skills under `.agents/skills/`. Load the matching skill before detailed implementation or review:
- `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.
- `ha-frontend-review`: PR template use, review checklist, and recurring review issues.
## Pull Requests
@@ -59,7 +54,4 @@ When creating a pull request, use `.github/PULL_REQUEST_TEMPLATE.md` as the PR b
## 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.
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.
+162 -169
View File
@@ -1,201 +1,194 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Apache License
==============
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
_Version 2.0, January 2004_
_&lt;<http://www.apache.org/licenses/>&gt;_
1. Definitions.
### Terms and Conditions for use, reproduction, and distribution
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
#### 1. Definitions
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
“License” shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
“Licensor” shall mean the copyright owner or entity authorized by the copyright
owner that is granting the License.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
“Legal Entity” shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, “control” means **(i)** the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the
outstanding shares, or **(iii)** beneficial ownership of such entity.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
“You” (or “Your”) shall mean an individual or Legal Entity exercising
permissions granted by this License.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
“Source” form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and configuration
files.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
“Object” form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object code,
generated documentation, and conversions to other media types.
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
“Work” shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is included
in or attached to the work (an example is provided in the Appendix below).
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
“Derivative Works” shall mean any work, whether in Source or Object form, that
is based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an
original work of authorship. For the purposes of this License, Derivative Works
shall not include works that remain separable from, or merely link (or bind by
name) to the interfaces of, the Work and Derivative Works thereof.
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
“Contribution” shall mean any work of authorship, including the original version
of the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work
by the copyright owner or by an individual or Legal Entity authorized to submit
on behalf of the copyright owner. For the purposes of this definition,
“submitted” means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright
owner as “Not a Contribution.”
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
“Contributor” shall mean Licensor and any individual or Legal Entity on behalf
of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
#### 2. Grant of Copyright License
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
#### 3. Grant of Patent License
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to make, have
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
such license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by combination
of their Contribution(s) with the Work to which such Contribution(s) was
submitted. If You institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
Contribution incorporated within the Work constitutes direct or contributory
patent infringement, then any patent licenses granted to You under this License
for that Work shall terminate as of the date such litigation is filed.
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
#### 4. Redistribution
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may reproduce and distribute copies of the Work or Derivative Works thereof
in any medium, with or without modifications, and in Source or Object form,
provided that You meet the following conditions:
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
* **(a)** You must give any other recipients of the Work or Derivative Works a copy of
this License; and
* **(b)** You must cause any modified files to carry prominent notices stating that You
changed the files; and
* **(c)** You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and
* **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any
Derivative Works that You distribute must include a readable copy of the
attribution notices contained within such NOTICE file, excluding those notices
that do not pertain to any part of the Derivative Works, in at least one of the
following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative
Works, if and wherever such third-party notices normally appear. The contents of
the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution notices within Derivative Works that
You distribute, alongside or as an addendum to the NOTICE text from the Work,
provided that such additional attribution notices cannot be construed as
modifying the License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a whole,
provided Your use, reproduction, and distribution of the Work otherwise complies
with the conditions stated in this License.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
#### 5. Submission of Contributions
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
Unless You explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the Work by You to the Licensor shall be under the terms and
conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the terms of
any separate license agreement you may have executed with Licensor regarding
such Contributions.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
#### 6. Trademarks
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
This License does not grant permission to use the trade names, trademarks,
service marks, or product names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
END OF TERMS AND CONDITIONS
#### 7. Disclaimer of Warranty
APPENDIX: How to apply the Apache License to your work.
Unless required by applicable law or agreed to in writing, Licensor provides the
Work (and each Contributor provides its Contributions) on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
including, without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
#### 8. Limitation of Liability
Copyright [yyyy] [name of copyright owner]
In no event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
and grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License or
out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
#### 9. Accepting Warranty or Additional Liability
http://www.apache.org/licenses/LICENSE-2.0
While redistributing the Work or Derivative Works thereof, You may choose to
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
other liability obligations and/or rights consistent with this License. However,
in accepting such obligations, You may act only on Your own behalf and on Your
sole responsibility, not on behalf of any other Contributor, and only if You
agree to indemnify, defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
_END OF TERMS AND CONDITIONS_
### APPENDIX: How to apply the Apache License to your work
To apply the Apache License to your work, attach the following boilerplate
notice, with the fields enclosed by brackets `[]` replaced with your own
identifying information. (Don't include the brackets!) The text should be
enclosed in the appropriate comment syntax for the file format. We also
recommend that a file or class name and description of purpose be included on
the same “printed page” as the copyright notice for easier identification within
third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+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);
+8 -8
View File
@@ -1,15 +1,15 @@
{
"_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": 624240,
"core": 55144,
"authorize": 594400,
"onboarding": 705499
"app": 561513,
"core": 54473,
"authorize": 544272,
"onboarding": 647136
},
"frontend-legacy": {
"app": 776696,
"core": 188309,
"authorize": 763316,
"onboarding": 879807
"app": 790323,
"core": 237208,
"authorize": 765464,
"onboarding": 918679
}
}
+14 -64
View File
@@ -31,44 +31,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 +63,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 +83,7 @@ module.exports.swcOptions = () => ({
},
});
module.exports.babelOptions = ({ latestBuild, isTestBuild, sw, worker }) => ({
module.exports.babelOptions = ({ latestBuild, isTestBuild, sw }) => ({
babelrc: false,
compact: false,
assumptions: {
@@ -152,7 +119,7 @@ module.exports.babelOptions = ({ latestBuild, isTestBuild, sw, worker }) => ({
ignoreModuleNotFound: true,
},
],
// Import helpers from runtime package.
// Import helpers and regenerator 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
@@ -170,11 +137,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 +153,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 +171,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 +221,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 +232,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 +247,6 @@ module.exports.config = {
isProdBuild,
latestBuild,
isStatsBuild,
isTestBuild,
};
},
@@ -292,13 +256,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 +276,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,
},
@@ -346,20 +306,11 @@ module.exports.config = {
};
},
e2eTestApp({ isProdBuild, latestBuild, isStatsBuild, isTestBuild }) {
e2eTestApp({ isProdBuild, latestBuild, isStatsBuild }) {
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),
@@ -370,7 +321,6 @@ module.exports.config = {
isProdBuild,
latestBuild,
isStatsBuild,
isTestBuild,
};
},
};
-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 })));
};
File diff suppressed because it is too large. Load diff
-10
View File
@@ -1,10 +0,0 @@
// @ts-check
import { noUnusedElementImport } from "./no-unused-element-import.mjs";
export default {
meta: { name: "eslint-plugin-ha" },
rules: {
"no-unused-element-import": noUnusedElementImport,
},
};
@@ -1,188 +0,0 @@
// @ts-check
import fs from "node:fs";
import path from "node:path";
const TAG_PATTERN =
/@customElement\(\s*["'`]([a-z0-9_-]+)["'`]|customElements\.define\(\s*["'`]([a-z0-9_-]+)["'`]/g;
const EXTENSIONS = /\.(ts|js)$/;
// Entry points register the root element that the served HTML renders.
const ENTRY_POINT = /(^|[\\/])(entrypoints[\\/]|entrypoint\.(ts|js)$)/;
// These resolve a tag from config at runtime, so they register every candidate
// they may be asked for.
const RUNTIME_REGISTRY =
/[\\/]create-element[\\/]|createLovelaceElement\(|getLovelaceElementClass\(/;
/** @type {Map<string, string[]>} */
const tagCache = new Map();
/** Tags the module at `file` registers when imported. */
const registeredTags = (file) => {
let tags = tagCache.get(file);
if (!tags) {
try {
const source = fs.readFileSync(file, "utf8");
tags = [...source.matchAll(TAG_PATTERN)].map((m) => m[1] || m[2]);
} catch {
tags = [];
}
tagCache.set(file, tags);
}
return tags;
};
const isFile = (candidate) => {
try {
return fs.statSync(candidate).isFile();
} catch {
return false;
}
};
const resolveModule = (fromFile, request) => {
const base = path.resolve(path.dirname(fromFile), request);
return [
base,
`${base}.ts`,
`${base}.js`,
base.replace(/\.js$/, ".ts"),
path.join(base, "index.ts"),
path.join(base, "index.js"),
].find((candidate) => EXTENSIONS.test(candidate) && isFile(candidate));
};
// `hui-${type}-card` or "state-card-" + domain never spell the tag out.
const buildsTagAtRuntime = (source, tag) => {
const segments = tag.split("-");
for (let end = 1; end < segments.length; end++) {
const prefix = `${segments.slice(0, end).join("-")}-`;
if (
source.includes(`\`${prefix}\${`) ||
source.includes(`"${prefix}" +`) ||
source.includes(`'${prefix}' +`)
) {
return true;
}
}
return false;
};
// Plain substring matching, so <ha-icon-button> counts as a use of ha-icon.
// That direction is deliberate: it misses dead imports rather than asking for
// a removal that breaks registration.
const usesTag = (body, tag) => body.includes(tag);
// A gallery page registers the elements its sibling markdown demos render, so
// that markdown is part of what the module is used by.
const siblingMarkup = (file) => {
const markdown = file.replace(EXTENSIONS, ".markdown");
try {
return fs.readFileSync(markdown, "utf8");
} catch {
return "";
}
};
/** Blanks out the given ranges so an import path cannot count as a usage. */
const withoutRanges = (source, ranges) => {
let result = source;
for (const [start, end] of ranges) {
result =
result.slice(0, start) + " ".repeat(end - start) + result.slice(end);
}
return result;
};
/**
* Side-effect imports register a custom element. ESLint's unused-import rules
* cannot judge them — there is no binding to be unused — so a registration
* outlives the template that needed it and nothing reports the dead import.
*
* Deliberately not fixable: removing the import is only safe once every file
* that renders the element imports it itself, which this rule cannot see.
*
* Off in eslint.config.mjs while a backlog of those paired cases remains;
* `pnpm lint:element-imports` enables it as a warning to list them. Flip it to
* "error" there once the list is empty.
*
* No disable comments while it is off: ESLint reports them as unused
* directives, which fails lint:eslint. Imports that must stay get theirs in
* the change that turns the rule on.
*/
export const noUnusedElementImport = {
meta: {
type: "suggestion",
docs: {
description:
"Disallow side-effect imports of a custom element the importing file never uses",
},
schema: [],
messages: {
unused:
'"{{request}}" only registers <{{tags}}>, which this file never uses. Remove the import, adding it to whichever file renders the element if that file relies on this registration.',
},
},
create(context) {
const filename = context.filename;
if (!EXTENSIONS.test(filename) || ENTRY_POINT.test(filename)) {
return {};
}
return {
Program(program) {
const imports = program.body.filter(
(node) => node.type === "ImportDeclaration"
);
const sideEffectImports = imports.filter(
(node) =>
node.specifiers.length === 0 &&
typeof node.source.value === "string" &&
node.source.value.startsWith(".")
);
if (!sideEffectImports.length) {
return;
}
const source = context.sourceCode.getText();
if (RUNTIME_REGISTRY.test(filename) || RUNTIME_REGISTRY.test(source)) {
return;
}
// Every import declaration, not just the side-effect ones: a module
// path is never a usage, and `import type { HaCard } from "./ha-card"`
// would otherwise pass off its own path as one.
const body =
withoutRanges(
source,
imports.map((node) => node.range)
) + siblingMarkup(filename);
for (const node of sideEffectImports) {
const request = node.source.value;
const target = resolveModule(filename, request);
if (!target) {
continue;
}
// No tags means no registration to judge: styles, polyfills, mocks.
const tags = registeredTags(target);
if (
!tags.length ||
tags.some(
(tag) => usesTag(body, tag) || buildsTagAtRuntime(body, tag)
)
) {
continue;
}
context.report({
node,
messageId: "unused",
data: { request, tags: tags.join(">, <") },
});
}
},
};
},
};
-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"])
)
);
+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(
+7 -42
View File
@@ -5,7 +5,6 @@ import mapStream from "map-stream";
import transform from "gulp-json-transform";
import { LokaliseApi } from "@lokalise/node-api";
import JSZip from "jszip";
import { SERVICE_DOMAINS } from "./gen-demo-core-data.js";
const inDir = "translations";
const inDirFrontend = `${inDir}/frontend`;
@@ -52,34 +51,15 @@ function convertBackendTranslations(data, _file) {
if (!data.component) {
return output;
}
// Keep the entity domains and the domains with automation triggers or
// conditions, so the demo can show states and describe automations. Only
// keep the services of the domains whose services the demo mocks.
Object.keys(data.component).forEach((domain) => {
const {
entity_component,
services,
triggers,
conditions,
selector,
title,
} = data.component[domain];
if (
!entity_component &&
!triggers &&
!conditions &&
!SERVICE_DOMAINS.includes(domain)
) {
if (!("entity_component" in data.component[domain])) {
return;
}
output.component[domain] = {
entity_component,
services: SERVICE_DOMAINS.includes(domain) ? services : undefined,
triggers,
conditions,
selector,
title,
};
output.component[domain] = { entity_component: {} };
Object.keys(data.component[domain].entity_component).forEach((key) => {
output.component[domain].entity_component[key] =
data.component[domain].entity_component[key];
});
});
return output;
}
@@ -175,23 +155,8 @@ gulp.task("fetch-lokalise", async function () {
fs.mkdir(inDirBackend, { recursive: true }),
]);
// The backend project only provides the translations the mocked backend
// needs (see convertBackendTranslations), 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()
-18
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";
@@ -13,7 +12,6 @@ gulp.task(
async function setEnv() {
process.env.NODE_ENV = "development";
},
createWorkflowLockTask("develop-e2e-test-app"),
"clean-e2e-test-app",
"translations-enable-merge-backend",
gulp.parallel(
@@ -33,7 +31,6 @@ gulp.task(
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"),
@@ -42,18 +39,3 @@ gulp.task(
"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 -44
View File
@@ -25,7 +25,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 +58,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 +83,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 +107,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 +146,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 +184,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 +225,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(
@@ -303,11 +268,7 @@ gulp.task(
)
);
const E2E_TEST_APP_PAGE_ENTRIES = {
"index.html": ["main"],
"dashboard.html": ["dashboard"],
"onboarding.html": ["onboarding"],
};
const E2E_TEST_APP_PAGE_ENTRIES = { "index.html": ["main"] };
gulp.task(
"gen-pages-e2e-test-app-dev",
@@ -1,6 +1,7 @@
// Task to download the latest Lokalise translations from the nightly workflow artifacts
import { createOAuthDeviceAuth } from "@octokit/auth-oauth-device";
import { retry } from "@octokit/plugin-retry";
import { Octokit } from "@octokit/rest";
import { deleteAsync } from "del";
import { mkdir, readFile, writeFile } from "fs/promises";
@@ -9,20 +10,11 @@ import jszip from "jszip";
import path from "path";
import process from "process";
import { extract } from "tar";
import {
RetryableError,
withRetry,
} from "../../.github/scripts/github-retry.mts";
type Artifact = Awaited<
ReturnType<Octokit["rest"]["actions"]["listArtifactsForRepo"]>
>["data"]["artifacts"][number];
const MAX_AGE = 24; // hours
const OWNER = "home-assistant";
const REPO = "frontend";
const BRANCH = "dev";
const WORKFLOW_NAME = "nightly.yaml";
const ARTIFACT_NAME = "translations";
const CLIENT_ID = "Iv1.3914e28cb27834d1";
const EXTRACT_DIR = "translations";
@@ -44,16 +36,11 @@ gulp.task("fetch-nightly-translations", async function () {
// Read current translations artifact info if it exists,
// and stop if they are not old enough
let currentArtifact: Artifact | null;
let currentArtifact;
try {
const artifact: Artifact = JSON.parse(
await readFile(ARTIFACT_FILE, "utf-8")
);
currentArtifact = artifact;
currentArtifact = JSON.parse(await readFile(ARTIFACT_FILE, "utf-8"));
const currentAge =
(Date.now() - Date.parse(artifact.created_at ?? "")) / 3600000;
(Date.now() - Date.parse(currentArtifact.created_at)) / 3600000;
if (currentAge < MAX_AGE) {
console.log(
"Keeping current translations (only %s hours old)",
@@ -65,30 +52,13 @@ 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 instanceof Error ? err.message : err
);
}
});
async function fetchTranslations(currentArtifact: Artifact | null) {
// To store file writing promises
const createExtractDir = mkdir(EXTRACT_DIR, { recursive: true });
const writings: Promise<void>[] = [];
const writings = [];
// Authenticate to GitHub using GitHub action token if it exists,
// otherwise look for a saved user token or generate a new one if none
let tokenAuth: { token: string };
let tokenAuth;
if (process.env.GITHUB_TOKEN) {
tokenAuth = { token: process.env.GITHUB_TOKEN };
} else {
@@ -117,97 +87,80 @@ async function fetchTranslations(currentArtifact: Artifact | null) {
});
tokenAuth = await auth({ type: "oauth" });
writings.push(
createExtractDir.then(() =>
createExtractDir.then(
writeFile(TOKEN_FILE, JSON.stringify(tokenAuth, null, 2))
)
);
}
}
// Authenticate with token and request workflow runs from GitHub
console.log("Fetching new translations...");
// Authenticate with token and find the newest translations artifact
const octokit = new Octokit({
const octokit = new (Octokit.plugin(retry))({
userAgent: "Fetch Nightly Translations",
auth: tokenAuth.token,
});
// Only the nightly workflow uploads this artifact. Requiring a run from this
// repository's own branch excludes artifacts uploaded by fork pull requests.
const latestArtifact = await withRetry(
"translations artifact lookup",
async () => {
const { data } = await octokit.rest.actions.listArtifactsForRepo({
owner: OWNER,
repo: REPO,
name: ARTIFACT_NAME,
per_page: 10,
});
const workflowRunsResponse = await octokit.rest.actions.listWorkflowRuns({
owner: OWNER,
repo: REPO,
workflow_id: WORKFLOW_NAME,
status: "success",
event: "schedule",
per_page: 1,
exclude_pull_requests: true,
});
if (workflowRunsResponse.data.total_count === 0) {
throw Error("No successful nightly workflow runs found");
}
const latestNightlyRun = workflowRunsResponse.data.workflow_runs[0];
const artifact = data.artifacts.find(
({ expired, workflow_run: run }) =>
!expired &&
run?.head_branch === BRANCH &&
run.head_repository_id === run.repository_id
);
if (!artifact) {
throw new RetryableError(
`No ${ARTIFACT_NAME} artifact found from ${BRANCH}`
);
}
return artifact;
}
);
console.log(
"Latest translations artifact is %s from workflow run %s (%s)",
latestArtifact.id,
latestArtifact.workflow_run?.id,
latestArtifact.created_at
);
// Stop if current is already the latest
if (currentArtifact?.id === latestArtifact.id) {
// Stop if current is already the latest, otherwise Find the translations artifact
if (currentArtifact?.workflow_run.id === latestNightlyRun.id) {
console.log("Stopping because current translations are still the latest");
return;
}
const latestArtifact = (
await octokit.actions.listWorkflowRunArtifacts({
owner: OWNER,
repo: REPO,
run_id: latestNightlyRun.id,
})
).data.artifacts.find((artifact) => artifact.name === ARTIFACT_NAME);
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(() =>
const deleteCurrent = Promise.all(writings).then(
deleteAsync([`${EXTRACT_DIR}/*`, `!${ARTIFACT_FILE}`, `!${TOKEN_FILE}`])
);
// Get the download URL and follow the redirect to download (stored as ArrayBuffer)
const downloadResponse = await withRetry("translations download", () =>
octokit.rest.actions.downloadArtifact({
owner: OWNER,
repo: REPO,
artifact_id: latestArtifact.id,
archive_format: "zip",
})
);
// Octokit types the redirect, but fetch follows it to the archive
if ((downloadResponse.status as number) !== 200) {
const downloadResponse = await octokit.actions.downloadArtifact({
owner: OWNER,
repo: REPO,
artifact_id: latestArtifact.id,
archive_format: "zip",
});
if (downloadResponse.status !== 200) {
throw Error("Failure downloading translations artifact");
}
// Artifact is a tarball, but GitHub adds it to a zip file
console.log("Unpacking downloaded translations...");
const zip = await jszip.loadAsync(downloadResponse.data as ArrayBuffer);
const zip = await jszip.loadAsync(downloadResponse.data);
await deleteCurrent;
const extractStream = zip.file(/.*/)[0].nodeStream().pipe(extract());
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
View File
@@ -4,7 +4,6 @@ import gulp from "gulp";
import { load as loadYaml } 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";
@@ -165,7 +164,6 @@ gulp.task(
async function setEnv() {
process.env.NODE_ENV = "development";
},
createWorkflowLockTask("develop-gallery"),
"clean-gallery",
"translations-enable-merge-backend",
gulp.parallel(
@@ -197,7 +195,6 @@ gulp.task(
async function setEnv() {
process.env.NODE_ENV = "production";
},
createWorkflowLockTask("build-gallery"),
"clean-gallery",
"translations-enable-merge-backend",
gulp.parallel(
+41 -14
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,12 +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/"));
// Controls and popups of the native MapLibre engine
copyFileDir(npmPath("maplibre-gl/dist/maplibre-gl.css"), staticPath("map/"));
}
function copyZXingWasm(staticDir) {
@@ -108,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);
@@ -129,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);
@@ -141,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);
@@ -157,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);
@@ -173,7 +200,6 @@ gulp.task("copy-static-landing-page", async () => {
copyFonts(paths.landingPage_output_static);
copyTranslations(paths.landingPage_output_static);
copyLocaleData(paths.landingPage_output_static);
});
gulp.task("copy-static-e2e-test-app", async () => {
@@ -188,7 +214,8 @@ gulp.task("copy-static-e2e-test-app", async () => {
fs.copySync(e2ePublic, paths.e2eTestApp_output_root);
}
await copyMapPanel(paths.e2eTestApp_output_static);
copyPolyfills(paths.e2eTestApp_output_static);
copyMapPanel(paths.e2eTestApp_output_static);
copyFonts(paths.e2eTestApp_output_static);
copyTranslations(paths.e2eTestApp_output_static);
copyLocaleData(paths.e2eTestApp_output_static);
-422
View File
@@ -1,422 +0,0 @@
// Generates the service, trigger and condition descriptions the demo and
// gallery serve instead of a backend, from the files in Home Assistant Core.
import gulp from "gulp";
import { CORE_SCHEMA, load, mergeTag } from "js-yaml";
import { writeFile } from "node:fs/promises";
import { join } from "node:path";
import process from "node:process";
import prettier from "prettier";
import paths from "../paths.cjs";
const CORE_URL =
process.env.CORE_COMPONENTS_URL ||
"https://raw.githubusercontent.com/home-assistant/core/refs/heads/dev/homeassistant/components";
// Integrations whose services the mocked backend provides
export const SERVICE_DOMAINS = [
"alarm_control_panel",
"automation",
"button",
"calendar",
"camera",
"climate",
"conversation",
"counter",
"cover",
"device_tracker",
"fan",
"frontend",
"group",
"homeassistant",
"humidifier",
"image_processing",
"input_boolean",
"input_button",
"input_datetime",
"input_number",
"input_select",
"input_text",
"lawn_mower",
"light",
"lock",
"logger",
"media_player",
"notify",
"number",
"persistent_notification",
"person",
"recorder",
"remote",
"scene",
"schedule",
"script",
"select",
"siren",
"switch",
"system_log",
"text",
"timer",
"todo",
"tts",
"update",
"vacuum",
"valve",
"water_heater",
"weather",
"zone",
];
// Services that return data. Core sets this when it registers a service, it is
// not part of services.yaml. The value is whether the response is optional.
const RESPONSE_SERVICES = {
"calendar.get_events": false,
"conversation.process": true,
"media_player.browse_media": false,
"media_player.search_media": false,
"recorder.get_statistics": false,
"schedule.get_schedule": false,
"todo.get_items": false,
"weather.get_forecasts": false,
};
// Services that are still in services.yaml, but that core no longer registers
const UNREGISTERED_SERVICES = ["weather.get_forecast"];
// Integrations that provide the new style triggers and conditions
const AUTOMATION_PLATFORM_DOMAINS = [
"air_quality",
"alarm_control_panel",
"assist_satellite",
"battery",
"button",
"calendar",
"climate",
"counter",
"cover",
"door",
"doorbell",
"event",
"fan",
"garage_door",
"gate",
"humidifier",
"humidity",
"illuminance",
"lawn_mower",
"light",
"lock",
"media_player",
"moisture",
"moon",
"motion",
"occupancy",
"power",
"remote",
"scene",
"schedule",
"select",
"siren",
"sun",
"switch",
"temperature",
"text",
"timer",
"todo",
"update",
"vacuum",
"valve",
"vibration",
"water_heater",
"window",
"zone",
];
// YAML 1.2 with merge keys, which matches how core reads these files
const YAML_SCHEMA = CORE_SCHEMA.withTags([mergeTag]);
const HEADER = `// This file is auto-generated from Home Assistant Core. Do not edit by hand.
// Regenerate with \`script/gen_demo_core_data\`.`;
const fetchCoreFile = async (domain, file) => {
const url = `${CORE_URL}/${domain}/${file}`;
const response = await fetch(url);
if (response.status === 404) {
return undefined;
}
if (!response.ok) {
throw new Error(`Failed to fetch ${url}: ${response.status}`);
}
return response.text();
};
// Fetches a file of every domain, keyed by domain
const fetchCoreFiles = async (domains, file) =>
Object.fromEntries(
await Promise.all(
domains.map(async (domain) => [domain, await fetchCoreFile(domain, file)])
)
);
const parseYaml = (content) => load(content, { schema: YAML_SCHEMA }) ?? {};
// Enum references look like "cover.CoverEntityFeature.OPEN"
const ENUM_REFERENCE = /^([a-z_]+)\.[A-Z]\w*\.[A-Z0-9_]+$/;
const enumDomains = (value, domains = new Set()) => {
if (typeof value === "string") {
const match = value.match(ENUM_REFERENCE);
if (match) {
domains.add(match[1]);
}
} else if (value && typeof value === "object") {
Object.values(value).forEach((val) => enumDomains(val, domains));
}
return domains;
};
// Resolves "<domain>.<Enum>.<MEMBER>" to the value of the member, like core
const enumResolver = async (yamls) => {
const domains = [...enumDomains(yamls)];
const [consts, inits] = await Promise.all([
fetchCoreFiles(domains, "const.py"),
fetchCoreFiles(domains, "__init__.py"),
]);
return (reference) => {
const [domain, enumName, member] = reference.split(".");
for (const source of [consts[domain], inits[domain]]) {
const match = source
?.split(`class ${enumName}(`)[1]
?.match(new RegExp(`\\n\\s+${member} = ("[^"]*"|\\d+)`));
if (match) {
return JSON.parse(match[1]);
}
}
throw new Error(`Unknown enum ${reference}`);
};
};
const createResolvers = (enumValue) => {
// In entity filters, every item of the supported features, a feature or a
// list of features, becomes one bit mask
const featureMask = (features) =>
[].concat(features).reduce(
// eslint-disable-next-line no-bitwise
(mask, feature) => mask | enumValue(feature),
0
);
const resolveSelector = (value) => {
if (Array.isArray(value)) {
return value.map(resolveSelector);
}
if (!value || typeof value !== "object") {
return value;
}
return Object.fromEntries(
Object.entries(value).map(([key, val]) => [
key,
key === "supported_features"
? [].concat(val).map(featureMask)
: resolveSelector(val),
])
);
};
// Like core, an empty target allows any target
const resolveTarget = (target) => resolveSelector(target ?? {});
// Field filters keep their lists, with every enum resolved on its own
const resolveField = (field) => {
const result = { ...field };
if (field.selector) {
result.selector = resolveSelector(field.selector);
}
if (field.filter?.supported_features) {
result.filter = {
...result.filter,
supported_features: field.filter.supported_features.map(enumValue),
};
}
if (field.filter?.attribute) {
result.filter = {
...result.filter,
attribute: Object.fromEntries(
Object.entries(field.filter.attribute).map(([name, options]) => [
name,
options.map(enumValue),
])
),
};
}
return result;
};
// Fields can be grouped in sections, which hold fields themselves
const resolveFields = (fields) =>
Object.fromEntries(
Object.entries(fields ?? {}).map(([key, field]) => [
key,
field && "fields" in field && !("selector" in field)
? { ...field, fields: resolveFields(field.fields) }
: resolveField(field ?? {}),
])
);
return { resolveFields, resolveTarget };
};
// Mirrors how core builds the response of get_services
const serviceDescriptions = (yamls, { resolveFields, resolveTarget }) =>
Object.fromEntries(
SERVICE_DOMAINS.map((domain) => {
if (!yamls[domain]) {
throw new Error(`No services.yaml found for ${domain}`);
}
const services = Object.entries(yamls[domain])
.filter(
([service]) =>
!service.startsWith(".") &&
!UNREGISTERED_SERVICES.includes(`${domain}.${service}`)
)
.map(([service, value]) => {
const description = { fields: resolveFields(value?.fields) };
for (const item of ["description", "name"]) {
if (value && item in value) {
description[item] = value[item];
}
}
if (value && "target" in value) {
description.target = resolveTarget(value.target);
}
const key = `${domain}.${service}`;
if (key in RESPONSE_SERVICES) {
description.response = { optional: RESPONSE_SERVICES[key] };
}
return [service, description];
});
return [domain, Object.fromEntries(services)];
})
);
// Mirrors how core builds the trigger and condition platform descriptions
const platformDescriptions = (yamls, { resolveFields, resolveTarget }) =>
Object.fromEntries(
AUTOMATION_PLATFORM_DOMAINS.flatMap((domain) =>
Object.entries(yamls[domain] ?? {})
// Keys starting with a dot only hold YAML anchors
.filter(([key, value]) => !key.startsWith(".") && value)
.map(([key, value]) => {
const absoluteKey = !key.startsWith("_")
? `${domain}.${key}`
: key.slice(1) || domain;
const description = { fields: resolveFields(value.fields) };
if ("target" in value) {
description.target = resolveTarget(value.target);
}
return [absoluteKey, description];
})
)
);
// The trigger or condition icons of every domain that has them
const platformIcons = (icons, category) =>
Object.fromEntries(
Object.entries(icons)
.map(([domain, content]) => [
domain,
content ? JSON.parse(content)[category] : undefined,
])
.filter(([, categoryIcons]) => categoryIcons)
);
const parseYamls = (files) =>
Object.fromEntries(
Object.entries(files)
.filter(([, content]) => content !== undefined)
.map(([domain, content]) => [domain, parseYaml(content)])
);
const writeTs = async (path, content) => {
const file = join(paths.root_dir, path);
const options = await prettier.resolveConfig(file);
await writeFile(
file,
await prettier.format(`${HEADER}\n${content}`, {
...options,
filepath: file,
})
);
};
gulp.task("gen-demo-core-data", async () => {
const [servicesFiles, triggersFiles, conditionsFiles, iconsFiles] =
await Promise.all([
fetchCoreFiles(SERVICE_DOMAINS, "services.yaml"),
fetchCoreFiles(AUTOMATION_PLATFORM_DOMAINS, "triggers.yaml"),
fetchCoreFiles(AUTOMATION_PLATFORM_DOMAINS, "conditions.yaml"),
fetchCoreFiles(AUTOMATION_PLATFORM_DOMAINS, "icons.json"),
]);
const servicesYamls = parseYamls(servicesFiles);
const triggersYamls = parseYamls(triggersFiles);
const conditionsYamls = parseYamls(conditionsFiles);
const resolvers = createResolvers(
await enumResolver([servicesYamls, triggersYamls, conditionsYamls])
);
for (const key of UNREGISTERED_SERVICES) {
const [domain, service] = key.split(".");
if (!(service in (servicesYamls[domain] ?? {}))) {
throw new Error(`Remove ${key} from UNREGISTERED_SERVICES, it is gone`);
}
}
const services = serviceDescriptions(servicesYamls, resolvers);
for (const key of Object.keys(RESPONSE_SERVICES)) {
const [domain, service] = key.split(".");
if (!services[domain]?.[service]) {
throw new Error(`Service ${key} that returns a response does not exist`);
}
}
const triggers = platformDescriptions(triggersYamls, resolvers);
const conditions = platformDescriptions(conditionsYamls, resolvers);
const icons = {
triggers: platformIcons(iconsFiles, "triggers"),
conditions: platformIcons(iconsFiles, "conditions"),
};
await Promise.all([
writeTs(
"src/fake_data/demo_services.ts",
`import type { HassServices } from "home-assistant-js-websocket";
// Core sends more than the HassServices type covers, like sections and list
// examples.
export const demoServices = ${JSON.stringify(services)} as unknown as HassServices;
`
),
writeTs(
"demo/src/stubs/automation_platform_domains.ts",
`
// Integrations that provide the new style triggers and conditions. Their
// translations are part of the demo build.
export const automationPlatformDomains = ${JSON.stringify(AUTOMATION_PLATFORM_DOMAINS)};
`
),
writeTs(
"demo/src/stubs/automation_platforms_data.ts",
`import type { ConditionDescriptions } from "../../../src/data/condition";
import type { TriggerDescriptions } from "../../../src/data/trigger";
export const triggerDescriptions: TriggerDescriptions = ${JSON.stringify(triggers)};
export const conditionDescriptions: ConditionDescriptions = ${JSON.stringify(conditions)};
`
),
writeTs(
"demo/src/stubs/automation_platforms_icons.ts",
`
export const triggerIcons = ${JSON.stringify(icons.triggers)};
export const conditionIcons = ${JSON.stringify(icons.conditions)};
`
),
]);
});
-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);
});
@@ -0,0 +1,40 @@
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_numeric_device_classes.ts"
);
gulp.task("gen-numeric-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 classes = [...(data.numeric_device_classes ?? [])].sort();
if (!classes.length) {
throw new Error(`No numeric_device_classes found in ${SOURCE_URL}`);
}
const content = `// This file is auto-generated from Home Assistant Core's \`SensorDeviceClass\`
// (all values minus \`NON_NUMERIC_DEVICE_CLASSES\`). Do not edit by hand.
// Regenerate with \`script/gen_numeric_device_classes\`.
export const SENSOR_NUMERIC_DEVICE_CLASSES: string[] = [
${classes.map((deviceClass) => ` "${deviceClass}",`).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 | null)[]> = {
${Object.entries(stateClassUnits)
.map(
([stateClass, units]) =>
` ${stateClass}: [${units.map((u) => (u === null ? "null" : `"${u}"`)).join(", ")}],`
)
.join("\n")}
};
`;
await writeFile(TARGET, content);
});
+2 -6
View File
@@ -6,17 +6,13 @@ import "./demo.js";
import "./download-translations.js";
import "./e2e-test-app.js";
import "./entry-html.js";
import "./fetch-nightly-translations.mts";
import "./fetch-nightly-translations.js";
import "./gallery.js";
import "./gather-static.js";
import "./gen-demo-core-data.js";
import "./gen-device-classes.js";
import "./gen-icons-json.js";
import "./gen-sensor-entity-constants.js";
import "./gen-numeric-device-classes.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";
+38 -11
View File
@@ -29,27 +29,54 @@ 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.10.0",
version: "5.8.0",
licenseFile: "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.
// The copy we care about may be hoisted to the top-level node_modules or
// nested under a dependency when a different version occupies the hoisted
// slot (e.g. a build-only dependency pulling in an older release). Searching
// both keeps this check independent of yarn's hoisting decisions, which can
// shift when unrelated dependencies are added.
async function findPackageDir(packageName, version) {
const storeDir = path.join(NODE_MODULES, ".pnpm");
const prefix = `${packageName.replace("/", "+")}@${version}`;
const entries = await readdir(storeDir).catch(() => []);
const candidateDirs = [path.join(NODE_MODULES, packageName)];
for (const entry of entries) {
if (entry !== prefix && !entry.startsWith(`${prefix}(`)) {
// Collect one level of nesting: node_modules/<dep>/node_modules/<pkg> and
// node_modules/@scope/<dep>/node_modules/<pkg>.
let topLevel = [];
try {
topLevel = await readdir(NODE_MODULES, { withFileTypes: true });
} catch {
// node_modules unreadable — fall back to the hoisted candidate only.
}
for (const entry of topLevel) {
if (!entry.isDirectory() || entry.name === packageName) {
continue;
}
const dir = path.join(storeDir, entry, "node_modules", packageName);
if (entry.name.startsWith("@")) {
const scopeDir = path.join(NODE_MODULES, entry.name);
// eslint-disable-next-line no-await-in-loop
const scoped = await readdir(scopeDir, { withFileTypes: true }).catch(
() => []
);
for (const dep of scoped) {
if (dep.isDirectory()) {
candidateDirs.push(
path.join(scopeDir, dep.name, "node_modules", packageName)
);
}
}
} else {
candidateDirs.push(
path.join(NODE_MODULES, entry.name, "node_modules", packageName)
);
}
}
for (const dir of candidateDirs) {
// eslint-disable-next-line no-await-in-loop
const pkg = await readFile(path.join(dir, "package.json"), "utf-8")
.then(JSON.parse)
+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);
+7 -51
View File
@@ -108,7 +108,7 @@ const runDevServer = async ({
}
};
const doneHandler = () => (err, stats) => {
const doneHandler = (done) => (err, stats) => {
if (err) {
log.error(err.stack || err);
if (err.details) {
@@ -122,26 +122,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 +160,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(
@@ -196,18 +177,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(),
})
)
);
@@ -252,7 +221,6 @@ gulp.task("rspack-prod-gallery", () =>
createGalleryConfig({
isProdBuild: true,
latestBuild: true,
isTestBuild: env.isTestBuild(),
})
)
);
@@ -301,18 +269,6 @@ gulp.task("rspack-prod-e2e-test-app", () =>
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"]])
)
);
+8 -14
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,8 +12,7 @@ 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.mts";
import "./fetch-nightly-translations.js";
const inFrontendDir = "translations/frontend";
const inBackendDir = "translations/backend";
@@ -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,
+27 -62
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,9 +47,7 @@ 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];
const presetEnvOpts = babelOpts.presets[0][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(
@@ -74,38 +55,22 @@ for (const buildType of ["Modern", "Legacy"]) {
Array.isArray(plugin) && plugin[0] === "babel-plugin-polyfill-corejs3"
)?.[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) {
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,
-552
View File
@@ -1,552 +0,0 @@
import { spawn, execFileSync } from "node:child_process";
import fs from "node:fs";
import path from "node:path";
import { createInterface } from "node:readline/promises";
export const LIFECYCLE_MODE_FLAGS = new Map([
["--background", "background"],
["--status", "status"],
["--stop", "stop"],
["--logs", "logs"],
]);
const AGENT_PROVIDERS = [
{
id: "opencode",
env: [
"OPENCODE",
"OPENCODE_BIN_PATH",
"OPENCODE_SERVER",
"OPENCODE_APP_INFO",
"OPENCODE_MODES",
],
processes: ["opencode"],
},
{
id: "claude-code",
env: ["CLAUDECODE"],
processes: ["claude"],
},
{
id: "cursor",
env: ["CURSOR_TRACE_ID"],
processes: [],
},
{
id: "github-copilot",
matchesEnv: (env) =>
env.TERM_PROGRAM === "vscode" && env.GIT_PAGER === "cat",
processes: [],
},
{
id: "generic",
env: ["AGENT", "AI_AGENT"],
processes: [],
},
];
const MAX_ANCESTRY_HOPS = 24;
const readProcessParent = (pid) => {
try {
const stat = fs.readFileSync(`/proc/${pid}/stat`, "utf8");
const commandEnd = stat.lastIndexOf(")");
const commandStart = stat.indexOf("(");
if (commandStart === -1 || commandEnd === -1) {
return undefined;
}
const parentPid = Number.parseInt(
stat.slice(commandEnd + 2).split(" ")[1] ?? "",
10
);
return Number.isFinite(parentPid)
? {
command: stat.slice(commandStart + 1, commandEnd).toLowerCase(),
parentPid,
}
: undefined;
} catch {
return undefined;
}
};
export const detectCodingAgent = (env = process.env, pid = process.pid) => {
if (env.HA_CODING_AGENT === "0") {
return undefined;
}
const envMatch = AGENT_PROVIDERS.find(
(provider) =>
provider.matchesEnv?.(env) || provider.env?.some((name) => env[name])
);
if (envMatch) {
return envMatch.id;
}
if (env.HA_CODING_AGENT === "1") {
return "unknown";
}
let currentPid = pid;
for (let hop = 0; hop < MAX_ANCESTRY_HOPS; hop++) {
const processInfo = readProcessParent(currentPid);
if (!processInfo) {
return undefined;
}
const processMatch = AGENT_PROVIDERS.find((provider) =>
provider.processes.some((name) => processInfo.command.includes(name))
);
if (processMatch) {
return processMatch.id;
}
if (processInfo.parentPid <= 1) {
return undefined;
}
currentPid = processInfo.parentPid;
}
return undefined;
};
const canPromptForConflict = () =>
Boolean(process.stdin.isTTY && process.stderr.isTTY && !detectCodingAgent());
const formatCommand = (command) =>
!("NO_COLOR" in process.env)
? `\u001b[1;36m${command}\u001b[0m`
: `\`${command}\``;
const confirmStopConflict = async (ownerDescription, stopCommand) => {
const readline = createInterface({
input: process.stdin,
output: process.stderr,
});
const controller = new AbortController();
const timeout = setTimeout(() => controller.abort(), 30_000);
try {
process.stderr.write(
`${ownerDescription} can be stopped with ${formatCommand(stopCommand)}.\n`
);
const answer = await readline.question("Stop it and continue? [y/N] ", {
signal: controller.signal,
});
return ["y", "yes"].includes(answer.trim().toLowerCase());
} catch (err) {
if (err?.name !== "AbortError") {
throw err;
}
process.stderr.write("\n");
return false;
} finally {
clearTimeout(timeout);
readline.close();
}
};
export const sleep = (ms) =>
new Promise((resolve) => {
setTimeout(resolve, ms);
});
export const waitFor = async (predicate, intervalMs, timeoutMs) => {
const deadline = Date.now() + timeoutMs;
const poll = async () => {
if (await predicate()) {
return true;
}
if (Date.now() >= deadline) {
return false;
}
await sleep(intervalMs);
return poll();
};
return poll();
};
export const isProcessAlive = (pid) => {
if (!Number.isInteger(pid) || pid <= 0) {
return false;
}
try {
process.kill(pid, 0);
return true;
} catch (err) {
// EPERM means the process exists but is owned by someone else.
return err.code === "EPERM";
}
};
export const processStartTime = (pid) => {
if (!isProcessAlive(pid)) {
return undefined;
}
try {
const stat = fs.readFileSync(`/proc/${pid}/stat`, "utf8");
return stat.slice(stat.lastIndexOf(")") + 2).split(" ")[19];
} catch {
try {
return execFileSync("ps", ["-o", "lstart=", "-p", String(pid)], {
encoding: "utf8",
stdio: ["ignore", "pipe", "ignore"],
}).trim();
} catch {
return undefined;
}
}
};
export const isProcessRecordAlive = ({ pid, startTime }) =>
Boolean(startTime) && processStartTime(pid) === startTime;
export const readProcessRecord = (file) => {
try {
const data = JSON.parse(fs.readFileSync(file, "utf8"));
return data && Number.isInteger(data.pid) ? data : undefined;
} catch (err) {
if (err.code === "ENOENT" || err instanceof SyntaxError) {
return undefined;
}
throw err;
}
};
export const writeProcessRecord = (file, data) => {
fs.mkdirSync(path.dirname(file), { recursive: true });
const temporary = `${file}.${process.pid}.${Date.now()}.tmp`;
try {
fs.writeFileSync(temporary, JSON.stringify(data));
fs.renameSync(temporary, file);
} finally {
removeFileIfExists(temporary);
}
};
export const removeProcessRecord = (file) => {
removeFileIfExists(file);
};
export const acquireProcessRecord = (file, data) => {
fs.mkdirSync(path.dirname(file), { recursive: true });
for (let attempt = 0; attempt < 2; attempt++) {
try {
const fd = fs.openSync(file, "wx");
try {
fs.writeFileSync(fd, JSON.stringify(data));
} finally {
fs.closeSync(fd);
}
return { acquired: true };
} catch (err) {
if (err.code !== "EEXIST") {
throw err;
}
const existing = readProcessRecord(file);
if (existing && isProcessRecordAlive(existing)) {
return { acquired: false, existing };
}
if (!existing && isRecentFile(file)) {
return { acquired: false };
}
const removed = withExclusiveFileLockSync(`${file}.cleanup`, () => {
const current = readProcessRecord(file);
if (
current &&
(current.token !== existing?.token || isProcessRecordAlive(current))
) {
return false;
}
removeProcessRecord(file);
return true;
});
if (!removed.acquired || !removed.value) {
return { acquired: false, existing: readProcessRecord(file) };
}
}
}
return { acquired: false, existing: readProcessRecord(file) };
};
export const releaseProcessRecord = (file, token, onRelease) => {
if (!token) {
return;
}
withExclusiveFileLockSync(`${file}.cleanup`, () => {
const existing = readProcessRecord(file);
if (!existing || existing.token === token) {
onRelease?.();
if (existing) {
removeProcessRecord(file);
}
}
});
};
const removeFileIfExists = (file) => {
try {
fs.rmSync(file);
} catch (err) {
if (err.code !== "ENOENT") {
throw err;
}
}
};
const isRecentFile = (file) => {
try {
return Date.now() - fs.statSync(file).mtimeMs < 5000;
} catch (err) {
if (err.code === "ENOENT") {
return false;
}
throw err;
}
};
export const withExclusiveFileLockSync = (file, operation) => {
fs.mkdirSync(path.dirname(file), { recursive: true });
for (let attempt = 0; attempt < 2; attempt++) {
let fd;
try {
fd = fs.openSync(file, "wx");
} catch (err) {
if (err.code !== "EEXIST") {
throw err;
}
const owner = readProcessRecord(file);
if (owner && isProcessRecordAlive(owner)) {
return { acquired: false };
}
if (!owner && isRecentFile(file)) {
return { acquired: false };
}
removeFileIfExists(file);
continue;
}
try {
fs.writeFileSync(
fd,
JSON.stringify({
pid: process.pid,
startTime: processStartTime(process.pid),
})
);
return { acquired: true, value: operation() };
} finally {
try {
fs.closeSync(fd);
} finally {
removeFileIfExists(file);
}
}
}
return { acquired: false };
};
export const spawnForeground = ({
cmd,
args,
cwd,
env,
processGroup = false,
onSpawn,
}) =>
new Promise((resolve, reject) => {
const child = spawn(cmd, args, {
cwd,
detached: processGroup,
env,
stdio: "inherit",
});
let settled = false;
const forwardSigint = () =>
signalProcess(child.pid, "SIGINT", processGroup);
const forwardSigterm = () =>
signalProcess(child.pid, "SIGTERM", processGroup);
const forwardSighup = () =>
signalProcess(child.pid, "SIGHUP", processGroup);
const removeSignalHandlers = () => {
process.off("SIGINT", forwardSigint);
process.off("SIGTERM", forwardSigterm);
process.off("SIGHUP", forwardSighup);
};
if (processGroup) {
process.on("SIGINT", forwardSigint);
process.on("SIGTERM", forwardSigterm);
process.on("SIGHUP", forwardSighup);
}
child.once("spawn", () => {
try {
onSpawn?.(child);
} catch (err) {
settled = true;
signalProcess(child.pid, "SIGTERM", processGroup);
removeSignalHandlers();
reject(err);
}
});
child.once("error", (err) => {
if (!settled) {
settled = true;
removeSignalHandlers();
process.stderr.write(`Failed to start ${cmd}: ${err.message}\n`);
resolve(1);
}
});
child.once("exit", (code) => {
if (!settled) {
settled = true;
removeSignalHandlers();
resolve(code ?? 1);
}
});
});
export const spawnDetachedToLog = ({ cmd, args, cwd, env, logFile }) =>
new Promise((resolve, reject) => {
fs.mkdirSync(path.dirname(logFile), { recursive: true });
const fd = fs.openSync(logFile, "w");
let child;
try {
child = spawn(cmd, args, {
cwd,
detached: true,
env,
stdio: ["ignore", fd, fd],
});
} finally {
fs.closeSync(fd);
}
child.once("spawn", () => {
child.unref();
resolve(child);
});
child.once("error", reject);
});
const signalProcess = (pid, signal, processGroup) => {
if (processGroup) {
try {
process.kill(-pid, signal);
return;
} catch {
// Fall back to the process itself.
}
}
try {
process.kill(pid, signal);
} catch {
// Already gone.
}
};
export const terminateProcess = async ({
pid,
isStopped,
processGroup = true,
graceMs = 10_000,
}) => {
signalProcess(pid, "SIGTERM", processGroup);
if (await waitFor(isStopped, 300, graceMs)) {
return true;
}
signalProcess(pid, "SIGKILL", processGroup);
await sleep(300);
return await isStopped();
};
const sameProcessRecord = (current, expected) =>
Boolean(expected?.token) && current?.token === expected.token;
const stopProcessRecord = async (file, owner) => {
let current = readProcessRecord(file);
if (!current) {
return true;
}
if (!sameProcessRecord(current, owner)) {
return false;
}
if (!isProcessRecordAlive(current)) {
releaseProcessRecord(file, current.token);
return true;
}
const stopped = await terminateProcess({
pid: current.pid,
processGroup: current.processGroup ?? false,
isStopped: () => {
const latest = readProcessRecord(file);
return (
!sameProcessRecord(latest, owner) ||
!latest ||
!isProcessRecordAlive(latest)
);
},
});
current = readProcessRecord(file);
if (current && !sameProcessRecord(current, owner)) {
return false;
}
if (!stopped && current) {
return false;
}
releaseProcessRecord(file, owner.token);
return true;
};
export const offerToStopProcessRecord = async ({
file,
owner,
ownerDescription,
stopCommand,
}) => {
if (
!owner ||
!stopCommand ||
!canPromptForConflict() ||
!(await confirmStopConflict(ownerDescription, stopCommand))
) {
return false;
}
return stopProcessRecord(file, owner);
};
export const terminateDetachedProcess = (child) =>
terminateProcess({
pid: child.pid,
processGroup: true,
isStopped: () => !isProcessAlive(child.pid),
});
export const outputLog = (logFile, follow, missingMessage) => {
if (!fs.existsSync(logFile)) {
process.stdout.write(missingMessage);
return Promise.resolve(0);
}
if (!follow) {
process.stdout.write(fs.readFileSync(logFile, "utf8"));
return Promise.resolve(0);
}
return new Promise((resolve) => {
const tail = spawn("tail", ["-f", logFile], { stdio: "inherit" });
let settled = false;
tail.once("error", () => {
if (!settled) {
settled = true;
process.stdout.write(fs.readFileSync(logFile, "utf8"));
resolve(0);
}
});
tail.once("exit", (code) => {
if (!settled) {
settled = true;
resolve(code ?? 1);
}
});
});
};
export const runCli = (main) => {
main().then(
(code) => {
process.exitCode = code;
},
(err) => {
process.stderr.write(`${err?.stack || err}\n`);
process.exitCode = 1;
}
);
};
@@ -12,42 +12,18 @@
const remapping = require("@ampproject/remapping");
// minify-literals is ESM-only, so load it via dynamic import from this CJS loader.
// Also map to cache loader promises per environment (e.g., 'modern', 'legacy')
const loaderInitPromises = new Map();
const initLoader = (browserslistEnv) => {
if (!loaderInitPromises.has(browserslistEnv)) {
loaderInitPromises.set(
browserslistEnv,
Promise.all([
import("minify-literals"),
import("browserslist"),
import("lightningcss"),
]).then(([minifyModule, browserslistModule, lightningcssModule]) => {
const browserslist = browserslistModule.default;
const { browserslistToTargets } = lightningcssModule;
const rawTargets = browserslist(null, { env: browserslistEnv });
if (!rawTargets.length) {
throw new Error(
`No browsers resolved for browserslist environment "${browserslistEnv}"`
);
}
const lightningcssTargets = browserslistToTargets(rawTargets);
return {
minifyHTMLLiterals: minifyModule.minifyHTMLLiterals,
lightningcssTargets,
};
})
);
let minifyPromise;
const getMinifier = () => {
if (!minifyPromise) {
minifyPromise = import("minify-literals").then((m) => m.minifyHTMLLiterals);
}
return loaderInitPromises.get(browserslistEnv);
return minifyPromise;
};
// HTML options mirror the previous babel-plugin-template-html-minifier config
// (html-minifier-next is option-compatible with html-minifier-terser). CSS in
// css`` templates and inline <style> is handled by minify-literals'
// lightningcss. We pass in the targets from browserslist so lightningcss
// can minify CSS appropriately for the build environment.
// css`` templates and inline <style> is handled by minify-literals' lightningcss
// default.
//
// `keepClosingSlash` is required for `svg`` templates: SVG elements such as
// `<path />` and `<circle />` are not void elements in HTML, so dropping the
@@ -64,16 +40,11 @@ const htmlOptions = {
module.exports = function minifyTemplateLiteralsLoader(source, map, meta) {
const callback = this.async();
const { browserslistEnv } = this.getOptions();
initLoader(browserslistEnv)
.then(({ minifyHTMLLiterals, lightningcssTargets }) =>
getMinifier()
.then((minifyHTMLLiterals) =>
minifyHTMLLiterals(source, {
fileName: this.resourcePath,
html: htmlOptions,
css: {
targets: lightningcssTargets,
},
})
)
.then((result) => {
-127
View File
@@ -1,127 +0,0 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
import {
acquireProcessRecord,
processStartTime,
readProcessRecord,
releaseProcessRecord,
} from "./managed-process.mjs";
const repoRoot = path.resolve(
path.dirname(fileURLToPath(import.meta.url)),
".."
);
export const buildCacheDir =
process.env.HA_BUILD_CACHE_DIR ??
path.join(repoRoot, "node_modules", ".cache");
const WORKFLOW_LOCK_TOKEN_ENV = "HA_WORKFLOW_LOCK_TOKEN";
const signalCleanups = new Set();
const cleanupSignals = ["SIGINT", "SIGTERM", "SIGHUP"];
const handleSignal = (signal) => {
for (const cleanup of signalCleanups) {
cleanup();
}
for (const cleanupSignal of cleanupSignals) {
process.off(cleanupSignal, handleSignal);
}
process.kill(process.pid, signal);
};
const registerSignalCleanup = (cleanup) => {
if (signalCleanups.size === 0) {
for (const signal of cleanupSignals) {
process.on(signal, handleSignal);
}
}
signalCleanups.add(cleanup);
};
const unregisterSignalCleanup = (cleanup) => {
signalCleanups.delete(cleanup);
if (signalCleanups.size === 0) {
for (const signal of cleanupSignals) {
process.off(signal, handleSignal);
}
}
};
export const workflowLockFile = path.join(buildCacheDir, "ha-workflow.lock");
export const workflowLockEnv = (token) => ({
...process.env,
[WORKFLOW_LOCK_TOKEN_ENV]: token,
});
export const describeOutputOwner = (owner) => {
if (owner?.kind === "build") {
return `frontend ${owner.modern ? "modern " : ""}build`;
}
if (owner?.kind === "dev") {
return `dev server (${owner.suite ?? "app"})`;
}
return owner?.target ? `Gulp task ${owner.target}` : "another process";
};
const createLockTask = ({ file, inheritedTokenEnv, kind, label, target }) => {
let exitToken;
const cleanup = () => {
if (!exitToken) {
return;
}
releaseProcessRecord(file, exitToken);
exitToken = undefined;
process.off("exit", cleanup);
unregisterSignalCleanup(cleanup);
};
const acquire = async () => {
const inheritedToken = process.env[inheritedTokenEnv];
if (inheritedToken) {
if (readProcessRecord(file)?.token !== inheritedToken) {
throw Error(
`${label} lock ownership was lost before ${target} started.`
);
}
exitToken = inheritedToken;
process.once("exit", cleanup);
registerSignalCleanup(cleanup);
return;
}
const token = `${process.pid}-${Date.now()}-${Math.random()}`;
const record = {
pid: process.pid,
startTime: processStartTime(process.pid),
processGroup: false,
kind,
target,
token,
};
const result = acquireProcessRecord(file, record);
if (!result.acquired) {
const pid = result.existing?.pid;
throw Error(
`Cannot run ${target}: ${describeOutputOwner(result.existing)} ` +
`already owns ${label}${pid ? ` (pid ${pid})` : ""}.`
);
}
exitToken = token;
process.once("exit", cleanup);
registerSignalCleanup(cleanup);
};
acquire.displayName = `lock-${label}:${target}`;
return acquire;
};
export const createWorkflowLockTask = (target) =>
createLockTask({
file: workflowLockFile,
inheritedTokenEnv: WORKFLOW_LOCK_TOKEN_ENV,
kind: "output",
label: "build and development workflow",
target,
});
Loaded 100 of 2209 files, more files were not shown because too many files have changed in this diff. Show more