diff --git a/website-src/app.html b/website-src/app.html new file mode 100644 index 00000000..975748a1 --- /dev/null +++ b/website-src/app.html @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/website-src/base.css b/website-src/base.css new file mode 100644 index 00000000..f3582dfd --- /dev/null +++ b/website-src/base.css @@ -0,0 +1,210 @@ +/* CSS reset */ + +html { + box-sizing: border-box; + font-size: 16px; +} + +*, *:before, *:after { + box-sizing: inherit; +} + +body, h1, h2, h3, h4, h5, h6, p { + margin: 0; + padding: 0; + font-weight: normal; +} + +img { + max-width: 100%; + height: auto; +} + +/* Actual styles below */ +body, html { + height: 100%; + margin: 0; + font-family: Jost, sans-serif; + background-color: #F8F8F8; + color: #1F1E1A; + font-size: 18px; + line-height: 2.5em; + overflow: hidden; +} + +.light-subtitle { + font-style: italic; + color: #1F1E1A; + font-size: 22px; + opacity: 0.8; + margin-top: -6px; +} + +.container { + display: grid; + grid-template-columns: 200px 1fr; + height: 100%; +} + +nav { + display: flex; + flex-direction: column; + justify-content: flex-start; + height: 100vh; + padding: 36px 20px 20px 20px; + line-height: 2em; + font-size: 18px; + background-color: #EEE; +} + +nav img { + border-radius: 16px; + width: 128px; + height: 128px; + margin-bottom: 24px; +} + +nav ul { + list-style-type: none; + padding: 0; +} + +nav ul li a { + color: #1F1E1A; + text-decoration: none; + display: block; +} + +nav li a { + color: #1F1E1A; + opacity: 0.8; +} + +nav li a.selected { + font-weight: 500; + opacity: 1.0; +} + +.copyright { + font-size: 14px; + opacity: 0.8; + margin-top: auto; + padding-top: 20px; +} + +main { + display: flex; + flex-direction: column; + height: 100vh; + overflow: auto; +} + +.main-content-area { + margin: 16px 0 128px 0; + max-width: 1280px; +} + +.main-content-area ul li { + margin-bottom: 16px; +} + +.main-content-area.compact-lists ol>li { + margin-top: 8px; + line-height: 1.5em; + position: relative; +} + +.main-content-area.compact-lists ul li { + margin-bottom: 0px; + line-height: 1.5em; +} + +header { + padding: 20px 20px 0 20px; +} + +header h1 { + font-size: 38px; + font-weight: 500; +} + +header p { + font-size: 26px; +} + +.content { + display: grid; + grid-template-columns: 1fr 1fr 1fr 1fr 1fr; + gap: 32px; + margin: 20px; + min-width: 1280px; +} + +.feature-box { + text-align: center; +} + +.feature-box.video { + grid-column: 1 / 6; +} + +.feature-box p { + font-style: italic; + margin-top: -16px; + line-height: 1.2em; +} + +.feature-box img { + height: 500px; + margin-bottom: 10px; + border-radius: 32px; + box-shadow: 0 0 10px 0 #e5e5e5; + display: inline-block; +} + +.description-box { + text-align: left; + line-height: 1.4em; + grid-column: 1 / 4; +} + +.description-box h2 { + font-size: 32px; + font-weight: 500; + margin: 16px 0; +} + +#features { + text-align: left; + grid-column: 4 / 6; +} + +.description-box p { + margin-bottom: 16px; +} + +.action-box { + margin-top: 48px; + grid-column: 1 / 4; + text-align: center; +} + +.action-box a { + display: inline-block; + padding: 16px 64px; + font-size: 26px; + font-weight: 500; + color: #FFF; + background-color: #AD5642; + border-radius: 16px; + text-decoration: none; + box-shadow: 0 0 6px 0 #999; +} + +button, a { + font-family: 'Jost', sans-serif; +} + +h1 + p { + margin-top: 16px; +} \ No newline at end of file diff --git a/website-src/contribute.css b/website-src/contribute.css new file mode 100644 index 00000000..d17d3636 --- /dev/null +++ b/website-src/contribute.css @@ -0,0 +1,24 @@ +.main-content-area { + padding: 0 32px; + max-width: 800px; +} + +.main-content-area p { + line-height: 1.5em; +} + +.main-content-area li { + line-height: 1.5em; +} + +.main-content-area ul li { + margin-bottom: 16px; +} + +.main-content-area h1 { + margin-top: 24px; +} + +.main-content-area h2 { + margin-top: 16px; +} \ No newline at end of file diff --git a/website-src/contribute.html b/website-src/contribute.html new file mode 100644 index 00000000..67692c89 --- /dev/null +++ b/website-src/contribute.html @@ -0,0 +1,74 @@ + + + + Contribute - kv4p HT + + + + + + + + + + + + + + +
+ +
+
+

Overview

+

+ I welcome contributions to this project! Or feel free to just fork it and make your own version, so long as you release the full source code (kv4p HT is licensed under GPL3). +

+

Discord

+

There is a kv4p HT Discord contributor channel to ask more technical questions, share ideas, or just discuss the project.

+

Project files

+
    +
  • Tinkercad 3D printer designs: case, stand
  • +
  • EasyEDA PCB design
  • +
  • Github project (Android and ESP32 source, .STL 3D print designs, PCB files)
  • +
      +
    • NOTE: For the ESP32 app use Arduino IDE, and these settings:
    • +
        +
      • Board: Install v2.0.17 of esp32 by Espressif Systems from Boards Manager - DO NOT use newer versions, the code is not compatible with the API changes that were made. The board may not be auto-detected when plugged in, make sure it says ESP32 Dev Module in the drop-down at the top of the IDE or select it manually.
      • +
      • Library: EspSoftwareSerial (8.1.0) - get this from the built-in library installer
      • +
      • Library: arduino-dra818 v1.0.1 - DO NOT use version 1.0.0 that's included in Arduino package installer, it's old and broken. Install with Sketch > Include Library > Add .ZIP Library.
      • +
      • Configuration: Choose Tools > Events Run On > Core 0 so audio processing interrupts run on a separate thread for maximum stability.
      • +
      +
    +
+

Contribution ideas

+

There are dozens of great project ideas for how you can help kv4P HT. Check out the enhnancement requests and bugs in the GitHub project.

+

Overview docs

+ +
+
+
+ + \ No newline at end of file diff --git a/website-src/donate.css b/website-src/donate.css new file mode 100644 index 00000000..b3c0b57d --- /dev/null +++ b/website-src/donate.css @@ -0,0 +1,9 @@ +.main-content-area { + padding: 32px 32px; + max-width: 800px; + line-height: 1.5em; +} + +.main-content-area img { + margin-top: 32px; +} \ No newline at end of file diff --git a/website-src/donate.html b/website-src/donate.html new file mode 100644 index 00000000..1598e9ae --- /dev/null +++ b/website-src/donate.html @@ -0,0 +1,49 @@ + + + + Release notes - kv4p HT + + + + + + + + + + + + + + +
+ +
+
+

kv4p HT is 100% free and open source, and doesn't accept donations. But it would make me super happy, if you enjoy the project, if you sent a few dollars to Hope Animal Rescue:

+

Logo of Hope Animal Rescue charity, showing a cute dog illustration.

+
+
+
+ + \ No newline at end of file diff --git a/website-src/esp-web-tools/dist/components/ew-checkbox.d.ts b/website-src/esp-web-tools/dist/components/ew-checkbox.d.ts new file mode 100644 index 00000000..35c32e92 --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ew-checkbox.d.ts @@ -0,0 +1,9 @@ +import { Checkbox } from "@material/web/checkbox/internal/checkbox.js"; +declare global { + interface HTMLElementTagNameMap { + "ew-checkbox": EwCheckbox; + } +} +export declare class EwCheckbox extends Checkbox { + static styles: import("lit").CSSResult[]; +} diff --git a/website-src/esp-web-tools/dist/components/ew-checkbox.js b/website-src/esp-web-tools/dist/components/ew-checkbox.js new file mode 100644 index 00000000..7319f256 --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ew-checkbox.js @@ -0,0 +1,6 @@ +import { Checkbox } from "@material/web/checkbox/internal/checkbox.js"; +import { styles } from "@material/web/checkbox/internal/checkbox-styles.css.js"; +export class EwCheckbox extends Checkbox { +} +EwCheckbox.styles = [styles]; +customElements.define("ew-checkbox", EwCheckbox); diff --git a/website-src/esp-web-tools/dist/components/ew-circular-progress.d.ts b/website-src/esp-web-tools/dist/components/ew-circular-progress.d.ts new file mode 100644 index 00000000..54d54817 --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ew-circular-progress.d.ts @@ -0,0 +1,9 @@ +import { CircularProgress } from "@material/web/progress/internal/circular-progress.js"; +declare global { + interface HTMLElementTagNameMap { + "ew-circular-progress": EwCircularProgress; + } +} +export declare class EwCircularProgress extends CircularProgress { + static styles: import("lit").CSSResult[]; +} diff --git a/website-src/esp-web-tools/dist/components/ew-circular-progress.js b/website-src/esp-web-tools/dist/components/ew-circular-progress.js new file mode 100644 index 00000000..a4a87291 --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ew-circular-progress.js @@ -0,0 +1,6 @@ +import { CircularProgress } from "@material/web/progress/internal/circular-progress.js"; +import { styles } from "@material/web/progress/internal/circular-progress-styles.css.js"; +export class EwCircularProgress extends CircularProgress { +} +EwCircularProgress.styles = [styles]; +customElements.define("ew-circular-progress", EwCircularProgress); diff --git a/website-src/esp-web-tools/dist/components/ew-dialog.d.ts b/website-src/esp-web-tools/dist/components/ew-dialog.d.ts new file mode 100644 index 00000000..64620fb6 --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ew-dialog.d.ts @@ -0,0 +1,9 @@ +import { Dialog } from "@material/web/dialog/internal/dialog.js"; +declare global { + interface HTMLElementTagNameMap { + "ew-dialog": EwDialog; + } +} +export declare class EwDialog extends Dialog { + static styles: import("lit").CSSResult[]; +} diff --git a/website-src/esp-web-tools/dist/components/ew-dialog.js b/website-src/esp-web-tools/dist/components/ew-dialog.js new file mode 100644 index 00000000..f3190ff3 --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ew-dialog.js @@ -0,0 +1,6 @@ +import { Dialog } from "@material/web/dialog/internal/dialog.js"; +import { styles } from "@material/web/dialog/internal/dialog-styles.css"; +export class EwDialog extends Dialog { +} +EwDialog.styles = [styles]; +customElements.define("ew-dialog", EwDialog); diff --git a/website-src/esp-web-tools/dist/components/ew-divider.d.ts b/website-src/esp-web-tools/dist/components/ew-divider.d.ts new file mode 100644 index 00000000..87905e75 --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ew-divider.d.ts @@ -0,0 +1,9 @@ +import { Divider } from "@material/web/divider/internal/divider.js"; +declare global { + interface HTMLElementTagNameMap { + "ew-divider": EwDivider; + } +} +export declare class EwDivider extends Divider { + static styles: import("lit").CSSResult[]; +} diff --git a/website-src/esp-web-tools/dist/components/ew-divider.js b/website-src/esp-web-tools/dist/components/ew-divider.js new file mode 100644 index 00000000..130308e6 --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ew-divider.js @@ -0,0 +1,6 @@ +import { Divider } from "@material/web/divider/internal/divider.js"; +import { styles } from "@material/web/divider/internal/divider-styles.css.js"; +export class EwDivider extends Divider { +} +EwDivider.styles = [styles]; +customElements.define("ew-divider", EwDivider); diff --git a/website-src/esp-web-tools/dist/components/ew-filled-select.d.ts b/website-src/esp-web-tools/dist/components/ew-filled-select.d.ts new file mode 100644 index 00000000..ba4388d9 --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ew-filled-select.d.ts @@ -0,0 +1,9 @@ +import { FilledSelect } from "@material/web/select/internal/filled-select.js"; +declare global { + interface HTMLElementTagNameMap { + "ew-filled-select": EwFilledSelect; + } +} +export declare class EwFilledSelect extends FilledSelect { + static styles: import("lit").CSSResult[]; +} diff --git a/website-src/esp-web-tools/dist/components/ew-filled-select.js b/website-src/esp-web-tools/dist/components/ew-filled-select.js new file mode 100644 index 00000000..4e00a2fb --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ew-filled-select.js @@ -0,0 +1,7 @@ +import { FilledSelect } from "@material/web/select/internal/filled-select.js"; +import { styles } from "@material/web/select/internal/filled-select-styles.css.js"; +import { styles as sharedStyles } from "@material/web/select/internal/shared-styles.css.js"; +export class EwFilledSelect extends FilledSelect { +} +EwFilledSelect.styles = [sharedStyles, styles]; +customElements.define("ew-filled-select", EwFilledSelect); diff --git a/website-src/esp-web-tools/dist/components/ew-filled-text-field.d.ts b/website-src/esp-web-tools/dist/components/ew-filled-text-field.d.ts new file mode 100644 index 00000000..f70907f6 --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ew-filled-text-field.d.ts @@ -0,0 +1,10 @@ +import { FilledTextField } from "@material/web/textfield/internal/filled-text-field.js"; +declare global { + interface HTMLElementTagNameMap { + "ew-filled-text-field": EwFilledTextField; + } +} +export declare class EwFilledTextField extends FilledTextField { + static styles: import("lit").CSSResult[]; + protected readonly fieldTag: import("lit-html/static").StaticValue; +} diff --git a/website-src/esp-web-tools/dist/components/ew-filled-text-field.js b/website-src/esp-web-tools/dist/components/ew-filled-text-field.js new file mode 100644 index 00000000..42645e8e --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ew-filled-text-field.js @@ -0,0 +1,12 @@ +import { styles as filledStyles } from "@material/web/textfield/internal/filled-styles.css.js"; +import { FilledTextField } from "@material/web/textfield/internal/filled-text-field.js"; +import { styles as sharedStyles } from "@material/web/textfield/internal/shared-styles.css.js"; +import { literal } from "lit/static-html.js"; +export class EwFilledTextField extends FilledTextField { + constructor() { + super(...arguments); + this.fieldTag = literal `md-filled-field`; + } +} +EwFilledTextField.styles = [sharedStyles, filledStyles]; +customElements.define("ew-filled-text-field", EwFilledTextField); diff --git a/website-src/esp-web-tools/dist/components/ew-icon-button.d.ts b/website-src/esp-web-tools/dist/components/ew-icon-button.d.ts new file mode 100644 index 00000000..485d5ee7 --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ew-icon-button.d.ts @@ -0,0 +1,9 @@ +import { IconButton } from "@material/web/iconbutton/internal/icon-button.js"; +declare global { + interface HTMLElementTagNameMap { + "ew-icon-button": EwIconButton; + } +} +export declare class EwIconButton extends IconButton { + static styles: import("lit").CSSResult[]; +} diff --git a/website-src/esp-web-tools/dist/components/ew-icon-button.js b/website-src/esp-web-tools/dist/components/ew-icon-button.js new file mode 100644 index 00000000..414e5873 --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ew-icon-button.js @@ -0,0 +1,7 @@ +import { IconButton } from "@material/web/iconbutton/internal/icon-button.js"; +import { styles as sharedStyles } from "@material/web/iconbutton/internal/shared-styles.css.js"; +import { styles } from "@material/web/iconbutton/internal/standard-styles.css.js"; +export class EwIconButton extends IconButton { +} +EwIconButton.styles = [sharedStyles, styles]; +customElements.define("ew-icon-button", EwIconButton); diff --git a/website-src/esp-web-tools/dist/components/ew-list-item.d.ts b/website-src/esp-web-tools/dist/components/ew-list-item.d.ts new file mode 100644 index 00000000..ad01f526 --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ew-list-item.d.ts @@ -0,0 +1,9 @@ +import { ListItemEl as ListItem } from "@material/web/list/internal/listitem/list-item.js"; +declare global { + interface HTMLElementTagNameMap { + "ew-list-item": EwListItem; + } +} +export declare class EwListItem extends ListItem { + static styles: import("lit").CSSResult[]; +} diff --git a/website-src/esp-web-tools/dist/components/ew-list-item.js b/website-src/esp-web-tools/dist/components/ew-list-item.js new file mode 100644 index 00000000..87e3011f --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ew-list-item.js @@ -0,0 +1,6 @@ +import { ListItemEl as ListItem } from "@material/web/list/internal/listitem/list-item.js"; +import { styles } from "@material/web/list/internal/listitem/list-item-styles.css.js"; +export class EwListItem extends ListItem { +} +EwListItem.styles = [styles]; +customElements.define("ew-list-item", EwListItem); diff --git a/website-src/esp-web-tools/dist/components/ew-list.d.ts b/website-src/esp-web-tools/dist/components/ew-list.d.ts new file mode 100644 index 00000000..67542d18 --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ew-list.d.ts @@ -0,0 +1,9 @@ +import { List } from "@material/web/list/internal/list.js"; +declare global { + interface HTMLElementTagNameMap { + "ew-list": EwList; + } +} +export declare class EwList extends List { + static styles: import("lit").CSSResult[]; +} diff --git a/website-src/esp-web-tools/dist/components/ew-list.js b/website-src/esp-web-tools/dist/components/ew-list.js new file mode 100644 index 00000000..716c9c3b --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ew-list.js @@ -0,0 +1,6 @@ +import { List } from "@material/web/list/internal/list.js"; +import { styles } from "@material/web/list/internal/list-styles.css.js"; +export class EwList extends List { +} +EwList.styles = [styles]; +customElements.define("ew-list", EwList); diff --git a/website-src/esp-web-tools/dist/components/ew-select-option.d.ts b/website-src/esp-web-tools/dist/components/ew-select-option.d.ts new file mode 100644 index 00000000..38c1543f --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ew-select-option.d.ts @@ -0,0 +1,9 @@ +import { SelectOptionEl } from "@material/web/select/internal/selectoption/select-option.js"; +declare global { + interface HTMLElementTagNameMap { + "ew-select-option": EwSelectOption; + } +} +export declare class EwSelectOption extends SelectOptionEl { + static styles: import("lit").CSSResult[]; +} diff --git a/website-src/esp-web-tools/dist/components/ew-select-option.js b/website-src/esp-web-tools/dist/components/ew-select-option.js new file mode 100644 index 00000000..3951591d --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ew-select-option.js @@ -0,0 +1,6 @@ +import { styles } from "@material/web/menu/internal/menuitem/menu-item-styles.css.js"; +import { SelectOptionEl } from "@material/web/select/internal/selectoption/select-option.js"; +export class EwSelectOption extends SelectOptionEl { +} +EwSelectOption.styles = [styles]; +customElements.define("ew-select-option", EwSelectOption); diff --git a/website-src/esp-web-tools/dist/components/ew-text-button.d.ts b/website-src/esp-web-tools/dist/components/ew-text-button.d.ts new file mode 100644 index 00000000..61d86f85 --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ew-text-button.d.ts @@ -0,0 +1,9 @@ +import { TextButton } from "@material/web/button/internal/text-button.js"; +declare global { + interface HTMLElementTagNameMap { + "ew-text-button": EwTextButton; + } +} +export declare class EwTextButton extends TextButton { + static styles: import("lit").CSSResult[]; +} diff --git a/website-src/esp-web-tools/dist/components/ew-text-button.js b/website-src/esp-web-tools/dist/components/ew-text-button.js new file mode 100644 index 00000000..36cedf62 --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ew-text-button.js @@ -0,0 +1,7 @@ +import { styles as sharedStyles } from "@material/web/button/internal/shared-styles.css.js"; +import { TextButton } from "@material/web/button/internal/text-button.js"; +import { styles as textStyles } from "@material/web/button/internal/text-styles.css.js"; +export class EwTextButton extends TextButton { +} +EwTextButton.styles = [sharedStyles, textStyles]; +customElements.define("ew-text-button", EwTextButton); diff --git a/website-src/esp-web-tools/dist/components/ewt-console.d.ts b/website-src/esp-web-tools/dist/components/ewt-console.d.ts new file mode 100644 index 00000000..6945396b --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ewt-console.d.ts @@ -0,0 +1,20 @@ +/// +import { Logger } from "../const"; +export declare class EwtConsole extends HTMLElement { + port: SerialPort; + logger: Logger; + allowInput: boolean; + private _console?; + private _cancelConnection?; + logs(): string; + connectedCallback(): void; + private _connect; + private _sendCommand; + disconnect(): Promise; + reset(): Promise; +} +declare global { + interface HTMLElementTagNameMap { + "ewt-console": EwtConsole; + } +} diff --git a/website-src/esp-web-tools/dist/components/ewt-console.js b/website-src/esp-web-tools/dist/components/ewt-console.js new file mode 100644 index 00000000..67843561 --- /dev/null +++ b/website-src/esp-web-tools/dist/components/ewt-console.js @@ -0,0 +1,145 @@ +import { ColoredConsole, coloredConsoleStyles } from "../util/console-color"; +import { sleep } from "../util/sleep"; +import { LineBreakTransformer } from "../util/line-break-transformer"; +import { TimestampTransformer } from "../util/timestamp-transformer"; +export class EwtConsole extends HTMLElement { + constructor() { + super(...arguments); + this.allowInput = true; + } + logs() { + var _a; + return ((_a = this._console) === null || _a === void 0 ? void 0 : _a.logs()) || ""; + } + connectedCallback() { + if (this._console) { + return; + } + const shadowRoot = this.attachShadow({ mode: "open" }); + shadowRoot.innerHTML = ` + +
+ ${this.allowInput + ? `
+ > + +
+ ` + : ""} + `; + this._console = new ColoredConsole(this.shadowRoot.querySelector("div")); + if (this.allowInput) { + const input = this.shadowRoot.querySelector("input"); + this.addEventListener("click", () => { + var _a; + // Only focus input if user didn't select some text + if (((_a = getSelection()) === null || _a === void 0 ? void 0 : _a.toString()) === "") { + input.focus(); + } + }); + input.addEventListener("keydown", (ev) => { + if (ev.key === "Enter") { + ev.preventDefault(); + ev.stopPropagation(); + this._sendCommand(); + } + }); + } + const abortController = new AbortController(); + const connection = this._connect(abortController.signal); + this._cancelConnection = () => { + abortController.abort(); + return connection; + }; + } + async _connect(abortSignal) { + this.logger.debug("Starting console read loop"); + try { + await this.port + .readable.pipeThrough(new TextDecoderStream(), { + signal: abortSignal, + }) + .pipeThrough(new TransformStream(new LineBreakTransformer())) + .pipeThrough(new TransformStream(new TimestampTransformer())) + .pipeTo(new WritableStream({ + write: (chunk) => { + this._console.addLine(chunk.replace("\r", "")); + }, + })); + if (!abortSignal.aborted) { + this._console.addLine(""); + this._console.addLine(""); + this._console.addLine("Terminal disconnected"); + } + } + catch (e) { + this._console.addLine(""); + this._console.addLine(""); + this._console.addLine(`Terminal disconnected: ${e}`); + } + finally { + await sleep(100); + this.logger.debug("Finished console read loop"); + } + } + async _sendCommand() { + const input = this.shadowRoot.querySelector("input"); + const command = input.value; + const encoder = new TextEncoder(); + const writer = this.port.writable.getWriter(); + await writer.write(encoder.encode(command + "\r\n")); + this._console.addLine(`> ${command}\r\n`); + input.value = ""; + input.focus(); + try { + writer.releaseLock(); + } + catch (err) { + console.error("Ignoring release lock error", err); + } + } + async disconnect() { + if (this._cancelConnection) { + await this._cancelConnection(); + this._cancelConnection = undefined; + } + } + async reset() { + this.logger.debug("Triggering reset"); + await this.port.setSignals({ + dataTerminalReady: false, + requestToSend: true, + }); + await sleep(250); + await this.port.setSignals({ + dataTerminalReady: false, + requestToSend: false, + }); + await sleep(250); + await new Promise((resolve) => setTimeout(resolve, 1000)); + } +} +customElements.define("ewt-console", EwtConsole); diff --git a/website-src/esp-web-tools/dist/components/svg.d.ts b/website-src/esp-web-tools/dist/components/svg.d.ts new file mode 100644 index 00000000..bfe8acfa --- /dev/null +++ b/website-src/esp-web-tools/dist/components/svg.d.ts @@ -0,0 +1,9 @@ +export declare const closeIcon: import("lit-html").TemplateResult<2>; +export declare const refreshIcon: import("lit-html").TemplateResult<2>; +export declare const listItemInstallIcon: import("lit-html").TemplateResult<2>; +export declare const listItemWifi: import("lit-html").TemplateResult<2>; +export declare const listItemConsole: import("lit-html").TemplateResult<2>; +export declare const listItemVisitDevice: import("lit-html").TemplateResult<2>; +export declare const listItemHomeAssistant: import("lit-html").TemplateResult<2>; +export declare const listItemEraseUserData: import("lit-html").TemplateResult<2>; +export declare const listItemFundDevelopment: import("lit-html").TemplateResult<2>; diff --git a/website-src/esp-web-tools/dist/components/svg.js b/website-src/esp-web-tools/dist/components/svg.js new file mode 100644 index 00000000..93dac92b --- /dev/null +++ b/website-src/esp-web-tools/dist/components/svg.js @@ -0,0 +1,52 @@ +import { svg } from "lit"; +export const closeIcon = svg ` + + + +`; +export const refreshIcon = svg ` + + + +`; +export const listItemInstallIcon = svg ` + + + +`; +export const listItemWifi = svg ` + + + +`; +export const listItemConsole = svg ` + + + +`; +export const listItemVisitDevice = svg ` + + + +`; +export const listItemHomeAssistant = svg ` + + + +`; +export const listItemEraseUserData = svg ` + + + +`; +export const listItemFundDevelopment = svg ` + + + +`; diff --git a/website-src/esp-web-tools/dist/connect.d.ts b/website-src/esp-web-tools/dist/connect.d.ts new file mode 100644 index 00000000..52345dc0 --- /dev/null +++ b/website-src/esp-web-tools/dist/connect.d.ts @@ -0,0 +1,2 @@ +import type { InstallButton } from "./install-button.js"; +export declare const connect: (button: InstallButton) => Promise; diff --git a/website-src/esp-web-tools/dist/connect.js b/website-src/esp-web-tools/dist/connect.js new file mode 100644 index 00000000..552b839b --- /dev/null +++ b/website-src/esp-web-tools/dist/connect.js @@ -0,0 +1,33 @@ +export const connect = async (button) => { + import("./install-dialog.js"); + let port; + try { + port = await navigator.serial.requestPort(); + } + catch (err) { + if (err.name === "NotFoundError") { + import("./no-port-picked/index").then((mod) => mod.openNoPortPickedDialog(() => connect(button))); + return; + } + alert(`Error: ${err.message}`); + return; + } + if (!port) { + return; + } + try { + await port.open({ baudRate: 115200 }); + } + catch (err) { + alert(err.message); + return; + } + const el = document.createElement("ewt-install-dialog"); + el.port = port; + el.manifestPath = button.manifest || button.getAttribute("manifest"); + el.overrides = button.overrides; + el.addEventListener("closed", () => { + port.close(); + }, { once: true }); + document.body.appendChild(el); +}; diff --git a/website-src/esp-web-tools/dist/const.d.ts b/website-src/esp-web-tools/dist/const.d.ts new file mode 100644 index 00000000..1b1cae68 --- /dev/null +++ b/website-src/esp-web-tools/dist/const.d.ts @@ -0,0 +1,87 @@ +export interface Logger { + log(msg: string, ...args: any[]): void; + error(msg: string, ...args: any[]): void; + debug(msg: string, ...args: any[]): void; +} +export interface Build { + chipFamily: "ESP32" | "ESP32-C2" | "ESP32-C3" | "ESP32-C6" | "ESP32-H2" | "ESP32-S2" | "ESP32-S3" | "ESP8266"; + parts: { + path: string; + offset: number; + }[]; +} +export interface Manifest { + name: string; + version: string; + home_assistant_domain?: string; + funding_url?: string; + /** @deprecated use `new_install_prompt_erase` instead */ + new_install_skip_erase?: boolean; + new_install_prompt_erase?: boolean; + new_install_improv_wait_time?: number; + builds: Build[]; +} +export interface BaseFlashState { + state: FlashStateType; + message: string; + manifest?: Manifest; + build?: Build; + chipFamily?: Build["chipFamily"] | "Unknown Chip"; +} +export interface InitializingState extends BaseFlashState { + state: FlashStateType.INITIALIZING; + details: { + done: boolean; + }; +} +export interface PreparingState extends BaseFlashState { + state: FlashStateType.PREPARING; + details: { + done: boolean; + }; +} +export interface ErasingState extends BaseFlashState { + state: FlashStateType.ERASING; + details: { + done: boolean; + }; +} +export interface WritingState extends BaseFlashState { + state: FlashStateType.WRITING; + details: { + bytesTotal: number; + bytesWritten: number; + percentage: number; + }; +} +export interface FinishedState extends BaseFlashState { + state: FlashStateType.FINISHED; +} +export interface ErrorState extends BaseFlashState { + state: FlashStateType.ERROR; + details: { + error: FlashError; + details: string | Error; + }; +} +export type FlashState = InitializingState | PreparingState | ErasingState | WritingState | FinishedState | ErrorState; +export declare const enum FlashStateType { + INITIALIZING = "initializing", + PREPARING = "preparing", + ERASING = "erasing", + WRITING = "writing", + FINISHED = "finished", + ERROR = "error" +} +export declare const enum FlashError { + FAILED_INITIALIZING = "failed_initialize", + FAILED_MANIFEST_FETCH = "fetch_manifest_failed", + NOT_SUPPORTED = "not_supported", + FAILED_FIRMWARE_DOWNLOAD = "failed_firmware_download", + WRITE_FAILED = "write_failed" +} +declare global { + interface HTMLElementEventMap { + "state-changed": CustomEvent; + } +} diff --git a/website-src/esp-web-tools/dist/const.js b/website-src/esp-web-tools/dist/const.js new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/website-src/esp-web-tools/dist/const.js @@ -0,0 +1 @@ +export {}; diff --git a/website-src/esp-web-tools/dist/esp-web-tools.min.js b/website-src/esp-web-tools/dist/esp-web-tools.min.js new file mode 100644 index 00000000..fa6655da --- /dev/null +++ b/website-src/esp-web-tools/dist/esp-web-tools.min.js @@ -0,0 +1,1630 @@ +var ESPWebTools=function(t){"use strict";const e=async t=>{let i;Promise.resolve().then((function(){return Ha}));try{i=await navigator.serial.requestPort()}catch(i){return"NotFoundError"===i.name?void Promise.resolve().then((function(){return Ga})).then((i=>i.openNoPortPickedDialog((()=>e(t))))):void alert(`Error: ${i.message}`)}if(!i)return;try{await i.open({baudRate:115200})}catch(t){return void alert(t.message)}const r=document.createElement("ewt-install-dialog");r.port=i,r.manifestPath=t.manifest||t.getAttribute("manifest"),r.overrides=t.overrides,r.addEventListener("closed",(()=>{i.close()}),{once:!0}),document.body.appendChild(r)};class i extends HTMLElement{connectedCallback(){if(this.renderRoot)return;if(this.renderRoot=this.attachShadow({mode:"open"}),!i.isSupported||!i.isAllowed)return this.toggleAttribute("install-unsupported",!0),void(this.renderRoot.innerHTML=i.isAllowed?"Your browser does not support installing things on ESP devices. Use Google Chrome or Microsoft Edge.":"You can only install ESP devices on HTTPS websites or on the localhost.");this.toggleAttribute("install-supported",!0);const t=document.createElement("slot");t.addEventListener("click",(async t=>{t.preventDefault(),e(this)})),t.name="activate";const r=document.createElement("button");if(r.innerText="Connect",t.append(r),"adoptedStyleSheets"in Document.prototype&&"replaceSync"in CSSStyleSheet.prototype){const t=new CSSStyleSheet;t.replaceSync(i.style),this.renderRoot.adoptedStyleSheets=[t]}else{const t=document.createElement("style");t.innerText=i.style,this.renderRoot.append(t)}this.renderRoot.append(t)}}function r(t,e,i,r){var o,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(n=(s<3?o(n):s>3?o(e,i,n):o(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n}i.isSupported="serial"in navigator,i.isAllowed=window.isSecureContext,i.style='\n button {\n position: relative;\n cursor: pointer;\n font-size: 14px;\n font-weight: 500;\n padding: 10px 24px;\n color: var(--esp-tools-button-text-color, #fff);\n background-color: var(--esp-tools-button-color, #03a9f4);\n border: none;\n border-radius: var(--esp-tools-button-border-radius, 9999px);\n }\n button::before {\n content: " ";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n opacity: 0.2;\n border-radius: var(--esp-tools-button-border-radius, 9999px);\n }\n button:hover::before {\n background-color: rgba(255,255,255,.8);\n }\n button:focus {\n outline: none;\n }\n button:focus::before {\n background-color: white;\n }\n button:active::before {\n background-color: grey;\n }\n :host([active]) button {\n color: rgba(0, 0, 0, 0.38);\n background-color: rgba(0, 0, 0, 0.12);\n box-shadow: none;\n cursor: unset;\n pointer-events: none;\n }\n .hidden {\n display: none;\n }',customElements.define("esp-web-install-button",i),"function"==typeof SuppressedError&&SuppressedError; +/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const o=globalThis,s=o.ShadowRoot&&(void 0===o.ShadyCSS||o.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),a=new WeakMap;let l=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(s&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=a.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&a.set(e,t))}return t}toString(){return this.cssText}};const d=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;re+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[r+1]),t[0]);return new l(o,t,n)},c=s?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new l("string"==typeof t?t:t+"",void 0,n))(e)})(t):t +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */,{is:h,defineProperty:A,getOwnPropertyDescriptor:p,getOwnPropertyNames:g,getOwnPropertySymbols:f,getPrototypeOf:u}=Object,m=globalThis,v=m.trustedTypes,w=v?v.emptyScript:"",y=m.reactiveElementPolyfillSupport,b=(t,e)=>t,_={toAttribute(t,e){switch(e){case Boolean:t=t?w:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},E=(t,e)=>!h(t,e),x={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:E};Symbol.metadata??=Symbol("metadata"),m.litPropertyMetadata??=new WeakMap;let C=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:x;if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,e);void 0!==r&&A(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){const{get:r,set:o}=p(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return r?.call(this)},set(e){const s=r?.call(this);o.call(this,e),this.requestUpdate(t,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??x}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const t=u(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const t=this.properties,e=[...g(t),...f(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(c(t))}else void 0!==t&&e.push(c(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(s)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of e){const e=document.createElement("style"),r=o.litNonce;void 0!==r&&e.setAttribute("nonce",r),e.textContent=i.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(void 0!==r&&!0===i.reflect){const o=(void 0!==i.converter?.toAttribute?i.converter:_).toAttribute(e,i.type);this._$Em=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){const i=this.constructor,r=i._$Eh.get(t);if(void 0!==r&&this._$Em!==r){const t=i.getPropertyOptions(r),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:_;this._$Em=r,this[r]=o.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??E)(this[t],e))return;this.P(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t)!0!==i.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],i)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}};C.elementStyles=[],C.shadowRootOptions={mode:"open"},C[b("elementProperties")]=new Map,C[b("finalized")]=new Map,y?.({ReactiveElement:C}),(m.reactiveElementVersions??=[]).push("2.0.4"); +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const I=globalThis,B=I.trustedTypes,S=B?B.createPolicy("lit-html",{createHTML:t=>t}):void 0,R="$lit$",k=`lit$${(Math.random()+"").slice(9)}$`,D="?"+k,M=`<${D}>`,T=document,Q=()=>T.createComment(""),F=t=>null===t||"object"!=typeof t&&"function"!=typeof t,O=Array.isArray,P="[ \t\n\f\r]",H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,L=/-->/g,U=/>/g,G=RegExp(`>|${P}(?:([^\\s"'>=/]+)(${P}*=${P}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),z=/'/g,K=/"/g,Y=/^(?:script|style|textarea|title)$/i,N=t=>function(e){for(var i=arguments.length,r=new Array(i>1?i-1:0),o=1;o{const i=t.length-1,r=[];let o,s=2===e?"":"",n=H;for(let e=0;e"===l[0]?(n=o??H,d=-1):void 0===l[1]?d=-2:(d=n.lastIndex-l[2].length,a=l[1],n=void 0===l[3]?G:'"'===l[3]?K:z):n===K||n===z?n=G:n===L||n===U?n=H:(n=G,o=void 0);const h=n===G&&t[e+1].startsWith("/>")?" ":"";s+=n===H?i+M:d>=0?(r.push(a),i.slice(0,d)+R+i.slice(d)+k+h):i+k+(-2===d?e:h)}return[V(t,s+(t[i]||"")+(2===e?"":"")),r]};class tt{constructor(t,e){let i,{strings:r,_$litType$:o}=t;this.parts=[];let s=0,n=0;const a=r.length-1,l=this.parts,[d,c]=X(r,o);if(this.el=tt.createElement(d,e),q.currentNode=this.el.content,2===o){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=q.nextNode())&&l.length0){i.textContent=B?B.emptyScript:"";for(let r=0;r2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3?arguments[3]:void 0;if(e===j)return e;let o=void 0!==r?i._$Co?.[r]:i._$Cl;const s=F(e)?void 0:e._$litDirective$;return o?.constructor!==s&&(o?._$AO?.(!1),void 0===s?o=void 0:(o=new s(t),o._$AT(t,i,r)),void 0!==r?(i._$Co??=[])[r]=o:i._$Cl=o),void 0!==o&&(e=et(t,o._$AS(t,e.values),o,r)),e}class it{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,r=(t?.creationScope??T).importNode(e,!0);q.currentNode=r;let o=q.nextNode(),s=0,n=0,a=i[0];for(;void 0!==a;){if(s===a.index){let e;2===a.type?e=new rt(o,o.nextSibling,this,t):1===a.type?e=new a.ctor(o,a.name,a.strings,this,t):6===a.type&&(e=new lt(o,this,t)),this._$AV.push(e),a=i[++n]}s!==a?.index&&(o=q.nextNode(),s++)}return q.currentNode=T,r}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class rt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=W,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t){t=et(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this),F(t)?t===W||null==t||""===t?(this._$AH!==W&&this._$AR(),this._$AH=W):t!==this._$AH&&t!==j&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>O(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==W&&F(this._$AH)?this._$AA.nextSibling.data=t:this.T(T.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,r="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=tt.createElement(V(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(e);else{const t=new it(r,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=Z.get(t.strings);return void 0===e&&Z.set(t.strings,e=new tt(t)),e}k(t){O(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const o of t)r===e.length?e.push(i=new rt(this.S(Q()),this.S(Q()),this,this.options)):i=e[r],i._$AI(o),r++;r0&&void 0!==arguments[0]?arguments[0]:this._$AA.nextSibling,e=arguments.length>1?arguments[1]:void 0;for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class ot{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,r,o){this.type=1,this._$AH=W,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=W}_$AI(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const o=this.strings;let s=!1;if(void 0===o)t=et(this,t,e,0),s=!F(t)||t!==this._$AH&&t!==j,s&&(this._$AH=t);else{const r=t;let n,a;for(t=o[0],n=0;n1&&void 0!==arguments[1]?arguments[1]:this,0)??W)===j)return;const e=this._$AH,i=t===W&&e!==W||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,r=t!==W&&(e===W||i);i&&this.element.removeEventListener(this.name,this,e),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class lt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){et(this,t)}}const dt=I.litHtmlPolyfillSupport;dt?.(tt,rt),(I.litHtmlVersions??=[]).push("3.1.2");const ct=(t,e,i)=>{const r=i?.renderBefore??e;let o=r._$litPart$;if(void 0===o){const t=i?.renderBefore??null;r._$litPart$=o=new rt(e.insertBefore(Q(),t),t,void 0,i??{})}return o._$AI(t),o}; +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */let ht=class extends C{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ct(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return j}};ht._$litElement$=!0,ht.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:ht});const At=globalThis.litElementPolyfillSupport;At?.({LitElement:ht}),(globalThis.litElementVersions??=[]).push("4.0.4"); +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const pt=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */,gt={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:E}; +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function ft(t){return(e,i)=>"object"==typeof i?function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gt,e=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;const{kind:r,metadata:o}=i;let s=globalThis.litPropertyMetadata.get(o);if(void 0===s&&globalThis.litPropertyMetadata.set(o,s=new Map),s.set(i.name,t),"accessor"===r){const{name:r}=i;return{set(i){const o=e.get.call(this);e.set.call(this,i),this.requestUpdate(r,o,t)},init(e){return void 0!==e&&this.P(r,void 0,t),e}}}if("setter"===r){const{name:r}=i;return function(i){const o=this[r];e.call(this,i),this.requestUpdate(r,o,t)}}throw Error("Unsupported decorator location: "+r)}(t,e,i):((t,e,i)=>{const r=e.hasOwnProperty(i);return e.constructor.createProperty(i,r?{...t,wrapped:!0}:t),r?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function ut(t){return ft({...t,state:!0,attribute:!1})} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const mt=(t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i) +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */;function vt(t,e){return(e,i,r)=>mt(e,i,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */let wt; +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +function yt(t){return(e,i)=>{const{slot:r,selector:o}=t??{},s="slot"+(r?`[name=${r}]`:":not([name])");return mt(e,i,{get(){const e=this.renderRoot?.querySelector(s),i=e?.assignedElements(t)??[];return void 0===o?i:i.filter((t=>t.matches(o)))}})}} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +const bt=d`:host{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end);box-sizing:border-box;cursor:pointer;display:inline-flex;gap:8px;min-height:var(--_container-height);outline:none;padding-block:calc((var(--_container-height) - max(var(--_label-text-line-height),var(--_icon-size)))/2);padding-inline-start:var(--_leading-space);padding-inline-end:var(--_trailing-space);place-content:center;place-items:center;position:relative;font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);text-overflow:ellipsis;text-wrap:nowrap;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);vertical-align:top;--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}md-focus-ring{--md-focus-ring-shape-start-start: var(--_container-shape-start-start);--md-focus-ring-shape-start-end: var(--_container-shape-start-end);--md-focus-ring-shape-end-end: var(--_container-shape-end-end);--md-focus-ring-shape-end-start: var(--_container-shape-end-start)}:host([disabled]){cursor:default;pointer-events:none}.button{border-radius:inherit;cursor:inherit;display:inline-flex;align-items:center;justify-content:center;border:none;outline:none;-webkit-appearance:none;vertical-align:middle;background:rgba(0,0,0,0);text-decoration:none;min-width:calc(64px - var(--_leading-space) - var(--_trailing-space));width:100%;z-index:0;height:100%;font:inherit;color:var(--_label-text-color);padding:0;gap:inherit}.button::-moz-focus-inner{padding:0;border:0}:host(:hover) .button{color:var(--_hover-label-text-color)}:host(:focus-within) .button{color:var(--_focus-label-text-color)}:host(:active) .button{color:var(--_pressed-label-text-color)}.background{background-color:var(--_container-color);border-radius:inherit;inset:0;position:absolute}.label{overflow:hidden}:is(.button,.label,.label slot),.label ::slotted(*){text-overflow:inherit}:host([disabled]) .label{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}:host([disabled]) .background{background-color:var(--_disabled-container-color);opacity:var(--_disabled-container-opacity)}@media(forced-colors: active){.background{border:1px solid CanvasText}:host([disabled]){--_disabled-icon-color: GrayText;--_disabled-icon-opacity: 1;--_disabled-container-opacity: 1;--_disabled-label-text-color: GrayText;--_disabled-label-text-opacity: 1}}:host([has-icon]:not([trailing-icon])){padding-inline-start:var(--_with-leading-icon-leading-space);padding-inline-end:var(--_with-leading-icon-trailing-space)}:host([has-icon][trailing-icon]){padding-inline-start:var(--_with-trailing-icon-leading-space);padding-inline-end:var(--_with-trailing-icon-trailing-space)}::slotted([slot=icon]){display:inline-flex;position:relative;writing-mode:horizontal-tb;fill:currentColor;flex-shrink:0;color:var(--_icon-color);font-size:var(--_icon-size);inline-size:var(--_icon-size);block-size:var(--_icon-size)}:host(:hover) ::slotted([slot=icon]){color:var(--_hover-icon-color)}:host(:focus-within) ::slotted([slot=icon]){color:var(--_focus-icon-color)}:host(:active) ::slotted([slot=icon]){color:var(--_pressed-icon-color)}:host([disabled]) ::slotted([slot=icon]){color:var(--_disabled-icon-color);opacity:var(--_disabled-icon-opacity)}.touch{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%)}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--_container-height))/2) 0}:host([touch-target=none]) .touch{display:none}/*# sourceMappingURL=shared-styles.css.map */ +` +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */,_t=Symbol("attachableController");let Et;Et=new MutationObserver((t=>{for(const e of t)e.target[_t]?.hostConnected()}));class xt{get htmlFor(){return this.host.getAttribute("for")}set htmlFor(t){null===t?this.host.removeAttribute("for"):this.host.setAttribute("for",t)}get control(){return this.host.hasAttribute("for")?this.htmlFor&&this.host.isConnected?this.host.getRootNode().querySelector(`#${this.htmlFor}`):null:this.currentControl||this.host.parentElement}set control(t){t?this.attach(t):this.detach()}constructor(t,e){this.host=t,this.onControlChange=e,this.currentControl=null,t.addController(this),t[_t]=this,Et?.observe(t,{attributeFilter:["for"]})}attach(t){t!==this.currentControl&&(this.setCurrentControl(t),this.host.removeAttribute("for"))}detach(){this.setCurrentControl(null),this.host.setAttribute("for","")}hostConnected(){this.setCurrentControl(this.control)}hostDisconnected(){this.setCurrentControl(null)}setCurrentControl(t){this.onControlChange(this.currentControl,t),this.currentControl=t}} +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */const Ct=["focusin","focusout","pointerdown"];class It extends ht{constructor(){super(...arguments),this.visible=!1,this.inward=!1,this.attachableController=new xt(this,this.onControlChange.bind(this))}get htmlFor(){return this.attachableController.htmlFor}set htmlFor(t){this.attachableController.htmlFor=t}get control(){return this.attachableController.control}set control(t){this.attachableController.control=t}attach(t){this.attachableController.attach(t)}detach(){this.attachableController.detach()}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}handleEvent(t){if(!t[Bt]){switch(t.type){default:return;case"focusin":this.visible=this.control?.matches(":focus-visible")??!1;break;case"focusout":case"pointerdown":this.visible=!1}t[Bt]=!0}}onControlChange(t,e){for(const i of Ct)t?.removeEventListener(i,this),e?.addEventListener(i,this)}update(t){t.has("visible")&&this.dispatchEvent(new Event("visibility-changed")),super.update(t)}}r([ft({type:Boolean,reflect:!0})],It.prototype,"visible",void 0),r([ft({type:Boolean,reflect:!0})],It.prototype,"inward",void 0);const Bt=Symbol("handledByFocusRing"),St=d`:host{animation-delay:0s,calc(var(--md-focus-ring-duration, 600ms)*.25);animation-duration:calc(var(--md-focus-ring-duration, 600ms)*.25),calc(var(--md-focus-ring-duration, 600ms)*.75);animation-timing-function:cubic-bezier(0.2, 0, 0, 1);box-sizing:border-box;color:var(--md-focus-ring-color, var(--md-sys-color-secondary, #625b71));display:none;pointer-events:none;position:absolute}:host([visible]){display:flex}:host(:not([inward])){animation-name:outward-grow,outward-shrink;border-end-end-radius:calc(var(--md-focus-ring-shape-end-end, var(--md-focus-ring-shape, 9999px)) + var(--md-focus-ring-outward-offset, 2px));border-end-start-radius:calc(var(--md-focus-ring-shape-end-start, var(--md-focus-ring-shape, 9999px)) + var(--md-focus-ring-outward-offset, 2px));border-start-end-radius:calc(var(--md-focus-ring-shape-start-end, var(--md-focus-ring-shape, 9999px)) + var(--md-focus-ring-outward-offset, 2px));border-start-start-radius:calc(var(--md-focus-ring-shape-start-start, var(--md-focus-ring-shape, 9999px)) + var(--md-focus-ring-outward-offset, 2px));inset:calc(-1*var(--md-focus-ring-outward-offset, 2px));outline:var(--md-focus-ring-width, 3px) solid currentColor}:host([inward]){animation-name:inward-grow,inward-shrink;border-end-end-radius:calc(var(--md-focus-ring-shape-end-end, var(--md-focus-ring-shape, 9999px)) - var(--md-focus-ring-inward-offset, 0px));border-end-start-radius:calc(var(--md-focus-ring-shape-end-start, var(--md-focus-ring-shape, 9999px)) - var(--md-focus-ring-inward-offset, 0px));border-start-end-radius:calc(var(--md-focus-ring-shape-start-end, var(--md-focus-ring-shape, 9999px)) - var(--md-focus-ring-inward-offset, 0px));border-start-start-radius:calc(var(--md-focus-ring-shape-start-start, var(--md-focus-ring-shape, 9999px)) - var(--md-focus-ring-inward-offset, 0px));border:var(--md-focus-ring-width, 3px) solid currentColor;inset:var(--md-focus-ring-inward-offset, 0px)}@keyframes outward-grow{from{outline-width:0}to{outline-width:var(--md-focus-ring-active-width, 8px)}}@keyframes outward-shrink{from{outline-width:var(--md-focus-ring-active-width, 8px)}}@keyframes inward-grow{from{border-width:0}to{border-width:var(--md-focus-ring-active-width, 8px)}}@keyframes inward-shrink{from{border-width:var(--md-focus-ring-active-width, 8px)}}@media(prefers-reduced-motion){:host{animation:none}}/*# sourceMappingURL=focus-ring-styles.css.map */ +` +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */; +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */let Rt=class extends It{};Rt.styles=[St],Rt=r([pt("md-focus-ring")],Rt); +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const kt=1,Dt=3,Mt=4,Tt=t=>function(){for(var e=arguments.length,i=new Array(e),r=0;r2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,e){let[i]=e;if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=t.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const e=!!i[t];e===this.st.has(t)||this.nt?.has(t)||(e?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)))}return j}}),Ot="cubic-bezier(0.2, 0, 0, 1)",Pt="cubic-bezier(.3,0,0,1)",Ht="cubic-bezier(.3,0,.8,.15)"; +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */var Lt;!function(t){t[t.INACTIVE=0]="INACTIVE",t[t.TOUCH_DELAY=1]="TOUCH_DELAY",t[t.HOLDING=2]="HOLDING",t[t.WAITING_FOR_CLICK=3]="WAITING_FOR_CLICK"}(Lt||(Lt={}));const Ut=["click","contextmenu","pointercancel","pointerdown","pointerenter","pointerleave","pointerup"],Gt=window.matchMedia("(forced-colors: active)");class zt extends ht{constructor(){super(...arguments),this.disabled=!1,this.hovered=!1,this.pressed=!1,this.rippleSize="",this.rippleScale="",this.initialSize=0,this.state=Lt.INACTIVE,this.checkBoundsAfterContextMenu=!1,this.attachableController=new xt(this,this.onControlChange.bind(this))}get htmlFor(){return this.attachableController.htmlFor}set htmlFor(t){this.attachableController.htmlFor=t}get control(){return this.attachableController.control}set control(t){this.attachableController.control=t}attach(t){this.attachableController.attach(t)}detach(){this.attachableController.detach()}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){const t={hovered:this.hovered,pressed:this.pressed};return J`
`}update(t){t.has("disabled")&&this.disabled&&(this.hovered=!1,this.pressed=!1),super.update(t)}handlePointerenter(t){this.shouldReactToEvent(t)&&(this.hovered=!0)}handlePointerleave(t){this.shouldReactToEvent(t)&&(this.hovered=!1,this.state!==Lt.INACTIVE&&this.endPressAnimation())}handlePointerup(t){if(this.shouldReactToEvent(t)){if(this.state!==Lt.HOLDING)return this.state===Lt.TOUCH_DELAY?(this.state=Lt.WAITING_FOR_CLICK,void this.startPressAnimation(this.rippleStartEvent)):void 0;this.state=Lt.WAITING_FOR_CLICK}}async handlePointerdown(t){if(this.shouldReactToEvent(t)){if(this.rippleStartEvent=t,!this.isTouch(t))return this.state=Lt.WAITING_FOR_CLICK,void this.startPressAnimation(t);this.checkBoundsAfterContextMenu&&!this.inBounds(t)||(this.checkBoundsAfterContextMenu=!1,this.state=Lt.TOUCH_DELAY,await new Promise((t=>{setTimeout(t,150)})),this.state===Lt.TOUCH_DELAY&&(this.state=Lt.HOLDING,this.startPressAnimation(t)))}}handleClick(){this.disabled||(this.state!==Lt.WAITING_FOR_CLICK?this.state===Lt.INACTIVE&&(this.startPressAnimation(),this.endPressAnimation()):this.endPressAnimation())}handlePointercancel(t){this.shouldReactToEvent(t)&&this.endPressAnimation()}handleContextmenu(){this.disabled||(this.checkBoundsAfterContextMenu=!0,this.endPressAnimation())}determineRippleSize(){const{height:t,width:e}=this.getBoundingClientRect(),i=Math.max(t,e),r=Math.max(.35*i,75),o=Math.floor(.2*i),s=Math.sqrt(e**2+t**2)+10;this.initialSize=o,this.rippleScale=""+(s+r)/o,this.rippleSize=`${o}px`}getNormalizedPointerEventCoords(t){const{scrollX:e,scrollY:i}=window,{left:r,top:o}=this.getBoundingClientRect(),s=e+r,n=i+o,{pageX:a,pageY:l}=t;return{x:a-s,y:l-n}}getTranslationCoordinates(t){const{height:e,width:i}=this.getBoundingClientRect(),r={x:(i-this.initialSize)/2,y:(e-this.initialSize)/2};let o;return o=t instanceof PointerEvent?this.getNormalizedPointerEventCoords(t):{x:i/2,y:e/2},o={x:o.x-this.initialSize/2,y:o.y-this.initialSize/2},{startPoint:o,endPoint:r}}startPressAnimation(t){if(!this.mdRoot)return;this.pressed=!0,this.growAnimation?.cancel(),this.determineRippleSize();const{startPoint:e,endPoint:i}=this.getTranslationCoordinates(t),r=`${e.x}px, ${e.y}px`,o=`${i.x}px, ${i.y}px`;this.growAnimation=this.mdRoot.animate({top:[0,0],left:[0,0],height:[this.rippleSize,this.rippleSize],width:[this.rippleSize,this.rippleSize],transform:[`translate(${r}) scale(1)`,`translate(${o}) scale(${this.rippleScale})`]},{pseudoElement:"::after",duration:450,easing:Ot,fill:"forwards"})}async endPressAnimation(){this.rippleStartEvent=void 0,this.state=Lt.INACTIVE;const t=this.growAnimation;let e=1/0;"number"==typeof t?.currentTime?e=t.currentTime:t?.currentTime&&(e=t.currentTime.to("ms").value),e>=225?this.pressed=!1:(await new Promise((t=>{setTimeout(t,225-e)})),this.growAnimation===t&&(this.pressed=!1))}shouldReactToEvent(t){if(this.disabled||!t.isPrimary)return!1;if(this.rippleStartEvent&&this.rippleStartEvent.pointerId!==t.pointerId)return!1;if("pointerenter"===t.type||"pointerleave"===t.type)return!this.isTouch(t);const e=1===t.buttons;return this.isTouch(t)||e}inBounds(t){let{x:e,y:i}=t;const{top:r,left:o,bottom:s,right:n}=this.getBoundingClientRect();return e>=o&&e<=n&&i>=r&&i<=s}isTouch(t){let{pointerType:e}=t;return"touch"===e}async handleEvent(t){if(!Gt?.matches)switch(t.type){case"click":this.handleClick();break;case"contextmenu":this.handleContextmenu();break;case"pointercancel":this.handlePointercancel(t);break;case"pointerdown":await this.handlePointerdown(t);break;case"pointerenter":this.handlePointerenter(t);break;case"pointerleave":this.handlePointerleave(t);break;case"pointerup":this.handlePointerup(t)}}onControlChange(t,e){for(const i of Ut)t?.removeEventListener(i,this),e?.addEventListener(i,this)}}r([ft({type:Boolean,reflect:!0})],zt.prototype,"disabled",void 0),r([ut()],zt.prototype,"hovered",void 0),r([ut()],zt.prototype,"pressed",void 0),r([vt(".surface")],zt.prototype,"mdRoot",void 0); +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +const Kt=d`:host{display:flex;margin:auto;pointer-events:none}:host([disabled]){display:none}@media(forced-colors: active){:host{display:none}}:host,.surface{border-radius:inherit;position:absolute;inset:0;overflow:hidden}.surface{-webkit-tap-highlight-color:rgba(0,0,0,0)}.surface::before,.surface::after{content:"";opacity:0;position:absolute}.surface::before{background-color:var(--md-ripple-hover-color, var(--md-sys-color-on-surface, #1d1b20));inset:0;transition:opacity 15ms linear,background-color 15ms linear}.surface::after{background:radial-gradient(closest-side, var(--md-ripple-pressed-color, var(--md-sys-color-on-surface, #1d1b20)) max(100% - 70px, 65%), transparent 100%);transform-origin:center center;transition:opacity 375ms linear}.hovered::before{background-color:var(--md-ripple-hover-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-ripple-hover-opacity, 0.08)}.pressed::after{opacity:var(--md-ripple-pressed-opacity, 0.12);transition-duration:105ms}/*# sourceMappingURL=ripple-styles.css.map */ +` +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */;let Yt=class extends zt{};Yt.styles=[Kt],Yt=r([pt("md-ripple")],Yt); +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +const Nt=["ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColSpan","ariaCurrent","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaInvalid","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText"];function Jt(t){return t.replace("aria","aria-").replace(/Elements?/g,"").toLowerCase()} +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */function $t(t){for(const e of Nt)t.createProperty(e,{attribute:Jt(e),reflect:!0});t.addInitializer((t=>{const e={hostConnected(){t.setAttribute("role","presentation")}};t.addController(e)}))} +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */Nt.map(Jt);const jt=Symbol("internals"),Wt=Symbol("privateInternals");function Zt(t){return class extends t{get[jt](){return this[Wt]||(this[Wt]=this.attachInternals()),this[Wt]}}} +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */function qt(t){t.addInitializer((t=>{const e=t;e.addEventListener("click",(async t=>{const{type:i,[jt]:r}=e,{form:o}=r;o&&"button"!==i&&(await new Promise((t=>{setTimeout(t)})),t.defaultPrevented||("reset"!==i?(o.addEventListener("submit",(t=>{Object.defineProperty(t,"submitter",{configurable:!0,enumerable:!0,get:()=>e})}),{capture:!0,once:!0}),r.setFormValue(e.value),o.requestSubmit()):o.reset()))}))}))} +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */function Vt(t){const e=new MouseEvent("click",{bubbles:!0});return t.dispatchEvent(e),e}function Xt(t){return t.currentTarget===t.target&&(t.composedPath()[0]===t.target&&(!t.target.disabled&&!function(t){const e=te;e&&(t.preventDefault(),t.stopImmediatePropagation());return async function(){te=!0,await null,te=!1} +/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */(),e}(t)))}let te=!1;const ee=Zt(ht);class ie extends ee{get name(){return this.getAttribute("name")??""}set name(t){this.setAttribute("name",t)}get form(){return this[jt].form}constructor(){super(),this.disabled=!1,this.href="",this.target="",this.trailingIcon=!1,this.hasIcon=!1,this.type="submit",this.value="",this.handleActivationClick=t=>{Xt(t)&&this.buttonElement&&(this.focus(),Vt(this.buttonElement))},this.addEventListener("click",this.handleActivationClick)}focus(){this.buttonElement?.focus()}blur(){this.buttonElement?.blur()}render(){const t=this.disabled&&!this.href,e=this.href?this.renderLink():this.renderButton(),i=this.href?"link":"button";return J` + ${this.renderElevationOrOutline?.()} +
+ + + ${e} + `}renderButton(){const{ariaLabel:t,ariaHasPopup:e,ariaExpanded:i}=this;return J``}renderLink(){const{ariaLabel:t,ariaHasPopup:e,ariaExpanded:i}=this;return J`${this.renderContent()} + `}renderContent(){const t=J``;return J` + + ${this.trailingIcon?W:t} + + ${this.trailingIcon?t:W} + `}handleSlotChange(){this.hasIcon=this.assignedIcons.length>0}}$t(ie),qt(ie),ie.formAssociated=!0,ie.shadowRootOptions={mode:"open",delegatesFocus:!0},r([ft({type:Boolean,reflect:!0})],ie.prototype,"disabled",void 0),r([ft()],ie.prototype,"href",void 0),r([ft()],ie.prototype,"target",void 0),r([ft({type:Boolean,attribute:"trailing-icon",reflect:!0})],ie.prototype,"trailingIcon",void 0),r([ft({type:Boolean,attribute:"has-icon",reflect:!0})],ie.prototype,"hasIcon",void 0),r([ft()],ie.prototype,"type",void 0),r([ft({reflect:!0})],ie.prototype,"value",void 0),r([vt(".button")],ie.prototype,"buttonElement",void 0),r([yt({slot:"icon",flatten:!0})],ie.prototype,"assignedIcons",void 0); +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +class re extends ie{} +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */const oe=d`:host{--_container-height: var(--md-text-button-container-height, 40px);--_container-shape: var(--md-text-button-container-shape, 9999px);--_disabled-label-text-color: var(--md-text-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-text-button-disabled-label-text-opacity, 0.38);--_focus-label-text-color: var(--md-text-button-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-label-text-color: var(--md-text-button-hover-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-text-button-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-text-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-text-button-label-text-color, var(--md-sys-color-primary, #6750a4));--_label-text-font: var(--md-text-button-label-text-font, var(--md-sys-typescale-label-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-text-button-label-text-line-height, var(--md-sys-typescale-label-large-line-height, 1.25rem));--_label-text-size: var(--md-text-button-label-text-size, var(--md-sys-typescale-label-large-size, 0.875rem));--_label-text-weight: var(--md-text-button-label-text-weight, var(--md-sys-typescale-label-large-weight, var(--md-ref-typeface-weight-medium, 500)));--_pressed-label-text-color: var(--md-text-button-pressed-label-text-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-color: var(--md-text-button-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-text-button-pressed-state-layer-opacity, 0.12);--_disabled-icon-color: var(--md-text-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-text-button-disabled-icon-opacity, 0.38);--_focus-icon-color: var(--md-text-button-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_hover-icon-color: var(--md-text-button-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-color: var(--md-text-button-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-size: var(--md-text-button-icon-size, 18px);--_pressed-icon-color: var(--md-text-button-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_leading-space: var(--md-text-button-leading-space, 12px);--_trailing-space: var(--md-text-button-trailing-space, 12px);--_with-leading-icon-leading-space: var(--md-text-button-with-leading-icon-leading-space, 12px);--_with-leading-icon-trailing-space: var(--md-text-button-with-leading-icon-trailing-space, 16px);--_with-trailing-icon-leading-space: var(--md-text-button-with-trailing-icon-leading-space, 16px);--_with-trailing-icon-trailing-space: var(--md-text-button-with-trailing-icon-trailing-space, 12px);--_container-color: none;--_disabled-container-color: none;--_disabled-container-opacity: 0;--_container-shape-start-start: var( --md-text-button-container-shape-start-start, var(--_container-shape) );--_container-shape-start-end: var( --md-text-button-container-shape-start-end, var(--_container-shape) );--_container-shape-end-end: var( --md-text-button-container-shape-end-end, var(--_container-shape) );--_container-shape-end-start: var( --md-text-button-container-shape-end-start, var(--_container-shape) )}/*# sourceMappingURL=text-styles.css.map */ +`;class se extends re{} +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +function ne(t){const e=de(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:pe);return e&&(e.tabIndex=0,e.focus()),e}function ae(t){const e=ce(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:pe);return e&&(e.tabIndex=0,e.focus()),e}function le(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pe;for(let i=0;i1&&void 0!==arguments[1]?arguments[1]:pe;for(const i of t)if(e(i))return i;return null}function ce(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pe;for(let i=t.length-1;i>=0;i--){const r=t[i];if(e(r))return r}return null}function he(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:pe;if(e){const r=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:pe;for(let r=1;r2&&void 0!==arguments[2]?arguments[2]:pe;if(e){const r=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:pe;for(let r=1;r{const e=t.key;if(t.defaultPrevented||!this.isNavigableKey(e))return;const i=this.items;if(!i.length)return;const r=le(i,this.isActivatable);r&&(r.item.tabIndex=-1),t.preventDefault();const o=this.isRtl();switch(e){case ge.ArrowDown:case o?ge.ArrowLeft:ge.ArrowRight:he(i,r,this.isActivatable);break;case ge.ArrowUp:case o?ge.ArrowRight:ge.ArrowLeft:Ae(i,r,this.isActivatable);break;case ge.Home:ne(i,this.isActivatable);break;case ge.End:ae(i,this.isActivatable)}},this.onDeactivateItems=()=>{const t=this.items;for(const e of t)this.deactivateItem(e)},this.onRequestActivation=t=>{this.onDeactivateItems();const e=t.target;this.activateItem(e),e.focus()},this.onSlotchange=()=>{const t=this.items;let e=!1;for(const i of t){!(!i.disabled&&i.tabIndex>-1)||e?i.tabIndex=-1:(e=!0,i.tabIndex=0)}if(e)return;const i=de(t,this.isActivatable);i&&(i.tabIndex=0)};const{isItem:e,getPossibleItems:i,isRtl:r,deactivateItem:o,activateItem:s,isNavigableKey:n,isActivatable:a}=t;this.isItem=e,this.getPossibleItems=i,this.isRtl=r,this.deactivateItem=o,this.activateItem=s,this.isNavigableKey=n,this.isActivatable=a}get items(){const t=this.getPossibleItems(),e=[];for(const i of t){if(this.isItem(i)){e.push(i);continue}const t=i.item;t&&this.isItem(t)&&e.push(t)}return e}activateNextItem(){const t=this.items,e=le(t,this.isActivatable);return e&&(e.item.tabIndex=-1),he(t,e,this.isActivatable)}activatePreviousItem(){const t=this.items,e=le(t,this.isActivatable);return e&&(e.item.tabIndex=-1),Ae(t,e,this.isActivatable)}} +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */const ue=new Set(Object.values(ge));class me extends ht{get items(){return this.listController.items}constructor(){super(),this.listController=new fe({isItem:t=>t.hasAttribute("md-list-item"),getPossibleItems:()=>this.slotItems,isRtl:()=>"rtl"===getComputedStyle(this).direction,deactivateItem:t=>{t.tabIndex=-1},activateItem:t=>{t.tabIndex=0},isNavigableKey:t=>ue.has(t),isActivatable:t=>!t.disabled&&"text"!==t.type}),this.internals=this.attachInternals(),this.internals.role="list",this.addEventListener("keydown",this.listController.handleKeydown)}render(){return J` + + + `}activateNextItem(){return this.listController.activateNextItem()}activatePreviousItem(){return this.listController.activatePreviousItem()}}r([yt({flatten:!0})],me.prototype,"slotItems",void 0); +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +const ve=d`:host{background:var(--md-list-container-color, var(--md-sys-color-surface, #fef7ff));color:unset;display:flex;flex-direction:column;outline:none;padding:8px 0;position:relative}/*# sourceMappingURL=list-styles.css.map */ +`;class we extends me{}we.styles=[ve],customElements.define("ew-list",we); +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +class ye extends ht{constructor(){super(...arguments),this.multiline=!1}render(){return J` + + +
+ + + + +
+ + + `}handleTextSlotChange(){let t=!1,e=0;for(const i of this.textSlots)if(be(i)&&(e+=1),e>1){t=!0;break}this.multiline=t}}function be(t){for(const e of t.assignedNodes({flatten:!0})){const t=e.nodeType===Node.ELEMENT_NODE,i=e.nodeType===Node.TEXT_NODE&&e.textContent?.match(/\S/);if(t||i)return!0}return!1} +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */r([ft({type:Boolean,reflect:!0})],ye.prototype,"multiline",void 0),r([function(t){return(e,i)=>mt(e,i,{get(){return(this.renderRoot??(wt??=document.createDocumentFragment())).querySelectorAll(t)}})}(".text slot")],ye.prototype,"textSlots",void 0);const _e=d`:host{color:var(--md-sys-color-on-surface, #1d1b20);font-family:var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-body-large-size, 1rem);font-weight:var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400));line-height:var(--md-sys-typescale-body-large-line-height, 1.5rem);align-items:center;box-sizing:border-box;display:flex;gap:16px;min-height:56px;overflow:hidden;padding:12px 16px;position:relative;text-overflow:ellipsis}:host([multiline]){min-height:72px}[name=overline]{color:var(--md-sys-color-on-surface-variant, #49454f);font-family:var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-label-small-size, 0.6875rem);font-weight:var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500));line-height:var(--md-sys-typescale-label-small-line-height, 1rem)}[name=supporting-text]{color:var(--md-sys-color-on-surface-variant, #49454f);font-family:var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-body-medium-size, 0.875rem);font-weight:var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400));line-height:var(--md-sys-typescale-body-medium-line-height, 1.25rem)}[name=trailing-supporting-text]{color:var(--md-sys-color-on-surface-variant, #49454f);font-family:var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto));font-size:var(--md-sys-typescale-label-small-size, 0.6875rem);font-weight:var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500));line-height:var(--md-sys-typescale-label-small-line-height, 1rem)}[name=container]::slotted(*){inset:0;position:absolute}.default-slot{display:inline}.default-slot,.text ::slotted(*){overflow:hidden;text-overflow:ellipsis}.text{display:flex;flex:1;flex-direction:column;overflow:hidden}/*# sourceMappingURL=item-styles.css.map */ +` +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */;let Ee=class extends ye{};Ee.styles=[_e],Ee=r([pt("md-item")],Ee); +/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const xe=Symbol.for(""),Ce=t=>{if(t?.r===xe)return t?._$litStatic$},Ie=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;re+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(i)+t[r+1]),t[0]),r:xe}},Be=new Map,Se=(t=>function(e){for(var i=arguments.length,r=new Array(i>1?i-1:0),o=1;o +
+ ${this.renderRipple()} ${this.renderFocusRing()} +
+ + + ${this.renderBody()} + + `)}renderListItem(t){const e="link"===this.type;let i;switch(this.type){case"link":i=Ie`a`;break;case"button":i=Ie`button`;break;default:i=Ie`li`}const r="text"!==this.type,o=e&&this.target?this.target:W;return Se` + <${i} + id="item" + tabindex="${this.isDisabled||!r?-1:0}" + ?disabled=${this.isDisabled} + role="listitem" + aria-selected=${this.ariaSelected||W} + aria-checked=${this.ariaChecked||W} + aria-expanded=${this.ariaExpanded||W} + aria-haspopup=${this.ariaHasPopup||W} + class="list-item ${Ft(this.getRenderClasses())}" + href=${this.href||W} + target=${o} + @focus=${this.onFocus} + >${t} + `}renderRipple(){return"text"===this.type?W:J` `}renderFocusRing(){return"text"===this.type?W:J` `}onFocusRingVisibilityChanged(t){}getRenderClasses(){return{disabled:this.isDisabled}}renderBody(){return J` + + + + + + `}onFocus(){-1===this.tabIndex&&this.dispatchEvent(new Event("request-activation",{bubbles:!0,composed:!0}))}focus(){this.listItemRoot?.focus()}}$t(Re),Re.shadowRootOptions={...ht.shadowRootOptions,delegatesFocus:!0},r([ft({type:Boolean,reflect:!0})],Re.prototype,"disabled",void 0),r([ft({reflect:!0})],Re.prototype,"type",void 0),r([ft({type:Boolean,attribute:"md-list-item",reflect:!0})],Re.prototype,"isListItem",void 0),r([ft()],Re.prototype,"href",void 0),r([ft()],Re.prototype,"target",void 0),r([vt(".list-item")],Re.prototype,"listItemRoot",void 0); +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +const ke=d`:host{display:flex;-webkit-tap-highlight-color:rgba(0,0,0,0);--md-ripple-hover-color: var(--md-list-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-list-item-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-list-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity: var(--md-list-item-pressed-state-layer-opacity, 0.12)}:host(:is([type=button]:not([disabled]),[type=link])){cursor:pointer}md-focus-ring{z-index:1;--md-focus-ring-shape: 8px}a,button,li{background:none;border:none;cursor:inherit;padding:0;margin:0;text-align:unset;text-decoration:none}.list-item{border-radius:inherit;display:flex;flex:1;max-width:inherit;min-width:inherit;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0);width:100%}.list-item.interactive{cursor:pointer}.list-item.disabled{opacity:var(--md-list-item-disabled-opacity, 0.3);pointer-events:none}[slot=container]{pointer-events:none}md-ripple{border-radius:inherit}md-item{border-radius:inherit;flex:1;height:100%;color:var(--md-list-item-label-text-color, var(--md-sys-color-on-surface, #1d1b20));font-family:var(--md-list-item-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));line-height:var(--md-list-item-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));font-weight:var(--md-list-item-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));min-height:var(--md-list-item-one-line-container-height, 56px);padding-top:var(--md-list-item-top-space, 12px);padding-bottom:var(--md-list-item-bottom-space, 12px);padding-inline-start:var(--md-list-item-leading-space, 16px);padding-inline-end:var(--md-list-item-trailing-space, 16px)}md-item[multiline]{min-height:var(--md-list-item-two-line-container-height, 72px)}[slot=supporting-text]{color:var(--md-list-item-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-list-item-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-list-item-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-list-item-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)))}[slot=trailing-supporting-text]{color:var(--md-list-item-trailing-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-list-item-trailing-supporting-text-font, var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-list-item-trailing-supporting-text-size, var(--md-sys-typescale-label-small-size, 0.6875rem));line-height:var(--md-list-item-trailing-supporting-text-line-height, var(--md-sys-typescale-label-small-line-height, 1rem));font-weight:var(--md-list-item-trailing-supporting-text-weight, var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500)))}:is([slot=start],[slot=end])::slotted(*){fill:currentColor}[slot=start]{color:var(--md-list-item-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}[slot=end]{color:var(--md-list-item-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}@media(forced-colors: active){.disabled slot{color:GrayText}.list-item.disabled{color:GrayText;opacity:1}}/*# sourceMappingURL=list-item-styles.css.map */ +`;class De extends Re{}De.styles=[ke],customElements.define("ew-list-item",De); +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +class Me extends ht{constructor(){super(...arguments),this.inset=!1,this.insetStart=!1,this.insetEnd=!1}}r([ft({type:Boolean,reflect:!0})],Me.prototype,"inset",void 0),r([ft({type:Boolean,reflect:!0,attribute:"inset-start"})],Me.prototype,"insetStart",void 0),r([ft({type:Boolean,reflect:!0,attribute:"inset-end"})],Me.prototype,"insetEnd",void 0); +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +const Te=d`:host{box-sizing:border-box;color:var(--md-divider-color, var(--md-sys-color-outline-variant, #cac4d0));display:flex;height:var(--md-divider-thickness, 1px);width:100%}:host([inset]),:host([inset-start]){padding-inline-start:16px}:host([inset]),:host([inset-end]){padding-inline-end:16px}:host::before{background:currentColor;content:"";height:100%;width:100%}@media(forced-colors: active){:host::before{background:CanvasText}}/*# sourceMappingURL=divider-styles.css.map */ +`;class Qe extends Me{} +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +function Fe(t,e){!e.bubbles||t.shadowRoot&&!e.composed||e.stopPropagation();const i=Reflect.construct(e.constructor,[e.type,e]),r=t.dispatchEvent(i);return r||e.preventDefault(),r} +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */Qe.styles=[Te],customElements.define("ew-divider",Qe);const Oe=Symbol("createValidator"),Pe=Symbol("getValidityAnchor"),He=Symbol("privateValidator"),Le=Symbol("privateSyncValidity"),Ue=Symbol("privateCustomValidationMessage");function Ge(t){var e;class i extends t{constructor(){super(...arguments),this[e]=""}get validity(){return this[Le](),this[jt].validity}get validationMessage(){return this[Le](),this[jt].validationMessage}get willValidate(){return this[Le](),this[jt].willValidate}checkValidity(){return this[Le](),this[jt].checkValidity()}reportValidity(){return this[Le](),this[jt].reportValidity()}setCustomValidity(t){this[Ue]=t,this[Le]()}requestUpdate(t,e,i){super.requestUpdate(t,e,i),this[Le]()}firstUpdated(t){super.firstUpdated(t),this[Le]()}[(e=Ue,Le)](){this[He]||(this[He]=this[Oe]());const{validity:t,validationMessage:e}=this[He].getValidity(),i=!!this[Ue],r=this[Ue]||e;this[jt].setValidity({...t,customError:i},r,this[Pe]()??void 0)}[Oe](){throw new Error("Implement [createValidator]")}[Pe](){throw new Error("Implement [getValidityAnchor]")}}return i} +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */const ze=Symbol("getFormValue"),Ke=Symbol("getFormState");function Ye(t){class e extends t{get form(){return this[jt].form}get labels(){return this[jt].labels}get name(){return this.getAttribute("name")??""}set name(t){this.setAttribute("name",t)}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",t)}attributeChangedCallback(t,e,i){if("name"!==t&&"disabled"!==t)super.attributeChangedCallback(t,e,i);else{const i="disabled"===t?null!==e:e;this.requestUpdate(t,i)}}requestUpdate(t,e,i){super.requestUpdate(t,e,i),this[jt].setFormValue(this[ze](),this[Ke]())}[ze](){throw new Error("Implement [getFormValue]")}[Ke](){return this[ze]()}formDisabledCallback(t){this.disabled=t}}return e.formAssociated=!0,r([ft({noAccessor:!0})],e.prototype,"name",null),r([ft({type:Boolean,noAccessor:!0})],e.prototype,"disabled",null),e} +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */class Ne{constructor(t){this.getCurrentState=t,this.currentValidity={validity:{},validationMessage:""}}getValidity(){const t=this.getCurrentState();if(!(!this.prevState||!this.equals(this.prevState,t)))return this.currentValidity;const{validity:e,validationMessage:i}=this.computeValidity(t);return this.prevState=this.copy(t),this.currentValidity={validationMessage:i,validity:{badInput:e.badInput,customError:e.customError,patternMismatch:e.patternMismatch,rangeOverflow:e.rangeOverflow,rangeUnderflow:e.rangeUnderflow,stepMismatch:e.stepMismatch,tooLong:e.tooLong,tooShort:e.tooShort,typeMismatch:e.typeMismatch,valueMissing:e.valueMissing}},this.currentValidity}} +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */class Je extends Ne{computeValidity(t){return this.checkboxControl||(this.checkboxControl=document.createElement("input"),this.checkboxControl.type="checkbox"),this.checkboxControl.checked=t.checked,this.checkboxControl.required=t.required,{validity:this.checkboxControl.validity,validationMessage:this.checkboxControl.validationMessage}}equals(t,e){return t.checked===e.checked&&t.required===e.required}copy(t){let{checked:e,required:i}=t;return{checked:e,required:i}}} +/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */const $e=Ge(Ye(Zt(ht)));class je extends $e{constructor(){super(),this.checked=!1,this.indeterminate=!1,this.required=!1,this.value="on",this.prevChecked=!1,this.prevDisabled=!1,this.prevIndeterminate=!1,this.addEventListener("click",(t=>{Xt(t)&&this.input&&(this.focus(),Vt(this.input))}))}update(t){(t.has("checked")||t.has("disabled")||t.has("indeterminate"))&&(this.prevChecked=t.get("checked")??this.checked,this.prevDisabled=t.get("disabled")??this.disabled,this.prevIndeterminate=t.get("indeterminate")??this.indeterminate),super.update(t)}render(){const t=!this.prevChecked&&!this.prevIndeterminate,e=this.prevChecked&&!this.prevIndeterminate,i=this.prevIndeterminate,r=this.checked&&!this.indeterminate,o=this.indeterminate,s=Ft({disabled:this.disabled,selected:r||o,unselected:!r&&!o,checked:r,indeterminate:o,"prev-unselected":t,"prev-checked":e,"prev-indeterminate":i,"prev-disabled":this.prevDisabled}),{ariaLabel:n,ariaInvalid:a}=this;return J` +
+ + +
+
+ + + +
+ `}handleInput(t){const e=t.target;this.checked=e.checked,this.indeterminate=e.indeterminate}handleChange(t){Fe(this,t)}[ze](){return!this.checked||this.indeterminate?null:this.value}[Ke](){return String(this.checked)}formResetCallback(){this.checked=this.hasAttribute("checked")}formStateRestoreCallback(t){this.checked="true"===t}[Oe](){return new Je((()=>this))}[Pe](){return this.input}}$t(je),je.shadowRootOptions={...ht.shadowRootOptions,delegatesFocus:!0},r([ft({type:Boolean})],je.prototype,"checked",void 0),r([ft({type:Boolean})],je.prototype,"indeterminate",void 0),r([ft({type:Boolean})],je.prototype,"required",void 0),r([ft()],je.prototype,"value",void 0),r([ut()],je.prototype,"prevChecked",void 0),r([ut()],je.prototype,"prevDisabled",void 0),r([ut()],je.prototype,"prevIndeterminate",void 0),r([vt("input")],je.prototype,"input",void 0); +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +const We=d`:host{border-start-start-radius:var(--md-checkbox-container-shape-start-start, var(--md-checkbox-container-shape, 2px));border-start-end-radius:var(--md-checkbox-container-shape-start-end, var(--md-checkbox-container-shape, 2px));border-end-end-radius:var(--md-checkbox-container-shape-end-end, var(--md-checkbox-container-shape, 2px));border-end-start-radius:var(--md-checkbox-container-shape-end-start, var(--md-checkbox-container-shape, 2px));display:inline-flex;height:var(--md-checkbox-container-size, 18px);position:relative;vertical-align:top;width:var(--md-checkbox-container-size, 18px);-webkit-tap-highlight-color:rgba(0,0,0,0);cursor:pointer}:host([disabled]){cursor:default}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--md-checkbox-container-size, 18px))/2)}md-focus-ring{height:44px;inset:unset;width:44px}input{appearance:none;height:48px;margin:0;opacity:0;outline:none;position:absolute;width:48px;z-index:1;cursor:inherit}:host([touch-target=none]) input{height:100%;width:100%}.container{border-radius:inherit;display:flex;height:100%;place-content:center;place-items:center;position:relative;width:100%}.outline,.background,.icon{inset:0;position:absolute}.outline,.background{border-radius:inherit}.outline{border-color:var(--md-checkbox-outline-color, var(--md-sys-color-on-surface-variant, #49454f));border-style:solid;border-width:var(--md-checkbox-outline-width, 2px);box-sizing:border-box}.background{background-color:var(--md-checkbox-selected-container-color, var(--md-sys-color-primary, #6750a4))}.background,.icon{opacity:0;transition-duration:150ms,50ms;transition-property:transform,opacity;transition-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15),linear;transform:scale(0.6)}:where(.selected) :is(.background,.icon){opacity:1;transition-duration:350ms,50ms;transition-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1),linear;transform:scale(1)}md-ripple{border-radius:var(--md-checkbox-state-layer-shape, 9999px);height:var(--md-checkbox-state-layer-size, 40px);inset:unset;width:var(--md-checkbox-state-layer-size, 40px);--md-ripple-hover-color: var(--md-checkbox-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-checkbox-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-checkbox-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-pressed-opacity: var(--md-checkbox-pressed-state-layer-opacity, 0.12)}.selected md-ripple{--md-ripple-hover-color: var(--md-checkbox-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-hover-opacity: var(--md-checkbox-selected-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-checkbox-selected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity: var(--md-checkbox-selected-pressed-state-layer-opacity, 0.12)}.icon{fill:var(--md-checkbox-selected-icon-color, var(--md-sys-color-on-primary, #fff));height:var(--md-checkbox-icon-size, 18px);width:var(--md-checkbox-icon-size, 18px)}.mark.short{height:2px;transition-property:transform,height;width:2px}.mark.long{height:2px;transition-property:transform,width;width:10px}.mark{animation-duration:150ms;animation-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15);transition-duration:150ms;transition-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15)}.selected .mark{animation-duration:350ms;animation-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1);transition-duration:350ms;transition-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1)}.checked .mark,.prev-checked.unselected .mark{transform:scaleY(-1) translate(7px, -14px) rotate(45deg)}.checked .mark.short,.prev-checked.unselected .mark.short{height:5.6568542495px}.checked .mark.long,.prev-checked.unselected .mark.long{width:11.313708499px}.indeterminate .mark,.prev-indeterminate.unselected .mark{transform:scaleY(-1) translate(4px, -10px) rotate(0deg)}.prev-unselected .mark{transition-property:none}.prev-unselected.checked .mark.long{animation-name:prev-unselected-to-checked}@keyframes prev-unselected-to-checked{from{width:0}}:where(:hover) .outline{border-color:var(--md-checkbox-hover-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-hover-outline-width, 2px)}:where(:hover) .background{background:var(--md-checkbox-selected-hover-container-color, var(--md-sys-color-primary, #6750a4))}:where(:hover) .icon{fill:var(--md-checkbox-selected-hover-icon-color, var(--md-sys-color-on-primary, #fff))}:where(:focus-within) .outline{border-color:var(--md-checkbox-focus-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-focus-outline-width, 2px)}:where(:focus-within) .background{background:var(--md-checkbox-selected-focus-container-color, var(--md-sys-color-primary, #6750a4))}:where(:focus-within) .icon{fill:var(--md-checkbox-selected-focus-icon-color, var(--md-sys-color-on-primary, #fff))}:where(:active) .outline{border-color:var(--md-checkbox-pressed-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-pressed-outline-width, 2px)}:where(:active) .background{background:var(--md-checkbox-selected-pressed-container-color, var(--md-sys-color-primary, #6750a4))}:where(:active) .icon{fill:var(--md-checkbox-selected-pressed-icon-color, var(--md-sys-color-on-primary, #fff))}:where(.disabled,.prev-disabled) :is(.background,.icon,.mark){animation-duration:0s;transition-duration:0s}:where(.disabled) .outline{border-color:var(--md-checkbox-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));border-width:var(--md-checkbox-disabled-outline-width, 2px);opacity:var(--md-checkbox-disabled-container-opacity, 0.38)}:where(.selected.disabled) .outline{visibility:hidden}:where(.selected.disabled) .background{background:var(--md-checkbox-selected-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-checkbox-selected-disabled-container-opacity, 0.38)}:where(.disabled) .icon{fill:var(--md-checkbox-selected-disabled-icon-color, var(--md-sys-color-surface, #fef7ff))}@media(forced-colors: active){.background{background-color:CanvasText}.selected.disabled .background{background-color:GrayText;opacity:1}.outline{border-color:CanvasText}.disabled .outline{border-color:GrayText;opacity:1}.icon{fill:Canvas}}/*# sourceMappingURL=checkbox-styles.css.map */ +`;class Ze extends je{}Ze.styles=[We],customElements.define("ew-checkbox",Ze);class qe{constructor(t){this.targetElement=t,this.state={bold:!1,italic:!1,underline:!1,strikethrough:!1,foregroundColor:null,backgroundColor:null,carriageReturn:!1,secret:!1}}logs(){return this.targetElement.innerText}addLine(t){const e=/(?:\033|\\033)(?:\[(.*?)[@-~]|\].*?(?:\007|\033\\))/g;let i=0;this.state.carriageReturn&&("\n"!==t&&this.targetElement.removeChild(this.targetElement.lastChild),this.state.carriageReturn=!1),t.includes("\r")&&(this.state.carriageReturn=!0);const r=document.createElement("span");r.classList.add("line"),this.targetElement.appendChild(r);const o=t=>{if(""===t)return;const e=document.createElement("span");if(this.state.bold&&e.classList.add("log-bold"),this.state.italic&&e.classList.add("log-italic"),this.state.underline&&e.classList.add("log-underline"),this.state.strikethrough&&e.classList.add("log-strikethrough"),this.state.secret&&e.classList.add("log-secret"),null!==this.state.foregroundColor&&e.classList.add(`log-fg-${this.state.foregroundColor}`),null!==this.state.backgroundColor&&e.classList.add(`log-bg-${this.state.backgroundColor}`),e.appendChild(document.createTextNode(t)),r.appendChild(e),this.state.secret){const t=document.createElement("span");t.classList.add("log-secret-redacted"),t.appendChild(document.createTextNode("[redacted]")),r.appendChild(t)}};for(;;){const r=e.exec(t);if(null===r)break;const s=r.index;if(o(t.substring(i,s)),i=s+r[0].length,void 0!==r[1])for(const t of r[1].split(";"))switch(parseInt(t)){case 0:this.state.bold=!1,this.state.italic=!1,this.state.underline=!1,this.state.strikethrough=!1,this.state.foregroundColor=null,this.state.backgroundColor=null,this.state.secret=!1;break;case 1:this.state.bold=!0;break;case 3:this.state.italic=!0;break;case 4:this.state.underline=!0;break;case 5:this.state.secret=!0;break;case 6:this.state.secret=!1;break;case 9:this.state.strikethrough=!0;break;case 22:this.state.bold=!1;break;case 23:this.state.italic=!1;break;case 24:this.state.underline=!1;break;case 29:this.state.strikethrough=!1;break;case 30:this.state.foregroundColor="black";break;case 31:this.state.foregroundColor="red";break;case 32:this.state.foregroundColor="green";break;case 33:this.state.foregroundColor="yellow";break;case 34:this.state.foregroundColor="blue";break;case 35:this.state.foregroundColor="magenta";break;case 36:this.state.foregroundColor="cyan";break;case 37:this.state.foregroundColor="white";break;case 39:this.state.foregroundColor=null;break;case 41:this.state.backgroundColor="red";break;case 42:this.state.backgroundColor="green";break;case 43:this.state.backgroundColor="yellow";break;case 44:this.state.backgroundColor="blue";break;case 45:this.state.backgroundColor="magenta";break;case 46:this.state.backgroundColor="cyan";break;case 47:this.state.backgroundColor="white";break;case 40:case 49:this.state.backgroundColor=null}}const s=this.targetElement.scrollTop>this.targetElement.scrollHeight-this.targetElement.offsetHeight-50;o(t.substring(i)),s&&(this.targetElement.scrollTop=this.targetElement.scrollHeight)}}const Ve=t=>new Promise((e=>setTimeout(e,t)));class Xe{constructor(){this.chunks=""}transform(t,e){this.chunks+=t;const i=this.chunks.split("\r\n");this.chunks=i.pop(),i.forEach((t=>e.enqueue(t+"\r\n")))}flush(t){t.enqueue(this.chunks)}}class ti{transform(t,e){const i=new Date,r=i.getHours().toString().padStart(2,"0"),o=i.getMinutes().toString().padStart(2,"0"),s=i.getSeconds().toString().padStart(2,"0");e.enqueue(`[${r}:${o}:${s}]${t}`)}}class ei extends HTMLElement{constructor(){super(...arguments),this.allowInput=!0}logs(){var t;return(null===(t=this._console)||void 0===t?void 0:t.logs())||""}connectedCallback(){if(this._console)return;if(this.attachShadow({mode:"open"}).innerHTML=`\n \n
\n ${this.allowInput?"
\n >\n \n
\n ":""}\n `,this._console=new qe(this.shadowRoot.querySelector("div")),this.allowInput){const t=this.shadowRoot.querySelector("input");this.addEventListener("click",(()=>{var e;""===(null===(e=getSelection())||void 0===e?void 0:e.toString())&&t.focus()})),t.addEventListener("keydown",(t=>{"Enter"===t.key&&(t.preventDefault(),t.stopPropagation(),this._sendCommand())}))}const t=new AbortController,e=this._connect(t.signal);this._cancelConnection=()=>(t.abort(),e)}async _connect(t){this.logger.debug("Starting console read loop");try{await this.port.readable.pipeThrough(new TextDecoderStream,{signal:t}).pipeThrough(new TransformStream(new Xe)).pipeThrough(new TransformStream(new ti)).pipeTo(new WritableStream({write:t=>{this._console.addLine(t.replace("\r",""))}})),t.aborted||(this._console.addLine(""),this._console.addLine(""),this._console.addLine("Terminal disconnected"))}catch(t){this._console.addLine(""),this._console.addLine(""),this._console.addLine(`Terminal disconnected: ${t}`)}finally{await Ve(100),this.logger.debug("Finished console read loop")}}async _sendCommand(){const t=this.shadowRoot.querySelector("input"),e=t.value,i=new TextEncoder,r=this.port.writable.getWriter();await r.write(i.encode(e+"\r\n")),this._console.addLine(`> ${e}\r\n`),t.value="",t.focus();try{r.releaseLock()}catch(t){console.error("Ignoring release lock error",t)}}async disconnect(){this._cancelConnection&&(await this._cancelConnection(),this._cancelConnection=void 0)}async reset(){this.logger.debug("Triggering reset"),await this.port.setSignals({dataTerminalReady:!1,requestToSend:!0}),await Ve(250),await this.port.setSignals({dataTerminalReady:!1,requestToSend:!1}),await Ve(250),await new Promise((t=>setTimeout(t,1e3)))}}customElements.define("ewt-console",ei); +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +let ii=class extends Me{};ii.styles=[Te],ii=r([pt("md-divider")],ii); +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +const ri={dialog:[[[{transform:"translateY(-50px)"},{transform:"translateY(0)"}],{duration:500,easing:Pt}]],scrim:[[[{opacity:0},{opacity:.32}],{duration:500,easing:"linear"}]],container:[[[{opacity:0},{opacity:1}],{duration:50,easing:"linear",pseudoElement:"::before"}],[[{height:"35%"},{height:"100%"}],{duration:500,easing:Pt,pseudoElement:"::before"}]],headline:[[[{opacity:0},{opacity:0,offset:.2},{opacity:1}],{duration:250,easing:"linear",fill:"forwards"}]],content:[[[{opacity:0},{opacity:0,offset:.2},{opacity:1}],{duration:250,easing:"linear",fill:"forwards"}]],actions:[[[{opacity:0},{opacity:0,offset:.5},{opacity:1}],{duration:300,easing:"linear",fill:"forwards"}]]},oi={dialog:[[[{transform:"translateY(0)"},{transform:"translateY(-50px)"}],{duration:150,easing:Ht}]],scrim:[[[{opacity:.32},{opacity:0}],{duration:150,easing:"linear"}]],container:[[[{height:"100%"},{height:"35%"}],{duration:150,easing:Ht,pseudoElement:"::before"}],[[{opacity:"1"},{opacity:"0"}],{delay:100,duration:50,easing:"linear",pseudoElement:"::before"}]],headline:[[[{opacity:1},{opacity:0}],{duration:100,easing:"linear",fill:"forwards"}]],content:[[[{opacity:1},{opacity:0}],{duration:100,easing:"linear",fill:"forwards"}]],actions:[[[{opacity:1},{opacity:0}],{duration:100,easing:"linear",fill:"forwards"}]]}; +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +class si extends ht{get open(){return this.isOpen}set open(t){t!==this.isOpen&&(this.isOpen=t,t?(this.setAttribute("open",""),this.show()):(this.removeAttribute("open"),this.close()))}constructor(){super(),this.returnValue="",this.getOpenAnimation=()=>ri,this.getCloseAnimation=()=>oi,this.isOpen=!1,this.isOpening=!1,this.isConnectedPromise=this.getIsConnectedPromise(),this.isAtScrollTop=!1,this.isAtScrollBottom=!1,this.nextClickIsFromContent=!1,this.hasHeadline=!1,this.hasActions=!1,this.hasIcon=!1,this.escapePressedWithoutCancel=!1,this.addEventListener("submit",this.handleSubmit),this.addEventListener("focus",(()=>{this.dialog?.focus()})),this.addEventListener("blur",(()=>{this.dialog?.blur()}))}async show(){this.isOpening=!0,await this.isConnectedPromise,await this.updateComplete;const t=this.dialog;if(t.open||!this.isOpening)return void(this.isOpening=!1);this.dispatchEvent(new Event("open",{cancelable:!0}))?(t.showModal(),this.open=!0,this.scroller&&(this.scroller.scrollTop=0),this.querySelector("[autofocus]")?.focus(),await this.animateDialog(this.getOpenAnimation()),this.dispatchEvent(new Event("opened")),this.isOpening=!1):this.open=!1}async close(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.returnValue;if(this.isOpening=!1,!this.isConnected)return void(this.open=!1);await this.updateComplete;const e=this.dialog;if(!e.open||this.isOpening)return void(this.open=!1);const i=this.returnValue;this.returnValue=t;this.dispatchEvent(new Event("close",{cancelable:!0}))?(await this.animateDialog(this.getCloseAnimation()),e.close(t),this.open=!1,this.dispatchEvent(new Event("closed"))):this.returnValue=i}connectedCallback(){super.connectedCallback(),this.isConnectedPromiseResolve()}disconnectedCallback(){super.disconnectedCallback(),this.isConnectedPromise=this.getIsConnectedPromise()}render(){const t=this.open&&!(this.isAtScrollTop&&this.isAtScrollBottom),e={"has-headline":this.hasHeadline,"has-actions":this.hasActions,"has-icon":this.hasIcon,scrollable:t,"show-top-divider":t&&!this.isAtScrollTop,"show-bottom-divider":t&&!this.isAtScrollBottom},{ariaLabel:i}=this;return J` +
+ +
+
+ +

+ +

+ +
+
+
+
+ +
+
+
+
+ + +
+
+
+ `}firstUpdated(){this.intersectionObserver=new IntersectionObserver((t=>{for(const e of t)this.handleAnchorIntersection(e)}),{root:this.scroller}),this.intersectionObserver.observe(this.topAnchor),this.intersectionObserver.observe(this.bottomAnchor)}handleDialogClick(){if(this.nextClickIsFromContent)return void(this.nextClickIsFromContent=!1);!this.dispatchEvent(new Event("cancel",{cancelable:!0}))||this.close()}handleContentClick(){this.nextClickIsFromContent=!0}handleSubmit(t){const e=t.target,{submitter:i}=t;"dialog"===e.method&&i&&this.close(i.getAttribute("value")??this.returnValue)}handleCancel(t){if(t.target!==this.dialog)return;this.escapePressedWithoutCancel=!1;const e=!Fe(this,t);t.preventDefault(),e||this.close()}handleClose(){this.escapePressedWithoutCancel&&(this.escapePressedWithoutCancel=!1,this.dialog?.dispatchEvent(new Event("cancel",{cancelable:!0})))}handleKeydown(t){"Escape"===t.key&&(this.escapePressedWithoutCancel=!0,setTimeout((()=>{this.escapePressedWithoutCancel=!1})))}async animateDialog(t){const{dialog:e,scrim:i,container:r,headline:o,content:s,actions:n}=this;if(!(e&&i&&r&&o&&s&&n))return;const{container:a,dialog:l,scrim:d,headline:c,content:h,actions:A}=t,p=[[e,l??[]],[i,d??[]],[r,a??[]],[o,c??[]],[s,h??[]],[n,A??[]]],g=[];for(const[t,e]of p)for(const i of e)g.push(t.animate(...i));await Promise.all(g.map((t=>t.finished)))}handleHeadlineChange(t){const e=t.target;this.hasHeadline=e.assignedElements().length>0}handleActionsChange(t){const e=t.target;this.hasActions=e.assignedElements().length>0}handleIconChange(t){const e=t.target;this.hasIcon=e.assignedElements().length>0}handleAnchorIntersection(t){const{target:e,isIntersecting:i}=t;e===this.topAnchor&&(this.isAtScrollTop=i),e===this.bottomAnchor&&(this.isAtScrollBottom=i)}getIsConnectedPromise(){return new Promise((t=>{this.isConnectedPromiseResolve=t}))}}$t(si),r([ft({type:Boolean})],si.prototype,"open",null),r([ft({attribute:!1})],si.prototype,"returnValue",void 0),r([ft()],si.prototype,"type",void 0),r([vt("dialog")],si.prototype,"dialog",void 0),r([vt(".scrim")],si.prototype,"scrim",void 0),r([vt(".container")],si.prototype,"container",void 0),r([vt(".headline")],si.prototype,"headline",void 0),r([vt(".content")],si.prototype,"content",void 0),r([vt(".actions")],si.prototype,"actions",void 0),r([ut()],si.prototype,"isAtScrollTop",void 0),r([ut()],si.prototype,"isAtScrollBottom",void 0),r([vt(".scroller")],si.prototype,"scroller",void 0),r([vt(".top.anchor")],si.prototype,"topAnchor",void 0),r([vt(".bottom.anchor")],si.prototype,"bottomAnchor",void 0),r([ut()],si.prototype,"hasHeadline",void 0),r([ut()],si.prototype,"hasActions",void 0),r([ut()],si.prototype,"hasIcon",void 0); +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +const ni=d`:host{border-start-start-radius:var(--md-dialog-container-shape-start-start, var(--md-dialog-container-shape, 28px));border-start-end-radius:var(--md-dialog-container-shape-start-end, var(--md-dialog-container-shape, 28px));border-end-end-radius:var(--md-dialog-container-shape-end-end, var(--md-dialog-container-shape, 28px));border-end-start-radius:var(--md-dialog-container-shape-end-start, var(--md-dialog-container-shape, 28px));display:contents;margin:auto;max-height:min(560px,100% - 48px);max-width:min(560px,100% - 48px);min-height:140px;min-width:280px;position:fixed;height:fit-content;width:fit-content}dialog{background:rgba(0,0,0,0);border:none;border-radius:inherit;flex-direction:column;height:inherit;margin:inherit;max-height:inherit;max-width:inherit;min-height:inherit;min-width:inherit;outline:none;overflow:visible;padding:0;width:inherit}dialog[open]{display:flex}::backdrop{background:none}.scrim{background:var(--md-sys-color-scrim, #000);display:none;inset:0;opacity:32%;pointer-events:none;position:fixed;z-index:1}:host([open]) .scrim{display:flex}h2{all:unset;align-self:stretch}.headline{align-items:center;color:var(--md-dialog-headline-color, var(--md-sys-color-on-surface, #1d1b20));display:flex;flex-direction:column;font-family:var(--md-dialog-headline-font, var(--md-sys-typescale-headline-small-font, var(--md-ref-typeface-brand, Roboto)));font-size:var(--md-dialog-headline-size, var(--md-sys-typescale-headline-small-size, 1.5rem));line-height:var(--md-dialog-headline-line-height, var(--md-sys-typescale-headline-small-line-height, 2rem));font-weight:var(--md-dialog-headline-weight, var(--md-sys-typescale-headline-small-weight, var(--md-ref-typeface-weight-regular, 400)));position:relative}slot[name=headline]::slotted(*){align-items:center;align-self:stretch;box-sizing:border-box;display:flex;gap:8px;padding:24px 24px 0}.icon{display:flex}slot[name=icon]::slotted(*){color:var(--md-dialog-icon-color, var(--md-sys-color-secondary, #625b71));fill:currentColor;font-size:var(--md-dialog-icon-size, 24px);margin-top:24px;height:var(--md-dialog-icon-size, 24px);width:var(--md-dialog-icon-size, 24px)}.has-icon slot[name=headline]::slotted(*){justify-content:center;padding-top:16px}.scrollable slot[name=headline]::slotted(*){padding-bottom:16px}.scrollable.has-headline slot[name=content]::slotted(*){padding-top:8px}.container{border-radius:inherit;display:flex;flex-direction:column;flex-grow:1;overflow:hidden;position:relative;transform-origin:top}.container::before{background:var(--md-dialog-container-color, var(--md-sys-color-surface-container-high, #ece6f0));border-radius:inherit;content:"";inset:0;position:absolute}.scroller{display:flex;flex:1;flex-direction:column;overflow:hidden;z-index:1}.scrollable .scroller{overflow-y:scroll}.content{color:var(--md-dialog-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-dialog-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-dialog-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-dialog-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-dialog-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)));height:min-content;position:relative}slot[name=content]::slotted(*){box-sizing:border-box;padding:24px}.anchor{position:absolute}.top.anchor{top:0}.bottom.anchor{bottom:0}.actions{position:relative}slot[name=actions]::slotted(*){box-sizing:border-box;display:flex;gap:8px;justify-content:flex-end;padding:16px 24px 24px}.has-actions slot[name=content]::slotted(*){padding-bottom:8px}md-divider{display:none;position:absolute}.has-headline.show-top-divider .headline md-divider,.has-actions.show-bottom-divider .actions md-divider{display:flex}.headline md-divider{bottom:0}.actions md-divider{top:0}@media(forced-colors: active){dialog{outline:2px solid WindowText}}/*# sourceMappingURL=dialog-styles.css.map */ +`;class ai extends si{} +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +function li(t){return(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&"rtl"===getComputedStyle(t).getPropertyValue("direction").trim()} +/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ai.styles=[ni],customElements.define("ew-dialog",ai);const di=Zt(ht);class ci extends di{constructor(){super(...arguments),this.disabled=!1,this.flipIconInRtl=!1,this.href="",this.target="",this.ariaLabelSelected="",this.toggle=!1,this.selected=!1,this.type="submit",this.value="",this.flipIcon=li(this,this.flipIconInRtl)}get name(){return this.getAttribute("name")??""}set name(t){this.setAttribute("name",t)}get form(){return this[jt].form}get labels(){return this[jt].labels}willUpdate(){this.href&&(this.disabled=!1)}render(){const t=this.href?Ie`div`:Ie`button`,{ariaLabel:e,ariaHasPopup:i,ariaExpanded:r}=this,o=e&&this.ariaLabelSelected,s=this.toggle?this.selected:W;let n=W;return this.href||(n=o&&this.selected?this.ariaLabelSelected:e),Se`<${t} + class="icon-button ${Ft(this.getRenderClasses())}" + id="button" + aria-label="${n||W}" + aria-haspopup="${!this.href&&i||W}" + aria-expanded="${!this.href&&r||W}" + aria-pressed="${s}" + ?disabled="${!this.href&&this.disabled}" + @click="${this.handleClick}"> + ${this.renderFocusRing()} + ${this.renderRipple()} + ${this.selected?W:this.renderIcon()} + ${this.selected?this.renderSelectedIcon():W} + ${this.renderTouchTarget()} + ${this.href&&this.renderLink()} + `}renderLink(){const{ariaLabel:t}=this;return J` + + `}getRenderClasses(){return{"flip-icon":this.flipIcon,selected:this.toggle&&this.selected}}renderIcon(){return J``}renderSelectedIcon(){return J``}renderTouchTarget(){return J``}renderFocusRing(){return J``}renderRipple(){return J``}connectedCallback(){this.flipIcon=li(this,this.flipIconInRtl),super.connectedCallback()}async handleClick(t){await 0,!this.toggle||this.disabled||t.defaultPrevented||(this.selected=!this.selected,this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0})))}}$t(ci),qt(ci),ci.formAssociated=!0,ci.shadowRootOptions={mode:"open",delegatesFocus:!0},r([ft({type:Boolean,reflect:!0})],ci.prototype,"disabled",void 0),r([ft({type:Boolean,attribute:"flip-icon-in-rtl"})],ci.prototype,"flipIconInRtl",void 0),r([ft()],ci.prototype,"href",void 0),r([ft()],ci.prototype,"target",void 0),r([ft({attribute:"aria-label-selected"})],ci.prototype,"ariaLabelSelected",void 0),r([ft({type:Boolean})],ci.prototype,"toggle",void 0),r([ft({type:Boolean,reflect:!0})],ci.prototype,"selected",void 0),r([ft()],ci.prototype,"type",void 0),r([ft({reflect:!0})],ci.prototype,"value",void 0),r([ut()],ci.prototype,"flipIcon",void 0); +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +const hi=d`:host{display:inline-flex;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0);height:var(--_container-height);width:var(--_container-width);justify-content:center}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--_container-height))/2) max(0px,(48px - var(--_container-width))/2)}md-focus-ring{--md-focus-ring-shape-start-start: var(--_container-shape-start-start);--md-focus-ring-shape-start-end: var(--_container-shape-start-end);--md-focus-ring-shape-end-end: var(--_container-shape-end-end);--md-focus-ring-shape-end-start: var(--_container-shape-end-start)}:host([disabled]){pointer-events:none}.icon-button{place-items:center;background:none;border:none;box-sizing:border-box;cursor:pointer;display:flex;place-content:center;outline:none;padding:0;position:relative;text-decoration:none;user-select:none;z-index:0;flex:1;border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}.icon ::slotted(*){font-size:var(--_icon-size);height:var(--_icon-size);width:var(--_icon-size);font-weight:inherit}md-ripple{z-index:-1;border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}.flip-icon .icon{transform:scaleX(-1)}.icon{display:inline-flex}.link{height:100%;outline:none;position:absolute;width:100%}.touch{position:absolute;height:max(48px,100%);width:max(48px,100%)}:host([touch-target=none]) .touch{display:none}@media(forced-colors: active){:host([disabled]){--_disabled-icon-opacity: 1}}/*# sourceMappingURL=shared-styles.css.map */ +` +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */,Ai=d`:host{--_disabled-icon-color: var(--md-icon-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-icon-button-disabled-icon-opacity, 0.38);--_icon-size: var(--md-icon-button-icon-size, 24px);--_selected-focus-icon-color: var(--md-icon-button-selected-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-icon-color: var(--md-icon-button-selected-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-color: var(--md-icon-button-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-opacity: var(--md-icon-button-selected-hover-state-layer-opacity, 0.08);--_selected-icon-color: var(--md-icon-button-selected-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-icon-color: var(--md-icon-button-selected-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-state-layer-color: var(--md-icon-button-selected-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-state-layer-opacity: var(--md-icon-button-selected-pressed-state-layer-opacity, 0.12);--_state-layer-height: var(--md-icon-button-state-layer-height, 40px);--_state-layer-shape: var(--md-icon-button-state-layer-shape, 9999px);--_state-layer-width: var(--md-icon-button-state-layer-width, 40px);--_focus-icon-color: var(--md-icon-button-focus-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-icon-color: var(--md-icon-button-hover-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-icon-button-hover-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-opacity: var(--md-icon-button-hover-state-layer-opacity, 0.08);--_icon-color: var(--md-icon-button-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-icon-color: var(--md-icon-button-pressed-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-state-layer-color: var(--md-icon-button-pressed-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-state-layer-opacity: var(--md-icon-button-pressed-state-layer-opacity, 0.12);--_container-shape-start-start: 0;--_container-shape-start-end: 0;--_container-shape-end-end: 0;--_container-shape-end-start: 0;--_container-height: 0;--_container-width: 0;height:var(--_state-layer-height);width:var(--_state-layer-width)}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--_state-layer-height))/2) max(0px,(48px - var(--_state-layer-width))/2)}md-focus-ring{--md-focus-ring-shape-start-start: var(--_state-layer-shape);--md-focus-ring-shape-start-end: var(--_state-layer-shape);--md-focus-ring-shape-end-end: var(--_state-layer-shape);--md-focus-ring-shape-end-start: var(--_state-layer-shape)}.standard{background-color:rgba(0,0,0,0);color:var(--_icon-color);--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}.standard:hover{color:var(--_hover-icon-color)}.standard:focus{color:var(--_focus-icon-color)}.standard:active{color:var(--_pressed-icon-color)}.standard:disabled{color:var(--_disabled-icon-color)}md-ripple{border-radius:var(--_state-layer-shape)}.standard:disabled .icon{opacity:var(--_disabled-icon-opacity)}.selected{--md-ripple-hover-color: var(--_selected-hover-state-layer-color);--md-ripple-hover-opacity: var(--_selected-hover-state-layer-opacity);--md-ripple-pressed-color: var(--_selected-pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_selected-pressed-state-layer-opacity)}.selected:not(:disabled){color:var(--_selected-icon-color)}.selected:not(:disabled):hover{color:var(--_selected-hover-icon-color)}.selected:not(:disabled):focus{color:var(--_selected-focus-icon-color)}.selected:not(:disabled):active{color:var(--_selected-pressed-icon-color)}/*# sourceMappingURL=standard-styles.css.map */ +`;class pi extends ci{}pi.styles=[hi,Ai],customElements.define("ew-icon-button",pi); +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +const gi=d`:host{--_leading-space: var(--md-filled-text-field-leading-space, 16px);--_trailing-space: var(--md-filled-text-field-trailing-space, 16px);--_top-space: var(--md-filled-text-field-top-space, 16px);--_bottom-space: var(--md-filled-text-field-bottom-space, 16px);--_input-text-prefix-trailing-space: var(--md-filled-text-field-input-text-prefix-trailing-space, 2px);--_input-text-suffix-leading-space: var(--md-filled-text-field-input-text-suffix-leading-space, 2px);--_with-label-top-space: var(--md-filled-text-field-with-label-top-space, 8px);--_with-label-bottom-space: var(--md-filled-text-field-with-label-bottom-space, 8px);--_focus-caret-color: var(--md-filled-text-field-focus-caret-color, var(--md-sys-color-primary, #6750a4));--_active-indicator-color: var(--md-filled-text-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_active-indicator-height: var(--md-filled-text-field-active-indicator-height, 1px);--_caret-color: var(--md-filled-text-field-caret-color, var(--md-sys-color-primary, #6750a4));--_container-color: var(--md-filled-text-field-container-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_container-shape-start-start: var( --md-filled-text-field-container-shape-start-start, var(--md-filled-text-field-container-shape, 4px) );--_container-shape-start-end: var( --md-filled-text-field-container-shape-start-end, var(--md-filled-text-field-container-shape, 4px) );--_container-shape-end-end: var( --md-filled-text-field-container-shape-end-end, var(--md-filled-text-field-container-shape, 0px) );--_container-shape-end-start: var( --md-filled-text-field-container-shape-end-start, var(--md-filled-text-field-container-shape, 0px) );--_disabled-active-indicator-color: var(--md-filled-text-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-active-indicator-height: var(--md-filled-text-field-disabled-active-indicator-height, 1px);--_disabled-active-indicator-opacity: var(--md-filled-text-field-disabled-active-indicator-opacity, 0.38);--_disabled-container-color: var(--md-filled-text-field-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-container-opacity: var(--md-filled-text-field-disabled-container-opacity, 0.04);--_disabled-input-text-color: var(--md-filled-text-field-disabled-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-input-text-opacity: var(--md-filled-text-field-disabled-input-text-opacity, 0.38);--_disabled-label-text-color: var(--md-filled-text-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-filled-text-field-disabled-label-text-opacity, 0.38);--_disabled-leading-icon-color: var(--md-filled-text-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-icon-opacity: var(--md-filled-text-field-disabled-leading-icon-opacity, 0.38);--_disabled-supporting-text-color: var(--md-filled-text-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-supporting-text-opacity: var(--md-filled-text-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-filled-text-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-trailing-icon-opacity: var(--md-filled-text-field-disabled-trailing-icon-opacity, 0.38);--_error-active-indicator-color: var(--md-filled-text-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-active-indicator-color: var(--md-filled-text-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-caret-color: var(--md-filled-text-field-error-focus-caret-color, var(--md-sys-color-error, #b3261e));--_error-focus-input-text-color: var(--md-filled-text-field-error-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_error-focus-label-text-color: var(--md-filled-text-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-icon-color: var(--md-filled-text-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-supporting-text-color: var(--md-filled-text-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-icon-color: var(--md-filled-text-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_error-hover-active-indicator-color: var(--md-filled-text-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-input-text-color: var(--md-filled-text-field-error-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_error-hover-label-text-color: var(--md-filled-text-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-icon-color: var(--md-filled-text-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-state-layer-color: var(--md-filled-text-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_error-hover-state-layer-opacity: var(--md-filled-text-field-error-hover-state-layer-opacity, 0.08);--_error-hover-supporting-text-color: var(--md-filled-text-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-icon-color: var(--md-filled-text-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_error-input-text-color: var(--md-filled-text-field-error-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_error-label-text-color: var(--md-filled-text-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-icon-color: var(--md-filled-text-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-supporting-text-color: var(--md-filled-text-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-icon-color: var(--md-filled-text-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_focus-active-indicator-color: var(--md-filled-text-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_focus-active-indicator-height: var(--md-filled-text-field-focus-active-indicator-height, 3px);--_focus-input-text-color: var(--md-filled-text-field-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_focus-label-text-color: var(--md-filled-text-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-icon-color: var(--md-filled-text-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-supporting-text-color: var(--md-filled-text-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-color: var(--md-filled-text-field-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-active-indicator-color: var(--md-filled-text-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-active-indicator-height: var(--md-filled-text-field-hover-active-indicator-height, 1px);--_hover-input-text-color: var(--md-filled-text-field-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color: var(--md-filled-text-field-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-leading-icon-color: var(--md-filled-text-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-filled-text-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-opacity: var(--md-filled-text-field-hover-state-layer-opacity, 0.08);--_hover-supporting-text-color: var(--md-filled-text-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-icon-color: var(--md-filled-text-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-color: var(--md-filled-text-field-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_input-text-font: var(--md-filled-text-field-input-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_input-text-line-height: var(--md-filled-text-field-input-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_input-text-placeholder-color: var(--md-filled-text-field-input-text-placeholder-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-prefix-color: var(--md-filled-text-field-input-text-prefix-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-size: var(--md-filled-text-field-input-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_input-text-suffix-color: var(--md-filled-text-field-input-text-suffix-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-weight: var(--md-filled-text-field-input-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_label-text-color: var(--md-filled-text-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-font: var(--md-filled-text-field-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-filled-text-field-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_label-text-populated-line-height: var(--md-filled-text-field-label-text-populated-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_label-text-populated-size: var(--md-filled-text-field-label-text-populated-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_label-text-size: var(--md-filled-text-field-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_label-text-weight: var(--md-filled-text-field-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_leading-icon-color: var(--md-filled-text-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-filled-text-field-leading-icon-size, 24px);--_supporting-text-color: var(--md-filled-text-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-font: var(--md-filled-text-field-supporting-text-font, var(--md-sys-typescale-body-small-font, var(--md-ref-typeface-plain, Roboto)));--_supporting-text-line-height: var(--md-filled-text-field-supporting-text-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_supporting-text-size: var(--md-filled-text-field-supporting-text-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_supporting-text-weight: var(--md-filled-text-field-supporting-text-weight, var(--md-sys-typescale-body-small-weight, var(--md-ref-typeface-weight-regular, 400)));--_trailing-icon-color: var(--md-filled-text-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-filled-text-field-trailing-icon-size, 24px);--md-filled-field-active-indicator-color: var(--_active-indicator-color);--md-filled-field-active-indicator-height: var(--_active-indicator-height);--md-filled-field-bottom-space: var(--_bottom-space);--md-filled-field-container-color: var(--_container-color);--md-filled-field-container-shape-end-end: var(--_container-shape-end-end);--md-filled-field-container-shape-end-start: var(--_container-shape-end-start);--md-filled-field-container-shape-start-end: var(--_container-shape-start-end);--md-filled-field-container-shape-start-start: var(--_container-shape-start-start);--md-filled-field-content-color: var(--_input-text-color);--md-filled-field-content-font: var(--_input-text-font);--md-filled-field-content-line-height: var(--_input-text-line-height);--md-filled-field-content-size: var(--_input-text-size);--md-filled-field-content-weight: var(--_input-text-weight);--md-filled-field-disabled-active-indicator-color: var(--_disabled-active-indicator-color);--md-filled-field-disabled-active-indicator-height: var(--_disabled-active-indicator-height);--md-filled-field-disabled-active-indicator-opacity: var(--_disabled-active-indicator-opacity);--md-filled-field-disabled-container-color: var(--_disabled-container-color);--md-filled-field-disabled-container-opacity: var(--_disabled-container-opacity);--md-filled-field-disabled-content-color: var(--_disabled-input-text-color);--md-filled-field-disabled-content-opacity: var(--_disabled-input-text-opacity);--md-filled-field-disabled-label-text-color: var(--_disabled-label-text-color);--md-filled-field-disabled-label-text-opacity: var(--_disabled-label-text-opacity);--md-filled-field-disabled-leading-content-color: var(--_disabled-leading-icon-color);--md-filled-field-disabled-leading-content-opacity: var(--_disabled-leading-icon-opacity);--md-filled-field-disabled-supporting-text-color: var(--_disabled-supporting-text-color);--md-filled-field-disabled-supporting-text-opacity: var(--_disabled-supporting-text-opacity);--md-filled-field-disabled-trailing-content-color: var(--_disabled-trailing-icon-color);--md-filled-field-disabled-trailing-content-opacity: var(--_disabled-trailing-icon-opacity);--md-filled-field-error-active-indicator-color: var(--_error-active-indicator-color);--md-filled-field-error-content-color: var(--_error-input-text-color);--md-filled-field-error-focus-active-indicator-color: var(--_error-focus-active-indicator-color);--md-filled-field-error-focus-content-color: var(--_error-focus-input-text-color);--md-filled-field-error-focus-label-text-color: var(--_error-focus-label-text-color);--md-filled-field-error-focus-leading-content-color: var(--_error-focus-leading-icon-color);--md-filled-field-error-focus-supporting-text-color: var(--_error-focus-supporting-text-color);--md-filled-field-error-focus-trailing-content-color: var(--_error-focus-trailing-icon-color);--md-filled-field-error-hover-active-indicator-color: var(--_error-hover-active-indicator-color);--md-filled-field-error-hover-content-color: var(--_error-hover-input-text-color);--md-filled-field-error-hover-label-text-color: var(--_error-hover-label-text-color);--md-filled-field-error-hover-leading-content-color: var(--_error-hover-leading-icon-color);--md-filled-field-error-hover-state-layer-color: var(--_error-hover-state-layer-color);--md-filled-field-error-hover-state-layer-opacity: var(--_error-hover-state-layer-opacity);--md-filled-field-error-hover-supporting-text-color: var(--_error-hover-supporting-text-color);--md-filled-field-error-hover-trailing-content-color: var(--_error-hover-trailing-icon-color);--md-filled-field-error-label-text-color: var(--_error-label-text-color);--md-filled-field-error-leading-content-color: var(--_error-leading-icon-color);--md-filled-field-error-supporting-text-color: var(--_error-supporting-text-color);--md-filled-field-error-trailing-content-color: var(--_error-trailing-icon-color);--md-filled-field-focus-active-indicator-color: var(--_focus-active-indicator-color);--md-filled-field-focus-active-indicator-height: var(--_focus-active-indicator-height);--md-filled-field-focus-content-color: var(--_focus-input-text-color);--md-filled-field-focus-label-text-color: var(--_focus-label-text-color);--md-filled-field-focus-leading-content-color: var(--_focus-leading-icon-color);--md-filled-field-focus-supporting-text-color: var(--_focus-supporting-text-color);--md-filled-field-focus-trailing-content-color: var(--_focus-trailing-icon-color);--md-filled-field-hover-active-indicator-color: var(--_hover-active-indicator-color);--md-filled-field-hover-active-indicator-height: var(--_hover-active-indicator-height);--md-filled-field-hover-content-color: var(--_hover-input-text-color);--md-filled-field-hover-label-text-color: var(--_hover-label-text-color);--md-filled-field-hover-leading-content-color: var(--_hover-leading-icon-color);--md-filled-field-hover-state-layer-color: var(--_hover-state-layer-color);--md-filled-field-hover-state-layer-opacity: var(--_hover-state-layer-opacity);--md-filled-field-hover-supporting-text-color: var(--_hover-supporting-text-color);--md-filled-field-hover-trailing-content-color: var(--_hover-trailing-icon-color);--md-filled-field-label-text-color: var(--_label-text-color);--md-filled-field-label-text-font: var(--_label-text-font);--md-filled-field-label-text-line-height: var(--_label-text-line-height);--md-filled-field-label-text-populated-line-height: var(--_label-text-populated-line-height);--md-filled-field-label-text-populated-size: var(--_label-text-populated-size);--md-filled-field-label-text-size: var(--_label-text-size);--md-filled-field-label-text-weight: var(--_label-text-weight);--md-filled-field-leading-content-color: var(--_leading-icon-color);--md-filled-field-leading-space: var(--_leading-space);--md-filled-field-supporting-text-color: var(--_supporting-text-color);--md-filled-field-supporting-text-font: var(--_supporting-text-font);--md-filled-field-supporting-text-line-height: var(--_supporting-text-line-height);--md-filled-field-supporting-text-size: var(--_supporting-text-size);--md-filled-field-supporting-text-weight: var(--_supporting-text-weight);--md-filled-field-top-space: var(--_top-space);--md-filled-field-trailing-content-color: var(--_trailing-icon-color);--md-filled-field-trailing-space: var(--_trailing-space);--md-filled-field-with-label-bottom-space: var(--_with-label-bottom-space);--md-filled-field-with-label-top-space: var(--_with-label-top-space)}/*# sourceMappingURL=filled-styles.css.map */ +` +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */;class fi extends ht{constructor(){super(...arguments),this.disabled=!1,this.error=!1,this.focused=!1,this.label="",this.populated=!1,this.required=!1,this.resizable=!1,this.supportingText="",this.errorText="",this.count=-1,this.max=-1,this.hasStart=!1,this.hasEnd=!1,this.isAnimating=!1,this.refreshErrorAlert=!1,this.disableTransitions=!1}get counterText(){const t=this.count??-1,e=this.max??-1;return t<0||e<=0?"":`${t} / ${e}`}get supportingOrErrorText(){return this.error&&this.errorText?this.errorText:this.supportingText}reannounceError(){this.refreshErrorAlert=!0}update(t){t.has("disabled")&&void 0!==t.get("disabled")&&(this.disableTransitions=!0),this.disabled&&this.focused&&(t.set("focused",!0),this.focused=!1),this.animateLabelIfNeeded({wasFocused:t.get("focused"),wasPopulated:t.get("populated")}),super.update(t)}render(){const t=this.renderLabel(!0),e=this.renderLabel(!1),i=this.renderOutline?.(t),r={disabled:this.disabled,"disable-transitions":this.disableTransitions,error:this.error&&!this.disabled,focused:this.focused,"with-start":this.hasStart,"with-end":this.hasEnd,populated:this.populated,resizable:this.resizable,required:this.required,"no-label":!this.label};return J` +
+
+ ${this.renderBackground?.()} ${this.renderIndicator?.()} ${i} +
+
+ +
+
+
+ ${e} ${i?W:t} +
+
+ +
+
+
+ +
+
+
+ ${this.renderSupportingText()} +
+ `}updated(t){(t.has("supportingText")||t.has("errorText")||t.has("count")||t.has("max"))&&this.updateSlottedAriaDescribedBy(),this.refreshErrorAlert&&requestAnimationFrame((()=>{this.refreshErrorAlert=!1})),this.disableTransitions&&requestAnimationFrame((()=>{this.disableTransitions=!1}))}renderSupportingText(){const{supportingOrErrorText:t,counterText:e}=this;if(!t&&!e)return W;const i=J`${t}`,r=e?J`${e}`:W,o=this.error&&this.errorText&&!this.refreshErrorAlert;return J` +
${i}${r}
+ + `}updateSlottedAriaDescribedBy(){for(const t of this.slottedAriaDescribedBy)ct(J`${this.supportingOrErrorText} ${this.counterText}`,t),t.setAttribute("hidden","")}renderLabel(t){if(!this.label)return W;let e;e=t?this.focused||this.populated||this.isAnimating:!this.focused&&!this.populated&&!this.isAnimating;const i={hidden:!e,floating:t,resting:!t},r=`${this.label}${this.required?"*":""}`;return J` + ${r} + `}animateLabelIfNeeded(t){let{wasFocused:e,wasPopulated:i}=t;if(!this.label)return;e??(e=this.focused),i??(i=this.populated);(e||i)!==(this.focused||this.populated)&&(this.isAnimating=!0,this.labelAnimation?.cancel(),this.labelAnimation=this.floatingLabelEl?.animate(this.getLabelKeyframes(),{duration:150,easing:Ot}),this.labelAnimation?.addEventListener("finish",(()=>{this.isAnimating=!1})))}getLabelKeyframes(){const{floatingLabelEl:t,restingLabelEl:e}=this;if(!t||!e)return[];const{x:i,y:r,height:o}=t.getBoundingClientRect(),{x:s,y:n,height:a}=e.getBoundingClientRect(),l=t.scrollWidth,d=e.scrollWidth,c=d/l,h=`translateX(${s-i}px) translateY(${n-r+Math.round((a-o*c)/2)}px) scale(${c})`,A="translateX(0) translateY(0) scale(1)",p=e.clientWidth,g=d>p?p/c+"px":"";return this.focused||this.populated?[{transform:h,width:g},{transform:A,width:g}]:[{transform:A,width:g},{transform:h,width:g}]}getSurfacePositionClientRect(){return this.containerEl.getBoundingClientRect()}}r([ft({type:Boolean})],fi.prototype,"disabled",void 0),r([ft({type:Boolean})],fi.prototype,"error",void 0),r([ft({type:Boolean})],fi.prototype,"focused",void 0),r([ft()],fi.prototype,"label",void 0),r([ft({type:Boolean})],fi.prototype,"populated",void 0),r([ft({type:Boolean})],fi.prototype,"required",void 0),r([ft({type:Boolean})],fi.prototype,"resizable",void 0),r([ft({attribute:"supporting-text"})],fi.prototype,"supportingText",void 0),r([ft({attribute:"error-text"})],fi.prototype,"errorText",void 0),r([ft({type:Number})],fi.prototype,"count",void 0),r([ft({type:Number})],fi.prototype,"max",void 0),r([ft({type:Boolean,attribute:"has-start"})],fi.prototype,"hasStart",void 0),r([ft({type:Boolean,attribute:"has-end"})],fi.prototype,"hasEnd",void 0),r([yt({slot:"aria-describedby"})],fi.prototype,"slottedAriaDescribedBy",void 0),r([ut()],fi.prototype,"isAnimating",void 0),r([ut()],fi.prototype,"refreshErrorAlert",void 0),r([ut()],fi.prototype,"disableTransitions",void 0),r([vt(".label.floating")],fi.prototype,"floatingLabelEl",void 0),r([vt(".label.resting")],fi.prototype,"restingLabelEl",void 0),r([vt(".container")],fi.prototype,"containerEl",void 0); +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +class ui extends fi{renderBackground(){return J` +
+
+ `}renderIndicator(){return J`
`}} +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */const mi=d`@layer styles{:host{--_active-indicator-color: var(--md-filled-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_active-indicator-height: var(--md-filled-field-active-indicator-height, 1px);--_bottom-space: var(--md-filled-field-bottom-space, 16px);--_container-color: var(--md-filled-field-container-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_container-shape-start-start: var( --md-filled-field-container-shape-start-start, var(--md-filled-field-container-shape, 4px) );--_container-shape-start-end: var( --md-filled-field-container-shape-start-end, var(--md-filled-field-container-shape, 4px) );--_container-shape-end-end: var( --md-filled-field-container-shape-end-end, var(--md-filled-field-container-shape, 0px) );--_container-shape-end-start: var( --md-filled-field-container-shape-end-start, var(--md-filled-field-container-shape, 0px) );--_content-color: var(--md-filled-field-content-color, var(--md-sys-color-on-surface, #1d1b20));--_content-font: var(--md-filled-field-content-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_content-line-height: var(--md-filled-field-content-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_content-size: var(--md-filled-field-content-size, var(--md-sys-typescale-body-large-size, 1rem));--_content-weight: var(--md-filled-field-content-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_disabled-active-indicator-color: var(--md-filled-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-active-indicator-height: var(--md-filled-field-disabled-active-indicator-height, 1px);--_disabled-active-indicator-opacity: var(--md-filled-field-disabled-active-indicator-opacity, 0.38);--_disabled-container-color: var(--md-filled-field-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-container-opacity: var(--md-filled-field-disabled-container-opacity, 0.04);--_disabled-content-color: var(--md-filled-field-disabled-content-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-content-opacity: var(--md-filled-field-disabled-content-opacity, 0.38);--_disabled-label-text-color: var(--md-filled-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-filled-field-disabled-label-text-opacity, 0.38);--_disabled-leading-content-color: var(--md-filled-field-disabled-leading-content-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-content-opacity: var(--md-filled-field-disabled-leading-content-opacity, 0.38);--_disabled-supporting-text-color: var(--md-filled-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-supporting-text-opacity: var(--md-filled-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-content-color: var(--md-filled-field-disabled-trailing-content-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-trailing-content-opacity: var(--md-filled-field-disabled-trailing-content-opacity, 0.38);--_error-active-indicator-color: var(--md-filled-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-content-color: var(--md-filled-field-error-content-color, var(--md-sys-color-on-surface, #1d1b20));--_error-focus-active-indicator-color: var(--md-filled-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-content-color: var(--md-filled-field-error-focus-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-label-text-color: var(--md-filled-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-content-color: var(--md-filled-field-error-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-supporting-text-color: var(--md-filled-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-content-color: var(--md-filled-field-error-focus-trailing-content-color, var(--md-sys-color-error, #b3261e));--_error-hover-active-indicator-color: var(--md-filled-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-content-color: var(--md-filled-field-error-hover-content-color, var(--md-sys-color-on-surface, #1d1b20));--_error-hover-label-text-color: var(--md-filled-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-content-color: var(--md-filled-field-error-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-state-layer-color: var(--md-filled-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_error-hover-state-layer-opacity: var(--md-filled-field-error-hover-state-layer-opacity, 0.08);--_error-hover-supporting-text-color: var(--md-filled-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-content-color: var(--md-filled-field-error-hover-trailing-content-color, var(--md-sys-color-on-error-container, #410e0b));--_error-label-text-color: var(--md-filled-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-content-color: var(--md-filled-field-error-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-supporting-text-color: var(--md-filled-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-content-color: var(--md-filled-field-error-trailing-content-color, var(--md-sys-color-error, #b3261e));--_focus-active-indicator-color: var(--md-filled-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_focus-active-indicator-height: var(--md-filled-field-focus-active-indicator-height, 3px);--_focus-content-color: var(--md-filled-field-focus-content-color, var(--md-sys-color-on-surface, #1d1b20));--_focus-label-text-color: var(--md-filled-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-content-color: var(--md-filled-field-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-supporting-text-color: var(--md-filled-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-content-color: var(--md-filled-field-focus-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-active-indicator-color: var(--md-filled-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-active-indicator-height: var(--md-filled-field-hover-active-indicator-height, 1px);--_hover-content-color: var(--md-filled-field-hover-content-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color: var(--md-filled-field-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-leading-content-color: var(--md-filled-field-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-filled-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-opacity: var(--md-filled-field-hover-state-layer-opacity, 0.08);--_hover-supporting-text-color: var(--md-filled-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-content-color: var(--md-filled-field-hover-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-filled-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-font: var(--md-filled-field-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-filled-field-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_label-text-populated-line-height: var(--md-filled-field-label-text-populated-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_label-text-populated-size: var(--md-filled-field-label-text-populated-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_label-text-size: var(--md-filled-field-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_label-text-weight: var(--md-filled-field-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_leading-content-color: var(--md-filled-field-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-space: var(--md-filled-field-leading-space, 16px);--_supporting-text-color: var(--md-filled-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-font: var(--md-filled-field-supporting-text-font, var(--md-sys-typescale-body-small-font, var(--md-ref-typeface-plain, Roboto)));--_supporting-text-leading-space: var(--md-filled-field-supporting-text-leading-space, 16px);--_supporting-text-line-height: var(--md-filled-field-supporting-text-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_supporting-text-size: var(--md-filled-field-supporting-text-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_supporting-text-top-space: var(--md-filled-field-supporting-text-top-space, 4px);--_supporting-text-trailing-space: var(--md-filled-field-supporting-text-trailing-space, 16px);--_supporting-text-weight: var(--md-filled-field-supporting-text-weight, var(--md-sys-typescale-body-small-weight, var(--md-ref-typeface-weight-regular, 400)));--_top-space: var(--md-filled-field-top-space, 16px);--_trailing-content-color: var(--md-filled-field-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-space: var(--md-filled-field-trailing-space, 16px);--_with-label-bottom-space: var(--md-filled-field-with-label-bottom-space, 8px);--_with-label-top-space: var(--md-filled-field-with-label-top-space, 8px)}.background,.state-layer{border-radius:inherit;inset:0;pointer-events:none;position:absolute}.background{background:var(--_container-color)}.state-layer{visibility:hidden}.field:not(.disabled):hover .state-layer{visibility:visible}.label.floating{position:absolute;top:var(--_with-label-top-space)}.field:not(.with-start) .label-wrapper{margin-inline-start:var(--_leading-space)}.field:not(.with-end) .label-wrapper{margin-inline-end:var(--_trailing-space)}.active-indicator{inset:auto 0 0 0;pointer-events:none;position:absolute;width:100%;z-index:1}.active-indicator::before,.active-indicator::after{border-bottom:var(--_active-indicator-height) solid var(--_active-indicator-color);inset:auto 0 0 0;content:"";position:absolute;width:100%}.active-indicator::after{opacity:0;transition:opacity 150ms cubic-bezier(0.2, 0, 0, 1)}.focused .active-indicator::after{opacity:1}.field:not(.with-start) .content ::slotted(*){padding-inline-start:var(--_leading-space)}.field:not(.with-end) .content ::slotted(*){padding-inline-end:var(--_trailing-space)}.field:not(.no-label) .content ::slotted(:not(textarea)){padding-bottom:var(--_with-label-bottom-space);padding-top:calc(var(--_with-label-top-space) + var(--_label-text-populated-line-height))}.field:not(.no-label) .content ::slotted(textarea){margin-bottom:var(--_with-label-bottom-space);margin-top:calc(var(--_with-label-top-space) + var(--_label-text-populated-line-height))}:hover .active-indicator::before{border-bottom-color:var(--_hover-active-indicator-color);border-bottom-width:var(--_hover-active-indicator-height)}.active-indicator::after{border-bottom-color:var(--_focus-active-indicator-color);border-bottom-width:var(--_focus-active-indicator-height)}:hover .state-layer{background:var(--_hover-state-layer-color);opacity:var(--_hover-state-layer-opacity)}.disabled .active-indicator::before{border-bottom-color:var(--_disabled-active-indicator-color);border-bottom-width:var(--_disabled-active-indicator-height);opacity:var(--_disabled-active-indicator-opacity)}.disabled .background{background:var(--_disabled-container-color);opacity:var(--_disabled-container-opacity)}.error .active-indicator::before{border-bottom-color:var(--_error-active-indicator-color)}.error:hover .active-indicator::before{border-bottom-color:var(--_error-hover-active-indicator-color)}.error:hover .state-layer{background:var(--_error-hover-state-layer-color);opacity:var(--_error-hover-state-layer-opacity)}.error .active-indicator::after{border-bottom-color:var(--_error-focus-active-indicator-color)}.resizable .container{bottom:var(--_focus-active-indicator-height);clip-path:inset(var(--_focus-active-indicator-height) 0 0 0)}.resizable .container>*{top:var(--_focus-active-indicator-height)}}@layer hcm{@media(forced-colors: active){.disabled .active-indicator::before{border-color:GrayText;opacity:1}}}/*# sourceMappingURL=filled-styles.css.map */ +` +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */,vi=d`:host{display:inline-flex;resize:both}.field{display:flex;flex:1;flex-direction:column;writing-mode:horizontal-tb;max-width:100%}.container-overflow{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start);display:flex;height:100%;position:relative}.container{align-items:center;border-radius:inherit;display:flex;flex:1;max-height:100%;min-height:100%;min-width:min-content;position:relative}.field,.container-overflow{resize:inherit}.resizable:not(.disabled) .container{resize:inherit;overflow:hidden}.disabled{pointer-events:none}@layer styles{.start,.middle,.end{display:flex;box-sizing:border-box;height:100%;position:relative}.start{color:var(--_leading-content-color)}.end{color:var(--_trailing-content-color)}.start,.end{align-items:center;justify-content:center}.with-start .start,.with-end .end{min-width:48px}.with-start .start{margin-inline-end:4px}.with-end .end{margin-inline-start:4px}.middle{align-items:stretch;align-self:baseline;flex:1}.content{color:var(--_content-color);display:flex;flex:1;opacity:0;transition:opacity 83ms cubic-bezier(0.2, 0, 0, 1)}.no-label .content,.focused .content,.populated .content{opacity:1;transition-delay:67ms}:is(.disabled,.disable-transitions) .content{transition:none}.content ::slotted(*){all:unset;color:currentColor;font-family:var(--_content-font);font-size:var(--_content-size);line-height:var(--_content-line-height);font-weight:var(--_content-weight);width:100%;overflow-wrap:revert;white-space:revert}.content ::slotted(:not(textarea)){padding-top:var(--_top-space);padding-bottom:var(--_bottom-space)}.content ::slotted(textarea){margin-top:var(--_top-space);margin-bottom:var(--_bottom-space)}:hover .content{color:var(--_hover-content-color)}:hover .start{color:var(--_hover-leading-content-color)}:hover .end{color:var(--_hover-trailing-content-color)}.focused .content{color:var(--_focus-content-color)}.focused .start{color:var(--_focus-leading-content-color)}.focused .end{color:var(--_focus-trailing-content-color)}.disabled .content{color:var(--_disabled-content-color)}.disabled.no-label .content,.disabled.focused .content,.disabled.populated .content{opacity:var(--_disabled-content-opacity)}.disabled .start{color:var(--_disabled-leading-content-color);opacity:var(--_disabled-leading-content-opacity)}.disabled .end{color:var(--_disabled-trailing-content-color);opacity:var(--_disabled-trailing-content-opacity)}.error .content{color:var(--_error-content-color)}.error .start{color:var(--_error-leading-content-color)}.error .end{color:var(--_error-trailing-content-color)}.error:hover .content{color:var(--_error-hover-content-color)}.error:hover .start{color:var(--_error-hover-leading-content-color)}.error:hover .end{color:var(--_error-hover-trailing-content-color)}.error.focused .content{color:var(--_error-focus-content-color)}.error.focused .start{color:var(--_error-focus-leading-content-color)}.error.focused .end{color:var(--_error-focus-trailing-content-color)}}@layer hcm{@media(forced-colors: active){.disabled :is(.start,.content,.end){color:GrayText;opacity:1}}}@layer styles{.label{box-sizing:border-box;color:var(--_label-text-color);overflow:hidden;max-width:100%;text-overflow:ellipsis;white-space:nowrap;z-index:1;font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight);width:min-content}.label-wrapper{inset:0;pointer-events:none;position:absolute}.label.resting{position:absolute;top:var(--_top-space)}.label.floating{font-size:var(--_label-text-populated-size);line-height:var(--_label-text-populated-line-height);transform-origin:top left}.label.hidden{opacity:0}.no-label .label{display:none}.label-wrapper{inset:0;position:absolute;text-align:initial}:hover .label{color:var(--_hover-label-text-color)}.focused .label{color:var(--_focus-label-text-color)}.disabled .label{color:var(--_disabled-label-text-color)}.disabled .label:not(.hidden){opacity:var(--_disabled-label-text-opacity)}.error .label{color:var(--_error-label-text-color)}.error:hover .label{color:var(--_error-hover-label-text-color)}.error.focused .label{color:var(--_error-focus-label-text-color)}}@layer hcm{@media(forced-colors: active){.disabled .label:not(.hidden){color:GrayText;opacity:1}}}@layer styles{.supporting-text{color:var(--_supporting-text-color);display:flex;font-family:var(--_supporting-text-font);font-size:var(--_supporting-text-size);line-height:var(--_supporting-text-line-height);font-weight:var(--_supporting-text-weight);gap:16px;justify-content:space-between;padding-inline-start:var(--_supporting-text-leading-space);padding-inline-end:var(--_supporting-text-trailing-space);padding-top:var(--_supporting-text-top-space)}.supporting-text :nth-child(2){flex-shrink:0}:hover .supporting-text{color:var(--_hover-supporting-text-color)}.focus .supporting-text{color:var(--_focus-supporting-text-color)}.disabled .supporting-text{color:var(--_disabled-supporting-text-color);opacity:var(--_disabled-supporting-text-opacity)}.error .supporting-text{color:var(--_error-supporting-text-color)}.error:hover .supporting-text{color:var(--_error-hover-supporting-text-color)}.error.focus .supporting-text{color:var(--_error-focus-supporting-text-color)}}@layer hcm{@media(forced-colors: active){.disabled .supporting-text{color:GrayText;opacity:1}}}/*# sourceMappingURL=shared-styles.css.map */ +` +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */;let wi=class extends ui{};wi.styles=[vi,mi],wi=r([pt("md-filled-field")],wi); +/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const yi={},bi=Tt(class extends Qt{constructor(t){if(super(t),t.type!==Dt&&t.type!==kt&&t.type!==Mt)throw Error("The `live` directive is not allowed on child or event bindings");if(!(t=>void 0===t.strings)(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,e){let[i]=e;if(i===j||i===W)return i;const r=t.element,o=t.name;if(t.type===Dt){if(i===r[o])return j}else if(t.type===Mt){if(!!i===r.hasAttribute(o))return j}else if(t.type===kt&&r.getAttribute(o)===i+"")return j;return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yi;t._$AH=e}(t),i}}),_i="important",Ei=" !"+_i,xi=Tt(class extends Qt{constructor(t){if(super(t),t.type!==kt||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,i)=>{const r=t[i];return null==r?e:e+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`}),"")}update(t,e){let[i]=e;const{style:r}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(i)),this.render(i);for(const t of this.ft)null==i[t]&&(this.ft.delete(t),t.includes("-")?r.removeProperty(t):r[t]=null);for(const t in i){const e=i[t];if(null!=e){this.ft.add(t);const i="string"==typeof e&&e.endsWith(Ei);t.includes("-")||i?r.setProperty(t,i?e.slice(0,-11):e,i?_i:""):r[t]=e}}return j}}),Ci={fromAttribute:t=>t??"",toAttribute:t=>t||null},Ii=Symbol("onReportValidity"),Bi=Symbol("privateCleanupFormListeners"),Si=Symbol("privateDoNotReportInvalid"),Ri=Symbol("privateIsSelfReportingValidity"),ki=Symbol("privateCallOnReportValidity"); +/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function Di(t){var e,i,r;class o extends t{constructor(){super(...arguments),this[e]=new AbortController,this[i]=!1,this[r]=!1,this.addEventListener("invalid",(t=>{!this[Si]&&t.isTrusted&&this.addEventListener("invalid",(()=>{this[ki](t)}),{once:!0})}),{capture:!0})}checkValidity(){this[Si]=!0;const t=super.checkValidity();return this[Si]=!1,t}reportValidity(){this[Ri]=!0;const t=super.reportValidity();return t&&this[ki](null),this[Ri]=!1,t}[(e=Bi,i=Si,r=Ri,ki)](t){const e=t?.defaultPrevented;if(e)return;this[Ii](t);!e&&t?.defaultPrevented&&(this[Ri]||function(t,e){if(!t)return!0;let i;for(const e of t.elements)if(e.matches(":invalid")){i=e;break}return i===e} +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */(this[jt].form,this))&&this.focus()}[Ii](t){throw new Error("Implement [onReportValidity]")}formAssociatedCallback(t){super.formAssociatedCallback&&super.formAssociatedCallback(t),this[Bi].abort(),t&&(this[Bi]=new AbortController,function(t,e,i,r){const o=function(t){if(!Mi.has(t)){const e=new EventTarget;Mi.set(t,e);for(const i of["reportValidity","requestSubmit"]){const r=t[i];t[i]=function(){e.dispatchEvent(new Event("before"));const t=Reflect.apply(r,this,arguments);return e.dispatchEvent(new Event("after")),t}}}return Mi.get(t)}(e);let s,n=!1,a=!1;o.addEventListener("before",(()=>{a=!0,s=new AbortController,n=!1,t.addEventListener("invalid",(()=>{n=!0}),{signal:s.signal})}),{signal:r}),o.addEventListener("after",(()=>{a=!1,s?.abort(),n||i()}),{signal:r}),e.addEventListener("submit",(()=>{a||i()}),{signal:r})}(this,t,(()=>{this[ki](null)}),this[Bi].signal))}}return o}const Mi=new WeakMap;class Ti extends Ne{computeValidity(t){let{state:e,renderedControl:i}=t,r=i;Qi(e)&&!r?(r=this.inputControl||document.createElement("input"),this.inputControl=r):r||(r=this.textAreaControl||document.createElement("textarea"),this.textAreaControl=r);const o=Qi(e)?r:null;if(o&&(o.type=e.type),r.value!==e.value&&(r.value=e.value),r.required=e.required,o){const t=e;t.pattern?o.pattern=t.pattern:o.removeAttribute("pattern"),t.min?o.min=t.min:o.removeAttribute("min"),t.max?o.max=t.max:o.removeAttribute("max"),t.step?o.step=t.step:o.removeAttribute("step")}return(e.minLength??-1)>-1?r.setAttribute("minlength",String(e.minLength)):r.removeAttribute("minlength"),(e.maxLength??-1)>-1?r.setAttribute("maxlength",String(e.maxLength)):r.removeAttribute("maxlength"),{validity:r.validity,validationMessage:r.validationMessage}}equals(t,e){let{state:i}=t,{state:r}=e;const o=i.type===r.type&&i.value===r.value&&i.required===r.required&&i.minLength===r.minLength&&i.maxLength===r.maxLength;return Qi(i)&&Qi(r)?o&&i.pattern===r.pattern&&i.min===r.min&&i.max===r.max&&i.step===r.step:o}copy(t){let{state:e}=t;return{state:Qi(e)?this.copyInput(e):this.copyTextArea(e),renderedControl:null}}copyInput(t){const{type:e,pattern:i,min:r,max:o,step:s}=t;return{...this.copySharedState(t),type:e,pattern:i,min:r,max:o,step:s}}copyTextArea(t){return{...this.copySharedState(t),type:t.type}}copySharedState(t){let{value:e,required:i,minLength:r,maxLength:o}=t;return{value:e,required:i,minLength:r,maxLength:o}}}function Qi(t){return"textarea"!==t.type} +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */const Fi=Di(Ge(Ye(Zt(ht))));class Oi extends Fi{constructor(){super(...arguments),this.error=!1,this.errorText="",this.label="",this.required=!1,this.value="",this.prefixText="",this.suffixText="",this.hasLeadingIcon=!1,this.hasTrailingIcon=!1,this.supportingText="",this.textDirection="",this.rows=2,this.cols=20,this.inputMode="",this.max="",this.maxLength=-1,this.min="",this.minLength=-1,this.noSpinner=!1,this.pattern="",this.placeholder="",this.readOnly=!1,this.multiple=!1,this.step="",this.type="text",this.autocomplete="",this.dirty=!1,this.focused=!1,this.nativeError=!1,this.nativeErrorText=""}get selectionDirection(){return this.getInputOrTextarea().selectionDirection}set selectionDirection(t){this.getInputOrTextarea().selectionDirection=t}get selectionEnd(){return this.getInputOrTextarea().selectionEnd}set selectionEnd(t){this.getInputOrTextarea().selectionEnd=t}get selectionStart(){return this.getInputOrTextarea().selectionStart}set selectionStart(t){this.getInputOrTextarea().selectionStart=t}get valueAsNumber(){const t=this.getInput();return t?t.valueAsNumber:NaN}set valueAsNumber(t){const e=this.getInput();e&&(e.valueAsNumber=t,this.value=e.value)}get valueAsDate(){const t=this.getInput();return t?t.valueAsDate:null}set valueAsDate(t){const e=this.getInput();e&&(e.valueAsDate=t,this.value=e.value)}get hasError(){return this.error||this.nativeError}select(){this.getInputOrTextarea().select()}setRangeText(){this.getInputOrTextarea().setRangeText(...arguments),this.value=this.getInputOrTextarea().value}setSelectionRange(t,e,i){this.getInputOrTextarea().setSelectionRange(t,e,i)}stepDown(t){const e=this.getInput();e&&(e.stepDown(t),this.value=e.value)}stepUp(t){const e=this.getInput();e&&(e.stepUp(t),this.value=e.value)}reset(){this.dirty=!1,this.value=this.getAttribute("value")??"",this.nativeError=!1,this.nativeErrorText=""}attributeChangedCallback(t,e,i){"value"===t&&this.dirty||super.attributeChangedCallback(t,e,i)}render(){const t={disabled:this.disabled,error:!this.disabled&&this.hasError,textarea:"textarea"===this.type,"no-spinner":this.noSpinner};return J` + + ${this.renderField()} + + `}updated(t){const e=this.getInputOrTextarea().value;this.value!==e&&(this.value=e)}renderField(){return Se`<${this.fieldTag} + class="field" + count=${this.value.length} + ?disabled=${this.disabled} + ?error=${this.hasError} + error-text=${this.getErrorText()} + ?focused=${this.focused} + ?has-end=${this.hasTrailingIcon} + ?has-start=${this.hasLeadingIcon} + label=${this.label} + max=${this.maxLength} + ?populated=${!!this.value} + ?required=${this.required} + ?resizable=${"textarea"===this.type} + supporting-text=${this.supportingText} + > + ${this.renderLeadingIcon()} + ${this.renderInputOrTextarea()} + ${this.renderTrailingIcon()} +
+ `}renderLeadingIcon(){return J` + + + + `}renderTrailingIcon(){return J` + + + + `}renderInputOrTextarea(){const t={direction:this.textDirection},e=this.ariaLabel||this.label||W,i=this.autocomplete,r=(this.maxLength??-1)>-1,o=(this.minLength??-1)>-1;if("textarea"===this.type)return J` + + `;const s=this.renderPrefix(),n=this.renderSuffix(),a=this.inputMode;return J` +
+ ${s} + + ${n} +
+ `}renderPrefix(){return this.renderAffix(this.prefixText,!1)}renderSuffix(){return this.renderAffix(this.suffixText,!0)}renderAffix(t,e){if(!t)return W;return J`${t}`}getErrorText(){return this.error?this.errorText:this.nativeErrorText}handleFocusChange(){this.focused=this.inputOrTextarea?.matches(":focus")??!1}handleInput(t){this.dirty=!0,this.value=t.target.value}redispatchEvent(t){Fe(this,t)}getInputOrTextarea(){return this.inputOrTextarea||(this.connectedCallback(),this.scheduleUpdate()),this.isUpdatePending&&this.scheduleUpdate(),this.inputOrTextarea}getInput(){return"textarea"===this.type?null:this.getInputOrTextarea()}handleIconChange(){this.hasLeadingIcon=this.leadingIcons.length>0,this.hasTrailingIcon=this.trailingIcons.length>0}[ze](){return this.value}formResetCallback(){this.reset()}formStateRestoreCallback(t){this.value=t}focus(){this.getInputOrTextarea().focus()}[Oe](){return new Ti((()=>({state:this,renderedControl:this.inputOrTextarea})))}[Pe](){return this.inputOrTextarea}[Ii](t){t?.preventDefault();const e=this.getErrorText();this.nativeError=!!t,this.nativeErrorText=this.validationMessage,e===this.getErrorText()&&this.field?.reannounceError()}}$t(Oi),Oi.shadowRootOptions={...ht.shadowRootOptions,delegatesFocus:!0},r([ft({type:Boolean,reflect:!0})],Oi.prototype,"error",void 0),r([ft({attribute:"error-text"})],Oi.prototype,"errorText",void 0),r([ft()],Oi.prototype,"label",void 0),r([ft({type:Boolean,reflect:!0})],Oi.prototype,"required",void 0),r([ft()],Oi.prototype,"value",void 0),r([ft({attribute:"prefix-text"})],Oi.prototype,"prefixText",void 0),r([ft({attribute:"suffix-text"})],Oi.prototype,"suffixText",void 0),r([ft({type:Boolean,attribute:"has-leading-icon"})],Oi.prototype,"hasLeadingIcon",void 0),r([ft({type:Boolean,attribute:"has-trailing-icon"})],Oi.prototype,"hasTrailingIcon",void 0),r([ft({attribute:"supporting-text"})],Oi.prototype,"supportingText",void 0),r([ft({attribute:"text-direction"})],Oi.prototype,"textDirection",void 0),r([ft({type:Number})],Oi.prototype,"rows",void 0),r([ft({type:Number})],Oi.prototype,"cols",void 0),r([ft({reflect:!0})],Oi.prototype,"inputMode",void 0),r([ft()],Oi.prototype,"max",void 0),r([ft({type:Number})],Oi.prototype,"maxLength",void 0),r([ft()],Oi.prototype,"min",void 0),r([ft({type:Number})],Oi.prototype,"minLength",void 0),r([ft({type:Boolean,attribute:"no-spinner"})],Oi.prototype,"noSpinner",void 0),r([ft()],Oi.prototype,"pattern",void 0),r([ft({reflect:!0,converter:Ci})],Oi.prototype,"placeholder",void 0),r([ft({type:Boolean,reflect:!0})],Oi.prototype,"readOnly",void 0),r([ft({type:Boolean,reflect:!0})],Oi.prototype,"multiple",void 0),r([ft()],Oi.prototype,"step",void 0),r([ft({reflect:!0})],Oi.prototype,"type",void 0),r([ft({reflect:!0})],Oi.prototype,"autocomplete",void 0),r([ut()],Oi.prototype,"dirty",void 0),r([ut()],Oi.prototype,"focused",void 0),r([ut()],Oi.prototype,"nativeError",void 0),r([ut()],Oi.prototype,"nativeErrorText",void 0),r([vt(".input")],Oi.prototype,"inputOrTextarea",void 0),r([vt(".field")],Oi.prototype,"field",void 0),r([yt({slot:"leading-icon"})],Oi.prototype,"leadingIcons",void 0),r([yt({slot:"trailing-icon"})],Oi.prototype,"trailingIcons",void 0); +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +class Pi extends Oi{constructor(){super(...arguments),this.fieldTag=Ie`md-filled-field`}} +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */const Hi=d`:host{display:inline-flex;outline:none;resize:both;-webkit-tap-highlight-color:rgba(0,0,0,0)}.text-field,.field{width:100%}.text-field{display:inline-flex}.field{cursor:text}.disabled .field{cursor:default}.text-field,.textarea .field{resize:inherit}.icon{color:currentColor;display:flex;fill:currentColor}.icon ::slotted(*){display:flex}[hasstart] .icon.leading{font-size:var(--_leading-icon-size);height:var(--_leading-icon-size);width:var(--_leading-icon-size)}[hasend] .icon.trailing{font-size:var(--_trailing-icon-size);height:var(--_trailing-icon-size);width:var(--_trailing-icon-size)}.input-wrapper{display:flex}.input-wrapper>*{all:inherit;padding:0}.input{caret-color:var(--_caret-color);overflow-x:hidden;text-align:inherit}.input::placeholder{color:currentColor;opacity:1}.input::-webkit-calendar-picker-indicator{display:none}.input::-webkit-search-decoration,.input::-webkit-search-cancel-button{display:none}@media(forced-colors: active){.input{background:none}}.no-spinner .input::-webkit-inner-spin-button,.no-spinner .input::-webkit-outer-spin-button{display:none}.no-spinner .input[type=number]{-moz-appearance:textfield}:focus-within .input{caret-color:var(--_focus-caret-color)}.error:focus-within .input{caret-color:var(--_error-focus-caret-color)}.text-field:not(.disabled) .prefix{color:var(--_input-text-prefix-color)}.text-field:not(.disabled) .suffix{color:var(--_input-text-suffix-color)}.text-field:not(.disabled) .input::placeholder{color:var(--_input-text-placeholder-color)}.prefix,.suffix{text-wrap:nowrap;width:min-content}.prefix{padding-inline-end:var(--_input-text-prefix-trailing-space)}.suffix{padding-inline-start:var(--_input-text-suffix-leading-space)}/*# sourceMappingURL=shared-styles.css.map */ +`;class Li extends Pi{constructor(){super(...arguments),this.fieldTag=Ie`md-filled-field`}}Li.styles=[Hi,gi],customElements.define("ew-filled-text-field",Li); +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +class Ui extends ht{connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){return J``}} +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */const Gi=d`:host{display:flex;pointer-events:none}:host,.shadow,.shadow::before,.shadow::after{border-radius:inherit;inset:0;position:absolute;transition-duration:inherit;transition-property:inherit;transition-timing-function:inherit}.shadow::before,.shadow::after{content:"";transition-property:box-shadow,opacity;--_level: var(--md-elevation-level, 0);--_shadow-color: var(--md-elevation-shadow-color, var(--md-sys-color-shadow, #000))}.shadow::before{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 3,1) + 2*clamp(0,var(--_level) - 4,1))) calc(1px*(2*clamp(0,var(--_level),1) + clamp(0,var(--_level) - 2,1) + clamp(0,var(--_level) - 4,1))) 0px var(--_shadow-color);opacity:.3}.shadow::after{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 1,1) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(3*clamp(0,var(--_level),2) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(clamp(0,var(--_level),4) + 2*clamp(0,var(--_level) - 4,1))) var(--_shadow-color);opacity:.15}/*# sourceMappingURL=elevation-styles.css.map */ +` +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */;let zi=class extends Ui{};zi.styles=[Gi],zi=r([pt("md-elevation")],zi);const Ki= +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +function(t,e){return new CustomEvent("close-menu",{bubbles:!0,composed:!0,detail:{initiator:t,reason:e,itemPath:[t]}})},Yi={SPACE:"Space",ENTER:"Enter"},Ni="click-selection",Ji="keydown",$i={ESCAPE:"Escape",SPACE:Yi.SPACE,ENTER:Yi.ENTER};function ji(t){return Object.values($i).some((e=>e===t))}function Wi(t,e){const i=new Event("md-contains",{bubbles:!0,composed:!0});let r=[];const o=t=>{r=t.composedPath()};e.addEventListener("md-contains",o),t.dispatchEvent(i),e.removeEventListener("md-contains",o);return r.length>0}const Zi="none",qi="list-root",Vi="first-item",Xi="last-item",tr="end-start",er="start-start"; +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */class ir{constructor(t,e){this.host=t,this.getProperties=e,this.surfaceStylesInternal={display:"none"},this.lastValues={isOpen:!1},this.host.addController(this)}get surfaceStyles(){return this.surfaceStylesInternal}async position(){const{surfaceEl:t,anchorEl:e,anchorCorner:i,surfaceCorner:r,positioning:o,xOffset:s,yOffset:n,repositionStrategy:a}=this.getProperties(),l=i.toLowerCase().trim(),d=r.toLowerCase().trim();if(!t||!e)return;const c=window.innerWidth,h=window.innerHeight,A=document.createElement("div");A.style.opacity="0",A.style.position="fixed",A.style.display="block",A.style.inset="0",document.body.appendChild(A);const p=A.getBoundingClientRect();A.remove();const g=window.innerHeight-p.bottom,f=window.innerWidth-p.right;this.surfaceStylesInternal={display:"block",opacity:"0"},this.host.requestUpdate(),await this.host.updateComplete,t.popover&&t.isConnected&&t.showPopover();const u=t.getSurfacePositionClientRect?t.getSurfacePositionClientRect():t.getBoundingClientRect(),m=e.getSurfacePositionClientRect?e.getSurfacePositionClientRect():e.getBoundingClientRect(),[v,w]=d.split("-"),[y,b]=l.split("-"),_="ltr"===getComputedStyle(t).direction;let{blockInset:E,blockOutOfBoundsCorrection:x,surfaceBlockProperty:C}=this.calculateBlock({surfaceRect:u,anchorRect:m,anchorBlock:y,surfaceBlock:v,yOffset:n,positioning:o,windowInnerHeight:h,blockScrollbarHeight:g});if(x){const t="start"===v?"end":"start",e="start"===y?"end":"start",i=this.calculateBlock({surfaceRect:u,anchorRect:m,anchorBlock:e,surfaceBlock:t,yOffset:n,positioning:o,windowInnerHeight:h,blockScrollbarHeight:g});x>i.blockOutOfBoundsCorrection&&(E=i.blockInset,x=i.blockOutOfBoundsCorrection,C=i.surfaceBlockProperty)}let{inlineInset:I,inlineOutOfBoundsCorrection:B,surfaceInlineProperty:S}=this.calculateInline({surfaceRect:u,anchorRect:m,anchorInline:b,surfaceInline:w,xOffset:s,positioning:o,isLTR:_,windowInnerWidth:c,inlineScrollbarWidth:f});if(B){const t="start"===w?"end":"start",e="start"===b?"end":"start",i=this.calculateInline({surfaceRect:u,anchorRect:m,anchorInline:e,surfaceInline:t,xOffset:s,positioning:o,isLTR:_,windowInnerWidth:c,inlineScrollbarWidth:f});Math.abs(B)>Math.abs(i.inlineOutOfBoundsCorrection)&&(I=i.inlineInset,B=i.inlineOutOfBoundsCorrection,S=i.surfaceInlineProperty)}"move"===a&&(E-=x,I-=B),this.surfaceStylesInternal={display:"block",opacity:"1",[C]:`${E}px`,[S]:`${I}px`},"resize"===a&&(x&&(this.surfaceStylesInternal.height=u.height-x+"px"),B&&(this.surfaceStylesInternal.width=u.width-B+"px")),this.host.requestUpdate()}calculateBlock(t){const{surfaceRect:e,anchorRect:i,anchorBlock:r,surfaceBlock:o,yOffset:s,positioning:n,windowInnerHeight:a,blockScrollbarHeight:l}=t,d="fixed"===n||"document"===n?1:0,c="document"===n?1:0,h="start"===o?1:0,A="end"===o?1:0,p=(r!==o?1:0)*i.height+s,g=h*i.top+A*(a-i.bottom-l);return{blockInset:d*g+c*(h*window.scrollY-A*window.scrollY)+p,blockOutOfBoundsCorrection:Math.abs(Math.min(0,a-g-p-e.height)),surfaceBlockProperty:"start"===o?"inset-block-start":"inset-block-end"}}calculateInline(t){const{isLTR:e,surfaceInline:i,anchorInline:r,anchorRect:o,surfaceRect:s,xOffset:n,positioning:a,windowInnerWidth:l,inlineScrollbarWidth:d}=t,c="fixed"===a||"document"===a?1:0,h="document"===a?1:0,A=e?1:0,p=e?0:1,g="start"===i?1:0,f="end"===i?1:0,u=(r!==i?1:0)*o.width+n,m=A*(g*o.left+f*(l-o.right-d))+p*(g*(l-o.right-d)+f*o.left);let v="start"===i?"inset-inline-start":"inset-inline-end";return"document"!==a&&"fixed"!==a||(v="start"===i&&e||"end"===i&&!e?"left":"right"),{inlineInset:c*m+u+h*(A*(g*window.scrollX-f*window.scrollX)+p*(f*window.scrollX-g*window.scrollX)),inlineOutOfBoundsCorrection:Math.abs(Math.min(0,l-m-u-s.width)),surfaceInlineProperty:v}}hostUpdate(){this.onUpdate()}hostUpdated(){this.onUpdate()}async onUpdate(){const t=this.getProperties();let e=!1;for(const[i,r]of Object.entries(t))if(e=e||r!==this.lastValues[i],e)break;const i=this.lastValues.isOpen!==t.isOpen,r=!!t.anchorEl,o=!!t.surfaceEl;e&&r&&o&&(this.lastValues.isOpen=t.isOpen,t.isOpen?(this.lastValues=t,await this.position(),t.onOpen()):i&&(await t.beforeClose(),this.close(),t.onClose()))}close(){this.surfaceStylesInternal={display:"none"},this.host.requestUpdate();const t=this.getProperties().surfaceEl;t?.popover&&t?.isConnected&&t.hidePopover()}} +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */const rr=0,or=1,sr=2;class nr{constructor(t){this.getProperties=t,this.typeaheadRecords=[],this.typaheadBuffer="",this.cancelTypeaheadTimeout=0,this.isTypingAhead=!1,this.lastActiveRecord=null,this.onKeydown=t=>{this.isTypingAhead?this.typeahead(t):this.beginTypeahead(t)},this.endTypeahead=()=>{this.isTypingAhead=!1,this.typaheadBuffer="",this.typeaheadRecords=[]}}get items(){return this.getProperties().getItems()}get active(){return this.getProperties().active}beginTypeahead(t){this.active&&("Space"===t.code||"Enter"===t.code||t.code.startsWith("Arrow")||"Escape"===t.code||(this.isTypingAhead=!0,this.typeaheadRecords=this.items.map(((t,e)=>[e,t,t.typeaheadText.trim().toLowerCase()])),this.lastActiveRecord=this.typeaheadRecords.find((t=>0===t[or].tabIndex))??null,this.lastActiveRecord&&(this.lastActiveRecord[or].tabIndex=-1),this.typeahead(t)))}typeahead(t){if(t.defaultPrevented)return;if(clearTimeout(this.cancelTypeaheadTimeout),"Enter"===t.code||t.code.startsWith("Arrow")||"Escape"===t.code)return this.endTypeahead(),void(this.lastActiveRecord&&(this.lastActiveRecord[or].tabIndex=-1));"Space"===t.code&&t.preventDefault(),this.cancelTypeaheadTimeout=setTimeout(this.endTypeahead,this.getProperties().typeaheadBufferTime),this.typaheadBuffer+=t.key.toLowerCase();const e=this.lastActiveRecord?this.lastActiveRecord[rr]:-1,i=this.typeaheadRecords.length,r=t=>(t[rr]+i-e)%i,o=this.typeaheadRecords.filter((t=>!t[or].disabled&&t[sr].startsWith(this.typaheadBuffer))).sort(((t,e)=>r(t)-r(e)));if(0===o.length)return clearTimeout(this.cancelTypeaheadTimeout),this.lastActiveRecord&&(this.lastActiveRecord[or].tabIndex=-1),void this.endTypeahead();const s=1===this.typaheadBuffer.length;let n;n=this.lastActiveRecord===o[0]&&s?o[1]??o[0]:o[0],this.lastActiveRecord&&(this.lastActiveRecord[or].tabIndex=-1),this.lastActiveRecord=n,n[or].tabIndex=0,n[or].focus()}} +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */const ar=new Set([ge.ArrowDown,ge.ArrowUp,ge.Home,ge.End]),lr=new Set([ge.ArrowLeft,ge.ArrowRight,...ar]);class dr extends ht{get openDirection(){return"start"===this.menuCorner.split("-")[0]?"DOWN":"UP"}get anchorElement(){return this.anchor?this.getRootNode().querySelector(`#${this.anchor}`):this.currentAnchorElement}set anchorElement(t){this.currentAnchorElement=t,this.requestUpdate("anchorElement")}constructor(){super(),this.anchor="",this.positioning="absolute",this.quick=!1,this.hasOverflow=!1,this.open=!1,this.xOffset=0,this.yOffset=0,this.typeaheadDelay=200,this.anchorCorner=tr,this.menuCorner=er,this.stayOpenOnOutsideClick=!1,this.stayOpenOnFocusout=!1,this.skipRestoreFocus=!1,this.defaultFocus=Vi,this.typeaheadActive=!0,this.isSubmenu=!1,this.pointerPath=[],this.isRepositioning=!1,this.openCloseAnimationSignal=function(){let t=null;return{start:()=>(t?.abort(),t=new AbortController,t.signal),finish(){t=null}}} +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */(),this.listController=new fe({isItem:t=>t.hasAttribute("md-menu-item"),getPossibleItems:()=>this.slotItems,isRtl:()=>"rtl"===getComputedStyle(this).direction,deactivateItem:t=>{t.selected=!1,t.tabIndex=-1},activateItem:t=>{t.selected=!0,t.tabIndex=0},isNavigableKey:t=>{if(!this.isSubmenu)return lr.has(t);return t===("rtl"===getComputedStyle(this).direction?ge.ArrowLeft:ge.ArrowRight)||ar.has(t)}}),this.lastFocusedElement=null,this.typeaheadController=new nr((()=>({getItems:()=>this.items,typeaheadBufferTime:this.typeaheadDelay,active:this.typeaheadActive}))),this.currentAnchorElement=null,this.internals=this.attachInternals(),this.menuPositionController=new ir(this,(()=>({anchorCorner:this.anchorCorner,surfaceCorner:this.menuCorner,surfaceEl:this.surfaceEl,anchorEl:this.anchorElement,positioning:"popover"===this.positioning?"document":this.positioning,isOpen:this.open,xOffset:this.xOffset,yOffset:this.yOffset,onOpen:this.onOpened,beforeClose:this.beforeClose,onClose:this.onClosed,repositionStrategy:this.hasOverflow&&"popover"!==this.positioning?"move":"resize"}))),this.onWindowResize=()=>{this.isRepositioning||"document"!==this.positioning&&"fixed"!==this.positioning&&"popover"!==this.positioning||(this.isRepositioning=!0,this.reposition(),this.isRepositioning=!1)},this.handleFocusout=async t=>{const e=this.anchorElement;if(this.stayOpenOnFocusout||!this.open||this.pointerPath.includes(e))return;if(t.relatedTarget){if(Wi(t.relatedTarget,this)||0!==this.pointerPath.length&&Wi(t.relatedTarget,e))return}else if(this.pointerPath.includes(this))return;const i=this.skipRestoreFocus;this.skipRestoreFocus=!0,this.close(),await this.updateComplete,this.skipRestoreFocus=i},this.onOpened=async()=>{this.lastFocusedElement=function(){let t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).activeElement;for(;t&&t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}();const t=this.items,e=le(t);e&&this.defaultFocus!==Zi&&(e.item.tabIndex=-1);let i=!this.quick;switch(this.quick?this.dispatchEvent(new Event("opening")):i=!!await this.animateOpen(),this.defaultFocus){case Vi:const e=de(t);e&&(e.tabIndex=0,e.focus(),await e.updateComplete);break;case Xi:const i=ce(t);i&&(i.tabIndex=0,i.focus(),await i.updateComplete);break;case qi:this.focus()}i||this.dispatchEvent(new Event("opened"))},this.beforeClose=async()=>{this.open=!1,this.skipRestoreFocus||this.lastFocusedElement?.focus?.(),this.quick||await this.animateClose()},this.onClosed=()=>{this.quick&&(this.dispatchEvent(new Event("closing")),this.dispatchEvent(new Event("closed")))},this.onWindowPointerdown=t=>{this.pointerPath=t.composedPath()},this.onDocumentClick=t=>{if(!this.open)return;const e=t.composedPath();this.stayOpenOnOutsideClick||e.includes(this)||e.includes(this.anchorElement)||(this.open=!1)},this.internals.role="menu",this.addEventListener("keydown",this.handleKeydown),this.addEventListener("keydown",this.captureKeydown,{capture:!0}),this.addEventListener("focusout",this.handleFocusout)}get items(){return this.listController.items}willUpdate(t){t.has("open")&&(this.open?this.removeAttribute("aria-hidden"):this.setAttribute("aria-hidden","true"))}update(t){t.has("open")&&(this.open?this.setUpGlobalEventListeners():this.cleanUpGlobalEventListeners()),t.has("positioning")&&"popover"===this.positioning&&!this.showPopover&&(this.positioning="fixed"),super.update(t)}connectedCallback(){super.connectedCallback(),this.open&&this.setUpGlobalEventListeners()}disconnectedCallback(){super.disconnectedCallback(),this.cleanUpGlobalEventListeners()}render(){return this.renderSurface()}renderSurface(){return J` + + `}renderMenuItems(){return J``}renderElevation(){return J``}getSurfaceClasses(){return{open:this.open,fixed:"fixed"===this.positioning,"has-overflow":this.hasOverflow}}captureKeydown(t){t.target===this&&!t.defaultPrevented&&ji(t.code)&&(t.preventDefault(),this.close()),this.typeaheadController.onKeydown(t)}async animateOpen(){const t=this.surfaceEl,e=this.slotEl;if(!t||!e)return!0;const i=this.openDirection;this.dispatchEvent(new Event("opening")),t.classList.toggle("animating",!0);const r=this.openCloseAnimationSignal.start(),o=t.offsetHeight,s="UP"===i,n=this.items,a=250/n.length,l=t.animate([{height:"0px"},{height:`${o}px`}],{duration:500,easing:Pt}),d=e.animate([{transform:s?`translateY(-${o}px)`:""},{transform:""}],{duration:500,easing:Pt}),c=t.animate([{opacity:0},{opacity:1}],50),h=[];for(let t=0;t{e.classList.toggle("md-menu-hidden",!1)})),h.push([e,i])}let A=t=>{};const p=new Promise((t=>{A=t}));return r.addEventListener("abort",(()=>{l.cancel(),d.cancel(),c.cancel(),h.forEach((t=>{let[e,i]=t;e.classList.toggle("md-menu-hidden",!1),i.cancel()})),A(!0)})),l.addEventListener("finish",(()=>{t.classList.toggle("animating",!1),this.openCloseAnimationSignal.finish(),A(!1)})),await p}animateClose(){let t,e;const i=new Promise(((i,r)=>{t=i,e=r})),r=this.surfaceEl,o=this.slotEl;if(!r||!o)return e(),i;const s="UP"===this.openDirection;this.dispatchEvent(new Event("closing")),r.classList.toggle("animating",!0);const n=this.openCloseAnimationSignal.start(),a=r.offsetHeight,l=this.items,d=150,c=50/l.length,h=r.animate([{height:`${a}px`},{height:.35*a+"px"}],{duration:d,easing:Ht}),A=o.animate([{transform:""},{transform:s?`translateY(-${.65*a}px)`:""}],{duration:d,easing:Ht}),p=r.animate([{opacity:1},{opacity:0}],{duration:50,delay:100}),g=[];for(let t=0;t{e.classList.toggle("md-menu-hidden",!0)})),g.push([e,i])}return n.addEventListener("abort",(()=>{h.cancel(),A.cancel(),p.cancel(),g.forEach((t=>{let[e,i]=t;i.cancel(),e.classList.toggle("md-menu-hidden",!1)})),e()})),h.addEventListener("finish",(()=>{r.classList.toggle("animating",!1),g.forEach((t=>{let[e]=t;e.classList.toggle("md-menu-hidden",!1)})),this.openCloseAnimationSignal.finish(),this.dispatchEvent(new Event("closed")),t(!0)})),i}handleKeydown(t){this.pointerPath=[],this.listController.handleKeydown(t)}setUpGlobalEventListeners(){document.addEventListener("click",this.onDocumentClick,{capture:!0}),window.addEventListener("pointerdown",this.onWindowPointerdown),document.addEventListener("resize",this.onWindowResize,{passive:!0}),window.addEventListener("resize",this.onWindowResize,{passive:!0})}cleanUpGlobalEventListeners(){document.removeEventListener("click",this.onDocumentClick,{capture:!0}),window.removeEventListener("pointerdown",this.onWindowPointerdown),document.removeEventListener("resize",this.onWindowResize),window.removeEventListener("resize",this.onWindowResize)}onCloseMenu(){this.close()}onDeactivateItems(t){t.stopPropagation(),this.listController.onDeactivateItems()}onRequestActivation(t){t.stopPropagation(),this.listController.onRequestActivation(t)}handleDeactivateTypeahead(t){t.stopPropagation(),this.typeaheadActive=!1}handleActivateTypeahead(t){t.stopPropagation(),this.typeaheadActive=!0}handleStayOpenOnFocusout(t){t.stopPropagation(),this.stayOpenOnFocusout=!0}handleCloseOnFocusout(t){t.stopPropagation(),this.stayOpenOnFocusout=!1}close(){this.open=!1;this.slotItems.forEach((t=>{t.close?.()}))}show(){this.open=!0}activateNextItem(){return this.listController.activateNextItem()??null}activatePreviousItem(){return this.listController.activatePreviousItem()??null}reposition(){this.open&&this.menuPositionController.position()}}r([vt(".menu")],dr.prototype,"surfaceEl",void 0),r([vt("slot")],dr.prototype,"slotEl",void 0),r([ft()],dr.prototype,"anchor",void 0),r([ft()],dr.prototype,"positioning",void 0),r([ft({type:Boolean})],dr.prototype,"quick",void 0),r([ft({type:Boolean,attribute:"has-overflow"})],dr.prototype,"hasOverflow",void 0),r([ft({type:Boolean,reflect:!0})],dr.prototype,"open",void 0),r([ft({type:Number,attribute:"x-offset"})],dr.prototype,"xOffset",void 0),r([ft({type:Number,attribute:"y-offset"})],dr.prototype,"yOffset",void 0),r([ft({type:Number,attribute:"typeahead-delay"})],dr.prototype,"typeaheadDelay",void 0),r([ft({attribute:"anchor-corner"})],dr.prototype,"anchorCorner",void 0),r([ft({attribute:"menu-corner"})],dr.prototype,"menuCorner",void 0),r([ft({type:Boolean,attribute:"stay-open-on-outside-click"})],dr.prototype,"stayOpenOnOutsideClick",void 0),r([ft({type:Boolean,attribute:"stay-open-on-focusout"})],dr.prototype,"stayOpenOnFocusout",void 0),r([ft({type:Boolean,attribute:"skip-restore-focus"})],dr.prototype,"skipRestoreFocus",void 0),r([ft({attribute:"default-focus"})],dr.prototype,"defaultFocus",void 0),r([yt({flatten:!0})],dr.prototype,"slotItems",void 0),r([ut()],dr.prototype,"typeaheadActive",void 0); +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +const cr=d`:host{--md-elevation-level: var(--md-menu-container-elevation, 2);--md-elevation-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));min-width:112px;color:unset;display:contents}md-focus-ring{--md-focus-ring-shape: var(--md-menu-container-shape, 4px)}.menu{border-radius:var(--md-menu-container-shape, 4px);display:none;inset:auto;border:none;padding:0px;overflow:visible;background-color:rgba(0,0,0,0);color:inherit;opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit;max-width:inherit}.menu::backdrop{display:none}.fixed{position:fixed}.items{display:block;list-style-type:none;margin:0;outline:none;box-sizing:border-box;background-color:var(--md-menu-container-color, var(--md-sys-color-surface-container, #f3edf7));height:inherit;max-height:inherit;overflow:auto;min-width:inherit;max-width:inherit;border-radius:inherit}.item-padding{padding-block:8px}.has-overflow:not([popover]) .items{overflow:visible}.has-overflow.animating .items,.animating .items{overflow:hidden}.has-overflow.animating .items{pointer-events:none}.animating ::slotted(.md-menu-hidden){opacity:0}slot{display:block;height:inherit;max-height:inherit}::slotted(:is(md-divider,[role=separator])){margin:8px 0}@media(forced-colors: active){.menu{border-style:solid;border-color:CanvasText;border-width:1px}}/*# sourceMappingURL=menu-styles.css.map */ +` +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */;let hr=class extends dr{};hr.styles=[cr],hr=r([pt("md-menu")],hr); +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +class Ar extends Ne{computeValidity(t){return this.selectControl||(this.selectControl=document.createElement("select")),ct(J``,this.selectControl),this.selectControl.value=t.value,this.selectControl.required=t.required,{validity:this.selectControl.validity,validationMessage:this.selectControl.validationMessage}}equals(t,e){return t.value===e.value&&t.required===e.required}copy(t){let{value:e,required:i}=t;return{value:e,required:i}}} +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +var pr;const gr=Symbol("value"),fr=Di(Ge(Ye(Zt(ht))));class ur extends fr{get value(){return this[gr]}set value(t){this.lastUserSetValue=t,this.select(t)}get options(){return this.menu?.items??[]}get selectedIndex(){const[t,e]=(this.getSelectedOptions()??[])[0]??[];return e??-1}set selectedIndex(t){this.lastUserSetSelectedIndex=t,this.selectIndex(t)}get selectedOptions(){return(this.getSelectedOptions()??[]).map((t=>{let[e]=t;return e}))}get hasError(){return this.error||this.nativeError}constructor(){super(),this.quick=!1,this.required=!1,this.errorText="",this.label="",this.supportingText="",this.error=!1,this.menuPositioning="popover",this.clampMenuWidth=!1,this.typeaheadDelay=200,this.hasLeadingIcon=!1,this.displayText="",this.menuAlign="start",this[pr]="",this.lastUserSetValue=null,this.lastUserSetSelectedIndex=null,this.lastSelectedOption=null,this.lastSelectedOptionRecords=[],this.nativeError=!1,this.nativeErrorText="",this.focused=!1,this.open=!1,this.defaultFocus=Zi,this.prevOpen=this.open,this.selectWidth=0,this.addEventListener("focus",this.handleFocus.bind(this)),this.addEventListener("blur",this.handleBlur.bind(this))}select(t){const e=this.options.find((e=>e.value===t));e&&this.selectItem(e)}selectIndex(t){const e=this.options[t];e&&this.selectItem(e)}reset(){for(const t of this.options)t.selected=t.hasAttribute("selected");this.updateValueAndDisplayText(),this.nativeError=!1,this.nativeErrorText=""}[(pr=gr,Ii)](t){t?.preventDefault();const e=this.getErrorText();this.nativeError=!!t,this.nativeErrorText=this.validationMessage,e===this.getErrorText()&&this.field?.reannounceError()}update(t){if(this.hasUpdated||this.initUserSelection(),this.prevOpen!==this.open&&this.open){const t=this.getBoundingClientRect();this.selectWidth=t.width}this.prevOpen=this.open,super.update(t)}render(){return J` + + ${this.renderField()} ${this.renderMenu()} + + `}async firstUpdated(t){await(this.menu?.updateComplete),this.lastSelectedOptionRecords.length||this.initUserSelection(),this.lastSelectedOptionRecords.length||this.options.length||setTimeout((()=>{this.updateValueAndDisplayText()})),super.firstUpdated(t)}getRenderClasses(){return{disabled:this.disabled,error:this.error,open:this.open}}renderField(){return Se` + <${this.fieldTag} + aria-haspopup="listbox" + role="combobox" + part="field" + id="field" + tabindex=${this.disabled?"-1":"0"} + aria-label=${this.ariaLabel||W} + aria-describedby="description" + aria-expanded=${this.open?"true":"false"} + aria-controls="listbox" + class="field" + label=${this.label} + .focused=${this.focused||this.open} + .populated=${!!this.displayText} + .disabled=${this.disabled} + .required=${this.required} + .error=${this.hasError} + ?has-start=${this.hasLeadingIcon} + has-end + supporting-text=${this.supportingText} + error-text=${this.getErrorText()} + @keydown=${this.handleKeydown} + @click=${this.handleClick}> + ${this.renderFieldContent()} +
+ `}renderFieldContent(){return[this.renderLeadingIcon(),this.renderLabel(),this.renderTrailingIcon()]}renderLeadingIcon(){return J` + + + + `}renderTrailingIcon(){return J` + + + + + + + + + `}renderLabel(){return J`
${this.displayText||J` `}
`}renderMenu(){const t=this.label||this.ariaLabel;return J``}renderMenuContent(){return J``}handleKeydown(t){if(this.open||this.disabled||!this.menu)return;const e=this.menu.typeaheadController,i="Space"===t.code||"ArrowDown"===t.code||"ArrowUp"===t.code||"End"===t.code||"Home"===t.code||"Enter"===t.code;if(!e.isTypingAhead&&i){switch(t.preventDefault(),this.open=!0,t.code){case"Space":case"ArrowDown":case"Enter":this.defaultFocus=Zi;break;case"End":this.defaultFocus=Xi;break;case"ArrowUp":case"Home":this.defaultFocus=Vi}return}if(1===t.key.length){e.onKeydown(t),t.preventDefault();const{lastActiveRecord:i}=e;if(!i)return;this.labelEl?.setAttribute?.("aria-live","polite");this.selectItem(i[or])&&this.dispatchInteractionEvents()}}handleClick(){this.open=!this.open}handleFocus(){this.focused=!0}handleBlur(){this.focused=!1}handleFocusout(t){t.relatedTarget&&Wi(t.relatedTarget,this)||(this.open=!1)}getSelectedOptions(){if(!this.menu)return this.lastSelectedOptionRecords=[],null;const t=this.menu.items;return this.lastSelectedOptionRecords=function(t){const e=[];for(let i=0;ie===t))}(e.key)?r=this.selectItem(i):(i.tabIndex=-1,i.blur()),r&&this.dispatchInteractionEvents()}selectItem(t){return(this.getSelectedOptions()??[]).forEach((e=>{let[i]=e;t!==i&&(i.selected=!1)})),t.selected=!0,this.updateValueAndDisplayText()}handleRequestSelection(t){const e=t.target;this.lastSelectedOptionRecords.some((t=>{let[i]=t;return i===e}))||this.selectItem(e)}handleRequestDeselection(t){const e=t.target;this.lastSelectedOptionRecords.some((t=>{let[i]=t;return i===e}))&&this.updateValueAndDisplayText()}initUserSelection(){this.lastUserSetValue&&!this.lastSelectedOptionRecords.length?this.select(this.lastUserSetValue):null===this.lastUserSetSelectedIndex||this.lastSelectedOptionRecords.length?this.updateValueAndDisplayText():this.selectIndex(this.lastUserSetSelectedIndex)}handleIconChange(){this.hasLeadingIcon=this.leadingIcons.length>0}dispatchInteractionEvents(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0}))}getErrorText(){return this.error?this.errorText:this.nativeErrorText}[ze](){return this.value}formResetCallback(){this.reset()}formStateRestoreCallback(t){this.value=t}[Oe](){return new Ar((()=>this))}[Pe](){return this.field}}$t(ur),ur.shadowRootOptions={...ht.shadowRootOptions,delegatesFocus:!0},r([ft({type:Boolean})],ur.prototype,"quick",void 0),r([ft({type:Boolean})],ur.prototype,"required",void 0),r([ft({type:String,attribute:"error-text"})],ur.prototype,"errorText",void 0),r([ft()],ur.prototype,"label",void 0),r([ft({type:String,attribute:"supporting-text"})],ur.prototype,"supportingText",void 0),r([ft({type:Boolean,reflect:!0})],ur.prototype,"error",void 0),r([ft({attribute:"menu-positioning"})],ur.prototype,"menuPositioning",void 0),r([ft({type:Boolean,attribute:"clamp-menu-width"})],ur.prototype,"clampMenuWidth",void 0),r([ft({type:Number,attribute:"typeahead-delay"})],ur.prototype,"typeaheadDelay",void 0),r([ft({type:Boolean,attribute:"has-leading-icon"})],ur.prototype,"hasLeadingIcon",void 0),r([ft({attribute:"display-text"})],ur.prototype,"displayText",void 0),r([ft({attribute:"menu-align"})],ur.prototype,"menuAlign",void 0),r([ft()],ur.prototype,"value",null),r([ft({type:Number,attribute:"selected-index"})],ur.prototype,"selectedIndex",null),r([ut()],ur.prototype,"nativeError",void 0),r([ut()],ur.prototype,"nativeErrorText",void 0),r([ut()],ur.prototype,"focused",void 0),r([ut()],ur.prototype,"open",void 0),r([ut()],ur.prototype,"defaultFocus",void 0),r([vt(".field")],ur.prototype,"field",void 0),r([vt("md-menu")],ur.prototype,"menu",void 0),r([vt("#label")],ur.prototype,"labelEl",void 0),r([yt({slot:"leading-icon",flatten:!0})],ur.prototype,"leadingIcons",void 0); +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +class mr extends ur{constructor(){super(...arguments),this.fieldTag=Ie`md-filled-field`}} +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */const vr=d`:host{--_text-field-active-indicator-color: var(--md-filled-select-text-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-active-indicator-height: var(--md-filled-select-text-field-active-indicator-height, 1px);--_text-field-container-color: var(--md-filled-select-text-field-container-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_text-field-container-shape-start-start: var( --md-filled-select-text-field-container-shape-start-start, var( --md-filled-select-text-field-container-shape, 4px ) );--_text-field-container-shape-start-end: var( --md-filled-select-text-field-container-shape-start-end, var( --md-filled-select-text-field-container-shape, 4px ) );--_text-field-container-shape-end-end: var( --md-filled-select-text-field-container-shape-end-end, var( --md-filled-select-text-field-container-shape, 0px ) );--_text-field-container-shape-end-start: var( --md-filled-select-text-field-container-shape-end-start, var( --md-filled-select-text-field-container-shape, 0px ) );--_text-field-disabled-active-indicator-color: var(--md-filled-select-text-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-active-indicator-height: var(--md-filled-select-text-field-disabled-active-indicator-height, 1px);--_text-field-disabled-active-indicator-opacity: var(--md-filled-select-text-field-disabled-active-indicator-opacity, 0.38);--_text-field-disabled-container-color: var(--md-filled-select-text-field-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-container-opacity: var(--md-filled-select-text-field-disabled-container-opacity, 0.04);--_text-field-disabled-input-text-color: var(--md-filled-select-text-field-disabled-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-input-text-opacity: var(--md-filled-select-text-field-disabled-input-text-opacity, 0.38);--_text-field-disabled-label-text-color: var(--md-filled-select-text-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-label-text-opacity: var(--md-filled-select-text-field-disabled-label-text-opacity, 0.38);--_text-field-disabled-leading-icon-color: var(--md-filled-select-text-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-leading-icon-opacity: var(--md-filled-select-text-field-disabled-leading-icon-opacity, 0.38);--_text-field-disabled-supporting-text-color: var(--md-filled-select-text-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-supporting-text-opacity: var(--md-filled-select-text-field-disabled-supporting-text-opacity, 0.38);--_text-field-disabled-trailing-icon-color: var(--md-filled-select-text-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-trailing-icon-opacity: var(--md-filled-select-text-field-disabled-trailing-icon-opacity, 0.38);--_text-field-error-active-indicator-color: var(--md-filled-select-text-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-active-indicator-color: var(--md-filled-select-text-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-input-text-color: var(--md-filled-select-text-field-error-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-focus-label-text-color: var(--md-filled-select-text-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-leading-icon-color: var(--md-filled-select-text-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-focus-supporting-text-color: var(--md-filled-select-text-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-trailing-icon-color: var(--md-filled-select-text-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_text-field-error-hover-active-indicator-color: var(--md-filled-select-text-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-hover-input-text-color: var(--md-filled-select-text-field-error-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-hover-label-text-color: var(--md-filled-select-text-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-hover-leading-icon-color: var(--md-filled-select-text-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-hover-state-layer-color: var(--md-filled-select-text-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-hover-state-layer-opacity: var(--md-filled-select-text-field-error-hover-state-layer-opacity, 0.08);--_text-field-error-hover-supporting-text-color: var(--md-filled-select-text-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-hover-trailing-icon-color: var(--md-filled-select-text-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-input-text-color: var(--md-filled-select-text-field-error-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-label-text-color: var(--md-filled-select-text-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-leading-icon-color: var(--md-filled-select-text-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-supporting-text-color: var(--md-filled-select-text-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-trailing-icon-color: var(--md-filled-select-text-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_text-field-focus-active-indicator-color: var(--md-filled-select-text-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_text-field-focus-active-indicator-height: var(--md-filled-select-text-field-focus-active-indicator-height, 3px);--_text-field-focus-input-text-color: var(--md-filled-select-text-field-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-focus-label-text-color: var(--md-filled-select-text-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_text-field-focus-leading-icon-color: var(--md-filled-select-text-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-focus-supporting-text-color: var(--md-filled-select-text-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-focus-trailing-icon-color: var(--md-filled-select-text-field-focus-trailing-icon-color, var(--md-sys-color-primary, #6750a4));--_text-field-hover-active-indicator-color: var(--md-filled-select-text-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-active-indicator-height: var(--md-filled-select-text-field-hover-active-indicator-height, 1px);--_text-field-hover-input-text-color: var(--md-filled-select-text-field-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-label-text-color: var(--md-filled-select-text-field-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-leading-icon-color: var(--md-filled-select-text-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-hover-state-layer-color: var(--md-filled-select-text-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-state-layer-opacity: var(--md-filled-select-text-field-hover-state-layer-opacity, 0.08);--_text-field-hover-supporting-text-color: var(--md-filled-select-text-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-hover-trailing-icon-color: var(--md-filled-select-text-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-input-text-color: var(--md-filled-select-text-field-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-input-text-font: var(--md-filled-select-text-field-input-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_text-field-input-text-line-height: var(--md-filled-select-text-field-input-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_text-field-input-text-size: var(--md-filled-select-text-field-input-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_text-field-input-text-weight: var(--md-filled-select-text-field-input-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_text-field-label-text-color: var(--md-filled-select-text-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-label-text-font: var(--md-filled-select-text-field-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_text-field-label-text-line-height: var(--md-filled-select-text-field-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_text-field-label-text-populated-line-height: var(--md-filled-select-text-field-label-text-populated-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_text-field-label-text-populated-size: var(--md-filled-select-text-field-label-text-populated-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_text-field-label-text-size: var(--md-filled-select-text-field-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_text-field-label-text-weight: var(--md-filled-select-text-field-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_text-field-leading-icon-color: var(--md-filled-select-text-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-leading-icon-size: var(--md-filled-select-text-field-leading-icon-size, 24px);--_text-field-supporting-text-color: var(--md-filled-select-text-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-supporting-text-font: var(--md-filled-select-text-field-supporting-text-font, var(--md-sys-typescale-body-small-font, var(--md-ref-typeface-plain, Roboto)));--_text-field-supporting-text-line-height: var(--md-filled-select-text-field-supporting-text-line-height, var(--md-sys-typescale-body-small-line-height, 1rem));--_text-field-supporting-text-size: var(--md-filled-select-text-field-supporting-text-size, var(--md-sys-typescale-body-small-size, 0.75rem));--_text-field-supporting-text-weight: var(--md-filled-select-text-field-supporting-text-weight, var(--md-sys-typescale-body-small-weight, var(--md-ref-typeface-weight-regular, 400)));--_text-field-trailing-icon-color: var(--md-filled-select-text-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-trailing-icon-size: var(--md-filled-select-text-field-trailing-icon-size, 24px);--md-filled-field-active-indicator-color: var(--_text-field-active-indicator-color);--md-filled-field-active-indicator-height: var(--_text-field-active-indicator-height);--md-filled-field-container-color: var(--_text-field-container-color);--md-filled-field-container-shape-end-end: var(--_text-field-container-shape-end-end);--md-filled-field-container-shape-end-start: var(--_text-field-container-shape-end-start);--md-filled-field-container-shape-start-end: var(--_text-field-container-shape-start-end);--md-filled-field-container-shape-start-start: var(--_text-field-container-shape-start-start);--md-filled-field-content-color: var(--_text-field-input-text-color);--md-filled-field-content-font: var(--_text-field-input-text-font);--md-filled-field-content-line-height: var(--_text-field-input-text-line-height);--md-filled-field-content-size: var(--_text-field-input-text-size);--md-filled-field-content-weight: var(--_text-field-input-text-weight);--md-filled-field-disabled-active-indicator-color: var(--_text-field-disabled-active-indicator-color);--md-filled-field-disabled-active-indicator-height: var(--_text-field-disabled-active-indicator-height);--md-filled-field-disabled-active-indicator-opacity: var(--_text-field-disabled-active-indicator-opacity);--md-filled-field-disabled-container-color: var(--_text-field-disabled-container-color);--md-filled-field-disabled-container-opacity: var(--_text-field-disabled-container-opacity);--md-filled-field-disabled-content-color: var(--_text-field-disabled-input-text-color);--md-filled-field-disabled-content-opacity: var(--_text-field-disabled-input-text-opacity);--md-filled-field-disabled-label-text-color: var(--_text-field-disabled-label-text-color);--md-filled-field-disabled-label-text-opacity: var(--_text-field-disabled-label-text-opacity);--md-filled-field-disabled-leading-content-color: var(--_text-field-disabled-leading-icon-color);--md-filled-field-disabled-leading-content-opacity: var(--_text-field-disabled-leading-icon-opacity);--md-filled-field-disabled-supporting-text-color: var(--_text-field-disabled-supporting-text-color);--md-filled-field-disabled-supporting-text-opacity: var(--_text-field-disabled-supporting-text-opacity);--md-filled-field-disabled-trailing-content-color: var(--_text-field-disabled-trailing-icon-color);--md-filled-field-disabled-trailing-content-opacity: var(--_text-field-disabled-trailing-icon-opacity);--md-filled-field-error-active-indicator-color: var(--_text-field-error-active-indicator-color);--md-filled-field-error-content-color: var(--_text-field-error-input-text-color);--md-filled-field-error-focus-active-indicator-color: var(--_text-field-error-focus-active-indicator-color);--md-filled-field-error-focus-content-color: var(--_text-field-error-focus-input-text-color);--md-filled-field-error-focus-label-text-color: var(--_text-field-error-focus-label-text-color);--md-filled-field-error-focus-leading-content-color: var(--_text-field-error-focus-leading-icon-color);--md-filled-field-error-focus-supporting-text-color: var(--_text-field-error-focus-supporting-text-color);--md-filled-field-error-focus-trailing-content-color: var(--_text-field-error-focus-trailing-icon-color);--md-filled-field-error-hover-active-indicator-color: var(--_text-field-error-hover-active-indicator-color);--md-filled-field-error-hover-content-color: var(--_text-field-error-hover-input-text-color);--md-filled-field-error-hover-label-text-color: var(--_text-field-error-hover-label-text-color);--md-filled-field-error-hover-leading-content-color: var(--_text-field-error-hover-leading-icon-color);--md-filled-field-error-hover-state-layer-color: var(--_text-field-error-hover-state-layer-color);--md-filled-field-error-hover-state-layer-opacity: var(--_text-field-error-hover-state-layer-opacity);--md-filled-field-error-hover-supporting-text-color: var(--_text-field-error-hover-supporting-text-color);--md-filled-field-error-hover-trailing-content-color: var(--_text-field-error-hover-trailing-icon-color);--md-filled-field-error-label-text-color: var(--_text-field-error-label-text-color);--md-filled-field-error-leading-content-color: var(--_text-field-error-leading-icon-color);--md-filled-field-error-supporting-text-color: var(--_text-field-error-supporting-text-color);--md-filled-field-error-trailing-content-color: var(--_text-field-error-trailing-icon-color);--md-filled-field-focus-active-indicator-color: var(--_text-field-focus-active-indicator-color);--md-filled-field-focus-active-indicator-height: var(--_text-field-focus-active-indicator-height);--md-filled-field-focus-content-color: var(--_text-field-focus-input-text-color);--md-filled-field-focus-label-text-color: var(--_text-field-focus-label-text-color);--md-filled-field-focus-leading-content-color: var(--_text-field-focus-leading-icon-color);--md-filled-field-focus-supporting-text-color: var(--_text-field-focus-supporting-text-color);--md-filled-field-focus-trailing-content-color: var(--_text-field-focus-trailing-icon-color);--md-filled-field-hover-active-indicator-color: var(--_text-field-hover-active-indicator-color);--md-filled-field-hover-active-indicator-height: var(--_text-field-hover-active-indicator-height);--md-filled-field-hover-content-color: var(--_text-field-hover-input-text-color);--md-filled-field-hover-label-text-color: var(--_text-field-hover-label-text-color);--md-filled-field-hover-leading-content-color: var(--_text-field-hover-leading-icon-color);--md-filled-field-hover-state-layer-color: var(--_text-field-hover-state-layer-color);--md-filled-field-hover-state-layer-opacity: var(--_text-field-hover-state-layer-opacity);--md-filled-field-hover-supporting-text-color: var(--_text-field-hover-supporting-text-color);--md-filled-field-hover-trailing-content-color: var(--_text-field-hover-trailing-icon-color);--md-filled-field-label-text-color: var(--_text-field-label-text-color);--md-filled-field-label-text-font: var(--_text-field-label-text-font);--md-filled-field-label-text-line-height: var(--_text-field-label-text-line-height);--md-filled-field-label-text-populated-line-height: var(--_text-field-label-text-populated-line-height);--md-filled-field-label-text-populated-size: var(--_text-field-label-text-populated-size);--md-filled-field-label-text-size: var(--_text-field-label-text-size);--md-filled-field-label-text-weight: var(--_text-field-label-text-weight);--md-filled-field-leading-content-color: var(--_text-field-leading-icon-color);--md-filled-field-supporting-text-color: var(--_text-field-supporting-text-color);--md-filled-field-supporting-text-font: var(--_text-field-supporting-text-font);--md-filled-field-supporting-text-line-height: var(--_text-field-supporting-text-line-height);--md-filled-field-supporting-text-size: var(--_text-field-supporting-text-size);--md-filled-field-supporting-text-weight: var(--_text-field-supporting-text-weight);--md-filled-field-trailing-content-color: var(--_text-field-trailing-icon-color)}[has-start] .icon.leading{font-size:var(--_text-field-leading-icon-size);height:var(--_text-field-leading-icon-size);width:var(--_text-field-leading-icon-size)}.icon.trailing{font-size:var(--_text-field-trailing-icon-size);height:var(--_text-field-trailing-icon-size);width:var(--_text-field-trailing-icon-size)}/*# sourceMappingURL=filled-select-styles.css.map */ +` +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */,wr=d`:host{color:unset;min-width:210px;display:flex}.field{cursor:default;outline:none}.select{position:relative;flex-direction:column}.icon.trailing svg,.icon ::slotted(*){fill:currentColor}.icon ::slotted(*){width:inherit;height:inherit;font-size:inherit}.icon slot{display:flex;height:100%;width:100%;align-items:center;justify-content:center}.icon.trailing :is(.up,.down){opacity:0;transition:opacity 75ms linear 75ms}.select:not(.open) .down,.select.open .up{opacity:1}.field,.select,md-menu{min-width:inherit;width:inherit;max-width:inherit;display:flex}md-menu{min-width:var(--__menu-min-width);max-width:var(--__menu-max-width, inherit)}.menu-wrapper{width:0px;height:0px;max-width:inherit}md-menu ::slotted(:not[disabled]){cursor:pointer}.field,.select{width:100%}:host{display:inline-flex}:host([disabled]){pointer-events:none}/*# sourceMappingURL=shared-styles.css.map */ +`;class yr extends mr{}yr.styles=[wr,vr],customElements.define("ew-filled-select",yr); +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +const br=d`:host{display:flex;--md-ripple-hover-color: var(--md-menu-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-menu-item-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-menu-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity: var(--md-menu-item-pressed-state-layer-opacity, 0.12)}:host([disabled]){opacity:var(--md-menu-item-disabled-opacity, 0.3);pointer-events:none}md-focus-ring{z-index:1;--md-focus-ring-shape: 8px}a,button,li{background:none;border:none;padding:0;margin:0;text-align:unset;text-decoration:none}.list-item{border-radius:inherit;display:flex;flex:1;max-width:inherit;min-width:inherit;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.list-item:not(.disabled){cursor:pointer}[slot=container]{pointer-events:none}md-ripple{border-radius:inherit}md-item{border-radius:inherit;flex:1;color:var(--md-menu-item-label-text-color, var(--md-sys-color-on-surface, #1d1b20));font-family:var(--md-menu-item-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-menu-item-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));line-height:var(--md-menu-item-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));font-weight:var(--md-menu-item-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));min-height:var(--md-menu-item-one-line-container-height, 56px);padding-top:var(--md-menu-item-top-space, 12px);padding-bottom:var(--md-menu-item-bottom-space, 12px);padding-inline-start:var(--md-menu-item-leading-space, 16px);padding-inline-end:var(--md-menu-item-trailing-space, 16px)}md-item[multiline]{min-height:var(--md-menu-item-two-line-container-height, 72px)}[slot=supporting-text]{color:var(--md-menu-item-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-menu-item-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-menu-item-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-menu-item-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-menu-item-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)))}[slot=trailing-supporting-text]{color:var(--md-menu-item-trailing-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-menu-item-trailing-supporting-text-font, var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-menu-item-trailing-supporting-text-size, var(--md-sys-typescale-label-small-size, 0.6875rem));line-height:var(--md-menu-item-trailing-supporting-text-line-height, var(--md-sys-typescale-label-small-line-height, 1rem));font-weight:var(--md-menu-item-trailing-supporting-text-weight, var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500)))}:is([slot=start],[slot=end])::slotted(*){fill:currentColor}[slot=start]{color:var(--md-menu-item-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}[slot=end]{color:var(--md-menu-item-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f))}.list-item{background-color:var(--md-menu-item-container-color, transparent)}.list-item.selected{background-color:var(--md-menu-item-selected-container-color, var(--md-sys-color-secondary-container, #e8def8))}.selected:not(.disabled) ::slotted(*){color:var(--md-menu-item-selected-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b))}@media(forced-colors: active){:host([disabled]),:host([disabled]) slot{color:GrayText;opacity:1}.list-item{position:relative}.list-item.selected::before{content:"";position:absolute;inset:0;box-sizing:border-box;border-radius:inherit;pointer-events:none;border:3px double CanvasText}}/*# sourceMappingURL=menu-item-styles.css.map */ +` +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */;class _r{constructor(t,e){this.host=t,this.internalTypeaheadText=null,this.onClick=()=>{this.host.keepOpen||this.host.dispatchEvent(Ki(this.host,{kind:Ni}))},this.onKeydown=t=>{if(this.host.href&&"Enter"===t.code){const t=this.getInteractiveElement();t instanceof HTMLAnchorElement&&t.click()}if(t.defaultPrevented)return;const e=t.code;this.host.keepOpen&&"Escape"!==e||ji(e)&&(t.preventDefault(),this.host.dispatchEvent(Ki(this.host,{kind:Ji,key:e})))},this.getHeadlineElements=e.getHeadlineElements,this.getSupportingTextElements=e.getSupportingTextElements,this.getDefaultElements=e.getDefaultElements,this.getInteractiveElement=e.getInteractiveElement,this.host.addController(this)}get typeaheadText(){if(null!==this.internalTypeaheadText)return this.internalTypeaheadText;const t=this.getHeadlineElements(),e=[];return t.forEach((t=>{t.textContent&&t.textContent.trim()&&e.push(t.textContent.trim())})),0===e.length&&this.getDefaultElements().forEach((t=>{t.textContent&&t.textContent.trim()&&e.push(t.textContent.trim())})),0===e.length&&this.getSupportingTextElements().forEach((t=>{t.textContent&&t.textContent.trim()&&e.push(t.textContent.trim())})),e.join(" ")}get tagName(){switch(this.host.type){case"link":return"a";case"button":return"button";default:return"li"}}get role(){return"option"===this.host.type?"option":"menuitem"}hostConnected(){this.host.toggleAttribute("md-menu-item",!0)}hostUpdate(){this.host.href&&(this.host.type="link")}setTypeaheadText(t){this.internalTypeaheadText=t}} +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */class Er{get role(){return this.menuItemController.role}get typeaheadText(){return this.menuItemController.typeaheadText}setTypeaheadText(t){this.menuItemController.setTypeaheadText(t)}get displayText(){return null!==this.internalDisplayText?this.internalDisplayText:this.menuItemController.typeaheadText}setDisplayText(t){this.internalDisplayText=t}constructor(t,e){this.host=t,this.internalDisplayText=null,this.lastSelected=this.host.selected,this.firstUpdate=!0,this.onClick=()=>{this.menuItemController.onClick()},this.onKeydown=t=>{this.menuItemController.onKeydown(t)},this.menuItemController=new _r(t,e),t.addController(this)}hostUpdate(){this.lastSelected!==this.host.selected&&(this.host.ariaSelected=this.host.selected?"true":"false")}hostUpdated(){this.lastSelected===this.host.selected||this.firstUpdate||(this.host.selected?this.host.dispatchEvent(new Event("request-selection",{bubbles:!0,composed:!0})):this.host.dispatchEvent(new Event("request-deselection",{bubbles:!0,composed:!0}))),this.lastSelected=this.host.selected,this.firstUpdate=!1}} +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */class xr extends ht{constructor(){super(...arguments),this.disabled=!1,this.isMenuItem=!0,this.selected=!1,this.value="",this.type="option",this.selectOptionController=new Er(this,{getHeadlineElements:()=>this.headlineElements,getSupportingTextElements:()=>this.supportingTextElements,getDefaultElements:()=>this.defaultElements,getInteractiveElement:()=>this.listItemRoot})}get typeaheadText(){return this.selectOptionController.typeaheadText}set typeaheadText(t){this.selectOptionController.setTypeaheadText(t)}get displayText(){return this.selectOptionController.displayText}set displayText(t){this.selectOptionController.setDisplayText(t)}render(){return this.renderListItem(J` + +
+ ${this.renderRipple()} ${this.renderFocusRing()} +
+ + + ${this.renderBody()} +
+ `)}renderListItem(t){return J` +
  • ${t}
  • + `}renderRipple(){return J` `}renderFocusRing(){return J` `}getRenderClasses(){return{disabled:this.disabled,selected:this.selected}}renderBody(){return J` + + + + + + `}focus(){this.listItemRoot?.focus()}}$t(xr),xr.shadowRootOptions={...ht.shadowRootOptions,delegatesFocus:!0},r([ft({type:Boolean,reflect:!0})],xr.prototype,"disabled",void 0),r([ft({type:Boolean,attribute:"md-menu-item",reflect:!0})],xr.prototype,"isMenuItem",void 0),r([ft({type:Boolean})],xr.prototype,"selected",void 0),r([ft()],xr.prototype,"value",void 0),r([vt(".list-item")],xr.prototype,"listItemRoot",void 0),r([yt({slot:"headline"})],xr.prototype,"headlineElements",void 0),r([yt({slot:"supporting-text"})],xr.prototype,"supportingTextElements",void 0),r([function(t){return(e,i)=>{const{slot:r}=t??{},o="slot"+(r?`[name=${r}]`:":not([name])");return mt(e,i,{get(){const e=this.renderRoot?.querySelector(o);return e?.assignedNodes(t)??[]}})}}({slot:""})],xr.prototype,"defaultElements",void 0),r([ft({attribute:"typeahead-text"})],xr.prototype,"typeaheadText",null),r([ft({attribute:"display-text"})],xr.prototype,"displayText",null);class Cr extends xr{}Cr.styles=[br],customElements.define("ew-select-option",Cr); +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +class Ir extends ht{constructor(){super(...arguments),this.value=0,this.max=1,this.indeterminate=!1,this.fourColor=!1}render(){const{ariaLabel:t}=this;return J` +
    ${this.renderIndicator()}
    + `}getRenderClasses(){return{indeterminate:this.indeterminate,"four-color":this.fourColor}}}$t(Ir),r([ft({type:Number})],Ir.prototype,"value",void 0),r([ft({type:Number})],Ir.prototype,"max",void 0),r([ft({type:Boolean})],Ir.prototype,"indeterminate",void 0),r([ft({type:Boolean,attribute:"four-color"})],Ir.prototype,"fourColor",void 0); +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +class Br extends Ir{renderIndicator(){return this.indeterminate?this.renderIndeterminateContainer():this.renderDeterminateContainer()}renderDeterminateContainer(){const t=100*(1-this.value/this.max);return J` + + + + + `}renderIndeterminateContainer(){return J`
    +
    +
    +
    +
    +
    +
    +
    `}} +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */const Sr=d`:host{--_active-indicator-color: var(--md-circular-progress-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_active-indicator-width: var(--md-circular-progress-active-indicator-width, 10);--_four-color-active-indicator-four-color: var(--md-circular-progress-four-color-active-indicator-four-color, var(--md-sys-color-tertiary-container, #ffd8e4));--_four-color-active-indicator-one-color: var(--md-circular-progress-four-color-active-indicator-one-color, var(--md-sys-color-primary, #6750a4));--_four-color-active-indicator-three-color: var(--md-circular-progress-four-color-active-indicator-three-color, var(--md-sys-color-tertiary, #7d5260));--_four-color-active-indicator-two-color: var(--md-circular-progress-four-color-active-indicator-two-color, var(--md-sys-color-primary-container, #eaddff));--_size: var(--md-circular-progress-size, 48px);display:inline-flex;vertical-align:middle;width:var(--_size);height:var(--_size);position:relative;align-items:center;justify-content:center;contain:strict;content-visibility:auto}.progress{flex:1;align-self:stretch;margin:4px}.progress,.spinner,.left,.right,.circle,svg,.track,.active-track{position:absolute;inset:0}svg{transform:rotate(-90deg)}circle{cx:50%;cy:50%;r:calc(50%*(1 - var(--_active-indicator-width)/100));stroke-width:calc(var(--_active-indicator-width)*1%);stroke-dasharray:100;fill:rgba(0,0,0,0)}.active-track{transition:stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1);stroke:var(--_active-indicator-color)}.track{stroke:rgba(0,0,0,0)}.progress.indeterminate{animation:linear infinite linear-rotate;animation-duration:1568.2352941176ms}.spinner{animation:infinite both rotate-arc;animation-duration:5332ms;animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.left{overflow:hidden;inset:0 50% 0 0}.right{overflow:hidden;inset:0 0 0 50%}.circle{box-sizing:border-box;border-radius:50%;border:solid calc(var(--_active-indicator-width)/100*(var(--_size) - 8px));border-color:var(--_active-indicator-color) var(--_active-indicator-color) rgba(0,0,0,0) rgba(0,0,0,0);animation:expand-arc;animation-iteration-count:infinite;animation-fill-mode:both;animation-duration:1333ms,5332ms;animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.four-color .circle{animation-name:expand-arc,four-color}.left .circle{rotate:135deg;inset:0 -100% 0 0}.right .circle{rotate:100deg;inset:0 0 0 -100%;animation-delay:-666.5ms,0ms}@media(forced-colors: active){.active-track{stroke:CanvasText}.circle{border-color:CanvasText CanvasText Canvas Canvas}}@keyframes expand-arc{0%{transform:rotate(265deg)}50%{transform:rotate(130deg)}100%{transform:rotate(265deg)}}@keyframes rotate-arc{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes linear-rotate{to{transform:rotate(360deg)}}@keyframes four-color{0%{border-top-color:var(--_four-color-active-indicator-one-color);border-right-color:var(--_four-color-active-indicator-one-color)}15%{border-top-color:var(--_four-color-active-indicator-one-color);border-right-color:var(--_four-color-active-indicator-one-color)}25%{border-top-color:var(--_four-color-active-indicator-two-color);border-right-color:var(--_four-color-active-indicator-two-color)}40%{border-top-color:var(--_four-color-active-indicator-two-color);border-right-color:var(--_four-color-active-indicator-two-color)}50%{border-top-color:var(--_four-color-active-indicator-three-color);border-right-color:var(--_four-color-active-indicator-three-color)}65%{border-top-color:var(--_four-color-active-indicator-three-color);border-right-color:var(--_four-color-active-indicator-three-color)}75%{border-top-color:var(--_four-color-active-indicator-four-color);border-right-color:var(--_four-color-active-indicator-four-color)}90%{border-top-color:var(--_four-color-active-indicator-four-color);border-right-color:var(--_four-color-active-indicator-four-color)}100%{border-top-color:var(--_four-color-active-indicator-one-color);border-right-color:var(--_four-color-active-indicator-one-color)}}/*# sourceMappingURL=circular-progress-styles.css.map */ +`;class Rr extends Br{}Rr.styles=[Sr],customElements.define("ew-circular-progress",Rr);class kr extends ht{render(){return J` +
    + + ${void 0!==this.progress?J`
    ${this.progress}%
    `:""} +
    + ${this.label} + `}}kr.styles=d` + :host { + display: flex; + flex-direction: column; + text-align: center; + } + ew-circular-progress { + margin-bottom: 16px; + } + `,r([ft()],kr.prototype,"label",void 0),r([ft()],kr.prototype,"progress",void 0),customElements.define("ewt-page-progress",kr);class Dr extends ht{render(){return J` +
    ${this.icon}
    + ${this.label} + `}}Dr.styles=d` + :host { + display: flex; + flex-direction: column; + text-align: center; + } + .icon { + font-size: 50px; + line-height: 80px; + color: black; + } + `,r([ft()],Dr.prototype,"icon",void 0),r([ft()],Dr.prototype,"label",void 0),customElements.define("ewt-page-message",Dr);const Mr=$` + + + +`,Tr=$` + + + +`,Qr=$` + + + +`,Fr=$` + + + +`,Or=$` + + + +`,Pr=$` + + + +`,Hr=$` + + + +`;$` + + + +`,$` + + + +`;const Lr=["I".charCodeAt(0),"M".charCodeAt(0),"P".charCodeAt(0),"R".charCodeAt(0),"O".charCodeAt(0),"V".charCodeAt(0),1];var Ur,Gr;!function(t){t[t.CURRENT_STATE=1]="CURRENT_STATE",t[t.ERROR_STATE=2]="ERROR_STATE",t[t.RPC=3]="RPC",t[t.RPC_RESULT=4]="RPC_RESULT"}(Ur||(Ur={})),function(t){t[t.READY=2]="READY",t[t.PROVISIONING=3]="PROVISIONING",t[t.PROVISIONED=4]="PROVISIONED"}(Gr||(Gr={}));const zr={0:"NO_ERROR",1:"INVALID_RPC_PACKET",2:"UNKNOWN_RPC_COMMAND",3:"UNABLE_TO_CONNECT",254:"TIMEOUT",255:"UNKNOWN_ERROR"};class Kr extends Error{constructor(){super("Port is not ready")}}const Yr=t=>"["+t.map((t=>function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=t.toString(16).toUpperCase();return i.startsWith("-")?"-0x"+i.substring(1).padStart(e,"0"):"0x"+i.padStart(e,"0")}(t))).join(", ")+"]";class Nr extends EventTarget{constructor(t,e){if(super(),this.port=t,this.logger=e,this.error=0,null===t.readable)throw new Error("Port is not readable");if(null===t.writable)throw new Error("Port is not writable")}async initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3;var e;if(this.logger.log("Initializing Improv Serial"),this._processInput(),await(e=1e3,new Promise((t=>setTimeout(t,e)))),void 0===this._reader)throw new Kr;try{await new Promise((async(e,i)=>{setTimeout((()=>i(new Error("Improv Wi-Fi Serial not detected"))),t),await this.requestCurrentState(),e(void 0)})),await this.requestInfo()}catch(t){throw await this.close(),t}return this.info}async close(){this._reader&&await new Promise((t=>{this._reader.cancel(),this.addEventListener("disconnect",t,{once:!0})}))}async requestCurrentState(){let t;try{await new Promise((async(e,i)=>{this.addEventListener("state-changed",e,{once:!0});t=this._sendRPCWithResponse(2,[]),t.catch((t=>{this.removeEventListener("state-changed",e),i(t)}))}))}catch(t){throw this._rpcFeedback=void 0,new Error(`Error fetching current state: ${t}`)}if(this.state!==Gr.PROVISIONED)return void(this._rpcFeedback=void 0);const e=await t;this.nextUrl=e[0]}async requestInfo(t){const e=await this._sendRPCWithResponse(3,[],t);this.info={firmware:e[0],version:e[1],name:e[3],chipFamily:e[2]}}async provision(t,e,i){const r=new TextEncoder,o=r.encode(t),s=r.encode(e),n=[o.length,...o,s.length,...s],a=await this._sendRPCWithResponse(1,n,i);this.nextUrl=a[0]}async scan(){const t=(await this._sendRPCWithMultipleResponses(4,[])).map((t=>{let[e,i,r]=t;return{name:e,rssi:parseInt(i),secured:"YES"===r}}));return t.sort(((t,e)=>t.name.toLocaleLowerCase().localeCompare(e.name.toLocaleLowerCase()))),t}_sendRPC(t,e){this.writePacketToStream(Ur.RPC,[t,e.length,...e])}async _sendRPCWithResponse(t,e,i){if(this._rpcFeedback)throw new Error("Only 1 RPC command that requires feedback can be active");return await this._awaitRPCResultWithTimeout(new Promise(((i,r)=>{this._rpcFeedback={command:t,resolve:i,reject:r},this._sendRPC(t,e)})),i)}async _sendRPCWithMultipleResponses(t,e,i){if(this._rpcFeedback)throw new Error("Only 1 RPC command that requires feedback can be active");return await this._awaitRPCResultWithTimeout(new Promise(((i,r)=>{this._rpcFeedback={command:t,resolve:i,reject:r,receivedData:[]},this._sendRPC(t,e)})),i)}async _awaitRPCResultWithTimeout(t,e){return e?await new Promise(((i,r)=>{const o=setTimeout((()=>this._setError(254)),e);t.finally((()=>clearTimeout(o))),t.then(i,r)})):await t}async _processInput(){this.logger.debug("Starting read loop"),this._reader=this.port.readable.getReader();try{let t,e=[],i=0;for(;;){const{value:r,done:o}=await this._reader.read();if(o)break;if(r&&0!==r.length)for(const o of r){if(!1===t){10===o&&(t=void 0);continue}if(!0===t){e.push(o),e.length===i&&(this._handleIncomingPacket(e),t=void 0,e=[]);continue}if(10===o){e=[];continue}if(e.push(o),9!==e.length)continue;if(t="IMPROV"===String.fromCharCode(...e.slice(0,6)),!t){e=[];continue}i=9+e[8]+1}}}catch(t){this.logger.error("Error while reading serial port",t)}finally{this._reader.releaseLock(),this._reader=void 0}this.logger.debug("Finished read loop"),this.dispatchEvent(new Event("disconnect"))}_handleIncomingPacket(t){const e=t.slice(6),i=e[0],r=e[1],o=e[2],s=e.slice(3,3+o);if(this.logger.debug("PROCESS",{version:i,packetType:r,packetLength:o,data:Yr(s)}),1!==i)return void this.logger.error("Received unsupported version",i);let n=e[3+o],a=0;for(let e=0;e0?this._rpcFeedback.receivedData.push(e):(this._rpcFeedback.resolve(this._rpcFeedback.receivedData),this._rpcFeedback=void 0):(this._rpcFeedback.resolve(e),this._rpcFeedback=void 0)}else this.logger.error("Unable to handle packet",e);else this.logger.error(`Received invalid checksum ${n}. Expected ${a}`)}async writePacketToStream(t,e){const i=new Uint8Array([...Lr,t,e.length,...e,0,0]);i[i.length-2]=255&i.reduce(((t,e)=>t+e),0),i[i.length-1]=10,this.logger.debug("Writing to stream:",Yr(new Array(...i)));const r=this.port.writable.getWriter();await r.write(i);try{r.releaseLock()}catch(t){console.error("Ignoring release lock error",t)}}_setError(t){this.error=t,t>0&&this._rpcFeedback&&(this._rpcFeedback.reject(zr[t]||`UNKNOWN_ERROR (${t})`),this._rpcFeedback=void 0),this.dispatchEvent(new CustomEvent("error-changed",{detail:this.error}))}}class Jr extends Error{} +/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */function $r(t){let e=t.length;for(;--e>=0;)t[e]=0}const jr=256,Wr=286,Zr=30,qr=15,Vr=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Xr=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),to=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),eo=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),io=new Array(576);$r(io);const ro=new Array(60);$r(ro);const oo=new Array(512);$r(oo);const so=new Array(256);$r(so);const no=new Array(29);$r(no);const ao=new Array(Zr);function lo(t,e,i,r,o){this.static_tree=t,this.extra_bits=e,this.extra_base=i,this.elems=r,this.max_length=o,this.has_stree=t&&t.length}let co,ho,Ao;function po(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}$r(ao);const go=t=>t<256?oo[t]:oo[256+(t>>>7)],fo=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},uo=(t,e,i)=>{t.bi_valid>16-i?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=i-16):(t.bi_buf|=e<{uo(t,i[2*e],i[2*e+1])},vo=(t,e)=>{let i=0;do{i|=1&t,t>>>=1,i<<=1}while(--e>0);return i>>>1},wo=(t,e,i)=>{const r=new Array(16);let o,s,n=0;for(o=1;o<=qr;o++)n=n+i[o-1]<<1,r[o]=n;for(s=0;s<=e;s++){let e=t[2*s+1];0!==e&&(t[2*s]=vo(r[e]++,e))}},yo=t=>{let e;for(e=0;e{t.bi_valid>8?fo(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},_o=(t,e,i,r)=>{const o=2*e,s=2*i;return t[o]{const r=t.heap[i];let o=i<<1;for(;o<=t.heap_len&&(o{let r,o,s,n,a=0;if(0!==t.sym_next)do{r=255&t.pending_buf[t.sym_buf+a++],r+=(255&t.pending_buf[t.sym_buf+a++])<<8,o=t.pending_buf[t.sym_buf+a++],0===r?mo(t,o,e):(s=so[o],mo(t,s+jr+1,e),n=Vr[s],0!==n&&(o-=no[s],uo(t,o,n)),r--,s=go(r),mo(t,s,i),n=Xr[s],0!==n&&(r-=ao[s],uo(t,r,n)))}while(a{const i=e.dyn_tree,r=e.stat_desc.static_tree,o=e.stat_desc.has_stree,s=e.stat_desc.elems;let n,a,l,d=-1;for(t.heap_len=0,t.heap_max=573,n=0;n>1;n>=1;n--)Eo(t,i,n);l=s;do{n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Eo(t,i,1),a=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=a,i[2*l]=i[2*n]+i[2*a],t.depth[l]=(t.depth[n]>=t.depth[a]?t.depth[n]:t.depth[a])+1,i[2*n+1]=i[2*a+1]=l,t.heap[1]=l++,Eo(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const i=e.dyn_tree,r=e.max_code,o=e.stat_desc.static_tree,s=e.stat_desc.has_stree,n=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,l=e.stat_desc.max_length;let d,c,h,A,p,g,f=0;for(A=0;A<=qr;A++)t.bl_count[A]=0;for(i[2*t.heap[t.heap_max]+1]=0,d=t.heap_max+1;d<573;d++)c=t.heap[d],A=i[2*i[2*c+1]+1]+1,A>l&&(A=l,f++),i[2*c+1]=A,c>r||(t.bl_count[A]++,p=0,c>=a&&(p=n[c-a]),g=i[2*c],t.opt_len+=g*(A+p),s&&(t.static_len+=g*(o[2*c+1]+p)));if(0!==f){do{for(A=l-1;0===t.bl_count[A];)A--;t.bl_count[A]--,t.bl_count[A+1]+=2,t.bl_count[l]--,f-=2}while(f>0);for(A=l;0!==A;A--)for(c=t.bl_count[A];0!==c;)h=t.heap[--d],h>r||(i[2*h+1]!==A&&(t.opt_len+=(A-i[2*h+1])*i[2*h],i[2*h+1]=A),c--)}})(t,e),wo(i,d,t.bl_count)},Io=(t,e,i)=>{let r,o,s=-1,n=e[1],a=0,l=7,d=4;for(0===n&&(l=138,d=3),e[2*(i+1)+1]=65535,r=0;r<=i;r++)o=n,n=e[2*(r+1)+1],++a{let r,o,s=-1,n=e[1],a=0,l=7,d=4;for(0===n&&(l=138,d=3),r=0;r<=i;r++)if(o=n,n=e[2*(r+1)+1],!(++a{uo(t,0+(r?1:0),3),bo(t),fo(t,i),fo(t,~i),i&&t.pending_buf.set(t.window.subarray(e,e+i),t.pending),t.pending+=i};var ko=t=>{So||((()=>{let t,e,i,r,o;const s=new Array(16);for(i=0,r=0;r<28;r++)for(no[r]=i,t=0;t<1<>=7;r{let o,s,n=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e{let e;for(Io(t,t.dyn_ltree,t.l_desc.max_code),Io(t,t.dyn_dtree,t.d_desc.max_code),Co(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*eo[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),o=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=o&&(o=s)):o=s=i+5,i+4<=o&&-1!==e?Ro(t,e,i,r):4===t.strategy||s===o?(uo(t,2+(r?1:0),3),xo(t,io,ro)):(uo(t,4+(r?1:0),3),((t,e,i,r)=>{let o;for(uo(t,e-257,5),uo(t,i-1,5),uo(t,r-4,4),o=0;o(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=i,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(so[i]+jr+1)]++,t.dyn_dtree[2*go(e)]++),t.sym_next===t.sym_end),To=t=>{uo(t,2,3),mo(t,256,io),(t=>{16===t.bi_valid?(fo(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)},Qo={_tr_init:ko,_tr_stored_block:Ro,_tr_flush_block:Do,_tr_tally:Mo,_tr_align:To};var Fo=(t,e,i,r)=>{let o=65535&t,s=t>>>16&65535,n=0;for(;0!==i;){n=i>2e3?2e3:i,i-=n;do{o=o+e[r++]|0,s=s+o|0}while(--n);o%=65521,s%=65521}return o|s<<16};const Oo=new Uint32Array((()=>{let t,e=[];for(var i=0;i<256;i++){t=i;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e})());var Po=(t,e,i,r)=>{const o=Oo,s=r+i;t^=-1;for(let i=r;i>>8^o[255&(t^e[i])];return~t},Ho={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Lo={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Uo,_tr_stored_block:Go,_tr_flush_block:zo,_tr_tally:Ko,_tr_align:Yo}=Qo,{Z_NO_FLUSH:No,Z_PARTIAL_FLUSH:Jo,Z_FULL_FLUSH:$o,Z_FINISH:jo,Z_BLOCK:Wo,Z_OK:Zo,Z_STREAM_END:qo,Z_STREAM_ERROR:Vo,Z_DATA_ERROR:Xo,Z_BUF_ERROR:ts,Z_DEFAULT_COMPRESSION:es,Z_FILTERED:is,Z_HUFFMAN_ONLY:rs,Z_RLE:os,Z_FIXED:ss,Z_DEFAULT_STRATEGY:ns,Z_UNKNOWN:as,Z_DEFLATED:ls}=Lo,ds=258,cs=262,hs=42,As=113,ps=666,gs=(t,e)=>(t.msg=Ho[e],e),fs=t=>2*t-(t>4?9:0),us=t=>{let e=t.length;for(;--e>=0;)t[e]=0},ms=t=>{let e,i,r,o=t.w_size;e=t.hash_size,r=e;do{i=t.head[--r],t.head[r]=i>=o?i-o:0}while(--e);e=o,r=e;do{i=t.prev[--r],t.prev[r]=i>=o?i-o:0}while(--e)};let vs=(t,e,i)=>(e<{const e=t.state;let i=e.pending;i>t.avail_out&&(i=t.avail_out),0!==i&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+i),t.next_out),t.next_out+=i,e.pending_out+=i,t.total_out+=i,t.avail_out-=i,e.pending-=i,0===e.pending&&(e.pending_out=0))},ys=(t,e)=>{zo(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,ws(t.strm)},bs=(t,e)=>{t.pending_buf[t.pending++]=e},_s=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Es=(t,e,i,r)=>{let o=t.avail_in;return o>r&&(o=r),0===o?0:(t.avail_in-=o,e.set(t.input.subarray(t.next_in,t.next_in+o),i),1===t.state.wrap?t.adler=Fo(t.adler,e,o,i):2===t.state.wrap&&(t.adler=Po(t.adler,e,o,i)),t.next_in+=o,t.total_in+=o,o)},xs=(t,e)=>{let i,r,o=t.max_chain_length,s=t.strstart,n=t.prev_length,a=t.nice_match;const l=t.strstart>t.w_size-cs?t.strstart-(t.w_size-cs):0,d=t.window,c=t.w_mask,h=t.prev,A=t.strstart+ds;let p=d[s+n-1],g=d[s+n];t.prev_length>=t.good_match&&(o>>=2),a>t.lookahead&&(a=t.lookahead);do{if(i=e,d[i+n]===g&&d[i+n-1]===p&&d[i]===d[s]&&d[++i]===d[s+1]){s+=2,i++;do{}while(d[++s]===d[++i]&&d[++s]===d[++i]&&d[++s]===d[++i]&&d[++s]===d[++i]&&d[++s]===d[++i]&&d[++s]===d[++i]&&d[++s]===d[++i]&&d[++s]===d[++i]&&sn){if(t.match_start=e,n=r,r>=a)break;p=d[s+n-1],g=d[s+n]}}}while((e=h[e&c])>l&&0!=--o);return n<=t.lookahead?n:t.lookahead},Cs=t=>{const e=t.w_size;let i,r,o;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-cs)&&(t.window.set(t.window.subarray(e,e+e-r),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),ms(t),r+=e),0===t.strm.avail_in)break;if(i=Es(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=i,t.lookahead+t.insert>=3)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=vs(t,t.ins_h,t.window[o+1]);t.insert&&(t.ins_h=vs(t,t.ins_h,t.window[o+3-1]),t.prev[o&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=o,o++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead{let i,r,o,s=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,n=0,a=t.strm.avail_in;do{if(i=65535,o=t.bi_valid+42>>3,t.strm.avail_outr+t.strm.avail_in&&(i=r+t.strm.avail_in),i>o&&(i=o),i>8,t.pending_buf[t.pending-2]=~i,t.pending_buf[t.pending-1]=~i>>8,ws(t.strm),r&&(r>i&&(r=i),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+r),t.strm.next_out),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r,t.block_start+=r,i-=r),i&&(Es(t.strm,t.strm.output,t.strm.next_out,i),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i)}while(0===n);return a-=t.strm.avail_in,a&&(a>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=a&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-a,t.strm.next_in),t.strstart),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.block_start=t.strstart),t.high_watero&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,o+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),o>t.strm.avail_in&&(o=t.strm.avail_in),o&&(Es(t.strm,t.window,t.strstart,o),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.high_water>3,o=t.pending_buf_size-o>65535?65535:t.pending_buf_size-o,s=o>t.w_size?t.w_size:o,r=t.strstart-t.block_start,(r>=s||(r||e===jo)&&e!==No&&0===t.strm.avail_in&&r<=o)&&(i=r>o?o:r,n=e===jo&&0===t.strm.avail_in&&i===r?1:0,Go(t,t.block_start,i,n),t.block_start+=i,ws(t.strm)),n?3:1)},Bs=(t,e)=>{let i,r;for(;;){if(t.lookahead=3&&(t.ins_h=vs(t,t.ins_h,t.window[t.strstart+3-1]),i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==i&&t.strstart-i<=t.w_size-cs&&(t.match_length=xs(t,i)),t.match_length>=3)if(r=Ko(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=vs(t,t.ins_h,t.window[t.strstart+3-1]),i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=vs(t,t.ins_h,t.window[t.strstart+1]);else r=Ko(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(ys(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===jo?(ys(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ys(t,!1),0===t.strm.avail_out)?1:2},Ss=(t,e)=>{let i,r,o;for(;;){if(t.lookahead=3&&(t.ins_h=vs(t,t.ins_h,t.window[t.strstart+3-1]),i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==i&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){o=t.strstart+t.lookahead-3,r=Ko(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=o&&(t.ins_h=vs(t,t.ins_h,t.window[t.strstart+3-1]),i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,r&&(ys(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(r=Ko(t,0,t.window[t.strstart-1]),r&&ys(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=Ko(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===jo?(ys(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ys(t,!1),0===t.strm.avail_out)?1:2};function Rs(t,e,i,r,o){this.good_length=t,this.max_lazy=e,this.nice_length=i,this.max_chain=r,this.func=o}const ks=[new Rs(0,0,0,0,Is),new Rs(4,4,8,4,Bs),new Rs(4,5,16,8,Bs),new Rs(4,6,32,32,Bs),new Rs(4,4,16,16,Ss),new Rs(8,16,32,32,Ss),new Rs(8,16,128,128,Ss),new Rs(8,32,128,256,Ss),new Rs(32,128,258,1024,Ss),new Rs(32,258,258,4096,Ss)];function Ds(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ls,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),us(this.dyn_ltree),us(this.dyn_dtree),us(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),us(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),us(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Ms=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==hs&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&e.status!==As&&e.status!==ps?1:0},Ts=t=>{if(Ms(t))return gs(t,Vo);t.total_in=t.total_out=0,t.data_type=as;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?hs:As,t.adler=2===e.wrap?0:1,e.last_flush=-2,Uo(e),Zo},Qs=t=>{const e=Ts(t);return e===Zo&&(t=>{t.window_size=2*t.w_size,us(t.head),t.max_lazy_match=ks[t.level].max_lazy,t.good_match=ks[t.level].good_length,t.nice_match=ks[t.level].nice_length,t.max_chain_length=ks[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0})(t.state),e},Fs=(t,e,i,r,o,s)=>{if(!t)return Vo;let n=1;if(e===es&&(e=6),r<0?(n=0,r=-r):r>15&&(n=2,r-=16),o<1||o>9||i!==ls||r<8||r>15||e<0||e>9||s<0||s>ss||8===r&&1!==n)return gs(t,Vo);8===r&&(r=9);const a=new Ds;return t.state=a,a.strm=t,a.status=hs,a.wrap=n,a.gzhead=null,a.w_bits=r,a.w_size=1<{if(Ms(t)||e>Wo||e<0)return t?gs(t,Vo):Vo;const i=t.state;if(!t.output||0!==t.avail_in&&!t.input||i.status===ps&&e!==jo)return gs(t,0===t.avail_out?ts:Vo);const r=i.last_flush;if(i.last_flush=e,0!==i.pending){if(ws(t),0===t.avail_out)return i.last_flush=-1,Zo}else if(0===t.avail_in&&fs(e)<=fs(r)&&e!==jo)return gs(t,ts);if(i.status===ps&&0!==t.avail_in)return gs(t,ts);if(i.status===hs&&0===i.wrap&&(i.status=As),i.status===hs){let e=ls+(i.w_bits-8<<4)<<8,r=-1;if(r=i.strategy>=rs||i.level<2?0:i.level<6?1:6===i.level?2:3,e|=r<<6,0!==i.strstart&&(e|=32),e+=31-e%31,_s(i,e),0!==i.strstart&&(_s(i,t.adler>>>16),_s(i,65535&t.adler)),t.adler=1,i.status=As,ws(t),0!==i.pending)return i.last_flush=-1,Zo}if(57===i.status)if(t.adler=0,bs(i,31),bs(i,139),bs(i,8),i.gzhead)bs(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),bs(i,255&i.gzhead.time),bs(i,i.gzhead.time>>8&255),bs(i,i.gzhead.time>>16&255),bs(i,i.gzhead.time>>24&255),bs(i,9===i.level?2:i.strategy>=rs||i.level<2?4:0),bs(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(bs(i,255&i.gzhead.extra.length),bs(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=Po(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69;else if(bs(i,0),bs(i,0),bs(i,0),bs(i,0),bs(i,0),bs(i,9===i.level?2:i.strategy>=rs||i.level<2?4:0),bs(i,3),i.status=As,ws(t),0!==i.pending)return i.last_flush=-1,Zo;if(69===i.status){if(i.gzhead.extra){let e=i.pending,r=(65535&i.gzhead.extra.length)-i.gzindex;for(;i.pending+r>i.pending_buf_size;){let o=i.pending_buf_size-i.pending;if(i.pending_buf.set(i.gzhead.extra.subarray(i.gzindex,i.gzindex+o),i.pending),i.pending=i.pending_buf_size,i.gzhead.hcrc&&i.pending>e&&(t.adler=Po(t.adler,i.pending_buf,i.pending-e,e)),i.gzindex+=o,ws(t),0!==i.pending)return i.last_flush=-1,Zo;e=0,r-=o}let o=new Uint8Array(i.gzhead.extra);i.pending_buf.set(o.subarray(i.gzindex,i.gzindex+r),i.pending),i.pending+=r,i.gzhead.hcrc&&i.pending>e&&(t.adler=Po(t.adler,i.pending_buf,i.pending-e,e)),i.gzindex=0}i.status=73}if(73===i.status){if(i.gzhead.name){let e,r=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>r&&(t.adler=Po(t.adler,i.pending_buf,i.pending-r,r)),ws(t),0!==i.pending)return i.last_flush=-1,Zo;r=0}e=i.gzindexr&&(t.adler=Po(t.adler,i.pending_buf,i.pending-r,r)),i.gzindex=0}i.status=91}if(91===i.status){if(i.gzhead.comment){let e,r=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>r&&(t.adler=Po(t.adler,i.pending_buf,i.pending-r,r)),ws(t),0!==i.pending)return i.last_flush=-1,Zo;r=0}e=i.gzindexr&&(t.adler=Po(t.adler,i.pending_buf,i.pending-r,r))}i.status=103}if(103===i.status){if(i.gzhead.hcrc){if(i.pending+2>i.pending_buf_size&&(ws(t),0!==i.pending))return i.last_flush=-1,Zo;bs(i,255&t.adler),bs(i,t.adler>>8&255),t.adler=0}if(i.status=As,ws(t),0!==i.pending)return i.last_flush=-1,Zo}if(0!==t.avail_in||0!==i.lookahead||e!==No&&i.status!==ps){let r=0===i.level?Is(i,e):i.strategy===rs?((t,e)=>{let i;for(;;){if(0===t.lookahead&&(Cs(t),0===t.lookahead)){if(e===No)return 1;break}if(t.match_length=0,i=Ko(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,i&&(ys(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===jo?(ys(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ys(t,!1),0===t.strm.avail_out)?1:2})(i,e):i.strategy===os?((t,e)=>{let i,r,o,s;const n=t.window;for(;;){if(t.lookahead<=ds){if(Cs(t),t.lookahead<=ds&&e===No)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(o=t.strstart-1,r=n[o],r===n[++o]&&r===n[++o]&&r===n[++o])){s=t.strstart+ds;do{}while(r===n[++o]&&r===n[++o]&&r===n[++o]&&r===n[++o]&&r===n[++o]&&r===n[++o]&&r===n[++o]&&r===n[++o]&&ot.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(i=Ko(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(i=Ko(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),i&&(ys(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===jo?(ys(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ys(t,!1),0===t.strm.avail_out)?1:2})(i,e):ks[i.level].func(i,e);if(3!==r&&4!==r||(i.status=ps),1===r||3===r)return 0===t.avail_out&&(i.last_flush=-1),Zo;if(2===r&&(e===Jo?Yo(i):e!==Wo&&(Go(i,0,0,!1),e===$o&&(us(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),ws(t),0===t.avail_out))return i.last_flush=-1,Zo}return e!==jo?Zo:i.wrap<=0?qo:(2===i.wrap?(bs(i,255&t.adler),bs(i,t.adler>>8&255),bs(i,t.adler>>16&255),bs(i,t.adler>>24&255),bs(i,255&t.total_in),bs(i,t.total_in>>8&255),bs(i,t.total_in>>16&255),bs(i,t.total_in>>24&255)):(_s(i,t.adler>>>16),_s(i,65535&t.adler)),ws(t),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?Zo:qo)},Ps=(t,e)=>{let i=e.length;if(Ms(t))return Vo;const r=t.state,o=r.wrap;if(2===o||1===o&&r.status!==hs||r.lookahead)return Vo;if(1===o&&(t.adler=Fo(t.adler,e,i,0)),r.wrap=0,i>=r.w_size){0===o&&(us(r.head),r.strstart=0,r.block_start=0,r.insert=0);let t=new Uint8Array(r.w_size);t.set(e.subarray(i-r.w_size,i),0),e=t,i=r.w_size}const s=t.avail_in,n=t.next_in,a=t.input;for(t.avail_in=i,t.next_in=0,t.input=e,Cs(r);r.lookahead>=3;){let t=r.strstart,e=r.lookahead-2;do{r.ins_h=vs(r,r.ins_h,r.window[t+3-1]),r.prev[t&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=t,t++}while(--e);r.strstart=t,r.lookahead=2,Cs(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,t.next_in=n,t.input=a,t.avail_in=s,r.wrap=o,Zo},Hs={deflateInit:(t,e)=>Fs(t,e,ls,15,8,ns),deflateInit2:Fs,deflateReset:Qs,deflateResetKeep:Ts,deflateSetHeader:(t,e)=>Ms(t)||2!==t.state.wrap?Vo:(t.state.gzhead=e,Zo),deflate:Os,deflateEnd:t=>{if(Ms(t))return Vo;const e=t.state.status;return t.state=null,e===As?gs(t,Xo):Zo},deflateSetDictionary:Ps,deflateInfo:"pako deflate (from Nodeca project)"};const Ls=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Us=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(const e in i)Ls(i,e)&&(t[e]=i[e])}}return t},Gs=t=>{let e=0;for(let i=0,r=t.length;i=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Ks[254]=Ks[254]=1;var Ys=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,i,r,o,s,n=t.length,a=0;for(o=0;o>>6,e[s++]=128|63&i):i<65536?(e[s++]=224|i>>>12,e[s++]=128|i>>>6&63,e[s++]=128|63&i):(e[s++]=240|i>>>18,e[s++]=128|i>>>12&63,e[s++]=128|i>>>6&63,e[s++]=128|63&i);return e},Ns=(t,e)=>{const i=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let r,o;const s=new Array(2*i);for(o=0,r=0;r4)s[o++]=65533,r+=n-1;else{for(e&=2===n?31:3===n?15:7;n>1&&r1?s[o++]=65533:e<65536?s[o++]=e:(e-=65536,s[o++]=55296|e>>10&1023,s[o++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&zs)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let i="";for(let r=0;r{(e=e||t.length)>t.length&&(e=t.length);let i=e-1;for(;i>=0&&128==(192&t[i]);)i--;return i<0||0===i?e:i+Ks[t[i]]>e?i:e};var $s=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const js=Object.prototype.toString,{Z_NO_FLUSH:Ws,Z_SYNC_FLUSH:Zs,Z_FULL_FLUSH:qs,Z_FINISH:Vs,Z_OK:Xs,Z_STREAM_END:tn,Z_DEFAULT_COMPRESSION:en,Z_DEFAULT_STRATEGY:rn,Z_DEFLATED:on}=Lo;function sn(t){this.options=Us({level:en,method:on,chunkSize:16384,windowBits:15,memLevel:8,strategy:rn},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new $s,this.strm.avail_out=0;let i=Hs.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(i!==Xs)throw new Error(Ho[i]);if(e.header&&Hs.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?Ys(e.dictionary):"[object ArrayBuffer]"===js.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,i=Hs.deflateSetDictionary(this.strm,t),i!==Xs)throw new Error(Ho[i]);this._dict_set=!0}}function nn(t,e){const i=new sn(e);if(i.push(t,!0),i.err)throw i.msg||Ho[i.err];return i.result}sn.prototype.push=function(t,e){const i=this.strm,r=this.options.chunkSize;let o,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?Vs:Ws,"string"==typeof t?i.input=Ys(t):"[object ArrayBuffer]"===js.call(t)?i.input=new Uint8Array(t):i.input=t,i.next_in=0,i.avail_in=i.input.length;;)if(0===i.avail_out&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),(s===Zs||s===qs)&&i.avail_out<=6)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else{if(o=Hs.deflate(i,s),o===tn)return i.next_out>0&&this.onData(i.output.subarray(0,i.next_out)),o=Hs.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===Xs;if(0!==i.avail_out){if(s>0&&i.next_out>0)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else if(0===i.avail_in)break}else this.onData(i.output)}return!0},sn.prototype.onData=function(t){this.chunks.push(t)},sn.prototype.onEnd=function(t){t===Xs&&(this.result=Gs(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var an={Deflate:sn,deflate:nn,deflateRaw:function(t,e){return(e=e||{}).raw=!0,nn(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,nn(t,e)},constants:Lo};const ln=16209;var dn=function(t,e){let i,r,o,s,n,a,l,d,c,h,A,p,g,f,u,m,v,w,y,b,_,E,x,C;const I=t.state;i=t.next_in,x=t.input,r=i+(t.avail_in-5),o=t.next_out,C=t.output,s=o-(e-t.avail_out),n=o+(t.avail_out-257),a=I.dmax,l=I.wsize,d=I.whave,c=I.wnext,h=I.window,A=I.hold,p=I.bits,g=I.lencode,f=I.distcode,u=(1<>>24,A>>>=w,p-=w,w=v>>>16&255,0===w)C[o++]=65535&v;else{if(!(16&w)){if(64&w){if(32&w){I.mode=16191;break t}t.msg="invalid literal/length code",I.mode=ln;break t}v=g[(65535&v)+(A&(1<>>=w,p-=w),p<15&&(A+=x[i++]<>>24,A>>>=w,p-=w,w=v>>>16&255,16&w){if(b=65535&v,w&=15,pa){t.msg="invalid distance too far back",I.mode=ln;break t}if(A>>>=w,p-=w,w=o-s,b>w){if(w=b-w,w>d&&I.sane){t.msg="invalid distance too far back",I.mode=ln;break t}if(_=0,E=h,0===c){if(_+=l-w,w2;)C[o++]=E[_++],C[o++]=E[_++],C[o++]=E[_++],y-=3;y&&(C[o++]=E[_++],y>1&&(C[o++]=E[_++]))}else{_=o-b;do{C[o++]=C[_++],C[o++]=C[_++],C[o++]=C[_++],y-=3}while(y>2);y&&(C[o++]=C[_++],y>1&&(C[o++]=C[_++]))}break}if(64&w){t.msg="invalid distance code",I.mode=ln;break t}v=f[(65535&v)+(A&(1<>3,i-=y,p-=y<<3,A&=(1<{const l=a.bits;let d,c,h,A,p,g,f=0,u=0,m=0,v=0,w=0,y=0,b=0,_=0,E=0,x=0,C=null;const I=new Uint16Array(16),B=new Uint16Array(16);let S,R,k,D=null;for(f=0;f<=cn;f++)I[f]=0;for(u=0;u=1&&0===I[v];v--);if(w>v&&(w=v),0===v)return o[s++]=20971520,o[s++]=20971520,a.bits=1,0;for(m=1;m0&&(0===t||1!==v))return-1;for(B[1]=0,f=1;f852||2===t&&E>592)return 1;for(;;){S=f-b,n[u]+1=g?(R=D[n[u]-g],k=C[n[u]-g]):(R=96,k=0),d=1<>b)+c]=S<<24|R<<16|k}while(0!==c);for(d=1<>=1;if(0!==d?(x&=d-1,x+=d):x=0,u++,0==--I[f]){if(f===v)break;f=e[i+n[u]]}if(f>w&&(x&A)!==h){for(0===b&&(b=w),p+=m,y=f-b,_=1<852||2===t&&E>592)return 1;h=x&A,o[h]=w<<24|y<<16|p-s}}return 0!==x&&(o[p+x]=f-b<<24|64<<16),a.bits=w,0};const{Z_FINISH:un,Z_BLOCK:mn,Z_TREES:vn,Z_OK:wn,Z_STREAM_END:yn,Z_NEED_DICT:bn,Z_STREAM_ERROR:_n,Z_DATA_ERROR:En,Z_MEM_ERROR:xn,Z_BUF_ERROR:Cn,Z_DEFLATED:In}=Lo,Bn=16180,Sn=16190,Rn=16191,kn=16192,Dn=16194,Mn=16199,Tn=16200,Qn=16206,Fn=16209,On=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function Pn(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Hn=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode16211?1:0},Ln=t=>{if(Hn(t))return _n;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=Bn,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,wn},Un=t=>{if(Hn(t))return _n;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Ln(t)},Gn=(t,e)=>{let i;if(Hn(t))return _n;const r=t.state;return e<0?(i=0,e=-e):(i=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?_n:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=i,r.wbits=e,Un(t))},zn=(t,e)=>{if(!t)return _n;const i=new Pn;t.state=i,i.strm=t,i.window=null,i.mode=Bn;const r=Gn(t,e);return r!==wn&&(t.state=null),r};let Kn,Yn,Nn=!0;const Jn=t=>{if(Nn){Kn=new Int32Array(512),Yn=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(fn(1,t.lens,0,288,Kn,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;fn(2,t.lens,0,32,Yn,0,t.work,{bits:5}),Nn=!1}t.lencode=Kn,t.lenbits=9,t.distcode=Yn,t.distbits=5},$n=(t,e,i,r)=>{let o;const s=t.state;return null===s.window&&(s.wsize=1<=s.wsize?(s.window.set(e.subarray(i-s.wsize,i),0),s.wnext=0,s.whave=s.wsize):(o=s.wsize-s.wnext,o>r&&(o=r),s.window.set(e.subarray(i-r,i-r+o),s.wnext),(r-=o)?(s.window.set(e.subarray(i-r,i),0),s.wnext=r,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave{let i,r,o,s,n,a,l,d,c,h,A,p,g,f,u,m,v,w,y,b,_,E,x=0;const C=new Uint8Array(4);let I,B;const S=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Hn(t)||!t.output||!t.input&&0!==t.avail_in)return _n;i=t.state,i.mode===Rn&&(i.mode=kn),n=t.next_out,o=t.output,l=t.avail_out,s=t.next_in,r=t.input,a=t.avail_in,d=i.hold,c=i.bits,h=a,A=l,E=wn;t:for(;;)switch(i.mode){case Bn:if(0===i.wrap){i.mode=kn;break}for(;c<16;){if(0===a)break t;a--,d+=r[s++]<>>8&255,i.check=Po(i.check,C,2,0),d=0,c=0,i.mode=16181;break}if(i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&d)<<8)+(d>>8))%31){t.msg="incorrect header check",i.mode=Fn;break}if((15&d)!==In){t.msg="unknown compression method",i.mode=Fn;break}if(d>>>=4,c-=4,_=8+(15&d),0===i.wbits&&(i.wbits=_),_>15||_>i.wbits){t.msg="invalid window size",i.mode=Fn;break}i.dmax=1<>8&1),512&i.flags&&4&i.wrap&&(C[0]=255&d,C[1]=d>>>8&255,i.check=Po(i.check,C,2,0)),d=0,c=0,i.mode=16182;case 16182:for(;c<32;){if(0===a)break t;a--,d+=r[s++]<>>8&255,C[2]=d>>>16&255,C[3]=d>>>24&255,i.check=Po(i.check,C,4,0)),d=0,c=0,i.mode=16183;case 16183:for(;c<16;){if(0===a)break t;a--,d+=r[s++]<>8),512&i.flags&&4&i.wrap&&(C[0]=255&d,C[1]=d>>>8&255,i.check=Po(i.check,C,2,0)),d=0,c=0,i.mode=16184;case 16184:if(1024&i.flags){for(;c<16;){if(0===a)break t;a--,d+=r[s++]<>>8&255,i.check=Po(i.check,C,2,0)),d=0,c=0}else i.head&&(i.head.extra=null);i.mode=16185;case 16185:if(1024&i.flags&&(p=i.length,p>a&&(p=a),p&&(i.head&&(_=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Uint8Array(i.head.extra_len)),i.head.extra.set(r.subarray(s,s+p),_)),512&i.flags&&4&i.wrap&&(i.check=Po(i.check,r,p,s)),a-=p,s+=p,i.length-=p),i.length))break t;i.length=0,i.mode=16186;case 16186:if(2048&i.flags){if(0===a)break t;p=0;do{_=r[s+p++],i.head&&_&&i.length<65536&&(i.head.name+=String.fromCharCode(_))}while(_&&p>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=Rn;break;case 16189:for(;c<32;){if(0===a)break t;a--,d+=r[s++]<>>=7&c,c-=7&c,i.mode=Qn;break}for(;c<3;){if(0===a)break t;a--,d+=r[s++]<>>=1,c-=1,3&d){case 0:i.mode=16193;break;case 1:if(Jn(i),i.mode=Mn,e===vn){d>>>=2,c-=2;break t}break;case 2:i.mode=16196;break;case 3:t.msg="invalid block type",i.mode=Fn}d>>>=2,c-=2;break;case 16193:for(d>>>=7&c,c-=7&c;c<32;){if(0===a)break t;a--,d+=r[s++]<>>16^65535)){t.msg="invalid stored block lengths",i.mode=Fn;break}if(i.length=65535&d,d=0,c=0,i.mode=Dn,e===vn)break t;case Dn:i.mode=16195;case 16195:if(p=i.length,p){if(p>a&&(p=a),p>l&&(p=l),0===p)break t;o.set(r.subarray(s,s+p),n),a-=p,s+=p,l-=p,n+=p,i.length-=p;break}i.mode=Rn;break;case 16196:for(;c<14;){if(0===a)break t;a--,d+=r[s++]<>>=5,c-=5,i.ndist=1+(31&d),d>>>=5,c-=5,i.ncode=4+(15&d),d>>>=4,c-=4,i.nlen>286||i.ndist>30){t.msg="too many length or distance symbols",i.mode=Fn;break}i.have=0,i.mode=16197;case 16197:for(;i.have>>=3,c-=3}for(;i.have<19;)i.lens[S[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,I={bits:i.lenbits},E=fn(0,i.lens,0,19,i.lencode,0,i.work,I),i.lenbits=I.bits,E){t.msg="invalid code lengths set",i.mode=Fn;break}i.have=0,i.mode=16198;case 16198:for(;i.have>>24,m=x>>>16&255,v=65535&x,!(u<=c);){if(0===a)break t;a--,d+=r[s++]<>>=u,c-=u,i.lens[i.have++]=v;else{if(16===v){for(B=u+2;c>>=u,c-=u,0===i.have){t.msg="invalid bit length repeat",i.mode=Fn;break}_=i.lens[i.have-1],p=3+(3&d),d>>>=2,c-=2}else if(17===v){for(B=u+3;c>>=u,c-=u,_=0,p=3+(7&d),d>>>=3,c-=3}else{for(B=u+7;c>>=u,c-=u,_=0,p=11+(127&d),d>>>=7,c-=7}if(i.have+p>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=Fn;break}for(;p--;)i.lens[i.have++]=_}}if(i.mode===Fn)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=Fn;break}if(i.lenbits=9,I={bits:i.lenbits},E=fn(1,i.lens,0,i.nlen,i.lencode,0,i.work,I),i.lenbits=I.bits,E){t.msg="invalid literal/lengths set",i.mode=Fn;break}if(i.distbits=6,i.distcode=i.distdyn,I={bits:i.distbits},E=fn(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,I),i.distbits=I.bits,E){t.msg="invalid distances set",i.mode=Fn;break}if(i.mode=Mn,e===vn)break t;case Mn:i.mode=Tn;case Tn:if(a>=6&&l>=258){t.next_out=n,t.avail_out=l,t.next_in=s,t.avail_in=a,i.hold=d,i.bits=c,dn(t,A),n=t.next_out,o=t.output,l=t.avail_out,s=t.next_in,r=t.input,a=t.avail_in,d=i.hold,c=i.bits,i.mode===Rn&&(i.back=-1);break}for(i.back=0;x=i.lencode[d&(1<>>24,m=x>>>16&255,v=65535&x,!(u<=c);){if(0===a)break t;a--,d+=r[s++]<>w)],u=x>>>24,m=x>>>16&255,v=65535&x,!(w+u<=c);){if(0===a)break t;a--,d+=r[s++]<>>=w,c-=w,i.back+=w}if(d>>>=u,c-=u,i.back+=u,i.length=v,0===m){i.mode=16205;break}if(32&m){i.back=-1,i.mode=Rn;break}if(64&m){t.msg="invalid literal/length code",i.mode=Fn;break}i.extra=15&m,i.mode=16201;case 16201:if(i.extra){for(B=i.extra;c>>=i.extra,c-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=16202;case 16202:for(;x=i.distcode[d&(1<>>24,m=x>>>16&255,v=65535&x,!(u<=c);){if(0===a)break t;a--,d+=r[s++]<>w)],u=x>>>24,m=x>>>16&255,v=65535&x,!(w+u<=c);){if(0===a)break t;a--,d+=r[s++]<>>=w,c-=w,i.back+=w}if(d>>>=u,c-=u,i.back+=u,64&m){t.msg="invalid distance code",i.mode=Fn;break}i.offset=v,i.extra=15&m,i.mode=16203;case 16203:if(i.extra){for(B=i.extra;c>>=i.extra,c-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=Fn;break}i.mode=16204;case 16204:if(0===l)break t;if(p=A-l,i.offset>p){if(p=i.offset-p,p>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=Fn;break}p>i.wnext?(p-=i.wnext,g=i.wsize-p):g=i.wnext-p,p>i.length&&(p=i.length),f=i.window}else f=o,g=n-i.offset,p=i.length;p>l&&(p=l),l-=p,i.length-=p;do{o[n++]=f[g++]}while(--p);0===i.length&&(i.mode=Tn);break;case 16205:if(0===l)break t;o[n++]=i.length,l--,i.mode=Tn;break;case Qn:if(i.wrap){for(;c<32;){if(0===a)break t;a--,d|=r[s++]<zn(t,15),inflateInit2:zn,inflate:jn,inflateEnd:t=>{if(Hn(t))return _n;let e=t.state;return e.window&&(e.window=null),t.state=null,wn},inflateGetHeader:(t,e)=>{if(Hn(t))return _n;const i=t.state;return 2&i.wrap?(i.head=e,e.done=!1,wn):_n},inflateSetDictionary:(t,e)=>{const i=e.length;let r,o,s;return Hn(t)?_n:(r=t.state,0!==r.wrap&&r.mode!==Sn?_n:r.mode===Sn&&(o=1,o=Fo(o,e,i,0),o!==r.check)?En:(s=$n(t,e,i,i),s?(r.mode=16210,xn):(r.havedict=1,wn)))},inflateInfo:"pako inflate (from Nodeca project)"};var Zn=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const qn=Object.prototype.toString,{Z_NO_FLUSH:Vn,Z_FINISH:Xn,Z_OK:ta,Z_STREAM_END:ea,Z_NEED_DICT:ia,Z_STREAM_ERROR:ra,Z_DATA_ERROR:oa,Z_MEM_ERROR:sa}=Lo;function na(t){this.options=Us({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(15&e.windowBits||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new $s,this.strm.avail_out=0;let i=Wn.inflateInit2(this.strm,e.windowBits);if(i!==ta)throw new Error(Ho[i]);if(this.header=new Zn,Wn.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Ys(e.dictionary):"[object ArrayBuffer]"===qn.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(i=Wn.inflateSetDictionary(this.strm,e.dictionary),i!==ta)))throw new Error(Ho[i])}function aa(t,e){const i=new na(e);if(i.push(t),i.err)throw i.msg||Ho[i.err];return i.result}na.prototype.push=function(t,e){const i=this.strm,r=this.options.chunkSize,o=this.options.dictionary;let s,n,a;if(this.ended)return!1;for(n=e===~~e?e:!0===e?Xn:Vn,"[object ArrayBuffer]"===qn.call(t)?i.input=new Uint8Array(t):i.input=t,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),s=Wn.inflate(i,n),s===ia&&o&&(s=Wn.inflateSetDictionary(i,o),s===ta?s=Wn.inflate(i,n):s===oa&&(s=ia));i.avail_in>0&&s===ea&&i.state.wrap>0&&0!==t[i.next_in];)Wn.inflateReset(i),s=Wn.inflate(i,n);switch(s){case ra:case oa:case ia:case sa:return this.onEnd(s),this.ended=!0,!1}if(a=i.avail_out,i.next_out&&(0===i.avail_out||s===ea))if("string"===this.options.to){let t=Js(i.output,i.next_out),e=i.next_out-t,o=Ns(i.output,t);i.next_out=e,i.avail_out=r-e,e&&i.output.set(i.output.subarray(t,t+e),0),this.onData(o)}else this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out));if(s!==ta||0!==a){if(s===ea)return s=Wn.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===i.avail_in)break}}return!0},na.prototype.onData=function(t){this.chunks.push(t)},na.prototype.onEnd=function(t){t===ta&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Gs(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var la={Inflate:na,inflate:aa,inflateRaw:function(t,e){return(e=e||{}).raw=!0,aa(t,e)},ungzip:aa,constants:Lo};const{Deflate:da,deflate:ca,deflateRaw:ha,gzip:Aa}=an,{Inflate:pa,inflate:ga,inflateRaw:fa,ungzip:ua}=la;var ma=ca,va=pa;class wa{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.device=t,this.tracing=e,this.slipReaderEnabled=!1,this.leftOver=new Uint8Array(0),this.baudrate=0,this.traceLog="",this.lastTraceTime=Date.now(),this._DTR_state=!1,this.slipReaderEnabled=i}getInfo(){const t=this.device.getInfo();return t.usbVendorId&&t.usbProductId?`WebSerial VendorID 0x${t.usbVendorId.toString(16)} ProductID 0x${t.usbProductId.toString(16)}`:""}getPid(){return this.device.getInfo().usbProductId}trace(t){const e=`${`TRACE ${(Date.now()-this.lastTraceTime).toFixed(3)}`} ${t}`;console.log(e),this.traceLog+=e+"\n"}async returnTrace(){try{await navigator.clipboard.writeText(this.traceLog),console.log("Text copied to clipboard!")}catch(t){console.error("Failed to copy text:",t)}}hexify(t){return Array.from(t).map((t=>t.toString(16).padStart(2,"0"))).join("").padEnd(16," ")}hexConvert(t){if((!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&t.length>16){let e="",i=t;for(;i.length>0;){const t=i.slice(0,16),r=String.fromCharCode(...t).split("").map((t=>" "===t||t>=" "&&t<="~"&&" "!==t?t:".")).join("");i=i.slice(16),e+=`\n ${this.hexify(t.slice(0,8))} ${this.hexify(t.slice(8))} | ${r}`}return e}return this.hexify(t)}slipWriter(t){const e=[];e.push(192);for(let i=0;i0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12,r=this.leftOver;if(this.leftOver=new Uint8Array(0),this.slipReaderEnabled){const t=this.slipReader(r);if(t.length>0)return t;r=this.leftOver,this.leftOver=new Uint8Array(0)}if(null==this.device.readable)return this.leftOver;const o=this.device.readable.getReader();try{e>0&&(t=setTimeout((function(){o.cancel()}),e));do{const{value:t,done:e}=await o.read();if(e)throw this.leftOver=r,new Error("Timeout");r=new Uint8Array(this._appendBuffer(r.buffer,t.buffer))}while(r.length0&&clearTimeout(t),o.releaseLock()}if(this.tracing&&(console.log("Read bytes"),this.trace(`Read ${r.length} bytes: ${this.hexConvert(r)}`)),this.slipReaderEnabled){const t=this.slipReader(r);return this.tracing&&(console.log("Slip reader results"),this.trace(`Read ${t.length} bytes: ${this.hexConvert(t)}`)),t}return r}async rawRead(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(0!=this.leftOver.length){const t=this.leftOver;return this.leftOver=new Uint8Array(0),t}if(!this.device.readable)return this.leftOver;const e=this.device.readable.getReader();let i;try{t>0&&(i=setTimeout((function(){e.cancel()}),t));const{value:r,done:o}=await e.read();if(o)throw new Error("Timeout");return this.tracing&&(console.log("Raw Read bytes"),this.trace(`Read ${r.length} bytes: ${this.hexConvert(r)}`)),r}finally{t>0&&clearTimeout(i),e.releaseLock()}}async setRTS(t){await this.device.setSignals({requestToSend:t}),await this.setDTR(this._DTR_state)}async setDTR(t){this._DTR_state=t,await this.device.setSignals({dataTerminalReady:t})}async connect(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:115200,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};await this.device.open({baudRate:t,dataBits:null==e?void 0:e.dataBits,stopBits:null==e?void 0:e.stopBits,bufferSize:null==e?void 0:e.bufferSize,parity:null==e?void 0:e.parity,flowControl:null==e?void 0:e.flowControl}),this.baudrate=t,this.leftOver=new Uint8Array(0)}async sleep(t){return new Promise((e=>setTimeout(e,t)))}async waitForUnlock(t){for(;this.device.readable&&this.device.readable.locked||this.device.writable&&this.device.writable.locked;)await this.sleep(t)}async disconnect(){await this.waitForUnlock(400),await this.device.close()}}function ya(t){return new Promise((e=>setTimeout(e,t)))}async function ba(t,e){const i={D:async e=>await t.setDTR(e),R:async e=>await t.setRTS(e),W:async t=>await ya(t)};try{const t=function(t){const e=["D","R","W"],i=t.split("|");for(const t of i){const i=t[0],r=t.slice(1);if(!e.includes(i))return!1;if("D"===i||"R"===i){if("0"!==r&&"1"!==r)return!1}else if("W"===i){const t=parseInt(r);if(isNaN(t)||t<=0)return!1}}return!0}(e);if(!t)return;const r=e.split("|");for(const t of r){const e=t[0],r=t.slice(1);"W"===e?await i.W(Number(r)):"D"!==e&&"R"!==e||await i[e]("1"===r)}}catch(t){throw new Error("Invalid custom reset sequence")}}for(var _a={},Ea={byteLength:function(t){var e=Ra(t),i=e[0],r=e[1];return 3*(i+r)/4-r},toByteArray:function(t){var e,i,r=Ra(t),o=r[0],s=r[1],n=new Ia(function(t,e,i){return 3*(e+i)/4-i}(0,o,s)),a=0,l=s>0?o-4:o;for(i=0;i>16&255,n[a++]=e>>8&255,n[a++]=255&e;2===s&&(e=Ca[t.charCodeAt(i)]<<2|Ca[t.charCodeAt(i+1)]>>4,n[a++]=255&e);1===s&&(e=Ca[t.charCodeAt(i)]<<10|Ca[t.charCodeAt(i+1)]<<4|Ca[t.charCodeAt(i+2)]>>2,n[a++]=e>>8&255,n[a++]=255&e);return n},fromByteArray:function(t){for(var e,i=t.length,r=i%3,o=[],s=16383,n=0,a=i-r;na?a:n+s));1===r?(e=t[i-1],o.push(xa[e>>2]+xa[e<<4&63]+"==")):2===r&&(e=(t[i-2]<<8)+t[i-1],o.push(xa[e>>10]+xa[e>>4&63]+xa[e<<2&63]+"="));return o.join("")}},xa=[],Ca=[],Ia="undefined"!=typeof Uint8Array?Uint8Array:Array,Ba="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Sa=0;Sa<64;++Sa)xa[Sa]=Ba[Sa],Ca[Ba.charCodeAt(Sa)]=Sa;function Ra(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return-1===i&&(i=e),[i,i===e?0:4-i%4]}function ka(t,e,i){for(var r,o,s=[],n=e;n>18&63]+xa[o>>12&63]+xa[o>>6&63]+xa[63&o]);return s.join("")}Ca["-".charCodeAt(0)]=62,Ca["_".charCodeAt(0)]=63;var Da={}; +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */Da.read=function(t,e,i,r,o){var s,n,a=8*o-r-1,l=(1<>1,c=-7,h=i?o-1:0,A=i?-1:1,p=t[e+h];for(h+=A,s=p&(1<<-c)-1,p>>=-c,c+=a;c>0;s=256*s+t[e+h],h+=A,c-=8);for(n=s&(1<<-c)-1,s>>=-c,c+=r;c>0;n=256*n+t[e+h],h+=A,c-=8);if(0===s)s=1-d;else{if(s===l)return n?NaN:1/0*(p?-1:1);n+=Math.pow(2,r),s-=d}return(p?-1:1)*n*Math.pow(2,s-r)},Da.write=function(t,e,i,r,o,s){var n,a,l,d=8*s-o-1,c=(1<>1,A=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,g=r?1:-1,f=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,n=c):(n=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-n))<1&&(n--,l*=2),(e+=n+h>=1?A/l:A*Math.pow(2,1-h))*l>=2&&(n++,l/=2),n+h>=c?(a=0,n=c):n+h>=1?(a=(e*l-1)*Math.pow(2,o),n+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,o),n=0));o>=8;t[i+p]=255&a,p+=g,a/=256,o-=8);for(n=n<0;t[i+p]=255&n,p+=g,n/=256,d-=8);t[i+p-g]|=128*f}, +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +function(t){const e=Ea,i=Da,r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=n,t.SlowBuffer=function(t){+t!=t&&(t=0);return n.alloc(+t)},t.INSPECT_MAX_BYTES=50;const o=2147483647;function s(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,n.prototype),e}function n(t,e,i){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return d(t)}return a(t,e,i)}function a(t,e,i){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!n.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const i=0|p(t,e);let r=s(i);const o=r.write(t,e);o!==i&&(r=r.slice(0,o));return r}(t,e);if(ArrayBuffer.isView(t))return function(t){if($(t,Uint8Array)){const e=new Uint8Array(t);return h(e.buffer,e.byteOffset,e.byteLength)}return c(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if($(t,ArrayBuffer)||t&&$(t.buffer,ArrayBuffer))return h(t,e,i);if("undefined"!=typeof SharedArrayBuffer&&($(t,SharedArrayBuffer)||t&&$(t.buffer,SharedArrayBuffer)))return h(t,e,i);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return n.from(r,e,i);const o=function(t){if(n.isBuffer(t)){const e=0|A(t.length),i=s(e);return 0===i.length||t.copy(i,0,0,e),i}if(void 0!==t.length)return"number"!=typeof t.length||j(t.length)?s(0):c(t);if("Buffer"===t.type&&Array.isArray(t.data))return c(t.data)}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return n.from(t[Symbol.toPrimitive]("string"),e,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function d(t){return l(t),s(t<0?0:0|A(t))}function c(t){const e=t.length<0?0:0|A(t.length),i=s(e);for(let r=0;r=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function p(t,e){if(n.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||$(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const i=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===i)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return Y(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return N(t).length;default:if(o)return r?-1:Y(t).length;e=(""+e).toLowerCase(),o=!0}}function g(t,e,i){let r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return S(this,e,i);case"utf8":case"utf-8":return x(this,e,i);case"ascii":return I(this,e,i);case"latin1":case"binary":return B(this,e,i);case"base64":return E(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,i);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function f(t,e,i){const r=t[e];t[e]=t[i],t[i]=r}function u(t,e,i,r,o){if(0===t.length)return-1;if("string"==typeof i?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),j(i=+i)&&(i=o?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(o)return-1;i=t.length-1}else if(i<0){if(!o)return-1;i=0}if("string"==typeof e&&(e=n.from(e,r)),n.isBuffer(e))return 0===e.length?-1:m(t,e,i,r,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):m(t,[e],i,r,o);throw new TypeError("val must be string, number or Buffer")}function m(t,e,i,r,o){let s,n=1,a=t.length,l=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;n=2,a/=2,l/=2,i/=2}function d(t,e){return 1===n?t[e]:t.readUInt16BE(e*n)}if(o){let r=-1;for(s=i;sa&&(i=a-l),s=i;s>=0;s--){let i=!0;for(let r=0;ro&&(r=o):r=o;const s=e.length;let n;for(r>s/2&&(r=s/2),n=0;n>8,o=i%256,s.push(o),s.push(r);return s}(e,t.length-i),t,i,r)}function E(t,i,r){return 0===i&&r===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(i,r))}function x(t,e,i){i=Math.min(t.length,i);const r=[];let o=e;for(;o239?4:e>223?3:e>191?2:1;if(o+n<=i){let i,r,a,l;switch(n){case 1:e<128&&(s=e);break;case 2:i=t[o+1],128==(192&i)&&(l=(31&e)<<6|63&i,l>127&&(s=l));break;case 3:i=t[o+1],r=t[o+2],128==(192&i)&&128==(192&r)&&(l=(15&e)<<12|(63&i)<<6|63&r,l>2047&&(l<55296||l>57343)&&(s=l));break;case 4:i=t[o+1],r=t[o+2],a=t[o+3],128==(192&i)&&128==(192&r)&&128==(192&a)&&(l=(15&e)<<18|(63&i)<<12|(63&r)<<6|63&a,l>65535&&l<1114112&&(s=l))}}null===s?(s=65533,n=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),o+=n}return function(t){const e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);let i="",r=0;for(;rr.length?(n.isBuffer(e)||(e=n.from(e)),e.copy(r,o)):Uint8Array.prototype.set.call(r,e,o);else{if(!n.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(r,o)}o+=e.length}return r},n.byteLength=p,n.prototype._isBuffer=!0,n.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;ei&&(e+=" ... "),""},r&&(n.prototype[r]=n.prototype.inspect),n.prototype.compare=function(t,e,i,r,o){if($(t,Uint8Array)&&(t=n.from(t,t.offset,t.byteLength)),!n.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===i&&(i=t?t.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),e<0||i>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=i)return 0;if(r>=o)return-1;if(e>=i)return 1;if(this===t)return 0;let s=(o>>>=0)-(r>>>=0),a=(i>>>=0)-(e>>>=0);const l=Math.min(s,a),d=this.slice(r,o),c=t.slice(e,i);for(let t=0;t>>=0,isFinite(i)?(i>>>=0,void 0===r&&(r="utf8")):(r=i,i=void 0)}const o=this.length-e;if((void 0===i||i>o)&&(i=o),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let s=!1;for(;;)switch(r){case"hex":return v(this,t,e,i);case"utf8":case"utf-8":return w(this,t,e,i);case"ascii":case"latin1":case"binary":return y(this,t,e,i);case"base64":return b(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,i);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const C=4096;function I(t,e,i){let r="";i=Math.min(t.length,i);for(let o=e;or)&&(i=r);let o="";for(let r=e;ri)throw new RangeError("Trying to access beyond buffer length")}function D(t,e,i,r,o,s){if(!n.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function M(t,e,i,r,o){U(e,r,o,t,i,7);let s=Number(e&BigInt(4294967295));t[i++]=s,s>>=8,t[i++]=s,s>>=8,t[i++]=s,s>>=8,t[i++]=s;let n=Number(e>>BigInt(32)&BigInt(4294967295));return t[i++]=n,n>>=8,t[i++]=n,n>>=8,t[i++]=n,n>>=8,t[i++]=n,i}function T(t,e,i,r,o){U(e,r,o,t,i,7);let s=Number(e&BigInt(4294967295));t[i+7]=s,s>>=8,t[i+6]=s,s>>=8,t[i+5]=s,s>>=8,t[i+4]=s;let n=Number(e>>BigInt(32)&BigInt(4294967295));return t[i+3]=n,n>>=8,t[i+2]=n,n>>=8,t[i+1]=n,n>>=8,t[i]=n,i+8}function Q(t,e,i,r,o,s){if(i+r>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function F(t,e,r,o,s){return e=+e,r>>>=0,s||Q(t,0,r,4),i.write(t,e,r,o,23,4),r+4}function O(t,e,r,o,s){return e=+e,r>>>=0,s||Q(t,0,r,8),i.write(t,e,r,o,52,8),r+8}n.prototype.slice=function(t,e){const i=this.length;(t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e>>=0,e>>>=0,i||k(t,e,this.length);let r=this[t],o=1,s=0;for(;++s>>=0,e>>>=0,i||k(t,e,this.length);let r=this[t+--e],o=1;for(;e>0&&(o*=256);)r+=this[t+--e]*o;return r},n.prototype.readUint8=n.prototype.readUInt8=function(t,e){return t>>>=0,e||k(t,1,this.length),this[t]},n.prototype.readUint16LE=n.prototype.readUInt16LE=function(t,e){return t>>>=0,e||k(t,2,this.length),this[t]|this[t+1]<<8},n.prototype.readUint16BE=n.prototype.readUInt16BE=function(t,e){return t>>>=0,e||k(t,2,this.length),this[t]<<8|this[t+1]},n.prototype.readUint32LE=n.prototype.readUInt32LE=function(t,e){return t>>>=0,e||k(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},n.prototype.readUint32BE=n.prototype.readUInt32BE=function(t,e){return t>>>=0,e||k(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},n.prototype.readBigUInt64LE=Z((function(t){G(t>>>=0,"offset");const e=this[t],i=this[t+7];void 0!==e&&void 0!==i||z(t,this.length-8);const r=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,o=this[++t]+256*this[++t]+65536*this[++t]+i*2**24;return BigInt(r)+(BigInt(o)<>>=0,"offset");const e=this[t],i=this[t+7];void 0!==e&&void 0!==i||z(t,this.length-8);const r=e*2**24+65536*this[++t]+256*this[++t]+this[++t],o=this[++t]*2**24+65536*this[++t]+256*this[++t]+i;return(BigInt(r)<>>=0,e>>>=0,i||k(t,e,this.length);let r=this[t],o=1,s=0;for(;++s=o&&(r-=Math.pow(2,8*e)),r},n.prototype.readIntBE=function(t,e,i){t>>>=0,e>>>=0,i||k(t,e,this.length);let r=e,o=1,s=this[t+--r];for(;r>0&&(o*=256);)s+=this[t+--r]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*e)),s},n.prototype.readInt8=function(t,e){return t>>>=0,e||k(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},n.prototype.readInt16LE=function(t,e){t>>>=0,e||k(t,2,this.length);const i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},n.prototype.readInt16BE=function(t,e){t>>>=0,e||k(t,2,this.length);const i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},n.prototype.readInt32LE=function(t,e){return t>>>=0,e||k(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},n.prototype.readInt32BE=function(t,e){return t>>>=0,e||k(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},n.prototype.readBigInt64LE=Z((function(t){G(t>>>=0,"offset");const e=this[t],i=this[t+7];void 0!==e&&void 0!==i||z(t,this.length-8);const r=this[t+4]+256*this[t+5]+65536*this[t+6]+(i<<24);return(BigInt(r)<>>=0,"offset");const e=this[t],i=this[t+7];void 0!==e&&void 0!==i||z(t,this.length-8);const r=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(r)<>>=0,e||k(t,4,this.length),i.read(this,t,!0,23,4)},n.prototype.readFloatBE=function(t,e){return t>>>=0,e||k(t,4,this.length),i.read(this,t,!1,23,4)},n.prototype.readDoubleLE=function(t,e){return t>>>=0,e||k(t,8,this.length),i.read(this,t,!0,52,8)},n.prototype.readDoubleBE=function(t,e){return t>>>=0,e||k(t,8,this.length),i.read(this,t,!1,52,8)},n.prototype.writeUintLE=n.prototype.writeUIntLE=function(t,e,i,r){if(t=+t,e>>>=0,i>>>=0,!r){D(this,t,e,i,Math.pow(2,8*i)-1,0)}let o=1,s=0;for(this[e]=255&t;++s>>=0,i>>>=0,!r){D(this,t,e,i,Math.pow(2,8*i)-1,0)}let o=i-1,s=1;for(this[e+o]=255&t;--o>=0&&(s*=256);)this[e+o]=t/s&255;return e+i},n.prototype.writeUint8=n.prototype.writeUInt8=function(t,e,i){return t=+t,e>>>=0,i||D(this,t,e,1,255,0),this[e]=255&t,e+1},n.prototype.writeUint16LE=n.prototype.writeUInt16LE=function(t,e,i){return t=+t,e>>>=0,i||D(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},n.prototype.writeUint16BE=n.prototype.writeUInt16BE=function(t,e,i){return t=+t,e>>>=0,i||D(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},n.prototype.writeUint32LE=n.prototype.writeUInt32LE=function(t,e,i){return t=+t,e>>>=0,i||D(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},n.prototype.writeUint32BE=n.prototype.writeUInt32BE=function(t,e,i){return t=+t,e>>>=0,i||D(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},n.prototype.writeBigUInt64LE=Z((function(t){return M(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),n.prototype.writeBigUInt64BE=Z((function(t){return T(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),n.prototype.writeIntLE=function(t,e,i,r){if(t=+t,e>>>=0,!r){const r=Math.pow(2,8*i-1);D(this,t,e,i,r-1,-r)}let o=0,s=1,n=0;for(this[e]=255&t;++o>>=0,!r){const r=Math.pow(2,8*i-1);D(this,t,e,i,r-1,-r)}let o=i-1,s=1,n=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===n&&0!==this[e+o+1]&&(n=1),this[e+o]=(t/s|0)-n&255;return e+i},n.prototype.writeInt8=function(t,e,i){return t=+t,e>>>=0,i||D(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},n.prototype.writeInt16LE=function(t,e,i){return t=+t,e>>>=0,i||D(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},n.prototype.writeInt16BE=function(t,e,i){return t=+t,e>>>=0,i||D(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},n.prototype.writeInt32LE=function(t,e,i){return t=+t,e>>>=0,i||D(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},n.prototype.writeInt32BE=function(t,e,i){return t=+t,e>>>=0,i||D(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},n.prototype.writeBigInt64LE=Z((function(t){return M(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),n.prototype.writeBigInt64BE=Z((function(t){return T(this,t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),n.prototype.writeFloatLE=function(t,e,i){return F(this,t,e,!0,i)},n.prototype.writeFloatBE=function(t,e,i){return F(this,t,e,!1,i)},n.prototype.writeDoubleLE=function(t,e,i){return O(this,t,e,!0,i)},n.prototype.writeDoubleBE=function(t,e,i){return O(this,t,e,!1,i)},n.prototype.copy=function(t,e,i,r){if(!n.isBuffer(t))throw new TypeError("argument should be a Buffer");if(i||(i=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(o=e;o=r+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}function U(t,e,i,r,o,s){if(t>i||t= 0${i} and < 2${i} ** ${8*(s+1)}${i}`:`>= -(2${i} ** ${8*(s+1)-1}${i}) and < 2 ** ${8*(s+1)-1}${i}`,new P.ERR_OUT_OF_RANGE("value",r,t)}!function(t,e,i){G(e,"offset"),void 0!==t[e]&&void 0!==t[e+i]||z(e,t.length-(i+1))}(r,o,s)}function G(t,e){if("number"!=typeof t)throw new P.ERR_INVALID_ARG_TYPE(e,"number",t)}function z(t,e,i){if(Math.floor(t)!==t)throw G(t,i),new P.ERR_OUT_OF_RANGE("offset","an integer",t);if(e<0)throw new P.ERR_BUFFER_OUT_OF_BOUNDS;throw new P.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${e}`,t)}H("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),H("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),H("ERR_OUT_OF_RANGE",(function(t,e,i){let r=`The value of "${t}" is out of range.`,o=i;return Number.isInteger(i)&&Math.abs(i)>2**32?o=L(String(i)):"bigint"==typeof i&&(o=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(o=L(o)),o+="n"),r+=` It must be ${e}. Received ${o}`,r}),RangeError);const K=/[^+/0-9A-Za-z-_]/g;function Y(t,e){let i;e=e||1/0;const r=t.length;let o=null;const s=[];for(let n=0;n55295&&i<57344){if(!o){if(i>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(n+1===r){(e-=3)>-1&&s.push(239,191,189);continue}o=i;continue}if(i<56320){(e-=3)>-1&&s.push(239,191,189),o=i;continue}i=65536+(o-55296<<10|i-56320)}else o&&(e-=3)>-1&&s.push(239,191,189);if(o=null,i<128){if((e-=1)<0)break;s.push(i)}else if(i<2048){if((e-=2)<0)break;s.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;s.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return s}function N(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function J(t,e,i,r){let o;for(o=0;o=e.length||o>=t.length);++o)e[o+i]=t[o];return o}function $(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function j(t){return t!=t}const W=function(){const t="0123456789abcdef",e=new Array(256);for(let i=0;i<16;++i){const r=16*i;for(let o=0;o<16;++o)e[r+o]=t[i]+t[o]}return e}();function Z(t){return"undefined"==typeof BigInt?q:t}function q(){throw new Error("BigInt not supported")}}(_a);class Ma{constructor(t){this.ESP_RAM_BLOCK=6144,this.ESP_FLASH_BEGIN=2,this.ESP_FLASH_DATA=3,this.ESP_FLASH_END=4,this.ESP_MEM_BEGIN=5,this.ESP_MEM_END=6,this.ESP_MEM_DATA=7,this.ESP_WRITE_REG=9,this.ESP_READ_REG=10,this.ESP_SPI_ATTACH=13,this.ESP_CHANGE_BAUDRATE=15,this.ESP_FLASH_DEFL_BEGIN=16,this.ESP_FLASH_DEFL_DATA=17,this.ESP_FLASH_DEFL_END=18,this.ESP_SPI_FLASH_MD5=19,this.ESP_ERASE_FLASH=208,this.ESP_ERASE_REGION=209,this.ESP_READ_FLASH=210,this.ESP_RUN_USER_CODE=211,this.ESP_IMAGE_MAGIC=233,this.ESP_CHECKSUM_MAGIC=239,this.ROM_INVALID_RECV_MSG=5,this.ERASE_REGION_TIMEOUT_PER_MB=3e4,this.ERASE_WRITE_TIMEOUT_PER_MB=4e4,this.MD5_TIMEOUT_PER_MB=8e3,this.CHIP_ERASE_TIMEOUT=12e4,this.FLASH_READ_TIMEOUT=1e5,this.MAX_TIMEOUT=2*this.CHIP_ERASE_TIMEOUT,this.CHIP_DETECT_MAGIC_REG_ADDR=1073745920,this.DETECTED_FLASH_SIZES={18:"256KB",19:"512KB",20:"1MB",21:"2MB",22:"4MB",23:"8MB",24:"16MB"},this.DETECTED_FLASH_SIZES_NUM={18:256,19:512,20:1024,21:2048,22:4096,23:8192,24:16384},this.USB_JTAG_SERIAL_PID=4097,this.romBaudrate=115200,this.debugLogging=!1,this.checksum=function(t){let e,i=239;for(e=0;esetTimeout(e,t)))}write(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.terminal?e?this.terminal.writeLine(t):this.terminal.write(t):console.log(t)}error(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.write(`Error: ${t}`,e)}info(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.write(t,e)}debug(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.debugLogging&&this.write(`Debug: ${t}`,e)}_shortToBytearray(t){return new Uint8Array([255&t,t>>8&255])}_intToByteArray(t){return new Uint8Array([255&t,t>>8&255,t>>16&255,t>>24&255])}_byteArrayToShort(t,e){return t|e>>8}_byteArrayToInt(t,e,i,r){return t|e<<8|i<<16|r<<24}_appendBuffer(t,e){const i=new Uint8Array(t.byteLength+e.byteLength);return i.set(new Uint8Array(t),0),i.set(new Uint8Array(e),t.byteLength),i.buffer}_appendArray(t,e){const i=new Uint8Array(t.length+e.length);return i.set(t,0),i.set(e,t.length),i}ui8ToBstr(t){let e="";for(let i=0;i0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e3;for(let i=0;i<100;i++){const i=await this.transport.read(e),r=i[0],o=i[1],s=this._byteArrayToInt(i[4],i[5],i[6],i[7]),n=i.slice(8);if(1==r){if(null==t||o==t)return[s,n];if(0!=n[0]&&n[1]==this.ROM_INVALID_RECV_MSG)throw await this.flushInput(),new Jr("unsupported command error")}}throw new Jr("invalid response")}async command(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint8Array(0),i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:3e3;if(null!=t){this.transport.tracing&&this.transport.trace(`command op:0x${t.toString(16).padStart(2,"0")} data len=${e.length} wait_response=${r?1:0} timeout=${(o/1e3).toFixed(3)} data=${this.transport.hexConvert(e)}`);const s=new Uint8Array(8+e.length);let n;for(s[0]=0,s[1]=t,s[2]=this._shortToBytearray(e.length)[0],s[3]=this._shortToBytearray(e.length)[1],s[4]=this._intToByteArray(i)[0],s[5]=this._intToByteArray(i)[1],s[6]=this._intToByteArray(i)[2],s[7]=this._intToByteArray(i)[3],n=0;n1&&void 0!==arguments[1]?arguments[1]:3e3;const i=this._intToByteArray(t);return(await this.command(this.ESP_READ_REG,i,void 0,void 0,e))[0]}async writeReg(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4294967295,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=this._appendArray(this._intToByteArray(t),this._intToByteArray(e));s=this._appendArray(s,this._intToByteArray(i)),s=this._appendArray(s,this._intToByteArray(r)),o>0&&(s=this._appendArray(s,this._intToByteArray(this.chip.UART_DATE_REG_ADDR)),s=this._appendArray(s,this._intToByteArray(0)),s=this._appendArray(s,this._intToByteArray(0)),s=this._appendArray(s,this._intToByteArray(o))),await this.checkCommand("write target memory",this.ESP_WRITE_REG,s)}async sync(){this.debug("Sync");const t=new Uint8Array(36);let e;for(t[0]=7,t[1]=7,t[2]=18,t[3]=32,e=0;e<32;e++)t[4+e]=85;try{return await this.command(8,t,void 0,void 0,100)}catch(t){throw this.debug("Sync err "+t),t}}async _connectAttempt(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default_reset",e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.debug("_connect_attempt "+t+" "+e),"no_reset"!==t)if(this.transport.getPid()===this.USB_JTAG_SERIAL_PID)await async function(t){await t.setRTS(!1),await t.setDTR(!1),await ya(100),await t.setDTR(!0),await t.setRTS(!1),await ya(100),await t.setRTS(!0),await t.setDTR(!1),await t.setRTS(!0),await ya(100),await t.setRTS(!1),await t.setDTR(!1)}(this.transport);else{const t=e?"D0|R1|W100|W2000|D1|R0|W50|D0":"D0|R1|W100|D1|R0|W50|D0";await ba(this.transport,t)}let i=0,r=!0;for(;r;){try{i+=(await this.transport.read(1e3)).length}catch(t){if(this.debug(t.message),t instanceof Error){r=!1;break}}await this._sleep(50)}for(this.transport.slipReaderEnabled=!0,i=7;i--;){try{const t=await this.sync();return this.debug(t[0].toString()),"success"}catch(t){t instanceof Error&&(e?this.info("_",!1):this.info(".",!1))}await this._sleep(50)}return"error"}async connect(){let t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default_reset",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:7,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(this.info("Connecting...",!1),await this.transport.connect(this.romBaudrate,this.serialOptions),t=0;t>>0;this.debug("Chip Magic "+t.toString(16));const e=await async function(t){switch(t){case 15736195:{const{ESP32ROM:t}=await Promise.resolve().then((function(){return $a}));return new t}case 1867591791:case 2084675695:{const{ESP32C2ROM:t}=await Promise.resolve().then((function(){return nl}));return new t}case 1763790959:case 456216687:case 1216438383:case 1130455151:{const{ESP32C3ROM:t}=await Promise.resolve().then((function(){return tl}));return new t}case 752910447:{const{ESP32C6ROM:t}=await Promise.resolve().then((function(){return Al}));return new t}case 3619110528:{const{ESP32H2ROM:t}=await Promise.resolve().then((function(){return vl}));return new t}case 9:{const{ESP32S3ROM:t}=await Promise.resolve().then((function(){return xl}));return new t}case 1990:{const{ESP32S2ROM:t}=await Promise.resolve().then((function(){return kl}));return new t}case 4293968129:{const{ESP8266ROM:t}=await Promise.resolve().then((function(){return Ol}));return new t}default:return null}}(t);if(null===this.chip)throw new Jr(`Unexpected CHIP magic value ${t}. Failed to autodetect chip type.`);this.chip=e}}async detectChip(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default_reset";await this.connect(t),this.info("Detecting chip type... ",!1),null!=this.chip?this.info(this.chip.CHIP_NAME):this.info("unknown!")}async checkCommand(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Uint8Array(0),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:3e3;this.debug("check_command "+t);const s=await this.command(e,i,r,void 0,o);return s[1].length>4?s[1]:s[0]}async memBegin(t,e,i,r){this.debug("mem_begin "+t+" "+e+" "+i+" "+r.toString(16));let o=this._appendArray(this._intToByteArray(t),this._intToByteArray(e));o=this._appendArray(o,this._intToByteArray(i)),o=this._appendArray(o,this._intToByteArray(r)),await this.checkCommand("enter RAM download mode",this.ESP_MEM_BEGIN,o)}async memBlock(t,e){let i=this._appendArray(this._intToByteArray(t.length),this._intToByteArray(e));i=this._appendArray(i,this._intToByteArray(0)),i=this._appendArray(i,this._intToByteArray(0)),i=this._appendArray(i,t);const r=this.checksum(t);await this.checkCommand("write to target RAM",this.ESP_MEM_DATA,i,r)}async memFinish(t){const e=0===t?1:0,i=this._appendArray(this._intToByteArray(e),this._intToByteArray(t));await this.checkCommand("leave RAM download mode",this.ESP_MEM_END,i,void 0,50)}async flashSpiAttach(t){const e=this._intToByteArray(t);await this.checkCommand("configure SPI flash pins",this.ESP_SPI_ATTACH,e)}async flashBegin(t,e){const i=Math.floor((t+this.FLASH_WRITE_SIZE-1)/this.FLASH_WRITE_SIZE),r=this.chip.getEraseSize(e,t),o=new Date,s=o.getTime();let n=3e3;0==this.IS_STUB&&(n=this.timeoutPerMb(this.ERASE_REGION_TIMEOUT_PER_MB,t)),this.debug("flash begin "+r+" "+i+" "+this.FLASH_WRITE_SIZE+" "+e+" "+t);let a=this._appendArray(this._intToByteArray(r),this._intToByteArray(i));a=this._appendArray(a,this._intToByteArray(this.FLASH_WRITE_SIZE)),a=this._appendArray(a,this._intToByteArray(e)),0==this.IS_STUB&&(a=this._appendArray(a,this._intToByteArray(0))),await this.checkCommand("enter Flash download mode",this.ESP_FLASH_BEGIN,a,void 0,n);const l=o.getTime();return 0!=t&&0==this.IS_STUB&&this.info("Took "+(l-s)/1e3+"."+(l-s)%1e3+"s to erase flash block"),i}async flashDeflBegin(t,e,i){const r=Math.floor((e+this.FLASH_WRITE_SIZE-1)/this.FLASH_WRITE_SIZE),o=Math.floor((t+this.FLASH_WRITE_SIZE-1)/this.FLASH_WRITE_SIZE),s=new Date,n=s.getTime();let a,l;this.IS_STUB?(a=t,l=3e3):(a=o*this.FLASH_WRITE_SIZE,l=this.timeoutPerMb(this.ERASE_REGION_TIMEOUT_PER_MB,a)),this.info("Compressed "+t+" bytes to "+e+"...");let d=this._appendArray(this._intToByteArray(a),this._intToByteArray(r));d=this._appendArray(d,this._intToByteArray(this.FLASH_WRITE_SIZE)),d=this._appendArray(d,this._intToByteArray(i)),"ESP32-S2"!==this.chip.CHIP_NAME&&"ESP32-S3"!==this.chip.CHIP_NAME&&"ESP32-C3"!==this.chip.CHIP_NAME&&"ESP32-C2"!==this.chip.CHIP_NAME||!1!==this.IS_STUB||(d=this._appendArray(d,this._intToByteArray(0))),await this.checkCommand("enter compressed flash mode",this.ESP_FLASH_DEFL_BEGIN,d,void 0,l);const c=s.getTime();return 0!=t&&!1===this.IS_STUB&&this.info("Took "+(c-n)/1e3+"."+(c-n)%1e3+"s to erase flash block"),r}async flashBlock(t,e,i){let r=this._appendArray(this._intToByteArray(t.length),this._intToByteArray(e));r=this._appendArray(r,this._intToByteArray(0)),r=this._appendArray(r,this._intToByteArray(0)),r=this._appendArray(r,t);const o=this.checksum(t);await this.checkCommand("write to target Flash after seq "+e,this.ESP_FLASH_DATA,r,o,i)}async flashDeflBlock(t,e,i){let r=this._appendArray(this._intToByteArray(t.length),this._intToByteArray(e));r=this._appendArray(r,this._intToByteArray(0)),r=this._appendArray(r,this._intToByteArray(0)),r=this._appendArray(r,t);const o=this.checksum(t);this.debug("flash_defl_block "+t[0].toString(16)+" "+t[1].toString(16)),await this.checkCommand("write compressed data to flash after seq "+e,this.ESP_FLASH_DEFL_DATA,r,o,i)}async flashFinish(){const t=arguments.length>0&&void 0!==arguments[0]&&arguments[0]?0:1,e=this._intToByteArray(t);await this.checkCommand("leave Flash mode",this.ESP_FLASH_END,e)}async flashDeflFinish(){const t=arguments.length>0&&void 0!==arguments[0]&&arguments[0]?0:1,e=this._intToByteArray(t);await this.checkCommand("leave compressed flash mode",this.ESP_FLASH_DEFL_END,e)}async runSpiflashCommand(t,e,i){const r=this.chip.SPI_REG_BASE,o=r+0,s=r+this.chip.SPI_USR_OFFS,n=r+this.chip.SPI_USR1_OFFS,a=r+this.chip.SPI_USR2_OFFS,l=r+this.chip.SPI_W0_OFFS;let d;d=null!=this.chip.SPI_MOSI_DLEN_OFFS?async(t,e)=>{const i=r+this.chip.SPI_MOSI_DLEN_OFFS,o=r+this.chip.SPI_MISO_DLEN_OFFS;t>0&&await this.writeReg(i,t-1),e>0&&await this.writeReg(o,e-1)}:async(t,e)=>{const i=n,r=(0===e?0:e-1)<<8|(0===t?0:t-1)<<17;await this.writeReg(i,r)};const c=1<<18;if(i>32)throw new Jr("Reading more than 32 bits back from a SPI flash operation is unsupported");if(e.length>64)throw new Jr("Writing more than 64 bytes of data with one SPI command is unsupported");const h=8*e.length,A=await this.readReg(s),p=await this.readReg(a);let g,f=1<<31;i>0&&(f|=268435456),h>0&&(f|=134217728),await d(h,i),await this.writeReg(s,f);let u=7<<28|t;if(await this.writeReg(a,u),0==h)await this.writeReg(l,0);else{if(e.length%4!=0){const t=new Uint8Array(e.length%4);e=this._appendArray(e,t)}let t=l;for(g=0;g("00"+t.toString(16)).slice(-2))).join("")}async flashMd5sum(t,e){const i=this.timeoutPerMb(this.MD5_TIMEOUT_PER_MB,e);let r=this._appendArray(this._intToByteArray(t),this._intToByteArray(e));r=this._appendArray(r,this._intToByteArray(0)),r=this._appendArray(r,this._intToByteArray(0));let o=await this.checkCommand("calculate md5sum",this.ESP_SPI_FLASH_MD5,r,void 0,i);o instanceof Uint8Array&&o.length>16&&(o=o.slice(0,16));return this.toHex(o)}async readFlash(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=this._appendArray(this._intToByteArray(t),this._intToByteArray(e));r=this._appendArray(r,this._intToByteArray(4096)),r=this._appendArray(r,this._intToByteArray(1024));const o=await this.checkCommand("read flash",this.ESP_READ_FLASH,r);if(0!=o)throw new Jr("Failed to read memory: "+o);let s=new Uint8Array(0);for(;s.length0&&(s=this._appendArray(s,t),await this.transport.write(this._intToByteArray(s.length)),i&&i(t,s.length,e))}return s}async runStub(){this.info("Uploading stub...");let t=_a.Buffer.from(this.chip.ROM_TEXT,"base64").toString("binary"),e=t.split("").map((function(t){return t.charCodeAt(0)}));const i=new Uint8Array(e);t=_a.Buffer.from(this.chip.ROM_DATA,"base64").toString("binary"),e=t.split("").map((function(t){return t.charCodeAt(0)}));const r=new Uint8Array(e);let o,s=Math.floor((i.length+this.ESP_RAM_BLOCK-1)/this.ESP_RAM_BLOCK);for(await this.memBegin(i.length,s,this.ESP_RAM_BLOCK,this.chip.TEXT_START),o=0;o0&&void 0!==arguments[0]?arguments[0]:"default_reset";await this.detectChip(t);const e=await this.chip.getChipDescription(this);return this.info("Chip is "+e),this.info("Features: "+await this.chip.getChipFeatures(this)),this.info("Crystal is "+await this.chip.getCrystalFreq(this)+"MHz"),this.info("MAC: "+await this.chip.readMac(this)),await this.chip.readMac(this),void 0!==this.chip.postConnect&&await this.chip.postConnect(this),await this.runStub(),this.romBaudrate!==this.baudrate&&await this.changeBaud(),e}parseFlashSizeArg(t){if(void 0===this.chip.FLASH_SIZES[t])throw new Jr("Flash size "+t+" is not supported by this chip type. Supported sizes: "+this.chip.FLASH_SIZES);return this.chip.FLASH_SIZES[t]}_updateImageFlashParams(t,e,i,r,o){if(this.debug("_update_image_flash_params "+i+" "+r+" "+o),t.length<8)return t;if(e!=this.chip.BOOTLOADER_FLASH_OFFSET)return t;if("keep"===i&&"keep"===r&&"keep"===o)return this.info("Not changing the image"),t;const s=parseInt(t[0]);let n=parseInt(t[2]);const a=parseInt(t[3]);if(s!==this.ESP_IMAGE_MAGIC)return this.info("Warning: Image file at 0x"+e.toString(16)+" doesn't look like an image file, so not changing any flash settings."),t;if("keep"!==r){n={qio:0,qout:1,dio:2,dout:3}[r]}let l=15&a;if("keep"!==o){l={"40m":0,"26m":1,"20m":2,"80m":15}[o]}let d=240&a;"keep"!==i&&(d=this.parseFlashSizeArg(i));const c=n<<8|l+d;return this.info("Flash params set to "+c.toString(16)),parseInt(t[2])!==n<<8&&(t=t.substring(0,2)+(n<<8).toString()+t.substring(3)),parseInt(t[3])!==l+d&&(t=t.substring(0,3)+(l+d).toString()+t.substring(4)),t}async writeFlash(t){if(this.debug("EspLoader program"),"keep"!==t.flashSize){const e=this.flashSizeBytes(t.flashSize);for(let i=0;ie)throw new Jr(`File ${i+1} doesn't fit in the available flash`)}let e,i;!0===this.IS_STUB&&!0===t.eraseAll&&await this.eraseFlash();for(let r=0;r0&&(e+="ÿÿÿÿ".substring(4-o)),i=t.fileArray[r].address,this.debug("Image Length "+e.length),0===e.length){this.debug("Warning: File is empty");continue}e=this._updateImageFlashParams(e,i,t.flashSize,t.flashMode,t.flashFreq);let s=null;t.calculateMD5Hash&&(s=t.calculateMD5Hash(e),this.debug("Image MD5 "+s));const n=e.length;let a;if(t.compress){const t=this.bstrToUi8(e);e=this.ui8ToBstr(ma(t,{level:9})),a=await this.flashDeflBegin(n,e.length,i)}else a=await this.flashBegin(n,i);let l=0,d=0;const c=e.length;t.reportProgress&&t.reportProgress(r,0,c);let h=new Date;const A=h.getTime();let p=5e3;const g=new va({chunkSize:1});let f=0;for(g.onData=function(t){f+=t.byteLength};e.length>0;){this.debug("Write loop "+i+" "+l+" "+a),this.info("Writing at 0x"+(i+f).toString(16)+"... ("+Math.floor(100*(l+1)/a)+"%)");const o=this.bstrToUi8(e.slice(0,this.FLASH_WRITE_SIZE));if(!t.compress)throw new Jr("Yet to handle Non Compressed writes");{const t=f;g.push(o,!1);const e=f-t;let i=3e3;this.timeoutPerMb(this.ERASE_WRITE_TIMEOUT_PER_MB,e)>3e3&&(i=this.timeoutPerMb(this.ERASE_WRITE_TIMEOUT_PER_MB,e)),!1===this.IS_STUB&&(p=i),await this.flashDeflBlock(o,l,p),this.IS_STUB&&(p=i)}d+=o.length,e=e.slice(this.FLASH_WRITE_SIZE,e.length),l++,t.reportProgress&&t.reportProgress(r,d,c)}this.IS_STUB&&await this.readReg(this.CHIP_DETECT_MAGIC_REG_ADDR,p),h=new Date;const u=h.getTime()-A;if(t.compress&&this.info("Wrote "+n+" bytes ("+d+" compressed) at 0x"+i.toString(16)+" in "+u/1e3+" seconds."),s){const t=await this.flashMd5sum(i,n);if(new String(t).valueOf()!=new String(s).valueOf())throw this.info("File md5: "+s),this.info("Flash md5: "+t),new Jr("MD5 of file does not match data in flash!");this.info("Hash of data verified.")}}this.info("Leaving..."),this.IS_STUB&&(await this.flashBegin(0,0),t.compress?await this.flashDeflFinish():await this.flashFinish())}async flashId(){this.debug("flash_id");const t=await this.readFlashId();this.info("Manufacturer: "+(255&t).toString(16));const e=t>>16&255;this.info("Device: "+(t>>8&255).toString(16)+e.toString(16)),this.info("Detected flash size: "+this.DETECTED_FLASH_SIZES[e])}async getFlashSize(){this.debug("flash_id");const t=await this.readFlashId()>>16&255;return this.DETECTED_FLASH_SIZES_NUM[t]}async hardReset(){await this.transport.setRTS(!0),await this._sleep(100),await this.transport.setRTS(!1)}async softReset(){if(this.IS_STUB){if("ESP8266"!=this.chip.CHIP_NAME)throw new Jr("Soft resetting is currently only supported on ESP8266");await this.command(this.ESP_RUN_USER_CODE,void 0,void 0,!1)}else await this.flashBegin(0,0),await this.flashFinish(!1)}}class Ta{getEraseSize(t,e){return e}}const Qa=async t=>{await t.device.setSignals({dataTerminalReady:!1,requestToSend:!0}),await Ve(250),await t.device.setSignals({dataTerminalReady:!1,requestToSend:!1}),await Ve(250)},Fa=(t,e="")=>{const i=new Blob([t],{type:"text/plain"}),r=URL.createObjectURL(i);((t,e="")=>{const i=document.createElement("a");i.target="_blank",i.href=t,i.download=e,document.body.appendChild(i),i.dispatchEvent(new MouseEvent("click")),document.body.removeChild(i)})(r,e),setTimeout((()=>URL.revokeObjectURL(r)),0)},Oa=d` + :host { + --roboto-font: Roboto, system-ui; + --text-color: rgba(0, 0, 0, 0.6); + --danger-color: #db4437; + + --md-sys-color-primary: #03a9f4; + --md-sys-color-on-primary: #fff; + --md-ref-typeface-brand: var(--roboto-font); + --md-ref-typeface-plain: var(--roboto-font); + + --md-sys-color-surface: #fff; + --md-sys-color-surface-container: #fff; + --md-sys-color-surface-container-high: #fff; + --md-sys-color-surface-container-highest: #f5f5f5; + --md-sys-color-secondary-container: #e0e0e0; + + --md-sys-typescale-headline-font: var(--roboto-font); + --md-sys-typescale-title-font: var(--roboto-font); + } + + a { + color: var(--md-sys-color-primary); + } +`;console.log("ESP Web Tools 10.0.1 by Nabu Casa; https://esphome.github.io/esp-web-tools/");class Pa extends ht{constructor(){super(...arguments),this.logger=console,this._state="DASHBOARD",this._installErase=!1,this._installConfirmed=!1,this._provisionForce=!1,this._wasProvisioned=!1,this._busy=!1,this._selectedSsid=null,this._bodyOverflow=null,this._handleDisconnect=()=>{this._state="ERROR",this._error="Disconnected"}}render(){if(!this.port)return J``;let t,e,i=!1;return void 0===this._client&&"INSTALL"!==this._state&&"LOGS"!==this._state?this._error?[t,e]=this._renderError(this._error):e=this._renderProgress("Connecting"):"INSTALL"===this._state?[t,e,i]=this._renderInstall():"ASK_ERASE"===this._state?[t,e]=this._renderAskErase():"ERROR"===this._state?[t,e]=this._renderError(this._error):"DASHBOARD"===this._state?[t,e,i]=this._client?this._renderDashboard():this._renderDashboardNoImprov():"PROVISION"===this._state?[t,e]=this._renderProvision():"LOGS"===this._state&&([t,e]=this._renderLogs()),J` + + ${t?J`
    ${t}
    `:""} + ${i?J` + + ${Mr} + + `:""} + ${e} +
    + `}_renderProgress(t,e){return J` + + `}_renderError(t){return["Error",J` + +
    + Close +
    + `]}_renderDashboard(){const t=this._manifest.name;let e;return e=J` +
    + + +
    Connected to ${this._info.name}
    +
    + ${this._info.firmware} ${this._info.version} + (${this._info.chipFamily}) +
    +
    + ${this._isSameVersion?"":J` + {this._isSameFirmware?this._startInstall(!1):this._manifest.new_install_prompt_erase?this._state="ASK_ERASE":this._startInstall(!0)}} + > + ${Qr} +
    + ${this._isSameFirmware?`Update ${this._manifest.name}`:`Install ${this._manifest.name}`} +
    +
    + `} + ${void 0===this._client.nextUrl?"":J` + + ${Pr} +
    Visit Device
    +
    + `} + ${this._manifest.home_assistant_domain&&this._client.state===Gr.PROVISIONED?J` + + ${Hr} +
    Add to Home Assistant
    +
    + `:""} + {this._state="PROVISION",this._client.state===Gr.PROVISIONED&&(this._provisionForce=!0)}} + > + ${Fr} +
    + ${this._client.state===Gr.READY?"Connect to Wi-Fi":"Change Wi-Fi"} +
    +
    + {const t=this._client;t&&(await this._closeClientWithoutEvents(t),await Ve(100)),this._client=void 0,this._state="LOGS"}} + > + ${Or} +
    Logs & Console
    +
    + ${this._isSameFirmware&&this._manifest.funding_url?J` + +
    Fund Development
    +
    + `:""} + ${this._isSameVersion?J` + this._startInstall(!0)} + > +
    Erase User Data
    +
    + `:""} +
    +
    + `,[t,e,!0]}_renderDashboardNoImprov(){const t=this._manifest.name;let e;return e=J` +
    + + {this._manifest.new_install_prompt_erase?this._state="ASK_ERASE":this._startInstall(!0)}} + > + ${Qr} +
    ${`Install ${this._manifest.name}`}
    +
    + {this._client=void 0,this._state="LOGS"}} + > + ${Or} +
    Logs & Console
    +
    +
    +
    + `,[t,e,!0]}_renderProvision(){var t;let e,i="Configure Wi-Fi";if(this._busy)return[i,this._renderProgress(void 0===this._ssids?"Scanning for networks":"Trying to connect")];if(this._provisionForce||this._client.state!==Gr.PROVISIONED){let i;switch(this._client.error){case 3:i="Unable to connect";break;case 254:i="Timeout";break;case 0:case 2:break;default:i=`Unknown error (${this._client.error})`}const r=null===(t=this._ssids)||void 0===t?void 0:t.find((t=>t.name===this._selectedSsid));e=J` + + ${Tr} + +
    +
    Connect your device to the network to start using it.
    + ${i?J`

    ${i}

    `:""} + ${null!==this._ssids?J` + {const e=t.target.selectedIndex;this._selectedSsid=e===this._ssids.length?null:this._ssids[e].name}} + > + ${this._ssids.map((t=>J` + + ${t.name} + + `))} + + + Join other… + + + `:""} + ${r?"":J` + + `} + ${!r||r.secured?J` + + `:""} +
    +
    + {this._state="DASHBOARD"}} + > + ${this._installState&&this._installErase?"Skip":"Back"} + + Connect +
    + `}else{i=void 0;const t=!this._wasProvisioned&&(void 0!==this._client.nextUrl||"home_assistant_domain"in this._manifest);e=J` +
    + + ${t?J` + + ${void 0===this._client.nextUrl?"":J` + {this._state="DASHBOARD"}} + > + ${Pr} +
    Visit Device
    +
    + `} + ${this._manifest.home_assistant_domain?J` + {this._state="DASHBOARD"}} + > + ${Hr} +
    Add to Home Assistant
    +
    + `:""} + {this._state="DASHBOARD"}} + > +
    +
    Skip
    +
    +
    + `:""} +
    + + ${t?"":J` +
    + {this._state="DASHBOARD"}} + > + Continue + +
    + `} + `}return[i,e]}_renderAskErase(){return["Erase device",J` +
    +
    + Do you want to erase the device before installing + ${this._manifest.name}? All data on the device will be lost. +
    + +
    +
    + {this._state="DASHBOARD"}} + > + Back + + {const t=this.shadowRoot.querySelector("ew-checkbox");this._startInstall(t.checked)}} + > + Next + +
    + `]}_renderInstall(){let t,e;const i=!this._installErase&&this._isSameFirmware;if(!this._installConfirmed&&this._isSameVersion)t="Erase User Data",e=J` +
    + Do you want to reset your device and erase all user data from your + device? +
    +
    + + Erase User Data + +
    + `;else if(this._installConfirmed)if(this._installState&&"initializing"!==this._installState.state&&"preparing"!==this._installState.state)if("erasing"===this._installState.state)t="Installing",e=this._renderProgress("Erasing");else if("writing"===this._installState.state||"finished"===this._installState.state&&void 0===this._client){let i,r;t="Installing","finished"===this._installState.state?r="Wrapping up":this._installState.details.percentage<4?r="Installing":i=this._installState.details.percentage,e=this._renderProgress(J` + ${r?J`${r}
    `:""} +
    + This will take + ${"ESP8266"===this._installState.chipFamily?"a minute":"2 minutes"}.
    + Keep this page visible to prevent slow down + `,i)}else if("finished"===this._installState.state){t=void 0;const i=null!==this._client;e=J` + + +
    + {this._state=i&&this._installErase?"PROVISION":"DASHBOARD"}} + > + Next + +
    + `}else"error"===this._installState.state&&(t="Installation failed",e=J` + +
    + {this._initialize(),this._state="DASHBOARD"}} + > + Back + +
    + `);else t="Installing",e=this._renderProgress("Preparing installation");else{t="Confirm Installation";const r=i?"update to":"install";e=J` +
    + ${i?J`Your device is running + ${this._info.firmware} ${this._info.version}.

    `:""} + Do you want to ${r} + ${this._manifest.name} ${this._manifest.version}? + ${this._installErase?J`

    All data on the device will be erased.`:""} +
    +
    + {this._state="DASHBOARD"}} + > + Back + + + Install + +
    + `}return[t,e,!1]}_renderLogs(){let t;return t=J` +
    + +
    +
    + {await this.shadowRoot.querySelector("ewt-console").reset()}} + > + Reset Device + + {Fa(this.shadowRoot.querySelector("ewt-console").logs(),"esp-web-tools-logs.txt"),this.shadowRoot.querySelector("ewt-console").reset()}} + > + Download Logs + + {await this.shadowRoot.querySelector("ewt-console").disconnect(),this._state="DASHBOARD",this._initialize()}} + > + Back + +
    + `,["Logs",t]}willUpdate(t){t.has("_state")&&("ERROR"!==this._state&&(this._error=void 0),"PROVISION"===this._state?this._updateSsids():this._provisionForce=!1,"INSTALL"===this._state&&(this._installConfirmed=!1,this._installState=void 0))}async _updateSsids(t=0){const e=this._ssids;let i;this._ssids=void 0,this._busy=!0;try{i=await this._client.scan()}catch(t){return void 0===this._ssids&&(this._ssids=null,this._selectedSsid=null),void(this._busy=!1)}if(0===i.length&&t<3)return console.log("SCHEDULE RETRY",t),void setTimeout((()=>this._updateSsids(t+1)),1e3);e?this._selectedSsid&&!i.find((t=>t.name===this._selectedSsid))&&(this._selectedSsid=i[0].name):this._selectedSsid=i.length?i[0].name:null,this._ssids=i,this._busy=!1}firstUpdated(t){super.firstUpdated(t),this._bodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden",this._initialize()}updated(t){super.updated(t),t.has("_state")&&this.setAttribute("state",this._state),"PROVISION"===this._state&&(t.has("_selectedSsid")&&null===this._selectedSsid?this._focusFormElement("ew-filled-text-field[name=ssid]"):t.has("_ssids")&&this._focusFormElement())}_focusFormElement(t="ew-filled-text-field, ew-filled-select"){const e=this.shadowRoot.querySelector(t);e&&e.updateComplete.then((()=>setTimeout((()=>e.focus()),100)))}async _initialize(t=!1){if(null===this.port.readable||null===this.port.writable)return this._state="ERROR",void(this._error="Serial port is not readable/writable. Close any other application using it and try again.");try{this._manifest=await(async t=>{const e=new URL(t,location.toString()).toString(),i=await fetch(e),r=await i.json();return"new_install_skip_erase"in r&&(console.warn('Manifest option "new_install_skip_erase" is deprecated. Use "new_install_prompt_erase" instead.'),r.new_install_skip_erase&&(r.new_install_prompt_erase=!0)),r})(this.manifestPath)}catch(t){return this._state="ERROR",void(this._error="Failed to download manifest")}if(0===this._manifest.new_install_improv_wait_time)return void(this._client=null);const e=new Nr(this.port,this.logger);e.addEventListener("state-changed",(()=>{this.requestUpdate()})),e.addEventListener("error-changed",(()=>this.requestUpdate()));try{const i=t?void 0!==this._manifest.new_install_improv_wait_time?1e3*this._manifest.new_install_improv_wait_time:1e4:1e3;this._info=await e.initialize(i),this._client=e,e.addEventListener("disconnect",this._handleDisconnect)}catch(t){this._info=void 0,t instanceof Kr?(this._state="ERROR",this._error="Serial port is not ready. Close any other application using it and try again."):(this._client=null,this.logger.error("Improv initialization failed.",t))}}_startInstall(t){this._state="INSTALL",this._installErase=t,this._installConfirmed=!1}async _confirmInstall(){this._installConfirmed=!0,this._installState=void 0,this._client&&await this._closeClientWithoutEvents(this._client),this._client=void 0,await this.port.close(),(async(t,e,i,r,o)=>{let s,n;const a=e=>t({...e,manifest:r,build:s,chipFamily:n}),l=new wa(e),d=new Ma({transport:l,baudrate:115200,romBaudrate:115200,enableTracing:!1});window.esploader=d,a({state:"initializing",message:"Initializing...",details:{done:!1}});try{await d.main(),await d.flashId()}catch(t){return console.error(t),a({state:"error",message:"Failed to initialize. Try resetting your device or holding the BOOT button while clicking INSTALL.",details:{error:"failed_initialize",details:t}}),await Qa(l),void await l.disconnect()}if(n=d.chip.CHIP_NAME,!d.chip.ROM_TEXT)return a({state:"error",message:`Chip ${n} is not supported`,details:{error:"not_supported",details:`Chip ${n} is not supported`}}),await Qa(l),void await l.disconnect();if(a({state:"initializing",message:`Initialized. Found ${n}`,details:{done:!0}}),s=r.builds.find((t=>t.chipFamily===n)),!s)return a({state:"error",message:`Your ${n} board is not supported.`,details:{error:"not_supported",details:n}}),await Qa(l),void await l.disconnect();a({state:"preparing",message:"Preparing installation...",details:{done:!1}});const c=new URL(i,location.toString()).toString(),h=s.parts.map((async t=>{const e=new URL(t.path,c).toString(),i=await fetch(e);if(!i.ok)throw new Error(`Downlading firmware ${t.path} failed: ${i.status}`);const r=new FileReader,o=await i.blob();return new Promise((t=>{r.addEventListener("load",(()=>t(r.result))),r.readAsBinaryString(o)}))})),A=[];let p=0;for(let t=0;t{const r=e/i*A[t].data.length,o=Math.floor((g+r)/p*100);e!==i?a({state:"writing",message:`Writing progress: ${o}%`,details:{bytesTotal:p,bytesWritten:g+e,percentage:o}}):g+=r}})}catch(t){return a({state:"error",message:t.message,details:{error:"write_failed",details:t}}),await Qa(l),void await l.disconnect()}a({state:"writing",message:"Writing complete",details:{bytesTotal:p,bytesWritten:g,percentage:100}}),await Ve(100),console.log("HARD RESET"),await Qa(l),console.log("DISCONNECT"),await l.disconnect(),a({state:"finished",message:"All done!"})})((t=>{this._installState=t,"finished"===t.state?Ve(100).then((()=>this.port.open({baudRate:115200}))).then((()=>this._initialize(!0))).then((()=>this.requestUpdate())):"error"===t.state&&Ve(100).then((()=>this.port.open({baudRate:115200})))}),this.port,this.manifestPath,this._manifest,this._installErase)}async _doProvision(){var t;this._busy=!0,this._wasProvisioned=this._client.state===Gr.PROVISIONED;const e=null===this._selectedSsid?this.shadowRoot.querySelector("ew-filled-text-field[name=ssid]").value:this._selectedSsid,i=(null===(t=this.shadowRoot.querySelector("ew-filled-text-field[name=password]"))||void 0===t?void 0:t.value)||"";try{await this._client.provision(e,i,3e4)}catch(t){return}finally{this._busy=!1,this._provisionForce=!1}}_closeDialog(){this.shadowRoot.querySelector("ew-dialog").close()}async _handleClose(){this._client&&await this._closeClientWithoutEvents(this._client),((t,e,i,r)=>{r=r||{};const o=new CustomEvent(e,{bubbles:void 0===r.bubbles||r.bubbles,cancelable:Boolean(r.cancelable),composed:void 0===r.composed||r.composed,detail:i});t.dispatchEvent(o)})(this,"closed"),document.body.style.overflow=this._bodyOverflow,this.parentNode.removeChild(this)}get _isSameFirmware(){var t;return!!this._info&&((null===(t=this.overrides)||void 0===t?void 0:t.checkSameFirmware)?this.overrides.checkSameFirmware(this._manifest,this._info):this._info.firmware===this._manifest.name)}get _isSameVersion(){return this._isSameFirmware&&this._info.version===this._manifest.version}async _closeClientWithoutEvents(t){t.removeEventListener("disconnect",this._handleDisconnect),await t.close()}_preventDefault(t){t.preventDefault()}}Pa.styles=[Oa,d` + :host { + --mdc-dialog-max-width: 390px; + } + div[slot="headline"] { + padding-right: 48px; + } + ew-icon-button[slot="headline"] { + position: absolute; + right: 4px; + top: 8px; + } + ew-icon-button[slot="headline"] svg { + padding: 8px; + color: var(--text-color); + } + .dialog-nav svg { + color: var(--text-color); + } + .table-row { + display: flex; + } + .table-row.last { + margin-bottom: 16px; + } + .table-row svg { + width: 20px; + margin-right: 8px; + } + ew-filled-text-field, + ew-filled-select { + display: block; + margin-top: 16px; + } + label.formfield { + display: inline-flex; + align-items: center; + padding-right: 8px; + } + ew-list { + margin: 0 -24px; + padding: 0; + } + ew-list-item svg { + height: 24px; + } + ewt-page-message + ew-list { + padding-top: 16px; + } + .fake-icon { + width: 24px; + } + .error { + color: var(--danger-color); + } + .danger { + --mdc-theme-primary: var(--danger-color); + --mdc-theme-secondary: var(--danger-color); + --md-sys-color-primary: var(--danger-color); + --md-sys-color-on-surface: var(--danger-color); + } + button.link { + background: none; + color: inherit; + border: none; + padding: 0; + font: inherit; + text-align: left; + text-decoration: underline; + cursor: pointer; + } + :host([state="LOGS"]) ew-dialog { + max-width: 90vw; + max-height: 90vh; + } + ewt-console { + width: calc(80vw - 48px); + height: calc(90vh - 168px); + } + `],r([ut()],Pa.prototype,"_client",void 0),r([ut()],Pa.prototype,"_state",void 0),r([ut()],Pa.prototype,"_installErase",void 0),r([ut()],Pa.prototype,"_installConfirmed",void 0),r([ut()],Pa.prototype,"_installState",void 0),r([ut()],Pa.prototype,"_provisionForce",void 0),r([ut()],Pa.prototype,"_error",void 0),r([ut()],Pa.prototype,"_busy",void 0),r([ut()],Pa.prototype,"_ssids",void 0),r([ut()],Pa.prototype,"_selectedSsid",void 0),customElements.define("ewt-install-dialog",Pa);var Ha=Object.freeze({__proto__:null,EwtInstallDialog:Pa});const La=$` + + + + + +`;let Ua=class extends ht{render(){const t=(()=>{var t,e;const i=window.navigator.userAgent,r=(null===(e=null===(t=window.navigator)||void 0===t?void 0:t.userAgentData)||void 0===e?void 0:e.platform)||window.navigator.platform;return-1!==["macOS","Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(r)?"Mac OS":-1!==["iPhone","iPad","iPod"].indexOf(r)?"iOS":-1!==["Win32","Win64","Windows","WinCE"].indexOf(r)?"Windows":/Android/.test(i)?"Android":/Linux/.test(r)?"Linux":null})();return J` + +
    No port selected
    +
    +
    + If you didn't select a port because you didn't see your device + listed, try the following steps: +
    +
      +
    1. + Make sure that the device is connected to this computer (the one + that runs the browser that shows this website) +
    2. +
    3. + Most devices have a tiny light when it is powered on. If yours has + one, make sure it is on. +
    4. +
    5. + Make sure that the USB cable you use can be used for data and is + not a power-only cable. +
    6. + ${"Linux"===t?J` +
    7. + If you are using a Linux flavor, make sure that your user is + part of the dialout group so it has permission + to access the device. + sudo usermod -a -G dialout YourUserName + You may need to log out & back in or reboot to activate the + new group access. +
    8. + `:""} +
    9. + Make sure you have the right drivers installed. Below are the + drivers for common chips used in ESP devices: +
        +
      • + CP2102 drivers: + Windows & Mac +
      • +
      • + CH342, CH343, CH9102 drivers: + Windows, + Mac +
        + (download via blue button with ${La} icon) +
      • +
      • + CH340, CH341 drivers: + Windows, + Mac +
        + (download via blue button with ${La} icon) +
      • +
      +
    10. +
    +
    +
    + ${this.doTryAgain?J` + Cancel + + Try Again + + `:J` + Close + `} +
    +
    + `}tryAgain(){var t;this.close(),null===(t=this.doTryAgain)||void 0===t||t.call(this)}close(){this.shadowRoot.querySelector("ew-dialog").close()}async _handleClose(){this.parentNode.removeChild(this)}};Ua.styles=[Oa,d` + li + li, + li > ul { + margin-top: 8px; + } + ul, + ol { + margin-bottom: 0; + padding-left: 1.5em; + } + li code.block { + display: block; + margin: 0.5em 0; + } + `],Ua=r([pt("ewt-no-port-picked-dialog")],Ua);var Ga=Object.freeze({__proto__:null,openNoPortPickedDialog:async t=>{const e=document.createElement("ewt-no-port-picked-dialog");return e.doTryAgain=t,document.body.append(e),!0}}),za=1074521560,Ka="CAD0PxwA9D8AAPQ/AMD8PxAA9D82QQAh+v/AIAA4AkH5/8AgACgEICB0nOIGBQAAAEH1/4H2/8AgAKgEiAigoHTgCAALImYC54b0/yHx/8AgADkCHfAAAKDr/T8Ya/0/hIAAAEBAAABYq/0/pOv9PzZBALH5/yCgdBARIKXHAJYaBoH2/5KhAZCZEZqYwCAAuAmR8/+go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nmQoMEikDLQgGBAAAAIKg3Xzyh5kGDBIpAyKg2x3wAAA=",Ya=1074520064,Na="GOv8P9jnC0Bx6AtA8+wLQO3oC0CP6AtA7egLQEnpC0AG6gtAeOoLQCHqC0CB5wtAo+kLQPjpC0Bn6QtAmuoLQI7pC0Ca6gtAXegLQLPoC0Dt6AtASekLQHfoC0BM6wtAs+wLQKXmC0DX7AtApeYLQKXmC0Cl5gtApeYLQKXmC0Cl5gtApeYLQKXmC0Dz6gtApeYLQM3rC0Cz7AtA",Ja=1073605544;var $a=Object.freeze({__proto__:null,ESP32ROM:class extends Ta{constructor(){super(...arguments),this.CHIP_NAME="ESP32",this.IMAGE_CHIP_ID=0,this.EFUSE_RD_REG_BASE=1073061888,this.DR_REG_SYSCON_BASE=1073111040,this.UART_CLKDIV_REG=1072955412,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612856,this.XTAL_CLK_DIVIDER=1,this.FLASH_SIZES={"1MB":0,"2MB":16,"4MB":32,"8MB":48,"16MB":64},this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=4096,this.SPI_REG_BASE=1072963584,this.SPI_USR_OFFS=28,this.SPI_USR1_OFFS=32,this.SPI_USR2_OFFS=36,this.SPI_W0_OFFS=128,this.SPI_MOSI_DLEN_OFFS=40,this.SPI_MISO_DLEN_OFFS=44,this.TEXT_START=Ya,this.ENTRY=za,this.DATA_START=Ja,this.ROM_DATA=Na,this.ROM_TEXT=Ka}async readEfuse(t,e){const i=this.EFUSE_RD_REG_BASE+4*e;return t.debug("Read efuse "+i),await t.readReg(i)}async getPkgVersion(t){const e=await this.readEfuse(t,3);let i=e>>9&7;return i+=(e>>2&1)<<3,i}async getChipRevision(t){const e=await this.readEfuse(t,3),i=await this.readEfuse(t,5),r=await t.readReg(this.DR_REG_SYSCON_BASE+124);return 0!=(e>>15&1)?0!=(i>>20&1)?0!=(r>>31&1)?3:2:1:0}async getChipDescription(t){const e=["ESP32-D0WDQ6","ESP32-D0WD","ESP32-D2WD","","ESP32-U4WDH","ESP32-PICO-D4","ESP32-PICO-V3-02"];let i="";const r=await this.getPkgVersion(t),o=await this.getChipRevision(t),s=3==o;return 0!=(1&await this.readEfuse(t,3))&&(e[0]="ESP32-S0WDQ6",e[1]="ESP32-S0WD"),s&&(e[5]="ESP32-PICO-V3"),i=r>=0&&r<=6?e[r]:"Unknown ESP32",!s||0!==r&&1!==r||(i+="-V3"),i+" (revision "+o+")"}async getChipFeatures(t){const e=["Wi-Fi"],i=await this.readEfuse(t,3);0===(2&i)&&e.push(" BT");0!==(1&i)?e.push(" Single Core"):e.push(" Dual Core");if(0!==(8192&i)){0!==(4096&i)?e.push(" 160MHz"):e.push(" 240MHz")}const r=await this.getPkgVersion(t);-1!==[2,4,5,6].indexOf(r)&&e.push(" Embedded Flash"),6===r&&e.push(" Embedded PSRAM");0!==(await this.readEfuse(t,4)>>8&31)&&e.push(" VRef calibration in efuse");0!==(i>>14&1)&&e.push(" BLK3 partially reserved");const o=3&await this.readEfuse(t,6);return e.push(" Coding Scheme "+["None","3/4","Repeat (UNSUPPORTED)","Invalid"][o]),e}async getCrystalFreq(t){const e=await t.readReg(this.UART_CLKDIV_REG)&this.UART_CLKDIV_MASK,i=t.transport.baudrate*e/1e6/this.XTAL_CLK_DIVIDER;let r;return r=i>33?40:26,Math.abs(r-i)>1&&t.info("WARNING: Unsupported crystal in use"),r}_d2h(t){const e=(+t).toString(16);return 1===e.length?"0"+e:e}async readMac(t){let e=await this.readEfuse(t,1);e>>>=0;let i=await this.readEfuse(t,2);i>>>=0;const r=new Uint8Array(6);return r[0]=i>>8&255,r[1]=255&i,r[2]=e>>24&255,r[3]=e>>16&255,r[4]=e>>8&255,r[5]=255&e,this._d2h(r[0])+":"+this._d2h(r[1])+":"+this._d2h(r[2])+":"+this._d2h(r[3])+":"+this._d2h(r[4])+":"+this._d2h(r[5])}}}),ja=1077413532,Wa="QREixCbCBsa3NwRgEUc3RMg/2Mu3NARgEw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u/wD8513chAYoaThYsBl/DH/+eAYEUBxZMHQAzcyNxA4pfcwNxEs4eHQdzEl/DH/+eAQESJvgllEwUFcQOsywADpIsAl/DH/+eAADa3BwBg2Eu3BgABwRaTV0cBEgd1j72L2Y+zh4cDAUWz1YcCl/DH/+eA4DYTBYA+l/DH/+eAoDIRtoOmSwEDpgsBg6XLAAOliwDv8M/7/bSDxTsAg8crABOFiwGiBd2NwRXv8O/X2bzv8E/HPb+DxzsAA8crABOMiwGiB9mPE40H/wVEt3vJP9xEYwUNAJnDY0yAAGNQBAoTB3AM2MjjnweokweQDGGok4cLu5hDt/fIP5OHB7KZjz7WgyeKsLd8yD9q0JOMTAGTjQu7BUhjc/0ADUhCxjrE7/BPwCJHMkg3Rcg/4oV8EJOGCrIQEBMFxQKX8Mf/54DAMIJXA6eMsIOlDQAzDf1AHY8+nLJXI6TssCqEvpUjoL0Ak4cKsp2NAcWhZ+OS9fZahe/wb8sjoG0Bmb8t9OODB6CTB4AM3Mj1uoOniwDjmwee7/Cv1gllEwUFcZfwx//ngGAg7/Bv0Zfwx//ngKAj0boDpMsA4wcEnO/wL9QTBYA+l/DH/+eAAB7v8A/PApRVuu/wj872UGZU1lRGWbZZJlqWWgZb9ktmTNZMRk22TQlhgoAAAA==",Za=1077411840,qa="IGvIP3YKOEDGCjhAHgs4QMILOEAuDDhA3As4QEIJOEB+CzhAvgs4QDILOEDyCDhAZgs4QPIIOEBQCjhAlgo4QMYKOEAeCzhAYgo4QKYJOEDWCThAXgo4QIAOOEDGCjhARg04QDgOOEAyCDhAYA44QDIIOEAyCDhAMgg4QDIIOEAyCDhAMgg4QDIIOEAyCDhA4gw4QDIIOEBkDThAOA44QA==",Va=1070164912;class Xa extends Ta{constructor(){super(...arguments),this.CHIP_NAME="ESP32-C3",this.IMAGE_CHIP_ID=5,this.EFUSE_BASE=1610647552,this.MAC_EFUSE_REG=this.EFUSE_BASE+68,this.UART_CLKDIV_REG=1072955412,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612860,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=0,this.FLASH_SIZES={"1MB":0,"2MB":16,"4MB":32,"8MB":48,"16MB":64},this.SPI_REG_BASE=1610620928,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.SPI_W0_OFFS=88,this.TEXT_START=Za,this.ENTRY=ja,this.DATA_START=Va,this.ROM_DATA=qa,this.ROM_TEXT=Wa}async getPkgVersion(t){const e=this.EFUSE_BASE+68+12;return await t.readReg(e)>>21&7}async getChipRevision(t){const e=this.EFUSE_BASE+68+12;return(await t.readReg(e)&7<<18)>>18}async getChipDescription(t){let e;e=0===await this.getPkgVersion(t)?"ESP32-C3":"unknown ESP32-C3";return e+=" (revision "+await this.getChipRevision(t)+")",e}async getChipFeatures(t){return["Wi-Fi"]}async getCrystalFreq(t){return 40}_d2h(t){const e=(+t).toString(16);return 1===e.length?"0"+e:e}async readMac(t){let e=await t.readReg(this.MAC_EFUSE_REG);e>>>=0;let i=await t.readReg(this.MAC_EFUSE_REG+4);i=i>>>0&65535;const r=new Uint8Array(6);return r[0]=i>>8&255,r[1]=255&i,r[2]=e>>24&255,r[3]=e>>16&255,r[4]=e>>8&255,r[5]=255&e,this._d2h(r[0])+":"+this._d2h(r[1])+":"+this._d2h(r[2])+":"+this._d2h(r[3])+":"+this._d2h(r[4])+":"+this._d2h(r[5])}getEraseSize(t,e){return e}}var tl=Object.freeze({__proto__:null,ESP32C3ROM:Xa}),el=1077413304,il="ARG3BwBgTsaDqYcASsg3Sco/JspSxAbOIsy3BABgfVoTCQkAwEwTdPQ/DeDyQGJEI6g0AUJJ0kSySSJKBWGCgIhAgycJABN19Q+Cl30U4xlE/8m/EwcADJRBqodjGOUAhUeFxiOgBQB5VYKABUdjh+YACUZjjcYAfVWCgEIFEwewDUGFY5XnAolHnMH1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mTNZMRk22TQlhgoA=",rl=1077411840,ol="DEDKP+AIOEAsCThAhAk4QFIKOEC+CjhAbAo4QKgHOEAOCjhATgo4QJgJOEBYBzhAzAk4QFgHOEC6CDhA/gg4QCwJOECECThAzAg4QBIIOEBCCDhAyAg4QBYNOEAsCThA1gs4QMoMOECkBjhA9Aw4QKQGOECkBjhApAY4QKQGOECkBjhApAY4QKQGOECkBjhAcgs4QKQGOEDyCzhAygw4QA==",sl=1070295976;var nl=Object.freeze({__proto__:null,ESP32C2ROM:class extends Xa{constructor(){super(...arguments),this.CHIP_NAME="ESP32-C2",this.IMAGE_CHIP_ID=12,this.EFUSE_BASE=1610647552,this.MAC_EFUSE_REG=this.EFUSE_BASE+64,this.UART_CLKDIV_REG=1610612756,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612860,this.XTAL_CLK_DIVIDER=1,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=0,this.FLASH_SIZES={"1MB":0,"2MB":16,"4MB":32,"8MB":48,"16MB":64},this.SPI_REG_BASE=1610620928,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.SPI_W0_OFFS=88,this.TEXT_START=rl,this.ENTRY=el,this.DATA_START=sl,this.ROM_DATA=ol,this.ROM_TEXT=il}async getPkgVersion(t){const e=this.EFUSE_BASE+64+4;return await t.readReg(e)>>22&7}async getChipRevision(t){const e=this.EFUSE_BASE+64+4;return(await t.readReg(e)&3<<20)>>20}async getChipDescription(t){let e;const i=await this.getPkgVersion(t);e=0===i||1===i?"ESP32-C2":"unknown ESP32-C2";return e+=" (revision "+await this.getChipRevision(t)+")",e}async getChipFeatures(t){return["Wi-Fi","BLE"]}async getCrystalFreq(t){const e=await t.readReg(this.UART_CLKDIV_REG)&this.UART_CLKDIV_MASK,i=t.transport.baudrate*e/1e6/this.XTAL_CLK_DIVIDER;let r;return r=i>33?40:26,Math.abs(r-i)>1&&t.info("WARNING: Unsupported crystal in use"),r}async changeBaudRate(t){26===await this.getCrystalFreq(t)&&t.changeBaud()}_d2h(t){const e=(+t).toString(16);return 1===e.length?"0"+e:e}async readMac(t){let e=await t.readReg(this.MAC_EFUSE_REG);e>>>=0;let i=await t.readReg(this.MAC_EFUSE_REG+4);i=i>>>0&65535;const r=new Uint8Array(6);return r[0]=i>>8&255,r[1]=255&i,r[2]=e>>24&255,r[3]=e>>16&255,r[4]=e>>8&255,r[5]=255&e,this._d2h(r[0])+":"+this._d2h(r[1])+":"+this._d2h(r[2])+":"+this._d2h(r[3])+":"+this._d2h(r[4])+":"+this._d2h(r[5])}getEraseSize(t,e){return e}}}),al=1082132112,ll="QREixCbCBsa39wBgEUc3BIRA2Mu39ABgEwQEANxAkYuR57JAIkSSREEBgoCIQBxAE3X1D4KX3bcBEbcHAGBOxoOphwBKyDcJhEAmylLEBs4izLcEAGB9WhMJCQDATBN09A8N4PJAYkQjqDQBQknSRLJJIkoFYYKAiECDJwkAE3X1D4KXfRTjGUT/yb8TBwAMlEGqh2MY5QCFR4XGI6AFAHlVgoAFR2OH5gAJRmONxgB9VYKAQgUTB7ANQYVjlecCiUecwfW3kwbADWMW1QCYwRMFAAyCgJMG0A19VWOV1wCYwRMFsA2CgLc1hUBBEZOFRboGxmE/Y0UFBrc3hUCTh8exA6cHCAPWRwgTdfUPkwYWAMIGwYIjktcIMpcjAKcAA9dHCJFnk4cHBGMe9wI3t4RAEwfHsaFnupcDpgcIt/aEQLc3hUCTh8exk4bGtWMf5gAjpscII6DXCCOSBwghoPlX4wb1/LJAQQGCgCOm1wgjoOcI3bc3NwBgfEudi/X/NycAYHxLnYv1/4KAQREGxt03tzcAYCOmBwI3BwAImMOYQ33/yFeyQBNF9f8FiUEBgoBBEQbG2T993TcHAEC3NwBgmMM3NwBgHEP9/7JAQQGCgEERIsQ3BIRAkwcEAUrAA6kHAQbGJsJjCgkERTc5x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guAQP4KgEC+CIBAMguAQL4IgEAcCoBAYgqAQJIKgEDqCoBALgqAQHIJgECiCYBAKgqAQEwOgECSCoBAEg2AQAQOgED+B4BALA6AQP4HgED+B4BA/geAQP4HgED+B4BA/geAQP4HgED+B4BArgyAQP4HgEAwDYBABA6AQA==",hl=1082469292;var Al=Object.freeze({__proto__:null,ESP32C6ROM:class extends Ta{constructor(){super(...arguments),this.CHIP_NAME="ESP32-C6",this.IMAGE_CHIP_ID=13,this.EFUSE_BASE=1611335680,this.MAC_EFUSE_REG=this.EFUSE_BASE+68,this.UART_CLKDIV_REG=1072955412,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612860,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=0,this.FLASH_SIZES={"1MB":0,"2MB":16,"4MB":32,"8MB":48,"16MB":64},this.SPI_REG_BASE=1610620928,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.SPI_W0_OFFS=88,this.TEXT_START=dl,this.ENTRY=al,this.DATA_START=hl,this.ROM_DATA=cl,this.ROM_TEXT=ll}async getPkgVersion(t){const e=this.EFUSE_BASE+68+12;return await t.readReg(e)>>21&7}async getChipRevision(t){const e=this.EFUSE_BASE+68+12;return(await t.readReg(e)&7<<18)>>18}async getChipDescription(t){let e;e=0===await this.getPkgVersion(t)?"ESP32-C6":"unknown ESP32-C6";return e+=" (revision "+await this.getChipRevision(t)+")",e}async getChipFeatures(t){return["Wi-Fi"]}async getCrystalFreq(t){return 40}_d2h(t){const e=(+t).toString(16);return 1===e.length?"0"+e:e}async readMac(t){let e=await t.readReg(this.MAC_EFUSE_REG);e>>>=0;let i=await t.readReg(this.MAC_EFUSE_REG+4);i=i>>>0&65535;const r=new Uint8Array(6);return r[0]=i>>8&255,r[1]=255&i,r[2]=e>>24&255,r[3]=e>>16&255,r[4]=e>>8&255,r[5]=255&e,this._d2h(r[0])+":"+this._d2h(r[1])+":"+this._d2h(r[2])+":"+this._d2h(r[3])+":"+this._d2h(r[4])+":"+this._d2h(r[5])}getEraseSize(t,e){return e}}}),pl=1082132112,gl="QREixCbCBsa39wBgEUc3BINA2Mu39ABgEwQEANxAkYuR57JAIkSSREEBgoCIQBxAE3X1D4KX3bcBEbcHAGBOxoOphwBKyDcJg0AmylLEBs4izLcEAGB9WhMJCQDATBN09A8N4PJAYkQjqDQBQknSRLJJIkoFYYKAiECDJwkAE3X1D4KXfRTjGUT/yb8TBwAMlEGqh2MY5QCFR4XGI6AFAHlVgoAFR2OH5gAJRmONxgB9VYKAQgUTB7ANQYVjlecCiUecwfW3kwbADWMW1QCYwRMFAAyCgJMG0A19VWOV1wCYwRMFsA2CgLc1hEBBEZOFRboGxmE/Y0UFBrc3hECTh8exA6cHCAPWRwgTdfUPkwYWAMIGwYIjktcIMpcjAKcAA9dHCJFnk4cHBGMe9wI3t4NAEwfHsaFnupcDpgcIt/aDQLc3hECTh8exk4bGtWMf5gAjpscII6DXCCOSBwghoPlX4wb1/LJAQQGCgCOm1wgjoOcI3bc3NwBgfEudi/X/NycAYHxLnYv1/4KAQREGxt03tzcAYCOmBwI3BwAImMOYQ33/yFeyQBNF9f8FiUEBgoBBEQbG2T993TcHAEC3NwBgmMM3NwBgHEP9/7JAQQGCgEERIsQ3hINAkwcEAUrAA6kHAQbGJsJjCgkERTc5xb1HEwQEAYFEY9YnAQREvYiTtBQAfTeFPxxENwaAABOXxwCZ4DcGAAG39v8AdY+3NgBg2MKQwphCff9BR5HgBUczCelAupcjKCQBHMSyQCJEkkQCSUEBgoABEQbOIswlNzcEhUBsABMFBP+XAID/54Ag8qqHBUWV57JHk/cHID7GiTc3NwBgHEe3BkAAEwUE/9WPHMeyRZcAgP/ngKDvMzWgAPJAYkQFYYKAQRG3h4NABsaThwcBBUcjgOcAE9fFAJjHBWd9F8zDyMf5jTqVqpWxgYzLI6oHAEE3G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ml/B//+eAYEwDrMQAQRRjc4QBIozjDgy4wEBilDGAnEhjVfAAnERjW/QK7/BP0XXdyEBihpOFiwGX8H//54BgSAHFkwdADNzI3EDil9zA3ESzh4dB3MSX8H//54BAR4m+CWUTBQVxA6zLAAOkiwCX8H//54BAOLcHAGDYS7cGAAHBFpNXRwESB3WPvYvZj7OHhwMBRbPVhwKX8H//54BgORMFgD6X8H//54DgNBG2g6ZLAQOmCwGDpcsAA6WLAO/wT/79tIPFOwCDxysAE4WLAaIF3Y3BFe/wL9vZvO/wj8o9vwPEOwCDxysAE4yLASIEXYzcREEUzeORR4VLY/+HCJMHkAzcyG20A6cNACLQBUizh+xAPtaDJ4qwY3P0AA1IQsY6xO/wD8YiRzJIN4WDQOKFfBCThgoBEBATBYUCl/B//+eAwDY3t4NAkwgHAYJXA6eIsIOlDQAdjB2PPpyyVyOk6LCqi76VI6C9AJOHCgGdjQHFoWdjl/UAWoXv8M/QI6BtAQnE3ESZw+NPcPdj3wsAkwdwDL23hUu3PYRAt4yDQJONzbqTjAwB6b/jkgug3ETjjweekweADKm3g6eLAOOYB57v8M/YCWUTBQVxl/B//+eAQCLv8E/Ul/B//+eAgCb5sgOkywDjBASc7/BP1hMFgD6X8H//54DgH+/w79EClH2y7/Bv0fZQZlTWVEZZtlkmWpZaBlv2S2ZM1kxGTbZNCWGCgA==",fl=1082130432,ul="EACDQEIKgECSCoBA6gqAQI4LgED6C4BAqAuAQA4JgEBKC4BAiguAQP4KgEC+CIBAMguAQL4IgEAcCoBAYgqAQJIKgEDqCoBALgqAQHIJgECiCYBAKgqAQFIOgECSCoBAEg2AQAoOgED+B4BAMg6AQP4HgED+B4BA/geAQP4HgED+B4BA/geAQP4HgED+B4BArgyAQP4HgEAwDYBACg6AQA==",ml=1082403756;var vl=Object.freeze({__proto__:null,ESP32H2ROM:class extends Ta{constructor(){super(...arguments),this.CHIP_NAME="ESP32-H2",this.IMAGE_CHIP_ID=16,this.EFUSE_BASE=1610647552,this.MAC_EFUSE_REG=this.EFUSE_BASE+68,this.UART_CLKDIV_REG=1072955412,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612860,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=0,this.FLASH_SIZES={"1MB":0,"2MB":16,"4MB":32,"8MB":48,"16MB":64},this.SPI_REG_BASE=1610620928,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.SPI_W0_OFFS=88,this.USB_RAM_BLOCK=2048,this.UARTDEV_BUF_NO_USB=3,this.UARTDEV_BUF_NO=1070526796,this.TEXT_START=fl,this.ENTRY=pl,this.DATA_START=ml,this.ROM_DATA=ul,this.ROM_TEXT=gl}async getChipDescription(t){return this.CHIP_NAME}async getChipFeatures(t){return["BLE","IEEE802.15.4"]}async getCrystalFreq(t){return 32}_d2h(t){const e=(+t).toString(16);return 1===e.length?"0"+e:e}async postConnect(t){const e=255&await t.readReg(this.UARTDEV_BUF_NO);t.debug("In _post_connect "+e),e==this.UARTDEV_BUF_NO_USB&&(t.ESP_RAM_BLOCK=this.USB_RAM_BLOCK)}async readMac(t){let e=await t.readReg(this.MAC_EFUSE_REG);e>>>=0;let i=await t.readReg(this.MAC_EFUSE_REG+4);i=i>>>0&65535;const r=new Uint8Array(6);return r[0]=i>>8&255,r[1]=255&i,r[2]=e>>24&255,r[3]=e>>16&255,r[4]=e>>8&255,r[5]=255&e,this._d2h(r[0])+":"+this._d2h(r[1])+":"+this._d2h(r[2])+":"+this._d2h(r[3])+":"+this._d2h(r[4])+":"+this._d2h(r[5])}getEraseSize(t,e){return e}}}),wl=1077381696,yl="FIADYACAA2BIAMo/BIADYDZBAIH7/wxJwCAAmQjGBAAAgfj/wCAAqAiB9/+goHSICOAIACH2/8AgAIgCJ+jhHfAAAAAIAABgHAAAYBAAAGA2QQAh/P/AIAA4AkH7/8AgACgEICCU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iBqP3gCADgAgBGQP4d8AAANkEAnQKCoMAoA4eZD8wyDBKGBwAMAikDfOKGDwAmEgcmIhiGAwAAAIKg24ApI4eZKgwiKQN88kYIAAAAIqDcJ5kKDBIpAy0IBgQAAACCoN188oeZBgwSKQMioNsd8AAA",bl=1077379072,_l="ZCvKP8qNN0CvjjdAcJM3QDqPN0DPjjdAOo83QJmPN0BmkDdA2ZA3QIGQN0BVjTdA/I83QFiQN0C8jzdA+5A3QOaPN0D7kDdAnY43QPqON0A6jzdAmY83QLWON0CWjTdAvJE3QDaTN0ByjDdAVpM3QHKMN0ByjDdAcow3QHKMN0ByjDdAcow3QHKMN0ByjDdAVpE3QHKMN0BRkjdANpM3QAQInwAAAAAAAAAYAQQIBQAAAAAAAAAIAQQIBgAAAAAAAAAAAQQIIQAAAAAAIAAAEQQI3AAAAAAAIAAAEQQIDAAAAAAAIAAAAQQIEgAAAAAAIAAAESAoDAAQAQAA",El=1070279668;var xl=Object.freeze({__proto__:null,ESP32S3ROM:class extends Ta{constructor(){super(...arguments),this.CHIP_NAME="ESP32-S3",this.IMAGE_CHIP_ID=9,this.EFUSE_BASE=1610641408,this.MAC_EFUSE_REG=this.EFUSE_BASE+68,this.UART_CLKDIV_REG=1610612756,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612864,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=0,this.FLASH_SIZES={"1MB":0,"2MB":16,"4MB":32,"8MB":48,"16MB":64},this.SPI_REG_BASE=1610620928,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.SPI_W0_OFFS=88,this.USB_RAM_BLOCK=2048,this.UARTDEV_BUF_NO_USB=3,this.UARTDEV_BUF_NO=1070526796,this.TEXT_START=bl,this.ENTRY=wl,this.DATA_START=El,this.ROM_DATA=_l,this.ROM_TEXT=yl}async getChipDescription(t){return"ESP32-S3"}async getChipFeatures(t){return["Wi-Fi","BLE"]}async getCrystalFreq(t){return 40}_d2h(t){const e=(+t).toString(16);return 1===e.length?"0"+e:e}async postConnect(t){const e=255&await t.readReg(this.UARTDEV_BUF_NO);t.debug("In _post_connect "+e),e==this.UARTDEV_BUF_NO_USB&&(t.ESP_RAM_BLOCK=this.USB_RAM_BLOCK)}async readMac(t){let e=await t.readReg(this.MAC_EFUSE_REG);e>>>=0;let i=await t.readReg(this.MAC_EFUSE_REG+4);i=i>>>0&65535;const r=new Uint8Array(6);return r[0]=i>>8&255,r[1]=255&i,r[2]=e>>24&255,r[3]=e>>16&255,r[4]=e>>8&255,r[5]=255&e,this._d2h(r[0])+":"+this._d2h(r[1])+":"+this._d2h(r[2])+":"+this._d2h(r[3])+":"+this._d2h(r[4])+":"+this._d2h(r[5])}getEraseSize(t,e){return e}}}),Cl=1073907696,Il="CAAAYBwAAGBIAP0/EAAAYDZBACH7/8AgADgCQfr/wCAAKAQgIJSc4kH4/0YEAAw4MIgBwCAAqAiIBKCgdOAIAAsiZgLohvT/IfH/wCAAOQId8AAA7Cv+P2Sr/T+EgAAAQEAAAKTr/T/wK/4/NkEAsfn/IKB0EBEgZQEBlhoGgfb/kqEBkJkRmpjAIAC4CZHz/6CgdJqIwCAAkhgAkJD0G8nAwPTAIADCWACam8AgAKJJAMAgAJIYAIHq/5CQ9ICA9IeZR4Hl/5KhAZCZEZqYwCAAyAmh5f+x4/+HnBfGAQB86Ica3sYIAMAgAIkKwCAAuQlGAgDAIAC5CsAgAIkJkdf/mogMCcAgAJJYAB3wAABUIEA/VDBAPzZBAJH9/8AgAIgJgIAkVkj/kfr/wCAAiAmAgCRWSP8d8AAAACwgQD8AIEA/AAAACDZBABARIKX8/yH6/wwIwCAAgmIAkfr/gfj/wCAAkmgAwCAAmAhWef/AIACIAnzygCIwICAEHfAAAAAAQDZBABARIOX7/xZq/4Hs/5H7/8AgAJJoAMAgAJgIVnn/HfAAAFgA/T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IkCQNiJAkDYiQJA2IkCQNiJAkDYiQJAZI4CQNiJAkBZjwJAPZACQA==",Rl=1073622012;var kl=Object.freeze({__proto__:null,ESP32S2ROM:class extends Ta{constructor(){super(...arguments),this.CHIP_NAME="ESP32-S2",this.IMAGE_CHIP_ID=2,this.MAC_EFUSE_REG=1061265476,this.EFUSE_BASE=1061265408,this.UART_CLKDIV_REG=1061158932,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612856,this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=4096,this.FLASH_SIZES={"1MB":0,"2MB":16,"4MB":32,"8MB":48,"16MB":64},this.SPI_REG_BASE=1061167104,this.SPI_USR_OFFS=24,this.SPI_USR1_OFFS=28,this.SPI_USR2_OFFS=32,this.SPI_W0_OFFS=88,this.SPI_MOSI_DLEN_OFFS=36,this.SPI_MISO_DLEN_OFFS=40,this.TEXT_START=Bl,this.ENTRY=Cl,this.DATA_START=Rl,this.ROM_DATA=Sl,this.ROM_TEXT=Il}async getPkgVersion(t){const e=this.EFUSE_BASE+68+12;return await t.readReg(e)>>21&15}async getChipDescription(t){const e=["ESP32-S2","ESP32-S2FH16","ESP32-S2FH32"],i=await this.getPkgVersion(t);return i>=0&&i<=2?e[i]:"unknown ESP32-S2"}async getChipFeatures(t){const e=["Wi-Fi"],i=await this.getPkgVersion(t);1==i?e.push("Embedded 2MB Flash"):2==i&&e.push("Embedded 4MB Flash");const r=this.EFUSE_BASE+92+16;return 1==(await t.readReg(r)>>4&7)&&e.push("ADC and temperature sensor calibration in BLK2 of efuse"),e}async getCrystalFreq(t){return 40}_d2h(t){const e=(+t).toString(16);return 1===e.length?"0"+e:e}async readMac(t){let e=await t.readReg(this.MAC_EFUSE_REG);e>>>=0;let i=await t.readReg(this.MAC_EFUSE_REG+4);i=i>>>0&65535;const r=new Uint8Array(6);return r[0]=i>>8&255,r[1]=255&i,r[2]=e>>24&255,r[3]=e>>16&255,r[4]=e>>8&255,r[5]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AAAAAgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAgAAAAMAAAADAAAAAwAAAAMAAAAEAAAABAAAAAQAAAAEAAAABQAAAAUAAAAFAAAABQAAAAAAAAAAAAAAAAAAABAREgAIBwkGCgULBAwDDQIOAQ8AAQEAAAEAAAAEAAAA",Fl=1073720488;var Ol=Object.freeze({__proto__:null,ESP8266ROM:class extends Ta{constructor(){super(...arguments),this.CHIP_NAME="ESP8266",this.CHIP_DETECT_MAGIC_VALUE=[4293968129],this.EFUSE_RD_REG_BASE=1072693328,this.UART_CLKDIV_REG=1610612756,this.UART_CLKDIV_MASK=1048575,this.XTAL_CLK_DIVIDER=2,this.FLASH_WRITE_SIZE=16384,this.BOOTLOADER_FLASH_OFFSET=0,this.UART_DATE_REG_ADDR=0,this.FLASH_SIZES={"512KB":0,"256KB":16,"1MB":32,"2MB":48,"4MB":64,"2MB-c1":80,"4MB-c1":96,"8MB":128,"16MB":144},this.SPI_REG_BASE=1610613248,this.SPI_USR_OFFS=28,this.SPI_USR1_OFFS=32,this.SPI_USR2_OFFS=36,this.SPI_MOSI_DLEN_OFFS=0,this.SPI_MISO_DLEN_OFFS=0,this.SPI_W0_OFFS=64,this.TEXT_START=Tl,this.ENTRY=Dl,this.DATA_START=Fl,this.ROM_DATA=Ql,this.ROM_TEXT=Ml,this.getChipFeatures=async t=>{const e=["WiFi"];return"ESP8285"==await this.getChipDescription(t)&&e.push("Embedded Flash"),e}}async readEfuse(t,e){const i=this.EFUSE_RD_REG_BASE+4*e;return t.debug("Read efuse "+i),await t.readReg(i)}async getChipDescription(t){const e=await this.readEfuse(t,2);return!!(16&await this.readEfuse(t,0)|65536&e)?"ESP8285":"ESP8266EX"}async getCrystalFreq(t){const e=await t.readReg(this.UART_CLKDIV_REG)&this.UART_CLKDIV_MASK,i=t.transport.baudrate*e/1e6/this.XTAL_CLK_DIVIDER;let r;return r=i>33?40:26,Math.abs(r-i)>1&&t.info("WARNING: Detected crystal freq "+i+"MHz is quite different to normalized freq "+r+"MHz. Unsupported crystal in use?"),r}_d2h(t){const e=(+t).toString(16);return 1===e.length?"0"+e:e}async readMac(t){let e=await this.readEfuse(t,0);e>>>=0;let i=await this.readEfuse(t,1);i>>>=0;let r=await this.readEfuse(t,3);r>>>=0;const o=new Uint8Array(6);return 0!=r?(o[0]=r>>16&255,o[1]=r>>8&255,o[2]=255&r):i>>16&255?1==(i>>16&255)?(o[0]=172,o[1]=208,o[2]=116):t.error("Unknown OUI"):(o[0]=24,o[1]=254,o[2]=52),o[3]=i>>8&255,o[4]=255&i,o[5]=e>>24&255,this._d2h(o[0])+":"+this._d2h(o[1])+":"+this._d2h(o[2])+":"+this._d2h(o[3])+":"+this._d2h(o[4])+":"+this._d2h(o[5])}getEraseSize(t,e){return e}}});return t.InstallButton=i,t}({}); diff --git a/website-src/esp-web-tools/dist/flash.d.ts b/website-src/esp-web-tools/dist/flash.d.ts new file mode 100644 index 00000000..036e0a1f --- /dev/null +++ b/website-src/esp-web-tools/dist/flash.d.ts @@ -0,0 +1,3 @@ +/// +import { FlashState, Manifest } from "./const"; +export declare const flash: (onEvent: (state: FlashState) => void, port: SerialPort, manifestPath: string, manifest: Manifest, eraseFirst: boolean) => Promise; diff --git a/website-src/esp-web-tools/dist/flash.js b/website-src/esp-web-tools/dist/flash.js new file mode 100644 index 00000000..2eca97c4 --- /dev/null +++ b/website-src/esp-web-tools/dist/flash.js @@ -0,0 +1,209 @@ +import { Transport, ESPLoader } from "esptool-js"; +import { sleep } from "./util/sleep"; +const resetTransport = async (transport) => { + await transport.device.setSignals({ + dataTerminalReady: false, + requestToSend: true, + }); + await sleep(250); + await transport.device.setSignals({ + dataTerminalReady: false, + requestToSend: false, + }); + await sleep(250); +}; +export const flash = async (onEvent, port, manifestPath, manifest, eraseFirst) => { + let build; + let chipFamily; + const fireStateEvent = (stateUpdate) => onEvent({ + ...stateUpdate, + manifest, + build, + chipFamily, + }); + const transport = new Transport(port); + const esploader = new ESPLoader({ + transport, + baudrate: 115200, + romBaudrate: 115200, + enableTracing: false, + }); + // For debugging + window.esploader = esploader; + fireStateEvent({ + state: "initializing" /* FlashStateType.INITIALIZING */, + message: "Initializing...", + details: { done: false }, + }); + try { + await esploader.main(); + await esploader.flashId(); + } + catch (err) { + console.error(err); + fireStateEvent({ + state: "error" /* FlashStateType.ERROR */, + message: "Failed to initialize. Try resetting your device or holding the BOOT button while clicking INSTALL.", + details: { error: "failed_initialize" /* FlashError.FAILED_INITIALIZING */, details: err }, + }); + await resetTransport(transport); + await transport.disconnect(); + return; + } + chipFamily = esploader.chip.CHIP_NAME; + if (!esploader.chip.ROM_TEXT) { + fireStateEvent({ + state: "error" /* FlashStateType.ERROR */, + message: `Chip ${chipFamily} is not supported`, + details: { + error: "not_supported" /* FlashError.NOT_SUPPORTED */, + details: `Chip ${chipFamily} is not supported`, + }, + }); + await resetTransport(transport); + await transport.disconnect(); + return; + } + fireStateEvent({ + state: "initializing" /* FlashStateType.INITIALIZING */, + message: `Initialized. Found ${chipFamily}`, + details: { done: true }, + }); + build = manifest.builds.find((b) => b.chipFamily === chipFamily); + if (!build) { + fireStateEvent({ + state: "error" /* FlashStateType.ERROR */, + message: `Your ${chipFamily} board is not supported.`, + details: { error: "not_supported" /* FlashError.NOT_SUPPORTED */, details: chipFamily }, + }); + await resetTransport(transport); + await transport.disconnect(); + return; + } + fireStateEvent({ + state: "preparing" /* FlashStateType.PREPARING */, + message: "Preparing installation...", + details: { done: false }, + }); + const manifestURL = new URL(manifestPath, location.toString()).toString(); + const filePromises = build.parts.map(async (part) => { + const url = new URL(part.path, manifestURL).toString(); + const resp = await fetch(url); + if (!resp.ok) { + throw new Error(`Downlading firmware ${part.path} failed: ${resp.status}`); + } + const reader = new FileReader(); + const blob = await resp.blob(); + return new Promise((resolve) => { + reader.addEventListener("load", () => resolve(reader.result)); + reader.readAsBinaryString(blob); + }); + }); + const fileArray = []; + let totalSize = 0; + for (let part = 0; part < filePromises.length; part++) { + try { + const data = await filePromises[part]; + fileArray.push({ data, address: build.parts[part].offset }); + totalSize += data.length; + } + catch (err) { + fireStateEvent({ + state: "error" /* FlashStateType.ERROR */, + message: err.message, + details: { + error: "failed_firmware_download" /* FlashError.FAILED_FIRMWARE_DOWNLOAD */, + details: err.message, + }, + }); + await resetTransport(transport); + await transport.disconnect(); + return; + } + } + fireStateEvent({ + state: "preparing" /* FlashStateType.PREPARING */, + message: "Installation prepared", + details: { done: true }, + }); + if (eraseFirst) { + fireStateEvent({ + state: "erasing" /* FlashStateType.ERASING */, + message: "Erasing device...", + details: { done: false }, + }); + await esploader.eraseFlash(); + fireStateEvent({ + state: "erasing" /* FlashStateType.ERASING */, + message: "Device erased", + details: { done: true }, + }); + } + fireStateEvent({ + state: "writing" /* FlashStateType.WRITING */, + message: `Writing progress: 0%`, + details: { + bytesTotal: totalSize, + bytesWritten: 0, + percentage: 0, + }, + }); + let totalWritten = 0; + try { + await esploader.writeFlash({ + fileArray, + flashSize: "keep", + flashMode: "keep", + flashFreq: "keep", + eraseAll: false, + compress: true, + // report progress + reportProgress: (fileIndex, written, total) => { + const uncompressedWritten = (written / total) * fileArray[fileIndex].data.length; + const newPct = Math.floor(((totalWritten + uncompressedWritten) / totalSize) * 100); + // we're done with this file + if (written === total) { + totalWritten += uncompressedWritten; + return; + } + fireStateEvent({ + state: "writing" /* FlashStateType.WRITING */, + message: `Writing progress: ${newPct}%`, + details: { + bytesTotal: totalSize, + bytesWritten: totalWritten + written, + percentage: newPct, + }, + }); + }, + }); + } + catch (err) { + fireStateEvent({ + state: "error" /* FlashStateType.ERROR */, + message: err.message, + details: { error: "write_failed" /* FlashError.WRITE_FAILED */, details: err }, + }); + await resetTransport(transport); + await transport.disconnect(); + return; + } + fireStateEvent({ + state: "writing" /* FlashStateType.WRITING */, + message: "Writing complete", + details: { + bytesTotal: totalSize, + bytesWritten: totalWritten, + percentage: 100, + }, + }); + await sleep(100); + console.log("HARD RESET"); + await resetTransport(transport); + console.log("DISCONNECT"); + await transport.disconnect(); + fireStateEvent({ + state: "finished" /* FlashStateType.FINISHED */, + message: "All done!", + }); +}; diff --git a/website-src/esp-web-tools/dist/install-button.d.ts b/website-src/esp-web-tools/dist/install-button.d.ts new file mode 100644 index 00000000..eb8fc867 --- /dev/null +++ b/website-src/esp-web-tools/dist/install-button.d.ts @@ -0,0 +1,16 @@ +import type { FlashState } from "./const"; +import type { EwtInstallDialog } from "./install-dialog"; +export declare class InstallButton extends HTMLElement { + static isSupported: boolean; + static isAllowed: boolean; + private static style; + manifest?: string; + eraseFirst?: boolean; + hideProgress?: boolean; + showLog?: boolean; + logConsole?: boolean; + state?: FlashState; + renderRoot?: ShadowRoot; + overrides: EwtInstallDialog["overrides"]; + connectedCallback(): void; +} diff --git a/website-src/esp-web-tools/dist/install-button.js b/website-src/esp-web-tools/dist/install-button.js new file mode 100644 index 00000000..cf8e0962 --- /dev/null +++ b/website-src/esp-web-tools/dist/install-button.js @@ -0,0 +1,85 @@ +import { connect } from "./connect"; +export class InstallButton extends HTMLElement { + connectedCallback() { + if (this.renderRoot) { + return; + } + this.renderRoot = this.attachShadow({ mode: "open" }); + if (!InstallButton.isSupported || !InstallButton.isAllowed) { + this.toggleAttribute("install-unsupported", true); + this.renderRoot.innerHTML = !InstallButton.isAllowed + ? "You can only install ESP devices on HTTPS websites or on the localhost." + : "Your browser does not support installing things on ESP devices. Use Google Chrome or Microsoft Edge."; + return; + } + this.toggleAttribute("install-supported", true); + const slot = document.createElement("slot"); + slot.addEventListener("click", async (ev) => { + ev.preventDefault(); + connect(this); + }); + slot.name = "activate"; + const button = document.createElement("button"); + button.innerText = "Connect"; + slot.append(button); + if ("adoptedStyleSheets" in Document.prototype && + "replaceSync" in CSSStyleSheet.prototype) { + const sheet = new CSSStyleSheet(); + sheet.replaceSync(InstallButton.style); + this.renderRoot.adoptedStyleSheets = [sheet]; + } + else { + const styleSheet = document.createElement("style"); + styleSheet.innerText = InstallButton.style; + this.renderRoot.append(styleSheet); + } + this.renderRoot.append(slot); + } +} +InstallButton.isSupported = "serial" in navigator; +InstallButton.isAllowed = window.isSecureContext; +InstallButton.style = ` + button { + position: relative; + cursor: pointer; + font-size: 14px; + font-weight: 500; + padding: 10px 24px; + color: var(--esp-tools-button-text-color, #fff); + background-color: var(--esp-tools-button-color, #03a9f4); + border: none; + border-radius: var(--esp-tools-button-border-radius, 9999px); + } + button::before { + content: " "; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + opacity: 0.2; + border-radius: var(--esp-tools-button-border-radius, 9999px); + } + button:hover::before { + background-color: rgba(255,255,255,.8); + } + button:focus { + outline: none; + } + button:focus::before { + background-color: white; + } + button:active::before { + background-color: grey; + } + :host([active]) button { + color: rgba(0, 0, 0, 0.38); + background-color: rgba(0, 0, 0, 0.12); + box-shadow: none; + cursor: unset; + pointer-events: none; + } + .hidden { + display: none; + }`; +customElements.define("esp-web-install-button", InstallButton); diff --git a/website-src/esp-web-tools/dist/install-dialog.d.ts b/website-src/esp-web-tools/dist/install-dialog.d.ts new file mode 100644 index 00000000..d3f751c8 --- /dev/null +++ b/website-src/esp-web-tools/dist/install-dialog.d.ts @@ -0,0 +1,76 @@ +/// +import { LitElement, PropertyValues, TemplateResult } from "lit"; +import "./components/ew-text-button"; +import "./components/ew-list"; +import "./components/ew-list-item"; +import "./components/ew-divider"; +import "./components/ew-checkbox"; +import "./components/ewt-console"; +import "./components/ew-dialog"; +import "./components/ew-icon-button"; +import "./components/ew-filled-text-field"; +import "./components/ew-filled-select"; +import "./components/ew-select-option"; +import "./pages/ewt-page-progress"; +import "./pages/ewt-page-message"; +import { Logger, Manifest } from "./const.js"; +import { ImprovSerial } from "improv-wifi-serial-sdk/dist/serial"; +export declare class EwtInstallDialog extends LitElement { + port: SerialPort; + manifestPath: string; + logger: Logger; + overrides?: { + checkSameFirmware?: (manifest: Manifest, deviceImprov: ImprovSerial["info"]) => boolean; + }; + private _manifest; + private _info?; + private _client?; + private _state; + private _installErase; + private _installConfirmed; + private _installState?; + private _provisionForce; + private _wasProvisioned; + private _error?; + private _busy; + private _ssids?; + private _selectedSsid; + private _bodyOverflow; + protected render(): TemplateResult<1>; + _renderProgress(label: string | TemplateResult, progress?: number): TemplateResult<1>; + _renderError(label: string): [string, TemplateResult]; + _renderDashboard(): [string, TemplateResult, boolean]; + _renderDashboardNoImprov(): [string, TemplateResult, boolean]; + _renderProvision(): [string | undefined, TemplateResult]; + _renderAskErase(): [string | undefined, TemplateResult]; + _renderInstall(): [string | undefined, TemplateResult, boolean]; + _renderLogs(): [string | undefined, TemplateResult]; + willUpdate(changedProps: PropertyValues): void; + private _updateSsids; + protected firstUpdated(changedProps: PropertyValues): void; + protected updated(changedProps: PropertyValues): void; + private _focusFormElement; + private _initialize; + private _startInstall; + private _confirmInstall; + private _doProvision; + private _handleDisconnect; + private _closeDialog; + private _handleClose; + /** + * Return if the device runs same firmware as manifest. + */ + private get _isSameFirmware(); + /** + * Return if the device runs same firmware and version as manifest. + */ + private get _isSameVersion(); + private _closeClientWithoutEvents; + private _preventDefault; + static styles: import("lit").CSSResult[]; +} +declare global { + interface HTMLElementTagNameMap { + "ewt-install-dialog": EwtInstallDialog; + } +} diff --git a/website-src/esp-web-tools/dist/install-dialog.js b/website-src/esp-web-tools/dist/install-dialog.js new file mode 100644 index 00000000..435f7f14 --- /dev/null +++ b/website-src/esp-web-tools/dist/install-dialog.js @@ -0,0 +1,1001 @@ +import { __decorate } from "tslib"; +import { LitElement, html, css } from "lit"; +import { state } from "lit/decorators.js"; +import "./components/ew-text-button"; +import "./components/ew-list"; +import "./components/ew-list-item"; +import "./components/ew-divider"; +import "./components/ew-checkbox"; +import "./components/ewt-console"; +import "./components/ew-dialog"; +import "./components/ew-icon-button"; +import "./components/ew-filled-text-field"; +import "./components/ew-filled-select"; +import "./components/ew-select-option"; +import "./pages/ewt-page-progress"; +import "./pages/ewt-page-message"; +import { closeIcon, listItemConsole, listItemHomeAssistant, listItemInstallIcon, listItemVisitDevice, listItemWifi, refreshIcon, } from "./components/svg"; +import { ImprovSerial } from "improv-wifi-serial-sdk/dist/serial"; +import { ImprovSerialCurrentState, PortNotReady, } from "improv-wifi-serial-sdk/dist/const"; +import { flash } from "./flash"; +import { textDownload } from "./util/file-download"; +import { fireEvent } from "./util/fire-event"; +import { sleep } from "./util/sleep"; +import { downloadManifest } from "./util/manifest"; +import { dialogStyles } from "./styles"; +import { version } from "./version"; +console.log(`ESP Web Tools ${version} by Nabu Casa; https://esphome.github.io/esp-web-tools/`); +const ERROR_ICON = "⚠️"; +const OK_ICON = "🎉"; +export class EwtInstallDialog extends LitElement { + constructor() { + super(...arguments); + this.logger = console; + this._state = "DASHBOARD"; + this._installErase = false; + this._installConfirmed = false; + this._provisionForce = false; + this._wasProvisioned = false; + this._busy = false; + // Name of Ssid. Null = other + this._selectedSsid = null; + this._bodyOverflow = null; + this._handleDisconnect = () => { + this._state = "ERROR"; + this._error = "Disconnected"; + }; + } + render() { + if (!this.port) { + return html ``; + } + let heading; + let content; + let allowClosing = false; + // During installation phase we temporarily remove the client + if (this._client === undefined && + this._state !== "INSTALL" && + this._state !== "LOGS") { + if (this._error) { + [heading, content] = this._renderError(this._error); + } + else { + content = this._renderProgress("Connecting"); + } + } + else if (this._state === "INSTALL") { + [heading, content, allowClosing] = this._renderInstall(); + } + else if (this._state === "ASK_ERASE") { + [heading, content] = this._renderAskErase(); + } + else if (this._state === "ERROR") { + [heading, content] = this._renderError(this._error); + } + else if (this._state === "DASHBOARD") { + [heading, content, allowClosing] = this._client + ? this._renderDashboard() + : this._renderDashboardNoImprov(); + } + else if (this._state === "PROVISION") { + [heading, content] = this._renderProvision(); + } + else if (this._state === "LOGS") { + [heading, content] = this._renderLogs(); + } + return html ` + + ${heading ? html `
    ${heading}
    ` : ""} + ${allowClosing + ? html ` + + ${closeIcon} + + ` + : ""} + ${content} +
    + `; + } + _renderProgress(label, progress) { + return html ` + + `; + } + _renderError(label) { + const heading = "Error"; + const content = html ` + +
    + Close +
    + `; + return [heading, content]; + } + _renderDashboard() { + const heading = this._manifest.name; + let content; + let allowClosing = true; + content = html ` +
    + + +
    Connected to ${this._info.name}
    +
    + ${this._info.firmware} ${this._info.version} + (${this._info.chipFamily}) +
    +
    + ${!this._isSameVersion + ? html ` + { + if (this._isSameFirmware) { + this._startInstall(false); + } + else if (this._manifest.new_install_prompt_erase) { + this._state = "ASK_ERASE"; + } + else { + this._startInstall(true); + } + }} + > + ${listItemInstallIcon} +
    + ${!this._isSameFirmware + ? `Install ${this._manifest.name}` + : `Update ${this._manifest.name}`} +
    +
    + ` + : ""} + ${this._client.nextUrl === undefined + ? "" + : html ` + + ${listItemVisitDevice} +
    Visit Device
    +
    + `} + ${!this._manifest.home_assistant_domain || + this._client.state !== ImprovSerialCurrentState.PROVISIONED + ? "" + : html ` + + ${listItemHomeAssistant} +
    Add to Home Assistant
    +
    + `} + { + this._state = "PROVISION"; + if (this._client.state === ImprovSerialCurrentState.PROVISIONED) { + this._provisionForce = true; + } + }} + > + ${listItemWifi} +
    + ${this._client.state === ImprovSerialCurrentState.READY + ? "Connect to Wi-Fi" + : "Change Wi-Fi"} +
    +
    + { + const client = this._client; + if (client) { + await this._closeClientWithoutEvents(client); + await sleep(100); + } + // Also set `null` back to undefined. + this._client = undefined; + this._state = "LOGS"; + }} + > + ${listItemConsole} +
    Logs & Console
    +
    + ${this._isSameFirmware && this._manifest.funding_url + ? html ` + +
    Fund Development
    +
    + ` + : ""} + ${this._isSameVersion + ? html ` + this._startInstall(true)} + > +
    Erase User Data
    +
    + ` + : ""} +
    +
    + `; + return [heading, content, allowClosing]; + } + _renderDashboardNoImprov() { + const heading = this._manifest.name; + let content; + let allowClosing = true; + content = html ` +
    + + { + if (this._manifest.new_install_prompt_erase) { + this._state = "ASK_ERASE"; + } + else { + // Default is to erase a device that does not support Improv Serial + this._startInstall(true); + } + }} + > + ${listItemInstallIcon} +
    ${`Install ${this._manifest.name}`}
    +
    + { + // Also set `null` back to undefined. + this._client = undefined; + this._state = "LOGS"; + }} + > + ${listItemConsole} +
    Logs & Console
    +
    +
    +
    + `; + return [heading, content, allowClosing]; + } + _renderProvision() { + var _a; + let heading = "Configure Wi-Fi"; + let content; + if (this._busy) { + return [ + heading, + this._renderProgress(this._ssids === undefined + ? "Scanning for networks" + : "Trying to connect"), + ]; + } + if (!this._provisionForce && + this._client.state === ImprovSerialCurrentState.PROVISIONED) { + heading = undefined; + const showSetupLinks = !this._wasProvisioned && + (this._client.nextUrl !== undefined || + "home_assistant_domain" in this._manifest); + content = html ` +
    + + ${showSetupLinks + ? html ` + + ${this._client.nextUrl === undefined + ? "" + : html ` + { + this._state = "DASHBOARD"; + }} + > + ${listItemVisitDevice} +
    Visit Device
    +
    + `} + ${!this._manifest.home_assistant_domain + ? "" + : html ` + { + this._state = "DASHBOARD"; + }} + > + ${listItemHomeAssistant} +
    Add to Home Assistant
    +
    + `} + { + this._state = "DASHBOARD"; + }} + > +
    +
    Skip
    +
    +
    + ` + : ""} +
    + + ${!showSetupLinks + ? html ` +
    + { + this._state = "DASHBOARD"; + }} + > + Continue + +
    + ` + : ""} + `; + } + else { + let error; + switch (this._client.error) { + case 3 /* ImprovSerialErrorState.UNABLE_TO_CONNECT */: + error = "Unable to connect"; + break; + case 254 /* ImprovSerialErrorState.TIMEOUT */: + error = "Timeout"; + break; + case 0 /* ImprovSerialErrorState.NO_ERROR */: + // Happens when list SSIDs not supported. + case 2 /* ImprovSerialErrorState.UNKNOWN_RPC_COMMAND */: + break; + default: + error = `Unknown error (${this._client.error})`; + } + const selectedSsid = (_a = this._ssids) === null || _a === void 0 ? void 0 : _a.find((info) => info.name === this._selectedSsid); + content = html ` + + ${refreshIcon} + +
    +
    Connect your device to the network to start using it.
    + ${error ? html `

    ${error}

    ` : ""} + ${this._ssids !== null + ? html ` + { + const index = ev.target.selectedIndex; + // The "Join Other" item is always the last item. + this._selectedSsid = + index === this._ssids.length + ? null + : this._ssids[index].name; + }} + > + ${this._ssids.map((info) => html ` + + ${info.name} + + `)} + + + Join other… + + + ` + : ""} + ${ + // Show input box if command not supported or "Join Other" selected + !selectedSsid + ? html ` + + ` + : ""} + ${!selectedSsid || selectedSsid.secured + ? html ` + + ` + : ""} +
    +
    + { + this._state = "DASHBOARD"; + }} + > + ${this._installState && this._installErase ? "Skip" : "Back"} + + Connect +
    + `; + } + return [heading, content]; + } + _renderAskErase() { + const heading = "Erase device"; + const content = html ` +
    +
    + Do you want to erase the device before installing + ${this._manifest.name}? All data on the device will be lost. +
    + +
    +
    + { + this._state = "DASHBOARD"; + }} + > + Back + + { + const checkbox = this.shadowRoot.querySelector("ew-checkbox"); + this._startInstall(checkbox.checked); + }} + > + Next + +
    + `; + return [heading, content]; + } + _renderInstall() { + let heading; + let content; + const allowClosing = false; + const isUpdate = !this._installErase && this._isSameFirmware; + if (!this._installConfirmed && this._isSameVersion) { + heading = "Erase User Data"; + content = html ` +
    + Do you want to reset your device and erase all user data from your + device? +
    +
    + + Erase User Data + +
    + `; + } + else if (!this._installConfirmed) { + heading = "Confirm Installation"; + const action = isUpdate ? "update to" : "install"; + content = html ` +
    + ${isUpdate + ? html `Your device is running + ${this._info.firmware} ${this._info.version}.

    ` + : ""} + Do you want to ${action} + ${this._manifest.name} ${this._manifest.version}? + ${this._installErase + ? html `

    All data on the device will be erased.` + : ""} +
    +
    + { + this._state = "DASHBOARD"; + }} + > + Back + + + Install + +
    + `; + } + else if (!this._installState || + this._installState.state === "initializing" /* FlashStateType.INITIALIZING */ || + this._installState.state === "preparing" /* FlashStateType.PREPARING */) { + heading = "Installing"; + content = this._renderProgress("Preparing installation"); + } + else if (this._installState.state === "erasing" /* FlashStateType.ERASING */) { + heading = "Installing"; + content = this._renderProgress("Erasing"); + } + else if (this._installState.state === "writing" /* FlashStateType.WRITING */ || + // When we're finished, keep showing this screen with 100% written + // until Improv is initialized / not detected. + (this._installState.state === "finished" /* FlashStateType.FINISHED */ && + this._client === undefined)) { + heading = "Installing"; + let percentage; + let undeterminateLabel; + if (this._installState.state === "finished" /* FlashStateType.FINISHED */) { + // We're done writing and detecting improv, show spinner + undeterminateLabel = "Wrapping up"; + } + else if (this._installState.details.percentage < 4) { + // We're writing the firmware under 4%, show spinner or else we don't show any pixels + undeterminateLabel = "Installing"; + } + else { + // We're writing the firmware over 4%, show progress bar + percentage = this._installState.details.percentage; + } + content = this._renderProgress(html ` + ${undeterminateLabel ? html `${undeterminateLabel}
    ` : ""} +
    + This will take + ${this._installState.chipFamily === "ESP8266" + ? "a minute" + : "2 minutes"}.
    + Keep this page visible to prevent slow down + `, percentage); + } + else if (this._installState.state === "finished" /* FlashStateType.FINISHED */) { + heading = undefined; + const supportsImprov = this._client !== null; + content = html ` + + +
    + { + this._state = + supportsImprov && this._installErase + ? "PROVISION" + : "DASHBOARD"; + }} + > + Next + +
    + `; + } + else if (this._installState.state === "error" /* FlashStateType.ERROR */) { + heading = "Installation failed"; + content = html ` + +
    + { + this._initialize(); + this._state = "DASHBOARD"; + }} + > + Back + +
    + `; + } + return [heading, content, allowClosing]; + } + _renderLogs() { + let heading = `Logs`; + let content; + content = html ` +
    + +
    +
    + { + await this.shadowRoot.querySelector("ewt-console").reset(); + }} + > + Reset Device + + { + textDownload(this.shadowRoot.querySelector("ewt-console").logs(), `esp-web-tools-logs.txt`); + this.shadowRoot.querySelector("ewt-console").reset(); + }} + > + Download Logs + + { + await this.shadowRoot.querySelector("ewt-console").disconnect(); + this._state = "DASHBOARD"; + this._initialize(); + }} + > + Back + +
    + `; + return [heading, content]; + } + willUpdate(changedProps) { + if (!changedProps.has("_state")) { + return; + } + // Clear errors when changing between pages unless we change + // to the error page. + if (this._state !== "ERROR") { + this._error = undefined; + } + // Scan for SSIDs on provision + if (this._state === "PROVISION") { + this._updateSsids(); + } + else { + // Reset this value if we leave provisioning. + this._provisionForce = false; + } + if (this._state === "INSTALL") { + this._installConfirmed = false; + this._installState = undefined; + } + } + async _updateSsids(tries = 0) { + const oldSsids = this._ssids; + this._ssids = undefined; + this._busy = true; + let ssids; + try { + ssids = await this._client.scan(); + } + catch (err) { + // When we fail while loading, pick "Join other" + if (this._ssids === undefined) { + this._ssids = null; + this._selectedSsid = null; + } + this._busy = false; + return; + } + // We will retry a few times if we don't get any results + if (ssids.length === 0 && tries < 3) { + console.log("SCHEDULE RETRY", tries); + setTimeout(() => this._updateSsids(tries + 1), 1000); + return; + } + if (oldSsids) { + // If we had a previous list, ensure the selection is still valid + if (this._selectedSsid && + !ssids.find((s) => s.name === this._selectedSsid)) { + this._selectedSsid = ssids[0].name; + } + } + else { + this._selectedSsid = ssids.length ? ssids[0].name : null; + } + this._ssids = ssids; + this._busy = false; + } + firstUpdated(changedProps) { + super.firstUpdated(changedProps); + this._bodyOverflow = document.body.style.overflow; + document.body.style.overflow = "hidden"; + this._initialize(); + } + updated(changedProps) { + super.updated(changedProps); + if (changedProps.has("_state")) { + this.setAttribute("state", this._state); + } + if (this._state !== "PROVISION") { + return; + } + if (changedProps.has("_selectedSsid") && this._selectedSsid === null) { + // If we pick "Join other", select SSID input. + this._focusFormElement("ew-filled-text-field[name=ssid]"); + } + else if (changedProps.has("_ssids")) { + // Form is shown when SSIDs are loaded/marked not supported + this._focusFormElement(); + } + } + _focusFormElement(selector = "ew-filled-text-field, ew-filled-select") { + const formEl = this.shadowRoot.querySelector(selector); + if (formEl) { + formEl.updateComplete.then(() => setTimeout(() => formEl.focus(), 100)); + } + } + async _initialize(justInstalled = false) { + if (this.port.readable === null || this.port.writable === null) { + this._state = "ERROR"; + this._error = + "Serial port is not readable/writable. Close any other application using it and try again."; + return; + } + try { + this._manifest = await downloadManifest(this.manifestPath); + } + catch (err) { + this._state = "ERROR"; + this._error = "Failed to download manifest"; + return; + } + if (this._manifest.new_install_improv_wait_time === 0) { + this._client = null; + return; + } + const client = new ImprovSerial(this.port, this.logger); + client.addEventListener("state-changed", () => { + this.requestUpdate(); + }); + client.addEventListener("error-changed", () => this.requestUpdate()); + try { + // If a device was just installed, give new firmware 10 seconds (overridable) to + // format the rest of the flash and do other stuff. + const timeout = !justInstalled + ? 1000 + : this._manifest.new_install_improv_wait_time !== undefined + ? this._manifest.new_install_improv_wait_time * 1000 + : 10000; + this._info = await client.initialize(timeout); + this._client = client; + client.addEventListener("disconnect", this._handleDisconnect); + } + catch (err) { + // Clear old value + this._info = undefined; + if (err instanceof PortNotReady) { + this._state = "ERROR"; + this._error = + "Serial port is not ready. Close any other application using it and try again."; + } + else { + this._client = null; // not supported + this.logger.error("Improv initialization failed.", err); + } + } + } + _startInstall(erase) { + this._state = "INSTALL"; + this._installErase = erase; + this._installConfirmed = false; + } + async _confirmInstall() { + this._installConfirmed = true; + this._installState = undefined; + if (this._client) { + await this._closeClientWithoutEvents(this._client); + } + this._client = undefined; + // Close port. ESPLoader likes opening it. + await this.port.close(); + flash((state) => { + this._installState = state; + if (state.state === "finished" /* FlashStateType.FINISHED */) { + sleep(100) + // Flashing closes the port + .then(() => this.port.open({ baudRate: 115200 })) + .then(() => this._initialize(true)) + .then(() => this.requestUpdate()); + } + else if (state.state === "error" /* FlashStateType.ERROR */) { + sleep(100) + // Flashing closes the port + .then(() => this.port.open({ baudRate: 115200 })); + } + }, this.port, this.manifestPath, this._manifest, this._installErase); + } + async _doProvision() { + var _a; + this._busy = true; + this._wasProvisioned = + this._client.state === ImprovSerialCurrentState.PROVISIONED; + const ssid = this._selectedSsid === null + ? this.shadowRoot.querySelector("ew-filled-text-field[name=ssid]").value + : this._selectedSsid; + const password = ((_a = this.shadowRoot.querySelector("ew-filled-text-field[name=password]")) === null || _a === void 0 ? void 0 : _a.value) || ""; + try { + await this._client.provision(ssid, password, 30000); + } + catch (err) { + return; + } + finally { + this._busy = false; + this._provisionForce = false; + } + } + _closeDialog() { + this.shadowRoot.querySelector("ew-dialog").close(); + } + async _handleClose() { + if (this._client) { + await this._closeClientWithoutEvents(this._client); + } + fireEvent(this, "closed"); + document.body.style.overflow = this._bodyOverflow; + this.parentNode.removeChild(this); + } + /** + * Return if the device runs same firmware as manifest. + */ + get _isSameFirmware() { + var _a; + return !this._info + ? false + : ((_a = this.overrides) === null || _a === void 0 ? void 0 : _a.checkSameFirmware) + ? this.overrides.checkSameFirmware(this._manifest, this._info) + : this._info.firmware === this._manifest.name; + } + /** + * Return if the device runs same firmware and version as manifest. + */ + get _isSameVersion() { + return (this._isSameFirmware && this._info.version === this._manifest.version); + } + async _closeClientWithoutEvents(client) { + client.removeEventListener("disconnect", this._handleDisconnect); + await client.close(); + } + _preventDefault(ev) { + ev.preventDefault(); + } +} +EwtInstallDialog.styles = [ + dialogStyles, + css ` + :host { + --mdc-dialog-max-width: 390px; + } + div[slot="headline"] { + padding-right: 48px; + } + ew-icon-button[slot="headline"] { + position: absolute; + right: 4px; + top: 8px; + } + ew-icon-button[slot="headline"] svg { + padding: 8px; + color: var(--text-color); + } + .dialog-nav svg { + color: var(--text-color); + } + .table-row { + display: flex; + } + .table-row.last { + margin-bottom: 16px; + } + .table-row svg { + width: 20px; + margin-right: 8px; + } + ew-filled-text-field, + ew-filled-select { + display: block; + margin-top: 16px; + } + label.formfield { + display: inline-flex; + align-items: center; + padding-right: 8px; + } + ew-list { + margin: 0 -24px; + padding: 0; + } + ew-list-item svg { + height: 24px; + } + ewt-page-message + ew-list { + padding-top: 16px; + } + .fake-icon { + width: 24px; + } + .error { + color: var(--danger-color); + } + .danger { + --mdc-theme-primary: var(--danger-color); + --mdc-theme-secondary: var(--danger-color); + --md-sys-color-primary: var(--danger-color); + --md-sys-color-on-surface: var(--danger-color); + } + button.link { + background: none; + color: inherit; + border: none; + padding: 0; + font: inherit; + text-align: left; + text-decoration: underline; + cursor: pointer; + } + :host([state="LOGS"]) ew-dialog { + max-width: 90vw; + max-height: 90vh; + } + ewt-console { + width: calc(80vw - 48px); + height: calc(90vh - 168px); + } + `, +]; +__decorate([ + state() +], EwtInstallDialog.prototype, "_client", void 0); +__decorate([ + state() +], EwtInstallDialog.prototype, "_state", void 0); +__decorate([ + state() +], EwtInstallDialog.prototype, "_installErase", void 0); +__decorate([ + state() +], EwtInstallDialog.prototype, "_installConfirmed", void 0); +__decorate([ + state() +], EwtInstallDialog.prototype, "_installState", void 0); +__decorate([ + state() +], EwtInstallDialog.prototype, "_provisionForce", void 0); +__decorate([ + state() +], EwtInstallDialog.prototype, "_error", void 0); +__decorate([ + state() +], EwtInstallDialog.prototype, "_busy", void 0); +__decorate([ + state() +], EwtInstallDialog.prototype, "_ssids", void 0); +__decorate([ + state() +], EwtInstallDialog.prototype, "_selectedSsid", void 0); +customElements.define("ewt-install-dialog", EwtInstallDialog); diff --git a/website-src/esp-web-tools/dist/no-port-picked/index.d.ts b/website-src/esp-web-tools/dist/no-port-picked/index.d.ts new file mode 100644 index 00000000..1750c507 --- /dev/null +++ b/website-src/esp-web-tools/dist/no-port-picked/index.d.ts @@ -0,0 +1,2 @@ +import "./no-port-picked-dialog"; +export declare const openNoPortPickedDialog: (doTryAgain?: () => void) => Promise; diff --git a/website-src/esp-web-tools/dist/no-port-picked/index.js b/website-src/esp-web-tools/dist/no-port-picked/index.js new file mode 100644 index 00000000..55fd80fc --- /dev/null +++ b/website-src/esp-web-tools/dist/no-port-picked/index.js @@ -0,0 +1,7 @@ +import "./no-port-picked-dialog"; +export const openNoPortPickedDialog = async (doTryAgain) => { + const dialog = document.createElement("ewt-no-port-picked-dialog"); + dialog.doTryAgain = doTryAgain; + document.body.append(dialog); + return true; +}; diff --git a/website-src/esp-web-tools/dist/no-port-picked/no-port-picked-dialog.d.ts b/website-src/esp-web-tools/dist/no-port-picked/no-port-picked-dialog.d.ts new file mode 100644 index 00000000..7aa609ef --- /dev/null +++ b/website-src/esp-web-tools/dist/no-port-picked/no-port-picked-dialog.d.ts @@ -0,0 +1,17 @@ +import { LitElement } from "lit"; +import "../components/ew-dialog"; +import "../components/ew-text-button"; +declare class EwtNoPortPickedDialog extends LitElement { + doTryAgain?: () => void; + render(): import("lit-html").TemplateResult<1>; + private tryAgain; + private close; + private _handleClose; + static styles: import("lit").CSSResult[]; +} +declare global { + interface HTMLElementTagNameMap { + "ewt-no-port-picked-dialog": EwtNoPortPickedDialog; + } +} +export {}; diff --git a/website-src/esp-web-tools/dist/no-port-picked/no-port-picked-dialog.js b/website-src/esp-web-tools/dist/no-port-picked/no-port-picked-dialog.js new file mode 100644 index 00000000..305aaafd --- /dev/null +++ b/website-src/esp-web-tools/dist/no-port-picked/no-port-picked-dialog.js @@ -0,0 +1,164 @@ +import { __decorate } from "tslib"; +import { LitElement, html, css, svg } from "lit"; +import { customElement } from "lit/decorators.js"; +import "../components/ew-dialog"; +import "../components/ew-text-button"; +import { dialogStyles } from "../styles"; +import { getOperatingSystem } from "../util/get-operating-system"; +const cloudDownload = svg ` + + + + + +`; +let EwtNoPortPickedDialog = class EwtNoPortPickedDialog extends LitElement { + render() { + const OS = getOperatingSystem(); + return html ` + +
    No port selected
    +
    +
    + If you didn't select a port because you didn't see your device + listed, try the following steps: +
    +
      +
    1. + Make sure that the device is connected to this computer (the one + that runs the browser that shows this website) +
    2. +
    3. + Most devices have a tiny light when it is powered on. If yours has + one, make sure it is on. +
    4. +
    5. + Make sure that the USB cable you use can be used for data and is + not a power-only cable. +
    6. + ${OS === "Linux" + ? html ` +
    7. + If you are using a Linux flavor, make sure that your user is + part of the dialout group so it has permission + to access the device. + sudo usermod -a -G dialout YourUserName + You may need to log out & back in or reboot to activate the + new group access. +
    8. + ` + : ""} +
    9. + Make sure you have the right drivers installed. Below are the + drivers for common chips used in ESP devices: +
        +
      • + CP2102 drivers: + Windows & Mac +
      • +
      • + CH342, CH343, CH9102 drivers: + Windows, + Mac +
        + (download via blue button with ${cloudDownload} icon) +
      • +
      • + CH340, CH341 drivers: + Windows, + Mac +
        + (download via blue button with ${cloudDownload} icon) +
      • +
      +
    10. +
    +
    +
    + ${this.doTryAgain + ? html ` + Cancel + + Try Again + + ` + : html ` + Close + `} +
    +
    + `; + } + tryAgain() { + var _a; + this.close(); + (_a = this.doTryAgain) === null || _a === void 0 ? void 0 : _a.call(this); + } + close() { + this.shadowRoot.querySelector("ew-dialog").close(); + } + async _handleClose() { + this.parentNode.removeChild(this); + } +}; +EwtNoPortPickedDialog.styles = [ + dialogStyles, + css ` + li + li, + li > ul { + margin-top: 8px; + } + ul, + ol { + margin-bottom: 0; + padding-left: 1.5em; + } + li code.block { + display: block; + margin: 0.5em 0; + } + `, +]; +EwtNoPortPickedDialog = __decorate([ + customElement("ewt-no-port-picked-dialog") +], EwtNoPortPickedDialog); diff --git a/website-src/esp-web-tools/dist/pages/ewt-page-message.d.ts b/website-src/esp-web-tools/dist/pages/ewt-page-message.d.ts new file mode 100644 index 00000000..56d76493 --- /dev/null +++ b/website-src/esp-web-tools/dist/pages/ewt-page-message.d.ts @@ -0,0 +1,13 @@ +import { LitElement, TemplateResult } from "lit"; +declare class EwtPageMessage extends LitElement { + icon: string; + label: string | TemplateResult; + render(): TemplateResult<1>; + static styles: import("lit").CSSResult; +} +declare global { + interface HTMLElementTagNameMap { + "ewt-page-message": EwtPageMessage; + } +} +export {}; diff --git a/website-src/esp-web-tools/dist/pages/ewt-page-message.js b/website-src/esp-web-tools/dist/pages/ewt-page-message.js new file mode 100644 index 00000000..dd56ef11 --- /dev/null +++ b/website-src/esp-web-tools/dist/pages/ewt-page-message.js @@ -0,0 +1,30 @@ +import { __decorate } from "tslib"; +import { LitElement, html, css } from "lit"; +import { property } from "lit/decorators.js"; +class EwtPageMessage extends LitElement { + render() { + return html ` +
    ${this.icon}
    + ${this.label} + `; + } +} +EwtPageMessage.styles = css ` + :host { + display: flex; + flex-direction: column; + text-align: center; + } + .icon { + font-size: 50px; + line-height: 80px; + color: black; + } + `; +__decorate([ + property() +], EwtPageMessage.prototype, "icon", void 0); +__decorate([ + property() +], EwtPageMessage.prototype, "label", void 0); +customElements.define("ewt-page-message", EwtPageMessage); diff --git a/website-src/esp-web-tools/dist/pages/ewt-page-progress.d.ts b/website-src/esp-web-tools/dist/pages/ewt-page-progress.d.ts new file mode 100644 index 00000000..1796386e --- /dev/null +++ b/website-src/esp-web-tools/dist/pages/ewt-page-progress.d.ts @@ -0,0 +1,14 @@ +import { LitElement, TemplateResult } from "lit"; +import "../components/ew-circular-progress"; +declare class EwtPageProgress extends LitElement { + label: string | TemplateResult; + progress: number | undefined; + render(): TemplateResult<1>; + static styles: import("lit").CSSResult; +} +declare global { + interface HTMLElementTagNameMap { + "ewt-page-progress": EwtPageProgress; + } +} +export {}; diff --git a/website-src/esp-web-tools/dist/pages/ewt-page-progress.js b/website-src/esp-web-tools/dist/pages/ewt-page-progress.js new file mode 100644 index 00000000..9254a372 --- /dev/null +++ b/website-src/esp-web-tools/dist/pages/ewt-page-progress.js @@ -0,0 +1,38 @@ +import { __decorate } from "tslib"; +import { LitElement, html, css } from "lit"; +import { property } from "lit/decorators.js"; +import "../components/ew-circular-progress"; +class EwtPageProgress extends LitElement { + render() { + return html ` +
    + + ${this.progress !== undefined ? html `
    ${this.progress}%
    ` : ""} +
    + ${this.label} + `; + } +} +EwtPageProgress.styles = css ` + :host { + display: flex; + flex-direction: column; + text-align: center; + } + ew-circular-progress { + margin-bottom: 16px; + } + `; +__decorate([ + property() +], EwtPageProgress.prototype, "label", void 0); +__decorate([ + property() +], EwtPageProgress.prototype, "progress", void 0); +customElements.define("ewt-page-progress", EwtPageProgress); diff --git a/website-src/esp-web-tools/dist/styles.d.ts b/website-src/esp-web-tools/dist/styles.d.ts new file mode 100644 index 00000000..a6d7cf08 --- /dev/null +++ b/website-src/esp-web-tools/dist/styles.d.ts @@ -0,0 +1 @@ +export declare const dialogStyles: import("lit").CSSResult; diff --git a/website-src/esp-web-tools/dist/styles.js b/website-src/esp-web-tools/dist/styles.js new file mode 100644 index 00000000..aedb1b39 --- /dev/null +++ b/website-src/esp-web-tools/dist/styles.js @@ -0,0 +1,29 @@ +import { css } from "lit"; +// We set font-size to 16px and all the mdc typography styles +// because it defaults to rem, which means that the font-size +// of the host website would influence the ESP Web Tools dialog. +export const dialogStyles = css ` + :host { + --roboto-font: Roboto, system-ui; + --text-color: rgba(0, 0, 0, 0.6); + --danger-color: #db4437; + + --md-sys-color-primary: #03a9f4; + --md-sys-color-on-primary: #fff; + --md-ref-typeface-brand: var(--roboto-font); + --md-ref-typeface-plain: var(--roboto-font); + + --md-sys-color-surface: #fff; + --md-sys-color-surface-container: #fff; + --md-sys-color-surface-container-high: #fff; + --md-sys-color-surface-container-highest: #f5f5f5; + --md-sys-color-secondary-container: #e0e0e0; + + --md-sys-typescale-headline-font: var(--roboto-font); + --md-sys-typescale-title-font: var(--roboto-font); + } + + a { + color: var(--md-sys-color-primary); + } +`; diff --git a/website-src/esp-web-tools/dist/util/console-color.d.ts b/website-src/esp-web-tools/dist/util/console-color.d.ts new file mode 100644 index 00000000..860484b4 --- /dev/null +++ b/website-src/esp-web-tools/dist/util/console-color.d.ts @@ -0,0 +1,19 @@ +interface ConsoleState { + bold: boolean; + italic: boolean; + underline: boolean; + strikethrough: boolean; + foregroundColor: string | null; + backgroundColor: string | null; + carriageReturn: boolean; + secret: boolean; +} +export declare class ColoredConsole { + targetElement: HTMLElement; + state: ConsoleState; + constructor(targetElement: HTMLElement); + logs(): string; + addLine(line: string): void; +} +export declare const coloredConsoleStyles = "\n .log {\n flex: 1;\n background-color: #1c1c1c;\n font-family: \"SFMono-Regular\", Consolas, \"Liberation Mono\", Menlo, Courier,\n monospace;\n font-size: 12px;\n padding: 16px;\n overflow: auto;\n line-height: 1.45;\n border-radius: 3px;\n white-space: pre-wrap;\n overflow-wrap: break-word;\n color: #ddd;\n }\n\n .log-bold {\n font-weight: bold;\n }\n .log-italic {\n font-style: italic;\n }\n .log-underline {\n text-decoration: underline;\n }\n .log-strikethrough {\n text-decoration: line-through;\n }\n .log-underline.log-strikethrough {\n text-decoration: underline line-through;\n }\n .log-secret {\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n .log-secret-redacted {\n opacity: 0;\n width: 1px;\n font-size: 1px;\n }\n .log-fg-black {\n color: rgb(128, 128, 128);\n }\n .log-fg-red {\n color: rgb(255, 0, 0);\n }\n .log-fg-green {\n color: rgb(0, 255, 0);\n }\n .log-fg-yellow {\n color: rgb(255, 255, 0);\n }\n .log-fg-blue {\n color: rgb(0, 0, 255);\n }\n .log-fg-magenta {\n color: rgb(255, 0, 255);\n }\n .log-fg-cyan {\n color: rgb(0, 255, 255);\n }\n .log-fg-white {\n color: rgb(187, 187, 187);\n }\n .log-bg-black {\n background-color: rgb(0, 0, 0);\n }\n .log-bg-red {\n background-color: rgb(255, 0, 0);\n }\n .log-bg-green {\n background-color: rgb(0, 255, 0);\n }\n .log-bg-yellow {\n background-color: rgb(255, 255, 0);\n }\n .log-bg-blue {\n background-color: rgb(0, 0, 255);\n }\n .log-bg-magenta {\n background-color: rgb(255, 0, 255);\n }\n .log-bg-cyan {\n background-color: rgb(0, 255, 255);\n }\n .log-bg-white {\n background-color: rgb(255, 255, 255);\n }\n"; +export {}; diff --git a/website-src/esp-web-tools/dist/util/console-color.js b/website-src/esp-web-tools/dist/util/console-color.js new file mode 100644 index 00000000..9c699d92 --- /dev/null +++ b/website-src/esp-web-tools/dist/util/console-color.js @@ -0,0 +1,266 @@ +export class ColoredConsole { + constructor(targetElement) { + this.targetElement = targetElement; + this.state = { + bold: false, + italic: false, + underline: false, + strikethrough: false, + foregroundColor: null, + backgroundColor: null, + carriageReturn: false, + secret: false, + }; + } + logs() { + return this.targetElement.innerText; + } + addLine(line) { + const re = /(?:\033|\\033)(?:\[(.*?)[@-~]|\].*?(?:\007|\033\\))/g; + let i = 0; + if (this.state.carriageReturn) { + if (line !== "\n") { + // don't remove if \r\n + this.targetElement.removeChild(this.targetElement.lastChild); + } + this.state.carriageReturn = false; + } + if (line.includes("\r")) { + this.state.carriageReturn = true; + } + const lineSpan = document.createElement("span"); + lineSpan.classList.add("line"); + this.targetElement.appendChild(lineSpan); + const addSpan = (content) => { + if (content === "") + return; + const span = document.createElement("span"); + if (this.state.bold) + span.classList.add("log-bold"); + if (this.state.italic) + span.classList.add("log-italic"); + if (this.state.underline) + span.classList.add("log-underline"); + if (this.state.strikethrough) + span.classList.add("log-strikethrough"); + if (this.state.secret) + span.classList.add("log-secret"); + if (this.state.foregroundColor !== null) + span.classList.add(`log-fg-${this.state.foregroundColor}`); + if (this.state.backgroundColor !== null) + span.classList.add(`log-bg-${this.state.backgroundColor}`); + span.appendChild(document.createTextNode(content)); + lineSpan.appendChild(span); + if (this.state.secret) { + const redacted = document.createElement("span"); + redacted.classList.add("log-secret-redacted"); + redacted.appendChild(document.createTextNode("[redacted]")); + lineSpan.appendChild(redacted); + } + }; + while (true) { + const match = re.exec(line); + if (match === null) + break; + const j = match.index; + addSpan(line.substring(i, j)); + i = j + match[0].length; + if (match[1] === undefined) + continue; + for (const colorCode of match[1].split(";")) { + switch (parseInt(colorCode)) { + case 0: + // reset + this.state.bold = false; + this.state.italic = false; + this.state.underline = false; + this.state.strikethrough = false; + this.state.foregroundColor = null; + this.state.backgroundColor = null; + this.state.secret = false; + break; + case 1: + this.state.bold = true; + break; + case 3: + this.state.italic = true; + break; + case 4: + this.state.underline = true; + break; + case 5: + this.state.secret = true; + break; + case 6: + this.state.secret = false; + break; + case 9: + this.state.strikethrough = true; + break; + case 22: + this.state.bold = false; + break; + case 23: + this.state.italic = false; + break; + case 24: + this.state.underline = false; + break; + case 29: + this.state.strikethrough = false; + break; + case 30: + this.state.foregroundColor = "black"; + break; + case 31: + this.state.foregroundColor = "red"; + break; + case 32: + this.state.foregroundColor = "green"; + break; + case 33: + this.state.foregroundColor = "yellow"; + break; + case 34: + this.state.foregroundColor = "blue"; + break; + case 35: + this.state.foregroundColor = "magenta"; + break; + case 36: + this.state.foregroundColor = "cyan"; + break; + case 37: + this.state.foregroundColor = "white"; + break; + case 39: + this.state.foregroundColor = null; + break; + case 41: + this.state.backgroundColor = "red"; + break; + case 42: + this.state.backgroundColor = "green"; + break; + case 43: + this.state.backgroundColor = "yellow"; + break; + case 44: + this.state.backgroundColor = "blue"; + break; + case 45: + this.state.backgroundColor = "magenta"; + break; + case 46: + this.state.backgroundColor = "cyan"; + break; + case 47: + this.state.backgroundColor = "white"; + break; + case 40: + case 49: + this.state.backgroundColor = null; + break; + } + } + } + const atBottom = this.targetElement.scrollTop > + this.targetElement.scrollHeight - this.targetElement.offsetHeight - 50; + addSpan(line.substring(i)); + // Keep scroll at bottom + if (atBottom) { + this.targetElement.scrollTop = this.targetElement.scrollHeight; + } + } +} +export const coloredConsoleStyles = ` + .log { + flex: 1; + background-color: #1c1c1c; + font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, + monospace; + font-size: 12px; + padding: 16px; + overflow: auto; + line-height: 1.45; + border-radius: 3px; + white-space: pre-wrap; + overflow-wrap: break-word; + color: #ddd; + } + + .log-bold { + font-weight: bold; + } + .log-italic { + font-style: italic; + } + .log-underline { + text-decoration: underline; + } + .log-strikethrough { + text-decoration: line-through; + } + .log-underline.log-strikethrough { + text-decoration: underline line-through; + } + .log-secret { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + } + .log-secret-redacted { + opacity: 0; + width: 1px; + font-size: 1px; + } + .log-fg-black { + color: rgb(128, 128, 128); + } + .log-fg-red { + color: rgb(255, 0, 0); + } + .log-fg-green { + color: rgb(0, 255, 0); + } + .log-fg-yellow { + color: rgb(255, 255, 0); + } + .log-fg-blue { + color: rgb(0, 0, 255); + } + .log-fg-magenta { + color: rgb(255, 0, 255); + } + .log-fg-cyan { + color: rgb(0, 255, 255); + } + .log-fg-white { + color: rgb(187, 187, 187); + } + .log-bg-black { + background-color: rgb(0, 0, 0); + } + .log-bg-red { + background-color: rgb(255, 0, 0); + } + .log-bg-green { + background-color: rgb(0, 255, 0); + } + .log-bg-yellow { + background-color: rgb(255, 255, 0); + } + .log-bg-blue { + background-color: rgb(0, 0, 255); + } + .log-bg-magenta { + background-color: rgb(255, 0, 255); + } + .log-bg-cyan { + background-color: rgb(0, 255, 255); + } + .log-bg-white { + background-color: rgb(255, 255, 255); + } +`; diff --git a/website-src/esp-web-tools/dist/util/file-download.d.ts b/website-src/esp-web-tools/dist/util/file-download.d.ts new file mode 100644 index 00000000..0b98f7e1 --- /dev/null +++ b/website-src/esp-web-tools/dist/util/file-download.d.ts @@ -0,0 +1,2 @@ +export declare const fileDownload: (href: string, filename?: string) => void; +export declare const textDownload: (text: string, filename?: string) => void; diff --git a/website-src/esp-web-tools/dist/util/file-download.js b/website-src/esp-web-tools/dist/util/file-download.js new file mode 100644 index 00000000..9c88ca72 --- /dev/null +++ b/website-src/esp-web-tools/dist/util/file-download.js @@ -0,0 +1,15 @@ +export const fileDownload = (href, filename = "") => { + const a = document.createElement("a"); + a.target = "_blank"; + a.href = href; + a.download = filename; + document.body.appendChild(a); + a.dispatchEvent(new MouseEvent("click")); + document.body.removeChild(a); +}; +export const textDownload = (text, filename = "") => { + const blob = new Blob([text], { type: "text/plain" }); + const url = URL.createObjectURL(blob); + fileDownload(url, filename); + setTimeout(() => URL.revokeObjectURL(url), 0); +}; diff --git a/website-src/esp-web-tools/dist/util/fire-event.d.ts b/website-src/esp-web-tools/dist/util/fire-event.d.ts new file mode 100644 index 00000000..61c4f2dc --- /dev/null +++ b/website-src/esp-web-tools/dist/util/fire-event.d.ts @@ -0,0 +1,5 @@ +export declare const fireEvent: (eventTarget: EventTarget, type: Event_1, detail?: HTMLElementEventMap[Event_1]["detail"] | undefined, options?: { + bubbles?: boolean; + cancelable?: boolean; + composed?: boolean; +}) => void; diff --git a/website-src/esp-web-tools/dist/util/fire-event.js b/website-src/esp-web-tools/dist/util/fire-event.js new file mode 100644 index 00000000..820ad0c6 --- /dev/null +++ b/website-src/esp-web-tools/dist/util/fire-event.js @@ -0,0 +1,12 @@ +export const fireEvent = (eventTarget, type, +// @ts-ignore +detail, options) => { + options = options || {}; + const event = new CustomEvent(type, { + bubbles: options.bubbles === undefined ? true : options.bubbles, + cancelable: Boolean(options.cancelable), + composed: options.composed === undefined ? true : options.composed, + detail, + }); + eventTarget.dispatchEvent(event); +}; diff --git a/website-src/esp-web-tools/dist/util/get-operating-system.d.ts b/website-src/esp-web-tools/dist/util/get-operating-system.d.ts new file mode 100644 index 00000000..38c93c2f --- /dev/null +++ b/website-src/esp-web-tools/dist/util/get-operating-system.d.ts @@ -0,0 +1 @@ +export declare const getOperatingSystem: () => "Mac OS" | "iOS" | "Windows" | "Android" | "Linux" | null; diff --git a/website-src/esp-web-tools/dist/util/get-operating-system.js b/website-src/esp-web-tools/dist/util/get-operating-system.js new file mode 100644 index 00000000..e6676bc7 --- /dev/null +++ b/website-src/esp-web-tools/dist/util/get-operating-system.js @@ -0,0 +1,27 @@ +// From https://stackoverflow.com/a/38241481 +export const getOperatingSystem = () => { + var _a, _b; + const userAgent = window.navigator.userAgent; + const platform = + // @ts-expect-error + ((_b = (_a = window.navigator) === null || _a === void 0 ? void 0 : _a.userAgentData) === null || _b === void 0 ? void 0 : _b.platform) || window.navigator.platform; + const macosPlatforms = ["macOS", "Macintosh", "MacIntel", "MacPPC", "Mac68K"]; + const windowsPlatforms = ["Win32", "Win64", "Windows", "WinCE"]; + const iosPlatforms = ["iPhone", "iPad", "iPod"]; + if (macosPlatforms.indexOf(platform) !== -1) { + return "Mac OS"; + } + else if (iosPlatforms.indexOf(platform) !== -1) { + return "iOS"; + } + else if (windowsPlatforms.indexOf(platform) !== -1) { + return "Windows"; + } + else if (/Android/.test(userAgent)) { + return "Android"; + } + else if (/Linux/.test(platform)) { + return "Linux"; + } + return null; +}; diff --git a/website-src/esp-web-tools/dist/util/line-break-transformer.d.ts b/website-src/esp-web-tools/dist/util/line-break-transformer.d.ts new file mode 100644 index 00000000..7da3384c --- /dev/null +++ b/website-src/esp-web-tools/dist/util/line-break-transformer.d.ts @@ -0,0 +1,5 @@ +export declare class LineBreakTransformer implements Transformer { + private chunks; + transform(chunk: string, controller: TransformStreamDefaultController): void; + flush(controller: TransformStreamDefaultController): void; +} diff --git a/website-src/esp-web-tools/dist/util/line-break-transformer.js b/website-src/esp-web-tools/dist/util/line-break-transformer.js new file mode 100644 index 00000000..851ab5dd --- /dev/null +++ b/website-src/esp-web-tools/dist/util/line-break-transformer.js @@ -0,0 +1,17 @@ +export class LineBreakTransformer { + constructor() { + this.chunks = ""; + } + transform(chunk, controller) { + // Append new chunks to existing chunks. + this.chunks += chunk; + // For each line breaks in chunks, send the parsed lines out. + const lines = this.chunks.split("\r\n"); + this.chunks = lines.pop(); + lines.forEach((line) => controller.enqueue(line + "\r\n")); + } + flush(controller) { + // When the stream is closed, flush any remaining chunks out. + controller.enqueue(this.chunks); + } +} diff --git a/website-src/esp-web-tools/dist/util/manifest.d.ts b/website-src/esp-web-tools/dist/util/manifest.d.ts new file mode 100644 index 00000000..22c80a1a --- /dev/null +++ b/website-src/esp-web-tools/dist/util/manifest.d.ts @@ -0,0 +1,2 @@ +import { Manifest } from "../const"; +export declare const downloadManifest: (manifestPath: string) => Promise; diff --git a/website-src/esp-web-tools/dist/util/manifest.js b/website-src/esp-web-tools/dist/util/manifest.js new file mode 100644 index 00000000..2c92831d --- /dev/null +++ b/website-src/esp-web-tools/dist/util/manifest.js @@ -0,0 +1,12 @@ +export const downloadManifest = async (manifestPath) => { + const manifestURL = new URL(manifestPath, location.toString()).toString(); + const resp = await fetch(manifestURL); + const manifest = await resp.json(); + if ("new_install_skip_erase" in manifest) { + console.warn('Manifest option "new_install_skip_erase" is deprecated. Use "new_install_prompt_erase" instead.'); + if (manifest.new_install_skip_erase) { + manifest.new_install_prompt_erase = true; + } + } + return manifest; +}; diff --git a/website-src/esp-web-tools/dist/util/sleep.d.ts b/website-src/esp-web-tools/dist/util/sleep.d.ts new file mode 100644 index 00000000..2450ca08 --- /dev/null +++ b/website-src/esp-web-tools/dist/util/sleep.d.ts @@ -0,0 +1 @@ +export declare const sleep: (time: number) => Promise; diff --git a/website-src/esp-web-tools/dist/util/sleep.js b/website-src/esp-web-tools/dist/util/sleep.js new file mode 100644 index 00000000..de7521fd --- /dev/null +++ b/website-src/esp-web-tools/dist/util/sleep.js @@ -0,0 +1 @@ +export const sleep = (time) => new Promise((resolve) => setTimeout(resolve, time)); diff --git a/website-src/esp-web-tools/dist/util/timestamp-transformer.d.ts b/website-src/esp-web-tools/dist/util/timestamp-transformer.d.ts new file mode 100644 index 00000000..b10b9cc9 --- /dev/null +++ b/website-src/esp-web-tools/dist/util/timestamp-transformer.d.ts @@ -0,0 +1,3 @@ +export declare class TimestampTransformer implements Transformer { + transform(chunk: string, controller: TransformStreamDefaultController): void; +} diff --git a/website-src/esp-web-tools/dist/util/timestamp-transformer.js b/website-src/esp-web-tools/dist/util/timestamp-transformer.js new file mode 100644 index 00000000..92187f35 --- /dev/null +++ b/website-src/esp-web-tools/dist/util/timestamp-transformer.js @@ -0,0 +1,9 @@ +export class TimestampTransformer { + transform(chunk, controller) { + const date = new Date(); + const h = date.getHours().toString().padStart(2, "0"); + const m = date.getMinutes().toString().padStart(2, "0"); + const s = date.getSeconds().toString().padStart(2, "0"); + controller.enqueue(`[${h}:${m}:${s}]${chunk}`); + } +} diff --git a/website-src/esp-web-tools/dist/version.d.ts b/website-src/esp-web-tools/dist/version.d.ts new file mode 100644 index 00000000..dfc45f9a --- /dev/null +++ b/website-src/esp-web-tools/dist/version.d.ts @@ -0,0 +1 @@ +export declare const version = "10.0.1"; diff --git a/website-src/esp-web-tools/dist/version.js b/website-src/esp-web-tools/dist/version.js new file mode 100644 index 00000000..9d5939ed --- /dev/null +++ b/website-src/esp-web-tools/dist/version.js @@ -0,0 +1 @@ +export const version = "10.0.1"; diff --git a/website-src/esp-web-tools/manifest.json b/website-src/esp-web-tools/manifest.json new file mode 100644 index 00000000..d8bb2dcc --- /dev/null +++ b/website-src/esp-web-tools/manifest.json @@ -0,0 +1,13 @@ +{ + "name": "kv4p HT firmware", + "version": "v2", + "new_install_prompt_erase": false, + "builds": [ + { + "chipFamily": "ESP32", + "parts": [ + { "path": "../firmware/kv4p-ht-firmware-v2.bin", "offset": 0 } + ] + } + ] +} \ No newline at end of file diff --git a/website-src/feedback.css b/website-src/feedback.css new file mode 100644 index 00000000..956ca378 --- /dev/null +++ b/website-src/feedback.css @@ -0,0 +1,13 @@ +.main-content-area { + padding: 32px 32px; + max-width: 800px; + line-height: 1.5em; +} + +h1 { + margin-top: 32px; +} + +iframe { + margin-top: 16px; +} \ No newline at end of file diff --git a/website-src/feedback.html b/website-src/feedback.html new file mode 100644 index 00000000..9e394971 --- /dev/null +++ b/website-src/feedback.html @@ -0,0 +1,53 @@ + + + + Feedback - kv4p HT + + + + + + + + + + + + + + +
    + +
    +
    +

    Have a question?

    +

    Visit the kv4p HT Discord general channel and ask for advice.

    +

    Found a bug?

    +

    Please report it in the GitHub project so me or a contributor can help fix it.

    +

    General feedback

    + +
    +
    +
    + + \ No newline at end of file diff --git a/website-src/firmware/kv4p-ht-firmware-v1.bin b/website-src/firmware/kv4p-ht-firmware-v1.bin new file mode 100644 index 00000000..e3948130 Binary files /dev/null and b/website-src/firmware/kv4p-ht-firmware-v1.bin differ diff --git a/website-src/firmware/kv4p-ht-firmware-v2.bin b/website-src/firmware/kv4p-ht-firmware-v2.bin new file mode 100644 index 00000000..40ca03a9 Binary files /dev/null and b/website-src/firmware/kv4p-ht-firmware-v2.bin differ diff --git a/website-src/firmware/kv4p-ht-firmware-v3.bin b/website-src/firmware/kv4p-ht-firmware-v3.bin new file mode 100644 index 00000000..179cef22 Binary files /dev/null and b/website-src/firmware/kv4p-ht-firmware-v3.bin differ diff --git a/website-src/img/HAR_logo_main-cropped.svg b/website-src/img/HAR_logo_main-cropped.svg new file mode 100644 index 00000000..e785f3bb --- /dev/null +++ b/website-src/img/HAR_logo_main-cropped.svg @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website-src/img/favicon-16x16.png b/website-src/img/favicon-16x16.png new file mode 100644 index 00000000..17e3baa6 Binary files /dev/null and b/website-src/img/favicon-16x16.png differ diff --git a/website-src/img/icon-lg-dark.png b/website-src/img/icon-lg-dark.png new file mode 100644 index 00000000..0b0d22f4 Binary files /dev/null and b/website-src/img/icon-lg-dark.png differ diff --git a/website-src/img/install-app-qr-code.png b/website-src/img/install-app-qr-code.png new file mode 100644 index 00000000..5843816b Binary files /dev/null and b/website-src/img/install-app-qr-code.png differ diff --git a/website-src/img/install-app-qr-code.svg b/website-src/img/install-app-qr-code.svg new file mode 100644 index 00000000..87c258e0 --- /dev/null +++ b/website-src/img/install-app-qr-code.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/website-src/img/kv4p-ht-chat.jpg b/website-src/img/kv4p-ht-chat.jpg new file mode 100644 index 00000000..0b71aa80 Binary files /dev/null and b/website-src/img/kv4p-ht-chat.jpg differ diff --git a/website-src/img/kv4p-ht-on-desk.jpg b/website-src/img/kv4p-ht-on-desk.jpg new file mode 100644 index 00000000..66f9e652 Binary files /dev/null and b/website-src/img/kv4p-ht-on-desk.jpg differ diff --git a/website-src/img/kv4p-ht-voice.jpg b/website-src/img/kv4p-ht-voice.jpg new file mode 100644 index 00000000..f5b4bb94 Binary files /dev/null and b/website-src/img/kv4p-ht-voice.jpg differ diff --git a/website-src/img/tinysa-spurious-v1.7.jpg b/website-src/img/tinysa-spurious-v1.7.jpg new file mode 100644 index 00000000..0194f437 Binary files /dev/null and b/website-src/img/tinysa-spurious-v1.7.jpg differ diff --git a/website-src/img/tinysa-spurious.jpg b/website-src/img/tinysa-spurious.jpg new file mode 100644 index 00000000..a1bdbeaf Binary files /dev/null and b/website-src/img/tinysa-spurious.jpg differ diff --git a/website-src/img/v1.7b-harmonics.jpg b/website-src/img/v1.7b-harmonics.jpg new file mode 100644 index 00000000..f264a929 Binary files /dev/null and b/website-src/img/v1.7b-harmonics.jpg differ diff --git a/website-src/index.html b/website-src/index.html new file mode 100644 index 00000000..996bc5f7 --- /dev/null +++ b/website-src/index.html @@ -0,0 +1,81 @@ + + + + kv4p HT - open source ham radio transceiver for your smartphone + + + + + + + + + + + + + +
    + +
    +
    +
    +

    kv4p HT

    +

    Turn your Android phone into a modern ham radio transceiver

    +

    Free open source software & hardware

    +
    +
    +
    + +
    +
    +

    What is it?

    +

    kv4p HT is a homebrew VHF radio that makes your phone capable of voice and text communication completely off-grid with at least a Technician class amateur radio license.

    +

    The radio simply plugs into the USB C port on your Android smartphone and transforms it into a fully-fledged handheld radio transceiver. + It's completely open source (GPL3): the Android app, ESP32 firmware, PCB designs, and 3D printer files.

    +

    It's small enough to fit in your pocket and take anywhere, and since it has no internal battery + it's the perfect radio to put in a go-bag or your car's glove compartment.

    +

    NOTE: kv4p HT is an open source project you build yourself and has absolutely no warranty, or guarantees on functionality or reliability! That said, have fun. :)

    + +
    +
    +

    Features

    +
      +
    • Only $35 to build, with 3 components to solder
    • +
    • 100% ham radio, always completely off-grid
    • +
    • Crystal-clear 44kHz 8-bit ADC/DAC audio, with filters and squelch
    • +
    • Texting with notifications just like SMS — radio-based APRS messaging (not just location) with built-in 1200 baud modem
    • +
    • Scan through unlimited memories and groups
    • +
    • No battery means nothing to charge except your phone
    • +
    • 1 watt transmit can go miles yet sips your phone's battery
    • +
    • Accessibility options: live closed captions (on supported phones), turn off animations, sticky PTT with haptic feedback
    • +
    +
    +
    +
    +
    +
    + + \ No newline at end of file diff --git a/website-src/quick_start.css b/website-src/quick_start.css new file mode 100644 index 00000000..9a65e2fd --- /dev/null +++ b/website-src/quick_start.css @@ -0,0 +1,70 @@ +esp-web-install-button button { + display: block; + padding: 8px 32px; + font-size: 16px; + font-weight: 500; + color: #FFF; + background-color: #AD5642; + border: none; + border-radius: 8px; + text-decoration: none; + box-shadow: 0 0 3px 0 #999; + margin: 24px 0; + cursor: pointer; +} + +.main-content-area { + padding: 0 32px; + max-width: 1280px; +} + +.main-content-area ol>li { + margin-top: 24px !important; +} + +iframe { + margin: 24px auto 48px auto; + display: block; +} + +.main-content-area ol>li { + padding: 16px 24px; + border-radius: 32px; + box-shadow: 0 0 12px rgba(0, 0, 0, 0.1); +} + +h3 { + top: 32px; + position: absolute; + margin-left: 16px; + font-size: 28px; + display: inline-block; +} + +li h3+ul { + margin-top: 16px; + padding-inline-start: 52px; + padding-bottom: 24px; +} + +ol { + padding: 0; +} + +ol>li { + list-style: decimal inside none; + counter-increment: listcounter; +} + +ol>li::marker { + line-height: 1.2em; + font-size: 48px; + content: counter(listcounter); + color: #AD5642; + font-weight: 500; +} + +h1 { + margin-top: 48px; +} + diff --git a/website-src/quick_start.html b/website-src/quick_start.html new file mode 100644 index 00000000..aaef3cab --- /dev/null +++ b/website-src/quick_start.html @@ -0,0 +1,121 @@ + + + + Quickstart - kv4p HT + + + + + + + + + + + + + + + +
    + +
    +
    + +
      +
    1. Order the parts

      + +
    2. +
    3. 3D print the case, and optionally the stand

      +
        +
      • Find the 3D printer files on Thingiverse
      • +
          +
        • If you're using the 3-port U-shaped USB connector (linked in step 1), use the design ending in "...for_3_port_connector".
        • +
        +
      • The case looks cooler with 2-colors, which most 3D printers can do (see how)
      • +
      +
    4. +
    5. Solder the DRA818V, ESP32, and SMA connector to the PCB

      +
        +
      • Once the ESP32 is soldered, trim all of its legs as short as possible (so they don't contact your phone)
      • +
      +
    6. +
    7. Insert the PCB into the case until it snaps in

    8. +
    9. Attach kv4p HT to your phone with a piece of sticky gel pad

      +
        +
      • Cut a strip of sticky gel pad to attach the kv4p HT to the back of your phone
      • +
      • Tip: insert the USB C 180 degree connector before pressing the kv4p HT to your phone, to help you align it properly
      • +
      • It will stay put, but can be easily removed with no residue
      • +
      +
    10. +
    11. Screw on the antenna

    12. +
    13. Install the Android app

      +
        +
      • The app requires Android 8 or higher, which came out in 2017 and pretty much all phones with a USB C connector will have.
      • +
      • You can search the Play store for "kv4p HT", use this link to the kv4p HT app, or scan this QR code:
      • +
      • NOTE: The first time you run the Android app, it will flash the firmware onto your kv4p HT. It takes about 5-10 minutes.
      • +
        +

        QR code for the kv4p HT app on the Google Play store.

        + +
      +
    14. +
    15. Get on the air, and have fun!

    16. +
    +

    Need some help?

    +

    Visit the kv4p HT Discord general channel and ask for advice.

    +

    Optional: Web-based firmware flasher

    +

    If for some reason the Android app can't flash your kv4p HT firmware, you can use this web-based flasher. It's not usually necessary.

    +
      +
    • Plug USB C cable from kv4p HT to your computer (your phone's browser won't work)
    • +
    • Use this online flash tool to install the latest firmware, which requires Chrome, Chromium, or Edge.
    • +
        +
      • If you don't see a red button below, your browser doesn't support flashing.
      • +
      +
    • Select the device "CP2102 USB to UART Bridge Controller": +
    • +
    • If the button doesn't seem to work, make sure you visited kv4p.com (without "www").
    • +
    • Device not showing up? You might need to install the CP210x device driver.
    • +
    +
    +
    +
    + + \ No newline at end of file diff --git a/website-src/testing.css b/website-src/testing.css new file mode 100644 index 00000000..d17d3636 --- /dev/null +++ b/website-src/testing.css @@ -0,0 +1,24 @@ +.main-content-area { + padding: 0 32px; + max-width: 800px; +} + +.main-content-area p { + line-height: 1.5em; +} + +.main-content-area li { + line-height: 1.5em; +} + +.main-content-area ul li { + margin-bottom: 16px; +} + +.main-content-area h1 { + margin-top: 24px; +} + +.main-content-area h2 { + margin-top: 16px; +} \ No newline at end of file diff --git a/website-src/testing.html b/website-src/testing.html new file mode 100644 index 00000000..94771c6e --- /dev/null +++ b/website-src/testing.html @@ -0,0 +1,60 @@ + + + + Testing - kv4p HT + + + + + + + + + + + + + + +
    + +
    +
    +

    Test results

    +

    I've tested harmonic filtering with a TinySA spectrum analyzer to ensure it meets FCC part 97 spurious emissions requirements (which for VHF must be at least -40dBc for 2nd harmonic and below 10uW).

    +

    PCB v1.7b

    +

    v1.7b of the PCB is -52.9dBc for the 2nd harmonic, and 5uW of harmonic power, fully FCC part 97 compliant (tested with 56dB of attenuation):

    +

    + A photo of a TinySA measuring the spurious emissions of the kv4p HT, the graph shows a single large spike at the transmitting frequency. +

    +

    PCB v1.7

    +

    v1.7 of the PCB is -52.7dBc for the 2nd harmonic, and below 4uW of harmonic power, fully FCC part 97 compliant (tested with 56dB of attenuation):

    +
    +

    + A photo of a TinySA measuring the spurious emissions of the kv4p HT, the graph shows a single large spike at the transmitting frequency. +

    +
    +
    +
    + + \ No newline at end of file diff --git a/website-src/updates.css b/website-src/updates.css new file mode 100644 index 00000000..f1fd6134 --- /dev/null +++ b/website-src/updates.css @@ -0,0 +1,26 @@ +.main-content-area { + padding: 0 32px; + max-width: 1024px; +} + +.main-content-area p { + line-height: 1.5em; +} + +.main-content-area li { + line-height: 1.5em; +} + +.main-content-area ul li { + margin-bottom: 8px; +} + +.main-content-area h1 { + margin-top: 24px; + font-size: 24px; + font-weight: 500; +} + +.main-content-area h2 { + margin-top: 16px; +} \ No newline at end of file diff --git a/website-src/updates.html b/website-src/updates.html new file mode 100644 index 00000000..e4c1541d --- /dev/null +++ b/website-src/updates.html @@ -0,0 +1,109 @@ + + + + Release notes - kv4p HT + + + + + + + + + + + + + + +
    + +
    +
    +

    Dec 14, 2024: Android app update v1.4.0, ESP32 firmware v3

    +
      +
    • Add new mic gain option to settings
    • +
    • Add new settings to control rx and tx sampling rates
    • +
    • Add setting to change bandwidth, narrow or wide
    • +
    +

    Dec 5, 2024: Android app update v1.3.1, case without USB connector holder

    +
      +
    • Screen now stays on as long as kv4p HT app is in the foreground, you can still turn screen off manually.
    • +
    • Add ability to tune to any frequency 134-174MHz (e.g. NOAA weather frequencies), while limiting tx to ham band.
    • +
    • Tx frequency is now displayed while holding down PTT, including any offset for the active channel memory.
    • +
    • Other small bug fixes.
    • +
    • Added an alternative 3D printed case design without the USB connector holder, for people using a wire intead.
    • +
    +

    Nov 23, 2024: Android app update v1.2.3

    +
      +
    • Much better APRS UI when decoding APRS messages in the "Text chat" view (such as on 144.39 or your local APRS frequency).
    • +
    • Numerous bug fixes.
    • +
    +

    Nov 20, 2024: Android app update v1.1.1

    +
      +
    • The Android app can now flash or upgrade firmware on your kv4p HT (no computer necessary).
    • +
    • Tuning in 500Hz increments is now possible, with a 4th decimal place allowed. This supports regions with 12.5kHz channel spacing.
    • +
    • You can set a maximum frequency in Settings, for regions with 146MHz as the top of the 2M amateur band.
    • +
    • Numerous bug fixes.
    • +
    • Website: Updated Quick Start page with latest hardware options, and a new 3D printable case that supports the new U-shaped adapter.
    • +
    +

    Oct 26, 2024: Android app published to play store as v1.0

    +
      +
    • Now that the beta is complete, the app is approved for the Google Play store. It has been renumbered to 1.0.
    • +
    • Bug fix: APRS message IDs will no longer exceed what the APRS spec allows.
    • +
    • Published Guiding Principles for Contributors doc
    • +
    +

    Oct 23, 2024: PCB versions 1.7 and 1.7b

    +
      +
    • Released PCB versions 1.7 and 1.7b, which have far better harmonic suppression than earlier PCB versions. Either version is fine to use, but 1.7b has components that are usually more readily available.
    • +
    +

    Oct 18, 2024: Android app version beta 12

    +
      +
    • FIXED - [Android] Text chat input field may be obscured on phones with shorter screens
    • +
    • FXIED - [Android] 2 exceptions in the wild with beta version 11
    • +
    • FIXED - [Android] Fix PTT button for screen reader (TalkBack) users
    • +
    • Also removed PCB v1.6 tentative design from GitHub since harmonic filtering was worse. PCB v1.7 is under development now.
    • +
    +

    Oct 8, 2024: Android app version beta 11, PCB version 1.6

    +
      +
    • Expand beta to include US, UK, and Australia (was just US previously).
    • +
    • Bug fix: Address a couple more rare exceptions that Google Play automated testing found.
    • +
    • PCB: Significant improvement to harmonic suppression by tweaking some of the LC filter values. Not yet verified empirically, awaiting prototype PCBs.
    • +
    +

    Oct 5, 2024: Android app version beta 10

    +
      +
    • Website full release and announced, with YouTube demo and quickstart videos.
    • +
    • Bug fix: Deleting a memory now automatically removes it from the UI (doesn't require restart).
    • +
    • Bug fix: Starting the app without the USB C connection in place, and then connecting it with app running, now detects the connection.
    • +
    • Bug fix: Add a couple guard conditions for rare corner cases that Google Play's automated testing found.
    • +
    +

    Sep 29, 2024: Android app version beta 5, ESP32 firmware version 1

    +
      +
    • Initial closed beta release, which the Android Play Store requires until you have 20 installed users testing the app.
    • +
    • Got this website up and running, including the web-based firmware installer.
    • +
    +
    +
    +
    + + \ No newline at end of file diff --git a/website-src/vid/home-demo.gif b/website-src/vid/home-demo.gif new file mode 100644 index 00000000..732544b3 Binary files /dev/null and b/website-src/vid/home-demo.gif differ