@benev/tact 0.4.0-6 → 0.4.0-8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +95 -26
- package/package.json +3 -2
- package/s/lib/input/controller.ts +4 -1
- package/s/lib/input/data/intent/decode.ts +2 -2
- package/s/lib/input/data/intent/encode.ts +2 -2
- package/s/lib/input/data/intent/minihash.ts +5 -0
- package/s/lib/input/decoder.ts +2 -2
- package/s/lib/input/evaluate/context.ts +5 -1
- package/s/lib/input/evaluate/evaluate.ts +27 -14
- package/s/lib/input/investigate/hash-bindings.ts +5 -3
- package/s/lib/input/investigate/investigate.ts +24 -9
- package/s/lib/input/test.ts +52 -30
- package/s/lib/input/testing/quickbind.ts +3 -3
- package/s/lib/ui/deck/auto-gamepads.ts +1 -0
- package/s/lib/ui/deck/collector.ts +3 -3
- package/s/lib/ui/deck/hub.ts +4 -3
- package/s/lib/ui/deck/setup/deck.ts +33 -20
- package/s/lib/ui/deck/setup/tact.ts +20 -11
- package/s/lib/ui/deck/setup/types.ts +1 -0
- package/s/lib/ui/deck/setup/utils/broadcast-channel.ts +17 -0
- package/s/lib/ui/deck/setup/utils/kv.ts +20 -0
- package/s/lib/ui/deck/types.ts +1 -1
- package/s/lib/ui/views/customize/view.ts +3 -3
- package/s/lib/utils/hash.ts +47 -0
- package/x/demo/main.bundle.min.js +104 -104
- package/x/demo/main.bundle.min.js.map +4 -4
- package/x/gamepad/index.html +1 -1
- package/x/index.html +2 -2
- package/x/lib/input/controller.js +1 -1
- package/x/lib/input/controller.js.map +1 -1
- package/x/lib/input/data/intent/decode.d.ts +1 -1
- package/x/lib/input/data/intent/decode.js +2 -2
- package/x/lib/input/data/intent/decode.js.map +1 -1
- package/x/lib/input/data/intent/encode.d.ts +1 -1
- package/x/lib/input/data/intent/encode.js +2 -2
- package/x/lib/input/data/intent/encode.js.map +1 -1
- package/x/lib/input/data/intent/minihash.d.ts +1 -0
- package/x/lib/input/data/intent/minihash.js +4 -0
- package/x/lib/input/data/intent/minihash.js.map +1 -0
- package/x/lib/input/decoder.d.ts +1 -1
- package/x/lib/input/decoder.js +2 -2
- package/x/lib/input/decoder.js.map +1 -1
- package/x/lib/input/evaluate/context.d.ts +3 -1
- package/x/lib/input/evaluate/context.js.map +1 -1
- package/x/lib/input/evaluate/evaluate.js +24 -11
- package/x/lib/input/evaluate/evaluate.js.map +1 -1
- package/x/lib/input/investigate/hash-bindings.d.ts +1 -1
- package/x/lib/input/investigate/hash-bindings.js +5 -3
- package/x/lib/input/investigate/hash-bindings.js.map +1 -1
- package/x/lib/input/investigate/investigate.d.ts +2 -1
- package/x/lib/input/investigate/investigate.js +14 -9
- package/x/lib/input/investigate/investigate.js.map +1 -1
- package/x/lib/input/test.d.ts +4 -2
- package/x/lib/input/test.js +49 -22
- package/x/lib/input/test.js.map +1 -1
- package/x/lib/input/testing/quickbind.d.ts +3 -2
- package/x/lib/input/testing/quickbind.js +3 -3
- package/x/lib/input/testing/quickbind.js.map +1 -1
- package/x/lib/ui/deck/auto-gamepads.js +1 -0
- package/x/lib/ui/deck/auto-gamepads.js.map +1 -1
- package/x/lib/ui/deck/collector.js +2 -2
- package/x/lib/ui/deck/collector.js.map +1 -1
- package/x/lib/ui/deck/hub.js +4 -3
- package/x/lib/ui/deck/hub.js.map +1 -1
- package/x/lib/ui/deck/setup/deck.js +23 -13
- package/x/lib/ui/deck/setup/deck.js.map +1 -1
- package/x/lib/ui/deck/setup/tact.d.ts +2 -2
- package/x/lib/ui/deck/setup/tact.js +15 -8
- package/x/lib/ui/deck/setup/tact.js.map +1 -1
- package/x/lib/ui/deck/setup/types.d.ts +1 -0
- package/x/lib/ui/deck/setup/utils/broadcast-channel.d.ts +4 -0
- package/x/lib/ui/deck/setup/utils/broadcast-channel.js +10 -0
- package/x/lib/ui/deck/setup/utils/broadcast-channel.js.map +1 -0
- package/x/lib/ui/deck/setup/utils/kv.d.ts +5 -0
- package/x/lib/ui/deck/setup/utils/kv.js +12 -0
- package/x/lib/ui/deck/setup/utils/kv.js.map +1 -0
- package/x/lib/ui/deck/types.d.ts +1 -0
- package/x/lib/ui/views/customize/view.js +3 -3
- package/x/lib/ui/views/customize/view.js.map +1 -1
- package/x/lib/utils/hash.d.ts +1 -0
- package/x/lib/utils/hash.js +47 -0
- package/x/lib/utils/hash.js.map +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../node_modules/@e280/sly/s/dom/standalone/dashify.ts", "../../node_modules/@e280/sly/s/dom/standalone/register.ts", "../../node_modules/@lit/reactive-element/src/css-tag.ts", "../../node_modules/@lit/reactive-element/src/reactive-element.ts", "../../node_modules/lit-html/src/lit-html.ts", "../../node_modules/lit-element/src/lit-element.ts", "../../node_modules/@e280/sly/s/dom/attrs/parts/attr-fns.ts", "../../node_modules/@e280/sly/s/dom/parts/el.ts", "../../node_modules/@e280/sly/s/dom/parts/mk.ts", "../../node_modules/@e280/sly/s/dom/parts/eve.ts", "../../node_modules/@e280/sly/s/dom/attrs/parts/on-attrs.ts", "../../node_modules/@e280/sly/s/dom/attrs/parts/attr-proxies.ts", "../../node_modules/@e280/sly/s/dom/attrs/parts/attr-spec.ts", "../../node_modules/@e280/sly/s/dom/attrs/attrs.ts", "../../node_modules/@e280/sly/s/dom/parts/elmer.ts", "../../node_modules/@e280/sly/s/dom/parts/queries.ts", "../../node_modules/@e280/sly/s/dom/parts/dom-scope.ts", "../../node_modules/@e280/sly/s/dom/dom.ts", "../../node_modules/@e280/sly/s/loot/index.barrel.ts", "../../node_modules/@e280/stz/s/data/bytes.ts", "../../node_modules/@e280/stz/s/data/base-x.ts", "../../node_modules/@e280/stz/s/data/base-x-codecs.ts", "../../node_modules/@e280/stz/s/debounce/debounce.ts", "../../node_modules/@e280/stz/s/defer.ts", "../../node_modules/@e280/stz/s/debounce/microbounce.ts", "../../node_modules/@e280/stz/s/deep/clone.ts", "../../node_modules/@e280/stz/s/is.ts", "../../node_modules/@e280/stz/s/deep/equal.ts", "../../node_modules/@e280/stz/s/deep/freeze.ts", "../../node_modules/@e280/stz/s/ok/fns/got.ts", "../../node_modules/@e280/stz/s/rand/mulberry.ts", "../../node_modules/@e280/stz/s/utensils/got.ts", "../../node_modules/@e280/stz/s/utensils/map.ts", "../../node_modules/@e280/stz/s/arraylimit.ts", "../../node_modules/@e280/stz/s/collect.ts", "../../node_modules/@e280/stz/s/cycle.ts", "../../node_modules/@e280/stz/s/disposer.ts", "../../node_modules/@e280/stz/s/ev.ts", "../../node_modules/@e280/stz/s/id-counter.ts", "../../node_modules/@e280/stz/s/nap.ts", "../../node_modules/@e280/stz/s/ob.ts", "../../node_modules/@e280/stz/s/subby.ts", "../../node_modules/@e280/stz/s/templating.ts", "../../node_modules/@e280/stz/s/when.ts", "../../node_modules/@e280/strata/s/tracker/tracker.ts", "../../node_modules/@e280/strata/s/tracker/global.ts", "../../node_modules/@e280/strata/s/signals/signal.ts", "../../node_modules/@e280/strata/s/signals/r/map.ts", "../../node_modules/@e280/strata/s/signals/r/set.ts", "../../node_modules/@e280/strata/s/signals/batch.ts", "../../node_modules/@e280/strata/s/prism/utils/immute.ts", "../../node_modules/@e280/strata/s/prism/utils/optic-symbol.ts", "../../node_modules/@e280/strata/s/prism/utils/cache-cell.ts", "../../node_modules/@e280/strata/s/prism/lens.ts", "../../node_modules/@e280/strata/s/wait/parts/get.ts", "../../node_modules/@e280/strata/s/wait/parts/is.ts", "../../node_modules/@e280/strata/s/wait/parts/select.ts", "../../node_modules/@e280/sly/s/loot/helpers.ts", "../../node_modules/@e280/sly/s/loot/drag-and-drops.ts", "../../node_modules/@e280/sly/s/loot/drops.ts", "../../node_modules/@e280/sly/s/view/common/css-reset.ts", "../../node_modules/@e280/sly/s/view/common/sly-shadow.ts", "../../node_modules/@e280/sly/s/view/parts/cx.ts", "../../node_modules/@e280/sly/s/view/hooks/plumbing/hooks.ts", "../../node_modules/@e280/sly/s/view/parts/reactivity.ts", "../../node_modules/@e280/sly/s/view/hooks/plumbing/mounts.ts", "../../node_modules/@e280/sly/s/view/hooks/plumbing/hookscope.ts", "../../node_modules/lit-html/src/directive-helpers.ts", "../../node_modules/lit-html/src/directive.ts", "../../node_modules/lit-html/src/async-directive.ts", "../../node_modules/@e280/sly/s/view/light.ts", "../../node_modules/@e280/sly/s/view/parts/apply-attrs.ts", "../../node_modules/@e280/sly/s/view/shadow.ts", "../../node_modules/@e280/sly/s/view/elements/shadow.ts", "../../node_modules/@e280/sly/s/view/duplex/shadow.ts", "../../node_modules/@e280/sly/s/view/hooks/use-once.ts", "../../node_modules/@e280/sly/s/view/hooks/plumbing/use-cx.ts", "../../node_modules/@e280/sly/s/view/hooks/plumbing/use-shadow-cx.ts", "../../node_modules/@e280/sly/s/view/hooks/use-host.ts", "../../node_modules/@e280/sly/s/view/hooks/use-mount.ts", "../../node_modules/@e280/sly/s/view/hooks/use-shadow.ts", "../../node_modules/@e280/sly/s/view/parts/apply-styles.ts", "../../node_modules/@e280/sly/s/view/hooks/use-css.ts", "../../node_modules/@e280/sly/s/view/hooks/use-name.ts", "../../node_modules/@e280/sly/s/view/hooks/use-signal.ts", "../../node_modules/@e280/sly/s/view/hooks/use-styles.ts", "../../node_modules/@e280/sly/s/view/hooks/use-unmount.ts", "../../node_modules/@e280/sly/s/spinner/parts/ascii-anim.ts", "../../node_modules/@e280/sly/s/spinner/parts/error-display.ts", "../../node_modules/@e280/sly/s/spinner/make-spinner.ts", "../../node_modules/@e280/sly/s/spinner/spinners/dots.ts", "../../node_modules/@e280/sly/s/spinner/spinners/earth.ts", "../../node_modules/@e280/sly/s/spinner/spinners/moon.ts", "../../node_modules/@e280/sly/s/spinner/spinners/spinner.ts", "../../node_modules/@e280/sly/s/spinner/spinners/wave.ts", "../../s/lib/input/types.ts", "../../s/lib/ui/deck/types.ts", "../../s/demo/presets.ts", "../../node_modules/@e280/kv/s/utils/idb/range.ts", "../../node_modules/@e280/kv/s/utils/idb/wait.ts", "../../node_modules/@e280/kv/s/utils/idb/transactions.ts", "../../node_modules/@e280/kv/s/magazines/idb.ts", "../../node_modules/@e280/kv/s/utils/lex-sort.ts", "../../node_modules/@e280/kv/s/utils/scan-match.ts", "../../node_modules/@e280/kv/s/utils/scan-entries.ts", "../../node_modules/@e280/kv/s/magazines/memory.ts", "../../node_modules/@e280/kv/s/utils/idb/open.ts", "../../node_modules/@e280/kv/s/utils/cell-operator.ts", "../../node_modules/@e280/kv/s/cell.ts", "../../node_modules/@e280/kv/s/consts.ts", "../../node_modules/@e280/kv/s/utils/prefix-end.ts", "../../node_modules/@e280/kv/s/utils/subtree.ts", "../../node_modules/@e280/kv/s/utils/operator.ts", "../../node_modules/@e280/kv/s/utils/prefixer.ts", "../../node_modules/@e280/kv/s/utils/validate-scan.ts", "../../node_modules/@e280/kv/s/utils/validate-scopes.ts", "../../node_modules/@e280/kv/s/kv.ts", "../../s/lib/input/data/parcel/encode.ts", "../../s/lib/input/data/intent/encode.ts", "../../s/lib/input/investigate/is-expression.ts", "../../s/lib/input/investigate/hash-bindings.ts", "../../s/lib/ui/deck/hub.ts", "../../s/lib/ui/deck/controls/internal/fns.ts", "../../s/lib/input/investigate/is-compatible.ts", "../../s/lib/ui/deck/controls/internal/profiles.ts", "../../s/lib/ui/deck/controls/internal/data.ts", "../../s/lib/ui/deck/controls/internal/assignments.ts", "../../s/lib/ui/deck/controls/controls.ts", "../../s/lib/ui/deck/utils/first-preset.ts", "../../s/lib/ui/deck/setup/deck.ts", "../../s/lib/input/data/intent/decode.ts", "../../s/lib/input/investigate/make-input.ts", "../../s/lib/input/investigate/investigate.ts", "../../s/lib/input/decoder.ts", "../../s/lib/input/data/parcel/decode.ts", "../../s/lib/ui/deck/collector.ts", "../../s/lib/input/utils/sampler.ts", "../../node_modules/@benev/math/s/core/basics.ts", "../../node_modules/@benev/math/s/core/vec2.ts", "../../s/lib/input/utils/is-down.ts", "../../s/lib/input/evaluate/evaluate.ts", "../../s/lib/input/utils/clock.ts", "../../s/lib/input/evaluate/context.ts", "../../s/lib/input/controller.ts", "../../s/lib/input/utils/pad/pad.ts", "../../s/lib/input/utils/evergreen.ts", "../../s/lib/input/utils/pad/on-pad.ts", "../../s/lib/input/sources/plain.ts", "../../s/lib/input/sources/gamepad.ts", "../../s/lib/ui/deck/auto-gamepads.ts", "../../s/lib/utils/ellipsis.ts", "../../s/lib/input/sources/sources.ts", "../../s/lib/ui/views/visualizer/visualizer.ts", "../../s/lib/input/utils/mouse-button.ts", "../../s/lib/input/sources/pointer.ts", "../../s/lib/input/sources/keyboard.ts", "../../node_modules/@e280/shiny/s/theme/parts/core.ts", "../../node_modules/@e280/shiny/s/theme/parts/vars.ts", "../../node_modules/@e280/shiny/s/theme/parts/reset.ts", "../../node_modules/@e280/shiny/s/theme/theme-string.ts", "../../node_modules/@e280/shiny/s/theme/theme.css.ts", "../../node_modules/@e280/shiny/s/views/tabs/control.ts", "../../node_modules/@e280/shiny/s/views/tabs/style.css.ts", "../../node_modules/@e280/shiny/s/views/tabs/view.ts", "../../s/lib/ui/views/deck/style.css.ts", "../../s/lib/ui/views/theme.css.ts", "../../s/lib/ui/icons/akar/game-controller.svg.ts", "../../s/lib/ui/icons/akar/settings-horizontal.svg.ts", "../../s/lib/ui/views/controllers/style.css.ts", "../../s/lib/ui/icons/akar/person-add.svg.ts", "../../s/lib/ui/icons/akar/x-small.svg.ts", "../../s/lib/ui/views/controllers/subviews/dropcard.ts", "../../s/lib/ui/icons/akar/drag-vertical-fill.svg.ts", "../../s/lib/utils/hueify.ts", "../../s/lib/ui/views/profile-select/view.ts", "../../s/lib/ui/views/controllers/subviews/controller.ts", "../../s/lib/ui/views/controllers/subviews/player.ts", "../../s/lib/ui/views/deck/types.ts", "../../s/lib/ui/views/controllers/view.ts", "../../s/lib/ui/views/customize/style.css.ts", "../../s/lib/ui/icons/akar/copy.svg.ts", "../../s/lib/ui/icons/akar/trash-can.svg.ts", "../../s/lib/utils/make-id.ts", "../../s/lib/ui/icons/akar/key-cap.svg.ts", "../../s/lib/ui/icons/akar/backspace.svg.ts", "../../s/lib/ui/icons/akar/cross.svg.ts", "../../s/lib/ui/views/customize/parts/capture-key-chord.ts", "../../s/lib/ui/views/customize/parts/capture-gamepad-chord.ts", "../../s/lib/ui/views/customize/parts/capture-pointer-chord.ts", "../../s/lib/ui/views/customize/subviews/recorder.ts", "../../s/lib/ui/views/customize/subviews/expression.ts", "../../s/lib/ui/views/customize/parts/render-bindings.ts", "../../s/lib/ui/views/customize/view.ts", "../../s/lib/ui/views/deck/view.ts", "../../s/lib/ui/views/visualizer/style.css.ts", "../../s/lib/ui/views/visualizer/view.ts", "../../s/lib/ui/icons/akar/devices.svg.ts", "../../s/lib/ui/deck/setup/tact.ts", "../../s/demo/main.bundle.ts"],
|
|
4
|
-
"sourcesContent": ["\n/** convert \"CamelCaseName\" into \"camel-case-name\". */\nexport function dashify(camel: string) {\n\treturn camel.replace(/([a-zA-Z])(?=[A-Z])/g, '$1-').toLowerCase()\n}\n\n", "\nimport {dashify} from \"./dashify.js\"\n\ntype HTMLElementClasses = {\n\t[key: string]: {new(...args: any[]): HTMLElement}\n}\n\n/** register custom elements to the dom, with dashified names. */\nexport function register<E extends HTMLElementClasses>(elements: E, options: {\n\n\t\t/** true to do nothing if the element is already defined. otherwise, throw error. default false. */\n\t\tsoft?: boolean\n\n\t\t/** true to run `customElements.upgrade` on already-placed elements. default true. */\n\t\tupgrade?: boolean\n\n\t} = {}) {\n\n\tconst {soft = false, upgrade = true} = options\n\n\tfor (const [name, Element] of Object.entries(elements)) {\n\t\tconst tag = dashify(name)\n\t\tconst already = customElements.get(tag)\n\n\t\tif (soft && already)\n\t\t\tcontinue\n\n\t\tcustomElements.define(tag, Element)\n\n\t\tif (upgrade)\n\t\t\tdocument.querySelectorAll(tag).forEach(element => {\n\t\t\t\tif (element.constructor === HTMLElement)\n\t\t\t\t\tcustomElements.upgrade(element)\n\t\t\t})\n\t}\n}\n\n", "/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nconst NODE_MODE = false;\n\n// Allows minifiers to rename references to globalThis\nconst global = globalThis;\n\n/**\n * Whether the current browser supports `adoptedStyleSheets`.\n */\nexport const supportsAdoptingStyleSheets: boolean =\n global.ShadowRoot &&\n (global.ShadyCSS === undefined || global.ShadyCSS.nativeShadow) &&\n 'adoptedStyleSheets' in Document.prototype &&\n 'replace' in CSSStyleSheet.prototype;\n\n/**\n * A CSSResult or native CSSStyleSheet.\n *\n * In browsers that support constructible CSS style sheets, CSSStyleSheet\n * object can be used for styling along side CSSResult from the `css`\n * template tag.\n */\nexport type CSSResultOrNative = CSSResult | CSSStyleSheet;\n\nexport type CSSResultArray = Array<CSSResultOrNative | CSSResultArray>;\n\n/**\n * A single CSSResult, CSSStyleSheet, or an array or nested arrays of those.\n */\nexport type CSSResultGroup = CSSResultOrNative | CSSResultArray;\n\nconst constructionToken = Symbol();\n\nconst cssTagCache = new WeakMap<TemplateStringsArray, CSSStyleSheet>();\n\n/**\n * A container for a string of CSS text, that may be used to create a CSSStyleSheet.\n *\n * CSSResult is the return value of `css`-tagged template literals and\n * `unsafeCSS()`. In order to ensure that CSSResults are only created via the\n * `css` tag and `unsafeCSS()`, CSSResult cannot be constructed directly.\n */\nexport class CSSResult {\n // This property needs to remain unminified.\n ['_$cssResult$'] = true;\n readonly cssText: string;\n private _styleSheet?: CSSStyleSheet;\n private _strings: TemplateStringsArray | undefined;\n\n private constructor(\n cssText: string,\n strings: TemplateStringsArray | undefined,\n safeToken: symbol\n ) {\n if (safeToken !== constructionToken) {\n throw new Error(\n 'CSSResult is not constructable. Use `unsafeCSS` or `css` instead.'\n );\n }\n this.cssText = cssText;\n this._strings = strings;\n }\n\n // This is a getter so that it's lazy. In practice, this means stylesheets\n // are not created until the first element instance is made.\n get styleSheet(): CSSStyleSheet | undefined {\n // If `supportsAdoptingStyleSheets` is true then we assume CSSStyleSheet is\n // constructable.\n let styleSheet = this._styleSheet;\n const strings = this._strings;\n if (supportsAdoptingStyleSheets && styleSheet === undefined) {\n const cacheable = strings !== undefined && strings.length === 1;\n if (cacheable) {\n styleSheet = cssTagCache.get(strings);\n }\n if (styleSheet === undefined) {\n (this._styleSheet = styleSheet = new CSSStyleSheet()).replaceSync(\n this.cssText\n );\n if (cacheable) {\n cssTagCache.set(strings, styleSheet);\n }\n }\n }\n return styleSheet;\n }\n\n toString(): string {\n return this.cssText;\n }\n}\n\ntype ConstructableCSSResult = CSSResult & {\n new (\n cssText: string,\n strings: TemplateStringsArray | undefined,\n safeToken: symbol\n ): CSSResult;\n};\n\nconst textFromCSSResult = (value: CSSResultGroup | number) => {\n // This property needs to remain unminified.\n if ((value as CSSResult)['_$cssResult$'] === true) {\n return (value as CSSResult).cssText;\n } else if (typeof value === 'number') {\n return value;\n } else {\n throw new Error(\n `Value passed to 'css' function must be a 'css' function result: ` +\n `${value}. Use 'unsafeCSS' to pass non-literal values, but take care ` +\n `to ensure page security.`\n );\n }\n};\n\n/**\n * Wrap a value for interpolation in a {@linkcode css} tagged template literal.\n *\n * This is unsafe because untrusted CSS text can be used to phone home\n * or exfiltrate data to an attacker controlled site. Take care to only use\n * this with trusted input.\n */\nexport const unsafeCSS = (value: unknown) =>\n new (CSSResult as ConstructableCSSResult)(\n typeof value === 'string' ? value : String(value),\n undefined,\n constructionToken\n );\n\n/**\n * A template literal tag which can be used with LitElement's\n * {@linkcode LitElement.styles} property to set element styles.\n *\n * For security reasons, only literal string values and number may be used in\n * embedded expressions. To incorporate non-literal values {@linkcode unsafeCSS}\n * may be used inside an expression.\n */\nexport const css = (\n strings: TemplateStringsArray,\n ...values: (CSSResultGroup | number)[]\n): CSSResult => {\n const cssText =\n strings.length === 1\n ? strings[0]\n : values.reduce(\n (acc, v, idx) => acc + textFromCSSResult(v) + strings[idx + 1],\n strings[0]\n );\n return new (CSSResult as ConstructableCSSResult)(\n cssText,\n strings,\n constructionToken\n );\n};\n\n/**\n * Applies the given styles to a `shadowRoot`. When Shadow DOM is\n * available but `adoptedStyleSheets` is not, styles are appended to the\n * `shadowRoot` to [mimic the native feature](https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/adoptedStyleSheets).\n * Note, when shimming is used, any styles that are subsequently placed into\n * the shadowRoot should be placed *before* any shimmed adopted styles. This\n * will match spec behavior that gives adopted sheets precedence over styles in\n * shadowRoot.\n */\nexport const adoptStyles = (\n renderRoot: ShadowRoot,\n styles: Array<CSSResultOrNative>\n) => {\n if (supportsAdoptingStyleSheets) {\n (renderRoot as ShadowRoot).adoptedStyleSheets = styles.map((s) =>\n s instanceof CSSStyleSheet ? s : s.styleSheet!\n );\n } else {\n for (const s of styles) {\n const style = document.createElement('style');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const nonce = (global as any)['litNonce'];\n if (nonce !== undefined) {\n style.setAttribute('nonce', nonce);\n }\n style.textContent = (s as CSSResult).cssText;\n renderRoot.appendChild(style);\n }\n }\n};\n\nconst cssResultFromStyleSheet = (sheet: CSSStyleSheet) => {\n let cssText = '';\n for (const rule of sheet.cssRules) {\n cssText += rule.cssText;\n }\n return unsafeCSS(cssText);\n};\n\nexport const getCompatibleStyle =\n supportsAdoptingStyleSheets ||\n (NODE_MODE && global.CSSStyleSheet === undefined)\n ? (s: CSSResultOrNative) => s\n : (s: CSSResultOrNative) =>\n s instanceof CSSStyleSheet ? cssResultFromStyleSheet(s) : s;\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Use this module if you want to create your own base class extending\n * {@link ReactiveElement}.\n * @packageDocumentation\n */\n\nimport {\n getCompatibleStyle,\n adoptStyles,\n CSSResultGroup,\n CSSResultOrNative,\n} from './css-tag.js';\nimport type {\n ReactiveController,\n ReactiveControllerHost,\n} from './reactive-controller.js';\n\n// In the Node build, this import will be injected by Rollup:\n// import {HTMLElement, customElements} from '@lit-labs/ssr-dom-shim';\n\nexport * from './css-tag.js';\nexport type {\n ReactiveController,\n ReactiveControllerHost,\n} from './reactive-controller.js';\n\n/**\n * Removes the `readonly` modifier from properties in the union K.\n *\n * This is a safer way to cast a value to a type with a mutable version of a\n * readonly field, than casting to an interface with the field re-declared\n * because it preserves the type of all the fields and warns on typos.\n */\ntype Mutable<T, K extends keyof T> = Omit<T, K> & {\n -readonly [P in keyof Pick<T, K>]: P extends K ? T[P] : never;\n};\n\n// TODO (justinfagnani): Add `hasOwn` here when we ship ES2022\nconst {\n is,\n defineProperty,\n getOwnPropertyDescriptor,\n getOwnPropertyNames,\n getOwnPropertySymbols,\n getPrototypeOf,\n} = Object;\n\nconst NODE_MODE = false;\n\n// Lets a minifier replace globalThis references with a minified name\nconst global = globalThis;\n\nif (NODE_MODE) {\n global.customElements ??= customElements;\n}\n\nconst DEV_MODE = true;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nconst trustedTypes = (global as unknown as {trustedTypes?: {emptyScript: ''}})\n .trustedTypes;\n\n// Temporary workaround for https://crbug.com/993268\n// Currently, any attribute starting with \"on\" is considered to be a\n// TrustedScript source. Such boolean attributes must be set to the equivalent\n// trusted emptyScript value.\nconst emptyStringForBooleanAttribute = trustedTypes\n ? (trustedTypes.emptyScript as unknown as '')\n : '';\n\nconst polyfillSupport = DEV_MODE\n ? global.reactiveElementPolyfillSupportDevMode\n : global.reactiveElementPolyfillSupport;\n\nif (DEV_MODE) {\n // Ensure warnings are issued only 1x, even if multiple versions of Lit\n // are loaded.\n global.litIssuedWarnings ??= new Set();\n\n /**\n * Issue a warning if we haven't already, based either on `code` or `warning`.\n * Warnings are disabled automatically only by `warning`; disabling via `code`\n * can be done by users.\n */\n issueWarning = (code: string, warning: string) => {\n warning += ` See https://lit.dev/msg/${code} for more information.`;\n if (\n !global.litIssuedWarnings!.has(warning) &&\n !global.litIssuedWarnings!.has(code)\n ) {\n console.warn(warning);\n global.litIssuedWarnings!.add(warning);\n }\n };\n\n queueMicrotask(() => {\n issueWarning(\n 'dev-mode',\n `Lit is in dev mode. Not recommended for production!`\n );\n\n // Issue polyfill support warning.\n if (global.ShadyDOM?.inUse && polyfillSupport === undefined) {\n issueWarning(\n 'polyfill-support-missing',\n `Shadow DOM is being polyfilled via \\`ShadyDOM\\` but ` +\n `the \\`polyfill-support\\` module has not been loaded.`\n );\n }\n });\n}\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ReactiveUnstable {\n /**\n * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n * we will emit 'lit-debug' events to window, with live details about the update and render\n * lifecycle. These can be useful for writing debug tooling and visualizations.\n *\n * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n * making certain operations that are normally very cheap (like a no-op render) much slower,\n * because we must copy data and dispatch events.\n */\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace DebugLog {\n export type Entry = Update;\n export interface Update {\n kind: 'update';\n }\n }\n}\n\ninterface DebugLoggingWindow {\n // Even in dev mode, we generally don't want to emit these events, as that's\n // another level of cost, so only emit them when DEV_MODE is true _and_ when\n // window.emitLitDebugEvents is true.\n emitLitDebugLogEvents?: boolean;\n}\n\n/**\n * Useful for visualizing and logging insights into what the Lit template system is doing.\n *\n * Compiled out of prod mode builds.\n */\nconst debugLogEvent = DEV_MODE\n ? (event: ReactiveUnstable.DebugLog.Entry) => {\n const shouldEmit = (global as unknown as DebugLoggingWindow)\n .emitLitDebugLogEvents;\n if (!shouldEmit) {\n return;\n }\n global.dispatchEvent(\n new CustomEvent<ReactiveUnstable.DebugLog.Entry>('lit-debug', {\n detail: event,\n })\n );\n }\n : undefined;\n\n/*\n * When using Closure Compiler, JSCompiler_renameProperty(property, object) is\n * replaced at compile time by the munged name for object[property]. We cannot\n * alias this function, so we have to use a small shim that has the same\n * behavior when not compiling.\n */\n/*@__INLINE__*/\nconst JSCompiler_renameProperty = <P extends PropertyKey>(\n prop: P,\n _obj: unknown\n): P => prop;\n\n/**\n * Converts property values to and from attribute values.\n */\nexport interface ComplexAttributeConverter<Type = unknown, TypeHint = unknown> {\n /**\n * Called to convert an attribute value to a property\n * value.\n */\n fromAttribute?(value: string | null, type?: TypeHint): Type;\n\n /**\n * Called to convert a property value to an attribute\n * value.\n *\n * It returns unknown instead of string, to be compatible with\n * https://github.com/WICG/trusted-types (and similar efforts).\n */\n toAttribute?(value: Type, type?: TypeHint): unknown;\n}\n\ntype AttributeConverter<Type = unknown, TypeHint = unknown> =\n | ComplexAttributeConverter<Type>\n | ((value: string | null, type?: TypeHint) => Type);\n\n/**\n * Defines options for a property accessor.\n */\nexport interface PropertyDeclaration<Type = unknown, TypeHint = unknown> {\n /**\n * When set to `true`, indicates the property is internal private state. The\n * property should not be set by users. When using TypeScript, this property\n * should be marked as `private` or `protected`, and it is also a common\n * practice to use a leading `_` in the name. The property is not added to\n * `observedAttributes`.\n */\n readonly state?: boolean;\n\n /**\n * Indicates how and whether the property becomes an observed attribute.\n * If the value is `false`, the property is not added to `observedAttributes`.\n * If true or absent, the lowercased property name is observed (e.g. `fooBar`\n * becomes `foobar`). If a string, the string value is observed (e.g\n * `attribute: 'foo-bar'`).\n */\n readonly attribute?: boolean | string;\n\n /**\n * Indicates the type of the property. This is used only as a hint for the\n * `converter` to determine how to convert the attribute\n * to/from a property.\n */\n readonly type?: TypeHint;\n\n /**\n * Indicates how to convert the attribute to/from a property. If this value\n * is a function, it is used to convert the attribute value a the property\n * value. If it's an object, it can have keys for `fromAttribute` and\n * `toAttribute`. If no `toAttribute` function is provided and\n * `reflect` is set to `true`, the property value is set directly to the\n * attribute. A default `converter` is used if none is provided; it supports\n * `Boolean`, `String`, `Number`, `Object`, and `Array`. Note,\n * when a property changes and the converter is used to update the attribute,\n * the property is never updated again as a result of the attribute changing,\n * and vice versa.\n */\n readonly converter?: AttributeConverter<Type, TypeHint>;\n\n /**\n * Indicates if the property should reflect to an attribute.\n * If `true`, when the property is set, the attribute is set using the\n * attribute name determined according to the rules for the `attribute`\n * property option and the value of the property converted using the rules\n * from the `converter` property option.\n */\n readonly reflect?: boolean;\n\n /**\n * A function that indicates if a property should be considered changed when\n * it is set. The function should take the `newValue` and `oldValue` and\n * return `true` if an update should be requested.\n */\n hasChanged?(value: Type, oldValue: Type): boolean;\n\n /**\n * Indicates whether an accessor will be created for this property. By\n * default, an accessor will be generated for this property that requests an\n * update when set. If this flag is `true`, no accessor will be created, and\n * it will be the user's responsibility to call\n * `this.requestUpdate(propertyName, oldValue)` to request an update when\n * the property changes.\n */\n readonly noAccessor?: boolean;\n\n /**\n * Whether this property is wrapping accessors. This is set by `@property`\n * to control the initial value change and reflection logic.\n *\n * @internal\n */\n wrapped?: boolean;\n\n /**\n * When `true`, uses the initial value of the property as the default value,\n * which changes how attributes are handled:\n * - The initial value does *not* reflect, even if the `reflect` option is `true`.\n * Subsequent changes to the property will reflect, even if they are equal to the\n * default value.\n * - When the attribute is removed, the property is set to the default value\n * - The initial value will not trigger an old value in the `changedProperties` map\n * argument to update lifecycle methods.\n *\n * When set, properties must be initialized, either with a field initializer, or an\n * assignment in the constructor. Not initializing the property may lead to\n * improper handling of subsequent property assignments.\n *\n * While this behavior is opt-in, most properties that reflect to attributes should\n * use `useDefault: true` so that their initial values do not reflect.\n */\n useDefault?: boolean;\n}\n\n/**\n * Map of properties to PropertyDeclaration options. For each property an\n * accessor is made, and the property is processed according to the\n * PropertyDeclaration options.\n */\nexport interface PropertyDeclarations {\n readonly [key: string]: PropertyDeclaration;\n}\n\ntype PropertyDeclarationMap = Map<PropertyKey, PropertyDeclaration>;\n\ntype AttributeMap = Map<string, PropertyKey>;\n\n/**\n * A Map of property keys to values.\n *\n * Takes an optional type parameter T, which when specified as a non-any,\n * non-unknown type, will make the Map more strongly-typed, associating the map\n * keys with their corresponding value type on T.\n *\n * Use `PropertyValues<this>` when overriding ReactiveElement.update() and\n * other lifecycle methods in order to get stronger type-checking on keys\n * and values.\n */\n// This type is conditional so that if the parameter T is not specified, or\n// is `any`, the type will include `Map<PropertyKey, unknown>`. Since T is not\n// given in the uses of PropertyValues in this file, all uses here fallback to\n// meaning `Map<PropertyKey, unknown>`, but if a developer uses\n// `PropertyValues<this>` (or any other value for T) they will get a\n// strongly-typed Map type.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type PropertyValues<T = any> = T extends object\n ? PropertyValueMap<T>\n : Map<PropertyKey, unknown>;\n\n/**\n * Do not use, instead prefer {@linkcode PropertyValues}.\n */\n// This type must be exported such that JavaScript generated by the Google\n// Closure Compiler can import a type reference.\nexport interface PropertyValueMap<T> extends Map<PropertyKey, unknown> {\n get<K extends keyof T>(k: K): T[K] | undefined;\n set<K extends keyof T>(key: K, value: T[K]): this;\n has<K extends keyof T>(k: K): boolean;\n delete<K extends keyof T>(k: K): boolean;\n}\n\nexport const defaultConverter: ComplexAttributeConverter = {\n toAttribute(value: unknown, type?: unknown): unknown {\n switch (type) {\n case Boolean:\n value = value ? emptyStringForBooleanAttribute : null;\n break;\n case Object:\n case Array:\n // if the value is `null` or `undefined` pass this through\n // to allow removing/no change behavior.\n value = value == null ? value : JSON.stringify(value);\n break;\n }\n return value;\n },\n\n fromAttribute(value: string | null, type?: unknown) {\n let fromValue: unknown = value;\n switch (type) {\n case Boolean:\n fromValue = value !== null;\n break;\n case Number:\n fromValue = value === null ? null : Number(value);\n break;\n case Object:\n case Array:\n // Do *not* generate exception when invalid JSON is set as elements\n // don't normally complain on being mis-configured.\n // TODO(sorvell): Do generate exception in *dev mode*.\n try {\n // Assert to adhere to Bazel's \"must type assert JSON parse\" rule.\n fromValue = JSON.parse(value!) as unknown;\n } catch (e) {\n fromValue = null;\n }\n break;\n }\n return fromValue;\n },\n};\n\nexport interface HasChanged {\n (value: unknown, old: unknown): boolean;\n}\n\n/**\n * Change function that returns true if `value` is different from `oldValue`.\n * This method is used as the default for a property's `hasChanged` function.\n */\nexport const notEqual: HasChanged = (value: unknown, old: unknown): boolean =>\n !is(value, old);\n\nconst defaultPropertyDeclaration: PropertyDeclaration = {\n attribute: true,\n type: String,\n converter: defaultConverter,\n reflect: false,\n useDefault: false,\n hasChanged: notEqual,\n};\n\n/**\n * A string representing one of the supported dev mode warning categories.\n */\nexport type WarningKind =\n | 'change-in-update'\n | 'migration'\n | 'async-perform-update';\n\nexport type Initializer = (element: ReactiveElement) => void;\n\n// Temporary, until google3 is on TypeScript 5.2\ndeclare global {\n interface SymbolConstructor {\n readonly metadata: unique symbol;\n }\n}\n\n// Ensure metadata is enabled. TypeScript does not polyfill\n// Symbol.metadata, so we must ensure that it exists.\n(Symbol as {metadata: symbol}).metadata ??= Symbol('metadata');\n\ndeclare global {\n // This is public global API, do not change!\n // eslint-disable-next-line no-var\n var litPropertyMetadata: WeakMap<\n object,\n Map<PropertyKey, PropertyDeclaration>\n >;\n}\n\n// Map from a class's metadata object to property options\n// Note that we must use nullish-coalescing assignment so that we only use one\n// map even if we load multiple version of this module.\nglobal.litPropertyMetadata ??= new WeakMap<\n object,\n Map<PropertyKey, PropertyDeclaration>\n>();\n\n/**\n * Base element class which manages element properties and attributes. When\n * properties change, the `update` method is asynchronously called. This method\n * should be supplied by subclasses to render updates as desired.\n * @noInheritDoc\n */\nexport abstract class ReactiveElement\n // In the Node build, this `extends` clause will be substituted with\n // `(globalThis.HTMLElement ?? HTMLElement)`.\n //\n // This way, we will first prefer any global `HTMLElement` polyfill that the\n // user has assigned, and then fall back to the `HTMLElement` shim which has\n // been imported (see note at the top of this file about how this import is\n // generated by Rollup). Note that the `HTMLElement` variable has been\n // shadowed by this import, so it no longer refers to the global.\n extends HTMLElement\n implements ReactiveControllerHost\n{\n // Note: these are patched in only in DEV_MODE.\n /**\n * Read or set all the enabled warning categories for this class.\n *\n * This property is only used in development builds.\n *\n * @nocollapse\n * @category dev-mode\n */\n static enabledWarnings?: WarningKind[];\n\n /**\n * Enable the given warning category for this class.\n *\n * This method only exists in development builds, so it should be accessed\n * with a guard like:\n *\n * ```ts\n * // Enable for all ReactiveElement subclasses\n * ReactiveElement.enableWarning?.('migration');\n *\n * // Enable for only MyElement and subclasses\n * MyElement.enableWarning?.('migration');\n * ```\n *\n * @nocollapse\n * @category dev-mode\n */\n static enableWarning?: (warningKind: WarningKind) => void;\n\n /**\n * Disable the given warning category for this class.\n *\n * This method only exists in development builds, so it should be accessed\n * with a guard like:\n *\n * ```ts\n * // Disable for all ReactiveElement subclasses\n * ReactiveElement.disableWarning?.('migration');\n *\n * // Disable for only MyElement and subclasses\n * MyElement.disableWarning?.('migration');\n * ```\n *\n * @nocollapse\n * @category dev-mode\n */\n static disableWarning?: (warningKind: WarningKind) => void;\n\n /**\n * Adds an initializer function to the class that is called during instance\n * construction.\n *\n * This is useful for code that runs against a `ReactiveElement`\n * subclass, such as a decorator, that needs to do work for each\n * instance, such as setting up a `ReactiveController`.\n *\n * ```ts\n * const myDecorator = (target: typeof ReactiveElement, key: string) => {\n * target.addInitializer((instance: ReactiveElement) => {\n * // This is run during construction of the element\n * new MyController(instance);\n * });\n * }\n * ```\n *\n * Decorating a field will then cause each instance to run an initializer\n * that adds a controller:\n *\n * ```ts\n * class MyElement extends LitElement {\n * @myDecorator foo;\n * }\n * ```\n *\n * Initializers are stored per-constructor. Adding an initializer to a\n * subclass does not add it to a superclass. Since initializers are run in\n * constructors, initializers will run in order of the class hierarchy,\n * starting with superclasses and progressing to the instance's class.\n *\n * @nocollapse\n */\n static addInitializer(initializer: Initializer) {\n this.__prepare();\n (this._initializers ??= []).push(initializer);\n }\n\n static _initializers?: Initializer[];\n\n /*\n * Due to closure compiler ES6 compilation bugs, @nocollapse is required on\n * all static methods and properties with initializers. Reference:\n * - https://github.com/google/closure-compiler/issues/1776\n */\n\n /**\n * Maps attribute names to properties; for example `foobar` attribute to\n * `fooBar` property. Created lazily on user subclasses when finalizing the\n * class.\n * @nocollapse\n */\n private static __attributeToPropertyMap: AttributeMap;\n\n /**\n * Marks class as having been finalized, which includes creating properties\n * from `static properties`, but does *not* include all properties created\n * from decorators.\n * @nocollapse\n */\n protected static finalized: true | undefined;\n\n /**\n * Memoized list of all element properties, including any superclass\n * properties. Created lazily on user subclasses when finalizing the class.\n *\n * @nocollapse\n * @category properties\n */\n static elementProperties: PropertyDeclarationMap;\n\n /**\n * User-supplied object that maps property names to `PropertyDeclaration`\n * objects containing options for configuring reactive properties. When\n * a reactive property is set the element will update and render.\n *\n * By default properties are public fields, and as such, they should be\n * considered as primarily settable by element users, either via attribute or\n * the property itself.\n *\n * Generally, properties that are changed by the element should be private or\n * protected fields and should use the `state: true` option. Properties\n * marked as `state` do not reflect from the corresponding attribute\n *\n * However, sometimes element code does need to set a public property. This\n * should typically only be done in response to user interaction, and an event\n * should be fired informing the user; for example, a checkbox sets its\n * `checked` property when clicked and fires a `changed` event. Mutating\n * public properties should typically not be done for non-primitive (object or\n * array) properties. In other cases when an element needs to manage state, a\n * private property set with the `state: true` option should be used. When\n * needed, state properties can be initialized via public properties to\n * facilitate complex interactions.\n * @nocollapse\n * @category properties\n */\n static properties: PropertyDeclarations;\n\n /**\n * Memoized list of all element styles.\n * Created lazily on user subclasses when finalizing the class.\n * @nocollapse\n * @category styles\n */\n static elementStyles: Array<CSSResultOrNative> = [];\n\n /**\n * Array of styles to apply to the element. The styles should be defined\n * using the {@linkcode css} tag function, via constructible stylesheets, or\n * imported from native CSS module scripts.\n *\n * Note on Content Security Policy:\n *\n * Element styles are implemented with `<style>` tags when the browser doesn't\n * support adopted StyleSheets. To use such `<style>` tags with the style-src\n * CSP directive, the style-src value must either include 'unsafe-inline' or\n * `nonce-<base64-value>` with `<base64-value>` replaced be a server-generated\n * nonce.\n *\n * To provide a nonce to use on generated `<style>` elements, set\n * `window.litNonce` to a server-generated nonce in your page's HTML, before\n * loading application code:\n *\n * ```html\n * <script>\n * // Generated and unique per request:\n * window.litNonce = 'a1b2c3d4';\n * </script>\n * ```\n * @nocollapse\n * @category styles\n */\n static styles?: CSSResultGroup;\n\n /**\n * Returns a list of attributes corresponding to the registered properties.\n * @nocollapse\n * @category attributes\n */\n static get observedAttributes() {\n // Ensure we've created all properties\n this.finalize();\n // this.__attributeToPropertyMap is only undefined after finalize() in\n // ReactiveElement itself. ReactiveElement.observedAttributes is only\n // accessed with ReactiveElement as the receiver when a subclass or mixin\n // calls super.observedAttributes\n return (\n this.__attributeToPropertyMap && [...this.__attributeToPropertyMap.keys()]\n );\n }\n\n private __instanceProperties?: PropertyValues = undefined;\n\n /**\n * Creates a property accessor on the element prototype if one does not exist\n * and stores a {@linkcode PropertyDeclaration} for the property with the\n * given options. The property setter calls the property's `hasChanged`\n * property option or uses a strict identity check to determine whether or not\n * to request an update.\n *\n * This method may be overridden to customize properties; however,\n * when doing so, it's important to call `super.createProperty` to ensure\n * the property is setup correctly. This method calls\n * `getPropertyDescriptor` internally to get a descriptor to install.\n * To customize what properties do when they are get or set, override\n * `getPropertyDescriptor`. To customize the options for a property,\n * implement `createProperty` like this:\n *\n * ```ts\n * static createProperty(name, options) {\n * options = Object.assign(options, {myOption: true});\n * super.createProperty(name, options);\n * }\n * ```\n *\n * @nocollapse\n * @category properties\n */\n static createProperty(\n name: PropertyKey,\n options: PropertyDeclaration = defaultPropertyDeclaration\n ) {\n // If this is a state property, force the attribute to false.\n if (options.state) {\n (options as Mutable<PropertyDeclaration, 'attribute'>).attribute = false;\n }\n this.__prepare();\n // Whether this property is wrapping accessors.\n // Helps control the initial value change and reflection logic.\n if (this.prototype.hasOwnProperty(name)) {\n options = Object.create(options);\n options.wrapped = true;\n }\n this.elementProperties.set(name, options);\n if (!options.noAccessor) {\n const key = DEV_MODE\n ? // Use Symbol.for in dev mode to make it easier to maintain state\n // when doing HMR.\n Symbol.for(`${String(name)} (@property() cache)`)\n : Symbol();\n const descriptor = this.getPropertyDescriptor(name, key, options);\n if (descriptor !== undefined) {\n defineProperty(this.prototype, name, descriptor);\n }\n }\n }\n\n /**\n * Returns a property descriptor to be defined on the given named property.\n * If no descriptor is returned, the property will not become an accessor.\n * For example,\n *\n * ```ts\n * class MyElement extends LitElement {\n * static getPropertyDescriptor(name, key, options) {\n * const defaultDescriptor =\n * super.getPropertyDescriptor(name, key, options);\n * const setter = defaultDescriptor.set;\n * return {\n * get: defaultDescriptor.get,\n * set(value) {\n * setter.call(this, value);\n * // custom action.\n * },\n * configurable: true,\n * enumerable: true\n * }\n * }\n * }\n * ```\n *\n * @nocollapse\n * @category properties\n */\n protected static getPropertyDescriptor(\n name: PropertyKey,\n key: string | symbol,\n options: PropertyDeclaration\n ): PropertyDescriptor | undefined {\n const {get, set} = getOwnPropertyDescriptor(this.prototype, name) ?? {\n get(this: ReactiveElement) {\n return this[key as keyof typeof this];\n },\n set(this: ReactiveElement, v: unknown) {\n (this as unknown as Record<string | symbol, unknown>)[key] = v;\n },\n };\n if (DEV_MODE && get == null) {\n if ('value' in (getOwnPropertyDescriptor(this.prototype, name) ?? {})) {\n throw new Error(\n `Field ${JSON.stringify(String(name))} on ` +\n `${this.name} was declared as a reactive property ` +\n `but it's actually declared as a value on the prototype. ` +\n `Usually this is due to using @property or @state on a method.`\n );\n }\n issueWarning(\n 'reactive-property-without-getter',\n `Field ${JSON.stringify(String(name))} on ` +\n `${this.name} was declared as a reactive property ` +\n `but it does not have a getter. This will be an error in a ` +\n `future version of Lit.`\n );\n }\n return {\n get,\n set(this: ReactiveElement, value: unknown) {\n const oldValue = get?.call(this);\n set?.call(this, value);\n this.requestUpdate(name, oldValue, options);\n },\n configurable: true,\n enumerable: true,\n };\n }\n\n /**\n * Returns the property options associated with the given property.\n * These options are defined with a `PropertyDeclaration` via the `properties`\n * object or the `@property` decorator and are registered in\n * `createProperty(...)`.\n *\n * Note, this method should be considered \"final\" and not overridden. To\n * customize the options for a given property, override\n * {@linkcode createProperty}.\n *\n * @nocollapse\n * @final\n * @category properties\n */\n static getPropertyOptions(name: PropertyKey) {\n return this.elementProperties.get(name) ?? defaultPropertyDeclaration;\n }\n\n // Temporary, until google3 is on TypeScript 5.2\n declare static [Symbol.metadata]: object & Record<PropertyKey, unknown>;\n\n /**\n * Initializes static own properties of the class used in bookkeeping\n * for element properties, initializers, etc.\n *\n * Can be called multiple times by code that needs to ensure these\n * properties exist before using them.\n *\n * This method ensures the superclass is finalized so that inherited\n * property metadata can be copied down.\n * @nocollapse\n */\n private static __prepare() {\n if (\n this.hasOwnProperty(JSCompiler_renameProperty('elementProperties', this))\n ) {\n // Already prepared\n return;\n }\n // Finalize any superclasses\n const superCtor = getPrototypeOf(this) as typeof ReactiveElement;\n superCtor.finalize();\n\n // Create own set of initializers for this class if any exist on the\n // superclass and copy them down. Note, for a small perf boost, avoid\n // creating initializers unless needed.\n if (superCtor._initializers !== undefined) {\n this._initializers = [...superCtor._initializers];\n }\n // Initialize elementProperties from the superclass\n this.elementProperties = new Map(superCtor.elementProperties);\n }\n\n /**\n * Finishes setting up the class so that it's ready to be registered\n * as a custom element and instantiated.\n *\n * This method is called by the ReactiveElement.observedAttributes getter.\n * If you override the observedAttributes getter, you must either call\n * super.observedAttributes to trigger finalization, or call finalize()\n * yourself.\n *\n * @nocollapse\n */\n protected static finalize() {\n if (this.hasOwnProperty(JSCompiler_renameProperty('finalized', this))) {\n return;\n }\n this.finalized = true;\n this.__prepare();\n\n // Create properties from the static properties block:\n if (this.hasOwnProperty(JSCompiler_renameProperty('properties', this))) {\n const props = this.properties;\n const propKeys = [\n ...getOwnPropertyNames(props),\n ...getOwnPropertySymbols(props),\n ] as Array<keyof typeof props>;\n for (const p of propKeys) {\n this.createProperty(p, props[p]);\n }\n }\n\n // Create properties from standard decorator metadata:\n const metadata = this[Symbol.metadata];\n if (metadata !== null) {\n const properties = litPropertyMetadata.get(metadata);\n if (properties !== undefined) {\n for (const [p, options] of properties) {\n this.elementProperties.set(p, options);\n }\n }\n }\n\n // Create the attribute-to-property map\n this.__attributeToPropertyMap = new Map();\n for (const [p, options] of this.elementProperties) {\n const attr = this.__attributeNameForProperty(p, options);\n if (attr !== undefined) {\n this.__attributeToPropertyMap.set(attr, p);\n }\n }\n\n this.elementStyles = this.finalizeStyles(this.styles);\n\n if (DEV_MODE) {\n if (this.hasOwnProperty('createProperty')) {\n issueWarning(\n 'no-override-create-property',\n 'Overriding ReactiveElement.createProperty() is deprecated. ' +\n 'The override will not be called with standard decorators'\n );\n }\n if (this.hasOwnProperty('getPropertyDescriptor')) {\n issueWarning(\n 'no-override-get-property-descriptor',\n 'Overriding ReactiveElement.getPropertyDescriptor() is deprecated. ' +\n 'The override will not be called with standard decorators'\n );\n }\n }\n }\n\n /**\n * Options used when calling `attachShadow`. Set this property to customize\n * the options for the shadowRoot; for example, to create a closed\n * shadowRoot: `{mode: 'closed'}`.\n *\n * Note, these options are used in `createRenderRoot`. If this method\n * is customized, options should be respected if possible.\n * @nocollapse\n * @category rendering\n */\n static shadowRootOptions: ShadowRootInit = {mode: 'open'};\n\n /**\n * Takes the styles the user supplied via the `static styles` property and\n * returns the array of styles to apply to the element.\n * Override this method to integrate into a style management system.\n *\n * Styles are deduplicated preserving the _last_ instance in the list. This\n * is a performance optimization to avoid duplicated styles that can occur\n * especially when composing via subclassing. The last item is kept to try\n * to preserve the cascade order with the assumption that it's most important\n * that last added styles override previous styles.\n *\n * @nocollapse\n * @category styles\n */\n protected static finalizeStyles(\n styles?: CSSResultGroup\n ): Array<CSSResultOrNative> {\n const elementStyles = [];\n if (Array.isArray(styles)) {\n // Dedupe the flattened array in reverse order to preserve the last items.\n // Casting to Array<unknown> works around TS error that\n // appears to come from trying to flatten a type CSSResultArray.\n const set = new Set((styles as Array<unknown>).flat(Infinity).reverse());\n // Then preserve original order by adding the set items in reverse order.\n for (const s of set) {\n elementStyles.unshift(getCompatibleStyle(s as CSSResultOrNative));\n }\n } else if (styles !== undefined) {\n elementStyles.push(getCompatibleStyle(styles));\n }\n return elementStyles;\n }\n\n /**\n * Node or ShadowRoot into which element DOM should be rendered. Defaults\n * to an open shadowRoot.\n * @category rendering\n */\n readonly renderRoot!: HTMLElement | DocumentFragment;\n\n /**\n * Returns the property name for the given attribute `name`.\n * @nocollapse\n */\n private static __attributeNameForProperty(\n name: PropertyKey,\n options: PropertyDeclaration\n ) {\n const attribute = options.attribute;\n return attribute === false\n ? undefined\n : typeof attribute === 'string'\n ? attribute\n : typeof name === 'string'\n ? name.toLowerCase()\n : undefined;\n }\n\n // Initialize to an unresolved Promise so we can make sure the element has\n // connected before first update.\n private __updatePromise!: Promise<boolean>;\n\n /**\n * True if there is a pending update as a result of calling `requestUpdate()`.\n * Should only be read.\n * @category updates\n */\n isUpdatePending = false;\n\n /**\n * Is set to `true` after the first update. The element code cannot assume\n * that `renderRoot` exists before the element `hasUpdated`.\n * @category updates\n */\n hasUpdated = false;\n\n /**\n * Map with keys for any properties that have changed since the last\n * update cycle with previous values.\n *\n * @internal\n */\n _$changedProperties!: PropertyValues;\n\n /**\n * Records property default values when the\n * `useDefault` option is used.\n */\n private __defaultValues?: Map<PropertyKey, unknown>;\n\n /**\n * Properties that should be reflected when updated.\n */\n private __reflectingProperties?: Set<PropertyKey>;\n\n /**\n * Name of currently reflecting property\n */\n private __reflectingProperty: PropertyKey | null = null;\n\n /**\n * Set of controllers.\n */\n private __controllers?: Set<ReactiveController>;\n\n constructor() {\n super();\n this.__initialize();\n }\n\n /**\n * Internal only override point for customizing work done when elements\n * are constructed.\n */\n private __initialize() {\n this.__updatePromise = new Promise<boolean>(\n (res) => (this.enableUpdating = res)\n );\n this._$changedProperties = new Map();\n // This enqueues a microtask that must run before the first update, so it\n // must be called before requestUpdate()\n this.__saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this.requestUpdate();\n (this.constructor as typeof ReactiveElement)._initializers?.forEach((i) =>\n i(this)\n );\n }\n\n /**\n * Registers a `ReactiveController` to participate in the element's reactive\n * update cycle. The element automatically calls into any registered\n * controllers during its lifecycle callbacks.\n *\n * If the element is connected when `addController()` is called, the\n * controller's `hostConnected()` callback will be immediately called.\n * @category controllers\n */\n addController(controller: ReactiveController) {\n (this.__controllers ??= new Set()).add(controller);\n // If a controller is added after the element has been connected,\n // call hostConnected. Note, re-using existence of `renderRoot` here\n // (which is set in connectedCallback) to avoid the need to track a\n // first connected state.\n if (this.renderRoot !== undefined && this.isConnected) {\n controller.hostConnected?.();\n }\n }\n\n /**\n * Removes a `ReactiveController` from the element.\n * @category controllers\n */\n removeController(controller: ReactiveController) {\n this.__controllers?.delete(controller);\n }\n\n /**\n * Fixes any properties set on the instance before upgrade time.\n * Otherwise these would shadow the accessor and break these properties.\n * The properties are stored in a Map which is played back after the\n * constructor runs.\n */\n private __saveInstanceProperties() {\n const instanceProperties = new Map<PropertyKey, unknown>();\n const elementProperties = (this.constructor as typeof ReactiveElement)\n .elementProperties;\n for (const p of elementProperties.keys() as IterableIterator<keyof this>) {\n if (this.hasOwnProperty(p)) {\n instanceProperties.set(p, this[p]);\n delete this[p];\n }\n }\n if (instanceProperties.size > 0) {\n this.__instanceProperties = instanceProperties;\n }\n }\n\n /**\n * Returns the node into which the element should render and by default\n * creates and returns an open shadowRoot. Implement to customize where the\n * element's DOM is rendered. For example, to render into the element's\n * childNodes, return `this`.\n *\n * @return Returns a node into which to render.\n * @category rendering\n */\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n const renderRoot =\n this.shadowRoot ??\n this.attachShadow(\n (this.constructor as typeof ReactiveElement).shadowRootOptions\n );\n adoptStyles(\n renderRoot,\n (this.constructor as typeof ReactiveElement).elementStyles\n );\n return renderRoot;\n }\n\n /**\n * On first connection, creates the element's renderRoot, sets up\n * element styling, and enables updating.\n * @category lifecycle\n */\n connectedCallback() {\n // Create renderRoot before controllers `hostConnected`\n (this as Mutable<typeof this, 'renderRoot'>).renderRoot ??=\n this.createRenderRoot();\n this.enableUpdating(true);\n this.__controllers?.forEach((c) => c.hostConnected?.());\n }\n\n /**\n * Note, this method should be considered final and not overridden. It is\n * overridden on the element instance with a function that triggers the first\n * update.\n * @category updates\n */\n protected enableUpdating(_requestedUpdate: boolean) {}\n\n /**\n * Allows for `super.disconnectedCallback()` in extensions while\n * reserving the possibility of making non-breaking feature additions\n * when disconnecting at some point in the future.\n * @category lifecycle\n */\n disconnectedCallback() {\n this.__controllers?.forEach((c) => c.hostDisconnected?.());\n }\n\n /**\n * Synchronizes property values when attributes change.\n *\n * Specifically, when an attribute is set, the corresponding property is set.\n * You should rarely need to implement this callback. If this method is\n * overridden, `super.attributeChangedCallback(name, _old, value)` must be\n * called.\n *\n * See [responding to attribute changes](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#responding_to_attribute_changes)\n * on MDN for more information about the `attributeChangedCallback`.\n * @category attributes\n */\n attributeChangedCallback(\n name: string,\n _old: string | null,\n value: string | null\n ) {\n this._$attributeToProperty(name, value);\n }\n\n private __propertyToAttribute(name: PropertyKey, value: unknown) {\n const elemProperties: PropertyDeclarationMap = (\n this.constructor as typeof ReactiveElement\n ).elementProperties;\n const options = elemProperties.get(name)!;\n const attr = (\n this.constructor as typeof ReactiveElement\n ).__attributeNameForProperty(name, options);\n if (attr !== undefined && options.reflect === true) {\n const converter =\n (options.converter as ComplexAttributeConverter)?.toAttribute !==\n undefined\n ? (options.converter as ComplexAttributeConverter)\n : defaultConverter;\n const attrValue = converter.toAttribute!(value, options.type);\n if (\n DEV_MODE &&\n (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n 'migration'\n ) &&\n attrValue === undefined\n ) {\n issueWarning(\n 'undefined-attribute-value',\n `The attribute value for the ${name as string} property is ` +\n `undefined on element ${this.localName}. The attribute will be ` +\n `removed, but in the previous version of \\`ReactiveElement\\`, ` +\n `the attribute would not have changed.`\n );\n }\n // Track if the property is being reflected to avoid\n // setting the property again via `attributeChangedCallback`. Note:\n // 1. this takes advantage of the fact that the callback is synchronous.\n // 2. will behave incorrectly if multiple attributes are in the reaction\n // stack at time of calling. However, since we process attributes\n // in `update` this should not be possible (or an extreme corner case\n // that we'd like to discover).\n // mark state reflecting\n this.__reflectingProperty = name;\n if (attrValue == null) {\n this.removeAttribute(attr);\n } else {\n this.setAttribute(attr, attrValue as string);\n }\n // mark state not reflecting\n this.__reflectingProperty = null;\n }\n }\n\n /** @internal */\n _$attributeToProperty(name: string, value: string | null) {\n const ctor = this.constructor as typeof ReactiveElement;\n // Note, hint this as an `AttributeMap` so closure clearly understands\n // the type; it has issues with tracking types through statics\n const propName = (ctor.__attributeToPropertyMap as AttributeMap).get(name);\n // Use tracking info to avoid reflecting a property value to an attribute\n // if it was just set because the attribute changed.\n if (propName !== undefined && this.__reflectingProperty !== propName) {\n const options = ctor.getPropertyOptions(propName);\n const converter =\n typeof options.converter === 'function'\n ? {fromAttribute: options.converter}\n : options.converter?.fromAttribute !== undefined\n ? options.converter\n : defaultConverter;\n // mark state reflecting\n this.__reflectingProperty = propName;\n const convertedValue = converter.fromAttribute!(value, options.type);\n this[propName as keyof this] =\n convertedValue ??\n this.__defaultValues?.get(propName) ??\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (convertedValue as any);\n // mark state not reflecting\n this.__reflectingProperty = null;\n }\n }\n\n /**\n * Requests an update which is processed asynchronously. This should be called\n * when an element should update based on some state not triggered by setting\n * a reactive property. In this case, pass no arguments. It should also be\n * called when manually implementing a property setter. In this case, pass the\n * property `name` and `oldValue` to ensure that any configured property\n * options are honored.\n *\n * @param name name of requesting property\n * @param oldValue old value of requesting property\n * @param options property options to use instead of the previously\n * configured options\n * @param useNewValue if true, the newValue argument is used instead of\n * reading the property value. This is important to use if the reactive\n * property is a standard private accessor, as opposed to a plain\n * property, since private members can't be dynamically read by name.\n * @param newValue the new value of the property. This is only used if\n * `useNewValue` is true.\n * @category updates\n */\n requestUpdate(\n name?: PropertyKey,\n oldValue?: unknown,\n options?: PropertyDeclaration,\n useNewValue = false,\n newValue?: unknown\n ): void {\n // If we have a property key, perform property update steps.\n if (name !== undefined) {\n if (DEV_MODE && (name as unknown) instanceof Event) {\n issueWarning(\n ``,\n `The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()`\n );\n }\n const ctor = this.constructor as typeof ReactiveElement;\n if (useNewValue === false) {\n newValue = this[name as keyof this];\n }\n options ??= ctor.getPropertyOptions(name);\n const changed =\n (options.hasChanged ?? notEqual)(newValue, oldValue) ||\n // When there is no change, check a corner case that can occur when\n // 1. there's a initial value which was not reflected\n // 2. the property is subsequently set to this value.\n // For example, `prop: {useDefault: true, reflect: true}`\n // and el.prop = 'foo'. This should be considered a change if the\n // attribute is not set because we will now reflect the property to the attribute.\n (options.useDefault &&\n options.reflect &&\n newValue === this.__defaultValues?.get(name) &&\n !this.hasAttribute(ctor.__attributeNameForProperty(name, options)!));\n if (changed) {\n this._$changeProperty(name, oldValue, options);\n } else {\n // Abort the request if the property should not be considered changed.\n return;\n }\n }\n if (this.isUpdatePending === false) {\n this.__updatePromise = this.__enqueueUpdate();\n }\n }\n\n /**\n * @internal\n */\n _$changeProperty(\n name: PropertyKey,\n oldValue: unknown,\n {useDefault, reflect, wrapped}: PropertyDeclaration,\n initializeValue?: unknown\n ) {\n // Record default value when useDefault is used. This allows us to\n // restore this value when the attribute is removed.\n if (useDefault && !(this.__defaultValues ??= new Map()).has(name)) {\n this.__defaultValues.set(\n name,\n initializeValue ?? oldValue ?? this[name as keyof this]\n );\n // if this is not wrapping an accessor, it must be an initial setting\n // and in this case we do not want to record the change or reflect.\n if (wrapped !== true || initializeValue !== undefined) {\n return;\n }\n }\n // TODO (justinfagnani): Create a benchmark of Map.has() + Map.set(\n // vs just Map.set()\n if (!this._$changedProperties.has(name)) {\n // On the initial change, the old value should be `undefined`, except\n // with `useDefault`\n if (!this.hasUpdated && !useDefault) {\n oldValue = undefined;\n }\n this._$changedProperties.set(name, oldValue);\n }\n // Add to reflecting properties set.\n // Note, it's important that every change has a chance to add the\n // property to `__reflectingProperties`. This ensures setting\n // attribute + property reflects correctly.\n if (reflect === true && this.__reflectingProperty !== name) {\n (this.__reflectingProperties ??= new Set<PropertyKey>()).add(name);\n }\n }\n\n /**\n * Sets up the element to asynchronously update.\n */\n private async __enqueueUpdate() {\n this.isUpdatePending = true;\n try {\n // Ensure any previous update has resolved before updating.\n // This `await` also ensures that property changes are batched.\n await this.__updatePromise;\n } catch (e) {\n // Refire any previous errors async so they do not disrupt the update\n // cycle. Errors are refired so developers have a chance to observe\n // them, and this can be done by implementing\n // `window.onunhandledrejection`.\n Promise.reject(e);\n }\n const result = this.scheduleUpdate();\n // If `scheduleUpdate` returns a Promise, we await it. This is done to\n // enable coordinating updates with a scheduler. Note, the result is\n // checked to avoid delaying an additional microtask unless we need to.\n if (result != null) {\n await result;\n }\n return !this.isUpdatePending;\n }\n\n /**\n * Schedules an element update. You can override this method to change the\n * timing of updates by returning a Promise. The update will await the\n * returned Promise, and you should resolve the Promise to allow the update\n * to proceed. If this method is overridden, `super.scheduleUpdate()`\n * must be called.\n *\n * For instance, to schedule updates to occur just before the next frame:\n *\n * ```ts\n * override protected async scheduleUpdate(): Promise<unknown> {\n * await new Promise((resolve) => requestAnimationFrame(() => resolve()));\n * super.scheduleUpdate();\n * }\n * ```\n * @category updates\n */\n protected scheduleUpdate(): void | Promise<unknown> {\n const result = this.performUpdate();\n if (\n DEV_MODE &&\n (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n 'async-perform-update'\n ) &&\n typeof (result as unknown as Promise<unknown> | undefined)?.then ===\n 'function'\n ) {\n issueWarning(\n 'async-perform-update',\n `Element ${this.localName} returned a Promise from performUpdate(). ` +\n `This behavior is deprecated and will be removed in a future ` +\n `version of ReactiveElement.`\n );\n }\n return result;\n }\n\n /**\n * Performs an element update. Note, if an exception is thrown during the\n * update, `firstUpdated` and `updated` will not be called.\n *\n * Call `performUpdate()` to immediately process a pending update. This should\n * generally not be needed, but it can be done in rare cases when you need to\n * update synchronously.\n *\n * @category updates\n */\n protected performUpdate(): void {\n // Abort any update if one is not pending when this is called.\n // This can happen if `performUpdate` is called early to \"flush\"\n // the update.\n if (!this.isUpdatePending) {\n return;\n }\n debugLogEvent?.({kind: 'update'});\n if (!this.hasUpdated) {\n // Create renderRoot before first update. This occurs in `connectedCallback`\n // but is done here to support out of tree calls to `enableUpdating`/`performUpdate`.\n (this as Mutable<typeof this, 'renderRoot'>).renderRoot ??=\n this.createRenderRoot();\n if (DEV_MODE) {\n // Produce warning if any reactive properties on the prototype are\n // shadowed by class fields. Instance fields set before upgrade are\n // deleted by this point, so any own property is caused by class field\n // initialization in the constructor.\n const ctor = this.constructor as typeof ReactiveElement;\n const shadowedProperties = [...ctor.elementProperties.keys()].filter(\n (p) => this.hasOwnProperty(p) && p in getPrototypeOf(this)\n );\n if (shadowedProperties.length) {\n throw new Error(\n `The following properties on element ${this.localName} will not ` +\n `trigger updates as expected because they are set using class ` +\n `fields: ${shadowedProperties.join(', ')}. ` +\n `Native class fields and some compiled output will overwrite ` +\n `accessors used for detecting changes. See ` +\n `https://lit.dev/msg/class-field-shadowing ` +\n `for more information.`\n );\n }\n }\n // Mixin instance properties once, if they exist.\n if (this.__instanceProperties) {\n // TODO (justinfagnani): should we use the stored value? Could a new value\n // have been set since we stored the own property value?\n for (const [p, value] of this.__instanceProperties) {\n this[p as keyof this] = value as this[keyof this];\n }\n this.__instanceProperties = undefined;\n }\n // Trigger initial value reflection and populate the initial\n // `changedProperties` map, but only for the case of properties created\n // via `createProperty` on accessors, which will not have already\n // populated the `changedProperties` map since they are not set.\n // We can't know if these accessors had initializers, so we just set\n // them anyway - a difference from experimental decorators on fields and\n // standard decorators on auto-accessors.\n // For context see:\n // https://github.com/lit/lit/pull/4183#issuecomment-1711959635\n const elementProperties = (this.constructor as typeof ReactiveElement)\n .elementProperties;\n if (elementProperties.size > 0) {\n for (const [p, options] of elementProperties) {\n const {wrapped} = options;\n const value = this[p as keyof this];\n if (\n wrapped === true &&\n !this._$changedProperties.has(p) &&\n value !== undefined\n ) {\n this._$changeProperty(p, undefined, options, value);\n }\n }\n }\n }\n let shouldUpdate = false;\n const changedProperties = this._$changedProperties;\n try {\n shouldUpdate = this.shouldUpdate(changedProperties);\n if (shouldUpdate) {\n this.willUpdate(changedProperties);\n this.__controllers?.forEach((c) => c.hostUpdate?.());\n this.update(changedProperties);\n } else {\n this.__markUpdated();\n }\n } catch (e) {\n // Prevent `firstUpdated` and `updated` from running when there's an\n // update exception.\n shouldUpdate = false;\n // Ensure element can accept additional updates after an exception.\n this.__markUpdated();\n throw e;\n }\n // The update is no longer considered pending and further updates are now allowed.\n if (shouldUpdate) {\n this._$didUpdate(changedProperties);\n }\n }\n\n /**\n * Invoked before `update()` to compute values needed during the update.\n *\n * Implement `willUpdate` to compute property values that depend on other\n * properties and are used in the rest of the update process.\n *\n * ```ts\n * willUpdate(changedProperties) {\n * // only need to check changed properties for an expensive computation.\n * if (changedProperties.has('firstName') || changedProperties.has('lastName')) {\n * this.sha = computeSHA(`${this.firstName} ${this.lastName}`);\n * }\n * }\n *\n * render() {\n * return html`SHA: ${this.sha}`;\n * }\n * ```\n *\n * @category updates\n */\n protected willUpdate(_changedProperties: PropertyValues): void {}\n\n // Note, this is an override point for polyfill-support.\n // @internal\n _$didUpdate(changedProperties: PropertyValues) {\n this.__controllers?.forEach((c) => c.hostUpdated?.());\n if (!this.hasUpdated) {\n this.hasUpdated = true;\n this.firstUpdated(changedProperties);\n }\n this.updated(changedProperties);\n if (\n DEV_MODE &&\n this.isUpdatePending &&\n (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n 'change-in-update'\n )\n ) {\n issueWarning(\n 'change-in-update',\n `Element ${this.localName} scheduled an update ` +\n `(generally because a property was set) ` +\n `after an update completed, causing a new update to be scheduled. ` +\n `This is inefficient and should be avoided unless the next update ` +\n `can only be scheduled as a side effect of the previous update.`\n );\n }\n }\n\n private __markUpdated() {\n this._$changedProperties = new Map();\n this.isUpdatePending = false;\n }\n\n /**\n * Returns a Promise that resolves when the element has completed updating.\n * The Promise value is a boolean that is `true` if the element completed the\n * update without triggering another update. The Promise result is `false` if\n * a property was set inside `updated()`. If the Promise is rejected, an\n * exception was thrown during the update.\n *\n * To await additional asynchronous work, override the `getUpdateComplete`\n * method. For example, it is sometimes useful to await a rendered element\n * before fulfilling this Promise. To do this, first await\n * `super.getUpdateComplete()`, then any subsequent state.\n *\n * @return A promise of a boolean that resolves to true if the update completed\n * without triggering another update.\n * @category updates\n */\n get updateComplete(): Promise<boolean> {\n return this.getUpdateComplete();\n }\n\n /**\n * Override point for the `updateComplete` promise.\n *\n * It is not safe to override the `updateComplete` getter directly due to a\n * limitation in TypeScript which means it is not possible to call a\n * superclass getter (e.g. `super.updateComplete.then(...)`) when the target\n * language is ES5 (https://github.com/microsoft/TypeScript/issues/338).\n * This method should be overridden instead. For example:\n *\n * ```ts\n * class MyElement extends LitElement {\n * override async getUpdateComplete() {\n * const result = await super.getUpdateComplete();\n * await this._myChild.updateComplete;\n * return result;\n * }\n * }\n * ```\n *\n * @return A promise of a boolean that resolves to true if the update completed\n * without triggering another update.\n * @category updates\n */\n protected getUpdateComplete(): Promise<boolean> {\n return this.__updatePromise;\n }\n\n /**\n * Controls whether or not `update()` should be called when the element requests\n * an update. By default, this method always returns `true`, but this can be\n * customized to control when to update.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected shouldUpdate(_changedProperties: PropertyValues): boolean {\n return true;\n }\n\n /**\n * Updates the element. This method reflects property values to attributes.\n * It can be overridden to render and keep updated element DOM.\n * Setting properties inside this method will *not* trigger\n * another update.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected update(_changedProperties: PropertyValues) {\n // The forEach() expression will only run when __reflectingProperties is\n // defined, and it returns undefined, setting __reflectingProperties to\n // undefined\n this.__reflectingProperties &&= this.__reflectingProperties.forEach((p) =>\n this.__propertyToAttribute(p, this[p as keyof this])\n ) as undefined;\n this.__markUpdated();\n }\n\n /**\n * Invoked whenever the element is updated. Implement to perform\n * post-updating tasks via DOM APIs, for example, focusing an element.\n *\n * Setting properties inside this method will trigger the element to update\n * again after this update cycle completes.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected updated(_changedProperties: PropertyValues) {}\n\n /**\n * Invoked when the element is first updated. Implement to perform one time\n * work on the element after update.\n *\n * ```ts\n * firstUpdated() {\n * this.renderRoot.getElementById('my-text-area').focus();\n * }\n * ```\n *\n * Setting properties inside this method will trigger the element to update\n * again after this update cycle completes.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected firstUpdated(_changedProperties: PropertyValues) {}\n}\n// Assigned here to work around a jscompiler bug with static fields\n// when compiling to ES5.\n// https://github.com/google/closure-compiler/issues/3177\n(ReactiveElement as unknown as Record<string, unknown>)[\n JSCompiler_renameProperty('elementProperties', ReactiveElement)\n] = new Map();\n(ReactiveElement as unknown as Record<string, unknown>)[\n JSCompiler_renameProperty('finalized', ReactiveElement)\n] = new Map();\n\n// Apply polyfills if available\npolyfillSupport?.({ReactiveElement});\n\n// Dev mode warnings...\nif (DEV_MODE) {\n // Default warning set.\n ReactiveElement.enabledWarnings = [\n 'change-in-update',\n 'async-perform-update',\n ];\n const ensureOwnWarnings = function (ctor: typeof ReactiveElement) {\n if (\n !ctor.hasOwnProperty(JSCompiler_renameProperty('enabledWarnings', ctor))\n ) {\n ctor.enabledWarnings = ctor.enabledWarnings!.slice();\n }\n };\n ReactiveElement.enableWarning = function (\n this: typeof ReactiveElement,\n warning: WarningKind\n ) {\n ensureOwnWarnings(this);\n if (!this.enabledWarnings!.includes(warning)) {\n this.enabledWarnings!.push(warning);\n }\n };\n ReactiveElement.disableWarning = function (\n this: typeof ReactiveElement,\n warning: WarningKind\n ) {\n ensureOwnWarnings(this);\n const i = this.enabledWarnings!.indexOf(warning);\n if (i >= 0) {\n this.enabledWarnings!.splice(i, 1);\n }\n };\n}\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for ReactiveElement usage.\n(global.reactiveElementVersions ??= []).push('2.1.2');\nif (DEV_MODE && global.reactiveElementVersions.length > 1) {\n queueMicrotask(() => {\n issueWarning!(\n 'multiple-versions',\n `Multiple versions of Lit loaded. Loading multiple versions ` +\n `is not recommended.`\n );\n });\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n// IMPORTANT: these imports must be type-only\nimport type {Directive, DirectiveResult, PartInfo} from './directive.js';\nimport type {TrustedHTML, TrustedTypesWindow} from 'trusted-types/lib/index.js';\n\nconst DEV_MODE = true;\nconst ENABLE_EXTRA_SECURITY_HOOKS = true;\nconst ENABLE_SHADYDOM_NOPATCH = true;\nconst NODE_MODE = false;\n\n// Allows minifiers to rename references to globalThis\nconst global = globalThis;\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace LitUnstable {\n /**\n * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n * we will emit 'lit-debug' events to window, with live details about the update and render\n * lifecycle. These can be useful for writing debug tooling and visualizations.\n *\n * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n * making certain operations that are normally very cheap (like a no-op render) much slower,\n * because we must copy data and dispatch events.\n */\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace DebugLog {\n export type Entry =\n | TemplatePrep\n | TemplateInstantiated\n | TemplateInstantiatedAndUpdated\n | TemplateUpdating\n | BeginRender\n | EndRender\n | CommitPartEntry\n | SetPartValue;\n export interface TemplatePrep {\n kind: 'template prep';\n template: Template;\n strings: TemplateStringsArray;\n clonableTemplate: HTMLTemplateElement;\n parts: TemplatePart[];\n }\n export interface BeginRender {\n kind: 'begin render';\n id: number;\n value: unknown;\n container: RenderRootNode;\n options: RenderOptions | undefined;\n part: ChildPart | undefined;\n }\n export interface EndRender {\n kind: 'end render';\n id: number;\n value: unknown;\n container: RenderRootNode;\n options: RenderOptions | undefined;\n part: ChildPart;\n }\n export interface TemplateInstantiated {\n kind: 'template instantiated';\n template: Template | CompiledTemplate;\n instance: TemplateInstance;\n options: RenderOptions | undefined;\n fragment: Node;\n parts: Array<Part | undefined>;\n values: unknown[];\n }\n export interface TemplateInstantiatedAndUpdated {\n kind: 'template instantiated and updated';\n template: Template | CompiledTemplate;\n instance: TemplateInstance;\n options: RenderOptions | undefined;\n fragment: Node;\n parts: Array<Part | undefined>;\n values: unknown[];\n }\n export interface TemplateUpdating {\n kind: 'template updating';\n template: Template | CompiledTemplate;\n instance: TemplateInstance;\n options: RenderOptions | undefined;\n parts: Array<Part | undefined>;\n values: unknown[];\n }\n export interface SetPartValue {\n kind: 'set part';\n part: Part;\n value: unknown;\n valueIndex: number;\n values: unknown[];\n templateInstance: TemplateInstance;\n }\n\n export type CommitPartEntry =\n | CommitNothingToChildEntry\n | CommitText\n | CommitNode\n | CommitAttribute\n | CommitProperty\n | CommitBooleanAttribute\n | CommitEventListener\n | CommitToElementBinding;\n\n export interface CommitNothingToChildEntry {\n kind: 'commit nothing to child';\n start: ChildNode;\n end: ChildNode | null;\n parent: Disconnectable | undefined;\n options: RenderOptions | undefined;\n }\n\n export interface CommitText {\n kind: 'commit text';\n node: Text;\n value: unknown;\n options: RenderOptions | undefined;\n }\n\n export interface CommitNode {\n kind: 'commit node';\n start: Node;\n parent: Disconnectable | undefined;\n value: Node;\n options: RenderOptions | undefined;\n }\n\n export interface CommitAttribute {\n kind: 'commit attribute';\n element: Element;\n name: string;\n value: unknown;\n options: RenderOptions | undefined;\n }\n\n export interface CommitProperty {\n kind: 'commit property';\n element: Element;\n name: string;\n value: unknown;\n options: RenderOptions | undefined;\n }\n\n export interface CommitBooleanAttribute {\n kind: 'commit boolean attribute';\n element: Element;\n name: string;\n value: boolean;\n options: RenderOptions | undefined;\n }\n\n export interface CommitEventListener {\n kind: 'commit event listener';\n element: Element;\n name: string;\n value: unknown;\n oldListener: unknown;\n options: RenderOptions | undefined;\n // True if we're removing the old event listener (e.g. because settings changed, or value is nothing)\n removeListener: boolean;\n // True if we're adding a new event listener (e.g. because first render, or settings changed)\n addListener: boolean;\n }\n\n export interface CommitToElementBinding {\n kind: 'commit to element binding';\n element: Element;\n value: unknown;\n options: RenderOptions | undefined;\n }\n }\n}\n\ninterface DebugLoggingWindow {\n // Even in dev mode, we generally don't want to emit these events, as that's\n // another level of cost, so only emit them when DEV_MODE is true _and_ when\n // window.emitLitDebugEvents is true.\n emitLitDebugLogEvents?: boolean;\n}\n\n/**\n * Useful for visualizing and logging insights into what the Lit template system is doing.\n *\n * Compiled out of prod mode builds.\n */\nconst debugLogEvent = DEV_MODE\n ? (event: LitUnstable.DebugLog.Entry) => {\n const shouldEmit = (global as unknown as DebugLoggingWindow)\n .emitLitDebugLogEvents;\n if (!shouldEmit) {\n return;\n }\n global.dispatchEvent(\n new CustomEvent<LitUnstable.DebugLog.Entry>('lit-debug', {\n detail: event,\n })\n );\n }\n : undefined;\n// Used for connecting beginRender and endRender events when there are nested\n// renders when errors are thrown preventing an endRender event from being\n// called.\nlet debugLogRenderId = 0;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n global.litIssuedWarnings ??= new Set();\n\n /**\n * Issue a warning if we haven't already, based either on `code` or `warning`.\n * Warnings are disabled automatically only by `warning`; disabling via `code`\n * can be done by users.\n */\n issueWarning = (code: string, warning: string) => {\n warning += code\n ? ` See https://lit.dev/msg/${code} for more information.`\n : '';\n if (\n !global.litIssuedWarnings!.has(warning) &&\n !global.litIssuedWarnings!.has(code)\n ) {\n console.warn(warning);\n global.litIssuedWarnings!.add(warning);\n }\n };\n\n queueMicrotask(() => {\n issueWarning(\n 'dev-mode',\n `Lit is in dev mode. Not recommended for production!`\n );\n });\n}\n\nconst wrap =\n ENABLE_SHADYDOM_NOPATCH &&\n global.ShadyDOM?.inUse &&\n global.ShadyDOM?.noPatch === true\n ? (global.ShadyDOM!.wrap as <T extends Node>(node: T) => T)\n : <T extends Node>(node: T) => node;\n\nconst trustedTypes = (global as unknown as TrustedTypesWindow).trustedTypes;\n\n/**\n * Our TrustedTypePolicy for HTML which is declared using the html template\n * tag function.\n *\n * That HTML is a developer-authored constant, and is parsed with innerHTML\n * before any untrusted expressions have been mixed in. Therefor it is\n * considered safe by construction.\n */\nconst policy = trustedTypes\n ? trustedTypes.createPolicy('lit-html', {\n createHTML: (s) => s,\n })\n : undefined;\n\n/**\n * Used to sanitize any value before it is written into the DOM. This can be\n * used to implement a security policy of allowed and disallowed values in\n * order to prevent XSS attacks.\n *\n * One way of using this callback would be to check attributes and properties\n * against a list of high risk fields, and require that values written to such\n * fields be instances of a class which is safe by construction. Closure's Safe\n * HTML Types is one implementation of this technique (\n * https://github.com/google/safe-html-types/blob/master/doc/safehtml-types.md).\n * The TrustedTypes polyfill in API-only mode could also be used as a basis\n * for this technique (https://github.com/WICG/trusted-types).\n *\n * @param node The HTML node (usually either a #text node or an Element) that\n * is being written to. Note that this is just an exemplar node, the write\n * may take place against another instance of the same class of node.\n * @param name The name of an attribute or property (for example, 'href').\n * @param type Indicates whether the write that's about to be performed will\n * be to a property or a node.\n * @return A function that will sanitize this class of writes.\n */\nexport type SanitizerFactory = (\n node: Node,\n name: string,\n type: 'property' | 'attribute'\n) => ValueSanitizer;\n\n/**\n * A function which can sanitize values that will be written to a specific kind\n * of DOM sink.\n *\n * See SanitizerFactory.\n *\n * @param value The value to sanitize. Will be the actual value passed into\n * the lit-html template literal, so this could be of any type.\n * @return The value to write to the DOM. Usually the same as the input value,\n * unless sanitization is needed.\n */\nexport type ValueSanitizer = (value: unknown) => unknown;\n\nconst identityFunction: ValueSanitizer = (value: unknown) => value;\nconst noopSanitizer: SanitizerFactory = (\n _node: Node,\n _name: string,\n _type: 'property' | 'attribute'\n) => identityFunction;\n\n/** Sets the global sanitizer factory. */\nconst setSanitizer = (newSanitizer: SanitizerFactory) => {\n if (!ENABLE_EXTRA_SECURITY_HOOKS) {\n return;\n }\n if (sanitizerFactoryInternal !== noopSanitizer) {\n throw new Error(\n `Attempted to overwrite existing lit-html security policy.` +\n ` setSanitizeDOMValueFactory should be called at most once.`\n );\n }\n sanitizerFactoryInternal = newSanitizer;\n};\n\n/**\n * Only used in internal tests, not a part of the public API.\n */\nconst _testOnlyClearSanitizerFactoryDoNotCallOrElse = () => {\n sanitizerFactoryInternal = noopSanitizer;\n};\n\nconst createSanitizer: SanitizerFactory = (node, name, type) => {\n return sanitizerFactoryInternal(node, name, type);\n};\n\n// Added to an attribute name to mark the attribute as bound so we can find\n// it easily.\nconst boundAttributeSuffix = '$lit$';\n\n// This marker is used in many syntactic positions in HTML, so it must be\n// a valid element name and attribute name. We don't support dynamic names (yet)\n// but this at least ensures that the parse tree is closer to the template\n// intention.\nconst marker = `lit$${Math.random().toFixed(9).slice(2)}$`;\n\n// String used to tell if a comment is a marker comment\nconst markerMatch = '?' + marker;\n\n// Text used to insert a comment marker node. We use processing instruction\n// syntax because it's slightly smaller, but parses as a comment node.\nconst nodeMarker = `<${markerMatch}>`;\n\nconst d =\n NODE_MODE && global.document === undefined\n ? ({\n createTreeWalker() {\n return {};\n },\n } as unknown as Document)\n : document;\n\n// Creates a dynamic marker. We never have to search for these in the DOM.\nconst createMarker = () => d.createComment('');\n\n// https://tc39.github.io/ecma262/#sec-typeof-operator\ntype Primitive = null | undefined | boolean | number | string | symbol | bigint;\nconst isPrimitive = (value: unknown): value is Primitive =>\n value === null || (typeof value != 'object' && typeof value != 'function');\nconst isArray = Array.isArray;\nconst isIterable = (value: unknown): value is Iterable<unknown> =>\n isArray(value) ||\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n typeof (value as any)?.[Symbol.iterator] === 'function';\n\nconst SPACE_CHAR = `[ \\t\\n\\f\\r]`;\nconst ATTR_VALUE_CHAR = `[^ \\t\\n\\f\\r\"'\\`<>=]`;\nconst NAME_CHAR = `[^\\\\s\"'>=/]`;\n\n// These regexes represent the five parsing states that we care about in the\n// Template's HTML scanner. They match the *end* of the state they're named\n// after.\n// Depending on the match, we transition to a new state. If there's no match,\n// we stay in the same state.\n// Note that the regexes are stateful. We utilize lastIndex and sync it\n// across the multiple regexes used. In addition to the five regexes below\n// we also dynamically create a regex to find the matching end tags for raw\n// text elements.\n\n/**\n * End of text is: `<` followed by:\n * (comment start) or (tag) or (dynamic tag binding)\n */\nconst textEndRegex = /<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g;\nconst COMMENT_START = 1;\nconst TAG_NAME = 2;\nconst DYNAMIC_TAG_NAME = 3;\n\nconst commentEndRegex = /-->/g;\n/**\n * Comments not started with <!--, like </{, can be ended by a single `>`\n */\nconst comment2EndRegex = />/g;\n\n/**\n * The tagEnd regex matches the end of the \"inside an opening\" tag syntax\n * position. It either matches a `>`, an attribute-like sequence, or the end\n * of the string after a space (attribute-name position ending).\n *\n * See attributes in the HTML spec:\n * https://www.w3.org/TR/html5/syntax.html#elements-attributes\n *\n * \" \\t\\n\\f\\r\" are HTML space characters:\n * https://infra.spec.whatwg.org/#ascii-whitespace\n *\n * So an attribute is:\n * * The name: any character except a whitespace character, (\"), ('), \">\",\n * \"=\", or \"/\". Note: this is different from the HTML spec which also excludes control characters.\n * * Followed by zero or more space characters\n * * Followed by \"=\"\n * * Followed by zero or more space characters\n * * Followed by:\n * * Any character except space, ('), (\"), \"<\", \">\", \"=\", (`), or\n * * (\") then any non-(\"), or\n * * (') then any non-(')\n */\nconst tagEndRegex = new RegExp(\n `>|${SPACE_CHAR}(?:(${NAME_CHAR}+)(${SPACE_CHAR}*=${SPACE_CHAR}*(?:${ATTR_VALUE_CHAR}|(\"|')|))|$)`,\n 'g'\n);\nconst ENTIRE_MATCH = 0;\nconst ATTRIBUTE_NAME = 1;\nconst SPACES_AND_EQUALS = 2;\nconst QUOTE_CHAR = 3;\n\nconst singleQuoteAttrEndRegex = /'/g;\nconst doubleQuoteAttrEndRegex = /\"/g;\n/**\n * Matches the raw text elements.\n *\n * Comments are not parsed within raw text elements, so we need to search their\n * text content for marker strings.\n */\nconst rawTextElement = /^(?:script|style|textarea|title)$/i;\n\n/** TemplateResult types */\nconst HTML_RESULT = 1;\nconst SVG_RESULT = 2;\nconst MATHML_RESULT = 3;\n\ntype ResultType = typeof HTML_RESULT | typeof SVG_RESULT | typeof MATHML_RESULT;\n\n// TemplatePart types\n// IMPORTANT: these must match the values in PartType\nconst ATTRIBUTE_PART = 1;\nconst CHILD_PART = 2;\nconst PROPERTY_PART = 3;\nconst BOOLEAN_ATTRIBUTE_PART = 4;\nconst EVENT_PART = 5;\nconst ELEMENT_PART = 6;\nconst COMMENT_PART = 7;\n\n/**\n * The return type of the template tag functions, {@linkcode html} and\n * {@linkcode svg} when it hasn't been compiled by @lit-labs/compiler.\n *\n * A `TemplateResult` object holds all the information about a template\n * expression required to render it: the template strings, expression values,\n * and type of template (html or svg).\n *\n * `TemplateResult` objects do not create any DOM on their own. To create or\n * update DOM you need to render the `TemplateResult`. See\n * [Rendering](https://lit.dev/docs/components/rendering) for more information.\n *\n */\nexport type UncompiledTemplateResult<T extends ResultType = ResultType> = {\n // This property needs to remain unminified.\n ['_$litType$']: T;\n strings: TemplateStringsArray;\n values: unknown[];\n};\n\n/**\n * This is a template result that may be either uncompiled or compiled.\n *\n * In the future, TemplateResult will be this type. If you want to explicitly\n * note that a template result is potentially compiled, you can reference this\n * type and it will continue to behave the same through the next major version\n * of Lit. This can be useful for code that wants to prepare for the next\n * major version of Lit.\n */\nexport type MaybeCompiledTemplateResult<T extends ResultType = ResultType> =\n | UncompiledTemplateResult<T>\n | CompiledTemplateResult;\n\n/**\n * The return type of the template tag functions, {@linkcode html} and\n * {@linkcode svg}.\n *\n * A `TemplateResult` object holds all the information about a template\n * expression required to render it: the template strings, expression values,\n * and type of template (html or svg).\n *\n * `TemplateResult` objects do not create any DOM on their own. To create or\n * update DOM you need to render the `TemplateResult`. See\n * [Rendering](https://lit.dev/docs/components/rendering) for more information.\n *\n * In Lit 4, this type will be an alias of\n * MaybeCompiledTemplateResult, so that code will get type errors if it assumes\n * that Lit templates are not compiled. When deliberately working with only\n * one, use either {@linkcode CompiledTemplateResult} or\n * {@linkcode UncompiledTemplateResult} explicitly.\n */\nexport type TemplateResult<T extends ResultType = ResultType> =\n UncompiledTemplateResult<T>;\n\nexport type HTMLTemplateResult = TemplateResult<typeof HTML_RESULT>;\n\nexport type SVGTemplateResult = TemplateResult<typeof SVG_RESULT>;\n\nexport type MathMLTemplateResult = TemplateResult<typeof MATHML_RESULT>;\n\n/**\n * A TemplateResult that has been compiled by @lit-labs/compiler, skipping the\n * prepare step.\n */\nexport interface CompiledTemplateResult {\n // This is a factory in order to make template initialization lazy\n // and allow ShadyRenderOptions scope to be passed in.\n // This property needs to remain unminified.\n ['_$litType$']: CompiledTemplate;\n values: unknown[];\n}\n\nexport interface CompiledTemplate extends Omit<Template, 'el'> {\n // el is overridden to be optional. We initialize it on first render\n el?: HTMLTemplateElement;\n\n // The prepared HTML string to create a template element from.\n // The type is a TemplateStringsArray to guarantee that the value came from\n // source code, preventing a JSON injection attack.\n h: TemplateStringsArray;\n}\n\n/**\n * Generates a template literal tag function that returns a TemplateResult with\n * the given result type.\n */\nconst tag =\n <T extends ResultType>(type: T) =>\n (strings: TemplateStringsArray, ...values: unknown[]): TemplateResult<T> => {\n // Warn against templates octal escape sequences\n // We do this here rather than in render so that the warning is closer to the\n // template definition.\n if (DEV_MODE && strings.some((s) => s === undefined)) {\n console.warn(\n 'Some template strings are undefined.\\n' +\n 'This is probably caused by illegal octal escape sequences.'\n );\n }\n if (DEV_MODE) {\n // Import static-html.js results in a circular dependency which g3 doesn't\n // handle. Instead we know that static values must have the field\n // `_$litStatic$`.\n if (\n values.some((val) => (val as {_$litStatic$: unknown})?.['_$litStatic$'])\n ) {\n issueWarning(\n '',\n `Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.\\n` +\n `Please use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions`\n );\n }\n }\n return {\n // This property needs to remain unminified.\n ['_$litType$']: type,\n strings,\n values,\n };\n };\n\n/**\n * Interprets a template literal as an HTML template that can efficiently\n * render to and update a container.\n *\n * ```ts\n * const header = (title: string) => html`<h1>${title}</h1>`;\n * ```\n *\n * The `html` tag returns a description of the DOM to render as a value. It is\n * lazy, meaning no work is done until the template is rendered. When rendering,\n * if a template comes from the same expression as a previously rendered result,\n * it's efficiently updated instead of replaced.\n */\nexport const html = tag(HTML_RESULT);\n\n/**\n * Interprets a template literal as an SVG fragment that can efficiently render\n * to and update a container.\n *\n * ```ts\n * const rect = svg`<rect width=\"10\" height=\"10\"></rect>`;\n *\n * const myImage = html`\n * <svg viewBox=\"0 0 10 10\" xmlns=\"http://www.w3.org/2000/svg\">\n * ${rect}\n * </svg>`;\n * ```\n *\n * The `svg` *tag function* should only be used for SVG fragments, or elements\n * that would be contained **inside** an `<svg>` HTML element. A common error is\n * placing an `<svg>` *element* in a template tagged with the `svg` tag\n * function. The `<svg>` element is an HTML element and should be used within a\n * template tagged with the {@linkcode html} tag function.\n *\n * In LitElement usage, it's invalid to return an SVG fragment from the\n * `render()` method, as the SVG fragment will be contained within the element's\n * shadow root and thus not be properly contained within an `<svg>` HTML\n * element.\n */\nexport const svg = tag(SVG_RESULT);\n\n/**\n * Interprets a template literal as MathML fragment that can efficiently render\n * to and update a container.\n *\n * ```ts\n * const num = mathml`<mn>1</mn>`;\n *\n * const eq = html`\n * <math>\n * ${num}\n * </math>`;\n * ```\n *\n * The `mathml` *tag function* should only be used for MathML fragments, or\n * elements that would be contained **inside** a `<math>` HTML element. A common\n * error is placing a `<math>` *element* in a template tagged with the `mathml`\n * tag function. The `<math>` element is an HTML element and should be used\n * within a template tagged with the {@linkcode html} tag function.\n *\n * In LitElement usage, it's invalid to return an MathML fragment from the\n * `render()` method, as the MathML fragment will be contained within the\n * element's shadow root and thus not be properly contained within a `<math>`\n * HTML element.\n */\nexport const mathml = tag(MATHML_RESULT);\n\n/**\n * A sentinel value that signals that a value was handled by a directive and\n * should not be written to the DOM.\n */\nexport const noChange = Symbol.for('lit-noChange');\n\n/**\n * A sentinel value that signals a ChildPart to fully clear its content.\n *\n * ```ts\n * const button = html`${\n * user.isAdmin\n * ? html`<button>DELETE</button>`\n * : nothing\n * }`;\n * ```\n *\n * Prefer using `nothing` over other falsy values as it provides a consistent\n * behavior between various expression binding contexts.\n *\n * In child expressions, `undefined`, `null`, `''`, and `nothing` all behave the\n * same and render no nodes. In attribute expressions, `nothing` _removes_ the\n * attribute, while `undefined` and `null` will render an empty string. In\n * property expressions `nothing` becomes `undefined`.\n */\nexport const nothing = Symbol.for('lit-nothing');\n\n/**\n * The cache of prepared templates, keyed by the tagged TemplateStringsArray\n * and _not_ accounting for the specific template tag used. This means that\n * template tags cannot be dynamic - they must statically be one of html, svg,\n * or attr. This restriction simplifies the cache lookup, which is on the hot\n * path for rendering.\n */\nconst templateCache = new WeakMap<TemplateStringsArray, Template>();\n\n/**\n * Object specifying options for controlling lit-html rendering. Note that\n * while `render` may be called multiple times on the same `container` (and\n * `renderBefore` reference node) to efficiently update the rendered content,\n * only the options passed in during the first render are respected during\n * the lifetime of renders to that unique `container` + `renderBefore`\n * combination.\n */\nexport interface RenderOptions {\n /**\n * An object to use as the `this` value for event listeners. It's often\n * useful to set this to the host component rendering a template.\n */\n host?: object;\n /**\n * A DOM node before which to render content in the container.\n */\n renderBefore?: ChildNode | null;\n /**\n * Node used for cloning the template (`importNode` will be called on this\n * node). This controls the `ownerDocument` of the rendered DOM, along with\n * any inherited context. Defaults to the global `document`.\n */\n creationScope?: {importNode(node: Node, deep?: boolean): Node};\n /**\n * The initial connected state for the top-level part being rendered. If no\n * `isConnected` option is set, `AsyncDirective`s will be connected by\n * default. Set to `false` if the initial render occurs in a disconnected tree\n * and `AsyncDirective`s should see `isConnected === false` for their initial\n * render. The `part.setConnected()` method must be used subsequent to initial\n * render to change the connected state of the part.\n */\n isConnected?: boolean;\n}\n\n/**\n * The root DOM node for rendering.\n */\nexport type RenderRootNode = HTMLElement | SVGElement | DocumentFragment;\n\nconst walker = d.createTreeWalker(\n d,\n 129 /* NodeFilter.SHOW_{ELEMENT|COMMENT} */\n);\n\nlet sanitizerFactoryInternal: SanitizerFactory = noopSanitizer;\n\n//\n// Classes only below here, const variable declarations only above here...\n//\n// Keeping variable declarations and classes together improves minification.\n// Interfaces and type aliases can be interleaved freely.\n//\n\n// Type for classes that have a `_directive` or `_directives[]` field, used by\n// `resolveDirective`\nexport interface DirectiveParent {\n _$parent?: DirectiveParent;\n _$isConnected: boolean;\n __directive?: Directive;\n __directives?: Array<Directive | undefined>;\n}\n\nfunction trustFromTemplateString(\n tsa: TemplateStringsArray,\n stringFromTSA: string\n): TrustedHTML {\n // A security check to prevent spoofing of Lit template results.\n // In the future, we may be able to replace this with Array.isTemplateObject,\n // though we might need to make that check inside of the html and svg\n // functions, because precompiled templates don't come in as\n // TemplateStringArray objects.\n if (!isArray(tsa) || !tsa.hasOwnProperty('raw')) {\n let message = 'invalid template strings array';\n if (DEV_MODE) {\n message = `\n Internal Error: expected template strings to be an array\n with a 'raw' field. Faking a template strings array by\n calling html or svg like an ordinary function is effectively\n the same as calling unsafeHtml and can lead to major security\n issues, e.g. opening your code up to XSS attacks.\n If you're using the html or svg tagged template functions normally\n and still seeing this error, please file a bug at\n https://github.com/lit/lit/issues/new?template=bug_report.md\n and include information about your build tooling, if any.\n `\n .trim()\n .replace(/\\n */g, '\\n');\n }\n throw new Error(message);\n }\n return policy !== undefined\n ? policy.createHTML(stringFromTSA)\n : (stringFromTSA as unknown as TrustedHTML);\n}\n\n/**\n * Returns an HTML string for the given TemplateStringsArray and result type\n * (HTML or SVG), along with the case-sensitive bound attribute names in\n * template order. The HTML contains comment markers denoting the `ChildPart`s\n * and suffixes on bound attributes denoting the `AttributeParts`.\n *\n * @param strings template strings array\n * @param type HTML or SVG\n * @return Array containing `[html, attrNames]` (array returned for terseness,\n * to avoid object fields since this code is shared with non-minified SSR\n * code)\n */\nconst getTemplateHtml = (\n strings: TemplateStringsArray,\n type: ResultType\n): [TrustedHTML, Array<string>] => {\n // Insert makers into the template HTML to represent the position of\n // bindings. The following code scans the template strings to determine the\n // syntactic position of the bindings. They can be in text position, where\n // we insert an HTML comment, attribute value position, where we insert a\n // sentinel string and re-write the attribute name, or inside a tag where\n // we insert the sentinel string.\n const l = strings.length - 1;\n // Stores the case-sensitive bound attribute names in the order of their\n // parts. ElementParts are also reflected in this array as undefined\n // rather than a string, to disambiguate from attribute bindings.\n const attrNames: Array<string> = [];\n let html =\n type === SVG_RESULT ? '<svg>' : type === MATHML_RESULT ? '<math>' : '';\n\n // When we're inside a raw text tag (not it's text content), the regex\n // will still be tagRegex so we can find attributes, but will switch to\n // this regex when the tag ends.\n let rawTextEndRegex: RegExp | undefined;\n\n // The current parsing state, represented as a reference to one of the\n // regexes\n let regex = textEndRegex;\n\n for (let i = 0; i < l; i++) {\n const s = strings[i];\n // The index of the end of the last attribute name. When this is\n // positive at end of a string, it means we're in an attribute value\n // position and need to rewrite the attribute name.\n // We also use a special value of -2 to indicate that we encountered\n // the end of a string in attribute name position.\n let attrNameEndIndex = -1;\n let attrName: string | undefined;\n let lastIndex = 0;\n let match!: RegExpExecArray | null;\n\n // The conditions in this loop handle the current parse state, and the\n // assignments to the `regex` variable are the state transitions.\n while (lastIndex < s.length) {\n // Make sure we start searching from where we previously left off\n regex.lastIndex = lastIndex;\n match = regex.exec(s);\n if (match === null) {\n break;\n }\n lastIndex = regex.lastIndex;\n if (regex === textEndRegex) {\n if (match[COMMENT_START] === '!--') {\n regex = commentEndRegex;\n } else if (match[COMMENT_START] !== undefined) {\n // We started a weird comment, like </{\n regex = comment2EndRegex;\n } else if (match[TAG_NAME] !== undefined) {\n if (rawTextElement.test(match[TAG_NAME])) {\n // Record if we encounter a raw-text element. We'll switch to\n // this regex at the end of the tag.\n rawTextEndRegex = new RegExp(`</${match[TAG_NAME]}`, 'g');\n }\n regex = tagEndRegex;\n } else if (match[DYNAMIC_TAG_NAME] !== undefined) {\n if (DEV_MODE) {\n throw new Error(\n 'Bindings in tag names are not supported. Please use static templates instead. ' +\n 'See https://lit.dev/docs/templates/expressions/#static-expressions'\n );\n }\n regex = tagEndRegex;\n }\n } else if (regex === tagEndRegex) {\n if (match[ENTIRE_MATCH] === '>') {\n // End of a tag. If we had started a raw-text element, use that\n // regex\n regex = rawTextEndRegex ?? textEndRegex;\n // We may be ending an unquoted attribute value, so make sure we\n // clear any pending attrNameEndIndex\n attrNameEndIndex = -1;\n } else if (match[ATTRIBUTE_NAME] === undefined) {\n // Attribute name position\n attrNameEndIndex = -2;\n } else {\n attrNameEndIndex = regex.lastIndex - match[SPACES_AND_EQUALS].length;\n attrName = match[ATTRIBUTE_NAME];\n regex =\n match[QUOTE_CHAR] === undefined\n ? tagEndRegex\n : match[QUOTE_CHAR] === '\"'\n ? doubleQuoteAttrEndRegex\n : singleQuoteAttrEndRegex;\n }\n } else if (\n regex === doubleQuoteAttrEndRegex ||\n regex === singleQuoteAttrEndRegex\n ) {\n regex = tagEndRegex;\n } else if (regex === commentEndRegex || regex === comment2EndRegex) {\n regex = textEndRegex;\n } else {\n // Not one of the five state regexes, so it must be the dynamically\n // created raw text regex and we're at the close of that element.\n regex = tagEndRegex;\n rawTextEndRegex = undefined;\n }\n }\n\n if (DEV_MODE) {\n // If we have a attrNameEndIndex, which indicates that we should\n // rewrite the attribute name, assert that we're in a valid attribute\n // position - either in a tag, or a quoted attribute value.\n console.assert(\n attrNameEndIndex === -1 ||\n regex === tagEndRegex ||\n regex === singleQuoteAttrEndRegex ||\n regex === doubleQuoteAttrEndRegex,\n 'unexpected parse state B'\n );\n }\n\n // We have four cases:\n // 1. We're in text position, and not in a raw text element\n // (regex === textEndRegex): insert a comment marker.\n // 2. We have a non-negative attrNameEndIndex which means we need to\n // rewrite the attribute name to add a bound attribute suffix.\n // 3. We're at the non-first binding in a multi-binding attribute, use a\n // plain marker.\n // 4. We're somewhere else inside the tag. If we're in attribute name\n // position (attrNameEndIndex === -2), add a sequential suffix to\n // generate a unique attribute name.\n\n // Detect a binding next to self-closing tag end and insert a space to\n // separate the marker from the tag end:\n const end =\n regex === tagEndRegex && strings[i + 1].startsWith('/>') ? ' ' : '';\n html +=\n regex === textEndRegex\n ? s + nodeMarker\n : attrNameEndIndex >= 0\n ? (attrNames.push(attrName!),\n s.slice(0, attrNameEndIndex) +\n boundAttributeSuffix +\n s.slice(attrNameEndIndex)) +\n marker +\n end\n : s + marker + (attrNameEndIndex === -2 ? i : end);\n }\n\n const htmlResult: string | TrustedHTML =\n html +\n (strings[l] || '<?>') +\n (type === SVG_RESULT ? '</svg>' : type === MATHML_RESULT ? '</math>' : '');\n\n // Returned as an array for terseness\n return [trustFromTemplateString(strings, htmlResult), attrNames];\n};\n\n/** @internal */\nexport type {Template};\nclass Template {\n /** @internal */\n el!: HTMLTemplateElement;\n\n parts: Array<TemplatePart> = [];\n\n constructor(\n // This property needs to remain unminified.\n {strings, ['_$litType$']: type}: UncompiledTemplateResult,\n options?: RenderOptions\n ) {\n let node: Node | null;\n let nodeIndex = 0;\n let attrNameIndex = 0;\n const partCount = strings.length - 1;\n const parts = this.parts;\n\n // Create template element\n const [html, attrNames] = getTemplateHtml(strings, type);\n this.el = Template.createElement(html, options);\n walker.currentNode = this.el.content;\n\n // Re-parent SVG or MathML nodes into template root\n if (type === SVG_RESULT || type === MATHML_RESULT) {\n const wrapper = this.el.content.firstChild!;\n wrapper.replaceWith(...wrapper.childNodes);\n }\n\n // Walk the template to find binding markers and create TemplateParts\n while ((node = walker.nextNode()) !== null && parts.length < partCount) {\n if (node.nodeType === 1) {\n if (DEV_MODE) {\n const tag = (node as Element).localName;\n // Warn if `textarea` includes an expression and throw if `template`\n // does since these are not supported. We do this by checking\n // innerHTML for anything that looks like a marker. This catches\n // cases like bindings in textarea there markers turn into text nodes.\n if (\n /^(?:textarea|template)$/i!.test(tag) &&\n (node as Element).innerHTML.includes(marker)\n ) {\n const m =\n `Expressions are not supported inside \\`${tag}\\` ` +\n `elements. See https://lit.dev/msg/expression-in-${tag} for more ` +\n `information.`;\n if (tag === 'template') {\n throw new Error(m);\n } else issueWarning('', m);\n }\n }\n // TODO (justinfagnani): for attempted dynamic tag names, we don't\n // increment the bindingIndex, and it'll be off by 1 in the element\n // and off by two after it.\n if ((node as Element).hasAttributes()) {\n for (const name of (node as Element).getAttributeNames()) {\n if (name.endsWith(boundAttributeSuffix)) {\n const realName = attrNames[attrNameIndex++];\n const value = (node as Element).getAttribute(name)!;\n const statics = value.split(marker);\n const m = /([.?@])?(.*)/.exec(realName)!;\n parts.push({\n type: ATTRIBUTE_PART,\n index: nodeIndex,\n name: m[2],\n strings: statics,\n ctor:\n m[1] === '.'\n ? PropertyPart\n : m[1] === '?'\n ? BooleanAttributePart\n : m[1] === '@'\n ? EventPart\n : AttributePart,\n });\n (node as Element).removeAttribute(name);\n } else if (name.startsWith(marker)) {\n parts.push({\n type: ELEMENT_PART,\n index: nodeIndex,\n });\n (node as Element).removeAttribute(name);\n }\n }\n }\n // TODO (justinfagnani): benchmark the regex against testing for each\n // of the 3 raw text element names.\n if (rawTextElement.test((node as Element).tagName)) {\n // For raw text elements we need to split the text content on\n // markers, create a Text node for each segment, and create\n // a TemplatePart for each marker.\n const strings = (node as Element).textContent!.split(marker);\n const lastIndex = strings.length - 1;\n if (lastIndex > 0) {\n (node as Element).textContent = trustedTypes\n ? (trustedTypes.emptyScript as unknown as '')\n : '';\n // Generate a new text node for each literal section\n // These nodes are also used as the markers for child parts\n for (let i = 0; i < lastIndex; i++) {\n (node as Element).append(strings[i], createMarker());\n // Walk past the marker node we just added\n walker.nextNode();\n parts.push({type: CHILD_PART, index: ++nodeIndex});\n }\n // Note because this marker is added after the walker's current\n // node, it will be walked to in the outer loop (and ignored), so\n // we don't need to adjust nodeIndex here\n (node as Element).append(strings[lastIndex], createMarker());\n }\n }\n } else if (node.nodeType === 8) {\n const data = (node as Comment).data;\n if (data === markerMatch) {\n parts.push({type: CHILD_PART, index: nodeIndex});\n } else {\n let i = -1;\n while ((i = (node as Comment).data.indexOf(marker, i + 1)) !== -1) {\n // Comment node has a binding marker inside, make an inactive part\n // The binding won't work, but subsequent bindings will\n parts.push({type: COMMENT_PART, index: nodeIndex});\n // Move to the end of the match\n i += marker.length - 1;\n }\n }\n }\n nodeIndex++;\n }\n\n if (DEV_MODE) {\n // If there was a duplicate attribute on a tag, then when the tag is\n // parsed into an element the attribute gets de-duplicated. We can detect\n // this mismatch if we haven't precisely consumed every attribute name\n // when preparing the template. This works because `attrNames` is built\n // from the template string and `attrNameIndex` comes from processing the\n // resulting DOM.\n if (attrNames.length !== attrNameIndex) {\n throw new Error(\n `Detected duplicate attribute bindings. This occurs if your template ` +\n `has duplicate attributes on an element tag. For example ` +\n `\"<input ?disabled=\\${true} ?disabled=\\${false}>\" contains a ` +\n `duplicate \"disabled\" attribute. The error was detected in ` +\n `the following template: \\n` +\n '`' +\n strings.join('${...}') +\n '`'\n );\n }\n }\n\n // We could set walker.currentNode to another node here to prevent a memory\n // leak, but every time we prepare a template, we immediately render it\n // and re-use the walker in new TemplateInstance._clone().\n debugLogEvent &&\n debugLogEvent({\n kind: 'template prep',\n template: this,\n clonableTemplate: this.el,\n parts: this.parts,\n strings,\n });\n }\n\n // Overridden via `litHtmlPolyfillSupport` to provide platform support.\n /** @nocollapse */\n static createElement(html: TrustedHTML, _options?: RenderOptions) {\n const el = d.createElement('template');\n el.innerHTML = html as unknown as string;\n return el;\n }\n}\n\nexport interface Disconnectable {\n _$parent?: Disconnectable;\n _$disconnectableChildren?: Set<Disconnectable>;\n // Rather than hold connection state on instances, Disconnectables recursively\n // fetch the connection state from the RootPart they are connected in via\n // getters up the Disconnectable tree via _$parent references. This pushes the\n // cost of tracking the isConnected state to `AsyncDirectives`, and avoids\n // needing to pass all Disconnectables (parts, template instances, and\n // directives) their connection state each time it changes, which would be\n // costly for trees that have no AsyncDirectives.\n _$isConnected: boolean;\n}\n\nfunction resolveDirective(\n part: ChildPart | AttributePart | ElementPart,\n value: unknown,\n parent: DirectiveParent = part,\n attributeIndex?: number\n): unknown {\n // Bail early if the value is explicitly noChange. Note, this means any\n // nested directive is still attached and is not run.\n if (value === noChange) {\n return value;\n }\n let currentDirective =\n attributeIndex !== undefined\n ? (parent as AttributePart).__directives?.[attributeIndex]\n : (parent as ChildPart | ElementPart | Directive).__directive;\n const nextDirectiveConstructor = isPrimitive(value)\n ? undefined\n : // This property needs to remain unminified.\n (value as DirectiveResult)['_$litDirective$'];\n if (currentDirective?.constructor !== nextDirectiveConstructor) {\n // This property needs to remain unminified.\n currentDirective?.['_$notifyDirectiveConnectionChanged']?.(false);\n if (nextDirectiveConstructor === undefined) {\n currentDirective = undefined;\n } else {\n currentDirective = new nextDirectiveConstructor(part as PartInfo);\n currentDirective._$initialize(part, parent, attributeIndex);\n }\n if (attributeIndex !== undefined) {\n ((parent as AttributePart).__directives ??= [])[attributeIndex] =\n currentDirective;\n } else {\n (parent as ChildPart | Directive).__directive = currentDirective;\n }\n }\n if (currentDirective !== undefined) {\n value = resolveDirective(\n part,\n currentDirective._$resolve(part, (value as DirectiveResult).values),\n currentDirective,\n attributeIndex\n );\n }\n return value;\n}\n\nexport type {TemplateInstance};\n/**\n * An updateable instance of a Template. Holds references to the Parts used to\n * update the template instance.\n */\nclass TemplateInstance implements Disconnectable {\n _$template: Template;\n _$parts: Array<Part | undefined> = [];\n\n /** @internal */\n _$parent: ChildPart;\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n constructor(template: Template, parent: ChildPart) {\n this._$template = template;\n this._$parent = parent;\n }\n\n // Called by ChildPart parentNode getter\n get parentNode() {\n return this._$parent.parentNode;\n }\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n // This method is separate from the constructor because we need to return a\n // DocumentFragment and we don't want to hold onto it with an instance field.\n _clone(options: RenderOptions | undefined) {\n const {\n el: {content},\n parts: parts,\n } = this._$template;\n const fragment = (options?.creationScope ?? d).importNode(content, true);\n walker.currentNode = fragment;\n\n let node = walker.nextNode()!;\n let nodeIndex = 0;\n let partIndex = 0;\n let templatePart = parts[0];\n\n while (templatePart !== undefined) {\n if (nodeIndex === templatePart.index) {\n let part: Part | undefined;\n if (templatePart.type === CHILD_PART) {\n part = new ChildPart(\n node as HTMLElement,\n node.nextSibling,\n this,\n options\n );\n } else if (templatePart.type === ATTRIBUTE_PART) {\n part = new templatePart.ctor(\n node as HTMLElement,\n templatePart.name,\n templatePart.strings,\n this,\n options\n );\n } else if (templatePart.type === ELEMENT_PART) {\n part = new ElementPart(node as HTMLElement, this, options);\n }\n this._$parts.push(part);\n templatePart = parts[++partIndex];\n }\n if (nodeIndex !== templatePart?.index) {\n node = walker.nextNode()!;\n nodeIndex++;\n }\n }\n // We need to set the currentNode away from the cloned tree so that we\n // don't hold onto the tree even if the tree is detached and should be\n // freed.\n walker.currentNode = d;\n return fragment;\n }\n\n _update(values: Array<unknown>) {\n let i = 0;\n for (const part of this._$parts) {\n if (part !== undefined) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'set part',\n part,\n value: values[i],\n valueIndex: i,\n values,\n templateInstance: this,\n });\n if ((part as AttributePart).strings !== undefined) {\n (part as AttributePart)._$setValue(values, part as AttributePart, i);\n // The number of values the part consumes is part.strings.length - 1\n // since values are in between template spans. We increment i by 1\n // later in the loop, so increment it by part.strings.length - 2 here\n i += (part as AttributePart).strings!.length - 2;\n } else {\n part._$setValue(values[i]);\n }\n }\n i++;\n }\n }\n}\n\n/*\n * Parts\n */\ntype AttributeTemplatePart = {\n readonly type: typeof ATTRIBUTE_PART;\n readonly index: number;\n readonly name: string;\n readonly ctor: typeof AttributePart;\n readonly strings: ReadonlyArray<string>;\n};\ntype ChildTemplatePart = {\n readonly type: typeof CHILD_PART;\n readonly index: number;\n};\ntype ElementTemplatePart = {\n readonly type: typeof ELEMENT_PART;\n readonly index: number;\n};\ntype CommentTemplatePart = {\n readonly type: typeof COMMENT_PART;\n readonly index: number;\n};\n\n/**\n * A TemplatePart represents a dynamic part in a template, before the template\n * is instantiated. When a template is instantiated Parts are created from\n * TemplateParts.\n */\ntype TemplatePart =\n | ChildTemplatePart\n | AttributeTemplatePart\n | ElementTemplatePart\n | CommentTemplatePart;\n\nexport type Part =\n | ChildPart\n | AttributePart\n | PropertyPart\n | BooleanAttributePart\n | ElementPart\n | EventPart;\n\nexport type {ChildPart};\nclass ChildPart implements Disconnectable {\n readonly type = CHILD_PART;\n readonly options: RenderOptions | undefined;\n _$committedValue: unknown = nothing;\n /** @internal */\n __directive?: Directive;\n /** @internal */\n _$startNode: ChildNode;\n /** @internal */\n _$endNode: ChildNode | null;\n private _textSanitizer: ValueSanitizer | undefined;\n /** @internal */\n _$parent: Disconnectable | undefined;\n /**\n * Connection state for RootParts only (i.e. ChildPart without _$parent\n * returned from top-level `render`). This field is unused otherwise. The\n * intention would be clearer if we made `RootPart` a subclass of `ChildPart`\n * with this field (and a different _$isConnected getter), but the subclass\n * caused a perf regression, possibly due to making call sites polymorphic.\n * @internal\n */\n __isConnected: boolean;\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n // ChildParts that are not at the root should always be created with a\n // parent; only RootChildNode's won't, so they return the local isConnected\n // state\n return this._$parent?._$isConnected ?? this.__isConnected;\n }\n\n // The following fields will be patched onto ChildParts when required by\n // AsyncDirective\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n /** @internal */\n _$notifyConnectionChanged?(\n isConnected: boolean,\n removeFromParent?: boolean,\n from?: number\n ): void;\n /** @internal */\n _$reparentDisconnectables?(parent: Disconnectable): void;\n\n constructor(\n startNode: ChildNode,\n endNode: ChildNode | null,\n parent: TemplateInstance | ChildPart | undefined,\n options: RenderOptions | undefined\n ) {\n this._$startNode = startNode;\n this._$endNode = endNode;\n this._$parent = parent;\n this.options = options;\n // Note __isConnected is only ever accessed on RootParts (i.e. when there is\n // no _$parent); the value on a non-root-part is \"don't care\", but checking\n // for parent would be more code\n this.__isConnected = options?.isConnected ?? true;\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n // Explicitly initialize for consistent class shape.\n this._textSanitizer = undefined;\n }\n }\n\n /**\n * The parent node into which the part renders its content.\n *\n * A ChildPart's content consists of a range of adjacent child nodes of\n * `.parentNode`, possibly bordered by 'marker nodes' (`.startNode` and\n * `.endNode`).\n *\n * - If both `.startNode` and `.endNode` are non-null, then the part's content\n * consists of all siblings between `.startNode` and `.endNode`, exclusively.\n *\n * - If `.startNode` is non-null but `.endNode` is null, then the part's\n * content consists of all siblings following `.startNode`, up to and\n * including the last child of `.parentNode`. If `.endNode` is non-null, then\n * `.startNode` will always be non-null.\n *\n * - If both `.endNode` and `.startNode` are null, then the part's content\n * consists of all child nodes of `.parentNode`.\n */\n get parentNode(): Node {\n let parentNode: Node = wrap(this._$startNode).parentNode!;\n const parent = this._$parent;\n if (\n parent !== undefined &&\n parentNode?.nodeType === 11 /* Node.DOCUMENT_FRAGMENT */\n ) {\n // If the parentNode is a DocumentFragment, it may be because the DOM is\n // still in the cloned fragment during initial render; if so, get the real\n // parentNode the part will be committed into by asking the parent.\n parentNode = (parent as ChildPart | TemplateInstance).parentNode;\n }\n return parentNode;\n }\n\n /**\n * The part's leading marker node, if any. See `.parentNode` for more\n * information.\n */\n get startNode(): Node | null {\n return this._$startNode;\n }\n\n /**\n * The part's trailing marker node, if any. See `.parentNode` for more\n * information.\n */\n get endNode(): Node | null {\n return this._$endNode;\n }\n\n _$setValue(value: unknown, directiveParent: DirectiveParent = this): void {\n if (DEV_MODE && this.parentNode === null) {\n throw new Error(\n `This \\`ChildPart\\` has no \\`parentNode\\` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's \\`innerHTML\\` or \\`textContent\\` can do this.`\n );\n }\n value = resolveDirective(this, value, directiveParent);\n if (isPrimitive(value)) {\n // Non-rendering child values. It's important that these do not render\n // empty text nodes to avoid issues with preventing default <slot>\n // fallback content.\n if (value === nothing || value == null || value === '') {\n if (this._$committedValue !== nothing) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit nothing to child',\n start: this._$startNode,\n end: this._$endNode,\n parent: this._$parent,\n options: this.options,\n });\n this._$clear();\n }\n this._$committedValue = nothing;\n } else if (value !== this._$committedValue && value !== noChange) {\n this._commitText(value);\n }\n // This property needs to remain unminified.\n } else if ((value as TemplateResult)['_$litType$'] !== undefined) {\n this._commitTemplateResult(value as TemplateResult);\n } else if ((value as Node).nodeType !== undefined) {\n if (DEV_MODE && this.options?.host === value) {\n this._commitText(\n `[probable mistake: rendered a template's host in itself ` +\n `(commonly caused by writing \\${this} in a template]`\n );\n console.warn(\n `Attempted to render the template host`,\n value,\n `inside itself. This is almost always a mistake, and in dev mode `,\n `we render some warning text. In production however, we'll `,\n `render it, which will usually result in an error, and sometimes `,\n `in the element disappearing from the DOM.`\n );\n return;\n }\n this._commitNode(value as Node);\n } else if (isIterable(value)) {\n this._commitIterable(value);\n } else {\n // Fallback, will render the string representation\n this._commitText(value);\n }\n }\n\n private _insert<T extends Node>(node: T) {\n return wrap(wrap(this._$startNode).parentNode!).insertBefore(\n node,\n this._$endNode\n );\n }\n\n private _commitNode(value: Node): void {\n if (this._$committedValue !== value) {\n this._$clear();\n if (\n ENABLE_EXTRA_SECURITY_HOOKS &&\n sanitizerFactoryInternal !== noopSanitizer\n ) {\n const parentNodeName = this._$startNode.parentNode?.nodeName;\n if (parentNodeName === 'STYLE' || parentNodeName === 'SCRIPT') {\n let message = 'Forbidden';\n if (DEV_MODE) {\n if (parentNodeName === 'STYLE') {\n message =\n `Lit does not support binding inside style nodes. ` +\n `This is a security risk, as style injection attacks can ` +\n `exfiltrate data and spoof UIs. ` +\n `Consider instead using css\\`...\\` literals ` +\n `to compose styles, and do dynamic styling with ` +\n `css custom properties, ::parts, <slot>s, ` +\n `and by mutating the DOM rather than stylesheets.`;\n } else {\n message =\n `Lit does not support binding inside script nodes. ` +\n `This is a security risk, as it could allow arbitrary ` +\n `code execution.`;\n }\n }\n throw new Error(message);\n }\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit node',\n start: this._$startNode,\n parent: this._$parent,\n value: value,\n options: this.options,\n });\n this._$committedValue = this._insert(value);\n }\n }\n\n private _commitText(value: unknown): void {\n // If the committed value is a primitive it means we called _commitText on\n // the previous render, and we know that this._$startNode.nextSibling is a\n // Text node. We can now just replace the text content (.data) of the node.\n if (\n this._$committedValue !== nothing &&\n isPrimitive(this._$committedValue)\n ) {\n const node = wrap(this._$startNode).nextSibling as Text;\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n if (this._textSanitizer === undefined) {\n this._textSanitizer = createSanitizer(node, 'data', 'property');\n }\n value = this._textSanitizer(value);\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit text',\n node,\n value,\n options: this.options,\n });\n (node as Text).data = value as string;\n } else {\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n const textNode = d.createTextNode('');\n this._commitNode(textNode);\n // When setting text content, for security purposes it matters a lot\n // what the parent is. For example, <style> and <script> need to be\n // handled with care, while <span> does not. So first we need to put a\n // text node into the document, then we can sanitize its content.\n if (this._textSanitizer === undefined) {\n this._textSanitizer = createSanitizer(textNode, 'data', 'property');\n }\n value = this._textSanitizer(value);\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit text',\n node: textNode,\n value,\n options: this.options,\n });\n textNode.data = value as string;\n } else {\n this._commitNode(d.createTextNode(value as string));\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit text',\n node: wrap(this._$startNode).nextSibling as Text,\n value,\n options: this.options,\n });\n }\n }\n this._$committedValue = value;\n }\n\n private _commitTemplateResult(\n result: TemplateResult | CompiledTemplateResult\n ): void {\n // This property needs to remain unminified.\n const {values, ['_$litType$']: type} = result;\n // If $litType$ is a number, result is a plain TemplateResult and we get\n // the template from the template cache. If not, result is a\n // CompiledTemplateResult and _$litType$ is a CompiledTemplate and we need\n // to create the <template> element the first time we see it.\n const template: Template | CompiledTemplate =\n typeof type === 'number'\n ? this._$getTemplate(result as UncompiledTemplateResult)\n : (type.el === undefined &&\n (type.el = Template.createElement(\n trustFromTemplateString(type.h, type.h[0]),\n this.options\n )),\n type);\n\n if ((this._$committedValue as TemplateInstance)?._$template === template) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'template updating',\n template,\n instance: this._$committedValue as TemplateInstance,\n parts: (this._$committedValue as TemplateInstance)._$parts,\n options: this.options,\n values,\n });\n (this._$committedValue as TemplateInstance)._update(values);\n } else {\n const instance = new TemplateInstance(template as Template, this);\n const fragment = instance._clone(this.options);\n debugLogEvent &&\n debugLogEvent({\n kind: 'template instantiated',\n template,\n instance,\n parts: instance._$parts,\n options: this.options,\n fragment,\n values,\n });\n instance._update(values);\n debugLogEvent &&\n debugLogEvent({\n kind: 'template instantiated and updated',\n template,\n instance,\n parts: instance._$parts,\n options: this.options,\n fragment,\n values,\n });\n this._commitNode(fragment);\n this._$committedValue = instance;\n }\n }\n\n // Overridden via `litHtmlPolyfillSupport` to provide platform support.\n /** @internal */\n _$getTemplate(result: UncompiledTemplateResult) {\n let template = templateCache.get(result.strings);\n if (template === undefined) {\n templateCache.set(result.strings, (template = new Template(result)));\n }\n return template;\n }\n\n private _commitIterable(value: Iterable<unknown>): void {\n // For an Iterable, we create a new InstancePart per item, then set its\n // value to the item. This is a little bit of overhead for every item in\n // an Iterable, but it lets us recurse easily and efficiently update Arrays\n // of TemplateResults that will be commonly returned from expressions like:\n // array.map((i) => html`${i}`), by reusing existing TemplateInstances.\n\n // If value is an array, then the previous render was of an\n // iterable and value will contain the ChildParts from the previous\n // render. If value is not an array, clear this part and make a new\n // array for ChildParts.\n if (!isArray(this._$committedValue)) {\n this._$committedValue = [];\n this._$clear();\n }\n\n // Lets us keep track of how many items we stamped so we can clear leftover\n // items from a previous render\n const itemParts = this._$committedValue as ChildPart[];\n let partIndex = 0;\n let itemPart: ChildPart | undefined;\n\n for (const item of value) {\n if (partIndex === itemParts.length) {\n // If no existing part, create a new one\n // TODO (justinfagnani): test perf impact of always creating two parts\n // instead of sharing parts between nodes\n // https://github.com/lit/lit/issues/1266\n itemParts.push(\n (itemPart = new ChildPart(\n this._insert(createMarker()),\n this._insert(createMarker()),\n this,\n this.options\n ))\n );\n } else {\n // Reuse an existing part\n itemPart = itemParts[partIndex];\n }\n itemPart._$setValue(item);\n partIndex++;\n }\n\n if (partIndex < itemParts.length) {\n // itemParts always have end nodes\n this._$clear(\n itemPart && wrap(itemPart._$endNode!).nextSibling,\n partIndex\n );\n // Truncate the parts array so _value reflects the current state\n itemParts.length = partIndex;\n }\n }\n\n /**\n * Removes the nodes contained within this Part from the DOM.\n *\n * @param start Start node to clear from, for clearing a subset of the part's\n * DOM (used when truncating iterables)\n * @param from When `start` is specified, the index within the iterable from\n * which ChildParts are being removed, used for disconnecting directives\n * in those Parts.\n *\n * @internal\n */\n _$clear(\n start: ChildNode | null = wrap(this._$startNode).nextSibling,\n from?: number\n ) {\n this._$notifyConnectionChanged?.(false, true, from);\n while (start !== this._$endNode) {\n // The non-null assertion is safe because if _$startNode.nextSibling is\n // null, then _$endNode is also null, and we would not have entered this\n // loop.\n const n = wrap(start!).nextSibling;\n wrap(start!).remove();\n start = n;\n }\n }\n\n /**\n * Implementation of RootPart's `isConnected`. Note that this method\n * should only be called on `RootPart`s (the `ChildPart` returned from a\n * top-level `render()` call). It has no effect on non-root ChildParts.\n * @param isConnected Whether to set\n * @internal\n */\n setConnected(isConnected: boolean) {\n if (this._$parent === undefined) {\n this.__isConnected = isConnected;\n this._$notifyConnectionChanged?.(isConnected);\n } else if (DEV_MODE) {\n throw new Error(\n 'part.setConnected() may only be called on a ' +\n 'RootPart returned from render().'\n );\n }\n }\n}\n\n/**\n * A top-level `ChildPart` returned from `render` that manages the connected\n * state of `AsyncDirective`s created throughout the tree below it.\n */\nexport interface RootPart extends ChildPart {\n /**\n * Sets the connection state for `AsyncDirective`s contained within this root\n * ChildPart.\n *\n * lit-html does not automatically monitor the connectedness of DOM rendered;\n * as such, it is the responsibility of the caller to `render` to ensure that\n * `part.setConnected(false)` is called before the part object is potentially\n * discarded, to ensure that `AsyncDirective`s have a chance to dispose of\n * any resources being held. If a `RootPart` that was previously\n * disconnected is subsequently re-connected (and its `AsyncDirective`s should\n * re-connect), `setConnected(true)` should be called.\n *\n * @param isConnected Whether directives within this tree should be connected\n * or not\n */\n setConnected(isConnected: boolean): void;\n}\n\nexport type {AttributePart};\nclass AttributePart implements Disconnectable {\n readonly type:\n | typeof ATTRIBUTE_PART\n | typeof PROPERTY_PART\n | typeof BOOLEAN_ATTRIBUTE_PART\n | typeof EVENT_PART = ATTRIBUTE_PART;\n readonly element: HTMLElement;\n readonly name: string;\n readonly options: RenderOptions | undefined;\n\n /**\n * If this attribute part represents an interpolation, this contains the\n * static strings of the interpolation. For single-value, complete bindings,\n * this is undefined.\n */\n readonly strings?: ReadonlyArray<string>;\n /** @internal */\n _$committedValue: unknown | Array<unknown> = nothing;\n /** @internal */\n __directives?: Array<Directive | undefined>;\n /** @internal */\n _$parent: Disconnectable;\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n protected _sanitizer: ValueSanitizer | undefined;\n\n get tagName() {\n return this.element.tagName;\n }\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n constructor(\n element: HTMLElement,\n name: string,\n strings: ReadonlyArray<string>,\n parent: Disconnectable,\n options: RenderOptions | undefined\n ) {\n this.element = element;\n this.name = name;\n this._$parent = parent;\n this.options = options;\n if (strings.length > 2 || strings[0] !== '' || strings[1] !== '') {\n this._$committedValue = new Array(strings.length - 1).fill(new String());\n this.strings = strings;\n } else {\n this._$committedValue = nothing;\n }\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n this._sanitizer = undefined;\n }\n }\n\n /**\n * Sets the value of this part by resolving the value from possibly multiple\n * values and static strings and committing it to the DOM.\n * If this part is single-valued, `this._strings` will be undefined, and the\n * method will be called with a single value argument. If this part is\n * multi-value, `this._strings` will be defined, and the method is called\n * with the value array of the part's owning TemplateInstance, and an offset\n * into the value array from which the values should be read.\n * This method is overloaded this way to eliminate short-lived array slices\n * of the template instance values, and allow a fast-path for single-valued\n * parts.\n *\n * @param value The part value, or an array of values for multi-valued parts\n * @param valueIndex the index to start reading values from. `undefined` for\n * single-valued parts\n * @param noCommit causes the part to not commit its value to the DOM. Used\n * in hydration to prime attribute parts with their first-rendered value,\n * but not set the attribute, and in SSR to no-op the DOM operation and\n * capture the value for serialization.\n *\n * @internal\n */\n _$setValue(\n value: unknown | Array<unknown>,\n directiveParent: DirectiveParent = this,\n valueIndex?: number,\n noCommit?: boolean\n ) {\n const strings = this.strings;\n\n // Whether any of the values has changed, for dirty-checking\n let change = false;\n\n if (strings === undefined) {\n // Single-value binding case\n value = resolveDirective(this, value, directiveParent, 0);\n change =\n !isPrimitive(value) ||\n (value !== this._$committedValue && value !== noChange);\n if (change) {\n this._$committedValue = value;\n }\n } else {\n // Interpolation case\n const values = value as Array<unknown>;\n value = strings[0];\n\n let i, v;\n for (i = 0; i < strings.length - 1; i++) {\n v = resolveDirective(this, values[valueIndex! + i], directiveParent, i);\n\n if (v === noChange) {\n // If the user-provided value is `noChange`, use the previous value\n v = (this._$committedValue as Array<unknown>)[i];\n }\n change ||=\n !isPrimitive(v) || v !== (this._$committedValue as Array<unknown>)[i];\n if (v === nothing) {\n value = nothing;\n } else if (value !== nothing) {\n value += (v ?? '') + strings[i + 1];\n }\n // We always record each value, even if one is `nothing`, for future\n // change detection.\n (this._$committedValue as Array<unknown>)[i] = v;\n }\n }\n if (change && !noCommit) {\n this._commitValue(value);\n }\n }\n\n /** @internal */\n _commitValue(value: unknown) {\n if (value === nothing) {\n (wrap(this.element) as Element).removeAttribute(this.name);\n } else {\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n if (this._sanitizer === undefined) {\n this._sanitizer = sanitizerFactoryInternal(\n this.element,\n this.name,\n 'attribute'\n );\n }\n value = this._sanitizer(value ?? '');\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit attribute',\n element: this.element,\n name: this.name,\n value,\n options: this.options,\n });\n (wrap(this.element) as Element).setAttribute(\n this.name,\n (value ?? '') as string\n );\n }\n }\n}\n\nexport type {PropertyPart};\nclass PropertyPart extends AttributePart {\n override readonly type = PROPERTY_PART;\n\n /** @internal */\n override _commitValue(value: unknown) {\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n if (this._sanitizer === undefined) {\n this._sanitizer = sanitizerFactoryInternal(\n this.element,\n this.name,\n 'property'\n );\n }\n value = this._sanitizer(value);\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit property',\n element: this.element,\n name: this.name,\n value,\n options: this.options,\n });\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this.element as any)[this.name] = value === nothing ? undefined : value;\n }\n}\n\nexport type {BooleanAttributePart};\nclass BooleanAttributePart extends AttributePart {\n override readonly type = BOOLEAN_ATTRIBUTE_PART;\n\n /** @internal */\n override _commitValue(value: unknown) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit boolean attribute',\n element: this.element,\n name: this.name,\n value: !!(value && value !== nothing),\n options: this.options,\n });\n (wrap(this.element) as Element).toggleAttribute(\n this.name,\n !!value && value !== nothing\n );\n }\n}\n\ntype EventListenerWithOptions = EventListenerOrEventListenerObject &\n Partial<AddEventListenerOptions>;\n\n/**\n * An AttributePart that manages an event listener via add/removeEventListener.\n *\n * This part works by adding itself as the event listener on an element, then\n * delegating to the value passed to it. This reduces the number of calls to\n * add/removeEventListener if the listener changes frequently, such as when an\n * inline function is used as a listener.\n *\n * Because event options are passed when adding listeners, we must take case\n * to add and remove the part as a listener when the event options change.\n */\nexport type {EventPart};\nclass EventPart extends AttributePart {\n override readonly type = EVENT_PART;\n\n constructor(\n element: HTMLElement,\n name: string,\n strings: ReadonlyArray<string>,\n parent: Disconnectable,\n options: RenderOptions | undefined\n ) {\n super(element, name, strings, parent, options);\n\n if (DEV_MODE && this.strings !== undefined) {\n throw new Error(\n `A \\`<${element.localName}>\\` has a \\`@${name}=...\\` listener with ` +\n 'invalid content. Event listeners in templates must have exactly ' +\n 'one expression and no surrounding text.'\n );\n }\n }\n\n // EventPart does not use the base _$setValue/_resolveValue implementation\n // since the dirty checking is more complex\n /** @internal */\n override _$setValue(\n newListener: unknown,\n directiveParent: DirectiveParent = this\n ) {\n newListener =\n resolveDirective(this, newListener, directiveParent, 0) ?? nothing;\n if (newListener === noChange) {\n return;\n }\n const oldListener = this._$committedValue;\n\n // If the new value is nothing or any options change we have to remove the\n // part as a listener.\n const shouldRemoveListener =\n (newListener === nothing && oldListener !== nothing) ||\n (newListener as EventListenerWithOptions).capture !==\n (oldListener as EventListenerWithOptions).capture ||\n (newListener as EventListenerWithOptions).once !==\n (oldListener as EventListenerWithOptions).once ||\n (newListener as EventListenerWithOptions).passive !==\n (oldListener as EventListenerWithOptions).passive;\n\n // If the new value is not nothing and we removed the listener, we have\n // to add the part as a listener.\n const shouldAddListener =\n newListener !== nothing &&\n (oldListener === nothing || shouldRemoveListener);\n\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit event listener',\n element: this.element,\n name: this.name,\n value: newListener,\n options: this.options,\n removeListener: shouldRemoveListener,\n addListener: shouldAddListener,\n oldListener,\n });\n if (shouldRemoveListener) {\n this.element.removeEventListener(\n this.name,\n this,\n oldListener as EventListenerWithOptions\n );\n }\n if (shouldAddListener) {\n this.element.addEventListener(\n this.name,\n this,\n newListener as EventListenerWithOptions\n );\n }\n this._$committedValue = newListener;\n }\n\n handleEvent(event: Event) {\n if (typeof this._$committedValue === 'function') {\n this._$committedValue.call(this.options?.host ?? this.element, event);\n } else {\n (this._$committedValue as EventListenerObject).handleEvent(event);\n }\n }\n}\n\nexport type {ElementPart};\nclass ElementPart implements Disconnectable {\n readonly type = ELEMENT_PART;\n\n /** @internal */\n __directive?: Directive;\n\n // This is to ensure that every Part has a _$committedValue\n _$committedValue: undefined;\n\n /** @internal */\n _$parent!: Disconnectable;\n\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n options: RenderOptions | undefined;\n\n constructor(\n public element: Element,\n parent: Disconnectable,\n options: RenderOptions | undefined\n ) {\n this._$parent = parent;\n this.options = options;\n }\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n _$setValue(value: unknown): void {\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit to element binding',\n element: this.element,\n value,\n options: this.options,\n });\n resolveDirective(this, value);\n }\n}\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * Private exports for use by other Lit packages, not intended for use by\n * external users.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports mangled in the\n * client side code, we export a _$LH object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n *\n * This has a unique name, to disambiguate it from private exports in\n * lit-element, which re-exports all of lit-html.\n *\n * @private\n */\nexport const _$LH = {\n // Used in lit-ssr\n _boundAttributeSuffix: boundAttributeSuffix,\n _marker: marker,\n _markerMatch: markerMatch,\n _HTML_RESULT: HTML_RESULT,\n _getTemplateHtml: getTemplateHtml,\n // Used in tests and private-ssr-support\n _TemplateInstance: TemplateInstance,\n _isIterable: isIterable,\n _resolveDirective: resolveDirective,\n _ChildPart: ChildPart,\n _AttributePart: AttributePart,\n _BooleanAttributePart: BooleanAttributePart,\n _EventPart: EventPart,\n _PropertyPart: PropertyPart,\n _ElementPart: ElementPart,\n};\n\n// Apply polyfills if available\nconst polyfillSupport = DEV_MODE\n ? global.litHtmlPolyfillSupportDevMode\n : global.litHtmlPolyfillSupport;\npolyfillSupport?.(Template, ChildPart);\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for lit-html usage.\n(global.litHtmlVersions ??= []).push('3.3.3');\nif (DEV_MODE && global.litHtmlVersions.length > 1) {\n queueMicrotask(() => {\n issueWarning!(\n 'multiple-versions',\n `Multiple versions of Lit loaded. ` +\n `Loading multiple versions is not recommended.`\n );\n });\n}\n\n/**\n * Renders a value, usually a lit-html TemplateResult, to the container.\n *\n * This example renders the text \"Hello, Zoe!\" inside a paragraph tag, appending\n * it to the container `document.body`.\n *\n * ```js\n * import {html, render} from 'lit';\n *\n * const name = \"Zoe\";\n * render(html`<p>Hello, ${name}!</p>`, document.body);\n * ```\n *\n * @param value Any [renderable\n * value](https://lit.dev/docs/templates/expressions/#child-expressions),\n * typically a {@linkcode TemplateResult} created by evaluating a template tag\n * like {@linkcode html} or {@linkcode svg}.\n * @param container A DOM container to render to. The first render will append\n * the rendered value to the container, and subsequent renders will\n * efficiently update the rendered value if the same result type was\n * previously rendered there.\n * @param options See {@linkcode RenderOptions} for options documentation.\n * @see\n * {@link https://lit.dev/docs/libraries/standalone-templates/#rendering-lit-html-templates| Rendering Lit HTML Templates}\n */\nexport const render = (\n value: unknown,\n container: RenderRootNode,\n options?: RenderOptions\n): RootPart => {\n if (DEV_MODE && container == null) {\n // Give a clearer error message than\n // Uncaught TypeError: Cannot read properties of null (reading\n // '_$litPart$')\n // which reads like an internal Lit error.\n throw new TypeError(`The container to render into may not be ${container}`);\n }\n const renderId = DEV_MODE ? debugLogRenderId++ : 0;\n const partOwnerNode = options?.renderBefore ?? container;\n // This property needs to remain unminified.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let part: ChildPart = (partOwnerNode as any)['_$litPart$'];\n debugLogEvent &&\n debugLogEvent({\n kind: 'begin render',\n id: renderId,\n value,\n container,\n options,\n part,\n });\n if (part === undefined) {\n const endNode = options?.renderBefore ?? null;\n // This property needs to remain unminified.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (partOwnerNode as any)['_$litPart$'] = part = new ChildPart(\n container.insertBefore(createMarker(), endNode),\n endNode,\n undefined,\n options ?? {}\n );\n }\n part._$setValue(value);\n debugLogEvent &&\n debugLogEvent({\n kind: 'end render',\n id: renderId,\n value,\n container,\n options,\n part,\n });\n return part as RootPart;\n};\n\nif (ENABLE_EXTRA_SECURITY_HOOKS) {\n render.setSanitizer = setSanitizer;\n render.createSanitizer = createSanitizer;\n if (DEV_MODE) {\n render._testOnlyClearSanitizerFactoryDoNotCallOrElse =\n _testOnlyClearSanitizerFactoryDoNotCallOrElse;\n }\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The main LitElement module, which defines the {@linkcode LitElement} base\n * class and related APIs.\n *\n * LitElement components can define a template and a set of observed\n * properties. Changing an observed property triggers a re-render of the\n * element.\n *\n * Import {@linkcode LitElement} and {@linkcode html} from this module to\n * create a component:\n *\n * ```js\n * import {LitElement, html} from 'lit-element';\n *\n * class MyElement extends LitElement {\n *\n * // Declare observed properties\n * static get properties() {\n * return {\n * adjective: {}\n * }\n * }\n *\n * constructor() {\n * this.adjective = 'awesome';\n * }\n *\n * // Define the element's template\n * render() {\n * return html`<p>your ${adjective} template here</p>`;\n * }\n * }\n *\n * customElements.define('my-element', MyElement);\n * ```\n *\n * `LitElement` extends {@linkcode ReactiveElement} and adds lit-html\n * templating. The `ReactiveElement` class is provided for users that want to\n * build their own custom element base classes that don't use lit-html.\n *\n * @packageDocumentation\n */\nimport {PropertyValues, ReactiveElement} from '@lit/reactive-element';\nimport {render, RenderOptions, noChange, RootPart} from 'lit-html';\nexport * from '@lit/reactive-element';\nexport * from 'lit-html';\n\nimport {LitUnstable} from 'lit-html';\nimport {ReactiveUnstable} from '@lit/reactive-element';\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace Unstable {\n /**\n * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n * we will emit 'lit-debug' events to window, with live details about the update and render\n * lifecycle. These can be useful for writing debug tooling and visualizations.\n *\n * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n * making certain operations that are normally very cheap (like a no-op render) much slower,\n * because we must copy data and dispatch events.\n */\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace DebugLog {\n export type Entry =\n | LitUnstable.DebugLog.Entry\n | ReactiveUnstable.DebugLog.Entry;\n }\n}\n/*\n * When using Closure Compiler, JSCompiler_renameProperty(property, object) is\n * replaced at compile time by the munged name for object[property]. We cannot\n * alias this function, so we have to use a small shim that has the same\n * behavior when not compiling.\n */\n/*@__INLINE__*/\nconst JSCompiler_renameProperty = <P extends PropertyKey>(\n prop: P,\n _obj: unknown\n): P => prop;\n\nconst DEV_MODE = true;\n// Allows minifiers to rename references to globalThis\nconst global = globalThis;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n // Ensure warnings are issued only 1x, even if multiple versions of Lit\n // are loaded.\n global.litIssuedWarnings ??= new Set();\n\n /**\n * Issue a warning if we haven't already, based either on `code` or `warning`.\n * Warnings are disabled automatically only by `warning`; disabling via `code`\n * can be done by users.\n */\n issueWarning = (code: string, warning: string) => {\n warning += ` See https://lit.dev/msg/${code} for more information.`;\n if (\n !global.litIssuedWarnings!.has(warning) &&\n !global.litIssuedWarnings!.has(code)\n ) {\n console.warn(warning);\n global.litIssuedWarnings!.add(warning);\n }\n };\n}\n\n/**\n * Base element class that manages element properties and attributes, and\n * renders a lit-html template.\n *\n * To define a component, subclass `LitElement` and implement a\n * `render` method to provide the component's template. Define properties\n * using the {@linkcode LitElement.properties properties} property or the\n * {@linkcode property} decorator.\n */\nexport class LitElement extends ReactiveElement {\n // This property needs to remain unminified.\n static ['_$litElement$'] = true;\n\n /**\n * @category rendering\n */\n readonly renderOptions: RenderOptions = {host: this};\n\n private __childPart: RootPart | undefined = undefined;\n\n /**\n * @category rendering\n */\n protected override createRenderRoot() {\n const renderRoot = super.createRenderRoot();\n // When adoptedStyleSheets are shimmed, they are inserted into the\n // shadowRoot by createRenderRoot. Adjust the renderBefore node so that\n // any styles in Lit content render before adoptedStyleSheets. This is\n // important so that adoptedStyleSheets have precedence over styles in\n // the shadowRoot.\n this.renderOptions.renderBefore ??= renderRoot!.firstChild as ChildNode;\n return renderRoot;\n }\n\n /**\n * Updates the element. This method reflects property values to attributes\n * and calls `render` to render DOM via lit-html. Setting properties inside\n * this method will *not* trigger another update.\n * @param changedProperties Map of changed properties with old values\n * @category updates\n */\n protected override update(changedProperties: PropertyValues) {\n // Setting properties in `render` should not trigger an update. Since\n // updates are allowed after super.update, it's important to call `render`\n // before that.\n const value = this.render();\n if (!this.hasUpdated) {\n this.renderOptions.isConnected = this.isConnected;\n }\n super.update(changedProperties);\n this.__childPart = render(value, this.renderRoot, this.renderOptions);\n }\n\n /**\n * Invoked when the component is added to the document's DOM.\n *\n * In `connectedCallback()` you should setup tasks that should only occur when\n * the element is connected to the document. The most common of these is\n * adding event listeners to nodes external to the element, like a keydown\n * event handler added to the window.\n *\n * ```ts\n * connectedCallback() {\n * super.connectedCallback();\n * addEventListener('keydown', this._handleKeydown);\n * }\n * ```\n *\n * Typically, anything done in `connectedCallback()` should be undone when the\n * element is disconnected, in `disconnectedCallback()`.\n *\n * @category lifecycle\n */\n override connectedCallback() {\n super.connectedCallback();\n this.__childPart?.setConnected(true);\n }\n\n /**\n * Invoked when the component is removed from the document's DOM.\n *\n * This callback is the main signal to the element that it may no longer be\n * used. `disconnectedCallback()` should ensure that nothing is holding a\n * reference to the element (such as event listeners added to nodes external\n * to the element), so that it is free to be garbage collected.\n *\n * ```ts\n * disconnectedCallback() {\n * super.disconnectedCallback();\n * window.removeEventListener('keydown', this._handleKeydown);\n * }\n * ```\n *\n * An element may be re-connected after being disconnected.\n *\n * @category lifecycle\n */\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.__childPart?.setConnected(false);\n }\n\n /**\n * Invoked on each update to perform rendering tasks. This method may return\n * any value renderable by lit-html's `ChildPart` - typically a\n * `TemplateResult`. Setting properties inside this method will *not* trigger\n * the element to update.\n * @category rendering\n */\n protected render(): unknown {\n return noChange;\n }\n}\n\n/**\n * Ensure this class is marked as `finalized` as an optimization ensuring\n * it will not needlessly try to `finalize`.\n *\n * Note this property name is a string to prevent breaking Closure JS Compiler\n * optimizations. See @lit/reactive-element for more information.\n */\n(LitElement as unknown as Record<string, unknown>)[\n JSCompiler_renameProperty('finalized', LitElement)\n] = true;\n\n// Install hydration if available\nglobal.litElementHydrateSupport?.({LitElement});\n\n// Apply polyfills if available\nconst polyfillSupport = DEV_MODE\n ? global.litElementPolyfillSupportDevMode\n : global.litElementPolyfillSupport;\npolyfillSupport?.({LitElement});\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * Private exports for use by other Lit packages, not intended for use by\n * external users.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports mangled in the\n * client side code, we export a _$LE object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n *\n * This has a unique name, to disambiguate it from private exports in\n * lit-html, since this module re-exports all of lit-html.\n *\n * @private\n */\nexport const _$LE = {\n _$attributeToProperty: (\n el: LitElement,\n name: string,\n value: string | null\n ) => {\n // eslint-disable-next-line\n (el as any)._$attributeToProperty(name, value);\n },\n // eslint-disable-next-line\n _$changedProperties: (el: LitElement) => (el as any)._$changedProperties,\n};\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for LitElement usage.\n(global.litElementVersions ??= []).push('4.2.2');\nif (DEV_MODE && global.litElementVersions.length > 1) {\n queueMicrotask(() => {\n issueWarning!(\n 'multiple-versions',\n `Multiple versions of Lit loaded. Loading multiple versions ` +\n `is not recommended.`\n );\n });\n}\n", "\nimport {AttrValue} from \"../../types.js\"\n\n/** get html attributes */\nexport const attrGet = {\n\tstring: (e: HTMLElement, key: string) => {\n\t\treturn e.getAttribute(key) ?? undefined\n\t},\n\tnumber: (e: HTMLElement, key: string) => {\n\t\tconst raw = e.getAttribute(key)\n\t\treturn (raw === null || !raw)\n\t\t\t? undefined\n\t\t\t: Number(raw)\n\t},\n\tboolean: (e: HTMLElement, key: string) => {\n\t\tconst raw = e.getAttribute(key)\n\t\treturn raw !== null\n\t},\n}\n\n/** set html attributes */\nexport const attrSet = {\n\tstring: (e: HTMLElement, key: string, value: string | undefined) => {\n\t\tif (value === undefined) e.removeAttribute(key)\n\t\telse e.setAttribute(key, value)\n\t\treturn true\n\t},\n\tnumber: (e: HTMLElement, key: string, value: number | undefined) => {\n\t\tif (value === undefined) e.removeAttribute(key)\n\t\telse e.setAttribute(key, value.toString())\n\t\treturn true\n\t},\n\tboolean: (e: HTMLElement, key: string, value: boolean | undefined) => {\n\t\tif (value) e.setAttribute(key, \"\")\n\t\telse e.removeAttribute(key)\n\t\treturn true\n\t},\n\n\tany: (element: HTMLElement, key: string, value: AttrValue) => {\n\t\tif (value === undefined || value === null)\n\t\t\telement.removeAttribute(key)\n\n\t\telse if (typeof value === \"string\")\n\t\t\telement.setAttribute(key, value)\n\n\t\telse if (typeof value === \"number\")\n\t\t\telement.setAttribute(key, value.toString())\n\n\t\telse if (typeof value === \"boolean\") {\n\t\t\tif (value === true)\n\t\t\t\telement.setAttribute(key, \"\")\n\t\t\telse\n\t\t\t\telement.removeAttribute(key)\n\t\t}\n\n\t\telse console.warn(`invalid attribute \"${key}\" type is \"${typeof value}\"`)\n\t},\n\n\tentries: (element: HTMLElement, entries: Iterable<[key: string, value: AttrValue]>) => {\n\t\tfor (const [key, value] of entries)\n\t\t\tattrSet.any(element, key, value)\n\t},\n\n\trecord: (element: HTMLElement, record: Record<string, AttrValue>) => {\n\t\treturn attrSet.entries(element, Object.entries(record))\n\t},\n}\n\n", "\nimport {AttrValue} from \"../types.js\"\nimport {attrSet} from \"../attrs/parts/attr-fns.js\"\n\nexport function el<E extends HTMLElement>(\n\t\ttagName: string,\n\t\tattrs: Record<string, AttrValue> = {},\n\t) {\n\n\tconst element = document.createElement(tagName) as E\n\tattrSet.record(element, attrs)\n\treturn element\n}\n\n", "\nimport {render, TemplateResult} from \"lit\"\n\nexport function mk<E extends Element = HTMLElement>(template: TemplateResult) {\n\tconst fragment = document.createDocumentFragment()\n\trender(template, fragment)\n\treturn fragment.firstElementChild as E\n}\n\n", "\nexport type EveFn = (event: any) => void\nexport type EveConfig = [options: AddEventListenerOptions, fn: EveFn]\nexport type EveHandler = EveFn | EveConfig\nexport type EveSpec = {[eventName: string]: EveHandler}\n\nexport function eve(target: EventTarget, events: EveSpec) {\n\tlet detachers: (() => void)[] = []\n\n\tfor (const [eventName, handler] of Object.entries(events)) {\n\t\tif (typeof handler === \"function\") {\n\t\t\ttarget.addEventListener(eventName, handler)\n\t\t\tdetachers.push(() => target.removeEventListener(eventName, handler))\n\t\t}\n\t\telse {\n\t\t\tconst [options, fn] = handler\n\t\t\ttarget.addEventListener(eventName, fn, options)\n\t\t\tdetachers.push(() => target.removeEventListener(eventName, fn))\n\t\t}\n\t}\n\n\treturn () => detachers.forEach(d => d())\n}\n\n", "\n/** respond when any attribute changes on the html element */\nexport function onAttrs(element: HTMLElement, fn: MutationCallback) {\n\tconst observer = new MutationObserver(fn)\n\tobserver.observe(element, {attributes: true})\n\treturn () => observer.disconnect()\n}\n\n", "\nimport {attrGet, attrSet} from \"./attr-fns.js\"\n\n/** a typed proxy accessor for html attributes */\nexport class AttrProxies {\n\tconstructor(public element: HTMLElement) {}\n\n\tstrings = new Proxy({}, {\n\t\tget: (_t, key: string) => (\n\t\t\tattrGet.string(this.element, key)\n\t\t),\n\t\tset: (_t, key: string, value: string | undefined) => (\n\t\t\tattrSet.string(this.element, key, value)\n\t\t),\n\t}) as Record<string, string | undefined>\n\n\tnumbers = new Proxy({}, {\n\t\tget: (_t, key: string) => (\n\t\t\tattrGet.number(this.element, key)\n\t\t),\n\t\tset: (_t, key: string, value: number | undefined) => (\n\t\t\tattrSet.number(this.element, key, value)\n\t\t),\n\t}) as Record<string, number | undefined>\n\n\tbooleans = new Proxy({}, {\n\t\tget: (_t, key: string) => (\n\t\t\tattrGet.boolean(this.element, key)\n\t\t),\n\t\tset: (_t, key: string, value: boolean | undefined) => (\n\t\t\tattrSet.boolean(this.element, key, value)\n\t\t),\n\t}) as Record<string, boolean | undefined>\n}\n\n", "\nimport {attrGet, attrSet} from \"./attr-fns.js\"\nimport {AttrSpec, AttrTypes} from \"../../types.js\"\n\nexport type AttrSpecOptions = {\n\tbeforeSet?: (attrKey: string) => void\n\tafterSet?: (attrKey: string) => void\n}\n\n/** specify available html attributes and their types and create a proxy accessor */\nexport const attrSpec = <A extends AttrSpec>(\n\t\te: HTMLElement,\n\t\tspec: A,\n\t\toptions: AttrSpecOptions = {},\n\t) => new Proxy(spec, {\n\n\tget: (_target, key: string) => {\n\t\tswitch (spec[key]) {\n\t\t\tcase String: return attrGet.string(e, key)\n\t\t\tcase Number: return attrGet.number(e, key)\n\t\t\tcase Boolean: return attrGet.boolean(e, key)\n\t\t\tdefault: throw new Error(`invalid attribute type for \"${key}\"`)\n\t\t}\n\t},\n\n\tset: (_target, key: string, value: any) => {\n\t\ttry {\n\t\t\toptions.beforeSet?.(key)\n\t\t\tswitch (spec[key]) {\n\t\t\t\tcase String: return attrSet.string(e, key, value)\n\t\t\t\tcase Number: return attrSet.number(e, key, value)\n\t\t\t\tcase Boolean: return attrSet.boolean(e, key, value)\n\t\t\t\tdefault: throw new Error(`invalid attribute type for \"${key}\"`)\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\toptions.afterSet?.(key)\n\t\t}\n\t},\n}) as any as AttrTypes<A>\n\n", "\nimport {AttrSpec} from \"../types.js\"\nimport {onAttrs} from \"./parts/on-attrs.js\"\nimport {AttrProxies} from \"./parts/attr-proxies.js\"\nimport {attrGet, attrSet} from \"./parts/attr-fns.js\"\nimport {attrSpec, AttrSpecOptions} from \"./parts/attr-spec.js\"\n\nexport function attrs(element: HTMLElement) {\n\tconst proxies = new AttrProxies(element)\n\treturn {\n\t\tstrings: proxies.strings,\n\t\tnumbers: proxies.numbers,\n\t\tbooleans: proxies.booleans,\n\t\ton: (fn: MutationCallback) => onAttrs(element, fn),\n\t\tspec: <A extends AttrSpec>(spec: A, options: AttrSpecOptions = {}) => attrSpec(element, spec, options),\n\t}\n}\n\nattrs.get = attrGet\nattrs.set = attrSet\n\n", "\nimport {AttrValue} from \"../types.js\"\nimport {attrSet} from \"../attrs/parts/attr-fns.js\"\n\nexport function elmer<E extends HTMLElement = HTMLElement>(tagName: string) {\n\treturn new Elmer<E>(tagName)\n}\n\nexport class Elmer<E extends HTMLElement = HTMLElement> {\n\t#attrs = new Map<string, AttrValue>()\n\t#children: (Node | string)[] = []\n\n\tconstructor(public tagName: string) {}\n\n\tattr(key: string, value: AttrValue = true) {\n\t\tthis.#attrs.set(key, value)\n\t\treturn this\n\t}\n\n\tattrs(record: Record<string, AttrValue>) {\n\t\tfor (const [key, value] of Object.entries(record))\n\t\t\tthis.attr(key, value)\n\t\treturn this\n\t}\n\n\tchildren(...elements: (Node | string)[]) {\n\t\tthis.#children.push(...elements)\n\t\treturn this\n\t}\n\n\tdone() {\n\t\tconst element = document.createElement(this.tagName)\n\t\tattrSet.entries(element, this.#attrs)\n\t\telement.append(...this.#children)\n\t\treturn element as E\n\t}\n}\n\n", "\nimport {Queryable} from \"../types.js\"\n\nexport function queryRequire<E extends Element>(\n\t\tselector: string,\n\t\tcontainer: Queryable = document,\n\t) {\n\tconst e = container.querySelector<E>(selector)\n\tif (!e) throw new Error(`element not found (${selector})`)\n\treturn e\n}\n\nexport function queryMaybe<E extends Element>(\n\t\tselector: string,\n\t\tcontainer: Queryable = document,\n\t) {\n\treturn container.querySelector<E>(selector)\n}\n\nexport function queryAll<E extends Element>(\n\t\tselector: string,\n\t\tcontainer: Queryable = document,\n\t) {\n\treturn Array.from(container.querySelectorAll<E>(selector))\n}\n\n", "\nimport {render} from \"lit\"\nimport {eve, EveSpec} from \"./eve.js\"\nimport {attrs} from \"../attrs/attrs.js\"\nimport {Content} from \"../../view/types.js\"\nimport {Attrs, Queryable, Renderable} from \"../types.js\"\nimport {queryAll, queryMaybe, queryRequire} from \"./queries.js\"\n\nexport class Dom<C extends Queryable> {\n\t#attrs?: Attrs\n\n\tconstructor(public element: C) {}\n\n\tin<E extends Queryable>(selectorOrElement: string | E) {\n\t\treturn new Dom<E>(\n\t\t\t(typeof selectorOrElement === \"string\")\n\t\t\t\t? queryRequire(selectorOrElement, this.element) as E\n\t\t\t\t: selectorOrElement\n\t\t)\n\t}\n\n\trequire<E extends Element = HTMLElement>(selector: string) {\n\t\treturn queryRequire<E>(selector, this.element)\n\t}\n\n\tmaybe<E extends Element = HTMLElement>(selector: string) {\n\t\treturn queryMaybe<E>(selector, this.element)\n\t}\n\n\tall<E extends Element = HTMLElement>(selector: string) {\n\t\treturn queryAll<E>(selector, this.element)\n\t}\n\n\trender(...content: Content[]) {\n\t\treturn render(content, this.element as Renderable)\n\t}\n\n\tget attrs(): Attrs {\n\t\treturn this.#attrs ??= attrs(this.element as HTMLElement)\n\t}\n\n\tevents(spec: EveSpec) {\n\t\treturn eve(this.element, spec)\n\t}\n}\n\n", "\nimport {render} from \"lit\"\nimport {el} from \"./parts/el.js\"\nimport {mk} from \"./parts/mk.js\"\nimport {eve} from \"./parts/eve.js\"\nimport {attrs} from \"./attrs/attrs.js\"\nimport {elmer} from \"./parts/elmer.js\"\nimport {Content} from \"../view/types.js\"\nimport {Dom} from \"./parts/dom-scope.js\"\nimport {Queryable, Renderable} from \"./types.js\"\nimport {register} from \"./standalone/register.js\"\nimport {queryAll, queryMaybe, queryRequire} from \"./parts/queries.js\"\n\nexport function dom<E extends HTMLElement>(selector: string, container: Queryable = document) {\n\treturn queryRequire<E>(selector, container)\n}\n\ndom.in = <E extends Queryable>(selectorOrElement: string | E, container: Queryable = document) => {\n\treturn new Dom(container).in(selectorOrElement)\n}\n\ndom.need = queryRequire\ndom.maybe = queryMaybe\ndom.all = queryAll\n\ndom.el = el\ndom.elmer = elmer\ndom.mk = mk\ndom.events = eve\ndom.attrs = attrs\ndom.register = register\ndom.render = (container: Renderable, ...content: Content[]) => {\n\treturn render(content, container)\n}\n\n", "\nexport * from \"./drag-and-drops.js\"\nexport * from \"./drops.js\"\nexport * from \"./helpers.js\"\n\n", "\nexport const bytes = Object.freeze({\n\teq(a: Uint8Array, b: Uint8Array) {\n\t\tif (a.length !== b.length) return false\n\t\tlet diff = 0\n\t\tfor (let i = 0; i < a.length; i++) diff |= a[i] ^ b[i]\n\t\treturn diff === 0\n\t},\n\n\trandom(count: number) {\n\t\treturn crypto.getRandomValues(new Uint8Array(count))\n\t},\n\n\tconcat(parts: Uint8Array[]) {\n\t\tlet size = 0\n\t\tfor (const part of parts) size += part.byteLength\n\n\t\tconst bytes = new Uint8Array(size)\n\n\t\tlet offset = 0\n\t\tfor (const part of parts) {\n\t\t\tbytes.set(part, offset)\n\t\t\toffset += part.byteLength\n\t\t}\n\n\t\treturn bytes as Uint8Array\n\t},\n})\n\n", "\nimport {bytes} from \"./bytes.js\"\n\nexport type Lexicon = {\n\tcharacters: string\n\tnegativePrefix?: string\n\tcaseInsensitive?: boolean\n\tpadding?: {\n\t\tcharacter: string\n\t\tsize: number\n\t}\n}\n\nexport interface BaseX {\n\t(bytes: Uint8Array): string\n}\n\nexport class BaseX {\n\tstatic lexicons = Object.freeze({\n\t\tbase2: {characters: \"01\"},\n\t\thex: {characters: \"0123456789abcdef\", caseInsensitive: true},\n\t\tbase36: {characters: \"0123456789abcdefghijklmnopqrstuvwxyz\"},\n\t\tbase58: {characters: \"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\"},\n\t\tbase62: {characters: \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\"},\n\t\tbase64url: {\n\t\t\tnegativePrefix: \"~\",\n\t\t\tcharacters: \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\",\n\t\t},\n\t\tbase64: {\n\t\t\tcharacters: \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",\n\t\t\tpadding: {character: \"=\", size: 4},\n\t\t},\n\t})\n\n\tprivate lookup: Record<string, number>\n\tprivate negativePrefix: string\n\n\tconstructor(public lexicon: Lexicon) {\n\t\tthis.lookup = Object.fromEntries(\n\t\t\t[...lexicon.characters].map((char, i) => [char, i])\n\t\t)\n\t\tthis.negativePrefix = lexicon.negativePrefix ?? \"-\"\n\n\t\tconst fn = this.fromBytes.bind(this)\n\t\tObject.setPrototypeOf(fn, new.target.prototype)\n\t\tObject.assign(fn, this)\n\t\treturn fn as BaseX\n\t}\n\n\ttoBytes(s: string): Uint8Array {\n\t\tif (this.lexicon.caseInsensitive) s = s.toLowerCase()\n\t\tconst bitsPerChar = Math.log2(this.lexicon.characters.length)\n\t\tif (Number.isInteger(bitsPerChar)) {\n\t\t\t// Bitstream mode (for power-of-2 lexicons)\n\t\t\tlet bitBuffer = 0\n\t\t\tlet bitCount = 0\n\t\t\tconst output: number[] = []\n\n\t\t\tfor (const char of s) {\n\t\t\t\tif (char === this.lexicon.padding?.character) continue\n\t\t\t\tconst val = this.lookup[char]\n\t\t\t\tif (val === undefined) throw new Error(`Invalid character: ${char}`)\n\t\t\t\tbitBuffer = (bitBuffer << bitsPerChar) | val\n\t\t\t\tbitCount += bitsPerChar\n\n\t\t\t\twhile (bitCount >= 8) {\n\t\t\t\t\tbitCount -= 8\n\t\t\t\t\toutput.push((bitBuffer >> bitCount) & 0xFF)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new Uint8Array(output)\n\t\t}\n\n\t\t// Radix mode fallback\n\t\tlet num = 0n\n\t\tconst base = BigInt(this.lexicon.characters.length)\n\t\tif (s.startsWith(this.negativePrefix)) {\n\t\t\ts = s.slice(this.negativePrefix.length)\n\t\t}\n\t\tconst zeroCharacter = this.lexicon.characters[0]\n\t\tlet leadingZeroBytes = 0\n\t\twhile (s[leadingZeroBytes] === zeroCharacter)\n\t\t\tleadingZeroBytes++\n\t\ts = s.slice(leadingZeroBytes)\n\t\tfor (const char of s) {\n\t\t\tconst val = this.lookup[char]\n\t\t\tif (val === undefined) throw new Error(`Invalid character: ${char}`)\n\t\t\tnum = num * base + BigInt(val)\n\t\t}\n\t\tconst out = new Uint8Array(leadingZeroBytes + (num === 0n ? 0 : this.countBytes(num)))\n\t\tlet writeIndex = out.length\n\t\twhile (num > 0n) {\n\t\t\tout[--writeIndex] = Number(num % 256n)\n\t\t\tnum = num / 256n\n\t\t}\n\t\treturn out\n\t}\n\n\tfromBytes(bytes: Uint8Array): string {\n\t\tconst bitsPerChar = Math.log2(this.lexicon.characters.length)\n\t\tif (Number.isInteger(bitsPerChar)) {\n\t\t\t// Bitstream mode (for power-of-2 lexicons)\n\t\t\tlet bitBuffer = 0\n\t\t\tlet bitCount = 0\n\t\t\tlet out = \"\"\n\n\t\t\tfor (const byte of bytes) {\n\t\t\t\tbitBuffer = (bitBuffer << 8) | byte\n\t\t\t\tbitCount += 8\n\n\t\t\t\twhile (bitCount >= bitsPerChar) {\n\t\t\t\t\tbitCount -= bitsPerChar\n\t\t\t\t\tconst index = (bitBuffer >> bitCount) & ((1 << bitsPerChar) - 1)\n\t\t\t\t\tout += this.lexicon.characters[index]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// \uD83E\uDE79 flush remaining bits\n\t\t\tif (bitCount > 0) {\n\t\t\t\tconst index = (bitBuffer << (bitsPerChar - bitCount)) & ((1 << bitsPerChar) - 1)\n\t\t\t\tout += this.lexicon.characters[index]\n\t\t\t}\n\n\t\t\t// Add padding if applicable\n\t\t\tif (this.lexicon.padding) {\n\t\t\t\twhile (out.length % this.lexicon.padding.size !== 0)\n\t\t\t\t\tout += this.lexicon.padding.character\n\t\t\t}\n\n\t\t\treturn out\n\t\t}\n\n\t\t// Radix mode fallback\n\t\tif (bytes.length === 0) return \"\"\n\t\tconst zeroCharacter = this.lexicon.characters[0]\n\t\tlet leadingZeroBytes = 0\n\t\twhile (bytes[leadingZeroBytes] === 0)\n\t\t\tleadingZeroBytes++\n\t\tlet num = 0n\n\t\tfor (const byte of bytes.slice(leadingZeroBytes))\n\t\t\tnum = (num << 8n) + BigInt(byte)\n\n\t\tif (num === 0n) return zeroCharacter.repeat(leadingZeroBytes)\n\n\t\tconst base = BigInt(this.lexicon.characters.length)\n\t\tlet out = \"\"\n\t\twhile (num > 0n) {\n\t\t\tout = this.lexicon.characters[Number(num % base)] + out\n\t\t\tnum = num / base\n\t\t}\n\t\treturn zeroCharacter.repeat(leadingZeroBytes) + out\n\t}\n\n\ttoInteger(s: string) {\n\t\tif (!s) return 0\n\t\tlet n = 0n\n\t\tlet negative = false\n\t\tconst base = BigInt(this.lexicon.characters.length)\n\t\tif (s.startsWith(this.negativePrefix)) {\n\t\t\ts = s.slice(this.negativePrefix.length)\n\t\t\tnegative = true\n\t\t}\n\t\tfor (const char of s) {\n\t\t\tconst value = this.lookup[char]\n\t\t\tif (value === undefined) throw new Error(`Invalid character: ${char}`)\n\t\t\tn = n * base + BigInt(value)\n\t\t}\n\t\treturn Number(negative ? -n : n)\n\t}\n\n\tfromInteger(n: number) {\n\t\tn = Math.floor(n)\n\t\tconst negative = n < 0\n\t\tlet num = BigInt(negative ? -n : n)\n\t\tif (num === 0n) return this.lexicon.characters[0]\n\t\tconst base = BigInt(this.lexicon.characters.length)\n\t\tlet out = \"\"\n\t\twhile (num > 0n) {\n\t\t\tout = this.lexicon.characters[Number(num % base)] + out\n\t\t\tnum = num / base\n\t\t}\n\t\treturn negative ? `${this.negativePrefix}${out}` : out\n\t}\n\n\trandom(count = 32) {\n\t\treturn this.fromBytes(bytes.random(count))\n\t}\n\n\tprivate countBytes(num: bigint) {\n\t\tlet count = 0\n\t\twhile (num > 0n) {\n\t\t\tcount++\n\t\t\tnum = num / 256n\n\t\t}\n\t\treturn count\n\t}\n}\n", "\nimport {BaseX} from \"./base-x.js\"\n\nexport const hex = new BaseX(BaseX.lexicons.hex)\nexport const base2 = new BaseX(BaseX.lexicons.base2)\nexport const base36 = new BaseX(BaseX.lexicons.base36)\nexport const base58 = new BaseX(BaseX.lexicons.base58)\nexport const base62 = new BaseX(BaseX.lexicons.base62)\nexport const base64 = new BaseX(BaseX.lexicons.base64)\nexport const base64url = new BaseX(BaseX.lexicons.base64url)\n\n", "\nimport {AnyFunction, DebounceReturn} from \"./types.js\"\n\nexport function debounce<xAction extends AnyFunction>(\n\t\tdelay: number,\n\t\taction: xAction,\n\t): DebounceReturn<xAction> {\n\n\tlet latestArgs: any[]\n\tlet timeout: any\n\n\tlet waitingQueue: {\n\t\tresolve: (r: ReturnType<xAction>) => void\n\t\treject: (reason: any) => void\n\t}[] = []\n\n\tfunction reset() {\n\t\tlatestArgs = []\n\t\tif (timeout)\n\t\t\tclearTimeout(timeout)\n\t\ttimeout = undefined\n\t\twaitingQueue = []\n\t}\n\n\treset()\n\n\treturn <DebounceReturn<xAction>>((...args) => {\n\t\tlatestArgs = args\n\n\t\tif (timeout)\n\t\t\tclearTimeout(timeout)\n\n\t\tconst promise = new Promise((resolve, reject) => {\n\t\t\twaitingQueue.push({resolve, reject})\n\t\t})\n\n\t\ttimeout = setTimeout(() => {\n\t\t\tPromise.resolve()\n\t\t\t\t.then(() => action(...latestArgs))\n\t\t\t\t.then(r => {\n\t\t\t\t\tfor (const {resolve} of waitingQueue)\n\t\t\t\t\t\tresolve(r)\n\t\t\t\t\treset()\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tfor (const {reject} of waitingQueue)\n\t\t\t\t\t\treject(err)\n\t\t\t\t\treset()\n\t\t\t\t})\n\t\t}, delay)\n\n\t\treturn promise\n\t})\n}\n", "\n/** a promise which can be resolved or rejected from the outside */\nexport type Deferred<R = void> = Promise<R> & {\n\tpromise: Promise<R>\n\tresolve: (result: R | PromiseLike<R>) => void\n\treject: (reason: any) => void\n\n\t/** adopt the outcome of another promise */\n\tentangle: (other: Promise<R>) => Promise<R>\n}\n\n/** returns a deferred promise with exposed resolve and reject fns */\nexport function defer<R = void>(): Deferred<R> {\n\tlet resolve!: (result: R | PromiseLike<R>) => void\n\tlet reject!: (reason: any) => void\n\n\tconst promise = new Promise<R>((res, rej) => {\n\t\tresolve = res\n\t\treject = rej\n\t}) as Deferred<R>\n\n\tpromise.resolve = resolve\n\tpromise.reject = reject\n\tpromise.promise = promise\n\n\tpromise.entangle = (other: Promise<R>) => {\n\t\tother.then(resolve, reject)\n\t\treturn promise\n\t}\n\n\treturn promise\n}\n\n", "\nimport {defer, Deferred} from \"../defer.js\"\n\nexport function microbounce<F extends (...params: any[]) => any>(fn: F) {\n\tlet scheduled: {\n\t\tparams: any[]\n\t\tdeferred: Deferred<any>\n\t} | null = null\n\n\treturn ((...params: any[]) => {\n\t\tif (scheduled) {\n\t\t\tscheduled.params = params\n\t\t}\n\t\telse {\n\t\t\tscheduled = {params, deferred: defer()}\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tconst {params, deferred} = scheduled!\n\t\t\t\tscheduled = null\n\t\t\t\tPromise.resolve(fn(...params))\n\t\t\t\t\t.then(deferred.resolve)\n\t\t\t\t\t.catch(deferred.reject)\n\t\t\t})\n\t\t}\n\t\treturn scheduled.deferred.promise\n\t}) as ((...params: Parameters<F>) => Promise<Awaited<ReturnType<F>>>)\n}\n\n", "\nexport function deepClone<T>(data: T, refs = new Set<any>()): T {\n\n\tif (refs.has(data))\n\t\tthrow new Error(\"cannot clone circular reference\")\n\n\tlet copy = undefined as T\n\n\tif (typeof data === \"function\" || (data !== null && typeof data === \"object\")) {\n\t\trefs.add(data)\n\n\t\tif (Array.isArray(data))\n\t\t\tcopy = data.map(d => deepClone(d, new Set(refs))) as T\n\n\t\telse if (data.constructor === Object)\n\t\t\tcopy = Object.fromEntries(\n\t\t\t\tObject.entries(data)\n\t\t\t\t\t.map(([key, d]) => [key, deepClone(d, new Set(refs))])\n\t\t\t) as T\n\n\t\telse if (data instanceof Map)\n\t\t\tcopy = new Map(Array.from(data, ([key, val]) => [key, deepClone(val, new Set(refs))])) as T\n\n\t\telse if (data instanceof Set)\n\t\t\tcopy = new Set(Array.from(data, val => deepClone(val, new Set(refs)))) as T\n\n\t\telse if (data instanceof Date)\n\t\t\tcopy = new Date(data.getTime()) as T\n\n\t\telse\n\t\t\tcopy = data\n\n\t\trefs.delete(data) // Remove current data from refs once we're done with this branch of the object tree\n\t}\n\n\telse\n\t\tcopy = data\n\n\treturn copy\n}\n\n", "\n/** is not null or undefined */\nexport function isHappy<X>(x: X): x is NonNullable<X> {\n\treturn x !== undefined && x !== null\n}\n\n/** is null or undefined */\nexport function isSad(x: any): x is (undefined | null) {\n\treturn x === undefined || x === null\n}\n\nexport const isBoolean = (x: any): x is boolean =>\n\ttypeof x === \"boolean\"\n\nexport const isNumber = (x: any): x is number =>\n\ttypeof x === \"number\"\n\nexport const isString = (x: any): x is string =>\n\ttypeof x === \"string\"\n\nexport const isBigint = (x: any): x is bigint =>\n\ttypeof x === \"bigint\"\n\nexport const isObject = <X>(x: X): x is object & NonNullable<X> =>\n\ttypeof x === \"object\" && x !== null\n\nexport const isArray = (x: any | any[]): x is any[] =>\n\tArray.isArray(x)\n\nexport const isFn = (x: any): x is (...a: any[]) => any =>\n\ttypeof x === \"function\"\n\nexport const isSymbol = (x: any): x is symbol =>\n\ttypeof x === \"symbol\"\n\n/////////////////////////////////////////\n\n/** not null or undefined\n * @deprecated renamed to `isHappy`\n */\nexport function happy<X>(x: X): x is NonNullable<X> {\n\treturn x !== undefined && x !== null\n}\n\n/** null or undefined\n * @deprecated renamed to `isHappy`\n */\nexport function sad(x: any): x is (undefined | null) {\n\treturn x === undefined || x === null\n}\n\n/** @deprecated please use `isNumber` instead of `is.number`, etc */\nexport const is = Object.freeze({\n\n\t/** not null or undefined */\n\thappy,\n\n\t/** null or undefined */\n\tsad,\n\n\t/** @deprecated renamed to `isBoolean` */\n\tboolean: (x: any): x is boolean =>\n\t\ttypeof x === \"boolean\",\n\n\t/** @deprecated renamed to `isNumber` */\n\tnumber: (x: any): x is number =>\n\t\ttypeof x === \"number\",\n\n\t/** @deprecated renamed to `isString` */\n\tstring: (x: any): x is string =>\n\t\ttypeof x === \"string\",\n\n\t/** @deprecated renamed to `isBigint` */\n\tbigint: (x: any): x is bigint =>\n\t\ttypeof x === \"bigint\",\n\n\t/** @deprecated renamed to `isObject` */\n\tobject: <X>(x: X): x is object & NonNullable<X> =>\n\t\ttypeof x === \"object\" && x !== null,\n\n\t/** @deprecated renamed to `isArray` */\n\tarray: (x: any | any[]): x is any[] =>\n\t\tArray.isArray(x),\n\n\t/** @deprecated renamed to `isFn` */\n\tfn: (x: any): x is (...a: any[]) => any =>\n\t\ttypeof x === \"function\",\n\n\t/** @deprecated renamed to `isSymbol` */\n\tsymbol: (x: any): x is symbol =>\n\t\ttypeof x === \"symbol\",\n})\n\n", "\nimport {isObject} from \"../is.js\"\n\nexport const deepEqual = (alpha: any, bravo: any): boolean => {\n\n\tfunction recurse(alpha: any, bravo: any, parents: object[]) {\n\t\tif (!isObject(alpha) || !isObject(bravo))\n\t\t\treturn alpha === bravo\n\n\t\tif (parents.includes(alpha))\n\t\t\tthrow new Error(`forbidden circularity detected in deep equal comparison`)\n\n\t\tconst newParents = [...parents, alpha]\n\n\t\tif (alpha instanceof Map && bravo instanceof Map) {\n\t\t\tif (alpha.size !== bravo.size)\n\t\t\t\treturn false\n\t\t\tfor (const [key, val] of alpha)\n\t\t\t\tif (!bravo.has(key) || !recurse(val, bravo.get(key), newParents))\n\t\t\t\t\treturn false\n\t\t}\n\t\telse if (alpha instanceof Set && bravo instanceof Set) {\n\t\t\tif (alpha.size !== bravo.size)\n\t\t\t\treturn false\n\t\t\tfor (const item of alpha)\n\t\t\t\tif (!Array.from(bravo).some(bItem => recurse(item, bItem, newParents)))\n\t\t\t\t\treturn false\n\t\t}\n\t\telse {\n\t\t\tconst keys1 = Object.keys(alpha)\n\t\t\tconst keys2 = Object.keys(bravo)\n\n\t\t\tif (keys1.length !== keys2.length)\n\t\t\t\treturn false\n\n\t\t\tfor (const key of keys1) {\n\t\t\t\tif (!keys2.includes(key))\n\t\t\t\t\treturn false\n\t\t\t\tif (!recurse(alpha[key], bravo[key], newParents))\n\t\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\treturn true\n\t}\n\n\treturn recurse(alpha, bravo, [])\n}\n\n", "\nimport {isObject} from \"../is.js\"\n\nexport function deepFreeze<X>(item: X): X {\n\tfunction recurse(x: X, parents: object[]) {\n\t\tif (!isObject(x) || parents.includes(x))\n\t\t\treturn x\n\n\t\tconst newParents = [...parents, x]\n\n\t\tif (x instanceof Map)\n\t\t\tfor (const arr of x.entries())\n\t\t\t\tfor (const y of arr)\n\t\t\t\t\trecurse(y, newParents)\n\n\t\telse if (x instanceof Set)\n\t\t\tfor (const y of x)\n\t\t\t\trecurse(y, newParents)\n\n\t\telse if (Array.isArray(x))\n\t\t\tfor (const y of x)\n\t\t\t\trecurse(y, newParents)\n\n\t\telse\n\t\t\tfor (const y of Object.values(x))\n\t\t\t\trecurse(y, newParents)\n\n\t\treturn Object.freeze(x)\n\t}\n\n\treturn recurse(item, [])\n}\n\n", "\nimport type {Result} from \"../types/result.js\"\n\n/** return ok value, otherwise throw error */\nexport function gotOk<Value, E>(result: Result<Value, E>): Value {\n\tif (result.ok)\n\t\treturn result.value\n\n\tconst {error} = result\n\n\tif (error instanceof Error)\n\t\tthrow error\n\n\telse if (typeof error === \"string\")\n\t\tthrow new Error(error)\n\n\telse\n\t\tthrow new Error(\"unknown\")\n}\n\n/** return error, otherwise throw error */\nexport function gotErr<E>(result: Result<unknown, E>): E {\n\tif (result.ok) throw new Error(\"didn't get needed error\")\n\treturn result.error\n}\n\n", "\nimport {Random} from \"./types.js\"\n\nconst step = 0x6D2B79F5\nconst scale = 0x100000000\nconst encoder = new TextEncoder()\n\nexport function rand32() {\n\treturn crypto.getRandomValues(new Uint32Array(1))[0]!\n}\n\nfunction mix32(x: number) {\n\tx = Math.imul(x ^ (x >>> 15), x | 1)\n\tx ^= x + Math.imul(x ^ (x >>> 7), x | 61)\n\tx ^= x >>> 14\n\treturn x >>> 0\n}\n\nfunction string32(text: string) {\n\tlet hash = 0x811C9DC5\n\n\tfor (const byte of encoder.encode(text)) {\n\t\thash ^= byte\n\t\thash = Math.imul(hash, 0x01000193)\n\t}\n\n\treturn mix32(hash)\n}\n\nexport function hash32(...values: (number | string)[]) {\n\tlet hash = 0x9E3779B9\n\n\tfor (const value of values) {\n\t\tconst u32 = typeof value === \"string\"\n\t\t\t? string32(value)\n\t\t\t: value >>> 0\n\n\t\thash = (hash + step) >>> 0\n\t\thash ^= mix32(u32)\n\t\thash = mix32(hash)\n\t}\n\n\treturn hash\n}\n\nexport function mulberry(\n\t\tu32 = rand32(),\n\t\t...salts: (number | string)[]\n\t): Random {\n\n\tlet state = salts.length\n\t\t? hash32(u32, ...salts)\n\t\t: u32 >>> 0\n\n\treturn () => {\n\t\tstate = (state + step) >>> 0\n\t\treturn mix32(state) / scale\n\t}\n}\n\n", "\nexport function got<X>(thing: X | undefined | null, err = \"got failed\"): X {\n\tif (thing === undefined || thing === null) throw new Error(err)\n\treturn thing\n}\n\n", "\nexport type MapLike<K, V> = {\n\thas(key: K): boolean\n\tget(key: K): V | undefined\n\tset(key: K, value: V): unknown\n}\n\nexport function need<K, V>(\n\t\tmap: Pick<MapLike<K, V>, \"has\" | \"get\">,\n\t\tkey: K,\n\t\terr = (typeof key === \"string\" ? `needed key not found \"${key}\"` : \"needed key not found\"),\n\t) {\n\tif (map.has(key))\n\t\treturn map.get(key) as V\n\telse\n\t\tthrow new Error(err)\n}\n\nexport function guarantee<K, V>(map: MapLike<K, V>, key: K, make: () => V) {\n\tif (map.has(key))\n\t\treturn map.get(key)!\n\telse {\n\t\tconst value = make()\n\t\tmap.set(key, value)\n\t\treturn value\n\t}\n}\n\nexport function setEntries<K, V, M extends Pick<MapLike<K, V>, \"set\">>(map: M, entries: Iterable<[K, V]>) {\n\tfor (const [key, value] of entries)\n\t\tmap.set(key, value)\n\treturn map\n}\n\n", "\nexport function arraylimit<X>(array: X[], limit: number) {\n\tif (limit <= 0) return []\n\treturn (array.length > limit)\n\t\t? array.slice(-limit)\n\t\t: array\n}\n\n", "\nexport async function collect<X>(iterable: AsyncIterable<X>) {\n\tconst array: X[] = []\n\tfor await (const item of iterable) array.push(item)\n\treturn array\n}\n\n", "\n/**\n * repeat the given async function over and over.\n * - consider using `nap` in your fn to create a delay\n */\nexport function cycle(fn: (stop: () => void) => unknown | Promise<unknown>) {\n\tlet timeout: any\n\tlet stopped = false\n\n\tconst stop = () => {\n\t\tstopped = true\n\t\tclearTimeout(timeout)\n\t}\n\n\tconst tick = async() => {\n\t\tif (stopped) return\n\t\tawait fn(stop)\n\t\tif (stopped) return\n\t\ttimeout = setTimeout(tick, 0)\n\t}\n\n\ttick()\n\treturn stop\n}\n\n", "\nexport type Disposer = {\n\t(): void\n\tdispose: () => void\n\tschedule: (...fns: (() => void)[]) => Disposer\n\town: <X>(x: X, fn: (x: X) => void) => X\n\tdisposable: <X extends Disposable>(x: X) => X\n\n\t/** @deprecated typo renamed to `disposable` */\n\tdisposables: <X extends Disposable>(x: X) => X\n}\n\nexport type Disposable = {\n\tdispose: () => void\n}\n\nexport function disposer(): Disposer {\n\tlet fns: (() => void)[] = []\n\n\tconst dispose = () => {\n\t\tconst doomed = fns\n\t\tfns = []\n\t\tfor (let i = doomed.length - 1; i >= 0; i--)\n\t\t\tdoomed[i]()\n\t}\n\n\tfunction d() {\n\t\tdispose()\n\t}\n\n\td.dispose = dispose\n\n\td.schedule = (...newFns: (() => void)[]) => {\n\t\tfns.push(...newFns)\n\t\treturn d\n\t}\n\n\td.own = <X>(x: X, fn: (x: X) => void) => {\n\t\tfns.push(() => fn(x))\n\t\treturn x\n\t}\n\n\td.disposable = <X extends Disposable>(x: X) => {\n\t\tfns.push(() => x.dispose())\n\t\treturn x\n\t}\n\n\td.disposables = d.disposable\n\n\treturn d\n}\n\n", "\nexport type EvFn = (...a: any[]) => void\n\nexport type EvTarget<N extends string> = {\n\taddEventListener(name: N, fn: EvFn): void\n\tremoveEventListener(name: N, fn: EvFn): void\n}\n\nexport function ev<N extends string>(target: EvTarget<N>, fns: Record<N, EvFn>) {\n\tconst entries = Object.entries(fns) as [N, EvFn][]\n\n\tfor (const [name, fn] of entries)\n\t\ttarget.addEventListener(name, fn)\n\n\treturn () => {\n\t\tfor (const [name, fn] of entries)\n\t\t\ttarget.removeEventListener(name, fn)\n\t}\n}\n\n", "\nexport class IdCounter {\n\tconstructor(public count = 0) {}\n\n\tnext() {\n\t\treturn this.count++\n\t}\n}\n\n", "\n/** create a promise that waits for a number of milliseconds. */\nexport const nap = (milliseconds: number = 0) => (\n\tnew Promise<void>(resolve => setTimeout(resolve, milliseconds))\n)\n\n", "\nexport type ObTransform<Ob extends object, Value> = (\n\t(value: Ob[keyof Ob], key: keyof Ob) => Value\n)\n\nexport type ObPredicate<Ob extends object> = (\n\t(value: Ob[keyof Ob], key: keyof Ob) => boolean\n)\n\nexport const obmap = <Ob extends object, Value>(\n\t\to: Ob,\n\t\ttransform: ObTransform<Ob, Value>,\n\t) => {\n\n\treturn Object.fromEntries(\n\t\tObject.entries(o).map(\n\t\t\t([key, value]: any) => [key, transform(value, key)]\n\t\t)\n\t) as {[P in keyof Ob]: Value}\n}\n\nexport const obfilter = <Ob extends object>(\n\t\to: Ob,\n\t\tpredicate: ObPredicate<Ob>,\n\t) => {\n\n\treturn Object.fromEntries(\n\t\tObject.entries(o).filter(\n\t\t\t([key, value]: any) => predicate(value, key)\n\t\t)\n\t) as {[P in keyof Ob]?: Ob[keyof Ob]}\n}\n\n////////////////////////////////////////////////////////////////\n\n/** @deprecated use `obmap` and `obfilter` directly. */\nexport function ob<Ob extends object>(o: Ob) {\n\treturn {\n\t\tmap: <Value>(transform: ObTransform<Ob, Value>) => (\n\t\t\tobMap(o, transform)\n\t\t),\n\t\tfilter: (predicate: ObPredicate<Ob>) => (\n\t\t\tobFilter(o, predicate)\n\t\t),\n\t}\n}\n\n/** @deprecated */\nob.pipe = Object.freeze({\n\tmap: <O extends {}, Value>(\n\t\t\ttransform: (value: O[keyof O], key: keyof O) => Value,\n\t\t) => (\n\t\t(o: O) => obMap(o, transform)\n\t),\n\tfilter: <O extends {}>(\n\t\t\ttransform: (value: O[keyof O], key: keyof O) => boolean,\n\t\t) => (\n\t\t(o: O) => obFilter(o, transform) as {[key: string]: O[keyof O]}\n\t),\n})\n\n/** @deprecated renamed to `obmap` */\nexport const obMap = obmap\n\n/** @deprecated renamed to `obfilter` */\nexport const obFilter = obfilter\n\n", "\nimport {defer, Deferred} from \"./defer.js\"\n\nexport type On<P extends any[] = []> = (fn: Fn<P>) => () => void\nexport type Publish<P extends any[] = []> = (...p: P) => void\n\nexport type Subby<P extends any[] = []> = On<P> & ReturnType<typeof mk<P>>\nexport type Pubby<P extends any[] = []> = Publish<P> & ReturnType<typeof mk<P>>\n\nexport function subby<P extends any[] = []>(fn?: Fn<P>) {\n\tconst tools = mk<P>()\n\tconst subby = (fn: Fn<P>) => tools.on(fn)\n\tObject.assign(subby, tools)\n\tif (fn) tools.on(fn)\n\treturn subby as Subby<P>\n}\n\nexport function pubby<P extends any[] = []>(fn?: Fn<P>) {\n\tconst tools = mk<P>()\n\tconst pubby = (...p: P) => tools.publish(...p)\n\tObject.assign(pubby, tools)\n\tif (fn) tools.on(fn)\n\treturn pubby as Pubby<P>\n}\n\ntype Fn<P extends any[]> = (...p: P) => unknown\n\nfunction mk<P extends any[]>() {\n\tconst set = new Set<Fn<P>>()\n\n\tlet waiter: Deferred<P> | undefined\n\tconst next = () => waiter ??= defer()\n\tconst resolveWaiter = (p: P) => {\n\t\tconst ready = waiter\n\t\twaiter = undefined\n\t\tready?.resolve(p)\n\t}\n\n\tconst on = (fn: Fn<P>) => {\n\t\tset.add(fn)\n\t\treturn () => { set.delete(fn) }\n\t}\n\n\tconst publish = (...p: P) => {\n\t\tresolveWaiter(p)\n\t\tfor (const fn of [...set])\n\t\t\tfn(...p)\n\t}\n\n\tconst publishAsync = async(...p: P) => {\n\t\tresolveWaiter(p)\n\t\tawait Promise.all([...set].map(async fn => fn(...p)))\n\t}\n\n\treturn {set, on, publish, publishAsync, next}\n}\n\n", "\nexport type TemplateParts = {\n\tstrings: TemplateStringsArray\n\tvalues: any[]\n}\n\nexport function templateParts(\n\t\tstrings: TemplateStringsArray,\n\t\t...values: any[]\n\t): TemplateParts {\n\n\treturn {strings, values}\n}\n\nexport function templateString(strings: TemplateStringsArray, ...values: any[]) {\n\tconst lastIndex = strings.length - 1\n\treturn strings\n\t\t.slice(0, lastIndex)\n\t\t.reduce((a, b, c) => a + b + values[c], \"\")\n\t\t\t+ strings[lastIndex]\n}\n\n", "\nimport {isHappy} from \"./is.js\"\n\n/** when truthy, do something. */\nexport function when<Y>(\n\t\tx: unknown,\n\t\tyes: () => Y,\n\t\tno?: () => void,\n\t): Y | void {\n\n\treturn x\n\t\t? yes()\n\t\t: no?.()\n}\n\n/** given a non-null non-undefined thing, do something with it. */\nexport function given<X, Y>(\n\t\tx: X,\n\t\tyes: (x: NonNullable<X>) => Y,\n\t\tno?: () => void,\n\t): Y | void {\n\n\treturn isHappy(x)\n\t\t? yes(x)\n\t\t: no?.()\n}\n\n", "\nimport {guarantee} from \"@e280/stz\"\n\nexport type Trackable = object | symbol\n\n/**\n * reactivity integration hub\n */\nexport class Tracker<Item extends Trackable = any> {\n\t#busy = new Set<() => void>()\n\t#observationLayers: Set<Item>[] = []\n\t#subscriptions = new WeakMap<Item, Set<() => void>>()\n\n\t#batchDepth = 0\n\t#batchPending = new Set<() => void>()\n\n\t/** indicate to observers that this item was accessed */\n\tread(item: Item) {\n\t\tconst top = this.#observationLayers.at(-1)\n\t\ttop?.add(item)\n\t}\n\n\t/** invoke all subscriptions for this item */\n\twrite(item: Item) {\n\t\tconst fns = this.#subscriptions.get(item)\n\t\tif (!fns) return\n\n\t\tfor (const fn of fns)\n\t\t\tthis.#batchPending.add(fn)\n\n\t\tif (this.#batchDepth === 0)\n\t\t\tthis.#flush()\n\t}\n\n\t/** collect items that were read during fn */\n\tobserve<Value>(fn: () => Value) {\n\t\tconst seen = new Set<Item>()\n\t\tthis.#observationLayers.push(seen)\n\t\ttry {\n\t\t\tconst value = fn()\n\t\t\treturn {seen, value}\n\t\t}\n\t\tfinally {\n\t\t\tthis.#observationLayers.pop()\n\t\t}\n\t}\n\n\t/** fn will be called when item changes */\n\tsubscribe(item: Item, fn: () => void) {\n\t\tconst fns = guarantee(this.#subscriptions, item, () => new Set())\n\t\tfns.add(fn)\n\t\treturn () => {\n\t\t\tfns.delete(fn)\n\t\t\tif (fns.size === 0)\n\t\t\t\tthis.#subscriptions.delete(item)\n\t\t}\n\t}\n\n\tbatch = <R>(fn: () => R) => {\n\t\tthis.#batchDepth++\n\t\ttry {\n\t\t\treturn fn()\n\t\t}\n\t\tfinally {\n\t\t\tthis.#batchDepth--\n\t\t\tif (this.#batchDepth === 0)\n\t\t\t\tthis.#flush()\n\t\t}\n\t}\n\n\t#run(fn: () => void) {\n\t\tif (this.#busy.has(fn))\n\t\t\tthrow new Error(\"circularity forbidden\")\n\t\tthis.#busy.add(fn)\n\t\ttry { fn() }\n\t\tfinally { this.#busy.delete(fn) }\n\t}\n\n\t#flush() {\n\t\twhile (this.#batchPending.size > 0) {\n\t\t\tconst pending = [...this.#batchPending]\n\t\t\tthis.#batchPending.clear()\n\n\t\t\tfor (const fn of pending)\n\t\t\t\tthis.#run(fn)\n\t\t}\n\t}\n}\n\n", "\nimport {Tracker} from \"./tracker.js\"\n\n/** standard global tracker for integrations */\nexport const tracker: Tracker = (globalThis as any)[Symbol.for(\"e280.tracker.2\")] ??= new Tracker()\n\n", "\nimport {Subby, subby} from \"@e280/stz\"\nimport {Signal} from \"./types.js\"\nimport {tracker} from \"../tracker/global.js\"\n\nexport function signal<Value>(value: Value): Signal<Value> {\n\tlet on: undefined | Subby<[Value]>\n\n\tfunction sig() {\n\t\tif (arguments.length === 0) {\n\t\t\ttracker.read(sig)\n\t\t\treturn value\n\t\t}\n\t\telse {\n\t\t\tvalue = arguments[0]\n\t\t\ttracker.write(sig)\n\t\t\ton?.publish(value)\n\t\t\treturn value\n\t\t}\n\t}\n\n\tsig.get = () => sig()\n\tsig.set = (value: Value) => (<any>sig)(value)\n\tsig.on = (fn: (value: Value) => void) => (on ??= subby())(fn)\n\n\treturn sig\n}\n\n", "\nimport {tracker} from \"../../tracker/global.js\"\n\nexport class RMap<K, V> extends Map<K, V> {\n\n\t//\n\t// reading\n\t//\n\n\tget size() {\n\t\ttracker.read(this)\n\t\treturn super.size\n\t}\n\n\t;[Symbol.iterator]() {\n\t\ttracker.read(this)\n\t\treturn super[Symbol.iterator]()\n\t}\n\n\tforEach(callbackFn: (value: V, key: K, map: RMap<K, V>) => void) {\n\t\ttracker.read(this)\n\t\tfor (const [key, value] of this)\n\t\t\tcallbackFn(value, key, this)\n\t\treturn this\n\t}\n\n\tkeys() {\n\t\ttracker.read(this)\n\t\treturn super.keys()\n\t}\n\n\tvalues() {\n\t\ttracker.read(this)\n\t\treturn super.values()\n\t}\n\n\tentries() {\n\t\ttracker.read(this)\n\t\treturn super.entries()\n\t}\n\n\thas(key: K) {\n\t\ttracker.read(this)\n\t\treturn super.has(key)\n\t}\n\n\tget(key: K) {\n\t\ttracker.read(this)\n\t\treturn super.get(key)\n\t}\n\n\t//\n\t// writing\n\t//\n\n\tset(key: K, value: V) {\n\t\tsuper.set(key, value)\n\t\ttracker.write(this)\n\t\treturn this\n\t}\n\n\tdelete(key: K) {\n\t\tconst ret = super.delete(key)\n\t\ttracker.write(this)\n\t\treturn ret\n\t}\n\n\tclear() {\n\t\tsuper.clear()\n\t\ttracker.write(this)\n\t\treturn this\n\t}\n}\n\n", "\nimport {tracker} from \"../../tracker/global.js\"\n\nexport class RSet<V> extends Set<V> {\n\n\t//\n\t// reading\n\t//\n\n\tget size() {\n\t\ttracker.read(this)\n\t\treturn super.size\n\t}\n\n\t;[Symbol.iterator]() {\n\t\ttracker.read(this)\n\t\treturn super[Symbol.iterator]()\n\t}\n\n\tforEach(callbackFn: (value: V, value2: V, set: RSet<V>) => void) {\n\t\ttracker.read(this)\n\t\tfor (const value of this)\n\t\t\tcallbackFn(value, value, this)\n\t\treturn this\n\t}\n\n\tvalues() {\n\t\ttracker.read(this)\n\t\treturn super.values()\n\t}\n\n\thas(item: V) {\n\t\ttracker.read(this)\n\t\treturn super.has(item)\n\t}\n\n\t//\n\t// writing\n\t//\n\n\tadd(item: V) {\n\t\tsuper.add(item)\n\t\ttracker.write(this)\n\t\treturn this\n\t}\n\n\tdelete(item: V) {\n\t\tconst ret = super.delete(item)\n\t\ttracker.write(this)\n\t\treturn ret\n\t}\n\n\tclear() {\n\t\tsuper.clear()\n\t\ttracker.write(this)\n\t\treturn this\n\t}\n}\n\n", "\nimport {tracker} from \"../tracker/global.js\"\n\nexport const batch = tracker.batch\n\n", "\nimport {deepClone, deepFreeze} from \"@e280/stz\"\nimport {Immutable} from \"../types.js\"\n\nexport function immute<S>(s: S) {\n\treturn deepFreeze(deepClone(s)) as Immutable<S>\n}\n\n", "\nexport const _optic = Symbol(\"optic\")\n\n", "\nexport class CacheCell<R> {\n\t#dirty = false\n\t#value: R\n\n\tconstructor(private calculate: () => R) {\n\t\tthis.#value = calculate()\n\t}\n\n\tget() {\n\t\tif (this.#dirty) {\n\t\t\tthis.#dirty = false\n\t\t\tthis.#value = this.calculate()\n\t\t}\n\t\treturn this.#value\n\t}\n\n\tinvalidate() {\n\t\tthis.#dirty = true\n\t}\n}\n\n", "\nimport {deepClone, deepEqual, subby} from \"@e280/stz\"\nimport {immute} from \"./utils/immute.js\"\nimport {tracker} from \"../tracker/global.js\"\nimport {_optic} from \"./utils/optic-symbol.js\"\nimport {CacheCell} from \"./utils/cache-cell.js\"\nimport {Immutable, LensLike, Optic} from \"./types.js\"\n\n/** reactive view into a state prism, with formalized mutations */\nexport class Lens<State> implements LensLike<State> {\n\t;[_optic]: Optic<State>\n\t#previous: State\n\t#stateCache: CacheCell<State>\n\t#frozenCache: CacheCell<Immutable<State>>\n\t#on = subby<[state: State]>()\n\n\tconstructor(optic: Optic<State>) {\n\t\tthis[_optic] = optic\n\t\tthis.#previous = deepClone(optic.getState())\n\t\tthis.#stateCache = new CacheCell(() => deepClone(optic.getState()))\n\t\tthis.#frozenCache = new CacheCell(() => immute(optic.getState()))\n\t}\n\n\tget on() {\n\t\treturn this.#on.on\n\t}\n\n\tupdate() {\n\t\tconst state = this[_optic].getState()\n\t\tconst isChanged = !deepEqual(state, this.#previous)\n\t\tif (isChanged) {\n\t\t\tthis.#stateCache.invalidate()\n\t\t\tthis.#frozenCache.invalidate()\n\t\t\tthis.#previous = deepClone(state)\n\t\t\ttracker.write(this)\n\t\t\tif (this.#on.set.size)\n\t\t\t\tthis.#on.publish(this.#stateCache.get())\n\t\t}\n\t}\n\n\t/** get a snapshot of the current state. it's typed as mutable, but you should not mutate it. */\n\tget state() {\n\t\ttracker.read(this)\n\t\treturn this.#stateCache.get()\n\t}\n\n\t/** get an immutable readonly snapshot of the current state. */\n\tget frozen() {\n\t\ttracker.read(this)\n\t\treturn this.#frozenCache.get()\n\t}\n\n\tmutate<R>(fn: (state: State) => R) {\n\t\treturn this[_optic].mutate(fn)\n\t}\n\n\tlens<State2>(selector: (state: State) => State2) {\n\t\tconst lens = new Lens<State2>({\n\t\t\tgetState: () => selector(this[_optic].getState()),\n\t\t\tmutate: fn => this[_optic].mutate(state => fn(selector(state))),\n\t\t\tregisterLens: this[_optic].registerLens,\n\t\t})\n\t\tthis[_optic].registerLens(lens)\n\t\treturn lens\n\t}\n}\n\n", "\nimport {getErr, getOk, gotOk, gotErr} from \"@e280/stz\"\nimport {WaitState} from \"./type.js\"\n\nexport function waitGet<Value>(wait: WaitState<Value>) {\n\treturn wait.done\n\t\t? getOk(wait)\n\t\t: undefined\n}\n\nexport function waitGot<Value>(wait: WaitState<Value>) {\n\tif (!wait.done) throw new Error(\"wait not done\")\n\treturn gotOk(wait)\n}\n\nexport function waitGetErr<E = unknown>(wait: WaitState<unknown, E>) {\n\treturn wait.done\n\t\t? getErr(wait)\n\t\t: undefined\n}\n\nexport function waitGotErr<E = unknown>(wait: WaitState<unknown, E>) {\n\tif (!wait.done) throw new Error(\"wait not done\")\n\treturn gotErr(wait)\n}\n\n", "\nimport {WaitState, WaitResult, WaitErr, WaitOk, WaitPending} from \"./type.js\"\n\nexport const isWaitPending = (state: WaitState<unknown>): state is WaitPending => !state.done\nexport const isWaitDone = <Value, E = unknown>(state: WaitState<Value, E>): state is WaitResult<Value, E> => state.done\nexport const isWaitOk = <Value>(state: WaitState<Value, unknown>): state is WaitOk<Value> => state.done && state.ok\nexport const isWaitErr = <E = unknown>(state: WaitState<unknown, E>): state is WaitErr<E> => state.done && !state.ok\n\n", "\nimport {WaitState} from \"./type.js\"\nimport {isWaitOk, isWaitPending} from \"./is.js\"\nimport {waitGotErr, waitGot} from \"./get.js\"\n\nexport function waitSelect<Ret, Value, E = unknown>(state: WaitState<Value, E>, select: {\n\t\tpending?: () => Ret\n\t\tok?: (value: Value) => Ret\n\t\terr?: (error: E) => Ret\n\t}) {\n\n\tconst {\n\t\tpending = () => {},\n\t\tok = () => {},\n\t\terr = () => {},\n\t} = select\n\n\tif (isWaitPending(state))\n\t\treturn pending()\n\n\telse if (isWaitOk(state))\n\t\treturn ok(waitGot(state))\n\n\telse\n\t\treturn err(waitGotErr(state))\n}\n\n", "\nexport function hasFiles(event: DragEvent) {\n\treturn !!(\n\t\tevent.dataTransfer &&\n\t\tevent.dataTransfer.types.includes(\"Files\")\n\t)\n}\n\nexport function files(event: DragEvent) {\n\treturn event.dataTransfer\n\t\t? Array.from(event.dataTransfer.files)\n\t\t: []\n}\n\nexport function outsideCurrentTarget(event: DragEvent) {\n\tconst currentTarget = event.currentTarget as HTMLElement\n\tconst relatedTarget = event.relatedTarget as HTMLElement\n\tconst nulled = !currentTarget || !relatedTarget\n\treturn nulled || !currentTarget.contains(relatedTarget)\n}\n\n", "\nimport {signal} from \"@e280/strata\"\nimport {Drops} from \"./drops.js\"\nimport {outsideCurrentTarget} from \"./helpers.js\"\n\n/** respond to user dragging-and-dropping things around on a webpage */\nexport class DragAndDrops<Draggy, Droppy> {\n\n\t/** what is currently being dragged */\n\t$draggy = signal<Draggy | undefined>(undefined)\n\n\t/** what dropzone are we curently hovering over */\n\t$droppy = signal<Droppy | undefined>(undefined)\n\n\tconstructor(private params: {\n\n\t\t/** accept a dropped item that was declared within this system */\n\t\tacceptDrop: (event: DragEvent, draggy: Draggy, droppy: Droppy) => void\n\n\t\t/** also accept drops on the side */\n\t\tbackchannelDrops?: Drops\n\t}) {}\n\n\tget dragging() {\n\t\treturn this.$draggy()\n\t}\n\n\tget hovering() {\n\t\treturn this.$droppy()\n\t}\n\n\t/** make event listeners to attach to your dragzone(s) */\n\tdragzone = (getDraggy: () => Draggy) => ({\n\t\tdraggable: \"true\",\n\n\t\tdragstart: (_: DragEvent) => {\n\t\t\tthis.$draggy(getDraggy())\n\t\t},\n\n\t\tdragend: (_: DragEvent) => {\n\t\t\tthis.$draggy(undefined)\n\t\t\tthis.$droppy(undefined)\n\t\t},\n\t})\n\n\t/** make event listeners to attach to your dropzones(s) */\n\tdropzone = (getDroppy: () => Droppy) => ({\n\t\tdragenter: (_: DragEvent) => {},\n\n\t\tdragover: (event: DragEvent) => {\n\t\t\tevent.preventDefault()\n\t\t\tif (this.$draggy())\n\t\t\t\tthis.$droppy(getDroppy())\n\t\t\telse\n\t\t\t\tthis.params.backchannelDrops?.dragover(event)\n\t\t},\n\n\t\tdragleave: (event: DragEvent) => {\n\t\t\tif (outsideCurrentTarget(event))\n\t\t\t\tthis.$droppy(undefined)\n\t\t\tthis.params.backchannelDrops?.dragleave(event)\n\t\t},\n\n\t\tdrop: (event: DragEvent) => {\n\t\t\tevent.preventDefault()\n\t\t\tconst {acceptDrop} = this.params\n\t\t\tconst draggy = this.$draggy()\n\t\t\tconst droppy = this.$droppy()\n\t\t\ttry {\n\t\t\t\tif (draggy && droppy)\n\t\t\t\t\tacceptDrop(event, draggy, droppy)\n\t\t\t\telse\n\t\t\t\t\tthis.params.backchannelDrops?.drop(event)\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tthis.$draggy(undefined)\n\t\t\t\tthis.$droppy(undefined)\n\t\t\t}\n\t\t},\n\t})\n}\n\n", "\nimport {signal} from \"@e280/strata\"\nimport {outsideCurrentTarget} from \"./helpers.js\"\n\n/** dropzone that accepts user-dropped stuff like files */\nexport class Drops {\n\t$indicator = signal(false)\n\n\tconstructor(private params: {\n\n\t\t/** whether or not the dragged item is acceptable for a drop */\n\t\tpredicate: (event: DragEvent) => boolean\n\n\t\t/** fn to handle the drop of an acceptable item */\n\t\tacceptDrop: (event: DragEvent) => void\n\t}) {}\n\n\tdragover = (event: DragEvent) => {\n\t\tevent.preventDefault()\n\t\tthis.$indicator(this.params.predicate(event))\n\t}\n\n\tdragleave = (event: DragEvent) => {\n\t\tif (outsideCurrentTarget(event))\n\t\t\tthis.$indicator(false)\n\t}\n\n\tdrop = (event: DragEvent) => {\n\t\tevent.preventDefault()\n\t\tthis.$indicator(false)\n\t\tif (this.params.predicate(event))\n\t\t\tthis.params.acceptDrop(event)\n\t}\n}\n\n", "\nimport {css, CSSResultGroup} from \"lit\"\n\nexport const cssReset: CSSResultGroup = css`\n\t* {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tbox-sizing: border-box;\n\n\t\tscrollbar-width: thin;\n\t\tscrollbar-color: #888 transparent;\n\t}\n\n\t::-webkit-scrollbar { width: 8px; }\n\t::-webkit-scrollbar-track { background: transparent; }\n\t::-webkit-scrollbar-thumb { background: #888; border-radius: 1em; }\n\t::-webkit-scrollbar-thumb:hover { background: #999; }\n`\n\n", "\nimport {dom} from \"../../dom/dom.js\"\n\nexport class SlyShadow extends HTMLElement {\n\tstatic register() {\n\t\tdom.register({SlyShadow}, {soft: true})\n\t}\n\n\tconnectedCallback() {\n\t\tif (!this.hasAttribute(\"view\"))\n\t\t\tthis.setAttribute(\"view\", \"\")\n\t}\n}\n\n", "\nimport {defer} from \"@e280/stz\"\n\nexport class LightCx {\n\tcount = 0\n\trendered = defer<void>()\n\n\tconstructor(public render: () => Promise<void>) {}\n\n\tdoneRender() {\n\t\tthis.count++\n\t\tthis.rendered.resolve()\n\t\tthis.rendered = defer()\n\t}\n}\n\nexport class ShadowCx extends LightCx {\n\tconstructor(\n\t\t\trender: () => Promise<void>,\n\t\t\tpublic host: HTMLElement,\n\t\t\tpublic shadow: ShadowRoot,\n\t\t) {\n\t\tsuper(render)\n\t}\n}\n\n", "\nimport {Hookscope} from \"./hookscope.js\"\n\nexport class Hooks {\n\t#scopes: Hookscope[] = []\n\n\tget scope() {\n\t\tconst scope = this.#scopes.at(-1)\n\t\tif (!scope) throw new Error(\"hooks must be called within a render fn\")\n\t\treturn scope\n\t}\n\n\tincrement() {\n\t\tconst scope = this.scope\n\t\tconst position = scope.position++\n\t\treturn {scope, position}\n\t}\n\n\twrap<Ret>(scope: Hookscope, fn: () => Ret) {\n\t\tscope.position = 0\n\t\tthis.#scopes.push(scope)\n\t\ttry { return fn() }\n\t\tfinally { this.#scopes.pop() }\n\t}\n}\n\nexport const hooks: Hooks = (globalThis as any)[Symbol.for(\"e280.hooks\")] ??= new Hooks()\n\n", "\nimport {tracker} from \"@e280/strata\"\n\nexport class Reactivity {\n\t#stoppers: (() => void)[] = []\n\n\tclear() {\n\t\tthis.#stoppers.forEach(stop => stop())\n\t\tthis.#stoppers = []\n\t}\n\n\tobserve<X>(fn: () => X, rerender: () => Promise<void>) {\n\t\tconst {seen, value} = tracker.observe(fn)\n\t\tthis.clear()\n\t\tfor (const item of seen) {\n\t\t\tconst stop = tracker.subscribe(item, rerender)\n\t\t\tthis.#stoppers.push(stop)\n\t\t}\n\t\treturn value\n\t}\n}\n\n", "\nexport class Mounts {\n\t#mounters: (() => () => void)[] = []\n\t#unmounters: (() => void)[] = []\n\n\tmount(mount: () => () => void) {\n\t\tthis.#mounters.push(mount)\n\t\tthis.#unmounters.push(mount())\n\t}\n\n\tunmountAll() {\n\t\tfor (const unmount of this.#unmounters)\n\t\t\tunmount()\n\t\tthis.#unmounters = []\n\t}\n\n\tremountAll() {\n\t\tfor (const mount of this.#mounters)\n\t\t\tthis.#unmounters.push(mount())\n\t}\n}\n\n", "\nimport {Mounts} from \"./mounts.js\"\nimport {LightCx, ShadowCx} from \"../../parts/cx.js\"\n\nexport class Hookscope {\n\tposition = 0\n\tvalues = new Map<number, any>()\n\tmounts = new Mounts()\n\tconstructor(public cx: LightCx | ShadowCx) {}\n}\n\n", "/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {\n _$LH,\n Part,\n DirectiveParent,\n CompiledTemplateResult,\n MaybeCompiledTemplateResult,\n UncompiledTemplateResult,\n} from './lit-html.js';\nimport {\n DirectiveResult,\n DirectiveClass,\n PartInfo,\n AttributePartInfo,\n} from './directive.js';\ntype Primitive = null | undefined | boolean | number | string | symbol | bigint;\n\nconst {_ChildPart: ChildPart} = _$LH;\n\ntype ChildPart = InstanceType<typeof ChildPart>;\n\nconst ENABLE_SHADYDOM_NOPATCH = true;\n\nconst wrap =\n ENABLE_SHADYDOM_NOPATCH &&\n window.ShadyDOM?.inUse &&\n window.ShadyDOM?.noPatch === true\n ? window.ShadyDOM!.wrap\n : (node: Node) => node;\n\n/**\n * Tests if a value is a primitive value.\n *\n * See https://tc39.github.io/ecma262/#sec-typeof-operator\n */\nexport const isPrimitive = (value: unknown): value is Primitive =>\n value === null || (typeof value != 'object' && typeof value != 'function');\n\nexport const TemplateResultType = {\n HTML: 1,\n SVG: 2,\n MATHML: 3,\n} as const;\n\nexport type TemplateResultType =\n (typeof TemplateResultType)[keyof typeof TemplateResultType];\n\ntype IsTemplateResult = {\n (val: unknown): val is MaybeCompiledTemplateResult;\n <T extends TemplateResultType>(\n val: unknown,\n type: T\n ): val is UncompiledTemplateResult<T>;\n};\n\n/**\n * Tests if a value is a TemplateResult or a CompiledTemplateResult.\n */\nexport const isTemplateResult: IsTemplateResult = (\n value: unknown,\n type?: TemplateResultType\n): value is UncompiledTemplateResult =>\n type === undefined\n ? // This property needs to remain unminified.\n (value as UncompiledTemplateResult)?.['_$litType$'] !== undefined\n : (value as UncompiledTemplateResult)?.['_$litType$'] === type;\n\n/**\n * Tests if a value is a CompiledTemplateResult.\n */\nexport const isCompiledTemplateResult = (\n value: unknown\n): value is CompiledTemplateResult => {\n return (value as CompiledTemplateResult)?.['_$litType$']?.h != null;\n};\n\n/**\n * Tests if a value is a DirectiveResult.\n */\nexport const isDirectiveResult = (value: unknown): value is DirectiveResult =>\n // This property needs to remain unminified.\n (value as DirectiveResult)?.['_$litDirective$'] !== undefined;\n\n/**\n * Retrieves the Directive class for a DirectiveResult\n */\nexport const getDirectiveClass = (value: unknown): DirectiveClass | undefined =>\n // This property needs to remain unminified.\n (value as DirectiveResult)?.['_$litDirective$'];\n\n/**\n * Tests whether a part has only a single-expression with no strings to\n * interpolate between.\n *\n * Only AttributePart and PropertyPart can have multiple expressions.\n * Multi-expression parts have a `strings` property and single-expression\n * parts do not.\n */\nexport const isSingleExpression = (part: PartInfo) =>\n (part as AttributePartInfo).strings === undefined;\n\nconst createMarker = () => document.createComment('');\n\n/**\n * Inserts a ChildPart into the given container ChildPart's DOM, either at the\n * end of the container ChildPart, or before the optional `refPart`.\n *\n * This does not add the part to the containerPart's committed value. That must\n * be done by callers.\n *\n * @param containerPart Part within which to add the new ChildPart\n * @param refPart Part before which to add the new ChildPart; when omitted the\n * part added to the end of the `containerPart`\n * @param part Part to insert, or undefined to create a new part\n */\nexport const insertPart = (\n containerPart: ChildPart,\n refPart?: ChildPart,\n part?: ChildPart\n): ChildPart => {\n const container = wrap(containerPart._$startNode).parentNode!;\n\n const refNode =\n refPart === undefined ? containerPart._$endNode : refPart._$startNode;\n\n if (part === undefined) {\n const startNode = wrap(container).insertBefore(createMarker(), refNode);\n const endNode = wrap(container).insertBefore(createMarker(), refNode);\n part = new ChildPart(\n startNode,\n endNode,\n containerPart,\n containerPart.options\n );\n } else {\n const endNode = wrap(part._$endNode!).nextSibling;\n const oldParent = part._$parent;\n const parentChanged = oldParent !== containerPart;\n if (parentChanged) {\n part._$reparentDisconnectables?.(containerPart);\n // Note that although `_$reparentDisconnectables` updates the part's\n // `_$parent` reference after unlinking from its current parent, that\n // method only exists if Disconnectables are present, so we need to\n // unconditionally set it here\n part._$parent = containerPart;\n // Since the _$isConnected getter is somewhat costly, only\n // read it once we know the subtree has directives that need\n // to be notified\n let newConnectionState;\n if (\n part._$notifyConnectionChanged !== undefined &&\n (newConnectionState = containerPart._$isConnected) !==\n oldParent!._$isConnected\n ) {\n part._$notifyConnectionChanged(newConnectionState);\n }\n }\n if (endNode !== refNode || parentChanged) {\n let start: Node | null = part._$startNode;\n while (start !== endNode) {\n const n: Node | null = wrap(start!).nextSibling;\n wrap(container).insertBefore(start!, refNode);\n start = n;\n }\n }\n }\n\n return part;\n};\n\n/**\n * Sets the value of a Part.\n *\n * Note that this should only be used to set/update the value of user-created\n * parts (i.e. those created using `insertPart`); it should not be used\n * by directives to set the value of the directive's container part. Directives\n * should return a value from `update`/`render` to update their part state.\n *\n * For directives that require setting their part value asynchronously, they\n * should extend `AsyncDirective` and call `this.setValue()`.\n *\n * @param part Part to set\n * @param value Value to set\n * @param index For `AttributePart`s, the index to set\n * @param directiveParent Used internally; should not be set by user\n */\nexport const setChildPartValue = <T extends ChildPart>(\n part: T,\n value: unknown,\n directiveParent: DirectiveParent = part\n): T => {\n part._$setValue(value, directiveParent);\n return part;\n};\n\n// A sentinel value that can never appear as a part value except when set by\n// live(). Used to force a dirty-check to fail and cause a re-render.\nconst RESET_VALUE = {};\n\n/**\n * Sets the committed value of a ChildPart directly without triggering the\n * commit stage of the part.\n *\n * This is useful in cases where a directive needs to update the part such\n * that the next update detects a value change or not. When value is omitted,\n * the next update will be guaranteed to be detected as a change.\n *\n * @param part\n * @param value\n */\nexport const setCommittedValue = (part: Part, value: unknown = RESET_VALUE) =>\n (part._$committedValue = value);\n\n/**\n * Returns the committed value of a ChildPart.\n *\n * The committed value is used for change detection and efficient updates of\n * the part. It can differ from the value set by the template or directive in\n * cases where the template value is transformed before being committed.\n *\n * - `TemplateResult`s are committed as a `TemplateInstance`\n * - Iterables are committed as `Array<ChildPart>`\n * - All other types are committed as the template value or value returned or\n * set by a directive.\n *\n * @param part\n */\nexport const getCommittedValue = (part: ChildPart) => part._$committedValue;\n\n/**\n * Removes a ChildPart from the DOM, including any of its content and markers.\n *\n * Note: The only difference between this and clearPart() is that this also\n * removes the part's start node. This means that the ChildPart must own its\n * start node, ie it must be a marker node specifically for this part and not an\n * anchor from surrounding content.\n *\n * @param part The Part to remove\n */\nexport const removePart = (part: ChildPart) => {\n part._$clear();\n part._$startNode.remove();\n};\n\nexport const clearPart = (part: ChildPart) => {\n part._$clear();\n};\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {Disconnectable, Part} from './lit-html.js';\n\nexport {\n AttributePart,\n BooleanAttributePart,\n ChildPart,\n ElementPart,\n EventPart,\n Part,\n PropertyPart,\n} from './lit-html.js';\n\nexport interface DirectiveClass {\n new (part: PartInfo): Directive;\n}\n\n/**\n * This utility type extracts the signature of a directive class's render()\n * method so we can use it for the type of the generated directive function.\n */\nexport type DirectiveParameters<C extends Directive> = Parameters<C['render']>;\n\n/**\n * A generated directive function doesn't evaluate the directive, but just\n * returns a DirectiveResult object that captures the arguments.\n */\nexport interface DirectiveResult<C extends DirectiveClass = DirectiveClass> {\n /**\n * This property needs to remain unminified.\n * @internal\n */\n ['_$litDirective$']: C;\n /** @internal */\n values: DirectiveParameters<InstanceType<C>>;\n}\n\nexport const PartType = {\n ATTRIBUTE: 1,\n CHILD: 2,\n PROPERTY: 3,\n BOOLEAN_ATTRIBUTE: 4,\n EVENT: 5,\n ELEMENT: 6,\n} as const;\n\nexport type PartType = (typeof PartType)[keyof typeof PartType];\n\nexport interface ChildPartInfo {\n readonly type: typeof PartType.CHILD;\n}\n\nexport interface AttributePartInfo {\n readonly type:\n | typeof PartType.ATTRIBUTE\n | typeof PartType.PROPERTY\n | typeof PartType.BOOLEAN_ATTRIBUTE\n | typeof PartType.EVENT;\n readonly strings?: ReadonlyArray<string>;\n readonly name: string;\n readonly tagName: string;\n}\n\nexport interface ElementPartInfo {\n readonly type: typeof PartType.ELEMENT;\n}\n\n/**\n * Information about the part a directive is bound to.\n *\n * This is useful for checking that a directive is attached to a valid part,\n * such as with directive that can only be used on attribute bindings.\n */\nexport type PartInfo = ChildPartInfo | AttributePartInfo | ElementPartInfo;\n\n/**\n * Creates a user-facing directive function from a Directive class. This\n * function has the same parameters as the directive's render() method.\n */\nexport const directive =\n <C extends DirectiveClass>(c: C) =>\n (...values: DirectiveParameters<InstanceType<C>>): DirectiveResult<C> => ({\n // This property needs to remain unminified.\n ['_$litDirective$']: c,\n values,\n });\n\n/**\n * Base class for creating custom directives. Users should extend this class,\n * implement `render` and/or `update`, and then pass their subclass to\n * `directive`.\n */\nexport abstract class Directive implements Disconnectable {\n //@internal\n __part!: Part;\n //@internal\n __attributeIndex: number | undefined;\n //@internal\n __directive?: Directive;\n\n //@internal\n _$parent!: Disconnectable;\n\n // These will only exist on the AsyncDirective subclass\n //@internal\n _$disconnectableChildren?: Set<Disconnectable>;\n // This property needs to remain unminified.\n //@internal\n ['_$notifyDirectiveConnectionChanged']?(isConnected: boolean): void;\n\n constructor(_partInfo: PartInfo) {}\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n /** @internal */\n _$initialize(\n part: Part,\n parent: Disconnectable,\n attributeIndex: number | undefined\n ) {\n this.__part = part;\n this._$parent = parent;\n this.__attributeIndex = attributeIndex;\n }\n /** @internal */\n _$resolve(part: Part, props: Array<unknown>): unknown {\n return this.update(part, props);\n }\n\n abstract render(...props: Array<unknown>): unknown;\n\n update(_part: Part, props: Array<unknown>): unknown {\n return this.render(...props);\n }\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Overview:\n *\n * This module is designed to add support for an async `setValue` API and\n * `disconnected` callback to directives with the least impact on the core\n * runtime or payload when that feature is not used.\n *\n * The strategy is to introduce a `AsyncDirective` subclass of\n * `Directive` that climbs the \"parent\" tree in its constructor to note which\n * branches of lit-html's \"logical tree\" of data structures contain such\n * directives and thus need to be crawled when a subtree is being cleared (or\n * manually disconnected) in order to run the `disconnected` callback.\n *\n * The \"nodes\" of the logical tree include Parts, TemplateInstances (for when a\n * TemplateResult is committed to a value of a ChildPart), and Directives; these\n * all implement a common interface called `DisconnectableChild`. Each has a\n * `_$parent` reference which is set during construction in the core code, and a\n * `_$disconnectableChildren` field which is initially undefined.\n *\n * The sparse tree created by means of the `AsyncDirective` constructor\n * crawling up the `_$parent` tree and placing a `_$disconnectableChildren` Set\n * on each parent that includes each child that contains a\n * `AsyncDirective` directly or transitively via its children. In order to\n * notify connection state changes and disconnect (or reconnect) a tree, the\n * `_$notifyConnectionChanged` API is patched onto ChildParts as a directive\n * climbs the parent tree, which is called by the core when clearing a part if\n * it exists. When called, that method iterates over the sparse tree of\n * Set<DisconnectableChildren> built up by AsyncDirectives, and calls\n * `_$notifyDirectiveConnectionChanged` on any directives that are encountered\n * in that tree, running the required callbacks.\n *\n * A given \"logical tree\" of lit-html data-structures might look like this:\n *\n * ChildPart(N1) _$dC=[D2,T3]\n * ._directive\n * AsyncDirective(D2)\n * ._value // user value was TemplateResult\n * TemplateInstance(T3) _$dC=[A4,A6,N10,N12]\n * ._$parts[]\n * AttributePart(A4) _$dC=[D5]\n * ._directives[]\n * AsyncDirective(D5)\n * AttributePart(A6) _$dC=[D7,D8]\n * ._directives[]\n * AsyncDirective(D7)\n * Directive(D8) _$dC=[D9]\n * ._directive\n * AsyncDirective(D9)\n * ChildPart(N10) _$dC=[D11]\n * ._directive\n * AsyncDirective(D11)\n * ._value\n * string\n * ChildPart(N12) _$dC=[D13,N14,N16]\n * ._directive\n * AsyncDirective(D13)\n * ._value // user value was iterable\n * Array<ChildPart>\n * ChildPart(N14) _$dC=[D15]\n * ._value\n * string\n * ChildPart(N16) _$dC=[D17,T18]\n * ._directive\n * AsyncDirective(D17)\n * ._value // user value was TemplateResult\n * TemplateInstance(T18) _$dC=[A19,A21,N25]\n * ._$parts[]\n * AttributePart(A19) _$dC=[D20]\n * ._directives[]\n * AsyncDirective(D20)\n * AttributePart(A21) _$dC=[22,23]\n * ._directives[]\n * AsyncDirective(D22)\n * Directive(D23) _$dC=[D24]\n * ._directive\n * AsyncDirective(D24)\n * ChildPart(N25) _$dC=[D26]\n * ._directive\n * AsyncDirective(D26)\n * ._value\n * string\n *\n * Example 1: The directive in ChildPart(N12) updates and returns `nothing`. The\n * ChildPart will _clear() itself, and so we need to disconnect the \"value\" of\n * the ChildPart (but not its directive). In this case, when `_clear()` calls\n * `_$notifyConnectionChanged()`, we don't iterate all of the\n * _$disconnectableChildren, rather we do a value-specific disconnection: i.e.\n * since the _value was an Array<ChildPart> (because an iterable had been\n * committed), we iterate the array of ChildParts (N14, N16) and run\n * `setConnected` on them (which does recurse down the full tree of\n * `_$disconnectableChildren` below it, and also removes N14 and N16 from N12's\n * `_$disconnectableChildren`). Once the values have been disconnected, we then\n * check whether the ChildPart(N12)'s list of `_$disconnectableChildren` is empty\n * (and would remove it from its parent TemplateInstance(T3) if so), but since\n * it would still contain its directive D13, it stays in the disconnectable\n * tree.\n *\n * Example 2: In the course of Example 1, `setConnected` will reach\n * ChildPart(N16); in this case the entire part is being disconnected, so we\n * simply iterate all of N16's `_$disconnectableChildren` (D17,T18) and\n * recursively run `setConnected` on them. Note that we only remove children\n * from `_$disconnectableChildren` for the top-level values being disconnected\n * on a clear; doing this bookkeeping lower in the tree is wasteful since it's\n * all being thrown away.\n *\n * Example 3: If the LitElement containing the entire tree above becomes\n * disconnected, it will run `childPart.setConnected()` (which calls\n * `childPart._$notifyConnectionChanged()` if it exists); in this case, we\n * recursively run `setConnected()` over the entire tree, without removing any\n * children from `_$disconnectableChildren`, since this tree is required to\n * re-connect the tree, which does the same operation, simply passing\n * `isConnected: true` down the tree, signaling which callback to run.\n */\n\nimport {AttributePart, ChildPart, Disconnectable, Part} from './lit-html.js';\nimport {isSingleExpression} from './directive-helpers.js';\nimport {Directive, PartInfo, PartType} from './directive.js';\nexport * from './directive.js';\n\nconst DEV_MODE = true;\n\n/**\n * Recursively walks down the tree of Parts/TemplateInstances/Directives to set\n * the connected state of directives and run `disconnected`/ `reconnected`\n * callbacks.\n *\n * @return True if there were children to disconnect; false otherwise\n */\nconst notifyChildrenConnectedChanged = (\n parent: Disconnectable,\n isConnected: boolean\n): boolean => {\n const children = parent._$disconnectableChildren;\n if (children === undefined) {\n return false;\n }\n for (const obj of children) {\n // The existence of `_$notifyDirectiveConnectionChanged` is used as a \"brand\" to\n // disambiguate AsyncDirectives from other DisconnectableChildren\n // (as opposed to using an instanceof check to know when to call it); the\n // redundancy of \"Directive\" in the API name is to avoid conflicting with\n // `_$notifyConnectionChanged`, which exists `ChildParts` which are also in\n // this list\n // Disconnect Directive (and any nested directives contained within)\n // This property needs to remain unminified.\n (obj as AsyncDirective)['_$notifyDirectiveConnectionChanged']?.(\n isConnected,\n false\n );\n // Disconnect Part/TemplateInstance\n notifyChildrenConnectedChanged(obj, isConnected);\n }\n return true;\n};\n\n/**\n * Removes the given child from its parent list of disconnectable children, and\n * if the parent list becomes empty as a result, removes the parent from its\n * parent, and so forth up the tree when that causes subsequent parent lists to\n * become empty.\n */\nconst removeDisconnectableFromParent = (obj: Disconnectable) => {\n let parent, children;\n do {\n if ((parent = obj._$parent) === undefined) {\n break;\n }\n children = parent._$disconnectableChildren!;\n children.delete(obj);\n obj = parent;\n } while (children?.size === 0);\n};\n\nconst addDisconnectableToParent = (obj: Disconnectable) => {\n // Climb the parent tree, creating a sparse tree of children needing\n // disconnection\n for (let parent; (parent = obj._$parent); obj = parent) {\n let children = parent._$disconnectableChildren;\n if (children === undefined) {\n parent._$disconnectableChildren = children = new Set();\n } else if (children.has(obj)) {\n // Once we've reached a parent that already contains this child, we\n // can short-circuit\n break;\n }\n children.add(obj);\n installDisconnectAPI(parent);\n }\n};\n\n/**\n * Changes the parent reference of the ChildPart, and updates the sparse tree of\n * Disconnectable children accordingly.\n *\n * Note, this method will be patched onto ChildPart instances and called from\n * the core code when parts are moved between different parents.\n */\nfunction reparentDisconnectables(this: ChildPart, newParent: Disconnectable) {\n if (this._$disconnectableChildren !== undefined) {\n removeDisconnectableFromParent(this);\n this._$parent = newParent;\n addDisconnectableToParent(this);\n } else {\n this._$parent = newParent;\n }\n}\n\n/**\n * Sets the connected state on any directives contained within the committed\n * value of this part (i.e. within a TemplateInstance or iterable of\n * ChildParts) and runs their `disconnected`/`reconnected`s, as well as within\n * any directives stored on the ChildPart (when `valueOnly` is false).\n *\n * `isClearingValue` should be passed as `true` on a top-level part that is\n * clearing itself, and not as a result of recursively disconnecting directives\n * as part of a `clear` operation higher up the tree. This both ensures that any\n * directive on this ChildPart that produced a value that caused the clear\n * operation is not disconnected, and also serves as a performance optimization\n * to avoid needless bookkeeping when a subtree is going away; when clearing a\n * subtree, only the top-most part need to remove itself from the parent.\n *\n * `fromPartIndex` is passed only in the case of a partial `_clear` running as a\n * result of truncating an iterable.\n *\n * Note, this method will be patched onto ChildPart instances and called from the\n * core code when parts are cleared or the connection state is changed by the\n * user.\n */\nfunction notifyChildPartConnectedChanged(\n this: ChildPart,\n isConnected: boolean,\n isClearingValue = false,\n fromPartIndex = 0\n) {\n const value = this._$committedValue;\n const children = this._$disconnectableChildren;\n if (children === undefined || children.size === 0) {\n return;\n }\n if (isClearingValue) {\n if (Array.isArray(value)) {\n // Iterable case: Any ChildParts created by the iterable should be\n // disconnected and removed from this ChildPart's disconnectable\n // children (starting at `fromPartIndex` in the case of truncation)\n for (let i = fromPartIndex; i < value.length; i++) {\n notifyChildrenConnectedChanged(value[i], false);\n removeDisconnectableFromParent(value[i]);\n }\n } else if (value != null) {\n // TemplateInstance case: If the value has disconnectable children (will\n // only be in the case that it is a TemplateInstance), we disconnect it\n // and remove it from this ChildPart's disconnectable children\n notifyChildrenConnectedChanged(value as Disconnectable, false);\n removeDisconnectableFromParent(value as Disconnectable);\n }\n } else {\n notifyChildrenConnectedChanged(this, isConnected);\n }\n}\n\n/**\n * Patches disconnection API onto ChildParts.\n */\nconst installDisconnectAPI = (obj: Disconnectable) => {\n if ((obj as ChildPart).type == PartType.CHILD) {\n (obj as ChildPart)._$notifyConnectionChanged ??=\n notifyChildPartConnectedChanged;\n (obj as ChildPart)._$reparentDisconnectables ??= reparentDisconnectables;\n }\n};\n\n/**\n * An abstract `Directive` base class whose `disconnected` method will be\n * called when the part containing the directive is cleared as a result of\n * re-rendering, or when the user calls `part.setConnected(false)` on\n * a part that was previously rendered containing the directive (as happens\n * when e.g. a LitElement disconnects from the DOM).\n *\n * If `part.setConnected(true)` is subsequently called on a\n * containing part, the directive's `reconnected` method will be called prior\n * to its next `update`/`render` callbacks. When implementing `disconnected`,\n * `reconnected` should also be implemented to be compatible with reconnection.\n *\n * Note that updates may occur while the directive is disconnected. As such,\n * directives should generally check the `this.isConnected` flag during\n * render/update to determine whether it is safe to subscribe to resources\n * that may prevent garbage collection.\n */\nexport abstract class AsyncDirective extends Directive {\n // As opposed to other Disconnectables, AsyncDirectives always get notified\n // when the RootPart connection changes, so the public `isConnected`\n // is a locally stored variable initialized via its part's getter and synced\n // via `_$notifyDirectiveConnectionChanged`. This is cheaper than using\n // the _$isConnected getter, which has to look back up the tree each time.\n /**\n * The connection state for this Directive.\n */\n isConnected!: boolean;\n\n // @internal\n override _$disconnectableChildren?: Set<Disconnectable> = undefined;\n /**\n * Initialize the part with internal fields\n * @param part\n * @param parent\n * @param attributeIndex\n */\n override _$initialize(\n part: Part,\n parent: Disconnectable,\n attributeIndex: number | undefined\n ) {\n super._$initialize(part, parent, attributeIndex);\n addDisconnectableToParent(this);\n this.isConnected = part._$isConnected;\n }\n // This property needs to remain unminified.\n /**\n * Called from the core code when a directive is going away from a part (in\n * which case `shouldRemoveFromParent` should be true), and from the\n * `setChildrenConnected` helper function when recursively changing the\n * connection state of a tree (in which case `shouldRemoveFromParent` should\n * be false).\n *\n * @param isConnected\n * @param isClearingDirective - True when the directive itself is being\n * removed; false when the tree is being disconnected\n * @internal\n */\n override ['_$notifyDirectiveConnectionChanged'](\n isConnected: boolean,\n isClearingDirective = true\n ) {\n if (isConnected !== this.isConnected) {\n this.isConnected = isConnected;\n if (isConnected) {\n this.reconnected?.();\n } else {\n this.disconnected?.();\n }\n }\n if (isClearingDirective) {\n notifyChildrenConnectedChanged(this, isConnected);\n removeDisconnectableFromParent(this);\n }\n }\n\n /**\n * Sets the value of the directive's Part outside the normal `update`/`render`\n * lifecycle of a directive.\n *\n * This method should not be called synchronously from a directive's `update`\n * or `render`.\n *\n * @param directive The directive to update\n * @param value The value to set\n */\n setValue(value: unknown) {\n if (isSingleExpression(this.__part as unknown as PartInfo)) {\n this.__part._$setValue(value, this);\n } else {\n // this.__attributeIndex will be defined in this case, but\n // assert it in dev mode\n if (DEV_MODE && this.__attributeIndex === undefined) {\n throw new Error(`Expected this.__attributeIndex to be a number`);\n }\n const newValues = [...(this.__part._$committedValue as Array<unknown>)];\n newValues[this.__attributeIndex!] = value;\n (this.__part as AttributePart)._$setValue(newValues, this, 0);\n }\n }\n\n /**\n * User callbacks for implementing logic to release any resources/subscriptions\n * that may have been retained by this directive. Since directives may also be\n * re-connected, `reconnected` should also be implemented to restore the\n * working state of the directive prior to the next render.\n */\n protected disconnected() {}\n protected reconnected() {}\n}\n", "\nimport {microbounce} from \"@e280/stz\"\n\nimport {View} from \"./types.js\"\nimport {LightCx} from \"./parts/cx.js\"\nimport {hooks} from \"./hooks/plumbing/hooks.js\"\nimport {Reactivity} from \"./parts/reactivity.js\"\nimport {Hookscope} from \"./hooks/plumbing/hookscope.js\"\nimport {AsyncDirective, directive, Part} from \"lit/async-directive.js\"\n\nexport function lightView<Props extends any[]>(view: View<Props>) {\n\treturn directive(class D extends AsyncDirective {\n\t\t#props!: Props\n\t\t#cx = new LightCx(microbounce(() => {\n\t\t\tif (!this.#props) throw new Error(\"cannot render before props\")\n\t\t\tif (this.isConnected) {\n\t\t\t\tconst content = this.render(...this.#props)\n\t\t\t\tthis.setValue(content)\n\t\t\t\tthis.#cx.doneRender()\n\t\t\t}\n\t\t}))\n\t\t#hookscope = new Hookscope(this.#cx)\n\t\t#reactivity = new Reactivity()\n\n\t\tupdate(part: Part, props: any[]) {\n\t\t\tconst ret = super.update(part, props)\n\t\t\tif (this.isConnected) this.#cx.doneRender()\n\t\t\treturn ret\n\t\t}\n\n\t\trender(...props: Props) {\n\t\t\tthis.#props = props\n\t\t\treturn this.#reactivity.observe(\n\t\t\t\t() => hooks.wrap(this.#hookscope, () => view(...this.#props)),\n\t\t\t\tthis.#cx.render,\n\t\t\t)\n\t\t}\n\n\t\tdisconnected() {\n\t\t\tthis.#hookscope.mounts.unmountAll()\n\t\t\tthis.#reactivity.clear()\n\t\t}\n\n\t\treconnected() {\n\t\t\tthis.#hookscope.mounts.remountAll()\n\t\t\tthis.#cx.render()\n\t\t}\n\t}) as View<Props>\n}\n\n/** @deprecated renamed to `lightView` */\nexport const light = lightView\n\n", "\nimport {ViewAttr, ViewAttrs} from \"../types.js\"\n\nexport function applyAttrs(element: HTMLElement, attrs: ViewAttrs) {\n\tfor (const [name, value] of Object.entries(attrs))\n\t\tapplyAttr(element, name, value)\n}\n\nfunction applyAttr(element: HTMLElement, name: string, value: ViewAttr) {\n\tconst existing = element.getAttribute(name)\n\tconst v = coerce(value)\n\tif (v === existing) return\n\tif (v === null) element.removeAttribute(name)\n\telse element.setAttribute(name, v)\n}\n\nfunction coerce(value: ViewAttr) {\n\tif (typeof value === \"string\") return value\n\telse if (typeof value === \"number\") return value.toString()\n\treturn value ? \"\" : null\n}\n\n", "\nimport {microbounce} from \"@e280/stz\"\nimport {render as litRender} from \"lit\"\n\nimport {ShadowCx} from \"./parts/cx.js\"\nimport {hooks} from \"./hooks/plumbing/hooks.js\"\nimport {SlyShadow} from \"./common/sly-shadow.js\"\nimport {Reactivity} from \"./parts/reactivity.js\"\nimport {applyAttrs} from \"./parts/apply-attrs.js\"\nimport {Hookscope} from \"./hooks/plumbing/hookscope.js\"\nimport {View, Placement, ShadowSetup, ShadowView} from \"./types.js\"\nimport {AsyncDirective, directive, PartInfo} from \"lit/async-directive.js\"\n\nexport function shadowSetup(): ShadowSetup {\n\tSlyShadow.register()\n\tconst host = document.createElement(\"sly-shadow\")\n\tconst shadow = host.attachShadow({mode: \"open\"})\n\treturn {host, shadow}\n}\n\nexport function shadowView<Props extends any[]>(view: View<Props>) {\n\treturn rawShadow(shadowSetup, view)\n}\n\nshadowView.setup = (setup: () => ShadowSetup) => (\n\t<Props extends any[]>(view: View<Props>) => (\n\t\trawShadow(setup, view)\n\t)\n)\n\n/** @deprecated renamed to `shadowView` */\nexport const shadow = shadowView\n\nfunction rawShadow<Props extends any[]>(\n\t\tsetup: () => ShadowSetup,\n\t\tview: View<Props>,\n\t) {\n\n\tconst directiveFn = directive(class extends AsyncDirective {\n\t\t#cx\n\t\t#hookscope\n\t\t#props!: Props\n\t\t#reactivity = new Reactivity()\n\n\t\tconstructor(part: PartInfo) {\n\t\t\tsuper(part)\n\t\t\tconst {host, shadow} = setup()\n\t\t\tconst rerender = microbounce(() => {\n\t\t\t\tif (!this.#props) throw new Error(\"cannot render before props\")\n\t\t\t\tif (!this.isConnected) return\n\t\t\t\tconst content = this.#renderContent(this.#props)\n\t\t\t\tlitRender(content, this.#cx.shadow)\n\t\t\t\tthis.#cx.doneRender()\n\t\t\t})\n\t\t\tthis.#cx = new ShadowCx(rerender, host, shadow)\n\t\t\tthis.#hookscope = new Hookscope(this.#cx)\n\t\t}\n\n\t\t#renderContent(props: Props) {\n\t\t\tthis.#props = props\n\t\t\treturn this.#reactivity.observe(\n\t\t\t\t() => hooks.wrap(this.#hookscope, () => view(...this.#props)),\n\t\t\t\tthis.#cx.render,\n\t\t\t)\n\t\t}\n\n\t\trender({props, children, attrs}: Placement<Props>) {\n\t\t\tconst {host} = this.#cx\n\t\t\tif (!this.isConnected) return host\n\t\t\tif (attrs) applyAttrs(host, attrs)\n\t\t\tlitRender(children, this.#cx.host)\n\t\t\tlitRender(this.#renderContent(props), this.#cx.shadow)\n\t\t\tthis.#cx.doneRender()\n\t\t\treturn host\n\t\t}\n\n\t\tdisconnected() {\n\t\t\tlitRender(null, this.#cx.shadow)\n\t\t\tlitRender(null, this.#cx.host)\n\t\t\tthis.#hookscope.mounts.unmountAll()\n\t\t\tthis.#reactivity.clear()\n\t\t}\n\n\t\treconnected() {\n\t\t\tthis.#hookscope.mounts.remountAll()\n\t\t\tthis.#cx.render()\n\t\t}\n\t}) as ShadowView<[Placement<Props>]>\n\n\tfunction shadowView(...props: Props) {\n\t\treturn directiveFn({props})\n\t}\n\n\tshadowView.with = directiveFn\n\n\treturn shadowView as ShadowView<Props>\n}\n\n", "\nimport {microbounce} from \"@e280/stz\"\nimport {render as litRender} from \"lit\"\n\nimport {Content} from \"../types.js\"\nimport {ShadowCx} from \"../parts/cx.js\"\nimport {hooks} from \"../hooks/plumbing/hooks.js\"\nimport {Reactivity} from \"../parts/reactivity.js\"\nimport {Hookscope} from \"../hooks/plumbing/hookscope.js\"\n\nexport function shadowElement(view: () => Content): new() => HTMLElement {\n\treturn class extends HTMLElement {\n\t\t#cx\n\t\t#hookscope\n\t\t#reactivity = new Reactivity()\n\t\t#shadow = this.attachShadow({mode: \"open\"})\n\n\t\tconstructor() {\n\t\t\tsuper()\n\t\t\tconst rerender = microbounce(() => {\n\t\t\t\tif (!this.isConnected) return\n\t\t\t\tconst content = this.#renderContent()\n\t\t\t\tlitRender(content, this.#cx.shadow)\n\t\t\t\tthis.#cx.doneRender()\n\t\t\t})\n\t\t\tthis.#cx = new ShadowCx(rerender, this, this.#shadow)\n\t\t\tthis.#hookscope = new Hookscope(this.#cx)\n\t\t}\n\n\t\t#renderContent() {\n\t\t\treturn this.#reactivity.observe(\n\t\t\t\t() => hooks.wrap(this.#hookscope, () => view()),\n\t\t\t\tthis.#cx.render,\n\t\t\t)\n\t\t}\n\n\t\trender() {\n\t\t\tlitRender(this.#renderContent(), this.#cx.shadow)\n\t\t\tthis.#cx.doneRender()\n\t\t}\n\n\t\tconnectedCallback() {\n\t\t\tthis.#hookscope.mounts.remountAll()\n\t\t\tthis.#cx.render()\n\t\t}\n\n\t\tdisconnectedCallback() {\n\t\t\tthis.#hookscope.mounts.unmountAll()\n\t\t\tthis.#reactivity.clear()\n\t\t}\n\t}\n}\n\n", "\nimport {Content} from \"../types.js\"\nimport {shadowView} from \"../shadow.js\"\nimport {shadowElement} from \"../elements/shadow.js\"\n\n/** make a shadow-view and shadow-element at the same time. */\nexport function shadowDuplex<P extends any[]>(render: (...p: P) => Content) {\n\tconst view = shadowView(render)\n\tconst makeElement = (...p: P) => shadowElement(() => render(...p))\n\n\treturn [view, makeElement] as [\n\t\tview: typeof view,\n\t\tmakeElement: typeof makeElement,\n\t]\n}\n\n", "\nimport {guarantee} from \"@e280/stz\"\nimport {hooks} from \"./plumbing/hooks.js\"\n\n/** run the fn only one time */\nexport function useOnce<Value>(fn: () => Value) {\n\tconst {scope, position} = hooks.increment()\n\treturn guarantee(scope.values, position, fn) as Value\n}\n\n", "\nimport {hooks} from \"./hooks.js\"\n\nexport function useCx() {\n\treturn hooks.increment().scope.cx\n}\n\n", "\nimport {useCx} from \"./use-cx.js\"\nimport {ShadowCx} from \"../../parts/cx.js\"\n\nexport function useShadowCx() {\n\tconst cx = useCx()\n\n\tif (!(cx instanceof ShadowCx))\n\t\tthrow new Error(\"this hook only works on shadow views (but was called in a light view)\")\n\n\treturn cx\n}\n\n", "\nimport {useShadowCx} from \"./plumbing/use-shadow-cx.js\"\n\n/** return the shadow view's host element */\nexport function useHost() {\n\treturn useShadowCx().host\n}\n\n", "\nimport {useOnce} from \"./use-once.js\"\nimport {hooks} from \"./plumbing/hooks.js\"\n\nexport function useMount(fn: () => () => void) {\n\tconst {scope} = hooks.increment()\n\treturn useOnce(() => scope.mounts.mount(fn))\n}\n\n", "\nimport {useShadowCx} from \"./plumbing/use-shadow-cx.js\"\n\n/** return the shadow root */\nexport function useShadow() {\n\treturn useShadowCx().shadow\n}\n\n", "\nimport {adoptStyles, CSSResultGroup, CSSResultOrNative, getCompatibleStyle} from \"lit\"\n\nexport function applyStyles(shadow: ShadowRoot, styles?: CSSResultGroup) {\n\tadoptStyles(shadow, prepareStyles(styles))\n}\n\nfunction prepareStyles(styles?: CSSResultGroup): Array<CSSResultOrNative> {\n\tconst elementStyles = []\n\n\tif (Array.isArray(styles)) {\n\t\tconst set = new Set((styles as Array<unknown>).flat(Infinity).reverse())\n\t\tfor (const s of set)\n\t\t\telementStyles.unshift(getCompatibleStyle(s as CSSResultOrNative))\n\t}\n\telse if (styles !== undefined)\n\t\telementStyles.push(getCompatibleStyle(styles))\n\n\treturn elementStyles\n}\n\n", "\nimport {CSSResultGroup} from \"lit\"\nimport {useOnce} from \"./use-once.js\"\nimport {useShadow} from \"./use-shadow.js\"\nimport {applyStyles} from \"../parts/apply-styles.js\"\n\n/** attach stylesheets to the shadow root */\nexport function useCss(...styles: CSSResultGroup[]) {\n\tconst shadow = useShadow()\n\tuseOnce(() => applyStyles(shadow, styles))\n}\n\n", "\nimport {useHost} from \"./use-host.js\"\nimport {useOnce} from \"./use-once.js\"\n\n/** sets the host element's \"data-view\" attribute */\nexport function useName(name = \"\") {\n\tconst host = useHost()\n\tuseOnce(() => host.setAttribute(\"view\", name))\n}\n\n", "\nimport {signal} from \"@e280/strata\"\nimport {useOnce} from \"./use-once.js\"\n\nexport function useSignal<Value>(value: Value) {\n\treturn useOnce(() => signal(value))\n}\n\n", "\nimport {useCss} from \"./use-css.js\"\n\n/** alias for `useCss` */\nexport const useStyles = useCss\n\n", "\nimport {useMount} from \"./use-mount.js\"\n\nexport function useUnmount(fn: () => void) {\n\treturn useMount(() => fn)\n}\n\n", "\nimport {css} from \"lit\"\nimport {nap, cycle} from \"@e280/stz\"\nimport {Content} from \"../../view/types.js\"\nimport {cssReset, shadowView, useMount, useName, useSignal, useStyles} from \"../../view/index.js\"\n\nexport function makeAsciiAnim(hz: number, frames: string[]): () => Content {\n\treturn () => AsciiAnim({hz, frames})\n}\n\nexport const AsciiAnim = shadowView(({hz, frames}: {\n\t\thz: number,\n\t\tframes: string[],\n\t}) => {\n\n\tuseName(\"loading\")\n\tuseStyles(cssReset, style)\n\n\tconst $frame = useSignal(0)\n\n\tuseMount(() => cycle(async() => {\n\t\tawait nap(1000 / hz)\n\t\tconst next = $frame() + 1\n\t\t$frame(next >= frames.length ? 0 : next)\n\t}))\n\n\treturn frames.at($frame())\n})\n\nconst style = css`\n:host {\n\tfont-family: monospace;\n\twhite-space: pre;\n\tuser-select: none;\n}\n`\n\n", "\nimport {css, html} from \"lit\"\nimport {shadowView} from \"../../view/shadow.js\"\nimport {cssReset, useName, useStyles} from \"../../view/index.js\"\n\nexport const ErrorDisplay = shadowView((error: any) => {\n\tuseName(\"error\")\n\tuseStyles(cssReset, style)\n\n\tif (typeof error === \"string\")\n\t\treturn error\n\n\telse if (error instanceof Error)\n\t\treturn html`<strong>${error.name}:</strong> <span>${error.message}</span>`\n\n\telse\n\t\treturn `error`\n})\n\nconst style = css`\n\t:host {\n\t\tfont-family: monospace;\n\t\tcolor: red;\n\t}\n`\n\n", "\nimport {waitSelect} from \"@e280/strata\"\n\nimport {Spinner} from \"./types.js\"\nimport {Content} from \"../view/types.js\"\n\nexport function makeSpinner(\n\t\tpending: () => Content,\n\t\terr: (error: unknown) => Content,\n\t): Spinner {\n\t\n\treturn (wait, ok) => waitSelect(wait, {pending, err, ok})\n}\n\n", "\nimport {makeSpinner} from \"../make-spinner.js\"\nimport {makeAsciiAnim} from \"../parts/ascii-anim.js\"\nimport {ErrorDisplay} from \"../parts/error-display.js\"\n\nexport const dotsSpinner = makeSpinner(\n\tmakeAsciiAnim(10, [\n\t\t\" \",\n\t\t\" \",\n\t\t\". \",\n\t\t\".. \",\n\t\t\"...\",\n\t\t\" ..\",\n\t\t\" .\",\n\t]),\n\tErrorDisplay,\n)\n\n", "\nimport {makeSpinner} from \"../make-spinner.js\"\nimport {makeAsciiAnim} from \"../parts/ascii-anim.js\"\nimport {ErrorDisplay} from \"../parts/error-display.js\"\n\nexport const earthSpinner = makeSpinner(\n\tmakeAsciiAnim(3, [\"\uD83C\uDF0E\", \"\uD83C\uDF0F\", \"\uD83C\uDF0D\"]),\n\tErrorDisplay,\n)\n\n", "\nimport {makeSpinner} from \"../make-spinner.js\"\nimport {makeAsciiAnim} from \"../parts/ascii-anim.js\"\nimport {ErrorDisplay} from \"../parts/error-display.js\"\n\nexport const moonSpinner = makeSpinner(\n\tmakeAsciiAnim(10, [\n\t\t\"\uD83C\uDF12\",\n\t\t\"\uD83C\uDF13\",\n\t\t\"\uD83C\uDF14\",\n\t\t\"\uD83C\uDF15\",\n\t\t\"\uD83C\uDF16\",\n\t\t\"\uD83C\uDF17\",\n\t\t\"\uD83C\uDF18\",\n\t\t\"\uD83C\uDF11\",\n\t\t\"\uD83C\uDF11\",\n\t\t\"\uD83C\uDF11\",\n\t]),\n\tErrorDisplay,\n)\n\n", "\nimport {makeSpinner} from \"../make-spinner.js\"\nimport {makeAsciiAnim} from \"../parts/ascii-anim.js\"\nimport {ErrorDisplay} from \"../parts/error-display.js\"\n\nexport const spinner = makeSpinner(\n\tmakeAsciiAnim(16, [\"|\", \"/\", \"-\", \"\\\\\"]),\n\tErrorDisplay,\n)\n\n", "\nimport {makeSpinner} from \"../make-spinner.js\"\nimport {makeAsciiAnim} from \"../parts/ascii-anim.js\"\nimport {ErrorDisplay} from \"../parts/error-display.js\"\n\nexport const waveSpinner = makeSpinner(\n\tmakeAsciiAnim(20, [\n\t\t\":....\",\n\t\t\":....\",\n\t\t\"::...\",\n\t\t\".::..\",\n\t\t\"..::.\",\n\t\t\"...::\",\n\t\t\"....:\",\n\t\t\"....:\",\n\t\t\"...::\",\n\t\t\"..::.\",\n\t\t\".::..\",\n\t\t\"::...\",\n\t]),\n\tErrorDisplay,\n)\n\n", "\nimport type {Expression} from \"./expression.js\"\n\nexport type Sample = {\n\tcode: string\n\tvalue: number\n}\n\nexport type Source = {\n\treadonly onSample: (fn: (sample: Sample) => void) => () => void\n\treadonly dispose: () => void\n\treadonly poll?: () => void\n}\n\nexport type Input = {\n\n\t/** latest-known value. */\n\tvalue: number\n\n\t/** previously-known value from last frame. */\n\twas: number\n\n\t/** sum of values since last frame. */\n\tsum: number\n}\n\nexport type Inputs<B extends Bindings = any> = (\n\tB extends Expression\n\t\t? Input\n\t\t: B extends {[key: string]: Bindings}\n\t\t\t? {[K in keyof B]: Inputs<B[K]>}\n\t\t\t: never\n)\n\nexport type Bindings = Expression | {\n\t[key: string]: Bindings\n}\n\nexport const asBindings = <B extends Bindings>(bindings: B) => (bindings as any as Rebindings<B>)\n\nexport type Rebindings<B extends Bindings> = (\n\tB extends Expression\n\t\t? Expression\n\t\t: B extends {[key: string]: Bindings}\n\t\t\t? {[K in keyof B]: Rebindings<B[K]>}\n\t\t\t: never\n)\n\n", "\nimport {Hub} from \"./hub.js\"\nimport {Bindings} from \"../../input/types.js\"\nimport {Controls} from \"./controls/controls.js\"\n\nexport type PlayerId = number\n\nexport type ProfileKey = string\n\nexport type Profile<B extends Bindings = any> = {\n\tlabel: string\n\tbindings: B\n\tbasedOn?: string\n}\n\nexport type Presets<B extends Bindings> = Record<ProfileKey, Profile<B>>\n\nexport type Deck<B extends Bindings = any> = {\n\thub: Hub<B>\n\tmaxPlayers: number\n\tcontrols: Controls<B>\n}\n\nexport const asDeck = <B extends Bindings>(deck: Deck<B>) => deck\nexport const asPresets = <B extends Bindings>(presets: Presets<B>) => presets\n\n", "\nimport {asBindings} from \"../lib/input/types.js\"\nimport {asPresets} from \"../lib/ui/deck/types.js\"\n\nexport const bindings = asBindings({\n\tlooking: {\n\t\thorizontal: [\"accumulate\", \"pointer.x\"],\n\t\tvertical: [\"accumulate\", \"pointer.y\"],\n\t},\n\tmoving: {\n\t\tforward: \"KeyW\",\n\t\tbackward: \"KeyS\",\n\t\tleftward: \"KeyA\",\n\t\trightward: \"KeyD\",\n\t},\n\tinteractions: {\n\t\tuse: \"KeyE\",\n\t},\n})\n\nexport const presets = asPresets<typeof bindings>({\n\tstandard: {label: \"\u2328\uFE0Fstandard\", bindings},\n\tgamer: {label: \"\uD83C\uDFAEgamer\", bindings: {\n\t\tlooking: {\n\t\t\thorizontal: [\"*\", [\"dt\"], \"gamepad.axis.3\", 100],\n\t\t\tvertical: [\"*\", [\"dt\"], \"gamepad.axis.4\", 100],\n\t\t},\n\t\tmoving: {\n\t\t\tforward: [\"remap\", 0, -1, 0, 1, \"gamepad.axis.2\"],\n\t\t\tbackward: [\"remap\", 0, 1, 0, 1, \"gamepad.axis.2\"],\n\t\t\tleftward: [\"remap\", 0, -1, 0, 1, \"gamepad.axis.1\"],\n\t\t\trightward: [\"remap\", 0, 1, 0, 1, \"gamepad.axis.1\"],\n\t\t},\n\t\tinteractions: {\n\t\t\tuse: \"gamepad.1\",\n\t\t},\n\t}},\n\tmicro: {label: \"\uD83E\uDDA0micro\", bindings: {\n\t\tlooking: {\n\t\t\thorizontal: [\"*\", [\"dt\"], [\"+\", \"gamepad.1\", [\"-\", \"gamepad.4\"]], 100],\n\t\t\tvertical: [\"*\", [\"dt\"], [\"+\", \"gamepad.2\", [\"-\", \"gamepad.3\"]], 100],\n\t\t},\n\t\tmoving: {\n\t\t\tforward: [\"remap\", 0, -1, 0, 1, \"gamepad.axis.2\"],\n\t\t\tbackward: [\"remap\", 0, 1, 0, 1, \"gamepad.axis.2\"],\n\t\t\tleftward: [\"remap\", 0, -1, 0, 1, \"gamepad.axis.1\"],\n\t\t\trightward: [\"remap\", 0, 1, 0, 1, \"gamepad.axis.1\"],\n\t\t},\n\t\tinteractions: {\n\t\t\tuse: [\"*\", \"gamepad.5\", \"gamepad.6\"],\n\t\t},\n\t}},\n})\n\n", "\nimport {isHappy} from \"@e280/stz\"\nimport {Scan} from \"../../types.js\"\n\nexport function idbRange({start, end}: Scan) {\n\tif (isHappy(start) && isHappy(end)) return IDBKeyRange.bound(start, end, false, true)\n\tif (isHappy(start)) return IDBKeyRange.lowerBound(start, false)\n\tif (isHappy(end)) return IDBKeyRange.upperBound(end, true)\n}\n\n", "\nexport async function idbWait<T>(request: IDBRequest<T>) {\n\treturn new Promise<T>((resolve, reject) => {\n\t\trequest.onsuccess = () => resolve(request.result)\n\t\trequest.onerror = () => reject(request.error)\n\t})\n}\n\n", "\nimport {Idb} from \"./types.js\"\nimport {idbWait} from \"./wait.js\"\n\nexport function idbTransactions({db, storeName}: Idb) {\n\tconst setup = (mode: IDBTransactionMode) => (\n\t\tasync<R>(fn: (store: IDBObjectStore, wait: typeof idbWait) => Promise<R>) => {\n\t\t\tconst tx = db.transaction(storeName, mode)\n\t\t\tconst store = tx.objectStore(storeName)\n\n\t\t\tconst completed = new Promise((resolve, reject) => {\n\t\t\t\ttx.onabort = () => reject(tx.error ?? new Error(\"transaction aborted\"))\n\t\t\t\ttx.oncomplete = () => resolve(undefined)\n\t\t\t})\n\n\t\t\ttry {\n\t\t\t\tconst result = await fn(store, idbWait)\n\t\t\t\ttx.commit()\n\t\t\t\tawait completed\n\t\t\t\treturn result\n\t\t\t}\n\t\t\tcatch (error) {\n\t\t\t\ttry { tx.abort() }\n\t\t\t\tcatch {}\n\t\t\t\tthrow error\n\t\t\t}\n\t\t}\n\t)\n\n\treturn {\n\t\treadonly: setup(\"readonly\"),\n\t\treadwrite: setup(\"readwrite\"),\n\t}\n}\n\n", "\nimport {Idb} from \"../utils/idb/types.js\"\nimport {idbRange} from \"../utils/idb/range.js\"\nimport {Op, Magazine, Scan, Value} from \"../types.js\"\nimport {idbTransactions} from \"../utils/idb/transactions.js\"\n\nexport class IdbMagazine implements Magazine {\n\t#tx\n\n\tconstructor(idb: Idb) {\n\t\tthis.#tx = idbTransactions(idb)\n\t}\n\n\tasync commit(ops: Op<Value>[]) {\n\t\treturn this.#tx.readwrite(async store => {\n\t\t\tfor (const [key, value] of ops) {\n\t\t\t\tif (value === undefined)\n\t\t\t\t\tstore.delete(key)\n\t\t\t\telse\n\t\t\t\t\tstore.put(value, key)\n\t\t\t}\n\t\t})\n\t}\n\n\tasync getMany(keys: string[]) {\n\t\treturn this.#tx.readonly((store, wait) => (\n\t\t\tPromise.all(\n\t\t\t\tkeys.map(key => wait<Value | undefined>(store.get(key)))\n\t\t\t)\n\t\t))\n\t}\n\n\tasync* entries(scan: Scan = {}) {\n\t\tif (scan.limit === 0)\n\t\t\treturn\n\n\t\tyield* await this.#tx.readonly(async (store, wait) => {\n\t\t\tconst entries: [string, Value][] = []\n\t\t\tconst direction = scan.reverse ? \"prev\" : \"next\"\n\t\t\tconst request = store.openCursor(idbRange(scan), direction)\n\n\t\t\tlet cursor = await wait<IDBCursorWithValue | null>(request)\n\n\t\t\twhile (cursor) {\n\t\t\t\tentries.push([cursor.key as string, cursor.value])\n\n\t\t\t\tif (scan.limit !== undefined && entries.length >= scan.limit)\n\t\t\t\t\tbreak\n\n\t\t\t\tcursor.continue()\n\t\t\t\tcursor = await wait<IDBCursorWithValue | null>(request)\n\t\t\t}\n\n\t\t\treturn entries\n\t\t})\n\t}\n}\n\n", "\nexport const lexSort = (a: string, b: string) => (\n\ta < b ? -1 : a > b ? 1 : 0\n)\n\n", "\nimport {Scan} from \"../types.js\"\n\nexport function scanMatch(key: string, {start, end}: Scan) {\n\tif (start !== undefined && key < start) return false\n\tif (end !== undefined && key >= end) return false\n\treturn true\n}\n\n", "\nimport {Scan} from \"../types.js\"\nimport {lexSort} from \"./lex-sort.js\"\nimport {scanMatch} from \"./scan-match.js\"\n\nexport function* scanEntries<V>(scan: Scan, entries: [string, V][]) {\n\tif (scan.limit === 0)\n\t\treturn\n\n\tconst matches = entries\n\t\t.filter(([key, value]) => value !== undefined && scanMatch(key, scan))\n\t\t.sort(([a], [b]) => lexSort(a, b))\n\n\tif (scan.reverse)\n\t\tmatches.reverse()\n\n\tyield* matches.slice(0, scan.limit ?? Infinity)\n}\n\n", "\nimport {scanEntries} from \"../utils/scan-entries.js\"\nimport {Op, Magazine, Scan, Value} from \"../types.js\"\n\nexport class MemoryMagazine implements Magazine {\n\t#map = new Map<string, Value>()\n\n\tasync commit(ops: Op<Value>[]) {\n\t\tfor (const [key, value] of ops) {\n\t\t\tif (value === undefined)\n\t\t\t\tthis.#map.delete(key)\n\t\t\telse\n\t\t\t\tthis.#map.set(key, structuredClone(value))\n\t\t}\n\t}\n\n\tasync getMany(keys: string[]) {\n\t\treturn keys.map(key => structuredClone(this.#map.get(key)))\n\t}\n\n\tasync* entries(scan: Scan = {}) {\n\t\tyield* scanEntries(scan, [...this.#map.entries()].map(([key, value]) => [key, structuredClone(value)]))\n\t}\n}\n\n", "\nimport {Idb} from \"./types.js\"\n\nexport async function idbOpen(dbName: string, storeName = dbName): Promise<Idb> {\n\tconst db = await new Promise<IDBDatabase>((resolve, reject) => {\n\t\tconst request = indexedDB.open(dbName, 1)\n\t\trequest.onblocked = () => reject(new Error(\"idb blocked\"))\n\t\trequest.onerror = () => reject(request.error)\n\t\trequest.onupgradeneeded = () => request.result.createObjectStore(storeName)\n\t\trequest.onsuccess = () => resolve(request.result)\n\t})\n\treturn {db, storeName}\n}\n\n", "\nimport {Value} from \"../types.js\"\nimport {Operator} from \"./operator.js\"\n\nexport class CellOperator<V = Value> {\n\t#key\n\t#parent\n\n\tconstructor(key: string, parent: Operator<V>) {\n\t\tthis.#key = key\n\t\tthis.#parent = parent\n\t}\n\n\tset(value: V | undefined) {\n\t\treturn this.#parent.set(this.#key, value)\n\t}\n\n\tdelete() {\n\t\treturn this.#parent.delete(this.#key)\n\t}\n}\n\n", "\nimport {Cubby, got} from \"@e280/stz\"\nimport {Kv} from \"./kv.js\"\nimport {Value} from \"./types.js\"\nimport {CellOperator} from \"./utils/cell-operator.js\"\n\nexport class Cell<V = Value> implements Cubby<V> {\n\top\n\n\tconstructor(public kv: Kv, public key: string) {\n\t\tthis.op = new CellOperator(key, kv.op)\n\t}\n\n\tasync set(value: V | undefined) {\n\t\treturn this.kv.set(this.key, value)\n\t}\n\n\tasync get(): Promise<V | undefined> {\n\t\treturn this.kv.get(this.key)\n\t}\n\n\tasync has(): Promise<boolean> {\n\t\treturn (await this.get()) !== undefined\n\t}\n\n\tasync need(): Promise<V> {\n\t\treturn got(await this.get(), `key not found \"${this.key}\"`)\n\t}\n\n\tasync delete() {\n\t\treturn this.kv.set(this.key, undefined)\n\t}\n}\n\n", "\nimport {deepFreeze} from \"@e280/stz\"\n\nexport const consts = deepFreeze({\n\tdivisor: \".\",\n\tdelimiter: \":\",\n\tchunkSize: 1024,\n})\n\n", "\nexport function prefixEnd(prefix: string) {\n\tfor (let index = prefix.length - 1; index >= 0; index--) {\n\t\tconst code = prefix.charCodeAt(index)\n\n\t\tif (code < 0xFFFF) {\n\t\t\treturn (\n\t\t\t\tprefix.slice(0, index) +\n\t\t\t\tString.fromCharCode(code + 1)\n\t\t\t)\n\t\t}\n\t}\n\n\treturn undefined\n}\n\n", "\nimport {consts} from \"../consts.js\"\nimport {Magazine, Op, Scan} from \"../types.js\"\nimport {prefixEnd} from \"./prefix-end.js\"\n\nexport class Subtree {\n\t#magazine\n\t#scans: Scan[] = [{}]\n\n\tconstructor(magazine: Magazine, scopes: string[]) {\n\t\tthis.#magazine = magazine\n\n\t\tif (scopes.length) {\n\t\t\tconst pre = scopes.join(consts.divisor)\n\t\t\tconst divised = pre + \".\"\n\t\t\tconst delimited = pre + \":\"\n\t\t\tthis.#scans = [\n\t\t\t\t{start: delimited, end: prefixEnd(delimited)},\n\t\t\t\t{start: divised, end: prefixEnd(divised)},\n\t\t\t]\n\t\t}\n\t}\n\n\tasync count() {\n\t\tlet count = 0\n\n\t\tfor (const scan of this.#scans) {\n\t\t\tfor await (const _ of this.#magazine.entries(scan))\n\t\t\t\tcount++\n\t\t}\n\n\t\treturn count\n\t}\n\n\tasync clear() {\n\t\tlet changes: Op<string>[] = []\n\n\t\tfor (const scan of this.#scans) {\n\t\t\tfor await (const [key] of this.#magazine.entries(scan)) {\n\t\t\t\tchanges.push([key, undefined])\n\t\t\t\tif (changes.length >= 1024) {\n\t\t\t\t\tawait this.#magazine.commit(changes)\n\t\t\t\t\tchanges = []\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (changes.length)\n\t\t\tawait this.#magazine.commit(changes)\n\t}\n}\n\n", "\nimport {Op, Value} from \"../types.js\"\nimport {Prefixer} from \"./prefixer.js\"\n\nexport class Operator<V = Value> {\n\t#prefixer: Prefixer\n\n\tconstructor(prefixer: Prefixer) {\n\t\tthis.#prefixer = prefixer\n\t}\n\n\tset<X extends V = V>(key: string, value: X | undefined): Op<X> {\n\t\treturn [this.#prefixer.prefix(key), value]\n\t}\n\n\tdelete(key: string): Op<undefined> {\n\t\treturn [this.#prefixer.prefix(key), undefined]\n\t}\n}\n\n", "\nimport {consts} from \"../consts.js\"\nimport {Options, Scan} from \"../types.js\"\nimport {prefixEnd} from \"./prefix-end.js\"\n\nconst {divisor, delimiter} = consts\n\nexport class Prefixer {\n\t#prefix: string\n\t#end: string | undefined\n\n\tconstructor(options: Options) {\n\t\tconst {scopes} = options\n\t\tthis.#prefix = scopes.join(divisor) + delimiter\n\t\tthis.#end = prefixEnd(this.#prefix)\n\t}\n\n\tprefix = (key: string) => {\n\t\treturn this.#prefix + key\n\t}\n\n\tunprefix = (fullkey: string) => {\n\t\treturn fullkey.slice(this.#prefix.length)\n\t}\n\n\tscan = (scan: Scan): Scan => {\n\t\tconst {start, end, limit, reverse} = scan\n\n\t\treturn {\n\t\t\tstart: this.#prefix + (start ?? \"\"),\n\t\t\tend: end === undefined\n\t\t\t\t? this.#end\n\t\t\t\t: this.#prefix + end,\n\t\t\tlimit,\n\t\t\treverse,\n\t\t}\n\t}\n}\n\n", "\nimport {Scan} from \"../types.js\"\n\nexport function validateScan(scan: Scan) {\n\tconst limit = scan.limit\n\n\tif (limit !== undefined) {\n\t\tif (!Number.isInteger(limit))\n\t\t\tthrow new Error(\"scan limit must be integer\")\n\n\t\tif (limit < 0)\n\t\t\tthrow new Error(\"scan limit must be positive\")\n\t}\n\n\treturn scan\n}\n\n", "\nexport function validateScopes(scopes: string[]) {\n\tfor (const scope of scopes) {\n\t\tif (scope === \"\") throw new Error(`invalid scope empty string`)\n\t\tforbidden(scope, \".\")\n\t\tforbidden(scope, \":\")\n\t}\n\treturn scopes\n}\n\nfunction forbidden(scope: string, illegal: string) {\n\tif (scope.includes(illegal))\n\t\tthrow new Error(`invalid scope \"${scope}\" contains illegal \"${illegal}\"`)\n}\n\n", "\nimport {got} from \"@e280/stz\"\nimport {Cell} from \"./cell.js\"\nimport {consts} from \"./consts.js\"\nimport {Subtree} from \"./utils/subtree.js\"\nimport {Operator} from \"./utils/operator.js\"\nimport {Prefixer} from \"./utils/prefixer.js\"\nimport {MemoryMagazine} from \"./magazines/memory.js\"\nimport {validateScan} from \"./utils/validate-scan.js\"\nimport {validateScopes} from \"./utils/validate-scopes.js\"\nimport {Magazine, Op, Options, Scan, Pair, Value} from \"./types.js\"\n\nexport class Kv<V = Value> {\n\n\t/** facility for writing operations that could be committed. */\n\treadonly op\n\n\t/** methods that can access all entries under this scope, including child scopes. */\n\treadonly subtree\n\n\t#magazine\n\t#prefixer\n\t#preprocess\n\t#options: Options\n\n\tconstructor(\n\t\t\tmagazine: Magazine = new MemoryMagazine(),\n\t\t\toptions: Partial<Options> = {},\n\t\t) {\n\t\tthis.#magazine = magazine\n\t\tthis.#options = {\n\t\t\tstrict: false,\n\t\t\tscopes: [],\n\t\t\t...options,\n\t\t}\n\t\tvalidateScopes(this.#options.scopes)\n\t\tthis.#prefixer = new Prefixer(this.#options)\n\t\tthis.op = new Operator<V>(this.#prefixer)\n\t\tthis.subtree = new Subtree(this.#magazine, this.#options.scopes)\n\t\tthis.#preprocess = this.#options.strict\n\t\t\t? (value: Value) => JSON.parse(JSON.stringify(value))\n\t\t\t: (value: Value) => value\n\t}\n\n\t/** create a cell which can set or get on a single key */\n\tcell<X extends V = V>(key: string) {\n\t\treturn new Cell<X>(this, key)\n\t}\n\n\t/** create a sub kv where all keys inherit a prefix */\n\tscope<X = Value>(...scopes: string[]) {\n\t\treturn new Kv<X>(this.#magazine, {\n\t\t\t...this.#options,\n\t\t\tscopes: [...this.#options.scopes, ...scopes],\n\t\t})\n\t}\n\n\tasync commit(ops: Op<V>[]) {\n\t\tawait this.#magazine.commit(\n\t\t\tops.map(([key, value]) => [key, (\n\t\t\t\t(value === undefined)\n\t\t\t\t\t? undefined\n\t\t\t\t\t: this.#preprocess(value)\n\t\t\t)])\n\t\t)\n\t}\n\n\tasync set<X extends V = V>(key: string, value: X | undefined) {\n\t\treturn this.commit([this.op.set(key, value)])\n\t}\n\n\tasync setMany<X extends V = V>(changes: [key: string, value: X | undefined][]) {\n\t\treturn this.commit(changes.map(([key, value]) => this.op.set(key, value)))\n\t}\n\n\tasync delete(...keys: string[]) {\n\t\treturn this.commit(keys.map(key => this.op.delete(key)))\n\t}\n\n\tasync getMany<X extends V = V>(keys: string[]) {\n\t\tkeys = keys.map(key => this.#prefixer.prefix(key))\n\t\treturn (await this.#magazine.getMany(keys)).map(value =>\n\t\t\t(value === undefined)\n\t\t\t\t? undefined\n\t\t\t\t: value as X\n\t\t)\n\t}\n\n\tasync get<X extends V = V>(key: string) {\n\t\tconst [value] = await this.getMany<X>([key])\n\t\treturn value\n\t}\n\n\tasync has(key: string) {\n\t\treturn (await this.get(key)) !== undefined\n\t}\n\n\t/** throw if the value is undefined or null */\n\tasync need<X extends V = V>(key: string) {\n\t\treturn got(await this.get<X>(key), `key not found \"${key}\"`)\n\t}\n\n\t/** throw if the value is undefined or null */\n\tasync needMany<X extends V = V>(keys: string[]) {\n\t\tconst values = await this.getMany<X>(keys)\n\t\tfor (const [index, key] of keys.entries())\n\t\t\tgot(values[index], `key not found \"${key}\"`)\n\t\treturn values as X[]\n\t}\n\n\tasync* entries<X extends V = V>(scan: Scan = {}) {\n\t\tscan = validateScan(this.#prefixer.scan(scan))\n\n\t\tfor await (const [key, value] of this.#magazine.entries(scan)) {\n\t\t\tconst key2 = this.#prefixer.unprefix(key)\n\t\t\tif (value !== undefined)\n\t\t\t\tyield [key2, value] as Pair<X>\n\t\t}\n\t}\n\n\t[Symbol.asyncIterator]() {\n\t\treturn this.entries()\n\t}\n\n\tasync* keys(scan: Scan = {}) {\n\t\tfor await (const [key] of this.entries(scan))\n\t\t\tyield key\n\t}\n\n\tasync* values<X extends V = V>(scan: Scan = {}) {\n\t\tfor await (const [, value] of this.entries(scan))\n\t\t\tyield value as X\n\t}\n\n\tasync count(scan: Scan = {}) {\n\t\tlet count = 0\n\t\tfor await (const _ of this.keys(scan)) count++\n\t\treturn count\n\t}\n\n\tasync clear(scan: Scan = {}) {\n\t\tlet changes: Op<V>[] = []\n\n\t\tfor await (const [key] of this.entries(scan)) {\n\t\t\tchanges.push(this.op.delete(key))\n\t\t\tif (changes.length >= consts.chunkSize) {\n\t\t\t\tawait this.commit(changes)\n\t\t\t\tchanges = []\n\t\t\t}\n\t\t}\n\n\t\tif (changes.length)\n\t\t\tawait this.commit(changes)\n\t}\n}\n\n", "\nimport {Parcel} from \"./types.js\"\nimport {endian} from \"../endian.js\"\n\nexport function encodeParcels(parcels: Parcel[]): ArrayBuffer {\n\tconst sizeHeader = 8\n\tconst size = parcels.reduce(\n\t\t(total, {intents}) => total + sizeHeader + intents.byteLength,\n\t\t0,\n\t)\n\n\tconst buffer = new ArrayBuffer(size)\n\tconst view = new DataView(buffer)\n\tconst bytes = new Uint8Array(buffer)\n\tlet cursor = 0\n\n\tfor (const {playerId, intents} of parcels) {\n\t\tview.setUint32(cursor, playerId, endian)\n\t\tcursor += 4\n\n\t\tview.setUint32(cursor, intents.byteLength, endian)\n\t\tcursor += 4\n\n\t\tbytes.set(new Uint8Array(intents), cursor)\n\t\tcursor += intents.byteLength\n\t}\n\n\treturn buffer\n}\n\n", "\nimport {Intent} from \"./types.js\"\nimport {endian} from \"../endian.js\"\nimport {sizeHash, sizeId, sizeIntent, sizeValue} from \"./sizes.js\"\n\nexport function encodeIntents(hash: number, intents: Intent[]) {\n\tconst byteCount = sizeHash + (intents.length * sizeIntent)\n\tconst buffer = new ArrayBuffer(byteCount)\n\tconst dv = new DataView(buffer)\n\tlet cursor = 0\n\n\tdv.setUint32(cursor, hash, endian)\n\tcursor += sizeHash\n\n\tfor (const intent of intents) {\n\t\tdv.setUint16(cursor, intent.id, endian)\n\t\tcursor += sizeId\n\n\t\tdv.setFloat32(cursor, intent.value, endian)\n\t\tcursor += sizeValue\n\t}\n\n\treturn buffer\n}\n\n", "\nimport {isArray, isNumber, isString} from \"@e280/stz\"\nimport type {Bindings} from \"../types.js\"\nimport type {Expression} from \"../expression.js\"\n\nexport function isExpression(b: Bindings): b is Expression {\n\tif (b === null) return true\n\tif (isString(b)) return true\n\tif (isNumber(b)) return true\n\tif (isArray(b)) return true\n\treturn false\n}\n\n", "\nimport {hash32} from \"@e280/stz\"\nimport {Bindings} from \"../types.js\"\nimport {isExpression} from \"./is-expression.js\"\n\nexport function hashBindings(bindings: Bindings) {\n\tconst paths: string[] = []\n\n\tfunction recurse(b: Bindings, path: string[]) {\n\t\tif (isExpression(b)) {\n\t\t\tpaths.push(path.join(\".\"))\n\t\t}\n\t\telse {\n\t\t\tfor (const [key, value] of Object.entries(b))\n\t\t\t\trecurse(value, [...path, key])\n\t\t}\n\t}\n\n\trecurse(bindings, [\"b\"])\n\treturn hash32(...paths)\n}\n\n", "\nimport {RMap, RSet} from \"@e280/strata\"\nimport {got, IdCounter} from \"@e280/stz\"\n\nimport {PlayerId} from \"./types.js\"\nimport {Bindings} from \"../../input/types.js\"\nimport {Controller} from \"../../input/controller.js\"\nimport {encodeParcels} from \"../../input/data/parcel/encode.js\"\nimport {encodeIntents} from \"../../input/data/intent/encode.js\"\nimport {hashBindings} from \"../../input/investigate/hash-bindings.js\"\n\nexport class Hub<B extends Bindings = any> {\n\t#hash\n\t#ids = new IdCounter()\n\t#unassigned = new RSet<Controller<B>>()\n\t#players = new RMap<PlayerId, {controllers: RSet<Controller<B>>}>()\n\n\tconstructor(readonly bindings: B) {\n\t\tthis.#hash = hashBindings(bindings)\n\t}\n\n\tget playerIds() {\n\t\treturn [...this.#players.keys()]\n\t}\n\n\tget controllers() {\n\t\treturn {\n\t\t\tunassigned: [...this.#unassigned],\n\t\t\tassigned: new Map<PlayerId, Controller<B>[]>(\n\t\t\t\t[...this.#players]\n\t\t\t\t\t.map(([playerId, port]) => [playerId, [...port.controllers]])\n\t\t\t),\n\t\t}\n\t}\n\n\tcreatePlayer(): PlayerId {\n\t\tconst playerId = this.#ids.next()\n\t\tthis.#players.set(playerId, {controllers: new RSet()})\n\t\treturn playerId\n\t}\n\n\tdeletePlayer(playerId: PlayerId) {\n\t\tthis.#players.get(playerId)?.controllers.forEach(c => this.#unassigned.add(c))\n\t\tthis.#players.delete(playerId)\n\t\treturn this\n\t}\n\n\tadd(controller: Controller<B>) {\n\t\tthis.unplug(controller)\n\t\treturn this\n\t}\n\n\tremove(controller: Controller<B>) {\n\t\tthis.unplug(controller)\n\t\tthis.#unassigned.delete(controller)\n\t\treturn this\n\t}\n\n\tunplug(controller: Controller<B>) {\n\t\tthis.#unassigned.add(controller)\n\t\tfor (const port of this.#players.values())\n\t\t\tport.controllers.delete(controller)\n\t\treturn this\n\t}\n\n\tplug(controller: Controller<B>, playerId?: PlayerId) {\n\t\tplayerId ??= this.playerIds.at(-1) ?? this.createPlayer()\n\t\tthis.unplug(controller)\n\t\tgot(this.#players.get(playerId)).controllers.add(controller)\n\t\tthis.#unassigned.delete(controller)\n\t\treturn this\n\t}\n\n\tencode(playerId: PlayerId, time = performance.now()) {\n\t\tconst intents = new Map<number, number>()\n\t\tconst {controllers} = got(this.#players.get(playerId))\n\n\t\tfor (const controller of controllers) {\n\t\t\tfor (const intent of controller.evaluate(time)) {\n\t\t\t\tconst alpha = intents.get(intent.id) ?? 0\n\t\t\t\tintents.set(intent.id, alpha + intent.value)\n\t\t\t}\n\t\t}\n\n\t\tconst changedIntents = [...intents]\n\t\t\t.filter(([, value]) => value !== 0)\n\t\t\t.map(([id, value]) => ({id, value}))\n\n\t\treturn encodeIntents(this.#hash, changedIntents)\n\t}\n\n\tencodeAll(time = performance.now()) {\n\n\t\t// drain and discard unused controller inputs.\n\t\tfor (const controller of this.#unassigned)\n\t\t\tcontroller.clear()\n\n\t\t// encode intents.\n\t\tconst parcels = Array.from(this.#players.keys()).map(playerId => ({\n\t\t\tplayerId,\n\t\t\tintents: this.encode(playerId, time),\n\t\t}))\n\n\t\t// encode parcels.\n\t\treturn encodeParcels(parcels)\n\t}\n}\n\n", "\nimport {given, got} from \"@e280/stz\"\nimport {ControlsData} from \"./data.js\"\nimport {ProfileKey} from \"../../types.js\"\nimport {Bindings} from \"../../../../input/types.js\"\nimport {Controller} from \"../../../../input/controller.js\"\n\nexport function getProfile<B extends Bindings>(\n\t\tdata: ControlsData<B>,\n\t\tprofileKey?: ProfileKey,\n\t) {\n\n\tconst {presets, customs, fallback} = data.profiles\n\n\tif (profileKey === undefined)\n\t\treturn fallback.profile\n\n\treturn customs.get(profileKey)\n\t\t?? presets.get(profileKey)\n\t\t?? got(presets.get(fallback.key))\n}\n\nexport async function assignProfile<B extends Bindings>(\n\t\tdata: ControlsData<B>,\n\t\tcontroller: Controller,\n\t\tprofileKey: ProfileKey,\n\t) {\n\n\tconst {kvs, controllers, assignments} = data\n\tcontroller.bindings = getProfile(data, profileKey).bindings\n\tassignments.set(controller, profileKey)\n\n\tawait given(controllers.get(controller)?.handle, async handle => {\n\t\tdata.preferences.set(handle, profileKey)\n\t\tawait kvs.preferences.set(handle, profileKey)\n\t})\n}\n\n", "\nimport {Bindings} from \"../types.js\"\nimport {hashBindings} from \"./hash-bindings.js\"\n\nexport function isCompatible(bindingsA: Bindings, bindingsB: Bindings) {\n\treturn hashBindings(bindingsA) === hashBindings(bindingsB)\n}\n\n", "\nimport {ControlsData} from \"./data.js\"\nimport {Profile, ProfileKey} from \"../../types.js\"\nimport {assignProfile, getProfile} from \"./fns.js\"\nimport {Bindings} from \"../../../../input/types.js\"\nimport {isCompatible} from \"../../../../input/investigate/is-compatible.js\"\n\nexport class Profiles<B extends Bindings> {\n\t#data\n\n\tconstructor(data: ControlsData<B>) {\n\t\tthis.#data = data\n\t}\n\n\t#ensureBindingsAreCompatible(b: B) {\n\t\tif (!isCompatible(b, this.#data.bindings))\n\t\t\tthrow new Error(\"incompatible bindings\")\n\t}\n\n\tget presets() {\n\t\treturn [...this.#data.profiles.presets]\n\t}\n\n\tget customs() {\n\t\treturn [...this.#data.profiles.customs]\n\t}\n\n\tisPreset(profileKey: string) {\n\t\treturn this.#data.profiles.presets.has(profileKey)\n\t}\n\n\tget(profileKey?: ProfileKey) {\n\t\treturn getProfile(this.#data, profileKey)\n\t}\n\n\tasync create(key: ProfileKey, profile: Profile<B>) {\n\t\tconst {kvs, profiles} = this.#data\n\t\tthis.#ensureBindingsAreCompatible(profile.bindings)\n\t\tprofiles.customs.set(key, profile)\n\t\tawait kvs.profiles.set(key, profile)\n\t\tthis.#data.subby.publish()\n\t}\n\n\tasync clone(key: ProfileKey, basedOn: ProfileKey) {\n\t\tconst {label, bindings} = this.get(basedOn)\n\t\tawait this.create(key, {basedOn, bindings, label: `${label} copy`})\n\t}\n\n\tasync delete(profileKey: ProfileKey) {\n\t\tconst {kvs, assignments, profiles: {customs, fallback}} = this.#data\n\t\tcustoms.delete(profileKey)\n\t\tawait kvs.profiles.delete(profileKey)\n\t\tfor (const [controller, controllerKey] of assignments)\n\t\t\tif (controllerKey === profileKey)\n\t\t\t\tawait assignProfile(this.#data, controller, fallback.key)\n\t\tthis.#data.subby.publish()\n\t}\n\n\tasync update(profileKey: ProfileKey, changes: Partial<{\n\t\t\tbindings: B\n\t\t\tlabel: string\n\t\t}>) {\n\n\t\tconst {kvs, assignments, profiles: {customs}} = this.#data\n\n\t\tif (changes.bindings)\n\t\t\tthis.#ensureBindingsAreCompatible(changes.bindings)\n\n\t\tconst staleProfile = this.get(profileKey)\n\t\tconst freshProfile = {...structuredClone(staleProfile), ...changes}\n\n\t\tcustoms.set(profileKey, freshProfile)\n\n\t\tfor (const [controller, controllerKey] of assignments) {\n\t\t\tif (controllerKey === profileKey)\n\t\t\t\tcontroller.bindings = freshProfile.bindings\n\t\t}\n\n\t\tawait kvs.profiles.set(profileKey, freshProfile)\n\t\tthis.#data.subby.publish()\n\t}\n}\n\n", "\nimport {RMap} from \"@e280/strata\"\nimport {got, IdCounter, setEntries, subby} from \"@e280/stz\"\n\nimport {Profile, ProfileKey} from \"../../types.js\"\nimport {Bindings} from \"../../../../input/types.js\"\nimport {Controller} from \"../../../../input/controller.js\"\nimport {hashBindings} from \"../../../../input/investigate/hash-bindings.js\"\nimport {ControllerHandle, ControllerMeta, ControlsOptions} from \"../types.js\"\n\nexport type ControlsData<B extends Bindings> = (\n\tReturnType<typeof makeControlsData<B>>\n)\n\nexport function makeControlsData<B extends Bindings>(options: ControlsOptions<B>) {\n\tconst {presets} = options\n\tconst fallbackKey = got(Object.keys(presets)[0], \"missing presets\")\n\tconst fallbackProfile = got(presets[fallbackKey])\n\tconst bindings = fallbackProfile.bindings\n\n\tconst kv = options.kv.scope(\n\t\thashBindings(bindings).toString()\n\t)\n\n\tconst profiles = {\n\t\tpresets: new RMap<ProfileKey, Profile<B>>(),\n\t\tcustoms: new RMap<ProfileKey, Profile<B>>(),\n\t\tfallback: {key: fallbackKey, profile: fallbackProfile},\n\t}\n\n\tsetEntries(profiles.presets, Object.entries(presets))\n\n\treturn {\n\t\tsubby: subby(),\n\n\t\tkv,\n\t\tpresets,\n\t\tbindings,\n\t\tidCounter: new IdCounter(),\n\n\t\tprofiles,\n\n\t\tcontrollers: new RMap<Controller, ControllerMeta>(),\n\t\tassignments: new RMap<Controller, ProfileKey>(),\n\t\tpreferences: new RMap<ControllerHandle, ProfileKey>(),\n\n\t\tkvs: {\n\t\t\tprofiles: kv.scope<Profile>(\"profiles\"),\n\t\t\tpreferences: kv.scope<ProfileKey>(\"preferences\"),\n\t\t},\n\t}\n}\n\n", "\nimport {assignProfile} from \"./fns.js\"\nimport {ControlsData} from \"./data.js\"\nimport {ProfileKey} from \"../../types.js\"\nimport {Controller} from \"../../../../input/controller.js\"\n\nexport class Assignments {\n\t#data\n\n\tconstructor(data: ControlsData<any>) {\n\t\tthis.#data = data\n\t}\n\n\tasync assign(controller: Controller, profileKey: ProfileKey) {\n\t\tawait assignProfile(this.#data, controller, profileKey)\n\t\tthis.#data.subby.publish()\n\t}\n\n\tassignedProfileKeyOf(controller: Controller) {\n\t\tconst {assignments} = this.#data\n\t\treturn assignments.get(controller) ?? this.#data.profiles.fallback.key\n\t}\n}\n\n", "\nimport {collect, got, setEntries} from \"@e280/stz\"\n\nimport {Profiles} from \"./internal/profiles.js\"\nimport {Bindings} from \"../../../input/types.js\"\nimport {makeControlsData} from \"./internal/data.js\"\nimport {Assignments} from \"./internal/assignments.js\"\nimport {Controller} from \"../../../input/controller.js\"\nimport {ControllerMeta, ControlsOptions} from \"./types.js\"\n\nexport class Controls<B extends Bindings = any> {\n\t#data\n\tprofiles\n\tassignments\n\treadonly presets\n\n\tconstructor(options: ControlsOptions<B>) {\n\t\tthis.#data = makeControlsData(options)\n\t\tthis.profiles = new Profiles(this.#data)\n\t\tthis.assignments = new Assignments(this.#data)\n\t\tthis.presets = options.presets\n\t}\n\n\tget on() {\n\t\treturn this.#data.subby.on\n\t}\n\n\t#rebind(controller: Controller) {\n\t\tconst {preferences, assignments, controllers} = this.#data\n\t\tconst meta = got(controllers.get(controller))\n\n\t\tconst profileKey = assignments.get(controller)\n\t\t\t?? preferences.get(meta.handle)\n\t\t\t?? meta.defaultProfileKey\n\n\t\tcontroller.bindings = this.profiles.get(profileKey).bindings\n\t\tassignments.set(controller, profileKey)\n\t}\n\n\tasync load() {\n\t\tconst {kvs, controllers, preferences, profiles: {customs}} = this.#data\n\n\t\tcustoms.clear()\n\t\tsetEntries(customs, await collect(kvs.profiles))\n\n\t\tpreferences.clear()\n\t\tsetEntries(preferences, await collect(kvs.preferences))\n\n\t\tfor (const controller of controllers.keys())\n\t\t\tthis.#rebind(controller)\n\t}\n\n\tget controllers() {\n\t\treturn [...this.#data.controllers.keys()]\n\t}\n\n\tget fallbackProfileKey() {\n\t\treturn this.#data.profiles.fallback.key\n\t}\n\n\tmeta(controller: Controller) {\n\t\treturn this.#data.controllers.get(controller)\n\t}\n\n\tattach(controller: Controller, meta: Omit<ControllerMeta, \"id\">) {\n\t\tconst id = this.#data.idCounter.next()\n\t\tthis.#data.controllers.set(controller, {...meta, id})\n\t\tthis.#rebind(controller)\n\t}\n\n\tdetach(controller: Controller) {\n\t\tthis.#data.controllers.delete(controller)\n\t\tthis.#data.assignments.delete(controller)\n\t}\n}\n\n", "\nimport {Presets} from \"../types.js\"\nimport {Bindings} from \"../../../input/types.js\"\n\nexport function firstPreset<B extends Bindings>(presets: Presets<B>) {\n\tconst [key, profile] = Object.entries(presets)[0]\n\treturn {key, profile}\n}\n\n", "\nimport {IdbMagazine, idbOpen, Kv} from \"@e280/kv\"\n\nimport {Hub} from \"../hub.js\"\nimport {asDeck} from \"../types.js\"\nimport {SetupParams} from \"./types.js\"\nimport {Controls} from \"../controls/controls.js\"\nimport {Bindings} from \"../../../input/types.js\"\nimport {firstPreset} from \"../utils/first-preset.js\"\n\nexport async function setupDeck<B extends Bindings>(params: SetupParams<B>) {\n\tconst kv = params.kv\n\t\t?? new Kv(new IdbMagazine(await idbOpen(\"tact\", \"kv\")))\n\n\tconst broadcastChannel = params.broadcastChannel\n\t\t?? new BroadcastChannel(\"tact\")\n\n\tconst {maxPlayers} = params\n\tconst {bindings} = firstPreset(params.presets).profile\n\n\tconst hub = new Hub(bindings)\n\tconst controls = new Controls({...params, kv})\n\n\tawait controls.load()\n\n\tbroadcastChannel.onmessage = () => controls.load()\n\tcontrols.on(() => broadcastChannel.postMessage({}))\n\n\treturn asDeck({hub, controls, maxPlayers})\n}\n\n", "\nimport {Intent} from \"./types.js\"\nimport {endian} from \"../endian.js\"\nimport {sizeHash, sizeId, sizeValue} from \"./sizes.js\"\n\nexport function decodeIntents(buffer: ArrayBuffer) {\n\tconst intents: Intent[] = []\n\tconst dv = new DataView(buffer)\n\tlet cursor = 0\n\n\tconst hash = dv.getUint32(cursor, endian)\n\tcursor += sizeHash\n\n\twhile (cursor < buffer.byteLength) {\n\t\tconst id = dv.getUint16(cursor, endian)\n\t\tcursor += sizeId\n\n\t\tconst value = dv.getFloat32(cursor, endian)\n\t\tcursor += sizeValue\n\n\t\tintents.push({id, value})\n\t}\n\n\treturn {hash, intents}\n}\n\n", "\nimport {Input} from \"../types.js\"\n\nexport function makeInput(): Input {\n\treturn {value: 0, was: 0, sum: 0}\n}\n\n", "\nimport {obmap} from \"@e280/stz\"\nimport {makeInput} from \"./make-input.js\"\nimport {Expression} from \"../expression.js\"\nimport {hashBindings} from \"./hash-bindings.js\"\nimport {isExpression} from \"./is-expression.js\"\nimport {Bindings, Input, Inputs} from \"../types.js\"\n\nexport function investigate<B extends Bindings>(bindings: B) {\n\tconst hash = hashBindings(bindings)\n\tconst inputList: Input[] = []\n\tconst rootList: Expression[] = []\n\n\tfunction makeInputs(b: Bindings): unknown {\n\t\tif (isExpression(b)) {\n\t\t\tconst input = makeInput()\n\t\t\tinputList.push(input)\n\t\t\trootList.push(b)\n\t\t\treturn input\n\t\t}\n\t\telse {\n\t\t\treturn obmap(b, makeInputs)\n\t\t}\n\t}\n\n\tconst inputs = makeInputs(bindings) as Inputs<B>\n\n\treturn {\n\t\thash,\n\t\tinputs,\n\t\tinputList,\n\t\trootList,\n\t}\n}\n\n", "\nimport {Inputs, Bindings} from \"./types.js\"\nimport {decodeIntents} from \"./data/intent/decode.js\"\nimport {investigate} from \"./investigate/investigate.js\"\n\nexport class InputDecoder<B extends Bindings> {\n\t#investigation\n\n\tconstructor(bindings: B) {\n\t\tthis.#investigation = investigate(bindings)\n\t}\n\n\tget inputs() {\n\t\treturn this.#investigation.inputs\n\t}\n\n\tdecode(...buffers: ArrayBuffer[]): Inputs<B> {\n\t\tconst inputs = this.#investigation.inputList\n\n\t\tfor (const input of inputs) {\n\t\t\tinput.was = input.value\n\t\t\tinput.sum = 0\n\t\t}\n\n\t\tfor (const buffer of buffers) {\n\t\t\tconst decoded = decodeIntents(buffer)\n\n\t\t\tif (decoded.hash !== this.#investigation.hash)\n\t\t\t\tthrow new Error(\"intent bindings hash mismatch\")\n\n\t\t\tfor (const input of inputs)\n\t\t\t\tinput.value = 0\n\n\t\t\tfor (const {id, value} of decoded.intents) {\n\t\t\t\tconst input = inputs[id]\n\t\t\t\tinput.value = value\n\t\t\t}\n\n\t\t\tfor (const input of inputs)\n\t\t\t\tinput.sum += input.value\n\t\t}\n\n\t\treturn this.inputs\n\t}\n}\n\n", "\nimport {Parcel} from \"./types.js\"\nimport {endian} from \"../endian.js\"\nimport {sizeHeader, sizeLength, sizePlayerId} from \"./sizes.js\"\n\nexport function decodeParcels(buffer: ArrayBuffer): Parcel[] {\n\tconst view = new DataView(buffer)\n\tconst parcels: Parcel[] = []\n\tlet cursor = 0\n\n\twhile (cursor < buffer.byteLength) {\n\t\tif (buffer.byteLength - cursor < sizeHeader)\n\t\t\tthrow new Error(\"truncated header\")\n\n\t\tconst playerId = view.getUint32(cursor, endian)\n\t\tcursor += sizePlayerId\n\n\t\tconst length = view.getUint32(cursor, endian)\n\t\tcursor += sizeLength\n\n\t\tif (length > buffer.byteLength - cursor)\n\t\t\tthrow new Error(\"truncated data\")\n\n\t\tconst intents = buffer.slice(cursor, cursor + length)\n\t\tcursor += length\n\n\t\tparcels.push({playerId: playerId, intents})\n\t}\n\n\treturn parcels\n}\n\n", "\nimport {RMap} from \"@e280/strata\"\nimport {guarantee} from \"@e280/stz\"\n\nimport {PlayerId} from \"./types.js\"\nimport {Bindings} from \"../../input/types.js\"\nimport {InputDecoder} from \"../../input/decoder.js\"\nimport {decodeParcels} from \"../../input/data/parcel/decode.js\"\n\nexport class Collector<B extends Bindings> {\n\t#bindings: B\n\t#decoders = new RMap<PlayerId, InputDecoder<B>>()\n\n\tconstructor(bindings: B) {\n\t\tthis.#bindings = bindings\n\t}\n\n\tget players() {\n\t\treturn [...this.#decoders].map(([playerId, decoder]) => ({\n\t\t\tplayerId,\n\t\t\tinputs: decoder.inputs,\n\t\t}))\n\t}\n\n\t#getDecoder(playerId: PlayerId) {\n\t\treturn guarantee(\n\t\t\tthis.#decoders,\n\t\t\tplayerId,\n\t\t\t() => new InputDecoder(this.#bindings),\n\t\t)\n\t}\n\n\tdecodeAll(...buffers: ArrayBuffer[]) {\n\t\tconst grouped = new Map<PlayerId, ArrayBuffer[]>()\n\n\t\tfor (const buffer of buffers) {\n\t\t\tfor (const {playerId, intents} of decodeParcels(buffer))\n\t\t\t\tguarantee(grouped, playerId, () => []).push(intents)\n\t\t}\n\n\t\tfor (const [playerId, intents] of grouped)\n\t\t\tthis.#getDecoder(playerId).decode(...intents)\n\n\t\tfor (const playerId of this.#decoders.keys()) {\n\t\t\tif (!grouped.has(playerId))\n\t\t\t\tthis.#decoders.delete(playerId)\n\t\t}\n\n\t\treturn this.players\n\t}\n}\n\n", "\nimport {arraylimit} from \"@e280/stz\"\nimport {Sample, Source} from \"../types.js\"\n\nconst limit = 1024\n\nexport class Sampler {\n\treadonly dispose\n\t#source\n\t#samples: Sample[] = []\n\n\tconstructor(source: Source) {\n\t\tthis.#source = source\n\t\tthis.dispose = source.onSample(sample => {\n\t\t\tthis.#samples.push(sample)\n\t\t\tif (this.#samples.length > limit) console.warn(`tact sampler exceeded limit ${limit}`)\n\t\t\tthis.#samples = arraylimit(this.#samples, limit)\n\t\t})\n\t}\n\n\ttake() {\n\t\tthis.#source.poll?.()\n\t\tconst samples = this.#samples\n\t\tthis.#samples = []\n\t\treturn samples\n\t}\n}\n\n", "\nexport const {min, max, abs, sign, floor, ceil, pow} = Math\n\nexport function sum(...numbers: number[]) {\n\tlet x = 0\n\tfor (const n of numbers)\n\t\tx += n\n\treturn x\n}\n\nexport function average(...numbers: number[]) {\n\tif (numbers.length === 0) throw new Error(\"no numbers for average fn\")\n\treturn sum(...numbers) / numbers.length\n}\n\n/** inclusive */\nexport function between(x: number, a = 0, b = 1) {\n\tconst small = Math.min(a, b)\n\tconst big = Math.max(a, b)\n\treturn (x >= small) && (x <= big)\n}\n\nexport function clamp(x: number, a: number = 0, b: number = 1) {\n\tx = min(x, b)\n\tx = max(x, a)\n\treturn x\n}\n\nexport function invert(x: number) {\n\treturn 1 - x\n}\n\nexport function atLeast(x: number, least = 0) {\n\treturn Math.max(x, least)\n}\n\nexport function atMost(x: number, most = 1) {\n\treturn Math.min(x, most)\n}\n\nexport function distance(x: number, y: number) {\n\treturn Math.abs(x - y)\n}\n\nexport function wrap(x: number, a: number = 0, b: number = 1) {\n\tconst small = min(a, b)\n\tconst big = max(a, b)\n\tconst span = big - small\n\tconst adjusted = x - small\n\tconst wrapped = (adjusted < 0)\n\t\t? span - (-adjusted % span)\n\t\t: adjusted % span\n\treturn small + wrapped\n}\n\nexport function lerp(fraction: number, from: number, to: number, maxDelta?: number) {\n\tconst difference = to - from\n\tlet delta = difference * fraction\n\tif (maxDelta !== undefined && abs(delta) > maxDelta)\n\t\tdelta = sign(delta) * maxDelta\n\treturn from + delta\n}\n\nexport function unlerp(x: number, a: number, b: number) {\n\treturn (x - a) / (b - a)\n}\n\nexport function remap(x: number, a1: number, a2: number, b1: number = 0, b2: number = 1, clamping = false) {\n\tlet fraction = unlerp(x, a1, a2)\n\tif (clamping) fraction = clamp(fraction)\n\treturn lerp(fraction, b1, b2)\n}\n\n/** calculate a time-based lerp factor */\nexport function halflife(halfTime: number, deltaTime: number) {\n\treturn 1 - pow(0.5, deltaTime / halfTime)\n}\n\nexport function approach(maxDelta: number, from: number, to: number) {\n\tconst delta = clamp(to - from, -maxDelta, maxDelta)\n\treturn from + delta\n}\n\nexport function stronger(noul: number, power = 2) {\n\tnoul = invert(noul)\n\tnoul = noul ** power\n\treturn invert(noul)\n}\n\nexport function weaker(noul: number, power = 2) {\n\treturn noul ** power\n}\n\nexport function smoothstep(x: number) {\n\treturn x * x * (3 - (2 * x))\n}\n\nexport function smootherstep(x: number) {\n\treturn x * x * x * (x * (x * 6 - 15) + 10)\n}\n\n", "\nimport {clamp} from \"./basics.js\"\nimport {XyArray} from \"./tuples.js\"\n\nexport type Xy = {x: number, y: number}\n\nexport const index2d = (extent: Xy, vec: Xy) => {\n\treturn (vec.y * extent.x) + vec.x\n}\n\nexport const unindex2d = (extent: Xy, index: number) => {\n\tconst x = index % extent.x\n\tconst y = Math.floor(index / extent.x)\n\treturn new Vec2(x, y)\n}\n\ntype Vec2ish<T extends Vec2> = new(x?: number, y?: number) => T\n\nexport class Vec2 implements Xy {\n\tconstructor(\n\t\tpublic x = 0,\n\t\tpublic y = 0,\n\t) {}\n\n\tstatic new<T extends Vec2>(this: Vec2ish<T>, x = 0, y = 0) {\n\t\treturn new this(x, y)\n\t}\n\n\tstatic zero<T extends Vec2>(this: Vec2ish<T>) {\n\t\treturn new this()\n\t}\n\n\tstatic fill<T extends Vec2>(this: Vec2ish<T>, value: number) {\n\t\treturn new this(value, value)\n\t}\n\n\tstatic from<T extends Vec2>(this: Vec2ish<T>, v: XyArray | Xy): T {\n\t\treturn (\n\t\t\tArray.isArray(v)\n\t\t\t\t? new this(...v)\n\t\t\t\t: new this(v.x, v.y)\n\t\t)\n\t}\n\n\tstatic magnitudeSquared(x: number, y: number) {\n\t\treturn (x * x) + (y * y)\n\t}\n\n\tstatic magnitude(x: number, y: number) {\n\t\treturn Math.sqrt(this.magnitudeSquared(x, y))\n\t}\n\n\tstatic average<T extends Vec2>(this: Vec2ish<T>, ...vectors: Xy[]): T {\n\t\treturn new this()\n\t\t\t.add(...vectors)\n\t\t\t.divBy(vectors.length)\n\t}\n\n\tstatic min<T extends Vec2>(this: Vec2ish<T>, ...vecs: Xy[]) {\n\t\treturn new this(\n\t\t\tMath.min(...vecs.map(v => v.x)),\n\t\t\tMath.min(...vecs.map(v => v.y)),\n\t\t)\n\t}\n\n\tstatic max<T extends Vec2>(this: Vec2ish<T>, ...vecs: Xy[]) {\n\t\treturn new this(\n\t\t\tMath.max(...vecs.map(v => v.x)),\n\t\t\tMath.max(...vecs.map(v => v.y)),\n\t\t)\n\t}\n\n\tstatic rotation<T extends Vec2>(this: Vec2ish<T>, radians: number) {\n\t\treturn new this(\n\t\t\tMath.cos(radians),\n\t\t\tMath.sin(radians),\n\t\t)\n\t}\n\n\tdup() {\n\t\treturn new (this.constructor as any)(this.x, this.y) as typeof this\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.x\n\t\tyield this.y\n\t}\n\n\tarray(): XyArray {\n\t\treturn [this.x, this.y]\n\t}\n\n\ttoJSON(): XyArray {\n\t\treturn this.array()\n\t}\n\n\ttoString() {\n\t\treturn `(${this.constructor.name} x${this.x.toFixed(2)}, y${this.y.toFixed(2)})`\n\t}\n\n\t/** mutator */\n\tfill(n: number) {\n\t\tthis.x = n\n\t\tthis.y = n\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tzero() {\n\t\treturn this.fill(0)\n\t}\n\n\t/** mutator */\n\tset_(x: number, y: number) {\n\t\tthis.x = x\n\t\tthis.y = y\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tset({x, y}: Xy) {\n\t\tthis.x = x\n\t\tthis.y = y\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tfrom(v: Xy | XyArray) {\n\t\tif (Array.isArray(v)) {\n\t\t\tconst [x, y] = v\n\t\t\tthis.x = x\n\t\t\tthis.y = y\n\t\t}\n\t\telse {\n\t\t\tconst {x, y} = v\n\t\t\tthis.x = x\n\t\t\tthis.y = y\n\t\t}\n\t\treturn this\n\t}\n\n\tmagnitudeSquared() {\n\t\treturn Vec2.magnitudeSquared(this.x, this.y)\n\t}\n\n\tmagnitude() {\n\t\treturn Vec2.magnitude(this.x, this.y)\n\t}\n\n\trotation() {\n\t\treturn Math.atan2(this.y, this.x)\n\t}\n\n\tequals_(x: number, y: number) {\n\t\treturn (\n\t\t\tthis.x === x &&\n\t\t\tthis.y === y\n\t\t)\n\t}\n\n\tequals(...vecs: Xy[]) {\n\t\treturn vecs.every(({x, y}) => this.equals_(x, y))\n\t}\n\n\tnear_(x: number, y: number, epsilon = 1e-6) {\n\t\treturn (\n\t\t\tMath.abs(this.x - x) <= epsilon &&\n\t\t\tMath.abs(this.y - y) <= epsilon\n\t\t)\n\t}\n\n\tnear({x, y}: Xy, epsilon = 1e-6) {\n\t\treturn this.near_(x, y, epsilon)\n\t}\n\n\tdot_(x: number, y: number) {\n\t\treturn (this.x * x) + (this.y * y)\n\t}\n\n\tdot({x, y}: Xy) {\n\t\treturn this.dot_(x, y)\n\t}\n\n\tdistanceSquared_(x: number, y: number) {\n\t\tx = this.x - x\n\t\ty = this.y - y\n\t\treturn (x * x) + (y * y)\n\t}\n\n\tdistanceSquared({x, y}: Xy) {\n\t\treturn this.distanceSquared_(x, y)\n\t}\n\n\tdistance_(x: number, y: number) {\n\t\treturn Math.sqrt(this.distanceSquared_(x, y))\n\t}\n\n\tdistance({x, y}: Xy) {\n\t\treturn this.distance_(x, y)\n\t}\n\n\tangleBetween_(x: number, y: number) {\n\t\tconst dot = this.dot_(x, y)\n\t\tconst magnitudes = this.magnitude() * Vec2.magnitude(x, y)\n\t\tif (magnitudes === 0) return 0\n\t\tconst ratio = clamp(dot / magnitudes, -1, 1)\n\t\treturn Math.acos(ratio)\n\t}\n\n\tangleBetween({x, y}: Xy) {\n\t\treturn this.angleBetween_(x, y)\n\t}\n\n\t/** mutator */\n\tnormalize() {\n\t\treturn this.divBy(this.magnitude())\n\t}\n\n\t/** mutator */\n\thalf() {\n\t\treturn this.divBy(2)\n\t}\n\n\t/** mutator */\n\tdouble() {\n\t\treturn this.mulBy(2)\n\t}\n\n\t/** mutator */\n\tabs() {\n\t\treturn this.map(x => Math.abs(x))\n\t}\n\n\t/** mutator */\n\trotate(radians: number) {\n\t\tconst {x, y} = this\n\t\tthis.x = (x * Math.cos(radians)) - (y * Math.sin(radians))\n\t\tthis.y = (x * Math.sin(radians)) + (y * Math.cos(radians))\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tperpendicular() {\n\t\tconst {x, y} = this\n\t\tthis.x = -y\n\t\tthis.y = x\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tclampMagnitude(max: number) {\n\t\tconst mag = this.magnitude()\n\t\tif (mag > max)\n\t\t\tthis.normalize().mulBy(max)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tfloor() {\n\t\tthis.x = Math.floor(this.x)\n\t\tthis.y = Math.floor(this.y)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tceil() {\n\t\tthis.x = Math.ceil(this.x)\n\t\tthis.y = Math.ceil(this.y)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tround() {\n\t\tthis.x = Math.round(this.x)\n\t\tthis.y = Math.round(this.y)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tmap(fn: (a: number, index: number) => number) {\n\t\tthis.x = fn(this.x, 0)\n\t\tthis.y = fn(this.y, 1)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tmorph(fn: (vec: Vec2) => (Xy | void)) {\n\t\tconst result = fn(this)\n\t\tif (result && result !== this) this.set(result)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tclamp(min: Xy = {x: 0, y: 0}, max: Xy = {x: 1, y: 1}) {\n\t\tthis.x = clamp(this.x, min.x, max.x)\n\t\tthis.y = clamp(this.y, min.y, max.y)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tclampBy(min = 0, max = 1) {\n\t\tthis.x = clamp(this.x, min, max)\n\t\tthis.y = clamp(this.y, min, max)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tnegate() {\n\t\treturn this.map(a => a * -1)\n\t}\n\n\t/** mutator */\n\taddBy(delta: number) {\n\t\tthis.x += delta\n\t\tthis.y += delta\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tsubBy(delta: number) {\n\t\tthis.x -= delta\n\t\tthis.y -= delta\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tmulBy(coefficient: number) {\n\t\tthis.x *= coefficient\n\t\tthis.y *= coefficient\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tscale(coefficient: number) {\n\t\tthis.x *= coefficient\n\t\tthis.y *= coefficient\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tdivBy(divisor: number) {\n\t\tif (divisor === 0) return this\n\t\tthis.x /= divisor\n\t\tthis.y /= divisor\n\t\treturn this\n\t}\n\n\t///////////////////////////////////////////////////////////////////////\n\n\t/** mutator */\n\tadd_(x: number, y: number) {\n\t\tthis.x += x\n\t\tthis.y += y\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tadd(...vecs: Xy[]) {\n\t\tfor (const {x, y} of vecs) this.add_(x, y)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tsub_(x: number, y: number) {\n\t\tthis.x -= x\n\t\tthis.y -= y\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tsub(...vecs: Xy[]) {\n\t\tfor (const {x, y} of vecs) this.sub_(x, y)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tmul_(x: number, y: number) {\n\t\tthis.x *= x\n\t\tthis.y *= y\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tmul(...vecs: Xy[]) {\n\t\tfor (const {x, y} of vecs) this.mul_(x, y)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tdiv_(x: number, y: number) {\n\t\tif (x !== 0) this.x /= x\n\t\tif (y !== 0) this.y /= y\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tdiv(...vecs: Xy[]) {\n\t\tfor (const {x, y} of vecs) this.div_(x, y)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tlerp_(x: number, y: number, fraction: number) {\n\t\tthis.x += (x - this.x) * fraction\n\t\tthis.y += (y - this.y) * fraction\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tlerp(fraction: number, {x, y}: Xy) {\n\t\treturn this.lerp_(fraction, x, y)\n\t}\n\n\t/** mutator */\n\treflect_(x: number, y: number) {\n\t\tconst dot = 2 * this.dot_(x, y)\n\t\tthis.x -= dot * x\n\t\tthis.y -= dot * y\n\t\treturn this\n\t}\n\n\t/** mutator */\n\treflect({x, y}: Xy) {\n\t\treturn this.reflect_(x, y)\n\t}\n\n\t/** mutator */\n\trotateAroundPoint_(radians: number, x: number, y: number) {\n\t\tconst dx = this.x - x\n\t\tconst dy = this.y - y\n\t\tconst cos = Math.cos(radians)\n\t\tconst sin = Math.sin(radians)\n\t\tthis.x = cos * dx - sin * dy + x\n\t\tthis.y = sin * dx + cos * dy + y\n\t\treturn this\n\t}\n\n\t/** mutator */\n\trotateAroundPoint(radians: number, {x, y}: Xy) {\n\t\treturn this.rotateAroundPoint_(radians, x, y)\n\t}\n}\n\n", "\nexport function isDown(value: number) {\n\treturn value !== 0\n}\n\n", "\nimport {remap} from \"@benev/math\"\nimport {arraylimit, guarantee, isHappy, isNumber, isString} from \"@e280/stz\"\n\nimport {isDown} from \"../utils/is-down.js\"\nimport {EvaluationContext} from \"./context.js\"\nimport type {Expression} from \"../expression.js\"\n\nexport function evaluate(\n\t\tcontext: EvaluationContext,\n\t\texpression: Expression,\n\t): number {\n\n\tconst e = (expression: Expression) => evaluate(context, expression)\n\n\tif (expression === null)\n\t\treturn 0\n\n\tif (isNumber(expression))\n\t\treturn expression\n\n\telse if (isString(expression)) {\n\t\tconst latest = context.latestValues.get(expression) ?? 0\n\t\treturn context.recentSamples\n\t\t\t.filter(s => s.code === expression)\n\t\t\t.reduce(\n\t\t\t\t(peak, s) => Math.abs(s.value) > Math.abs(peak)\n\t\t\t\t\t? s.value\n\t\t\t\t\t: peak,\n\t\t\t\tlatest,\n\t\t\t)\n\t}\n\n\telse switch (expression[0]) {\n\t\tcase \"accumulate\": {\n\t\t\tconst code = expression[1]\n\t\t\tlet x = 0\n\t\t\tfor (const sample of context.recentSamples) {\n\t\t\t\tif (sample.code === code)\n\t\t\t\t\tx += sample.value\n\t\t\t}\n\t\t\treturn x\n\t\t}\n\n\t\tcase \"up\": {\n\t\t\tconst code = expression[1]\n\t\t\tlet ups = 0\n\t\t\tlet was = context.previousValues.get(code) ?? 0\n\t\t\tfor (const sample of context.recentSamples) {\n\t\t\t\tif (sample.code !== code) continue\n\t\t\t\tif (isDown(was) && !isDown(sample.value))\n\t\t\t\t\tups++\n\t\t\t\twas = sample.value\n\t\t\t}\n\t\t\treturn ups\n\t\t}\n\n\t\tcase \"down\": {\n\t\t\tconst code = expression[1]\n\t\t\tlet downs = 0\n\t\t\tlet was = context.previousValues.get(code) ?? 0\n\t\t\tfor (const sample of context.recentSamples) {\n\t\t\t\tif (sample.code !== code) continue\n\t\t\t\tif (!isDown(was) && isDown(sample.value))\n\t\t\t\t\tdowns++\n\t\t\t\twas = sample.value\n\t\t\t}\n\t\t\treturn downs\n\t\t}\n\n\t\tcase \"was\": {\n\t\t\tconst code = expression[1]\n\t\t\treturn context.previousValues.get(code) ?? 0\n\t\t}\n\n\t\tcase \"since\": {\n\t\t\tconst code = expression[1]\n\t\t\tconst was = context.previousValues.get(code) ?? 0\n\t\t\tconst latest = context.latestValues.get(code) ?? 0\n\t\t\treturn latest - was\n\t\t}\n\n\t\tcase \"if\": {\n\t\t\tconst [, condition, yes, no] = expression\n\t\t\treturn e(condition)\n\t\t\t\t? e(yes)\n\t\t\t\t: (isHappy(no) ? e(no) : 0)\n\t\t}\n\n\t\tcase \"min\":\n\t\t\treturn Math.min(...expression.slice(1).map(e))\n\n\t\tcase \"max\":\n\t\t\treturn Math.max(...expression.slice(1).map(e))\n\n\t\tcase \"+\":\n\t\t\treturn expression.slice(1)\n\t\t\t\t.map(e)\n\t\t\t\t.reduce((p, c) => p + c, 0)\n\n\t\tcase \"*\":\n\t\t\treturn expression.slice(1)\n\t\t\t\t.map(e)\n\t\t\t\t.reduce((p, c) => p * c, 1)\n\n\t\tcase \"==\":\n\t\t\treturn +(e(expression[1]) === e(expression[2]))\n\n\t\tcase \"!=\":\n\t\t\treturn +(e(expression[1]) !== e(expression[2]))\n\n\t\tcase \">\":\n\t\t\treturn +(e(expression[1]) > e(expression[2]))\n\n\t\tcase \"<\":\n\t\t\treturn +(e(expression[1]) < e(expression[2]))\n\n\t\tcase \">=\":\n\t\t\treturn +(e(expression[1]) >= e(expression[2]))\n\n\t\tcase \"<=\":\n\t\t\treturn +(e(expression[1]) <= e(expression[2]))\n\n\t\tcase \"!\":\n\t\t\treturn +(e(expression[1]) === 0)\n\n\t\tcase \"!!\":\n\t\t\treturn +(e(expression[1]) !== 0)\n\n\t\tcase \"-\": {\n\t\t\tconst [, first, ...rest] = expression\n\t\t\tif (rest.length === 0) return -e(first)\n\t\t\tlet value = e(first)\n\t\t\tfor (const neg of rest) value -= e(neg)\n\t\t\treturn value\n\t\t}\n\n\t\tcase \"clamp\": {\n\t\t\tconst [, min, max, expr] = expression\n\t\t\tconst value = e(expr)\n\t\t\treturn Math.min(\n\t\t\t\tmax === null ? Infinity : e(max),\n\t\t\t\tMath.max(\n\t\t\t\t\tmin === null ? -Infinity : e(min),\n\t\t\t\t\tvalue,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\n\t\tcase \"remap\": {\n\t\t\tconst [a, b, c, d, value] = expression.slice(1).map(e)\n\t\t\treturn remap(value, a, b, c, d)\n\t\t}\n\n\t\tcase \"dt\":\n\t\t\treturn context.dt\n\n\t\tcase \"held\": {\n\t\t\tconst [, ms, subexpression] = expression\n\t\t\tconst down = isDown(e(subexpression))\n\t\t\tlet held = context.holding.get(expression)\n\n\t\t\tif (down && !held) {\n\t\t\t\theld = {start: context.clock.time}\n\t\t\t\tcontext.holding.set(expression, held)\n\t\t\t}\n\n\t\t\tif (!down && held) {\n\t\t\t\theld = undefined\n\t\t\t\tcontext.holding.delete(expression)\n\t\t\t}\n\n\t\t\tif (held) {\n\t\t\t\tconst timeHeld = context.clock.time - held.start\n\t\t\t\tif (timeHeld >= ms)\n\t\t\t\t\treturn 1\n\t\t\t}\n\n\t\t\treturn 0\n\t\t}\n\n\t\tcase \"taps\": {\n\t\t\tconst [, taps, ms, subexpression] = expression\n\t\t\tconst presses = e(subexpression)\n\t\t\tconst now = context.clock.time\n\n\t\t\tconst tapped = guarantee(context.tapping, expression, () => ({\n\t\t\t\tevents: [] as number[],\n\t\t\t}))\n\n\t\t\tfor (let i = 0; i < presses; i++)\n\t\t\t\ttapped.events.push(now)\n\n\t\t\ttapped.events = arraylimit(\n\t\t\t\ttapped.events.filter(time => time >= now - ms),\n\t\t\t\t128,\n\t\t\t)\n\n\t\t\tif (tapped.events.length >= taps) {\n\t\t\t\ttapped.events = []\n\t\t\t\treturn 1\n\t\t\t}\n\n\t\t\treturn 0\n\t\t}\n\n\t\tcase \"mod\": {\n\t\t\tconst [, ...modifiers] = expression\n\t\t\tconst down = (code: string) =>\n\t\t\t\tisDown(context.latestValues.get(code) ?? 0)\n\n\t\t\tconst shift = down(\"ShiftLeft\") || down(\"ShiftRight\")\n\t\t\tconst ctrl = down(\"ControlLeft\") || down(\"ControlRight\")\n\t\t\tconst alt = down(\"AltLeft\") || down(\"AltRight\")\n\t\t\tconst meta = down(\"MetaLeft\") || down(\"MetaRight\")\n\n\t\t\tif (modifiers.includes(\"shift\") !== shift) return 0\n\t\t\tif (modifiers.includes(\"ctrl\") !== ctrl) return 0\n\t\t\tif (modifiers.includes(\"alt\") !== alt) return 0\n\t\t\tif (modifiers.includes(\"meta\") !== meta) return 0\n\n\t\t\treturn 1\n\t\t}\n\n\t\tdefault:\n\t\t\tthrow new Error(\"unknown expression\")\n\t}\n}\n\n", "\nexport class Clock {\n\tsince = 0\n\tlast: number | undefined\n\n\tconstructor(public time = performance.now()) {}\n\n\tupdate(time = performance.now()) {\n\t\tthis.since = time - (this.time ?? time)\n\t\tthis.last = this.time\n\t\tthis.time = time\n\t}\n}\n\n", "\nimport {Sample} from \"../types.js\"\nimport {Clock} from \"../utils/clock.js\"\n\nexport class EvaluationContext {\n\tdt = 0\n\tclock = new Clock()\n\n\trecentSamples: Sample[] = []\n\tlatestValues = new Map<string, number>()\n\tpreviousValues = new Map<string, number>()\n\n\tholding = new Map<object, {start: number}>()\n\ttapping = new Map<object, {events: number[]}>()\n}\n\n", "\nimport {deepFreeze} from \"@e280/stz\"\nimport {Sampler} from \"./utils/sampler.js\"\nimport {Intent} from \"./data/intent/types.js\"\nimport {evaluate} from \"./evaluate/evaluate.js\"\nimport {encodeIntents} from \"./data/intent/encode.js\"\nimport {Bindings, Rebindings, Source} from \"./types.js\"\nimport {EvaluationContext} from \"./evaluate/context.js\"\nimport {investigate} from \"./investigate/investigate.js\"\n\nexport class Controller<B extends Bindings = any> {\n\t#sampler\n\t#bindings: Rebindings<B>\n\t#investigation\n\t#context\n\n\tconstructor(options: {source: Source, bindings: B}) {\n\t\tthis.#bindings = deepFreeze(structuredClone(options.bindings)) as any as Rebindings<B>\n\t\tthis.#investigation = investigate(this.#bindings)\n\t\tthis.#sampler = new Sampler(options.source)\n\t\tthis.#context = new EvaluationContext()\n\t}\n\n\tget bindings() {\n\t\treturn this.#bindings\n\t}\n\n\tset bindings(b: Rebindings<B>) {\n\t\tconst bindings = deepFreeze(structuredClone(b)) as Rebindings<B>\n\t\tconst fresh = investigate(bindings)\n\t\tconst goodHash = this.#investigation.hash\n\n\t\tif (fresh.hash !== goodHash)\n\t\t\tthrow new Error(\"incompatible bindings\")\n\n\t\tthis.#bindings = bindings\n\t\tthis.#investigation.rootList = fresh.rootList\n\t}\n\n\t*evaluate(time = performance.now()) {\n\t\tconst samples = this.#sampler.take()\n\n\t\tthis.#context.clock.update(time)\n\t\tthis.#context.recentSamples = samples\n\t\tthis.#context.dt = this.#context.clock.since / 1000\n\n\t\tfor (const {code, value} of samples)\n\t\t\tthis.#context.latestValues.set(code, value)\n\n\t\tfor (const [id, expression] of this.#investigation.rootList.entries()) {\n\t\t\tconst value = evaluate(this.#context, expression)\n\t\t\tif (value !== 0)\n\t\t\t\tyield {id, value} as Intent\n\t\t}\n\n\t\tfor (const {code, value} of samples)\n\t\t\tthis.#context.previousValues.set(code, value)\n\t}\n\n\tencode(time = performance.now()) {\n\t\treturn encodeIntents(this.#investigation.hash, [...this.evaluate(time)])\n\t}\n\n\tclear() {\n\t\tvoid this.#sampler.take()\n\t}\n\n\tdispose() {\n\t\treturn this.#sampler.dispose()\n\t}\n}\n\n", "\n/** stable reference to a gamepad, has a getter to get the latest gamepad snapshot */\nexport class Pad {\n\tconstructor(private get: () => Gamepad) {}\n\n\tget gamepad() {\n\t\treturn this.get()\n\t}\n}\n\n", "\nexport function evergreen<V>(value: V, fn: () => V | null | undefined) {\n\tlet cached = value\n\treturn () => {\n\t\tconst next = fn()\n\t\tif (next !== undefined && next !== null) cached = next\n\t\treturn cached\n\t}\n}\n\n", "\nimport {ev} from \"@e280/stz\"\nimport {Pad} from \"./pad.js\"\nimport {evergreen} from \"../../utils/evergreen.js\"\n\n/** listen for gamepads coming and going */\nexport function onPad(fn: (pad: Pad) => () => void) {\n\tconst known = new Map<number, {pad: Pad, dispose: () => void}>()\n\n\tfunction refresh() {\n\t\taddNew()\n\t\tdeleteOld()\n\t}\n\n\tfunction addNew() {\n\t\tfor (const gamepad of navigator.getGamepads()) {\n\t\t\tif (gamepad?.connected && !known.has(gamepad.index)) {\n\t\t\t\tconst get = () => navigator.getGamepads()[gamepad.index]\n\t\t\t\tconst pad = new Pad(evergreen(gamepad, get))\n\t\t\t\tconst dispose = fn(pad)\n\t\t\t\tknown.set(gamepad.index, {pad, dispose})\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction deleteOld() {\n\t\tfor (const [index, {pad, dispose}] of known) {\n\t\t\tconst gamepad = navigator.getGamepads()[pad.gamepad.index]\n\t\t\tif (!gamepad?.connected) {\n\t\t\t\tdispose()\n\t\t\t\tknown.delete(index)\n\t\t\t}\n\t\t}\n\t}\n\n\trefresh()\n\n\tconst unlisten = ev(window, {\n\t\tgamepadconnected: refresh,\n\t\tgamepaddisconnected: refresh,\n\t})\n\n\treturn () => {\n\t\tunlisten()\n\t\tfor (const {dispose} of known.values())\n\t\t\tdispose()\n\t\tknown.clear()\n\t}\n}\n\n", "\nimport {disposer, subby} from \"@e280/stz\"\nimport {Sample, Source} from \"../types.js\"\n\nexport class PlainSource implements Source {\n\tonSample = subby<[sample: Sample]>()\n\tdispose = disposer()\n}\n\n", "\nimport {PlainSource} from \"./plain.js\"\nimport {Pad} from \"../utils/pad/pad.js\"\n\nexport class GamepadSource extends PlainSource {\n\t#values = new Map<string, number>()\n\n\tconstructor(public pad: Pad) {\n\t\tsuper()\n\t}\n\n\tget gamepad() {\n\t\treturn this.pad.gamepad\n\t}\n\n\tpoll() {\n\t\tconst gamepad = this.gamepad\n\t\tthis.#pollButtons(gamepad)\n\t\tthis.#pollAxes(gamepad)\n\t}\n\n\t#publish(code: string, value: number) {\n\t\tconst previous = this.#values.get(code) ?? 0\n\n\t\tif (value !== previous) {\n\t\t\tthis.#values.set(code, value)\n\t\t\tthis.onSample.publish({code, value})\n\t\t}\n\t}\n\n\t#pollButtons(gamepad: Gamepad) {\n\t\tlet any = 0\n\n\t\tfor (const [index, button] of gamepad.buttons.entries()) {\n\t\t\tconst value = button.value\n\t\t\tthis.#publish(`gamepad.${index + 1}`, value)\n\t\t\tany = Math.max(any, value)\n\t\t}\n\n\t\tthis.#publish(\"gamepad.any\", any >= 0.9 ? 1 : 0)\n\t}\n\n\t#pollAxes(gamepad: Gamepad) {\n\t\tfor (const [index, value] of gamepad.axes.entries()) {\n\t\t\tthis.#publish(`gamepad.axis.${index + 1}`, value)\n\t\t}\n\t}\n}\n\n", "\nimport {Hub} from \"./hub.js\"\nimport {Controller} from \"../../input/controller.js\"\nimport {onPad} from \"../../input/utils/pad/on-pad.js\"\nimport {GamepadSource} from \"../../input/sources/gamepad.js\"\n\nexport function autoGamepads(\n\t\thub: Hub,\n\t\tfn?: (controller: Controller, source: GamepadSource) => () => void\n\t) {\n\n\treturn onPad(pad => {\n\t\tconst source = new GamepadSource(pad)\n\n\t\tconst controller = new Controller({\n\t\t\tsource,\n\t\t\tbindings: hub.bindings,\n\t\t})\n\n\t\thub.plug(controller)\n\t\tconst dispose = fn?.(controller, source)\n\n\t\treturn () => {\n\t\t\thub.remove(controller)\n\t\t\tdispose?.()\n\t\t}\n\t})\n}\n\n", "\nexport function ellipsis(s: string, max: number) {\n\treturn s.length > max\n\t\t? s.slice(0, max) + \"...\"\n\t\t: s\n}\n\n", "\nimport {Source} from \"../types.js\"\nimport {PlainSource} from \"./plain.js\"\n\nexport class Sources extends PlainSource {\n\t#array\n\n\tconstructor(...sources: Source[]) {\n\t\tsuper()\n\n\t\tthis.#array = sources\n\n\t\tfor (const source of sources)\n\t\t\tthis.dispose.schedule(\n\t\t\t\tsource.onSample(sample => this.onSample.publish(sample))\n\t\t\t)\n\t}\n\n\tpoll() {\n\t\tfor (const source of this.#array)\n\t\t\tsource.poll?.()\n\t}\n}\n\n", "\nimport {signal} from \"@e280/strata\"\nimport {debounce, hex} from \"@e280/stz\"\n\nexport class Visualizer {\n\t$hex = signal(\"\")\n\n\tclear = debounce(250, () => {\n\t\tthis.$hex.set(\"\")\n\t})\n\n\tupdate(data: ArrayBuffer) {\n\t\tthis.$hex(hex(new Uint8Array(data)))\n\t\tthis.clear()\n\t}\n}\n\n", "\nexport function mouseButton(button: number) {\n\treturn `pointer.${button + 1}`\n}\n\n", "\nimport {ev} from \"@e280/stz\"\nimport {Vec2} from \"@benev/math\"\nimport {PlainSource} from \"./plain.js\"\nimport {mouseButton} from \"../utils/mouse-button.js\"\n\nexport class PointerSource extends PlainSource {\n\tclient = new Vec2()\n\n\tconstructor(target: EventTarget = window) {\n\t\tsuper()\n\t\tthis.dispose.schedule(\n\t\t\tev(target, this.#listeners)\n\t\t)\n\t}\n\n\t#listeners = {\n\t\tpointerdown: (event: PointerEvent) => {\n\t\t\tthis.onSample.publish({code: mouseButton(event.button), value: 1})\n\t\t},\n\n\t\tpointerup: (event: PointerEvent) => {\n\t\t\tthis.onSample.publish({code: mouseButton(event.button), value: 0})\n\t\t},\n\n\t\tpointermove: ({clientX, clientY, movementX, movementY}: PointerEvent) => {\n\t\t\tthis.client.set_(clientX, clientY)\n\t\t\tif (movementX) this.onSample.publish({code: \"pointer.x\", value: movementX})\n\t\t\tif (movementY) this.onSample.publish({code: \"pointer.y\", value: movementY})\n\t\t},\n\n\t\twheel: ({deltaX, deltaY}: WheelEvent) => {\n\t\t\tif (deltaX) this.onSample.publish({code: \"pointer.wheel.x\", value: deltaX})\n\t\t\tif (deltaY) this.onSample.publish({code: \"pointer.wheel.y\", value: deltaY})\n\t\t},\n\t}\n}\n\n", "\nimport {ev} from \"@e280/stz\"\nimport {PlainSource} from \"./plain.js\"\n\nexport class KeyboardSource extends PlainSource {\n\t#down = new Set<string>()\n\n\tconstructor(target: EventTarget = window) {\n\t\tsuper()\n\t\tthis.dispose.schedule(ev(target, this.#targetListeners))\n\t\tthis.dispose.schedule(ev(window, this.#windowListeners))\n\t}\n\n\t#targetListeners = {\n\t\tkeydown: (event: KeyboardEvent) => {\n\t\t\tif (event.repeat) return\n\n\t\t\tif (this.#down.size === 0)\n\t\t\t\tthis.onSample.publish({code: \"keyboard.any\", value: 1})\n\n\t\t\tthis.onSample.publish({code: event.code, value: 1})\n\t\t\tthis.#down.add(event.code)\n\t\t},\n\n\t\tkeyup: (event: KeyboardEvent) => {\n\t\t\tthis.onSample.publish({code: event.code, value: 0})\n\t\t\tthis.#down.delete(event.code)\n\n\t\t\tif (this.#down.size === 0)\n\t\t\t\tthis.onSample.publish({code: \"keyboard.any\", value: 0})\n\t\t},\n\t}\n\n\t#windowListeners = {\n\t\tblur: () => {\n\t\t\tfor (const code of this.#down)\n\t\t\t\tthis.onSample.publish({code: code, value: 0})\n\n\t\t\tif (this.#down.size)\n\t\t\t\tthis.onSample.publish({code: \"keyboard.any\", value: 0})\n\n\t\t\tthis.#down.clear()\n\t\t},\n\t}\n}\n\n", "\nimport {templateString as css} from \"@e280/stz\"\nexport const coreString = css`@layer core {\n\n::selection {\n\tcolor: var(--selection);\n\tbackground-color: var(--selection-bg);\n}\n\n::-webkit-scrollbar { width: 8px; }\n::-webkit-scrollbar-track { background: transparent; }\n::-webkit-scrollbar-thumb { background: #444; border-radius: 1em; }\n::-webkit-scrollbar-thumb:hover { background: #666; }\n\na {\n\tcolor: var(--link);\n\ttext-decoration: none;\n\n\t&:visited {\n\t\tcolor: color-mix(in srgb, purple, var(--link) 70%);\n\t}\n\n\t&:hover {\n\t\tcolor: color-mix(in srgb, white, var(--link) 90%);\n\t\ttext-decoration: underline;\n\t}\n\n\t&:active {\n\t\tcolor: color-mix(in srgb, white, var(--link) 50%);\n\t}\n}\n\n}`\n\n", "\nimport {templateString as css} from \"@e280/stz\"\nexport const varsString = css`@layer vars {\n\n:is(:root, :host) {\n\t${renderVars({\n\t\t\"bg\": \"#111\",\n\t\t\"alpha\": \"#def\",\n\n\t\t\"rounded\": \"0.5em\",\n\t\t\"padding\": \"0.5em\",\n\n\t\t\"prime\": \"#d068ff\",\n\t\t\"code\": \"#3f1\",\n\t\t\"link\": \"cyan\",\n\t\t\"selection\": \"white\",\n\t\t\"selection-bg\": \"#f70\",\n\n\t\t\"lame\": \"#8888\",\n\t\t\"angry\": \"#f50\",\n\t\t\"zesty\": \"#cf0\",\n\t\t\"happy\": \"#0fa\",\n\t\t\"calm\": \"#0af\",\n\t\t\"sad\": \"#74f\",\n\t\t\"quirky\": \"#f49\",\n\n\t\t\"inactive-opacity\": \"0.5\",\n\t\t\"anim-duration\": \"150ms\",\n\t})}\n}\n\n}`\n\nfunction renderVar([name, value]: [string, string]) {\n\treturn `--${name}: var(--shiny-${name}, ${value});`\n}\n\nfunction renderVars(varsObject: Record<string, string>) {\n\treturn Object.entries(varsObject).map(renderVar).join(\"\\n\")\n}\n\n", "\nimport {templateString as css} from \"@e280/stz\"\nexport const resetString = css`@layer reset {\n\n* {\n\tmargin: 0;\n\tpadding: 0;\n\tbox-sizing: border-box;\n\n\tscrollbar-width: thin;\n\tscrollbar-color: #888 transparent;\n}\n\n::-webkit-scrollbar { width: 8px; }\n::-webkit-scrollbar-track { background: transparent; }\n::-webkit-scrollbar-thumb { background: #888; border-radius: 1em; }\n::-webkit-scrollbar-thumb:hover { background: #999; }\n\n}`\n\n", "\nimport {templateString as css} from \"@e280/stz\"\nimport {coreString} from \"./parts/core.js\"\nimport {varsString} from \"./parts/vars.js\"\nimport {resetString} from \"./parts/reset.js\"\nexport const themeString = css`\n\n@layer vars, reset, core, underlay, view, overlay;\n\n${varsString}\n${resetString}\n${coreString}\n\n`\n\n", "\nimport {themeString} from \"./theme-string.js\"\n\nexport const themeCss = new CSSStyleSheet()\n\nthemeCss.replaceSync(themeString)\n\n", "\nimport {signal} from \"@e280/strata\"\n\nexport class TabsControl {\n\tlength = 1\n\t$index = signal(0)\n\n\tconstructor(start = 0) {\n\t\tthis.$index(start)\n\t}\n\n\tclamp(index: number) {\n\t\tindex = Math.min(index, this.length - 1)\n\t\tindex = Math.max(index, 0)\n\t\treturn index\n\t}\n\n\tget index() {\n\t\treturn this.clamp(this.$index())\n\t}\n\n\tasync setIndex(index: number) {\n\t\treturn this.$index(index)\n\t}\n\n\tasync shimmy(delta: number) {\n\t\tconst index = this.clamp(this.index + delta)\n\t\treturn this.setIndex(index)\n\t}\n}\n\n", "\nimport {css} from \"lit\"\nexport default css`@layer view {\n\n:host {\n\tdisplay: inline-flex;\n\tflex-direction: column;\n}\n\nslot[part=\"tabs\"] {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\n\t&::slotted([data-tabbed]) {\n\t\topacity: 1;\n\t\tcolor: currentColor;\n\t\ttext-decoration: underline;\n\t}\n}\n\nslot[part=\"tabs\"][data-snug] {\n\t&::slotted(*) {\n\t\tborder-radius: var(--rounded);\n\t}\n\n\t&::slotted(:not([data-last], [data-next-is-tabbed])) {\n\t\tborder-right: none;\n\t}\n\n\t&::slotted([data-tabbed]:not([data-first])) {\n\t\tborder-left: none;\n\t}\n\n\t&::slotted(:not([data-last])) {\n\t\tborder-top-right-radius: 0;\n\t\tborder-bottom-right-radius: 0;\n\t}\n\n\t&::slotted(:not([data-first])) {\n\t\tborder-top-left-radius: 0;\n\t\tborder-bottom-left-radius: 0;\n\t}\n}\n\n} `\n\n", "\nimport {html} from \"lit\"\nimport {dom, shadow, useHost, useName, useOnce, useSignal, useStyles} from \"@e280/sly\"\nimport styleCss from \"./style.css.js\"\nimport {TabsControl} from \"./control.js\"\nimport {themeCss} from \"../../theme/theme.css.js\"\n\nexport const ShinyTabs = shadow((options: {\n\t\tsnug?: boolean\n\t\tcontrol?: TabsControl\n\t} = {}) => {\n\n\tuseName(\"shiny-tabs\")\n\tuseStyles(themeCss, styleCss)\n\n\tconst host = useHost()\n\tconst attrs = useOnce(() => dom.attrs(host).spec({index: Number}))\n\tconst control = useOnce(() => options.control ?? new TabsControl(attrs.index ?? 0))\n\n\tconst $tabs = useSignal<HTMLElement[]>([])\n\tconst $panels = useSignal<HTMLElement[]>([])\n\n\tfunction tabchange(event: Event) {\n\t\tconst slot = event.currentTarget! as HTMLSlotElement\n\t\t$tabs(slot.assignedElements() as HTMLElement[])\n\t}\n\n\tfunction panelchange(event: Event) {\n\t\tconst slot = event.currentTarget! as HTMLSlotElement\n\t\t$panels(slot.assignedElements() as HTMLElement[])\n\t}\n\n\tattrs.index = control.$index()\n\tcontrol.length = $tabs().length\n\n\tfunction isNeighborActive(index: number, delta: number) {\n\t\tconst nextIndex = control.clamp(index + delta)\n\t\tif (nextIndex === index) return false\n\t\treturn (nextIndex === control.index)\n\t}\n\n\tfor (const [index, tab] of $tabs().entries()) {\n\t\tconst tabbed = (index === control.index)\n\t\tconst tabAttrs = dom.attrs(tab)\n\t\ttabAttrs.booleans.disabled = tabbed\n\t\ttabAttrs.booleans[\"data-snug\"] = options.snug\n\t\ttabAttrs.booleans[\"data-tabbed\"] = tabbed\n\t\ttabAttrs.booleans[\"data-first\"] = (index === 0)\n\t\ttabAttrs.booleans[\"data-last\"] = (index === (control.length - 1))\n\t\ttabAttrs.booleans[\"data-next-is-tabbed\"] = isNeighborActive(index, 1)\n\t\ttabAttrs.booleans[\"data-previous-is-tabbed\"] = isNeighborActive(index, -1)\n\t\ttab.onclick = () => control.setIndex(index)\n\t}\n\n\tfor (const [index, panel] of $panels().entries()) {\n\t\tconst tabbed = (index === control.index)\n\t\tdom.attrs(panel).booleans[\"data-tabbed\"] = tabbed\n\t\tdom.attrs(panel).booleans[\"hidden\"] = !tabbed\n\t}\n\n\treturn html`\n\t\t<slot part=tabs ?data-snug=\"${options.snug}\" @slotchange=\"${tabchange}\"></slot>\n\t\t<slot part=panels name=panel @slotchange=\"${panelchange}\"></slot>\n\t`\n})\n\n", "\nimport {css} from \"lit\"\nexport default css`@layer view {\n\n:host {\n\tdisplay: block;\n\twidth: min(50em, 100%);\n\n\tcolor: var(--text);\n\ttext-shadow: var(--text-shadow);\n}\n\n.deck {\n\tpadding: var(--pad);\n\t--tint: oklch(from var(--prime) l c h / 50%);\n}\n\n[view=\"shiny-tabs\"] {\n\t--prime: inherit;\n\n\t--tint: var(--prime);\n\t--slate: color-mix(in oklch,\n\t\ttransparent,\n\t\tcolor-mix(in oklch, var(--bg), var(--tint) 25%) 25%\n\t);\n\t--shimmer: color-mix(in oklch, transparent, var(--tint));\n\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\n\t&::part(tabs) {\n\t\tdisplay: flex;\n\t\twidth: max-content;\n\t\tjustify-content: center;\n\t\tpadding: var(--nib);\n\n\t\tbackground: var(--slate);\n\t\tborder: 1px solid var(--shimmer);\n\t\tborder-radius: var(--round);\n\t}\n\n\t&::part(panels) {\n\t\tdisplay: block;\n\t\twidth: 100%;\n\t\tmargin-top: var(--pad);\n\t}\n\n\tbutton {\n\t\tborder: none;\n\t\tbackground: transparent;\n\t\tborder-radius: var(--round);\n\t\tborder: 2px solid transparent;\n\t\ttext-shadow: var(--text-shadow);\n\n\t\t&[data-tabbed] {\n\t\t\ttext-decoration: none;\n\t\t\tcolor: var(--prime);\n\t\t\tborder-color: var(--prime);\n\t\t\tbackground: color-mix(in oklch, var(--bg), var(--prime) 30%);\n\t\t\tbox-shadow:\n\t\t\t\tinset 0 0 1.5em oklch(from var(--shimmer) l c h / 50%),\n\t\t\t\t0 0 2em oklch(from var(--shimmer) l c h / 50%);\n\t\t}\n\t}\n}\n\n}`\n\n", "\nimport {css} from \"lit\"\nimport {cssReset} from \"@e280/sly\"\n\nexport default css`\n@layer theme, view;\n@layer theme {\n\n${cssReset}\n\n:host {\n\t--prime: var(--tact-prime, #fb0);\n\n\t--text: var(--tact-text, #fffc);\n\t--bg: var(--tact-bg, oklch(from var(--prime) calc(l * 0.3) calc(c * 0.1) h));\n\t--droppy: var(--tact-droppy, oklch(from var(--prime) l c calc(h + 100)));\n\t--recording: var(--tact-recording, oklch(from var(--prime) l c calc(h + 100)));\n\n\t--round: var(--tact-round, 0.5em);\n\t--pad: var(--tact-pad, 0.5em);\n\t--nib: var(--tact-nib, 0.2em);\n\t--space: var(--tact-space, 1em);\n\t--box-shadow: var(--tact-box-shadow, 0.1em 0.2em 1em #0006);\n\t--text-shadow: var(--tact-text-shadow, 0.02em 0.04em 0.1em #000a);\n}\n\n[theme-card] {\n\t--tint: var(--prime);\n\t--slate: color-mix(in oklch,\n\t\ttransparent,\n\t\tcolor-mix(in oklch, var(--bg), var(--tint) 25%) 25%\n\t);\n\t--shimmer: color-mix(in oklch, transparent, var(--tint));\n\n\tborder-radius: var(--round);\n\tbackground: var(--slate);\n\tborder: 1px solid var(--shimmer);\n\tbox-shadow:\n\t\tinset 0 0 3em color-mix(in oklch, transparent, var(--shimmer) 30%),\n\t\tvar(--box-shadow);\n\n\t&[theme-card=\"dull\"] {\n\t\t--tint: #8888;\n\t}\n}\n\n[theme-button] {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tfont: inherit;\n\tcolor: inherit;\n\n\tcursor: pointer;\n\tuser-select: none;\n\n\topacity: 0.8;\n\tgap: 0.5em;\n\tpadding: 0.5em;\n\n\t&:is(:hover, :focus-visible) { opacity: 1; }\n\t&:active { opacity: 0.8; }\n\n\tsvg {\n\t\twidth: 1.2em;\n\t\theight: 1.2em;\n\t}\n\n\t&[theme-button~=\"naked\"] {\n\t\tpadding: 0;\n\t\tborder: none;\n\t\tbackground: transparent;\n\t\tcolor: currentColor;\n\t}\n\n\t&[theme-button~=\"angry\"] {\n\t\t&:is(:hover, :focus-visible) { color: red; }\n\t}\n}\n\n[theme-select] {\n\t--base: var(--tint, var(--prime));\n\tfont: inherit;\n\tcolor: inherit;\n\tbackground: var(--bg);\n\tborder: 1px solid var(--base);\n\tborder-radius: var(--round);\n\tpadding: var(--nib) var(--pad);\n\tbox-shadow: inset 0 0 1em oklch(from var(--base) l c h / 40%);\n\n\t&:is(:hover, :focus-visible) {\n\t\tfilter: brightness(110%);\n\t\tbox-shadow: inset 0 0 1em oklch(from var(--base) l c h / 60%);\n\t}\n\n\t&:active {\n\t\tfilter: brightness(90%);\n\t\tbox-shadow: inset 0 0 1em oklch(from var(--base) l c h / 40%);\n\t}\n}\n\n[theme-input] {\n\t--base: var(--tint, var(--prime));\n\t--chill: oklch(from var(--base) l c h / 50%);\n\tfont: inherit;\n\tcolor: inherit;\n\tbackground: transparent;\n\tborder: 1px solid var(--chill);\n\tborder-radius: var(--round);\n\tpadding: 0 var(--nib);\n\tbox-shadow: inset 0 0 1em oklch(from var(--chill) l c h / 20%);\n}\n\n}`\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"ai ai-GameController\"><path d=\"M9 15l-2.968 2.968A2.362 2.362 0 0 1 2 16.298V15l1.357-6.784A4 4 0 0 1 7.279 5h9.442a4 4 0 0 1 3.922 3.216L22 15v1.297a2.362 2.362 0 0 1-4.032 1.67L15 15H9z\"/><path d=\"M9 5l1 2h4l1-2\"/></svg>`\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"ai ai-SettingsHorizontal\"><path d=\"M3 5h4m14 0H11m-8 7h12m6 0h-2M3 19h2m16 0H9\"/><circle cx=\"9\" cy=\"5\" r=\"2\"/><circle cx=\"17\" cy=\"12\" r=\"2\"/><circle cx=\"7\" cy=\"19\" r=\"2\"/></svg>`\n\n", "\nimport {css} from \"lit\"\nexport default css`@layer view {\n\n.plate {\n\tuser-select: none;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: var(--pad);\n}\n\n[data-drag-and-drop] {\n\t.player[data-drop-candidate] {\n\t\toutline: 2px dashed color-mix(in oklch, transparent, var(--droppy) 80%);\n\t\tbackground: color-mix(in oklch, var(--slate), var(--droppy) 20%);\n\n\t\t&[data-dropping] {\n\t\t\toutline: 2px solid var(--droppy);\n\t\t\tbackground: color-mix(in oklch, var(--slate), var(--droppy) 50%);\n\t\t}\n\t}\n}\n\n.playerlist {\n\tdisplay: grid;\n\tgrid-template-columns: repeat(\n\t\tauto-fit,\n\t\tminmax(min(100%, 20em), 1fr)\n\t);\n\n\twidth: min(100%, calc(48em + var(--pad)));\n\tgap: var(--pad);\n\n\t> * {\n\t\tmin-width: 0;\n\t\tmin-height: 7em;\n\t}\n}\n\n.player {\n\tdisplay: flex;\n\tflex-direction: column;\n\n\t&.new {\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\tpadding: var(--pad);\n\n\t\tborder-style: dashed;\n\t\tborder-width: 2px;\n\t\tborder-color: oklch(from var(--text) l c h / 30%);\n\t\tbackground: transparent;\n\t\tbox-shadow: none;\n\n\t\tbutton {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tsvg {\n\t\t\t\twidth: 2.5em;\n\t\t\t\theight: 2.5em;\n\t\t\t}\n\t\t}\n\t}\n\n\th3 {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tjustify-content: space-between;\n\t\tpadding: var(--nib) var(--pad);\n\t}\n\n\t.controllerlist {\n\t\tdisplay: flex;\n\t\tflex: 1 1 auto;\n\t\tflex-direction: column;\n\t\tgap: var(--pad);\n\t\tpadding: var(--pad);\n\t}\n\n\t.controller {\n\t\t--tint: oklch(0.7 0.3 var(--hue, 0));\n\t\tbackground: color-mix(in oklch, transparent, var(--bg) 50%);\n\t\tborder: 2px solid var(--shimmer);\n\t\tbox-shadow:\n\t\t\tinset 0 0 2em color-mix(in oklch, transparent, var(--shimmer)),\n\t\t\tvar(--box-shadow);\n\n\t\t&:hover {\n\t\t\tbackground: color-mix(in oklch, transparent, var(--bg) 70%);\n\t\t\tfilter: brightness(120%);\n\t\t}\n\n\t\t[view=\"profile-select\"]::part(select) {\n\t\t\t--base: oklch(from var(--tint) l c h / 50%);\n\t\t}\n\t}\n\n\t.controller {\n\t\tcursor: grab;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\n\t\tgap: var(--pad);\n\t\tpadding: var(--nib);\n\n\t\tborder-radius: 0.5em;\n\t\toverflow: clip;\n\n\t\t.griptape {\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: center;\n\t\t\talign-items: center;\n\n\t\t\twidth: 1.5em;\n\t\t\tflex: 0 0 auto;\n\n\t\t\tsvg {\n\t\t\t\topacity: 0.5;\n\t\t\t}\n\t\t}\n\n\t\t.label {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: var(--pad);\n\t\t\tmin-width: 0;\n\n\t\t\tflex: 1 1 auto;\n\t\t\tfont-size: 1em;\n\t\t\tfont-weight: normal;\n\n\t\t\t.icon {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex: 0 0 auto;\n\t\t\t\tsvg {\n\t\t\t\t\twidth: 2em;\n\t\t\t\t\theight: 2em;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.name {\n\t\t\t\tmin-width: 0;\n\t\t\t\tline-height: 1.1;\n\t\t\t\tfont-size: 0.7em;\n\t\t\t\toverflow: hidden;\n\t\t\t\ttext-overflow: ellipsis;\n\t\t\t}\n\t\t}\n\n\t\tselect {\n\t\t\tpadding: var(--nib) var(--pad);\n\t\t}\n\t}\n}\n\n}`\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"ai ai-PersonAdd\"><circle cx=\"12\" cy=\"7\" r=\"5\"/><path d=\"M17 22H5.266a2 2 0 0 1-1.985-2.248l.39-3.124A3 3 0 0 1 6.649 14H7\"/><path d=\"M19 14v4\"/><path d=\"M17 16h4\"/></svg>`\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"ai ai-XSmall\"><path d=\"M17 17L7 7m10 0L7 17\"/></svg>`\n\n", "\nimport {html} from \"lit\"\nimport {Content, lightView} from \"@e280/sly\"\nimport {Context, DroppyPort} from \"../../deck/types.js\"\n\nexport const DropcardView = lightView((o: {\n\t\tclass: string\n\t\tthemeCard?: string\n\t\tcontext: Context\n\t\tplayerId: DroppyPort[\"playerId\"]\n\t\tcontent: Content\n\t}) => {\n\n\tconst {dnd} = o.context\n\tconst dropzone = dnd.dropzone(() => ({playerId: o.playerId}))\n\n\treturn html`\n\t\t<div class=\"${o.class}\"\n\t\t\ttheme-card=\"${o.themeCard ?? \"\"}\"\n\t\t\tdata-drop-candidate\n\t\t\t?data-dropping=\"${dnd.hovering?.playerId === o.playerId}\"\n\t\t\t@dragenter=\"${dropzone.dragenter}\"\n\t\t\t@dragleave=\"${dropzone.dragleave}\"\n\t\t\t@dragover=\"${dropzone.dragover}\"\n\t\t\t@drop=\"${dropzone.drop}\">\n\n\t\t\t${o.content}\n\t\t</div>\n\t`\n})\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"currentColor\" stroke-width=\"2\" class=\"ai ai-DragVerticalFill\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M16 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4z\"/><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M16 10a2 2 0 1 1 0 4 2 2 0 0 1 0-4z\"/><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8 18a2 2 0 1 1 0 4 2 2 0 0 1 0-4z\"/><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M16 18a2 2 0 1 1 0 4 2 2 0 0 1 0-4z\"/><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4z\"/><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8 10a2 2 0 1 1 0 4 2 2 0 0 1 0-4z\"/></svg>`\n\n", "\nexport function hueify(n: number) {\n\treturn n * 137.508\n}\n\n", "\nimport {html} from \"lit\"\nimport {lightView} from \"@e280/sly\"\nimport {Controls} from \"../../deck/controls/controls.js\"\n\nexport const ProfileSelectView = lightView((\n\t\tdeck: {controls: Controls},\n\t\tcurrentProfileKey: string,\n\t\tonChange: (key: string) => void,\n\t) => {\n\n\tconst {profiles} = deck.controls\n\n\tfunction handleChange(event: Event) {\n\t\tconst select = event.currentTarget as HTMLSelectElement\n\t\tonChange(select.value)\n\t}\n\n\treturn html`\n\t\t<select\n\t\t\tpart=select\n\t\t\ttheme-select\n\t\t\t.value=\"${currentProfileKey}\"\n\t\t\t@change=\"${handleChange}\">\n\n\t\t\t${profiles.presets.map(([key, profile]) => html`\n\t\t\t\t<option\n\t\t\t\t\tvalue=\"${key}\"\n\t\t\t\t\t?selected=\"${key === currentProfileKey}\">\n\t\t\t\t\t${profile.label}\n\t\t\t\t</option>\n\t\t\t`)}\n\n\t\t\t${profiles.customs.map(([key, profile]) => html`\n\t\t\t\t<option\n\t\t\t\t\tvalue=\"${key}\"\n\t\t\t\t\t?selected=\"${key === currentProfileKey}\">\n\t\t\t\t\t${profile.label}\n\t\t\t\t</option>\n\t\t\t`)}\n\t\t</select>\n\t`\n})\n\n", "\nimport {html} from \"lit\"\nimport {lightView} from \"@e280/sly\"\n\nimport gameControllerSvg from \"../../../icons/akar/game-controller.svg.js\"\nimport dragVerticalFillSvg from \"../../../icons/akar/drag-vertical-fill.svg.js\"\n\nimport {Context} from \"../../deck/types.js\"\nimport {hueify} from \"../../../../utils/hueify.js\"\nimport {Controller} from \"../../../../input/controller.js\"\nimport {ProfileSelectView} from \"../../profile-select/view.js\"\n\nexport const ControllerView = lightView((context: Context, controller: Controller) => {\n\tconst {deck, dnd} = context\n\tconst {controls} = deck\n\tconst dragzone = dnd.dragzone(() => ({controller}))\n\tconst currentProfileKey = controls.assignments.assignedProfileKeyOf(controller)\n\tconst meta = controls.meta(controller) ?? {\n\t\tid: 0,\n\t\ticon: gameControllerSvg,\n\t\thandle: \"controller\",\n\t\tname: \"controller\",\n\t\ttooltip: \"\",\n\t\tdefaultProfileKey: controls.fallbackProfileKey,\n\t}\n\n\tconst style = `--hue: ${hueify(meta?.id ?? 0)};`\n\n\treturn html`\n\t\t<div class=controller\n\t\t\tstyle=\"${style}\"\n\t\t\ttheme-card\n\t\t\t?data-dragging=\"${dnd.dragging?.controller === controller}\"\n\t\t\tdraggable=\"${dragzone.draggable}\"\n\t\t\t@dragstart=\"${dragzone.dragstart}\"\n\t\t\t@dragend=\"${dragzone.dragend}\">\n\n\t\t\t<div class=griptape>\n\t\t\t\t${dragVerticalFillSvg}\n\t\t\t</div>\n\n\t\t\t<h4 class=label title=\"${meta.tooltip}\">\n\t\t\t\t<span class=icon>${meta.icon}</span>\n\t\t\t\t<span class=name>${meta.name}</span>\n\t\t\t</h4>\n\n\t\t\t${ProfileSelectView(deck, currentProfileKey, key => {\n\t\t\t\tcontrols.assignments.assign(controller, key)\n\t\t\t})}\n\t\t</div>\n\t`\n})\n\n", "\nimport {html} from \"lit\"\nimport {when} from \"@e280/stz\"\nimport {lightView} from \"@e280/sly\"\n\nimport xSmallSvg from \"../../../icons/akar/x-small.svg.js\"\n\nimport {DropcardView} from \"./dropcard.js\"\nimport {Context} from \"../../deck/types.js\"\nimport {ControllerView} from \"./controller.js\"\n\nexport const PlayerView = lightView((context: Context, playerId: number, index: number) => {\n\tconst {hub} = context.deck\n\tconst deletePlayer = () => hub.deletePlayer(playerId)\n\tconst controllers = hub.controllers.assigned.get(playerId) ?? []\n\n\treturn DropcardView({\n\t\tclass: \"player\",\n\t\tplayerId: playerId,\n\t\tcontext,\n\t\tcontent: html`\n\t\t\t<h3>\n\t\t\t\t<span>player ${index + 1}</span>\n\n\t\t\t\t${when(hub.playerIds.length > 1, () => html`\n\t\t\t\t\t<button theme-button=\"naked angry\" @click=${deletePlayer}>\n\t\t\t\t\t\t${xSmallSvg}\n\t\t\t\t\t</button>\n\t\t\t\t`)}\n\t\t\t</h3>\n\n\t\t\t<div class=controllerlist>\n\t\t\t\t${controllers.map(c => ControllerView(context, c))}\n\t\t\t</div>\n\t\t`,\n\t})\n})\n\n", "\nimport {loot} from \"@e280/sly\"\nimport {Deck, PlayerId} from \"../../deck/types.js\"\nimport {Controller} from \"../../../input/controller.js\"\n\nexport const droppyNewPlayer = Symbol(\"droppyNewPlayer\")\n\nexport type DraggyController = {controller: Controller}\nexport type DroppyPort = {playerId: PlayerId | null | typeof droppyNewPlayer}\n\nexport type Context = {\n\tdeck: Deck\n\tdnd: loot.DragAndDrops<DraggyController, DroppyPort>\n}\n\n", "\nimport {html} from \"lit\"\nimport {isHappy, when} from \"@e280/stz\"\nimport {loot, shadowDuplex, useCss, useOnce} from \"@e280/sly\"\n\nimport styleCss from \"./style.css.js\"\nimport themeCss from \"../theme.css.js\"\nimport personAddSvg from \"../../icons/akar/person-add.svg.js\"\n\nimport {Deck} from \"../../deck/types.js\"\nimport {PlayerView} from \"./subviews/player.js\"\nimport {DropcardView} from \"./subviews/dropcard.js\"\nimport {ControllerView} from \"./subviews/controller.js\"\nimport {Context, droppyNewPlayer} from \"../deck/types.js\"\n\nexport const [ControllersView, makeControllersElement] = shadowDuplex((deck: Deck) => {\n\tuseCss(themeCss, styleCss)\n\n\tconst {hub} = deck\n\tconst controllers = hub.controllers\n\tconst clickCreatePlayer = () => deck.hub.createPlayer()\n\tconst renderPlayer = (p: number, i: number) => PlayerView(context, p, i)\n\n\tconst context: Context = useOnce(() => ({\n\t\tdeck,\n\t\tdnd: new loot.DragAndDrops({\n\t\t\tacceptDrop(_event, draggy, droppy) {\n\t\t\t\tif (droppy.playerId === droppyNewPlayer)\n\t\t\t\t\thub.plug(draggy.controller, hub.createPlayer())\n\t\t\t\telse if (isHappy(droppy.playerId))\n\t\t\t\t\thub.plug(draggy.controller, droppy.playerId)\n\t\t\t\telse\n\t\t\t\t\thub.unplug(draggy.controller)\n\t\t\t},\n\t\t}),\n\t}))\n\n\treturn html`\n\t\t<div class=plate ?data-drag-and-drop=\"${!!context.dnd.dragging}\">\n\t\t\t<div class=playerlist>\n\t\t\t\t${hub.playerIds.map(renderPlayer)}\n\n\t\t\t\t${when(hub.playerIds.length < deck.maxPlayers, () => DropcardView({\n\t\t\t\t\tclass: \"player new\",\n\t\t\t\t\tthemeCard: \"dull\",\n\t\t\t\t\tplayerId: droppyNewPlayer,\n\t\t\t\t\tcontext,\n\t\t\t\t\tcontent: html`\n\t\t\t\t\t\t<button theme-button=naked @click=\"${clickCreatePlayer}\">\n\t\t\t\t\t\t\t${personAddSvg}\n\t\t\t\t\t\t\t<span>add player</span>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t`,\n\t\t\t\t}))}\n\n\t\t\t\t${DropcardView({\n\t\t\t\t\tclass: \"player unassigned\",\n\t\t\t\t\tthemeCard: \"dull\",\n\t\t\t\t\tplayerId: null,\n\t\t\t\t\tcontext,\n\t\t\t\t\tcontent: html`\n\t\t\t\t\t\t<h3>unassigned</h3>\n\t\t\t\t\t\t<div class=controllerlist>\n\t\t\t\t\t\t\t${controllers.unassigned.map(c => ControllerView(context, c))}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`,\n\t\t\t\t})}\n\t\t\t</div>\n\t\t</div>\n\t`\n})\n\n", "\nimport {css} from \"lit\"\nexport default css`@layer view {\n\n.plate {\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.topbar {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tpadding: var(--pad) var(--space);\n\n\t[view=\"profile-select\"] {\n\t\tfont-size: 1.2em;\n\t}\n\n\t.corner {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\talign-items: center;\n\t\tgap: var(--pad);\n\n\t\tsmall {\n\t\t\tuser-select: none;\n\t\t\topacity: 0.5;\n\t\t\tfont-style: italic;\n\t\t\tborder: 1px solid;\n\t\t\tborder-radius: var(--round);\n\t\t\tpadding: var(--nib) var(--pad);\n\t\t}\n\t}\n\n\t.tools {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: var(--pad);\n\t\tflex: 1 1 auto;\n\t\tjustify-content: end;\n\n\t\tinput[type=\"text\"] {\n\t\t\twidth: 12em;\n\t\t}\n\t}\n}\n\n.bindings, .group {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: var(--nib);\n}\n\n.bindings {\n\tuser-select: none;\n\tcursor: default;\n\tpadding: var(--space);\n\n\tsummary {\n\t\tcolor: var(--prime);\n\t\twidth: max-content;\n\t\tfont-weight: bold;\n\t\tfont-size: 1.2em;\n\t\t&:is(:hover, :focus-visible) { filter: brightness(120%); }\n\t\t&:active { filter: brightness(90%); }\n\t}\n\n\t.expression {\n\t\tdisplay: flex;\n\t\talign-items: end;\n\t\tmargin-left: 0.5em;\n\t\tborder-bottom: 1px dashed oklch(from var(--prime) l c h / 30%);\n\t\tflex-wrap: wrap;\n\t\tgap: 0 var(--pad);\n\t\tpadding: var(--nib);\n\n\t\tmin-height: 3em;\n\n\t\t&:last-of-type {\n\t\t\tmargin-bottom: calc(var(--space) * 2);\n\t\t}\n\n\t\t> strong {\n\t\t\tfont-weight: normal;\n\t\t}\n\n\t\t> div {\n\t\t\tmargin-left: auto;\n\n\t\t\tinput {\n\t\t\t\tfont: inherit;\n\t\t\t\tcolor: inherit;\n\t\t\t\twidth: 8em;\n\n\t\t\t\t&[type=\"number\"] {\n\t\t\t\t\twidth: 5em;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdiv {\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\talign-items: stretch;\n\t\t\tgap: var(--nib);\n\t\t}\n\n\t\t.bracket {\n\t\t\talign-items: center;\n\t\t\tgap: var(--nib);\n\t\t\tpadding: 2px var(--nib);\n\t\t\tbackground: color-mix(in oklch, #aaa2, var(--slate) 80%);\n\t\t\tbox-shadow: 0.1em 0.2em 0.5em #0002;\n\t\t\tborder: 1px solid #fff4;\n\t\t\tborder-radius: 0.2em;\n\n\t\t\t&.mod {\n\t\t\t\tgap: var(--nib);\n\t\t\t}\n\t\t}\n\t}\n\n\t.children {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\n\t\tmargin-left: 0.3em;\n\t\tpadding-left: 0.5em;\n\t\tborder-left: 1px solid oklch(from var(--prime) l c h / 20%);\n\t}\n\n\t.expression .recorder {\n\t\tdisplay: flex;\n\t\tgap: var(--pad);\n\n\t\t&[data-recording] {\n\t\t\tcolor: var(--recording);\n\t\t}\n\t}\n}\n\n}`\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"ai ai-Copy\"><path d=\"M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z\"/><path d=\"M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2\"/></svg>`\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"ai ai-TrashCan\"><path d=\"M4 6h16l-1.58 14.22A2 2 0 0 1 16.432 22H7.568a2 2 0 0 1-1.988-1.78L4 6z\"/><path d=\"M7.345 3.147A2 2 0 0 1 9.154 2h5.692a2 2 0 0 1 1.81 1.147L18 6H6l1.345-2.853z\"/><path d=\"M2 6h20\"/><path d=\"M10 11v5\"/><path d=\"M14 11v5\"/></svg>`\n\n", "\nimport {hex} from \"@e280/stz\"\n\nexport function makeId() {\n\treturn hex.random(16)\n}\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"ai ai-KeyCap\"><path d=\"M7 3s3 .5 5 .5 5-.5 5-.5l1 9s-3 1-6 1-6-1-6-1l1-9z\"/><path d=\"M3.869 8.147l-.862 10.294c-.03.366.04.733.205 1.06l.197.393A2.01 2.01 0 0 0 5.206 21h13.588a2.01 2.01 0 0 0 1.797-1.106l.197-.392c.165-.328.236-.695.205-1.06l-.862-10.295a3.99 3.99 0 0 0-.79-2.068L17 3s-3 .5-5 .5S6.978 3 6.978 3l-2.32 3.08a3.99 3.99 0 0 0-.79 2.067z\"/><path d=\"M6 12l-2.5 8M18 12l2.5 8\"/></svg>`\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"ai ai-Backspace\"><path d=\"M17 15l-6-6m6 0l-6 6\"/><path d=\"M7.4 4.8A2 2 0 0 1 9 4h11a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H9a2 2 0 0 1-1.6-.8l-4.5-6a2 2 0 0 1 0-2.4l4.5-6z\"/></svg>`\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"ai ai-Cross\"><path d=\"M20 20L4 4m16 0L4 20\"/></svg>`\n\n", "\nimport {ev} from \"@e280/stz\"\nimport {Expression} from \"../../../../input/expression.js\"\n\nexport function captureKeyChord(\n\t\tupdate: (code: Expression) => void,\n\t\tonDone: () => void,\n\t) {\n\n\tconst held = new Set<string>()\n\tconst seen = new Set<string>()\n\n\tfunction mod(code: string) {\n\t\tif (code === \"ShiftLeft\" || code === \"ShiftRight\") return \"shift\"\n\t\tif (code === \"ControlLeft\" || code === \"ControlRight\") return \"ctrl\"\n\t\tif (code === \"MetaLeft\" || code === \"MetaRight\") return \"meta\"\n\t\tif (code === \"AltLeft\" || code === \"AltRight\") return \"alt\"\n\t\treturn undefined\n\t}\n\n\tconst stop = ev(window, {\n\t\tblur: () => halt(),\n\t\tkeydown: (event: KeyboardEvent) => {\n\t\t\tevent.preventDefault()\n\n\t\t\tif (event.code === \"Escape\")\n\t\t\t\treturn halt()\n\n\t\t\theld.add(event.code)\n\t\t\tseen.add(event.code)\n\t\t},\n\t\tkeyup: (event: KeyboardEvent) => {\n\t\t\tevent.preventDefault()\n\n\t\t\theld.delete(event.code)\n\n\t\t\tif (held.size === 0) {\n\t\t\t\tconst codes = new Set<string>()\n\t\t\t\tconst mods = new Set<string>()\n\n\t\t\t\tfor (const code of seen) {\n\t\t\t\t\tconst m = mod(code)\n\t\t\t\t\tif (m) mods.add(m)\n\t\t\t\t\telse codes.add(code)\n\t\t\t\t}\n\n\t\t\t\tif (seen.size === 0)\n\t\t\t\t\tvoid 0\n\t\t\t\telse if (codes.size === 0)\n\t\t\t\t\tupdate([\"*\", ...seen])\n\t\t\t\telse if (mods.size > 0)\n\t\t\t\t\tupdate([\"*\", [\"mod\", ...mods as any], ...codes])\n\t\t\t\telse if (seen.size > 1)\n\t\t\t\t\tupdate([\"*\", ...seen])\n\t\t\t\telse\n\t\t\t\t\tupdate([...seen][0]!)\n\n\t\t\t\thalt()\n\t\t\t}\n\t\t},\n\t})\n\n\tconst halt = () => {\n\t\tstop()\n\t\tonDone()\n\t}\n\n\treturn halt\n}\n\n", "\nimport {cycle, disposer, ev, nap} from \"@e280/stz\"\nimport {Expression} from \"../../../../input/expression.js\"\nimport {onPad} from \"../../../../input/utils/pad/on-pad.js\"\nimport {GamepadSource} from \"../../../../input/sources/gamepad.js\"\n\nexport function captureGamepadChord(\n\t\tupdate: (code: Expression) => void,\n\t\tonDone: () => void,\n\t) {\n\n\tconst {dispose, schedule} = disposer()\n\tschedule(onDone)\n\n\tconst sourceSet = new Set<GamepadSource>()\n\tconst held = new Set<string>()\n\tconst seen = new Set<string>()\n\n\tschedule(ev(window, {blur: () => dispose()}))\n\n\tschedule(onPad(pad => {\n\t\tconst source = new GamepadSource(pad)\n\t\tsourceSet.add(source)\n\n\t\tsource.onSample(sample => {\n\t\t\tif (sample.code === \"gamepad.any\")\n\t\t\t\treturn undefined\n\n\t\t\tif (sample.value > 0.9) {\n\t\t\t\theld.add(sample.code)\n\t\t\t\tseen.add(sample.code)\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (!held.delete(sample.code))\n\t\t\t\t\treturn\n\t\t\t\tif (held.size === 0) {\n\t\t\t\t\tif (seen.size === 1) update([...seen][0])\n\t\t\t\t\telse if (seen.size > 1) update([\"*\", ...seen])\n\t\t\t\t\tdispose()\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\treturn () => {\n\t\t\tsource.dispose()\n\t\t\tsourceSet.delete(source)\n\t\t}\n\t}))\n\n\tschedule(cycle(async() => {\n\t\tfor (const source of sourceSet) {\n\t\t\tsource.poll()\n\t\t}\n\t\tawait nap(16.67)\n\t}))\n\n\treturn dispose\n}\n\n", "\nimport {disposer, ev} from \"@e280/stz\"\nimport {Expression} from \"../../../../input/expression.js\"\nimport {mouseButton} from \"../../../../input/utils/mouse-button.js\"\n\nexport function capturePointerChord(\n\t\tupdate: (code: Expression) => void,\n\t\tonDone: () => void,\n\t) {\n\n\tconst {dispose, schedule} = disposer()\n\tschedule(onDone)\n\n\tconst held = new Set<string>()\n\tconst seen = new Set<string>()\n\n\tconst isControl = (event: MouseEvent) => {\n\t\treturn event.composedPath().some(target =>\n\t\t\ttarget instanceof Element &&\n\t\t\ttarget.matches(\"button.record\")\n\t\t)\n\t}\n\n\tschedule(ev(window, {\n\t\tblur: () => dispose(),\n\t\tauxclick: (event: MouseEvent) => event.preventDefault(),\n\n\t\tmousedown: (event: MouseEvent) => {\n\t\t\tif (isControl(event)) return\n\t\t\tevent.preventDefault()\n\t\t\tconst code = mouseButton(event.button)\n\t\t\theld.add(code)\n\t\t\tseen.add(code)\n\t\t},\n\n\t\tmouseup: (event: MouseEvent) => {\n\t\t\tconst code = mouseButton(event.button)\n\t\t\tif (!held.delete(code)) return\n\t\t\tevent.preventDefault()\n\n\t\t\tif (held.size === 0) {\n\t\t\t\tif (seen.size === 1) update([...seen][0]!)\n\t\t\t\telse if (seen.size > 1) update([\"*\", ...seen])\n\t\t\t\tdispose()\n\t\t\t}\n\t\t},\n\n\t\tcontextmenu: (event: MouseEvent) => {\n\t\t\tevent.preventDefault()\n\t\t},\n\t}))\n\n\treturn dispose\n}\n\n", "\nimport {html} from \"lit\"\nimport {disposer} from \"@e280/stz\"\nimport {Content, lightView, useSignal, useUnmount} from \"@e280/sly\"\n\nimport keyCapSvg from \"../../../icons/akar/key-cap.svg.js\"\nimport backspaceSvg from \"../../../icons/akar/backspace.svg.js\"\n\nimport crossSvg from \"../../../icons/akar/cross.svg.js\"\nimport {Expression} from \"../../../../input/expression.js\"\nimport {captureKeyChord} from \"../parts/capture-key-chord.js\"\nimport {captureGamepadChord} from \"../parts/capture-gamepad-chord.js\"\nimport {capturePointerChord} from \"../parts/capture-pointer-chord.js\"\n\nexport const RecorderView = lightView((\n\t\tisReadonly: boolean,\n\t\tupdate: (e: Expression) => void,\n\t\treset: () => void,\n\t\tcontent: Content,\n\t) => {\n\n\tconst $recording = useSignal<null | (() => void)>(null)\n\n\tconst removeRecording = () => $recording(null)\n\n\tconst startRecording = () => {\n\t\tconst {dispose, schedule} = disposer()\n\t\tschedule(removeRecording)\n\t\tschedule(captureKeyChord(update, dispose))\n\t\tschedule(captureGamepadChord(update, dispose))\n\t\tschedule(capturePointerChord(update, dispose))\n\t\t$recording(dispose)\n\t}\n\n\tconst haltRecording = () => {\n\t\t$recording()?.()\n\t\tremoveRecording()\n\t}\n\n\tfunction toggleRecording() {\n\t\tif ($recording()) haltRecording()\n\t\telse startRecording()\n\t}\n\n\tfunction haltAndReset() {\n\t\thaltRecording()\n\t\treset()\n\t}\n\n\tuseUnmount(haltRecording)\n\n\treturn html`\n\t\t<div class=recorder ?data-recording=\"${!!$recording()}\">\n\t\t\t${content}\n\t\t\t${isReadonly ? null : html`\n\t\t\t\t<button\n\t\t\t\t\tclass=record\n\t\t\t\t\ttheme-button=naked\n\t\t\t\t\ttitle=\"record a keypress\"\n\t\t\t\t\t@click=${toggleRecording}>\n\t\t\t\t\t${$recording()\n\t\t\t\t\t\t? crossSvg\n\t\t\t\t\t\t: keyCapSvg}\n\t\t\t\t</button>\n\n\t\t\t\t<button\n\t\t\t\t\ttheme-button=naked\n\t\t\t\t\ttitle=\"reset to default\"\n\t\t\t\t\t@click=${haltAndReset}>\n\t\t\t\t\t${backspaceSvg}\n\t\t\t\t</button>\n\t\t\t`}\n\t\t</div>\n\t`\n})\n\n", "\nimport {html} from \"lit\"\nimport {Content, lightView} from \"@e280/sly\"\nimport {isArray, isHappy, isNumber, isString} from \"@e280/stz\"\n\nimport {Expression} from \"../../../../input/expression.js\"\nimport xSmallSvg from \"../../../icons/akar/x-small.svg.js\"\n\nexport const ExpressionView = lightView((\n\t\tisReadonly: boolean,\n\t\texpression: Expression,\n\t\tupdate: (expression: Expression) => void,\n\t): Content => {\n\n\tif (!isHappy(expression))\n\t\treturn html`\n\t\t\t<div class=null>unset</div>\n\t\t`\n\n\tif (isNumber(expression))\n\t\treturn html`\n\t\t\t<div class=number>\n\t\t\t\t<input\n\t\t\t\t\ttype=number\n\t\t\t\t\tstep=any\n\t\t\t\t\ttheme-input\n\t\t\t\t\t.value=\"${expression}\"\n\t\t\t\t\t?readonly=\"${isReadonly}\"\n\t\t\t\t\t@change=\"${(event: Event) => {\n\t\t\t\t\t\tconst input = event.currentTarget as HTMLInputElement\n\t\t\t\t\t\tconst value = input.valueAsNumber\n\t\t\t\t\t\tif (Number.isFinite(value))\n\t\t\t\t\t\t\tupdate(value)\n\t\t\t\t\t}}\"\n\t\t\t\t\t/>\n\t\t\t</div>\n\t\t`\n\n\tif (isString(expression))\n\t\treturn html`\n\t\t\t<input\n\t\t\t\ttype=text\n\t\t\t\ttheme-input\n\t\t\t\t.value=\"${expression}\"\n\t\t\t\t?readonly=\"${isReadonly}\"\n\t\t\t\t@change=\"${(event: Event) => {\n\t\t\t\tconst input = event.currentTarget as HTMLInputElement\n\t\t\t\tconst value = input.value\n\t\t\t\tupdate(value)\n\t\t\t}}\"/>\n\t\t`\n\n\tif (isArray(expression))\n\t\treturn (expression[0] === \"mod\") ? html`\n\t\t\t<div class=\"bracket mod\">\n\t\t\t\t${expression.slice(1).length === 0\n\t\t\t\t\t? \"unmodified\"\n\t\t\t\t\t: expression.slice(1).join(\"+\")}\n\n\t\t\t\t${!isReadonly && expression.slice(1).length > 0\n\t\t\t\t\t? html`\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttheme-button=naked\n\t\t\t\t\t\t\t@click=\"${() => update([expression[0]])}\">\n\t\t\t\t\t\t\t${xSmallSvg}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t`\n\t\t\t\t\t: null}\n\t\t\t</div>\n\t\t` : html`\n\t\t\t<div class=bracket>\n\t\t\t\t${expression[0] === \"*\" ? null : html`\n\t\t\t\t\t<strong>${expression[0]}</strong>\n\t\t\t\t`}\n\t\t\t\t${expression.slice(1).map((e, i) => {\n\t\t\t\t\treturn ExpressionView(isReadonly, e ?? null, fresh => {\n\t\t\t\t\t\tconst clone = structuredClone(expression) as any\n\t\t\t\t\t\tclone[i + 1] = fresh\n\t\t\t\t\t\tupdate(clone)\n\t\t\t\t\t})\n\t\t\t\t})}\n\t\t\t</div>\n\t\t`\n\n\telse\n\t\tthrow new Error(\"unknown expression\")\n})\n\n", "\nimport {html} from \"lit\"\nimport {Content} from \"@e280/sly\"\nimport {Bindings} from \"../../../../input/types.js\"\nimport {RecorderView} from \"../subviews/recorder.js\"\nimport {ExpressionView} from \"../subviews/expression.js\"\nimport {isExpression} from \"../../../../input/investigate/is-expression.js\"\n\nexport function renderBindings(\n\t\tisReadonly: boolean,\n\t\tbindings: Bindings,\n\t\toriginal: Bindings,\n\t\tupdate: (b: Bindings) => void,\n\t): Content {\n\n\tif (isExpression(bindings))\n\t\treturn ExpressionView(isReadonly, bindings, update)\n\n\treturn Object.entries(bindings).map(([key, child]) => (\n\t\tisExpression(child)\n\t\t\t? renderExpression(isReadonly, bindings, original as any, update, key)\n\t\t\t: renderGroup(isReadonly, bindings, original as any, update, key)\n\t))\n}\n\nfunction renderGroup(\n\t\tisReadonly: boolean,\n\t\tbindings: Record<string, Bindings>,\n\t\toriginal: Record<string, Bindings>,\n\t\tupdate: (b: Bindings) => void,\n\t\tkey: string,\n\t) {\n\n\treturn html`\n\t\t<details class=group open>\n\t\t\t<summary>${key}</summary>\n\t\t\t<div class=children>\n\t\t\t\t${renderBindings(\n\t\t\t\t\tisReadonly,\n\t\t\t\t\tbindings[key],\n\t\t\t\t\toriginal[key],\n\t\t\t\t\tfresh => update({...bindings, [key]: fresh}),\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</details>\n\t`\n}\n\nfunction renderExpression(\n\t\tisReadonly: boolean,\n\t\tbindings: Record<string, Bindings>,\n\t\toriginal: Record<string, Bindings>,\n\t\tupdate: (b: Bindings) => void,\n\t\tkey: string,\n\t) {\n\n\tconst up = (fresh: Bindings) => update({...bindings, [key]: fresh})\n\tconst reset = () => up(original[key])\n\n\treturn html`\n\t\t<div class=expression>\n\t\t\t<strong>${key}</strong>\n\t\t\t${RecorderView(isReadonly, up, reset, renderBindings(isReadonly, bindings[key], original[key], up))}\n\t\t</div>\n\t`\n}\n\n", "\nimport {html} from \"lit\"\nimport {given, when} from \"@e280/stz\"\nimport {shadowDuplex, useCss, useSignal} from \"@e280/sly\"\n\nimport styleCss from \"./style.css.js\"\nimport themeCss from \"../theme.css.js\"\n\nimport copySvg from \"../../icons/akar/copy.svg.js\"\nimport trashCanSvg from \"../../icons/akar/trash-can.svg.js\"\n\nimport {Bindings} from \"../../../input/types.js\"\nimport {makeId} from \"../../../utils/make-id.js\"\nimport {Controls} from \"../../deck/controls/controls.js\"\nimport {renderBindings} from \"./parts/render-bindings.js\"\nimport {ProfileSelectView} from \"../profile-select/view.js\"\n\nexport const [CustomizeView, makeCustomizeElement] = shadowDuplex((options: {controls: Controls}) => {\n\tuseCss(themeCss, styleCss)\n\tconst {controls, controls: {profiles}} = options\n\tconst $profileKey = useSignal(controls.fallbackProfileKey)\n\n\tconst profile = profiles.get($profileKey())\n\tconst isReadonly = profiles.isPreset($profileKey())\n\n\tconst baseline = profile.basedOn\n\t\t? profiles.get(profile.basedOn)\n\t\t: profile\n\n\tconst updateBindings = (bindings: Bindings) => {\n\t\tlet key = $profileKey()\n\n\t\tif (profiles.isPreset(key)) {\n\t\t\tconst basedOn = key\n\t\t\tconst freshKey = makeId()\n\t\t\tkey = freshKey\n\t\t\tprofiles.clone(freshKey, basedOn)\n\t\t}\n\n\t\tprofiles.update(key, {bindings})\n\t\t$profileKey(key)\n\t}\n\n\tconst updateLabel = (profileKey: string, label: string) =>\n\t\tprofiles.update(profileKey, {label})\n\n\tconst clone = () => {\n\t\tconst key = makeId()\n\t\tprofiles.clone(key, $profileKey())\n\t\t$profileKey.set(key)\n\t}\n\n\tconst destroy = () => {\n\t\tprofiles.delete($profileKey())\n\t\t$profileKey(controls.fallbackProfileKey)\n\t}\n\n\treturn html`\n\t\t<div class=plate theme-card>\n\t\t\t<header class=topbar>\n\t\t\t\t<div class=corner>\n\t\t\t\t\t${ProfileSelectView(options, $profileKey(), $profileKey)}\n\n\t\t\t\t\t<button title=\"copy this profile\" theme-button=naked @click=\"${clone}\">\n\t\t\t\t\t\t${copySvg}\n\t\t\t\t\t</button>\n\n\t\t\t\t\t${isReadonly ? null : html`\n\t\t\t\t\t\t<button title=\"delete this profile\" theme-button=naked @click=\"${destroy}\">\n\t\t\t\t\t\t\t${trashCanSvg}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t`}\n\n\t\t\t\t\t${when(isReadonly, () => html`<small>readonly</small>`)}\n\t\t\t\t\t${given(profile.basedOn, basedOn => html`<small>based on ${profiles.get(basedOn).label}</small>`)}\n\t\t\t\t</div>\n\n\t\t\t\t<div class=tools>\n\t\t\t\t\t${isReadonly ? null : html`\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\ttype=text\n\t\t\t\t\t\t\ttheme-input\n\t\t\t\t\t\t\t.value=\"${profile.label}\"\n\t\t\t\t\t\t\t@change=\"${(event: Event) => {\n\t\t\t\t\t\t\t\tconst input = event.currentTarget as HTMLInputElement\n\t\t\t\t\t\t\t\tupdateLabel($profileKey(), input.value)\n\t\t\t\t\t\t\t}}\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t`}\n\t\t\t\t</div>\n\t\t\t</header>\n\n\t\t\t<div class=bindings>\n\t\t\t\t${renderBindings(\n\t\t\t\t\tfalse,\n\t\t\t\t\tprofile.bindings,\n\t\t\t\t\tbaseline.bindings,\n\t\t\t\t\tupdateBindings,\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t`\n})\n\n", "\nimport {html} from \"lit\"\nimport {ShinyTabs, TabsControl} from \"@e280/shiny\"\nimport {shadowDuplex, useCss, useOnce} from \"@e280/sly\"\n\nimport styleCss from \"./style.css.js\"\nimport themeCss from \"../theme.css.js\"\nimport gameControllerSvg from \"../../icons/akar/game-controller.svg.js\"\nimport settingsHorizontalSvg from \"../../icons/akar/settings-horizontal.svg.js\"\n\nimport {Deck} from \"../../deck/types.js\"\nimport {ControllersView} from \"../controllers/view.js\"\nimport {CustomizeView} from \"../customize/view.js\"\n\nexport const [DeckView, makeDeckElement] = shadowDuplex((deck: Deck) => {\n\tuseCss(themeCss, styleCss)\n\n\tconst attrs = {slot: \"panel\"}\n\tconst tabsControl = useOnce(() => new TabsControl())\n\n\t// TODO remove this\n\tuseOnce(() => {\n\t\tif (window.location.hash.includes(\"bindings\"))\n\t\t\ttabsControl.setIndex(1)\n\t})\n\n\treturn html`\n\t\t<div class=deck theme-card>\n\t\t\t${ShinyTabs.with({\n\t\t\t\tprops: [{control: tabsControl}],\n\t\t\t\tchildren: html`\n\t\t\t\t\t<button theme-button>\n\t\t\t\t\t\t${gameControllerSvg}\n\t\t\t\t\t\t<span>controllers</span>\n\t\t\t\t\t</button>\n\n\t\t\t\t\t<button theme-button>\n\t\t\t\t\t\t${settingsHorizontalSvg}\n\t\t\t\t\t\t<span>customize</span>\n\t\t\t\t\t</button>\n\n\t\t\t\t\t${ControllersView.with({attrs, props: [deck]})}\n\t\t\t\t\t${CustomizeView.with({attrs, props: [deck]})}\n\t\t\t\t`,\n\t\t\t})}\n\t\t</div>\n\t`\n})\n\n", "\nimport {css} from \"lit\"\nexport default css`@layer view {\n\n:host {\n\tdisplay: block;\n}\n\noutput {\n\topacity: 0.5;\n\tdisplay: block;\n\n\tfont-size: 1em;\n\theight: 8em;\n\n\toverflow: hidden;\n\toverflow-wrap: anywhere;\n\n\tfont-family: monospace;\n\tcolor: var(--prime);\n\ttext-overflow: ellipsis;\n}\n\n}`\n\n", "\nimport {html} from \"lit\"\nimport {shadowDuplex, useCss} from \"@e280/sly\"\n\nimport styleCss from \"./style.css.js\"\nimport themeCss from \"../theme.css.js\"\nimport {Visualizer} from \"./visualizer.js\"\n\nexport const [VisualizerView, makeVisualizerElement] = shadowDuplex((visualizer: Visualizer) => {\n\tuseCss(themeCss, styleCss)\n\n\treturn html`\n\t\t<slot></slot>\n\t\t<output class=viz>${visualizer.$hex()}</output>\n\t`\n})\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"ai ai-Devices\"><path d=\"M10 15H4V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v2\"/><path d=\"M2 18h12\"/><path d=\"M14 9.2c0-.663.597-1.2 1.333-1.2h5.334C21.403 8 22 8.537 22 9.2v9.6c0 .663-.597 1.2-1.333 1.2h-5.334C14.597 20 14 19.463 14 18.8V9.2z\"/><path d=\"M18 17h.01\"/></svg>`\n\n", "\nimport {register} from \"@e280/sly\"\n\nimport {setupDeck} from \"./deck.js\"\nimport {SetupParams} from \"./types.js\"\nimport {Collector} from \"../collector.js\"\nimport {Bindings} from \"../../../input/types.js\"\nimport {autoGamepads} from \"../auto-gamepads.js\"\nimport {ellipsis} from \"../../../utils/ellipsis.js\"\nimport {firstPreset} from \"../utils/first-preset.js\"\nimport {Controller} from \"../../../input/controller.js\"\nimport {Sources} from \"../../../input/sources/sources.js\"\nimport {Visualizer} from \"../../views/visualizer/visualizer.js\"\nimport {PointerSource} from \"../../../input/sources/pointer.js\"\nimport {KeyboardSource} from \"../../../input/sources/keyboard.js\"\n\nimport {makeDeckElement} from \"../../views/deck/view.js\"\nimport {makeCustomizeElement} from \"../../views/customize/view.js\"\nimport {makeVisualizerElement} from \"../../views/visualizer/view.js\"\nimport {makeControllersElement} from \"../../views/controllers/view.js\"\n\nimport devicesSvg from \"../../icons/akar/devices.svg.js\"\nimport gameControllerSvg from \"../../icons/akar/game-controller.svg.js\"\n\nexport async function setupTact<B extends Bindings>(params: SetupParams<B>) {\n\tconst deck = await setupDeck(params)\n\tconst first = firstPreset(deck.controls.presets)\n\tconst collector = new Collector(first.profile.bindings)\n\tconst visualizer = new Visualizer()\n\n\tconst elements = {\n\t\tTactDeck: makeDeckElement(deck),\n\t\tTactCustomize: makeCustomizeElement(deck),\n\t\tTactControllers: makeControllersElement(deck),\n\t\tTactVisualizer: makeVisualizerElement(visualizer),\n\t}\n\n\tfunction gamepads(defaultProfileKey?: string) {\n\t\treturn autoGamepads(deck.hub, (controller, source) => {\n\t\t\tconst handle = `${source.pad.gamepad.id} ${source.pad.gamepad.index + 1}`\n\t\t\tdeck.controls.attach(controller, {\n\t\t\t\ticon: gameControllerSvg,\n\t\t\t\thandle,\n\t\t\t\ttooltip: handle,\n\t\t\t\tname: ellipsis(handle, 32),\n\t\t\t\tdefaultProfileKey: defaultProfileKey ?? first.key,\n\t\t\t})\n\t\t\treturn () => deck.controls.detach(controller)\n\t\t})\n\t}\n\n\tfunction mouseKeyboard() {\n\t\tconst {key, profile} = first\n\n\t\tconst controller = new Controller({\n\t\t\tbindings: profile.bindings,\n\t\t\tsource: new Sources(\n\t\t\t\tnew KeyboardSource(),\n\t\t\t\tnew PointerSource(),\n\t\t\t),\n\t\t})\n\n\t\tdeck.hub.plug(controller)\n\n\t\tdeck.controls.attach(controller, {\n\t\t\ticon: devicesSvg,\n\t\t\thandle: \"standard\",\n\t\t\tname: \"mouse/keyboard\",\n\t\t\ttooltip: \"\",\n\t\t\tdefaultProfileKey: key,\n\t\t})\n\n\t\treturn controller\n\t}\n\n\tfunction registerElements() {\n\t\tregister(elements)\n\t}\n\n\treturn {\n\t\tdeck,\n\t\tcollector,\n\t\tgamepads,\n\t\tmouseKeyboard,\n\t\tvisualizer,\n\t\telements,\n\t\tregisterElements,\n\t}\n}\n\n", "\nimport {dom} from \"@e280/sly\"\nimport {cycle, nap} from \"@e280/stz\"\nimport {presets} from \"./presets.js\"\nimport {setupTact} from \"../lib/ui/deck/setup/tact.js\"\n\nconst tact = await setupTact({presets, maxPlayers: 4})\ntact.mouseKeyboard()\ntact.gamepads(\"gamer\")\ntact.registerElements()\n\ncycle(async() => {\n\tconst data = tact.deck.hub.encodeAll()\n\ttact.visualizer.update(data)\n\tawait nap(1000 / 60)\n})\n\n{\n\tconst input = dom<HTMLInputElement>('input[type=\"color\"]')\n\tinput.value = \"#ffbb00\"\n\tinput.oninput = () => document.body.style.setProperty(\"--tact-prime\", input.value)\n}\n\n"],
|
|
5
|
-
"mappings": "6FAEM,SAAUA,GAAQC,EAAa,CACpC,OAAOA,EAAM,QAAQ,uBAAwB,KAAK,EAAE,YAAW,CAChE,CCIM,SAAUC,GAAuCC,EAAaC,EAQ/D,CAAA,EAAE,CAEN,GAAM,CAAC,KAAAC,EAAO,GAAO,QAAAC,EAAU,EAAI,EAAIF,EAEvC,OAAW,CAACG,EAAMC,CAAO,IAAK,OAAO,QAAQL,CAAQ,EAAG,CACvD,IAAMM,EAAMC,GAAQH,CAAI,EAClBI,EAAU,eAAe,IAAIF,CAAG,EAElCJ,GAAQM,IAGZ,eAAe,OAAOF,EAAKD,CAAO,EAE9BF,GACH,SAAS,i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EAAM,QAAU,IAAM,SAAS,KAAK,MAAM,YAAY,eAAgBA,EAAM,KAAK,CAClF",
|
|
6
|
-
"names": ["dashify", "camel", "register", "elements", "options", "soft", "upgrade", "name", "Element", "tag", "dashify", "already", "element", "global", "globalThis", "supportsAdoptingStyleSheets", "ShadowRoot", "ShadyCSS", "nativeShadow", "Document", "prototype", "CSSStyleSheet", "constructionToken", "Symbol", "cssTagCache", "WeakMap", "CSSResult", "cssText", "strings", "safeToken", "this", "Error", "_strings", "styleSheet", "_styleSheet", "cacheable", "length", "get", "replaceSync", "set", "toString", "unsafeCSS", "value", "String", "css", "values", "reduce", "acc", "v", "idx", "adoptStyles", "renderRoot", "styles", "adoptedStyleSheets", "map", "s", "style", "document", "createElement", "nonce", "setAttribute", "textContent", "appendChild", "getCompatibleStyle", "sheet", "rule", "cssRules", "is", "defineProperty", "getOwnPropertyDescriptor", "getOwnPropertyNames", "getOwnPropertySymbols", "getPrototypeOf", "Object", "global", "globalThis", "trustedTypes", "emptyStringForBooleanAttribute", "emptyScript", "polyfillSupport", "reactiveElementPolyfillSupport", "JSCompiler_renameProperty", "prop", "_obj", "defaultConverter", "value", "type", "Boolean", "Array", "JSON", "stringify", "fromValue", "Number", "parse", "e", "notEqual", "old", "defaultPropertyDeclaration", "attribute", "String", "converter", "reflect", "useDefault", "hasChanged", "Symbol", "metadata", "litPropertyMetadata", "WeakMap", "ReactiveElement", "HTMLElement", "initializer", "this", "__prepare", "_initializers", "push", "observedAttributes", "finalize", "__attributeToPropertyMap", "keys", "name", "options", "state", "prototype", "hasOwnProperty", "create", "wrapped", "elementProperties", "set", "noAccessor", "key", "descriptor", "getPropertyDescriptor", "get", "v", "oldValue", "call", "requestUpdate", "configurable", "enumerable", "superCtor", "Map", "finalized", "props", "properties", "propKeys", "p", "createProperty", "attr", "__attributeNameForProperty", "elementStyles", "finalizeStyles", "styles", "isArray", "Set", "flat", "Infinity", "reverse", "s", "unshift", "getCompatibleStyle", "toLowerCase", "constructor", "super", "__instanceProperties", "isUpdatePending", "hasUpdated", "__reflectingProperty", "__initialize", "__updatePromise", "Promise", "res", "enableUpdating", "_$changedProperties", "__saveInstanceProperties", "forEach", "i", "controller", "__controllers", "add", "renderRoot", "isConnected", "hostConnected", "delete", "instanceProperties", "size", "createRenderRoot", "shadowRoot", "attachShadow", "shadowRootOptions", "adoptStyles", "connectedCallback", "c", "_requestedUpdate", "disconnectedCallback", "hostDisconnected", "_old", "_$attributeToProperty", "attrValue", "toAttribute", "removeAttribute", "setAttribute", "ctor", "propName", "getPropertyOptions", "fromAttribute", "convertedValue", "__defaultValues", "useNewValue", "newValue", "hasAttribute", "_$changeProperty", "__enqueueUpdate", "initializeValue", "has", "__reflectingProperties", "reject", "result", "scheduleUpdate", "performUpdate", "shouldUpdate", "changedProperties", "willUpdate", "hostUpdate", "update", "__markUpdated", "_$didUpdate", "_changedProperties", "hostUpdated", "firstUpdated", "updated", "updateComplete", "getUpdateComplete", "__propertyToAttribute", "mode", "reactiveElementVersions", "global", "globalThis", "wrap", "node", "trustedTypes", "policy", "createPolicy", "createHTML", "s", "boundAttributeSuffix", "marker", "Math", "random", "toFixed", "slice", "markerMatch", "nodeMarker", "d", "document", "createMarker", "createComment", "isPrimitive", "value", "isArray", "Array", "isIterable", "Symbol", "iterator", "SPACE_CHAR", "textEndRegex", "commentEndRegex", "comment2EndRegex", "tagEndRegex", "RegExp", "singleQuoteAttrEndRegex", "doubleQuoteAttrEndRegex", "rawTextElement", "tag", "type", "strings", "values", "_$litType$", "html", "svg", "mathml", "noChange", "for", "nothing", "templateCache", "WeakMap", "walker", "createTreeWalker", "trustFromTemplateString", "tsa", "stringFromTSA", "hasOwnProperty", "Error", "getTemplateHtml", "l", "length", "attrNames", "rawTextEndRegex", "regex", "i", "attrName", "match", "attrNameEndIndex", "lastIndex", "exec", "test", "end", "startsWith", "push", "Template", "constructor", "options", "this", "parts", "nodeIndex", "attrNameIndex", "partCount", "el", "createElement", "currentNode", "content", "wrapper", "firstChild", "replaceWith", "childNodes", "nextNode", "nodeType", "hasAttributes", "name", "getAttributeNames", "endsWith", "realName", "statics", "getAttribute", "split", "m", "index", "ctor", "PropertyPart", "BooleanAttributePart", "EventPart", "AttributePart", "removeAttribute", "tagName", "textContent", "emptyScript", "append", "data", "indexOf", "_options", "innerHTML", "resolveDirective", "part", "parent", "attributeIndex", "currentDirective", "__directives", "__directive", "nextDirectiveConstructor", "_$initialize", "_$resolve", "TemplateInstance", "template", "_$parts", "_$disconnectableChildren", "_$template", "_$parent", "parentNode", "_$isConnected", "fragment", "creationScope", "importNode", "partIndex", "templatePart", "ChildPart", "nextSibling", "ElementPart", "_$setValue", "__isConnected", "startNode", "endNode", "_$committedValue", "_$startNode", "_$endNode", "isConnected", "directiveParent", "_$clear", "_commitText", "_commitTemplateResult", "_commitNode", "_commitIterable", "insertBefore", "_insert", "createTextNode", "result", "_$getTemplate", "h", "_update", "instance", "_clone", "get", "set", "itemParts", "itemPart", "item", "start", "from", "_$notifyConnectionChanged", "n", "remove", "element", "fill", "String", "valueIndex", "noCommit", "change", "v", "_commitValue", "setAttribute", "toggleAttribute", "super", "newListener", "oldListener", "shouldRemoveListener", "capture", "once", "passive", "shouldAddListener", "removeEventListener", "addEventListener", "event", "call", "host", "handleEvent", "_$LH", "_boundAttributeSuffix", "_marker", "_markerMatch", "_HTML_RESULT", "_getTemplateHtml", "_TemplateInstance", "_isIterable", "_resolveDirective", "_ChildPart", "_AttributePart", "_BooleanAttributePart", "_EventPart", "_PropertyPart", "_ElementPart", "polyfillSupport", "litHtmlPolyfillSupport", "litHtmlVersions", "render", "container", "partOwnerNode", "renderBefore", "global", "globalThis", "LitElement", "ReactiveElement", "constructor", "this", "renderOptions", "host", "__childPart", "createRenderRoot", "renderRoot", "super", "renderBefore", "firstChild", "changedProperties", "value", "render", "hasUpdated", "isConnected", "update", "connectedCallback", "setConnected", "disconnectedCallback", "noChange", "litElementHydrateSupport", "polyfillSupport", "litElementPolyfillSupport", "global", "litElementVersions", "push", "attrGet", "e", "key", "raw", "attrSet", "value", "element", "entries", "record", "el", "tagName", "attrs", "element", "attrSet", "mk", "template", "fragment", "D", "eve", "target", "events", "detachers", "eventName", "handler", "options", "fn", "d", "onAttrs", "element", "fn", "observer", "AttrProxies", "element", "_t", "key", "attrGet", "value", "attrSet", "attrSpec", "e", "spec", "options", "_target", "key", "attrGet", "value", "attrSet", "attrs", "element", "proxies", "AttrProxies", "fn", "onAttrs", "spec", "options", "attrSpec", "attrGet", "attrSet", "elmer", "tagName", "Elmer", "#attrs", "#children", "key", "value", "record", "elements", "element", "attrSet", "queryRequire", "selector", "container", "queryMaybe", "queryAll", "Dom", "_Dom", "#attrs", "element", "selectorOrElement", "queryRequire", "selector", "queryMaybe", "queryAll", "content", "D", "attrs", "spec", "eve", "dom", "selector", "container", "queryRequire", "selectorOrElement", "Dom", "queryMaybe", "queryAll", "el", "elmer", "mk", "eve", "attrs", "register", "content", "D", "index_barrel_exports", "__export", "DragAndDrops", "Drops", "files", "hasFiles", "outsideCurrentTarget", "bytes", "a", "b", "diff", "i", "count", "parts", "size", "part", "offset", "BaseX", "lexicon", "char", "i", "fn", "s", "bitsPerChar", "bitBuffer", "bitCount", "output", "val", "num", "base", "zeroCharacter", "leadingZeroBytes", "out", "writeIndex", "bytes", "byte", "index", "n", "negative", "value", "count", "hex", "BaseX", "base2", "base36", "base58", "base62", "base64", "base64url", "debounce", "delay", "action", "latestArgs", "timeout", "waitingQueue", "reset", "args", "promise", "resolve", "reject", "r", "err", "defer", "resolve", "reject", "promise", "res", "rej", "other", "microbounce", "fn", "scheduled", "params", "defer", "deferred", "deepClone", "data", "refs", "copy", "d", "key", "val", "isHappy", "x", "isNumber", "x", "isString", "isObject", "x", "isArray", "happy", "x", "sad", "is", "deepEqual", "alpha", "bravo", "recurse", "parents", "isObject", "newParents", "key", "val", "item", "bItem", "keys1", "keys2", "deepFreeze", "item", "recurse", "x", "parents", "isObject", "newParents", "arr", "y", "gotOk", "result", "error", "gotErr", "encoder", "mix32", "x", "string32", "text", "hash", "byte", "encoder", "hash32", "values", "value", "u32", "got", "thing", "err", "guarantee", "map", "key", "make", "value", "setEntries", "entries", "arraylimit", "array", "limit", "collect", "iterable", "array", "item", "cycle", "fn", "timeout", "stopped", "stop", "tick", "disposer", "fns", "dispose", "doomed", "i", "d", "newFns", "x", "fn", "ev", "target", "fns", "entries", "name", "fn", "IdCounter", "count", "nap", "milliseconds", "resolve", "obmap", "o", "transform", "key", "value", "obfilter", "predicate", "ob", "obMap", "obFilter", "subby", "fn", "tools", "mk", "mk", "set", "waiter", "next", "defer", "resolveWaiter", "p", "ready", "fn", "templateString", "strings", "values", "lastIndex", "a", "b", "c", "when", "x", "yes", "no", "given", "isHappy", "Tracker", "#busy", "#observationLayers", "#subscriptions", "#batchDepth", "#batchPending", "item", "fns", "fn", "#flush", "seen", "value", "guarantee", "#run", "pending", "tracker", "Tracker", "signal", "value", "on", "sig", "tracker", "fn", "subby", "RMap", "tracker", "callbackFn", "key", "value", "ret", "RSet", "tracker", "callbackFn", "value", "item", "ret", "batch", "tracker", "immute", "s", "deepFreeze", "deepClone", "_optic", "CacheCell", "#dirty", "#value", "calculate", "Lens", "_Lens", "_optic", "#previous", "#stateCache", "#frozenCache", "#on", "subby", "optic", "deepClone", "CacheCell", "immute", "state", "deepEqual", "tracker", "fn", "selector", "lens", "waitGot", "wait", "gotOk", "waitGotErr", "wait", "gotErr", "isWaitPending", "state", "isWaitOk", "state", "waitSelect", "state", "select", "pending", "ok", "err", "isWaitPending", "isWaitOk", "waitGot", "waitGotErr", "hasFiles", "event", "files", "outsideCurrentTarget", "currentTarget", "relatedTarget", "DragAndDrops", "signal", "params", "getDraggy", "_", "getDroppy", "event", "outsideCurrentTarget", "acceptDrop", "draggy", "droppy", "Drops", "signal", "params", "event", "outsideCurrentTarget", "cssReset", "i", "SlyShadow", "_SlyShadow", "dom", "LightCx", "defer", "render", "ShadowCx", "host", "shadow", "Hooks", "#scopes", "scope", "position", "fn", "hooks", "Reactivity", "#stoppers", "stop", "fn", "rerender", "seen", "value", "tracker", "item", "Mounts", "#mounters", "#unmounters", "mount", "unmount", "Hookscope", "Mounts", "cx", "_ChildPart", "ChildPart", "_$LH", "isSingleExpression", "part", "strings", "PartType", "ATTRIBUTE", "CHILD", "PROPERTY", "BOOLEAN_ATTRIBUTE", "EVENT", "ELEMENT", "directive", "c", "values", "_$litDirective$", "Directive", "_partInfo", "_$isConnected", "this", "_$parent", "part", "parent", "attributeIndex", "__part", "__attributeIndex", "props", "update", "_part", "render", "notifyChildrenConnectedChanged", "parent", "isConnected", "children", "_$disconnectableChildren", "obj", "removeDisconnectableFromParent", "_$parent", "delete", "size", "addDisconnectableToParent", "Set", "has", "add", "installDisconnectAPI", "reparentDisconnectables", "newParent", "this", "notifyChildPartConnectedChanged", "isClearingValue", "fromPartIndex", "value", "_$committedValue", "Array", "isArray", "i", "length", "type", "PartType", "CHILD", "_$notifyConnectionChanged", "_$reparentDisconnectables", "AsyncDirective", "Directive", "constructor", "part", "attributeIndex", "super", "_$initialize", "_$isConnected", "isClearingDirective", "reconnected", "disconnected", "isSingleExpression", "__part", "_$setValue", "newValues", "__attributeIndex", "lightView", "view", "e", "f", "#props", "#cx", "LightCx", "microbounce", "content", "#hookscope", "Hookscope", "#reactivity", "Reactivity", "part", "props", "ret", "hooks", "applyAttrs", "element", "attrs", "name", "value", "applyAttr", "existing", "v", "coerce", "shadowSetup", "SlyShadow", "host", "shadow", "shadowView", "view", "rawShadow", "setup", "directiveFn", "e", "f", "#cx", "#hookscope", "#props", "#reactivity", "Reactivity", "part", "rerender", "microbounce", "content", "#renderContent", "D", "ShadowCx", "Hookscope", "props", "hooks", "children", "attrs", "applyAttrs", "shadowElement", "view", "#cx", "#hookscope", "#reactivity", "Reactivity", "#shadow", "rerender", "microbounce", "content", "#renderContent", "D", "ShadowCx", "Hookscope", "hooks", "shadowDuplex", "render", "shadowView", "p", "shadowElement", "useOnce", "fn", "scope", "position", "hooks", "guarantee", "useCx", "hooks", "useShadowCx", "cx", "useCx", "ShadowCx", "useHost", "useShadowCx", "useMount", "fn", "scope", "hooks", "useOnce", "useShadow", "useShadowCx", "applyStyles", "shadow", "styles", "S", "prepareStyles", "elementStyles", "set", "s", "c", "useCss", "styles", "shadow", "useShadow", "useOnce", "applyStyles", "useName", "name", "host", "useHost", "useOnce", "useSignal", "value", "useOnce", "signal", "useStyles", "useCss", "useUnmount", "fn", "useMount", "makeAsciiAnim", "hz", "frames", "AsciiAnim", "shadowView", "useName", "useStyles", "cssReset", "style", "$frame", "useSignal", "useMount", "cycle", "nap", "next", "i", "ErrorDisplay", "shadowView", "error", "useName", "useStyles", "cssReset", "style", "b", "i", "makeSpinner", "pending", "err", "wait", "ok", "waitSelect", "dotsSpinner", "makeSpinner", "makeAsciiAnim", "ErrorDisplay", "earthSpinner", "makeSpinner", "makeAsciiAnim", "ErrorDisplay", "moonSpinner", "makeSpinner", "makeAsciiAnim", "ErrorDisplay", "spinner", "makeSpinner", "makeAsciiAnim", "ErrorDisplay", "waveSpinner", "makeSpinner", "makeAsciiAnim", "ErrorDisplay", "asBindings", "bindings", "asDeck", "deck", "asPresets", "presets", "bindings", "asBindings", "presets", "asPresets", "idbRange", "start", "end", "isHappy", "idbWait", "request", "resolve", "reject", "idbTransactions", "db", "storeName", "setup", "mode", "fn", "tx", "store", "completed", "resolve", "reject", "result", "idbWait", "error", "IdbMagazine", "#tx", "idb", "idbTransactions", "ops", "store", "key", "value", "keys", "wait", "scan", "entries", "direction", "request", "idbRange", "cursor", "lexSort", "a", "b", "scanMatch", "key", "start", "end", "scanEntries", "scan", "entries", "matches", "key", "value", "scanMatch", "a", "b", "lexSort", "MemoryMagazine", "#map", "ops", "key", "value", "keys", "scan", "scanEntries", "idbOpen", "dbName", "storeName", "resolve", "reject", "request", "CellOperator", "#key", "#parent", "key", "parent", "value", "Cell", "kv", "key", "CellOperator", "value", "got", "consts", "deepFreeze", "prefixEnd", "prefix", "index", "code", "Subtree", "#magazine", "#scans", "magazine", "scopes", "pre", "consts", "divised", "delimited", "prefixEnd", "count", "scan", "_", "changes", "key", "Operator", "#prefixer", "prefixer", "key", "value", "divisor", "delimiter", "consts", "Prefixer", "#prefix", "#end", "options", "scopes", "prefixEnd", "key", "fullkey", "scan", "start", "end", "limit", "reverse", "validateScan", "scan", "limit", "validateScopes", "scopes", "scope", "forbidden", "illegal", "Kv", "_Kv", "#magazine", "#prefixer", "#preprocess", "#options", "magazine", "MemoryMagazine", "options", "validateScopes", "Prefixer", "Operator", "Subtree", "value", "key", "Cell", "scopes", "ops", "changes", "keys", "got", "values", "index", "scan", "validateScan", "key2", "count", "_", "consts", "encodeParcels", "parcels", "size", "total", "intents", "buffer", "view", "bytes", "cursor", "playerId", "encodeIntents", "hash", "intents", "byteCount", "buffer", "dv", "cursor", "intent", "isExpression", "b", "isString", "isNumber", "isArray", "hashBindings", "bindings", "paths", "recurse", "b", "path", "isExpression", "key", "value", "hash32", "Hub", "#hash", "#ids", "IdCounter", "#unassigned", "RSet", "#players", "RMap", "bindings", "hashBindings", "playerId", "port", "c", "controller", "got", "time", "intents", "controllers", "intent", "alpha", "changedIntents", "value", "id", "encodeIntents", "parcels", "encodeParcels", "getProfile", "data", "profileKey", "presets", "customs", "fallback", "got", "assignProfile", "controller", "kvs", "controllers", "assignments", "given", "handle", "isCompatible", "bindingsA", "bindingsB", "hashBindings", "Profiles", "#data", "data", "#ensureBindingsAreCompatible", "b", "isCompatible", "profileKey", "getProfile", "key", "profile", "kvs", "profiles", "basedOn", "label", "bindings", "assignments", "customs", "fallback", "controller", "controllerKey", "assignProfile", "changes", "staleProfile", "freshProfile", "makeControlsData", "options", "presets", "fallbackKey", "got", "fallbackProfile", "bindings", "kv", "hashBindings", "profiles", "RMap", "setEntries", "subby", "IdCounter", "Assignments", "#data", "data", "controller", "profileKey", "assignProfile", "assignments", "Controls", "#data", "options", "makeControlsData", "Profiles", "Assignments", "#rebind", "controller", "preferences", "assignments", "controllers", "meta", "got", "profileKey", "kvs", "customs", "setEntries", "collect", "id", "firstPreset", "presets", "key", "profile", "setupDeck", "params", "kv", "Kv", "IdbMagazine", "idbOpen", "broadcastChannel", "maxPlayers", "bindings", "firstPreset", "hub", "Hub", "controls", "Controls", "asDeck", "decodeIntents", "buffer", "intents", "dv", "cursor", "hash", "id", "value", "makeInput", "investigate", "bindings", "hash", "hashBindings", "inputList", "rootList", "makeInputs", "b", "isExpression", "input", "makeInput", "obmap", "inputs", "InputDecoder", "#investigation", "bindings", "investigate", "buffers", "inputs", "input", "buffer", "decoded", "decodeIntents", "id", "value", "decodeParcels", "buffer", "view", "parcels", "cursor", "playerId", "length", "intents", "Collector", "#bindings", "#decoders", "RMap", "bindings", "playerId", "decoder", "#getDecoder", "guarantee", "InputDecoder", "buffers", "grouped", "buffer", "intents", "decodeParcels", "limit", "Sampler", "#source", "#samples", "source", "sample", "arraylimit", "samples", "min", "max", "abs", "sign", "floor", "ceil", "pow", "clamp", "x", "a", "b", "min", "max", "lerp", "fraction", "from", "to", "maxDelta", "delta", "abs", "sign", "unlerp", "x", "a", "b", "remap", "a1", "a2", "b1", "b2", "clamping", "clamp", "Vec2", "_Vec2", "x", "y", "value", "v", "vectors", "vecs", "radians", "n", "epsilon", "dot", "magnitudes", "ratio", "clamp", "max", "fn", "result", "min", "a", "delta", "coefficient", "divisor", "fraction", "dx", "dy", "cos", "sin", "isDown", "value", "evaluate", "context", "expression", "isNumber", "isString", "latest", "peak", "s", "code", "x", "sample", "ups", "was", "isDown", "downs", "condition", "yes", "no", "isHappy", "p", "c", "first", "rest", "value", "neg", "min", "max", "expr", "a", "b", "d", "remap", "ms", "subexpression", "down", "held", "taps", "presses", "now", "tapped", "guarantee", "i", "arraylimit", "time", "modifiers", "shift", "ctrl", "alt", "meta", "Clock", "time", "EvaluationContext", "Clock", "Controller", "#sampler", "#bindings", "#investigation", "#context", "options", "deepFreeze", "investigate", "Sampler", "EvaluationContext", "b", "bindings", "fresh", "goodHash", "time", "samples", "code", "value", "id", "expression", "evaluate", "encodeIntents", "Pad", "get", "evergreen", "value", "fn", "cached", "next", "onPad", "fn", "known", "refresh", "addNew", "deleteOld", "gamepad", "get", "pad", "Pad", "evergreen", "dispose", "index", "unlisten", "ev", "PlainSource", "subby", "disposer", "GamepadSource", "PlainSource", "#values", "pad", "gamepad", "#pollButtons", "#pollAxes", "#publish", "code", "value", "previous", "any", "index", "button", "autoGamepads", "hub", "fn", "onPad", "pad", "source", "GamepadSource", "controller", "Controller", "dispose", "ellipsis", "s", "max", "Sources", "PlainSource", "#array", "sources", "source", "sample", "Visualizer", "signal", "debounce", "data", "hex", "mouseButton", "button", "PointerSource", "PlainSource", "Vec2", "target", "ev", "#listeners", "event", "mouseButton", "clientX", "clientY", "movementX", "movementY", "deltaX", "deltaY", "KeyboardSource", "PlainSource", "#down", "target", "ev", "#targetListeners", "#windowListeners", "event", "code", "coreString", "templateString", "varsString", "templateString", "renderVars", "renderVar", "name", "value", "varsObject", "resetString", "templateString", "themeString", "templateString", "varsString", "resetString", "coreString", "themeCss", "themeString", "TabsControl", "signal", "start", "index", "delta", "style_css_default", "i", "ShinyTabs", "shadow", "options", "useName", "useStyles", "themeCss", "style_css_default", "host", "useHost", "attrs", "useOnce", "dom", "control", "TabsControl", "$tabs", "useSignal", "$panels", "tabchange", "event", "slot", "panelchange", "isNeighborActive", "index", "delta", "nextIndex", "tab", "tabbed", "tabAttrs", "panel", "b", "style_css_default", "i", "theme_css_default", "i", "cssReset", "game_controller_svg_default", "w", "settings_horizontal_svg_default", "w", "style_css_default", "i", "person_add_svg_default", "w", "x_small_svg_default", "w", "DropcardView", "lightView", "o", "dnd", "dropzone", "b", "drag_vertical_fill_svg_default", "w", "hueify", "n", "ProfileSelectView", "lightView", "deck", "currentProfileKey", "onChange", "profiles", "handleChange", "event", "select", "b", "key", "profile", "ControllerView", "lightView", "context", "controller", "deck", "dnd", "controls", "dragzone", "currentProfileKey", "meta", "game_controller_svg_default", "style", "hueify", "b", "drag_vertical_fill_svg_default", "ProfileSelectView", "key", "PlayerView", "lightView", "context", "playerId", "index", "hub", "deletePlayer", "controllers", "DropcardView", "b", "when", "x_small_svg_default", "c", "ControllerView", "droppyNewPlayer", "ControllersView", "makeControllersElement", "shadowDuplex", "deck", "useCss", "theme_css_default", "style_css_default", "hub", "controllers", "clickCreatePlayer", "renderPlayer", "p", "i", "PlayerView", "context", "useOnce", "index_barrel_exports", "_event", "draggy", "droppy", "droppyNewPlayer", "isHappy", "b", "when", "DropcardView", "person_add_svg_default", "c", "ControllerView", "style_css_default", "i", "copy_svg_default", "w", "trash_can_svg_default", "w", "makeId", "hex", "key_cap_svg_default", "w", "backspace_svg_default", "w", "cross_svg_default", "w", "captureKeyChord", "update", "onDone", "held", "seen", "mod", "code", "stop", "ev", "halt", "event", "codes", "mods", "m", "captureGamepadChord", "update", "onDone", "dispose", "schedule", "disposer", "sourceSet", "held", "seen", "ev", "onPad", "pad", "source", "GamepadSource", "sample", "cycle", "nap", "capturePointerChord", "update", "onDone", "dispose", "schedule", "disposer", "held", "seen", "isControl", "event", "target", "ev", "code", "mouseButton", "RecorderView", "lightView", "isReadonly", "update", "reset", "content", "$recording", "useSignal", "removeRecording", "startRecording", "dispose", "schedule", "disposer", "captureKeyChord", "captureGamepadChord", "capturePointerChord", "haltRecording", "toggleRecording", "haltAndReset", "useUnmount", "b", "cross_svg_default", "key_cap_svg_default", "backspace_svg_default", "ExpressionView", "lightView", "isReadonly", "expression", "update", "isHappy", "b", "isNumber", "event", "value", "isString", "isArray", "x_small_svg_default", "e", "i", "fresh", "clone", "renderBindings", "isReadonly", "bindings", "original", "update", "isExpression", "ExpressionView", "key", "child", "renderExpression", "renderGroup", "b", "fresh", "up", "RecorderView", "CustomizeView", "makeCustomizeElement", "shadowDuplex", "options", "useCss", "theme_css_default", "style_css_default", "controls", "profiles", "$profileKey", "useSignal", "profile", "isReadonly", "baseline", "updateBindings", "bindings", "key", "basedOn", "freshKey", "makeId", "updateLabel", "profileKey", "label", "clone", "destroy", "b", "ProfileSelectView", "copy_svg_default", "trash_can_svg_default", "when", "given", "event", "input", "renderBindings", "DeckView", "makeDeckElement", "shadowDuplex", "deck", "useCss", "theme_css_default", "style_css_default", "attrs", "tabsControl", "useOnce", "TabsControl", "b", "ShinyTabs", "game_controller_svg_default", "settings_horizontal_svg_default", "ControllersView", "CustomizeView", "style_css_default", "i", "VisualizerView", "makeVisualizerElement", "shadowDuplex", "visualizer", "useCss", "theme_css_default", "style_css_default", "b", "devices_svg_default", "w", "setupTact", "params", "deck", "setupDeck", "first", "firstPreset", "collector", "Collector", "visualizer", "Visualizer", "elements", "makeDeckElement", "makeCustomizeElement", "makeControllersElement", "makeVisualizerElement", "gamepads", "defaultProfileKey", "autoGamepads", "controller", "source", "handle", "game_controller_svg_default", "ellipsis", "mouseKeyboard", "key", "profile", "Controller", "Sources", "KeyboardSource", "PointerSource", "devices_svg_default", "registerElements", "register", "tact", "setupTact", "presets", "cycle", "data", "nap", "input", "dom"]
|
|
3
|
+
"sources": ["../../node_modules/@e280/sly/s/dom/standalone/dashify.ts", "../../node_modules/@e280/sly/s/dom/standalone/register.ts", "../../node_modules/@lit/reactive-element/src/css-tag.ts", "../../node_modules/@lit/reactive-element/src/reactive-element.ts", "../../node_modules/lit-html/src/lit-html.ts", "../../node_modules/lit-element/src/lit-element.ts", "../../node_modules/@e280/sly/s/dom/attrs/parts/attr-fns.ts", "../../node_modules/@e280/sly/s/dom/parts/el.ts", "../../node_modules/@e280/sly/s/dom/parts/mk.ts", "../../node_modules/@e280/sly/s/dom/parts/eve.ts", "../../node_modules/@e280/sly/s/dom/attrs/parts/on-attrs.ts", "../../node_modules/@e280/sly/s/dom/attrs/parts/attr-proxies.ts", "../../node_modules/@e280/sly/s/dom/attrs/parts/attr-spec.ts", "../../node_modules/@e280/sly/s/dom/attrs/attrs.ts", "../../node_modules/@e280/sly/s/dom/parts/elmer.ts", "../../node_modules/@e280/sly/s/dom/parts/queries.ts", "../../node_modules/@e280/sly/s/dom/parts/dom-scope.ts", "../../node_modules/@e280/sly/s/dom/dom.ts", "../../node_modules/@e280/sly/s/loot/index.barrel.ts", "../../node_modules/@e280/stz/s/data/bytes.ts", "../../node_modules/@e280/stz/s/data/base-x.ts", "../../node_modules/@e280/stz/s/data/base-x-codecs.ts", "../../node_modules/@e280/stz/s/data/txt.ts", "../../node_modules/@e280/stz/s/debounce/debounce.ts", "../../node_modules/@e280/stz/s/defer.ts", "../../node_modules/@e280/stz/s/debounce/microbounce.ts", "../../node_modules/@e280/stz/s/deep/clone.ts", "../../node_modules/@e280/stz/s/is.ts", "../../node_modules/@e280/stz/s/deep/equal.ts", "../../node_modules/@e280/stz/s/deep/freeze.ts", "../../node_modules/@e280/stz/s/ok/fns/got.ts", "../../node_modules/@e280/stz/s/utensils/got.ts", "../../node_modules/@e280/stz/s/utensils/map.ts", "../../node_modules/@e280/stz/s/arraylimit.ts", "../../node_modules/@e280/stz/s/collect.ts", "../../node_modules/@e280/stz/s/cycle.ts", "../../node_modules/@e280/stz/s/data-view-from.ts", "../../node_modules/@e280/stz/s/disposer.ts", "../../node_modules/@e280/stz/s/ev.ts", "../../node_modules/@e280/stz/s/id-counter.ts", "../../node_modules/@e280/stz/s/nap.ts", "../../node_modules/@e280/stz/s/ob.ts", "../../node_modules/@e280/stz/s/subby.ts", "../../node_modules/@e280/stz/s/templating.ts", "../../node_modules/@e280/stz/s/when.ts", "../../node_modules/@e280/strata/s/tracker/tracker.ts", "../../node_modules/@e280/strata/s/tracker/global.ts", "../../node_modules/@e280/strata/s/signals/signal.ts", "../../node_modules/@e280/strata/s/signals/r/map.ts", "../../node_modules/@e280/strata/s/signals/r/set.ts", "../../node_modules/@e280/strata/s/signals/batch.ts", "../../node_modules/@e280/strata/s/prism/utils/immute.ts", "../../node_modules/@e280/strata/s/prism/utils/optic-symbol.ts", "../../node_modules/@e280/strata/s/prism/utils/cache-cell.ts", "../../node_modules/@e280/strata/s/prism/lens.ts", "../../node_modules/@e280/strata/s/wait/parts/get.ts", "../../node_modules/@e280/strata/s/wait/parts/is.ts", "../../node_modules/@e280/strata/s/wait/parts/select.ts", "../../node_modules/@e280/sly/s/loot/helpers.ts", "../../node_modules/@e280/sly/s/loot/drag-and-drops.ts", "../../node_modules/@e280/sly/s/loot/drops.ts", "../../node_modules/@e280/sly/s/view/common/css-reset.ts", "../../node_modules/@e280/sly/s/view/common/sly-shadow.ts", "../../node_modules/@e280/sly/s/view/parts/cx.ts", "../../node_modules/@e280/sly/s/view/hooks/plumbing/hooks.ts", "../../node_modules/@e280/sly/s/view/parts/reactivity.ts", "../../node_modules/@e280/sly/s/view/hooks/plumbing/mounts.ts", "../../node_modules/@e280/sly/s/view/hooks/plumbing/hookscope.ts", "../../node_modules/lit-html/src/directive-helpers.ts", "../../node_modules/lit-html/src/directive.ts", "../../node_modules/lit-html/src/async-directive.ts", "../../node_modules/@e280/sly/s/view/light.ts", "../../node_modules/@e280/sly/s/view/parts/apply-attrs.ts", "../../node_modules/@e280/sly/s/view/shadow.ts", "../../node_modules/@e280/sly/s/view/elements/shadow.ts", "../../node_modules/@e280/sly/s/view/duplex/shadow.ts", "../../node_modules/@e280/sly/s/view/hooks/use-once.ts", "../../node_modules/@e280/sly/s/view/hooks/plumbing/use-cx.ts", "../../node_modules/@e280/sly/s/view/hooks/plumbing/use-shadow-cx.ts", "../../node_modules/@e280/sly/s/view/hooks/use-host.ts", "../../node_modules/@e280/sly/s/view/hooks/use-mount.ts", "../../node_modules/@e280/sly/s/view/hooks/use-shadow.ts", "../../node_modules/@e280/sly/s/view/parts/apply-styles.ts", "../../node_modules/@e280/sly/s/view/hooks/use-css.ts", "../../node_modules/@e280/sly/s/view/hooks/use-name.ts", "../../node_modules/@e280/sly/s/view/hooks/use-signal.ts", "../../node_modules/@e280/sly/s/view/hooks/use-styles.ts", "../../node_modules/@e280/sly/s/view/hooks/use-unmount.ts", "../../node_modules/@e280/sly/s/spinner/parts/ascii-anim.ts", "../../node_modules/@e280/sly/s/spinner/parts/error-display.ts", "../../node_modules/@e280/sly/s/spinner/make-spinner.ts", "../../node_modules/@e280/sly/s/spinner/spinners/dots.ts", "../../node_modules/@e280/sly/s/spinner/spinners/earth.ts", "../../node_modules/@e280/sly/s/spinner/spinners/moon.ts", "../../node_modules/@e280/sly/s/spinner/spinners/spinner.ts", "../../node_modules/@e280/sly/s/spinner/spinners/wave.ts", "../../s/lib/input/types.ts", "../../s/lib/ui/deck/types.ts", "../../s/demo/presets.ts", "../../s/lib/input/data/intent/minihash.ts", "../../s/lib/input/data/parcel/encode.ts", "../../s/lib/input/data/intent/encode.ts", "../../node_modules/@awasm/noble/utils.js", "../../node_modules/@awasm/noble/hashes-abstract.js", "../../node_modules/@awasm/noble/constants.js", "../../node_modules/@awasm/noble/hashes.js", "../../node_modules/@awasm/noble/targets/js/blake3.js", "../../node_modules/@awasm/noble/targets/js/index.js", "../../s/lib/utils/hash.ts", "../../s/lib/input/investigate/is-expression.ts", "../../s/lib/input/investigate/hash-bindings.ts", "../../s/lib/ui/deck/hub.ts", "../../node_modules/@e280/kv/s/utils/idb/range.ts", "../../node_modules/@e280/kv/s/utils/idb/wait.ts", "../../node_modules/@e280/kv/s/utils/idb/transactions.ts", "../../node_modules/@e280/kv/s/magazines/idb.ts", "../../node_modules/@e280/kv/s/utils/lex-sort.ts", "../../node_modules/@e280/kv/s/utils/scan-match.ts", "../../node_modules/@e280/kv/s/utils/scan-entries.ts", "../../node_modules/@e280/kv/s/magazines/memory.ts", "../../node_modules/@e280/kv/s/utils/idb/open.ts", "../../node_modules/@e280/kv/s/utils/cell-operator.ts", "../../node_modules/@e280/kv/s/cell.ts", "../../node_modules/@e280/kv/s/consts.ts", "../../node_modules/@e280/kv/s/utils/prefix-end.ts", "../../node_modules/@e280/kv/s/utils/subtree.ts", "../../node_modules/@e280/kv/s/utils/operator.ts", "../../node_modules/@e280/kv/s/utils/prefixer.ts", "../../node_modules/@e280/kv/s/utils/validate-scan.ts", "../../node_modules/@e280/kv/s/utils/validate-scopes.ts", "../../node_modules/@e280/kv/s/kv.ts", "../../s/lib/ui/deck/setup/utils/kv.ts", "../../s/lib/ui/deck/controls/internal/fns.ts", "../../s/lib/input/investigate/is-compatible.ts", "../../s/lib/ui/deck/controls/internal/profiles.ts", "../../s/lib/ui/deck/controls/internal/data.ts", "../../s/lib/ui/deck/controls/internal/assignments.ts", "../../s/lib/ui/deck/controls/controls.ts", "../../s/lib/ui/deck/utils/first-preset.ts", "../../s/lib/ui/deck/setup/utils/broadcast-channel.ts", "../../s/lib/ui/deck/setup/deck.ts", "../../s/lib/input/utils/sampler.ts", "../../node_modules/@benev/math/s/core/basics.ts", "../../node_modules/@benev/math/s/core/vec2.ts", "../../s/lib/input/utils/is-down.ts", "../../s/lib/input/evaluate/evaluate.ts", "../../s/lib/input/utils/clock.ts", "../../s/lib/input/evaluate/context.ts", "../../s/lib/input/investigate/make-input.ts", "../../s/lib/input/investigate/investigate.ts", "../../s/lib/input/controller.ts", "../../s/lib/input/utils/pad/pad.ts", "../../s/lib/input/utils/evergreen.ts", "../../s/lib/input/utils/pad/on-pad.ts", "../../s/lib/input/sources/plain.ts", "../../s/lib/input/sources/gamepad.ts", "../../s/lib/ui/deck/auto-gamepads.ts", "../../s/lib/utils/ellipsis.ts", "../../s/lib/input/sources/sources.ts", "../../s/lib/ui/views/visualizer/visualizer.ts", "../../s/lib/input/utils/mouse-button.ts", "../../s/lib/input/sources/pointer.ts", "../../s/lib/input/sources/keyboard.ts", "../../node_modules/@e280/shiny/s/theme/parts/core.ts", "../../node_modules/@e280/shiny/s/theme/parts/vars.ts", "../../node_modules/@e280/shiny/s/theme/parts/reset.ts", "../../node_modules/@e280/shiny/s/theme/theme-string.ts", "../../node_modules/@e280/shiny/s/theme/theme.css.ts", "../../node_modules/@e280/shiny/s/views/tabs/control.ts", "../../node_modules/@e280/shiny/s/views/tabs/style.css.ts", "../../node_modules/@e280/shiny/s/views/tabs/view.ts", "../../s/lib/ui/views/deck/style.css.ts", "../../s/lib/ui/views/theme.css.ts", "../../s/lib/ui/icons/akar/game-controller.svg.ts", "../../s/lib/ui/icons/akar/settings-horizontal.svg.ts", "../../s/lib/ui/views/controllers/style.css.ts", "../../s/lib/ui/icons/akar/person-add.svg.ts", "../../s/lib/ui/icons/akar/x-small.svg.ts", "../../s/lib/ui/views/controllers/subviews/dropcard.ts", "../../s/lib/ui/icons/akar/drag-vertical-fill.svg.ts", "../../s/lib/utils/hueify.ts", "../../s/lib/ui/views/profile-select/view.ts", "../../s/lib/ui/views/controllers/subviews/controller.ts", "../../s/lib/ui/views/controllers/subviews/player.ts", "../../s/lib/ui/views/deck/types.ts", "../../s/lib/ui/views/controllers/view.ts", "../../s/lib/ui/views/customize/style.css.ts", "../../s/lib/ui/icons/akar/copy.svg.ts", "../../s/lib/ui/icons/akar/trash-can.svg.ts", "../../s/lib/utils/make-id.ts", "../../s/lib/ui/icons/akar/key-cap.svg.ts", "../../s/lib/ui/icons/akar/backspace.svg.ts", "../../s/lib/ui/icons/akar/cross.svg.ts", "../../s/lib/ui/views/customize/parts/capture-key-chord.ts", "../../s/lib/ui/views/customize/parts/capture-gamepad-chord.ts", "../../s/lib/ui/views/customize/parts/capture-pointer-chord.ts", "../../s/lib/ui/views/customize/subviews/recorder.ts", "../../s/lib/ui/views/customize/subviews/expression.ts", "../../s/lib/ui/views/customize/parts/render-bindings.ts", "../../s/lib/ui/views/customize/view.ts", "../../s/lib/ui/views/deck/view.ts", "../../s/lib/ui/views/visualizer/style.css.ts", "../../s/lib/ui/views/visualizer/view.ts", "../../s/lib/ui/icons/akar/devices.svg.ts", "../../s/lib/ui/deck/setup/tact.ts", "../../s/demo/main.bundle.ts"],
|
|
4
|
+
"sourcesContent": ["\n/** convert \"CamelCaseName\" into \"camel-case-name\". */\nexport function dashify(camel: string) {\n\treturn camel.replace(/([a-zA-Z])(?=[A-Z])/g, '$1-').toLowerCase()\n}\n\n", "\nimport {dashify} from \"./dashify.js\"\n\ntype HTMLElementClasses = {\n\t[key: string]: {new(...args: any[]): HTMLElement}\n}\n\n/** register custom elements to the dom, with dashified names. */\nexport function register<E extends HTMLElementClasses>(elements: E, options: {\n\n\t\t/** true to do nothing if the element is already defined. otherwise, throw error. default false. */\n\t\tsoft?: boolean\n\n\t\t/** true to run `customElements.upgrade` on already-placed elements. default true. */\n\t\tupgrade?: boolean\n\n\t} = {}) {\n\n\tconst {soft = false, upgrade = true} = options\n\n\tfor (const [name, Element] of Object.entries(elements)) {\n\t\tconst tag = dashify(name)\n\t\tconst already = customElements.get(tag)\n\n\t\tif (soft && already)\n\t\t\tcontinue\n\n\t\tcustomElements.define(tag, Element)\n\n\t\tif (upgrade)\n\t\t\tdocument.querySelectorAll(tag).forEach(element => {\n\t\t\t\tif (element.constructor === HTMLElement)\n\t\t\t\t\tcustomElements.upgrade(element)\n\t\t\t})\n\t}\n}\n\n", "/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nconst NODE_MODE = false;\n\n// Allows minifiers to rename references to globalThis\nconst global = globalThis;\n\n/**\n * Whether the current browser supports `adoptedStyleSheets`.\n */\nexport const supportsAdoptingStyleSheets: boolean =\n global.ShadowRoot &&\n (global.ShadyCSS === undefined || global.ShadyCSS.nativeShadow) &&\n 'adoptedStyleSheets' in Document.prototype &&\n 'replace' in CSSStyleSheet.prototype;\n\n/**\n * A CSSResult or native CSSStyleSheet.\n *\n * In browsers that support constructible CSS style sheets, CSSStyleSheet\n * object can be used for styling along side CSSResult from the `css`\n * template tag.\n */\nexport type CSSResultOrNative = CSSResult | CSSStyleSheet;\n\nexport type CSSResultArray = Array<CSSResultOrNative | CSSResultArray>;\n\n/**\n * A single CSSResult, CSSStyleSheet, or an array or nested arrays of those.\n */\nexport type CSSResultGroup = CSSResultOrNative | CSSResultArray;\n\nconst constructionToken = Symbol();\n\nconst cssTagCache = new WeakMap<TemplateStringsArray, CSSStyleSheet>();\n\n/**\n * A container for a string of CSS text, that may be used to create a CSSStyleSheet.\n *\n * CSSResult is the return value of `css`-tagged template literals and\n * `unsafeCSS()`. In order to ensure that CSSResults are only created via the\n * `css` tag and `unsafeCSS()`, CSSResult cannot be constructed directly.\n */\nexport class CSSResult {\n // This property needs to remain unminified.\n ['_$cssResult$'] = true;\n readonly cssText: string;\n private _styleSheet?: CSSStyleSheet;\n private _strings: TemplateStringsArray | undefined;\n\n private constructor(\n cssText: string,\n strings: TemplateStringsArray | undefined,\n safeToken: symbol\n ) {\n if (safeToken !== constructionToken) {\n throw new Error(\n 'CSSResult is not constructable. Use `unsafeCSS` or `css` instead.'\n );\n }\n this.cssText = cssText;\n this._strings = strings;\n }\n\n // This is a getter so that it's lazy. In practice, this means stylesheets\n // are not created until the first element instance is made.\n get styleSheet(): CSSStyleSheet | undefined {\n // If `supportsAdoptingStyleSheets` is true then we assume CSSStyleSheet is\n // constructable.\n let styleSheet = this._styleSheet;\n const strings = this._strings;\n if (supportsAdoptingStyleSheets && styleSheet === undefined) {\n const cacheable = strings !== undefined && strings.length === 1;\n if (cacheable) {\n styleSheet = cssTagCache.get(strings);\n }\n if (styleSheet === undefined) {\n (this._styleSheet = styleSheet = new CSSStyleSheet()).replaceSync(\n this.cssText\n );\n if (cacheable) {\n cssTagCache.set(strings, styleSheet);\n }\n }\n }\n return styleSheet;\n }\n\n toString(): string {\n return this.cssText;\n }\n}\n\ntype ConstructableCSSResult = CSSResult & {\n new (\n cssText: string,\n strings: TemplateStringsArray | undefined,\n safeToken: symbol\n ): CSSResult;\n};\n\nconst textFromCSSResult = (value: CSSResultGroup | number) => {\n // This property needs to remain unminified.\n if ((value as CSSResult)['_$cssResult$'] === true) {\n return (value as CSSResult).cssText;\n } else if (typeof value === 'number') {\n return value;\n } else {\n throw new Error(\n `Value passed to 'css' function must be a 'css' function result: ` +\n `${value}. Use 'unsafeCSS' to pass non-literal values, but take care ` +\n `to ensure page security.`\n );\n }\n};\n\n/**\n * Wrap a value for interpolation in a {@linkcode css} tagged template literal.\n *\n * This is unsafe because untrusted CSS text can be used to phone home\n * or exfiltrate data to an attacker controlled site. Take care to only use\n * this with trusted input.\n */\nexport const unsafeCSS = (value: unknown) =>\n new (CSSResult as ConstructableCSSResult)(\n typeof value === 'string' ? value : String(value),\n undefined,\n constructionToken\n );\n\n/**\n * A template literal tag which can be used with LitElement's\n * {@linkcode LitElement.styles} property to set element styles.\n *\n * For security reasons, only literal string values and number may be used in\n * embedded expressions. To incorporate non-literal values {@linkcode unsafeCSS}\n * may be used inside an expression.\n */\nexport const css = (\n strings: TemplateStringsArray,\n ...values: (CSSResultGroup | number)[]\n): CSSResult => {\n const cssText =\n strings.length === 1\n ? strings[0]\n : values.reduce(\n (acc, v, idx) => acc + textFromCSSResult(v) + strings[idx + 1],\n strings[0]\n );\n return new (CSSResult as ConstructableCSSResult)(\n cssText,\n strings,\n constructionToken\n );\n};\n\n/**\n * Applies the given styles to a `shadowRoot`. When Shadow DOM is\n * available but `adoptedStyleSheets` is not, styles are appended to the\n * `shadowRoot` to [mimic the native feature](https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/adoptedStyleSheets).\n * Note, when shimming is used, any styles that are subsequently placed into\n * the shadowRoot should be placed *before* any shimmed adopted styles. This\n * will match spec behavior that gives adopted sheets precedence over styles in\n * shadowRoot.\n */\nexport const adoptStyles = (\n renderRoot: ShadowRoot,\n styles: Array<CSSResultOrNative>\n) => {\n if (supportsAdoptingStyleSheets) {\n (renderRoot as ShadowRoot).adoptedStyleSheets = styles.map((s) =>\n s instanceof CSSStyleSheet ? s : s.styleSheet!\n );\n } else {\n for (const s of styles) {\n const style = document.createElement('style');\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const nonce = (global as any)['litNonce'];\n if (nonce !== undefined) {\n style.setAttribute('nonce', nonce);\n }\n style.textContent = (s as CSSResult).cssText;\n renderRoot.appendChild(style);\n }\n }\n};\n\nconst cssResultFromStyleSheet = (sheet: CSSStyleSheet) => {\n let cssText = '';\n for (const rule of sheet.cssRules) {\n cssText += rule.cssText;\n }\n return unsafeCSS(cssText);\n};\n\nexport const getCompatibleStyle =\n supportsAdoptingStyleSheets ||\n (NODE_MODE && global.CSSStyleSheet === undefined)\n ? (s: CSSResultOrNative) => s\n : (s: CSSResultOrNative) =>\n s instanceof CSSStyleSheet ? cssResultFromStyleSheet(s) : s;\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Use this module if you want to create your own base class extending\n * {@link ReactiveElement}.\n * @packageDocumentation\n */\n\nimport {\n getCompatibleStyle,\n adoptStyles,\n CSSResultGroup,\n CSSResultOrNative,\n} from './css-tag.js';\nimport type {\n ReactiveController,\n ReactiveControllerHost,\n} from './reactive-controller.js';\n\n// In the Node build, this import will be injected by Rollup:\n// import {HTMLElement, customElements} from '@lit-labs/ssr-dom-shim';\n\nexport * from './css-tag.js';\nexport type {\n ReactiveController,\n ReactiveControllerHost,\n} from './reactive-controller.js';\n\n/**\n * Removes the `readonly` modifier from properties in the union K.\n *\n * This is a safer way to cast a value to a type with a mutable version of a\n * readonly field, than casting to an interface with the field re-declared\n * because it preserves the type of all the fields and warns on typos.\n */\ntype Mutable<T, K extends keyof T> = Omit<T, K> & {\n -readonly [P in keyof Pick<T, K>]: P extends K ? T[P] : never;\n};\n\n// TODO (justinfagnani): Add `hasOwn` here when we ship ES2022\nconst {\n is,\n defineProperty,\n getOwnPropertyDescriptor,\n getOwnPropertyNames,\n getOwnPropertySymbols,\n getPrototypeOf,\n} = Object;\n\nconst NODE_MODE = false;\n\n// Lets a minifier replace globalThis references with a minified name\nconst global = globalThis;\n\nif (NODE_MODE) {\n global.customElements ??= customElements;\n}\n\nconst DEV_MODE = true;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nconst trustedTypes = (global as unknown as {trustedTypes?: {emptyScript: ''}})\n .trustedTypes;\n\n// Temporary workaround for https://crbug.com/993268\n// Currently, any attribute starting with \"on\" is considered to be a\n// TrustedScript source. Such boolean attributes must be set to the equivalent\n// trusted emptyScript value.\nconst emptyStringForBooleanAttribute = trustedTypes\n ? (trustedTypes.emptyScript as unknown as '')\n : '';\n\nconst polyfillSupport = DEV_MODE\n ? global.reactiveElementPolyfillSupportDevMode\n : global.reactiveElementPolyfillSupport;\n\nif (DEV_MODE) {\n // Ensure warnings are issued only 1x, even if multiple versions of Lit\n // are loaded.\n global.litIssuedWarnings ??= new Set();\n\n /**\n * Issue a warning if we haven't already, based either on `code` or `warning`.\n * Warnings are disabled automatically only by `warning`; disabling via `code`\n * can be done by users.\n */\n issueWarning = (code: string, warning: string) => {\n warning += ` See https://lit.dev/msg/${code} for more information.`;\n if (\n !global.litIssuedWarnings!.has(warning) &&\n !global.litIssuedWarnings!.has(code)\n ) {\n console.warn(warning);\n global.litIssuedWarnings!.add(warning);\n }\n };\n\n queueMicrotask(() => {\n issueWarning(\n 'dev-mode',\n `Lit is in dev mode. Not recommended for production!`\n );\n\n // Issue polyfill support warning.\n if (global.ShadyDOM?.inUse && polyfillSupport === undefined) {\n issueWarning(\n 'polyfill-support-missing',\n `Shadow DOM is being polyfilled via \\`ShadyDOM\\` but ` +\n `the \\`polyfill-support\\` module has not been loaded.`\n );\n }\n });\n}\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace ReactiveUnstable {\n /**\n * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n * we will emit 'lit-debug' events to window, with live details about the update and render\n * lifecycle. These can be useful for writing debug tooling and visualizations.\n *\n * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n * making certain operations that are normally very cheap (like a no-op render) much slower,\n * because we must copy data and dispatch events.\n */\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace DebugLog {\n export type Entry = Update;\n export interface Update {\n kind: 'update';\n }\n }\n}\n\ninterface DebugLoggingWindow {\n // Even in dev mode, we generally don't want to emit these events, as that's\n // another level of cost, so only emit them when DEV_MODE is true _and_ when\n // window.emitLitDebugEvents is true.\n emitLitDebugLogEvents?: boolean;\n}\n\n/**\n * Useful for visualizing and logging insights into what the Lit template system is doing.\n *\n * Compiled out of prod mode builds.\n */\nconst debugLogEvent = DEV_MODE\n ? (event: ReactiveUnstable.DebugLog.Entry) => {\n const shouldEmit = (global as unknown as DebugLoggingWindow)\n .emitLitDebugLogEvents;\n if (!shouldEmit) {\n return;\n }\n global.dispatchEvent(\n new CustomEvent<ReactiveUnstable.DebugLog.Entry>('lit-debug', {\n detail: event,\n })\n );\n }\n : undefined;\n\n/*\n * When using Closure Compiler, JSCompiler_renameProperty(property, object) is\n * replaced at compile time by the munged name for object[property]. We cannot\n * alias this function, so we have to use a small shim that has the same\n * behavior when not compiling.\n */\n/*@__INLINE__*/\nconst JSCompiler_renameProperty = <P extends PropertyKey>(\n prop: P,\n _obj: unknown\n): P => prop;\n\n/**\n * Converts property values to and from attribute values.\n */\nexport interface ComplexAttributeConverter<Type = unknown, TypeHint = unknown> {\n /**\n * Called to convert an attribute value to a property\n * value.\n */\n fromAttribute?(value: string | null, type?: TypeHint): Type;\n\n /**\n * Called to convert a property value to an attribute\n * value.\n *\n * It returns unknown instead of string, to be compatible with\n * https://github.com/WICG/trusted-types (and similar efforts).\n */\n toAttribute?(value: Type, type?: TypeHint): unknown;\n}\n\ntype AttributeConverter<Type = unknown, TypeHint = unknown> =\n | ComplexAttributeConverter<Type>\n | ((value: string | null, type?: TypeHint) => Type);\n\n/**\n * Defines options for a property accessor.\n */\nexport interface PropertyDeclaration<Type = unknown, TypeHint = unknown> {\n /**\n * When set to `true`, indicates the property is internal private state. The\n * property should not be set by users. When using TypeScript, this property\n * should be marked as `private` or `protected`, and it is also a common\n * practice to use a leading `_` in the name. The property is not added to\n * `observedAttributes`.\n */\n readonly state?: boolean;\n\n /**\n * Indicates how and whether the property becomes an observed attribute.\n * If the value is `false`, the property is not added to `observedAttributes`.\n * If true or absent, the lowercased property name is observed (e.g. `fooBar`\n * becomes `foobar`). If a string, the string value is observed (e.g\n * `attribute: 'foo-bar'`).\n */\n readonly attribute?: boolean | string;\n\n /**\n * Indicates the type of the property. This is used only as a hint for the\n * `converter` to determine how to convert the attribute\n * to/from a property.\n */\n readonly type?: TypeHint;\n\n /**\n * Indicates how to convert the attribute to/from a property. If this value\n * is a function, it is used to convert the attribute value a the property\n * value. If it's an object, it can have keys for `fromAttribute` and\n * `toAttribute`. If no `toAttribute` function is provided and\n * `reflect` is set to `true`, the property value is set directly to the\n * attribute. A default `converter` is used if none is provided; it supports\n * `Boolean`, `String`, `Number`, `Object`, and `Array`. Note,\n * when a property changes and the converter is used to update the attribute,\n * the property is never updated again as a result of the attribute changing,\n * and vice versa.\n */\n readonly converter?: AttributeConverter<Type, TypeHint>;\n\n /**\n * Indicates if the property should reflect to an attribute.\n * If `true`, when the property is set, the attribute is set using the\n * attribute name determined according to the rules for the `attribute`\n * property option and the value of the property converted using the rules\n * from the `converter` property option.\n */\n readonly reflect?: boolean;\n\n /**\n * A function that indicates if a property should be considered changed when\n * it is set. The function should take the `newValue` and `oldValue` and\n * return `true` if an update should be requested.\n */\n hasChanged?(value: Type, oldValue: Type): boolean;\n\n /**\n * Indicates whether an accessor will be created for this property. By\n * default, an accessor will be generated for this property that requests an\n * update when set. If this flag is `true`, no accessor will be created, and\n * it will be the user's responsibility to call\n * `this.requestUpdate(propertyName, oldValue)` to request an update when\n * the property changes.\n */\n readonly noAccessor?: boolean;\n\n /**\n * Whether this property is wrapping accessors. This is set by `@property`\n * to control the initial value change and reflection logic.\n *\n * @internal\n */\n wrapped?: boolean;\n\n /**\n * When `true`, uses the initial value of the property as the default value,\n * which changes how attributes are handled:\n * - The initial value does *not* reflect, even if the `reflect` option is `true`.\n * Subsequent changes to the property will reflect, even if they are equal to the\n * default value.\n * - When the attribute is removed, the property is set to the default value\n * - The initial value will not trigger an old value in the `changedProperties` map\n * argument to update lifecycle methods.\n *\n * When set, properties must be initialized, either with a field initializer, or an\n * assignment in the constructor. Not initializing the property may lead to\n * improper handling of subsequent property assignments.\n *\n * While this behavior is opt-in, most properties that reflect to attributes should\n * use `useDefault: true` so that their initial values do not reflect.\n */\n useDefault?: boolean;\n}\n\n/**\n * Map of properties to PropertyDeclaration options. For each property an\n * accessor is made, and the property is processed according to the\n * PropertyDeclaration options.\n */\nexport interface PropertyDeclarations {\n readonly [key: string]: PropertyDeclaration;\n}\n\ntype PropertyDeclarationMap = Map<PropertyKey, PropertyDeclaration>;\n\ntype AttributeMap = Map<string, PropertyKey>;\n\n/**\n * A Map of property keys to values.\n *\n * Takes an optional type parameter T, which when specified as a non-any,\n * non-unknown type, will make the Map more strongly-typed, associating the map\n * keys with their corresponding value type on T.\n *\n * Use `PropertyValues<this>` when overriding ReactiveElement.update() and\n * other lifecycle methods in order to get stronger type-checking on keys\n * and values.\n */\n// This type is conditional so that if the parameter T is not specified, or\n// is `any`, the type will include `Map<PropertyKey, unknown>`. Since T is not\n// given in the uses of PropertyValues in this file, all uses here fallback to\n// meaning `Map<PropertyKey, unknown>`, but if a developer uses\n// `PropertyValues<this>` (or any other value for T) they will get a\n// strongly-typed Map type.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type PropertyValues<T = any> = T extends object\n ? PropertyValueMap<T>\n : Map<PropertyKey, unknown>;\n\n/**\n * Do not use, instead prefer {@linkcode PropertyValues}.\n */\n// This type must be exported such that JavaScript generated by the Google\n// Closure Compiler can import a type reference.\nexport interface PropertyValueMap<T> extends Map<PropertyKey, unknown> {\n get<K extends keyof T>(k: K): T[K] | undefined;\n set<K extends keyof T>(key: K, value: T[K]): this;\n has<K extends keyof T>(k: K): boolean;\n delete<K extends keyof T>(k: K): boolean;\n}\n\nexport const defaultConverter: ComplexAttributeConverter = {\n toAttribute(value: unknown, type?: unknown): unknown {\n switch (type) {\n case Boolean:\n value = value ? emptyStringForBooleanAttribute : null;\n break;\n case Object:\n case Array:\n // if the value is `null` or `undefined` pass this through\n // to allow removing/no change behavior.\n value = value == null ? value : JSON.stringify(value);\n break;\n }\n return value;\n },\n\n fromAttribute(value: string | null, type?: unknown) {\n let fromValue: unknown = value;\n switch (type) {\n case Boolean:\n fromValue = value !== null;\n break;\n case Number:\n fromValue = value === null ? null : Number(value);\n break;\n case Object:\n case Array:\n // Do *not* generate exception when invalid JSON is set as elements\n // don't normally complain on being mis-configured.\n // TODO(sorvell): Do generate exception in *dev mode*.\n try {\n // Assert to adhere to Bazel's \"must type assert JSON parse\" rule.\n fromValue = JSON.parse(value!) as unknown;\n } catch (e) {\n fromValue = null;\n }\n break;\n }\n return fromValue;\n },\n};\n\nexport interface HasChanged {\n (value: unknown, old: unknown): boolean;\n}\n\n/**\n * Change function that returns true if `value` is different from `oldValue`.\n * This method is used as the default for a property's `hasChanged` function.\n */\nexport const notEqual: HasChanged = (value: unknown, old: unknown): boolean =>\n !is(value, old);\n\nconst defaultPropertyDeclaration: PropertyDeclaration = {\n attribute: true,\n type: String,\n converter: defaultConverter,\n reflect: false,\n useDefault: false,\n hasChanged: notEqual,\n};\n\n/**\n * A string representing one of the supported dev mode warning categories.\n */\nexport type WarningKind =\n | 'change-in-update'\n | 'migration'\n | 'async-perform-update';\n\nexport type Initializer = (element: ReactiveElement) => void;\n\n// Temporary, until google3 is on TypeScript 5.2\ndeclare global {\n interface SymbolConstructor {\n readonly metadata: unique symbol;\n }\n}\n\n// Ensure metadata is enabled. TypeScript does not polyfill\n// Symbol.metadata, so we must ensure that it exists.\n(Symbol as {metadata: symbol}).metadata ??= Symbol('metadata');\n\ndeclare global {\n // This is public global API, do not change!\n // eslint-disable-next-line no-var\n var litPropertyMetadata: WeakMap<\n object,\n Map<PropertyKey, PropertyDeclaration>\n >;\n}\n\n// Map from a class's metadata object to property options\n// Note that we must use nullish-coalescing assignment so that we only use one\n// map even if we load multiple version of this module.\nglobal.litPropertyMetadata ??= new WeakMap<\n object,\n Map<PropertyKey, PropertyDeclaration>\n>();\n\n/**\n * Base element class which manages element properties and attributes. When\n * properties change, the `update` method is asynchronously called. This method\n * should be supplied by subclasses to render updates as desired.\n * @noInheritDoc\n */\nexport abstract class ReactiveElement\n // In the Node build, this `extends` clause will be substituted with\n // `(globalThis.HTMLElement ?? HTMLElement)`.\n //\n // This way, we will first prefer any global `HTMLElement` polyfill that the\n // user has assigned, and then fall back to the `HTMLElement` shim which has\n // been imported (see note at the top of this file about how this import is\n // generated by Rollup). Note that the `HTMLElement` variable has been\n // shadowed by this import, so it no longer refers to the global.\n extends HTMLElement\n implements ReactiveControllerHost\n{\n // Note: these are patched in only in DEV_MODE.\n /**\n * Read or set all the enabled warning categories for this class.\n *\n * This property is only used in development builds.\n *\n * @nocollapse\n * @category dev-mode\n */\n static enabledWarnings?: WarningKind[];\n\n /**\n * Enable the given warning category for this class.\n *\n * This method only exists in development builds, so it should be accessed\n * with a guard like:\n *\n * ```ts\n * // Enable for all ReactiveElement subclasses\n * ReactiveElement.enableWarning?.('migration');\n *\n * // Enable for only MyElement and subclasses\n * MyElement.enableWarning?.('migration');\n * ```\n *\n * @nocollapse\n * @category dev-mode\n */\n static enableWarning?: (warningKind: WarningKind) => void;\n\n /**\n * Disable the given warning category for this class.\n *\n * This method only exists in development builds, so it should be accessed\n * with a guard like:\n *\n * ```ts\n * // Disable for all ReactiveElement subclasses\n * ReactiveElement.disableWarning?.('migration');\n *\n * // Disable for only MyElement and subclasses\n * MyElement.disableWarning?.('migration');\n * ```\n *\n * @nocollapse\n * @category dev-mode\n */\n static disableWarning?: (warningKind: WarningKind) => void;\n\n /**\n * Adds an initializer function to the class that is called during instance\n * construction.\n *\n * This is useful for code that runs against a `ReactiveElement`\n * subclass, such as a decorator, that needs to do work for each\n * instance, such as setting up a `ReactiveController`.\n *\n * ```ts\n * const myDecorator = (target: typeof ReactiveElement, key: string) => {\n * target.addInitializer((instance: ReactiveElement) => {\n * // This is run during construction of the element\n * new MyController(instance);\n * });\n * }\n * ```\n *\n * Decorating a field will then cause each instance to run an initializer\n * that adds a controller:\n *\n * ```ts\n * class MyElement extends LitElement {\n * @myDecorator foo;\n * }\n * ```\n *\n * Initializers are stored per-constructor. Adding an initializer to a\n * subclass does not add it to a superclass. Since initializers are run in\n * constructors, initializers will run in order of the class hierarchy,\n * starting with superclasses and progressing to the instance's class.\n *\n * @nocollapse\n */\n static addInitializer(initializer: Initializer) {\n this.__prepare();\n (this._initializers ??= []).push(initializer);\n }\n\n static _initializers?: Initializer[];\n\n /*\n * Due to closure compiler ES6 compilation bugs, @nocollapse is required on\n * all static methods and properties with initializers. Reference:\n * - https://github.com/google/closure-compiler/issues/1776\n */\n\n /**\n * Maps attribute names to properties; for example `foobar` attribute to\n * `fooBar` property. Created lazily on user subclasses when finalizing the\n * class.\n * @nocollapse\n */\n private static __attributeToPropertyMap: AttributeMap;\n\n /**\n * Marks class as having been finalized, which includes creating properties\n * from `static properties`, but does *not* include all properties created\n * from decorators.\n * @nocollapse\n */\n protected static finalized: true | undefined;\n\n /**\n * Memoized list of all element properties, including any superclass\n * properties. Created lazily on user subclasses when finalizing the class.\n *\n * @nocollapse\n * @category properties\n */\n static elementProperties: PropertyDeclarationMap;\n\n /**\n * User-supplied object that maps property names to `PropertyDeclaration`\n * objects containing options for configuring reactive properties. When\n * a reactive property is set the element will update and render.\n *\n * By default properties are public fields, and as such, they should be\n * considered as primarily settable by element users, either via attribute or\n * the property itself.\n *\n * Generally, properties that are changed by the element should be private or\n * protected fields and should use the `state: true` option. Properties\n * marked as `state` do not reflect from the corresponding attribute\n *\n * However, sometimes element code does need to set a public property. This\n * should typically only be done in response to user interaction, and an event\n * should be fired informing the user; for example, a checkbox sets its\n * `checked` property when clicked and fires a `changed` event. Mutating\n * public properties should typically not be done for non-primitive (object or\n * array) properties. In other cases when an element needs to manage state, a\n * private property set with the `state: true` option should be used. When\n * needed, state properties can be initialized via public properties to\n * facilitate complex interactions.\n * @nocollapse\n * @category properties\n */\n static properties: PropertyDeclarations;\n\n /**\n * Memoized list of all element styles.\n * Created lazily on user subclasses when finalizing the class.\n * @nocollapse\n * @category styles\n */\n static elementStyles: Array<CSSResultOrNative> = [];\n\n /**\n * Array of styles to apply to the element. The styles should be defined\n * using the {@linkcode css} tag function, via constructible stylesheets, or\n * imported from native CSS module scripts.\n *\n * Note on Content Security Policy:\n *\n * Element styles are implemented with `<style>` tags when the browser doesn't\n * support adopted StyleSheets. To use such `<style>` tags with the style-src\n * CSP directive, the style-src value must either include 'unsafe-inline' or\n * `nonce-<base64-value>` with `<base64-value>` replaced be a server-generated\n * nonce.\n *\n * To provide a nonce to use on generated `<style>` elements, set\n * `window.litNonce` to a server-generated nonce in your page's HTML, before\n * loading application code:\n *\n * ```html\n * <script>\n * // Generated and unique per request:\n * window.litNonce = 'a1b2c3d4';\n * </script>\n * ```\n * @nocollapse\n * @category styles\n */\n static styles?: CSSResultGroup;\n\n /**\n * Returns a list of attributes corresponding to the registered properties.\n * @nocollapse\n * @category attributes\n */\n static get observedAttributes() {\n // Ensure we've created all properties\n this.finalize();\n // this.__attributeToPropertyMap is only undefined after finalize() in\n // ReactiveElement itself. ReactiveElement.observedAttributes is only\n // accessed with ReactiveElement as the receiver when a subclass or mixin\n // calls super.observedAttributes\n return (\n this.__attributeToPropertyMap && [...this.__attributeToPropertyMap.keys()]\n );\n }\n\n private __instanceProperties?: PropertyValues = undefined;\n\n /**\n * Creates a property accessor on the element prototype if one does not exist\n * and stores a {@linkcode PropertyDeclaration} for the property with the\n * given options. The property setter calls the property's `hasChanged`\n * property option or uses a strict identity check to determine whether or not\n * to request an update.\n *\n * This method may be overridden to customize properties; however,\n * when doing so, it's important to call `super.createProperty` to ensure\n * the property is setup correctly. This method calls\n * `getPropertyDescriptor` internally to get a descriptor to install.\n * To customize what properties do when they are get or set, override\n * `getPropertyDescriptor`. To customize the options for a property,\n * implement `createProperty` like this:\n *\n * ```ts\n * static createProperty(name, options) {\n * options = Object.assign(options, {myOption: true});\n * super.createProperty(name, options);\n * }\n * ```\n *\n * @nocollapse\n * @category properties\n */\n static createProperty(\n name: PropertyKey,\n options: PropertyDeclaration = defaultPropertyDeclaration\n ) {\n // If this is a state property, force the attribute to false.\n if (options.state) {\n (options as Mutable<PropertyDeclaration, 'attribute'>).attribute = false;\n }\n this.__prepare();\n // Whether this property is wrapping accessors.\n // Helps control the initial value change and reflection logic.\n if (this.prototype.hasOwnProperty(name)) {\n options = Object.create(options);\n options.wrapped = true;\n }\n this.elementProperties.set(name, options);\n if (!options.noAccessor) {\n const key = DEV_MODE\n ? // Use Symbol.for in dev mode to make it easier to maintain state\n // when doing HMR.\n Symbol.for(`${String(name)} (@property() cache)`)\n : Symbol();\n const descriptor = this.getPropertyDescriptor(name, key, options);\n if (descriptor !== undefined) {\n defineProperty(this.prototype, name, descriptor);\n }\n }\n }\n\n /**\n * Returns a property descriptor to be defined on the given named property.\n * If no descriptor is returned, the property will not become an accessor.\n * For example,\n *\n * ```ts\n * class MyElement extends LitElement {\n * static getPropertyDescriptor(name, key, options) {\n * const defaultDescriptor =\n * super.getPropertyDescriptor(name, key, options);\n * const setter = defaultDescriptor.set;\n * return {\n * get: defaultDescriptor.get,\n * set(value) {\n * setter.call(this, value);\n * // custom action.\n * },\n * configurable: true,\n * enumerable: true\n * }\n * }\n * }\n * ```\n *\n * @nocollapse\n * @category properties\n */\n protected static getPropertyDescriptor(\n name: PropertyKey,\n key: string | symbol,\n options: PropertyDeclaration\n ): PropertyDescriptor | undefined {\n const {get, set} = getOwnPropertyDescriptor(this.prototype, name) ?? {\n get(this: ReactiveElement) {\n return this[key as keyof typeof this];\n },\n set(this: ReactiveElement, v: unknown) {\n (this as unknown as Record<string | symbol, unknown>)[key] = v;\n },\n };\n if (DEV_MODE && get == null) {\n if ('value' in (getOwnPropertyDescriptor(this.prototype, name) ?? {})) {\n throw new Error(\n `Field ${JSON.stringify(String(name))} on ` +\n `${this.name} was declared as a reactive property ` +\n `but it's actually declared as a value on the prototype. ` +\n `Usually this is due to using @property or @state on a method.`\n );\n }\n issueWarning(\n 'reactive-property-without-getter',\n `Field ${JSON.stringify(String(name))} on ` +\n `${this.name} was declared as a reactive property ` +\n `but it does not have a getter. This will be an error in a ` +\n `future version of Lit.`\n );\n }\n return {\n get,\n set(this: ReactiveElement, value: unknown) {\n const oldValue = get?.call(this);\n set?.call(this, value);\n this.requestUpdate(name, oldValue, options);\n },\n configurable: true,\n enumerable: true,\n };\n }\n\n /**\n * Returns the property options associated with the given property.\n * These options are defined with a `PropertyDeclaration` via the `properties`\n * object or the `@property` decorator and are registered in\n * `createProperty(...)`.\n *\n * Note, this method should be considered \"final\" and not overridden. To\n * customize the options for a given property, override\n * {@linkcode createProperty}.\n *\n * @nocollapse\n * @final\n * @category properties\n */\n static getPropertyOptions(name: PropertyKey) {\n return this.elementProperties.get(name) ?? defaultPropertyDeclaration;\n }\n\n // Temporary, until google3 is on TypeScript 5.2\n declare static [Symbol.metadata]: object & Record<PropertyKey, unknown>;\n\n /**\n * Initializes static own properties of the class used in bookkeeping\n * for element properties, initializers, etc.\n *\n * Can be called multiple times by code that needs to ensure these\n * properties exist before using them.\n *\n * This method ensures the superclass is finalized so that inherited\n * property metadata can be copied down.\n * @nocollapse\n */\n private static __prepare() {\n if (\n this.hasOwnProperty(JSCompiler_renameProperty('elementProperties', this))\n ) {\n // Already prepared\n return;\n }\n // Finalize any superclasses\n const superCtor = getPrototypeOf(this) as typeof ReactiveElement;\n superCtor.finalize();\n\n // Create own set of initializers for this class if any exist on the\n // superclass and copy them down. Note, for a small perf boost, avoid\n // creating initializers unless needed.\n if (superCtor._initializers !== undefined) {\n this._initializers = [...superCtor._initializers];\n }\n // Initialize elementProperties from the superclass\n this.elementProperties = new Map(superCtor.elementProperties);\n }\n\n /**\n * Finishes setting up the class so that it's ready to be registered\n * as a custom element and instantiated.\n *\n * This method is called by the ReactiveElement.observedAttributes getter.\n * If you override the observedAttributes getter, you must either call\n * super.observedAttributes to trigger finalization, or call finalize()\n * yourself.\n *\n * @nocollapse\n */\n protected static finalize() {\n if (this.hasOwnProperty(JSCompiler_renameProperty('finalized', this))) {\n return;\n }\n this.finalized = true;\n this.__prepare();\n\n // Create properties from the static properties block:\n if (this.hasOwnProperty(JSCompiler_renameProperty('properties', this))) {\n const props = this.properties;\n const propKeys = [\n ...getOwnPropertyNames(props),\n ...getOwnPropertySymbols(props),\n ] as Array<keyof typeof props>;\n for (const p of propKeys) {\n this.createProperty(p, props[p]);\n }\n }\n\n // Create properties from standard decorator metadata:\n const metadata = this[Symbol.metadata];\n if (metadata !== null) {\n const properties = litPropertyMetadata.get(metadata);\n if (properties !== undefined) {\n for (const [p, options] of properties) {\n this.elementProperties.set(p, options);\n }\n }\n }\n\n // Create the attribute-to-property map\n this.__attributeToPropertyMap = new Map();\n for (const [p, options] of this.elementProperties) {\n const attr = this.__attributeNameForProperty(p, options);\n if (attr !== undefined) {\n this.__attributeToPropertyMap.set(attr, p);\n }\n }\n\n this.elementStyles = this.finalizeStyles(this.styles);\n\n if (DEV_MODE) {\n if (this.hasOwnProperty('createProperty')) {\n issueWarning(\n 'no-override-create-property',\n 'Overriding ReactiveElement.createProperty() is deprecated. ' +\n 'The override will not be called with standard decorators'\n );\n }\n if (this.hasOwnProperty('getPropertyDescriptor')) {\n issueWarning(\n 'no-override-get-property-descriptor',\n 'Overriding ReactiveElement.getPropertyDescriptor() is deprecated. ' +\n 'The override will not be called with standard decorators'\n );\n }\n }\n }\n\n /**\n * Options used when calling `attachShadow`. Set this property to customize\n * the options for the shadowRoot; for example, to create a closed\n * shadowRoot: `{mode: 'closed'}`.\n *\n * Note, these options are used in `createRenderRoot`. If this method\n * is customized, options should be respected if possible.\n * @nocollapse\n * @category rendering\n */\n static shadowRootOptions: ShadowRootInit = {mode: 'open'};\n\n /**\n * Takes the styles the user supplied via the `static styles` property and\n * returns the array of styles to apply to the element.\n * Override this method to integrate into a style management system.\n *\n * Styles are deduplicated preserving the _last_ instance in the list. This\n * is a performance optimization to avoid duplicated styles that can occur\n * especially when composing via subclassing. The last item is kept to try\n * to preserve the cascade order with the assumption that it's most important\n * that last added styles override previous styles.\n *\n * @nocollapse\n * @category styles\n */\n protected static finalizeStyles(\n styles?: CSSResultGroup\n ): Array<CSSResultOrNative> {\n const elementStyles = [];\n if (Array.isArray(styles)) {\n // Dedupe the flattened array in reverse order to preserve the last items.\n // Casting to Array<unknown> works around TS error that\n // appears to come from trying to flatten a type CSSResultArray.\n const set = new Set((styles as Array<unknown>).flat(Infinity).reverse());\n // Then preserve original order by adding the set items in reverse order.\n for (const s of set) {\n elementStyles.unshift(getCompatibleStyle(s as CSSResultOrNative));\n }\n } else if (styles !== undefined) {\n elementStyles.push(getCompatibleStyle(styles));\n }\n return elementStyles;\n }\n\n /**\n * Node or ShadowRoot into which element DOM should be rendered. Defaults\n * to an open shadowRoot.\n * @category rendering\n */\n readonly renderRoot!: HTMLElement | DocumentFragment;\n\n /**\n * Returns the property name for the given attribute `name`.\n * @nocollapse\n */\n private static __attributeNameForProperty(\n name: PropertyKey,\n options: PropertyDeclaration\n ) {\n const attribute = options.attribute;\n return attribute === false\n ? undefined\n : typeof attribute === 'string'\n ? attribute\n : typeof name === 'string'\n ? name.toLowerCase()\n : undefined;\n }\n\n // Initialize to an unresolved Promise so we can make sure the element has\n // connected before first update.\n private __updatePromise!: Promise<boolean>;\n\n /**\n * True if there is a pending update as a result of calling `requestUpdate()`.\n * Should only be read.\n * @category updates\n */\n isUpdatePending = false;\n\n /**\n * Is set to `true` after the first update. The element code cannot assume\n * that `renderRoot` exists before the element `hasUpdated`.\n * @category updates\n */\n hasUpdated = false;\n\n /**\n * Map with keys for any properties that have changed since the last\n * update cycle with previous values.\n *\n * @internal\n */\n _$changedProperties!: PropertyValues;\n\n /**\n * Records property default values when the\n * `useDefault` option is used.\n */\n private __defaultValues?: Map<PropertyKey, unknown>;\n\n /**\n * Properties that should be reflected when updated.\n */\n private __reflectingProperties?: Set<PropertyKey>;\n\n /**\n * Name of currently reflecting property\n */\n private __reflectingProperty: PropertyKey | null = null;\n\n /**\n * Set of controllers.\n */\n private __controllers?: Set<ReactiveController>;\n\n constructor() {\n super();\n this.__initialize();\n }\n\n /**\n * Internal only override point for customizing work done when elements\n * are constructed.\n */\n private __initialize() {\n this.__updatePromise = new Promise<boolean>(\n (res) => (this.enableUpdating = res)\n );\n this._$changedProperties = new Map();\n // This enqueues a microtask that must run before the first update, so it\n // must be called before requestUpdate()\n this.__saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this.requestUpdate();\n (this.constructor as typeof ReactiveElement)._initializers?.forEach((i) =>\n i(this)\n );\n }\n\n /**\n * Registers a `ReactiveController` to participate in the element's reactive\n * update cycle. The element automatically calls into any registered\n * controllers during its lifecycle callbacks.\n *\n * If the element is connected when `addController()` is called, the\n * controller's `hostConnected()` callback will be immediately called.\n * @category controllers\n */\n addController(controller: ReactiveController) {\n (this.__controllers ??= new Set()).add(controller);\n // If a controller is added after the element has been connected,\n // call hostConnected. Note, re-using existence of `renderRoot` here\n // (which is set in connectedCallback) to avoid the need to track a\n // first connected state.\n if (this.renderRoot !== undefined && this.isConnected) {\n controller.hostConnected?.();\n }\n }\n\n /**\n * Removes a `ReactiveController` from the element.\n * @category controllers\n */\n removeController(controller: ReactiveController) {\n this.__controllers?.delete(controller);\n }\n\n /**\n * Fixes any properties set on the instance before upgrade time.\n * Otherwise these would shadow the accessor and break these properties.\n * The properties are stored in a Map which is played back after the\n * constructor runs.\n */\n private __saveInstanceProperties() {\n const instanceProperties = new Map<PropertyKey, unknown>();\n const elementProperties = (this.constructor as typeof ReactiveElement)\n .elementProperties;\n for (const p of elementProperties.keys() as IterableIterator<keyof this>) {\n if (this.hasOwnProperty(p)) {\n instanceProperties.set(p, this[p]);\n delete this[p];\n }\n }\n if (instanceProperties.size > 0) {\n this.__instanceProperties = instanceProperties;\n }\n }\n\n /**\n * Returns the node into which the element should render and by default\n * creates and returns an open shadowRoot. Implement to customize where the\n * element's DOM is rendered. For example, to render into the element's\n * childNodes, return `this`.\n *\n * @return Returns a node into which to render.\n * @category rendering\n */\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n const renderRoot =\n this.shadowRoot ??\n this.attachShadow(\n (this.constructor as typeof ReactiveElement).shadowRootOptions\n );\n adoptStyles(\n renderRoot,\n (this.constructor as typeof ReactiveElement).elementStyles\n );\n return renderRoot;\n }\n\n /**\n * On first connection, creates the element's renderRoot, sets up\n * element styling, and enables updating.\n * @category lifecycle\n */\n connectedCallback() {\n // Create renderRoot before controllers `hostConnected`\n (this as Mutable<typeof this, 'renderRoot'>).renderRoot ??=\n this.createRenderRoot();\n this.enableUpdating(true);\n this.__controllers?.forEach((c) => c.hostConnected?.());\n }\n\n /**\n * Note, this method should be considered final and not overridden. It is\n * overridden on the element instance with a function that triggers the first\n * update.\n * @category updates\n */\n protected enableUpdating(_requestedUpdate: boolean) {}\n\n /**\n * Allows for `super.disconnectedCallback()` in extensions while\n * reserving the possibility of making non-breaking feature additions\n * when disconnecting at some point in the future.\n * @category lifecycle\n */\n disconnectedCallback() {\n this.__controllers?.forEach((c) => c.hostDisconnected?.());\n }\n\n /**\n * Synchronizes property values when attributes change.\n *\n * Specifically, when an attribute is set, the corresponding property is set.\n * You should rarely need to implement this callback. If this method is\n * overridden, `super.attributeChangedCallback(name, _old, value)` must be\n * called.\n *\n * See [responding to attribute changes](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#responding_to_attribute_changes)\n * on MDN for more information about the `attributeChangedCallback`.\n * @category attributes\n */\n attributeChangedCallback(\n name: string,\n _old: string | null,\n value: string | null\n ) {\n this._$attributeToProperty(name, value);\n }\n\n private __propertyToAttribute(name: PropertyKey, value: unknown) {\n const elemProperties: PropertyDeclarationMap = (\n this.constructor as typeof ReactiveElement\n ).elementProperties;\n const options = elemProperties.get(name)!;\n const attr = (\n this.constructor as typeof ReactiveElement\n ).__attributeNameForProperty(name, options);\n if (attr !== undefined && options.reflect === true) {\n const converter =\n (options.converter as ComplexAttributeConverter)?.toAttribute !==\n undefined\n ? (options.converter as ComplexAttributeConverter)\n : defaultConverter;\n const attrValue = converter.toAttribute!(value, options.type);\n if (\n DEV_MODE &&\n (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n 'migration'\n ) &&\n attrValue === undefined\n ) {\n issueWarning(\n 'undefined-attribute-value',\n `The attribute value for the ${name as string} property is ` +\n `undefined on element ${this.localName}. The attribute will be ` +\n `removed, but in the previous version of \\`ReactiveElement\\`, ` +\n `the attribute would not have changed.`\n );\n }\n // Track if the property is being reflected to avoid\n // setting the property again via `attributeChangedCallback`. Note:\n // 1. this takes advantage of the fact that the callback is synchronous.\n // 2. will behave incorrectly if multiple attributes are in the reaction\n // stack at time of calling. However, since we process attributes\n // in `update` this should not be possible (or an extreme corner case\n // that we'd like to discover).\n // mark state reflecting\n this.__reflectingProperty = name;\n if (attrValue == null) {\n this.removeAttribute(attr);\n } else {\n this.setAttribute(attr, attrValue as string);\n }\n // mark state not reflecting\n this.__reflectingProperty = null;\n }\n }\n\n /** @internal */\n _$attributeToProperty(name: string, value: string | null) {\n const ctor = this.constructor as typeof ReactiveElement;\n // Note, hint this as an `AttributeMap` so closure clearly understands\n // the type; it has issues with tracking types through statics\n const propName = (ctor.__attributeToPropertyMap as AttributeMap).get(name);\n // Use tracking info to avoid reflecting a property value to an attribute\n // if it was just set because the attribute changed.\n if (propName !== undefined && this.__reflectingProperty !== propName) {\n const options = ctor.getPropertyOptions(propName);\n const converter =\n typeof options.converter === 'function'\n ? {fromAttribute: options.converter}\n : options.converter?.fromAttribute !== undefined\n ? options.converter\n : defaultConverter;\n // mark state reflecting\n this.__reflectingProperty = propName;\n const convertedValue = converter.fromAttribute!(value, options.type);\n this[propName as keyof this] =\n convertedValue ??\n this.__defaultValues?.get(propName) ??\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (convertedValue as any);\n // mark state not reflecting\n this.__reflectingProperty = null;\n }\n }\n\n /**\n * Requests an update which is processed asynchronously. This should be called\n * when an element should update based on some state not triggered by setting\n * a reactive property. In this case, pass no arguments. It should also be\n * called when manually implementing a property setter. In this case, pass the\n * property `name` and `oldValue` to ensure that any configured property\n * options are honored.\n *\n * @param name name of requesting property\n * @param oldValue old value of requesting property\n * @param options property options to use instead of the previously\n * configured options\n * @param useNewValue if true, the newValue argument is used instead of\n * reading the property value. This is important to use if the reactive\n * property is a standard private accessor, as opposed to a plain\n * property, since private members can't be dynamically read by name.\n * @param newValue the new value of the property. This is only used if\n * `useNewValue` is true.\n * @category updates\n */\n requestUpdate(\n name?: PropertyKey,\n oldValue?: unknown,\n options?: PropertyDeclaration,\n useNewValue = false,\n newValue?: unknown\n ): void {\n // If we have a property key, perform property update steps.\n if (name !== undefined) {\n if (DEV_MODE && (name as unknown) instanceof Event) {\n issueWarning(\n ``,\n `The requestUpdate() method was called with an Event as the property name. This is probably a mistake caused by binding this.requestUpdate as an event listener. Instead bind a function that will call it with no arguments: () => this.requestUpdate()`\n );\n }\n const ctor = this.constructor as typeof ReactiveElement;\n if (useNewValue === false) {\n newValue = this[name as keyof this];\n }\n options ??= ctor.getPropertyOptions(name);\n const changed =\n (options.hasChanged ?? notEqual)(newValue, oldValue) ||\n // When there is no change, check a corner case that can occur when\n // 1. there's a initial value which was not reflected\n // 2. the property is subsequently set to this value.\n // For example, `prop: {useDefault: true, reflect: true}`\n // and el.prop = 'foo'. This should be considered a change if the\n // attribute is not set because we will now reflect the property to the attribute.\n (options.useDefault &&\n options.reflect &&\n newValue === this.__defaultValues?.get(name) &&\n !this.hasAttribute(ctor.__attributeNameForProperty(name, options)!));\n if (changed) {\n this._$changeProperty(name, oldValue, options);\n } else {\n // Abort the request if the property should not be considered changed.\n return;\n }\n }\n if (this.isUpdatePending === false) {\n this.__updatePromise = this.__enqueueUpdate();\n }\n }\n\n /**\n * @internal\n */\n _$changeProperty(\n name: PropertyKey,\n oldValue: unknown,\n {useDefault, reflect, wrapped}: PropertyDeclaration,\n initializeValue?: unknown\n ) {\n // Record default value when useDefault is used. This allows us to\n // restore this value when the attribute is removed.\n if (useDefault && !(this.__defaultValues ??= new Map()).has(name)) {\n this.__defaultValues.set(\n name,\n initializeValue ?? oldValue ?? this[name as keyof this]\n );\n // if this is not wrapping an accessor, it must be an initial setting\n // and in this case we do not want to record the change or reflect.\n if (wrapped !== true || initializeValue !== undefined) {\n return;\n }\n }\n // TODO (justinfagnani): Create a benchmark of Map.has() + Map.set(\n // vs just Map.set()\n if (!this._$changedProperties.has(name)) {\n // On the initial change, the old value should be `undefined`, except\n // with `useDefault`\n if (!this.hasUpdated && !useDefault) {\n oldValue = undefined;\n }\n this._$changedProperties.set(name, oldValue);\n }\n // Add to reflecting properties set.\n // Note, it's important that every change has a chance to add the\n // property to `__reflectingProperties`. This ensures setting\n // attribute + property reflects correctly.\n if (reflect === true && this.__reflectingProperty !== name) {\n (this.__reflectingProperties ??= new Set<PropertyKey>()).add(name);\n }\n }\n\n /**\n * Sets up the element to asynchronously update.\n */\n private async __enqueueUpdate() {\n this.isUpdatePending = true;\n try {\n // Ensure any previous update has resolved before updating.\n // This `await` also ensures that property changes are batched.\n await this.__updatePromise;\n } catch (e) {\n // Refire any previous errors async so they do not disrupt the update\n // cycle. Errors are refired so developers have a chance to observe\n // them, and this can be done by implementing\n // `window.onunhandledrejection`.\n Promise.reject(e);\n }\n const result = this.scheduleUpdate();\n // If `scheduleUpdate` returns a Promise, we await it. This is done to\n // enable coordinating updates with a scheduler. Note, the result is\n // checked to avoid delaying an additional microtask unless we need to.\n if (result != null) {\n await result;\n }\n return !this.isUpdatePending;\n }\n\n /**\n * Schedules an element update. You can override this method to change the\n * timing of updates by returning a Promise. The update will await the\n * returned Promise, and you should resolve the Promise to allow the update\n * to proceed. If this method is overridden, `super.scheduleUpdate()`\n * must be called.\n *\n * For instance, to schedule updates to occur just before the next frame:\n *\n * ```ts\n * override protected async scheduleUpdate(): Promise<unknown> {\n * await new Promise((resolve) => requestAnimationFrame(() => resolve()));\n * super.scheduleUpdate();\n * }\n * ```\n * @category updates\n */\n protected scheduleUpdate(): void | Promise<unknown> {\n const result = this.performUpdate();\n if (\n DEV_MODE &&\n (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n 'async-perform-update'\n ) &&\n typeof (result as unknown as Promise<unknown> | undefined)?.then ===\n 'function'\n ) {\n issueWarning(\n 'async-perform-update',\n `Element ${this.localName} returned a Promise from performUpdate(). ` +\n `This behavior is deprecated and will be removed in a future ` +\n `version of ReactiveElement.`\n );\n }\n return result;\n }\n\n /**\n * Performs an element update. Note, if an exception is thrown during the\n * update, `firstUpdated` and `updated` will not be called.\n *\n * Call `performUpdate()` to immediately process a pending update. This should\n * generally not be needed, but it can be done in rare cases when you need to\n * update synchronously.\n *\n * @category updates\n */\n protected performUpdate(): void {\n // Abort any update if one is not pending when this is called.\n // This can happen if `performUpdate` is called early to \"flush\"\n // the update.\n if (!this.isUpdatePending) {\n return;\n }\n debugLogEvent?.({kind: 'update'});\n if (!this.hasUpdated) {\n // Create renderRoot before first update. This occurs in `connectedCallback`\n // but is done here to support out of tree calls to `enableUpdating`/`performUpdate`.\n (this as Mutable<typeof this, 'renderRoot'>).renderRoot ??=\n this.createRenderRoot();\n if (DEV_MODE) {\n // Produce warning if any reactive properties on the prototype are\n // shadowed by class fields. Instance fields set before upgrade are\n // deleted by this point, so any own property is caused by class field\n // initialization in the constructor.\n const ctor = this.constructor as typeof ReactiveElement;\n const shadowedProperties = [...ctor.elementProperties.keys()].filter(\n (p) => this.hasOwnProperty(p) && p in getPrototypeOf(this)\n );\n if (shadowedProperties.length) {\n throw new Error(\n `The following properties on element ${this.localName} will not ` +\n `trigger updates as expected because they are set using class ` +\n `fields: ${shadowedProperties.join(', ')}. ` +\n `Native class fields and some compiled output will overwrite ` +\n `accessors used for detecting changes. See ` +\n `https://lit.dev/msg/class-field-shadowing ` +\n `for more information.`\n );\n }\n }\n // Mixin instance properties once, if they exist.\n if (this.__instanceProperties) {\n // TODO (justinfagnani): should we use the stored value? Could a new value\n // have been set since we stored the own property value?\n for (const [p, value] of this.__instanceProperties) {\n this[p as keyof this] = value as this[keyof this];\n }\n this.__instanceProperties = undefined;\n }\n // Trigger initial value reflection and populate the initial\n // `changedProperties` map, but only for the case of properties created\n // via `createProperty` on accessors, which will not have already\n // populated the `changedProperties` map since they are not set.\n // We can't know if these accessors had initializers, so we just set\n // them anyway - a difference from experimental decorators on fields and\n // standard decorators on auto-accessors.\n // For context see:\n // https://github.com/lit/lit/pull/4183#issuecomment-1711959635\n const elementProperties = (this.constructor as typeof ReactiveElement)\n .elementProperties;\n if (elementProperties.size > 0) {\n for (const [p, options] of elementProperties) {\n const {wrapped} = options;\n const value = this[p as keyof this];\n if (\n wrapped === true &&\n !this._$changedProperties.has(p) &&\n value !== undefined\n ) {\n this._$changeProperty(p, undefined, options, value);\n }\n }\n }\n }\n let shouldUpdate = false;\n const changedProperties = this._$changedProperties;\n try {\n shouldUpdate = this.shouldUpdate(changedProperties);\n if (shouldUpdate) {\n this.willUpdate(changedProperties);\n this.__controllers?.forEach((c) => c.hostUpdate?.());\n this.update(changedProperties);\n } else {\n this.__markUpdated();\n }\n } catch (e) {\n // Prevent `firstUpdated` and `updated` from running when there's an\n // update exception.\n shouldUpdate = false;\n // Ensure element can accept additional updates after an exception.\n this.__markUpdated();\n throw e;\n }\n // The update is no longer considered pending and further updates are now allowed.\n if (shouldUpdate) {\n this._$didUpdate(changedProperties);\n }\n }\n\n /**\n * Invoked before `update()` to compute values needed during the update.\n *\n * Implement `willUpdate` to compute property values that depend on other\n * properties and are used in the rest of the update process.\n *\n * ```ts\n * willUpdate(changedProperties) {\n * // only need to check changed properties for an expensive computation.\n * if (changedProperties.has('firstName') || changedProperties.has('lastName')) {\n * this.sha = computeSHA(`${this.firstName} ${this.lastName}`);\n * }\n * }\n *\n * render() {\n * return html`SHA: ${this.sha}`;\n * }\n * ```\n *\n * @category updates\n */\n protected willUpdate(_changedProperties: PropertyValues): void {}\n\n // Note, this is an override point for polyfill-support.\n // @internal\n _$didUpdate(changedProperties: PropertyValues) {\n this.__controllers?.forEach((c) => c.hostUpdated?.());\n if (!this.hasUpdated) {\n this.hasUpdated = true;\n this.firstUpdated(changedProperties);\n }\n this.updated(changedProperties);\n if (\n DEV_MODE &&\n this.isUpdatePending &&\n (this.constructor as typeof ReactiveElement).enabledWarnings!.includes(\n 'change-in-update'\n )\n ) {\n issueWarning(\n 'change-in-update',\n `Element ${this.localName} scheduled an update ` +\n `(generally because a property was set) ` +\n `after an update completed, causing a new update to be scheduled. ` +\n `This is inefficient and should be avoided unless the next update ` +\n `can only be scheduled as a side effect of the previous update.`\n );\n }\n }\n\n private __markUpdated() {\n this._$changedProperties = new Map();\n this.isUpdatePending = false;\n }\n\n /**\n * Returns a Promise that resolves when the element has completed updating.\n * The Promise value is a boolean that is `true` if the element completed the\n * update without triggering another update. The Promise result is `false` if\n * a property was set inside `updated()`. If the Promise is rejected, an\n * exception was thrown during the update.\n *\n * To await additional asynchronous work, override the `getUpdateComplete`\n * method. For example, it is sometimes useful to await a rendered element\n * before fulfilling this Promise. To do this, first await\n * `super.getUpdateComplete()`, then any subsequent state.\n *\n * @return A promise of a boolean that resolves to true if the update completed\n * without triggering another update.\n * @category updates\n */\n get updateComplete(): Promise<boolean> {\n return this.getUpdateComplete();\n }\n\n /**\n * Override point for the `updateComplete` promise.\n *\n * It is not safe to override the `updateComplete` getter directly due to a\n * limitation in TypeScript which means it is not possible to call a\n * superclass getter (e.g. `super.updateComplete.then(...)`) when the target\n * language is ES5 (https://github.com/microsoft/TypeScript/issues/338).\n * This method should be overridden instead. For example:\n *\n * ```ts\n * class MyElement extends LitElement {\n * override async getUpdateComplete() {\n * const result = await super.getUpdateComplete();\n * await this._myChild.updateComplete;\n * return result;\n * }\n * }\n * ```\n *\n * @return A promise of a boolean that resolves to true if the update completed\n * without triggering another update.\n * @category updates\n */\n protected getUpdateComplete(): Promise<boolean> {\n return this.__updatePromise;\n }\n\n /**\n * Controls whether or not `update()` should be called when the element requests\n * an update. By default, this method always returns `true`, but this can be\n * customized to control when to update.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected shouldUpdate(_changedProperties: PropertyValues): boolean {\n return true;\n }\n\n /**\n * Updates the element. This method reflects property values to attributes.\n * It can be overridden to render and keep updated element DOM.\n * Setting properties inside this method will *not* trigger\n * another update.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected update(_changedProperties: PropertyValues) {\n // The forEach() expression will only run when __reflectingProperties is\n // defined, and it returns undefined, setting __reflectingProperties to\n // undefined\n this.__reflectingProperties &&= this.__reflectingProperties.forEach((p) =>\n this.__propertyToAttribute(p, this[p as keyof this])\n ) as undefined;\n this.__markUpdated();\n }\n\n /**\n * Invoked whenever the element is updated. Implement to perform\n * post-updating tasks via DOM APIs, for example, focusing an element.\n *\n * Setting properties inside this method will trigger the element to update\n * again after this update cycle completes.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected updated(_changedProperties: PropertyValues) {}\n\n /**\n * Invoked when the element is first updated. Implement to perform one time\n * work on the element after update.\n *\n * ```ts\n * firstUpdated() {\n * this.renderRoot.getElementById('my-text-area').focus();\n * }\n * ```\n *\n * Setting properties inside this method will trigger the element to update\n * again after this update cycle completes.\n *\n * @param _changedProperties Map of changed properties with old values\n * @category updates\n */\n protected firstUpdated(_changedProperties: PropertyValues) {}\n}\n// Assigned here to work around a jscompiler bug with static fields\n// when compiling to ES5.\n// https://github.com/google/closure-compiler/issues/3177\n(ReactiveElement as unknown as Record<string, unknown>)[\n JSCompiler_renameProperty('elementProperties', ReactiveElement)\n] = new Map();\n(ReactiveElement as unknown as Record<string, unknown>)[\n JSCompiler_renameProperty('finalized', ReactiveElement)\n] = new Map();\n\n// Apply polyfills if available\npolyfillSupport?.({ReactiveElement});\n\n// Dev mode warnings...\nif (DEV_MODE) {\n // Default warning set.\n ReactiveElement.enabledWarnings = [\n 'change-in-update',\n 'async-perform-update',\n ];\n const ensureOwnWarnings = function (ctor: typeof ReactiveElement) {\n if (\n !ctor.hasOwnProperty(JSCompiler_renameProperty('enabledWarnings', ctor))\n ) {\n ctor.enabledWarnings = ctor.enabledWarnings!.slice();\n }\n };\n ReactiveElement.enableWarning = function (\n this: typeof ReactiveElement,\n warning: WarningKind\n ) {\n ensureOwnWarnings(this);\n if (!this.enabledWarnings!.includes(warning)) {\n this.enabledWarnings!.push(warning);\n }\n };\n ReactiveElement.disableWarning = function (\n this: typeof ReactiveElement,\n warning: WarningKind\n ) {\n ensureOwnWarnings(this);\n const i = this.enabledWarnings!.indexOf(warning);\n if (i >= 0) {\n this.enabledWarnings!.splice(i, 1);\n }\n };\n}\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for ReactiveElement usage.\n(global.reactiveElementVersions ??= []).push('2.1.2');\nif (DEV_MODE && global.reactiveElementVersions.length > 1) {\n queueMicrotask(() => {\n issueWarning!(\n 'multiple-versions',\n `Multiple versions of Lit loaded. Loading multiple versions ` +\n `is not recommended.`\n );\n });\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n// IMPORTANT: these imports must be type-only\nimport type {Directive, DirectiveResult, PartInfo} from './directive.js';\nimport type {TrustedHTML, TrustedTypesWindow} from 'trusted-types/lib/index.js';\n\nconst DEV_MODE = true;\nconst ENABLE_EXTRA_SECURITY_HOOKS = true;\nconst ENABLE_SHADYDOM_NOPATCH = true;\nconst NODE_MODE = false;\n\n// Allows minifiers to rename references to globalThis\nconst global = globalThis;\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace LitUnstable {\n /**\n * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n * we will emit 'lit-debug' events to window, with live details about the update and render\n * lifecycle. These can be useful for writing debug tooling and visualizations.\n *\n * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n * making certain operations that are normally very cheap (like a no-op render) much slower,\n * because we must copy data and dispatch events.\n */\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace DebugLog {\n export type Entry =\n | TemplatePrep\n | TemplateInstantiated\n | TemplateInstantiatedAndUpdated\n | TemplateUpdating\n | BeginRender\n | EndRender\n | CommitPartEntry\n | SetPartValue;\n export interface TemplatePrep {\n kind: 'template prep';\n template: Template;\n strings: TemplateStringsArray;\n clonableTemplate: HTMLTemplateElement;\n parts: TemplatePart[];\n }\n export interface BeginRender {\n kind: 'begin render';\n id: number;\n value: unknown;\n container: RenderRootNode;\n options: RenderOptions | undefined;\n part: ChildPart | undefined;\n }\n export interface EndRender {\n kind: 'end render';\n id: number;\n value: unknown;\n container: RenderRootNode;\n options: RenderOptions | undefined;\n part: ChildPart;\n }\n export interface TemplateInstantiated {\n kind: 'template instantiated';\n template: Template | CompiledTemplate;\n instance: TemplateInstance;\n options: RenderOptions | undefined;\n fragment: Node;\n parts: Array<Part | undefined>;\n values: unknown[];\n }\n export interface TemplateInstantiatedAndUpdated {\n kind: 'template instantiated and updated';\n template: Template | CompiledTemplate;\n instance: TemplateInstance;\n options: RenderOptions | undefined;\n fragment: Node;\n parts: Array<Part | undefined>;\n values: unknown[];\n }\n export interface TemplateUpdating {\n kind: 'template updating';\n template: Template | CompiledTemplate;\n instance: TemplateInstance;\n options: RenderOptions | undefined;\n parts: Array<Part | undefined>;\n values: unknown[];\n }\n export interface SetPartValue {\n kind: 'set part';\n part: Part;\n value: unknown;\n valueIndex: number;\n values: unknown[];\n templateInstance: TemplateInstance;\n }\n\n export type CommitPartEntry =\n | CommitNothingToChildEntry\n | CommitText\n | CommitNode\n | CommitAttribute\n | CommitProperty\n | CommitBooleanAttribute\n | CommitEventListener\n | CommitToElementBinding;\n\n export interface CommitNothingToChildEntry {\n kind: 'commit nothing to child';\n start: ChildNode;\n end: ChildNode | null;\n parent: Disconnectable | undefined;\n options: RenderOptions | undefined;\n }\n\n export interface CommitText {\n kind: 'commit text';\n node: Text;\n value: unknown;\n options: RenderOptions | undefined;\n }\n\n export interface CommitNode {\n kind: 'commit node';\n start: Node;\n parent: Disconnectable | undefined;\n value: Node;\n options: RenderOptions | undefined;\n }\n\n export interface CommitAttribute {\n kind: 'commit attribute';\n element: Element;\n name: string;\n value: unknown;\n options: RenderOptions | undefined;\n }\n\n export interface CommitProperty {\n kind: 'commit property';\n element: Element;\n name: string;\n value: unknown;\n options: RenderOptions | undefined;\n }\n\n export interface CommitBooleanAttribute {\n kind: 'commit boolean attribute';\n element: Element;\n name: string;\n value: boolean;\n options: RenderOptions | undefined;\n }\n\n export interface CommitEventListener {\n kind: 'commit event listener';\n element: Element;\n name: string;\n value: unknown;\n oldListener: unknown;\n options: RenderOptions | undefined;\n // True if we're removing the old event listener (e.g. because settings changed, or value is nothing)\n removeListener: boolean;\n // True if we're adding a new event listener (e.g. because first render, or settings changed)\n addListener: boolean;\n }\n\n export interface CommitToElementBinding {\n kind: 'commit to element binding';\n element: Element;\n value: unknown;\n options: RenderOptions | undefined;\n }\n }\n}\n\ninterface DebugLoggingWindow {\n // Even in dev mode, we generally don't want to emit these events, as that's\n // another level of cost, so only emit them when DEV_MODE is true _and_ when\n // window.emitLitDebugEvents is true.\n emitLitDebugLogEvents?: boolean;\n}\n\n/**\n * Useful for visualizing and logging insights into what the Lit template system is doing.\n *\n * Compiled out of prod mode builds.\n */\nconst debugLogEvent = DEV_MODE\n ? (event: LitUnstable.DebugLog.Entry) => {\n const shouldEmit = (global as unknown as DebugLoggingWindow)\n .emitLitDebugLogEvents;\n if (!shouldEmit) {\n return;\n }\n global.dispatchEvent(\n new CustomEvent<LitUnstable.DebugLog.Entry>('lit-debug', {\n detail: event,\n })\n );\n }\n : undefined;\n// Used for connecting beginRender and endRender events when there are nested\n// renders when errors are thrown preventing an endRender event from being\n// called.\nlet debugLogRenderId = 0;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n global.litIssuedWarnings ??= new Set();\n\n /**\n * Issue a warning if we haven't already, based either on `code` or `warning`.\n * Warnings are disabled automatically only by `warning`; disabling via `code`\n * can be done by users.\n */\n issueWarning = (code: string, warning: string) => {\n warning += code\n ? ` See https://lit.dev/msg/${code} for more information.`\n : '';\n if (\n !global.litIssuedWarnings!.has(warning) &&\n !global.litIssuedWarnings!.has(code)\n ) {\n console.warn(warning);\n global.litIssuedWarnings!.add(warning);\n }\n };\n\n queueMicrotask(() => {\n issueWarning(\n 'dev-mode',\n `Lit is in dev mode. Not recommended for production!`\n );\n });\n}\n\nconst wrap =\n ENABLE_SHADYDOM_NOPATCH &&\n global.ShadyDOM?.inUse &&\n global.ShadyDOM?.noPatch === true\n ? (global.ShadyDOM!.wrap as <T extends Node>(node: T) => T)\n : <T extends Node>(node: T) => node;\n\nconst trustedTypes = (global as unknown as TrustedTypesWindow).trustedTypes;\n\n/**\n * Our TrustedTypePolicy for HTML which is declared using the html template\n * tag function.\n *\n * That HTML is a developer-authored constant, and is parsed with innerHTML\n * before any untrusted expressions have been mixed in. Therefor it is\n * considered safe by construction.\n */\nconst policy = trustedTypes\n ? trustedTypes.createPolicy('lit-html', {\n createHTML: (s) => s,\n })\n : undefined;\n\n/**\n * Used to sanitize any value before it is written into the DOM. This can be\n * used to implement a security policy of allowed and disallowed values in\n * order to prevent XSS attacks.\n *\n * One way of using this callback would be to check attributes and properties\n * against a list of high risk fields, and require that values written to such\n * fields be instances of a class which is safe by construction. Closure's Safe\n * HTML Types is one implementation of this technique (\n * https://github.com/google/safe-html-types/blob/master/doc/safehtml-types.md).\n * The TrustedTypes polyfill in API-only mode could also be used as a basis\n * for this technique (https://github.com/WICG/trusted-types).\n *\n * @param node The HTML node (usually either a #text node or an Element) that\n * is being written to. Note that this is just an exemplar node, the write\n * may take place against another instance of the same class of node.\n * @param name The name of an attribute or property (for example, 'href').\n * @param type Indicates whether the write that's about to be performed will\n * be to a property or a node.\n * @return A function that will sanitize this class of writes.\n */\nexport type SanitizerFactory = (\n node: Node,\n name: string,\n type: 'property' | 'attribute'\n) => ValueSanitizer;\n\n/**\n * A function which can sanitize values that will be written to a specific kind\n * of DOM sink.\n *\n * See SanitizerFactory.\n *\n * @param value The value to sanitize. Will be the actual value passed into\n * the lit-html template literal, so this could be of any type.\n * @return The value to write to the DOM. Usually the same as the input value,\n * unless sanitization is needed.\n */\nexport type ValueSanitizer = (value: unknown) => unknown;\n\nconst identityFunction: ValueSanitizer = (value: unknown) => value;\nconst noopSanitizer: SanitizerFactory = (\n _node: Node,\n _name: string,\n _type: 'property' | 'attribute'\n) => identityFunction;\n\n/** Sets the global sanitizer factory. */\nconst setSanitizer = (newSanitizer: SanitizerFactory) => {\n if (!ENABLE_EXTRA_SECURITY_HOOKS) {\n return;\n }\n if (sanitizerFactoryInternal !== noopSanitizer) {\n throw new Error(\n `Attempted to overwrite existing lit-html security policy.` +\n ` setSanitizeDOMValueFactory should be called at most once.`\n );\n }\n sanitizerFactoryInternal = newSanitizer;\n};\n\n/**\n * Only used in internal tests, not a part of the public API.\n */\nconst _testOnlyClearSanitizerFactoryDoNotCallOrElse = () => {\n sanitizerFactoryInternal = noopSanitizer;\n};\n\nconst createSanitizer: SanitizerFactory = (node, name, type) => {\n return sanitizerFactoryInternal(node, name, type);\n};\n\n// Added to an attribute name to mark the attribute as bound so we can find\n// it easily.\nconst boundAttributeSuffix = '$lit$';\n\n// This marker is used in many syntactic positions in HTML, so it must be\n// a valid element name and attribute name. We don't support dynamic names (yet)\n// but this at least ensures that the parse tree is closer to the template\n// intention.\nconst marker = `lit$${Math.random().toFixed(9).slice(2)}$`;\n\n// String used to tell if a comment is a marker comment\nconst markerMatch = '?' + marker;\n\n// Text used to insert a comment marker node. We use processing instruction\n// syntax because it's slightly smaller, but parses as a comment node.\nconst nodeMarker = `<${markerMatch}>`;\n\nconst d =\n NODE_MODE && global.document === undefined\n ? ({\n createTreeWalker() {\n return {};\n },\n } as unknown as Document)\n : document;\n\n// Creates a dynamic marker. We never have to search for these in the DOM.\nconst createMarker = () => d.createComment('');\n\n// https://tc39.github.io/ecma262/#sec-typeof-operator\ntype Primitive = null | undefined | boolean | number | string | symbol | bigint;\nconst isPrimitive = (value: unknown): value is Primitive =>\n value === null || (typeof value != 'object' && typeof value != 'function');\nconst isArray = Array.isArray;\nconst isIterable = (value: unknown): value is Iterable<unknown> =>\n isArray(value) ||\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n typeof (value as any)?.[Symbol.iterator] === 'function';\n\nconst SPACE_CHAR = `[ \\t\\n\\f\\r]`;\nconst ATTR_VALUE_CHAR = `[^ \\t\\n\\f\\r\"'\\`<>=]`;\nconst NAME_CHAR = `[^\\\\s\"'>=/]`;\n\n// These regexes represent the five parsing states that we care about in the\n// Template's HTML scanner. They match the *end* of the state they're named\n// after.\n// Depending on the match, we transition to a new state. If there's no match,\n// we stay in the same state.\n// Note that the regexes are stateful. We utilize lastIndex and sync it\n// across the multiple regexes used. In addition to the five regexes below\n// we also dynamically create a regex to find the matching end tags for raw\n// text elements.\n\n/**\n * End of text is: `<` followed by:\n * (comment start) or (tag) or (dynamic tag binding)\n */\nconst textEndRegex = /<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g;\nconst COMMENT_START = 1;\nconst TAG_NAME = 2;\nconst DYNAMIC_TAG_NAME = 3;\n\nconst commentEndRegex = /-->/g;\n/**\n * Comments not started with <!--, like </{, can be ended by a single `>`\n */\nconst comment2EndRegex = />/g;\n\n/**\n * The tagEnd regex matches the end of the \"inside an opening\" tag syntax\n * position. It either matches a `>`, an attribute-like sequence, or the end\n * of the string after a space (attribute-name position ending).\n *\n * See attributes in the HTML spec:\n * https://www.w3.org/TR/html5/syntax.html#elements-attributes\n *\n * \" \\t\\n\\f\\r\" are HTML space characters:\n * https://infra.spec.whatwg.org/#ascii-whitespace\n *\n * So an attribute is:\n * * The name: any character except a whitespace character, (\"), ('), \">\",\n * \"=\", or \"/\". Note: this is different from the HTML spec which also excludes control characters.\n * * Followed by zero or more space characters\n * * Followed by \"=\"\n * * Followed by zero or more space characters\n * * Followed by:\n * * Any character except space, ('), (\"), \"<\", \">\", \"=\", (`), or\n * * (\") then any non-(\"), or\n * * (') then any non-(')\n */\nconst tagEndRegex = new RegExp(\n `>|${SPACE_CHAR}(?:(${NAME_CHAR}+)(${SPACE_CHAR}*=${SPACE_CHAR}*(?:${ATTR_VALUE_CHAR}|(\"|')|))|$)`,\n 'g'\n);\nconst ENTIRE_MATCH = 0;\nconst ATTRIBUTE_NAME = 1;\nconst SPACES_AND_EQUALS = 2;\nconst QUOTE_CHAR = 3;\n\nconst singleQuoteAttrEndRegex = /'/g;\nconst doubleQuoteAttrEndRegex = /\"/g;\n/**\n * Matches the raw text elements.\n *\n * Comments are not parsed within raw text elements, so we need to search their\n * text content for marker strings.\n */\nconst rawTextElement = /^(?:script|style|textarea|title)$/i;\n\n/** TemplateResult types */\nconst HTML_RESULT = 1;\nconst SVG_RESULT = 2;\nconst MATHML_RESULT = 3;\n\ntype ResultType = typeof HTML_RESULT | typeof SVG_RESULT | typeof MATHML_RESULT;\n\n// TemplatePart types\n// IMPORTANT: these must match the values in PartType\nconst ATTRIBUTE_PART = 1;\nconst CHILD_PART = 2;\nconst PROPERTY_PART = 3;\nconst BOOLEAN_ATTRIBUTE_PART = 4;\nconst EVENT_PART = 5;\nconst ELEMENT_PART = 6;\nconst COMMENT_PART = 7;\n\n/**\n * The return type of the template tag functions, {@linkcode html} and\n * {@linkcode svg} when it hasn't been compiled by @lit-labs/compiler.\n *\n * A `TemplateResult` object holds all the information about a template\n * expression required to render it: the template strings, expression values,\n * and type of template (html or svg).\n *\n * `TemplateResult` objects do not create any DOM on their own. To create or\n * update DOM you need to render the `TemplateResult`. See\n * [Rendering](https://lit.dev/docs/components/rendering) for more information.\n *\n */\nexport type UncompiledTemplateResult<T extends ResultType = ResultType> = {\n // This property needs to remain unminified.\n ['_$litType$']: T;\n strings: TemplateStringsArray;\n values: unknown[];\n};\n\n/**\n * This is a template result that may be either uncompiled or compiled.\n *\n * In the future, TemplateResult will be this type. If you want to explicitly\n * note that a template result is potentially compiled, you can reference this\n * type and it will continue to behave the same through the next major version\n * of Lit. This can be useful for code that wants to prepare for the next\n * major version of Lit.\n */\nexport type MaybeCompiledTemplateResult<T extends ResultType = ResultType> =\n | UncompiledTemplateResult<T>\n | CompiledTemplateResult;\n\n/**\n * The return type of the template tag functions, {@linkcode html} and\n * {@linkcode svg}.\n *\n * A `TemplateResult` object holds all the information about a template\n * expression required to render it: the template strings, expression values,\n * and type of template (html or svg).\n *\n * `TemplateResult` objects do not create any DOM on their own. To create or\n * update DOM you need to render the `TemplateResult`. See\n * [Rendering](https://lit.dev/docs/components/rendering) for more information.\n *\n * In Lit 4, this type will be an alias of\n * MaybeCompiledTemplateResult, so that code will get type errors if it assumes\n * that Lit templates are not compiled. When deliberately working with only\n * one, use either {@linkcode CompiledTemplateResult} or\n * {@linkcode UncompiledTemplateResult} explicitly.\n */\nexport type TemplateResult<T extends ResultType = ResultType> =\n UncompiledTemplateResult<T>;\n\nexport type HTMLTemplateResult = TemplateResult<typeof HTML_RESULT>;\n\nexport type SVGTemplateResult = TemplateResult<typeof SVG_RESULT>;\n\nexport type MathMLTemplateResult = TemplateResult<typeof MATHML_RESULT>;\n\n/**\n * A TemplateResult that has been compiled by @lit-labs/compiler, skipping the\n * prepare step.\n */\nexport interface CompiledTemplateResult {\n // This is a factory in order to make template initialization lazy\n // and allow ShadyRenderOptions scope to be passed in.\n // This property needs to remain unminified.\n ['_$litType$']: CompiledTemplate;\n values: unknown[];\n}\n\nexport interface CompiledTemplate extends Omit<Template, 'el'> {\n // el is overridden to be optional. We initialize it on first render\n el?: HTMLTemplateElement;\n\n // The prepared HTML string to create a template element from.\n // The type is a TemplateStringsArray to guarantee that the value came from\n // source code, preventing a JSON injection attack.\n h: TemplateStringsArray;\n}\n\n/**\n * Generates a template literal tag function that returns a TemplateResult with\n * the given result type.\n */\nconst tag =\n <T extends ResultType>(type: T) =>\n (strings: TemplateStringsArray, ...values: unknown[]): TemplateResult<T> => {\n // Warn against templates octal escape sequences\n // We do this here rather than in render so that the warning is closer to the\n // template definition.\n if (DEV_MODE && strings.some((s) => s === undefined)) {\n console.warn(\n 'Some template strings are undefined.\\n' +\n 'This is probably caused by illegal octal escape sequences.'\n );\n }\n if (DEV_MODE) {\n // Import static-html.js results in a circular dependency which g3 doesn't\n // handle. Instead we know that static values must have the field\n // `_$litStatic$`.\n if (\n values.some((val) => (val as {_$litStatic$: unknown})?.['_$litStatic$'])\n ) {\n issueWarning(\n '',\n `Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.\\n` +\n `Please use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions`\n );\n }\n }\n return {\n // This property needs to remain unminified.\n ['_$litType$']: type,\n strings,\n values,\n };\n };\n\n/**\n * Interprets a template literal as an HTML template that can efficiently\n * render to and update a container.\n *\n * ```ts\n * const header = (title: string) => html`<h1>${title}</h1>`;\n * ```\n *\n * The `html` tag returns a description of the DOM to render as a value. It is\n * lazy, meaning no work is done until the template is rendered. When rendering,\n * if a template comes from the same expression as a previously rendered result,\n * it's efficiently updated instead of replaced.\n */\nexport const html = tag(HTML_RESULT);\n\n/**\n * Interprets a template literal as an SVG fragment that can efficiently render\n * to and update a container.\n *\n * ```ts\n * const rect = svg`<rect width=\"10\" height=\"10\"></rect>`;\n *\n * const myImage = html`\n * <svg viewBox=\"0 0 10 10\" xmlns=\"http://www.w3.org/2000/svg\">\n * ${rect}\n * </svg>`;\n * ```\n *\n * The `svg` *tag function* should only be used for SVG fragments, or elements\n * that would be contained **inside** an `<svg>` HTML element. A common error is\n * placing an `<svg>` *element* in a template tagged with the `svg` tag\n * function. The `<svg>` element is an HTML element and should be used within a\n * template tagged with the {@linkcode html} tag function.\n *\n * In LitElement usage, it's invalid to return an SVG fragment from the\n * `render()` method, as the SVG fragment will be contained within the element's\n * shadow root and thus not be properly contained within an `<svg>` HTML\n * element.\n */\nexport const svg = tag(SVG_RESULT);\n\n/**\n * Interprets a template literal as MathML fragment that can efficiently render\n * to and update a container.\n *\n * ```ts\n * const num = mathml`<mn>1</mn>`;\n *\n * const eq = html`\n * <math>\n * ${num}\n * </math>`;\n * ```\n *\n * The `mathml` *tag function* should only be used for MathML fragments, or\n * elements that would be contained **inside** a `<math>` HTML element. A common\n * error is placing a `<math>` *element* in a template tagged with the `mathml`\n * tag function. The `<math>` element is an HTML element and should be used\n * within a template tagged with the {@linkcode html} tag function.\n *\n * In LitElement usage, it's invalid to return an MathML fragment from the\n * `render()` method, as the MathML fragment will be contained within the\n * element's shadow root and thus not be properly contained within a `<math>`\n * HTML element.\n */\nexport const mathml = tag(MATHML_RESULT);\n\n/**\n * A sentinel value that signals that a value was handled by a directive and\n * should not be written to the DOM.\n */\nexport const noChange = Symbol.for('lit-noChange');\n\n/**\n * A sentinel value that signals a ChildPart to fully clear its content.\n *\n * ```ts\n * const button = html`${\n * user.isAdmin\n * ? html`<button>DELETE</button>`\n * : nothing\n * }`;\n * ```\n *\n * Prefer using `nothing` over other falsy values as it provides a consistent\n * behavior between various expression binding contexts.\n *\n * In child expressions, `undefined`, `null`, `''`, and `nothing` all behave the\n * same and render no nodes. In attribute expressions, `nothing` _removes_ the\n * attribute, while `undefined` and `null` will render an empty string. In\n * property expressions `nothing` becomes `undefined`.\n */\nexport const nothing = Symbol.for('lit-nothing');\n\n/**\n * The cache of prepared templates, keyed by the tagged TemplateStringsArray\n * and _not_ accounting for the specific template tag used. This means that\n * template tags cannot be dynamic - they must statically be one of html, svg,\n * or attr. This restriction simplifies the cache lookup, which is on the hot\n * path for rendering.\n */\nconst templateCache = new WeakMap<TemplateStringsArray, Template>();\n\n/**\n * Object specifying options for controlling lit-html rendering. Note that\n * while `render` may be called multiple times on the same `container` (and\n * `renderBefore` reference node) to efficiently update the rendered content,\n * only the options passed in during the first render are respected during\n * the lifetime of renders to that unique `container` + `renderBefore`\n * combination.\n */\nexport interface RenderOptions {\n /**\n * An object to use as the `this` value for event listeners. It's often\n * useful to set this to the host component rendering a template.\n */\n host?: object;\n /**\n * A DOM node before which to render content in the container.\n */\n renderBefore?: ChildNode | null;\n /**\n * Node used for cloning the template (`importNode` will be called on this\n * node). This controls the `ownerDocument` of the rendered DOM, along with\n * any inherited context. Defaults to the global `document`.\n */\n creationScope?: {importNode(node: Node, deep?: boolean): Node};\n /**\n * The initial connected state for the top-level part being rendered. If no\n * `isConnected` option is set, `AsyncDirective`s will be connected by\n * default. Set to `false` if the initial render occurs in a disconnected tree\n * and `AsyncDirective`s should see `isConnected === false` for their initial\n * render. The `part.setConnected()` method must be used subsequent to initial\n * render to change the connected state of the part.\n */\n isConnected?: boolean;\n}\n\n/**\n * The root DOM node for rendering.\n */\nexport type RenderRootNode = HTMLElement | SVGElement | DocumentFragment;\n\nconst walker = d.createTreeWalker(\n d,\n 129 /* NodeFilter.SHOW_{ELEMENT|COMMENT} */\n);\n\nlet sanitizerFactoryInternal: SanitizerFactory = noopSanitizer;\n\n//\n// Classes only below here, const variable declarations only above here...\n//\n// Keeping variable declarations and classes together improves minification.\n// Interfaces and type aliases can be interleaved freely.\n//\n\n// Type for classes that have a `_directive` or `_directives[]` field, used by\n// `resolveDirective`\nexport interface DirectiveParent {\n _$parent?: DirectiveParent;\n _$isConnected: boolean;\n __directive?: Directive;\n __directives?: Array<Directive | undefined>;\n}\n\nfunction trustFromTemplateString(\n tsa: TemplateStringsArray,\n stringFromTSA: string\n): TrustedHTML {\n // A security check to prevent spoofing of Lit template results.\n // In the future, we may be able to replace this with Array.isTemplateObject,\n // though we might need to make that check inside of the html and svg\n // functions, because precompiled templates don't come in as\n // TemplateStringArray objects.\n if (!isArray(tsa) || !tsa.hasOwnProperty('raw')) {\n let message = 'invalid template strings array';\n if (DEV_MODE) {\n message = `\n Internal Error: expected template strings to be an array\n with a 'raw' field. Faking a template strings array by\n calling html or svg like an ordinary function is effectively\n the same as calling unsafeHtml and can lead to major security\n issues, e.g. opening your code up to XSS attacks.\n If you're using the html or svg tagged template functions normally\n and still seeing this error, please file a bug at\n https://github.com/lit/lit/issues/new?template=bug_report.md\n and include information about your build tooling, if any.\n `\n .trim()\n .replace(/\\n */g, '\\n');\n }\n throw new Error(message);\n }\n return policy !== undefined\n ? policy.createHTML(stringFromTSA)\n : (stringFromTSA as unknown as TrustedHTML);\n}\n\n/**\n * Returns an HTML string for the given TemplateStringsArray and result type\n * (HTML or SVG), along with the case-sensitive bound attribute names in\n * template order. The HTML contains comment markers denoting the `ChildPart`s\n * and suffixes on bound attributes denoting the `AttributeParts`.\n *\n * @param strings template strings array\n * @param type HTML or SVG\n * @return Array containing `[html, attrNames]` (array returned for terseness,\n * to avoid object fields since this code is shared with non-minified SSR\n * code)\n */\nconst getTemplateHtml = (\n strings: TemplateStringsArray,\n type: ResultType\n): [TrustedHTML, Array<string>] => {\n // Insert makers into the template HTML to represent the position of\n // bindings. The following code scans the template strings to determine the\n // syntactic position of the bindings. They can be in text position, where\n // we insert an HTML comment, attribute value position, where we insert a\n // sentinel string and re-write the attribute name, or inside a tag where\n // we insert the sentinel string.\n const l = strings.length - 1;\n // Stores the case-sensitive bound attribute names in the order of their\n // parts. ElementParts are also reflected in this array as undefined\n // rather than a string, to disambiguate from attribute bindings.\n const attrNames: Array<string> = [];\n let html =\n type === SVG_RESULT ? '<svg>' : type === MATHML_RESULT ? '<math>' : '';\n\n // When we're inside a raw text tag (not it's text content), the regex\n // will still be tagRegex so we can find attributes, but will switch to\n // this regex when the tag ends.\n let rawTextEndRegex: RegExp | undefined;\n\n // The current parsing state, represented as a reference to one of the\n // regexes\n let regex = textEndRegex;\n\n for (let i = 0; i < l; i++) {\n const s = strings[i];\n // The index of the end of the last attribute name. When this is\n // positive at end of a string, it means we're in an attribute value\n // position and need to rewrite the attribute name.\n // We also use a special value of -2 to indicate that we encountered\n // the end of a string in attribute name position.\n let attrNameEndIndex = -1;\n let attrName: string | undefined;\n let lastIndex = 0;\n let match!: RegExpExecArray | null;\n\n // The conditions in this loop handle the current parse state, and the\n // assignments to the `regex` variable are the state transitions.\n while (lastIndex < s.length) {\n // Make sure we start searching from where we previously left off\n regex.lastIndex = lastIndex;\n match = regex.exec(s);\n if (match === null) {\n break;\n }\n lastIndex = regex.lastIndex;\n if (regex === textEndRegex) {\n if (match[COMMENT_START] === '!--') {\n regex = commentEndRegex;\n } else if (match[COMMENT_START] !== undefined) {\n // We started a weird comment, like </{\n regex = comment2EndRegex;\n } else if (match[TAG_NAME] !== undefined) {\n if (rawTextElement.test(match[TAG_NAME])) {\n // Record if we encounter a raw-text element. We'll switch to\n // this regex at the end of the tag.\n rawTextEndRegex = new RegExp(`</${match[TAG_NAME]}`, 'g');\n }\n regex = tagEndRegex;\n } else if (match[DYNAMIC_TAG_NAME] !== undefined) {\n if (DEV_MODE) {\n throw new Error(\n 'Bindings in tag names are not supported. Please use static templates instead. ' +\n 'See https://lit.dev/docs/templates/expressions/#static-expressions'\n );\n }\n regex = tagEndRegex;\n }\n } else if (regex === tagEndRegex) {\n if (match[ENTIRE_MATCH] === '>') {\n // End of a tag. If we had started a raw-text element, use that\n // regex\n regex = rawTextEndRegex ?? textEndRegex;\n // We may be ending an unquoted attribute value, so make sure we\n // clear any pending attrNameEndIndex\n attrNameEndIndex = -1;\n } else if (match[ATTRIBUTE_NAME] === undefined) {\n // Attribute name position\n attrNameEndIndex = -2;\n } else {\n attrNameEndIndex = regex.lastIndex - match[SPACES_AND_EQUALS].length;\n attrName = match[ATTRIBUTE_NAME];\n regex =\n match[QUOTE_CHAR] === undefined\n ? tagEndRegex\n : match[QUOTE_CHAR] === '\"'\n ? doubleQuoteAttrEndRegex\n : singleQuoteAttrEndRegex;\n }\n } else if (\n regex === doubleQuoteAttrEndRegex ||\n regex === singleQuoteAttrEndRegex\n ) {\n regex = tagEndRegex;\n } else if (regex === commentEndRegex || regex === comment2EndRegex) {\n regex = textEndRegex;\n } else {\n // Not one of the five state regexes, so it must be the dynamically\n // created raw text regex and we're at the close of that element.\n regex = tagEndRegex;\n rawTextEndRegex = undefined;\n }\n }\n\n if (DEV_MODE) {\n // If we have a attrNameEndIndex, which indicates that we should\n // rewrite the attribute name, assert that we're in a valid attribute\n // position - either in a tag, or a quoted attribute value.\n console.assert(\n attrNameEndIndex === -1 ||\n regex === tagEndRegex ||\n regex === singleQuoteAttrEndRegex ||\n regex === doubleQuoteAttrEndRegex,\n 'unexpected parse state B'\n );\n }\n\n // We have four cases:\n // 1. We're in text position, and not in a raw text element\n // (regex === textEndRegex): insert a comment marker.\n // 2. We have a non-negative attrNameEndIndex which means we need to\n // rewrite the attribute name to add a bound attribute suffix.\n // 3. We're at the non-first binding in a multi-binding attribute, use a\n // plain marker.\n // 4. We're somewhere else inside the tag. If we're in attribute name\n // position (attrNameEndIndex === -2), add a sequential suffix to\n // generate a unique attribute name.\n\n // Detect a binding next to self-closing tag end and insert a space to\n // separate the marker from the tag end:\n const end =\n regex === tagEndRegex && strings[i + 1].startsWith('/>') ? ' ' : '';\n html +=\n regex === textEndRegex\n ? s + nodeMarker\n : attrNameEndIndex >= 0\n ? (attrNames.push(attrName!),\n s.slice(0, attrNameEndIndex) +\n boundAttributeSuffix +\n s.slice(attrNameEndIndex)) +\n marker +\n end\n : s + marker + (attrNameEndIndex === -2 ? i : end);\n }\n\n const htmlResult: string | TrustedHTML =\n html +\n (strings[l] || '<?>') +\n (type === SVG_RESULT ? '</svg>' : type === MATHML_RESULT ? '</math>' : '');\n\n // Returned as an array for terseness\n return [trustFromTemplateString(strings, htmlResult), attrNames];\n};\n\n/** @internal */\nexport type {Template};\nclass Template {\n /** @internal */\n el!: HTMLTemplateElement;\n\n parts: Array<TemplatePart> = [];\n\n constructor(\n // This property needs to remain unminified.\n {strings, ['_$litType$']: type}: UncompiledTemplateResult,\n options?: RenderOptions\n ) {\n let node: Node | null;\n let nodeIndex = 0;\n let attrNameIndex = 0;\n const partCount = strings.length - 1;\n const parts = this.parts;\n\n // Create template element\n const [html, attrNames] = getTemplateHtml(strings, type);\n this.el = Template.createElement(html, options);\n walker.currentNode = this.el.content;\n\n // Re-parent SVG or MathML nodes into template root\n if (type === SVG_RESULT || type === MATHML_RESULT) {\n const wrapper = this.el.content.firstChild!;\n wrapper.replaceWith(...wrapper.childNodes);\n }\n\n // Walk the template to find binding markers and create TemplateParts\n while ((node = walker.nextNode()) !== null && parts.length < partCount) {\n if (node.nodeType === 1) {\n if (DEV_MODE) {\n const tag = (node as Element).localName;\n // Warn if `textarea` includes an expression and throw if `template`\n // does since these are not supported. We do this by checking\n // innerHTML for anything that looks like a marker. This catches\n // cases like bindings in textarea there markers turn into text nodes.\n if (\n /^(?:textarea|template)$/i!.test(tag) &&\n (node as Element).innerHTML.includes(marker)\n ) {\n const m =\n `Expressions are not supported inside \\`${tag}\\` ` +\n `elements. See https://lit.dev/msg/expression-in-${tag} for more ` +\n `information.`;\n if (tag === 'template') {\n throw new Error(m);\n } else issueWarning('', m);\n }\n }\n // TODO (justinfagnani): for attempted dynamic tag names, we don't\n // increment the bindingIndex, and it'll be off by 1 in the element\n // and off by two after it.\n if ((node as Element).hasAttributes()) {\n for (const name of (node as Element).getAttributeNames()) {\n if (name.endsWith(boundAttributeSuffix)) {\n const realName = attrNames[attrNameIndex++];\n const value = (node as Element).getAttribute(name)!;\n const statics = value.split(marker);\n const m = /([.?@])?(.*)/.exec(realName)!;\n parts.push({\n type: ATTRIBUTE_PART,\n index: nodeIndex,\n name: m[2],\n strings: statics,\n ctor:\n m[1] === '.'\n ? PropertyPart\n : m[1] === '?'\n ? BooleanAttributePart\n : m[1] === '@'\n ? EventPart\n : AttributePart,\n });\n (node as Element).removeAttribute(name);\n } else if (name.startsWith(marker)) {\n parts.push({\n type: ELEMENT_PART,\n index: nodeIndex,\n });\n (node as Element).removeAttribute(name);\n }\n }\n }\n // TODO (justinfagnani): benchmark the regex against testing for each\n // of the 3 raw text element names.\n if (rawTextElement.test((node as Element).tagName)) {\n // For raw text elements we need to split the text content on\n // markers, create a Text node for each segment, and create\n // a TemplatePart for each marker.\n const strings = (node as Element).textContent!.split(marker);\n const lastIndex = strings.length - 1;\n if (lastIndex > 0) {\n (node as Element).textContent = trustedTypes\n ? (trustedTypes.emptyScript as unknown as '')\n : '';\n // Generate a new text node for each literal section\n // These nodes are also used as the markers for child parts\n for (let i = 0; i < lastIndex; i++) {\n (node as Element).append(strings[i], createMarker());\n // Walk past the marker node we just added\n walker.nextNode();\n parts.push({type: CHILD_PART, index: ++nodeIndex});\n }\n // Note because this marker is added after the walker's current\n // node, it will be walked to in the outer loop (and ignored), so\n // we don't need to adjust nodeIndex here\n (node as Element).append(strings[lastIndex], createMarker());\n }\n }\n } else if (node.nodeType === 8) {\n const data = (node as Comment).data;\n if (data === markerMatch) {\n parts.push({type: CHILD_PART, index: nodeIndex});\n } else {\n let i = -1;\n while ((i = (node as Comment).data.indexOf(marker, i + 1)) !== -1) {\n // Comment node has a binding marker inside, make an inactive part\n // The binding won't work, but subsequent bindings will\n parts.push({type: COMMENT_PART, index: nodeIndex});\n // Move to the end of the match\n i += marker.length - 1;\n }\n }\n }\n nodeIndex++;\n }\n\n if (DEV_MODE) {\n // If there was a duplicate attribute on a tag, then when the tag is\n // parsed into an element the attribute gets de-duplicated. We can detect\n // this mismatch if we haven't precisely consumed every attribute name\n // when preparing the template. This works because `attrNames` is built\n // from the template string and `attrNameIndex` comes from processing the\n // resulting DOM.\n if (attrNames.length !== attrNameIndex) {\n throw new Error(\n `Detected duplicate attribute bindings. This occurs if your template ` +\n `has duplicate attributes on an element tag. For example ` +\n `\"<input ?disabled=\\${true} ?disabled=\\${false}>\" contains a ` +\n `duplicate \"disabled\" attribute. The error was detected in ` +\n `the following template: \\n` +\n '`' +\n strings.join('${...}') +\n '`'\n );\n }\n }\n\n // We could set walker.currentNode to another node here to prevent a memory\n // leak, but every time we prepare a template, we immediately render it\n // and re-use the walker in new TemplateInstance._clone().\n debugLogEvent &&\n debugLogEvent({\n kind: 'template prep',\n template: this,\n clonableTemplate: this.el,\n parts: this.parts,\n strings,\n });\n }\n\n // Overridden via `litHtmlPolyfillSupport` to provide platform support.\n /** @nocollapse */\n static createElement(html: TrustedHTML, _options?: RenderOptions) {\n const el = d.createElement('template');\n el.innerHTML = html as unknown as string;\n return el;\n }\n}\n\nexport interface Disconnectable {\n _$parent?: Disconnectable;\n _$disconnectableChildren?: Set<Disconnectable>;\n // Rather than hold connection state on instances, Disconnectables recursively\n // fetch the connection state from the RootPart they are connected in via\n // getters up the Disconnectable tree via _$parent references. This pushes the\n // cost of tracking the isConnected state to `AsyncDirectives`, and avoids\n // needing to pass all Disconnectables (parts, template instances, and\n // directives) their connection state each time it changes, which would be\n // costly for trees that have no AsyncDirectives.\n _$isConnected: boolean;\n}\n\nfunction resolveDirective(\n part: ChildPart | AttributePart | ElementPart,\n value: unknown,\n parent: DirectiveParent = part,\n attributeIndex?: number\n): unknown {\n // Bail early if the value is explicitly noChange. Note, this means any\n // nested directive is still attached and is not run.\n if (value === noChange) {\n return value;\n }\n let currentDirective =\n attributeIndex !== undefined\n ? (parent as AttributePart).__directives?.[attributeIndex]\n : (parent as ChildPart | ElementPart | Directive).__directive;\n const nextDirectiveConstructor = isPrimitive(value)\n ? undefined\n : // This property needs to remain unminified.\n (value as DirectiveResult)['_$litDirective$'];\n if (currentDirective?.constructor !== nextDirectiveConstructor) {\n // This property needs to remain unminified.\n currentDirective?.['_$notifyDirectiveConnectionChanged']?.(false);\n if (nextDirectiveConstructor === undefined) {\n currentDirective = undefined;\n } else {\n currentDirective = new nextDirectiveConstructor(part as PartInfo);\n currentDirective._$initialize(part, parent, attributeIndex);\n }\n if (attributeIndex !== undefined) {\n ((parent as AttributePart).__directives ??= [])[attributeIndex] =\n currentDirective;\n } else {\n (parent as ChildPart | Directive).__directive = currentDirective;\n }\n }\n if (currentDirective !== undefined) {\n value = resolveDirective(\n part,\n currentDirective._$resolve(part, (value as DirectiveResult).values),\n currentDirective,\n attributeIndex\n );\n }\n return value;\n}\n\nexport type {TemplateInstance};\n/**\n * An updateable instance of a Template. Holds references to the Parts used to\n * update the template instance.\n */\nclass TemplateInstance implements Disconnectable {\n _$template: Template;\n _$parts: Array<Part | undefined> = [];\n\n /** @internal */\n _$parent: ChildPart;\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n constructor(template: Template, parent: ChildPart) {\n this._$template = template;\n this._$parent = parent;\n }\n\n // Called by ChildPart parentNode getter\n get parentNode() {\n return this._$parent.parentNode;\n }\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n // This method is separate from the constructor because we need to return a\n // DocumentFragment and we don't want to hold onto it with an instance field.\n _clone(options: RenderOptions | undefined) {\n const {\n el: {content},\n parts: parts,\n } = this._$template;\n const fragment = (options?.creationScope ?? d).importNode(content, true);\n walker.currentNode = fragment;\n\n let node = walker.nextNode()!;\n let nodeIndex = 0;\n let partIndex = 0;\n let templatePart = parts[0];\n\n while (templatePart !== undefined) {\n if (nodeIndex === templatePart.index) {\n let part: Part | undefined;\n if (templatePart.type === CHILD_PART) {\n part = new ChildPart(\n node as HTMLElement,\n node.nextSibling,\n this,\n options\n );\n } else if (templatePart.type === ATTRIBUTE_PART) {\n part = new templatePart.ctor(\n node as HTMLElement,\n templatePart.name,\n templatePart.strings,\n this,\n options\n );\n } else if (templatePart.type === ELEMENT_PART) {\n part = new ElementPart(node as HTMLElement, this, options);\n }\n this._$parts.push(part);\n templatePart = parts[++partIndex];\n }\n if (nodeIndex !== templatePart?.index) {\n node = walker.nextNode()!;\n nodeIndex++;\n }\n }\n // We need to set the currentNode away from the cloned tree so that we\n // don't hold onto the tree even if the tree is detached and should be\n // freed.\n walker.currentNode = d;\n return fragment;\n }\n\n _update(values: Array<unknown>) {\n let i = 0;\n for (const part of this._$parts) {\n if (part !== undefined) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'set part',\n part,\n value: values[i],\n valueIndex: i,\n values,\n templateInstance: this,\n });\n if ((part as AttributePart).strings !== undefined) {\n (part as AttributePart)._$setValue(values, part as AttributePart, i);\n // The number of values the part consumes is part.strings.length - 1\n // since values are in between template spans. We increment i by 1\n // later in the loop, so increment it by part.strings.length - 2 here\n i += (part as AttributePart).strings!.length - 2;\n } else {\n part._$setValue(values[i]);\n }\n }\n i++;\n }\n }\n}\n\n/*\n * Parts\n */\ntype AttributeTemplatePart = {\n readonly type: typeof ATTRIBUTE_PART;\n readonly index: number;\n readonly name: string;\n readonly ctor: typeof AttributePart;\n readonly strings: ReadonlyArray<string>;\n};\ntype ChildTemplatePart = {\n readonly type: typeof CHILD_PART;\n readonly index: number;\n};\ntype ElementTemplatePart = {\n readonly type: typeof ELEMENT_PART;\n readonly index: number;\n};\ntype CommentTemplatePart = {\n readonly type: typeof COMMENT_PART;\n readonly index: number;\n};\n\n/**\n * A TemplatePart represents a dynamic part in a template, before the template\n * is instantiated. When a template is instantiated Parts are created from\n * TemplateParts.\n */\ntype TemplatePart =\n | ChildTemplatePart\n | AttributeTemplatePart\n | ElementTemplatePart\n | CommentTemplatePart;\n\nexport type Part =\n | ChildPart\n | AttributePart\n | PropertyPart\n | BooleanAttributePart\n | ElementPart\n | EventPart;\n\nexport type {ChildPart};\nclass ChildPart implements Disconnectable {\n readonly type = CHILD_PART;\n readonly options: RenderOptions | undefined;\n _$committedValue: unknown = nothing;\n /** @internal */\n __directive?: Directive;\n /** @internal */\n _$startNode: ChildNode;\n /** @internal */\n _$endNode: ChildNode | null;\n private _textSanitizer: ValueSanitizer | undefined;\n /** @internal */\n _$parent: Disconnectable | undefined;\n /**\n * Connection state for RootParts only (i.e. ChildPart without _$parent\n * returned from top-level `render`). This field is unused otherwise. The\n * intention would be clearer if we made `RootPart` a subclass of `ChildPart`\n * with this field (and a different _$isConnected getter), but the subclass\n * caused a perf regression, possibly due to making call sites polymorphic.\n * @internal\n */\n __isConnected: boolean;\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n // ChildParts that are not at the root should always be created with a\n // parent; only RootChildNode's won't, so they return the local isConnected\n // state\n return this._$parent?._$isConnected ?? this.__isConnected;\n }\n\n // The following fields will be patched onto ChildParts when required by\n // AsyncDirective\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n /** @internal */\n _$notifyConnectionChanged?(\n isConnected: boolean,\n removeFromParent?: boolean,\n from?: number\n ): void;\n /** @internal */\n _$reparentDisconnectables?(parent: Disconnectable): void;\n\n constructor(\n startNode: ChildNode,\n endNode: ChildNode | null,\n parent: TemplateInstance | ChildPart | undefined,\n options: RenderOptions | undefined\n ) {\n this._$startNode = startNode;\n this._$endNode = endNode;\n this._$parent = parent;\n this.options = options;\n // Note __isConnected is only ever accessed on RootParts (i.e. when there is\n // no _$parent); the value on a non-root-part is \"don't care\", but checking\n // for parent would be more code\n this.__isConnected = options?.isConnected ?? true;\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n // Explicitly initialize for consistent class shape.\n this._textSanitizer = undefined;\n }\n }\n\n /**\n * The parent node into which the part renders its content.\n *\n * A ChildPart's content consists of a range of adjacent child nodes of\n * `.parentNode`, possibly bordered by 'marker nodes' (`.startNode` and\n * `.endNode`).\n *\n * - If both `.startNode` and `.endNode` are non-null, then the part's content\n * consists of all siblings between `.startNode` and `.endNode`, exclusively.\n *\n * - If `.startNode` is non-null but `.endNode` is null, then the part's\n * content consists of all siblings following `.startNode`, up to and\n * including the last child of `.parentNode`. If `.endNode` is non-null, then\n * `.startNode` will always be non-null.\n *\n * - If both `.endNode` and `.startNode` are null, then the part's content\n * consists of all child nodes of `.parentNode`.\n */\n get parentNode(): Node {\n let parentNode: Node = wrap(this._$startNode).parentNode!;\n const parent = this._$parent;\n if (\n parent !== undefined &&\n parentNode?.nodeType === 11 /* Node.DOCUMENT_FRAGMENT */\n ) {\n // If the parentNode is a DocumentFragment, it may be because the DOM is\n // still in the cloned fragment during initial render; if so, get the real\n // parentNode the part will be committed into by asking the parent.\n parentNode = (parent as ChildPart | TemplateInstance).parentNode;\n }\n return parentNode;\n }\n\n /**\n * The part's leading marker node, if any. See `.parentNode` for more\n * information.\n */\n get startNode(): Node | null {\n return this._$startNode;\n }\n\n /**\n * The part's trailing marker node, if any. See `.parentNode` for more\n * information.\n */\n get endNode(): Node | null {\n return this._$endNode;\n }\n\n _$setValue(value: unknown, directiveParent: DirectiveParent = this): void {\n if (DEV_MODE && this.parentNode === null) {\n throw new Error(\n `This \\`ChildPart\\` has no \\`parentNode\\` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's \\`innerHTML\\` or \\`textContent\\` can do this.`\n );\n }\n value = resolveDirective(this, value, directiveParent);\n if (isPrimitive(value)) {\n // Non-rendering child values. It's important that these do not render\n // empty text nodes to avoid issues with preventing default <slot>\n // fallback content.\n if (value === nothing || value == null || value === '') {\n if (this._$committedValue !== nothing) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit nothing to child',\n start: this._$startNode,\n end: this._$endNode,\n parent: this._$parent,\n options: this.options,\n });\n this._$clear();\n }\n this._$committedValue = nothing;\n } else if (value !== this._$committedValue && value !== noChange) {\n this._commitText(value);\n }\n // This property needs to remain unminified.\n } else if ((value as TemplateResult)['_$litType$'] !== undefined) {\n this._commitTemplateResult(value as TemplateResult);\n } else if ((value as Node).nodeType !== undefined) {\n if (DEV_MODE && this.options?.host === value) {\n this._commitText(\n `[probable mistake: rendered a template's host in itself ` +\n `(commonly caused by writing \\${this} in a template]`\n );\n console.warn(\n `Attempted to render the template host`,\n value,\n `inside itself. This is almost always a mistake, and in dev mode `,\n `we render some warning text. In production however, we'll `,\n `render it, which will usually result in an error, and sometimes `,\n `in the element disappearing from the DOM.`\n );\n return;\n }\n this._commitNode(value as Node);\n } else if (isIterable(value)) {\n this._commitIterable(value);\n } else {\n // Fallback, will render the string representation\n this._commitText(value);\n }\n }\n\n private _insert<T extends Node>(node: T) {\n return wrap(wrap(this._$startNode).parentNode!).insertBefore(\n node,\n this._$endNode\n );\n }\n\n private _commitNode(value: Node): void {\n if (this._$committedValue !== value) {\n this._$clear();\n if (\n ENABLE_EXTRA_SECURITY_HOOKS &&\n sanitizerFactoryInternal !== noopSanitizer\n ) {\n const parentNodeName = this._$startNode.parentNode?.nodeName;\n if (parentNodeName === 'STYLE' || parentNodeName === 'SCRIPT') {\n let message = 'Forbidden';\n if (DEV_MODE) {\n if (parentNodeName === 'STYLE') {\n message =\n `Lit does not support binding inside style nodes. ` +\n `This is a security risk, as style injection attacks can ` +\n `exfiltrate data and spoof UIs. ` +\n `Consider instead using css\\`...\\` literals ` +\n `to compose styles, and do dynamic styling with ` +\n `css custom properties, ::parts, <slot>s, ` +\n `and by mutating the DOM rather than stylesheets.`;\n } else {\n message =\n `Lit does not support binding inside script nodes. ` +\n `This is a security risk, as it could allow arbitrary ` +\n `code execution.`;\n }\n }\n throw new Error(message);\n }\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit node',\n start: this._$startNode,\n parent: this._$parent,\n value: value,\n options: this.options,\n });\n this._$committedValue = this._insert(value);\n }\n }\n\n private _commitText(value: unknown): void {\n // If the committed value is a primitive it means we called _commitText on\n // the previous render, and we know that this._$startNode.nextSibling is a\n // Text node. We can now just replace the text content (.data) of the node.\n if (\n this._$committedValue !== nothing &&\n isPrimitive(this._$committedValue)\n ) {\n const node = wrap(this._$startNode).nextSibling as Text;\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n if (this._textSanitizer === undefined) {\n this._textSanitizer = createSanitizer(node, 'data', 'property');\n }\n value = this._textSanitizer(value);\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit text',\n node,\n value,\n options: this.options,\n });\n (node as Text).data = value as string;\n } else {\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n const textNode = d.createTextNode('');\n this._commitNode(textNode);\n // When setting text content, for security purposes it matters a lot\n // what the parent is. For example, <style> and <script> need to be\n // handled with care, while <span> does not. So first we need to put a\n // text node into the document, then we can sanitize its content.\n if (this._textSanitizer === undefined) {\n this._textSanitizer = createSanitizer(textNode, 'data', 'property');\n }\n value = this._textSanitizer(value);\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit text',\n node: textNode,\n value,\n options: this.options,\n });\n textNode.data = value as string;\n } else {\n this._commitNode(d.createTextNode(value as string));\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit text',\n node: wrap(this._$startNode).nextSibling as Text,\n value,\n options: this.options,\n });\n }\n }\n this._$committedValue = value;\n }\n\n private _commitTemplateResult(\n result: TemplateResult | CompiledTemplateResult\n ): void {\n // This property needs to remain unminified.\n const {values, ['_$litType$']: type} = result;\n // If $litType$ is a number, result is a plain TemplateResult and we get\n // the template from the template cache. If not, result is a\n // CompiledTemplateResult and _$litType$ is a CompiledTemplate and we need\n // to create the <template> element the first time we see it.\n const template: Template | CompiledTemplate =\n typeof type === 'number'\n ? this._$getTemplate(result as UncompiledTemplateResult)\n : (type.el === undefined &&\n (type.el = Template.createElement(\n trustFromTemplateString(type.h, type.h[0]),\n this.options\n )),\n type);\n\n if ((this._$committedValue as TemplateInstance)?._$template === template) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'template updating',\n template,\n instance: this._$committedValue as TemplateInstance,\n parts: (this._$committedValue as TemplateInstance)._$parts,\n options: this.options,\n values,\n });\n (this._$committedValue as TemplateInstance)._update(values);\n } else {\n const instance = new TemplateInstance(template as Template, this);\n const fragment = instance._clone(this.options);\n debugLogEvent &&\n debugLogEvent({\n kind: 'template instantiated',\n template,\n instance,\n parts: instance._$parts,\n options: this.options,\n fragment,\n values,\n });\n instance._update(values);\n debugLogEvent &&\n debugLogEvent({\n kind: 'template instantiated and updated',\n template,\n instance,\n parts: instance._$parts,\n options: this.options,\n fragment,\n values,\n });\n this._commitNode(fragment);\n this._$committedValue = instance;\n }\n }\n\n // Overridden via `litHtmlPolyfillSupport` to provide platform support.\n /** @internal */\n _$getTemplate(result: UncompiledTemplateResult) {\n let template = templateCache.get(result.strings);\n if (template === undefined) {\n templateCache.set(result.strings, (template = new Template(result)));\n }\n return template;\n }\n\n private _commitIterable(value: Iterable<unknown>): void {\n // For an Iterable, we create a new InstancePart per item, then set its\n // value to the item. This is a little bit of overhead for every item in\n // an Iterable, but it lets us recurse easily and efficiently update Arrays\n // of TemplateResults that will be commonly returned from expressions like:\n // array.map((i) => html`${i}`), by reusing existing TemplateInstances.\n\n // If value is an array, then the previous render was of an\n // iterable and value will contain the ChildParts from the previous\n // render. If value is not an array, clear this part and make a new\n // array for ChildParts.\n if (!isArray(this._$committedValue)) {\n this._$committedValue = [];\n this._$clear();\n }\n\n // Lets us keep track of how many items we stamped so we can clear leftover\n // items from a previous render\n const itemParts = this._$committedValue as ChildPart[];\n let partIndex = 0;\n let itemPart: ChildPart | undefined;\n\n for (const item of value) {\n if (partIndex === itemParts.length) {\n // If no existing part, create a new one\n // TODO (justinfagnani): test perf impact of always creating two parts\n // instead of sharing parts between nodes\n // https://github.com/lit/lit/issues/1266\n itemParts.push(\n (itemPart = new ChildPart(\n this._insert(createMarker()),\n this._insert(createMarker()),\n this,\n this.options\n ))\n );\n } else {\n // Reuse an existing part\n itemPart = itemParts[partIndex];\n }\n itemPart._$setValue(item);\n partIndex++;\n }\n\n if (partIndex < itemParts.length) {\n // itemParts always have end nodes\n this._$clear(\n itemPart && wrap(itemPart._$endNode!).nextSibling,\n partIndex\n );\n // Truncate the parts array so _value reflects the current state\n itemParts.length = partIndex;\n }\n }\n\n /**\n * Removes the nodes contained within this Part from the DOM.\n *\n * @param start Start node to clear from, for clearing a subset of the part's\n * DOM (used when truncating iterables)\n * @param from When `start` is specified, the index within the iterable from\n * which ChildParts are being removed, used for disconnecting directives\n * in those Parts.\n *\n * @internal\n */\n _$clear(\n start: ChildNode | null = wrap(this._$startNode).nextSibling,\n from?: number\n ) {\n this._$notifyConnectionChanged?.(false, true, from);\n while (start !== this._$endNode) {\n // The non-null assertion is safe because if _$startNode.nextSibling is\n // null, then _$endNode is also null, and we would not have entered this\n // loop.\n const n = wrap(start!).nextSibling;\n wrap(start!).remove();\n start = n;\n }\n }\n\n /**\n * Implementation of RootPart's `isConnected`. Note that this method\n * should only be called on `RootPart`s (the `ChildPart` returned from a\n * top-level `render()` call). It has no effect on non-root ChildParts.\n * @param isConnected Whether to set\n * @internal\n */\n setConnected(isConnected: boolean) {\n if (this._$parent === undefined) {\n this.__isConnected = isConnected;\n this._$notifyConnectionChanged?.(isConnected);\n } else if (DEV_MODE) {\n throw new Error(\n 'part.setConnected() may only be called on a ' +\n 'RootPart returned from render().'\n );\n }\n }\n}\n\n/**\n * A top-level `ChildPart` returned from `render` that manages the connected\n * state of `AsyncDirective`s created throughout the tree below it.\n */\nexport interface RootPart extends ChildPart {\n /**\n * Sets the connection state for `AsyncDirective`s contained within this root\n * ChildPart.\n *\n * lit-html does not automatically monitor the connectedness of DOM rendered;\n * as such, it is the responsibility of the caller to `render` to ensure that\n * `part.setConnected(false)` is called before the part object is potentially\n * discarded, to ensure that `AsyncDirective`s have a chance to dispose of\n * any resources being held. If a `RootPart` that was previously\n * disconnected is subsequently re-connected (and its `AsyncDirective`s should\n * re-connect), `setConnected(true)` should be called.\n *\n * @param isConnected Whether directives within this tree should be connected\n * or not\n */\n setConnected(isConnected: boolean): void;\n}\n\nexport type {AttributePart};\nclass AttributePart implements Disconnectable {\n readonly type:\n | typeof ATTRIBUTE_PART\n | typeof PROPERTY_PART\n | typeof BOOLEAN_ATTRIBUTE_PART\n | typeof EVENT_PART = ATTRIBUTE_PART;\n readonly element: HTMLElement;\n readonly name: string;\n readonly options: RenderOptions | undefined;\n\n /**\n * If this attribute part represents an interpolation, this contains the\n * static strings of the interpolation. For single-value, complete bindings,\n * this is undefined.\n */\n readonly strings?: ReadonlyArray<string>;\n /** @internal */\n _$committedValue: unknown | Array<unknown> = nothing;\n /** @internal */\n __directives?: Array<Directive | undefined>;\n /** @internal */\n _$parent: Disconnectable;\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n protected _sanitizer: ValueSanitizer | undefined;\n\n get tagName() {\n return this.element.tagName;\n }\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n constructor(\n element: HTMLElement,\n name: string,\n strings: ReadonlyArray<string>,\n parent: Disconnectable,\n options: RenderOptions | undefined\n ) {\n this.element = element;\n this.name = name;\n this._$parent = parent;\n this.options = options;\n if (strings.length > 2 || strings[0] !== '' || strings[1] !== '') {\n this._$committedValue = new Array(strings.length - 1).fill(new String());\n this.strings = strings;\n } else {\n this._$committedValue = nothing;\n }\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n this._sanitizer = undefined;\n }\n }\n\n /**\n * Sets the value of this part by resolving the value from possibly multiple\n * values and static strings and committing it to the DOM.\n * If this part is single-valued, `this._strings` will be undefined, and the\n * method will be called with a single value argument. If this part is\n * multi-value, `this._strings` will be defined, and the method is called\n * with the value array of the part's owning TemplateInstance, and an offset\n * into the value array from which the values should be read.\n * This method is overloaded this way to eliminate short-lived array slices\n * of the template instance values, and allow a fast-path for single-valued\n * parts.\n *\n * @param value The part value, or an array of values for multi-valued parts\n * @param valueIndex the index to start reading values from. `undefined` for\n * single-valued parts\n * @param noCommit causes the part to not commit its value to the DOM. Used\n * in hydration to prime attribute parts with their first-rendered value,\n * but not set the attribute, and in SSR to no-op the DOM operation and\n * capture the value for serialization.\n *\n * @internal\n */\n _$setValue(\n value: unknown | Array<unknown>,\n directiveParent: DirectiveParent = this,\n valueIndex?: number,\n noCommit?: boolean\n ) {\n const strings = this.strings;\n\n // Whether any of the values has changed, for dirty-checking\n let change = false;\n\n if (strings === undefined) {\n // Single-value binding case\n value = resolveDirective(this, value, directiveParent, 0);\n change =\n !isPrimitive(value) ||\n (value !== this._$committedValue && value !== noChange);\n if (change) {\n this._$committedValue = value;\n }\n } else {\n // Interpolation case\n const values = value as Array<unknown>;\n value = strings[0];\n\n let i, v;\n for (i = 0; i < strings.length - 1; i++) {\n v = resolveDirective(this, values[valueIndex! + i], directiveParent, i);\n\n if (v === noChange) {\n // If the user-provided value is `noChange`, use the previous value\n v = (this._$committedValue as Array<unknown>)[i];\n }\n change ||=\n !isPrimitive(v) || v !== (this._$committedValue as Array<unknown>)[i];\n if (v === nothing) {\n value = nothing;\n } else if (value !== nothing) {\n value += (v ?? '') + strings[i + 1];\n }\n // We always record each value, even if one is `nothing`, for future\n // change detection.\n (this._$committedValue as Array<unknown>)[i] = v;\n }\n }\n if (change && !noCommit) {\n this._commitValue(value);\n }\n }\n\n /** @internal */\n _commitValue(value: unknown) {\n if (value === nothing) {\n (wrap(this.element) as Element).removeAttribute(this.name);\n } else {\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n if (this._sanitizer === undefined) {\n this._sanitizer = sanitizerFactoryInternal(\n this.element,\n this.name,\n 'attribute'\n );\n }\n value = this._sanitizer(value ?? '');\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit attribute',\n element: this.element,\n name: this.name,\n value,\n options: this.options,\n });\n (wrap(this.element) as Element).setAttribute(\n this.name,\n (value ?? '') as string\n );\n }\n }\n}\n\nexport type {PropertyPart};\nclass PropertyPart extends AttributePart {\n override readonly type = PROPERTY_PART;\n\n /** @internal */\n override _commitValue(value: unknown) {\n if (ENABLE_EXTRA_SECURITY_HOOKS) {\n if (this._sanitizer === undefined) {\n this._sanitizer = sanitizerFactoryInternal(\n this.element,\n this.name,\n 'property'\n );\n }\n value = this._sanitizer(value);\n }\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit property',\n element: this.element,\n name: this.name,\n value,\n options: this.options,\n });\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this.element as any)[this.name] = value === nothing ? undefined : value;\n }\n}\n\nexport type {BooleanAttributePart};\nclass BooleanAttributePart extends AttributePart {\n override readonly type = BOOLEAN_ATTRIBUTE_PART;\n\n /** @internal */\n override _commitValue(value: unknown) {\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit boolean attribute',\n element: this.element,\n name: this.name,\n value: !!(value && value !== nothing),\n options: this.options,\n });\n (wrap(this.element) as Element).toggleAttribute(\n this.name,\n !!value && value !== nothing\n );\n }\n}\n\ntype EventListenerWithOptions = EventListenerOrEventListenerObject &\n Partial<AddEventListenerOptions>;\n\n/**\n * An AttributePart that manages an event listener via add/removeEventListener.\n *\n * This part works by adding itself as the event listener on an element, then\n * delegating to the value passed to it. This reduces the number of calls to\n * add/removeEventListener if the listener changes frequently, such as when an\n * inline function is used as a listener.\n *\n * Because event options are passed when adding listeners, we must take case\n * to add and remove the part as a listener when the event options change.\n */\nexport type {EventPart};\nclass EventPart extends AttributePart {\n override readonly type = EVENT_PART;\n\n constructor(\n element: HTMLElement,\n name: string,\n strings: ReadonlyArray<string>,\n parent: Disconnectable,\n options: RenderOptions | undefined\n ) {\n super(element, name, strings, parent, options);\n\n if (DEV_MODE && this.strings !== undefined) {\n throw new Error(\n `A \\`<${element.localName}>\\` has a \\`@${name}=...\\` listener with ` +\n 'invalid content. Event listeners in templates must have exactly ' +\n 'one expression and no surrounding text.'\n );\n }\n }\n\n // EventPart does not use the base _$setValue/_resolveValue implementation\n // since the dirty checking is more complex\n /** @internal */\n override _$setValue(\n newListener: unknown,\n directiveParent: DirectiveParent = this\n ) {\n newListener =\n resolveDirective(this, newListener, directiveParent, 0) ?? nothing;\n if (newListener === noChange) {\n return;\n }\n const oldListener = this._$committedValue;\n\n // If the new value is nothing or any options change we have to remove the\n // part as a listener.\n const shouldRemoveListener =\n (newListener === nothing && oldListener !== nothing) ||\n (newListener as EventListenerWithOptions).capture !==\n (oldListener as EventListenerWithOptions).capture ||\n (newListener as EventListenerWithOptions).once !==\n (oldListener as EventListenerWithOptions).once ||\n (newListener as EventListenerWithOptions).passive !==\n (oldListener as EventListenerWithOptions).passive;\n\n // If the new value is not nothing and we removed the listener, we have\n // to add the part as a listener.\n const shouldAddListener =\n newListener !== nothing &&\n (oldListener === nothing || shouldRemoveListener);\n\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit event listener',\n element: this.element,\n name: this.name,\n value: newListener,\n options: this.options,\n removeListener: shouldRemoveListener,\n addListener: shouldAddListener,\n oldListener,\n });\n if (shouldRemoveListener) {\n this.element.removeEventListener(\n this.name,\n this,\n oldListener as EventListenerWithOptions\n );\n }\n if (shouldAddListener) {\n this.element.addEventListener(\n this.name,\n this,\n newListener as EventListenerWithOptions\n );\n }\n this._$committedValue = newListener;\n }\n\n handleEvent(event: Event) {\n if (typeof this._$committedValue === 'function') {\n this._$committedValue.call(this.options?.host ?? this.element, event);\n } else {\n (this._$committedValue as EventListenerObject).handleEvent(event);\n }\n }\n}\n\nexport type {ElementPart};\nclass ElementPart implements Disconnectable {\n readonly type = ELEMENT_PART;\n\n /** @internal */\n __directive?: Directive;\n\n // This is to ensure that every Part has a _$committedValue\n _$committedValue: undefined;\n\n /** @internal */\n _$parent!: Disconnectable;\n\n /** @internal */\n _$disconnectableChildren?: Set<Disconnectable> = undefined;\n\n options: RenderOptions | undefined;\n\n constructor(\n public element: Element,\n parent: Disconnectable,\n options: RenderOptions | undefined\n ) {\n this._$parent = parent;\n this.options = options;\n }\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n _$setValue(value: unknown): void {\n debugLogEvent &&\n debugLogEvent({\n kind: 'commit to element binding',\n element: this.element,\n value,\n options: this.options,\n });\n resolveDirective(this, value);\n }\n}\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * Private exports for use by other Lit packages, not intended for use by\n * external users.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports mangled in the\n * client side code, we export a _$LH object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n *\n * This has a unique name, to disambiguate it from private exports in\n * lit-element, which re-exports all of lit-html.\n *\n * @private\n */\nexport const _$LH = {\n // Used in lit-ssr\n _boundAttributeSuffix: boundAttributeSuffix,\n _marker: marker,\n _markerMatch: markerMatch,\n _HTML_RESULT: HTML_RESULT,\n _getTemplateHtml: getTemplateHtml,\n // Used in tests and private-ssr-support\n _TemplateInstance: TemplateInstance,\n _isIterable: isIterable,\n _resolveDirective: resolveDirective,\n _ChildPart: ChildPart,\n _AttributePart: AttributePart,\n _BooleanAttributePart: BooleanAttributePart,\n _EventPart: EventPart,\n _PropertyPart: PropertyPart,\n _ElementPart: ElementPart,\n};\n\n// Apply polyfills if available\nconst polyfillSupport = DEV_MODE\n ? global.litHtmlPolyfillSupportDevMode\n : global.litHtmlPolyfillSupport;\npolyfillSupport?.(Template, ChildPart);\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for lit-html usage.\n(global.litHtmlVersions ??= []).push('3.3.3');\nif (DEV_MODE && global.litHtmlVersions.length > 1) {\n queueMicrotask(() => {\n issueWarning!(\n 'multiple-versions',\n `Multiple versions of Lit loaded. ` +\n `Loading multiple versions is not recommended.`\n );\n });\n}\n\n/**\n * Renders a value, usually a lit-html TemplateResult, to the container.\n *\n * This example renders the text \"Hello, Zoe!\" inside a paragraph tag, appending\n * it to the container `document.body`.\n *\n * ```js\n * import {html, render} from 'lit';\n *\n * const name = \"Zoe\";\n * render(html`<p>Hello, ${name}!</p>`, document.body);\n * ```\n *\n * @param value Any [renderable\n * value](https://lit.dev/docs/templates/expressions/#child-expressions),\n * typically a {@linkcode TemplateResult} created by evaluating a template tag\n * like {@linkcode html} or {@linkcode svg}.\n * @param container A DOM container to render to. The first render will append\n * the rendered value to the container, and subsequent renders will\n * efficiently update the rendered value if the same result type was\n * previously rendered there.\n * @param options See {@linkcode RenderOptions} for options documentation.\n * @see\n * {@link https://lit.dev/docs/libraries/standalone-templates/#rendering-lit-html-templates| Rendering Lit HTML Templates}\n */\nexport const render = (\n value: unknown,\n container: RenderRootNode,\n options?: RenderOptions\n): RootPart => {\n if (DEV_MODE && container == null) {\n // Give a clearer error message than\n // Uncaught TypeError: Cannot read properties of null (reading\n // '_$litPart$')\n // which reads like an internal Lit error.\n throw new TypeError(`The container to render into may not be ${container}`);\n }\n const renderId = DEV_MODE ? debugLogRenderId++ : 0;\n const partOwnerNode = options?.renderBefore ?? container;\n // This property needs to remain unminified.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let part: ChildPart = (partOwnerNode as any)['_$litPart$'];\n debugLogEvent &&\n debugLogEvent({\n kind: 'begin render',\n id: renderId,\n value,\n container,\n options,\n part,\n });\n if (part === undefined) {\n const endNode = options?.renderBefore ?? null;\n // This property needs to remain unminified.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (partOwnerNode as any)['_$litPart$'] = part = new ChildPart(\n container.insertBefore(createMarker(), endNode),\n endNode,\n undefined,\n options ?? {}\n );\n }\n part._$setValue(value);\n debugLogEvent &&\n debugLogEvent({\n kind: 'end render',\n id: renderId,\n value,\n container,\n options,\n part,\n });\n return part as RootPart;\n};\n\nif (ENABLE_EXTRA_SECURITY_HOOKS) {\n render.setSanitizer = setSanitizer;\n render.createSanitizer = createSanitizer;\n if (DEV_MODE) {\n render._testOnlyClearSanitizerFactoryDoNotCallOrElse =\n _testOnlyClearSanitizerFactoryDoNotCallOrElse;\n }\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * The main LitElement module, which defines the {@linkcode LitElement} base\n * class and related APIs.\n *\n * LitElement components can define a template and a set of observed\n * properties. Changing an observed property triggers a re-render of the\n * element.\n *\n * Import {@linkcode LitElement} and {@linkcode html} from this module to\n * create a component:\n *\n * ```js\n * import {LitElement, html} from 'lit-element';\n *\n * class MyElement extends LitElement {\n *\n * // Declare observed properties\n * static get properties() {\n * return {\n * adjective: {}\n * }\n * }\n *\n * constructor() {\n * this.adjective = 'awesome';\n * }\n *\n * // Define the element's template\n * render() {\n * return html`<p>your ${adjective} template here</p>`;\n * }\n * }\n *\n * customElements.define('my-element', MyElement);\n * ```\n *\n * `LitElement` extends {@linkcode ReactiveElement} and adds lit-html\n * templating. The `ReactiveElement` class is provided for users that want to\n * build their own custom element base classes that don't use lit-html.\n *\n * @packageDocumentation\n */\nimport {PropertyValues, ReactiveElement} from '@lit/reactive-element';\nimport {render, RenderOptions, noChange, RootPart} from 'lit-html';\nexport * from '@lit/reactive-element';\nexport * from 'lit-html';\n\nimport {LitUnstable} from 'lit-html';\nimport {ReactiveUnstable} from '@lit/reactive-element';\n\n/**\n * Contains types that are part of the unstable debug API.\n *\n * Everything in this API is not stable and may change or be removed in the future,\n * even on patch releases.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace Unstable {\n /**\n * When Lit is running in dev mode and `window.emitLitDebugLogEvents` is true,\n * we will emit 'lit-debug' events to window, with live details about the update and render\n * lifecycle. These can be useful for writing debug tooling and visualizations.\n *\n * Please be aware that running with window.emitLitDebugLogEvents has performance overhead,\n * making certain operations that are normally very cheap (like a no-op render) much slower,\n * because we must copy data and dispatch events.\n */\n // eslint-disable-next-line @typescript-eslint/no-namespace\n export namespace DebugLog {\n export type Entry =\n | LitUnstable.DebugLog.Entry\n | ReactiveUnstable.DebugLog.Entry;\n }\n}\n/*\n * When using Closure Compiler, JSCompiler_renameProperty(property, object) is\n * replaced at compile time by the munged name for object[property]. We cannot\n * alias this function, so we have to use a small shim that has the same\n * behavior when not compiling.\n */\n/*@__INLINE__*/\nconst JSCompiler_renameProperty = <P extends PropertyKey>(\n prop: P,\n _obj: unknown\n): P => prop;\n\nconst DEV_MODE = true;\n// Allows minifiers to rename references to globalThis\nconst global = globalThis;\n\nlet issueWarning: (code: string, warning: string) => void;\n\nif (DEV_MODE) {\n // Ensure warnings are issued only 1x, even if multiple versions of Lit\n // are loaded.\n global.litIssuedWarnings ??= new Set();\n\n /**\n * Issue a warning if we haven't already, based either on `code` or `warning`.\n * Warnings are disabled automatically only by `warning`; disabling via `code`\n * can be done by users.\n */\n issueWarning = (code: string, warning: string) => {\n warning += ` See https://lit.dev/msg/${code} for more information.`;\n if (\n !global.litIssuedWarnings!.has(warning) &&\n !global.litIssuedWarnings!.has(code)\n ) {\n console.warn(warning);\n global.litIssuedWarnings!.add(warning);\n }\n };\n}\n\n/**\n * Base element class that manages element properties and attributes, and\n * renders a lit-html template.\n *\n * To define a component, subclass `LitElement` and implement a\n * `render` method to provide the component's template. Define properties\n * using the {@linkcode LitElement.properties properties} property or the\n * {@linkcode property} decorator.\n */\nexport class LitElement extends ReactiveElement {\n // This property needs to remain unminified.\n static ['_$litElement$'] = true;\n\n /**\n * @category rendering\n */\n readonly renderOptions: RenderOptions = {host: this};\n\n private __childPart: RootPart | undefined = undefined;\n\n /**\n * @category rendering\n */\n protected override createRenderRoot() {\n const renderRoot = super.createRenderRoot();\n // When adoptedStyleSheets are shimmed, they are inserted into the\n // shadowRoot by createRenderRoot. Adjust the renderBefore node so that\n // any styles in Lit content render before adoptedStyleSheets. This is\n // important so that adoptedStyleSheets have precedence over styles in\n // the shadowRoot.\n this.renderOptions.renderBefore ??= renderRoot!.firstChild as ChildNode;\n return renderRoot;\n }\n\n /**\n * Updates the element. This method reflects property values to attributes\n * and calls `render` to render DOM via lit-html. Setting properties inside\n * this method will *not* trigger another update.\n * @param changedProperties Map of changed properties with old values\n * @category updates\n */\n protected override update(changedProperties: PropertyValues) {\n // Setting properties in `render` should not trigger an update. Since\n // updates are allowed after super.update, it's important to call `render`\n // before that.\n const value = this.render();\n if (!this.hasUpdated) {\n this.renderOptions.isConnected = this.isConnected;\n }\n super.update(changedProperties);\n this.__childPart = render(value, this.renderRoot, this.renderOptions);\n }\n\n /**\n * Invoked when the component is added to the document's DOM.\n *\n * In `connectedCallback()` you should setup tasks that should only occur when\n * the element is connected to the document. The most common of these is\n * adding event listeners to nodes external to the element, like a keydown\n * event handler added to the window.\n *\n * ```ts\n * connectedCallback() {\n * super.connectedCallback();\n * addEventListener('keydown', this._handleKeydown);\n * }\n * ```\n *\n * Typically, anything done in `connectedCallback()` should be undone when the\n * element is disconnected, in `disconnectedCallback()`.\n *\n * @category lifecycle\n */\n override connectedCallback() {\n super.connectedCallback();\n this.__childPart?.setConnected(true);\n }\n\n /**\n * Invoked when the component is removed from the document's DOM.\n *\n * This callback is the main signal to the element that it may no longer be\n * used. `disconnectedCallback()` should ensure that nothing is holding a\n * reference to the element (such as event listeners added to nodes external\n * to the element), so that it is free to be garbage collected.\n *\n * ```ts\n * disconnectedCallback() {\n * super.disconnectedCallback();\n * window.removeEventListener('keydown', this._handleKeydown);\n * }\n * ```\n *\n * An element may be re-connected after being disconnected.\n *\n * @category lifecycle\n */\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.__childPart?.setConnected(false);\n }\n\n /**\n * Invoked on each update to perform rendering tasks. This method may return\n * any value renderable by lit-html's `ChildPart` - typically a\n * `TemplateResult`. Setting properties inside this method will *not* trigger\n * the element to update.\n * @category rendering\n */\n protected render(): unknown {\n return noChange;\n }\n}\n\n/**\n * Ensure this class is marked as `finalized` as an optimization ensuring\n * it will not needlessly try to `finalize`.\n *\n * Note this property name is a string to prevent breaking Closure JS Compiler\n * optimizations. See @lit/reactive-element for more information.\n */\n(LitElement as unknown as Record<string, unknown>)[\n JSCompiler_renameProperty('finalized', LitElement)\n] = true;\n\n// Install hydration if available\nglobal.litElementHydrateSupport?.({LitElement});\n\n// Apply polyfills if available\nconst polyfillSupport = DEV_MODE\n ? global.litElementPolyfillSupportDevMode\n : global.litElementPolyfillSupport;\npolyfillSupport?.({LitElement});\n\n/**\n * END USERS SHOULD NOT RELY ON THIS OBJECT.\n *\n * Private exports for use by other Lit packages, not intended for use by\n * external users.\n *\n * We currently do not make a mangled rollup build of the lit-ssr code. In order\n * to keep a number of (otherwise private) top-level exports mangled in the\n * client side code, we export a _$LE object containing those members (or\n * helper methods for accessing private fields of those members), and then\n * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the\n * client-side code is being used in `dev` mode or `prod` mode.\n *\n * This has a unique name, to disambiguate it from private exports in\n * lit-html, since this module re-exports all of lit-html.\n *\n * @private\n */\nexport const _$LE = {\n _$attributeToProperty: (\n el: LitElement,\n name: string,\n value: string | null\n ) => {\n // eslint-disable-next-line\n (el as any)._$attributeToProperty(name, value);\n },\n // eslint-disable-next-line\n _$changedProperties: (el: LitElement) => (el as any)._$changedProperties,\n};\n\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for LitElement usage.\n(global.litElementVersions ??= []).push('4.2.2');\nif (DEV_MODE && global.litElementVersions.length > 1) {\n queueMicrotask(() => {\n issueWarning!(\n 'multiple-versions',\n `Multiple versions of Lit loaded. Loading multiple versions ` +\n `is not recommended.`\n );\n });\n}\n", "\nimport {AttrValue} from \"../../types.js\"\n\n/** get html attributes */\nexport const attrGet = {\n\tstring: (e: HTMLElement, key: string) => {\n\t\treturn e.getAttribute(key) ?? undefined\n\t},\n\tnumber: (e: HTMLElement, key: string) => {\n\t\tconst raw = e.getAttribute(key)\n\t\treturn (raw === null || !raw)\n\t\t\t? undefined\n\t\t\t: Number(raw)\n\t},\n\tboolean: (e: HTMLElement, key: string) => {\n\t\tconst raw = e.getAttribute(key)\n\t\treturn raw !== null\n\t},\n}\n\n/** set html attributes */\nexport const attrSet = {\n\tstring: (e: HTMLElement, key: string, value: string | undefined) => {\n\t\tif (value === undefined) e.removeAttribute(key)\n\t\telse e.setAttribute(key, value)\n\t\treturn true\n\t},\n\tnumber: (e: HTMLElement, key: string, value: number | undefined) => {\n\t\tif (value === undefined) e.removeAttribute(key)\n\t\telse e.setAttribute(key, value.toString())\n\t\treturn true\n\t},\n\tboolean: (e: HTMLElement, key: string, value: boolean | undefined) => {\n\t\tif (value) e.setAttribute(key, \"\")\n\t\telse e.removeAttribute(key)\n\t\treturn true\n\t},\n\n\tany: (element: HTMLElement, key: string, value: AttrValue) => {\n\t\tif (value === undefined || value === null)\n\t\t\telement.removeAttribute(key)\n\n\t\telse if (typeof value === \"string\")\n\t\t\telement.setAttribute(key, value)\n\n\t\telse if (typeof value === \"number\")\n\t\t\telement.setAttribute(key, value.toString())\n\n\t\telse if (typeof value === \"boolean\") {\n\t\t\tif (value === true)\n\t\t\t\telement.setAttribute(key, \"\")\n\t\t\telse\n\t\t\t\telement.removeAttribute(key)\n\t\t}\n\n\t\telse console.warn(`invalid attribute \"${key}\" type is \"${typeof value}\"`)\n\t},\n\n\tentries: (element: HTMLElement, entries: Iterable<[key: string, value: AttrValue]>) => {\n\t\tfor (const [key, value] of entries)\n\t\t\tattrSet.any(element, key, value)\n\t},\n\n\trecord: (element: HTMLElement, record: Record<string, AttrValue>) => {\n\t\treturn attrSet.entries(element, Object.entries(record))\n\t},\n}\n\n", "\nimport {AttrValue} from \"../types.js\"\nimport {attrSet} from \"../attrs/parts/attr-fns.js\"\n\nexport function el<E extends HTMLElement>(\n\t\ttagName: string,\n\t\tattrs: Record<string, AttrValue> = {},\n\t) {\n\n\tconst element = document.createElement(tagName) as E\n\tattrSet.record(element, attrs)\n\treturn element\n}\n\n", "\nimport {render, TemplateResult} from \"lit\"\n\nexport function mk<E extends Element = HTMLElement>(template: TemplateResult) {\n\tconst fragment = document.createDocumentFragment()\n\trender(template, fragment)\n\treturn fragment.firstElementChild as E\n}\n\n", "\nexport type EveFn = (event: any) => void\nexport type EveConfig = [options: AddEventListenerOptions, fn: EveFn]\nexport type EveHandler = EveFn | EveConfig\nexport type EveSpec = {[eventName: string]: EveHandler}\n\nexport function eve(target: EventTarget, events: EveSpec) {\n\tlet detachers: (() => void)[] = []\n\n\tfor (const [eventName, handler] of Object.entries(events)) {\n\t\tif (typeof handler === \"function\") {\n\t\t\ttarget.addEventListener(eventName, handler)\n\t\t\tdetachers.push(() => target.removeEventListener(eventName, handler))\n\t\t}\n\t\telse {\n\t\t\tconst [options, fn] = handler\n\t\t\ttarget.addEventListener(eventName, fn, options)\n\t\t\tdetachers.push(() => target.removeEventListener(eventName, fn))\n\t\t}\n\t}\n\n\treturn () => detachers.forEach(d => d())\n}\n\n", "\n/** respond when any attribute changes on the html element */\nexport function onAttrs(element: HTMLElement, fn: MutationCallback) {\n\tconst observer = new MutationObserver(fn)\n\tobserver.observe(element, {attributes: true})\n\treturn () => observer.disconnect()\n}\n\n", "\nimport {attrGet, attrSet} from \"./attr-fns.js\"\n\n/** a typed proxy accessor for html attributes */\nexport class AttrProxies {\n\tconstructor(public element: HTMLElement) {}\n\n\tstrings = new Proxy({}, {\n\t\tget: (_t, key: string) => (\n\t\t\tattrGet.string(this.element, key)\n\t\t),\n\t\tset: (_t, key: string, value: string | undefined) => (\n\t\t\tattrSet.string(this.element, key, value)\n\t\t),\n\t}) as Record<string, string | undefined>\n\n\tnumbers = new Proxy({}, {\n\t\tget: (_t, key: string) => (\n\t\t\tattrGet.number(this.element, key)\n\t\t),\n\t\tset: (_t, key: string, value: number | undefined) => (\n\t\t\tattrSet.number(this.element, key, value)\n\t\t),\n\t}) as Record<string, number | undefined>\n\n\tbooleans = new Proxy({}, {\n\t\tget: (_t, key: string) => (\n\t\t\tattrGet.boolean(this.element, key)\n\t\t),\n\t\tset: (_t, key: string, value: boolean | undefined) => (\n\t\t\tattrSet.boolean(this.element, key, value)\n\t\t),\n\t}) as Record<string, boolean | undefined>\n}\n\n", "\nimport {attrGet, attrSet} from \"./attr-fns.js\"\nimport {AttrSpec, AttrTypes} from \"../../types.js\"\n\nexport type AttrSpecOptions = {\n\tbeforeSet?: (attrKey: string) => void\n\tafterSet?: (attrKey: string) => void\n}\n\n/** specify available html attributes and their types and create a proxy accessor */\nexport const attrSpec = <A extends AttrSpec>(\n\t\te: HTMLElement,\n\t\tspec: A,\n\t\toptions: AttrSpecOptions = {},\n\t) => new Proxy(spec, {\n\n\tget: (_target, key: string) => {\n\t\tswitch (spec[key]) {\n\t\t\tcase String: return attrGet.string(e, key)\n\t\t\tcase Number: return attrGet.number(e, key)\n\t\t\tcase Boolean: return attrGet.boolean(e, key)\n\t\t\tdefault: throw new Error(`invalid attribute type for \"${key}\"`)\n\t\t}\n\t},\n\n\tset: (_target, key: string, value: any) => {\n\t\ttry {\n\t\t\toptions.beforeSet?.(key)\n\t\t\tswitch (spec[key]) {\n\t\t\t\tcase String: return attrSet.string(e, key, value)\n\t\t\t\tcase Number: return attrSet.number(e, key, value)\n\t\t\t\tcase Boolean: return attrSet.boolean(e, key, value)\n\t\t\t\tdefault: throw new Error(`invalid attribute type for \"${key}\"`)\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\toptions.afterSet?.(key)\n\t\t}\n\t},\n}) as any as AttrTypes<A>\n\n", "\nimport {AttrSpec} from \"../types.js\"\nimport {onAttrs} from \"./parts/on-attrs.js\"\nimport {AttrProxies} from \"./parts/attr-proxies.js\"\nimport {attrGet, attrSet} from \"./parts/attr-fns.js\"\nimport {attrSpec, AttrSpecOptions} from \"./parts/attr-spec.js\"\n\nexport function attrs(element: HTMLElement) {\n\tconst proxies = new AttrProxies(element)\n\treturn {\n\t\tstrings: proxies.strings,\n\t\tnumbers: proxies.numbers,\n\t\tbooleans: proxies.booleans,\n\t\ton: (fn: MutationCallback) => onAttrs(element, fn),\n\t\tspec: <A extends AttrSpec>(spec: A, options: AttrSpecOptions = {}) => attrSpec(element, spec, options),\n\t}\n}\n\nattrs.get = attrGet\nattrs.set = attrSet\n\n", "\nimport {AttrValue} from \"../types.js\"\nimport {attrSet} from \"../attrs/parts/attr-fns.js\"\n\nexport function elmer<E extends HTMLElement = HTMLElement>(tagName: string) {\n\treturn new Elmer<E>(tagName)\n}\n\nexport class Elmer<E extends HTMLElement = HTMLElement> {\n\t#attrs = new Map<string, AttrValue>()\n\t#children: (Node | string)[] = []\n\n\tconstructor(public tagName: string) {}\n\n\tattr(key: string, value: AttrValue = true) {\n\t\tthis.#attrs.set(key, value)\n\t\treturn this\n\t}\n\n\tattrs(record: Record<string, AttrValue>) {\n\t\tfor (const [key, value] of Object.entries(record))\n\t\t\tthis.attr(key, value)\n\t\treturn this\n\t}\n\n\tchildren(...elements: (Node | string)[]) {\n\t\tthis.#children.push(...elements)\n\t\treturn this\n\t}\n\n\tdone() {\n\t\tconst element = document.createElement(this.tagName)\n\t\tattrSet.entries(element, this.#attrs)\n\t\telement.append(...this.#children)\n\t\treturn element as E\n\t}\n}\n\n", "\nimport {Queryable} from \"../types.js\"\n\nexport function queryRequire<E extends Element>(\n\t\tselector: string,\n\t\tcontainer: Queryable = document,\n\t) {\n\tconst e = container.querySelector<E>(selector)\n\tif (!e) throw new Error(`element not found (${selector})`)\n\treturn e\n}\n\nexport function queryMaybe<E extends Element>(\n\t\tselector: string,\n\t\tcontainer: Queryable = document,\n\t) {\n\treturn container.querySelector<E>(selector)\n}\n\nexport function queryAll<E extends Element>(\n\t\tselector: string,\n\t\tcontainer: Queryable = document,\n\t) {\n\treturn Array.from(container.querySelectorAll<E>(selector))\n}\n\n", "\nimport {render} from \"lit\"\nimport {eve, EveSpec} from \"./eve.js\"\nimport {attrs} from \"../attrs/attrs.js\"\nimport {Content} from \"../../view/types.js\"\nimport {Attrs, Queryable, Renderable} from \"../types.js\"\nimport {queryAll, queryMaybe, queryRequire} from \"./queries.js\"\n\nexport class Dom<C extends Queryable> {\n\t#attrs?: Attrs\n\n\tconstructor(public element: C) {}\n\n\tin<E extends Queryable>(selectorOrElement: string | E) {\n\t\treturn new Dom<E>(\n\t\t\t(typeof selectorOrElement === \"string\")\n\t\t\t\t? queryRequire(selectorOrElement, this.element) as E\n\t\t\t\t: selectorOrElement\n\t\t)\n\t}\n\n\trequire<E extends Element = HTMLElement>(selector: string) {\n\t\treturn queryRequire<E>(selector, this.element)\n\t}\n\n\tmaybe<E extends Element = HTMLElement>(selector: string) {\n\t\treturn queryMaybe<E>(selector, this.element)\n\t}\n\n\tall<E extends Element = HTMLElement>(selector: string) {\n\t\treturn queryAll<E>(selector, this.element)\n\t}\n\n\trender(...content: Content[]) {\n\t\treturn render(content, this.element as Renderable)\n\t}\n\n\tget attrs(): Attrs {\n\t\treturn this.#attrs ??= attrs(this.element as HTMLElement)\n\t}\n\n\tevents(spec: EveSpec) {\n\t\treturn eve(this.element, spec)\n\t}\n}\n\n", "\nimport {render} from \"lit\"\nimport {el} from \"./parts/el.js\"\nimport {mk} from \"./parts/mk.js\"\nimport {eve} from \"./parts/eve.js\"\nimport {attrs} from \"./attrs/attrs.js\"\nimport {elmer} from \"./parts/elmer.js\"\nimport {Content} from \"../view/types.js\"\nimport {Dom} from \"./parts/dom-scope.js\"\nimport {Queryable, Renderable} from \"./types.js\"\nimport {register} from \"./standalone/register.js\"\nimport {queryAll, queryMaybe, queryRequire} from \"./parts/queries.js\"\n\nexport function dom<E extends HTMLElement>(selector: string, container: Queryable = document) {\n\treturn queryRequire<E>(selector, container)\n}\n\ndom.in = <E extends Queryable>(selectorOrElement: string | E, container: Queryable = document) => {\n\treturn new Dom(container).in(selectorOrElement)\n}\n\ndom.need = queryRequire\ndom.maybe = queryMaybe\ndom.all = queryAll\n\ndom.el = el\ndom.elmer = elmer\ndom.mk = mk\ndom.events = eve\ndom.attrs = attrs\ndom.register = register\ndom.render = (container: Renderable, ...content: Content[]) => {\n\treturn render(content, container)\n}\n\n", "\nexport * from \"./drag-and-drops.js\"\nexport * from \"./drops.js\"\nexport * from \"./helpers.js\"\n\n", "\nexport const bytes = Object.freeze({\n\teq(a: Uint8Array, b: Uint8Array) {\n\t\tif (a.length !== b.length) return false\n\t\tlet diff = 0\n\t\tfor (let i = 0; i < a.length; i++) diff |= a[i] ^ b[i]\n\t\treturn diff === 0\n\t},\n\n\trandom(count: number) {\n\t\treturn crypto.getRandomValues(new Uint8Array(count))\n\t},\n\n\tconcat(parts: Uint8Array[]) {\n\t\tlet size = 0\n\t\tfor (const part of parts) size += part.byteLength\n\n\t\tconst bytes = new Uint8Array(size)\n\n\t\tlet offset = 0\n\t\tfor (const part of parts) {\n\t\t\tbytes.set(part, offset)\n\t\t\toffset += part.byteLength\n\t\t}\n\n\t\treturn bytes as Uint8Array\n\t},\n})\n\n", "\nimport {bytes} from \"./bytes.js\"\n\nexport type Lexicon = {\n\tcharacters: string\n\tnegativePrefix?: string\n\tcaseInsensitive?: boolean\n\tpadding?: {\n\t\tcharacter: string\n\t\tsize: number\n\t}\n}\n\nexport interface BaseX {\n\t(bytes: Uint8Array): string\n}\n\nexport class BaseX {\n\tstatic lexicons = Object.freeze({\n\t\tbase2: {characters: \"01\"},\n\t\thex: {characters: \"0123456789abcdef\", caseInsensitive: true},\n\t\tbase36: {characters: \"0123456789abcdefghijklmnopqrstuvwxyz\"},\n\t\tbase58: {characters: \"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\"},\n\t\tbase62: {characters: \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\"},\n\t\tbase64url: {\n\t\t\tnegativePrefix: \"~\",\n\t\t\tcharacters: \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\",\n\t\t},\n\t\tbase64: {\n\t\t\tcharacters: \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",\n\t\t\tpadding: {character: \"=\", size: 4},\n\t\t},\n\t})\n\n\tprivate lookup: Record<string, number>\n\tprivate negativePrefix: string\n\n\tconstructor(public lexicon: Lexicon) {\n\t\tthis.lookup = Object.fromEntries(\n\t\t\t[...lexicon.characters].map((char, i) => [char, i])\n\t\t)\n\t\tthis.negativePrefix = lexicon.negativePrefix ?? \"-\"\n\n\t\tconst fn = this.fromBytes.bind(this)\n\t\tObject.setPrototypeOf(fn, new.target.prototype)\n\t\tObject.assign(fn, this)\n\t\treturn fn as BaseX\n\t}\n\n\ttoBytes(s: string): Uint8Array {\n\t\tif (this.lexicon.caseInsensitive) s = s.toLowerCase()\n\t\tconst bitsPerChar = Math.log2(this.lexicon.characters.length)\n\t\tif (Number.isInteger(bitsPerChar)) {\n\t\t\t// Bitstream mode (for power-of-2 lexicons)\n\t\t\tlet bitBuffer = 0\n\t\t\tlet bitCount = 0\n\t\t\tconst output: number[] = []\n\n\t\t\tfor (const char of s) {\n\t\t\t\tif (char === this.lexicon.padding?.character) continue\n\t\t\t\tconst val = this.lookup[char]\n\t\t\t\tif (val === undefined) throw new Error(`Invalid character: ${char}`)\n\t\t\t\tbitBuffer = (bitBuffer << bitsPerChar) | val\n\t\t\t\tbitCount += bitsPerChar\n\n\t\t\t\twhile (bitCount >= 8) {\n\t\t\t\t\tbitCount -= 8\n\t\t\t\t\toutput.push((bitBuffer >> bitCount) & 0xFF)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn new Uint8Array(output)\n\t\t}\n\n\t\t// Radix mode fallback\n\t\tlet num = 0n\n\t\tconst base = BigInt(this.lexicon.characters.length)\n\t\tif (s.startsWith(this.negativePrefix)) {\n\t\t\ts = s.slice(this.negativePrefix.length)\n\t\t}\n\t\tconst zeroCharacter = this.lexicon.characters[0]\n\t\tlet leadingZeroBytes = 0\n\t\twhile (s[leadingZeroBytes] === zeroCharacter)\n\t\t\tleadingZeroBytes++\n\t\ts = s.slice(leadingZeroBytes)\n\t\tfor (const char of s) {\n\t\t\tconst val = this.lookup[char]\n\t\t\tif (val === undefined) throw new Error(`Invalid character: ${char}`)\n\t\t\tnum = num * base + BigInt(val)\n\t\t}\n\t\tconst out = new Uint8Array(leadingZeroBytes + (num === 0n ? 0 : this.countBytes(num)))\n\t\tlet writeIndex = out.length\n\t\twhile (num > 0n) {\n\t\t\tout[--writeIndex] = Number(num % 256n)\n\t\t\tnum = num / 256n\n\t\t}\n\t\treturn out\n\t}\n\n\tfromBytes(bytes: Uint8Array): string {\n\t\tconst bitsPerChar = Math.log2(this.lexicon.characters.length)\n\t\tif (Number.isInteger(bitsPerChar)) {\n\t\t\t// Bitstream mode (for power-of-2 lexicons)\n\t\t\tlet bitBuffer = 0\n\t\t\tlet bitCount = 0\n\t\t\tlet out = \"\"\n\n\t\t\tfor (const byte of bytes) {\n\t\t\t\tbitBuffer = (bitBuffer << 8) | byte\n\t\t\t\tbitCount += 8\n\n\t\t\t\twhile (bitCount >= bitsPerChar) {\n\t\t\t\t\tbitCount -= bitsPerChar\n\t\t\t\t\tconst index = (bitBuffer >> bitCount) & ((1 << bitsPerChar) - 1)\n\t\t\t\t\tout += this.lexicon.characters[index]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// \uD83E\uDE79 flush remaining bits\n\t\t\tif (bitCount > 0) {\n\t\t\t\tconst index = (bitBuffer << (bitsPerChar - bitCount)) & ((1 << bitsPerChar) - 1)\n\t\t\t\tout += this.lexicon.characters[index]\n\t\t\t}\n\n\t\t\t// Add padding if applicable\n\t\t\tif (this.lexicon.padding) {\n\t\t\t\twhile (out.length % this.lexicon.padding.size !== 0)\n\t\t\t\t\tout += this.lexicon.padding.character\n\t\t\t}\n\n\t\t\treturn out\n\t\t}\n\n\t\t// Radix mode fallback\n\t\tif (bytes.length === 0) return \"\"\n\t\tconst zeroCharacter = this.lexicon.characters[0]\n\t\tlet leadingZeroBytes = 0\n\t\twhile (bytes[leadingZeroBytes] === 0)\n\t\t\tleadingZeroBytes++\n\t\tlet num = 0n\n\t\tfor (const byte of bytes.slice(leadingZeroBytes))\n\t\t\tnum = (num << 8n) + BigInt(byte)\n\n\t\tif (num === 0n) return zeroCharacter.repeat(leadingZeroBytes)\n\n\t\tconst base = BigInt(this.lexicon.characters.length)\n\t\tlet out = \"\"\n\t\twhile (num > 0n) {\n\t\t\tout = this.lexicon.characters[Number(num % base)] + out\n\t\t\tnum = num / base\n\t\t}\n\t\treturn zeroCharacter.repeat(leadingZeroBytes) + out\n\t}\n\n\ttoInteger(s: string) {\n\t\tif (!s) return 0\n\t\tlet n = 0n\n\t\tlet negative = false\n\t\tconst base = BigInt(this.lexicon.characters.length)\n\t\tif (s.startsWith(this.negativePrefix)) {\n\t\t\ts = s.slice(this.negativePrefix.length)\n\t\t\tnegative = true\n\t\t}\n\t\tfor (const char of s) {\n\t\t\tconst value = this.lookup[char]\n\t\t\tif (value === undefined) throw new Error(`Invalid character: ${char}`)\n\t\t\tn = n * base + BigInt(value)\n\t\t}\n\t\treturn Number(negative ? -n : n)\n\t}\n\n\tfromInteger(n: number) {\n\t\tn = Math.floor(n)\n\t\tconst negative = n < 0\n\t\tlet num = BigInt(negative ? -n : n)\n\t\tif (num === 0n) return this.lexicon.characters[0]\n\t\tconst base = BigInt(this.lexicon.characters.length)\n\t\tlet out = \"\"\n\t\twhile (num > 0n) {\n\t\t\tout = this.lexicon.characters[Number(num % base)] + out\n\t\t\tnum = num / base\n\t\t}\n\t\treturn negative ? `${this.negativePrefix}${out}` : out\n\t}\n\n\trandom(count = 32) {\n\t\treturn this.fromBytes(bytes.random(count))\n\t}\n\n\tprivate countBytes(num: bigint) {\n\t\tlet count = 0\n\t\twhile (num > 0n) {\n\t\t\tcount++\n\t\t\tnum = num / 256n\n\t\t}\n\t\treturn count\n\t}\n}\n", "\nimport {BaseX} from \"./base-x.js\"\n\nexport const hex = new BaseX(BaseX.lexicons.hex)\nexport const base2 = new BaseX(BaseX.lexicons.base2)\nexport const base36 = new BaseX(BaseX.lexicons.base36)\nexport const base58 = new BaseX(BaseX.lexicons.base58)\nexport const base62 = new BaseX(BaseX.lexicons.base62)\nexport const base64 = new BaseX(BaseX.lexicons.base64)\nexport const base64url = new BaseX(BaseX.lexicons.base64url)\n\n", "\nconst fromBytes = (bytes: Uint8Array) => new TextDecoder().decode(bytes)\nconst toBytes = (string: string): Uint8Array => new TextEncoder().encode(string)\n\nexport function txt(bytes: Uint8Array) {\n\treturn fromBytes(bytes)\n}\ntxt.fromBytes = fromBytes\ntxt.toBytes = toBytes\n\n", "\nimport {AnyFunction, DebounceReturn} from \"./types.js\"\n\nexport function debounce<xAction extends AnyFunction>(\n\t\tdelay: number,\n\t\taction: xAction,\n\t): DebounceReturn<xAction> {\n\n\tlet latestArgs: any[]\n\tlet timeout: any\n\n\tlet waitingQueue: {\n\t\tresolve: (r: ReturnType<xAction>) => void\n\t\treject: (reason: any) => void\n\t}[] = []\n\n\tfunction reset() {\n\t\tlatestArgs = []\n\t\tif (timeout)\n\t\t\tclearTimeout(timeout)\n\t\ttimeout = undefined\n\t\twaitingQueue = []\n\t}\n\n\treset()\n\n\treturn <DebounceReturn<xAction>>((...args) => {\n\t\tlatestArgs = args\n\n\t\tif (timeout)\n\t\t\tclearTimeout(timeout)\n\n\t\tconst promise = new Promise((resolve, reject) => {\n\t\t\twaitingQueue.push({resolve, reject})\n\t\t})\n\n\t\ttimeout = setTimeout(() => {\n\t\t\tPromise.resolve()\n\t\t\t\t.then(() => action(...latestArgs))\n\t\t\t\t.then(r => {\n\t\t\t\t\tfor (const {resolve} of waitingQueue)\n\t\t\t\t\t\tresolve(r)\n\t\t\t\t\treset()\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tfor (const {reject} of waitingQueue)\n\t\t\t\t\t\treject(err)\n\t\t\t\t\treset()\n\t\t\t\t})\n\t\t}, delay)\n\n\t\treturn promise\n\t})\n}\n", "\n/** a promise which can be resolved or rejected from the outside */\nexport type Deferred<R = void> = Promise<R> & {\n\tpromise: Promise<R>\n\tresolve: (result: R | PromiseLike<R>) => void\n\treject: (reason: any) => void\n\n\t/** adopt the outcome of another promise */\n\tentangle: (other: Promise<R>) => Promise<R>\n}\n\n/** returns a deferred promise with exposed resolve and reject fns */\nexport function defer<R = void>(): Deferred<R> {\n\tlet resolve!: (result: R | PromiseLike<R>) => void\n\tlet reject!: (reason: any) => void\n\n\tconst promise = new Promise<R>((res, rej) => {\n\t\tresolve = res\n\t\treject = rej\n\t}) as Deferred<R>\n\n\tpromise.resolve = resolve\n\tpromise.reject = reject\n\tpromise.promise = promise\n\n\tpromise.entangle = (other: Promise<R>) => {\n\t\tother.then(resolve, reject)\n\t\treturn promise\n\t}\n\n\treturn promise\n}\n\n", "\nimport {defer, Deferred} from \"../defer.js\"\n\nexport function microbounce<F extends (...params: any[]) => any>(fn: F) {\n\tlet scheduled: {\n\t\tparams: any[]\n\t\tdeferred: Deferred<any>\n\t} | null = null\n\n\treturn ((...params: any[]) => {\n\t\tif (scheduled) {\n\t\t\tscheduled.params = params\n\t\t}\n\t\telse {\n\t\t\tscheduled = {params, deferred: defer()}\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tconst {params, deferred} = scheduled!\n\t\t\t\tscheduled = null\n\t\t\t\tPromise.resolve(fn(...params))\n\t\t\t\t\t.then(deferred.resolve)\n\t\t\t\t\t.catch(deferred.reject)\n\t\t\t})\n\t\t}\n\t\treturn scheduled.deferred.promise\n\t}) as ((...params: Parameters<F>) => Promise<Awaited<ReturnType<F>>>)\n}\n\n", "\nexport function deepClone<T>(data: T, refs = new Set<any>()): T {\n\n\tif (refs.has(data))\n\t\tthrow new Error(\"cannot clone circular reference\")\n\n\tlet copy = undefined as T\n\n\tif (typeof data === \"function\" || (data !== null && typeof data === \"object\")) {\n\t\trefs.add(data)\n\n\t\tif (Array.isArray(data))\n\t\t\tcopy = data.map(d => deepClone(d, new Set(refs))) as T\n\n\t\telse if (data.constructor === Object)\n\t\t\tcopy = Object.fromEntries(\n\t\t\t\tObject.entries(data)\n\t\t\t\t\t.map(([key, d]) => [key, deepClone(d, new Set(refs))])\n\t\t\t) as T\n\n\t\telse if (data instanceof Map)\n\t\t\tcopy = new Map(Array.from(data, ([key, val]) => [key, deepClone(val, new Set(refs))])) as T\n\n\t\telse if (data instanceof Set)\n\t\t\tcopy = new Set(Array.from(data, val => deepClone(val, new Set(refs)))) as T\n\n\t\telse if (data instanceof Date)\n\t\t\tcopy = new Date(data.getTime()) as T\n\n\t\telse\n\t\t\tcopy = data\n\n\t\trefs.delete(data) // Remove current data from refs once we're done with this branch of the object tree\n\t}\n\n\telse\n\t\tcopy = data\n\n\treturn copy\n}\n\n", "\n/** is not null or undefined */\nexport function isHappy<X>(x: X): x is NonNullable<X> {\n\treturn x !== undefined && x !== null\n}\n\n/** is null or undefined */\nexport function isSad(x: any): x is (undefined | null) {\n\treturn x === undefined || x === null\n}\n\nexport const isBoolean = (x: any): x is boolean =>\n\ttypeof x === \"boolean\"\n\nexport const isNumber = (x: any): x is number =>\n\ttypeof x === \"number\"\n\nexport const isString = (x: any): x is string =>\n\ttypeof x === \"string\"\n\nexport const isBigint = (x: any): x is bigint =>\n\ttypeof x === \"bigint\"\n\nexport const isObject = <X>(x: X): x is object & NonNullable<X> =>\n\ttypeof x === \"object\" && x !== null\n\nexport const isArray = (x: any | any[]): x is any[] =>\n\tArray.isArray(x)\n\nexport const isFn = (x: any): x is (...a: any[]) => any =>\n\ttypeof x === \"function\"\n\nexport const isSymbol = (x: any): x is symbol =>\n\ttypeof x === \"symbol\"\n\n/////////////////////////////////////////\n\n/** not null or undefined\n * @deprecated renamed to `isHappy`\n */\nexport function happy<X>(x: X): x is NonNullable<X> {\n\treturn x !== undefined && x !== null\n}\n\n/** null or undefined\n * @deprecated renamed to `isHappy`\n */\nexport function sad(x: any): x is (undefined | null) {\n\treturn x === undefined || x === null\n}\n\n/** @deprecated please use `isNumber` instead of `is.number`, etc */\nexport const is = Object.freeze({\n\n\t/** not null or undefined */\n\thappy,\n\n\t/** null or undefined */\n\tsad,\n\n\t/** @deprecated renamed to `isBoolean` */\n\tboolean: (x: any): x is boolean =>\n\t\ttypeof x === \"boolean\",\n\n\t/** @deprecated renamed to `isNumber` */\n\tnumber: (x: any): x is number =>\n\t\ttypeof x === \"number\",\n\n\t/** @deprecated renamed to `isString` */\n\tstring: (x: any): x is string =>\n\t\ttypeof x === \"string\",\n\n\t/** @deprecated renamed to `isBigint` */\n\tbigint: (x: any): x is bigint =>\n\t\ttypeof x === \"bigint\",\n\n\t/** @deprecated renamed to `isObject` */\n\tobject: <X>(x: X): x is object & NonNullable<X> =>\n\t\ttypeof x === \"object\" && x !== null,\n\n\t/** @deprecated renamed to `isArray` */\n\tarray: (x: any | any[]): x is any[] =>\n\t\tArray.isArray(x),\n\n\t/** @deprecated renamed to `isFn` */\n\tfn: (x: any): x is (...a: any[]) => any =>\n\t\ttypeof x === \"function\",\n\n\t/** @deprecated renamed to `isSymbol` */\n\tsymbol: (x: any): x is symbol =>\n\t\ttypeof x === \"symbol\",\n})\n\n", "\nimport {isObject} from \"../is.js\"\n\nexport const deepEqual = (alpha: any, bravo: any): boolean => {\n\n\tfunction recurse(alpha: any, bravo: any, parents: object[]) {\n\t\tif (!isObject(alpha) || !isObject(bravo))\n\t\t\treturn alpha === bravo\n\n\t\tif (parents.includes(alpha))\n\t\t\tthrow new Error(`forbidden circularity detected in deep equal comparison`)\n\n\t\tconst newParents = [...parents, alpha]\n\n\t\tif (alpha instanceof Map && bravo instanceof Map) {\n\t\t\tif (alpha.size !== bravo.size)\n\t\t\t\treturn false\n\t\t\tfor (const [key, val] of alpha)\n\t\t\t\tif (!bravo.has(key) || !recurse(val, bravo.get(key), newParents))\n\t\t\t\t\treturn false\n\t\t}\n\t\telse if (alpha instanceof Set && bravo instanceof Set) {\n\t\t\tif (alpha.size !== bravo.size)\n\t\t\t\treturn false\n\t\t\tfor (const item of alpha)\n\t\t\t\tif (!Array.from(bravo).some(bItem => recurse(item, bItem, newParents)))\n\t\t\t\t\treturn false\n\t\t}\n\t\telse {\n\t\t\tconst keys1 = Object.keys(alpha)\n\t\t\tconst keys2 = Object.keys(bravo)\n\n\t\t\tif (keys1.length !== keys2.length)\n\t\t\t\treturn false\n\n\t\t\tfor (const key of keys1) {\n\t\t\t\tif (!keys2.includes(key))\n\t\t\t\t\treturn false\n\t\t\t\tif (!recurse(alpha[key], bravo[key], newParents))\n\t\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\treturn true\n\t}\n\n\treturn recurse(alpha, bravo, [])\n}\n\n", "\nimport {isObject} from \"../is.js\"\n\nexport function deepFreeze<X>(item: X): X {\n\tfunction recurse(x: X, parents: object[]) {\n\t\tif (!isObject(x) || parents.includes(x))\n\t\t\treturn x\n\n\t\tconst newParents = [...parents, x]\n\n\t\tif (x instanceof Map)\n\t\t\tfor (const arr of x.entries())\n\t\t\t\tfor (const y of arr)\n\t\t\t\t\trecurse(y, newParents)\n\n\t\telse if (x instanceof Set)\n\t\t\tfor (const y of x)\n\t\t\t\trecurse(y, newParents)\n\n\t\telse if (Array.isArray(x))\n\t\t\tfor (const y of x)\n\t\t\t\trecurse(y, newParents)\n\n\t\telse\n\t\t\tfor (const y of Object.values(x))\n\t\t\t\trecurse(y, newParents)\n\n\t\treturn Object.freeze(x)\n\t}\n\n\treturn recurse(item, [])\n}\n\n", "\nimport type {Result} from \"../types/result.js\"\n\n/** return ok value, otherwise throw error */\nexport function gotOk<Value, E>(result: Result<Value, E>): Value {\n\tif (result.ok)\n\t\treturn result.value\n\n\tconst {error} = result\n\n\tif (error instanceof Error)\n\t\tthrow error\n\n\telse if (typeof error === \"string\")\n\t\tthrow new Error(error)\n\n\telse\n\t\tthrow new Error(\"unknown\")\n}\n\n/** return error, otherwise throw error */\nexport function gotErr<E>(result: Result<unknown, E>): E {\n\tif (result.ok) throw new Error(\"didn't get needed error\")\n\treturn result.error\n}\n\n", "\nexport function got<X>(thing: X | undefined | null, err = \"got failed\"): X {\n\tif (thing === undefined || thing === null) throw new Error(err)\n\treturn thing\n}\n\n", "\nexport type MapLike<K, V> = {\n\thas(key: K): boolean\n\tget(key: K): V | undefined\n\tset(key: K, value: V): unknown\n}\n\nexport function need<K, V>(\n\t\tmap: Pick<MapLike<K, V>, \"has\" | \"get\">,\n\t\tkey: K,\n\t\terr = (typeof key === \"string\" ? `needed key not found \"${key}\"` : \"needed key not found\"),\n\t) {\n\tif (map.has(key))\n\t\treturn map.get(key) as V\n\telse\n\t\tthrow new Error(err)\n}\n\nexport function guarantee<K, V>(map: MapLike<K, V>, key: K, make: () => V) {\n\tif (map.has(key))\n\t\treturn map.get(key)!\n\telse {\n\t\tconst value = make()\n\t\tmap.set(key, value)\n\t\treturn value\n\t}\n}\n\nexport function setEntries<K, V, M extends Pick<MapLike<K, V>, \"set\">>(map: M, entries: Iterable<[K, V]>) {\n\tfor (const [key, value] of entries)\n\t\tmap.set(key, value)\n\treturn map\n}\n\n", "\nexport function arraylimit<X>(array: X[], limit: number) {\n\tif (limit <= 0) return []\n\treturn (array.length > limit)\n\t\t? array.slice(-limit)\n\t\t: array\n}\n\n", "\nexport async function collect<X>(iterable: AsyncIterable<X>) {\n\tconst array: X[] = []\n\tfor await (const item of iterable) array.push(item)\n\treturn array\n}\n\n", "\n/**\n * repeat the given async function over and over.\n * - consider using `nap` in your fn to create a delay\n */\nexport function cycle(fn: (stop: () => void) => unknown | Promise<unknown>) {\n\tlet timeout: any\n\tlet stopped = false\n\n\tconst stop = () => {\n\t\tstopped = true\n\t\tclearTimeout(timeout)\n\t}\n\n\tconst tick = async() => {\n\t\tif (stopped) return\n\t\tawait fn(stop)\n\t\tif (stopped) return\n\t\ttimeout = setTimeout(tick, 0)\n\t}\n\n\ttick()\n\treturn stop\n}\n\n", "\nexport function dataViewFrom(array: ArrayBufferView) {\n\treturn new DataView(array.buffer, array.byteOffset, array.byteLength)\n}\n\n", "\nexport type Disposer = {\n\t(): void\n\tdispose: () => void\n\tschedule: (...fns: (() => void)[]) => Disposer\n\town: <X>(x: X, fn: (x: X) => void) => X\n\tdisposable: <X extends Disposable>(x: X) => X\n\n\t/** @deprecated typo renamed to `disposable` */\n\tdisposables: <X extends Disposable>(x: X) => X\n}\n\nexport type Disposable = {\n\tdispose: () => void\n}\n\nexport function disposer(): Disposer {\n\tlet fns: (() => void)[] = []\n\n\tconst dispose = () => {\n\t\tconst doomed = fns\n\t\tfns = []\n\t\tfor (let i = doomed.length - 1; i >= 0; i--)\n\t\t\tdoomed[i]()\n\t}\n\n\tfunction d() {\n\t\tdispose()\n\t}\n\n\td.dispose = dispose\n\n\td.schedule = (...newFns: (() => void)[]) => {\n\t\tfns.push(...newFns)\n\t\treturn d\n\t}\n\n\td.own = <X>(x: X, fn: (x: X) => void) => {\n\t\tfns.push(() => fn(x))\n\t\treturn x\n\t}\n\n\td.disposable = <X extends Disposable>(x: X) => {\n\t\tfns.push(() => x.dispose())\n\t\treturn x\n\t}\n\n\td.disposables = d.disposable\n\n\treturn d\n}\n\n", "\nexport type EvFn = (...a: any[]) => void\n\nexport type EvTarget<N extends string> = {\n\taddEventListener(name: N, fn: EvFn): void\n\tremoveEventListener(name: N, fn: EvFn): void\n}\n\nexport function ev<N extends string>(target: EvTarget<N>, fns: Record<N, EvFn>) {\n\tconst entries = Object.entries(fns) as [N, EvFn][]\n\n\tfor (const [name, fn] of entries)\n\t\ttarget.addEventListener(name, fn)\n\n\treturn () => {\n\t\tfor (const [name, fn] of entries)\n\t\t\ttarget.removeEventListener(name, fn)\n\t}\n}\n\n", "\nexport class IdCounter {\n\tconstructor(public count = 0) {}\n\n\tnext() {\n\t\treturn this.count++\n\t}\n}\n\n", "\n/** create a promise that waits for a number of milliseconds. */\nexport const nap = (milliseconds: number = 0) => (\n\tnew Promise<void>(resolve => setTimeout(resolve, milliseconds))\n)\n\n", "\nexport type ObTransform<Ob extends object, Value> = (\n\t(value: Ob[keyof Ob], key: keyof Ob) => Value\n)\n\nexport type ObPredicate<Ob extends object> = (\n\t(value: Ob[keyof Ob], key: keyof Ob) => boolean\n)\n\nexport const obmap = <Ob extends object, Value>(\n\t\to: Ob,\n\t\ttransform: ObTransform<Ob, Value>,\n\t) => {\n\n\treturn Object.fromEntries(\n\t\tObject.entries(o).map(\n\t\t\t([key, value]: any) => [key, transform(value, key)]\n\t\t)\n\t) as {[P in keyof Ob]: Value}\n}\n\nexport const obfilter = <Ob extends object>(\n\t\to: Ob,\n\t\tpredicate: ObPredicate<Ob>,\n\t) => {\n\n\treturn Object.fromEntries(\n\t\tObject.entries(o).filter(\n\t\t\t([key, value]: any) => predicate(value, key)\n\t\t)\n\t) as {[P in keyof Ob]?: Ob[keyof Ob]}\n}\n\n////////////////////////////////////////////////////////////////\n\n/** @deprecated use `obmap` and `obfilter` directly. */\nexport function ob<Ob extends object>(o: Ob) {\n\treturn {\n\t\tmap: <Value>(transform: ObTransform<Ob, Value>) => (\n\t\t\tobMap(o, transform)\n\t\t),\n\t\tfilter: (predicate: ObPredicate<Ob>) => (\n\t\t\tobFilter(o, predicate)\n\t\t),\n\t}\n}\n\n/** @deprecated */\nob.pipe = Object.freeze({\n\tmap: <O extends {}, Value>(\n\t\t\ttransform: (value: O[keyof O], key: keyof O) => Value,\n\t\t) => (\n\t\t(o: O) => obMap(o, transform)\n\t),\n\tfilter: <O extends {}>(\n\t\t\ttransform: (value: O[keyof O], key: keyof O) => boolean,\n\t\t) => (\n\t\t(o: O) => obFilter(o, transform) as {[key: string]: O[keyof O]}\n\t),\n})\n\n/** @deprecated renamed to `obmap` */\nexport const obMap = obmap\n\n/** @deprecated renamed to `obfilter` */\nexport const obFilter = obfilter\n\n", "\nimport {defer, Deferred} from \"./defer.js\"\n\nexport type On<P extends any[] = []> = (fn: Fn<P>) => () => void\nexport type Publish<P extends any[] = []> = (...p: P) => void\n\nexport type Subby<P extends any[] = []> = On<P> & ReturnType<typeof mk<P>>\nexport type Pubby<P extends any[] = []> = Publish<P> & ReturnType<typeof mk<P>>\n\nexport function subby<P extends any[] = []>(fn?: Fn<P>) {\n\tconst tools = mk<P>()\n\tconst subby = (fn: Fn<P>) => tools.on(fn)\n\tObject.assign(subby, tools)\n\tif (fn) tools.on(fn)\n\treturn subby as Subby<P>\n}\n\nexport function pubby<P extends any[] = []>(fn?: Fn<P>) {\n\tconst tools = mk<P>()\n\tconst pubby = (...p: P) => tools.publish(...p)\n\tObject.assign(pubby, tools)\n\tif (fn) tools.on(fn)\n\treturn pubby as Pubby<P>\n}\n\ntype Fn<P extends any[]> = (...p: P) => unknown\n\nfunction mk<P extends any[]>() {\n\tconst set = new Set<Fn<P>>()\n\n\tlet waiter: Deferred<P> | undefined\n\tconst next = () => waiter ??= defer()\n\tconst resolveWaiter = (p: P) => {\n\t\tconst ready = waiter\n\t\twaiter = undefined\n\t\tready?.resolve(p)\n\t}\n\n\tconst on = (fn: Fn<P>) => {\n\t\tset.add(fn)\n\t\treturn () => { set.delete(fn) }\n\t}\n\n\tconst publish = (...p: P) => {\n\t\tresolveWaiter(p)\n\t\tfor (const fn of [...set])\n\t\t\tfn(...p)\n\t}\n\n\tconst publishAsync = async(...p: P) => {\n\t\tresolveWaiter(p)\n\t\tawait Promise.all([...set].map(async fn => fn(...p)))\n\t}\n\n\treturn {set, on, publish, publishAsync, next}\n}\n\n", "\nexport type TemplateParts = {\n\tstrings: TemplateStringsArray\n\tvalues: any[]\n}\n\nexport function templateParts(\n\t\tstrings: TemplateStringsArray,\n\t\t...values: any[]\n\t): TemplateParts {\n\n\treturn {strings, values}\n}\n\nexport function templateString(strings: TemplateStringsArray, ...values: any[]) {\n\tconst lastIndex = strings.length - 1\n\treturn strings\n\t\t.slice(0, lastIndex)\n\t\t.reduce((a, b, c) => a + b + values[c], \"\")\n\t\t\t+ strings[lastIndex]\n}\n\n", "\nimport {isHappy} from \"./is.js\"\n\n/** when truthy, do something. */\nexport function when<Y>(\n\t\tx: unknown,\n\t\tyes: () => Y,\n\t\tno?: () => void,\n\t): Y | void {\n\n\treturn x\n\t\t? yes()\n\t\t: no?.()\n}\n\n/** given a non-null non-undefined thing, do something with it. */\nexport function given<X, Y>(\n\t\tx: X,\n\t\tyes: (x: NonNullable<X>) => Y,\n\t\tno?: () => void,\n\t): Y | void {\n\n\treturn isHappy(x)\n\t\t? yes(x)\n\t\t: no?.()\n}\n\n", "\nimport {guarantee} from \"@e280/stz\"\n\nexport type Trackable = object | symbol\n\n/**\n * reactivity integration hub\n */\nexport class Tracker<Item extends Trackable = any> {\n\t#busy = new Set<() => void>()\n\t#observationLayers: Set<Item>[] = []\n\t#subscriptions = new WeakMap<Item, Set<() => void>>()\n\n\t#batchDepth = 0\n\t#batchPending = new Set<() => void>()\n\n\t/** indicate to observers that this item was accessed */\n\tread(item: Item) {\n\t\tconst top = this.#observationLayers.at(-1)\n\t\ttop?.add(item)\n\t}\n\n\t/** invoke all subscriptions for this item */\n\twrite(item: Item) {\n\t\tconst fns = this.#subscriptions.get(item)\n\t\tif (!fns) return\n\n\t\tfor (const fn of fns)\n\t\t\tthis.#batchPending.add(fn)\n\n\t\tif (this.#batchDepth === 0)\n\t\t\tthis.#flush()\n\t}\n\n\t/** collect items that were read during fn */\n\tobserve<Value>(fn: () => Value) {\n\t\tconst seen = new Set<Item>()\n\t\tthis.#observationLayers.push(seen)\n\t\ttry {\n\t\t\tconst value = fn()\n\t\t\treturn {seen, value}\n\t\t}\n\t\tfinally {\n\t\t\tthis.#observationLayers.pop()\n\t\t}\n\t}\n\n\t/** fn will be called when item changes */\n\tsubscribe(item: Item, fn: () => void) {\n\t\tconst fns = guarantee(this.#subscriptions, item, () => new Set())\n\t\tfns.add(fn)\n\t\treturn () => {\n\t\t\tfns.delete(fn)\n\t\t\tif (fns.size === 0)\n\t\t\t\tthis.#subscriptions.delete(item)\n\t\t}\n\t}\n\n\tbatch = <R>(fn: () => R) => {\n\t\tthis.#batchDepth++\n\t\ttry {\n\t\t\treturn fn()\n\t\t}\n\t\tfinally {\n\t\t\tthis.#batchDepth--\n\t\t\tif (this.#batchDepth === 0)\n\t\t\t\tthis.#flush()\n\t\t}\n\t}\n\n\t#run(fn: () => void) {\n\t\tif (this.#busy.has(fn))\n\t\t\tthrow new Error(\"circularity forbidden\")\n\t\tthis.#busy.add(fn)\n\t\ttry { fn() }\n\t\tfinally { this.#busy.delete(fn) }\n\t}\n\n\t#flush() {\n\t\twhile (this.#batchPending.size > 0) {\n\t\t\tconst pending = [...this.#batchPending]\n\t\t\tthis.#batchPending.clear()\n\n\t\t\tfor (const fn of pending)\n\t\t\t\tthis.#run(fn)\n\t\t}\n\t}\n}\n\n", "\nimport {Tracker} from \"./tracker.js\"\n\n/** standard global tracker for integrations */\nexport const tracker: Tracker = (globalThis as any)[Symbol.for(\"e280.tracker.2\")] ??= new Tracker()\n\n", "\nimport {Subby, subby} from \"@e280/stz\"\nimport {Signal} from \"./types.js\"\nimport {tracker} from \"../tracker/global.js\"\n\nexport function signal<Value>(value: Value): Signal<Value> {\n\tlet on: undefined | Subby<[Value]>\n\n\tfunction sig() {\n\t\tif (arguments.length === 0) {\n\t\t\ttracker.read(sig)\n\t\t\treturn value\n\t\t}\n\t\telse {\n\t\t\tvalue = arguments[0]\n\t\t\ttracker.write(sig)\n\t\t\ton?.publish(value)\n\t\t\treturn value\n\t\t}\n\t}\n\n\tsig.get = () => sig()\n\tsig.set = (value: Value) => (<any>sig)(value)\n\tsig.on = (fn: (value: Value) => void) => (on ??= subby())(fn)\n\n\treturn sig\n}\n\n", "\nimport {tracker} from \"../../tracker/global.js\"\n\nexport class RMap<K, V> extends Map<K, V> {\n\n\t//\n\t// reading\n\t//\n\n\tget size() {\n\t\ttracker.read(this)\n\t\treturn super.size\n\t}\n\n\t;[Symbol.iterator]() {\n\t\ttracker.read(this)\n\t\treturn super[Symbol.iterator]()\n\t}\n\n\tforEach(callbackFn: (value: V, key: K, map: RMap<K, V>) => void) {\n\t\ttracker.read(this)\n\t\tfor (const [key, value] of this)\n\t\t\tcallbackFn(value, key, this)\n\t\treturn this\n\t}\n\n\tkeys() {\n\t\ttracker.read(this)\n\t\treturn super.keys()\n\t}\n\n\tvalues() {\n\t\ttracker.read(this)\n\t\treturn super.values()\n\t}\n\n\tentries() {\n\t\ttracker.read(this)\n\t\treturn super.entries()\n\t}\n\n\thas(key: K) {\n\t\ttracker.read(this)\n\t\treturn super.has(key)\n\t}\n\n\tget(key: K) {\n\t\ttracker.read(this)\n\t\treturn super.get(key)\n\t}\n\n\t//\n\t// writing\n\t//\n\n\tset(key: K, value: V) {\n\t\tsuper.set(key, value)\n\t\ttracker.write(this)\n\t\treturn this\n\t}\n\n\tdelete(key: K) {\n\t\tconst ret = super.delete(key)\n\t\ttracker.write(this)\n\t\treturn ret\n\t}\n\n\tclear() {\n\t\tsuper.clear()\n\t\ttracker.write(this)\n\t\treturn this\n\t}\n}\n\n", "\nimport {tracker} from \"../../tracker/global.js\"\n\nexport class RSet<V> extends Set<V> {\n\n\t//\n\t// reading\n\t//\n\n\tget size() {\n\t\ttracker.read(this)\n\t\treturn super.size\n\t}\n\n\t;[Symbol.iterator]() {\n\t\ttracker.read(this)\n\t\treturn super[Symbol.iterator]()\n\t}\n\n\tforEach(callbackFn: (value: V, value2: V, set: RSet<V>) => void) {\n\t\ttracker.read(this)\n\t\tfor (const value of this)\n\t\t\tcallbackFn(value, value, this)\n\t\treturn this\n\t}\n\n\tvalues() {\n\t\ttracker.read(this)\n\t\treturn super.values()\n\t}\n\n\thas(item: V) {\n\t\ttracker.read(this)\n\t\treturn super.has(item)\n\t}\n\n\t//\n\t// writing\n\t//\n\n\tadd(item: V) {\n\t\tsuper.add(item)\n\t\ttracker.write(this)\n\t\treturn this\n\t}\n\n\tdelete(item: V) {\n\t\tconst ret = super.delete(item)\n\t\ttracker.write(this)\n\t\treturn ret\n\t}\n\n\tclear() {\n\t\tsuper.clear()\n\t\ttracker.write(this)\n\t\treturn this\n\t}\n}\n\n", "\nimport {tracker} from \"../tracker/global.js\"\n\nexport const batch = tracker.batch\n\n", "\nimport {deepClone, deepFreeze} from \"@e280/stz\"\nimport {Immutable} from \"../types.js\"\n\nexport function immute<S>(s: S) {\n\treturn deepFreeze(deepClone(s)) as Immutable<S>\n}\n\n", "\nexport const _optic = Symbol(\"optic\")\n\n", "\nexport class CacheCell<R> {\n\t#dirty = false\n\t#value: R\n\n\tconstructor(private calculate: () => R) {\n\t\tthis.#value = calculate()\n\t}\n\n\tget() {\n\t\tif (this.#dirty) {\n\t\t\tthis.#dirty = false\n\t\t\tthis.#value = this.calculate()\n\t\t}\n\t\treturn this.#value\n\t}\n\n\tinvalidate() {\n\t\tthis.#dirty = true\n\t}\n}\n\n", "\nimport {deepClone, deepEqual, subby} from \"@e280/stz\"\nimport {immute} from \"./utils/immute.js\"\nimport {tracker} from \"../tracker/global.js\"\nimport {_optic} from \"./utils/optic-symbol.js\"\nimport {CacheCell} from \"./utils/cache-cell.js\"\nimport {Immutable, LensLike, Optic} from \"./types.js\"\n\n/** reactive view into a state prism, with formalized mutations */\nexport class Lens<State> implements LensLike<State> {\n\t;[_optic]: Optic<State>\n\t#previous: State\n\t#stateCache: CacheCell<State>\n\t#frozenCache: CacheCell<Immutable<State>>\n\t#on = subby<[state: State]>()\n\n\tconstructor(optic: Optic<State>) {\n\t\tthis[_optic] = optic\n\t\tthis.#previous = deepClone(optic.getState())\n\t\tthis.#stateCache = new CacheCell(() => deepClone(optic.getState()))\n\t\tthis.#frozenCache = new CacheCell(() => immute(optic.getState()))\n\t}\n\n\tget on() {\n\t\treturn this.#on.on\n\t}\n\n\tupdate() {\n\t\tconst state = this[_optic].getState()\n\t\tconst isChanged = !deepEqual(state, this.#previous)\n\t\tif (isChanged) {\n\t\t\tthis.#stateCache.invalidate()\n\t\t\tthis.#frozenCache.invalidate()\n\t\t\tthis.#previous = deepClone(state)\n\t\t\ttracker.write(this)\n\t\t\tif (this.#on.set.size)\n\t\t\t\tthis.#on.publish(this.#stateCache.get())\n\t\t}\n\t}\n\n\t/** get a snapshot of the current state. it's typed as mutable, but you should not mutate it. */\n\tget state() {\n\t\ttracker.read(this)\n\t\treturn this.#stateCache.get()\n\t}\n\n\t/** get an immutable readonly snapshot of the current state. */\n\tget frozen() {\n\t\ttracker.read(this)\n\t\treturn this.#frozenCache.get()\n\t}\n\n\tmutate<R>(fn: (state: State) => R) {\n\t\treturn this[_optic].mutate(fn)\n\t}\n\n\tlens<State2>(selector: (state: State) => State2) {\n\t\tconst lens = new Lens<State2>({\n\t\t\tgetState: () => selector(this[_optic].getState()),\n\t\t\tmutate: fn => this[_optic].mutate(state => fn(selector(state))),\n\t\t\tregisterLens: this[_optic].registerLens,\n\t\t})\n\t\tthis[_optic].registerLens(lens)\n\t\treturn lens\n\t}\n}\n\n", "\nimport {getErr, getOk, gotOk, gotErr} from \"@e280/stz\"\nimport {WaitState} from \"./type.js\"\n\nexport function waitGet<Value>(wait: WaitState<Value>) {\n\treturn wait.done\n\t\t? getOk(wait)\n\t\t: undefined\n}\n\nexport function waitGot<Value>(wait: WaitState<Value>) {\n\tif (!wait.done) throw new Error(\"wait not done\")\n\treturn gotOk(wait)\n}\n\nexport function waitGetErr<E = unknown>(wait: WaitState<unknown, E>) {\n\treturn wait.done\n\t\t? getErr(wait)\n\t\t: undefined\n}\n\nexport function waitGotErr<E = unknown>(wait: WaitState<unknown, E>) {\n\tif (!wait.done) throw new Error(\"wait not done\")\n\treturn gotErr(wait)\n}\n\n", "\nimport {WaitState, WaitResult, WaitErr, WaitOk, WaitPending} from \"./type.js\"\n\nexport const isWaitPending = (state: WaitState<unknown>): state is WaitPending => !state.done\nexport const isWaitDone = <Value, E = unknown>(state: WaitState<Value, E>): state is WaitResult<Value, E> => state.done\nexport const isWaitOk = <Value>(state: WaitState<Value, unknown>): state is WaitOk<Value> => state.done && state.ok\nexport const isWaitErr = <E = unknown>(state: WaitState<unknown, E>): state is WaitErr<E> => state.done && !state.ok\n\n", "\nimport {WaitState} from \"./type.js\"\nimport {isWaitOk, isWaitPending} from \"./is.js\"\nimport {waitGotErr, waitGot} from \"./get.js\"\n\nexport function waitSelect<Ret, Value, E = unknown>(state: WaitState<Value, E>, select: {\n\t\tpending?: () => Ret\n\t\tok?: (value: Value) => Ret\n\t\terr?: (error: E) => Ret\n\t}) {\n\n\tconst {\n\t\tpending = () => {},\n\t\tok = () => {},\n\t\terr = () => {},\n\t} = select\n\n\tif (isWaitPending(state))\n\t\treturn pending()\n\n\telse if (isWaitOk(state))\n\t\treturn ok(waitGot(state))\n\n\telse\n\t\treturn err(waitGotErr(state))\n}\n\n", "\nexport function hasFiles(event: DragEvent) {\n\treturn !!(\n\t\tevent.dataTransfer &&\n\t\tevent.dataTransfer.types.includes(\"Files\")\n\t)\n}\n\nexport function files(event: DragEvent) {\n\treturn event.dataTransfer\n\t\t? Array.from(event.dataTransfer.files)\n\t\t: []\n}\n\nexport function outsideCurrentTarget(event: DragEvent) {\n\tconst currentTarget = event.currentTarget as HTMLElement\n\tconst relatedTarget = event.relatedTarget as HTMLElement\n\tconst nulled = !currentTarget || !relatedTarget\n\treturn nulled || !currentTarget.contains(relatedTarget)\n}\n\n", "\nimport {signal} from \"@e280/strata\"\nimport {Drops} from \"./drops.js\"\nimport {outsideCurrentTarget} from \"./helpers.js\"\n\n/** respond to user dragging-and-dropping things around on a webpage */\nexport class DragAndDrops<Draggy, Droppy> {\n\n\t/** what is currently being dragged */\n\t$draggy = signal<Draggy | undefined>(undefined)\n\n\t/** what dropzone are we curently hovering over */\n\t$droppy = signal<Droppy | undefined>(undefined)\n\n\tconstructor(private params: {\n\n\t\t/** accept a dropped item that was declared within this system */\n\t\tacceptDrop: (event: DragEvent, draggy: Draggy, droppy: Droppy) => void\n\n\t\t/** also accept drops on the side */\n\t\tbackchannelDrops?: Drops\n\t}) {}\n\n\tget dragging() {\n\t\treturn this.$draggy()\n\t}\n\n\tget hovering() {\n\t\treturn this.$droppy()\n\t}\n\n\t/** make event listeners to attach to your dragzone(s) */\n\tdragzone = (getDraggy: () => Draggy) => ({\n\t\tdraggable: \"true\",\n\n\t\tdragstart: (_: DragEvent) => {\n\t\t\tthis.$draggy(getDraggy())\n\t\t},\n\n\t\tdragend: (_: DragEvent) => {\n\t\t\tthis.$draggy(undefined)\n\t\t\tthis.$droppy(undefined)\n\t\t},\n\t})\n\n\t/** make event listeners to attach to your dropzones(s) */\n\tdropzone = (getDroppy: () => Droppy) => ({\n\t\tdragenter: (_: DragEvent) => {},\n\n\t\tdragover: (event: DragEvent) => {\n\t\t\tevent.preventDefault()\n\t\t\tif (this.$draggy())\n\t\t\t\tthis.$droppy(getDroppy())\n\t\t\telse\n\t\t\t\tthis.params.backchannelDrops?.dragover(event)\n\t\t},\n\n\t\tdragleave: (event: DragEvent) => {\n\t\t\tif (outsideCurrentTarget(event))\n\t\t\t\tthis.$droppy(undefined)\n\t\t\tthis.params.backchannelDrops?.dragleave(event)\n\t\t},\n\n\t\tdrop: (event: DragEvent) => {\n\t\t\tevent.preventDefault()\n\t\t\tconst {acceptDrop} = this.params\n\t\t\tconst draggy = this.$draggy()\n\t\t\tconst droppy = this.$droppy()\n\t\t\ttry {\n\t\t\t\tif (draggy && droppy)\n\t\t\t\t\tacceptDrop(event, draggy, droppy)\n\t\t\t\telse\n\t\t\t\t\tthis.params.backchannelDrops?.drop(event)\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tthis.$draggy(undefined)\n\t\t\t\tthis.$droppy(undefined)\n\t\t\t}\n\t\t},\n\t})\n}\n\n", "\nimport {signal} from \"@e280/strata\"\nimport {outsideCurrentTarget} from \"./helpers.js\"\n\n/** dropzone that accepts user-dropped stuff like files */\nexport class Drops {\n\t$indicator = signal(false)\n\n\tconstructor(private params: {\n\n\t\t/** whether or not the dragged item is acceptable for a drop */\n\t\tpredicate: (event: DragEvent) => boolean\n\n\t\t/** fn to handle the drop of an acceptable item */\n\t\tacceptDrop: (event: DragEvent) => void\n\t}) {}\n\n\tdragover = (event: DragEvent) => {\n\t\tevent.preventDefault()\n\t\tthis.$indicator(this.params.predicate(event))\n\t}\n\n\tdragleave = (event: DragEvent) => {\n\t\tif (outsideCurrentTarget(event))\n\t\t\tthis.$indicator(false)\n\t}\n\n\tdrop = (event: DragEvent) => {\n\t\tevent.preventDefault()\n\t\tthis.$indicator(false)\n\t\tif (this.params.predicate(event))\n\t\t\tthis.params.acceptDrop(event)\n\t}\n}\n\n", "\nimport {css, CSSResultGroup} from \"lit\"\n\nexport const cssReset: CSSResultGroup = css`\n\t* {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tbox-sizing: border-box;\n\n\t\tscrollbar-width: thin;\n\t\tscrollbar-color: #888 transparent;\n\t}\n\n\t::-webkit-scrollbar { width: 8px; }\n\t::-webkit-scrollbar-track { background: transparent; }\n\t::-webkit-scrollbar-thumb { background: #888; border-radius: 1em; }\n\t::-webkit-scrollbar-thumb:hover { background: #999; }\n`\n\n", "\nimport {dom} from \"../../dom/dom.js\"\n\nexport class SlyShadow extends HTMLElement {\n\tstatic register() {\n\t\tdom.register({SlyShadow}, {soft: true})\n\t}\n\n\tconnectedCallback() {\n\t\tif (!this.hasAttribute(\"view\"))\n\t\t\tthis.setAttribute(\"view\", \"\")\n\t}\n}\n\n", "\nimport {defer} from \"@e280/stz\"\n\nexport class LightCx {\n\tcount = 0\n\trendered = defer<void>()\n\n\tconstructor(public render: () => Promise<void>) {}\n\n\tdoneRender() {\n\t\tthis.count++\n\t\tthis.rendered.resolve()\n\t\tthis.rendered = defer()\n\t}\n}\n\nexport class ShadowCx extends LightCx {\n\tconstructor(\n\t\t\trender: () => Promise<void>,\n\t\t\tpublic host: HTMLElement,\n\t\t\tpublic shadow: ShadowRoot,\n\t\t) {\n\t\tsuper(render)\n\t}\n}\n\n", "\nimport {Hookscope} from \"./hookscope.js\"\n\nexport class Hooks {\n\t#scopes: Hookscope[] = []\n\n\tget scope() {\n\t\tconst scope = this.#scopes.at(-1)\n\t\tif (!scope) throw new Error(\"hooks must be called within a render fn\")\n\t\treturn scope\n\t}\n\n\tincrement() {\n\t\tconst scope = this.scope\n\t\tconst position = scope.position++\n\t\treturn {scope, position}\n\t}\n\n\twrap<Ret>(scope: Hookscope, fn: () => Ret) {\n\t\tscope.position = 0\n\t\tthis.#scopes.push(scope)\n\t\ttry { return fn() }\n\t\tfinally { this.#scopes.pop() }\n\t}\n}\n\nexport const hooks: Hooks = (globalThis as any)[Symbol.for(\"e280.hooks\")] ??= new Hooks()\n\n", "\nimport {tracker} from \"@e280/strata\"\n\nexport class Reactivity {\n\t#stoppers: (() => void)[] = []\n\n\tclear() {\n\t\tthis.#stoppers.forEach(stop => stop())\n\t\tthis.#stoppers = []\n\t}\n\n\tobserve<X>(fn: () => X, rerender: () => Promise<void>) {\n\t\tconst {seen, value} = tracker.observe(fn)\n\t\tthis.clear()\n\t\tfor (const item of seen) {\n\t\t\tconst stop = tracker.subscribe(item, rerender)\n\t\t\tthis.#stoppers.push(stop)\n\t\t}\n\t\treturn value\n\t}\n}\n\n", "\nexport class Mounts {\n\t#mounters: (() => () => void)[] = []\n\t#unmounters: (() => void)[] = []\n\n\tmount(mount: () => () => void) {\n\t\tthis.#mounters.push(mount)\n\t\tthis.#unmounters.push(mount())\n\t}\n\n\tunmountAll() {\n\t\tfor (const unmount of this.#unmounters)\n\t\t\tunmount()\n\t\tthis.#unmounters = []\n\t}\n\n\tremountAll() {\n\t\tfor (const mount of this.#mounters)\n\t\t\tthis.#unmounters.push(mount())\n\t}\n}\n\n", "\nimport {Mounts} from \"./mounts.js\"\nimport {LightCx, ShadowCx} from \"../../parts/cx.js\"\n\nexport class Hookscope {\n\tposition = 0\n\tvalues = new Map<number, any>()\n\tmounts = new Mounts()\n\tconstructor(public cx: LightCx | ShadowCx) {}\n}\n\n", "/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {\n _$LH,\n Part,\n DirectiveParent,\n CompiledTemplateResult,\n MaybeCompiledTemplateResult,\n UncompiledTemplateResult,\n} from './lit-html.js';\nimport {\n DirectiveResult,\n DirectiveClass,\n PartInfo,\n AttributePartInfo,\n} from './directive.js';\ntype Primitive = null | undefined | boolean | number | string | symbol | bigint;\n\nconst {_ChildPart: ChildPart} = _$LH;\n\ntype ChildPart = InstanceType<typeof ChildPart>;\n\nconst ENABLE_SHADYDOM_NOPATCH = true;\n\nconst wrap =\n ENABLE_SHADYDOM_NOPATCH &&\n window.ShadyDOM?.inUse &&\n window.ShadyDOM?.noPatch === true\n ? window.ShadyDOM!.wrap\n : (node: Node) => node;\n\n/**\n * Tests if a value is a primitive value.\n *\n * See https://tc39.github.io/ecma262/#sec-typeof-operator\n */\nexport const isPrimitive = (value: unknown): value is Primitive =>\n value === null || (typeof value != 'object' && typeof value != 'function');\n\nexport const TemplateResultType = {\n HTML: 1,\n SVG: 2,\n MATHML: 3,\n} as const;\n\nexport type TemplateResultType =\n (typeof TemplateResultType)[keyof typeof TemplateResultType];\n\ntype IsTemplateResult = {\n (val: unknown): val is MaybeCompiledTemplateResult;\n <T extends TemplateResultType>(\n val: unknown,\n type: T\n ): val is UncompiledTemplateResult<T>;\n};\n\n/**\n * Tests if a value is a TemplateResult or a CompiledTemplateResult.\n */\nexport const isTemplateResult: IsTemplateResult = (\n value: unknown,\n type?: TemplateResultType\n): value is UncompiledTemplateResult =>\n type === undefined\n ? // This property needs to remain unminified.\n (value as UncompiledTemplateResult)?.['_$litType$'] !== undefined\n : (value as UncompiledTemplateResult)?.['_$litType$'] === type;\n\n/**\n * Tests if a value is a CompiledTemplateResult.\n */\nexport const isCompiledTemplateResult = (\n value: unknown\n): value is CompiledTemplateResult => {\n return (value as CompiledTemplateResult)?.['_$litType$']?.h != null;\n};\n\n/**\n * Tests if a value is a DirectiveResult.\n */\nexport const isDirectiveResult = (value: unknown): value is DirectiveResult =>\n // This property needs to remain unminified.\n (value as DirectiveResult)?.['_$litDirective$'] !== undefined;\n\n/**\n * Retrieves the Directive class for a DirectiveResult\n */\nexport const getDirectiveClass = (value: unknown): DirectiveClass | undefined =>\n // This property needs to remain unminified.\n (value as DirectiveResult)?.['_$litDirective$'];\n\n/**\n * Tests whether a part has only a single-expression with no strings to\n * interpolate between.\n *\n * Only AttributePart and PropertyPart can have multiple expressions.\n * Multi-expression parts have a `strings` property and single-expression\n * parts do not.\n */\nexport const isSingleExpression = (part: PartInfo) =>\n (part as AttributePartInfo).strings === undefined;\n\nconst createMarker = () => document.createComment('');\n\n/**\n * Inserts a ChildPart into the given container ChildPart's DOM, either at the\n * end of the container ChildPart, or before the optional `refPart`.\n *\n * This does not add the part to the containerPart's committed value. That must\n * be done by callers.\n *\n * @param containerPart Part within which to add the new ChildPart\n * @param refPart Part before which to add the new ChildPart; when omitted the\n * part added to the end of the `containerPart`\n * @param part Part to insert, or undefined to create a new part\n */\nexport const insertPart = (\n containerPart: ChildPart,\n refPart?: ChildPart,\n part?: ChildPart\n): ChildPart => {\n const container = wrap(containerPart._$startNode).parentNode!;\n\n const refNode =\n refPart === undefined ? containerPart._$endNode : refPart._$startNode;\n\n if (part === undefined) {\n const startNode = wrap(container).insertBefore(createMarker(), refNode);\n const endNode = wrap(container).insertBefore(createMarker(), refNode);\n part = new ChildPart(\n startNode,\n endNode,\n containerPart,\n containerPart.options\n );\n } else {\n const endNode = wrap(part._$endNode!).nextSibling;\n const oldParent = part._$parent;\n const parentChanged = oldParent !== containerPart;\n if (parentChanged) {\n part._$reparentDisconnectables?.(containerPart);\n // Note that although `_$reparentDisconnectables` updates the part's\n // `_$parent` reference after unlinking from its current parent, that\n // method only exists if Disconnectables are present, so we need to\n // unconditionally set it here\n part._$parent = containerPart;\n // Since the _$isConnected getter is somewhat costly, only\n // read it once we know the subtree has directives that need\n // to be notified\n let newConnectionState;\n if (\n part._$notifyConnectionChanged !== undefined &&\n (newConnectionState = containerPart._$isConnected) !==\n oldParent!._$isConnected\n ) {\n part._$notifyConnectionChanged(newConnectionState);\n }\n }\n if (endNode !== refNode || parentChanged) {\n let start: Node | null = part._$startNode;\n while (start !== endNode) {\n const n: Node | null = wrap(start!).nextSibling;\n wrap(container).insertBefore(start!, refNode);\n start = n;\n }\n }\n }\n\n return part;\n};\n\n/**\n * Sets the value of a Part.\n *\n * Note that this should only be used to set/update the value of user-created\n * parts (i.e. those created using `insertPart`); it should not be used\n * by directives to set the value of the directive's container part. Directives\n * should return a value from `update`/`render` to update their part state.\n *\n * For directives that require setting their part value asynchronously, they\n * should extend `AsyncDirective` and call `this.setValue()`.\n *\n * @param part Part to set\n * @param value Value to set\n * @param index For `AttributePart`s, the index to set\n * @param directiveParent Used internally; should not be set by user\n */\nexport const setChildPartValue = <T extends ChildPart>(\n part: T,\n value: unknown,\n directiveParent: DirectiveParent = part\n): T => {\n part._$setValue(value, directiveParent);\n return part;\n};\n\n// A sentinel value that can never appear as a part value except when set by\n// live(). Used to force a dirty-check to fail and cause a re-render.\nconst RESET_VALUE = {};\n\n/**\n * Sets the committed value of a ChildPart directly without triggering the\n * commit stage of the part.\n *\n * This is useful in cases where a directive needs to update the part such\n * that the next update detects a value change or not. When value is omitted,\n * the next update will be guaranteed to be detected as a change.\n *\n * @param part\n * @param value\n */\nexport const setCommittedValue = (part: Part, value: unknown = RESET_VALUE) =>\n (part._$committedValue = value);\n\n/**\n * Returns the committed value of a ChildPart.\n *\n * The committed value is used for change detection and efficient updates of\n * the part. It can differ from the value set by the template or directive in\n * cases where the template value is transformed before being committed.\n *\n * - `TemplateResult`s are committed as a `TemplateInstance`\n * - Iterables are committed as `Array<ChildPart>`\n * - All other types are committed as the template value or value returned or\n * set by a directive.\n *\n * @param part\n */\nexport const getCommittedValue = (part: ChildPart) => part._$committedValue;\n\n/**\n * Removes a ChildPart from the DOM, including any of its content and markers.\n *\n * Note: The only difference between this and clearPart() is that this also\n * removes the part's start node. This means that the ChildPart must own its\n * start node, ie it must be a marker node specifically for this part and not an\n * anchor from surrounding content.\n *\n * @param part The Part to remove\n */\nexport const removePart = (part: ChildPart) => {\n part._$clear();\n part._$startNode.remove();\n};\n\nexport const clearPart = (part: ChildPart) => {\n part._$clear();\n};\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {Disconnectable, Part} from './lit-html.js';\n\nexport {\n AttributePart,\n BooleanAttributePart,\n ChildPart,\n ElementPart,\n EventPart,\n Part,\n PropertyPart,\n} from './lit-html.js';\n\nexport interface DirectiveClass {\n new (part: PartInfo): Directive;\n}\n\n/**\n * This utility type extracts the signature of a directive class's render()\n * method so we can use it for the type of the generated directive function.\n */\nexport type DirectiveParameters<C extends Directive> = Parameters<C['render']>;\n\n/**\n * A generated directive function doesn't evaluate the directive, but just\n * returns a DirectiveResult object that captures the arguments.\n */\nexport interface DirectiveResult<C extends DirectiveClass = DirectiveClass> {\n /**\n * This property needs to remain unminified.\n * @internal\n */\n ['_$litDirective$']: C;\n /** @internal */\n values: DirectiveParameters<InstanceType<C>>;\n}\n\nexport const PartType = {\n ATTRIBUTE: 1,\n CHILD: 2,\n PROPERTY: 3,\n BOOLEAN_ATTRIBUTE: 4,\n EVENT: 5,\n ELEMENT: 6,\n} as const;\n\nexport type PartType = (typeof PartType)[keyof typeof PartType];\n\nexport interface ChildPartInfo {\n readonly type: typeof PartType.CHILD;\n}\n\nexport interface AttributePartInfo {\n readonly type:\n | typeof PartType.ATTRIBUTE\n | typeof PartType.PROPERTY\n | typeof PartType.BOOLEAN_ATTRIBUTE\n | typeof PartType.EVENT;\n readonly strings?: ReadonlyArray<string>;\n readonly name: string;\n readonly tagName: string;\n}\n\nexport interface ElementPartInfo {\n readonly type: typeof PartType.ELEMENT;\n}\n\n/**\n * Information about the part a directive is bound to.\n *\n * This is useful for checking that a directive is attached to a valid part,\n * such as with directive that can only be used on attribute bindings.\n */\nexport type PartInfo = ChildPartInfo | AttributePartInfo | ElementPartInfo;\n\n/**\n * Creates a user-facing directive function from a Directive class. This\n * function has the same parameters as the directive's render() method.\n */\nexport const directive =\n <C extends DirectiveClass>(c: C) =>\n (...values: DirectiveParameters<InstanceType<C>>): DirectiveResult<C> => ({\n // This property needs to remain unminified.\n ['_$litDirective$']: c,\n values,\n });\n\n/**\n * Base class for creating custom directives. Users should extend this class,\n * implement `render` and/or `update`, and then pass their subclass to\n * `directive`.\n */\nexport abstract class Directive implements Disconnectable {\n //@internal\n __part!: Part;\n //@internal\n __attributeIndex: number | undefined;\n //@internal\n __directive?: Directive;\n\n //@internal\n _$parent!: Disconnectable;\n\n // These will only exist on the AsyncDirective subclass\n //@internal\n _$disconnectableChildren?: Set<Disconnectable>;\n // This property needs to remain unminified.\n //@internal\n ['_$notifyDirectiveConnectionChanged']?(isConnected: boolean): void;\n\n constructor(_partInfo: PartInfo) {}\n\n // See comment in Disconnectable interface for why this is a getter\n get _$isConnected() {\n return this._$parent._$isConnected;\n }\n\n /** @internal */\n _$initialize(\n part: Part,\n parent: Disconnectable,\n attributeIndex: number | undefined\n ) {\n this.__part = part;\n this._$parent = parent;\n this.__attributeIndex = attributeIndex;\n }\n /** @internal */\n _$resolve(part: Part, props: Array<unknown>): unknown {\n return this.update(part, props);\n }\n\n abstract render(...props: Array<unknown>): unknown;\n\n update(_part: Part, props: Array<unknown>): unknown {\n return this.render(...props);\n }\n}\n", "/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Overview:\n *\n * This module is designed to add support for an async `setValue` API and\n * `disconnected` callback to directives with the least impact on the core\n * runtime or payload when that feature is not used.\n *\n * The strategy is to introduce a `AsyncDirective` subclass of\n * `Directive` that climbs the \"parent\" tree in its constructor to note which\n * branches of lit-html's \"logical tree\" of data structures contain such\n * directives and thus need to be crawled when a subtree is being cleared (or\n * manually disconnected) in order to run the `disconnected` callback.\n *\n * The \"nodes\" of the logical tree include Parts, TemplateInstances (for when a\n * TemplateResult is committed to a value of a ChildPart), and Directives; these\n * all implement a common interface called `DisconnectableChild`. Each has a\n * `_$parent` reference which is set during construction in the core code, and a\n * `_$disconnectableChildren` field which is initially undefined.\n *\n * The sparse tree created by means of the `AsyncDirective` constructor\n * crawling up the `_$parent` tree and placing a `_$disconnectableChildren` Set\n * on each parent that includes each child that contains a\n * `AsyncDirective` directly or transitively via its children. In order to\n * notify connection state changes and disconnect (or reconnect) a tree, the\n * `_$notifyConnectionChanged` API is patched onto ChildParts as a directive\n * climbs the parent tree, which is called by the core when clearing a part if\n * it exists. When called, that method iterates over the sparse tree of\n * Set<DisconnectableChildren> built up by AsyncDirectives, and calls\n * `_$notifyDirectiveConnectionChanged` on any directives that are encountered\n * in that tree, running the required callbacks.\n *\n * A given \"logical tree\" of lit-html data-structures might look like this:\n *\n * ChildPart(N1) _$dC=[D2,T3]\n * ._directive\n * AsyncDirective(D2)\n * ._value // user value was TemplateResult\n * TemplateInstance(T3) _$dC=[A4,A6,N10,N12]\n * ._$parts[]\n * AttributePart(A4) _$dC=[D5]\n * ._directives[]\n * AsyncDirective(D5)\n * AttributePart(A6) _$dC=[D7,D8]\n * ._directives[]\n * AsyncDirective(D7)\n * Directive(D8) _$dC=[D9]\n * ._directive\n * AsyncDirective(D9)\n * ChildPart(N10) _$dC=[D11]\n * ._directive\n * AsyncDirective(D11)\n * ._value\n * string\n * ChildPart(N12) _$dC=[D13,N14,N16]\n * ._directive\n * AsyncDirective(D13)\n * ._value // user value was iterable\n * Array<ChildPart>\n * ChildPart(N14) _$dC=[D15]\n * ._value\n * string\n * ChildPart(N16) _$dC=[D17,T18]\n * ._directive\n * AsyncDirective(D17)\n * ._value // user value was TemplateResult\n * TemplateInstance(T18) _$dC=[A19,A21,N25]\n * ._$parts[]\n * AttributePart(A19) _$dC=[D20]\n * ._directives[]\n * AsyncDirective(D20)\n * AttributePart(A21) _$dC=[22,23]\n * ._directives[]\n * AsyncDirective(D22)\n * Directive(D23) _$dC=[D24]\n * ._directive\n * AsyncDirective(D24)\n * ChildPart(N25) _$dC=[D26]\n * ._directive\n * AsyncDirective(D26)\n * ._value\n * string\n *\n * Example 1: The directive in ChildPart(N12) updates and returns `nothing`. The\n * ChildPart will _clear() itself, and so we need to disconnect the \"value\" of\n * the ChildPart (but not its directive). In this case, when `_clear()` calls\n * `_$notifyConnectionChanged()`, we don't iterate all of the\n * _$disconnectableChildren, rather we do a value-specific disconnection: i.e.\n * since the _value was an Array<ChildPart> (because an iterable had been\n * committed), we iterate the array of ChildParts (N14, N16) and run\n * `setConnected` on them (which does recurse down the full tree of\n * `_$disconnectableChildren` below it, and also removes N14 and N16 from N12's\n * `_$disconnectableChildren`). Once the values have been disconnected, we then\n * check whether the ChildPart(N12)'s list of `_$disconnectableChildren` is empty\n * (and would remove it from its parent TemplateInstance(T3) if so), but since\n * it would still contain its directive D13, it stays in the disconnectable\n * tree.\n *\n * Example 2: In the course of Example 1, `setConnected` will reach\n * ChildPart(N16); in this case the entire part is being disconnected, so we\n * simply iterate all of N16's `_$disconnectableChildren` (D17,T18) and\n * recursively run `setConnected` on them. Note that we only remove children\n * from `_$disconnectableChildren` for the top-level values being disconnected\n * on a clear; doing this bookkeeping lower in the tree is wasteful since it's\n * all being thrown away.\n *\n * Example 3: If the LitElement containing the entire tree above becomes\n * disconnected, it will run `childPart.setConnected()` (which calls\n * `childPart._$notifyConnectionChanged()` if it exists); in this case, we\n * recursively run `setConnected()` over the entire tree, without removing any\n * children from `_$disconnectableChildren`, since this tree is required to\n * re-connect the tree, which does the same operation, simply passing\n * `isConnected: true` down the tree, signaling which callback to run.\n */\n\nimport {AttributePart, ChildPart, Disconnectable, Part} from './lit-html.js';\nimport {isSingleExpression} from './directive-helpers.js';\nimport {Directive, PartInfo, PartType} from './directive.js';\nexport * from './directive.js';\n\nconst DEV_MODE = true;\n\n/**\n * Recursively walks down the tree of Parts/TemplateInstances/Directives to set\n * the connected state of directives and run `disconnected`/ `reconnected`\n * callbacks.\n *\n * @return True if there were children to disconnect; false otherwise\n */\nconst notifyChildrenConnectedChanged = (\n parent: Disconnectable,\n isConnected: boolean\n): boolean => {\n const children = parent._$disconnectableChildren;\n if (children === undefined) {\n return false;\n }\n for (const obj of children) {\n // The existence of `_$notifyDirectiveConnectionChanged` is used as a \"brand\" to\n // disambiguate AsyncDirectives from other DisconnectableChildren\n // (as opposed to using an instanceof check to know when to call it); the\n // redundancy of \"Directive\" in the API name is to avoid conflicting with\n // `_$notifyConnectionChanged`, which exists `ChildParts` which are also in\n // this list\n // Disconnect Directive (and any nested directives contained within)\n // This property needs to remain unminified.\n (obj as AsyncDirective)['_$notifyDirectiveConnectionChanged']?.(\n isConnected,\n false\n );\n // Disconnect Part/TemplateInstance\n notifyChildrenConnectedChanged(obj, isConnected);\n }\n return true;\n};\n\n/**\n * Removes the given child from its parent list of disconnectable children, and\n * if the parent list becomes empty as a result, removes the parent from its\n * parent, and so forth up the tree when that causes subsequent parent lists to\n * become empty.\n */\nconst removeDisconnectableFromParent = (obj: Disconnectable) => {\n let parent, children;\n do {\n if ((parent = obj._$parent) === undefined) {\n break;\n }\n children = parent._$disconnectableChildren!;\n children.delete(obj);\n obj = parent;\n } while (children?.size === 0);\n};\n\nconst addDisconnectableToParent = (obj: Disconnectable) => {\n // Climb the parent tree, creating a sparse tree of children needing\n // disconnection\n for (let parent; (parent = obj._$parent); obj = parent) {\n let children = parent._$disconnectableChildren;\n if (children === undefined) {\n parent._$disconnectableChildren = children = new Set();\n } else if (children.has(obj)) {\n // Once we've reached a parent that already contains this child, we\n // can short-circuit\n break;\n }\n children.add(obj);\n installDisconnectAPI(parent);\n }\n};\n\n/**\n * Changes the parent reference of the ChildPart, and updates the sparse tree of\n * Disconnectable children accordingly.\n *\n * Note, this method will be patched onto ChildPart instances and called from\n * the core code when parts are moved between different parents.\n */\nfunction reparentDisconnectables(this: ChildPart, newParent: Disconnectable) {\n if (this._$disconnectableChildren !== undefined) {\n removeDisconnectableFromParent(this);\n this._$parent = newParent;\n addDisconnectableToParent(this);\n } else {\n this._$parent = newParent;\n }\n}\n\n/**\n * Sets the connected state on any directives contained within the committed\n * value of this part (i.e. within a TemplateInstance or iterable of\n * ChildParts) and runs their `disconnected`/`reconnected`s, as well as within\n * any directives stored on the ChildPart (when `valueOnly` is false).\n *\n * `isClearingValue` should be passed as `true` on a top-level part that is\n * clearing itself, and not as a result of recursively disconnecting directives\n * as part of a `clear` operation higher up the tree. This both ensures that any\n * directive on this ChildPart that produced a value that caused the clear\n * operation is not disconnected, and also serves as a performance optimization\n * to avoid needless bookkeeping when a subtree is going away; when clearing a\n * subtree, only the top-most part need to remove itself from the parent.\n *\n * `fromPartIndex` is passed only in the case of a partial `_clear` running as a\n * result of truncating an iterable.\n *\n * Note, this method will be patched onto ChildPart instances and called from the\n * core code when parts are cleared or the connection state is changed by the\n * user.\n */\nfunction notifyChildPartConnectedChanged(\n this: ChildPart,\n isConnected: boolean,\n isClearingValue = false,\n fromPartIndex = 0\n) {\n const value = this._$committedValue;\n const children = this._$disconnectableChildren;\n if (children === undefined || children.size === 0) {\n return;\n }\n if (isClearingValue) {\n if (Array.isArray(value)) {\n // Iterable case: Any ChildParts created by the iterable should be\n // disconnected and removed from this ChildPart's disconnectable\n // children (starting at `fromPartIndex` in the case of truncation)\n for (let i = fromPartIndex; i < value.length; i++) {\n notifyChildrenConnectedChanged(value[i], false);\n removeDisconnectableFromParent(value[i]);\n }\n } else if (value != null) {\n // TemplateInstance case: If the value has disconnectable children (will\n // only be in the case that it is a TemplateInstance), we disconnect it\n // and remove it from this ChildPart's disconnectable children\n notifyChildrenConnectedChanged(value as Disconnectable, false);\n removeDisconnectableFromParent(value as Disconnectable);\n }\n } else {\n notifyChildrenConnectedChanged(this, isConnected);\n }\n}\n\n/**\n * Patches disconnection API onto ChildParts.\n */\nconst installDisconnectAPI = (obj: Disconnectable) => {\n if ((obj as ChildPart).type == PartType.CHILD) {\n (obj as ChildPart)._$notifyConnectionChanged ??=\n notifyChildPartConnectedChanged;\n (obj as ChildPart)._$reparentDisconnectables ??= reparentDisconnectables;\n }\n};\n\n/**\n * An abstract `Directive` base class whose `disconnected` method will be\n * called when the part containing the directive is cleared as a result of\n * re-rendering, or when the user calls `part.setConnected(false)` on\n * a part that was previously rendered containing the directive (as happens\n * when e.g. a LitElement disconnects from the DOM).\n *\n * If `part.setConnected(true)` is subsequently called on a\n * containing part, the directive's `reconnected` method will be called prior\n * to its next `update`/`render` callbacks. When implementing `disconnected`,\n * `reconnected` should also be implemented to be compatible with reconnection.\n *\n * Note that updates may occur while the directive is disconnected. As such,\n * directives should generally check the `this.isConnected` flag during\n * render/update to determine whether it is safe to subscribe to resources\n * that may prevent garbage collection.\n */\nexport abstract class AsyncDirective extends Directive {\n // As opposed to other Disconnectables, AsyncDirectives always get notified\n // when the RootPart connection changes, so the public `isConnected`\n // is a locally stored variable initialized via its part's getter and synced\n // via `_$notifyDirectiveConnectionChanged`. This is cheaper than using\n // the _$isConnected getter, which has to look back up the tree each time.\n /**\n * The connection state for this Directive.\n */\n isConnected!: boolean;\n\n // @internal\n override _$disconnectableChildren?: Set<Disconnectable> = undefined;\n /**\n * Initialize the part with internal fields\n * @param part\n * @param parent\n * @param attributeIndex\n */\n override _$initialize(\n part: Part,\n parent: Disconnectable,\n attributeIndex: number | undefined\n ) {\n super._$initialize(part, parent, attributeIndex);\n addDisconnectableToParent(this);\n this.isConnected = part._$isConnected;\n }\n // This property needs to remain unminified.\n /**\n * Called from the core code when a directive is going away from a part (in\n * which case `shouldRemoveFromParent` should be true), and from the\n * `setChildrenConnected` helper function when recursively changing the\n * connection state of a tree (in which case `shouldRemoveFromParent` should\n * be false).\n *\n * @param isConnected\n * @param isClearingDirective - True when the directive itself is being\n * removed; false when the tree is being disconnected\n * @internal\n */\n override ['_$notifyDirectiveConnectionChanged'](\n isConnected: boolean,\n isClearingDirective = true\n ) {\n if (isConnected !== this.isConnected) {\n this.isConnected = isConnected;\n if (isConnected) {\n this.reconnected?.();\n } else {\n this.disconnected?.();\n }\n }\n if (isClearingDirective) {\n notifyChildrenConnectedChanged(this, isConnected);\n removeDisconnectableFromParent(this);\n }\n }\n\n /**\n * Sets the value of the directive's Part outside the normal `update`/`render`\n * lifecycle of a directive.\n *\n * This method should not be called synchronously from a directive's `update`\n * or `render`.\n *\n * @param directive The directive to update\n * @param value The value to set\n */\n setValue(value: unknown) {\n if (isSingleExpression(this.__part as unknown as PartInfo)) {\n this.__part._$setValue(value, this);\n } else {\n // this.__attributeIndex will be defined in this case, but\n // assert it in dev mode\n if (DEV_MODE && this.__attributeIndex === undefined) {\n throw new Error(`Expected this.__attributeIndex to be a number`);\n }\n const newValues = [...(this.__part._$committedValue as Array<unknown>)];\n newValues[this.__attributeIndex!] = value;\n (this.__part as AttributePart)._$setValue(newValues, this, 0);\n }\n }\n\n /**\n * User callbacks for implementing logic to release any resources/subscriptions\n * that may have been retained by this directive. Since directives may also be\n * re-connected, `reconnected` should also be implemented to restore the\n * working state of the directive prior to the next render.\n */\n protected disconnected() {}\n protected reconnected() {}\n}\n", "\nimport {microbounce} from \"@e280/stz\"\n\nimport {View} from \"./types.js\"\nimport {LightCx} from \"./parts/cx.js\"\nimport {hooks} from \"./hooks/plumbing/hooks.js\"\nimport {Reactivity} from \"./parts/reactivity.js\"\nimport {Hookscope} from \"./hooks/plumbing/hookscope.js\"\nimport {AsyncDirective, directive, Part} from \"lit/async-directive.js\"\n\nexport function lightView<Props extends any[]>(view: View<Props>) {\n\treturn directive(class D extends AsyncDirective {\n\t\t#props!: Props\n\t\t#cx = new LightCx(microbounce(() => {\n\t\t\tif (!this.#props) throw new Error(\"cannot render before props\")\n\t\t\tif (this.isConnected) {\n\t\t\t\tconst content = this.render(...this.#props)\n\t\t\t\tthis.setValue(content)\n\t\t\t\tthis.#cx.doneRender()\n\t\t\t}\n\t\t}))\n\t\t#hookscope = new Hookscope(this.#cx)\n\t\t#reactivity = new Reactivity()\n\n\t\tupdate(part: Part, props: any[]) {\n\t\t\tconst ret = super.update(part, props)\n\t\t\tif (this.isConnected) this.#cx.doneRender()\n\t\t\treturn ret\n\t\t}\n\n\t\trender(...props: Props) {\n\t\t\tthis.#props = props\n\t\t\treturn this.#reactivity.observe(\n\t\t\t\t() => hooks.wrap(this.#hookscope, () => view(...this.#props)),\n\t\t\t\tthis.#cx.render,\n\t\t\t)\n\t\t}\n\n\t\tdisconnected() {\n\t\t\tthis.#hookscope.mounts.unmountAll()\n\t\t\tthis.#reactivity.clear()\n\t\t}\n\n\t\treconnected() {\n\t\t\tthis.#hookscope.mounts.remountAll()\n\t\t\tthis.#cx.render()\n\t\t}\n\t}) as View<Props>\n}\n\n/** @deprecated renamed to `lightView` */\nexport const light = lightView\n\n", "\nimport {ViewAttr, ViewAttrs} from \"../types.js\"\n\nexport function applyAttrs(element: HTMLElement, attrs: ViewAttrs) {\n\tfor (const [name, value] of Object.entries(attrs))\n\t\tapplyAttr(element, name, value)\n}\n\nfunction applyAttr(element: HTMLElement, name: string, value: ViewAttr) {\n\tconst existing = element.getAttribute(name)\n\tconst v = coerce(value)\n\tif (v === existing) return\n\tif (v === null) element.removeAttribute(name)\n\telse element.setAttribute(name, v)\n}\n\nfunction coerce(value: ViewAttr) {\n\tif (typeof value === \"string\") return value\n\telse if (typeof value === \"number\") return value.toString()\n\treturn value ? \"\" : null\n}\n\n", "\nimport {microbounce} from \"@e280/stz\"\nimport {render as litRender} from \"lit\"\n\nimport {ShadowCx} from \"./parts/cx.js\"\nimport {hooks} from \"./hooks/plumbing/hooks.js\"\nimport {SlyShadow} from \"./common/sly-shadow.js\"\nimport {Reactivity} from \"./parts/reactivity.js\"\nimport {applyAttrs} from \"./parts/apply-attrs.js\"\nimport {Hookscope} from \"./hooks/plumbing/hookscope.js\"\nimport {View, Placement, ShadowSetup, ShadowView} from \"./types.js\"\nimport {AsyncDirective, directive, PartInfo} from \"lit/async-directive.js\"\n\nexport function shadowSetup(): ShadowSetup {\n\tSlyShadow.register()\n\tconst host = document.createElement(\"sly-shadow\")\n\tconst shadow = host.attachShadow({mode: \"open\"})\n\treturn {host, shadow}\n}\n\nexport function shadowView<Props extends any[]>(view: View<Props>) {\n\treturn rawShadow(shadowSetup, view)\n}\n\nshadowView.setup = (setup: () => ShadowSetup) => (\n\t<Props extends any[]>(view: View<Props>) => (\n\t\trawShadow(setup, view)\n\t)\n)\n\n/** @deprecated renamed to `shadowView` */\nexport const shadow = shadowView\n\nfunction rawShadow<Props extends any[]>(\n\t\tsetup: () => ShadowSetup,\n\t\tview: View<Props>,\n\t) {\n\n\tconst directiveFn = directive(class extends AsyncDirective {\n\t\t#cx\n\t\t#hookscope\n\t\t#props!: Props\n\t\t#reactivity = new Reactivity()\n\n\t\tconstructor(part: PartInfo) {\n\t\t\tsuper(part)\n\t\t\tconst {host, shadow} = setup()\n\t\t\tconst rerender = microbounce(() => {\n\t\t\t\tif (!this.#props) throw new Error(\"cannot render before props\")\n\t\t\t\tif (!this.isConnected) return\n\t\t\t\tconst content = this.#renderContent(this.#props)\n\t\t\t\tlitRender(content, this.#cx.shadow)\n\t\t\t\tthis.#cx.doneRender()\n\t\t\t})\n\t\t\tthis.#cx = new ShadowCx(rerender, host, shadow)\n\t\t\tthis.#hookscope = new Hookscope(this.#cx)\n\t\t}\n\n\t\t#renderContent(props: Props) {\n\t\t\tthis.#props = props\n\t\t\treturn this.#reactivity.observe(\n\t\t\t\t() => hooks.wrap(this.#hookscope, () => view(...this.#props)),\n\t\t\t\tthis.#cx.render,\n\t\t\t)\n\t\t}\n\n\t\trender({props, children, attrs}: Placement<Props>) {\n\t\t\tconst {host} = this.#cx\n\t\t\tif (!this.isConnected) return host\n\t\t\tif (attrs) applyAttrs(host, attrs)\n\t\t\tlitRender(children, this.#cx.host)\n\t\t\tlitRender(this.#renderContent(props), this.#cx.shadow)\n\t\t\tthis.#cx.doneRender()\n\t\t\treturn host\n\t\t}\n\n\t\tdisconnected() {\n\t\t\tlitRender(null, this.#cx.shadow)\n\t\t\tlitRender(null, this.#cx.host)\n\t\t\tthis.#hookscope.mounts.unmountAll()\n\t\t\tthis.#reactivity.clear()\n\t\t}\n\n\t\treconnected() {\n\t\t\tthis.#hookscope.mounts.remountAll()\n\t\t\tthis.#cx.render()\n\t\t}\n\t}) as ShadowView<[Placement<Props>]>\n\n\tfunction shadowView(...props: Props) {\n\t\treturn directiveFn({props})\n\t}\n\n\tshadowView.with = directiveFn\n\n\treturn shadowView as ShadowView<Props>\n}\n\n", "\nimport {microbounce} from \"@e280/stz\"\nimport {render as litRender} from \"lit\"\n\nimport {Content} from \"../types.js\"\nimport {ShadowCx} from \"../parts/cx.js\"\nimport {hooks} from \"../hooks/plumbing/hooks.js\"\nimport {Reactivity} from \"../parts/reactivity.js\"\nimport {Hookscope} from \"../hooks/plumbing/hookscope.js\"\n\nexport function shadowElement(view: () => Content): new() => HTMLElement {\n\treturn class extends HTMLElement {\n\t\t#cx\n\t\t#hookscope\n\t\t#reactivity = new Reactivity()\n\t\t#shadow = this.attachShadow({mode: \"open\"})\n\n\t\tconstructor() {\n\t\t\tsuper()\n\t\t\tconst rerender = microbounce(() => {\n\t\t\t\tif (!this.isConnected) return\n\t\t\t\tconst content = this.#renderContent()\n\t\t\t\tlitRender(content, this.#cx.shadow)\n\t\t\t\tthis.#cx.doneRender()\n\t\t\t})\n\t\t\tthis.#cx = new ShadowCx(rerender, this, this.#shadow)\n\t\t\tthis.#hookscope = new Hookscope(this.#cx)\n\t\t}\n\n\t\t#renderContent() {\n\t\t\treturn this.#reactivity.observe(\n\t\t\t\t() => hooks.wrap(this.#hookscope, () => view()),\n\t\t\t\tthis.#cx.render,\n\t\t\t)\n\t\t}\n\n\t\trender() {\n\t\t\tlitRender(this.#renderContent(), this.#cx.shadow)\n\t\t\tthis.#cx.doneRender()\n\t\t}\n\n\t\tconnectedCallback() {\n\t\t\tthis.#hookscope.mounts.remountAll()\n\t\t\tthis.#cx.render()\n\t\t}\n\n\t\tdisconnectedCallback() {\n\t\t\tthis.#hookscope.mounts.unmountAll()\n\t\t\tthis.#reactivity.clear()\n\t\t}\n\t}\n}\n\n", "\nimport {Content} from \"../types.js\"\nimport {shadowView} from \"../shadow.js\"\nimport {shadowElement} from \"../elements/shadow.js\"\n\n/** make a shadow-view and shadow-element at the same time. */\nexport function shadowDuplex<P extends any[]>(render: (...p: P) => Content) {\n\tconst view = shadowView(render)\n\tconst makeElement = (...p: P) => shadowElement(() => render(...p))\n\n\treturn [view, makeElement] as [\n\t\tview: typeof view,\n\t\tmakeElement: typeof makeElement,\n\t]\n}\n\n", "\nimport {guarantee} from \"@e280/stz\"\nimport {hooks} from \"./plumbing/hooks.js\"\n\n/** run the fn only one time */\nexport function useOnce<Value>(fn: () => Value) {\n\tconst {scope, position} = hooks.increment()\n\treturn guarantee(scope.values, position, fn) as Value\n}\n\n", "\nimport {hooks} from \"./hooks.js\"\n\nexport function useCx() {\n\treturn hooks.increment().scope.cx\n}\n\n", "\nimport {useCx} from \"./use-cx.js\"\nimport {ShadowCx} from \"../../parts/cx.js\"\n\nexport function useShadowCx() {\n\tconst cx = useCx()\n\n\tif (!(cx instanceof ShadowCx))\n\t\tthrow new Error(\"this hook only works on shadow views (but was called in a light view)\")\n\n\treturn cx\n}\n\n", "\nimport {useShadowCx} from \"./plumbing/use-shadow-cx.js\"\n\n/** return the shadow view's host element */\nexport function useHost() {\n\treturn useShadowCx().host\n}\n\n", "\nimport {useOnce} from \"./use-once.js\"\nimport {hooks} from \"./plumbing/hooks.js\"\n\nexport function useMount(fn: () => () => void) {\n\tconst {scope} = hooks.increment()\n\treturn useOnce(() => scope.mounts.mount(fn))\n}\n\n", "\nimport {useShadowCx} from \"./plumbing/use-shadow-cx.js\"\n\n/** return the shadow root */\nexport function useShadow() {\n\treturn useShadowCx().shadow\n}\n\n", "\nimport {adoptStyles, CSSResultGroup, CSSResultOrNative, getCompatibleStyle} from \"lit\"\n\nexport function applyStyles(shadow: ShadowRoot, styles?: CSSResultGroup) {\n\tadoptStyles(shadow, prepareStyles(styles))\n}\n\nfunction prepareStyles(styles?: CSSResultGroup): Array<CSSResultOrNative> {\n\tconst elementStyles = []\n\n\tif (Array.isArray(styles)) {\n\t\tconst set = new Set((styles as Array<unknown>).flat(Infinity).reverse())\n\t\tfor (const s of set)\n\t\t\telementStyles.unshift(getCompatibleStyle(s as CSSResultOrNative))\n\t}\n\telse if (styles !== undefined)\n\t\telementStyles.push(getCompatibleStyle(styles))\n\n\treturn elementStyles\n}\n\n", "\nimport {CSSResultGroup} from \"lit\"\nimport {useOnce} from \"./use-once.js\"\nimport {useShadow} from \"./use-shadow.js\"\nimport {applyStyles} from \"../parts/apply-styles.js\"\n\n/** attach stylesheets to the shadow root */\nexport function useCss(...styles: CSSResultGroup[]) {\n\tconst shadow = useShadow()\n\tuseOnce(() => applyStyles(shadow, styles))\n}\n\n", "\nimport {useHost} from \"./use-host.js\"\nimport {useOnce} from \"./use-once.js\"\n\n/** sets the host element's \"data-view\" attribute */\nexport function useName(name = \"\") {\n\tconst host = useHost()\n\tuseOnce(() => host.setAttribute(\"view\", name))\n}\n\n", "\nimport {signal} from \"@e280/strata\"\nimport {useOnce} from \"./use-once.js\"\n\nexport function useSignal<Value>(value: Value) {\n\treturn useOnce(() => signal(value))\n}\n\n", "\nimport {useCss} from \"./use-css.js\"\n\n/** alias for `useCss` */\nexport const useStyles = useCss\n\n", "\nimport {useMount} from \"./use-mount.js\"\n\nexport function useUnmount(fn: () => void) {\n\treturn useMount(() => fn)\n}\n\n", "\nimport {css} from \"lit\"\nimport {nap, cycle} from \"@e280/stz\"\nimport {Content} from \"../../view/types.js\"\nimport {cssReset, shadowView, useMount, useName, useSignal, useStyles} from \"../../view/index.js\"\n\nexport function makeAsciiAnim(hz: number, frames: string[]): () => Content {\n\treturn () => AsciiAnim({hz, frames})\n}\n\nexport const AsciiAnim = shadowView(({hz, frames}: {\n\t\thz: number,\n\t\tframes: string[],\n\t}) => {\n\n\tuseName(\"loading\")\n\tuseStyles(cssReset, style)\n\n\tconst $frame = useSignal(0)\n\n\tuseMount(() => cycle(async() => {\n\t\tawait nap(1000 / hz)\n\t\tconst next = $frame() + 1\n\t\t$frame(next >= frames.length ? 0 : next)\n\t}))\n\n\treturn frames.at($frame())\n})\n\nconst style = css`\n:host {\n\tfont-family: monospace;\n\twhite-space: pre;\n\tuser-select: none;\n}\n`\n\n", "\nimport {css, html} from \"lit\"\nimport {shadowView} from \"../../view/shadow.js\"\nimport {cssReset, useName, useStyles} from \"../../view/index.js\"\n\nexport const ErrorDisplay = shadowView((error: any) => {\n\tuseName(\"error\")\n\tuseStyles(cssReset, style)\n\n\tif (typeof error === \"string\")\n\t\treturn error\n\n\telse if (error instanceof Error)\n\t\treturn html`<strong>${error.name}:</strong> <span>${error.message}</span>`\n\n\telse\n\t\treturn `error`\n})\n\nconst style = css`\n\t:host {\n\t\tfont-family: monospace;\n\t\tcolor: red;\n\t}\n`\n\n", "\nimport {waitSelect} from \"@e280/strata\"\n\nimport {Spinner} from \"./types.js\"\nimport {Content} from \"../view/types.js\"\n\nexport function makeSpinner(\n\t\tpending: () => Content,\n\t\terr: (error: unknown) => Content,\n\t): Spinner {\n\t\n\treturn (wait, ok) => waitSelect(wait, {pending, err, ok})\n}\n\n", "\nimport {makeSpinner} from \"../make-spinner.js\"\nimport {makeAsciiAnim} from \"../parts/ascii-anim.js\"\nimport {ErrorDisplay} from \"../parts/error-display.js\"\n\nexport const dotsSpinner = makeSpinner(\n\tmakeAsciiAnim(10, [\n\t\t\" \",\n\t\t\" \",\n\t\t\". \",\n\t\t\".. \",\n\t\t\"...\",\n\t\t\" ..\",\n\t\t\" .\",\n\t]),\n\tErrorDisplay,\n)\n\n", "\nimport {makeSpinner} from \"../make-spinner.js\"\nimport {makeAsciiAnim} from \"../parts/ascii-anim.js\"\nimport {ErrorDisplay} from \"../parts/error-display.js\"\n\nexport const earthSpinner = makeSpinner(\n\tmakeAsciiAnim(3, [\"\uD83C\uDF0E\", \"\uD83C\uDF0F\", \"\uD83C\uDF0D\"]),\n\tErrorDisplay,\n)\n\n", "\nimport {makeSpinner} from \"../make-spinner.js\"\nimport {makeAsciiAnim} from \"../parts/ascii-anim.js\"\nimport {ErrorDisplay} from \"../parts/error-display.js\"\n\nexport const moonSpinner = makeSpinner(\n\tmakeAsciiAnim(10, [\n\t\t\"\uD83C\uDF12\",\n\t\t\"\uD83C\uDF13\",\n\t\t\"\uD83C\uDF14\",\n\t\t\"\uD83C\uDF15\",\n\t\t\"\uD83C\uDF16\",\n\t\t\"\uD83C\uDF17\",\n\t\t\"\uD83C\uDF18\",\n\t\t\"\uD83C\uDF11\",\n\t\t\"\uD83C\uDF11\",\n\t\t\"\uD83C\uDF11\",\n\t]),\n\tErrorDisplay,\n)\n\n", "\nimport {makeSpinner} from \"../make-spinner.js\"\nimport {makeAsciiAnim} from \"../parts/ascii-anim.js\"\nimport {ErrorDisplay} from \"../parts/error-display.js\"\n\nexport const spinner = makeSpinner(\n\tmakeAsciiAnim(16, [\"|\", \"/\", \"-\", \"\\\\\"]),\n\tErrorDisplay,\n)\n\n", "\nimport {makeSpinner} from \"../make-spinner.js\"\nimport {makeAsciiAnim} from \"../parts/ascii-anim.js\"\nimport {ErrorDisplay} from \"../parts/error-display.js\"\n\nexport const waveSpinner = makeSpinner(\n\tmakeAsciiAnim(20, [\n\t\t\":....\",\n\t\t\":....\",\n\t\t\"::...\",\n\t\t\".::..\",\n\t\t\"..::.\",\n\t\t\"...::\",\n\t\t\"....:\",\n\t\t\"....:\",\n\t\t\"...::\",\n\t\t\"..::.\",\n\t\t\".::..\",\n\t\t\"::...\",\n\t]),\n\tErrorDisplay,\n)\n\n", "\nimport type {Expression} from \"./expression.js\"\n\nexport type Sample = {\n\tcode: string\n\tvalue: number\n}\n\nexport type Source = {\n\treadonly onSample: (fn: (sample: Sample) => void) => () => void\n\treadonly dispose: () => void\n\treadonly poll?: () => void\n}\n\nexport type Input = {\n\n\t/** latest-known value. */\n\tvalue: number\n\n\t/** previously-known value from last frame. */\n\twas: number\n\n\t/** sum of values since last frame. */\n\tsum: number\n}\n\nexport type Inputs<B extends Bindings = any> = (\n\tB extends Expression\n\t\t? Input\n\t\t: B extends {[key: string]: Bindings}\n\t\t\t? {[K in keyof B]: Inputs<B[K]>}\n\t\t\t: never\n)\n\nexport type Bindings = Expression | {\n\t[key: string]: Bindings\n}\n\nexport const asBindings = <B extends Bindings>(bindings: B) => (bindings as any as Rebindings<B>)\n\nexport type Rebindings<B extends Bindings> = (\n\tB extends Expression\n\t\t? Expression\n\t\t: B extends {[key: string]: Bindings}\n\t\t\t? {[K in keyof B]: Rebindings<B[K]>}\n\t\t\t: never\n)\n\n", "\nimport {Hub} from \"./hub.js\"\nimport {Bindings} from \"../../input/types.js\"\nimport {Controls} from \"./controls/controls.js\"\n\nexport type PlayerId = number\nexport type ProfileKey = string\n\nexport type Profile<B extends Bindings = any> = {\n\tlabel: string\n\tbindings: B\n\tbasedOn?: string\n}\n\nexport type Presets<B extends Bindings> = Record<ProfileKey, Profile<B>>\n\nexport type Deck<B extends Bindings = any> = {\n\thub: Hub<B>\n\tmaxPlayers: number\n\tcontrols: Controls<B>\n\tdispose: () => void\n}\n\nexport const asDeck = <B extends Bindings>(deck: Deck<B>) => deck\nexport const asPresets = <B extends Bindings>(presets: Presets<B>) => presets\n\n", "\nimport {asBindings} from \"../lib/input/types.js\"\nimport {asPresets} from \"../lib/ui/deck/types.js\"\n\nexport const bindings = asBindings({\n\tlooking: {\n\t\thorizontal: [\"accumulate\", \"pointer.x\"],\n\t\tvertical: [\"accumulate\", \"pointer.y\"],\n\t},\n\tmoving: {\n\t\tforward: \"KeyW\",\n\t\tbackward: \"KeyS\",\n\t\tleftward: \"KeyA\",\n\t\trightward: \"KeyD\",\n\t},\n\tinteractions: {\n\t\tuse: \"KeyE\",\n\t},\n})\n\nexport const presets = asPresets<typeof bindings>({\n\tstandard: {label: \"\u2328\uFE0Fstandard\", bindings},\n\tgamer: {label: \"\uD83C\uDFAEgamer\", bindings: {\n\t\tlooking: {\n\t\t\thorizontal: [\"*\", [\"dt\"], \"gamepad.axis.3\", 100],\n\t\t\tvertical: [\"*\", [\"dt\"], \"gamepad.axis.4\", 100],\n\t\t},\n\t\tmoving: {\n\t\t\tforward: [\"remap\", 0, -1, 0, 1, \"gamepad.axis.2\"],\n\t\t\tbackward: [\"remap\", 0, 1, 0, 1, \"gamepad.axis.2\"],\n\t\t\tleftward: [\"remap\", 0, -1, 0, 1, \"gamepad.axis.1\"],\n\t\t\trightward: [\"remap\", 0, 1, 0, 1, \"gamepad.axis.1\"],\n\t\t},\n\t\tinteractions: {\n\t\t\tuse: \"gamepad.1\",\n\t\t},\n\t}},\n\tmicro: {label: \"\uD83E\uDDA0micro\", bindings: {\n\t\tlooking: {\n\t\t\thorizontal: [\"*\", [\"dt\"], [\"+\", \"gamepad.1\", [\"-\", \"gamepad.4\"]], 100],\n\t\t\tvertical: [\"*\", [\"dt\"], [\"+\", \"gamepad.2\", [\"-\", \"gamepad.3\"]], 100],\n\t\t},\n\t\tmoving: {\n\t\t\tforward: [\"remap\", 0, -1, 0, 1, \"gamepad.axis.2\"],\n\t\t\tbackward: [\"remap\", 0, 1, 0, 1, \"gamepad.axis.2\"],\n\t\t\tleftward: [\"remap\", 0, -1, 0, 1, \"gamepad.axis.1\"],\n\t\t\trightward: [\"remap\", 0, 1, 0, 1, \"gamepad.axis.1\"],\n\t\t},\n\t\tinteractions: {\n\t\t\tuse: [\"*\", \"gamepad.5\", \"gamepad.6\"],\n\t\t},\n\t}},\n})\n\n", "\nexport function minihash(hash: string) {\n\treturn Number.parseInt(hash.slice(0, 8), 16)\n}\n\n", "\nimport {Parcel} from \"./types.js\"\nimport {endian} from \"../endian.js\"\n\nexport function encodeParcels(parcels: Parcel[]): ArrayBuffer {\n\tconst sizeHeader = 8\n\tconst size = parcels.reduce(\n\t\t(total, {intents}) => total + sizeHeader + intents.byteLength,\n\t\t0,\n\t)\n\n\tconst buffer = new ArrayBuffer(size)\n\tconst view = new DataView(buffer)\n\tconst bytes = new Uint8Array(buffer)\n\tlet cursor = 0\n\n\tfor (const {playerId, intents} of parcels) {\n\t\tview.setUint32(cursor, playerId, endian)\n\t\tcursor += 4\n\n\t\tview.setUint32(cursor, intents.byteLength, endian)\n\t\tcursor += 4\n\n\t\tbytes.set(new Uint8Array(intents), cursor)\n\t\tcursor += intents.byteLength\n\t}\n\n\treturn buffer\n}\n\n", "\nimport {Intent} from \"./types.js\"\nimport {endian} from \"../endian.js\"\nimport {sizeHash, sizeId, sizeIntent, sizeValue} from \"./sizes.js\"\n\nexport function encodeIntents(minihash: number, intents: Intent[]) {\n\tconst byteCount = sizeHash + (intents.length * sizeIntent)\n\tconst buffer = new ArrayBuffer(byteCount)\n\tconst dv = new DataView(buffer)\n\tlet cursor = 0\n\n\tdv.setUint32(cursor, minihash, endian)\n\tcursor += sizeHash\n\n\tfor (const intent of intents) {\n\t\tdv.setUint16(cursor, intent.id, endian)\n\t\tcursor += sizeId\n\n\t\tdv.setFloat32(cursor, intent.value, endian)\n\t\tcursor += sizeValue\n\t}\n\n\treturn buffer\n}\n\n", "/** Whether the current platform is little-endian. */\nexport const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\nconst assertLE = (littleEndian = isLE) => {\n if (littleEndian)\n return;\n // Fail closed on BE for now: qemu-smoke checks still showed broken wasm outputs, and the JS\n // target would need a dedicated BE compilation path that is not currently generated.\n throw new Error('big-endian platforms are unsupported');\n};\nassertLE();\n/** Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. */\n/**\n * Checks whether a value is a byte-oriented Uint8Array view.\n * @param a - value to inspect.\n * @returns True when the value is a Uint8Array-compatible byte view.\n * @example\n * ```ts\n * import { isBytes } from '@awasm/noble/utils.js';\n * isBytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function isBytes(a) {\n // Plain `instanceof Uint8Array` is too strict for some Buffer / proxy / cross-realm cases.\n // The fallback still requires a real ArrayBuffer view, so plain\n // JSON-deserialized `{ constructor: ... }` spoofing is rejected, and\n // `BYTES_PER_ELEMENT === 1` keeps the fallback on byte-oriented views.\n return (a instanceof Uint8Array ||\n (ArrayBuffer.isView(a) &&\n a.constructor.name === 'Uint8Array' &&\n 'BYTES_PER_ELEMENT' in a &&\n a.BYTES_PER_ELEMENT === 1));\n}\n/**\n * Asserts something is boolean.\n * @param b - value to validate.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * ```ts\n * import { abool } from '@awasm/noble/utils.js';\n * abool(true);\n * ```\n */\nexport function abool(b) {\n if (typeof b !== 'boolean')\n throw new TypeError(`boolean expected, not ${b}`);\n}\n/**\n * Asserts something is a non-negative safe integer.\n * @param n - value to validate.\n * @param title - optional field name for error messages.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * ```ts\n * import { anumber } from '@awasm/noble/utils.js';\n * anumber(7, 'count');\n * ```\n */\nexport function anumber(n, title = '') {\n const prefix = title && `\"${title}\" `;\n if (typeof n !== 'number')\n throw new TypeError(`${prefix}expected number, got ${typeof n}`);\n if (!Number.isSafeInteger(n) || n < 0) {\n throw new RangeError(`${prefix}expected integer >= 0, got ${n}`);\n }\n}\n/**\n * Asserts something is Uint8Array.\n * @param value - byte array candidate.\n * @param length - optional exact length requirement.\n * @param title - optional field name for error messages.\n * @returns The validated byte array.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * ```ts\n * import { abytes } from '@awasm/noble/utils.js';\n * abytes(new Uint8Array([1, 2, 3]), 3, 'msg');\n * ```\n */\nexport function abytes(value, length, title = '') {\n const bytes = isBytes(value);\n const len = value?.length;\n const needsLen = length !== undefined;\n const prefix = title && `\"${title}\" `;\n if (!bytes)\n throw new TypeError(prefix + 'expected Uint8Array, got type=' + typeof value);\n if (needsLen && len !== length)\n throw new RangeError(prefix + 'expected Uint8Array of length ' + length + ', got length=' + len);\n return value;\n}\n/**\n * Asserts a hash-like instance has not been destroyed or finished.\n * @param instance - instance to validate.\n * @param checkFinished - whether to reject already-finished instances.\n * @throws If the documented runtime validation or state check fails. {@link Error}\n * @example\n * ```ts\n * import { aexists } from '@awasm/noble/utils.js';\n * aexists({ destroyed: false, finished: false });\n * ```\n */\nexport function aexists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\n/**\n * Asserts an output buffer is a byte array with sufficient capacity.\n * @param out - destination buffer.\n * @param instance - object exposing `outputLen`.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * ```ts\n * import { aoutput } from '@awasm/noble/utils.js';\n * aoutput(new Uint8Array(32), { outputLen: 32 });\n * ```\n */\nexport function aoutput(out, instance) {\n abytes(out, undefined, 'output');\n const min = instance.outputLen;\n if (out.length < min) {\n // Shared digestInto() contracts treat undersized destinations as a range problem, not a\n // generic runtime failure, so callers can distinguish \"wrong type\" from \"too short\".\n throw new RangeError('digestInto() expects output buffer of length at least ' + min);\n }\n}\n/**\n * Asserts a hash surface looks like one produced by the hash factory.\n * @param h - hash surface to validate.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @throws If a documented runtime validation or state check fails. {@link Error}\n * @example\n * ```ts\n * import { sha256 } from '@awasm/noble';\n * import { ahash } from '@awasm/noble/utils.js';\n * ahash(sha256);\n * ```\n */\nexport function ahash(h) {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new TypeError('Hash must created by hashes.mkHash');\n anumber(h.outputLen);\n anumber(h.blockLen);\n // HMAC and KDF callers treat these as real byte lengths; allowing zero lets fake wrappers pass\n // validation and can produce empty outputs instead of failing fast.\n if (h.outputLen < 1)\n throw new Error('\"outputLen\" must be >= 1');\n if (h.blockLen < 1)\n throw new Error('\"blockLen\" must be >= 1');\n}\n/**\n * Casts a typed-array view to bytes over the same memory region.\n * Shared buffer view in native memory order; used for internal state init, not endian-normalized serialization.\n * @param arr - source typed-array view.\n * @returns Byte view over the same buffer region.\n * @example\n * ```ts\n * import { u8 } from '@awasm/noble/utils.js';\n * u8(new Uint32Array([1]));\n * ```\n */\nexport function u8(arr) {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/**\n * Casts a typed-array view to 32-bit words over the same memory region.\n * Shared native-order word view; byteOffset must be 4-byte aligned and trailing 1..3 bytes are ignored.\n * @param arr - source typed-array view.\n * @returns Uint32Array view over the same buffer region.\n * @example\n * ```ts\n * import { u32 } from '@awasm/noble/utils.js';\n * u32(new Uint8Array([1, 2, 3, 4]));\n * ```\n */\nexport function u32(arr) {\n return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n/**\n * Byte-swaps each 32-bit word on big-endian platforms.\n * @param arr - word array to normalize in place.\n * @returns The input array after any required byte swaps.\n * @example\n * ```ts\n * import { swap32IfBE } from '@awasm/noble/utils.js';\n * const words = new Uint32Array([0x11223344]);\n * swap32IfBE(words);\n * ```\n */\nexport function swap32IfBE(arr) {\n if (isLE)\n return arr;\n for (let i = 0; i < arr.length; i++) {\n const x = arr[i];\n arr[i] = ((x << 24) | ((x & 0xff00) << 8) | ((x >>> 8) & 0xff00) | (x >>> 24)) >>> 0;\n }\n return arr;\n}\n/**\n * Zeroize typed arrays in place. Warning: JS provides no guarantees.\n * @param arrays - arrays to overwrite with zeros.\n * @example\n * ```ts\n * import { clean } from '@awasm/noble/utils.js';\n * const buf = new Uint8Array([1, 2, 3]);\n * clean(buf);\n * ```\n */\nexport function clean(...arrays) {\n for (let i = 0; i < arrays.length; i++) {\n arrays[i].fill(0);\n }\n}\n// JS `.fill(0)` can be surprisingly slow on large buffers; chunked `.set` tends to be faster.\n// This is used by ciphers to clear large staging buffers without making perf unusable.\n/**\n * Fast zeroization for large byte buffers.\n * @param dst - destination buffer.\n * @param len - prefix length to clear.\n * @example\n * ```ts\n * import { cleanFast } from '@awasm/noble/utils.js';\n * cleanFast(new Uint8Array(16), 8);\n * ```\n */\nexport const cleanFast = (() => {\n let zero;\n return (dst, len = dst.length) => {\n abytes(dst);\n anumber(len, 'len');\n if (len > dst.length)\n throw new Error(`\"len\" expected <= dst.length, got len=${len} dst.length=${dst.length}`);\n if (!len)\n return;\n // Keep the zero chunk inside the export so bundles that don't use cleanFast can drop it too.\n const chunk = zero || (zero = /* @__PURE__ */ new Uint8Array(1024 * 1024));\n let off = 0;\n for (; off + chunk.length <= len; off += chunk.length)\n dst.set(chunk, off);\n if (off < len)\n dst.fill(0, off, len);\n };\n})();\n/**\n * Create a DataView over the same buffer region; writes through it mutate the original array.\n * @param arr - source typed-array view.\n * @returns DataView over the same buffer region.\n * @example\n * ```ts\n * import { createView } from '@awasm/noble/utils.js';\n * createView(new Uint8Array(8));\n * ```\n */\nexport function createView(arr) {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/**\n * Checks if two byte arrays overlap in the same underlying buffer.\n * This is invalid and can corrupt data.\n * @param a - first byte view.\n * @param b - second byte view.\n * @returns True when the byte ranges overlap.\n * @example\n * ```ts\n * import { overlapBytes } from '@awasm/noble/utils.js';\n * const buf = new Uint8Array(8);\n * overlapBytes(buf.subarray(0, 4), buf.subarray(2, 6));\n * ```\n */\nexport function overlapBytes(a, b) {\n // Zero-length views cannot overwrite anything, even if their offset sits inside another range.\n if (!a.byteLength || !b.byteLength)\n return false;\n return (a.buffer === b.buffer &&\n a.byteOffset < b.byteOffset + b.byteLength &&\n b.byteOffset < a.byteOffset + a.byteLength);\n}\nexport const __TEST = /* @__PURE__ */ Object.freeze({\n assertLE,\n});\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin = /* @__PURE__ */ (() => \n// @ts-ignore\ntypeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * Convert byte array to hex string. Uses built-in function, when available.\n * @param bytes - bytes to encode.\n * @returns Lowercase hex string.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * ```ts\n * import { bytesToHex } from '@awasm/noble/utils.js';\n * bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23]));\n * ```\n */\nexport function bytesToHex(bytes) {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin)\n return bytes.toHex();\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };\nfunction asciiToBase16(ch) {\n if (ch >= asciis._0 && ch <= asciis._9)\n return ch - asciis._0; // '2' => 50-48\n if (ch >= asciis.A && ch <= asciis.F)\n return ch - (asciis.A - 10); // 'B' => 66-(65-10)\n if (ch >= asciis.a && ch <= asciis.f)\n return ch - (asciis.a - 10); // 'b' => 98-(97-10)\n return;\n}\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @param hex - hex string to decode.\n * @returns Decoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * ```ts\n * import { hexToBytes } from '@awasm/noble/utils.js';\n * hexToBytes('cafe0123');\n * ```\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new TypeError('hex string expected, got ' + typeof hex);\n if (hasHexBuiltin) {\n try {\n // @ts-ignore\n return Uint8Array.fromHex(hex);\n }\n catch (error) {\n if (error instanceof SyntaxError)\n throw new RangeError(error.message);\n throw error;\n }\n }\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2)\n throw new RangeError('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi));\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new RangeError('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // multiply first octet, e.g. 'a3' => 10*16+3 => 160 + 3 => 163\n }\n return array;\n}\n/**\n * There is no setImmediate in browser and setTimeout is slow.\n * Call of async fn will return Promise, which will be fullfiled only on\n * next scheduler queue processing step and this is exactly what we need.\n * This yields to the Promise/microtask scheduler queue, not to timers or the full macrotask event loop.\n * @example\n * ```ts\n * import { nextTick } from '@awasm/noble/utils.js';\n * await nextTick();\n * ```\n */\nexport const nextTick = async () => { };\n/**\n * Returns control to the Promise/microtask scheduler every `tick` ms to avoid blocking long loops.\n * @param iters - number of loop iterations.\n * @param tick - maximum milliseconds to spend before yielding.\n * @param cb - callback invoked for each iteration index.\n */\nexport async function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick();\n ts += diff;\n }\n}\n/**\n * Converts string to bytes using UTF8 encoding.\n * Built-in doesn't validate input to be string: we do the check.\n * Non-ASCII details are delegated to the platform TextEncoder.\n * @param str - string to encode.\n * @returns UTF-8 bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * ```ts\n * import { utf8ToBytes } from '@awasm/noble/utils.js';\n * utf8ToBytes('abc');\n * ```\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new TypeError('string expected');\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\n/**\n * Convert byte array to string, assuming UTF8 encoding.\n * Input validation and malformed-sequence handling are delegated to TextDecoder:\n * invalid UTF-8 is replacement-decoded, not rejected.\n * @param bytes - bytes to decode.\n * @returns UTF-8 string.\n * @example\n * ```ts\n * import { bytesToUtf8 } from '@awasm/noble/utils.js';\n * bytesToUtf8(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport function bytesToUtf8(bytes) {\n return new TextDecoder().decode(bytes);\n}\n/**\n * Checks whether a byte array is aligned to a 4-byte offset.\n * @param bytes - byte view to inspect.\n * @returns True when the view is 32-bit aligned.\n * @example\n * ```ts\n * import { isAligned32 } from '@awasm/noble/utils.js';\n * isAligned32(new Uint8Array(8));\n * ```\n */\nexport function isAligned32(bytes) {\n return bytes.byteOffset % 4 === 0;\n}\n/**\n * By default, returns u8a of expected length.\n * When `out` is specified, it checks it for validity and uses it.\n * @param expectedLength - expected output length in bytes.\n * @param out - optional caller-provided destination buffer.\n * @param onlyAligned - whether to require 32-bit alignment for `out`.\n * @returns Output buffer with the expected length.\n * @throws On wrong argument types. {@link TypeError}\n * @throws If a documented runtime validation or state check fails. {@link Error}\n * @example\n * ```ts\n * import { getOutput } from '@awasm/noble/utils.js';\n * getOutput(16);\n * ```\n */\nexport function getOutput(expectedLength, out, onlyAligned = true) {\n if (out === undefined)\n return new Uint8Array(expectedLength);\n // Keep Buffer/cross-realm Uint8Array support here instead of trusting a shape-compatible object.\n abytes(out, undefined, 'output');\n if (out.length !== expectedLength)\n throw new Error('\"output\" expected Uint8Array of length ' + expectedLength + ', got: ' + out.length);\n if (onlyAligned && !isAligned32(out))\n throw new Error('invalid output, must be aligned');\n return out;\n}\n/**\n * Encodes the AEAD length block as aadLength || dataLength.\n * Callers pass lengths already scaled to the mode's unit:\n * octets for ChaCha20-Poly1305, bits for GCM/GCM-SIV.\n * @param dataLength - encoded data length.\n * @param aadLength - encoded AAD length.\n * @param isLE - whether to write values in little-endian order.\n * @returns Encoded 16-byte length block.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * ```ts\n * import { u64Lengths } from '@awasm/noble/utils.js';\n * u64Lengths(16, 8, true);\n * ```\n */\nexport function u64Lengths(dataLength, aadLength, isLE) {\n // Reject coercible non-number lengths like '10' and true before BigInt(...) accepts them.\n anumber(dataLength);\n anumber(aadLength);\n abool(isLE);\n const num = new Uint8Array(16);\n const view = createView(num);\n view.setBigUint64(0, BigInt(aadLength), isLE);\n view.setBigUint64(8, BigInt(dataLength), isLE);\n return num;\n}\n/**\n * Helper for KDFs: consumes Uint8Array or string.\n * String inputs are UTF-8 encoded; byte-array inputs stay aliased to the caller buffer.\n * @param data - string or bytes input.\n * @param errorTitle - optional field name for byte validation.\n * @returns Byte representation of the input.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * ```ts\n * import { kdfInputToBytes } from '@awasm/noble/utils.js';\n * kdfInputToBytes('password');\n * ```\n */\nexport function kdfInputToBytes(data, errorTitle = '') {\n if (typeof data === 'string')\n return utf8ToBytes(data);\n return abytes(data, undefined, errorTitle);\n}\n/**\n * Copies several Uint8Arrays into one.\n * @param arrays - arrays to concatenate.\n * @returns Concatenated bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * ```ts\n * import { concatBytes } from '@awasm/noble/utils.js';\n * concatBytes(new Uint8Array([1]), new Uint8Array([2, 3]));\n * ```\n */\nexport function concatBytes(...arrays) {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n/**\n * Fast copy for validated, in-bounds byte ranges.\n * Overlap is intentionally unsupported here for speed: hot callers only pass disjoint ranges,\n * and same-buffer moves must use copyWithin()/set() at the call site instead.\n * @param dst - destination byte array.\n * @param dstPos - write offset in destination.\n * @param src - source byte array.\n * @param srcPos - read offset in source.\n * @param len - number of bytes to copy.\n * @example\n * ```ts\n * import { copyFast } from '@awasm/noble/utils.js';\n * const dst = new Uint8Array(4);\n * copyFast(dst, 1, new Uint8Array([7, 8]), 0, 2);\n * ```\n */\nexport function copyFast(dst, dstPos, src, srcPos, len) {\n if (len <= 0)\n return;\n if (len <= 64)\n for (let i = 0; i < len; i++)\n dst[dstPos + i] = src[srcPos + i];\n else\n dst.set(src.subarray(srcPos, srcPos + len), dstPos);\n}\n/**\n * Fast copy for validated, in-bounds 32-bit word ranges.\n * Overlap is intentionally unsupported here for speed: hot callers only pass disjoint ranges,\n * and same-buffer moves must use copyWithin()/set() at the call site instead.\n * @param dst - destination word array.\n * @param dstPos - write offset in destination.\n * @param src - source word array.\n * @param srcPos - read offset in source.\n * @param len - number of words to copy.\n * @example\n * ```ts\n * import { copyFast32 } from '@awasm/noble/utils.js';\n * const dst = new Uint32Array(4);\n * copyFast32(dst, 1, new Uint32Array([7, 8]), 0, 2);\n * ```\n */\nexport function copyFast32(dst, dstPos, src, srcPos, len) {\n if (len <= 0)\n return;\n if (len <= 64)\n for (let i = 0; i < len; i++)\n dst[dstPos + i] = src[srcPos + i];\n else\n dst.set(src.subarray(srcPos, srcPos + len), dstPos);\n}\n/**\n * Callers must pass a validated byte array; Uint8Array.from() would otherwise coerce arbitrary iterables.\n * Copies into a detached Uint8Array instead of using slice(), because Buffer.slice() aliases memory.\n * @param bytes - bytes to copy.\n * @returns Detached copy of the input bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * ```ts\n * import { copyBytes } from '@awasm/noble/utils.js';\n * copyBytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function copyBytes(bytes) {\n // `Uint8Array.from(...)` would also accept arrays / other typed arrays. Keep this helper strict\n // because callers use it at byte-validation boundaries before mutating the detached copy.\n return Uint8Array.from(abytes(bytes));\n}\n/**\n * Creates OID opts for NIST hashes, with prefix 06 09 60 86 48 01 65 03 04 02.\n * Current callers pass one-byte hashAlgs suffixes for 2.16.840.1.101.3.4.2.<suffix>,\n * so the DER length byte stays 0x09.\n * @param suffix - final OID suffix byte.\n * @returns DER-encoded OID bytes.\n * @example\n * ```ts\n * import { oidNist } from '@awasm/noble/utils.js';\n * oidNist(1);\n * ```\n */\nexport const oidNist = (suffix) => Uint8Array.from([\n 0x06,\n 0x09,\n 0x60,\n 0x86,\n 0x48,\n 0x01,\n 0x65,\n 0x03,\n 0x04,\n 0x02,\n suffix,\n]);\n/**\n * Merges default options and passed options.\n * This mutates `defaults`, so callers pass fresh defaults when they need reuse.\n * @param defaults - default option object.\n * @param opts - caller-provided overrides.\n * @returns Merged options object.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * ```ts\n * import { checkOpts } from '@awasm/noble/utils.js';\n * checkOpts({ a: 1 }, { b: 2 });\n * ```\n */\nexport function checkOpts(defaults, opts) {\n if (opts !== undefined && {}.toString.call(opts) !== '[object Object]')\n throw new TypeError('options must be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\n/**\n * Build sync and async wrappers from the same generator body.\n * @param cb_ - generator callback shared by sync and async variants.\n * @returns Function exposing both sync and `.async(...)` entrypoints.\n * @example\n * ```ts\n * import { mkAsync } from '@awasm/noble/utils.js';\n * const twice = mkAsync(function* (_setup, value: number) {\n * return value * 2;\n * });\n * await twice.async(2);\n * ```\n */\nexport function mkAsync(cb_) {\n const cb = cb_;\n const genSetup = (canReturn) => {\n let setupDone = false;\n let progressTotal = -1;\n let done = 0;\n let stateBytes = 0;\n let state;\n let onSave = (_state) => { };\n let onRestore = (_state) => { };\n /**\n * Default scheduler yields to the Promise microtask queue.\n * Callers can pass `nextTick` when they need a custom scheduler.\n */\n let onNextTick = async () => { };\n return {\n save: () => {\n if (!canReturn || !stateBytes)\n return;\n if (!state)\n state = new Uint8Array(stateBytes);\n onSave(state);\n },\n restore: () => {\n if (!canReturn || !state)\n return;\n onRestore(state);\n },\n nextTick: () => onNextTick(),\n onEnd: () => {\n // setup() can be skipped on explicit sync fast-paths.\n if (progressTotal < 0)\n return;\n if (done !== progressTotal)\n throw new Error(`done (${done}) < progressTotal(${progressTotal})`);\n },\n setup: (_opts) => {\n const rawOpts = _opts;\n if (setupDone)\n throw new Error('setup already called');\n setupDone = true;\n if (!canReturn) {\n anumber(rawOpts.total, 'total');\n progressTotal = rawOpts.total;\n const onProgress = rawOpts.onProgress;\n if (onProgress !== undefined && typeof onProgress !== 'function')\n throw new Error('onProgress must be a function');\n if (!onProgress) {\n return (inc = 1) => {\n done += inc;\n return false;\n };\n }\n const callbackPer = Math.max(Math.floor(progressTotal / 10000), 1);\n return (inc = 1) => {\n done += inc;\n if (!(done % callbackPer) || done === progressTotal)\n onProgress(progressTotal ? done / progressTotal : 1);\n return false;\n };\n }\n const opts = { ...rawOpts };\n if (opts.asyncTick === undefined)\n delete opts.asyncTick; // will override defaults otherwise\n const { asyncTick, onProgress, stateBytes: _stateBytes, save, restore, nextTick, total, } = checkOpts({ asyncTick: 10 }, opts);\n anumber(asyncTick, 'asyncTick');\n anumber(total, 'total');\n progressTotal = total;\n for (const [k, v] of Object.entries({ onProgress, save, restore, nextTick })) {\n if (v !== undefined && typeof v !== 'function')\n throw new Error(`${k} must be a function`);\n }\n if (_stateBytes !== undefined)\n anumber(_stateBytes, 'stateBytes');\n if (_stateBytes !== undefined)\n stateBytes = _stateBytes;\n if ((save !== undefined || restore !== undefined) && !stateBytes)\n throw new Error('stateBytes must be a positive integer when save/restore is used');\n if (save !== undefined)\n onSave = save;\n if (restore !== undefined)\n onRestore = restore;\n if (nextTick !== undefined)\n onNextTick = nextTick;\n let needReturn = () => false;\n if (canReturn) {\n let ts = Date.now();\n needReturn = () => {\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < asyncTick)\n return false;\n ts += diff;\n return true;\n };\n }\n // Invoke callback if progress changes from 10.01 to 10.02\n // Allows to draw smooth progress bar on up to 8K screen\n const callbackPer = Math.max(Math.floor(progressTotal / 10000), 1);\n let progress = (inc = 1) => {\n done += inc;\n return needReturn();\n };\n if (onProgress) {\n progress = (inc = 1) => {\n done += inc;\n if (onProgress && (!(done % callbackPer) || done === total))\n onProgress(total ? done / total : 1);\n return needReturn();\n };\n }\n return progress;\n },\n };\n };\n const res = (...args) => {\n let setupDone = false;\n let progressTotal = -1;\n let done = 0;\n const setup = ((opts) => {\n const rawOpts = opts;\n if (setupDone)\n throw new Error('setup already called');\n setupDone = true;\n anumber(rawOpts.total, 'total');\n progressTotal = rawOpts.total;\n const onProgress = rawOpts.onProgress;\n if (onProgress !== undefined && typeof onProgress !== 'function')\n throw new Error('onProgress must be a function');\n if (!onProgress) {\n return (inc = 1) => {\n done += inc;\n return false;\n };\n }\n const callbackPer = Math.max(Math.floor(progressTotal / 10000), 1);\n return (inc = 1) => {\n done += inc;\n // Keep zero-total sync progress aligned with the async path for empty-input callers.\n if (!(done % callbackPer) || done === progressTotal)\n onProgress(progressTotal ? done / progressTotal : 1);\n return false;\n };\n });\n setup.isAsync = false;\n const g = cb(setup, ...args);\n let r = g.next();\n while (!r.done)\n r = g.next();\n if (progressTotal >= 0 && done !== progressTotal)\n throw new Error(`done (${done}) < progressTotal(${progressTotal})`);\n return r.value;\n };\n res.async = async (...args) => {\n const { setup, save, restore, onEnd, nextTick } = genSetup(true);\n const setupMode = setup;\n setupMode.isAsync = true;\n const g = cb(setupMode, ...args);\n let r = g.next();\n while (!r.done) {\n save();\n await nextTick();\n restore();\n r = g.next();\n }\n onEnd();\n return r.value;\n };\n return res;\n}\n/**\n * Compares two byte arrays in kinda constant time once lengths already match.\n * Different lengths return false immediately.\n * @param a - first byte array.\n * @param b - second byte array.\n * @returns True when the byte arrays are equal.\n * @example\n * ```ts\n * import { equalBytes } from '@awasm/noble/utils.js';\n * equalBytes(new Uint8Array([1, 2]), new Uint8Array([1, 2]));\n * ```\n */\nexport function equalBytes(a, b) {\n if (a.length !== b.length)\n return false;\n let diff = 0;\n for (let i = 0; i < a.length; i++)\n diff |= a[i] ^ b[i];\n return diff === 0;\n}\n/**\n * Cryptographically secure PRNG. Uses internal OS-level `crypto.getRandomValues`.\n * @param bytesLength - number of random bytes to generate.\n * @returns Random bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @throws If a documented runtime validation or state check fails. {@link Error}\n * @example\n * ```ts\n * import { randomBytes } from '@awasm/noble/utils.js';\n * randomBytes(16);\n * ```\n */\nexport function randomBytes(bytesLength = 32) {\n // Validate upfront so fractional / coercible lengths do not silently\n // truncate through Uint8Array().\n anumber(bytesLength);\n const cr = typeof globalThis === 'object' ? globalThis.crypto : null;\n if (typeof cr?.getRandomValues !== 'function')\n throw new Error('crypto.getRandomValues must be defined');\n return cr.getRandomValues(new Uint8Array(bytesLength));\n}\n/**\n * Uses CSPRNG for nonce and injects it into ciphertext.\n * For `encrypt`, a `nonceLength`-byte nonce is fetched from CSPRNG and\n * prepended to encrypted ciphertext. For `decrypt`, the first `nonceLength`\n * bytes of ciphertext are treated as nonce.\n *\n * The wrapper always allocates a fresh `nonce || ciphertext` buffer on encrypt\n * and intentionally does not support caller-provided destination buffers.\n * Too-short decrypt inputs are split into short/empty nonce views and then\n * delegated to the wrapped cipher instead of being rejected here first.\n *\n * NOTE: Under the same key, using random nonces (e.g. `managedNonce`) with AES-GCM and ChaCha\n * should be limited to `2**23` (8M) messages to get a collision chance of\n * `2**-50`. Stretching to `2**32` (4B) messages would raise that chance to\n * `2**-33`, still negligible but creeping up.\n * @param fn - nonce-taking cipher factory.\n * @param randomBytes_ - CSPRNG used to generate nonces.\n * @returns Cipher factory that prepends managed nonces to ciphertext.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * ```ts\n * import { managedNonce } from '@awasm/noble/utils.js';\n * import { xchacha20poly1305 } from '@awasm/noble';\n * const cipher = managedNonce(xchacha20poly1305)(new Uint8Array(32));\n * const sealed = cipher.encrypt(new Uint8Array([1, 2, 3]));\n * cipher.decrypt(sealed);\n * ```\n */\nexport function managedNonce(fn, randomBytes_ = randomBytes) {\n const { nonceLength } = fn;\n const nonceLen = nonceLength;\n anumber(nonceLen);\n const addNonce = (nonce, ciphertext, plaintext) => {\n const out = concatBytes(nonce, ciphertext);\n // Wrapped ciphers may alias caller plaintext on encrypt(); don't wipe caller-owned bytes here.\n if (!overlapBytes(plaintext, ciphertext))\n ciphertext.fill(0);\n return out;\n };\n // NOTE: we cannot support DST here, it would be a mistake:\n // - we don't know how much dst length cipher requires\n // - nonce may unalign dst and break everything\n // - we create new u8a anyway (concatBytes)\n // - previously all args were passed-through to a cipher, but that was a mistake\n const res = ((key, ...args) => ({\n encrypt(plaintext) {\n abytes(plaintext);\n const nonce = randomBytes_(nonceLen);\n const encrypted = fn(key, nonce, ...args).encrypt(plaintext);\n // @ts-ignore\n if (encrypted instanceof Promise)\n return encrypted.then((ct) => addNonce(nonce, ct, plaintext));\n return addNonce(nonce, encrypted, plaintext);\n },\n decrypt(ciphertext) {\n abytes(ciphertext);\n const nonce = ciphertext.subarray(0, nonceLen);\n const decrypted = ciphertext.subarray(nonceLen);\n return fn(key, nonce, ...args).decrypt(decrypted);\n },\n }));\n // awasm tests and callers still treat managed wrappers as cipher factories, so preserve metadata.\n if ('blockSize' in fn)\n res.blockSize = fn.blockSize;\n res.nonceLength = nonceLen;\n if ('tagLength' in fn)\n res.tagLength = fn.tagLength;\n if (fn.withAAD)\n res.withAAD = true;\n return res;\n}\n", "/**\n * Abstract logic for hashes.\n * @module\n */\nimport { abool, abytes, anumber, clean, concatBytes, copyBytes, copyFast, isBytes, mkAsync, } from \"./utils.js\";\nconst checkParallelOutput = (opts, count, outputLen, canXOF) => {\n const raw = (isBytes(opts) ? {} : opts || {});\n if (raw.dkLen !== undefined)\n anumber(raw.dkLen, 'opts.dkLen');\n if (raw.outPos !== undefined)\n anumber(raw.outPos, 'opts.outPos');\n const dkLen = (raw.dkLen === undefined ? outputLen : raw.dkLen) | 0;\n if (!canXOF && dkLen > outputLen)\n throw new RangeError(`\"opts.dkLen\" expected <= ${outputLen}, got ${dkLen}`);\n if (Array.isArray(raw.out)) {\n if (raw.outPos !== undefined && raw.outPos !== 0)\n throw new Error('outPos is not supported with output view arrays');\n if (raw.out.length !== count)\n throw new RangeError('output array length must match messages length');\n for (let i = 0; i < count; i++)\n abytes(raw.out[i], dkLen, 'output');\n return { dkLen, out: raw.out };\n }\n if (raw.out !== undefined)\n abytes(raw.out, undefined, 'output');\n const out = raw.out || new Uint8Array(dkLen * count);\n const outPos = (raw.outPos === undefined ? 0 : raw.outPos) | 0;\n if (outPos < 0 || outPos + dkLen * count > out.length)\n throw new RangeError('out/outPos too small');\n const slices = [];\n for (let i = 0; i < count; i++) {\n const pos = outPos + i * dkLen;\n slices.push(out.subarray(pos, pos + dkLen));\n }\n return { dkLen, out: slices };\n};\nconst BRAND = /* @__PURE__ */ Symbol('hash_impl_brand');\nconst brandSet = /* @__PURE__ */ new WeakSet();\nfunction isBranded(x) {\n return typeof x === 'function' || (typeof x === 'object' && x !== null)\n ? brandSet.has(x)\n : false;\n}\n// Universal generic wrapper\nexport function mkHash(modFn, def_, platform) {\n const def = def_;\n const { outputLen, blockLen, suffix = 0, init, canXOF, oid } = def;\n const outBlockLen = def.outputBlockLen ? def.outputBlockLen : def.outputLen;\n let hashImpl;\n let hashAsyncImpl;\n let chunksImpl;\n let chunksAsyncImpl;\n let parallelImpl;\n let parallelAsyncImpl;\n let createImpl;\n let cleanStateImpl;\n let inited = false;\n function lazyInit() {\n if (inited)\n throw new Error('second lazyInit call');\n const mod = modFn();\n inited = true;\n const { processBlocks, processOutBlocks, padding, reset } = mod;\n const BUFFER = mod.segments.buffer;\n const STATE = mod.segments.state_chunks[0];\n const STATE_CHUNKS = mod.segments.state_chunks;\n const parallelChunks = mod.segments.state_chunks.length;\n const maxBlocks = Math.floor(BUFFER.length / blockLen);\n const chunks = maxBlocks - 2; // 2 for padding\n if (chunks < 1)\n throw new Error('wrong chunks');\n const maxOutBlocks = Math.floor(BUFFER.length / outBlockLen);\n const prefixStates = new WeakSet();\n function initHash(opts, batchPos = 0) {\n const rawOpts = opts;\n reset(batchPos, 1, 0, outBlockLen, maxOutBlocks);\n let blocks = 0;\n let streamOutputLen = outputLen;\n if (rawOpts.dkLen !== undefined) {\n anumber(rawOpts.dkLen, 'opts.dkLen');\n streamOutputLen = rawOpts.dkLen | 0;\n if (!canXOF && streamOutputLen > outputLen)\n throw new RangeError(`\"opts.dkLen\" expected <= ${outputLen}, got ${streamOutputLen}`);\n }\n if (init) {\n const i = init(batchPos, maxBlocks, mod, hash, rawOpts);\n if (i && i.blocks !== undefined)\n blocks = i.blocks;\n if (i && i.outputLen !== undefined)\n streamOutputLen = i.outputLen;\n }\n return { blocks, outputLen: streamOutputLen };\n }\n // reset(0, 1);\n function processMessage(msg, blocks) {\n // Preloaded blocks from init(): e.g., keyed BLAKE2 writes key||zeros into BUFFER\n // Invariant: these are full blocks, already in BUFFER, and must *not* be treated as 'last'.\n if (blocks > 0) {\n if (msg.length === 0) {\n const padBlocks = padding(0, blocks * blockLen, maxBlocks, 0, blockLen, suffix);\n processBlocks(0, 1, blocks + padBlocks, maxBlocks, blockLen, 1, 0, padBlocks);\n return;\n }\n processBlocks(0, 1, blocks, maxBlocks, blockLen, 0, 0, 0);\n }\n let pos = 0;\n do {\n const take = Math.min(msg.length - pos, chunks * blockLen);\n copyFast(BUFFER, 0, msg, pos, take);\n const isLast = pos + take == msg.length;\n // How many full/partial blocks do we have here? Can be zero.\n let blocks = Math.ceil(take / blockLen);\n // now, we need position where we add padding? take?\n // How much space remains? blockLen-rem, except rem=0.\n const left = blocks * blockLen - take;\n let padBlocks = 0;\n if (isLast) {\n // suffix for sha3 and length for blake1, nothing for others\n padBlocks = padding(0, take, maxBlocks, left, blockLen, suffix);\n blocks += padBlocks;\n }\n processBlocks(0, 1, blocks, maxBlocks, blockLen, isLast ? 1 : 0, left, padBlocks);\n pos += take;\n } while (pos < msg.length); // no extra final take=0 pass\n }\n function processMessages(parts, blocks, prefix) {\n // TODO: cleanup, garbage.\n const cap = (chunks * blockLen) | 0; // max bytes per batch\n // total length to keep isLast identical to single-buffer path\n const prefixLen = prefix ? prefix.buf.length : 0;\n let totalLen = prefixLen;\n for (let k = 0; k < parts.length; k++)\n totalLen += parts[k].length;\n // Preloaded blocks from init():\n // those are full blocks, already in BUFFER, and must NOT be treated as 'last'.\n if (blocks > 0) {\n if (totalLen === 0) {\n const padBlocks = padding(0, blocks * blockLen, maxBlocks, 0, blockLen, suffix);\n processBlocks(0, 1, blocks + padBlocks, maxBlocks, blockLen, 1, 0, padBlocks);\n return;\n }\n processBlocks(0, 1, blocks, maxBlocks, blockLen, 0, 0, 0);\n }\n let pos = 0; // global position in virtual concatenation\n let idx = 0; // which part\n let off = 0; // offset within current part\n while (pos < totalLen) {\n const take = Math.min(totalLen - pos, cap) | 0;\n // fill BUFFER[0..take) from parts[idx..] without concat\n let written = 0;\n if (prefix && pos < prefixLen) {\n const n = Math.min(take, prefixLen - pos) | 0;\n copyFast(BUFFER, written, prefix.buf, pos, n);\n written += n;\n }\n while (written < take) {\n const cur = parts[idx];\n const rem = (cur.length - off) | 0;\n const n = (take - written < rem ? take - written : rem) | 0;\n copyFast(BUFFER, written, cur, off, n);\n written += n;\n off += n;\n if (off === cur.length) {\n idx++;\n off = 0;\n }\n }\n const isLast = pos + take === totalLen;\n let blocks = Math.ceil(take / blockLen) | 0;\n const left = (blocks * blockLen - take) | 0;\n let padBlocks = 0;\n if (isLast) {\n padBlocks = padding(0, take, maxBlocks, left, blockLen, suffix) | 0;\n blocks = (blocks + padBlocks) | 0;\n }\n processBlocks(0, 1, blocks, maxBlocks, blockLen, isLast ? 1 : 0, left, padBlocks);\n pos += take;\n }\n return;\n }\n // same as processMessage but with chunkPos.\n function processMessageParallel(msg, chunkPos, chunkLen, blocks, maxBlocks, prefix) {\n const chunks = maxBlocks - 2;\n if (chunks < 1)\n throw new Error('wrong chunks');\n const prefixLen = prefix ? prefix.buf.length : 0;\n const msgLen = msg[chunkPos].length;\n const totalLen = prefixLen + msgLen;\n const copyLane = (dst, lane, pos, take) => {\n let written = 0;\n if (prefix && pos < prefixLen) {\n const n = Math.min(take, prefixLen - pos);\n copyFast(BUFFER, dst, prefix.buf, pos, n);\n written += n;\n }\n if (written < take)\n copyFast(BUFFER, dst + written, lane, pos + written - prefixLen, take - written);\n };\n // Caller validates per-group size equality before touching module state.\n if (blocks > 0) {\n if (totalLen === 0) {\n // No more message input: do a normal finalization over an empty tail.\n // Keep 'left' consistent with the wrapper contract for take=0: left=0.\n const padBlocks = padding(0, blocks * blockLen, maxBlocks, 0, blockLen, suffix);\n for (let j = 0; j < chunkLen; j++) {\n const pb2 = padding(j, blocks * blockLen, maxBlocks, 0, blockLen, suffix);\n if (pb2 !== padBlocks)\n throw new Error('different padding across batch');\n }\n processBlocks(0, chunkLen, blocks + padBlocks, maxBlocks, blockLen, 1, 0, padBlocks);\n return;\n }\n processBlocks(0, chunkLen, blocks, maxBlocks, blockLen, 0, 0, 0);\n }\n let pos = 0;\n do {\n const take = Math.min(totalLen - pos, chunks * blockLen);\n for (let i = 0; i < chunkLen; i++) {\n copyLane(i * maxBlocks * blockLen, msg[chunkPos + i], pos, take);\n }\n const isLast = pos + take == totalLen;\n // How many full/partial blocks do we have here? Can be zero.\n let blocks = Math.ceil(take / blockLen);\n // How much space remains? blockLen-rem, except rem=0.\n const left = blocks * blockLen - take;\n let padBlocks = 0;\n if (isLast) {\n // suffix for sha3 and length for blake1, nothing for others\n padBlocks = padding(0, take, maxBlocks, left, blockLen, suffix);\n for (let j = 1; j < chunkLen; j++) {\n const pb2 = padding(j, take, maxBlocks, left, blockLen, suffix);\n if (pb2 !== padBlocks)\n throw new Error('parallel batch: different padding');\n }\n blocks += padBlocks;\n }\n processBlocks(0, chunkLen, blocks, maxBlocks, blockLen, isLast ? 1 : 0, left, padBlocks);\n pos += take;\n } while (pos < totalLen); // no extra final take=0 pass\n return;\n }\n function checkOutputOpts(o = {}, bytes, defaultLen = outputLen) {\n const raw = o;\n if (raw.dkLen !== undefined)\n anumber(raw.dkLen, 'opts.dkLen');\n if (raw.outPos !== undefined)\n anumber(raw.outPos, 'opts.outPos');\n if (raw.out !== undefined)\n abytes(raw.out, undefined, 'output');\n if (bytes !== undefined)\n anumber(bytes, 'xof.bytes');\n let dkLen = bytes !== undefined ? bytes : (raw.dkLen === undefined ? defaultLen : raw.dkLen) | 0;\n // Old awasm hash output opts intentionally allow requesting a shorter fixed digest, but\n // must reject oversize lengths instead of silently clamping or zero-extending the tail.\n if (!canXOF && dkLen > outputLen)\n throw new RangeError(`\"opts.dkLen\" expected <= ${outputLen}, got ${dkLen}`);\n const out = raw.out || new Uint8Array(dkLen);\n const outPos = (raw.outPos === undefined ? 0 : raw.outPos) | 0;\n if (outPos < 0 || outPos + dkLen > out.length)\n throw new RangeError('out/outPos too small');\n return { dkLen, out: out, outPos };\n }\n function processOutput(o = {}, checked = checkOutputOpts(o)) {\n const { dkLen, out, outPos } = checked;\n const batch = chunks | 0;\n const blocksTotal = ((dkLen + outBlockLen - 1) / outBlockLen) | 0; // ceil div\n let produced = 0, blocksLeft = blocksTotal;\n let maxWritten = 0;\n while (blocksLeft > 0) {\n const takeBlocks = blocksLeft > batch ? batch : blocksLeft;\n const isLast = blocksLeft === takeBlocks ? 1 : 0;\n processOutBlocks(0, 1, takeBlocks, maxOutBlocks, outBlockLen, isLast);\n const emitted = takeBlocks * outBlockLen;\n const need = dkLen - produced;\n const takeBytes = need < emitted ? need : emitted;\n copyFast(out, outPos + produced, BUFFER, 0, takeBytes);\n maxWritten = Math.max(maxWritten, takeBytes, takeBlocks * outBlockLen);\n produced += takeBytes;\n blocksLeft -= takeBlocks;\n }\n // NOTE: it would be nice to return slices subarray here, but it is not free!\n return { maxWritten, out };\n }\n function processOutputParallel(chunkLen, maxOutBlocks, checked, outOffset) {\n const chunks = maxOutBlocks;\n const { dkLen, out } = checked;\n let maxWritten = 0;\n const batch = chunks | 0;\n const blocksTotal = ((dkLen + outBlockLen - 1) / outBlockLen) | 0; // ceil div\n let produced = 0, blocksLeft = blocksTotal;\n while (blocksLeft > 0) {\n const takeBlocks = blocksLeft > batch ? batch : blocksLeft;\n const isLast = blocksLeft === takeBlocks ? 1 : 0;\n processOutBlocks(0, chunkLen, takeBlocks, maxOutBlocks, outBlockLen, isLast);\n const emitted = takeBlocks * outBlockLen;\n const need = dkLen - produced;\n const takeBytes = need < emitted ? need : emitted;\n for (let i = 0; i < chunkLen; i++) {\n copyFast(out[outOffset + i], produced, BUFFER, i * outBlockLen * maxOutBlocks, takeBytes);\n // Some modules (e.g. blake3) may write full output blocks even when only part is copied out.\n // Track emitted block span for reset() so unread bytes are also zeroized.\n maxWritten = Math.max(maxWritten, takeBytes, emitted);\n }\n produced += takeBytes;\n blocksLeft -= takeBlocks;\n }\n // NOTE: it would be nice to return slices subarray here, but it is not free!\n return { out, maxWritten };\n }\n const stateBytes = (state) => {\n if (!isBytes(state))\n throw new Error('prefixState is not from this hash');\n if (state.length < STATE.length)\n throw new Error('prefixState is too short');\n // Byte-state backends serialize only `state || partialBlock`; a full block must be flushed.\n if (state.length >= STATE.length + blockLen)\n throw new Error('prefixState is too long');\n if (!prefixStates.has(state))\n throw new Error('prefixState is not from this hash');\n return state;\n };\n const prefixState = (opts = {}) => {\n const raw = opts;\n if (raw.prefixState === undefined)\n return;\n const state = stateBytes(raw.prefixState);\n return { state: state.subarray(0, STATE.length), buf: state.subarray(STATE.length) };\n };\n class StreamHash {\n canXOF;\n blockLen;\n outputLen;\n buf;\n pos;\n state;\n finished;\n destroyed;\n constructor(opts) {\n if (opts.streamBufLen % blockLen || opts.streamBufLen < blockLen)\n throw new Error('wrong streamBufLen');\n this.finished = false;\n this.destroyed = false;\n // this.reserve = blockLen; // TODO: change when sha2\n this.buf = new Uint8Array(opts.streamBufLen);\n this.pos = 0;\n if (opts.blocks !== undefined) {\n if (opts.blocks * blockLen > this.buf.length)\n throw new Error('too much blocks');\n copyFast(this.buf, 0, BUFFER, 0, opts.blocks * blockLen);\n this.pos = opts.blocks * blockLen;\n }\n this.canXOF = !!canXOF;\n this.blockLen = blockLen;\n this.outputLen = opts.outputLen;\n this.state = copyBytes(STATE);\n reset(0, 1, 0, outBlockLen, maxOutBlocks); // cleanup\n }\n restoreState() {\n copyFast(STATE, 0, this.state, 0, STATE.length);\n }\n saveState() {\n this.state = copyBytes(STATE);\n }\n update(msg) {\n abytes(msg);\n if (this.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (this.finished)\n throw new Error('Hash#digest() has already been called');\n let msgPos = 0;\n let blocks = Math.ceil((this.pos + msg.length) / blockLen) - 1; // never process last block here!\n if (blocks > 0) {\n this.restoreState();\n let takeBlocks = Math.min(chunks, blocks);\n // first can be unaligned!\n const msgFirstLen = takeBlocks * blockLen - this.pos;\n copyFast(BUFFER, 0, this.buf, 0, this.pos);\n copyFast(BUFFER, this.pos, msg, msgPos, msgFirstLen);\n this.pos = 0;\n msgPos += msgFirstLen;\n processBlocks(0, 1, takeBlocks, maxBlocks, blockLen, 0, 0, 0);\n blocks -= takeBlocks;\n for (; msgPos < msg.length && blocks;) {\n const takeBlocks = Math.min(chunks, blocks);\n copyFast(BUFFER, 0, msg, msgPos, takeBlocks * blockLen);\n processBlocks(0, 1, takeBlocks, maxBlocks, blockLen, 0, 0, 0);\n blocks -= takeBlocks;\n msgPos += takeBlocks * blockLen;\n }\n this.saveState();\n reset(0, 1, 0, outBlockLen, maxOutBlocks);\n }\n // save leftovers\n const leftover = msg.length - msgPos;\n if (leftover) {\n copyFast(this.buf, this.pos, msg, msgPos, leftover);\n this.pos += leftover;\n }\n return this;\n }\n finish() {\n if (this.finished)\n throw new Error('Hash#digest() has already been called');\n this.restoreState();\n this.finished = true;\n const isLast = true;\n let take = this.pos;\n let blocks = Math.ceil(take / blockLen);\n copyFast(BUFFER, 0, this.buf, 0, this.pos);\n const left = blocks * blockLen - take; // how much space we have. blockLen-rem except when rem=0\n let padBlocks = 0;\n if (isLast) {\n padBlocks = padding(0, take, maxBlocks, left, blockLen, suffix); // suffix for sha3 and length for blake1, nothing for others\n blocks += padBlocks;\n }\n processBlocks(0, 1, blocks, maxBlocks, blockLen, 1, left, padBlocks);\n this.pos = outBlockLen;\n return blocks * blockLen;\n }\n digest(opts = {}) {\n if (this.destroyed)\n throw new Error('Hash instance has been destroyed');\n const outChecked = checkOutputOpts(opts, undefined, this.outputLen);\n this.finish();\n const { out: res, maxWritten } = processOutput(opts, outChecked);\n this.destroy();\n reset(0, 1, maxWritten, outBlockLen, maxOutBlocks);\n return res;\n }\n /**\n * Resets internal state. Makes Hash instance unusable.\n * Reset is impossible for keyed hashes if key is consumed into state. If digest is not consumed\n * by user, they will need to manually call `destroy()` when zeroing is necessary.\n */\n destroy() {\n this.destroyed = true;\n this.state.fill(0);\n this.buf.fill(0);\n }\n xof(bytes, opts = {}) {\n if (!canXOF)\n throw new Error('XOF is not possible for this instance');\n if (this.destroyed)\n throw new Error('Hash instance has been destroyed');\n const outChecked = checkOutputOpts(opts, bytes);\n if (!this.finished) {\n this.finish();\n this.saveState();\n }\n // XOF mutates module state via processOutBlocks(). Snapshot/restore around calls so\n // stream instances don't leak squeeze state into global hash wrappers.\n this.restoreState();\n const { out, outPos } = outChecked;\n for (let pos = 0; pos < bytes;) {\n if (this.pos >= outBlockLen) {\n // get next squeeze block\n processOutBlocks(0, 1, 1, maxOutBlocks, outBlockLen, 0); // never 'last' in XOF\n copyFast(this.buf, 0, BUFFER, 0, outBlockLen);\n this.pos = 0;\n }\n const take = (outBlockLen - this.pos < bytes - pos ? outBlockLen - this.pos : bytes - pos) | 0;\n copyFast(out, (outPos + pos) | 0, this.buf, this.pos, take);\n this.pos = (this.pos + take) | 0;\n pos = (pos + take) | 0;\n }\n this.saveState();\n reset(0, 1, 0, outBlockLen, maxOutBlocks);\n return out;\n }\n // old api\n digestInto(buf) {\n // digestInto is the fixed-size surface even for XOF hashes, but callers may provide a\n // larger workspace buffer and expect the tail to stay untouched.\n abytes(buf, undefined, 'output');\n if (buf.length < this.outputLen)\n // Keep short digest destinations aligned with the shared noble-hashes contract:\n // wrong output type -> TypeError, too-short output -> RangeError.\n throw new RangeError('digestInto() expects output buffer of length at least ' + this.outputLen);\n this.digest({ out: buf.subarray(0, this.outputLen), dkLen: this.outputLen });\n }\n xofInto(buf) {\n return this.xof(buf.length, { out: buf });\n }\n /**\n * Clones hash instance. Unsafe: doesn't check whether `to` is valid. Can be used as `clone()`\n * when no options are passed.\n * Reasons to use `_cloneInto` instead of clone: 1) performance 2) reuse instance => all internal\n * buffers are overwritten => causes buffer overwrite which is used for digest in some cases.\n * There are no guarantees for clean-up because it's impossible in JS.\n */\n _cloneInto(to) {\n if (this.destroyed)\n throw new Error('Hash instance has been destroyed');\n // Allocate target if needed (ensure same stream buffer capacity).\n const dst = to || new this.constructor({ streamBufLen: this.buf.length });\n if (!(dst instanceof StreamHash))\n throw new Error('wrong instance');\n if (dst.buf.length !== this.buf.length)\n throw new Error('wrong buffer length');\n // Clones must preserve the public stream metadata too. digest()/digestInto() allocate and\n // validate against outputLen, xof()/xofInto() gate on canXOF, and callers may read blockLen.\n dst.blockLen = this.blockLen;\n dst.outputLen = this.outputLen;\n dst.canXOF = this.canXOF;\n // Copy tail / XOF cache content up to bufPos.\n if (this.pos)\n copyFast(dst.buf, 0, this.buf, 0, this.pos);\n dst.pos = this.pos | 0;\n // Snapshot of full engine state used by restoreState().\n dst.state = copyBytes(this.state);\n // Flags\n dst.finished = !!this.finished;\n dst.destroyed = !!this.destroyed;\n return dst;\n }\n // Safe version that clones internal state\n clone() {\n return this._cloneInto();\n }\n exportState() {\n if (this.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (this.finished)\n throw new Error('Hash#digest() has already been called');\n // update() keeps one full tail block unprocessed for finalization; export must absorb it\n // so a full-block prefix is represented only by the engine state plus a short leftover.\n if (this.pos === blockLen) {\n this.restoreState();\n copyFast(BUFFER, 0, this.buf, 0, blockLen);\n processBlocks(0, 1, 1, maxBlocks, blockLen, 0, 0, 0);\n this.saveState();\n this.pos = 0;\n this.buf.fill(0);\n reset(0, 1, 0, outBlockLen, maxOutBlocks);\n }\n // Returned bytes are exactly `state || partialBlock`, with no outputLen, pos, or header.\n const out = new Uint8Array(this.state.length + this.pos);\n out.set(this.state);\n if (this.pos)\n out.set(this.buf.subarray(0, this.pos), this.state.length);\n prefixStates.add(out);\n return out;\n }\n }\n const hashSync = (msg, opts = {}) => {\n abytes(msg);\n const outChecked = checkOutputOpts(opts);\n const { blocks } = initHash(opts);\n processMessage(msg, blocks);\n const { out: res, maxWritten } = processOutput(opts, outChecked);\n reset(0, 1, maxWritten, outBlockLen, maxOutBlocks);\n return res;\n };\n const chunksSync = (parts, opts = {}) => {\n if (!Array.isArray(parts))\n throw new Error('expected array of messages');\n let total = 0;\n for (const p of parts) {\n abytes(p);\n total += p.length;\n }\n const prefix = prefixState(opts);\n if (prefix && total === 0)\n throw new Error('prefixState requires a non-empty message');\n const outChecked = checkOutputOpts(opts);\n if (prefix) {\n reset(0, 1, 0, outBlockLen, maxOutBlocks);\n copyFast(STATE, 0, prefix.state, 0, prefix.state.length);\n processMessages(parts, 0, prefix);\n }\n else {\n const { blocks } = initHash(opts);\n processMessages(parts, blocks);\n }\n const { out: res, maxWritten } = processOutput(opts, outChecked);\n reset(0, 1, maxWritten, outBlockLen, maxOutBlocks);\n return res;\n };\n const parallelSync = (chunks, opts = {}) => {\n if (!Array.isArray(chunks))\n throw new Error('expected array of messages');\n const prefix = prefixState(opts);\n if (prefix && chunks.length === 0)\n throw new Error('prefixState requires a non-empty message');\n // At least 3 blocks (for padding).\n const maxGroups = Math.floor(BUFFER.length / (blockLen * 3));\n const maxOutGroups = Math.floor(BUFFER.length / outBlockLen);\n // Validate user input first. Wrong input must throw before touching module state/memory.\n for (let i = 0; i < chunks.length; i += parallelChunks) {\n const groupLen = Math.min(parallelChunks, chunks.length - i, maxGroups, maxOutGroups);\n for (let j = 0; j < groupLen; j++)\n if (!isBytes(chunks[i + j]))\n throw new Error(`expected Uint8Array, got type=${typeof chunks[i + j]}`);\n if (prefix && chunks[i].length === 0)\n throw new Error('prefixState requires a non-empty message');\n for (let j = 1; j < groupLen; j++) {\n if (chunks[i + j].length !== chunks[i].length)\n throw new Error('different sizes inside chunk');\n }\n }\n const outChecked = checkParallelOutput(opts, chunks.length, outputLen, canXOF);\n for (let i = 0; i < chunks.length; i += parallelChunks) {\n const groupLen = Math.min(parallelChunks, chunks.length - i, maxGroups, maxOutGroups);\n const maxBlocks = Math.floor(BUFFER.length / (blockLen * groupLen));\n const maxOutBlocks = Math.floor(BUFFER.length / (outBlockLen * groupLen));\n let blocks = 0;\n if (prefix) {\n reset(0, groupLen, 0, outBlockLen, maxOutBlocks);\n for (let j = 0; j < groupLen; j++)\n copyFast(STATE_CHUNKS[j], 0, prefix.state, 0, prefix.state.length);\n }\n else if (init) {\n const i = init(0, maxBlocks, mod, hash, opts);\n if (i && i.blocks !== undefined)\n blocks = i.blocks;\n for (let j = 0; j < groupLen; j++) {\n const t = init(j, maxBlocks, mod, hash, opts);\n if ((t && t.blocks) !== (i && i.blocks))\n throw new Error('inconsistent init blocks inside parallel group');\n }\n }\n processMessageParallel(chunks, i, groupLen, blocks, maxBlocks, prefix);\n const { maxWritten } = processOutputParallel(groupLen, maxOutBlocks, outChecked, i);\n reset(0, groupLen, maxWritten, outBlockLen, maxOutBlocks);\n }\n return outChecked.out;\n };\n const setupTick = (setup, total, opts) => {\n const rawSetup = setup;\n const rawOpts = opts;\n return !rawSetup.isAsync\n ? !rawOpts?.onProgress\n ? (rawSetup({ total: 0 }), (_inc) => false)\n : rawSetup({ total, onProgress: rawOpts.onProgress })\n : rawSetup({\n total,\n asyncTick: rawOpts?.asyncTick,\n onProgress: rawOpts?.onProgress,\n nextTick: rawOpts?.nextTick,\n });\n };\n const hashRun = mkAsync(function* (setup, msg, opts = {}) {\n const setupMode = setup;\n if (!setupMode.isAsync && !opts?.onProgress)\n return hashSync(msg, opts);\n const tick = setupTick(setupMode, msg.length, opts);\n const out = hashSync(msg, opts);\n if ((setupMode.isAsync || !!opts?.onProgress) && tick(msg.length))\n yield;\n return out;\n });\n const chunksRun = mkAsync(function* (setup, parts, opts = {}) {\n const setupMode = setup;\n if (!setupMode.isAsync && !opts?.onProgress)\n return chunksSync(parts, opts);\n let total = 0;\n for (const p of parts)\n total += p.length;\n const tick = setupTick(setupMode, total, opts);\n const out = chunksSync(parts, opts);\n if ((setupMode.isAsync || !!opts?.onProgress) && tick(total))\n yield;\n return out;\n });\n const parallelRun = mkAsync(function* (setup, parts, opts = {}) {\n const setupMode = setup;\n if (!setupMode.isAsync && !opts?.onProgress)\n return parallelSync(parts, opts);\n let total = 0;\n for (const p of parts)\n total += p.length;\n const tick = setupTick(setupMode, total, opts);\n const out = parallelSync(parts, opts);\n if ((setupMode.isAsync || !!opts?.onProgress) && tick(total))\n yield;\n return out;\n });\n hashImpl = (msg, opts = {}) => hashSync(msg, opts);\n hashAsyncImpl = async (msg, opts) => {\n const rawOpts = opts;\n if (!rawOpts)\n return hashSync(msg, {});\n return rawOpts.asyncTick !== undefined ||\n rawOpts.onProgress !== undefined ||\n rawOpts.nextTick !== undefined\n ? hashRun.async(msg, rawOpts)\n : hashSync(msg, rawOpts);\n };\n chunksImpl = (parts, opts = {}) => chunksSync(parts, opts);\n chunksAsyncImpl = async (parts, opts) => {\n const rawOpts = opts;\n if (!rawOpts)\n return chunksSync(parts, {});\n return rawOpts.asyncTick !== undefined ||\n rawOpts.onProgress !== undefined ||\n rawOpts.nextTick !== undefined\n ? chunksRun.async(parts, rawOpts)\n : chunksSync(parts, rawOpts);\n };\n parallelImpl = (parts, opts = {}) => parallelSync(parts, opts);\n parallelAsyncImpl = async (parts, opts) => {\n const rawOpts = opts;\n if (!rawOpts)\n return parallelSync(parts, {});\n return rawOpts.asyncTick !== undefined ||\n rawOpts.onProgress !== undefined ||\n rawOpts.nextTick !== undefined\n ? parallelRun.async(parts, rawOpts)\n : parallelSync(parts, rawOpts);\n };\n createImpl = (opts = {}) => {\n const rawOpts = opts;\n reset(0, 1, 0, outBlockLen, maxOutBlocks);\n const { blocks, outputLen } = initHash(rawOpts);\n return new StreamHash({ ...rawOpts, streamBufLen: blockLen, blocks, outputLen });\n };\n cleanStateImpl = (state) => {\n const bytes = stateBytes(state);\n clean(bytes);\n prefixStates.delete(bytes);\n };\n }\n // Trampoline: init only on first usage\n hashImpl = (msg, opts) => {\n lazyInit();\n return hashImpl(msg, opts);\n };\n hashAsyncImpl = (msg, opts) => {\n lazyInit();\n return hashAsyncImpl(msg, opts);\n };\n chunksImpl = (parts, opts) => {\n lazyInit();\n return chunksImpl(parts, opts);\n };\n chunksAsyncImpl = (parts, opts) => {\n lazyInit();\n return chunksAsyncImpl(parts, opts);\n };\n parallelImpl = (chunks, opts) => {\n lazyInit();\n return parallelImpl(chunks, opts);\n };\n parallelAsyncImpl = (chunks, opts) => {\n lazyInit();\n return parallelAsyncImpl(chunks, opts);\n };\n createImpl = (opts) => {\n lazyInit();\n return createImpl(opts);\n };\n cleanStateImpl = (state) => {\n lazyInit();\n return cleanStateImpl(state);\n };\n const hash = ((msg, opts = {}) => hashImpl(msg, opts));\n const chunksFn = (parts, opts = {}) => chunksImpl(parts, opts);\n Object.assign(chunksFn, {\n async: (parts, opts) => chunksAsyncImpl(parts, opts),\n });\n const parallel = (chunks, opts = {}) => parallelImpl(chunks, opts);\n Object.assign(parallel, {\n async: (chunks, opts) => parallelAsyncImpl(chunks, opts),\n });\n Object.assign(hash, {\n async: (msg, opts) => hashAsyncImpl(msg, opts),\n chunks: chunksFn,\n parallel,\n create: (opts = {}) => createImpl(opts),\n cleanState: (state) => cleanStateImpl(state),\n getPlatform: () => platform,\n getDefinition: () => def,\n canXOF: !!canXOF,\n outputLen,\n blockLen,\n oid,\n });\n Object.defineProperty(hash, BRAND, { value: true, enumerable: false });\n brandSet.add(hash);\n return Object.freeze(hash);\n}\nexport function mkHashNoble(def_, impl_, platform = 'noble') {\n const def = def_;\n const impl = impl_;\n const { outputLen, blockLen, canXOF, oid } = def;\n const rawOutputOpts = (opts) => (isBytes(opts) ? {} : opts || {});\n const hasOutputOpts = (opts) => {\n const raw = rawOutputOpts(opts);\n return raw.dkLen !== undefined || raw.out !== undefined || raw.outPos !== undefined;\n };\n const prefixStates = new WeakSet();\n const stateStream = (state) => {\n if ((typeof state !== 'object' && typeof state !== 'function') || state === null)\n throw new Error('prefixState is not from this hash');\n const stream = state;\n if (!prefixStates.has(stream))\n throw new Error('prefixState is not from this hash');\n return stream;\n };\n const prefixState = (opts) => {\n const raw = rawOutputOpts(opts);\n if (raw.prefixState === undefined)\n return;\n return stateStream(raw.prefixState);\n };\n const checkOutput = (opts, bytes, defaultLen = outputLen) => {\n const raw = rawOutputOpts(opts);\n if (raw.dkLen !== undefined)\n anumber(raw.dkLen, 'opts.dkLen');\n if (raw.outPos !== undefined)\n anumber(raw.outPos, 'opts.outPos');\n if (raw.out !== undefined)\n abytes(raw.out, undefined, 'output');\n if (bytes !== undefined)\n anumber(bytes, 'xof.bytes');\n const dkLen = (bytes !== undefined ? bytes : raw.dkLen === undefined ? defaultLen : raw.dkLen) | 0;\n if (!canXOF && dkLen > outputLen)\n throw new RangeError(`\"opts.dkLen\" expected <= ${outputLen}, got ${dkLen}`);\n const hasOut = raw.out !== undefined;\n const out = raw.out || new Uint8Array(dkLen);\n const outPos = (raw.outPos === undefined ? 0 : raw.outPos) | 0;\n if (outPos < 0 || outPos + dkLen > out.length)\n throw new RangeError('out/outPos too small');\n return { dkLen, out: out, outPos, hasOut };\n };\n const writeInto = (inner, out, dkLen, tmp) => {\n const rawInner = inner;\n const rawOut = out;\n let rawTmp = tmp;\n if (canXOF) {\n rawInner.xofInto(rawOut.subarray(0, dkLen));\n return rawTmp;\n }\n // noble BLAKE2 streams require aligned digestInto() views, but awasm outPos is byte-granular.\n if (dkLen === outputLen && (rawOut.byteOffset & 3) === 0)\n rawInner.digestInto(rawOut);\n else {\n if (!rawTmp || rawTmp.length < outputLen)\n rawTmp = new Uint8Array(outputLen);\n rawInner.digestInto(rawTmp);\n if (dkLen)\n copyFast(rawOut, 0, rawTmp, 0, dkLen);\n }\n return rawTmp;\n };\n class Stream {\n canXOF = !!canXOF;\n blockLen = blockLen;\n outputLen;\n inner;\n constructor(inner, outputLen) {\n this.inner = inner;\n this.outputLen = outputLen;\n }\n update(msg) {\n abytes(msg);\n this.inner.update(msg);\n return this;\n }\n digest(opts) {\n if (!hasOutputOpts(opts) && !canXOF && this.outputLen === outputLen)\n return this.inner.digest();\n const checked = checkOutput(opts, undefined, this.outputLen);\n const tmp = writeInto(this.inner, checked.out.subarray(checked.outPos, checked.outPos + checked.dkLen), checked.dkLen);\n if (tmp)\n clean(tmp);\n return checked.out;\n }\n destroy() {\n this.inner.destroy();\n }\n xof(bytes, opts) {\n if (!canXOF)\n throw new Error('XOF is not possible for this instance');\n if (!hasOutputOpts(opts)) {\n anumber(bytes, 'xof.bytes');\n if (this.inner.xof)\n return this.inner.xof(bytes);\n const out = new Uint8Array(bytes);\n this.inner.xofInto(out);\n return out;\n }\n const checked = checkOutput(opts, bytes);\n this.inner.xofInto(checked.out.subarray(checked.outPos, checked.outPos + checked.dkLen));\n return checked.out;\n }\n digestInto(buf) {\n abytes(buf, undefined, 'output');\n if (buf.length < this.outputLen)\n throw new RangeError('digestInto() expects output buffer of length at least ' + this.outputLen);\n const tmp = writeInto(this.inner, buf.subarray(0, this.outputLen), this.outputLen);\n if (tmp)\n clean(tmp);\n }\n xofInto(buf) {\n abytes(buf, undefined, 'output');\n if (!canXOF)\n throw new Error('XOF is not possible for this instance');\n this.inner.xofInto(buf);\n return buf;\n }\n _cloneInto(to) {\n if (to !== undefined && !(to instanceof Stream))\n throw new Error('wrong instance');\n const inner = this.inner._cloneInto(to?.inner);\n if (to) {\n to.inner = inner;\n to.outputLen = this.outputLen;\n return to;\n }\n return new Stream(inner, this.outputLen);\n }\n clone() {\n return this._cloneInto();\n }\n exportState() {\n // Native noble streams may carry structured state, e.g. BLAKE3. The clone itself is the state.\n const state = this.inner._cloneInto();\n prefixStates.add(state);\n return state;\n }\n }\n const createSync = (opts = {}) => {\n if (!impl.create)\n throw new Error('streaming is not supported');\n const inner = impl.create(opts);\n const raw = rawOutputOpts(opts);\n if (raw.dkLen !== undefined)\n anumber(raw.dkLen, 'opts.dkLen');\n const fallback = inner.outputLen || outputLen;\n const len = raw.dkLen === undefined ? fallback : raw.dkLen;\n if (!canXOF && len > outputLen)\n throw new RangeError(`\"opts.dkLen\" expected <= ${outputLen}, got ${len}`);\n return new Stream(inner, len);\n };\n const hashSync = (msg, opts = {}) => {\n abytes(msg);\n const raw = rawOutputOpts(opts);\n if (raw.out === undefined &&\n raw.outPos === undefined &&\n (raw.dkLen === undefined || (canXOF && raw.dkLen !== undefined)))\n return impl.hash(msg, opts);\n const checked = checkOutput(opts);\n const res = impl.hash(msg, opts);\n const { dkLen, out, outPos, hasOut } = checked;\n if (res.length < dkLen)\n throw new RangeError('output is too small');\n if (!hasOut && res.length === dkLen)\n return res;\n if (dkLen)\n copyFast(out, outPos, res, 0, dkLen);\n if (out !== res)\n clean(res);\n return out;\n };\n const chunksSync = (parts, opts = {}) => {\n if (!Array.isArray(parts))\n throw new Error('expected array of messages');\n let total = 0;\n for (const p of parts) {\n abytes(p);\n total += p.length;\n }\n const prefix = prefixState(opts);\n if (prefix && total === 0)\n throw new Error('prefixState requires a non-empty message');\n if (prefix) {\n const h = new Stream(prefix._cloneInto(), outputLen);\n for (const p of parts)\n h.update(p);\n return h.digest(rawOutputOpts(opts));\n }\n if (impl.create) {\n const h = createSync(opts);\n for (const p of parts)\n h.update(p);\n return h.digest(rawOutputOpts(opts));\n }\n const joined = concatBytes(...parts);\n try {\n return hashSync(joined, opts);\n }\n finally {\n clean(joined);\n }\n };\n const parallelSync = (parts, opts = {}) => {\n if (!Array.isArray(parts))\n throw new Error('expected array of messages');\n for (const p of parts)\n abytes(p);\n const prefix = prefixState(opts);\n if (prefix && parts.length === 0)\n throw new Error('prefixState requires a non-empty message');\n if (prefix)\n for (const p of parts)\n if (p.length === 0)\n throw new Error('prefixState requires a non-empty message');\n const checked = checkParallelOutput(opts, parts.length, outputLen, canXOF);\n let tmp;\n const base = prefix || (impl.create ? impl.create(opts) : undefined);\n let work;\n for (let i = 0; i < parts.length; i++) {\n const lane = checked.out[i];\n if (base) {\n work = base._cloneInto(work);\n work.update(parts[i]);\n tmp = writeInto(work, lane, checked.dkLen, tmp);\n }\n else {\n const outOpts = (isBytes(opts)\n ? { key: opts, out: lane, outPos: 0, dkLen: checked.dkLen }\n : { ...(opts || {}), out: lane, outPos: 0, dkLen: checked.dkLen });\n hashSync(parts[i], outOpts);\n }\n }\n if (tmp)\n clean(tmp);\n if (work)\n work.destroy();\n if (base && base !== prefix)\n base.destroy();\n return checked.out;\n };\n const setupTick = (setup, total, opts) => {\n const rawSetup = setup;\n const rawOpts = opts;\n return !rawSetup.isAsync\n ? !rawOpts?.onProgress\n ? (rawSetup({ total: 0 }), (_inc) => false)\n : rawSetup({ total, onProgress: rawOpts.onProgress })\n : rawSetup({\n total,\n asyncTick: rawOpts?.asyncTick,\n onProgress: rawOpts?.onProgress,\n nextTick: rawOpts?.nextTick,\n });\n };\n const hash = ((msg, opts = {}) => hashSync(msg, opts));\n const chunks = (parts, opts = {}) => chunksSync(parts, opts);\n Object.assign(chunks, {\n async: mkAsync(function* (setup, parts, opts = {}) {\n const setupMode = setup;\n const rawOpts = opts;\n if (!setupMode.isAsync && !rawOpts?.onProgress)\n return chunksSync(parts, rawOpts);\n let total = 0;\n for (const p of parts)\n total += p.length;\n const tick = setupTick(setupMode, total, rawOpts);\n const out = chunksSync(parts, rawOpts);\n if ((setupMode.isAsync || !!rawOpts?.onProgress) && tick(total))\n yield;\n return out;\n }).async,\n });\n const parallel = (parts, opts = {}) => parallelSync(parts, opts);\n Object.assign(parallel, {\n async: mkAsync(function* (setup, parts, opts = {}) {\n const setupMode = setup;\n const rawOpts = opts;\n if (!setupMode.isAsync && !rawOpts?.onProgress)\n return parallelSync(parts, rawOpts);\n let total = 0;\n for (const p of parts)\n total += p.length;\n const tick = setupTick(setupMode, total, rawOpts);\n const out = parallelSync(parts, rawOpts);\n if ((setupMode.isAsync || !!rawOpts?.onProgress) && tick(total))\n yield;\n return out;\n }).async,\n });\n Object.assign(hash, {\n async: mkAsync(function* (setup, msg, opts = {}) {\n const setupMode = setup;\n // TArg expands byte-like option unions here; keep the cast local to the async shim.\n const rawOpts = opts;\n if (!setupMode.isAsync && !rawOpts?.onProgress)\n return hashSync(msg, rawOpts);\n const tick = setupTick(setupMode, msg.length, rawOpts);\n const out = hashSync(msg, rawOpts);\n if ((setupMode.isAsync || !!rawOpts?.onProgress) && tick(msg.length))\n yield;\n return out;\n }).async,\n chunks,\n parallel,\n create: (opts = {}) => createSync(opts),\n cleanState(state) {\n const stream = stateStream(state);\n stream.destroy();\n prefixStates.delete(stream);\n },\n getPlatform: () => platform,\n getDefinition: () => def,\n canXOF: !!canXOF,\n outputLen,\n blockLen,\n oid,\n });\n Object.defineProperty(hash, BRAND, { value: true, enumerable: false });\n brandSet.add(hash);\n return Object.freeze(hash);\n}\nconst copyOutput = (out, opts, outputLen, canXOF) => {\n const rawLen = opts?.dkLen;\n if (rawLen !== undefined)\n anumber(rawLen, 'dkLen');\n const dkLen = rawLen === undefined ? outputLen : rawLen;\n anumber(dkLen, 'dkLen');\n // Old awasm hash output opts intentionally allow requesting a shorter fixed digest, but\n // must reject oversize lengths instead of silently clamping or zero-extending the tail.\n if (!canXOF && dkLen > outputLen)\n throw new RangeError(`\"dkLen\" expected <= ${outputLen}, got ${dkLen}`);\n if (out.length < dkLen)\n throw new RangeError(`expected output length >= dkLen, got ${out.length}`);\n const msg = out.subarray(0, dkLen);\n if (!opts?.out) {\n const res = copyBytes(msg);\n clean(out);\n return res;\n }\n const outPos = opts?.outPos || 0;\n anumber(outPos, 'outPos');\n if (opts.out.length < outPos + dkLen)\n throw new RangeError('output is too small');\n opts.out.set(msg, outPos);\n clean(out);\n return opts.out;\n};\nconst copyParallelOutput = (outs, views, dkLen, outputLen, canXOF) => {\n if (views.length !== outs.length)\n throw new RangeError('output array length must match messages length');\n for (let i = 0; i < outs.length; i++)\n copyOutput(outs[i], { out: views[i], dkLen }, outputLen, canXOF);\n return views;\n};\nconst hashSyncError = () => {\n throw new Error('sync is not supported');\n};\nexport function mkHashAsync(def_, impl_, platform = 'webcrypto', isSupported, meta) {\n const def = def_;\n const impl = impl_;\n const { outputLen, blockLen, canXOF, oid } = def;\n const hash = ((_msg) => hashSyncError());\n const hashAsync = async (msg, opts = {}) => {\n abytes(msg);\n const out = await impl.hash(msg, opts);\n return copyOutput(out, opts, outputLen, canXOF);\n };\n const chunks = ((_parts) => hashSyncError());\n const chunksAsync = async (parts, opts = {}) => {\n if (opts.prefixState !== undefined)\n throw new Error('prefixState is not supported');\n for (let i = 0; i < parts.length; i++)\n abytes(parts[i]);\n if (impl.chunks) {\n const out = await impl.chunks(parts, opts);\n return copyOutput(out, opts, outputLen, canXOF);\n }\n const joined = concatBytes(...parts);\n try {\n const out = await impl.hash(joined, opts);\n return copyOutput(out, opts, outputLen, canXOF);\n }\n finally {\n clean(joined);\n }\n };\n Object.assign(chunks, { async: chunksAsync });\n const parallel = ((_parts) => hashSyncError());\n const parallelAsync = async (parts, opts = {}) => {\n if (opts.prefixState !== undefined)\n throw new Error('prefixState is not supported');\n for (let i = 0; i < parts.length; i++)\n abytes(parts[i]);\n const checked = checkParallelOutput(opts, parts.length, outputLen, canXOF);\n const runOpts = { ...opts, out: undefined, outPos: undefined };\n const out = impl.parallel\n ? await impl.parallel(parts, runOpts)\n : await Promise.all(parts.map((i) => impl.hash(i, runOpts)));\n return copyParallelOutput(out, checked.out, checked.dkLen, outputLen, canXOF);\n };\n Object.assign(parallel, { async: parallelAsync });\n Object.assign(hash, {\n async: hashAsync,\n chunks,\n parallel,\n create: () => {\n throw new Error('streaming is not supported');\n },\n cleanState: () => {\n throw new Error('prefixState is not supported');\n },\n getPlatform: () => platform,\n getDefinition: () => def,\n canXOF: !!canXOF,\n outputLen,\n blockLen,\n oid,\n });\n if (meta)\n Object.assign(hash, meta);\n if (isSupported)\n hash.isSupported = isSupported;\n Object.defineProperty(hash, BRAND, { value: true, enumerable: false });\n brandSet.add(hash);\n return Object.freeze(hash);\n}\nexport function mkHashStub(def_) {\n const def = def_;\n const { outputLen, blockLen, canXOF, oid } = def;\n let inner;\n function checkInner(inner) {\n if (inner === undefined)\n throw new Error('implementation not installed');\n }\n const hash = ((msg, opts = {}) => {\n checkInner(inner);\n return inner(msg, opts);\n });\n const chunks = (parts, opts = {}) => {\n checkInner(inner);\n return inner.chunks(parts, opts);\n };\n Object.assign(chunks, {\n async: async (parts, opts = {}) => {\n checkInner(inner);\n return inner.chunks.async(parts, opts);\n },\n });\n const parallel = (chunks, opts = {}) => {\n checkInner(inner);\n return inner.parallel(chunks, opts);\n };\n Object.assign(parallel, {\n async(chunks, opts = {}) {\n checkInner(inner);\n return inner.parallel.async(chunks, opts);\n },\n });\n Object.assign(hash, {\n async: async (msg, opts = {}) => {\n checkInner(inner);\n return inner.async(msg, opts);\n },\n chunks,\n parallel,\n create(opts = {}) {\n checkInner(inner);\n return inner.create(opts);\n },\n cleanState(state) {\n checkInner(inner);\n return inner.cleanState(state);\n },\n getPlatform: () => {\n checkInner(inner);\n return inner.getPlatform();\n },\n getDefinition: () => {\n checkInner(inner);\n return inner.getDefinition();\n },\n install: (impl, opts = {}) => {\n const { onlyMissing } = opts;\n if (onlyMissing !== undefined)\n abool(onlyMissing);\n if (onlyMissing && inner !== undefined)\n return;\n // install() accepts only constructor-created hashes: WeakSet branding rejects copied fields,\n // and exact definition identity rejects same-shaped but different hash families.\n if (!isBranded(impl))\n throw new Error('install: non-branded implementation');\n // NOTE: this strict check works because all implementations will use exact same frozen definition\n // which means it is impossible to use same blockLen/outputLen hash from different definition\n if (impl.getDefinition() !== def)\n throw new Error('wrong implementation definition');\n inner = impl;\n },\n canXOF,\n outputLen,\n blockLen,\n oid,\n });\n return Object.freeze(hash);\n}\n", "/**\n * Constants for hashes and ciphers. Mostly initial state.\n * @module\n */\nimport { u8 } from \"./utils.js\";\n/**\n * Round constants:\n * First 32 bits of fractional parts of the cube roots of the first 64 primes 2..311)\n */\nexport const SHA256_K = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,\n];\n/** Initial SHA256 state. Bits 0..32 of frac part of sqrt of primes 2..19 */\nexport const SHA256_IV = /* @__PURE__ */ new Uint32Array([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\nexport const SHA256_IV_U8 = /* @__PURE__ */ u8(SHA256_IV);\n/** Initial SHA224 state. Bits 32..64 of frac part of sqrt of primes 23..53 */\nexport const SHA224_IV = /* @__PURE__ */ Uint32Array.from([\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,\n]);\nexport const SHA224_IV_U8 = /* @__PURE__ */ u8(SHA224_IV);\n// Round constants\n// RFC 6234 \u00A75.2:\n// first 64 bits of the fractional parts of the cube roots of the first 80 primes.\n// prettier-ignore\nexport const SHA512_K = /* @__PURE__ */ [\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817',\n].map((n) => BigInt(n));\n// 64-bit SHA-2 IV words are stored as [lo, hi] u32 pairs.\n// This lets u8(...) seed native module state directly.\n/** Initial SHA512 state. Bits 0..64 of frac part of sqrt of primes 2..19 */\nexport const SHA512_IV = /* @__PURE__ */ Uint32Array.from([\n 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372, 0x5f1d36f1, 0xa54ff53a,\n 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c, 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19,\n]);\nexport const SHA512_IV_U8 = /* @__PURE__ */ u8(SHA512_IV);\n/** Initial SHA384 state. Bits 0..64 of frac part of sqrt of primes 23..53 */\nexport const SHA384_IV = /* @__PURE__ */ Uint32Array.from([\n 0xc1059ed8, 0xcbbb9d5d, 0x367cd507, 0x629a292a, 0x3070dd17, 0x9159015a, 0xf70e5939, 0x152fecd8,\n 0xffc00b31, 0x67332667, 0x68581511, 0x8eb44a87, 0x64f98fa7, 0xdb0c2e0d, 0xbefa4fa4, 0x47b5481d,\n]);\nexport const SHA384_IV_U8 = /* @__PURE__ */ u8(SHA384_IV);\n/**\n * Truncated SHA512/256 and SHA512/224.\n * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as \"intermediary\" IV of SHA512/t.\n * Then t hashes string to produce result IV.\n */\n// Derived SHA-512/t IVs also use [lo, hi] u32 pairs here.\n// That lets hashes.ts seed the shared SHA-512 state layout directly.\n/** SHA512/224 IV */\nconst SHA512_224_IV = /* @__PURE__ */ Uint32Array.from([\n 0x19544da2, 0x8c3d37c8, 0x89dcd4d6, 0x73e19966, 0x32ff9c82, 0x1dfab7ae, 0x582f9fcf, 0x679dd514,\n 0x7bd44da8, 0x0f6d2b69, 0x04c48942, 0x77e36f73, 0x6a1d36c8, 0x3f9d85a8, 0x91d692a1, 0x1112e6ad,\n]);\nexport const SHA512_224_IV_U8 = /* @__PURE__ */ u8(SHA512_224_IV);\n/** SHA512/256 IV */\nconst SHA512_256_IV = /* @__PURE__ */ Uint32Array.from([\n 0xfc2bf72c, 0x22312194, 0xc84c64c2, 0x9f555fa3, 0x6f53b151, 0x2393b86b, 0x5940eabd, 0x96387719,\n 0xa88effe3, 0x96283ee2, 0x53863992, 0xbe5e1e25, 0x2c85b8aa, 0x2b0199fc, 0x81c52ca2, 0x0eb72ddc,\n]);\nexport const SHA512_256_IV_U8 = /* @__PURE__ */ u8(SHA512_256_IV);\n// RFC 7693 \u00A72.6 / Appendix C: BLAKE2b reuses the SHA-512 IV words.\n// This file keeps them as LE [lo, hi] u32 halves for the BLAKE2b helpers.\n// Same as SHA512_IV, but swapped endianness: LE instead of BE. iv[1] is iv[0], etc.\nexport const B2B_IV = /* @__PURE__ */ Uint32Array.from([\n 0xf3bcc908, 0x6a09e667, 0x84caa73b, 0xbb67ae85, 0xfe94f82b, 0x3c6ef372, 0x5f1d36f1, 0xa54ff53a,\n 0xade682d1, 0x510e527f, 0x2b3e6c1f, 0x9b05688c, 0xfb41bd6b, 0x1f83d9ab, 0x137e2179, 0x5be0cd19,\n]);\nexport const B2B_IV_U8 = /* @__PURE__ */ u8(B2B_IV);\nconst _32n = /* @__PURE__ */ BigInt(32);\nexport const B2B_IV_U64 = /* @__PURE__ */ [\n '0x6a09e667f3bcc908',\n '0xbb67ae8584caa73b',\n '0x3c6ef372fe94f82b',\n '0xa54ff53a5f1d36f1',\n '0x510e527fade682d1',\n '0x9b05688c2b3e6c1f',\n '0x1f83d9abfb41bd6b',\n '0x5be0cd19137e2179',\n].map((n) => BigInt(n));\n// RFC 7693 \u00A72.6 / Appendix D: BLAKE2s reuses the SHA-256 IV words as-is.\nexport const B2S_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\nexport const B2S_IV_U8 = /* @__PURE__ */ u8(B2S_IV);\n// SHA-3 proposal BLAKE v1.2 \u00A72.1.1 Table 2.1 / RFC 7693 \u00A72.7:\n// rows 0..9 are the published SIGMA table; rows 10..11 repeat 0..1 for BLAKE2b;\n// rows 10..13 satisfy SHA-3 proposal BLAKE v1.2 \u00A72.2.2's sigma[r mod 10] reuse for 14-round\n// BLAKE-64; rows 14..15 extend that modulo-10 reuse for the legacy 16-round\n// Blake1 path.\n// prettier-ignore\nexport const BSIGMA = /* @__PURE__ */ Uint8Array.from([\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3,\n 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4,\n 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8,\n 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13,\n 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9,\n 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11,\n 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10,\n 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5,\n 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0,\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3,\n // Blake1, unused in others\n 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4,\n 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8,\n 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13,\n 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9,\n]);\n// blake1\n// first half of C512\n// SHA-3 proposal BLAKE v1.2 \u00A72.1.1: BLAKE-32 uses c0..c15,\n// starting at 0x243f6a88 and ending at 0xb5470917.\nexport const B32C = /* @__PURE__ */ Uint32Array.from([\n 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,\n 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,\n]);\n// prettier-ignore\n// SHA-3 proposal BLAKE v1.2 \u00A72.2.1 c0..c15 are stored as [lo32, hi32] halves.\n// generateTBL512_new rebuilds each 64-bit constant with (hi << 32n) | lo.\nexport const B64C = /* @__PURE__ */ (() => Uint32Array.from([\n B32C[1], B32C[0], B32C[3], B32C[2], B32C[5], B32C[4], B32C[7], B32C[6], // le<->be\n B32C[9], B32C[8], B32C[11], B32C[10], B32C[13], B32C[12], B32C[15], B32C[14],\n 0x8979fb1b, 0x9216d5d9, 0x98dfb5ac, 0xd1310ba6, 0xd01adfb7, 0x2ffd72db, 0x6a267e96, 0xb8e1afed,\n 0xf12c7f99, 0xba7c9045, 0xb3916cf7, 0x24a19947, 0x858efc16, 0x0801f2e2, 0x71574e69, 0x636920d8,\n]))();\nexport const B64C_U64 = /* @__PURE__ */ [\n // first half\n '0x243f6a8885a308d3',\n '0x13198a2e03707344',\n '0xa4093822299f31d0',\n '0x082efa98ec4e6c89',\n '0x452821e638d01377',\n '0xbe5466cf34e90c6c',\n '0xc0ac29b7c97c50dd',\n '0x3f84d5b5b5470917',\n // second half\n '0x9216d5d98979fb1b',\n '0xd1310ba698dfb5ac',\n '0x2ffd72dbd01adfb7',\n '0xb8e1afed6a267e96',\n '0xba7c9045f12c7f99',\n '0x24a19947b3916cf7',\n '0x0801f2e2858efc16',\n '0x636920d871574e69',\n].map((n) => BigInt(n));\nexport const B256_IV = /* @__PURE__ */ SHA256_IV.slice();\n// SHA-3 proposal BLAKE v1.2 \u00A72.2.1: legacy Blake1-64 keeps the SHA-512 IV in canonical\n// [hi32, lo32] order, unlike SHA512_IV above, which is laid out as [lo, hi]\n// for module-state seeding.\nexport const B512_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179,\n]);\nfunction generateTBL256() {\n const TBL = [];\n for (let i = 0, j = 0; i < 14; i++, j += 16) {\n for (let offset = 1; offset < 16; offset += 2) {\n TBL.push(B32C[BSIGMA[j + offset]]);\n TBL.push(B32C[BSIGMA[j + offset - 1]]);\n }\n }\n return TBL;\n}\nexport const TBL256 = /* @__PURE__ */ generateTBL256(); // C256[SIGMA[X]] precompute\nfunction generateTBL512_new() {\n const TBL = [];\n for (let r = 0, k = 0; r < 16; r++, k += 16) {\n for (let offset = 1; offset < 16; offset += 2) {\n const l0 = B64C[BSIGMA[k + offset] * 2 + 1];\n const h0 = B64C[BSIGMA[k + offset] * 2 + 0];\n const l1 = B64C[BSIGMA[k + offset - 1] * 2 + 1];\n const h1 = B64C[BSIGMA[k + offset - 1] * 2 + 0];\n TBL.push((BigInt(l0) << _32n) | BigInt(h0));\n TBL.push((BigInt(l1) << _32n) | BigInt(h1));\n }\n }\n return TBL;\n}\nexport const TBL512 = /* @__PURE__ */ generateTBL512_new();\n/** Initial SHA-1 state from RFC 3174 \u00A76.1. */\nexport const SHA1_IV = /* @__PURE__ */ Uint32Array.from([\n 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0,\n]);\nexport const SHA1_IV_U8 = /* @__PURE__ */ u8(SHA1_IV);\nconst p32 = /* @__PURE__ */ Math.pow(2, 32);\n/** RFC 1321 \u00A73.4 / Appendix A.3 `T[1..64]` table. */\nexport const MD5_K = /* @__PURE__ */ Array.from({ length: 64 }, (_, i) => Math.floor(p32 * Math.abs(Math.sin(i + 1))));\n/**\n * RFC 1321 \u00A73.3 / Appendix A.3 MD5 initial state.\n * It matches the first four SHA-1 words, so slice() copies them without\n * aliasing SHA1_IV.\n */\nexport const MD5_IV = /* @__PURE__ */ SHA1_IV.slice(0, 4);\nexport const MD5_IV_U8 = /* @__PURE__ */ u8(MD5_IV);\n/** RIPEMD-160 initial state; same five 32-bit words as SHA-1. */\nexport const RIPEMD160_IV = /* @__PURE__ */ new Uint32Array([\n 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0,\n]);\nexport const RIPEMD160_IV_U8 = /* @__PURE__ */ u8(RIPEMD160_IV);\nconst Rho160 = /* @__PURE__ */ Uint8Array.from([\n 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n]);\nconst Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))();\nconst Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))();\n// Five left/right message-word orderings for the RIPEMD-160 dual-lane rounds.\nconst idxLR = /* @__PURE__ */ (() => {\n const L = [Id160];\n const R = [Pi160];\n const res = [L, R];\n for (let i = 0; i < 4; i++)\n for (let j of res)\n j.push(j[i].map((k) => Rho160[k]));\n return res;\n})();\nexport const RIPEMD160_idxL = /* @__PURE__ */ (() => idxLR[0])();\nexport const RIPEMD160_idxR = /* @__PURE__ */ (() => idxLR[1])();\n// const [idxL, idxR] = idxLR;\n// Base per-group shift table before the left/right message-order permutations are applied.\nconst shifts160 = /* @__PURE__ */ [\n [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],\n [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],\n [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],\n [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],\n [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5],\n].map((i) => Uint8Array.from(i));\nexport const RIPEMD160_shiftsL160 = /* @__PURE__ */ RIPEMD160_idxL.map((idx, i) => idx.map((j) => shifts160[i][j]));\nexport const RIPEMD160_shiftsR160 = /* @__PURE__ */ RIPEMD160_idxR.map((idx, i) => idx.map((j) => shifts160[i][j]));\n// Five left-lane additive constants for RIPEMD-160.\nexport const RIPEMD160_Kl160 = /* @__PURE__ */ Uint32Array.from([\n 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e,\n]);\n// Five right-lane additive constants for RIPEMD-160.\nexport const RIPEMD160_Kr160 = /* @__PURE__ */ Uint32Array.from([\n 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000,\n]);\nconst _0n = /* @__PURE__ */ BigInt(0);\nconst _1n = /* @__PURE__ */ BigInt(1);\nconst _2n = /* @__PURE__ */ BigInt(2);\nconst _7n = /* @__PURE__ */ BigInt(7);\nconst _256n = /* @__PURE__ */ BigInt(256);\n// FIPS 202 Algorithm 5 rc():\n// when the outgoing bit is 1, the 8-bit LFSR xors taps 0, 4, 5, and 6.\n// That compresses to the feedback mask `0x71`.\nconst _0x71n = /* @__PURE__ */ BigInt(0x71);\n// Grouped export destructuring sticks in bundles even when SHA3 is unused, so generate\n// each table in its own pure IIFE instead of exporting all three from one object.\n// FIPS 202 \u00A73.2.2 / \u00A73.2.3 walk the 24 non-(0,0) lanes.\n// This table stores each lane as 5*y + x for the u64 state layout.\nexport const SHA3_PI2 = /* @__PURE__ */ (() => {\n const SHA3_PI2 = [];\n for (let round = 0, x = 1, y = 0; round < 24; round++) {\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI2.push(5 * y + x);\n }\n return SHA3_PI2;\n})();\nexport const SHA3_ROTL = /* @__PURE__ */ (() => {\n const SHA3_ROTL = [];\n for (let round = 0, x = 1, y = 0; round < 24; round++) {\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n }\n return SHA3_ROTL;\n})();\nexport const SHA3_IOTA = /* @__PURE__ */ (() => {\n const SHA3_IOTA = [];\n for (let round = 0, R = _1n; round < 24; round++) {\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n);\n }\n SHA3_IOTA.push(t);\n }\n return SHA3_IOTA;\n})();\n// Flag bitset\n// BLAKE3 compression-domain flags from Table~\\ref{tab:flags}.\nexport const B3_Flags = {\n CHUNK_START: 0b1,\n CHUNK_END: 0b10,\n PARENT: 0b100,\n ROOT: 0b1000,\n KEYED_HASH: 0b10000,\n DERIVE_KEY_CONTEXT: 0b100000,\n DERIVE_KEY_MATERIAL: 0b1000000,\n};\n// Default BLAKE3 IV, cloned from the shared BLAKE2s / SHA-256 IV basis.\nexport const B3_IV = /* @__PURE__ */ SHA256_IV.slice();\nexport const B3_IV_U8 = /* @__PURE__ */ u8(B3_IV);\n// Seven 16-word rounds of the BLAKE3 message schedule.\n// Generated by repeatedly applying the adopted single permutation.\nexport const B3_SIGMA = /* @__PURE__ */ (() => {\n const Id = Array.from({ length: 16 }, (_, i) => i);\n const permute = (arr) => [2, 6, 3, 10, 7, 0, 4, 13, 1, 11, 12, 5, 9, 14, 15, 8].map((i) => arr[i]);\n const res = [];\n for (let i = 0, v = Id; i < 7; i++, v = permute(v))\n res.push(...v);\n return Uint8Array.from(res);\n})();\n// Replaces `TextEncoder` for ASCII literals, which is enough for sigma constants.\n// Non-ASCII input would not match UTF-8 `TextEncoder` output.\nconst encodeStr = (str) => Uint8Array.from(str.split(''), (c) => c.charCodeAt(0));\n// RFC 8439 \u00A72.3 / RFC 7539 \u00A72.3 only define the 256-bit-key constants; this 16-byte sigma is\n// kept for legacy allowShortKeys Salsa/ChaCha variants.\nexport const ARX_SIGMA16 = /* @__PURE__ */ encodeStr('expand 16-byte k');\n// RFC 8439 \u00A72.3 / RFC 7539 \u00A72.3 define words 0-3 as\n// `0x61707865 0x3320646e 0x79622d32 0x6b206574`, i.e. `expand 32-byte k`.\nexport const ARX_SIGMA32 = /* @__PURE__ */ encodeStr('expand 32-byte k');\n", "/**\n * Hash definitions. Common logic for all targets.\n * Doesn't contain WASM-specific/JS-specific code.\n * @module\n */\nimport * as constants from \"./constants.js\";\nimport {} from \"./hashes-abstract.js\";\nimport { mkArgon2d, mkArgon2i, mkArgon2id, mkScrypt } from \"./kdf.js\";\nimport { abytes, anumber, isBytes, oidNist, u32 } from \"./utils.js\";\n// FIPS 202 \u00A76.1 appends SHA-3 suffix bits `01`; this byte-level wrapper uses `0x06`\n// so the shared Keccak padding path applies those domain bits before pad10*1.\nexport const sha3_224 = /* @__PURE__ */ Object.freeze({\n suffix: 0x06,\n blockLen: 144,\n outputLen: 28,\n outputBlockLen: 144,\n oid: /* @__PURE__ */ oidNist(0x07),\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\nexport const sha3_256 = /* @__PURE__ */ Object.freeze({\n suffix: 0x06,\n blockLen: 136,\n outputLen: 32,\n outputBlockLen: 136,\n oid: /* @__PURE__ */ oidNist(0x08),\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\nexport const sha3_384 = /* @__PURE__ */ Object.freeze({\n suffix: 0x06,\n blockLen: 104,\n outputLen: 48,\n outputBlockLen: 104,\n oid: /* @__PURE__ */ oidNist(0x09),\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\nexport const sha3_512 = /* @__PURE__ */ Object.freeze({\n suffix: 0x06,\n blockLen: 72,\n outputLen: 64,\n outputBlockLen: 72,\n oid: /* @__PURE__ */ oidNist(0x0a),\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\n// Legacy Keccak keeps the original 0x01 domain suffix on Keccak-f[1600].\n// Unlike FIPS 202 SHA3-*, it does not use the SHA-3 0x06 suffix or expose\n// NIST hash OIDs here.\nexport const keccak_224 = /* @__PURE__ */ Object.freeze({\n suffix: 0x01,\n blockLen: 144,\n outputLen: 28,\n outputBlockLen: 144,\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\nexport const keccak_256 = /* @__PURE__ */ Object.freeze({\n suffix: 0x01,\n blockLen: 136,\n outputLen: 32,\n outputBlockLen: 136,\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\nexport const keccak_384 = /* @__PURE__ */ Object.freeze({\n suffix: 0x01,\n blockLen: 104,\n outputLen: 48,\n outputBlockLen: 104,\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\nexport const keccak_512 = /* @__PURE__ */ Object.freeze({\n suffix: 0x01,\n blockLen: 72,\n outputLen: 64,\n outputBlockLen: 72,\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\n// FIPS 202 \u00A76.2: SHAKE128 uses the 1111 domain suffix.\n// It is `0x1f` in this byte-oriented padding path and stays XOF-capable; this\n// wrapper keeps a 16-byte library default while callers can request any dkLen.\nexport const shake128 = /* @__PURE__ */ Object.freeze({\n suffix: 0x1f,\n blockLen: 168,\n outputLen: 16,\n outputBlockLen: 168,\n canXOF: true,\n oid: /* @__PURE__ */ oidNist(0x0b),\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\n// FIPS 202 \u00A76.2: SHAKE256 uses the same 1111 domain suffix (`0x1f` here).\n// It stays XOF-capable; this wrapper keeps a 32-byte library default while\n// callers can request any dkLen.\nexport const shake256 = /* @__PURE__ */ Object.freeze({\n suffix: 0x1f,\n blockLen: 136,\n outputLen: 32,\n outputBlockLen: 136,\n canXOF: true,\n oid: /* @__PURE__ */ oidNist(0x0c),\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\n// This keeps the SHAKE128 algorithm and OID from FIPS 202 Appendix C.\n// It chooses the 32-byte \"NIST version\" default while staying XOF-capable for\n// any requested dkLen.\nexport const shake128_32 = /* @__PURE__ */ Object.freeze({\n suffix: 0x1f,\n blockLen: 168,\n outputLen: 32,\n outputBlockLen: 168,\n canXOF: true,\n oid: /* @__PURE__ */ oidNist(0x0b),\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\n// This keeps the SHAKE256 algorithm and OID from FIPS 202 Appendix C.\n// It chooses the 64-byte \"NIST version\" default while staying XOF-capable for\n// any requested dkLen.\nexport const shake256_64 = /* @__PURE__ */ Object.freeze({\n suffix: 0x1f,\n blockLen: 136,\n outputLen: 64,\n outputBlockLen: 136,\n canXOF: true,\n oid: /* @__PURE__ */ oidNist(0x0c),\n init: (_batchPos, _maxBlocks, mod) => mod.initKeccak(),\n});\nexport const sha256 = /* @__PURE__ */ Object.freeze({\n blockLen: 64,\n outputLen: 32,\n oid: /* @__PURE__ */ oidNist(0x01),\n init: (batchPos, _maxBlocks, mod) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.SHA256_IV_U8);\n },\n});\n// RFC 6234 \u00A76.2: SHA-224 shares the SHA-256 compression core and eight-word state, but\n// exposes only the leftmost 224 bits, so this wrapper keeps 32-byte backend output blocks\n// while truncating the public digest to 28 bytes.\nexport const sha224 = /* @__PURE__ */ Object.freeze({\n blockLen: 64,\n outputLen: 28,\n outputBlockLen: 32,\n oid: /* @__PURE__ */ oidNist(0x04),\n init: (batchPos, _maxBlocks, mod) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.SHA224_IV_U8);\n },\n});\nexport const sha512 = /* @__PURE__ */ Object.freeze({\n blockLen: 128,\n outputLen: 64,\n outputBlockLen: 64,\n oid: /* @__PURE__ */ oidNist(0x03),\n init: (batchPos, _maxBlocks, mod) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.SHA512_IV_U8);\n },\n});\n// RFC 4634 \u00A76.4: SHA-384 shares the SHA-512 compression core and eight-word state, but\n// exposes only H(N)0..H(N)5, so this wrapper keeps 64-byte backend output blocks while\n// truncating the public digest to 48 bytes.\nexport const sha384 = /* @__PURE__ */ Object.freeze({\n blockLen: 128,\n outputLen: 48,\n outputBlockLen: 64,\n oid: /* @__PURE__ */ oidNist(0x02),\n init: (batchPos, _maxBlocks, mod) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.SHA384_IV_U8);\n },\n});\n// This variant uses the shared SHA-512 backend with the derived SHA-512/224 IV, so backend\n// output blocks stay 64 bytes while the public digest truncates to 28 bytes.\nexport const sha512_224 = /* @__PURE__ */ Object.freeze({\n blockLen: 128,\n outputLen: 28,\n outputBlockLen: 64,\n oid: /* @__PURE__ */ oidNist(0x05),\n init: (batchPos, _maxBlocks, mod) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.SHA512_224_IV_U8);\n },\n});\n// This variant uses the shared SHA-512 backend with the derived SHA-512/256 IV, so backend\n// output blocks stay 64 bytes while the public digest truncates to 32 bytes.\nexport const sha512_256 = /* @__PURE__ */ Object.freeze({\n blockLen: 128,\n outputLen: 32,\n outputBlockLen: 64,\n oid: /* @__PURE__ */ oidNist(0x06),\n init: (batchPos, _maxBlocks, mod) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.SHA512_256_IV_U8);\n },\n});\nexport const sha1 = /* @__PURE__ */ Object.freeze({\n blockLen: 64,\n outputLen: 20,\n init: (batchPos, _maxBlocks, mod) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.SHA1_IV_U8);\n },\n});\nexport const ripemd160 = /* @__PURE__ */ Object.freeze({\n blockLen: 64,\n outputLen: 20,\n init: (batchPos, _maxBlocks, mod) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.RIPEMD160_IV_U8);\n },\n});\nexport const md5 = /* @__PURE__ */ Object.freeze({\n blockLen: 64,\n outputLen: 16,\n init: (batchPos, _maxBlocks, mod) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.MD5_IV_U8);\n },\n});\nfunction blake1Salt(batchPos, mod, opts) {\n if (opts.salt !== undefined) {\n const slt = opts.salt;\n const salt_chunks = mod.segments['state.salt_chunks'];\n abytes(slt, salt_chunks[batchPos].length, 'salt');\n salt_chunks[batchPos].set(slt);\n }\n}\nexport const blake256 = /* @__PURE__ */ Object.freeze({\n blockLen: 64,\n outputLen: 32,\n // SHA-3 proposal BLAKE v1.2 \u00A72.1.1 / \u00A72.1.3:\n // BLAKE-32 starts from the SHA-256 IV, and the 256-bit variant\n // keeps the pre-length padding bit set to 1, so this wrapper uses suffix 0x01.\n suffix: 0b0000_0001,\n init: (batchPos, _maxBlocks, mod, _, opts = {}) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.SHA256_IV_U8);\n blake1Salt(batchPos, mod, opts);\n },\n});\nexport const blake224 = /* @__PURE__ */ Object.freeze({\n blockLen: 64,\n outputLen: 28,\n // SHA-3 proposal BLAKE v1.2 \u00A72.3:\n // BLAKE-28 reuses the BLAKE-32 core with the SHA-224 IV, replaces the\n // pre-length padding bit with 0, and truncates the public digest to 224 bits, so this\n // wrapper keeps 32-byte backend output blocks and leaves suffix at the default 0.\n outputBlockLen: 32,\n init: (batchPos, _maxBlocks, mod, _, opts = {}) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.SHA224_IV_U8);\n blake1Salt(batchPos, mod, opts);\n },\n});\nexport const blake384 = /* @__PURE__ */ Object.freeze({\n blockLen: 128,\n outputLen: 48,\n // SHA-3 proposal BLAKE v1.2 \u00A72.4:\n // BLAKE-48 reuses the BLAKE-64 core with the SHA-384 IV, replaces the\n // pre-length padding bit with 0, and truncates the public digest to 384 bits, so this\n // wrapper keeps 64-byte backend output blocks and leaves suffix at the default 0.\n outputBlockLen: 64,\n init: (batchPos, _maxBlocks, mod, _, opts = {}) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.SHA384_IV_U8);\n blake1Salt(batchPos, mod, opts);\n },\n});\nexport const blake512 = /* @__PURE__ */ Object.freeze({\n blockLen: 128,\n outputLen: 64,\n // SHA-3 proposal BLAKE v1.2 \u00A72.2.1 / \u00A72.2.3:\n // BLAKE-64 starts from the SHA-512 IV, and the 512-bit variant\n // keeps the pre-length padding bit set to 1, so this wrapper uses suffix 0x01 and falls\n // back to 64-byte output blocks.\n suffix: 0b0000_0001,\n init: (batchPos, _maxBlocks, mod, _, opts = {}) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.SHA512_IV_U8);\n blake1Salt(batchPos, mod, opts);\n },\n});\nfunction blake2Init(batchPos, outputLen, maxBlocks, blockLen, mod, opts) {\n if (opts.dkLen !== undefined)\n anumber(opts.dkLen, 'opts.dkLen');\n const dkLen = opts.dkLen === undefined ? outputLen : opts.dkLen;\n let keyLength = 0;\n let blocks = 0;\n // RFC 7693 uses digest length nn in 1..outputLen, so zero-length output is invalid here.\n if (dkLen <= 0 || dkLen > outputLen)\n throw new Error('outputLen bigger than keyLen');\n const { key, salt, personalization } = opts;\n if (key !== undefined) {\n if (key.length < 1 || key.length > outputLen)\n throw new Error('\"key\" expected to be undefined or of length=1..' + outputLen);\n abytes(key);\n const keyPos = batchPos * maxBlocks * blockLen;\n // RFC 7693 \u00A73.3: keyed BLAKE2 pads the key with zeros and prepends it as d[0],\n // so preload one full block here and report blocks=1 to the shared absorber.\n mod.segments.buffer.fill(0, keyPos, keyPos + blockLen);\n mod.segments.buffer.set(key, keyPos);\n keyLength = key.length;\n blocks = 1;\n }\n const salt_chunk = mod.segments['init.salt_chunks'][batchPos];\n const pers_chunk = mod.segments['init.personalization_chunks'][batchPos];\n if (salt !== undefined) {\n abytes(salt, salt_chunk.length, 'salt');\n salt_chunk.set(salt);\n }\n if (personalization !== undefined) {\n abytes(personalization, pers_chunk.length, 'personalization');\n pers_chunk.set(personalization);\n }\n mod.initBlake2(batchPos, 1, 1, dkLen, keyLength);\n // Streaming BLAKE2 instances keep dkLen as their fixed digest size, so create({ dkLen })\n // must carry that value into digest() / digestInto() instead of falling back to the family max.\n return { blocks, outputLen: dkLen };\n}\nexport const blake2s = /* @__PURE__ */ Object.freeze({\n blockLen: 64,\n // RFC 7693 \u00A74: the default named surface here is BLAKE2s-256 (nn = 32);\n // shorter digests come from opts.dkLen, and OID support is optional so oid stays unset.\n outputLen: 32,\n init: (batchPos, maxBlocks, mod, _, opts = {}) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.B2S_IV_U8);\n return blake2Init(batchPos, 32, maxBlocks, 64, mod, opts);\n },\n});\nexport const blake2b = /* @__PURE__ */ Object.freeze({\n blockLen: 128,\n // RFC 7693 \u00A74: the default named surface here is BLAKE2b-512 (nn = 64);\n // shorter digests come from opts.dkLen, and OID support is optional so oid stays unset.\n outputLen: 64,\n suffix: 0,\n init: (batchPos, maxBlocks, mod, _, opts = {}) => {\n mod.segments['state.state_chunks'][batchPos].set(constants.B2B_IV_U8);\n return blake2Init(batchPos, 64, maxBlocks, 128, mod, opts);\n },\n});\nexport const blake3 = /* @__PURE__ */ Object.freeze({\n blockLen: 64,\n // BLAKE3's default hash is the 32-byte root chaining value, but XOF output repeats\n // the full 64-byte ROOT compression blocks, so outputBlockLen stays 64 while outputLen is 32.\n outputBlockLen: 64,\n outputLen: 32,\n chunks: /* @__PURE__ */ (() => 10 * 1024 * 16)(),\n canXOF: true,\n init(batchPos, _maxBlocks, mod, hash, opts = {}) {\n const { key, context, _keyContext } = opts;\n if (opts.dkLen !== undefined)\n anumber(opts.dkLen, 'opts.dkLen');\n let flags = 0 >>> 0;\n let IV = constants.B3_IV_U8;\n if (key !== undefined) {\n abytes(key, 32, 'key');\n if (context !== undefined || _keyContext !== undefined)\n throw new Error('Only \"key\" or \"context\" can be specified at same time');\n // PRF/HMAC/MAC\n IV = key;\n flags = constants.B3_Flags.KEYED_HASH;\n }\n else if (_keyContext !== undefined) {\n if (context !== undefined || key !== undefined)\n throw new Error('Only \"key\" or \"context\" can be specified at same time');\n flags = constants.B3_Flags.DERIVE_KEY_CONTEXT;\n }\n else if (context !== undefined) {\n abytes(context, undefined, 'context');\n if (_keyContext !== undefined || key !== undefined)\n throw new Error('Only \"key\" or \"context\" can be specified at same time');\n if (_keyContext !== undefined && typeof _keyContext !== 'boolean')\n throw new Error('wrong type for _keyContext');\n // BLAKE3 derive_key is two-stage: first hash the context under\n // DERIVE_KEY_CONTEXT, then use that 32-byte output as the key words for key material.\n const derive = hash;\n IV = derive(context, { dkLen: 32, _keyContext: true });\n flags = constants.B3_Flags.DERIVE_KEY_MATERIAL;\n }\n mod.segments['state.iv_chunks'][batchPos].set(IV);\n mod.segments['state.state_chunks'][batchPos].set(IV);\n u32(mod.segments['state.flags_chunks'][batchPos])[0] = flags;\n },\n});\n// Normalize both legacy mac(msg, key) and newer mac(msg, { key }) call shapes without cloning.\nconst getMacKey = (opts) => (isBytes(opts) ? opts : opts.key);\n// RFC 8439 \u00A72.5: Poly1305 consumes a fresh 32-byte one-time key per message.\n// It emits a 16-byte tag over 16-byte blocks.\nexport const poly1305 = /* @__PURE__ */ Object.freeze({\n blockLen: 16,\n outputLen: 16,\n init(_batchPos, _maxBlocks, mod, _hash, opts) {\n const key = getMacKey(opts);\n if (key === undefined)\n throw new Error('\"key\" expected Uint8Array of length 32, got type=undefined');\n abytes(key, 32, 'key');\n mod.segments['state.poly.key_chunks'][_batchPos].set(key);\n mod.macInit(_batchPos);\n },\n});\n// RFC 4493 \u00A72.4 / FIPS 197-upd1 \u00A73.1:\n// AES-CMAC uses AES's 16-byte block size and fixed 16-byte tag, while this\n// wrapper accepts AES-128/192/256 keys.\nexport const cmac = /* @__PURE__ */ Object.freeze({\n blockLen: 16,\n outputLen: 16,\n init(_batchPos, _maxBlocks, mod, _hash, opts) {\n const key = getMacKey(opts);\n if (key === undefined)\n throw new Error('\"cmac key\" expected Uint8Array of length 16/24/32, got length=undefined');\n abytes(key, undefined, 'cmac key');\n if (key.length !== 16 && key.length !== 24 && key.length !== 32)\n throw new Error('\"cmac key\" expected Uint8Array of length 16/24/32, got length=' + key.length);\n mod.segments['state.key_chunks'][_batchPos].set(key);\n mod.macInit(_batchPos, key.length);\n },\n});\n// NIST SP 800-38D \u00A76.4 / \u00A77.1:\n// raw GHASH takes the 16-byte hash subkey H = CIPH_K(0^128), not the AES key K.\nexport const ghash = /* @__PURE__ */ Object.freeze({\n blockLen: 16,\n outputLen: 16,\n init(_batchPos, _maxBlocks, mod, _hash, opts) {\n const key = getMacKey(opts);\n if (key === undefined)\n throw new Error('\"key\" expected Uint8Array of length 16, got type=undefined');\n abytes(key, 16, 'key');\n mod.segments['state.ghash.h_chunks'][_batchPos].set(key);\n mod.macInit(_batchPos);\n },\n});\n// RFC 8452 \u00A73 / Appendix A:\n// raw POLYVAL takes a 16-byte field element H and shares the GHASH core via\n// the reversed byte/bit convention.\nexport const polyval = /* @__PURE__ */ Object.freeze({\n blockLen: 16,\n outputLen: 16,\n init(_batchPos, _maxBlocks, mod, _hash, opts) {\n const key = getMacKey(opts);\n if (key === undefined)\n throw new Error('\"key\" expected Uint8Array of length 16, got type=undefined');\n abytes(key, 16, 'key');\n mod.segments['state.ghash.h_chunks'][_batchPos].set(key);\n mod.macInit(_batchPos);\n },\n});\n// NOTE: safe for tree-shaking since used only in building process\n// prettier-ignore\nconst defs = {\n sha3_224, sha3_256, sha3_384, sha3_512, // sha3\n keccak_224, keccak_256, keccak_384, keccak_512, // keccak\n shake128, shake256, shake128_32, shake256_64, // shake\n sha224, sha256, sha384, sha512, sha512_224, sha512_256, // sha2\n sha1, ripemd160, md5, // legacy\n blake224, blake256, blake384, blake512, blake2s, blake2b, blake3, // blake\n poly1305, ghash, polyval, cmac, // MAC\n};\n// Map each name to module\nconst MOD_OF = {\n // sha3\n sha3_224: 'keccak24',\n sha3_256: 'keccak24',\n sha3_384: 'keccak24',\n sha3_512: 'keccak24',\n // keccak\n keccak_224: 'keccak24',\n keccak_256: 'keccak24',\n keccak_384: 'keccak24',\n keccak_512: 'keccak24',\n // shake\n shake128: 'keccak24',\n shake256: 'keccak24',\n shake128_32: 'keccak24',\n shake256_64: 'keccak24',\n // sha2\n sha224: 'sha256',\n sha256: 'sha256',\n sha384: 'sha512',\n sha512: 'sha512',\n sha512_224: 'sha512',\n sha512_256: 'sha512',\n // legacy\n sha1: 'sha1',\n ripemd160: 'ripemd160',\n md5: 'md5',\n // blake1/2/3\n blake224: 'blake256',\n blake256: 'blake256',\n blake384: 'blake512',\n blake512: 'blake512',\n blake2s: 'blake2s',\n blake2b: 'blake2b',\n blake3: 'blake3',\n // Mac\n poly1305: 'poly1305',\n ghash: 'ghash',\n polyval: 'polyval',\n cmac: 'cmac',\n};\n// Verifies that definition actually can be used with module\nfunction buildDefinitions(defs, modOf) {\n const out = {};\n for (const k in defs)\n out[k] = { mod: modOf[k], def: defs[k] };\n return out;\n}\nexport const Definitions = /* @__PURE__ */ buildDefinitions(defs, MOD_OF);\n// Generic definitions can be used for non-hash/cipher surfaces that still need\n// a specific wrapper function.\n// KDF stubs compare factory identity, so installed implementations carry the public wrapper here.\nexport const scrypt = ((mod, deps, platform) => mkScrypt(mod, deps, platform, scrypt));\nexport const argon2d = ((mod, deps, platform) => mkArgon2d(mod, deps, platform, argon2d));\nexport const argon2i = ((mod, deps, platform) => mkArgon2i(mod, deps, platform, argon2i));\nexport const argon2id = ((mod, deps, platform) => mkArgon2id(mod, deps, platform, argon2id));\n// type GenericDefinition<T, DEPS extends Record<string, any>, RET> = (\n// mod: T,\n// deps: DEPS,\n// platform: string\n// ) => RET;\n// const genDefs = { scrypt, argon2d, argon2i, argon2id } satisfies Record<\n// string,\n// GenericDefinition<any, any, any>\n// >;\nconst KDFStub = { path: 'kdf.ts', fn: 'mkKDFStub' };\nexport const GenericDefinitions = {\n scrypt: { mod: 'scrypt', deps: ['sha256'], stub: KDFStub },\n argon2d: { mod: 'argon2', deps: ['blake2b'], stub: KDFStub },\n argon2i: { mod: 'argon2', deps: ['blake2b'], stub: KDFStub },\n argon2id: { mod: 'argon2', deps: ['blake2b'], stub: KDFStub },\n};\n", "// WARNING: This file is auto-generated. Any changes will be lost.\nfunction init_module(_imports = {}, pool) {\n const _importsEmbed = { env: {} };\n _imports = { ..._importsEmbed, ..._imports, env: { ..._importsEmbed.env, ..._imports.env } };\n const __buf = new ArrayBuffer(15730784);\n if (!(__buf instanceof ArrayBuffer))\n throw new Error('wrong buffer');\n const memory = new Uint8Array(__buf);\n const memory_i32 = new Int32Array(__buf);\n function compressParents(v0, v1, v2) {\n const v3 = ((32 + Math.imul(2144, v0)) | 0);\n const v4 = memory_i32[(((v3) >>> 0) + 0) >>> 2];\n const v5 = ((4 + v3) | 0);\n const v6 = memory_i32[(((v5) >>> 0) + 0) >>> 2];\n const v7 = ((4 + v5) | 0);\n const v8 = memory_i32[(((v7) >>> 0) + 0) >>> 2];\n const v9 = ((4 + v7) | 0);\n const v10 = memory_i32[(((v9) >>> 0) + 0) >>> 2];\n const v11 = ((4 + v9) | 0);\n const v12 = memory_i32[(((v11) >>> 0) + 0) >>> 2];\n const v13 = ((4 + v11) | 0);\n const v14 = memory_i32[(((v13) >>> 0) + 0) >>> 2];\n const v15 = ((4 + v13) | 0);\n const v16 = memory_i32[(((v15) >>> 0) + 0) >>> 2];\n const v17 = memory_i32[(((((4 + v15) | 0)) >>> 0) + 0) >>> 2];\n const v18 = ((((96 + (v1 << 5)) | 0) + Math.imul(2144, v0)) | 0);\n const v19 = memory_i32[(((v18) >>> 0) + 0) >>> 2];\n const v20 = ((4 + v18) | 0);\n const v21 = memory_i32[(((v20) >>> 0) + 0) >>> 2];\n const v22 = ((4 + v20) | 0);\n const v23 = memory_i32[(((v22) >>> 0) + 0) >>> 2];\n const v24 = ((4 + v22) | 0);\n const v25 = memory_i32[(((v24) >>> 0) + 0) >>> 2];\n const v26 = ((4 + v24) | 0);\n const v27 = memory_i32[(((v26) >>> 0) + 0) >>> 2];\n const v28 = ((4 + v26) | 0);\n const v29 = memory_i32[(((v28) >>> 0) + 0) >>> 2];\n const v30 = ((4 + v28) | 0);\n const v31 = memory_i32[(((v30) >>> 0) + 0) >>> 2];\n const v32 = memory_i32[(((((4 + v30) | 0)) >>> 0) + 0) >>> 2];\n memory_i32[(((v18) >>> 0) + 0) >>> 2] = 0;\n const v33 = ((4 + v18) | 0);\n memory_i32[(((v33) >>> 0) + 0) >>> 2] = 0;\n const v34 = ((4 + v33) | 0);\n memory_i32[(((v34) >>> 0) + 0) >>> 2] = 0;\n const v35 = ((4 + v34) | 0);\n memory_i32[(((v35) >>> 0) + 0) >>> 2] = 0;\n const v36 = ((4 + v35) | 0);\n memory_i32[(((v36) >>> 0) + 0) >>> 2] = 0;\n const v37 = ((4 + v36) | 0);\n memory_i32[(((v37) >>> 0) + 0) >>> 2] = 0;\n const v38 = ((4 + v37) | 0);\n memory_i32[(((v38) >>> 0) + 0) >>> 2] = 0;\n memory_i32[(((((4 + v38) | 0)) >>> 0) + 0) >>> 2] = 0;\n const v39 = ((((96 + (((1 + v1) | 0) << 5)) | 0) + Math.imul(2144, v0)) | 0);\n const v40 = memory_i32[(((v39) >>> 0) + 0) >>> 2];\n const v41 = ((4 + v39) | 0);\n const v42 = memory_i32[(((v41) >>> 0) + 0) >>> 2];\n const v43 = ((4 + v41) | 0);\n const v44 = memory_i32[(((v43) >>> 0) + 0) >>> 2];\n const v45 = ((4 + v43) | 0);\n const v46 = memory_i32[(((v45) >>> 0) + 0) >>> 2];\n const v47 = ((4 + v45) | 0);\n const v48 = memory_i32[(((v47) >>> 0) + 0) >>> 2];\n const v49 = ((4 + v47) | 0);\n const v50 = memory_i32[(((v49) >>> 0) + 0) >>> 2];\n const v51 = ((4 + v49) | 0);\n const v52 = memory_i32[(((v51) >>> 0) + 0) >>> 2];\n const v53 = memory_i32[(((((4 + v51) | 0)) >>> 0) + 0) >>> 2];\n memory_i32[(((v39) >>> 0) + 0) >>> 2] = 0;\n const v54 = ((4 + v39) | 0);\n memory_i32[(((v54) >>> 0) + 0) >>> 2] = 0;\n const v55 = ((4 + v54) | 0);\n memory_i32[(((v55) >>> 0) + 0) >>> 2] = 0;\n const v56 = ((4 + v55) | 0);\n memory_i32[(((v56) >>> 0) + 0) >>> 2] = 0;\n const v57 = ((4 + v56) | 0);\n memory_i32[(((v57) >>> 0) + 0) >>> 2] = 0;\n const v58 = ((4 + v57) | 0);\n memory_i32[(((v58) >>> 0) + 0) >>> 2] = 0;\n const v59 = ((4 + v58) | 0);\n memory_i32[(((v59) >>> 0) + 0) >>> 2] = 0;\n memory_i32[(((((4 + v59) | 0)) >>> 0) + 0) >>> 2] = 0;\n const v60 = memory_i32[(((((16 + Math.imul(2144, v0)) | 0)) >>> 0) + 0) >>> 2];\n const v61 = ((((v19 + v12) | 0) + v4) | 0);\n const v62 = (((v61 >>> 16) | (v61 << (32 - 16))));\n const v63 = ((v62 + 1779033703) | 0);\n const v64 = ((((v63 ^ v12) >>> 12) | ((v63 ^ v12) << (32 - 12))));\n const v65 = ((((v21 + v64) | 0) + v61) | 0);\n const v66 = ((((v65 ^ v62) >>> 8) | ((v65 ^ v62) << (32 - 8))));\n const v67 = ((v66 + v63) | 0);\n const v68 = ((((v67 ^ v64) >>> 7) | ((v67 ^ v64) << (32 - 7))));\n const v69 = ((((v23 + v14) | 0) + v6) | 0);\n const v70 = (((v69 >>> 16) | (v69 << (32 - 16))));\n const v71 = ((v70 + -1150833019) | 0);\n const v72 = ((((v71 ^ v14) >>> 12) | ((v71 ^ v14) << (32 - 12))));\n const v73 = ((((v25 + v72) | 0) + v69) | 0);\n const v74 = ((((v73 ^ v70) >>> 8) | ((v73 ^ v70) << (32 - 8))));\n const v75 = ((v74 + v71) | 0);\n const v76 = ((((v75 ^ v72) >>> 7) | ((v75 ^ v72) << (32 - 7))));\n const v77 = ((((v27 + v16) | 0) + v8) | 0);\n const v78 = ((((v77 ^ 64) >>> 16) | ((v77 ^ 64) << (32 - 16))));\n const v79 = ((v78 + 1013904242) | 0);\n const v80 = ((((v79 ^ v16) >>> 12) | ((v79 ^ v16) << (32 - 12))));\n const v81 = ((((v29 + v80) | 0) + v77) | 0);\n const v82 = ((((v81 ^ v78) >>> 8) | ((v81 ^ v78) << (32 - 8))));\n const v83 = ((v82 + v79) | 0);\n const v84 = ((((v83 ^ v80) >>> 7) | ((v83 ^ v80) << (32 - 7))));\n const v85 = ((((v31 + v17) | 0) + v10) | 0);\n const v86 = ((((v85 ^ (4 | v60)) >>> 16) | ((v85 ^ (4 | v60)) << (32 - 16))));\n const v87 = ((v86 + -1521486534) | 0);\n const v88 = ((((v87 ^ v17) >>> 12) | ((v87 ^ v17) << (32 - 12))));\n const v89 = ((((v32 + v88) | 0) + v85) | 0);\n const v90 = ((((v89 ^ v86) >>> 8) | ((v89 ^ v86) << (32 - 8))));\n const v91 = ((v90 + v87) | 0);\n const v92 = ((((v91 ^ v88) >>> 7) | ((v91 ^ v88) << (32 - 7))));\n const v93 = ((((v40 + v76) | 0) + v65) | 0);\n const v94 = ((((v93 ^ v90) >>> 16) | ((v93 ^ v90) << (32 - 16))));\n const v95 = ((v94 + v83) | 0);\n const v96 = ((((v95 ^ v76) >>> 12) | ((v95 ^ v76) << (32 - 12))));\n const v97 = ((((v42 + v96) | 0) + v93) | 0);\n const v98 = ((((v97 ^ v94) >>> 8) | ((v97 ^ v94) << (32 - 8))));\n const v99 = ((v98 + v95) | 0);\n const v100 = ((((v99 ^ v96) >>> 7) | ((v99 ^ v96) << (32 - 7))));\n const v101 = ((((v44 + v84) | 0) + v73) | 0);\n const v102 = ((((v101 ^ v66) >>> 16) | ((v101 ^ v66) << (32 - 16))));\n const v103 = ((v102 + v91) | 0);\n const v104 = ((((v103 ^ v84) >>> 12) | ((v103 ^ v84) << (32 - 12))));\n const v105 = ((((v46 + v104) | 0) + v101) | 0);\n const v106 = ((((v105 ^ v102) >>> 8) | ((v105 ^ v102) << (32 - 8))));\n const v107 = ((v106 + v103) | 0);\n const v108 = ((((v107 ^ v104) >>> 7) | ((v107 ^ v104) << (32 - 7))));\n const v109 = ((((v48 + v92) | 0) + v81) | 0);\n const v110 = ((((v109 ^ v74) >>> 16) | ((v109 ^ v74) << (32 - 16))));\n const v111 = ((v110 + v67) | 0);\n const v112 = ((((v111 ^ v92) >>> 12) | ((v111 ^ v92) << (32 - 12))));\n const v113 = ((((v50 + v112) | 0) + v109) | 0);\n const v114 = ((((v113 ^ v110) >>> 8) | ((v113 ^ v110) << (32 - 8))));\n const v115 = ((v114 + v111) | 0);\n const v116 = ((((v115 ^ v112) >>> 7) | ((v115 ^ v112) << (32 - 7))));\n const v117 = ((((v52 + v68) | 0) + v89) | 0);\n const v118 = ((((v117 ^ v82) >>> 16) | ((v117 ^ v82) << (32 - 16))));\n const v119 = ((v118 + v75) | 0);\n const v120 = ((((v119 ^ v68) >>> 12) | ((v119 ^ v68) << (32 - 12))));\n const v121 = ((((v53 + v120) | 0) + v117) | 0);\n const v122 = ((((v121 ^ v118) >>> 8) | ((v121 ^ v118) << (32 - 8))));\n const v123 = ((v122 + v119) | 0);\n const v124 = ((((v123 ^ v120) >>> 7) | ((v123 ^ v120) << (32 - 7))));\n const v125 = ((((v23 + v124) | 0) + v97) | 0);\n const v126 = ((((v125 ^ v106) >>> 16) | ((v125 ^ v106) << (32 - 16))));\n const v127 = ((v126 + v115) | 0);\n const v128 = ((((v127 ^ v124) >>> 12) | ((v127 ^ v124) << (32 - 12))));\n const v129 = ((((v31 + v128) | 0) + v125) | 0);\n const v130 = ((((v129 ^ v126) >>> 8) | ((v129 ^ v126) << (32 - 8))));\n const v131 = ((v130 + v127) | 0);\n const v132 = ((((v131 ^ v128) >>> 7) | ((v131 ^ v128) << (32 - 7))));\n const v133 = ((((v25 + v100) | 0) + v105) | 0);\n const v134 = ((((v133 ^ v114) >>> 16) | ((v133 ^ v114) << (32 - 16))));\n const v135 = ((v134 + v123) | 0);\n const v136 = ((((v135 ^ v100) >>> 12) | ((v135 ^ v100) << (32 - 12))));\n const v137 = ((((v44 + v136) | 0) + v133) | 0);\n const v138 = ((((v137 ^ v134) >>> 8) | ((v137 ^ v134) << (32 - 8))));\n const v139 = ((v138 + v135) | 0);\n const v140 = ((((v139 ^ v136) >>> 7) | ((v139 ^ v136) << (32 - 7))));\n const v141 = ((((v32 + v108) | 0) + v113) | 0);\n const v142 = ((((v141 ^ v122) >>> 16) | ((v141 ^ v122) << (32 - 16))));\n const v143 = ((v142 + v99) | 0);\n const v144 = ((((v143 ^ v108) >>> 12) | ((v143 ^ v108) << (32 - 12))));\n const v145 = ((((v19 + v144) | 0) + v141) | 0);\n const v146 = ((((v145 ^ v142) >>> 8) | ((v145 ^ v142) << (32 - 8))));\n const v147 = ((v146 + v143) | 0);\n const v148 = ((((v147 ^ v144) >>> 7) | ((v147 ^ v144) << (32 - 7))));\n const v149 = ((((v27 + v116) | 0) + v121) | 0);\n const v150 = ((((v149 ^ v98) >>> 16) | ((v149 ^ v98) << (32 - 16))));\n const v151 = ((v150 + v107) | 0);\n const v152 = ((((v151 ^ v116) >>> 12) | ((v151 ^ v116) << (32 - 12))));\n const v153 = ((((v50 + v152) | 0) + v149) | 0);\n const v154 = ((((v153 ^ v150) >>> 8) | ((v153 ^ v150) << (32 - 8))));\n const v155 = ((v154 + v151) | 0);\n const v156 = ((((v155 ^ v152) >>> 7) | ((v155 ^ v152) << (32 - 7))));\n const v157 = ((((v21 + v140) | 0) + v129) | 0);\n const v158 = ((((v157 ^ v154) >>> 16) | ((v157 ^ v154) << (32 - 16))));\n const v159 = ((v158 + v147) | 0);\n const v160 = ((((v159 ^ v140) >>> 12) | ((v159 ^ v140) << (32 - 12))));\n const v161 = ((((v46 + v160) | 0) + v157) | 0);\n const v162 = ((((v161 ^ v158) >>> 8) | ((v161 ^ v158) << (32 - 8))));\n const v163 = ((v162 + v159) | 0);\n const v164 = ((((v163 ^ v160) >>> 7) | ((v163 ^ v160) << (32 - 7))));\n const v165 = ((((v48 + v148) | 0) + v137) | 0);\n const v166 = ((((v165 ^ v130) >>> 16) | ((v165 ^ v130) << (32 - 16))));\n const v167 = ((v166 + v155) | 0);\n const v168 = ((((v167 ^ v148) >>> 12) | ((v167 ^ v148) << (32 - 12))));\n const v169 = ((((v29 + v168) | 0) + v165) | 0);\n const v170 = ((((v169 ^ v166) >>> 8) | ((v169 ^ v166) << (32 - 8))));\n const v171 = ((v170 + v167) | 0);\n const v172 = ((((v171 ^ v168) >>> 7) | ((v171 ^ v168) << (32 - 7))));\n const v173 = ((((v42 + v156) | 0) + v145) | 0);\n const v174 = ((((v173 ^ v138) >>> 16) | ((v173 ^ v138) << (32 - 16))));\n const v175 = ((v174 + v131) | 0);\n const v176 = ((((v175 ^ v156) >>> 12) | ((v175 ^ v156) << (32 - 12))));\n const v177 = ((((v52 + v176) | 0) + v173) | 0);\n const v178 = ((((v177 ^ v174) >>> 8) | ((v177 ^ v174) << (32 - 8))));\n const v179 = ((v178 + v175) | 0);\n const v180 = ((((v179 ^ v176) >>> 7) | ((v179 ^ v176) << (32 - 7))));\n const v181 = ((((v53 + v132) | 0) + v153) | 0);\n const v182 = ((((v181 ^ v146) >>> 16) | ((v181 ^ v146) << (32 - 16))));\n const v183 = ((v182 + v139) | 0);\n const v184 = ((((v183 ^ v132) >>> 12) | ((v183 ^ v132) << (32 - 12))));\n const v185 = ((((v40 + v184) | 0) + v181) | 0);\n const v186 = ((((v185 ^ v182) >>> 8) | ((v185 ^ v182) << (32 - 8))));\n const v187 = ((v186 + v183) | 0);\n const v188 = ((((v187 ^ v184) >>> 7) | ((v187 ^ v184) << (32 - 7))));\n const v189 = ((((v25 + v188) | 0) + v161) | 0);\n const v190 = ((((v189 ^ v170) >>> 16) | ((v189 ^ v170) << (32 - 16))));\n const v191 = ((v190 + v179) | 0);\n const v192 = ((((v191 ^ v188) >>> 12) | ((v191 ^ v188) << (32 - 12))));\n const v193 = ((((v27 + v192) | 0) + v189) | 0);\n const v194 = ((((v193 ^ v190) >>> 8) | ((v193 ^ v190) << (32 - 8))));\n const v195 = ((v194 + v191) | 0);\n const v196 = ((((v195 ^ v192) >>> 7) | ((v195 ^ v192) << (32 - 7))));\n const v197 = ((((v44 + v164) | 0) + v169) | 0);\n const v198 = ((((v197 ^ v178) >>> 16) | ((v197 ^ v178) << (32 - 16))));\n const v199 = ((v198 + v187) | 0);\n const v200 = ((((v199 ^ v164) >>> 12) | ((v199 ^ v164) << (32 - 12))));\n const v201 = ((((v48 + v200) | 0) + v197) | 0);\n const v202 = ((((v201 ^ v198) >>> 8) | ((v201 ^ v198) << (32 - 8))));\n const v203 = ((v202 + v199) | 0);\n const v204 = ((((v203 ^ v200) >>> 7) | ((v203 ^ v200) << (32 - 7))));\n const v205 = ((((v50 + v172) | 0) + v177) | 0);\n const v206 = ((((v205 ^ v186) >>> 16) | ((v205 ^ v186) << (32 - 16))));\n const v207 = ((v206 + v163) | 0);\n const v208 = ((((v207 ^ v172) >>> 12) | ((v207 ^ v172) << (32 - 12))));\n const v209 = ((((v23 + v208) | 0) + v205) | 0);\n const v210 = ((((v209 ^ v206) >>> 8) | ((v209 ^ v206) << (32 - 8))));\n const v211 = ((v210 + v207) | 0);\n const v212 = ((((v211 ^ v208) >>> 7) | ((v211 ^ v208) << (32 - 7))));\n const v213 = ((((v32 + v180) | 0) + v185) | 0);\n const v214 = ((((v213 ^ v162) >>> 16) | ((v213 ^ v162) << (32 - 16))));\n const v215 = ((v214 + v171) | 0);\n const v216 = ((((v215 ^ v180) >>> 12) | ((v215 ^ v180) << (32 - 12))));\n const v217 = ((((v52 + v216) | 0) + v213) | 0);\n const v218 = ((((v217 ^ v214) >>> 8) | ((v217 ^ v214) << (32 - 8))));\n const v219 = ((v218 + v215) | 0);\n const v220 = ((((v219 ^ v216) >>> 7) | ((v219 ^ v216) << (32 - 7))));\n const v221 = ((((v31 + v204) | 0) + v193) | 0);\n const v222 = ((((v221 ^ v218) >>> 16) | ((v221 ^ v218) << (32 - 16))));\n const v223 = ((v222 + v211) | 0);\n const v224 = ((((v223 ^ v204) >>> 12) | ((v223 ^ v204) << (32 - 12))));\n const v225 = ((((v29 + v224) | 0) + v221) | 0);\n const v226 = ((((v225 ^ v222) >>> 8) | ((v225 ^ v222) << (32 - 8))));\n const v227 = ((v226 + v223) | 0);\n const v228 = ((((v227 ^ v224) >>> 7) | ((v227 ^ v224) << (32 - 7))));\n const v229 = ((((v42 + v212) | 0) + v201) | 0);\n const v230 = ((((v229 ^ v194) >>> 16) | ((v229 ^ v194) << (32 - 16))));\n const v231 = ((v230 + v219) | 0);\n const v232 = ((((v231 ^ v212) >>> 12) | ((v231 ^ v212) << (32 - 12))));\n const v233 = ((((v19 + v232) | 0) + v229) | 0);\n const v234 = ((((v233 ^ v230) >>> 8) | ((v233 ^ v230) << (32 - 8))));\n const v235 = ((v234 + v231) | 0);\n const v236 = ((((v235 ^ v232) >>> 7) | ((v235 ^ v232) << (32 - 7))));\n const v237 = ((((v46 + v220) | 0) + v209) | 0);\n const v238 = ((((v237 ^ v202) >>> 16) | ((v237 ^ v202) << (32 - 16))));\n const v239 = ((v238 + v195) | 0);\n const v240 = ((((v239 ^ v220) >>> 12) | ((v239 ^ v220) << (32 - 12))));\n const v241 = ((((v53 + v240) | 0) + v237) | 0);\n const v242 = ((((v241 ^ v238) >>> 8) | ((v241 ^ v238) << (32 - 8))));\n const v243 = ((v242 + v239) | 0);\n const v244 = ((((v243 ^ v240) >>> 7) | ((v243 ^ v240) << (32 - 7))));\n const v245 = ((((v40 + v196) | 0) + v217) | 0);\n const v246 = ((((v245 ^ v210) >>> 16) | ((v245 ^ v210) << (32 - 16))));\n const v247 = ((v246 + v203) | 0);\n const v248 = ((((v247 ^ v196) >>> 12) | ((v247 ^ v196) << (32 - 12))));\n const v249 = ((((v21 + v248) | 0) + v245) | 0);\n const v250 = ((((v249 ^ v246) >>> 8) | ((v249 ^ v246) << (32 - 8))));\n const v251 = ((v250 + v247) | 0);\n const v252 = ((((v251 ^ v248) >>> 7) | ((v251 ^ v248) << (32 - 7))));\n const v253 = ((((v44 + v252) | 0) + v225) | 0);\n const v254 = ((((v253 ^ v234) >>> 16) | ((v253 ^ v234) << (32 - 16))));\n const v255 = ((v254 + v243) | 0);\n const v256 = ((((v255 ^ v252) >>> 12) | ((v255 ^ v252) << (32 - 12))));\n const v257 = ((((v32 + v256) | 0) + v253) | 0);\n const v258 = ((((v257 ^ v254) >>> 8) | ((v257 ^ v254) << (32 - 8))));\n const v259 = ((v258 + v255) | 0);\n const v260 = ((((v259 ^ v256) >>> 7) | ((v259 ^ v256) << (32 - 7))));\n const v261 = ((((v48 + v228) | 0) + v233) | 0);\n const v262 = ((((v261 ^ v242) >>> 16) | ((v261 ^ v242) << (32 - 16))));\n const v263 = ((v262 + v251) | 0);\n const v264 = ((((v263 ^ v228) >>> 12) | ((v263 ^ v228) << (32 - 12))));\n const v265 = ((((v42 + v264) | 0) + v261) | 0);\n const v266 = ((((v265 ^ v262) >>> 8) | ((v265 ^ v262) << (32 - 8))));\n const v267 = ((v266 + v263) | 0);\n const v268 = ((((v267 ^ v264) >>> 7) | ((v267 ^ v264) << (32 - 7))));\n const v269 = ((((v52 + v236) | 0) + v241) | 0);\n const v270 = ((((v269 ^ v250) >>> 16) | ((v269 ^ v250) << (32 - 16))));\n const v271 = ((v270 + v227) | 0);\n const v272 = ((((v271 ^ v236) >>> 12) | ((v271 ^ v236) << (32 - 12))));\n const v273 = ((((v25 + v272) | 0) + v269) | 0);\n const v274 = ((((v273 ^ v270) >>> 8) | ((v273 ^ v270) << (32 - 8))));\n const v275 = ((v274 + v271) | 0);\n const v276 = ((((v275 ^ v272) >>> 7) | ((v275 ^ v272) << (32 - 7))));\n const v277 = ((((v50 + v244) | 0) + v249) | 0);\n const v278 = ((((v277 ^ v226) >>> 16) | ((v277 ^ v226) << (32 - 16))));\n const v279 = ((v278 + v235) | 0);\n const v280 = ((((v279 ^ v244) >>> 12) | ((v279 ^ v244) << (32 - 12))));\n const v281 = ((((v53 + v280) | 0) + v277) | 0);\n const v282 = ((((v281 ^ v278) >>> 8) | ((v281 ^ v278) << (32 - 8))));\n const v283 = ((v282 + v279) | 0);\n const v284 = ((((v283 ^ v280) >>> 7) | ((v283 ^ v280) << (32 - 7))));\n const v285 = ((((v27 + v268) | 0) + v257) | 0);\n const v286 = ((((v285 ^ v282) >>> 16) | ((v285 ^ v282) << (32 - 16))));\n const v287 = ((v286 + v275) | 0);\n const v288 = ((((v287 ^ v268) >>> 12) | ((v287 ^ v268) << (32 - 12))));\n const v289 = ((((v19 + v288) | 0) + v285) | 0);\n const v290 = ((((v289 ^ v286) >>> 8) | ((v289 ^ v286) << (32 - 8))));\n const v291 = ((v290 + v287) | 0);\n const v292 = ((((v291 ^ v288) >>> 7) | ((v291 ^ v288) << (32 - 7))));\n const v293 = ((((v46 + v276) | 0) + v265) | 0);\n const v294 = ((((v293 ^ v258) >>> 16) | ((v293 ^ v258) << (32 - 16))));\n const v295 = ((v294 + v283) | 0);\n const v296 = ((((v295 ^ v276) >>> 12) | ((v295 ^ v276) << (32 - 12))));\n const v297 = ((((v23 + v296) | 0) + v293) | 0);\n const v298 = ((((v297 ^ v294) >>> 8) | ((v297 ^ v294) << (32 - 8))));\n const v299 = ((v298 + v295) | 0);\n const v300 = ((((v299 ^ v296) >>> 7) | ((v299 ^ v296) << (32 - 7))));\n const v301 = ((((v29 + v284) | 0) + v273) | 0);\n const v302 = ((((v301 ^ v266) >>> 16) | ((v301 ^ v266) << (32 - 16))));\n const v303 = ((v302 + v259) | 0);\n const v304 = ((((v303 ^ v284) >>> 12) | ((v303 ^ v284) << (32 - 12))));\n const v305 = ((((v40 + v304) | 0) + v301) | 0);\n const v306 = ((((v305 ^ v302) >>> 8) | ((v305 ^ v302) << (32 - 8))));\n const v307 = ((v306 + v303) | 0);\n const v308 = ((((v307 ^ v304) >>> 7) | ((v307 ^ v304) << (32 - 7))));\n const v309 = ((((v21 + v260) | 0) + v281) | 0);\n const v310 = ((((v309 ^ v274) >>> 16) | ((v309 ^ v274) << (32 - 16))));\n const v311 = ((v310 + v267) | 0);\n const v312 = ((((v311 ^ v260) >>> 12) | ((v311 ^ v260) << (32 - 12))));\n const v313 = ((((v31 + v312) | 0) + v309) | 0);\n const v314 = ((((v313 ^ v310) >>> 8) | ((v313 ^ v310) << (32 - 8))));\n const v315 = ((v314 + v311) | 0);\n const v316 = ((((v315 ^ v312) >>> 7) | ((v315 ^ v312) << (32 - 7))));\n const v317 = ((((v48 + v316) | 0) + v289) | 0);\n const v318 = ((((v317 ^ v298) >>> 16) | ((v317 ^ v298) << (32 - 16))));\n const v319 = ((v318 + v307) | 0);\n const v320 = ((((v319 ^ v316) >>> 12) | ((v319 ^ v316) << (32 - 12))));\n const v321 = ((((v50 + v320) | 0) + v317) | 0);\n const v322 = ((((v321 ^ v318) >>> 8) | ((v321 ^ v318) << (32 - 8))));\n const v323 = ((v322 + v319) | 0);\n const v324 = ((((v323 ^ v320) >>> 7) | ((v323 ^ v320) << (32 - 7))));\n const v325 = ((((v42 + v292) | 0) + v297) | 0);\n const v326 = ((((v325 ^ v306) >>> 16) | ((v325 ^ v306) << (32 - 16))));\n const v327 = ((v326 + v315) | 0);\n const v328 = ((((v327 ^ v292) >>> 12) | ((v327 ^ v292) << (32 - 12))));\n const v329 = ((((v46 + v328) | 0) + v325) | 0);\n const v330 = ((((v329 ^ v326) >>> 8) | ((v329 ^ v326) << (32 - 8))));\n const v331 = ((v330 + v327) | 0);\n const v332 = ((((v331 ^ v328) >>> 7) | ((v331 ^ v328) << (32 - 7))));\n const v333 = ((((v53 + v300) | 0) + v305) | 0);\n const v334 = ((((v333 ^ v314) >>> 16) | ((v333 ^ v314) << (32 - 16))));\n const v335 = ((v334 + v291) | 0);\n const v336 = ((((v335 ^ v300) >>> 12) | ((v335 ^ v300) << (32 - 12))));\n const v337 = ((((v44 + v336) | 0) + v333) | 0);\n const v338 = ((((v337 ^ v334) >>> 8) | ((v337 ^ v334) << (32 - 8))));\n const v339 = ((v338 + v335) | 0);\n const v340 = ((((v339 ^ v336) >>> 7) | ((v339 ^ v336) << (32 - 7))));\n const v341 = ((((v52 + v308) | 0) + v313) | 0);\n const v342 = ((((v341 ^ v290) >>> 16) | ((v341 ^ v290) << (32 - 16))));\n const v343 = ((v342 + v299) | 0);\n const v344 = ((((v343 ^ v308) >>> 12) | ((v343 ^ v308) << (32 - 12))));\n const v345 = ((((v40 + v344) | 0) + v341) | 0);\n const v346 = ((((v345 ^ v342) >>> 8) | ((v345 ^ v342) << (32 - 8))));\n const v347 = ((v346 + v343) | 0);\n const v348 = ((((v347 ^ v344) >>> 7) | ((v347 ^ v344) << (32 - 7))));\n const v349 = ((((v32 + v332) | 0) + v321) | 0);\n const v350 = ((((v349 ^ v346) >>> 16) | ((v349 ^ v346) << (32 - 16))));\n const v351 = ((v350 + v339) | 0);\n const v352 = ((((v351 ^ v332) >>> 12) | ((v351 ^ v332) << (32 - 12))));\n const v353 = ((((v23 + v352) | 0) + v349) | 0);\n const v354 = ((((v353 ^ v350) >>> 8) | ((v353 ^ v350) << (32 - 8))));\n const v355 = ((v354 + v351) | 0);\n const v356 = ((((v355 ^ v352) >>> 7) | ((v355 ^ v352) << (32 - 7))));\n const v357 = ((((v29 + v340) | 0) + v329) | 0);\n const v358 = ((((v357 ^ v322) >>> 16) | ((v357 ^ v322) << (32 - 16))));\n const v359 = ((v358 + v347) | 0);\n const v360 = ((((v359 ^ v340) >>> 12) | ((v359 ^ v340) << (32 - 12))));\n const v361 = ((((v25 + v360) | 0) + v357) | 0);\n const v362 = ((((v361 ^ v358) >>> 8) | ((v361 ^ v358) << (32 - 8))));\n const v363 = ((v362 + v359) | 0);\n const v364 = ((((v363 ^ v360) >>> 7) | ((v363 ^ v360) << (32 - 7))));\n const v365 = ((((v19 + v348) | 0) + v337) | 0);\n const v366 = ((((v365 ^ v330) >>> 16) | ((v365 ^ v330) << (32 - 16))));\n const v367 = ((v366 + v323) | 0);\n const v368 = ((((v367 ^ v348) >>> 12) | ((v367 ^ v348) << (32 - 12))));\n const v369 = ((((v21 + v368) | 0) + v365) | 0);\n const v370 = ((((v369 ^ v366) >>> 8) | ((v369 ^ v366) << (32 - 8))));\n const v371 = ((v370 + v367) | 0);\n const v372 = ((((v371 ^ v368) >>> 7) | ((v371 ^ v368) << (32 - 7))));\n const v373 = ((((v31 + v324) | 0) + v345) | 0);\n const v374 = ((((v373 ^ v338) >>> 16) | ((v373 ^ v338) << (32 - 16))));\n const v375 = ((v374 + v331) | 0);\n const v376 = ((((v375 ^ v324) >>> 12) | ((v375 ^ v324) << (32 - 12))));\n const v377 = ((((v27 + v376) | 0) + v373) | 0);\n const v378 = ((((v377 ^ v374) >>> 8) | ((v377 ^ v374) << (32 - 8))));\n const v379 = ((v378 + v375) | 0);\n const v380 = ((((v379 ^ v376) >>> 7) | ((v379 ^ v376) << (32 - 7))));\n const v381 = ((((v42 + v380) | 0) + v353) | 0);\n const v382 = ((((v381 ^ v362) >>> 16) | ((v381 ^ v362) << (32 - 16))));\n const v383 = ((v382 + v371) | 0);\n const v384 = ((((v383 ^ v380) >>> 12) | ((v383 ^ v380) << (32 - 12))));\n const v385 = ((((v52 + v384) | 0) + v381) | 0);\n const v386 = ((((v385 ^ v382) >>> 8) | ((v385 ^ v382) << (32 - 8))));\n const v387 = ((v386 + v383) | 0);\n const v388 = ((((v387 ^ v384) >>> 7) | ((v387 ^ v384) << (32 - 7))));\n const v389 = ((((v46 + v356) | 0) + v361) | 0);\n const v390 = ((((v389 ^ v370) >>> 16) | ((v389 ^ v370) << (32 - 16))));\n const v391 = ((v390 + v379) | 0);\n const v392 = ((((v391 ^ v356) >>> 12) | ((v391 ^ v356) << (32 - 12))));\n const v393 = ((((v29 + v392) | 0) + v389) | 0);\n const v394 = ((((v393 ^ v390) >>> 8) | ((v393 ^ v390) << (32 - 8))));\n const v395 = ((v394 + v391) | 0);\n const v396 = ((((v395 ^ v392) >>> 7) | ((v395 ^ v392) << (32 - 7))));\n const v397 = ((((v40 + v364) | 0) + v369) | 0);\n const v398 = ((((v397 ^ v378) >>> 16) | ((v397 ^ v378) << (32 - 16))));\n const v399 = ((v398 + v355) | 0);\n const v400 = ((((v399 ^ v364) >>> 12) | ((v399 ^ v364) << (32 - 12))));\n const v401 = ((((v48 + v400) | 0) + v397) | 0);\n const v402 = ((((v401 ^ v398) >>> 8) | ((v401 ^ v398) << (32 - 8))));\n const v403 = ((v402 + v399) | 0);\n const v404 = ((((v403 ^ v400) >>> 7) | ((v403 ^ v400) << (32 - 7))));\n const v405 = ((((v53 + v372) | 0) + v377) | 0);\n const v406 = ((((v405 ^ v354) >>> 16) | ((v405 ^ v354) << (32 - 16))));\n const v407 = ((v406 + v363) | 0);\n const v408 = ((((v407 ^ v372) >>> 12) | ((v407 ^ v372) << (32 - 12))));\n const v409 = ((((v21 + v408) | 0) + v405) | 0);\n const v410 = ((((v409 ^ v406) >>> 8) | ((v409 ^ v406) << (32 - 8))));\n const v411 = ((v410 + v407) | 0);\n const v412 = ((((v411 ^ v408) >>> 7) | ((v411 ^ v408) << (32 - 7))));\n const v413 = ((((v50 + v396) | 0) + v385) | 0);\n const v414 = ((((v413 ^ v410) >>> 16) | ((v413 ^ v410) << (32 - 16))));\n const v415 = ((v414 + v403) | 0);\n const v416 = ((((v415 ^ v396) >>> 12) | ((v415 ^ v396) << (32 - 12))));\n const v417 = ((((v25 + v416) | 0) + v413) | 0);\n const v418 = ((((v417 ^ v414) >>> 8) | ((v417 ^ v414) << (32 - 8))));\n const v419 = ((v418 + v415) | 0);\n const v420 = ((((v419 ^ v416) >>> 7) | ((v419 ^ v416) << (32 - 7))));\n const v421 = ((((v19 + v404) | 0) + v393) | 0);\n const v422 = ((((v421 ^ v386) >>> 16) | ((v421 ^ v386) << (32 - 16))));\n const v423 = ((v422 + v411) | 0);\n const v424 = ((((v423 ^ v404) >>> 12) | ((v423 ^ v404) << (32 - 12))));\n const v425 = ((((v44 + v424) | 0) + v421) | 0);\n const v426 = ((((v425 ^ v422) >>> 8) | ((v425 ^ v422) << (32 - 8))));\n const v427 = ((v426 + v423) | 0);\n const v428 = ((((v427 ^ v424) >>> 7) | ((v427 ^ v424) << (32 - 7))));\n const v429 = ((((v23 + v412) | 0) + v401) | 0);\n const v430 = ((((v429 ^ v394) >>> 16) | ((v429 ^ v394) << (32 - 16))));\n const v431 = ((v430 + v387) | 0);\n const v432 = ((((v431 ^ v412) >>> 12) | ((v431 ^ v412) << (32 - 12))));\n const v433 = ((((v31 + v432) | 0) + v429) | 0);\n const v434 = ((((v433 ^ v430) >>> 8) | ((v433 ^ v430) << (32 - 8))));\n const v435 = ((v434 + v431) | 0);\n const v436 = ((((v435 ^ v432) >>> 7) | ((v435 ^ v432) << (32 - 7))));\n const v437 = ((((v27 + v388) | 0) + v409) | 0);\n const v438 = ((((v437 ^ v402) >>> 16) | ((v437 ^ v402) << (32 - 16))));\n const v439 = ((v438 + v395) | 0);\n const v440 = ((((v439 ^ v388) >>> 12) | ((v439 ^ v388) << (32 - 12))));\n const v441 = ((((v32 + v440) | 0) + v437) | 0);\n const v442 = ((((v441 ^ v438) >>> 8) | ((v441 ^ v438) << (32 - 8))));\n const v443 = ((v442 + v439) | 0);\n const v444 = ((((v443 ^ v440) >>> 7) | ((v443 ^ v440) << (32 - 7))));\n const v445 = ((((v46 + v444) | 0) + v417) | 0);\n const v446 = ((((v445 ^ v426) >>> 16) | ((v445 ^ v426) << (32 - 16))));\n const v447 = ((v446 + v435) | 0);\n const v448 = ((((v447 ^ v444) >>> 12) | ((v447 ^ v444) << (32 - 12))));\n const v449 = ((((v53 + v448) | 0) + v445) | 0);\n const v450 = ((((v449 ^ v446) >>> 8) | ((v449 ^ v446) << (32 - 8))));\n const v451 = ((v450 + v447) | 0);\n const v452 = ((((v451 ^ v448) >>> 7) | ((v451 ^ v448) << (32 - 7))));\n const v453 = ((((v29 + v420) | 0) + v425) | 0);\n const v454 = ((((v453 ^ v434) >>> 16) | ((v453 ^ v434) << (32 - 16))));\n const v455 = ((v454 + v443) | 0);\n const v456 = ((((v455 ^ v420) >>> 12) | ((v455 ^ v420) << (32 - 12))));\n const v457 = ((((v19 + v456) | 0) + v453) | 0);\n const v458 = ((((v457 ^ v454) >>> 8) | ((v457 ^ v454) << (32 - 8))));\n const v459 = ((v458 + v455) | 0);\n const v460 = ((((v459 ^ v456) >>> 7) | ((v459 ^ v456) << (32 - 7))));\n const v461 = ((((v21 + v428) | 0) + v433) | 0);\n const v462 = ((((v461 ^ v442) >>> 16) | ((v461 ^ v442) << (32 - 16))));\n const v463 = ((v462 + v419) | 0);\n const v464 = ((((v463 ^ v428) >>> 12) | ((v463 ^ v428) << (32 - 12))));\n const v465 = ((((v42 + v464) | 0) + v461) | 0);\n const v466 = ((((v465 ^ v462) >>> 8) | ((v465 ^ v462) << (32 - 8))));\n const v467 = ((v466 + v463) | 0);\n const v468 = ((((v467 ^ v464) >>> 7) | ((v467 ^ v464) << (32 - 7))));\n const v469 = ((((v40 + v436) | 0) + v441) | 0);\n const v470 = ((((v469 ^ v418) >>> 16) | ((v469 ^ v418) << (32 - 16))));\n const v471 = ((v470 + v427) | 0);\n const v472 = ((((v471 ^ v436) >>> 12) | ((v471 ^ v436) << (32 - 12))));\n const v473 = ((((v31 + v472) | 0) + v469) | 0);\n const v474 = ((((v473 ^ v470) >>> 8) | ((v473 ^ v470) << (32 - 8))));\n const v475 = ((v474 + v471) | 0);\n const v476 = ((((v475 ^ v472) >>> 7) | ((v475 ^ v472) << (32 - 7))));\n const v477 = ((((v52 + v460) | 0) + v449) | 0);\n const v478 = ((((v477 ^ v474) >>> 16) | ((v477 ^ v474) << (32 - 16))));\n const v479 = ((v478 + v467) | 0);\n const v480 = ((((v479 ^ v460) >>> 12) | ((v479 ^ v460) << (32 - 12))));\n const v481 = ((((v44 + v480) | 0) + v477) | 0);\n const v482 = ((((v481 ^ v478) >>> 8) | ((v481 ^ v478) << (32 - 8))));\n const v483 = ((v482 + v479) | 0);\n const v484 = ((((v23 + v468) | 0) + v457) | 0);\n const v485 = ((((v484 ^ v450) >>> 16) | ((v484 ^ v450) << (32 - 16))));\n const v486 = ((v485 + v475) | 0);\n const v487 = ((((v486 ^ v468) >>> 12) | ((v486 ^ v468) << (32 - 12))));\n const v488 = ((((v48 + v487) | 0) + v484) | 0);\n const v489 = ((((v488 ^ v485) >>> 8) | ((v488 ^ v485) << (32 - 8))));\n const v490 = ((v489 + v486) | 0);\n const v491 = ((((v25 + v476) | 0) + v465) | 0);\n const v492 = ((((v491 ^ v458) >>> 16) | ((v491 ^ v458) << (32 - 16))));\n const v493 = ((v492 + v451) | 0);\n const v494 = ((((v493 ^ v476) >>> 12) | ((v493 ^ v476) << (32 - 12))));\n const v495 = ((((v27 + v494) | 0) + v491) | 0);\n const v496 = ((((v495 ^ v492) >>> 8) | ((v495 ^ v492) << (32 - 8))));\n const v497 = ((v496 + v493) | 0);\n const v498 = ((((v32 + v452) | 0) + v473) | 0);\n const v499 = ((((v498 ^ v466) >>> 16) | ((v498 ^ v466) << (32 - 16))));\n const v500 = ((v499 + v459) | 0);\n const v501 = ((((v500 ^ v452) >>> 12) | ((v500 ^ v452) << (32 - 12))));\n const v502 = ((((v50 + v501) | 0) + v498) | 0);\n const v503 = ((((v502 ^ v499) >>> 8) | ((v502 ^ v499) << (32 - 8))));\n const v504 = ((v503 + v500) | 0);\n const v505 = ((((96 + (v2 << 5)) | 0) + Math.imul(2144, v0)) | 0);\n memory_i32[(((v505) >>> 0) + 0) >>> 2] = (v497 ^ v481);\n const v506 = ((4 + v505) | 0);\n memory_i32[(((v506) >>> 0) + 0) >>> 2] = (v504 ^ v488);\n const v507 = ((4 + v506) | 0);\n memory_i32[(((v507) >>> 0) + 0) >>> 2] = (v483 ^ v495);\n const v508 = ((4 + v507) | 0);\n memory_i32[(((v508) >>> 0) + 0) >>> 2] = (v490 ^ v502);\n const v509 = ((4 + v508) | 0);\n memory_i32[(((v509) >>> 0) + 0) >>> 2] = (v489 ^ ((((v504 ^ v501) >>> 7) | ((v504 ^ v501) << (32 - 7)))));\n const v510 = ((4 + v509) | 0);\n memory_i32[(((v510) >>> 0) + 0) >>> 2] = (v496 ^ ((((v483 ^ v480) >>> 7) | ((v483 ^ v480) << (32 - 7)))));\n const v511 = ((4 + v510) | 0);\n memory_i32[(((v511) >>> 0) + 0) >>> 2] = (v503 ^ ((((v490 ^ v487) >>> 7) | ((v490 ^ v487) << (32 - 7)))));\n memory_i32[(((((4 + v511) | 0)) >>> 0) + 0) >>> 2] = (v482 ^ ((((v497 ^ v494) >>> 7) | ((v497 ^ v494) << (32 - 7)))));\n return;\n }\n function compressParentsFull(v0, v1) {\n const v2 = Math.imul(2144, v0);\n const v3 = memory_i32[(((((24 + Math.imul(2144, v0)) | 0)) >>> 0) + 0) >>> 2];\n const v4 = memory_i32[(((v2) >>> 0) + 0) >>> 2];\n const v5 = memory_i32[(((v2) >>> 0) + 4) >>> 2];\n const v6 = ((1 + v4) | 0);\n let s0 = v6, s1 = ((((((-1 ^ v6) & (1 | v4)) | (1 & v4)) >>> 31) + v5) | 0), s2 = v3;\n L0: {\n const v7 = s0;\n const v8 = s1;\n const v9 = s2;\n if ((((((((((((1 & v7)) | 0) === ((0) | 0)) | 0) | v1) & ((((v9) | 0) !== ((0) | 0)) | 0))) | 0) === 0) | 0)) {\n s0 = v7;\n s1 = v8;\n s2 = v9;\n break L0;\n }\n let s3 = v7, s4 = v8, s5 = v9;\n L1: {\n const v10 = s3;\n const v11 = s4;\n const v12 = s5;\n let s6 = v10, s7 = v11, s8 = v12;\n L2: for (;;) {\n const v13 = s6;\n const v14 = s7;\n const v15 = s8;\n let s9 = v13, s10 = v14, s11 = v15;\n L3: {\n const v16 = s9;\n const v17 = s10;\n const v18 = s11;\n const v19 = ((v18 - 1) | 0);\n if ((((((v19) | 0) === ((0) | 0)) | 0) & v1)) {\n s3 = v16;\n s4 = v17;\n s5 = v19;\n break L1;\n }\n compressParents(v0, v19, v19);\n s9 = v16;\n s10 = v17;\n s11 = v19;\n }\n const v16 = s9;\n const v17 = s10;\n const v18 = s11;\n const v20 = ((v17 << 31) | (v16 >>> 1));\n const v21 = (v17 >>> 1);\n if ((((((((1 & v20)) | 0) === ((0) | 0)) | 0) | v1) & ((((v18) | 0) !== ((0) | 0)) | 0))) {\n s6 = v20;\n s7 = v21;\n s8 = v18;\n continue L2;\n }\n s6 = v20;\n s7 = v21;\n s8 = v18;\n break L2;\n }\n const v13 = s6;\n const v14 = s7;\n const v15 = s8;\n s3 = v13;\n s4 = v14;\n s5 = v15;\n }\n const v10 = s3;\n const v11 = s4;\n const v12 = s5;\n s0 = v10;\n s1 = v11;\n s2 = v12;\n }\n const v9 = s2;\n const v22 = Math.imul(2144, v0);\n const v23 = Math.imul(2144, v0);\n const v24 = memory_i32[(((v22) >>> 0) + 0) >>> 2];\n const v25 = memory_i32[(((v22) >>> 0) + 4) >>> 2];\n const v26 = ((1 + v24) | 0);\n memory_i32[(((v23) >>> 0) + 0) >>> 2] = v26;\n memory_i32[(((v23) >>> 0) + 4) >>> 2] = ((((((-1 ^ v26) & (1 | v24)) | (1 & v24)) >>> 31) + v25) | 0);\n memory_i32[(((((24 + Math.imul(2144, v0)) | 0)) >>> 0) + 0) >>> 2] = ((1 + v9) | 0);\n return;\n }\n function padding(v0, v1, v2, v3, v4, v5) {\n memory.fill(0, ((((((2144 + v1) | 0) + (Math.imul(v2, v0) << 6)) | 0)) >>> 0), ((((((2144 + v1) | 0) + (Math.imul(v2, v0) << 6)) | 0)) >>> 0) + ((((((((v1) | 0) === 0) | 0)) ? (v4) : (v3))) >>> 0));\n return 0;\n }\n function proccessChunksParallel(v0, v1, v2, v3, v4, v5, v6, v7) {\n let s0 = 0;\n L0: {\n const v8 = s0;\n if (((((((((v8) >>> 0) < ((v1) >>> 0)) | 0)) | 0) === 0) | 0)) {\n s0 = v8;\n break L0;\n }\n let s1 = v8;\n L1: {\n const v9 = s1;\n let s2 = v9;\n L2: for (;;) {\n const v10 = s2;\n let s3 = v10;\n L3: {\n const v11 = s3;\n const v12 = ((v11 + v0) | 0);\n const v13 = ((32 + Math.imul(2144, v12)) | 0);\n const v14 = ((64 + Math.imul(2144, v12)) | 0);\n const v15 = memory_i32[(((v13) >>> 0) + 0) >>> 2];\n const v16 = ((4 + v13) | 0);\n const v17 = memory_i32[(((v16) >>> 0) + 0) >>> 2];\n const v18 = ((4 + v16) | 0);\n const v19 = memory_i32[(((v18) >>> 0) + 0) >>> 2];\n const v20 = ((4 + v18) | 0);\n const v21 = memory_i32[(((v20) >>> 0) + 0) >>> 2];\n const v22 = ((4 + v20) | 0);\n const v23 = memory_i32[(((v22) >>> 0) + 0) >>> 2];\n const v24 = ((4 + v22) | 0);\n const v25 = memory_i32[(((v24) >>> 0) + 0) >>> 2];\n const v26 = ((4 + v24) | 0);\n const v27 = memory_i32[(((v26) >>> 0) + 0) >>> 2];\n const v28 = memory_i32[(((((4 + v26) | 0)) >>> 0) + 0) >>> 2];\n const v29 = memory_i32[(((((20 + Math.imul(2144, v12)) | 0)) >>> 0) + 0) >>> 2];\n const v30 = Math.imul(2144, v12);\n const v31 = memory_i32[(((((16 + Math.imul(2144, v12)) | 0)) >>> 0) + 0) >>> 2];\n const v32 = memory_i32[(((v14) >>> 0) + 0) >>> 2];\n const v33 = ((4 + v14) | 0);\n const v34 = memory_i32[(((v33) >>> 0) + 0) >>> 2];\n const v35 = ((4 + v33) | 0);\n const v36 = memory_i32[(((v35) >>> 0) + 0) >>> 2];\n const v37 = ((4 + v35) | 0);\n const v38 = memory_i32[(((v37) >>> 0) + 0) >>> 2];\n const v39 = ((4 + v37) | 0);\n const v40 = memory_i32[(((v39) >>> 0) + 0) >>> 2];\n const v41 = ((4 + v39) | 0);\n const v42 = memory_i32[(((v41) >>> 0) + 0) >>> 2];\n const v43 = ((4 + v41) | 0);\n const v44 = memory_i32[(((v43) >>> 0) + 0) >>> 2];\n const v45 = memory_i32[(((((4 + v43) | 0)) >>> 0) + 0) >>> 2];\n const v46 = memory_i32[(((v30) >>> 0) + 0) >>> 2];\n const v47 = memory_i32[(((v30) >>> 0) + 4) >>> 2];\n let s4 = 0, s5 = 0, s6 = v32, s7 = v34, s8 = v36, s9 = v38, s10 = v40, s11 = v42, s12 = v44, s13 = v45, s14 = v29;\n L4: {\n const v48 = s4;\n const v49 = s5;\n const v50 = s6;\n const v51 = s7;\n const v52 = s8;\n const v53 = s9;\n const v54 = s10;\n const v55 = s11;\n const v56 = s12;\n const v57 = s13;\n const v58 = s14;\n if (((((((((v48) >>> 0) < ((v2) >>> 0)) | 0)) | 0) === 0) | 0)) {\n s4 = v48;\n s5 = v49;\n s6 = v50;\n s7 = v51;\n s8 = v52;\n s9 = v53;\n s10 = v54;\n s11 = v55;\n s12 = v56;\n s13 = v57;\n s14 = v58;\n break L4;\n }\n let s15 = v48, s16 = v49, s17 = v50, s18 = v51, s19 = v52, s20 = v53, s21 = v54, s22 = v55, s23 = v56, s24 = v57, s25 = v58;\n L5: {\n const v59 = s15;\n const v60 = s16;\n const v61 = s17;\n const v62 = s18;\n const v63 = s19;\n const v64 = s20;\n const v65 = s21;\n const v66 = s22;\n const v67 = s23;\n const v68 = s24;\n const v69 = s25;\n let s26 = v59, s27 = v60, s28 = v61, s29 = v62, s30 = v63, s31 = v64, s32 = v65, s33 = v66, s34 = v67, s35 = v68, s36 = v69;\n L6: for (;;) {\n const v70 = s26;\n const v71 = s27;\n const v72 = s28;\n const v73 = s29;\n const v74 = s30;\n const v75 = s31;\n const v76 = s32;\n const v77 = s33;\n const v78 = s34;\n const v79 = s35;\n const v80 = s36;\n let s37 = v70, s38 = v71, s39 = v72, s40 = v73, s41 = v74, s42 = v75, s43 = v76, s44 = v77, s45 = v78, s46 = v79, s47 = v80;\n L7: {\n const v81 = s37;\n const v82 = s38;\n const v83 = s39;\n const v84 = s40;\n const v85 = s41;\n const v86 = s42;\n const v87 = s43;\n const v88 = s44;\n const v89 = s45;\n const v90 = s46;\n const v91 = s47;\n const v92 = ((v2 - v81) | 0);\n const v93 = (Math.min(((16 - v91) | 0) >>> 0, v92 >>> 0) | 0);\n let s48 = v83, s49 = v84, s50 = v85, s51 = v86, s52 = v87, s53 = v88, s54 = v89, s55 = v90;\n L8: {\n const v94 = s48;\n const v95 = s49;\n const v96 = s50;\n const v97 = s51;\n const v98 = s52;\n const v99 = s53;\n const v100 = s54;\n const v101 = s55;\n if (((((((((v91) | 0) === 0) | 0)) | 0) === 0) | 0)) {\n s48 = v94;\n s49 = v95;\n s50 = v96;\n s51 = v97;\n s52 = v98;\n s53 = v99;\n s54 = v100;\n s55 = v101;\n break L8;\n }\n s48 = v15;\n s49 = v17;\n s50 = v19;\n s51 = v21;\n s52 = v23;\n s53 = v25;\n s54 = v27;\n s55 = v28;\n }\n const v94 = s48;\n const v95 = s49;\n const v96 = s50;\n const v97 = s51;\n const v98 = s52;\n const v99 = s53;\n const v100 = s54;\n const v101 = s55;\n let s56 = 0, s57 = v81, s58 = v94, s59 = v95, s60 = v96, s61 = v97, s62 = v98, s63 = v99, s64 = v100, s65 = v101, s66 = v91;\n L9: {\n const v102 = s56;\n const v103 = s57;\n const v104 = s58;\n const v105 = s59;\n const v106 = s60;\n const v107 = s61;\n const v108 = s62;\n const v109 = s63;\n const v110 = s64;\n const v111 = s65;\n const v112 = s66;\n let s67 = v102, s68 = v103, s69 = v104, s70 = v105, s71 = v106, s72 = v107, s73 = v108, s74 = v109, s75 = v110, s76 = v111, s77 = v112;\n L10: for (;;) {\n const v113 = s67;\n const v114 = s68;\n const v115 = s69;\n const v116 = s70;\n const v117 = s71;\n const v118 = s72;\n const v119 = s73;\n const v120 = s74;\n const v121 = s75;\n const v122 = s76;\n const v123 = s77;\n const v124 = ((1 + v113) | 0);\n const v125 = ((v6 & ((((v113) | 0) === ((((v93 - 1) | 0)) | 0)) | 0)) & ((((v92) | 0) === ((v93) | 0)) | 0));\n const v126 = (v125 | ((((v123) | 0) === ((15) | 0)) | 0));\n const v127 = ((((2144 + (((v114 + v3) | 0) << 6)) | 0) + (Math.imul(v4, v12) << 6)) | 0);\n const v128 = memory_i32[(((v127) >>> 0) + 0) >>> 2];\n const v129 = ((4 + v127) | 0);\n const v130 = memory_i32[(((v129) >>> 0) + 0) >>> 2];\n const v131 = ((4 + v129) | 0);\n const v132 = memory_i32[(((v131) >>> 0) + 0) >>> 2];\n const v133 = ((4 + v131) | 0);\n const v134 = memory_i32[(((v133) >>> 0) + 0) >>> 2];\n const v135 = ((4 + v133) | 0);\n const v136 = memory_i32[(((v135) >>> 0) + 0) >>> 2];\n const v137 = ((4 + v135) | 0);\n const v138 = memory_i32[(((v137) >>> 0) + 0) >>> 2];\n const v139 = ((4 + v137) | 0);\n const v140 = memory_i32[(((v139) >>> 0) + 0) >>> 2];\n const v141 = ((4 + v139) | 0);\n const v142 = memory_i32[(((v141) >>> 0) + 0) >>> 2];\n const v143 = ((4 + v141) | 0);\n const v144 = memory_i32[(((v143) >>> 0) + 0) >>> 2];\n const v145 = ((4 + v143) | 0);\n const v146 = memory_i32[(((v145) >>> 0) + 0) >>> 2];\n const v147 = ((4 + v145) | 0);\n const v148 = memory_i32[(((v147) >>> 0) + 0) >>> 2];\n const v149 = ((4 + v147) | 0);\n const v150 = memory_i32[(((v149) >>> 0) + 0) >>> 2];\n const v151 = ((4 + v149) | 0);\n const v152 = memory_i32[(((v151) >>> 0) + 0) >>> 2];\n const v153 = ((4 + v151) | 0);\n const v154 = memory_i32[(((v153) >>> 0) + 0) >>> 2];\n const v155 = ((4 + v153) | 0);\n const v156 = memory_i32[(((v155) >>> 0) + 0) >>> 2];\n const v157 = memory_i32[(((((4 + v155) | 0)) >>> 0) + 0) >>> 2];\n memory_i32[(((v127) >>> 0) + 0) >>> 2] = 0;\n const v158 = ((4 + v127) | 0);\n memory_i32[(((v158) >>> 0) + 0) >>> 2] = 0;\n const v159 = ((4 + v158) | 0);\n memory_i32[(((v159) >>> 0) + 0) >>> 2] = 0;\n const v160 = ((4 + v159) | 0);\n memory_i32[(((v160) >>> 0) + 0) >>> 2] = 0;\n const v161 = ((4 + v160) | 0);\n memory_i32[(((v161) >>> 0) + 0) >>> 2] = 0;\n const v162 = ((4 + v161) | 0);\n memory_i32[(((v162) >>> 0) + 0) >>> 2] = 0;\n const v163 = ((4 + v162) | 0);\n memory_i32[(((v163) >>> 0) + 0) >>> 2] = 0;\n const v164 = ((4 + v163) | 0);\n memory_i32[(((v164) >>> 0) + 0) >>> 2] = 0;\n const v165 = ((4 + v164) | 0);\n memory_i32[(((v165) >>> 0) + 0) >>> 2] = 0;\n const v166 = ((4 + v165) | 0);\n memory_i32[(((v166) >>> 0) + 0) >>> 2] = 0;\n const v167 = ((4 + v166) | 0);\n memory_i32[(((v167) >>> 0) + 0) >>> 2] = 0;\n const v168 = ((4 + v167) | 0);\n memory_i32[(((v168) >>> 0) + 0) >>> 2] = 0;\n const v169 = ((4 + v168) | 0);\n memory_i32[(((v169) >>> 0) + 0) >>> 2] = 0;\n const v170 = ((4 + v169) | 0);\n memory_i32[(((v170) >>> 0) + 0) >>> 2] = 0;\n const v171 = ((4 + v170) | 0);\n memory_i32[(((v171) >>> 0) + 0) >>> 2] = 0;\n memory_i32[(((((4 + v171) | 0)) >>> 0) + 0) >>> 2] = 0;\n const v172 = ((((v128 + v119) | 0) + v115) | 0);\n const v173 = ((v82 + v46) | 0);\n const v174 = ((((v172 ^ v173) >>> 16) | ((v172 ^ v173) << (32 - 16))));\n const v175 = ((v174 + 1779033703) | 0);\n const v176 = ((((v175 ^ v119) >>> 12) | ((v175 ^ v119) << (32 - 12))));\n const v177 = ((((v130 + v176) | 0) + v172) | 0);\n const v178 = ((((v177 ^ v174) >>> 8) | ((v177 ^ v174) << (32 - 8))));\n const v179 = ((v178 + v175) | 0);\n const v180 = ((((v179 ^ v176) >>> 7) | ((v179 ^ v176) << (32 - 7))));\n const v181 = ((((v132 + v120) | 0) + v116) | 0);\n const v182 = ((((v181 ^ ((((((-1 ^ v173) & (v82 | v46)) | (v82 & v46)) >>> 31) + v47) | 0)) >>> 16) | ((v181 ^ ((((((-1 ^ v173) & (v82 | v46)) | (v82 & v46)) >>> 31) + v47) | 0)) << (32 - 16))));\n const v183 = ((v182 + -1150833019) | 0);\n const v184 = ((((v183 ^ v120) >>> 12) | ((v183 ^ v120) << (32 - 12))));\n const v185 = ((((v134 + v184) | 0) + v181) | 0);\n const v186 = ((((v185 ^ v182) >>> 8) | ((v185 ^ v182) << (32 - 8))));\n const v187 = ((v186 + v183) | 0);\n const v188 = ((((v187 ^ v184) >>> 7) | ((v187 ^ v184) << (32 - 7))));\n const v189 = ((((v136 + v121) | 0) + v117) | 0);\n const v190 = ((((v189 ^ ((v125) ? (((v5 - v7) | 0)) : (v5))) >>> 16) | ((v189 ^ ((v125) ? (((v5 - v7) | 0)) : (v5))) << (32 - 16))));\n const v191 = ((v190 + 1013904242) | 0);\n const v192 = ((((v191 ^ v121) >>> 12) | ((v191 ^ v121) << (32 - 12))));\n const v193 = ((((v138 + v192) | 0) + v189) | 0);\n const v194 = ((((v193 ^ v190) >>> 8) | ((v193 ^ v190) << (32 - 8))));\n const v195 = ((v194 + v191) | 0);\n const v196 = ((((v195 ^ v192) >>> 7) | ((v195 ^ v192) << (32 - 7))));\n const v197 = ((((v140 + v122) | 0) + v118) | 0);\n const v198 = ((((v197 ^ ((((v126) ? (2) : (0)) | ((((((v123) | 0) === 0) | 0)) ? (1) : (0))) | v31)) >>> 16) | ((v197 ^ ((((v126) ? (2) : (0)) | ((((((v123) | 0) === 0) | 0)) ? (1) : (0))) | v31)) << (32 - 16))));\n const v199 = ((v198 + -1521486534) | 0);\n const v200 = ((((v199 ^ v122) >>> 12) | ((v199 ^ v122) << (32 - 12))));\n const v201 = ((((v142 + v200) | 0) + v197) | 0);\n const v202 = ((((v201 ^ v198) >>> 8) | ((v201 ^ v198) << (32 - 8))));\n const v203 = ((v202 + v199) | 0);\n const v204 = ((((v203 ^ v200) >>> 7) | ((v203 ^ v200) << (32 - 7))));\n const v205 = ((((v144 + v188) | 0) + v177) | 0);\n const v206 = ((((v205 ^ v202) >>> 16) | ((v205 ^ v202) << (32 - 16))));\n const v207 = ((v206 + v195) | 0);\n const v208 = ((((v207 ^ v188) >>> 12) | ((v207 ^ v188) << (32 - 12))));\n const v209 = ((((v146 + v208) | 0) + v205) | 0);\n const v210 = ((((v209 ^ v206) >>> 8) | ((v209 ^ v206) << (32 - 8))));\n const v211 = ((v210 + v207) | 0);\n const v212 = ((((v211 ^ v208) >>> 7) | ((v211 ^ v208) << (32 - 7))));\n const v213 = ((((v148 + v196) | 0) + v185) | 0);\n const v214 = ((((v213 ^ v178) >>> 16) | ((v213 ^ v178) << (32 - 16))));\n const v215 = ((v214 + v203) | 0);\n const v216 = ((((v215 ^ v196) >>> 12) | ((v215 ^ v196) << (32 - 12))));\n const v217 = ((((v150 + v216) | 0) + v213) | 0);\n const v218 = ((((v217 ^ v214) >>> 8) | ((v217 ^ v214) << (32 - 8))));\n const v219 = ((v218 + v215) | 0);\n const v220 = ((((v219 ^ v216) >>> 7) | ((v219 ^ v216) << (32 - 7))));\n const v221 = ((((v152 + v204) | 0) + v193) | 0);\n const v222 = ((((v221 ^ v186) >>> 16) | ((v221 ^ v186) << (32 - 16))));\n const v223 = ((v222 + v179) | 0);\n const v224 = ((((v223 ^ v204) >>> 12) | ((v223 ^ v204) << (32 - 12))));\n const v225 = ((((v154 + v224) | 0) + v221) | 0);\n const v226 = ((((v225 ^ v222) >>> 8) | ((v225 ^ v222) << (32 - 8))));\n const v227 = ((v226 + v223) | 0);\n const v228 = ((((v227 ^ v224) >>> 7) | ((v227 ^ v224) << (32 - 7))));\n const v229 = ((((v156 + v180) | 0) + v201) | 0);\n const v230 = ((((v229 ^ v194) >>> 16) | ((v229 ^ v194) << (32 - 16))));\n const v231 = ((v230 + v187) | 0);\n const v232 = ((((v231 ^ v180) >>> 12) | ((v231 ^ v180) << (32 - 12))));\n const v233 = ((((v157 + v232) | 0) + v229) | 0);\n const v234 = ((((v233 ^ v230) >>> 8) | ((v233 ^ v230) << (32 - 8))));\n const v235 = ((v234 + v231) | 0);\n const v236 = ((((v235 ^ v232) >>> 7) | ((v235 ^ v232) << (32 - 7))));\n const v237 = ((((v132 + v236) | 0) + v209) | 0);\n const v238 = ((((v237 ^ v218) >>> 16) | ((v237 ^ v218) << (32 - 16))));\n const v239 = ((v238 + v227) | 0);\n const v240 = ((((v239 ^ v236) >>> 12) | ((v239 ^ v236) << (32 - 12))));\n const v241 = ((((v140 + v240) | 0) + v237) | 0);\n const v242 = ((((v241 ^ v238) >>> 8) | ((v241 ^ v238) << (32 - 8))));\n const v243 = ((v242 + v239) | 0);\n const v244 = ((((v243 ^ v240) >>> 7) | ((v243 ^ v240) << (32 - 7))));\n const v245 = ((((v134 + v212) | 0) + v217) | 0);\n const v246 = ((((v245 ^ v226) >>> 16) | ((v245 ^ v226) << (32 - 16))));\n const v247 = ((v246 + v235) | 0);\n const v248 = ((((v247 ^ v212) >>> 12) | ((v247 ^ v212) << (32 - 12))));\n const v249 = ((((v148 + v248) | 0) + v245) | 0);\n const v250 = ((((v249 ^ v246) >>> 8) | ((v249 ^ v246) << (32 - 8))));\n const v251 = ((v250 + v247) | 0);\n const v252 = ((((v251 ^ v248) >>> 7) | ((v251 ^ v248) << (32 - 7))));\n const v253 = ((((v142 + v220) | 0) + v225) | 0);\n const v254 = ((((v253 ^ v234) >>> 16) | ((v253 ^ v234) << (32 - 16))));\n const v255 = ((v254 + v211) | 0);\n const v256 = ((((v255 ^ v220) >>> 12) | ((v255 ^ v220) << (32 - 12))));\n const v257 = ((((v128 + v256) | 0) + v253) | 0);\n const v258 = ((((v257 ^ v254) >>> 8) | ((v257 ^ v254) << (32 - 8))));\n const v259 = ((v258 + v255) | 0);\n const v260 = ((((v259 ^ v256) >>> 7) | ((v259 ^ v256) << (32 - 7))));\n const v261 = ((((v136 + v228) | 0) + v233) | 0);\n const v262 = ((((v261 ^ v210) >>> 16) | ((v261 ^ v210) << (32 - 16))));\n const v263 = ((v262 + v219) | 0);\n const v264 = ((((v263 ^ v228) >>> 12) | ((v263 ^ v228) << (32 - 12))));\n const v265 = ((((v154 + v264) | 0) + v261) | 0);\n const v266 = ((((v265 ^ v262) >>> 8) | ((v265 ^ v262) << (32 - 8))));\n const v267 = ((v266 + v263) | 0);\n const v268 = ((((v267 ^ v264) >>> 7) | ((v267 ^ v264) << (32 - 7))));\n const v269 = ((((v130 + v252) | 0) + v241) | 0);\n const v270 = ((((v269 ^ v266) >>> 16) | ((v269 ^ v266) << (32 - 16))));\n const v271 = ((v270 + v259) | 0);\n const v272 = ((((v271 ^ v252) >>> 12) | ((v271 ^ v252) << (32 - 12))));\n const v273 = ((((v150 + v272) | 0) + v269) | 0);\n const v274 = ((((v273 ^ v270) >>> 8) | ((v273 ^ v270) << (32 - 8))));\n const v275 = ((v274 + v271) | 0);\n const v276 = ((((v275 ^ v272) >>> 7) | ((v275 ^ v272) << (32 - 7))));\n const v277 = ((((v152 + v260) | 0) + v249) | 0);\n const v278 = ((((v277 ^ v242) >>> 16) | ((v277 ^ v242) << (32 - 16))));\n const v279 = ((v278 + v267) | 0);\n const v280 = ((((v279 ^ v260) >>> 12) | ((v279 ^ v260) << (32 - 12))));\n const v281 = ((((v138 + v280) | 0) + v277) | 0);\n const v282 = ((((v281 ^ v278) >>> 8) | ((v281 ^ v278) << (32 - 8))));\n const v283 = ((v282 + v279) | 0);\n const v284 = ((((v283 ^ v280) >>> 7) | ((v283 ^ v280) << (32 - 7))));\n const v285 = ((((v146 + v268) | 0) + v257) | 0);\n const v286 = ((((v285 ^ v250) >>> 16) | ((v285 ^ v250) << (32 - 16))));\n const v287 = ((v286 + v243) | 0);\n const v288 = ((((v287 ^ v268) >>> 12) | ((v287 ^ v268) << (32 - 12))));\n const v289 = ((((v156 + v288) | 0) + v285) | 0);\n const v290 = ((((v289 ^ v286) >>> 8) | ((v289 ^ v286) << (32 - 8))));\n const v291 = ((v290 + v287) | 0);\n const v292 = ((((v291 ^ v288) >>> 7) | ((v291 ^ v288) << (32 - 7))));\n const v293 = ((((v157 + v244) | 0) + v265) | 0);\n const v294 = ((((v293 ^ v258) >>> 16) | ((v293 ^ v258) << (32 - 16))));\n const v295 = ((v294 + v251) | 0);\n const v296 = ((((v295 ^ v244) >>> 12) | ((v295 ^ v244) << (32 - 12))));\n const v297 = ((((v144 + v296) | 0) + v293) | 0);\n const v298 = ((((v297 ^ v294) >>> 8) | ((v297 ^ v294) << (32 - 8))));\n const v299 = ((v298 + v295) | 0);\n const v300 = ((((v299 ^ v296) >>> 7) | ((v299 ^ v296) << (32 - 7))));\n const v301 = ((((v134 + v300) | 0) + v273) | 0);\n const v302 = ((((v301 ^ v282) >>> 16) | ((v301 ^ v282) << (32 - 16))));\n const v303 = ((v302 + v291) | 0);\n const v304 = ((((v303 ^ v300) >>> 12) | ((v303 ^ v300) << (32 - 12))));\n const v305 = ((((v136 + v304) | 0) + v301) | 0);\n const v306 = ((((v305 ^ v302) >>> 8) | ((v305 ^ v302) << (32 - 8))));\n const v307 = ((v306 + v303) | 0);\n const v308 = ((((v307 ^ v304) >>> 7) | ((v307 ^ v304) << (32 - 7))));\n const v309 = ((((v148 + v276) | 0) + v281) | 0);\n const v310 = ((((v309 ^ v290) >>> 16) | ((v309 ^ v290) << (32 - 16))));\n const v311 = ((v310 + v299) | 0);\n const v312 = ((((v311 ^ v276) >>> 12) | ((v311 ^ v276) << (32 - 12))));\n const v313 = ((((v152 + v312) | 0) + v309) | 0);\n const v314 = ((((v313 ^ v310) >>> 8) | ((v313 ^ v310) << (32 - 8))));\n const v315 = ((v314 + v311) | 0);\n const v316 = ((((v315 ^ v312) >>> 7) | ((v315 ^ v312) << (32 - 7))));\n const v317 = ((((v154 + v284) | 0) + v289) | 0);\n const v318 = ((((v317 ^ v298) >>> 16) | ((v317 ^ v298) << (32 - 16))));\n const v319 = ((v318 + v275) | 0);\n const v320 = ((((v319 ^ v284) >>> 12) | ((v319 ^ v284) << (32 - 12))));\n const v321 = ((((v132 + v320) | 0) + v317) | 0);\n const v322 = ((((v321 ^ v318) >>> 8) | ((v321 ^ v318) << (32 - 8))));\n const v323 = ((v322 + v319) | 0);\n const v324 = ((((v323 ^ v320) >>> 7) | ((v323 ^ v320) << (32 - 7))));\n const v325 = ((((v142 + v292) | 0) + v297) | 0);\n const v326 = ((((v325 ^ v274) >>> 16) | ((v325 ^ v274) << (32 - 16))));\n const v327 = ((v326 + v283) | 0);\n const v328 = ((((v327 ^ v292) >>> 12) | ((v327 ^ v292) << (32 - 12))));\n const v329 = ((((v156 + v328) | 0) + v325) | 0);\n const v330 = ((((v329 ^ v326) >>> 8) | ((v329 ^ v326) << (32 - 8))));\n const v331 = ((v330 + v327) | 0);\n const v332 = ((((v331 ^ v328) >>> 7) | ((v331 ^ v328) << (32 - 7))));\n const v333 = ((((v140 + v316) | 0) + v305) | 0);\n const v334 = ((((v333 ^ v330) >>> 16) | ((v333 ^ v330) << (32 - 16))));\n const v335 = ((v334 + v323) | 0);\n const v336 = ((((v335 ^ v316) >>> 12) | ((v335 ^ v316) << (32 - 12))));\n const v337 = ((((v138 + v336) | 0) + v333) | 0);\n const v338 = ((((v337 ^ v334) >>> 8) | ((v337 ^ v334) << (32 - 8))));\n const v339 = ((v338 + v335) | 0);\n const v340 = ((((v339 ^ v336) >>> 7) | ((v339 ^ v336) << (32 - 7))));\n const v341 = ((((v146 + v324) | 0) + v313) | 0);\n const v342 = ((((v341 ^ v306) >>> 16) | ((v341 ^ v306) << (32 - 16))));\n const v343 = ((v342 + v331) | 0);\n const v344 = ((((v343 ^ v324) >>> 12) | ((v343 ^ v324) << (32 - 12))));\n const v345 = ((((v128 + v344) | 0) + v341) | 0);\n const v346 = ((((v345 ^ v342) >>> 8) | ((v345 ^ v342) << (32 - 8))));\n const v347 = ((v346 + v343) | 0);\n const v348 = ((((v347 ^ v344) >>> 7) | ((v347 ^ v344) << (32 - 7))));\n const v349 = ((((v150 + v332) | 0) + v321) | 0);\n const v350 = ((((v349 ^ v314) >>> 16) | ((v349 ^ v314) << (32 - 16))));\n const v351 = ((v350 + v307) | 0);\n const v352 = ((((v351 ^ v332) >>> 12) | ((v351 ^ v332) << (32 - 12))));\n const v353 = ((((v157 + v352) | 0) + v349) | 0);\n const v354 = ((((v353 ^ v350) >>> 8) | ((v353 ^ v350) << (32 - 8))));\n const v355 = ((v354 + v351) | 0);\n const v356 = ((((v355 ^ v352) >>> 7) | ((v355 ^ v352) << (32 - 7))));\n const v357 = ((((v144 + v308) | 0) + v329) | 0);\n const v358 = ((((v357 ^ v322) >>> 16) | ((v357 ^ v322) << (32 - 16))));\n const v359 = ((v358 + v315) | 0);\n const v360 = ((((v359 ^ v308) >>> 12) | ((v359 ^ v308) << (32 - 12))));\n const v361 = ((((v130 + v360) | 0) + v357) | 0);\n const v362 = ((((v361 ^ v358) >>> 8) | ((v361 ^ v358) << (32 - 8))));\n const v363 = ((v362 + v359) | 0);\n const v364 = ((((v363 ^ v360) >>> 7) | ((v363 ^ v360) << (32 - 7))));\n const v365 = ((((v148 + v364) | 0) + v337) | 0);\n const v366 = ((((v365 ^ v346) >>> 16) | ((v365 ^ v346) << (32 - 16))));\n const v367 = ((v366 + v355) | 0);\n const v368 = ((((v367 ^ v364) >>> 12) | ((v367 ^ v364) << (32 - 12))));\n const v369 = ((((v142 + v368) | 0) + v365) | 0);\n const v370 = ((((v369 ^ v366) >>> 8) | ((v369 ^ v366) << (32 - 8))));\n const v371 = ((v370 + v367) | 0);\n const v372 = ((((v371 ^ v368) >>> 7) | ((v371 ^ v368) << (32 - 7))));\n const v373 = ((((v152 + v340) | 0) + v345) | 0);\n const v374 = ((((v373 ^ v354) >>> 16) | ((v373 ^ v354) << (32 - 16))));\n const v375 = ((v374 + v363) | 0);\n const v376 = ((((v375 ^ v340) >>> 12) | ((v375 ^ v340) << (32 - 12))));\n const v377 = ((((v146 + v376) | 0) + v373) | 0);\n const v378 = ((((v377 ^ v374) >>> 8) | ((v377 ^ v374) << (32 - 8))));\n const v379 = ((v378 + v375) | 0);\n const v380 = ((((v379 ^ v376) >>> 7) | ((v379 ^ v376) << (32 - 7))));\n const v381 = ((((v156 + v348) | 0) + v353) | 0);\n const v382 = ((((v381 ^ v362) >>> 16) | ((v381 ^ v362) << (32 - 16))));\n const v383 = ((v382 + v339) | 0);\n const v384 = ((((v383 ^ v348) >>> 12) | ((v383 ^ v348) << (32 - 12))));\n const v385 = ((((v134 + v384) | 0) + v381) | 0);\n const v386 = ((((v385 ^ v382) >>> 8) | ((v385 ^ v382) << (32 - 8))));\n const v387 = ((v386 + v383) | 0);\n const v388 = ((((v387 ^ v384) >>> 7) | ((v387 ^ v384) << (32 - 7))));\n const v389 = ((((v154 + v356) | 0) + v361) | 0);\n const v390 = ((((v389 ^ v338) >>> 16) | ((v389 ^ v338) << (32 - 16))));\n const v391 = ((v390 + v347) | 0);\n const v392 = ((((v391 ^ v356) >>> 12) | ((v391 ^ v356) << (32 - 12))));\n const v393 = ((((v157 + v392) | 0) + v389) | 0);\n const v394 = ((((v393 ^ v390) >>> 8) | ((v393 ^ v390) << (32 - 8))));\n const v395 = ((v394 + v391) | 0);\n const v396 = ((((v395 ^ v392) >>> 7) | ((v395 ^ v392) << (32 - 7))));\n const v397 = ((((v136 + v380) | 0) + v369) | 0);\n const v398 = ((((v397 ^ v394) >>> 16) | ((v397 ^ v394) << (32 - 16))));\n const v399 = ((v398 + v387) | 0);\n const v400 = ((((v399 ^ v380) >>> 12) | ((v399 ^ v380) << (32 - 12))));\n const v401 = ((((v128 + v400) | 0) + v397) | 0);\n const v402 = ((((v401 ^ v398) >>> 8) | ((v401 ^ v398) << (32 - 8))));\n const v403 = ((v402 + v399) | 0);\n const v404 = ((((v403 ^ v400) >>> 7) | ((v403 ^ v400) << (32 - 7))));\n const v405 = ((((v150 + v388) | 0) + v377) | 0);\n const v406 = ((((v405 ^ v370) >>> 16) | ((v405 ^ v370) << (32 - 16))));\n const v407 = ((v406 + v395) | 0);\n const v408 = ((((v407 ^ v388) >>> 12) | ((v407 ^ v388) << (32 - 12))));\n const v409 = ((((v132 + v408) | 0) + v405) | 0);\n const v410 = ((((v409 ^ v406) >>> 8) | ((v409 ^ v406) << (32 - 8))));\n const v411 = ((v410 + v407) | 0);\n const v412 = ((((v411 ^ v408) >>> 7) | ((v411 ^ v408) << (32 - 7))));\n const v413 = ((((v138 + v396) | 0) + v385) | 0);\n const v414 = ((((v413 ^ v378) >>> 16) | ((v413 ^ v378) << (32 - 16))));\n const v415 = ((v414 + v371) | 0);\n const v416 = ((((v415 ^ v396) >>> 12) | ((v415 ^ v396) << (32 - 12))));\n const v417 = ((((v144 + v416) | 0) + v413) | 0);\n const v418 = ((((v417 ^ v414) >>> 8) | ((v417 ^ v414) << (32 - 8))));\n const v419 = ((v418 + v415) | 0);\n const v420 = ((((v419 ^ v416) >>> 7) | ((v419 ^ v416) << (32 - 7))));\n const v421 = ((((v130 + v372) | 0) + v393) | 0);\n const v422 = ((((v421 ^ v386) >>> 16) | ((v421 ^ v386) << (32 - 16))));\n const v423 = ((v422 + v379) | 0);\n const v424 = ((((v423 ^ v372) >>> 12) | ((v423 ^ v372) << (32 - 12))));\n const v425 = ((((v140 + v424) | 0) + v421) | 0);\n const v426 = ((((v425 ^ v422) >>> 8) | ((v425 ^ v422) << (32 - 8))));\n const v427 = ((v426 + v423) | 0);\n const v428 = ((((v427 ^ v424) >>> 7) | ((v427 ^ v424) << (32 - 7))));\n const v429 = ((((v152 + v428) | 0) + v401) | 0);\n const v430 = ((((v429 ^ v410) >>> 16) | ((v429 ^ v410) << (32 - 16))));\n const v431 = ((v430 + v419) | 0);\n const v432 = ((((v431 ^ v428) >>> 12) | ((v431 ^ v428) << (32 - 12))));\n const v433 = ((((v154 + v432) | 0) + v429) | 0);\n const v434 = ((((v433 ^ v430) >>> 8) | ((v433 ^ v430) << (32 - 8))));\n const v435 = ((v434 + v431) | 0);\n const v436 = ((((v435 ^ v432) >>> 7) | ((v435 ^ v432) << (32 - 7))));\n const v437 = ((((v146 + v404) | 0) + v409) | 0);\n const v438 = ((((v437 ^ v418) >>> 16) | ((v437 ^ v418) << (32 - 16))));\n const v439 = ((v438 + v427) | 0);\n const v440 = ((((v439 ^ v404) >>> 12) | ((v439 ^ v404) << (32 - 12))));\n const v441 = ((((v150 + v440) | 0) + v437) | 0);\n const v442 = ((((v441 ^ v438) >>> 8) | ((v441 ^ v438) << (32 - 8))));\n const v443 = ((v442 + v439) | 0);\n const v444 = ((((v443 ^ v440) >>> 7) | ((v443 ^ v440) << (32 - 7))));\n const v445 = ((((v157 + v412) | 0) + v417) | 0);\n const v446 = ((((v445 ^ v426) >>> 16) | ((v445 ^ v426) << (32 - 16))));\n const v447 = ((v446 + v403) | 0);\n const v448 = ((((v447 ^ v412) >>> 12) | ((v447 ^ v412) << (32 - 12))));\n const v449 = ((((v148 + v448) | 0) + v445) | 0);\n const v450 = ((((v449 ^ v446) >>> 8) | ((v449 ^ v446) << (32 - 8))));\n const v451 = ((v450 + v447) | 0);\n const v452 = ((((v451 ^ v448) >>> 7) | ((v451 ^ v448) << (32 - 7))));\n const v453 = ((((v156 + v420) | 0) + v425) | 0);\n const v454 = ((((v453 ^ v402) >>> 16) | ((v453 ^ v402) << (32 - 16))));\n const v455 = ((v454 + v411) | 0);\n const v456 = ((((v455 ^ v420) >>> 12) | ((v455 ^ v420) << (32 - 12))));\n const v457 = ((((v144 + v456) | 0) + v453) | 0);\n const v458 = ((((v457 ^ v454) >>> 8) | ((v457 ^ v454) << (32 - 8))));\n const v459 = ((v458 + v455) | 0);\n const v460 = ((((v459 ^ v456) >>> 7) | ((v459 ^ v456) << (32 - 7))));\n const v461 = ((((v142 + v444) | 0) + v433) | 0);\n const v462 = ((((v461 ^ v458) >>> 16) | ((v461 ^ v458) << (32 - 16))));\n const v463 = ((v462 + v451) | 0);\n const v464 = ((((v463 ^ v444) >>> 12) | ((v463 ^ v444) << (32 - 12))));\n const v465 = ((((v132 + v464) | 0) + v461) | 0);\n const v466 = ((((v465 ^ v462) >>> 8) | ((v465 ^ v462) << (32 - 8))));\n const v467 = ((v466 + v463) | 0);\n const v468 = ((((v467 ^ v464) >>> 7) | ((v467 ^ v464) << (32 - 7))));\n const v469 = ((((v138 + v452) | 0) + v441) | 0);\n const v470 = ((((v469 ^ v434) >>> 16) | ((v469 ^ v434) << (32 - 16))));\n const v471 = ((v470 + v459) | 0);\n const v472 = ((((v471 ^ v452) >>> 12) | ((v471 ^ v452) << (32 - 12))));\n const v473 = ((((v134 + v472) | 0) + v469) | 0);\n const v474 = ((((v473 ^ v470) >>> 8) | ((v473 ^ v470) << (32 - 8))));\n const v475 = ((v474 + v471) | 0);\n const v476 = ((((v475 ^ v472) >>> 7) | ((v475 ^ v472) << (32 - 7))));\n const v477 = ((((v128 + v460) | 0) + v449) | 0);\n const v478 = ((((v477 ^ v442) >>> 16) | ((v477 ^ v442) << (32 - 16))));\n const v479 = ((v478 + v435) | 0);\n const v480 = ((((v479 ^ v460) >>> 12) | ((v479 ^ v460) << (32 - 12))));\n const v481 = ((((v130 + v480) | 0) + v477) | 0);\n const v482 = ((((v481 ^ v478) >>> 8) | ((v481 ^ v478) << (32 - 8))));\n const v483 = ((v482 + v479) | 0);\n const v484 = ((((v483 ^ v480) >>> 7) | ((v483 ^ v480) << (32 - 7))));\n const v485 = ((((v140 + v436) | 0) + v457) | 0);\n const v486 = ((((v485 ^ v450) >>> 16) | ((v485 ^ v450) << (32 - 16))));\n const v487 = ((v486 + v443) | 0);\n const v488 = ((((v487 ^ v436) >>> 12) | ((v487 ^ v436) << (32 - 12))));\n const v489 = ((((v136 + v488) | 0) + v485) | 0);\n const v490 = ((((v489 ^ v486) >>> 8) | ((v489 ^ v486) << (32 - 8))));\n const v491 = ((v490 + v487) | 0);\n const v492 = ((((v491 ^ v488) >>> 7) | ((v491 ^ v488) << (32 - 7))));\n const v493 = ((((v146 + v492) | 0) + v465) | 0);\n const v494 = ((((v493 ^ v474) >>> 16) | ((v493 ^ v474) << (32 - 16))));\n const v495 = ((v494 + v483) | 0);\n const v496 = ((((v495 ^ v492) >>> 12) | ((v495 ^ v492) << (32 - 12))));\n const v497 = ((((v156 + v496) | 0) + v493) | 0);\n const v498 = ((((v497 ^ v494) >>> 8) | ((v497 ^ v494) << (32 - 8))));\n const v499 = ((v498 + v495) | 0);\n const v500 = ((((v499 ^ v496) >>> 7) | ((v499 ^ v496) << (32 - 7))));\n const v501 = ((((v150 + v468) | 0) + v473) | 0);\n const v502 = ((((v501 ^ v482) >>> 16) | ((v501 ^ v482) << (32 - 16))));\n const v503 = ((v502 + v491) | 0);\n const v504 = ((((v503 ^ v468) >>> 12) | ((v503 ^ v468) << (32 - 12))));\n const v505 = ((((v138 + v504) | 0) + v501) | 0);\n const v506 = ((((v505 ^ v502) >>> 8) | ((v505 ^ v502) << (32 - 8))));\n const v507 = ((v506 + v503) | 0);\n const v508 = ((((v507 ^ v504) >>> 7) | ((v507 ^ v504) << (32 - 7))));\n const v509 = ((((v144 + v476) | 0) + v481) | 0);\n const v510 = ((((v509 ^ v490) >>> 16) | ((v509 ^ v490) << (32 - 16))));\n const v511 = ((v510 + v467) | 0);\n const v512 = ((((v511 ^ v476) >>> 12) | ((v511 ^ v476) << (32 - 12))));\n const v513 = ((((v152 + v512) | 0) + v509) | 0);\n const v514 = ((((v513 ^ v510) >>> 8) | ((v513 ^ v510) << (32 - 8))));\n const v515 = ((v514 + v511) | 0);\n const v516 = ((((v515 ^ v512) >>> 7) | ((v515 ^ v512) << (32 - 7))));\n const v517 = ((((v157 + v484) | 0) + v489) | 0);\n const v518 = ((((v517 ^ v466) >>> 16) | ((v517 ^ v466) << (32 - 16))));\n const v519 = ((v518 + v475) | 0);\n const v520 = ((((v519 ^ v484) >>> 12) | ((v519 ^ v484) << (32 - 12))));\n const v521 = ((((v130 + v520) | 0) + v517) | 0);\n const v522 = ((((v521 ^ v518) >>> 8) | ((v521 ^ v518) << (32 - 8))));\n const v523 = ((v522 + v519) | 0);\n const v524 = ((((v523 ^ v520) >>> 7) | ((v523 ^ v520) << (32 - 7))));\n const v525 = ((((v154 + v508) | 0) + v497) | 0);\n const v526 = ((((v525 ^ v522) >>> 16) | ((v525 ^ v522) << (32 - 16))));\n const v527 = ((v526 + v515) | 0);\n const v528 = ((((v527 ^ v508) >>> 12) | ((v527 ^ v508) << (32 - 12))));\n const v529 = ((((v134 + v528) | 0) + v525) | 0);\n const v530 = ((((v529 ^ v526) >>> 8) | ((v529 ^ v526) << (32 - 8))));\n const v531 = ((v530 + v527) | 0);\n const v532 = ((((v531 ^ v528) >>> 7) | ((v531 ^ v528) << (32 - 7))));\n const v533 = ((((v128 + v516) | 0) + v505) | 0);\n const v534 = ((((v533 ^ v498) >>> 16) | ((v533 ^ v498) << (32 - 16))));\n const v535 = ((v534 + v523) | 0);\n const v536 = ((((v535 ^ v516) >>> 12) | ((v535 ^ v516) << (32 - 12))));\n const v537 = ((((v148 + v536) | 0) + v533) | 0);\n const v538 = ((((v537 ^ v534) >>> 8) | ((v537 ^ v534) << (32 - 8))));\n const v539 = ((v538 + v535) | 0);\n const v540 = ((((v539 ^ v536) >>> 7) | ((v539 ^ v536) << (32 - 7))));\n const v541 = ((((v132 + v524) | 0) + v513) | 0);\n const v542 = ((((v541 ^ v506) >>> 16) | ((v541 ^ v506) << (32 - 16))));\n const v543 = ((v542 + v499) | 0);\n const v544 = ((((v543 ^ v524) >>> 12) | ((v543 ^ v524) << (32 - 12))));\n const v545 = ((((v140 + v544) | 0) + v541) | 0);\n const v546 = ((((v545 ^ v542) >>> 8) | ((v545 ^ v542) << (32 - 8))));\n const v547 = ((v546 + v543) | 0);\n const v548 = ((((v547 ^ v544) >>> 7) | ((v547 ^ v544) << (32 - 7))));\n const v549 = ((((v136 + v500) | 0) + v521) | 0);\n const v550 = ((((v549 ^ v514) >>> 16) | ((v549 ^ v514) << (32 - 16))));\n const v551 = ((v550 + v507) | 0);\n const v552 = ((((v551 ^ v500) >>> 12) | ((v551 ^ v500) << (32 - 12))));\n const v553 = ((((v142 + v552) | 0) + v549) | 0);\n const v554 = ((((v553 ^ v550) >>> 8) | ((v553 ^ v550) << (32 - 8))));\n const v555 = ((v554 + v551) | 0);\n const v556 = ((((v555 ^ v552) >>> 7) | ((v555 ^ v552) << (32 - 7))));\n const v557 = ((((v150 + v556) | 0) + v529) | 0);\n const v558 = ((((v557 ^ v538) >>> 16) | ((v557 ^ v538) << (32 - 16))));\n const v559 = ((v558 + v547) | 0);\n const v560 = ((((v559 ^ v556) >>> 12) | ((v559 ^ v556) << (32 - 12))));\n const v561 = ((((v157 + v560) | 0) + v557) | 0);\n const v562 = ((((v561 ^ v558) >>> 8) | ((v561 ^ v558) << (32 - 8))));\n const v563 = ((v562 + v559) | 0);\n const v564 = ((((v563 ^ v560) >>> 7) | ((v563 ^ v560) << (32 - 7))));\n const v565 = ((((v138 + v532) | 0) + v537) | 0);\n const v566 = ((((v565 ^ v546) >>> 16) | ((v565 ^ v546) << (32 - 16))));\n const v567 = ((v566 + v555) | 0);\n const v568 = ((((v567 ^ v532) >>> 12) | ((v567 ^ v532) << (32 - 12))));\n const v569 = ((((v128 + v568) | 0) + v565) | 0);\n const v570 = ((((v569 ^ v566) >>> 8) | ((v569 ^ v566) << (32 - 8))));\n const v571 = ((v570 + v567) | 0);\n const v572 = ((((v571 ^ v568) >>> 7) | ((v571 ^ v568) << (32 - 7))));\n const v573 = ((((v130 + v540) | 0) + v545) | 0);\n const v574 = ((((v573 ^ v554) >>> 16) | ((v573 ^ v554) << (32 - 16))));\n const v575 = ((v574 + v531) | 0);\n const v576 = ((((v575 ^ v540) >>> 12) | ((v575 ^ v540) << (32 - 12))));\n const v577 = ((((v146 + v576) | 0) + v573) | 0);\n const v578 = ((((v577 ^ v574) >>> 8) | ((v577 ^ v574) << (32 - 8))));\n const v579 = ((v578 + v575) | 0);\n const v580 = ((((v579 ^ v576) >>> 7) | ((v579 ^ v576) << (32 - 7))));\n const v581 = ((((v144 + v548) | 0) + v553) | 0);\n const v582 = ((((v581 ^ v530) >>> 16) | ((v581 ^ v530) << (32 - 16))));\n const v583 = ((v582 + v539) | 0);\n const v584 = ((((v583 ^ v548) >>> 12) | ((v583 ^ v548) << (32 - 12))));\n const v585 = ((((v140 + v584) | 0) + v581) | 0);\n const v586 = ((((v585 ^ v582) >>> 8) | ((v585 ^ v582) << (32 - 8))));\n const v587 = ((v586 + v583) | 0);\n const v588 = ((((v587 ^ v584) >>> 7) | ((v587 ^ v584) << (32 - 7))));\n const v589 = ((((v156 + v572) | 0) + v561) | 0);\n const v590 = ((((v589 ^ v586) >>> 16) | ((v589 ^ v586) << (32 - 16))));\n const v591 = ((v590 + v579) | 0);\n const v592 = ((((v591 ^ v572) >>> 12) | ((v591 ^ v572) << (32 - 12))));\n const v593 = ((((v148 + v592) | 0) + v589) | 0);\n const v594 = ((((v593 ^ v590) >>> 8) | ((v593 ^ v590) << (32 - 8))));\n const v595 = ((v594 + v591) | 0);\n const v596 = ((((v132 + v580) | 0) + v569) | 0);\n const v597 = ((((v596 ^ v562) >>> 16) | ((v596 ^ v562) << (32 - 16))));\n const v598 = ((v597 + v587) | 0);\n const v599 = ((((v598 ^ v580) >>> 12) | ((v598 ^ v580) << (32 - 12))));\n const v600 = ((((v152 + v599) | 0) + v596) | 0);\n const v601 = ((((v600 ^ v597) >>> 8) | ((v600 ^ v597) << (32 - 8))));\n const v602 = ((v601 + v598) | 0);\n const v603 = ((((v134 + v588) | 0) + v577) | 0);\n const v604 = ((((v603 ^ v570) >>> 16) | ((v603 ^ v570) << (32 - 16))));\n const v605 = ((v604 + v563) | 0);\n const v606 = ((((v605 ^ v588) >>> 12) | ((v605 ^ v588) << (32 - 12))));\n const v607 = ((((v136 + v606) | 0) + v603) | 0);\n const v608 = ((((v607 ^ v604) >>> 8) | ((v607 ^ v604) << (32 - 8))));\n const v609 = ((v608 + v605) | 0);\n const v610 = ((((v142 + v564) | 0) + v585) | 0);\n const v611 = ((((v610 ^ v578) >>> 16) | ((v610 ^ v578) << (32 - 16))));\n const v612 = ((v611 + v571) | 0);\n const v613 = ((((v612 ^ v564) >>> 12) | ((v612 ^ v564) << (32 - 12))));\n const v614 = ((((v154 + v613) | 0) + v610) | 0);\n const v615 = ((((v614 ^ v611) >>> 8) | ((v614 ^ v611) << (32 - 8))));\n const v616 = ((v615 + v612) | 0);\n const v617 = (v609 ^ v593);\n const v618 = (v616 ^ v600);\n const v619 = (v595 ^ v607);\n const v620 = (v602 ^ v614);\n const v621 = (v601 ^ ((((v616 ^ v613) >>> 7) | ((v616 ^ v613) << (32 - 7)))));\n const v622 = (v608 ^ ((((v595 ^ v592) >>> 7) | ((v595 ^ v592) << (32 - 7)))));\n const v623 = (v615 ^ ((((v602 ^ v599) >>> 7) | ((v602 ^ v599) << (32 - 7)))));\n const v624 = (v594 ^ ((((v609 ^ v606) >>> 7) | ((v609 ^ v606) << (32 - 7)))));\n const v625 = ((v126) ? (0) : (((1 + v123) | 0)));\n const v626 = ((1 + v114) | 0);\n if (((((v124) >>> 0) < ((v93) >>> 0)) | 0)) {\n s67 = v124;\n s68 = v626;\n s69 = v617;\n s70 = v618;\n s71 = v619;\n s72 = v620;\n s73 = v621;\n s74 = v622;\n s75 = v623;\n s76 = v624;\n s77 = v625;\n continue L10;\n }\n s67 = v124;\n s68 = v626;\n s69 = v617;\n s70 = v618;\n s71 = v619;\n s72 = v620;\n s73 = v621;\n s74 = v622;\n s75 = v623;\n s76 = v624;\n s77 = v625;\n break L10;\n }\n const v113 = s67;\n const v114 = s68;\n const v115 = s69;\n const v116 = s70;\n const v117 = s71;\n const v118 = s72;\n const v119 = s73;\n const v120 = s74;\n const v121 = s75;\n const v122 = s76;\n const v123 = s77;\n s56 = v113;\n s57 = v114;\n s58 = v115;\n s59 = v116;\n s60 = v117;\n s61 = v118;\n s62 = v119;\n s63 = v120;\n s64 = v121;\n s65 = v122;\n s66 = v123;\n }\n const v103 = s57;\n const v104 = s58;\n const v105 = s59;\n const v106 = s60;\n const v107 = s61;\n const v108 = s62;\n const v109 = s63;\n const v110 = s64;\n const v111 = s65;\n const v112 = s66;\n L11: {\n if (((((((((v112) | 0) === 0) | 0)) | 0) === 0) | 0)) {\n break L11;\n }\n const v627 = memory_i32[(((((24 + Math.imul(2144, v12)) | 0)) >>> 0) + 0) >>> 2];\n const v628 = ((((96 + (v627 << 5)) | 0) + Math.imul(2144, v12)) | 0);\n memory_i32[(((v628) >>> 0) + 0) >>> 2] = v104;\n const v629 = ((4 + v628) | 0);\n memory_i32[(((v629) >>> 0) + 0) >>> 2] = v105;\n const v630 = ((4 + v629) | 0);\n memory_i32[(((v630) >>> 0) + 0) >>> 2] = v106;\n const v631 = ((4 + v630) | 0);\n memory_i32[(((v631) >>> 0) + 0) >>> 2] = v107;\n const v632 = ((4 + v631) | 0);\n memory_i32[(((v632) >>> 0) + 0) >>> 2] = v108;\n const v633 = ((4 + v632) | 0);\n memory_i32[(((v633) >>> 0) + 0) >>> 2] = v109;\n const v634 = ((4 + v633) | 0);\n memory_i32[(((v634) >>> 0) + 0) >>> 2] = v110;\n memory_i32[(((((4 + v634) | 0)) >>> 0) + 0) >>> 2] = v111;\n compressParentsFull(v12, (((((v103) | 0) === ((v2) | 0)) | 0) & v6));\n }\n const v635 = ((1 + v82) | 0);\n s37 = v103;\n s38 = v635;\n s39 = v104;\n s40 = v105;\n s41 = v106;\n s42 = v107;\n s43 = v108;\n s44 = v109;\n s45 = v110;\n s46 = v111;\n s47 = v112;\n }\n const v81 = s37;\n const v82 = s38;\n const v83 = s39;\n const v84 = s40;\n const v85 = s41;\n const v86 = s42;\n const v87 = s43;\n const v88 = s44;\n const v89 = s45;\n const v90 = s46;\n const v91 = s47;\n if (((((v81) >>> 0) < ((v2) >>> 0)) | 0)) {\n s26 = v81;\n s27 = v82;\n s28 = v83;\n s29 = v84;\n s30 = v85;\n s31 = v86;\n s32 = v87;\n s33 = v88;\n s34 = v89;\n s35 = v90;\n s36 = v91;\n continue L6;\n }\n s26 = v81;\n s27 = v82;\n s28 = v83;\n s29 = v84;\n s30 = v85;\n s31 = v86;\n s32 = v87;\n s33 = v88;\n s34 = v89;\n s35 = v90;\n s36 = v91;\n break L6;\n }\n const v70 = s26;\n const v71 = s27;\n const v72 = s28;\n const v73 = s29;\n const v74 = s30;\n const v75 = s31;\n const v76 = s32;\n const v77 = s33;\n const v78 = s34;\n const v79 = s35;\n const v80 = s36;\n s15 = v70;\n s16 = v71;\n s17 = v72;\n s18 = v73;\n s19 = v74;\n s20 = v75;\n s21 = v76;\n s22 = v77;\n s23 = v78;\n s24 = v79;\n s25 = v80;\n }\n const v59 = s15;\n const v60 = s16;\n const v61 = s17;\n const v62 = s18;\n const v63 = s19;\n const v64 = s20;\n const v65 = s21;\n const v66 = s22;\n const v67 = s23;\n const v68 = s24;\n const v69 = s25;\n s4 = v59;\n s5 = v60;\n s6 = v61;\n s7 = v62;\n s8 = v63;\n s9 = v64;\n s10 = v65;\n s11 = v66;\n s12 = v67;\n s13 = v68;\n s14 = v69;\n }\n const v50 = s6;\n const v51 = s7;\n const v52 = s8;\n const v53 = s9;\n const v54 = s10;\n const v55 = s11;\n const v56 = s12;\n const v57 = s13;\n const v58 = s14;\n memory_i32[(((((20 + Math.imul(2144, v12)) | 0)) >>> 0) + 0) >>> 2] = v58;\n L12: {\n L13: {\n if (((((((((v58) | 0) !== ((0) | 0)) | 0)) | 0) === 0) | 0)) {\n break L13;\n }\n memory_i32[(((v14) >>> 0) + 0) >>> 2] = v50;\n const v636 = ((4 + v14) | 0);\n memory_i32[(((v636) >>> 0) + 0) >>> 2] = v51;\n const v637 = ((4 + v636) | 0);\n memory_i32[(((v637) >>> 0) + 0) >>> 2] = v52;\n const v638 = ((4 + v637) | 0);\n memory_i32[(((v638) >>> 0) + 0) >>> 2] = v53;\n const v639 = ((4 + v638) | 0);\n memory_i32[(((v639) >>> 0) + 0) >>> 2] = v54;\n const v640 = ((4 + v639) | 0);\n memory_i32[(((v640) >>> 0) + 0) >>> 2] = v55;\n const v641 = ((4 + v640) | 0);\n memory_i32[(((v641) >>> 0) + 0) >>> 2] = v56;\n memory_i32[(((((4 + v641) | 0)) >>> 0) + 0) >>> 2] = v57;\n break L12;\n }\n memory.copyWithin(((((64 + Math.imul(2144, v12)) | 0)) >>> 0), ((((32 + Math.imul(2144, v12)) | 0)) >>> 0), ((((32 + Math.imul(2144, v12)) | 0)) >>> 0) + 32);\n }\n s3 = v11;\n }\n const v11 = s3;\n const v642 = ((1 + v11) | 0);\n if (((((v642) >>> 0) < ((v1) >>> 0)) | 0)) {\n s2 = v642;\n continue L2;\n }\n s2 = v642;\n break L2;\n }\n const v10 = s2;\n s1 = v10;\n }\n const v9 = s1;\n s0 = v9;\n }\n return;\n }\n function proccessChunksSequential(v0, v1, v2, v3, v4, v5, v6, v7, v8) {\n let s0 = 0;\n L0: {\n const v9 = s0;\n if (((((((((v9) >>> 0) < ((v1) >>> 0)) | 0)) | 0) === 0) | 0)) {\n s0 = v9;\n break L0;\n }\n let s1 = v9;\n L1: {\n const v10 = s1;\n let s2 = v10;\n L2: for (;;) {\n const v11 = s2;\n let s3 = v11;\n L3: {\n const v12 = s3;\n const v13 = ((v12 + v0) | 0);\n const v14 = ((32 + Math.imul(2144, v8)) | 0);\n const v15 = Math.imul(2144, v8);\n const v16 = memory_i32[(((((16 + Math.imul(2144, v8)) | 0)) >>> 0) + 0) >>> 2];\n const v17 = (1 | v16);\n const v18 = (2 | v16);\n const v19 = memory_i32[(((v14) >>> 0) + 0) >>> 2];\n const v20 = ((4 + v14) | 0);\n const v21 = memory_i32[(((v20) >>> 0) + 0) >>> 2];\n const v22 = ((4 + v20) | 0);\n const v23 = memory_i32[(((v22) >>> 0) + 0) >>> 2];\n const v24 = ((4 + v22) | 0);\n const v25 = memory_i32[(((v24) >>> 0) + 0) >>> 2];\n const v26 = ((4 + v24) | 0);\n const v27 = memory_i32[(((v26) >>> 0) + 0) >>> 2];\n const v28 = ((4 + v26) | 0);\n const v29 = memory_i32[(((v28) >>> 0) + 0) >>> 2];\n const v30 = ((4 + v28) | 0);\n const v31 = memory_i32[(((v30) >>> 0) + 0) >>> 2];\n const v32 = memory_i32[(((((4 + v30) | 0)) >>> 0) + 0) >>> 2];\n const v33 = memory_i32[(((v15) >>> 0) + 0) >>> 2];\n const v34 = memory_i32[(((v15) >>> 0) + 4) >>> 2];\n const v35 = ((v13 + v33) | 0);\n const v36 = ((((((-1 ^ v35) & (v13 | v33)) | (v13 & v33)) >>> 31) + v34) | 0);\n let s4 = 0, s5 = v19, s6 = v21, s7 = v23, s8 = v25, s9 = v27, s10 = v29, s11 = v31, s12 = v32;\n L4: {\n const v37 = s4;\n const v38 = s5;\n const v39 = s6;\n const v40 = s7;\n const v41 = s8;\n const v42 = s9;\n const v43 = s10;\n const v44 = s11;\n const v45 = s12;\n if (((((((((v37) >>> 0) < ((16) >>> 0)) | 0)) | 0) === 0) | 0)) {\n s4 = v37;\n s5 = v38;\n s6 = v39;\n s7 = v40;\n s8 = v41;\n s9 = v42;\n s10 = v43;\n s11 = v44;\n s12 = v45;\n break L4;\n }\n let s13 = v37, s14 = v38, s15 = v39, s16 = v40, s17 = v41, s18 = v42, s19 = v43, s20 = v44, s21 = v45;\n L5: {\n const v46 = s13;\n const v47 = s14;\n const v48 = s15;\n const v49 = s16;\n const v50 = s17;\n const v51 = s18;\n const v52 = s19;\n const v53 = s20;\n const v54 = s21;\n let s22 = v46, s23 = v47, s24 = v48, s25 = v49, s26 = v50, s27 = v51, s28 = v52, s29 = v53, s30 = v54;\n L6: for (;;) {\n const v55 = s22;\n const v56 = s23;\n const v57 = s24;\n const v58 = s25;\n const v59 = s26;\n const v60 = s27;\n const v61 = s28;\n const v62 = s29;\n const v63 = s30;\n let s31 = v55, s32 = v56, s33 = v57, s34 = v58, s35 = v59, s36 = v60, s37 = v61, s38 = v62, s39 = v63;\n L7: {\n const v64 = s31;\n const v65 = s32;\n const v66 = s33;\n const v67 = s34;\n const v68 = s35;\n const v69 = s36;\n const v70 = s37;\n const v71 = s38;\n const v72 = s39;\n const v73 = ((((((2144 + (((v3 + v64) | 0) << 6)) | 0) + (v13 << 10)) | 0) + (Math.imul(v7, v8) << 6)) | 0);\n const v74 = memory_i32[(((v73) >>> 0) + 0) >>> 2];\n const v75 = ((4 + v73) | 0);\n const v76 = memory_i32[(((v75) >>> 0) + 0) >>> 2];\n const v77 = ((4 + v75) | 0);\n const v78 = memory_i32[(((v77) >>> 0) + 0) >>> 2];\n const v79 = ((4 + v77) | 0);\n const v80 = memory_i32[(((v79) >>> 0) + 0) >>> 2];\n const v81 = ((4 + v79) | 0);\n const v82 = memory_i32[(((v81) >>> 0) + 0) >>> 2];\n const v83 = ((4 + v81) | 0);\n const v84 = memory_i32[(((v83) >>> 0) + 0) >>> 2];\n const v85 = ((4 + v83) | 0);\n const v86 = memory_i32[(((v85) >>> 0) + 0) >>> 2];\n const v87 = ((4 + v85) | 0);\n const v88 = memory_i32[(((v87) >>> 0) + 0) >>> 2];\n const v89 = ((4 + v87) | 0);\n const v90 = memory_i32[(((v89) >>> 0) + 0) >>> 2];\n const v91 = ((4 + v89) | 0);\n const v92 = memory_i32[(((v91) >>> 0) + 0) >>> 2];\n const v93 = ((4 + v91) | 0);\n const v94 = memory_i32[(((v93) >>> 0) + 0) >>> 2];\n const v95 = ((4 + v93) | 0);\n const v96 = memory_i32[(((v95) >>> 0) + 0) >>> 2];\n const v97 = ((4 + v95) | 0);\n const v98 = memory_i32[(((v97) >>> 0) + 0) >>> 2];\n const v99 = ((4 + v97) | 0);\n const v100 = memory_i32[(((v99) >>> 0) + 0) >>> 2];\n const v101 = ((4 + v99) | 0);\n const v102 = memory_i32[(((v101) >>> 0) + 0) >>> 2];\n const v103 = memory_i32[(((((4 + v101) | 0)) >>> 0) + 0) >>> 2];\n memory_i32[(((v73) >>> 0) + 0) >>> 2] = 0;\n const v104 = ((4 + v73) | 0);\n memory_i32[(((v104) >>> 0) + 0) >>> 2] = 0;\n const v105 = ((4 + v104) | 0);\n memory_i32[(((v105) >>> 0) + 0) >>> 2] = 0;\n const v106 = ((4 + v105) | 0);\n memory_i32[(((v106) >>> 0) + 0) >>> 2] = 0;\n const v107 = ((4 + v106) | 0);\n memory_i32[(((v107) >>> 0) + 0) >>> 2] = 0;\n const v108 = ((4 + v107) | 0);\n memory_i32[(((v108) >>> 0) + 0) >>> 2] = 0;\n const v109 = ((4 + v108) | 0);\n memory_i32[(((v109) >>> 0) + 0) >>> 2] = 0;\n const v110 = ((4 + v109) | 0);\n memory_i32[(((v110) >>> 0) + 0) >>> 2] = 0;\n const v111 = ((4 + v110) | 0);\n memory_i32[(((v111) >>> 0) + 0) >>> 2] = 0;\n const v112 = ((4 + v111) | 0);\n memory_i32[(((v112) >>> 0) + 0) >>> 2] = 0;\n const v113 = ((4 + v112) | 0);\n memory_i32[(((v113) >>> 0) + 0) >>> 2] = 0;\n const v114 = ((4 + v113) | 0);\n memory_i32[(((v114) >>> 0) + 0) >>> 2] = 0;\n const v115 = ((4 + v114) | 0);\n memory_i32[(((v115) >>> 0) + 0) >>> 2] = 0;\n const v116 = ((4 + v115) | 0);\n memory_i32[(((v116) >>> 0) + 0) >>> 2] = 0;\n const v117 = ((4 + v116) | 0);\n memory_i32[(((v117) >>> 0) + 0) >>> 2] = 0;\n memory_i32[(((((4 + v117) | 0)) >>> 0) + 0) >>> 2] = 0;\n const v118 = ((((v74 + v69) | 0) + v65) | 0);\n const v119 = ((((v118 ^ v35) >>> 16) | ((v118 ^ v35) << (32 - 16))));\n const v120 = ((v119 + 1779033703) | 0);\n const v121 = ((((v120 ^ v69) >>> 12) | ((v120 ^ v69) << (32 - 12))));\n const v122 = ((((v76 + v121) | 0) + v118) | 0);\n const v123 = ((((v122 ^ v119) >>> 8) | ((v122 ^ v119) << (32 - 8))));\n const v124 = ((v123 + v120) | 0);\n const v125 = ((((v124 ^ v121) >>> 7) | ((v124 ^ v121) << (32 - 7))));\n const v126 = ((((v78 + v70) | 0) + v66) | 0);\n const v127 = ((((v126 ^ v36) >>> 16) | ((v126 ^ v36) << (32 - 16))));\n const v128 = ((v127 + -1150833019) | 0);\n const v129 = ((((v128 ^ v70) >>> 12) | ((v128 ^ v70) << (32 - 12))));\n const v130 = ((((v80 + v129) | 0) + v126) | 0);\n const v131 = ((((v130 ^ v127) >>> 8) | ((v130 ^ v127) << (32 - 8))));\n const v132 = ((v131 + v128) | 0);\n const v133 = ((((v132 ^ v129) >>> 7) | ((v132 ^ v129) << (32 - 7))));\n const v134 = ((((v82 + v71) | 0) + v67) | 0);\n const v135 = ((((v134 ^ ((v4 - ((((((v13) | 0) === ((v5) | 0)) | 0)) ? (((((((v64) | 0) === ((15) | 0)) | 0)) ? (v6) : (0))) : (0))) | 0)) >>> 16) | ((v134 ^ ((v4 - ((((((v13) | 0) === ((v5) | 0)) | 0)) ? (((((((v64) | 0) === ((15) | 0)) | 0)) ? (v6) : (0))) : (0))) | 0)) << (32 - 16))));\n const v136 = ((v135 + 1013904242) | 0);\n const v137 = ((((v136 ^ v71) >>> 12) | ((v136 ^ v71) << (32 - 12))));\n const v138 = ((((v84 + v137) | 0) + v134) | 0);\n const v139 = ((((v138 ^ v135) >>> 8) | ((v138 ^ v135) << (32 - 8))));\n const v140 = ((v139 + v136) | 0);\n const v141 = ((((v140 ^ v137) >>> 7) | ((v140 ^ v137) << (32 - 7))));\n const v142 = ((((v86 + v72) | 0) + v68) | 0);\n const v143 = ((((v142 ^ ((((((v64) | 0) === 0) | 0)) ? (v17) : (((((((v64) | 0) === ((15) | 0)) | 0)) ? (v18) : (v16))))) >>> 16) | ((v142 ^ ((((((v64) | 0) === 0) | 0)) ? (v17) : (((((((v64) | 0) === ((15) | 0)) | 0)) ? (v18) : (v16))))) << (32 - 16))));\n const v144 = ((v143 + -1521486534) | 0);\n const v145 = ((((v144 ^ v72) >>> 12) | ((v144 ^ v72) << (32 - 12))));\n const v146 = ((((v88 + v145) | 0) + v142) | 0);\n const v147 = ((((v146 ^ v143) >>> 8) | ((v146 ^ v143) << (32 - 8))));\n const v148 = ((v147 + v144) | 0);\n const v149 = ((((v148 ^ v145) >>> 7) | ((v148 ^ v145) << (32 - 7))));\n const v150 = ((((v90 + v133) | 0) + v122) | 0);\n const v151 = ((((v150 ^ v147) >>> 16) | ((v150 ^ v147) << (32 - 16))));\n const v152 = ((v151 + v140) | 0);\n const v153 = ((((v152 ^ v133) >>> 12) | ((v152 ^ v133) << (32 - 12))));\n const v154 = ((((v92 + v153) | 0) + v150) | 0);\n const v155 = ((((v154 ^ v151) >>> 8) | ((v154 ^ v151) << (32 - 8))));\n const v156 = ((v155 + v152) | 0);\n const v157 = ((((v156 ^ v153) >>> 7) | ((v156 ^ v153) << (32 - 7))));\n const v158 = ((((v94 + v141) | 0) + v130) | 0);\n const v159 = ((((v158 ^ v123) >>> 16) | ((v158 ^ v123) << (32 - 16))));\n const v160 = ((v159 + v148) | 0);\n const v161 = ((((v160 ^ v141) >>> 12) | ((v160 ^ v141) << (32 - 12))));\n const v162 = ((((v96 + v161) | 0) + v158) | 0);\n const v163 = ((((v162 ^ v159) >>> 8) | ((v162 ^ v159) << (32 - 8))));\n const v164 = ((v163 + v160) | 0);\n const v165 = ((((v164 ^ v161) >>> 7) | ((v164 ^ v161) << (32 - 7))));\n const v166 = ((((v98 + v149) | 0) + v138) | 0);\n const v167 = ((((v166 ^ v131) >>> 16) | ((v166 ^ v131) << (32 - 16))));\n const v168 = ((v167 + v124) | 0);\n const v169 = ((((v168 ^ v149) >>> 12) | ((v168 ^ v149) << (32 - 12))));\n const v170 = ((((v100 + v169) | 0) + v166) | 0);\n const v171 = ((((v170 ^ v167) >>> 8) | ((v170 ^ v167) << (32 - 8))));\n const v172 = ((v171 + v168) | 0);\n const v173 = ((((v172 ^ v169) >>> 7) | ((v172 ^ v169) << (32 - 7))));\n const v174 = ((((v102 + v125) | 0) + v146) | 0);\n const v175 = ((((v174 ^ v139) >>> 16) | ((v174 ^ v139) << (32 - 16))));\n const v176 = ((v175 + v132) | 0);\n const v177 = ((((v176 ^ v125) >>> 12) | ((v176 ^ v125) << (32 - 12))));\n const v178 = ((((v103 + v177) | 0) + v174) | 0);\n const v179 = ((((v178 ^ v175) >>> 8) | ((v178 ^ v175) << (32 - 8))));\n const v180 = ((v179 + v176) | 0);\n const v181 = ((((v180 ^ v177) >>> 7) | ((v180 ^ v177) << (32 - 7))));\n const v182 = ((((v78 + v181) | 0) + v154) | 0);\n const v183 = ((((v182 ^ v163) >>> 16) | ((v182 ^ v163) << (32 - 16))));\n const v184 = ((v183 + v172) | 0);\n const v185 = ((((v184 ^ v181) >>> 12) | ((v184 ^ v181) << (32 - 12))));\n const v186 = ((((v86 + v185) | 0) + v182) | 0);\n const v187 = ((((v186 ^ v183) >>> 8) | ((v186 ^ v183) << (32 - 8))));\n const v188 = ((v187 + v184) | 0);\n const v189 = ((((v188 ^ v185) >>> 7) | ((v188 ^ v185) << (32 - 7))));\n const v190 = ((((v80 + v157) | 0) + v162) | 0);\n const v191 = ((((v190 ^ v171) >>> 16) | ((v190 ^ v171) << (32 - 16))));\n const v192 = ((v191 + v180) | 0);\n const v193 = ((((v192 ^ v157) >>> 12) | ((v192 ^ v157) << (32 - 12))));\n const v194 = ((((v94 + v193) | 0) + v190) | 0);\n const v195 = ((((v194 ^ v191) >>> 8) | ((v194 ^ v191) << (32 - 8))));\n const v196 = ((v195 + v192) | 0);\n const v197 = ((((v196 ^ v193) >>> 7) | ((v196 ^ v193) << (32 - 7))));\n const v198 = ((((v88 + v165) | 0) + v170) | 0);\n const v199 = ((((v198 ^ v179) >>> 16) | ((v198 ^ v179) << (32 - 16))));\n const v200 = ((v199 + v156) | 0);\n const v201 = ((((v200 ^ v165) >>> 12) | ((v200 ^ v165) << (32 - 12))));\n const v202 = ((((v74 + v201) | 0) + v198) | 0);\n const v203 = ((((v202 ^ v199) >>> 8) | ((v202 ^ v199) << (32 - 8))));\n const v204 = ((v203 + v200) | 0);\n const v205 = ((((v204 ^ v201) >>> 7) | ((v204 ^ v201) << (32 - 7))));\n const v206 = ((((v82 + v173) | 0) + v178) | 0);\n const v207 = ((((v206 ^ v155) >>> 16) | ((v206 ^ v155) << (32 - 16))));\n const v208 = ((v207 + v164) | 0);\n const v209 = ((((v208 ^ v173) >>> 12) | ((v208 ^ v173) << (32 - 12))));\n const v210 = ((((v100 + v209) | 0) + v206) | 0);\n const v211 = ((((v210 ^ v207) >>> 8) | ((v210 ^ v207) << (32 - 8))));\n const v212 = ((v211 + v208) | 0);\n const v213 = ((((v212 ^ v209) >>> 7) | ((v212 ^ v209) << (32 - 7))));\n const v214 = ((((v76 + v197) | 0) + v186) | 0);\n const v215 = ((((v214 ^ v211) >>> 16) | ((v214 ^ v211) << (32 - 16))));\n const v216 = ((v215 + v204) | 0);\n const v217 = ((((v216 ^ v197) >>> 12) | ((v216 ^ v197) << (32 - 12))));\n const v218 = ((((v96 + v217) | 0) + v214) | 0);\n const v219 = ((((v218 ^ v215) >>> 8) | ((v218 ^ v215) << (32 - 8))));\n const v220 = ((v219 + v216) | 0);\n const v221 = ((((v220 ^ v217) >>> 7) | ((v220 ^ v217) << (32 - 7))));\n const v222 = ((((v98 + v205) | 0) + v194) | 0);\n const v223 = ((((v222 ^ v187) >>> 16) | ((v222 ^ v187) << (32 - 16))));\n const v224 = ((v223 + v212) | 0);\n const v225 = ((((v224 ^ v205) >>> 12) | ((v224 ^ v205) << (32 - 12))));\n const v226 = ((((v84 + v225) | 0) + v222) | 0);\n const v227 = ((((v226 ^ v223) >>> 8) | ((v226 ^ v223) << (32 - 8))));\n const v228 = ((v227 + v224) | 0);\n const v229 = ((((v228 ^ v225) >>> 7) | ((v228 ^ v225) << (32 - 7))));\n const v230 = ((((v92 + v213) | 0) + v202) | 0);\n const v231 = ((((v230 ^ v195) >>> 16) | ((v230 ^ v195) << (32 - 16))));\n const v232 = ((v231 + v188) | 0);\n const v233 = ((((v232 ^ v213) >>> 12) | ((v232 ^ v213) << (32 - 12))));\n const v234 = ((((v102 + v233) | 0) + v230) | 0);\n const v235 = ((((v234 ^ v231) >>> 8) | ((v234 ^ v231) << (32 - 8))));\n const v236 = ((v235 + v232) | 0);\n const v237 = ((((v236 ^ v233) >>> 7) | ((v236 ^ v233) << (32 - 7))));\n const v238 = ((((v103 + v189) | 0) + v210) | 0);\n const v239 = ((((v238 ^ v203) >>> 16) | ((v238 ^ v203) << (32 - 16))));\n const v240 = ((v239 + v196) | 0);\n const v241 = ((((v240 ^ v189) >>> 12) | ((v240 ^ v189) << (32 - 12))));\n const v242 = ((((v90 + v241) | 0) + v238) | 0);\n const v243 = ((((v242 ^ v239) >>> 8) | ((v242 ^ v239) << (32 - 8))));\n const v244 = ((v243 + v240) | 0);\n const v245 = ((((v244 ^ v241) >>> 7) | ((v244 ^ v241) << (32 - 7))));\n const v246 = ((((v80 + v245) | 0) + v218) | 0);\n const v247 = ((((v246 ^ v227) >>> 16) | ((v246 ^ v227) << (32 - 16))));\n const v248 = ((v247 + v236) | 0);\n const v249 = ((((v248 ^ v245) >>> 12) | ((v248 ^ v245) << (32 - 12))));\n const v250 = ((((v82 + v249) | 0) + v246) | 0);\n const v251 = ((((v250 ^ v247) >>> 8) | ((v250 ^ v247) << (32 - 8))));\n const v252 = ((v251 + v248) | 0);\n const v253 = ((((v252 ^ v249) >>> 7) | ((v252 ^ v249) << (32 - 7))));\n const v254 = ((((v94 + v221) | 0) + v226) | 0);\n const v255 = ((((v254 ^ v235) >>> 16) | ((v254 ^ v235) << (32 - 16))));\n const v256 = ((v255 + v244) | 0);\n const v257 = ((((v256 ^ v221) >>> 12) | ((v256 ^ v221) << (32 - 12))));\n const v258 = ((((v98 + v257) | 0) + v254) | 0);\n const v259 = ((((v258 ^ v255) >>> 8) | ((v258 ^ v255) << (32 - 8))));\n const v260 = ((v259 + v256) | 0);\n const v261 = ((((v260 ^ v257) >>> 7) | ((v260 ^ v257) << (32 - 7))));\n const v262 = ((((v100 + v229) | 0) + v234) | 0);\n const v263 = ((((v262 ^ v243) >>> 16) | ((v262 ^ v243) << (32 - 16))));\n const v264 = ((v263 + v220) | 0);\n const v265 = ((((v264 ^ v229) >>> 12) | ((v264 ^ v229) << (32 - 12))));\n const v266 = ((((v78 + v265) | 0) + v262) | 0);\n const v267 = ((((v266 ^ v263) >>> 8) | ((v266 ^ v263) << (32 - 8))));\n const v268 = ((v267 + v264) | 0);\n const v269 = ((((v268 ^ v265) >>> 7) | ((v268 ^ v265) << (32 - 7))));\n const v270 = ((((v88 + v237) | 0) + v242) | 0);\n const v271 = ((((v270 ^ v219) >>> 16) | ((v270 ^ v219) << (32 - 16))));\n const v272 = ((v271 + v228) | 0);\n const v273 = ((((v272 ^ v237) >>> 12) | ((v272 ^ v237) << (32 - 12))));\n const v274 = ((((v102 + v273) | 0) + v270) | 0);\n const v275 = ((((v274 ^ v271) >>> 8) | ((v274 ^ v271) << (32 - 8))));\n const v276 = ((v275 + v272) | 0);\n const v277 = ((((v276 ^ v273) >>> 7) | ((v276 ^ v273) << (32 - 7))));\n const v278 = ((((v86 + v261) | 0) + v250) | 0);\n const v279 = ((((v278 ^ v275) >>> 16) | ((v278 ^ v275) << (32 - 16))));\n const v280 = ((v279 + v268) | 0);\n const v281 = ((((v280 ^ v261) >>> 12) | ((v280 ^ v261) << (32 - 12))));\n const v282 = ((((v84 + v281) | 0) + v278) | 0);\n const v283 = ((((v282 ^ v279) >>> 8) | ((v282 ^ v279) << (32 - 8))));\n const v284 = ((v283 + v280) | 0);\n const v285 = ((((v284 ^ v281) >>> 7) | ((v284 ^ v281) << (32 - 7))));\n const v286 = ((((v92 + v269) | 0) + v258) | 0);\n const v287 = ((((v286 ^ v251) >>> 16) | ((v286 ^ v251) << (32 - 16))));\n const v288 = ((v287 + v276) | 0);\n const v289 = ((((v288 ^ v269) >>> 12) | ((v288 ^ v269) << (32 - 12))));\n const v290 = ((((v74 + v289) | 0) + v286) | 0);\n const v291 = ((((v290 ^ v287) >>> 8) | ((v290 ^ v287) << (32 - 8))));\n const v292 = ((v291 + v288) | 0);\n const v293 = ((((v292 ^ v289) >>> 7) | ((v292 ^ v289) << (32 - 7))));\n const v294 = ((((v96 + v277) | 0) + v266) | 0);\n const v295 = ((((v294 ^ v259) >>> 16) | ((v294 ^ v259) << (32 - 16))));\n const v296 = ((v295 + v252) | 0);\n const v297 = ((((v296 ^ v277) >>> 12) | ((v296 ^ v277) << (32 - 12))));\n const v298 = ((((v103 + v297) | 0) + v294) | 0);\n const v299 = ((((v298 ^ v295) >>> 8) | ((v298 ^ v295) << (32 - 8))));\n const v300 = ((v299 + v296) | 0);\n const v301 = ((((v300 ^ v297) >>> 7) | ((v300 ^ v297) << (32 - 7))));\n const v302 = ((((v90 + v253) | 0) + v274) | 0);\n const v303 = ((((v302 ^ v267) >>> 16) | ((v302 ^ v267) << (32 - 16))));\n const v304 = ((v303 + v260) | 0);\n const v305 = ((((v304 ^ v253) >>> 12) | ((v304 ^ v253) << (32 - 12))));\n const v306 = ((((v76 + v305) | 0) + v302) | 0);\n const v307 = ((((v306 ^ v303) >>> 8) | ((v306 ^ v303) << (32 - 8))));\n const v308 = ((v307 + v304) | 0);\n const v309 = ((((v308 ^ v305) >>> 7) | ((v308 ^ v305) << (32 - 7))));\n const v310 = ((((v94 + v309) | 0) + v282) | 0);\n const v311 = ((((v310 ^ v291) >>> 16) | ((v310 ^ v291) << (32 - 16))));\n const v312 = ((v311 + v300) | 0);\n const v313 = ((((v312 ^ v309) >>> 12) | ((v312 ^ v309) << (32 - 12))));\n const v314 = ((((v88 + v313) | 0) + v310) | 0);\n const v315 = ((((v314 ^ v311) >>> 8) | ((v314 ^ v311) << (32 - 8))));\n const v316 = ((v315 + v312) | 0);\n const v317 = ((((v316 ^ v313) >>> 7) | ((v316 ^ v313) << (32 - 7))));\n const v318 = ((((v98 + v285) | 0) + v290) | 0);\n const v319 = ((((v318 ^ v299) >>> 16) | ((v318 ^ v299) << (32 - 16))));\n const v320 = ((v319 + v308) | 0);\n const v321 = ((((v320 ^ v285) >>> 12) | ((v320 ^ v285) << (32 - 12))));\n const v322 = ((((v92 + v321) | 0) + v318) | 0);\n const v323 = ((((v322 ^ v319) >>> 8) | ((v322 ^ v319) << (32 - 8))));\n const v324 = ((v323 + v320) | 0);\n const v325 = ((((v324 ^ v321) >>> 7) | ((v324 ^ v321) << (32 - 7))));\n const v326 = ((((v102 + v293) | 0) + v298) | 0);\n const v327 = ((((v326 ^ v307) >>> 16) | ((v326 ^ v307) << (32 - 16))));\n const v328 = ((v327 + v284) | 0);\n const v329 = ((((v328 ^ v293) >>> 12) | ((v328 ^ v293) << (32 - 12))));\n const v330 = ((((v80 + v329) | 0) + v326) | 0);\n const v331 = ((((v330 ^ v327) >>> 8) | ((v330 ^ v327) << (32 - 8))));\n const v332 = ((v331 + v328) | 0);\n const v333 = ((((v332 ^ v329) >>> 7) | ((v332 ^ v329) << (32 - 7))));\n const v334 = ((((v100 + v301) | 0) + v306) | 0);\n const v335 = ((((v334 ^ v283) >>> 16) | ((v334 ^ v283) << (32 - 16))));\n const v336 = ((v335 + v292) | 0);\n const v337 = ((((v336 ^ v301) >>> 12) | ((v336 ^ v301) << (32 - 12))));\n const v338 = ((((v103 + v337) | 0) + v334) | 0);\n const v339 = ((((v338 ^ v335) >>> 8) | ((v338 ^ v335) << (32 - 8))));\n const v340 = ((v339 + v336) | 0);\n const v341 = ((((v340 ^ v337) >>> 7) | ((v340 ^ v337) << (32 - 7))));\n const v342 = ((((v82 + v325) | 0) + v314) | 0);\n const v343 = ((((v342 ^ v339) >>> 16) | ((v342 ^ v339) << (32 - 16))));\n const v344 = ((v343 + v332) | 0);\n const v345 = ((((v344 ^ v325) >>> 12) | ((v344 ^ v325) << (32 - 12))));\n const v346 = ((((v74 + v345) | 0) + v342) | 0);\n const v347 = ((((v346 ^ v343) >>> 8) | ((v346 ^ v343) << (32 - 8))));\n const v348 = ((v347 + v344) | 0);\n const v349 = ((((v348 ^ v345) >>> 7) | ((v348 ^ v345) << (32 - 7))));\n const v350 = ((((v96 + v333) | 0) + v322) | 0);\n const v351 = ((((v350 ^ v315) >>> 16) | ((v350 ^ v315) << (32 - 16))));\n const v352 = ((v351 + v340) | 0);\n const v353 = ((((v352 ^ v333) >>> 12) | ((v352 ^ v333) << (32 - 12))));\n const v354 = ((((v78 + v353) | 0) + v350) | 0);\n const v355 = ((((v354 ^ v351) >>> 8) | ((v354 ^ v351) << (32 - 8))));\n const v356 = ((v355 + v352) | 0);\n const v357 = ((((v356 ^ v353) >>> 7) | ((v356 ^ v353) << (32 - 7))));\n const v358 = ((((v84 + v341) | 0) + v330) | 0);\n const v359 = ((((v358 ^ v323) >>> 16) | ((v358 ^ v323) << (32 - 16))));\n const v360 = ((v359 + v316) | 0);\n const v361 = ((((v360 ^ v341) >>> 12) | ((v360 ^ v341) << (32 - 12))));\n const v362 = ((((v90 + v361) | 0) + v358) | 0);\n const v363 = ((((v362 ^ v359) >>> 8) | ((v362 ^ v359) << (32 - 8))));\n const v364 = ((v363 + v360) | 0);\n const v365 = ((((v364 ^ v361) >>> 7) | ((v364 ^ v361) << (32 - 7))));\n const v366 = ((((v76 + v317) | 0) + v338) | 0);\n const v367 = ((((v366 ^ v331) >>> 16) | ((v366 ^ v331) << (32 - 16))));\n const v368 = ((v367 + v324) | 0);\n const v369 = ((((v368 ^ v317) >>> 12) | ((v368 ^ v317) << (32 - 12))));\n const v370 = ((((v86 + v369) | 0) + v366) | 0);\n const v371 = ((((v370 ^ v367) >>> 8) | ((v370 ^ v367) << (32 - 8))));\n const v372 = ((v371 + v368) | 0);\n const v373 = ((((v372 ^ v369) >>> 7) | ((v372 ^ v369) << (32 - 7))));\n const v374 = ((((v98 + v373) | 0) + v346) | 0);\n const v375 = ((((v374 ^ v355) >>> 16) | ((v374 ^ v355) << (32 - 16))));\n const v376 = ((v375 + v364) | 0);\n const v377 = ((((v376 ^ v373) >>> 12) | ((v376 ^ v373) << (32 - 12))));\n const v378 = ((((v100 + v377) | 0) + v374) | 0);\n const v379 = ((((v378 ^ v375) >>> 8) | ((v378 ^ v375) << (32 - 8))));\n const v380 = ((v379 + v376) | 0);\n const v381 = ((((v380 ^ v377) >>> 7) | ((v380 ^ v377) << (32 - 7))));\n const v382 = ((((v92 + v349) | 0) + v354) | 0);\n const v383 = ((((v382 ^ v363) >>> 16) | ((v382 ^ v363) << (32 - 16))));\n const v384 = ((v383 + v372) | 0);\n const v385 = ((((v384 ^ v349) >>> 12) | ((v384 ^ v349) << (32 - 12))));\n const v386 = ((((v96 + v385) | 0) + v382) | 0);\n const v387 = ((((v386 ^ v383) >>> 8) | ((v386 ^ v383) << (32 - 8))));\n const v388 = ((v387 + v384) | 0);\n const v389 = ((((v388 ^ v385) >>> 7) | ((v388 ^ v385) << (32 - 7))));\n const v390 = ((((v103 + v357) | 0) + v362) | 0);\n const v391 = ((((v390 ^ v371) >>> 16) | ((v390 ^ v371) << (32 - 16))));\n const v392 = ((v391 + v348) | 0);\n const v393 = ((((v392 ^ v357) >>> 12) | ((v392 ^ v357) << (32 - 12))));\n const v394 = ((((v94 + v393) | 0) + v390) | 0);\n const v395 = ((((v394 ^ v391) >>> 8) | ((v394 ^ v391) << (32 - 8))));\n const v396 = ((v395 + v392) | 0);\n const v397 = ((((v396 ^ v393) >>> 7) | ((v396 ^ v393) << (32 - 7))));\n const v398 = ((((v102 + v365) | 0) + v370) | 0);\n const v399 = ((((v398 ^ v347) >>> 16) | ((v398 ^ v347) << (32 - 16))));\n const v400 = ((v399 + v356) | 0);\n const v401 = ((((v400 ^ v365) >>> 12) | ((v400 ^ v365) << (32 - 12))));\n const v402 = ((((v90 + v401) | 0) + v398) | 0);\n const v403 = ((((v402 ^ v399) >>> 8) | ((v402 ^ v399) << (32 - 8))));\n const v404 = ((v403 + v400) | 0);\n const v405 = ((((v404 ^ v401) >>> 7) | ((v404 ^ v401) << (32 - 7))));\n const v406 = ((((v88 + v389) | 0) + v378) | 0);\n const v407 = ((((v406 ^ v403) >>> 16) | ((v406 ^ v403) << (32 - 16))));\n const v408 = ((v407 + v396) | 0);\n const v409 = ((((v408 ^ v389) >>> 12) | ((v408 ^ v389) << (32 - 12))));\n const v410 = ((((v78 + v409) | 0) + v406) | 0);\n const v411 = ((((v410 ^ v407) >>> 8) | ((v410 ^ v407) << (32 - 8))));\n const v412 = ((v411 + v408) | 0);\n const v413 = ((((v412 ^ v409) >>> 7) | ((v412 ^ v409) << (32 - 7))));\n const v414 = ((((v84 + v397) | 0) + v386) | 0);\n const v415 = ((((v414 ^ v379) >>> 16) | ((v414 ^ v379) << (32 - 16))));\n const v416 = ((v415 + v404) | 0);\n const v417 = ((((v416 ^ v397) >>> 12) | ((v416 ^ v397) << (32 - 12))));\n const v418 = ((((v80 + v417) | 0) + v414) | 0);\n const v419 = ((((v418 ^ v415) >>> 8) | ((v418 ^ v415) << (32 - 8))));\n const v420 = ((v419 + v416) | 0);\n const v421 = ((((v420 ^ v417) >>> 7) | ((v420 ^ v417) << (32 - 7))));\n const v422 = ((((v74 + v405) | 0) + v394) | 0);\n const v423 = ((((v422 ^ v387) >>> 16) | ((v422 ^ v387) << (32 - 16))));\n const v424 = ((v423 + v380) | 0);\n const v425 = ((((v424 ^ v405) >>> 12) | ((v424 ^ v405) << (32 - 12))));\n const v426 = ((((v76 + v425) | 0) + v422) | 0);\n const v427 = ((((v426 ^ v423) >>> 8) | ((v426 ^ v423) << (32 - 8))));\n const v428 = ((v427 + v424) | 0);\n const v429 = ((((v428 ^ v425) >>> 7) | ((v428 ^ v425) << (32 - 7))));\n const v430 = ((((v86 + v381) | 0) + v402) | 0);\n const v431 = ((((v430 ^ v395) >>> 16) | ((v430 ^ v395) << (32 - 16))));\n const v432 = ((v431 + v388) | 0);\n const v433 = ((((v432 ^ v381) >>> 12) | ((v432 ^ v381) << (32 - 12))));\n const v434 = ((((v82 + v433) | 0) + v430) | 0);\n const v435 = ((((v434 ^ v431) >>> 8) | ((v434 ^ v431) << (32 - 8))));\n const v436 = ((v435 + v432) | 0);\n const v437 = ((((v436 ^ v433) >>> 7) | ((v436 ^ v433) << (32 - 7))));\n const v438 = ((((v92 + v437) | 0) + v410) | 0);\n const v439 = ((((v438 ^ v419) >>> 16) | ((v438 ^ v419) << (32 - 16))));\n const v440 = ((v439 + v428) | 0);\n const v441 = ((((v440 ^ v437) >>> 12) | ((v440 ^ v437) << (32 - 12))));\n const v442 = ((((v102 + v441) | 0) + v438) | 0);\n const v443 = ((((v442 ^ v439) >>> 8) | ((v442 ^ v439) << (32 - 8))));\n const v444 = ((v443 + v440) | 0);\n const v445 = ((((v444 ^ v441) >>> 7) | ((v444 ^ v441) << (32 - 7))));\n const v446 = ((((v96 + v413) | 0) + v418) | 0);\n const v447 = ((((v446 ^ v427) >>> 16) | ((v446 ^ v427) << (32 - 16))));\n const v448 = ((v447 + v436) | 0);\n const v449 = ((((v448 ^ v413) >>> 12) | ((v448 ^ v413) << (32 - 12))));\n const v450 = ((((v84 + v449) | 0) + v446) | 0);\n const v451 = ((((v450 ^ v447) >>> 8) | ((v450 ^ v447) << (32 - 8))));\n const v452 = ((v451 + v448) | 0);\n const v453 = ((((v452 ^ v449) >>> 7) | ((v452 ^ v449) << (32 - 7))));\n const v454 = ((((v90 + v421) | 0) + v426) | 0);\n const v455 = ((((v454 ^ v435) >>> 16) | ((v454 ^ v435) << (32 - 16))));\n const v456 = ((v455 + v412) | 0);\n const v457 = ((((v456 ^ v421) >>> 12) | ((v456 ^ v421) << (32 - 12))));\n const v458 = ((((v98 + v457) | 0) + v454) | 0);\n const v459 = ((((v458 ^ v455) >>> 8) | ((v458 ^ v455) << (32 - 8))));\n const v460 = ((v459 + v456) | 0);\n const v461 = ((((v460 ^ v457) >>> 7) | ((v460 ^ v457) << (32 - 7))));\n const v462 = ((((v103 + v429) | 0) + v434) | 0);\n const v463 = ((((v462 ^ v411) >>> 16) | ((v462 ^ v411) << (32 - 16))));\n const v464 = ((v463 + v420) | 0);\n const v465 = ((((v464 ^ v429) >>> 12) | ((v464 ^ v429) << (32 - 12))));\n const v466 = ((((v76 + v465) | 0) + v462) | 0);\n const v467 = ((((v466 ^ v463) >>> 8) | ((v466 ^ v463) << (32 - 8))));\n const v468 = ((v467 + v464) | 0);\n const v469 = ((((v468 ^ v465) >>> 7) | ((v468 ^ v465) << (32 - 7))));\n const v470 = ((((v100 + v453) | 0) + v442) | 0);\n const v471 = ((((v470 ^ v467) >>> 16) | ((v470 ^ v467) << (32 - 16))));\n const v472 = ((v471 + v460) | 0);\n const v473 = ((((v472 ^ v453) >>> 12) | ((v472 ^ v453) << (32 - 12))));\n const v474 = ((((v80 + v473) | 0) + v470) | 0);\n const v475 = ((((v474 ^ v471) >>> 8) | ((v474 ^ v471) << (32 - 8))));\n const v476 = ((v475 + v472) | 0);\n const v477 = ((((v476 ^ v473) >>> 7) | ((v476 ^ v473) << (32 - 7))));\n const v478 = ((((v74 + v461) | 0) + v450) | 0);\n const v479 = ((((v478 ^ v443) >>> 16) | ((v478 ^ v443) << (32 - 16))));\n const v480 = ((v479 + v468) | 0);\n const v481 = ((((v480 ^ v461) >>> 12) | ((v480 ^ v461) << (32 - 12))));\n const v482 = ((((v94 + v481) | 0) + v478) | 0);\n const v483 = ((((v482 ^ v479) >>> 8) | ((v482 ^ v479) << (32 - 8))));\n const v484 = ((v483 + v480) | 0);\n const v485 = ((((v484 ^ v481) >>> 7) | ((v484 ^ v481) << (32 - 7))));\n const v486 = ((((v78 + v469) | 0) + v458) | 0);\n const v487 = ((((v486 ^ v451) >>> 16) | ((v486 ^ v451) << (32 - 16))));\n const v488 = ((v487 + v444) | 0);\n const v489 = ((((v488 ^ v469) >>> 12) | ((v488 ^ v469) << (32 - 12))));\n const v490 = ((((v86 + v489) | 0) + v486) | 0);\n const v491 = ((((v490 ^ v487) >>> 8) | ((v490 ^ v487) << (32 - 8))));\n const v492 = ((v491 + v488) | 0);\n const v493 = ((((v492 ^ v489) >>> 7) | ((v492 ^ v489) << (32 - 7))));\n const v494 = ((((v82 + v445) | 0) + v466) | 0);\n const v495 = ((((v494 ^ v459) >>> 16) | ((v494 ^ v459) << (32 - 16))));\n const v496 = ((v495 + v452) | 0);\n const v497 = ((((v496 ^ v445) >>> 12) | ((v496 ^ v445) << (32 - 12))));\n const v498 = ((((v88 + v497) | 0) + v494) | 0);\n const v499 = ((((v498 ^ v495) >>> 8) | ((v498 ^ v495) << (32 - 8))));\n const v500 = ((v499 + v496) | 0);\n const v501 = ((((v500 ^ v497) >>> 7) | ((v500 ^ v497) << (32 - 7))));\n const v502 = ((((v96 + v501) | 0) + v474) | 0);\n const v503 = ((((v502 ^ v483) >>> 16) | ((v502 ^ v483) << (32 - 16))));\n const v504 = ((v503 + v492) | 0);\n const v505 = ((((v504 ^ v501) >>> 12) | ((v504 ^ v501) << (32 - 12))));\n const v506 = ((((v103 + v505) | 0) + v502) | 0);\n const v507 = ((((v506 ^ v503) >>> 8) | ((v506 ^ v503) << (32 - 8))));\n const v508 = ((v507 + v504) | 0);\n const v509 = ((((v508 ^ v505) >>> 7) | ((v508 ^ v505) << (32 - 7))));\n const v510 = ((((v84 + v477) | 0) + v482) | 0);\n const v511 = ((((v510 ^ v491) >>> 16) | ((v510 ^ v491) << (32 - 16))));\n const v512 = ((v511 + v500) | 0);\n const v513 = ((((v512 ^ v477) >>> 12) | ((v512 ^ v477) << (32 - 12))));\n const v514 = ((((v74 + v513) | 0) + v510) | 0);\n const v515 = ((((v514 ^ v511) >>> 8) | ((v514 ^ v511) << (32 - 8))));\n const v516 = ((v515 + v512) | 0);\n const v517 = ((((v516 ^ v513) >>> 7) | ((v516 ^ v513) << (32 - 7))));\n const v518 = ((((v76 + v485) | 0) + v490) | 0);\n const v519 = ((((v518 ^ v499) >>> 16) | ((v518 ^ v499) << (32 - 16))));\n const v520 = ((v519 + v476) | 0);\n const v521 = ((((v520 ^ v485) >>> 12) | ((v520 ^ v485) << (32 - 12))));\n const v522 = ((((v92 + v521) | 0) + v518) | 0);\n const v523 = ((((v522 ^ v519) >>> 8) | ((v522 ^ v519) << (32 - 8))));\n const v524 = ((v523 + v520) | 0);\n const v525 = ((((v524 ^ v521) >>> 7) | ((v524 ^ v521) << (32 - 7))));\n const v526 = ((((v90 + v493) | 0) + v498) | 0);\n const v527 = ((((v526 ^ v475) >>> 16) | ((v526 ^ v475) << (32 - 16))));\n const v528 = ((v527 + v484) | 0);\n const v529 = ((((v528 ^ v493) >>> 12) | ((v528 ^ v493) << (32 - 12))));\n const v530 = ((((v86 + v529) | 0) + v526) | 0);\n const v531 = ((((v530 ^ v527) >>> 8) | ((v530 ^ v527) << (32 - 8))));\n const v532 = ((v531 + v528) | 0);\n const v533 = ((((v532 ^ v529) >>> 7) | ((v532 ^ v529) << (32 - 7))));\n const v534 = ((((v102 + v517) | 0) + v506) | 0);\n const v535 = ((((v534 ^ v531) >>> 16) | ((v534 ^ v531) << (32 - 16))));\n const v536 = ((v535 + v524) | 0);\n const v537 = ((((v536 ^ v517) >>> 12) | ((v536 ^ v517) << (32 - 12))));\n const v538 = ((((v94 + v537) | 0) + v534) | 0);\n const v539 = ((((v538 ^ v535) >>> 8) | ((v538 ^ v535) << (32 - 8))));\n const v540 = ((v539 + v536) | 0);\n const v541 = ((((v78 + v525) | 0) + v514) | 0);\n const v542 = ((((v541 ^ v507) >>> 16) | ((v541 ^ v507) << (32 - 16))));\n const v543 = ((v542 + v532) | 0);\n const v544 = ((((v543 ^ v525) >>> 12) | ((v543 ^ v525) << (32 - 12))));\n const v545 = ((((v98 + v544) | 0) + v541) | 0);\n const v546 = ((((v545 ^ v542) >>> 8) | ((v545 ^ v542) << (32 - 8))));\n const v547 = ((v546 + v543) | 0);\n const v548 = ((((v80 + v533) | 0) + v522) | 0);\n const v549 = ((((v548 ^ v515) >>> 16) | ((v548 ^ v515) << (32 - 16))));\n const v550 = ((v549 + v508) | 0);\n const v551 = ((((v550 ^ v533) >>> 12) | ((v550 ^ v533) << (32 - 12))));\n const v552 = ((((v82 + v551) | 0) + v548) | 0);\n const v553 = ((((v552 ^ v549) >>> 8) | ((v552 ^ v549) << (32 - 8))));\n const v554 = ((v553 + v550) | 0);\n const v555 = ((((v88 + v509) | 0) + v530) | 0);\n const v556 = ((((v555 ^ v523) >>> 16) | ((v555 ^ v523) << (32 - 16))));\n const v557 = ((v556 + v516) | 0);\n const v558 = ((((v557 ^ v509) >>> 12) | ((v557 ^ v509) << (32 - 12))));\n const v559 = ((((v100 + v558) | 0) + v555) | 0);\n const v560 = ((((v559 ^ v556) >>> 8) | ((v559 ^ v556) << (32 - 8))));\n const v561 = ((v560 + v557) | 0);\n const v562 = (v554 ^ v538);\n const v563 = (v561 ^ v545);\n const v564 = (v540 ^ v552);\n const v565 = (v547 ^ v559);\n const v566 = (v546 ^ ((((v561 ^ v558) >>> 7) | ((v561 ^ v558) << (32 - 7)))));\n const v567 = (v553 ^ ((((v540 ^ v537) >>> 7) | ((v540 ^ v537) << (32 - 7)))));\n const v568 = (v560 ^ ((((v547 ^ v544) >>> 7) | ((v547 ^ v544) << (32 - 7)))));\n const v569 = (v539 ^ ((((v554 ^ v551) >>> 7) | ((v554 ^ v551) << (32 - 7)))));\n s31 = v64;\n s32 = v562;\n s33 = v563;\n s34 = v564;\n s35 = v565;\n s36 = v566;\n s37 = v567;\n s38 = v568;\n s39 = v569;\n }\n const v64 = s31;\n const v65 = s32;\n const v66 = s33;\n const v67 = s34;\n const v68 = s35;\n const v69 = s36;\n const v70 = s37;\n const v71 = s38;\n const v72 = s39;\n const v570 = ((1 + v64) | 0);\n if (((((v570) >>> 0) < ((16) >>> 0)) | 0)) {\n s22 = v570;\n s23 = v65;\n s24 = v66;\n s25 = v67;\n s26 = v68;\n s27 = v69;\n s28 = v70;\n s29 = v71;\n s30 = v72;\n continue L6;\n }\n s22 = v570;\n s23 = v65;\n s24 = v66;\n s25 = v67;\n s26 = v68;\n s27 = v69;\n s28 = v70;\n s29 = v71;\n s30 = v72;\n break L6;\n }\n const v55 = s22;\n const v56 = s23;\n const v57 = s24;\n const v58 = s25;\n const v59 = s26;\n const v60 = s27;\n const v61 = s28;\n const v62 = s29;\n const v63 = s30;\n s13 = v55;\n s14 = v56;\n s15 = v57;\n s16 = v58;\n s17 = v59;\n s18 = v60;\n s19 = v61;\n s20 = v62;\n s21 = v63;\n }\n const v46 = s13;\n const v47 = s14;\n const v48 = s15;\n const v49 = s16;\n const v50 = s17;\n const v51 = s18;\n const v52 = s19;\n const v53 = s20;\n const v54 = s21;\n s4 = v46;\n s5 = v47;\n s6 = v48;\n s7 = v49;\n s8 = v50;\n s9 = v51;\n s10 = v52;\n s11 = v53;\n s12 = v54;\n }\n const v38 = s5;\n const v39 = s6;\n const v40 = s7;\n const v41 = s8;\n const v42 = s9;\n const v43 = s10;\n const v44 = s11;\n const v45 = s12;\n const v571 = ((10487904 + (v13 << 5)) | 0);\n memory_i32[(((v571) >>> 0) + 0) >>> 2] = v38;\n const v572 = ((4 + v571) | 0);\n memory_i32[(((v572) >>> 0) + 0) >>> 2] = v39;\n const v573 = ((4 + v572) | 0);\n memory_i32[(((v573) >>> 0) + 0) >>> 2] = v40;\n const v574 = ((4 + v573) | 0);\n memory_i32[(((v574) >>> 0) + 0) >>> 2] = v41;\n const v575 = ((4 + v574) | 0);\n memory_i32[(((v575) >>> 0) + 0) >>> 2] = v42;\n const v576 = ((4 + v575) | 0);\n memory_i32[(((v576) >>> 0) + 0) >>> 2] = v43;\n const v577 = ((4 + v576) | 0);\n memory_i32[(((v577) >>> 0) + 0) >>> 2] = v44;\n memory_i32[(((((4 + v577) | 0)) >>> 0) + 0) >>> 2] = v45;\n s3 = v12;\n }\n const v12 = s3;\n const v578 = ((1 + v12) | 0);\n if (((((v578) >>> 0) < ((v1) >>> 0)) | 0)) {\n s2 = v578;\n continue L2;\n }\n s2 = v578;\n break L2;\n }\n const v11 = s2;\n s1 = v11;\n }\n const v10 = s1;\n s0 = v10;\n }\n return;\n }\n function processBlocks(v0, v1, v2, v3, v4, v5, v6, v7) {\n const v8 = memory_i32[(((((20 + Math.imul(2144, v0)) | 0)) >>> 0) + 0) >>> 2];\n const v9 = memory_i32[(((((24 + Math.imul(2144, v0)) | 0)) >>> 0) + 0) >>> 2];\n const v10 = (((((((((v8 + v2) | 0)) >>> 0) <= ((16) >>> 0)) | 0) & ((((v9) | 0) === 0) | 0)) & ((((v2) | 0) !== ((0) | 0)) | 0)) & v5);\n const v11 = ((v2 - 1) | 0);\n const v12 = (((((v2) >>> 0) >= ((4096) >>> 0)) | 0) & (((((v1) | 0) === ((3) | 0)) | 0) | ((((v1) | 0) === ((2) | 0)) | 0)));\n const v13 = ((v10) ? (((v2 - 1) | 0)) : (v2));\n L0: {\n L1: {\n if (((((v12) | 0) === 0) | 0)) {\n break L1;\n }\n let s0 = 0;\n L2: {\n const v14 = s0;\n if (((((((((v14) >>> 0) < ((v1) >>> 0)) | 0)) | 0) === 0) | 0)) {\n s0 = v14;\n break L2;\n }\n let s1 = v14;\n L3: {\n const v15 = s1;\n let s2 = v15;\n L4: for (;;) {\n const v16 = s2;\n let s3 = v16;\n L5: {\n const v17 = s3;\n processBlocks(((v17 + v0) | 0), 1, v2, v3, v4, v5, v6, v7);\n s3 = v17;\n }\n const v17 = s3;\n const v18 = ((1 + v17) | 0);\n if (((((v18) >>> 0) < ((v1) >>> 0)) | 0)) {\n s2 = v18;\n continue L4;\n }\n s2 = v18;\n break L4;\n }\n const v16 = s2;\n s1 = v16;\n }\n const v15 = s1;\n s0 = v15;\n }\n break L0;\n }\n L6: {\n L7: {\n if (((((((((v1) >>> 0) > ((1) >>> 0)) | 0)) | 0) === 0) | 0)) {\n break L7;\n }\n if (((((v13) | 0) === 0) | 0)) {\n break L7;\n }\n proccessChunksParallel(v0, v1, v13, 0, v3, v4, (((((v10) | 0) === 0) | 0) & v5), v6);\n break L6;\n }\n const v19 = (Math.min(((16 - v8) | 0) >>> 0, v13 >>> 0) | 0);\n const v20 = (((((v19) | 0) !== ((0) | 0)) | 0) & ((((v8) | 0) !== ((0) | 0)) | 0));\n L8: {\n if (((((v20) | 0) === 0) | 0)) {\n break L8;\n }\n proccessChunksParallel(v0, v1, v19, 0, v3, v4, ((((((v10) | 0) === 0) | 0) & ((((v19) | 0) === ((v13) | 0)) | 0)) & v5), v6);\n }\n const v21 = ((v20) ? (((v13 - v19) | 0)) : (v13));\n const v22 = ((((((v21) >>> 0) / (((16) >>> 0)))) >>> 0));\n const v23 = ((v21 - (v22 << 4)) | 0);\n let s4 = ((v20) ? (v19) : (0));\n L9: {\n const v24 = s4;\n if (((((((((v21) | 0) !== ((0) | 0)) | 0)) | 0) === 0) | 0)) {\n s4 = v24;\n break L9;\n }\n const v25 = (((((((v23) | 0) === 0) | 0) & v5)) ? (((v22 - 1) | 0)) : (v22));\n let s5 = v24;\n L10: {\n const v26 = s5;\n if (((((((((v22) | 0) !== ((0) | 0)) | 0)) | 0) === 0) | 0)) {\n s5 = v26;\n break L10;\n }\n proccessChunksSequential(0, v22, 16, v26, v4, v25, v6, v3, v0);\n const v27 = (((v22 << 4) + v26) | 0);\n s5 = v27;\n }\n const v26 = s5;\n let s6 = 0;\n L11: {\n const v28 = s6;\n if (((((((((v28) >>> 0) < ((v22) >>> 0)) | 0)) | 0) === 0) | 0)) {\n s6 = v28;\n break L11;\n }\n let s7 = v28;\n L12: {\n const v29 = s7;\n let s8 = v29;\n L13: for (;;) {\n const v30 = s8;\n let s9 = v30;\n L14: {\n const v31 = s9;\n const v32 = ((10487904 + (v31 << 5)) | 0);\n const v33 = memory_i32[(((v32) >>> 0) + 0) >>> 2];\n const v34 = ((4 + v32) | 0);\n const v35 = memory_i32[(((v34) >>> 0) + 0) >>> 2];\n const v36 = ((4 + v34) | 0);\n const v37 = memory_i32[(((v36) >>> 0) + 0) >>> 2];\n const v38 = ((4 + v36) | 0);\n const v39 = memory_i32[(((v38) >>> 0) + 0) >>> 2];\n const v40 = ((4 + v38) | 0);\n const v41 = memory_i32[(((v40) >>> 0) + 0) >>> 2];\n const v42 = ((4 + v40) | 0);\n const v43 = memory_i32[(((v42) >>> 0) + 0) >>> 2];\n const v44 = ((4 + v42) | 0);\n const v45 = memory_i32[(((v44) >>> 0) + 0) >>> 2];\n const v46 = memory_i32[(((((4 + v44) | 0)) >>> 0) + 0) >>> 2];\n memory_i32[(((v32) >>> 0) + 0) >>> 2] = 0;\n const v47 = ((4 + v32) | 0);\n memory_i32[(((v47) >>> 0) + 0) >>> 2] = 0;\n const v48 = ((4 + v47) | 0);\n memory_i32[(((v48) >>> 0) + 0) >>> 2] = 0;\n const v49 = ((4 + v48) | 0);\n memory_i32[(((v49) >>> 0) + 0) >>> 2] = 0;\n const v50 = ((4 + v49) | 0);\n memory_i32[(((v50) >>> 0) + 0) >>> 2] = 0;\n const v51 = ((4 + v50) | 0);\n memory_i32[(((v51) >>> 0) + 0) >>> 2] = 0;\n const v52 = ((4 + v51) | 0);\n memory_i32[(((v52) >>> 0) + 0) >>> 2] = 0;\n memory_i32[(((((4 + v52) | 0)) >>> 0) + 0) >>> 2] = 0;\n const v53 = memory_i32[(((((24 + Math.imul(2144, v0)) | 0)) >>> 0) + 0) >>> 2];\n const v54 = ((((96 + (v53 << 5)) | 0) + Math.imul(2144, v0)) | 0);\n memory_i32[(((v54) >>> 0) + 0) >>> 2] = v33;\n const v55 = ((4 + v54) | 0);\n memory_i32[(((v55) >>> 0) + 0) >>> 2] = v35;\n const v56 = ((4 + v55) | 0);\n memory_i32[(((v56) >>> 0) + 0) >>> 2] = v37;\n const v57 = ((4 + v56) | 0);\n memory_i32[(((v57) >>> 0) + 0) >>> 2] = v39;\n const v58 = ((4 + v57) | 0);\n memory_i32[(((v58) >>> 0) + 0) >>> 2] = v41;\n const v59 = ((4 + v58) | 0);\n memory_i32[(((v59) >>> 0) + 0) >>> 2] = v43;\n const v60 = ((4 + v59) | 0);\n memory_i32[(((v60) >>> 0) + 0) >>> 2] = v45;\n memory_i32[(((((4 + v60) | 0)) >>> 0) + 0) >>> 2] = v46;\n compressParentsFull(v0, (((((v31) | 0) === ((v25) | 0)) | 0) & v5));\n s9 = v31;\n }\n const v31 = s9;\n const v61 = ((1 + v31) | 0);\n if (((((v61) >>> 0) < ((v22) >>> 0)) | 0)) {\n s8 = v61;\n continue L13;\n }\n s8 = v61;\n break L13;\n }\n const v30 = s8;\n s7 = v30;\n }\n const v29 = s7;\n s6 = v29;\n }\n s4 = v26;\n }\n const v24 = s4;\n L15: {\n if (((((((((v23) | 0) !== ((0) | 0)) | 0)) | 0) === 0) | 0)) {\n break L15;\n }\n proccessChunksParallel(v0, v1, v23, v24, v3, v4, (((((v10) | 0) === 0) | 0) & v5), v6);\n }\n }\n }\n L16: {\n if (((((((((v12) | 0) === 0) | 0)) | 0) === 0) | 0)) {\n break L16;\n }\n let s10 = 0;\n L17: {\n const v62 = s10;\n if (((((((((v62) >>> 0) < ((v1) >>> 0)) | 0)) | 0) === 0) | 0)) {\n s10 = v62;\n break L17;\n }\n let s11 = v62;\n L18: {\n const v63 = s11;\n let s12 = v63;\n L19: for (;;) {\n const v64 = s12;\n let s13 = v64;\n L20: {\n const v65 = s13;\n const v66 = ((v65 + v0) | 0);\n const v67 = memory_i32[(((((20 + Math.imul(2144, v66)) | 0)) >>> 0) + 0) >>> 2];\n L21: {\n if (((((((((v67) | 0) === 0) | 0)) | 0) === 0) | 0)) {\n break L21;\n }\n memory.copyWithin(((((64 + Math.imul(2144, v66)) | 0)) >>> 0), ((((32 + Math.imul(2144, v66)) | 0)) >>> 0), ((((32 + Math.imul(2144, v66)) | 0)) >>> 0) + 32);\n }\n L22: {\n if (((((v10) | 0) === 0) | 0)) {\n break L22;\n }\n const v68 = ((((2144 + (v11 << 6)) | 0) + (Math.imul(v3, ((v65 + v0) | 0)) << 6)) | 0);\n const v69 = memory_i32[(((v68) >>> 0) + 0) >>> 2];\n const v70 = ((4 + v68) | 0);\n const v71 = memory_i32[(((v70) >>> 0) + 0) >>> 2];\n const v72 = ((4 + v70) | 0);\n const v73 = memory_i32[(((v72) >>> 0) + 0) >>> 2];\n const v74 = ((4 + v72) | 0);\n const v75 = memory_i32[(((v74) >>> 0) + 0) >>> 2];\n const v76 = ((4 + v74) | 0);\n const v77 = memory_i32[(((v76) >>> 0) + 0) >>> 2];\n const v78 = ((4 + v76) | 0);\n const v79 = memory_i32[(((v78) >>> 0) + 0) >>> 2];\n const v80 = ((4 + v78) | 0);\n const v81 = memory_i32[(((v80) >>> 0) + 0) >>> 2];\n const v82 = ((4 + v80) | 0);\n const v83 = memory_i32[(((v82) >>> 0) + 0) >>> 2];\n const v84 = ((4 + v82) | 0);\n const v85 = memory_i32[(((v84) >>> 0) + 0) >>> 2];\n const v86 = ((4 + v84) | 0);\n const v87 = memory_i32[(((v86) >>> 0) + 0) >>> 2];\n const v88 = ((4 + v86) | 0);\n const v89 = memory_i32[(((v88) >>> 0) + 0) >>> 2];\n const v90 = ((4 + v88) | 0);\n const v91 = memory_i32[(((v90) >>> 0) + 0) >>> 2];\n const v92 = ((4 + v90) | 0);\n const v93 = memory_i32[(((v92) >>> 0) + 0) >>> 2];\n const v94 = ((4 + v92) | 0);\n const v95 = memory_i32[(((v94) >>> 0) + 0) >>> 2];\n const v96 = ((4 + v94) | 0);\n const v97 = memory_i32[(((v96) >>> 0) + 0) >>> 2];\n const v98 = memory_i32[(((((4 + v96) | 0)) >>> 0) + 0) >>> 2];\n memory_i32[(((v68) >>> 0) + 0) >>> 2] = 0;\n const v99 = ((4 + v68) | 0);\n memory_i32[(((v99) >>> 0) + 0) >>> 2] = 0;\n const v100 = ((4 + v99) | 0);\n memory_i32[(((v100) >>> 0) + 0) >>> 2] = 0;\n const v101 = ((4 + v100) | 0);\n memory_i32[(((v101) >>> 0) + 0) >>> 2] = 0;\n const v102 = ((4 + v101) | 0);\n memory_i32[(((v102) >>> 0) + 0) >>> 2] = 0;\n const v103 = ((4 + v102) | 0);\n memory_i32[(((v103) >>> 0) + 0) >>> 2] = 0;\n const v104 = ((4 + v103) | 0);\n memory_i32[(((v104) >>> 0) + 0) >>> 2] = 0;\n const v105 = ((4 + v104) | 0);\n memory_i32[(((v105) >>> 0) + 0) >>> 2] = 0;\n const v106 = ((4 + v105) | 0);\n memory_i32[(((v106) >>> 0) + 0) >>> 2] = 0;\n const v107 = ((4 + v106) | 0);\n memory_i32[(((v107) >>> 0) + 0) >>> 2] = 0;\n const v108 = ((4 + v107) | 0);\n memory_i32[(((v108) >>> 0) + 0) >>> 2] = 0;\n const v109 = ((4 + v108) | 0);\n memory_i32[(((v109) >>> 0) + 0) >>> 2] = 0;\n const v110 = ((4 + v109) | 0);\n memory_i32[(((v110) >>> 0) + 0) >>> 2] = 0;\n const v111 = ((4 + v110) | 0);\n memory_i32[(((v111) >>> 0) + 0) >>> 2] = 0;\n const v112 = ((4 + v111) | 0);\n memory_i32[(((v112) >>> 0) + 0) >>> 2] = 0;\n memory_i32[(((((4 + v112) | 0)) >>> 0) + 0) >>> 2] = 0;\n const v113 = ((96 + Math.imul(2144, v66)) | 0);\n memory_i32[(((v113) >>> 0) + 0) >>> 2] = v69;\n const v114 = ((4 + v113) | 0);\n memory_i32[(((v114) >>> 0) + 0) >>> 2] = v71;\n const v115 = ((4 + v114) | 0);\n memory_i32[(((v115) >>> 0) + 0) >>> 2] = v73;\n const v116 = ((4 + v115) | 0);\n memory_i32[(((v116) >>> 0) + 0) >>> 2] = v75;\n const v117 = ((4 + v116) | 0);\n memory_i32[(((v117) >>> 0) + 0) >>> 2] = v77;\n const v118 = ((4 + v117) | 0);\n memory_i32[(((v118) >>> 0) + 0) >>> 2] = v79;\n const v119 = ((4 + v118) | 0);\n memory_i32[(((v119) >>> 0) + 0) >>> 2] = v81;\n memory_i32[(((((4 + v119) | 0)) >>> 0) + 0) >>> 2] = v83;\n const v120 = ((128 + Math.imul(2144, v66)) | 0);\n memory_i32[(((v120) >>> 0) + 0) >>> 2] = v85;\n const v121 = ((4 + v120) | 0);\n memory_i32[(((v121) >>> 0) + 0) >>> 2] = v87;\n const v122 = ((4 + v121) | 0);\n memory_i32[(((v122) >>> 0) + 0) >>> 2] = v89;\n const v123 = ((4 + v122) | 0);\n memory_i32[(((v123) >>> 0) + 0) >>> 2] = v91;\n const v124 = ((4 + v123) | 0);\n memory_i32[(((v124) >>> 0) + 0) >>> 2] = v93;\n const v125 = ((4 + v124) | 0);\n memory_i32[(((v125) >>> 0) + 0) >>> 2] = v95;\n const v126 = ((4 + v125) | 0);\n memory_i32[(((v126) >>> 0) + 0) >>> 2] = v97;\n memory_i32[(((((4 + v126) | 0)) >>> 0) + 0) >>> 2] = v98;\n memory_i32[(((((28 + Math.imul(2144, v66)) | 0)) >>> 0) + 0) >>> 2] = ((v4 - v6) | 0);\n }\n s13 = v65;\n }\n const v65 = s13;\n const v127 = ((1 + v65) | 0);\n if (((((v127) >>> 0) < ((v1) >>> 0)) | 0)) {\n s12 = v127;\n continue L19;\n }\n s12 = v127;\n break L19;\n }\n const v64 = s12;\n s11 = v64;\n }\n const v63 = s11;\n s10 = v63;\n }\n }\n return;\n }\n function processOutBlocks(v0, v1, v2, v3, v4, v5) {\n let s0 = 0;\n L0: {\n const v6 = s0;\n if (((((((((v6) >>> 0) < ((v1) >>> 0)) | 0)) | 0) === 0) | 0)) {\n s0 = v6;\n break L0;\n }\n let s1 = v6;\n L1: {\n const v7 = s1;\n let s2 = v7;\n L2: for (;;) {\n const v8 = s2;\n let s3 = v8;\n L3: {\n const v9 = s3;\n const v10 = ((v9 + v0) | 0);\n const v11 = ((64 + Math.imul(2144, v10)) | 0);\n const v12 = memory_i32[(((((16 + Math.imul(2144, v10)) | 0)) >>> 0) + 0) >>> 2];\n const v13 = memory_i32[(((((24 + Math.imul(2144, v10)) | 0)) >>> 0) + 0) >>> 2];\n const v14 = memory_i32[(((((20 + Math.imul(2144, v10)) | 0)) >>> 0) + 0) >>> 2];\n const v15 = ((8 | ((((((v13) | 0) === 0) | 0)) ? ((2 | ((((((v14) | 0) === 0) | 0)) ? (1) : (0)))) : (4))) | v12);\n const v16 = ((96 + Math.imul(2144, v10)) | 0);\n const v17 = memory_i32[(((v16) >>> 0) + 0) >>> 2];\n const v18 = ((4 + v16) | 0);\n const v19 = memory_i32[(((v18) >>> 0) + 0) >>> 2];\n const v20 = ((4 + v18) | 0);\n const v21 = memory_i32[(((v20) >>> 0) + 0) >>> 2];\n const v22 = ((4 + v20) | 0);\n const v23 = memory_i32[(((v22) >>> 0) + 0) >>> 2];\n const v24 = ((4 + v22) | 0);\n const v25 = memory_i32[(((v24) >>> 0) + 0) >>> 2];\n const v26 = ((4 + v24) | 0);\n const v27 = memory_i32[(((v26) >>> 0) + 0) >>> 2];\n const v28 = ((4 + v26) | 0);\n const v29 = memory_i32[(((v28) >>> 0) + 0) >>> 2];\n const v30 = memory_i32[(((((4 + v28) | 0)) >>> 0) + 0) >>> 2];\n const v31 = ((128 + Math.imul(2144, v10)) | 0);\n const v32 = memory_i32[(((v31) >>> 0) + 0) >>> 2];\n const v33 = ((4 + v31) | 0);\n const v34 = memory_i32[(((v33) >>> 0) + 0) >>> 2];\n const v35 = ((4 + v33) | 0);\n const v36 = memory_i32[(((v35) >>> 0) + 0) >>> 2];\n const v37 = ((4 + v35) | 0);\n const v38 = memory_i32[(((v37) >>> 0) + 0) >>> 2];\n const v39 = ((4 + v37) | 0);\n const v40 = memory_i32[(((v39) >>> 0) + 0) >>> 2];\n const v41 = ((4 + v39) | 0);\n const v42 = memory_i32[(((v41) >>> 0) + 0) >>> 2];\n const v43 = ((4 + v41) | 0);\n const v44 = memory_i32[(((v43) >>> 0) + 0) >>> 2];\n const v45 = memory_i32[(((((4 + v43) | 0)) >>> 0) + 0) >>> 2];\n const v46 = ((8 + Math.imul(2144, v10)) | 0);\n const v47 = memory_i32[(((v46) >>> 0) + 0) >>> 2];\n const v48 = memory_i32[(((v46) >>> 0) + 4) >>> 2];\n let s4 = 0, s5 = v47, s6 = v48;\n L4: {\n const v49 = s4;\n const v50 = s5;\n const v51 = s6;\n let s7 = v49, s8 = v50, s9 = v51;\n L5: for (;;) {\n const v52 = s7;\n const v53 = s8;\n const v54 = s9;\n const v55 = ((1 + v52) | 0);\n const v56 = memory_i32[(((v11) >>> 0) + 0) >>> 2];\n const v57 = ((4 + v11) | 0);\n const v58 = memory_i32[(((v57) >>> 0) + 0) >>> 2];\n const v59 = ((4 + v57) | 0);\n const v60 = memory_i32[(((v59) >>> 0) + 0) >>> 2];\n const v61 = ((4 + v59) | 0);\n const v62 = memory_i32[(((v61) >>> 0) + 0) >>> 2];\n const v63 = ((4 + v61) | 0);\n const v64 = memory_i32[(((v63) >>> 0) + 0) >>> 2];\n const v65 = ((4 + v63) | 0);\n const v66 = memory_i32[(((v65) >>> 0) + 0) >>> 2];\n const v67 = ((4 + v65) | 0);\n const v68 = memory_i32[(((v67) >>> 0) + 0) >>> 2];\n const v69 = memory_i32[(((((4 + v67) | 0)) >>> 0) + 0) >>> 2];\n const v70 = memory_i32[(((((24 + Math.imul(2144, v10)) | 0)) >>> 0) + 0) >>> 2];\n const v71 = memory_i32[(((((28 + Math.imul(2144, v10)) | 0)) >>> 0) + 0) >>> 2];\n const v72 = ((((v17 + v64) | 0) + v56) | 0);\n const v73 = ((((v72 ^ v53) >>> 16) | ((v72 ^ v53) << (32 - 16))));\n const v74 = ((v73 + 1779033703) | 0);\n const v75 = ((((v74 ^ v64) >>> 12) | ((v74 ^ v64) << (32 - 12))));\n const v76 = ((((v19 + v75) | 0) + v72) | 0);\n const v77 = ((((v76 ^ v73) >>> 8) | ((v76 ^ v73) << (32 - 8))));\n const v78 = ((v77 + v74) | 0);\n const v79 = ((((v78 ^ v75) >>> 7) | ((v78 ^ v75) << (32 - 7))));\n const v80 = ((((v21 + v66) | 0) + v58) | 0);\n const v81 = ((((v80 ^ v54) >>> 16) | ((v80 ^ v54) << (32 - 16))));\n const v82 = ((v81 + -1150833019) | 0);\n const v83 = ((((v82 ^ v66) >>> 12) | ((v82 ^ v66) << (32 - 12))));\n const v84 = ((((v23 + v83) | 0) + v80) | 0);\n const v85 = ((((v84 ^ v81) >>> 8) | ((v84 ^ v81) << (32 - 8))));\n const v86 = ((v85 + v82) | 0);\n const v87 = ((((v86 ^ v83) >>> 7) | ((v86 ^ v83) << (32 - 7))));\n const v88 = ((((v25 + v68) | 0) + v60) | 0);\n const v89 = ((((v88 ^ ((((((v70) | 0) === 0) | 0)) ? (v71) : (v4))) >>> 16) | ((v88 ^ ((((((v70) | 0) === 0) | 0)) ? (v71) : (v4))) << (32 - 16))));\n const v90 = ((v89 + 1013904242) | 0);\n const v91 = ((((v90 ^ v68) >>> 12) | ((v90 ^ v68) << (32 - 12))));\n const v92 = ((((v27 + v91) | 0) + v88) | 0);\n const v93 = ((((v92 ^ v89) >>> 8) | ((v92 ^ v89) << (32 - 8))));\n const v94 = ((v93 + v90) | 0);\n const v95 = ((((v94 ^ v91) >>> 7) | ((v94 ^ v91) << (32 - 7))));\n const v96 = ((((v29 + v69) | 0) + v62) | 0);\n const v97 = ((((v96 ^ v15) >>> 16) | ((v96 ^ v15) << (32 - 16))));\n const v98 = ((v97 + -1521486534) | 0);\n const v99 = ((((v98 ^ v69) >>> 12) | ((v98 ^ v69) << (32 - 12))));\n const v100 = ((((v30 + v99) | 0) + v96) | 0);\n const v101 = ((((v100 ^ v97) >>> 8) | ((v100 ^ v97) << (32 - 8))));\n const v102 = ((v101 + v98) | 0);\n const v103 = ((((v102 ^ v99) >>> 7) | ((v102 ^ v99) << (32 - 7))));\n const v104 = ((((v32 + v87) | 0) + v76) | 0);\n const v105 = ((((v104 ^ v101) >>> 16) | ((v104 ^ v101) << (32 - 16))));\n const v106 = ((v105 + v94) | 0);\n const v107 = ((((v106 ^ v87) >>> 12) | ((v106 ^ v87) << (32 - 12))));\n const v108 = ((((v34 + v107) | 0) + v104) | 0);\n const v109 = ((((v108 ^ v105) >>> 8) | ((v108 ^ v105) << (32 - 8))));\n const v110 = ((v109 + v106) | 0);\n const v111 = ((((v110 ^ v107) >>> 7) | ((v110 ^ v107) << (32 - 7))));\n const v112 = ((((v36 + v95) | 0) + v84) | 0);\n const v113 = ((((v112 ^ v77) >>> 16) | ((v112 ^ v77) << (32 - 16))));\n const v114 = ((v113 + v102) | 0);\n const v115 = ((((v114 ^ v95) >>> 12) | ((v114 ^ v95) << (32 - 12))));\n const v116 = ((((v38 + v115) | 0) + v112) | 0);\n const v117 = ((((v116 ^ v113) >>> 8) | ((v116 ^ v113) << (32 - 8))));\n const v118 = ((v117 + v114) | 0);\n const v119 = ((((v118 ^ v115) >>> 7) | ((v118 ^ v115) << (32 - 7))));\n const v120 = ((((v40 + v103) | 0) + v92) | 0);\n const v121 = ((((v120 ^ v85) >>> 16) | ((v120 ^ v85) << (32 - 16))));\n const v122 = ((v121 + v78) | 0);\n const v123 = ((((v122 ^ v103) >>> 12) | ((v122 ^ v103) << (32 - 12))));\n const v124 = ((((v42 + v123) | 0) + v120) | 0);\n const v125 = ((((v124 ^ v121) >>> 8) | ((v124 ^ v121) << (32 - 8))));\n const v126 = ((v125 + v122) | 0);\n const v127 = ((((v126 ^ v123) >>> 7) | ((v126 ^ v123) << (32 - 7))));\n const v128 = ((((v44 + v79) | 0) + v100) | 0);\n const v129 = ((((v128 ^ v93) >>> 16) | ((v128 ^ v93) << (32 - 16))));\n const v130 = ((v129 + v86) | 0);\n const v131 = ((((v130 ^ v79) >>> 12) | ((v130 ^ v79) << (32 - 12))));\n const v132 = ((((v45 + v131) | 0) + v128) | 0);\n const v133 = ((((v132 ^ v129) >>> 8) | ((v132 ^ v129) << (32 - 8))));\n const v134 = ((v133 + v130) | 0);\n const v135 = ((((v134 ^ v131) >>> 7) | ((v134 ^ v131) << (32 - 7))));\n const v136 = ((((v21 + v135) | 0) + v108) | 0);\n const v137 = ((((v136 ^ v117) >>> 16) | ((v136 ^ v117) << (32 - 16))));\n const v138 = ((v137 + v126) | 0);\n const v139 = ((((v138 ^ v135) >>> 12) | ((v138 ^ v135) << (32 - 12))));\n const v140 = ((((v29 + v139) | 0) + v136) | 0);\n const v141 = ((((v140 ^ v137) >>> 8) | ((v140 ^ v137) << (32 - 8))));\n const v142 = ((v141 + v138) | 0);\n const v143 = ((((v142 ^ v139) >>> 7) | ((v142 ^ v139) << (32 - 7))));\n const v144 = ((((v23 + v111) | 0) + v116) | 0);\n const v145 = ((((v144 ^ v125) >>> 16) | ((v144 ^ v125) << (32 - 16))));\n const v146 = ((v145 + v134) | 0);\n const v147 = ((((v146 ^ v111) >>> 12) | ((v146 ^ v111) << (32 - 12))));\n const v148 = ((((v36 + v147) | 0) + v144) | 0);\n const v149 = ((((v148 ^ v145) >>> 8) | ((v148 ^ v145) << (32 - 8))));\n const v150 = ((v149 + v146) | 0);\n const v151 = ((((v150 ^ v147) >>> 7) | ((v150 ^ v147) << (32 - 7))));\n const v152 = ((((v30 + v119) | 0) + v124) | 0);\n const v153 = ((((v152 ^ v133) >>> 16) | ((v152 ^ v133) << (32 - 16))));\n const v154 = ((v153 + v110) | 0);\n const v155 = ((((v154 ^ v119) >>> 12) | ((v154 ^ v119) << (32 - 12))));\n const v156 = ((((v17 + v155) | 0) + v152) | 0);\n const v157 = ((((v156 ^ v153) >>> 8) | ((v156 ^ v153) << (32 - 8))));\n const v158 = ((v157 + v154) | 0);\n const v159 = ((((v158 ^ v155) >>> 7) | ((v158 ^ v155) << (32 - 7))));\n const v160 = ((((v25 + v127) | 0) + v132) | 0);\n const v161 = ((((v160 ^ v109) >>> 16) | ((v160 ^ v109) << (32 - 16))));\n const v162 = ((v161 + v118) | 0);\n const v163 = ((((v162 ^ v127) >>> 12) | ((v162 ^ v127) << (32 - 12))));\n const v164 = ((((v42 + v163) | 0) + v160) | 0);\n const v165 = ((((v164 ^ v161) >>> 8) | ((v164 ^ v161) << (32 - 8))));\n const v166 = ((v165 + v162) | 0);\n const v167 = ((((v166 ^ v163) >>> 7) | ((v166 ^ v163) << (32 - 7))));\n const v168 = ((((v19 + v151) | 0) + v140) | 0);\n const v169 = ((((v168 ^ v165) >>> 16) | ((v168 ^ v165) << (32 - 16))));\n const v170 = ((v169 + v158) | 0);\n const v171 = ((((v170 ^ v151) >>> 12) | ((v170 ^ v151) << (32 - 12))));\n const v172 = ((((v38 + v171) | 0) + v168) | 0);\n const v173 = ((((v172 ^ v169) >>> 8) | ((v172 ^ v169) << (32 - 8))));\n const v174 = ((v173 + v170) | 0);\n const v175 = ((((v174 ^ v171) >>> 7) | ((v174 ^ v171) << (32 - 7))));\n const v176 = ((((v40 + v159) | 0) + v148) | 0);\n const v177 = ((((v176 ^ v141) >>> 16) | ((v176 ^ v141) << (32 - 16))));\n const v178 = ((v177 + v166) | 0);\n const v179 = ((((v178 ^ v159) >>> 12) | ((v178 ^ v159) << (32 - 12))));\n const v180 = ((((v27 + v179) | 0) + v176) | 0);\n const v181 = ((((v180 ^ v177) >>> 8) | ((v180 ^ v177) << (32 - 8))));\n const v182 = ((v181 + v178) | 0);\n const v183 = ((((v182 ^ v179) >>> 7) | ((v182 ^ v179) << (32 - 7))));\n const v184 = ((((v34 + v167) | 0) + v156) | 0);\n const v185 = ((((v184 ^ v149) >>> 16) | ((v184 ^ v149) << (32 - 16))));\n const v186 = ((v185 + v142) | 0);\n const v187 = ((((v186 ^ v167) >>> 12) | ((v186 ^ v167) << (32 - 12))));\n const v188 = ((((v44 + v187) | 0) + v184) | 0);\n const v189 = ((((v188 ^ v185) >>> 8) | ((v188 ^ v185) << (32 - 8))));\n const v190 = ((v189 + v186) | 0);\n const v191 = ((((v190 ^ v187) >>> 7) | ((v190 ^ v187) << (32 - 7))));\n const v192 = ((((v45 + v143) | 0) + v164) | 0);\n const v193 = ((((v192 ^ v157) >>> 16) | ((v192 ^ v157) << (32 - 16))));\n const v194 = ((v193 + v150) | 0);\n const v195 = ((((v194 ^ v143) >>> 12) | ((v194 ^ v143) << (32 - 12))));\n const v196 = ((((v32 + v195) | 0) + v192) | 0);\n const v197 = ((((v196 ^ v193) >>> 8) | ((v196 ^ v193) << (32 - 8))));\n const v198 = ((v197 + v194) | 0);\n const v199 = ((((v198 ^ v195) >>> 7) | ((v198 ^ v195) << (32 - 7))));\n const v200 = ((((v23 + v199) | 0) + v172) | 0);\n const v201 = ((((v200 ^ v181) >>> 16) | ((v200 ^ v181) << (32 - 16))));\n const v202 = ((v201 + v190) | 0);\n const v203 = ((((v202 ^ v199) >>> 12) | ((v202 ^ v199) << (32 - 12))));\n const v204 = ((((v25 + v203) | 0) + v200) | 0);\n const v205 = ((((v204 ^ v201) >>> 8) | ((v204 ^ v201) << (32 - 8))));\n const v206 = ((v205 + v202) | 0);\n const v207 = ((((v206 ^ v203) >>> 7) | ((v206 ^ v203) << (32 - 7))));\n const v208 = ((((v36 + v175) | 0) + v180) | 0);\n const v209 = ((((v208 ^ v189) >>> 16) | ((v208 ^ v189) << (32 - 16))));\n const v210 = ((v209 + v198) | 0);\n const v211 = ((((v210 ^ v175) >>> 12) | ((v210 ^ v175) << (32 - 12))));\n const v212 = ((((v40 + v211) | 0) + v208) | 0);\n const v213 = ((((v212 ^ v209) >>> 8) | ((v212 ^ v209) << (32 - 8))));\n const v214 = ((v213 + v210) | 0);\n const v215 = ((((v214 ^ v211) >>> 7) | ((v214 ^ v211) << (32 - 7))));\n const v216 = ((((v42 + v183) | 0) + v188) | 0);\n const v217 = ((((v216 ^ v197) >>> 16) | ((v216 ^ v197) << (32 - 16))));\n const v218 = ((v217 + v174) | 0);\n const v219 = ((((v218 ^ v183) >>> 12) | ((v218 ^ v183) << (32 - 12))));\n const v220 = ((((v21 + v219) | 0) + v216) | 0);\n const v221 = ((((v220 ^ v217) >>> 8) | ((v220 ^ v217) << (32 - 8))));\n const v222 = ((v221 + v218) | 0);\n const v223 = ((((v222 ^ v219) >>> 7) | ((v222 ^ v219) << (32 - 7))));\n const v224 = ((((v30 + v191) | 0) + v196) | 0);\n const v225 = ((((v224 ^ v173) >>> 16) | ((v224 ^ v173) << (32 - 16))));\n const v226 = ((v225 + v182) | 0);\n const v227 = ((((v226 ^ v191) >>> 12) | ((v226 ^ v191) << (32 - 12))));\n const v228 = ((((v44 + v227) | 0) + v224) | 0);\n const v229 = ((((v228 ^ v225) >>> 8) | ((v228 ^ v225) << (32 - 8))));\n const v230 = ((v229 + v226) | 0);\n const v231 = ((((v230 ^ v227) >>> 7) | ((v230 ^ v227) << (32 - 7))));\n const v232 = ((((v29 + v215) | 0) + v204) | 0);\n const v233 = ((((v232 ^ v229) >>> 16) | ((v232 ^ v229) << (32 - 16))));\n const v234 = ((v233 + v222) | 0);\n const v235 = ((((v234 ^ v215) >>> 12) | ((v234 ^ v215) << (32 - 12))));\n const v236 = ((((v27 + v235) | 0) + v232) | 0);\n const v237 = ((((v236 ^ v233) >>> 8) | ((v236 ^ v233) << (32 - 8))));\n const v238 = ((v237 + v234) | 0);\n const v239 = ((((v238 ^ v235) >>> 7) | ((v238 ^ v235) << (32 - 7))));\n const v240 = ((((v34 + v223) | 0) + v212) | 0);\n const v241 = ((((v240 ^ v205) >>> 16) | ((v240 ^ v205) << (32 - 16))));\n const v242 = ((v241 + v230) | 0);\n const v243 = ((((v242 ^ v223) >>> 12) | ((v242 ^ v223) << (32 - 12))));\n const v244 = ((((v17 + v243) | 0) + v240) | 0);\n const v245 = ((((v244 ^ v241) >>> 8) | ((v244 ^ v241) << (32 - 8))));\n const v246 = ((v245 + v242) | 0);\n const v247 = ((((v246 ^ v243) >>> 7) | ((v246 ^ v243) << (32 - 7))));\n const v248 = ((((v38 + v231) | 0) + v220) | 0);\n const v249 = ((((v248 ^ v213) >>> 16) | ((v248 ^ v213) << (32 - 16))));\n const v250 = ((v249 + v206) | 0);\n const v251 = ((((v250 ^ v231) >>> 12) | ((v250 ^ v231) << (32 - 12))));\n const v252 = ((((v45 + v251) | 0) + v248) | 0);\n const v253 = ((((v252 ^ v249) >>> 8) | ((v252 ^ v249) << (32 - 8))));\n const v254 = ((v253 + v250) | 0);\n const v255 = ((((v254 ^ v251) >>> 7) | ((v254 ^ v251) << (32 - 7))));\n const v256 = ((((v32 + v207) | 0) + v228) | 0);\n const v257 = ((((v256 ^ v221) >>> 16) | ((v256 ^ v221) << (32 - 16))));\n const v258 = ((v257 + v214) | 0);\n const v259 = ((((v258 ^ v207) >>> 12) | ((v258 ^ v207) << (32 - 12))));\n const v260 = ((((v19 + v259) | 0) + v256) | 0);\n const v261 = ((((v260 ^ v257) >>> 8) | ((v260 ^ v257) << (32 - 8))));\n const v262 = ((v261 + v258) | 0);\n const v263 = ((((v262 ^ v259) >>> 7) | ((v262 ^ v259) << (32 - 7))));\n const v264 = ((((v36 + v263) | 0) + v236) | 0);\n const v265 = ((((v264 ^ v245) >>> 16) | ((v264 ^ v245) << (32 - 16))));\n const v266 = ((v265 + v254) | 0);\n const v267 = ((((v266 ^ v263) >>> 12) | ((v266 ^ v263) << (32 - 12))));\n const v268 = ((((v30 + v267) | 0) + v264) | 0);\n const v269 = ((((v268 ^ v265) >>> 8) | ((v268 ^ v265) << (32 - 8))));\n const v270 = ((v269 + v266) | 0);\n const v271 = ((((v270 ^ v267) >>> 7) | ((v270 ^ v267) << (32 - 7))));\n const v272 = ((((v40 + v239) | 0) + v244) | 0);\n const v273 = ((((v272 ^ v253) >>> 16) | ((v272 ^ v253) << (32 - 16))));\n const v274 = ((v273 + v262) | 0);\n const v275 = ((((v274 ^ v239) >>> 12) | ((v274 ^ v239) << (32 - 12))));\n const v276 = ((((v34 + v275) | 0) + v272) | 0);\n const v277 = ((((v276 ^ v273) >>> 8) | ((v276 ^ v273) << (32 - 8))));\n const v278 = ((v277 + v274) | 0);\n const v279 = ((((v278 ^ v275) >>> 7) | ((v278 ^ v275) << (32 - 7))));\n const v280 = ((((v44 + v247) | 0) + v252) | 0);\n const v281 = ((((v280 ^ v261) >>> 16) | ((v280 ^ v261) << (32 - 16))));\n const v282 = ((v281 + v238) | 0);\n const v283 = ((((v282 ^ v247) >>> 12) | ((v282 ^ v247) << (32 - 12))));\n const v284 = ((((v23 + v283) | 0) + v280) | 0);\n const v285 = ((((v284 ^ v281) >>> 8) | ((v284 ^ v281) << (32 - 8))));\n const v286 = ((v285 + v282) | 0);\n const v287 = ((((v286 ^ v283) >>> 7) | ((v286 ^ v283) << (32 - 7))));\n const v288 = ((((v42 + v255) | 0) + v260) | 0);\n const v289 = ((((v288 ^ v237) >>> 16) | ((v288 ^ v237) << (32 - 16))));\n const v290 = ((v289 + v246) | 0);\n const v291 = ((((v290 ^ v255) >>> 12) | ((v290 ^ v255) << (32 - 12))));\n const v292 = ((((v45 + v291) | 0) + v288) | 0);\n const v293 = ((((v292 ^ v289) >>> 8) | ((v292 ^ v289) << (32 - 8))));\n const v294 = ((v293 + v290) | 0);\n const v295 = ((((v294 ^ v291) >>> 7) | ((v294 ^ v291) << (32 - 7))));\n const v296 = ((((v25 + v279) | 0) + v268) | 0);\n const v297 = ((((v296 ^ v293) >>> 16) | ((v296 ^ v293) << (32 - 16))));\n const v298 = ((v297 + v286) | 0);\n const v299 = ((((v298 ^ v279) >>> 12) | ((v298 ^ v279) << (32 - 12))));\n const v300 = ((((v17 + v299) | 0) + v296) | 0);\n const v301 = ((((v300 ^ v297) >>> 8) | ((v300 ^ v297) << (32 - 8))));\n const v302 = ((v301 + v298) | 0);\n const v303 = ((((v302 ^ v299) >>> 7) | ((v302 ^ v299) << (32 - 7))));\n const v304 = ((((v38 + v287) | 0) + v276) | 0);\n const v305 = ((((v304 ^ v269) >>> 16) | ((v304 ^ v269) << (32 - 16))));\n const v306 = ((v305 + v294) | 0);\n const v307 = ((((v306 ^ v287) >>> 12) | ((v306 ^ v287) << (32 - 12))));\n const v308 = ((((v21 + v307) | 0) + v304) | 0);\n const v309 = ((((v308 ^ v305) >>> 8) | ((v308 ^ v305) << (32 - 8))));\n const v310 = ((v309 + v306) | 0);\n const v311 = ((((v310 ^ v307) >>> 7) | ((v310 ^ v307) << (32 - 7))));\n const v312 = ((((v27 + v295) | 0) + v284) | 0);\n const v313 = ((((v312 ^ v277) >>> 16) | ((v312 ^ v277) << (32 - 16))));\n const v314 = ((v313 + v270) | 0);\n const v315 = ((((v314 ^ v295) >>> 12) | ((v314 ^ v295) << (32 - 12))));\n const v316 = ((((v32 + v315) | 0) + v312) | 0);\n const v317 = ((((v316 ^ v313) >>> 8) | ((v316 ^ v313) << (32 - 8))));\n const v318 = ((v317 + v314) | 0);\n const v319 = ((((v318 ^ v315) >>> 7) | ((v318 ^ v315) << (32 - 7))));\n const v320 = ((((v19 + v271) | 0) + v292) | 0);\n const v321 = ((((v320 ^ v285) >>> 16) | ((v320 ^ v285) << (32 - 16))));\n const v322 = ((v321 + v278) | 0);\n const v323 = ((((v322 ^ v271) >>> 12) | ((v322 ^ v271) << (32 - 12))));\n const v324 = ((((v29 + v323) | 0) + v320) | 0);\n const v325 = ((((v324 ^ v321) >>> 8) | ((v324 ^ v321) << (32 - 8))));\n const v326 = ((v325 + v322) | 0);\n const v327 = ((((v326 ^ v323) >>> 7) | ((v326 ^ v323) << (32 - 7))));\n const v328 = ((((v40 + v327) | 0) + v300) | 0);\n const v329 = ((((v328 ^ v309) >>> 16) | ((v328 ^ v309) << (32 - 16))));\n const v330 = ((v329 + v318) | 0);\n const v331 = ((((v330 ^ v327) >>> 12) | ((v330 ^ v327) << (32 - 12))));\n const v332 = ((((v42 + v331) | 0) + v328) | 0);\n const v333 = ((((v332 ^ v329) >>> 8) | ((v332 ^ v329) << (32 - 8))));\n const v334 = ((v333 + v330) | 0);\n const v335 = ((((v334 ^ v331) >>> 7) | ((v334 ^ v331) << (32 - 7))));\n const v336 = ((((v34 + v303) | 0) + v308) | 0);\n const v337 = ((((v336 ^ v317) >>> 16) | ((v336 ^ v317) << (32 - 16))));\n const v338 = ((v337 + v326) | 0);\n const v339 = ((((v338 ^ v303) >>> 12) | ((v338 ^ v303) << (32 - 12))));\n const v340 = ((((v38 + v339) | 0) + v336) | 0);\n const v341 = ((((v340 ^ v337) >>> 8) | ((v340 ^ v337) << (32 - 8))));\n const v342 = ((v341 + v338) | 0);\n const v343 = ((((v342 ^ v339) >>> 7) | ((v342 ^ v339) << (32 - 7))));\n const v344 = ((((v45 + v311) | 0) + v316) | 0);\n const v345 = ((((v344 ^ v325) >>> 16) | ((v344 ^ v325) << (32 - 16))));\n const v346 = ((v345 + v302) | 0);\n const v347 = ((((v346 ^ v311) >>> 12) | ((v346 ^ v311) << (32 - 12))));\n const v348 = ((((v36 + v347) | 0) + v344) | 0);\n const v349 = ((((v348 ^ v345) >>> 8) | ((v348 ^ v345) << (32 - 8))));\n const v350 = ((v349 + v346) | 0);\n const v351 = ((((v350 ^ v347) >>> 7) | ((v350 ^ v347) << (32 - 7))));\n const v352 = ((((v44 + v319) | 0) + v324) | 0);\n const v353 = ((((v352 ^ v301) >>> 16) | ((v352 ^ v301) << (32 - 16))));\n const v354 = ((v353 + v310) | 0);\n const v355 = ((((v354 ^ v319) >>> 12) | ((v354 ^ v319) << (32 - 12))));\n const v356 = ((((v32 + v355) | 0) + v352) | 0);\n const v357 = ((((v356 ^ v353) >>> 8) | ((v356 ^ v353) << (32 - 8))));\n const v358 = ((v357 + v354) | 0);\n const v359 = ((((v358 ^ v355) >>> 7) | ((v358 ^ v355) << (32 - 7))));\n const v360 = ((((v30 + v343) | 0) + v332) | 0);\n const v361 = ((((v360 ^ v357) >>> 16) | ((v360 ^ v357) << (32 - 16))));\n const v362 = ((v361 + v350) | 0);\n const v363 = ((((v362 ^ v343) >>> 12) | ((v362 ^ v343) << (32 - 12))));\n const v364 = ((((v21 + v363) | 0) + v360) | 0);\n const v365 = ((((v364 ^ v361) >>> 8) | ((v364 ^ v361) << (32 - 8))));\n const v366 = ((v365 + v362) | 0);\n const v367 = ((((v366 ^ v363) >>> 7) | ((v366 ^ v363) << (32 - 7))));\n const v368 = ((((v27 + v351) | 0) + v340) | 0);\n const v369 = ((((v368 ^ v333) >>> 16) | ((v368 ^ v333) << (32 - 16))));\n const v370 = ((v369 + v358) | 0);\n const v371 = ((((v370 ^ v351) >>> 12) | ((v370 ^ v351) << (32 - 12))));\n const v372 = ((((v23 + v371) | 0) + v368) | 0);\n const v373 = ((((v372 ^ v369) >>> 8) | ((v372 ^ v369) << (32 - 8))));\n const v374 = ((v373 + v370) | 0);\n const v375 = ((((v374 ^ v371) >>> 7) | ((v374 ^ v371) << (32 - 7))));\n const v376 = ((((v17 + v359) | 0) + v348) | 0);\n const v377 = ((((v376 ^ v341) >>> 16) | ((v376 ^ v341) << (32 - 16))));\n const v378 = ((v377 + v334) | 0);\n const v379 = ((((v378 ^ v359) >>> 12) | ((v378 ^ v359) << (32 - 12))));\n const v380 = ((((v19 + v379) | 0) + v376) | 0);\n const v381 = ((((v380 ^ v377) >>> 8) | ((v380 ^ v377) << (32 - 8))));\n const v382 = ((v381 + v378) | 0);\n const v383 = ((((v382 ^ v379) >>> 7) | ((v382 ^ v379) << (32 - 7))));\n const v384 = ((((v29 + v335) | 0) + v356) | 0);\n const v385 = ((((v384 ^ v349) >>> 16) | ((v384 ^ v349) << (32 - 16))));\n const v386 = ((v385 + v342) | 0);\n const v387 = ((((v386 ^ v335) >>> 12) | ((v386 ^ v335) << (32 - 12))));\n const v388 = ((((v25 + v387) | 0) + v384) | 0);\n const v389 = ((((v388 ^ v385) >>> 8) | ((v388 ^ v385) << (32 - 8))));\n const v390 = ((v389 + v386) | 0);\n const v391 = ((((v390 ^ v387) >>> 7) | ((v390 ^ v387) << (32 - 7))));\n const v392 = ((((v34 + v391) | 0) + v364) | 0);\n const v393 = ((((v392 ^ v373) >>> 16) | ((v392 ^ v373) << (32 - 16))));\n const v394 = ((v393 + v382) | 0);\n const v395 = ((((v394 ^ v391) >>> 12) | ((v394 ^ v391) << (32 - 12))));\n const v396 = ((((v44 + v395) | 0) + v392) | 0);\n const v397 = ((((v396 ^ v393) >>> 8) | ((v396 ^ v393) << (32 - 8))));\n const v398 = ((v397 + v394) | 0);\n const v399 = ((((v398 ^ v395) >>> 7) | ((v398 ^ v395) << (32 - 7))));\n const v400 = ((((v38 + v367) | 0) + v372) | 0);\n const v401 = ((((v400 ^ v381) >>> 16) | ((v400 ^ v381) << (32 - 16))));\n const v402 = ((v401 + v390) | 0);\n const v403 = ((((v402 ^ v367) >>> 12) | ((v402 ^ v367) << (32 - 12))));\n const v404 = ((((v27 + v403) | 0) + v400) | 0);\n const v405 = ((((v404 ^ v401) >>> 8) | ((v404 ^ v401) << (32 - 8))));\n const v406 = ((v405 + v402) | 0);\n const v407 = ((((v406 ^ v403) >>> 7) | ((v406 ^ v403) << (32 - 7))));\n const v408 = ((((v32 + v375) | 0) + v380) | 0);\n const v409 = ((((v408 ^ v389) >>> 16) | ((v408 ^ v389) << (32 - 16))));\n const v410 = ((v409 + v366) | 0);\n const v411 = ((((v410 ^ v375) >>> 12) | ((v410 ^ v375) << (32 - 12))));\n const v412 = ((((v40 + v411) | 0) + v408) | 0);\n const v413 = ((((v412 ^ v409) >>> 8) | ((v412 ^ v409) << (32 - 8))));\n const v414 = ((v413 + v410) | 0);\n const v415 = ((((v414 ^ v411) >>> 7) | ((v414 ^ v411) << (32 - 7))));\n const v416 = ((((v45 + v383) | 0) + v388) | 0);\n const v417 = ((((v416 ^ v365) >>> 16) | ((v416 ^ v365) << (32 - 16))));\n const v418 = ((v417 + v374) | 0);\n const v419 = ((((v418 ^ v383) >>> 12) | ((v418 ^ v383) << (32 - 12))));\n const v420 = ((((v19 + v419) | 0) + v416) | 0);\n const v421 = ((((v420 ^ v417) >>> 8) | ((v420 ^ v417) << (32 - 8))));\n const v422 = ((v421 + v418) | 0);\n const v423 = ((((v422 ^ v419) >>> 7) | ((v422 ^ v419) << (32 - 7))));\n const v424 = ((((v42 + v407) | 0) + v396) | 0);\n const v425 = ((((v424 ^ v421) >>> 16) | ((v424 ^ v421) << (32 - 16))));\n const v426 = ((v425 + v414) | 0);\n const v427 = ((((v426 ^ v407) >>> 12) | ((v426 ^ v407) << (32 - 12))));\n const v428 = ((((v23 + v427) | 0) + v424) | 0);\n const v429 = ((((v428 ^ v425) >>> 8) | ((v428 ^ v425) << (32 - 8))));\n const v430 = ((v429 + v426) | 0);\n const v431 = ((((v430 ^ v427) >>> 7) | ((v430 ^ v427) << (32 - 7))));\n const v432 = ((((v17 + v415) | 0) + v404) | 0);\n const v433 = ((((v432 ^ v397) >>> 16) | ((v432 ^ v397) << (32 - 16))));\n const v434 = ((v433 + v422) | 0);\n const v435 = ((((v434 ^ v415) >>> 12) | ((v434 ^ v415) << (32 - 12))));\n const v436 = ((((v36 + v435) | 0) + v432) | 0);\n const v437 = ((((v436 ^ v433) >>> 8) | ((v436 ^ v433) << (32 - 8))));\n const v438 = ((v437 + v434) | 0);\n const v439 = ((((v438 ^ v435) >>> 7) | ((v438 ^ v435) << (32 - 7))));\n const v440 = ((((v21 + v423) | 0) + v412) | 0);\n const v441 = ((((v440 ^ v405) >>> 16) | ((v440 ^ v405) << (32 - 16))));\n const v442 = ((v441 + v398) | 0);\n const v443 = ((((v442 ^ v423) >>> 12) | ((v442 ^ v423) << (32 - 12))));\n const v444 = ((((v29 + v443) | 0) + v440) | 0);\n const v445 = ((((v444 ^ v441) >>> 8) | ((v444 ^ v441) << (32 - 8))));\n const v446 = ((v445 + v442) | 0);\n const v447 = ((((v446 ^ v443) >>> 7) | ((v446 ^ v443) << (32 - 7))));\n const v448 = ((((v25 + v399) | 0) + v420) | 0);\n const v449 = ((((v448 ^ v413) >>> 16) | ((v448 ^ v413) << (32 - 16))));\n const v450 = ((v449 + v406) | 0);\n const v451 = ((((v450 ^ v399) >>> 12) | ((v450 ^ v399) << (32 - 12))));\n const v452 = ((((v30 + v451) | 0) + v448) | 0);\n const v453 = ((((v452 ^ v449) >>> 8) | ((v452 ^ v449) << (32 - 8))));\n const v454 = ((v453 + v450) | 0);\n const v455 = ((((v454 ^ v451) >>> 7) | ((v454 ^ v451) << (32 - 7))));\n const v456 = ((((v38 + v455) | 0) + v428) | 0);\n const v457 = ((((v456 ^ v437) >>> 16) | ((v456 ^ v437) << (32 - 16))));\n const v458 = ((v457 + v446) | 0);\n const v459 = ((((v458 ^ v455) >>> 12) | ((v458 ^ v455) << (32 - 12))));\n const v460 = ((((v45 + v459) | 0) + v456) | 0);\n const v461 = ((((v460 ^ v457) >>> 8) | ((v460 ^ v457) << (32 - 8))));\n const v462 = ((v461 + v458) | 0);\n const v463 = ((((v462 ^ v459) >>> 7) | ((v462 ^ v459) << (32 - 7))));\n const v464 = ((((v27 + v431) | 0) + v436) | 0);\n const v465 = ((((v464 ^ v445) >>> 16) | ((v464 ^ v445) << (32 - 16))));\n const v466 = ((v465 + v454) | 0);\n const v467 = ((((v466 ^ v431) >>> 12) | ((v466 ^ v431) << (32 - 12))));\n const v468 = ((((v17 + v467) | 0) + v464) | 0);\n const v469 = ((((v468 ^ v465) >>> 8) | ((v468 ^ v465) << (32 - 8))));\n const v470 = ((v469 + v466) | 0);\n const v471 = ((((v470 ^ v467) >>> 7) | ((v470 ^ v467) << (32 - 7))));\n const v472 = ((((v19 + v439) | 0) + v444) | 0);\n const v473 = ((((v472 ^ v453) >>> 16) | ((v472 ^ v453) << (32 - 16))));\n const v474 = ((v473 + v430) | 0);\n const v475 = ((((v474 ^ v439) >>> 12) | ((v474 ^ v439) << (32 - 12))));\n const v476 = ((((v34 + v475) | 0) + v472) | 0);\n const v477 = ((((v476 ^ v473) >>> 8) | ((v476 ^ v473) << (32 - 8))));\n const v478 = ((v477 + v474) | 0);\n const v479 = ((((v478 ^ v475) >>> 7) | ((v478 ^ v475) << (32 - 7))));\n const v480 = ((((v32 + v447) | 0) + v452) | 0);\n const v481 = ((((v480 ^ v429) >>> 16) | ((v480 ^ v429) << (32 - 16))));\n const v482 = ((v481 + v438) | 0);\n const v483 = ((((v482 ^ v447) >>> 12) | ((v482 ^ v447) << (32 - 12))));\n const v484 = ((((v29 + v483) | 0) + v480) | 0);\n const v485 = ((((v484 ^ v481) >>> 8) | ((v484 ^ v481) << (32 - 8))));\n const v486 = ((v485 + v482) | 0);\n const v487 = ((((v486 ^ v483) >>> 7) | ((v486 ^ v483) << (32 - 7))));\n const v488 = ((((v44 + v471) | 0) + v460) | 0);\n const v489 = ((((v488 ^ v485) >>> 16) | ((v488 ^ v485) << (32 - 16))));\n const v490 = ((v489 + v478) | 0);\n const v491 = ((((v490 ^ v471) >>> 12) | ((v490 ^ v471) << (32 - 12))));\n const v492 = ((((v36 + v491) | 0) + v488) | 0);\n const v493 = ((((v492 ^ v489) >>> 8) | ((v492 ^ v489) << (32 - 8))));\n const v494 = ((v493 + v490) | 0);\n const v495 = ((((v21 + v479) | 0) + v468) | 0);\n const v496 = ((((v495 ^ v461) >>> 16) | ((v495 ^ v461) << (32 - 16))));\n const v497 = ((v496 + v486) | 0);\n const v498 = ((((v497 ^ v479) >>> 12) | ((v497 ^ v479) << (32 - 12))));\n const v499 = ((((v40 + v498) | 0) + v495) | 0);\n const v500 = ((((v499 ^ v496) >>> 8) | ((v499 ^ v496) << (32 - 8))));\n const v501 = ((v500 + v497) | 0);\n const v502 = ((((v23 + v487) | 0) + v476) | 0);\n const v503 = ((((v502 ^ v469) >>> 16) | ((v502 ^ v469) << (32 - 16))));\n const v504 = ((v503 + v462) | 0);\n const v505 = ((((v504 ^ v487) >>> 12) | ((v504 ^ v487) << (32 - 12))));\n const v506 = ((((v25 + v505) | 0) + v502) | 0);\n const v507 = ((((v506 ^ v503) >>> 8) | ((v506 ^ v503) << (32 - 8))));\n const v508 = ((v507 + v504) | 0);\n const v509 = ((((v30 + v463) | 0) + v484) | 0);\n const v510 = ((((v509 ^ v477) >>> 16) | ((v509 ^ v477) << (32 - 16))));\n const v511 = ((v510 + v470) | 0);\n const v512 = ((((v511 ^ v463) >>> 12) | ((v511 ^ v463) << (32 - 12))));\n const v513 = ((((v42 + v512) | 0) + v509) | 0);\n const v514 = ((((v513 ^ v510) >>> 8) | ((v513 ^ v510) << (32 - 8))));\n const v515 = ((v514 + v511) | 0);\n const v516 = ((((2144 + (v52 << 6)) | 0) + (Math.imul(v3, v10) << 6)) | 0);\n memory_i32[(((v516) >>> 0) + 0) >>> 2] = (v508 ^ v492);\n const v517 = ((4 + v516) | 0);\n memory_i32[(((v517) >>> 0) + 0) >>> 2] = (v515 ^ v499);\n const v518 = ((4 + v517) | 0);\n memory_i32[(((v518) >>> 0) + 0) >>> 2] = (v494 ^ v506);\n const v519 = ((4 + v518) | 0);\n memory_i32[(((v519) >>> 0) + 0) >>> 2] = (v501 ^ v513);\n const v520 = ((4 + v519) | 0);\n memory_i32[(((v520) >>> 0) + 0) >>> 2] = (v500 ^ ((((v515 ^ v512) >>> 7) | ((v515 ^ v512) << (32 - 7)))));\n const v521 = ((4 + v520) | 0);\n memory_i32[(((v521) >>> 0) + 0) >>> 2] = (v507 ^ ((((v494 ^ v491) >>> 7) | ((v494 ^ v491) << (32 - 7)))));\n const v522 = ((4 + v521) | 0);\n memory_i32[(((v522) >>> 0) + 0) >>> 2] = (v514 ^ ((((v501 ^ v498) >>> 7) | ((v501 ^ v498) << (32 - 7)))));\n const v523 = ((4 + v522) | 0);\n memory_i32[(((v523) >>> 0) + 0) >>> 2] = (v493 ^ ((((v508 ^ v505) >>> 7) | ((v508 ^ v505) << (32 - 7)))));\n const v524 = ((4 + v523) | 0);\n memory_i32[(((v524) >>> 0) + 0) >>> 2] = (v508 ^ v56);\n const v525 = ((4 + v524) | 0);\n memory_i32[(((v525) >>> 0) + 0) >>> 2] = (v515 ^ v58);\n const v526 = ((4 + v525) | 0);\n memory_i32[(((v526) >>> 0) + 0) >>> 2] = (v494 ^ v60);\n const v527 = ((4 + v526) | 0);\n memory_i32[(((v527) >>> 0) + 0) >>> 2] = (v501 ^ v62);\n const v528 = ((4 + v527) | 0);\n memory_i32[(((v528) >>> 0) + 0) >>> 2] = (v500 ^ v64);\n const v529 = ((4 + v528) | 0);\n memory_i32[(((v529) >>> 0) + 0) >>> 2] = (v507 ^ v66);\n const v530 = ((4 + v529) | 0);\n memory_i32[(((v530) >>> 0) + 0) >>> 2] = (v514 ^ v68);\n memory_i32[(((((4 + v530) | 0)) >>> 0) + 0) >>> 2] = (v493 ^ v69);\n const v531 = ((1 + v53) | 0);\n const v532 = ((((((-1 ^ v531) & (1 | v53)) | (1 & v53)) >>> 31) + v54) | 0);\n if (((((v55) >>> 0) < ((v2) >>> 0)) | 0)) {\n s7 = v55;\n s8 = v531;\n s9 = v532;\n continue L5;\n }\n s7 = v55;\n s8 = v531;\n s9 = v532;\n break L5;\n }\n const v52 = s7;\n const v53 = s8;\n const v54 = s9;\n s4 = v52;\n s5 = v53;\n s6 = v54;\n }\n const v50 = s5;\n const v51 = s6;\n const v533 = ((8 + Math.imul(2144, v10)) | 0);\n memory_i32[(((v533) >>> 0) + 0) >>> 2] = v50;\n memory_i32[(((v533) >>> 0) + 4) >>> 2] = v51;\n s3 = v9;\n }\n const v9 = s3;\n const v534 = ((1 + v9) | 0);\n if (((((v534) >>> 0) < ((v1) >>> 0)) | 0)) {\n s2 = v534;\n continue L2;\n }\n s2 = v534;\n break L2;\n }\n const v8 = s2;\n s1 = v8;\n }\n const v7 = s1;\n s0 = v7;\n }\n return;\n }\n function reset(v0, v1, v2, v3, v4) {\n memory.fill(0, ((Math.imul(2144, v0)) >>> 0), ((Math.imul(2144, v0)) >>> 0) + ((Math.imul(v1, 2144)) >>> 0));\n let s0 = 0;\n L0: {\n const v5 = s0;\n if (((((((((v5) >>> 0) < ((v1) >>> 0)) | 0)) | 0) === 0) | 0)) {\n s0 = v5;\n break L0;\n }\n let s1 = v5;\n L1: {\n const v6 = s1;\n let s2 = v6;\n L2: for (;;) {\n const v7 = s2;\n let s3 = v7;\n L3: {\n const v8 = s3;\n memory.fill(0, ((((2144 + (Math.imul(v4, ((v8 + v0) | 0)) << 6)) | 0)) >>> 0), ((((2144 + (Math.imul(v4, ((v8 + v0) | 0)) << 6)) | 0)) >>> 0) + ((v2) >>> 0));\n s3 = v8;\n }\n const v8 = s3;\n const v9 = ((1 + v8) | 0);\n if (((((v9) >>> 0) < ((v1) >>> 0)) | 0)) {\n s2 = v9;\n continue L2;\n }\n s2 = v9;\n break L2;\n }\n const v7 = s2;\n s1 = v7;\n }\n const v6 = s1;\n s0 = v6;\n }\n return;\n }\n const instance = { exports: { compressParents: compressParents, compressParentsFull: compressParentsFull, padding: padding, proccessChunksParallel: proccessChunksParallel, proccessChunksSequential: proccessChunksSequential, processBlocks: processBlocks, processOutBlocks: processOutBlocks, reset: reset, memory: { buffer: __buf } } };\n ;\n const _exports = instance.exports;\n const buffer = _exports.memory ? _exports.memory.buffer : new ArrayBuffer(0);\n const memoryExport = new Uint8Array(buffer, 0, 15730784);\n const segments = Object.freeze({ state: new Uint8Array(memoryExport.buffer, 0, 2144),\n state_chunks: Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 0 + i * 2144, 2144))),\n \"state.chunksDone_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 0 + i * 2144, 8))),\n \"state.chunkOut_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 8 + i * 2144, 8))),\n \"state.flags_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 16 + i * 2144, 4))),\n \"state.chunkPos_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 20 + i * 2144, 4))),\n \"state.stackPos_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 24 + i * 2144, 4))),\n \"state.lastBlockRem_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 28 + i * 2144, 4))),\n \"state.iv_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 32 + i * 2144, 32))),\n \"state.state_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 64 + i * 2144, 32))),\n \"state.stack_chunks\": Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 96 + i * 2144, 2048))),\n buffer: new Uint8Array(memoryExport.buffer, 2144, 10485760),\n buffer_chunks: Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 2144 + i * 10485760, 10485760))),\n stackBuffer: new Uint8Array(memoryExport.buffer, 10487904, 5242880),\n stackBuffer_chunks: Object.freeze(Array.from({ length: 1 }, (_, i) => new Uint8Array(memoryExport.buffer, 10487904 + i * 5242880, 5242880)))\n });\n return Object.freeze({ ..._exports, memory: memoryExport, segments });\n}\nlet _cache;\nexport default function blake3(_imports = {}, pool) {\n if (_cache)\n return _cache;\n return (_cache = init_module(_imports, pool));\n}\n", "import { mkHash } from \"../../hashes-abstract.js\";\nimport { sha3_224 as def_sha3_224 } from \"../../hashes.js\";\nimport mod_sha3_224 from './keccak24.js';\nimport { sha3_256 as def_sha3_256 } from \"../../hashes.js\";\nimport mod_sha3_256 from './keccak24.js';\nimport { sha3_384 as def_sha3_384 } from \"../../hashes.js\";\nimport mod_sha3_384 from './keccak24.js';\nimport { sha3_512 as def_sha3_512 } from \"../../hashes.js\";\nimport mod_sha3_512 from './keccak24.js';\nimport { keccak_224 as def_keccak_224 } from \"../../hashes.js\";\nimport mod_keccak_224 from './keccak24.js';\nimport { keccak_256 as def_keccak_256 } from \"../../hashes.js\";\nimport mod_keccak_256 from './keccak24.js';\nimport { keccak_384 as def_keccak_384 } from \"../../hashes.js\";\nimport mod_keccak_384 from './keccak24.js';\nimport { keccak_512 as def_keccak_512 } from \"../../hashes.js\";\nimport mod_keccak_512 from './keccak24.js';\nimport { shake128 as def_shake128 } from \"../../hashes.js\";\nimport mod_shake128 from './keccak24.js';\nimport { shake256 as def_shake256 } from \"../../hashes.js\";\nimport mod_shake256 from './keccak24.js';\nimport { shake128_32 as def_shake128_32 } from \"../../hashes.js\";\nimport mod_shake128_32 from './keccak24.js';\nimport { shake256_64 as def_shake256_64 } from \"../../hashes.js\";\nimport mod_shake256_64 from './keccak24.js';\nimport { sha224 as def_sha224 } from \"../../hashes.js\";\nimport mod_sha224 from './sha256.js';\nimport { sha256 as def_sha256 } from \"../../hashes.js\";\nimport mod_sha256 from './sha256.js';\nimport { sha384 as def_sha384 } from \"../../hashes.js\";\nimport mod_sha384 from './sha512.js';\nimport { sha512 as def_sha512 } from \"../../hashes.js\";\nimport mod_sha512 from './sha512.js';\nimport { sha512_224 as def_sha512_224 } from \"../../hashes.js\";\nimport mod_sha512_224 from './sha512.js';\nimport { sha512_256 as def_sha512_256 } from \"../../hashes.js\";\nimport mod_sha512_256 from './sha512.js';\nimport { sha1 as def_sha1 } from \"../../hashes.js\";\nimport mod_sha1 from './sha1.js';\nimport { ripemd160 as def_ripemd160 } from \"../../hashes.js\";\nimport mod_ripemd160 from './ripemd160.js';\nimport { md5 as def_md5 } from \"../../hashes.js\";\nimport mod_md5 from './md5.js';\nimport { blake224 as def_blake224 } from \"../../hashes.js\";\nimport mod_blake224 from './blake256.js';\nimport { blake256 as def_blake256 } from \"../../hashes.js\";\nimport mod_blake256 from './blake256.js';\nimport { blake384 as def_blake384 } from \"../../hashes.js\";\nimport mod_blake384 from './blake512.js';\nimport { blake512 as def_blake512 } from \"../../hashes.js\";\nimport mod_blake512 from './blake512.js';\nimport { blake2s as def_blake2s } from \"../../hashes.js\";\nimport mod_blake2s from './blake2s.js';\nimport { blake2b as def_blake2b } from \"../../hashes.js\";\nimport mod_blake2b from './blake2b.js';\nimport { blake3 as def_blake3 } from \"../../hashes.js\";\nimport mod_blake3 from './blake3.js';\nimport { poly1305 as def_poly1305 } from \"../../hashes.js\";\nimport mod_poly1305 from './poly1305.js';\nimport { ghash as def_ghash } from \"../../hashes.js\";\nimport mod_ghash from './ghash.js';\nimport { polyval as def_polyval } from \"../../hashes.js\";\nimport mod_polyval from './polyval.js';\nimport { cmac as def_cmac } from \"../../hashes.js\";\nimport mod_cmac from './cmac.js';\nimport { mkCipher } from \"../../ciphers-abstract.js\";\nimport { ctr as def_ctr } from \"../../ciphers.js\";\nimport mod_ctr from './aes_ctr.js';\nimport { cbc as def_cbc } from \"../../ciphers.js\";\nimport mod_cbc from './aes_cbc.js';\nimport { ofb as def_ofb } from \"../../ciphers.js\";\nimport mod_ofb from './aes_ofb.js';\nimport { cfb as def_cfb } from \"../../ciphers.js\";\nimport mod_cfb from './aes_cfb.js';\nimport { ecb as def_ecb } from \"../../ciphers.js\";\nimport mod_ecb from './aes_ecb.js';\nimport { gcm as def_gcm } from \"../../ciphers.js\";\nimport mod_gcm from './aes_gcm.js';\nimport { gcmsiv as def_gcmsiv } from \"../../ciphers.js\";\nimport mod_gcmsiv from './aes_gcmsiv.js';\nimport { aessiv as def_aessiv } from \"../../ciphers.js\";\nimport mod_aessiv from './aes_siv.js';\nimport { aeskw as def_aeskw } from \"../../ciphers.js\";\nimport mod_aeskw from './aes_kw.js';\nimport { aeskwp as def_aeskwp } from \"../../ciphers.js\";\nimport mod_aeskwp from './aes_kwp.js';\nimport { salsa20 as def_salsa20 } from \"../../ciphers.js\";\nimport mod_salsa20 from './salsa20.js';\nimport { xsalsa20 as def_xsalsa20 } from \"../../ciphers.js\";\nimport mod_xsalsa20 from './salsa20.js';\nimport { chacha8 as def_chacha8 } from \"../../ciphers.js\";\nimport mod_chacha8 from './chacha8.js';\nimport { chacha12 as def_chacha12 } from \"../../ciphers.js\";\nimport mod_chacha12 from './chacha12.js';\nimport { chacha20 as def_chacha20 } from \"../../ciphers.js\";\nimport mod_chacha20 from './chacha20.js';\nimport { chacha20orig as def_chacha20orig } from \"../../ciphers.js\";\nimport mod_chacha20orig from './chacha20.js';\nimport { xchacha20 as def_xchacha20 } from \"../../ciphers.js\";\nimport mod_xchacha20 from './chacha20.js';\nimport { chacha20poly1305 as def_chacha20poly1305 } from \"../../ciphers.js\";\nimport mod_chacha20poly1305 from './chacha_poly1305.js';\nimport { xchacha20poly1305 as def_xchacha20poly1305 } from \"../../ciphers.js\";\nimport mod_xchacha20poly1305 from './chacha_poly1305.js';\nimport { xsalsa20poly1305 as def_xsalsa20poly1305 } from \"../../ciphers.js\";\nimport mod_xsalsa20poly1305 from './salsa_poly1305.js';\nimport { scrypt as def_scrypt } from \"../../hashes.js\";\nimport mod_scrypt from './scrypt.js';\nimport { argon2d as def_argon2d } from \"../../hashes.js\";\nimport mod_argon2d from './argon2.js';\nimport { argon2i as def_argon2i } from \"../../hashes.js\";\nimport mod_argon2i from './argon2.js';\nimport { argon2id as def_argon2id } from \"../../hashes.js\";\nimport mod_argon2id from './argon2.js';\n/**\n * SHA3-224 hash function.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { sha3_224 } from '@awasm/noble';\n * sha3_224(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const sha3_224 = /* @__PURE__ */ mkHash(mod_sha3_224, def_sha3_224, 'js');\n/**\n * SHA3-256 hash function. Different from keccak-256.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { sha3_256 } from '@awasm/noble';\n * sha3_256(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const sha3_256 = /* @__PURE__ */ mkHash(mod_sha3_256, def_sha3_256, 'js');\n/**\n * SHA3-384 hash function.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { sha3_384 } from '@awasm/noble';\n * sha3_384(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const sha3_384 = /* @__PURE__ */ mkHash(mod_sha3_384, def_sha3_384, 'js');\n/**\n * SHA3-512 hash function.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { sha3_512 } from '@awasm/noble';\n * sha3_512(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const sha3_512 = /* @__PURE__ */ mkHash(mod_sha3_512, def_sha3_512, 'js');\n/**\n * keccak-224 hash function.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { keccak_224 } from '@awasm/noble';\n * keccak_224(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const keccak_224 = /* @__PURE__ */ mkHash(mod_keccak_224, def_keccak_224, 'js');\n/**\n * keccak-256 hash function. Different from SHA3-256.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { keccak_256 } from '@awasm/noble';\n * keccak_256(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const keccak_256 = /* @__PURE__ */ mkHash(mod_keccak_256, def_keccak_256, 'js');\n/**\n * keccak-384 hash function.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { keccak_384 } from '@awasm/noble';\n * keccak_384(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const keccak_384 = /* @__PURE__ */ mkHash(mod_keccak_384, def_keccak_384, 'js');\n/**\n * keccak-512 hash function.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { keccak_512 } from '@awasm/noble';\n * keccak_512(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const keccak_512 = /* @__PURE__ */ mkHash(mod_keccak_512, def_keccak_512, 'js');\n/**\n * SHAKE128 XOF with 128-bit security.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { shake128 } from '@awasm/noble';\n * shake128(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const shake128 = /* @__PURE__ */ mkHash(mod_shake128, def_shake128, 'js');\n/**\n * SHAKE256 XOF with 256-bit security.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { shake256 } from '@awasm/noble';\n * shake256(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const shake256 = /* @__PURE__ */ mkHash(mod_shake256, def_shake256, 'js');\n/**\n * SHAKE128 XOF with 256-bit output (NIST version).\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { shake128_32 } from '@awasm/noble';\n * shake128_32(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const shake128_32 = /* @__PURE__ */ mkHash(mod_shake128_32, def_shake128_32, 'js');\n/**\n * SHAKE256 XOF with 512-bit output (NIST version).\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { shake256_64 } from '@awasm/noble';\n * shake256_64(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const shake256_64 = /* @__PURE__ */ mkHash(mod_shake256_64, def_shake256_64, 'js');\n/**\n * SHA2-224 hash function from RFC 4634\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { sha224 } from '@awasm/noble';\n * sha224(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const sha224 = /* @__PURE__ */ mkHash(mod_sha224, def_sha224, 'js');\n/**\n * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info:\n * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack.\n * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n * - Each sha256 hash is executing 2^18 bit operations.\n * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { sha256 } from '@awasm/noble';\n * sha256(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const sha256 = /* @__PURE__ */ mkHash(mod_sha256, def_sha256, 'js');\n/**\n * SHA2-384 hash function from RFC 4634.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { sha384 } from '@awasm/noble';\n * sha384(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const sha384 = /* @__PURE__ */ mkHash(mod_sha384, def_sha384, 'js');\n/**\n * SHA2-512 hash function from RFC 4634.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { sha512 } from '@awasm/noble';\n * sha512(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const sha512 = /* @__PURE__ */ mkHash(mod_sha512, def_sha512, 'js');\n/**\n * SHA2-512/224 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on truncated SHA512.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { sha512_224 } from '@awasm/noble';\n * sha512_224(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const sha512_224 = /* @__PURE__ */ mkHash(mod_sha512_224, def_sha512_224, 'js');\n/**\n * SHA2-512/256 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on truncated SHA512.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { sha512_256 } from '@awasm/noble';\n * sha512_256(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const sha512_256 = /* @__PURE__ */ mkHash(mod_sha512_256, def_sha512_256, 'js');\n/**\n * SHA1 (RFC 3174) legacy hash function. It was cryptographically broken.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { sha1 } from '@awasm/noble';\n * sha1(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const sha1 = /* @__PURE__ */ mkHash(mod_sha1, def_sha1, 'js');\n/**\n * RIPEMD-160 - a legacy hash function from 1990s.\n * *\n * *\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { ripemd160 } from '@awasm/noble';\n * ripemd160(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const ripemd160 = /* @__PURE__ */ mkHash(mod_ripemd160, def_ripemd160, 'js');\n/**\n * MD5 (RFC 1321) legacy hash function. It was cryptographically broken.\n * MD5 architecture is similar to SHA1, with some differences:\n * - Reduced output length: 16 bytes (128 bit) instead of 20\n * - 64 rounds, instead of 80\n * - Little-endian: could be faster, but will require more code\n * - Non-linear index selection: huge speed-up for unroll\n * - Per round constants: more memory accesses, additional speed-up for unroll\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { md5 } from '@awasm/noble';\n * md5(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const md5 = /* @__PURE__ */ mkHash(mod_md5, def_md5, 'js');\n/**\n * blake1-224 hash function\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} and {@link BlakeOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { blake224 } from '@awasm/noble';\n * blake224(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const blake224 = /* @__PURE__ */ mkHash(mod_blake224, def_blake224, 'js');\n/**\n * blake1-256 hash function\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} and {@link BlakeOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { blake256 } from '@awasm/noble';\n * blake256(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const blake256 = /* @__PURE__ */ mkHash(mod_blake256, def_blake256, 'js');\n/**\n * blake1-384 hash function\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} and {@link BlakeOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { blake384 } from '@awasm/noble';\n * blake384(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const blake384 = /* @__PURE__ */ mkHash(mod_blake384, def_blake384, 'js');\n/**\n * blake1-512 hash function\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} and {@link BlakeOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { blake512 } from '@awasm/noble';\n * blake512(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const blake512 = /* @__PURE__ */ mkHash(mod_blake512, def_blake512, 'js');\n/**\n * Blake2s hash function. Focuses on 8-bit to 32-bit platforms.\n * 1.5x faster than blake2b in JS.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} and {@link Blake2Opts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { blake2s } from '@awasm/noble';\n * blake2s(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const blake2s = /* @__PURE__ */ mkHash(mod_blake2s, def_blake2s, 'js');\n/**\n * Blake2b hash function. 64-bit.\n * 1.5x slower than blake2s in JS.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} and {@link Blake2Opts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { blake2b } from '@awasm/noble';\n * blake2b(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport const blake2b = /* @__PURE__ */ mkHash(mod_blake2b, def_blake2b, 'js');\n/**\n * BLAKE3 hash function. Can be used as MAC and KDF.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} and {@link Blake3Opts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { blake3 } from '@awasm/noble';\n * const data = new Uint8Array(32);\n * const hash = blake3(data);\n * const mac = blake3(data, { key: new Uint8Array(32) });\n * const kdf = blake3(data, { context: new Uint8Array([1, 2, 3]) });\n * ```\n */\nexport const blake3 = /* @__PURE__ */ mkHash(mod_blake3, def_blake3, 'js');\n/**\n * Poly1305 MAC from RFC 8439.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { poly1305 } from '@awasm/noble';\n * poly1305(new Uint8Array([1, 2, 3]), { key: new Uint8Array(32) });\n * ```\n */\nexport const poly1305 = /* @__PURE__ */ mkHash(mod_poly1305, def_poly1305, 'js');\n/**\n * GHash MAC for AES-GCM.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { ghash } from '@awasm/noble';\n * ghash(new Uint8Array([1, 2, 3]), { key: new Uint8Array(16) });\n * ```\n */\nexport const ghash = /* @__PURE__ */ mkHash(mod_ghash, def_ghash, 'js');\n/**\n * Polyval MAC for AES-SIV.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { polyval } from '@awasm/noble';\n * polyval(new Uint8Array([1, 2, 3]), { key: new Uint8Array(16) });\n * ```\n */\nexport const polyval = /* @__PURE__ */ mkHash(mod_polyval, def_polyval, 'js');\n/**\n * AES-CMAC (Cipher-based Message Authentication Code).\n * Specs: RFC 4493.\n *\n * @param msg - message to hash.\n * @param opts - optional {@link OutputOpts} hash configuration.\n * @returns Hash output bytes.\n * @example\n * ```ts\n * import { cmac } from '@awasm/noble';\n * cmac(new Uint8Array([1, 2, 3]), { key: new Uint8Array(16) });\n * ```\n */\nexport const cmac = /* @__PURE__ */ mkHash(mod_cmac, def_cmac, 'js');\n/**\n * CTR (Counter Mode): Turns a block cipher into a stream cipher using a counter and IV (nonce).\n * Efficient and parallelizable. Requires a unique nonce per encryption. Unauthenticated: needs MAC.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { ctr } from '@awasm/noble';\n * ctr(new Uint8Array(16), new Uint8Array(16));\n * ```\n */\nexport const ctr = /* @__PURE__ */ mkCipher(mod_ctr, def_ctr, 'js');\n/**\n * CBC (Cipher Block Chaining): Each plaintext block is XORed with the\n * previous block of ciphertext before encryption.\n * Hard to use: requires proper padding and an IV. Unauthenticated: needs MAC.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { cbc } from '@awasm/noble';\n * cbc(new Uint8Array(16), new Uint8Array(16));\n * ```\n */\nexport const cbc = /* @__PURE__ */ mkCipher(mod_cbc, def_cbc, 'js');\n/**\n * OFB mode for AES block cipher.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { ofb } from '@awasm/noble';\n * ofb(new Uint8Array(16), new Uint8Array(16));\n * ```\n */\nexport const ofb = /* @__PURE__ */ mkCipher(mod_ofb, def_ofb, 'js');\n/**\n * CFB: Cipher Feedback Mode. The input for the block cipher is the previous cipher output.\n * Unauthenticated: needs MAC.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { cfb } from '@awasm/noble';\n * cfb(new Uint8Array(16), new Uint8Array(16));\n * ```\n */\nexport const cfb = /* @__PURE__ */ mkCipher(mod_cfb, def_cfb, 'js');\n/**\n * ECB (Electronic Codebook): Deterministic encryption; identical plaintext blocks yield\n * identical ciphertexts. Not secure due to pattern leakage.\n * See AES Penguin.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { ecb } from '@awasm/noble';\n * ecb(new Uint8Array(16));\n * ```\n */\nexport const ecb = /* @__PURE__ */ mkCipher(mod_ecb, def_ecb, 'js');\n/**\n * GCM (Galois/Counter Mode): Combines CTR mode with polynomial MAC. Efficient and widely used.\n * Not perfect:\n * a) conservative key wear-out is '232' (4B) msgs.\n * b) key wear-out under random nonces is even smaller: '223' (8M) messages for '2-50' chance.\n * c) MAC can be forged: see Poly1305 documentation.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { gcm } from '@awasm/noble';\n * gcm(new Uint8Array(16), new Uint8Array(12));\n * ```\n */\nexport const gcm = /* @__PURE__ */ mkCipher(mod_gcm, def_gcm, 'js');\n/**\n * SIV (Synthetic IV): GCM with nonce-misuse resistance.\n * Repeating nonces reveal only the fact plaintexts are identical.\n * Also suffers from GCM issues: key wear-out limits & MAC forging.\n * See RFC 8452.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { gcmsiv } from '@awasm/noble';\n * gcmsiv(new Uint8Array(16), new Uint8Array(12));\n * ```\n */\nexport const gcmsiv = /* @__PURE__ */ mkCipher(mod_gcmsiv, def_gcmsiv, 'js');\n/**\n * SIV: Synthetic Initialization Vector (SIV) Authenticated Encryption\n * Nonce is derived from the plaintext and AAD using the S2V function.\n * See RFC 5297.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { aessiv } from '@awasm/noble';\n * aessiv(new Uint8Array(32));\n * ```\n */\nexport const aessiv = /* @__PURE__ */ mkCipher(mod_aessiv, def_aessiv, 'js');\n/**\n * AES-KW (key-wrap). Injects static IV into plaintext, adds counter, encrypts 6 times.\n * Reduces block size from 16 to 8 bytes.\n * For padded version, use aeskwp.\n * RFC 3394,\n * NIST.SP.800-38F.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { aeskw } from '@awasm/noble';\n * aeskw(new Uint8Array(16));\n * ```\n */\nexport const aeskw = /* @__PURE__ */ mkCipher(mod_aeskw, def_aeskw, 'js');\n/**\n * AES-KW, but with padding and allows random keys.\n * Second u32 of IV is used as counter for length.\n * RFC 5649\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { aeskwp } from '@awasm/noble';\n * aeskwp(new Uint8Array(16));\n * ```\n */\nexport const aeskwp = /* @__PURE__ */ mkCipher(mod_aeskwp, def_aeskwp, 'js');\n/**\n * Salsa20 from original paper. 12-byte nonce.\n * With smaller nonce, it's not safe to make it random (CSPRNG), due to collision chance.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { salsa20 } from '@awasm/noble';\n * salsa20(new Uint8Array(32), new Uint8Array(8));\n * ```\n */\nexport const salsa20 = /* @__PURE__ */ mkCipher(mod_salsa20, def_salsa20, 'js');\n/**\n * xsalsa20 eXtended-nonce salsa. With 24-byte nonce, it's safe to make it random (CSPRNG).\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { xsalsa20 } from '@awasm/noble';\n * xsalsa20(new Uint8Array(32), new Uint8Array(24));\n * ```\n */\nexport const xsalsa20 = /* @__PURE__ */ mkCipher(mod_xsalsa20, def_xsalsa20, 'js');\n/**\n * Reduced 8-round chacha, described in original paper.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { chacha8 } from '@awasm/noble';\n * chacha8(new Uint8Array(32), new Uint8Array(12));\n * ```\n */\nexport const chacha8 = /* @__PURE__ */ mkCipher(mod_chacha8, def_chacha8, 'js');\n/**\n * Reduced 12-round chacha, described in original paper.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { chacha12 } from '@awasm/noble';\n * chacha12(new Uint8Array(32), new Uint8Array(12));\n * ```\n */\nexport const chacha12 = /* @__PURE__ */ mkCipher(mod_chacha12, def_chacha12, 'js');\n/**\n * ChaCha stream cipher. Conforms to RFC 8439 (IETF, TLS). 12-byte nonce, 4-byte counter.\n * With smaller nonce, it's not safe to make it random (CSPRNG), due to collision chance.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { chacha20 } from '@awasm/noble';\n * chacha20(new Uint8Array(32), new Uint8Array(12));\n * ```\n */\nexport const chacha20 = /* @__PURE__ */ mkCipher(mod_chacha20, def_chacha20, 'js');\n/**\n * Original, non-RFC chacha20 from DJB. 8-byte nonce, 8-byte counter.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { chacha20orig } from '@awasm/noble';\n * chacha20orig(new Uint8Array(32), new Uint8Array(8));\n * ```\n */\nexport const chacha20orig = /* @__PURE__ */ mkCipher(mod_chacha20orig, def_chacha20orig, 'js');\n/**\n * XChaCha eXtended-nonce ChaCha. With 24-byte nonce, it's safe to make it random (CSPRNG).\n * See IRTF draft.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { xchacha20 } from '@awasm/noble';\n * xchacha20(new Uint8Array(32), new Uint8Array(24));\n * ```\n */\nexport const xchacha20 = /* @__PURE__ */ mkCipher(mod_xchacha20, def_xchacha20, 'js');\n/**\n * ChaCha20-Poly1305 from RFC 8439.\n * Unsafe to use random nonces under the same key, due to collision chance.\n * Prefer XChaCha instead.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { chacha20poly1305 } from '@awasm/noble';\n * chacha20poly1305(new Uint8Array(32), new Uint8Array(12));\n * ```\n */\nexport const chacha20poly1305 = /* @__PURE__ */ mkCipher(mod_chacha20poly1305, def_chacha20poly1305, 'js');\n/**\n * XChaCha20-Poly1305 extended-nonce chacha.\n * Can be safely used with random nonces (CSPRNG).\n * See IRTF draft.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { xchacha20poly1305 } from '@awasm/noble';\n * xchacha20poly1305(new Uint8Array(32), new Uint8Array(24));\n * ```\n */\nexport const xchacha20poly1305 = /* @__PURE__ */ mkCipher(mod_xchacha20poly1305, def_xchacha20poly1305, 'js');\n/**\n * xsalsa20-poly1305 eXtended-nonce (24 bytes) salsa.\n * With 24-byte nonce, it's safe to make it random (CSPRNG).\n * Also known as 'secretbox' from libsodium / nacl.\n *\n * @param key - secret key bytes.\n * @param args - algorithm-specific extra arguments such as nonce or AAD.\n * @returns Configured cipher instance.\n * @example\n * ```ts\n * import { xsalsa20poly1305 } from '@awasm/noble';\n * xsalsa20poly1305(new Uint8Array(32), new Uint8Array(24));\n * ```\n */\nexport const xsalsa20poly1305 = /* @__PURE__ */ mkCipher(mod_xsalsa20poly1305, def_xsalsa20poly1305, 'js');\n/**\n * Scrypt KDF\n *\n * @param password - password or key material bytes.\n * @param salt - salt bytes.\n * @param opts - algorithm configuration options.\n * @returns Derived output bytes.\n * @example\n * ```ts\n * import { scrypt } from '@awasm/noble';\n * scrypt('password', 'salt', { N: 16, r: 1, p: 1, dkLen: 32 });\n * ```\n */\nexport const scrypt = /* @__PURE__ */ def_scrypt(mod_scrypt, { sha256 }, 'js');\n/**\n * argon2d GPU-resistant version.\n *\n * @param password - password or key material bytes.\n * @param salt - salt bytes.\n * @param opts - algorithm configuration options.\n * @returns Derived output bytes.\n * @example\n * ```ts\n * import { argon2d } from '@awasm/noble';\n * argon2d('password', 'saltsalt', { t: 1, m: 8, p: 1, dkLen: 32 });\n * ```\n */\nexport const argon2d = /* @__PURE__ */ def_argon2d(mod_argon2d, { blake2b }, 'js');\n/**\n * argon2i side-channel-resistant version.\n *\n * @param password - password or key material bytes.\n * @param salt - salt bytes.\n * @param opts - algorithm configuration options.\n * @returns Derived output bytes.\n * @example\n * ```ts\n * import { argon2i } from '@awasm/noble';\n * argon2i('password', 'saltsalt', { t: 1, m: 8, p: 1, dkLen: 32 });\n * ```\n */\nexport const argon2i = /* @__PURE__ */ def_argon2i(mod_argon2i, { blake2b }, 'js');\n/**\n * argon2id, combining i+d, the most popular version from RFC 9106\n *\n * @param password - password or key material bytes.\n * @param salt - salt bytes.\n * @param opts - algorithm configuration options.\n * @returns Derived output bytes.\n * @example\n * ```ts\n * import { argon2id } from '@awasm/noble';\n * argon2id('password', 'saltsalt', { t: 1, m: 8, p: 1, dkLen: 32 });\n * ```\n */\nexport const argon2id = /* @__PURE__ */ def_argon2id(mod_argon2id, { blake2b }, 'js');\n/**\n * Alias to xsalsa20poly1305, for compatibility with libsodium / nacl.\n * Check out for crypto_box.\n *\n * @param key - secret key bytes.\n * @param nonce - nonce bytes.\n * @returns Configured secretbox helper.\n * @example\n * ```ts\n * import { secretbox } from '@awasm/noble';\n * secretbox(new Uint8Array(32), new Uint8Array(24));\n * ```\n */\nexport const secretbox = (key, nonce) => {\n const xs = xsalsa20poly1305(key, nonce);\n return { seal: xs.encrypt, open: xs.decrypt };\n};\n", "\nimport {blake3} from \"@awasm/noble/js.js\"\nimport {dataViewFrom, txt} from \"@e280/stz\"\n\nconst endian = false\nenum EntropyType {String, Number, Bytes}\n\nexport function hash(...entropy: (string | number | Uint8Array)[]) {\n\tif (entropy.length === 0)\n\t\tthrow new RangeError(\"hash requires entropy\")\n\n\tconst hasher = blake3.create()\n\tconst typeTag = new Uint8Array(1)\n\tconst lengthTag = new Uint8Array(4)\n\tconst lengthDataview = dataViewFrom(lengthTag)\n\n\tfor (const part of entropy) {\n\t\tif (typeof part === \"string\") {\n\t\t\tconst bytes = txt.toBytes(part)\n\t\t\ttypeTag[0] = EntropyType.String\n\t\t\tlengthDataview.setUint32(0, bytes.byteLength, endian)\n\t\t\thasher.update(typeTag)\n\t\t\thasher.update(lengthTag)\n\t\t\thasher.update(bytes)\n\t\t}\n\t\telse if (typeof part === \"number\") {\n\t\t\tconst bytes = new Uint8Array(8)\n\t\t\tdataViewFrom(bytes).setFloat64(0, part, endian)\n\t\t\ttypeTag[0] = EntropyType.Number\n\t\t\tlengthDataview.setUint32(0, bytes.byteLength, endian)\n\t\t\thasher.update(typeTag)\n\t\t\thasher.update(lengthTag)\n\t\t\thasher.update(bytes)\n\t\t}\n\t\telse if (part instanceof Uint8Array) {\n\t\t\ttypeTag[0] = EntropyType.Bytes\n\t\t\tlengthDataview.setUint32(0, part.byteLength, endian)\n\t\t\thasher.update(typeTag)\n\t\t\thasher.update(lengthTag)\n\t\t\thasher.update(part)\n\t\t}\n\t\telse throw new Error(\"unknown part type\")\n\t}\n\n\treturn hasher.digest() as Uint8Array\n}\n\n", "\nimport {isArray, isNumber, isString} from \"@e280/stz\"\nimport type {Bindings} from \"../types.js\"\nimport type {Expression} from \"../expression.js\"\n\nexport function isExpression(b: Bindings): b is Expression {\n\tif (b === null) return true\n\tif (isString(b)) return true\n\tif (isNumber(b)) return true\n\tif (isArray(b)) return true\n\treturn false\n}\n\n", "\nimport {hex} from \"@e280/stz\"\nimport {Bindings} from \"../types.js\"\nimport {hash} from \"../../utils/hash.js\"\nimport {isExpression} from \"./is-expression.js\"\n\nexport function hashBindings(bindings: Bindings) {\n\tconst paths: string[] = []\n\n\tfunction recurse(b: Bindings, path: string[]) {\n\t\tif (isExpression(b)) {\n\t\t\tpaths.push(JSON.stringify(path))\n\t\t}\n\t\telse {\n\t\t\tfor (const [key, value] of Object.entries(b))\n\t\t\t\trecurse(value, [...path, key])\n\t\t}\n\t}\n\n\trecurse(bindings, [\"b\"])\n\tpaths.sort()\n\treturn hex(hash(\"tact/bindings/v1\", ...paths).slice(16))\n}\n\n", "\nimport {RMap, RSet} from \"@e280/strata\"\nimport {got, IdCounter} from \"@e280/stz\"\n\nimport {PlayerId} from \"./types.js\"\nimport {Bindings} from \"../../input/types.js\"\nimport {Controller} from \"../../input/controller.js\"\nimport {minihash} from \"../../input/data/intent/minihash.js\"\nimport {encodeParcels} from \"../../input/data/parcel/encode.js\"\nimport {encodeIntents} from \"../../input/data/intent/encode.js\"\nimport {hashBindings} from \"../../input/investigate/hash-bindings.js\"\n\nexport class Hub<B extends Bindings = any> {\n\t#minihash\n\t#ids = new IdCounter()\n\t#unassigned = new RSet<Controller<B>>()\n\t#players = new RMap<PlayerId, {controllers: RSet<Controller<B>>}>()\n\n\tconstructor(readonly bindings: B) {\n\t\tthis.#minihash = minihash(hashBindings(bindings))\n\t}\n\n\tget playerIds() {\n\t\treturn [...this.#players.keys()]\n\t}\n\n\tget controllers() {\n\t\treturn {\n\t\t\tunassigned: [...this.#unassigned],\n\t\t\tassigned: new Map<PlayerId, Controller<B>[]>(\n\t\t\t\t[...this.#players]\n\t\t\t\t\t.map(([playerId, port]) => [playerId, [...port.controllers]])\n\t\t\t),\n\t\t}\n\t}\n\n\tcreatePlayer(): PlayerId {\n\t\tconst playerId = this.#ids.next()\n\t\tthis.#players.set(playerId, {controllers: new RSet()})\n\t\treturn playerId\n\t}\n\n\tdeletePlayer(playerId: PlayerId) {\n\t\tthis.#players.get(playerId)?.controllers.forEach(c => this.#unassigned.add(c))\n\t\tthis.#players.delete(playerId)\n\t\treturn this\n\t}\n\n\tadd(controller: Controller<B>) {\n\t\tthis.unplug(controller)\n\t\treturn this\n\t}\n\n\tremove(controller: Controller<B>) {\n\t\tthis.unplug(controller)\n\t\tthis.#unassigned.delete(controller)\n\t\treturn this\n\t}\n\n\tunplug(controller: Controller<B>) {\n\t\tthis.#unassigned.add(controller)\n\t\tfor (const port of this.#players.values())\n\t\t\tport.controllers.delete(controller)\n\t\treturn this\n\t}\n\n\tplug(controller: Controller<B>, playerId?: PlayerId) {\n\t\tplayerId ??= this.playerIds.at(-1) ?? this.createPlayer()\n\t\tthis.unplug(controller)\n\t\tgot(this.#players.get(playerId)).controllers.add(controller)\n\t\tthis.#unassigned.delete(controller)\n\t\treturn this\n\t}\n\n\tencode(playerId: PlayerId, time = performance.now()) {\n\t\tconst intents = new Map<number, number>()\n\t\tconst {controllers} = got(this.#players.get(playerId))\n\n\t\tfor (const controller of controllers) {\n\t\t\tfor (const intent of controller.evaluate(time)) {\n\t\t\t\tconst alpha = intents.get(intent.id) ?? 0\n\t\t\t\tintents.set(intent.id, alpha + intent.value)\n\t\t\t}\n\t\t}\n\n\t\tconst changedIntents = [...intents]\n\t\t\t.filter(([, value]) => value !== 0)\n\t\t\t.map(([id, value]) => ({id, value}))\n\n\t\treturn encodeIntents(this.#minihash, changedIntents)\n\t}\n\n\tencodeAll(time = performance.now()) {\n\n\t\t// drain and discard unused controller inputs.\n\t\tfor (const controller of this.#unassigned)\n\t\t\tcontroller.clear()\n\n\t\t// encode intents.\n\t\tconst parcels = Array.from(this.#players.keys()).map(playerId => ({\n\t\t\tplayerId,\n\t\t\tintents: this.encode(playerId, time),\n\t\t}))\n\n\t\t// encode parcels.\n\t\treturn encodeParcels(parcels)\n\t}\n}\n\n", "\nimport {isHappy} from \"@e280/stz\"\nimport {Scan} from \"../../types.js\"\n\nexport function idbRange({start, end}: Scan) {\n\tif (isHappy(start) && isHappy(end)) return IDBKeyRange.bound(start, end, false, true)\n\tif (isHappy(start)) return IDBKeyRange.lowerBound(start, false)\n\tif (isHappy(end)) return IDBKeyRange.upperBound(end, true)\n}\n\n", "\nexport async function idbWait<T>(request: IDBRequest<T>) {\n\treturn new Promise<T>((resolve, reject) => {\n\t\trequest.onsuccess = () => resolve(request.result)\n\t\trequest.onerror = () => reject(request.error)\n\t})\n}\n\n", "\nimport {Idb} from \"./types.js\"\nimport {idbWait} from \"./wait.js\"\n\nexport function idbTransactions({db, storeName}: Idb) {\n\tconst setup = (mode: IDBTransactionMode) => (\n\t\tasync<R>(fn: (store: IDBObjectStore, wait: typeof idbWait) => Promise<R>) => {\n\t\t\tconst tx = db.transaction(storeName, mode)\n\t\t\tconst store = tx.objectStore(storeName)\n\n\t\t\tconst completed = new Promise((resolve, reject) => {\n\t\t\t\ttx.onabort = () => reject(tx.error ?? new Error(\"transaction aborted\"))\n\t\t\t\ttx.oncomplete = () => resolve(undefined)\n\t\t\t})\n\n\t\t\ttry {\n\t\t\t\tconst result = await fn(store, idbWait)\n\t\t\t\ttx.commit()\n\t\t\t\tawait completed\n\t\t\t\treturn result\n\t\t\t}\n\t\t\tcatch (error) {\n\t\t\t\ttry { tx.abort() }\n\t\t\t\tcatch {}\n\t\t\t\tthrow error\n\t\t\t}\n\t\t}\n\t)\n\n\treturn {\n\t\treadonly: setup(\"readonly\"),\n\t\treadwrite: setup(\"readwrite\"),\n\t}\n}\n\n", "\nimport {Idb} from \"../utils/idb/types.js\"\nimport {idbRange} from \"../utils/idb/range.js\"\nimport {Op, Magazine, Scan, Value} from \"../types.js\"\nimport {idbTransactions} from \"../utils/idb/transactions.js\"\n\nexport class IdbMagazine implements Magazine {\n\t#tx\n\n\tconstructor(idb: Idb) {\n\t\tthis.#tx = idbTransactions(idb)\n\t}\n\n\tasync commit(ops: Op<Value>[]) {\n\t\treturn this.#tx.readwrite(async store => {\n\t\t\tfor (const [key, value] of ops) {\n\t\t\t\tif (value === undefined)\n\t\t\t\t\tstore.delete(key)\n\t\t\t\telse\n\t\t\t\t\tstore.put(value, key)\n\t\t\t}\n\t\t})\n\t}\n\n\tasync getMany(keys: string[]) {\n\t\treturn this.#tx.readonly((store, wait) => (\n\t\t\tPromise.all(\n\t\t\t\tkeys.map(key => wait<Value | undefined>(store.get(key)))\n\t\t\t)\n\t\t))\n\t}\n\n\tasync* entries(scan: Scan = {}) {\n\t\tif (scan.limit === 0)\n\t\t\treturn\n\n\t\tyield* await this.#tx.readonly(async (store, wait) => {\n\t\t\tconst entries: [string, Value][] = []\n\t\t\tconst direction = scan.reverse ? \"prev\" : \"next\"\n\t\t\tconst request = store.openCursor(idbRange(scan), direction)\n\n\t\t\tlet cursor = await wait<IDBCursorWithValue | null>(request)\n\n\t\t\twhile (cursor) {\n\t\t\t\tentries.push([cursor.key as string, cursor.value])\n\n\t\t\t\tif (scan.limit !== undefined && entries.length >= scan.limit)\n\t\t\t\t\tbreak\n\n\t\t\t\tcursor.continue()\n\t\t\t\tcursor = await wait<IDBCursorWithValue | null>(request)\n\t\t\t}\n\n\t\t\treturn entries\n\t\t})\n\t}\n}\n\n", "\nexport const lexSort = (a: string, b: string) => (\n\ta < b ? -1 : a > b ? 1 : 0\n)\n\n", "\nimport {Scan} from \"../types.js\"\n\nexport function scanMatch(key: string, {start, end}: Scan) {\n\tif (start !== undefined && key < start) return false\n\tif (end !== undefined && key >= end) return false\n\treturn true\n}\n\n", "\nimport {Scan} from \"../types.js\"\nimport {lexSort} from \"./lex-sort.js\"\nimport {scanMatch} from \"./scan-match.js\"\n\nexport function* scanEntries<V>(scan: Scan, entries: [string, V][]) {\n\tif (scan.limit === 0)\n\t\treturn\n\n\tconst matches = entries\n\t\t.filter(([key, value]) => value !== undefined && scanMatch(key, scan))\n\t\t.sort(([a], [b]) => lexSort(a, b))\n\n\tif (scan.reverse)\n\t\tmatches.reverse()\n\n\tyield* matches.slice(0, scan.limit ?? Infinity)\n}\n\n", "\nimport {scanEntries} from \"../utils/scan-entries.js\"\nimport {Op, Magazine, Scan, Value} from \"../types.js\"\n\nexport class MemoryMagazine implements Magazine {\n\t#map = new Map<string, Value>()\n\n\tasync commit(ops: Op<Value>[]) {\n\t\tfor (const [key, value] of ops) {\n\t\t\tif (value === undefined)\n\t\t\t\tthis.#map.delete(key)\n\t\t\telse\n\t\t\t\tthis.#map.set(key, structuredClone(value))\n\t\t}\n\t}\n\n\tasync getMany(keys: string[]) {\n\t\treturn keys.map(key => structuredClone(this.#map.get(key)))\n\t}\n\n\tasync* entries(scan: Scan = {}) {\n\t\tyield* scanEntries(scan, [...this.#map.entries()].map(([key, value]) => [key, structuredClone(value)]))\n\t}\n}\n\n", "\nimport {Idb} from \"./types.js\"\n\nexport async function idbOpen(dbName: string, storeName = dbName): Promise<Idb> {\n\tconst db = await new Promise<IDBDatabase>((resolve, reject) => {\n\t\tconst request = indexedDB.open(dbName, 1)\n\t\trequest.onblocked = () => reject(new Error(\"idb blocked\"))\n\t\trequest.onerror = () => reject(request.error)\n\t\trequest.onupgradeneeded = () => request.result.createObjectStore(storeName)\n\t\trequest.onsuccess = () => resolve(request.result)\n\t})\n\treturn {db, storeName}\n}\n\n", "\nimport {Value} from \"../types.js\"\nimport {Operator} from \"./operator.js\"\n\nexport class CellOperator<V = Value> {\n\t#key\n\t#parent\n\n\tconstructor(key: string, parent: Operator<V>) {\n\t\tthis.#key = key\n\t\tthis.#parent = parent\n\t}\n\n\tset(value: V | undefined) {\n\t\treturn this.#parent.set(this.#key, value)\n\t}\n\n\tdelete() {\n\t\treturn this.#parent.delete(this.#key)\n\t}\n}\n\n", "\nimport {Cubby, got} from \"@e280/stz\"\nimport {Kv} from \"./kv.js\"\nimport {Value} from \"./types.js\"\nimport {CellOperator} from \"./utils/cell-operator.js\"\n\nexport class Cell<V = Value> implements Cubby<V> {\n\top\n\n\tconstructor(public kv: Kv, public key: string) {\n\t\tthis.op = new CellOperator(key, kv.op)\n\t}\n\n\tasync set(value: V | undefined) {\n\t\treturn this.kv.set(this.key, value)\n\t}\n\n\tasync get(): Promise<V | undefined> {\n\t\treturn this.kv.get(this.key)\n\t}\n\n\tasync has(): Promise<boolean> {\n\t\treturn (await this.get()) !== undefined\n\t}\n\n\tasync need(): Promise<V> {\n\t\treturn got(await this.get(), `key not found \"${this.key}\"`)\n\t}\n\n\tasync delete() {\n\t\treturn this.kv.set(this.key, undefined)\n\t}\n}\n\n", "\nimport {deepFreeze} from \"@e280/stz\"\n\nexport const consts = deepFreeze({\n\tdivisor: \".\",\n\tdelimiter: \":\",\n\tchunkSize: 1024,\n})\n\n", "\nexport function prefixEnd(prefix: string) {\n\tfor (let index = prefix.length - 1; index >= 0; index--) {\n\t\tconst code = prefix.charCodeAt(index)\n\n\t\tif (code < 0xFFFF) {\n\t\t\treturn (\n\t\t\t\tprefix.slice(0, index) +\n\t\t\t\tString.fromCharCode(code + 1)\n\t\t\t)\n\t\t}\n\t}\n\n\treturn undefined\n}\n\n", "\nimport {consts} from \"../consts.js\"\nimport {Magazine, Op, Scan} from \"../types.js\"\nimport {prefixEnd} from \"./prefix-end.js\"\n\nexport class Subtree {\n\t#magazine\n\t#scans: Scan[] = [{}]\n\n\tconstructor(magazine: Magazine, scopes: string[]) {\n\t\tthis.#magazine = magazine\n\n\t\tif (scopes.length) {\n\t\t\tconst pre = scopes.join(consts.divisor)\n\t\t\tconst divised = pre + \".\"\n\t\t\tconst delimited = pre + \":\"\n\t\t\tthis.#scans = [\n\t\t\t\t{start: delimited, end: prefixEnd(delimited)},\n\t\t\t\t{start: divised, end: prefixEnd(divised)},\n\t\t\t]\n\t\t}\n\t}\n\n\tasync count() {\n\t\tlet count = 0\n\n\t\tfor (const scan of this.#scans) {\n\t\t\tfor await (const _ of this.#magazine.entries(scan))\n\t\t\t\tcount++\n\t\t}\n\n\t\treturn count\n\t}\n\n\tasync clear() {\n\t\tlet changes: Op<string>[] = []\n\n\t\tfor (const scan of this.#scans) {\n\t\t\tfor await (const [key] of this.#magazine.entries(scan)) {\n\t\t\t\tchanges.push([key, undefined])\n\t\t\t\tif (changes.length >= 1024) {\n\t\t\t\t\tawait this.#magazine.commit(changes)\n\t\t\t\t\tchanges = []\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (changes.length)\n\t\t\tawait this.#magazine.commit(changes)\n\t}\n}\n\n", "\nimport {Op, Value} from \"../types.js\"\nimport {Prefixer} from \"./prefixer.js\"\n\nexport class Operator<V = Value> {\n\t#prefixer: Prefixer\n\n\tconstructor(prefixer: Prefixer) {\n\t\tthis.#prefixer = prefixer\n\t}\n\n\tset<X extends V = V>(key: string, value: X | undefined): Op<X> {\n\t\treturn [this.#prefixer.prefix(key), value]\n\t}\n\n\tdelete(key: string): Op<undefined> {\n\t\treturn [this.#prefixer.prefix(key), undefined]\n\t}\n}\n\n", "\nimport {consts} from \"../consts.js\"\nimport {Options, Scan} from \"../types.js\"\nimport {prefixEnd} from \"./prefix-end.js\"\n\nconst {divisor, delimiter} = consts\n\nexport class Prefixer {\n\t#prefix: string\n\t#end: string | undefined\n\n\tconstructor(options: Options) {\n\t\tconst {scopes} = options\n\t\tthis.#prefix = scopes.join(divisor) + delimiter\n\t\tthis.#end = prefixEnd(this.#prefix)\n\t}\n\n\tprefix = (key: string) => {\n\t\treturn this.#prefix + key\n\t}\n\n\tunprefix = (fullkey: string) => {\n\t\treturn fullkey.slice(this.#prefix.length)\n\t}\n\n\tscan = (scan: Scan): Scan => {\n\t\tconst {start, end, limit, reverse} = scan\n\n\t\treturn {\n\t\t\tstart: this.#prefix + (start ?? \"\"),\n\t\t\tend: end === undefined\n\t\t\t\t? this.#end\n\t\t\t\t: this.#prefix + end,\n\t\t\tlimit,\n\t\t\treverse,\n\t\t}\n\t}\n}\n\n", "\nimport {Scan} from \"../types.js\"\n\nexport function validateScan(scan: Scan) {\n\tconst limit = scan.limit\n\n\tif (limit !== undefined) {\n\t\tif (!Number.isInteger(limit))\n\t\t\tthrow new Error(\"scan limit must be integer\")\n\n\t\tif (limit < 0)\n\t\t\tthrow new Error(\"scan limit must be positive\")\n\t}\n\n\treturn scan\n}\n\n", "\nexport function validateScopes(scopes: string[]) {\n\tfor (const scope of scopes) {\n\t\tif (scope === \"\") throw new Error(`invalid scope empty string`)\n\t\tforbidden(scope, \".\")\n\t\tforbidden(scope, \":\")\n\t}\n\treturn scopes\n}\n\nfunction forbidden(scope: string, illegal: string) {\n\tif (scope.includes(illegal))\n\t\tthrow new Error(`invalid scope \"${scope}\" contains illegal \"${illegal}\"`)\n}\n\n", "\nimport {got} from \"@e280/stz\"\nimport {Cell} from \"./cell.js\"\nimport {consts} from \"./consts.js\"\nimport {Subtree} from \"./utils/subtree.js\"\nimport {Operator} from \"./utils/operator.js\"\nimport {Prefixer} from \"./utils/prefixer.js\"\nimport {MemoryMagazine} from \"./magazines/memory.js\"\nimport {validateScan} from \"./utils/validate-scan.js\"\nimport {validateScopes} from \"./utils/validate-scopes.js\"\nimport {Magazine, Op, Options, Scan, Pair, Value} from \"./types.js\"\n\nexport class Kv<V = Value> {\n\n\t/** facility for writing operations that could be committed. */\n\treadonly op\n\n\t/** methods that can access all entries under this scope, including child scopes. */\n\treadonly subtree\n\n\t#magazine\n\t#prefixer\n\t#preprocess\n\t#options: Options\n\n\tconstructor(\n\t\t\tmagazine: Magazine = new MemoryMagazine(),\n\t\t\toptions: Partial<Options> = {},\n\t\t) {\n\t\tthis.#magazine = magazine\n\t\tthis.#options = {\n\t\t\tstrict: false,\n\t\t\tscopes: [],\n\t\t\t...options,\n\t\t}\n\t\tvalidateScopes(this.#options.scopes)\n\t\tthis.#prefixer = new Prefixer(this.#options)\n\t\tthis.op = new Operator<V>(this.#prefixer)\n\t\tthis.subtree = new Subtree(this.#magazine, this.#options.scopes)\n\t\tthis.#preprocess = this.#options.strict\n\t\t\t? (value: Value) => JSON.parse(JSON.stringify(value))\n\t\t\t: (value: Value) => value\n\t}\n\n\t/** create a cell which can set or get on a single key */\n\tcell<X extends V = V>(key: string) {\n\t\treturn new Cell<X>(this, key)\n\t}\n\n\t/** create a sub kv where all keys inherit a prefix */\n\tscope<X = Value>(...scopes: string[]) {\n\t\treturn new Kv<X>(this.#magazine, {\n\t\t\t...this.#options,\n\t\t\tscopes: [...this.#options.scopes, ...scopes],\n\t\t})\n\t}\n\n\tasync commit(ops: Op<V>[]) {\n\t\tawait this.#magazine.commit(\n\t\t\tops.map(([key, value]) => [key, (\n\t\t\t\t(value === undefined)\n\t\t\t\t\t? undefined\n\t\t\t\t\t: this.#preprocess(value)\n\t\t\t)])\n\t\t)\n\t}\n\n\tasync set<X extends V = V>(key: string, value: X | undefined) {\n\t\treturn this.commit([this.op.set(key, value)])\n\t}\n\n\tasync setMany<X extends V = V>(changes: [key: string, value: X | undefined][]) {\n\t\treturn this.commit(changes.map(([key, value]) => this.op.set(key, value)))\n\t}\n\n\tasync delete(...keys: string[]) {\n\t\treturn this.commit(keys.map(key => this.op.delete(key)))\n\t}\n\n\tasync getMany<X extends V = V>(keys: string[]) {\n\t\tkeys = keys.map(key => this.#prefixer.prefix(key))\n\t\treturn (await this.#magazine.getMany(keys)).map(value =>\n\t\t\t(value === undefined)\n\t\t\t\t? undefined\n\t\t\t\t: value as X\n\t\t)\n\t}\n\n\tasync get<X extends V = V>(key: string) {\n\t\tconst [value] = await this.getMany<X>([key])\n\t\treturn value\n\t}\n\n\tasync has(key: string) {\n\t\treturn (await this.get(key)) !== undefined\n\t}\n\n\t/** throw if the value is undefined or null */\n\tasync need<X extends V = V>(key: string) {\n\t\treturn got(await this.get<X>(key), `key not found \"${key}\"`)\n\t}\n\n\t/** throw if the value is undefined or null */\n\tasync needMany<X extends V = V>(keys: string[]) {\n\t\tconst values = await this.getMany<X>(keys)\n\t\tfor (const [index, key] of keys.entries())\n\t\t\tgot(values[index], `key not found \"${key}\"`)\n\t\treturn values as X[]\n\t}\n\n\tasync* entries<X extends V = V>(scan: Scan = {}) {\n\t\tscan = validateScan(this.#prefixer.scan(scan))\n\n\t\tfor await (const [key, value] of this.#magazine.entries(scan)) {\n\t\t\tconst key2 = this.#prefixer.unprefix(key)\n\t\t\tif (value !== undefined)\n\t\t\t\tyield [key2, value] as Pair<X>\n\t\t}\n\t}\n\n\t[Symbol.asyncIterator]() {\n\t\treturn this.entries()\n\t}\n\n\tasync* keys(scan: Scan = {}) {\n\t\tfor await (const [key] of this.entries(scan))\n\t\t\tyield key\n\t}\n\n\tasync* values<X extends V = V>(scan: Scan = {}) {\n\t\tfor await (const [, value] of this.entries(scan))\n\t\t\tyield value as X\n\t}\n\n\tasync count(scan: Scan = {}) {\n\t\tlet count = 0\n\t\tfor await (const _ of this.keys(scan)) count++\n\t\treturn count\n\t}\n\n\tasync clear(scan: Scan = {}) {\n\t\tlet changes: Op<V>[] = []\n\n\t\tfor await (const [key] of this.entries(scan)) {\n\t\t\tchanges.push(this.op.delete(key))\n\t\t\tif (changes.length >= consts.chunkSize) {\n\t\t\t\tawait this.commit(changes)\n\t\t\t\tchanges = []\n\t\t\t}\n\t\t}\n\n\t\tif (changes.length)\n\t\t\tawait this.commit(changes)\n\t}\n}\n\n", "\nimport {IdbMagazine, idbOpen, Kv} from \"@e280/kv\"\n\nexport async function setupKv(\n\t\tnamespace: string,\n\t\tkv: Kv | undefined,\n\t) {\n\n\tlet dispose = () => {}\n\n\tif (!kv) {\n\t\tconst idb = await idbOpen(namespace, \"kv\")\n\t\tconst magazine = new IdbMagazine(idb)\n\t\tkv = new Kv(magazine)\n\t\tdispose = () => idb.db.close()\n\t}\n\n\treturn {kv, dispose}\n}\n\n", "\nimport {given, got} from \"@e280/stz\"\nimport {ControlsData} from \"./data.js\"\nimport {ProfileKey} from \"../../types.js\"\nimport {Bindings} from \"../../../../input/types.js\"\nimport {Controller} from \"../../../../input/controller.js\"\n\nexport function getProfile<B extends Bindings>(\n\t\tdata: ControlsData<B>,\n\t\tprofileKey?: ProfileKey,\n\t) {\n\n\tconst {presets, customs, fallback} = data.profiles\n\n\tif (profileKey === undefined)\n\t\treturn fallback.profile\n\n\treturn customs.get(profileKey)\n\t\t?? presets.get(profileKey)\n\t\t?? got(presets.get(fallback.key))\n}\n\nexport async function assignProfile<B extends Bindings>(\n\t\tdata: ControlsData<B>,\n\t\tcontroller: Controller,\n\t\tprofileKey: ProfileKey,\n\t) {\n\n\tconst {kvs, controllers, assignments} = data\n\tcontroller.bindings = getProfile(data, profileKey).bindings\n\tassignments.set(controller, profileKey)\n\n\tawait given(controllers.get(controller)?.handle, async handle => {\n\t\tdata.preferences.set(handle, profileKey)\n\t\tawait kvs.preferences.set(handle, profileKey)\n\t})\n}\n\n", "\nimport {Bindings} from \"../types.js\"\nimport {hashBindings} from \"./hash-bindings.js\"\n\nexport function isCompatible(bindingsA: Bindings, bindingsB: Bindings) {\n\treturn hashBindings(bindingsA) === hashBindings(bindingsB)\n}\n\n", "\nimport {ControlsData} from \"./data.js\"\nimport {Profile, ProfileKey} from \"../../types.js\"\nimport {assignProfile, getProfile} from \"./fns.js\"\nimport {Bindings} from \"../../../../input/types.js\"\nimport {isCompatible} from \"../../../../input/investigate/is-compatible.js\"\n\nexport class Profiles<B extends Bindings> {\n\t#data\n\n\tconstructor(data: ControlsData<B>) {\n\t\tthis.#data = data\n\t}\n\n\t#ensureBindingsAreCompatible(b: B) {\n\t\tif (!isCompatible(b, this.#data.bindings))\n\t\t\tthrow new Error(\"incompatible bindings\")\n\t}\n\n\tget presets() {\n\t\treturn [...this.#data.profiles.presets]\n\t}\n\n\tget customs() {\n\t\treturn [...this.#data.profiles.customs]\n\t}\n\n\tisPreset(profileKey: string) {\n\t\treturn this.#data.profiles.presets.has(profileKey)\n\t}\n\n\tget(profileKey?: ProfileKey) {\n\t\treturn getProfile(this.#data, profileKey)\n\t}\n\n\tasync create(key: ProfileKey, profile: Profile<B>) {\n\t\tconst {kvs, profiles} = this.#data\n\t\tthis.#ensureBindingsAreCompatible(profile.bindings)\n\t\tprofiles.customs.set(key, profile)\n\t\tawait kvs.profiles.set(key, profile)\n\t\tthis.#data.subby.publish()\n\t}\n\n\tasync clone(key: ProfileKey, basedOn: ProfileKey) {\n\t\tconst {label, bindings} = this.get(basedOn)\n\t\tawait this.create(key, {basedOn, bindings, label: `${label} copy`})\n\t}\n\n\tasync delete(profileKey: ProfileKey) {\n\t\tconst {kvs, assignments, profiles: {customs, fallback}} = this.#data\n\t\tcustoms.delete(profileKey)\n\t\tawait kvs.profiles.delete(profileKey)\n\t\tfor (const [controller, controllerKey] of assignments)\n\t\t\tif (controllerKey === profileKey)\n\t\t\t\tawait assignProfile(this.#data, controller, fallback.key)\n\t\tthis.#data.subby.publish()\n\t}\n\n\tasync update(profileKey: ProfileKey, changes: Partial<{\n\t\t\tbindings: B\n\t\t\tlabel: string\n\t\t}>) {\n\n\t\tconst {kvs, assignments, profiles: {customs}} = this.#data\n\n\t\tif (changes.bindings)\n\t\t\tthis.#ensureBindingsAreCompatible(changes.bindings)\n\n\t\tconst staleProfile = this.get(profileKey)\n\t\tconst freshProfile = {...structuredClone(staleProfile), ...changes}\n\n\t\tcustoms.set(profileKey, freshProfile)\n\n\t\tfor (const [controller, controllerKey] of assignments) {\n\t\t\tif (controllerKey === profileKey)\n\t\t\t\tcontroller.bindings = freshProfile.bindings\n\t\t}\n\n\t\tawait kvs.profiles.set(profileKey, freshProfile)\n\t\tthis.#data.subby.publish()\n\t}\n}\n\n", "\nimport {RMap} from \"@e280/strata\"\nimport {got, IdCounter, setEntries, subby} from \"@e280/stz\"\n\nimport {Profile, ProfileKey} from \"../../types.js\"\nimport {Bindings} from \"../../../../input/types.js\"\nimport {Controller} from \"../../../../input/controller.js\"\nimport {hashBindings} from \"../../../../input/investigate/hash-bindings.js\"\nimport {ControllerHandle, ControllerMeta, ControlsOptions} from \"../types.js\"\n\nexport type ControlsData<B extends Bindings> = (\n\tReturnType<typeof makeControlsData<B>>\n)\n\nexport function makeControlsData<B extends Bindings>(options: ControlsOptions<B>) {\n\tconst {presets} = options\n\tconst fallbackKey = got(Object.keys(presets)[0], \"missing presets\")\n\tconst fallbackProfile = got(presets[fallbackKey])\n\tconst bindings = fallbackProfile.bindings\n\n\tconst kv = options.kv.scope(\n\t\thashBindings(bindings).toString()\n\t)\n\n\tconst profiles = {\n\t\tpresets: new RMap<ProfileKey, Profile<B>>(),\n\t\tcustoms: new RMap<ProfileKey, Profile<B>>(),\n\t\tfallback: {key: fallbackKey, profile: fallbackProfile},\n\t}\n\n\tsetEntries(profiles.presets, Object.entries(presets))\n\n\treturn {\n\t\tsubby: subby(),\n\n\t\tkv,\n\t\tpresets,\n\t\tbindings,\n\t\tidCounter: new IdCounter(),\n\n\t\tprofiles,\n\n\t\tcontrollers: new RMap<Controller, ControllerMeta>(),\n\t\tassignments: new RMap<Controller, ProfileKey>(),\n\t\tpreferences: new RMap<ControllerHandle, ProfileKey>(),\n\n\t\tkvs: {\n\t\t\tprofiles: kv.scope<Profile>(\"profiles\"),\n\t\t\tpreferences: kv.scope<ProfileKey>(\"preferences\"),\n\t\t},\n\t}\n}\n\n", "\nimport {assignProfile} from \"./fns.js\"\nimport {ControlsData} from \"./data.js\"\nimport {ProfileKey} from \"../../types.js\"\nimport {Controller} from \"../../../../input/controller.js\"\n\nexport class Assignments {\n\t#data\n\n\tconstructor(data: ControlsData<any>) {\n\t\tthis.#data = data\n\t}\n\n\tasync assign(controller: Controller, profileKey: ProfileKey) {\n\t\tawait assignProfile(this.#data, controller, profileKey)\n\t\tthis.#data.subby.publish()\n\t}\n\n\tassignedProfileKeyOf(controller: Controller) {\n\t\tconst {assignments} = this.#data\n\t\treturn assignments.get(controller) ?? this.#data.profiles.fallback.key\n\t}\n}\n\n", "\nimport {collect, got, setEntries} from \"@e280/stz\"\n\nimport {Profiles} from \"./internal/profiles.js\"\nimport {Bindings} from \"../../../input/types.js\"\nimport {makeControlsData} from \"./internal/data.js\"\nimport {Assignments} from \"./internal/assignments.js\"\nimport {Controller} from \"../../../input/controller.js\"\nimport {ControllerMeta, ControlsOptions} from \"./types.js\"\n\nexport class Controls<B extends Bindings = any> {\n\t#data\n\tprofiles\n\tassignments\n\treadonly presets\n\n\tconstructor(options: ControlsOptions<B>) {\n\t\tthis.#data = makeControlsData(options)\n\t\tthis.profiles = new Profiles(this.#data)\n\t\tthis.assignments = new Assignments(this.#data)\n\t\tthis.presets = options.presets\n\t}\n\n\tget on() {\n\t\treturn this.#data.subby.on\n\t}\n\n\t#rebind(controller: Controller) {\n\t\tconst {preferences, assignments, controllers} = this.#data\n\t\tconst meta = got(controllers.get(controller))\n\n\t\tconst profileKey = assignments.get(controller)\n\t\t\t?? preferences.get(meta.handle)\n\t\t\t?? meta.defaultProfileKey\n\n\t\tcontroller.bindings = this.profiles.get(profileKey).bindings\n\t\tassignments.set(controller, profileKey)\n\t}\n\n\tasync load() {\n\t\tconst {kvs, controllers, preferences, profiles: {customs}} = this.#data\n\n\t\tcustoms.clear()\n\t\tsetEntries(customs, await collect(kvs.profiles))\n\n\t\tpreferences.clear()\n\t\tsetEntries(preferences, await collect(kvs.preferences))\n\n\t\tfor (const controller of controllers.keys())\n\t\t\tthis.#rebind(controller)\n\t}\n\n\tget controllers() {\n\t\treturn [...this.#data.controllers.keys()]\n\t}\n\n\tget fallbackProfileKey() {\n\t\treturn this.#data.profiles.fallback.key\n\t}\n\n\tmeta(controller: Controller) {\n\t\treturn this.#data.controllers.get(controller)\n\t}\n\n\tattach(controller: Controller, meta: Omit<ControllerMeta, \"id\">) {\n\t\tconst id = this.#data.idCounter.next()\n\t\tthis.#data.controllers.set(controller, {...meta, id})\n\t\tthis.#rebind(controller)\n\t}\n\n\tdetach(controller: Controller) {\n\t\tthis.#data.controllers.delete(controller)\n\t\tthis.#data.assignments.delete(controller)\n\t}\n}\n\n", "\nimport {Presets} from \"../types.js\"\nimport {Bindings} from \"../../../input/types.js\"\n\nexport function firstPreset<B extends Bindings>(presets: Presets<B>) {\n\tconst [key, profile] = Object.entries(presets)[0]\n\treturn {key, profile}\n}\n\n", "\nexport async function setupBroadcastChannel(\n\t\tnamespace: string,\n\t\tbroadcastChannel: BroadcastChannel | undefined,\n\t) {\n\n\tlet dispose = () => {}\n\n\tif (!broadcastChannel) {\n\t\tconst bc = new BroadcastChannel(namespace)\n\t\tbroadcastChannel = bc\n\t\tdispose = () => bc.close()\n\t}\n\n\treturn {broadcastChannel, dispose}\n}\n\n", "\nimport {disposer, ev} from \"@e280/stz\"\nimport {Hub} from \"../hub.js\"\nimport {asDeck} from \"../types.js\"\nimport {setupKv} from \"./utils/kv.js\"\nimport {SetupParams} from \"./types.js\"\nimport {Controls} from \"../controls/controls.js\"\nimport {Bindings} from \"../../../input/types.js\"\nimport {firstPreset} from \"../utils/first-preset.js\"\nimport {setupBroadcastChannel} from \"./utils/broadcast-channel.js\"\n\nexport async function setupDeck<B extends Bindings>(params: SetupParams<B>) {\n\tconst {dispose, schedule, disposable} = disposer()\n\n\tconst namespace = params.namespace\n\t\t? `tact_${params.namespace}`\n\t\t: \"tact\"\n\n\tconst {kv} = disposable(\n\t\tawait setupKv(namespace, params.kv)\n\t)\n\n\tconst {broadcastChannel} = disposable(\n\t\tawait setupBroadcastChannel(namespace, params.broadcastChannel)\n\t)\n\n\ttry {\n\t\tconst {maxPlayers} = params\n\t\tconst {bindings} = firstPreset(params.presets).profile\n\t\tconst hub = new Hub(bindings)\n\t\tconst controls = new Controls({...params, kv})\n\n\t\tschedule(ev(broadcastChannel, {message: () => controls.load()}))\n\t\tschedule(controls.on(() => broadcastChannel.postMessage({})))\n\n\t\tawait controls.load()\n\t\treturn asDeck({hub, controls, maxPlayers, dispose})\n\t}\n\tcatch (error) {\n\t\tdispose()\n\t\tthrow error\n\t}\n}\n\n", "\nimport {arraylimit} from \"@e280/stz\"\nimport {Sample, Source} from \"../types.js\"\n\nconst limit = 1024\n\nexport class Sampler {\n\treadonly dispose\n\t#source\n\t#samples: Sample[] = []\n\n\tconstructor(source: Source) {\n\t\tthis.#source = source\n\t\tthis.dispose = source.onSample(sample => {\n\t\t\tthis.#samples.push(sample)\n\t\t\tif (this.#samples.length > limit) console.warn(`tact sampler exceeded limit ${limit}`)\n\t\t\tthis.#samples = arraylimit(this.#samples, limit)\n\t\t})\n\t}\n\n\ttake() {\n\t\tthis.#source.poll?.()\n\t\tconst samples = this.#samples\n\t\tthis.#samples = []\n\t\treturn samples\n\t}\n}\n\n", "\nexport const {min, max, abs, sign, floor, ceil, pow} = Math\n\nexport function sum(...numbers: number[]) {\n\tlet x = 0\n\tfor (const n of numbers)\n\t\tx += n\n\treturn x\n}\n\nexport function average(...numbers: number[]) {\n\tif (numbers.length === 0) throw new Error(\"no numbers for average fn\")\n\treturn sum(...numbers) / numbers.length\n}\n\n/** inclusive */\nexport function between(x: number, a = 0, b = 1) {\n\tconst small = Math.min(a, b)\n\tconst big = Math.max(a, b)\n\treturn (x >= small) && (x <= big)\n}\n\nexport function clamp(x: number, a: number = 0, b: number = 1) {\n\tx = min(x, b)\n\tx = max(x, a)\n\treturn x\n}\n\nexport function invert(x: number) {\n\treturn 1 - x\n}\n\nexport function atLeast(x: number, least = 0) {\n\treturn Math.max(x, least)\n}\n\nexport function atMost(x: number, most = 1) {\n\treturn Math.min(x, most)\n}\n\nexport function distance(x: number, y: number) {\n\treturn Math.abs(x - y)\n}\n\nexport function wrap(x: number, a: number = 0, b: number = 1) {\n\tconst small = min(a, b)\n\tconst big = max(a, b)\n\tconst span = big - small\n\tconst adjusted = x - small\n\tconst wrapped = (adjusted < 0)\n\t\t? span - (-adjusted % span)\n\t\t: adjusted % span\n\treturn small + wrapped\n}\n\nexport function lerp(fraction: number, from: number, to: number, maxDelta?: number) {\n\tconst difference = to - from\n\tlet delta = difference * fraction\n\tif (maxDelta !== undefined && abs(delta) > maxDelta)\n\t\tdelta = sign(delta) * maxDelta\n\treturn from + delta\n}\n\nexport function unlerp(x: number, a: number, b: number) {\n\treturn (x - a) / (b - a)\n}\n\nexport function remap(x: number, a1: number, a2: number, b1: number = 0, b2: number = 1, clamping = false) {\n\tlet fraction = unlerp(x, a1, a2)\n\tif (clamping) fraction = clamp(fraction)\n\treturn lerp(fraction, b1, b2)\n}\n\n/** calculate a time-based lerp factor */\nexport function halflife(halfTime: number, deltaTime: number) {\n\treturn 1 - pow(0.5, deltaTime / halfTime)\n}\n\nexport function approach(maxDelta: number, from: number, to: number) {\n\tconst delta = clamp(to - from, -maxDelta, maxDelta)\n\treturn from + delta\n}\n\nexport function stronger(noul: number, power = 2) {\n\tnoul = invert(noul)\n\tnoul = noul ** power\n\treturn invert(noul)\n}\n\nexport function weaker(noul: number, power = 2) {\n\treturn noul ** power\n}\n\nexport function smoothstep(x: number) {\n\treturn x * x * (3 - (2 * x))\n}\n\nexport function smootherstep(x: number) {\n\treturn x * x * x * (x * (x * 6 - 15) + 10)\n}\n\n", "\nimport {clamp} from \"./basics.js\"\nimport {XyArray} from \"./tuples.js\"\n\nexport type Xy = {x: number, y: number}\n\nexport const index2d = (extent: Xy, vec: Xy) => {\n\treturn (vec.y * extent.x) + vec.x\n}\n\nexport const unindex2d = (extent: Xy, index: number) => {\n\tconst x = index % extent.x\n\tconst y = Math.floor(index / extent.x)\n\treturn new Vec2(x, y)\n}\n\ntype Vec2ish<T extends Vec2> = new(x?: number, y?: number) => T\n\nexport class Vec2 implements Xy {\n\tconstructor(\n\t\tpublic x = 0,\n\t\tpublic y = 0,\n\t) {}\n\n\tstatic new<T extends Vec2>(this: Vec2ish<T>, x = 0, y = 0) {\n\t\treturn new this(x, y)\n\t}\n\n\tstatic zero<T extends Vec2>(this: Vec2ish<T>) {\n\t\treturn new this()\n\t}\n\n\tstatic fill<T extends Vec2>(this: Vec2ish<T>, value: number) {\n\t\treturn new this(value, value)\n\t}\n\n\tstatic from<T extends Vec2>(this: Vec2ish<T>, v: XyArray | Xy): T {\n\t\treturn (\n\t\t\tArray.isArray(v)\n\t\t\t\t? new this(...v)\n\t\t\t\t: new this(v.x, v.y)\n\t\t)\n\t}\n\n\tstatic magnitudeSquared(x: number, y: number) {\n\t\treturn (x * x) + (y * y)\n\t}\n\n\tstatic magnitude(x: number, y: number) {\n\t\treturn Math.sqrt(this.magnitudeSquared(x, y))\n\t}\n\n\tstatic average<T extends Vec2>(this: Vec2ish<T>, ...vectors: Xy[]): T {\n\t\treturn new this()\n\t\t\t.add(...vectors)\n\t\t\t.divBy(vectors.length)\n\t}\n\n\tstatic min<T extends Vec2>(this: Vec2ish<T>, ...vecs: Xy[]) {\n\t\treturn new this(\n\t\t\tMath.min(...vecs.map(v => v.x)),\n\t\t\tMath.min(...vecs.map(v => v.y)),\n\t\t)\n\t}\n\n\tstatic max<T extends Vec2>(this: Vec2ish<T>, ...vecs: Xy[]) {\n\t\treturn new this(\n\t\t\tMath.max(...vecs.map(v => v.x)),\n\t\t\tMath.max(...vecs.map(v => v.y)),\n\t\t)\n\t}\n\n\tstatic rotation<T extends Vec2>(this: Vec2ish<T>, radians: number) {\n\t\treturn new this(\n\t\t\tMath.cos(radians),\n\t\t\tMath.sin(radians),\n\t\t)\n\t}\n\n\tdup() {\n\t\treturn new (this.constructor as any)(this.x, this.y) as typeof this\n\t}\n\n\t*[Symbol.iterator]() {\n\t\tyield this.x\n\t\tyield this.y\n\t}\n\n\tarray(): XyArray {\n\t\treturn [this.x, this.y]\n\t}\n\n\ttoJSON(): XyArray {\n\t\treturn this.array()\n\t}\n\n\ttoString() {\n\t\treturn `(${this.constructor.name} x${this.x.toFixed(2)}, y${this.y.toFixed(2)})`\n\t}\n\n\t/** mutator */\n\tfill(n: number) {\n\t\tthis.x = n\n\t\tthis.y = n\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tzero() {\n\t\treturn this.fill(0)\n\t}\n\n\t/** mutator */\n\tset_(x: number, y: number) {\n\t\tthis.x = x\n\t\tthis.y = y\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tset({x, y}: Xy) {\n\t\tthis.x = x\n\t\tthis.y = y\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tfrom(v: Xy | XyArray) {\n\t\tif (Array.isArray(v)) {\n\t\t\tconst [x, y] = v\n\t\t\tthis.x = x\n\t\t\tthis.y = y\n\t\t}\n\t\telse {\n\t\t\tconst {x, y} = v\n\t\t\tthis.x = x\n\t\t\tthis.y = y\n\t\t}\n\t\treturn this\n\t}\n\n\tmagnitudeSquared() {\n\t\treturn Vec2.magnitudeSquared(this.x, this.y)\n\t}\n\n\tmagnitude() {\n\t\treturn Vec2.magnitude(this.x, this.y)\n\t}\n\n\trotation() {\n\t\treturn Math.atan2(this.y, this.x)\n\t}\n\n\tequals_(x: number, y: number) {\n\t\treturn (\n\t\t\tthis.x === x &&\n\t\t\tthis.y === y\n\t\t)\n\t}\n\n\tequals(...vecs: Xy[]) {\n\t\treturn vecs.every(({x, y}) => this.equals_(x, y))\n\t}\n\n\tnear_(x: number, y: number, epsilon = 1e-6) {\n\t\treturn (\n\t\t\tMath.abs(this.x - x) <= epsilon &&\n\t\t\tMath.abs(this.y - y) <= epsilon\n\t\t)\n\t}\n\n\tnear({x, y}: Xy, epsilon = 1e-6) {\n\t\treturn this.near_(x, y, epsilon)\n\t}\n\n\tdot_(x: number, y: number) {\n\t\treturn (this.x * x) + (this.y * y)\n\t}\n\n\tdot({x, y}: Xy) {\n\t\treturn this.dot_(x, y)\n\t}\n\n\tdistanceSquared_(x: number, y: number) {\n\t\tx = this.x - x\n\t\ty = this.y - y\n\t\treturn (x * x) + (y * y)\n\t}\n\n\tdistanceSquared({x, y}: Xy) {\n\t\treturn this.distanceSquared_(x, y)\n\t}\n\n\tdistance_(x: number, y: number) {\n\t\treturn Math.sqrt(this.distanceSquared_(x, y))\n\t}\n\n\tdistance({x, y}: Xy) {\n\t\treturn this.distance_(x, y)\n\t}\n\n\tangleBetween_(x: number, y: number) {\n\t\tconst dot = this.dot_(x, y)\n\t\tconst magnitudes = this.magnitude() * Vec2.magnitude(x, y)\n\t\tif (magnitudes === 0) return 0\n\t\tconst ratio = clamp(dot / magnitudes, -1, 1)\n\t\treturn Math.acos(ratio)\n\t}\n\n\tangleBetween({x, y}: Xy) {\n\t\treturn this.angleBetween_(x, y)\n\t}\n\n\t/** mutator */\n\tnormalize() {\n\t\treturn this.divBy(this.magnitude())\n\t}\n\n\t/** mutator */\n\thalf() {\n\t\treturn this.divBy(2)\n\t}\n\n\t/** mutator */\n\tdouble() {\n\t\treturn this.mulBy(2)\n\t}\n\n\t/** mutator */\n\tabs() {\n\t\treturn this.map(x => Math.abs(x))\n\t}\n\n\t/** mutator */\n\trotate(radians: number) {\n\t\tconst {x, y} = this\n\t\tthis.x = (x * Math.cos(radians)) - (y * Math.sin(radians))\n\t\tthis.y = (x * Math.sin(radians)) + (y * Math.cos(radians))\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tperpendicular() {\n\t\tconst {x, y} = this\n\t\tthis.x = -y\n\t\tthis.y = x\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tclampMagnitude(max: number) {\n\t\tconst mag = this.magnitude()\n\t\tif (mag > max)\n\t\t\tthis.normalize().mulBy(max)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tfloor() {\n\t\tthis.x = Math.floor(this.x)\n\t\tthis.y = Math.floor(this.y)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tceil() {\n\t\tthis.x = Math.ceil(this.x)\n\t\tthis.y = Math.ceil(this.y)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tround() {\n\t\tthis.x = Math.round(this.x)\n\t\tthis.y = Math.round(this.y)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tmap(fn: (a: number, index: number) => number) {\n\t\tthis.x = fn(this.x, 0)\n\t\tthis.y = fn(this.y, 1)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tmorph(fn: (vec: Vec2) => (Xy | void)) {\n\t\tconst result = fn(this)\n\t\tif (result && result !== this) this.set(result)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tclamp(min: Xy = {x: 0, y: 0}, max: Xy = {x: 1, y: 1}) {\n\t\tthis.x = clamp(this.x, min.x, max.x)\n\t\tthis.y = clamp(this.y, min.y, max.y)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tclampBy(min = 0, max = 1) {\n\t\tthis.x = clamp(this.x, min, max)\n\t\tthis.y = clamp(this.y, min, max)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tnegate() {\n\t\treturn this.map(a => a * -1)\n\t}\n\n\t/** mutator */\n\taddBy(delta: number) {\n\t\tthis.x += delta\n\t\tthis.y += delta\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tsubBy(delta: number) {\n\t\tthis.x -= delta\n\t\tthis.y -= delta\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tmulBy(coefficient: number) {\n\t\tthis.x *= coefficient\n\t\tthis.y *= coefficient\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tscale(coefficient: number) {\n\t\tthis.x *= coefficient\n\t\tthis.y *= coefficient\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tdivBy(divisor: number) {\n\t\tif (divisor === 0) return this\n\t\tthis.x /= divisor\n\t\tthis.y /= divisor\n\t\treturn this\n\t}\n\n\t///////////////////////////////////////////////////////////////////////\n\n\t/** mutator */\n\tadd_(x: number, y: number) {\n\t\tthis.x += x\n\t\tthis.y += y\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tadd(...vecs: Xy[]) {\n\t\tfor (const {x, y} of vecs) this.add_(x, y)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tsub_(x: number, y: number) {\n\t\tthis.x -= x\n\t\tthis.y -= y\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tsub(...vecs: Xy[]) {\n\t\tfor (const {x, y} of vecs) this.sub_(x, y)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tmul_(x: number, y: number) {\n\t\tthis.x *= x\n\t\tthis.y *= y\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tmul(...vecs: Xy[]) {\n\t\tfor (const {x, y} of vecs) this.mul_(x, y)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tdiv_(x: number, y: number) {\n\t\tif (x !== 0) this.x /= x\n\t\tif (y !== 0) this.y /= y\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tdiv(...vecs: Xy[]) {\n\t\tfor (const {x, y} of vecs) this.div_(x, y)\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tlerp_(x: number, y: number, fraction: number) {\n\t\tthis.x += (x - this.x) * fraction\n\t\tthis.y += (y - this.y) * fraction\n\t\treturn this\n\t}\n\n\t/** mutator */\n\tlerp(fraction: number, {x, y}: Xy) {\n\t\treturn this.lerp_(fraction, x, y)\n\t}\n\n\t/** mutator */\n\treflect_(x: number, y: number) {\n\t\tconst dot = 2 * this.dot_(x, y)\n\t\tthis.x -= dot * x\n\t\tthis.y -= dot * y\n\t\treturn this\n\t}\n\n\t/** mutator */\n\treflect({x, y}: Xy) {\n\t\treturn this.reflect_(x, y)\n\t}\n\n\t/** mutator */\n\trotateAroundPoint_(radians: number, x: number, y: number) {\n\t\tconst dx = this.x - x\n\t\tconst dy = this.y - y\n\t\tconst cos = Math.cos(radians)\n\t\tconst sin = Math.sin(radians)\n\t\tthis.x = cos * dx - sin * dy + x\n\t\tthis.y = sin * dx + cos * dy + y\n\t\treturn this\n\t}\n\n\t/** mutator */\n\trotateAroundPoint(radians: number, {x, y}: Xy) {\n\t\treturn this.rotateAroundPoint_(radians, x, y)\n\t}\n}\n\n", "\nexport function isDown(value: number) {\n\treturn value !== 0\n}\n\n", "\nimport {remap} from \"@benev/math\"\nimport {guarantee, isHappy, isNumber, isString} from \"@e280/stz\"\n\nimport {isDown} from \"../utils/is-down.js\"\nimport {EvaluationContext} from \"./context.js\"\nimport type {Expression} from \"../expression.js\"\n\nexport function evaluate(\n\t\tcontext: EvaluationContext,\n\t\texpression: Expression,\n\t): number {\n\n\tconst e = (expression: Expression) => evaluate(context, expression)\n\n\tif (expression === null)\n\t\treturn 0\n\n\tif (isNumber(expression))\n\t\treturn expression\n\n\telse if (isString(expression)) {\n\t\tconst latest = context.latestValues.get(expression) ?? 0\n\t\treturn context.recentSamples\n\t\t\t.filter(s => s.code === expression)\n\t\t\t.reduce(\n\t\t\t\t(peak, s) => Math.abs(s.value) > Math.abs(peak)\n\t\t\t\t\t? s.value\n\t\t\t\t\t: peak,\n\t\t\t\tlatest,\n\t\t\t)\n\t}\n\n\telse switch (expression[0]) {\n\t\tcase \"accumulate\": {\n\t\t\tconst code = expression[1]\n\t\t\tlet x = 0\n\t\t\tfor (const sample of context.recentSamples) {\n\t\t\t\tif (sample.code === code)\n\t\t\t\t\tx += sample.value\n\t\t\t}\n\t\t\treturn x\n\t\t}\n\n\t\tcase \"up\": {\n\t\t\tconst code = expression[1]\n\t\t\tlet ups = 0\n\t\t\tlet was = context.previousValues.get(code) ?? 0\n\t\t\tfor (const sample of context.recentSamples) {\n\t\t\t\tif (sample.code !== code) continue\n\t\t\t\tif (isDown(was) && !isDown(sample.value))\n\t\t\t\t\tups++\n\t\t\t\twas = sample.value\n\t\t\t}\n\t\t\treturn ups\n\t\t}\n\n\t\tcase \"down\": {\n\t\t\tconst code = expression[1]\n\t\t\tlet downs = 0\n\t\t\tlet was = context.previousValues.get(code) ?? 0\n\t\t\tfor (const sample of context.recentSamples) {\n\t\t\t\tif (sample.code !== code) continue\n\t\t\t\tif (!isDown(was) && isDown(sample.value))\n\t\t\t\t\tdowns++\n\t\t\t\twas = sample.value\n\t\t\t}\n\t\t\treturn downs\n\t\t}\n\n\t\tcase \"was\": {\n\t\t\tconst code = expression[1]\n\t\t\treturn context.previousValues.get(code) ?? 0\n\t\t}\n\n\t\tcase \"since\": {\n\t\t\tconst code = expression[1]\n\t\t\tconst was = context.previousValues.get(code) ?? 0\n\t\t\tconst latest = context.latestValues.get(code) ?? 0\n\t\t\treturn latest - was\n\t\t}\n\n\t\tcase \"if\": {\n\t\t\tconst [, condition, yes, no] = expression\n\t\t\treturn e(condition)\n\t\t\t\t? e(yes)\n\t\t\t\t: (isHappy(no) ? e(no) : 0)\n\t\t}\n\n\t\tcase \"min\":\n\t\t\treturn Math.min(...expression.slice(1).map(e))\n\n\t\tcase \"max\":\n\t\t\treturn Math.max(...expression.slice(1).map(e))\n\n\t\tcase \"+\":\n\t\t\treturn expression.slice(1)\n\t\t\t\t.map(e)\n\t\t\t\t.reduce((p, c) => p + c, 0)\n\n\t\tcase \"*\":\n\t\t\treturn expression.slice(1)\n\t\t\t\t.map(e)\n\t\t\t\t.reduce((p, c) => p * c, 1)\n\n\t\tcase \"==\":\n\t\t\treturn +(e(expression[1]) === e(expression[2]))\n\n\t\tcase \"!=\":\n\t\t\treturn +(e(expression[1]) !== e(expression[2]))\n\n\t\tcase \">\":\n\t\t\treturn +(e(expression[1]) > e(expression[2]))\n\n\t\tcase \"<\":\n\t\t\treturn +(e(expression[1]) < e(expression[2]))\n\n\t\tcase \">=\":\n\t\t\treturn +(e(expression[1]) >= e(expression[2]))\n\n\t\tcase \"<=\":\n\t\t\treturn +(e(expression[1]) <= e(expression[2]))\n\n\t\tcase \"!\":\n\t\t\treturn +(e(expression[1]) === 0)\n\n\t\tcase \"!!\":\n\t\t\treturn +(e(expression[1]) !== 0)\n\n\t\tcase \"-\": {\n\t\t\tconst [, first, ...rest] = expression\n\t\t\tif (rest.length === 0) return -e(first)\n\t\t\tlet value = e(first)\n\t\t\tfor (const neg of rest) value -= e(neg)\n\t\t\treturn value\n\t\t}\n\n\t\tcase \"clamp\": {\n\t\t\tconst [, min, max, expr] = expression\n\t\t\tconst value = e(expr)\n\t\t\treturn Math.min(\n\t\t\t\tmax === null ? Infinity : e(max),\n\t\t\t\tMath.max(\n\t\t\t\t\tmin === null ? -Infinity : e(min),\n\t\t\t\t\tvalue,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\n\t\tcase \"remap\": {\n\t\t\tconst [a, b, c, d, value] = expression.slice(1).map(e)\n\t\t\treturn remap(value, a, b, c, d)\n\t\t}\n\n\t\tcase \"dt\":\n\t\t\treturn context.dt\n\n\t\tcase \"held\": {\n\t\t\tconst [, ms, subexpression] = expression\n\t\t\tconst down = isDown(e(subexpression))\n\t\t\tlet held = context.holding.get(expression)\n\n\t\t\tif (down && !held) {\n\t\t\t\theld = {start: context.clock.time}\n\t\t\t\tcontext.holding.set(expression, held)\n\t\t\t}\n\n\t\t\tif (!down && held) {\n\t\t\t\theld = undefined\n\t\t\t\tcontext.holding.delete(expression)\n\t\t\t}\n\n\t\t\tif (held) {\n\t\t\t\tconst timeHeld = context.clock.time - held.start\n\t\t\t\tif (timeHeld >= ms)\n\t\t\t\t\treturn 1\n\t\t\t}\n\n\t\t\treturn 0\n\t\t}\n\n\t\tcase \"taps\": {\n\t\t\tconst [, taps, ms, subexpression] = expression\n\t\t\tconst down = isDown(e(subexpression))\n\t\t\tconst now = context.clock.time\n\n\t\t\tconst state = guarantee(context.tapping, expression, () => ({\n\t\t\t\twasDown: false,\n\t\t\t\tstartedAt: null as number | null,\n\t\t\t\tcount: 0,\n\t\t\t}))\n\n\t\t\tconst pressed = down && !state.wasDown\n\t\t\tconst released = !down && state.wasDown\n\n\t\t\tif (state.startedAt !== null && now - state.startedAt >= ms) {\n\t\t\t\tstate.startedAt = null\n\t\t\t\tstate.count = 0\n\t\t\t}\n\n\t\t\tlet result = 0\n\n\t\t\tif (pressed && state.startedAt === null)\n\t\t\t\tstate.startedAt = now\n\n\t\t\tif (released && state.startedAt !== null) {\n\t\t\t\tstate.count++\n\n\t\t\t\tif (state.count === taps) {\n\t\t\t\t\tresult = 1\n\t\t\t\t\tstate.count = 0\n\t\t\t\t\tstate.startedAt = null\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstate.wasDown = down\n\t\t\treturn result\n\t\t}\n\n\t\tcase \"mod\": {\n\t\t\tconst [, ...modifiers] = expression\n\t\t\tconst down = (code: string) =>\n\t\t\t\tisDown(context.latestValues.get(code) ?? 0)\n\n\t\t\tconst shift = down(\"ShiftLeft\") || down(\"ShiftRight\")\n\t\t\tconst ctrl = down(\"ControlLeft\") || down(\"ControlRight\")\n\t\t\tconst alt = down(\"AltLeft\") || down(\"AltRight\")\n\t\t\tconst meta = down(\"MetaLeft\") || down(\"MetaRight\")\n\n\t\t\tif (modifiers.includes(\"shift\") !== shift) return 0\n\t\t\tif (modifiers.includes(\"ctrl\") !== ctrl) return 0\n\t\t\tif (modifiers.includes(\"alt\") !== alt) return 0\n\t\t\tif (modifiers.includes(\"meta\") !== meta) return 0\n\n\t\t\treturn 1\n\t\t}\n\n\t\tdefault:\n\t\t\tthrow new Error(\"unknown expression\")\n\t}\n}\n\n", "\nexport class Clock {\n\tsince = 0\n\tlast: number | undefined\n\n\tconstructor(public time = performance.now()) {}\n\n\tupdate(time = performance.now()) {\n\t\tthis.since = time - (this.time ?? time)\n\t\tthis.last = this.time\n\t\tthis.time = time\n\t}\n}\n\n", "\nimport {Sample} from \"../types.js\"\nimport {Clock} from \"../utils/clock.js\"\n\nexport class EvaluationContext {\n\tdt = 0\n\tclock = new Clock()\n\n\trecentSamples: Sample[] = []\n\tlatestValues = new Map<string, number>()\n\tpreviousValues = new Map<string, number>()\n\n\tholding = new Map<object, {start: number}>()\n\ttapping = new Map<object, {\n\t\twasDown: boolean\n\t\tstartedAt: number | null\n\t\tcount: number\n\t}>()\n}\n\n", "\nimport {Input} from \"../types.js\"\n\nexport function makeInput(): Input {\n\treturn {value: 0, was: 0, sum: 0}\n}\n\n", "\nimport {obmap} from \"@e280/stz\"\nimport {makeInput} from \"./make-input.js\"\nimport {Expression} from \"../expression.js\"\nimport {hashBindings} from \"./hash-bindings.js\"\nimport {isExpression} from \"./is-expression.js\"\nimport {Bindings, Input, Inputs} from \"../types.js\"\nimport {minihash} from \"../data/intent/minihash.js\"\n\nexport function investigate<B extends Bindings>(bindings: B) {\n\tconst hash = hashBindings(bindings)\n\n\tconst leaves: {\n\t\tpath: string\n\t\tinput: Input\n\t\texpression: Expression\n\t}[] = []\n\n\tfunction makeInputs(b: Bindings, path: string[]): unknown {\n\t\tif (isExpression(b)) {\n\t\t\tconst input = makeInput()\n\t\t\tleaves.push({\n\t\t\t\tpath: JSON.stringify(path),\n\t\t\t\tinput,\n\t\t\t\texpression: b,\n\t\t\t})\n\t\t\treturn input\n\t\t}\n\t\telse {\n\t\t\treturn obmap(b, (value, key) =>\n\t\t\t\tmakeInputs(value, [...path, key as string])\n\t\t\t)\n\t\t}\n\t}\n\n\tconst inputs = makeInputs(bindings, [\"b\"]) as Inputs<B>\n\n\tleaves.sort((a, b) =>\n\t\ta.path < b.path ? -1 : a.path > b.path ? 1 : 0\n\t)\n\n\treturn {\n\t\thash,\n\t\tminihash: minihash(hash),\n\t\tinputs,\n\t\tinputList: leaves.map(l => l.input),\n\t\trootList: leaves.map(l => l.expression),\n\t}\n}\n\n", "\nimport {deepFreeze} from \"@e280/stz\"\nimport {Sampler} from \"./utils/sampler.js\"\nimport {Intent} from \"./data/intent/types.js\"\nimport {evaluate} from \"./evaluate/evaluate.js\"\nimport {encodeIntents} from \"./data/intent/encode.js\"\nimport {Bindings, Rebindings, Source} from \"./types.js\"\nimport {EvaluationContext} from \"./evaluate/context.js\"\nimport {investigate} from \"./investigate/investigate.js\"\n\nexport class Controller<B extends Bindings = any> {\n\t#sampler\n\t#bindings: Rebindings<B>\n\t#investigation\n\t#context\n\n\tconstructor(options: {source: Source, bindings: B}) {\n\t\tthis.#bindings = deepFreeze(structuredClone(options.bindings)) as any as Rebindings<B>\n\t\tthis.#investigation = investigate(this.#bindings)\n\t\tthis.#sampler = new Sampler(options.source)\n\t\tthis.#context = new EvaluationContext()\n\t}\n\n\tget bindings() {\n\t\treturn this.#bindings\n\t}\n\n\tset bindings(b: Rebindings<B>) {\n\t\tconst bindings = deepFreeze(structuredClone(b)) as Rebindings<B>\n\t\tconst fresh = investigate(bindings)\n\t\tconst goodHash = this.#investigation.hash\n\n\t\tif (fresh.hash !== goodHash)\n\t\t\tthrow new Error(\"incompatible bindings\")\n\n\t\tthis.#bindings = bindings\n\t\tthis.#investigation.rootList = fresh.rootList\n\t}\n\n\t*evaluate(time = performance.now()) {\n\t\tconst samples = this.#sampler.take()\n\n\t\tthis.#context.clock.update(time)\n\t\tthis.#context.recentSamples = samples\n\t\tthis.#context.dt = this.#context.clock.since / 1000\n\n\t\tfor (const {code, value} of samples)\n\t\t\tthis.#context.latestValues.set(code, value)\n\n\t\tfor (const [id, expression] of this.#investigation.rootList.entries()) {\n\t\t\tconst value = evaluate(this.#context, expression)\n\t\t\tif (value !== 0)\n\t\t\t\tyield {id, value} as Intent\n\t\t}\n\n\t\tfor (const {code, value} of samples)\n\t\t\tthis.#context.previousValues.set(code, value)\n\t}\n\n\tencode(time = performance.now()) {\n\t\treturn encodeIntents(\n\t\t\tthis.#investigation.minihash,\n\t\t\t[...this.evaluate(time)],\n\t\t)\n\t}\n\n\tclear() {\n\t\tvoid this.#sampler.take()\n\t}\n\n\tdispose() {\n\t\treturn this.#sampler.dispose()\n\t}\n}\n\n", "\n/** stable reference to a gamepad, has a getter to get the latest gamepad snapshot */\nexport class Pad {\n\tconstructor(private get: () => Gamepad) {}\n\n\tget gamepad() {\n\t\treturn this.get()\n\t}\n}\n\n", "\nexport function evergreen<V>(value: V, fn: () => V | null | undefined) {\n\tlet cached = value\n\treturn () => {\n\t\tconst next = fn()\n\t\tif (next !== undefined && next !== null) cached = next\n\t\treturn cached\n\t}\n}\n\n", "\nimport {ev} from \"@e280/stz\"\nimport {Pad} from \"./pad.js\"\nimport {evergreen} from \"../../utils/evergreen.js\"\n\n/** listen for gamepads coming and going */\nexport function onPad(fn: (pad: Pad) => () => void) {\n\tconst known = new Map<number, {pad: Pad, dispose: () => void}>()\n\n\tfunction refresh() {\n\t\taddNew()\n\t\tdeleteOld()\n\t}\n\n\tfunction addNew() {\n\t\tfor (const gamepad of navigator.getGamepads()) {\n\t\t\tif (gamepad?.connected && !known.has(gamepad.index)) {\n\t\t\t\tconst get = () => navigator.getGamepads()[gamepad.index]\n\t\t\t\tconst pad = new Pad(evergreen(gamepad, get))\n\t\t\t\tconst dispose = fn(pad)\n\t\t\t\tknown.set(gamepad.index, {pad, dispose})\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction deleteOld() {\n\t\tfor (const [index, {pad, dispose}] of known) {\n\t\t\tconst gamepad = navigator.getGamepads()[pad.gamepad.index]\n\t\t\tif (!gamepad?.connected) {\n\t\t\t\tdispose()\n\t\t\t\tknown.delete(index)\n\t\t\t}\n\t\t}\n\t}\n\n\trefresh()\n\n\tconst unlisten = ev(window, {\n\t\tgamepadconnected: refresh,\n\t\tgamepaddisconnected: refresh,\n\t})\n\n\treturn () => {\n\t\tunlisten()\n\t\tfor (const {dispose} of known.values())\n\t\t\tdispose()\n\t\tknown.clear()\n\t}\n}\n\n", "\nimport {disposer, subby} from \"@e280/stz\"\nimport {Sample, Source} from \"../types.js\"\n\nexport class PlainSource implements Source {\n\tonSample = subby<[sample: Sample]>()\n\tdispose = disposer()\n}\n\n", "\nimport {PlainSource} from \"./plain.js\"\nimport {Pad} from \"../utils/pad/pad.js\"\n\nexport class GamepadSource extends PlainSource {\n\t#values = new Map<string, number>()\n\n\tconstructor(public pad: Pad) {\n\t\tsuper()\n\t}\n\n\tget gamepad() {\n\t\treturn this.pad.gamepad\n\t}\n\n\tpoll() {\n\t\tconst gamepad = this.gamepad\n\t\tthis.#pollButtons(gamepad)\n\t\tthis.#pollAxes(gamepad)\n\t}\n\n\t#publish(code: string, value: number) {\n\t\tconst previous = this.#values.get(code) ?? 0\n\n\t\tif (value !== previous) {\n\t\t\tthis.#values.set(code, value)\n\t\t\tthis.onSample.publish({code, value})\n\t\t}\n\t}\n\n\t#pollButtons(gamepad: Gamepad) {\n\t\tlet any = 0\n\n\t\tfor (const [index, button] of gamepad.buttons.entries()) {\n\t\t\tconst value = button.value\n\t\t\tthis.#publish(`gamepad.${index + 1}`, value)\n\t\t\tany = Math.max(any, value)\n\t\t}\n\n\t\tthis.#publish(\"gamepad.any\", any >= 0.9 ? 1 : 0)\n\t}\n\n\t#pollAxes(gamepad: Gamepad) {\n\t\tfor (const [index, value] of gamepad.axes.entries()) {\n\t\t\tthis.#publish(`gamepad.axis.${index + 1}`, value)\n\t\t}\n\t}\n}\n\n", "\nimport {Hub} from \"./hub.js\"\nimport {Controller} from \"../../input/controller.js\"\nimport {onPad} from \"../../input/utils/pad/on-pad.js\"\nimport {GamepadSource} from \"../../input/sources/gamepad.js\"\n\nexport function autoGamepads(\n\t\thub: Hub,\n\t\tfn?: (controller: Controller, source: GamepadSource) => () => void\n\t) {\n\n\treturn onPad(pad => {\n\t\tconst source = new GamepadSource(pad)\n\n\t\tconst controller = new Controller({\n\t\t\tsource,\n\t\t\tbindings: hub.bindings,\n\t\t})\n\n\t\thub.plug(controller)\n\t\tconst dispose = fn?.(controller, source)\n\n\t\treturn () => {\n\t\t\tcontroller.dispose()\n\t\t\thub.remove(controller)\n\t\t\tdispose?.()\n\t\t}\n\t})\n}\n\n", "\nexport function ellipsis(s: string, max: number) {\n\treturn s.length > max\n\t\t? s.slice(0, max) + \"...\"\n\t\t: s\n}\n\n", "\nimport {Source} from \"../types.js\"\nimport {PlainSource} from \"./plain.js\"\n\nexport class Sources extends PlainSource {\n\t#array\n\n\tconstructor(...sources: Source[]) {\n\t\tsuper()\n\n\t\tthis.#array = sources\n\n\t\tfor (const source of sources)\n\t\t\tthis.dispose.schedule(\n\t\t\t\tsource.onSample(sample => this.onSample.publish(sample))\n\t\t\t)\n\t}\n\n\tpoll() {\n\t\tfor (const source of this.#array)\n\t\t\tsource.poll?.()\n\t}\n}\n\n", "\nimport {signal} from \"@e280/strata\"\nimport {debounce, hex} from \"@e280/stz\"\n\nexport class Visualizer {\n\t$hex = signal(\"\")\n\n\tclear = debounce(250, () => {\n\t\tthis.$hex.set(\"\")\n\t})\n\n\tupdate(data: ArrayBuffer) {\n\t\tthis.$hex(hex(new Uint8Array(data)))\n\t\tthis.clear()\n\t}\n}\n\n", "\nexport function mouseButton(button: number) {\n\treturn `pointer.${button + 1}`\n}\n\n", "\nimport {ev} from \"@e280/stz\"\nimport {Vec2} from \"@benev/math\"\nimport {PlainSource} from \"./plain.js\"\nimport {mouseButton} from \"../utils/mouse-button.js\"\n\nexport class PointerSource extends PlainSource {\n\tclient = new Vec2()\n\n\tconstructor(target: EventTarget = window) {\n\t\tsuper()\n\t\tthis.dispose.schedule(\n\t\t\tev(target, this.#listeners)\n\t\t)\n\t}\n\n\t#listeners = {\n\t\tpointerdown: (event: PointerEvent) => {\n\t\t\tthis.onSample.publish({code: mouseButton(event.button), value: 1})\n\t\t},\n\n\t\tpointerup: (event: PointerEvent) => {\n\t\t\tthis.onSample.publish({code: mouseButton(event.button), value: 0})\n\t\t},\n\n\t\tpointermove: ({clientX, clientY, movementX, movementY}: PointerEvent) => {\n\t\t\tthis.client.set_(clientX, clientY)\n\t\t\tif (movementX) this.onSample.publish({code: \"pointer.x\", value: movementX})\n\t\t\tif (movementY) this.onSample.publish({code: \"pointer.y\", value: movementY})\n\t\t},\n\n\t\twheel: ({deltaX, deltaY}: WheelEvent) => {\n\t\t\tif (deltaX) this.onSample.publish({code: \"pointer.wheel.x\", value: deltaX})\n\t\t\tif (deltaY) this.onSample.publish({code: \"pointer.wheel.y\", value: deltaY})\n\t\t},\n\t}\n}\n\n", "\nimport {ev} from \"@e280/stz\"\nimport {PlainSource} from \"./plain.js\"\n\nexport class KeyboardSource extends PlainSource {\n\t#down = new Set<string>()\n\n\tconstructor(target: EventTarget = window) {\n\t\tsuper()\n\t\tthis.dispose.schedule(ev(target, this.#targetListeners))\n\t\tthis.dispose.schedule(ev(window, this.#windowListeners))\n\t}\n\n\t#targetListeners = {\n\t\tkeydown: (event: KeyboardEvent) => {\n\t\t\tif (event.repeat) return\n\n\t\t\tif (this.#down.size === 0)\n\t\t\t\tthis.onSample.publish({code: \"keyboard.any\", value: 1})\n\n\t\t\tthis.onSample.publish({code: event.code, value: 1})\n\t\t\tthis.#down.add(event.code)\n\t\t},\n\n\t\tkeyup: (event: KeyboardEvent) => {\n\t\t\tthis.onSample.publish({code: event.code, value: 0})\n\t\t\tthis.#down.delete(event.code)\n\n\t\t\tif (this.#down.size === 0)\n\t\t\t\tthis.onSample.publish({code: \"keyboard.any\", value: 0})\n\t\t},\n\t}\n\n\t#windowListeners = {\n\t\tblur: () => {\n\t\t\tfor (const code of this.#down)\n\t\t\t\tthis.onSample.publish({code: code, value: 0})\n\n\t\t\tif (this.#down.size)\n\t\t\t\tthis.onSample.publish({code: \"keyboard.any\", value: 0})\n\n\t\t\tthis.#down.clear()\n\t\t},\n\t}\n}\n\n", "\nimport {templateString as css} from \"@e280/stz\"\nexport const coreString = css`@layer core {\n\n::selection {\n\tcolor: var(--selection);\n\tbackground-color: var(--selection-bg);\n}\n\n::-webkit-scrollbar { width: 8px; }\n::-webkit-scrollbar-track { background: transparent; }\n::-webkit-scrollbar-thumb { background: #444; border-radius: 1em; }\n::-webkit-scrollbar-thumb:hover { background: #666; }\n\na {\n\tcolor: var(--link);\n\ttext-decoration: none;\n\n\t&:visited {\n\t\tcolor: color-mix(in srgb, purple, var(--link) 70%);\n\t}\n\n\t&:hover {\n\t\tcolor: color-mix(in srgb, white, var(--link) 90%);\n\t\ttext-decoration: underline;\n\t}\n\n\t&:active {\n\t\tcolor: color-mix(in srgb, white, var(--link) 50%);\n\t}\n}\n\n}`\n\n", "\nimport {templateString as css} from \"@e280/stz\"\nexport const varsString = css`@layer vars {\n\n:is(:root, :host) {\n\t${renderVars({\n\t\t\"bg\": \"#111\",\n\t\t\"alpha\": \"#def\",\n\n\t\t\"rounded\": \"0.5em\",\n\t\t\"padding\": \"0.5em\",\n\n\t\t\"prime\": \"#d068ff\",\n\t\t\"code\": \"#3f1\",\n\t\t\"link\": \"cyan\",\n\t\t\"selection\": \"white\",\n\t\t\"selection-bg\": \"#f70\",\n\n\t\t\"lame\": \"#8888\",\n\t\t\"angry\": \"#f50\",\n\t\t\"zesty\": \"#cf0\",\n\t\t\"happy\": \"#0fa\",\n\t\t\"calm\": \"#0af\",\n\t\t\"sad\": \"#74f\",\n\t\t\"quirky\": \"#f49\",\n\n\t\t\"inactive-opacity\": \"0.5\",\n\t\t\"anim-duration\": \"150ms\",\n\t})}\n}\n\n}`\n\nfunction renderVar([name, value]: [string, string]) {\n\treturn `--${name}: var(--shiny-${name}, ${value});`\n}\n\nfunction renderVars(varsObject: Record<string, string>) {\n\treturn Object.entries(varsObject).map(renderVar).join(\"\\n\")\n}\n\n", "\nimport {templateString as css} from \"@e280/stz\"\nexport const resetString = css`@layer reset {\n\n* {\n\tmargin: 0;\n\tpadding: 0;\n\tbox-sizing: border-box;\n\n\tscrollbar-width: thin;\n\tscrollbar-color: #888 transparent;\n}\n\n::-webkit-scrollbar { width: 8px; }\n::-webkit-scrollbar-track { background: transparent; }\n::-webkit-scrollbar-thumb { background: #888; border-radius: 1em; }\n::-webkit-scrollbar-thumb:hover { background: #999; }\n\n}`\n\n", "\nimport {templateString as css} from \"@e280/stz\"\nimport {coreString} from \"./parts/core.js\"\nimport {varsString} from \"./parts/vars.js\"\nimport {resetString} from \"./parts/reset.js\"\nexport const themeString = css`\n\n@layer vars, reset, core, underlay, view, overlay;\n\n${varsString}\n${resetString}\n${coreString}\n\n`\n\n", "\nimport {themeString} from \"./theme-string.js\"\n\nexport const themeCss = new CSSStyleSheet()\n\nthemeCss.replaceSync(themeString)\n\n", "\nimport {signal} from \"@e280/strata\"\n\nexport class TabsControl {\n\tlength = 1\n\t$index = signal(0)\n\n\tconstructor(start = 0) {\n\t\tthis.$index(start)\n\t}\n\n\tclamp(index: number) {\n\t\tindex = Math.min(index, this.length - 1)\n\t\tindex = Math.max(index, 0)\n\t\treturn index\n\t}\n\n\tget index() {\n\t\treturn this.clamp(this.$index())\n\t}\n\n\tasync setIndex(index: number) {\n\t\treturn this.$index(index)\n\t}\n\n\tasync shimmy(delta: number) {\n\t\tconst index = this.clamp(this.index + delta)\n\t\treturn this.setIndex(index)\n\t}\n}\n\n", "\nimport {css} from \"lit\"\nexport default css`@layer view {\n\n:host {\n\tdisplay: inline-flex;\n\tflex-direction: column;\n}\n\nslot[part=\"tabs\"] {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\n\t&::slotted([data-tabbed]) {\n\t\topacity: 1;\n\t\tcolor: currentColor;\n\t\ttext-decoration: underline;\n\t}\n}\n\nslot[part=\"tabs\"][data-snug] {\n\t&::slotted(*) {\n\t\tborder-radius: var(--rounded);\n\t}\n\n\t&::slotted(:not([data-last], [data-next-is-tabbed])) {\n\t\tborder-right: none;\n\t}\n\n\t&::slotted([data-tabbed]:not([data-first])) {\n\t\tborder-left: none;\n\t}\n\n\t&::slotted(:not([data-last])) {\n\t\tborder-top-right-radius: 0;\n\t\tborder-bottom-right-radius: 0;\n\t}\n\n\t&::slotted(:not([data-first])) {\n\t\tborder-top-left-radius: 0;\n\t\tborder-bottom-left-radius: 0;\n\t}\n}\n\n} `\n\n", "\nimport {html} from \"lit\"\nimport {dom, shadow, useHost, useName, useOnce, useSignal, useStyles} from \"@e280/sly\"\nimport styleCss from \"./style.css.js\"\nimport {TabsControl} from \"./control.js\"\nimport {themeCss} from \"../../theme/theme.css.js\"\n\nexport const ShinyTabs = shadow((options: {\n\t\tsnug?: boolean\n\t\tcontrol?: TabsControl\n\t} = {}) => {\n\n\tuseName(\"shiny-tabs\")\n\tuseStyles(themeCss, styleCss)\n\n\tconst host = useHost()\n\tconst attrs = useOnce(() => dom.attrs(host).spec({index: Number}))\n\tconst control = useOnce(() => options.control ?? new TabsControl(attrs.index ?? 0))\n\n\tconst $tabs = useSignal<HTMLElement[]>([])\n\tconst $panels = useSignal<HTMLElement[]>([])\n\n\tfunction tabchange(event: Event) {\n\t\tconst slot = event.currentTarget! as HTMLSlotElement\n\t\t$tabs(slot.assignedElements() as HTMLElement[])\n\t}\n\n\tfunction panelchange(event: Event) {\n\t\tconst slot = event.currentTarget! as HTMLSlotElement\n\t\t$panels(slot.assignedElements() as HTMLElement[])\n\t}\n\n\tattrs.index = control.$index()\n\tcontrol.length = $tabs().length\n\n\tfunction isNeighborActive(index: number, delta: number) {\n\t\tconst nextIndex = control.clamp(index + delta)\n\t\tif (nextIndex === index) return false\n\t\treturn (nextIndex === control.index)\n\t}\n\n\tfor (const [index, tab] of $tabs().entries()) {\n\t\tconst tabbed = (index === control.index)\n\t\tconst tabAttrs = dom.attrs(tab)\n\t\ttabAttrs.booleans.disabled = tabbed\n\t\ttabAttrs.booleans[\"data-snug\"] = options.snug\n\t\ttabAttrs.booleans[\"data-tabbed\"] = tabbed\n\t\ttabAttrs.booleans[\"data-first\"] = (index === 0)\n\t\ttabAttrs.booleans[\"data-last\"] = (index === (control.length - 1))\n\t\ttabAttrs.booleans[\"data-next-is-tabbed\"] = isNeighborActive(index, 1)\n\t\ttabAttrs.booleans[\"data-previous-is-tabbed\"] = isNeighborActive(index, -1)\n\t\ttab.onclick = () => control.setIndex(index)\n\t}\n\n\tfor (const [index, panel] of $panels().entries()) {\n\t\tconst tabbed = (index === control.index)\n\t\tdom.attrs(panel).booleans[\"data-tabbed\"] = tabbed\n\t\tdom.attrs(panel).booleans[\"hidden\"] = !tabbed\n\t}\n\n\treturn html`\n\t\t<slot part=tabs ?data-snug=\"${options.snug}\" @slotchange=\"${tabchange}\"></slot>\n\t\t<slot part=panels name=panel @slotchange=\"${panelchange}\"></slot>\n\t`\n})\n\n", "\nimport {css} from \"lit\"\nexport default css`@layer view {\n\n:host {\n\tdisplay: block;\n\twidth: min(50em, 100%);\n\n\tcolor: var(--text);\n\ttext-shadow: var(--text-shadow);\n}\n\n.deck {\n\tpadding: var(--pad);\n\t--tint: oklch(from var(--prime) l c h / 50%);\n}\n\n[view=\"shiny-tabs\"] {\n\t--prime: inherit;\n\n\t--tint: var(--prime);\n\t--slate: color-mix(in oklch,\n\t\ttransparent,\n\t\tcolor-mix(in oklch, var(--bg), var(--tint) 25%) 25%\n\t);\n\t--shimmer: color-mix(in oklch, transparent, var(--tint));\n\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\n\t&::part(tabs) {\n\t\tdisplay: flex;\n\t\twidth: max-content;\n\t\tjustify-content: center;\n\t\tpadding: var(--nib);\n\n\t\tbackground: var(--slate);\n\t\tborder: 1px solid var(--shimmer);\n\t\tborder-radius: var(--round);\n\t}\n\n\t&::part(panels) {\n\t\tdisplay: block;\n\t\twidth: 100%;\n\t\tmargin-top: var(--pad);\n\t}\n\n\tbutton {\n\t\tborder: none;\n\t\tbackground: transparent;\n\t\tborder-radius: var(--round);\n\t\tborder: 2px solid transparent;\n\t\ttext-shadow: var(--text-shadow);\n\n\t\t&[data-tabbed] {\n\t\t\ttext-decoration: none;\n\t\t\tcolor: var(--prime);\n\t\t\tborder-color: var(--prime);\n\t\t\tbackground: color-mix(in oklch, var(--bg), var(--prime) 30%);\n\t\t\tbox-shadow:\n\t\t\t\tinset 0 0 1.5em oklch(from var(--shimmer) l c h / 50%),\n\t\t\t\t0 0 2em oklch(from var(--shimmer) l c h / 50%);\n\t\t}\n\t}\n}\n\n}`\n\n", "\nimport {css} from \"lit\"\nimport {cssReset} from \"@e280/sly\"\n\nexport default css`\n@layer theme, view;\n@layer theme {\n\n${cssReset}\n\n:host {\n\t--prime: var(--tact-prime, #fb0);\n\n\t--text: var(--tact-text, #fffc);\n\t--bg: var(--tact-bg, oklch(from var(--prime) calc(l * 0.3) calc(c * 0.1) h));\n\t--droppy: var(--tact-droppy, oklch(from var(--prime) l c calc(h + 100)));\n\t--recording: var(--tact-recording, oklch(from var(--prime) l c calc(h + 100)));\n\n\t--round: var(--tact-round, 0.5em);\n\t--pad: var(--tact-pad, 0.5em);\n\t--nib: var(--tact-nib, 0.2em);\n\t--space: var(--tact-space, 1em);\n\t--box-shadow: var(--tact-box-shadow, 0.1em 0.2em 1em #0006);\n\t--text-shadow: var(--tact-text-shadow, 0.02em 0.04em 0.1em #000a);\n}\n\n[theme-card] {\n\t--tint: var(--prime);\n\t--slate: color-mix(in oklch,\n\t\ttransparent,\n\t\tcolor-mix(in oklch, var(--bg), var(--tint) 25%) 25%\n\t);\n\t--shimmer: color-mix(in oklch, transparent, var(--tint));\n\n\tborder-radius: var(--round);\n\tbackground: var(--slate);\n\tborder: 1px solid var(--shimmer);\n\tbox-shadow:\n\t\tinset 0 0 3em color-mix(in oklch, transparent, var(--shimmer) 30%),\n\t\tvar(--box-shadow);\n\n\t&[theme-card=\"dull\"] {\n\t\t--tint: #8888;\n\t}\n}\n\n[theme-button] {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tfont: inherit;\n\tcolor: inherit;\n\n\tcursor: pointer;\n\tuser-select: none;\n\n\topacity: 0.8;\n\tgap: 0.5em;\n\tpadding: 0.5em;\n\n\t&:is(:hover, :focus-visible) { opacity: 1; }\n\t&:active { opacity: 0.8; }\n\n\tsvg {\n\t\twidth: 1.2em;\n\t\theight: 1.2em;\n\t}\n\n\t&[theme-button~=\"naked\"] {\n\t\tpadding: 0;\n\t\tborder: none;\n\t\tbackground: transparent;\n\t\tcolor: currentColor;\n\t}\n\n\t&[theme-button~=\"angry\"] {\n\t\t&:is(:hover, :focus-visible) { color: red; }\n\t}\n}\n\n[theme-select] {\n\t--base: var(--tint, var(--prime));\n\tfont: inherit;\n\tcolor: inherit;\n\tbackground: var(--bg);\n\tborder: 1px solid var(--base);\n\tborder-radius: var(--round);\n\tpadding: var(--nib) var(--pad);\n\tbox-shadow: inset 0 0 1em oklch(from var(--base) l c h / 40%);\n\n\t&:is(:hover, :focus-visible) {\n\t\tfilter: brightness(110%);\n\t\tbox-shadow: inset 0 0 1em oklch(from var(--base) l c h / 60%);\n\t}\n\n\t&:active {\n\t\tfilter: brightness(90%);\n\t\tbox-shadow: inset 0 0 1em oklch(from var(--base) l c h / 40%);\n\t}\n}\n\n[theme-input] {\n\t--base: var(--tint, var(--prime));\n\t--chill: oklch(from var(--base) l c h / 50%);\n\tfont: inherit;\n\tcolor: inherit;\n\tbackground: transparent;\n\tborder: 1px solid var(--chill);\n\tborder-radius: var(--round);\n\tpadding: 0 var(--nib);\n\tbox-shadow: inset 0 0 1em oklch(from var(--chill) l c h / 20%);\n}\n\n}`\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"ai ai-GameController\"><path d=\"M9 15l-2.968 2.968A2.362 2.362 0 0 1 2 16.298V15l1.357-6.784A4 4 0 0 1 7.279 5h9.442a4 4 0 0 1 3.922 3.216L22 15v1.297a2.362 2.362 0 0 1-4.032 1.67L15 15H9z\"/><path d=\"M9 5l1 2h4l1-2\"/></svg>`\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"ai ai-SettingsHorizontal\"><path d=\"M3 5h4m14 0H11m-8 7h12m6 0h-2M3 19h2m16 0H9\"/><circle cx=\"9\" cy=\"5\" r=\"2\"/><circle cx=\"17\" cy=\"12\" r=\"2\"/><circle cx=\"7\" cy=\"19\" r=\"2\"/></svg>`\n\n", "\nimport {css} from \"lit\"\nexport default css`@layer view {\n\n.plate {\n\tuser-select: none;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: var(--pad);\n}\n\n[data-drag-and-drop] {\n\t.player[data-drop-candidate] {\n\t\toutline: 2px dashed color-mix(in oklch, transparent, var(--droppy) 80%);\n\t\tbackground: color-mix(in oklch, var(--slate), var(--droppy) 20%);\n\n\t\t&[data-dropping] {\n\t\t\toutline: 2px solid var(--droppy);\n\t\t\tbackground: color-mix(in oklch, var(--slate), var(--droppy) 50%);\n\t\t}\n\t}\n}\n\n.playerlist {\n\tdisplay: grid;\n\tgrid-template-columns: repeat(\n\t\tauto-fit,\n\t\tminmax(min(100%, 20em), 1fr)\n\t);\n\n\twidth: min(100%, calc(48em + var(--pad)));\n\tgap: var(--pad);\n\n\t> * {\n\t\tmin-width: 0;\n\t\tmin-height: 7em;\n\t}\n}\n\n.player {\n\tdisplay: flex;\n\tflex-direction: column;\n\n\t&.new {\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\tpadding: var(--pad);\n\n\t\tborder-style: dashed;\n\t\tborder-width: 2px;\n\t\tborder-color: oklch(from var(--text) l c h / 30%);\n\t\tbackground: transparent;\n\t\tbox-shadow: none;\n\n\t\tbutton {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tsvg {\n\t\t\t\twidth: 2.5em;\n\t\t\t\theight: 2.5em;\n\t\t\t}\n\t\t}\n\t}\n\n\th3 {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tjustify-content: space-between;\n\t\tpadding: var(--nib) var(--pad);\n\t}\n\n\t.controllerlist {\n\t\tdisplay: flex;\n\t\tflex: 1 1 auto;\n\t\tflex-direction: column;\n\t\tgap: var(--pad);\n\t\tpadding: var(--pad);\n\t}\n\n\t.controller {\n\t\t--tint: oklch(0.7 0.3 var(--hue, 0));\n\t\tbackground: color-mix(in oklch, transparent, var(--bg) 50%);\n\t\tborder: 2px solid var(--shimmer);\n\t\tbox-shadow:\n\t\t\tinset 0 0 2em color-mix(in oklch, transparent, var(--shimmer)),\n\t\t\tvar(--box-shadow);\n\n\t\t&:hover {\n\t\t\tbackground: color-mix(in oklch, transparent, var(--bg) 70%);\n\t\t\tfilter: brightness(120%);\n\t\t}\n\n\t\t[view=\"profile-select\"]::part(select) {\n\t\t\t--base: oklch(from var(--tint) l c h / 50%);\n\t\t}\n\t}\n\n\t.controller {\n\t\tcursor: grab;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\n\t\tgap: var(--pad);\n\t\tpadding: var(--nib);\n\n\t\tborder-radius: 0.5em;\n\t\toverflow: clip;\n\n\t\t.griptape {\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: center;\n\t\t\talign-items: center;\n\n\t\t\twidth: 1.5em;\n\t\t\tflex: 0 0 auto;\n\n\t\t\tsvg {\n\t\t\t\topacity: 0.5;\n\t\t\t}\n\t\t}\n\n\t\t.label {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: var(--pad);\n\t\t\tmin-width: 0;\n\n\t\t\tflex: 1 1 auto;\n\t\t\tfont-size: 1em;\n\t\t\tfont-weight: normal;\n\n\t\t\t.icon {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex: 0 0 auto;\n\t\t\t\tsvg {\n\t\t\t\t\twidth: 2em;\n\t\t\t\t\theight: 2em;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.name {\n\t\t\t\tmin-width: 0;\n\t\t\t\tline-height: 1.1;\n\t\t\t\tfont-size: 0.7em;\n\t\t\t\toverflow: hidden;\n\t\t\t\ttext-overflow: ellipsis;\n\t\t\t}\n\t\t}\n\n\t\tselect {\n\t\t\tpadding: var(--nib) var(--pad);\n\t\t}\n\t}\n}\n\n}`\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"ai ai-PersonAdd\"><circle cx=\"12\" cy=\"7\" r=\"5\"/><path d=\"M17 22H5.266a2 2 0 0 1-1.985-2.248l.39-3.124A3 3 0 0 1 6.649 14H7\"/><path d=\"M19 14v4\"/><path d=\"M17 16h4\"/></svg>`\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"ai ai-XSmall\"><path d=\"M17 17L7 7m10 0L7 17\"/></svg>`\n\n", "\nimport {html} from \"lit\"\nimport {Content, lightView} from \"@e280/sly\"\nimport {Context, DroppyPort} from \"../../deck/types.js\"\n\nexport const DropcardView = lightView((o: {\n\t\tclass: string\n\t\tthemeCard?: string\n\t\tcontext: Context\n\t\tplayerId: DroppyPort[\"playerId\"]\n\t\tcontent: Content\n\t}) => {\n\n\tconst {dnd} = o.context\n\tconst dropzone = dnd.dropzone(() => ({playerId: o.playerId}))\n\n\treturn html`\n\t\t<div class=\"${o.class}\"\n\t\t\ttheme-card=\"${o.themeCard ?? \"\"}\"\n\t\t\tdata-drop-candidate\n\t\t\t?data-dropping=\"${dnd.hovering?.playerId === o.playerId}\"\n\t\t\t@dragenter=\"${dropzone.dragenter}\"\n\t\t\t@dragleave=\"${dropzone.dragleave}\"\n\t\t\t@dragover=\"${dropzone.dragover}\"\n\t\t\t@drop=\"${dropzone.drop}\">\n\n\t\t\t${o.content}\n\t\t</div>\n\t`\n})\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"currentColor\" stroke-width=\"2\" class=\"ai ai-DragVerticalFill\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M16 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4z\"/><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M16 10a2 2 0 1 1 0 4 2 2 0 0 1 0-4z\"/><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8 18a2 2 0 1 1 0 4 2 2 0 0 1 0-4z\"/><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M16 18a2 2 0 1 1 0 4 2 2 0 0 1 0-4z\"/><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4z\"/><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8 10a2 2 0 1 1 0 4 2 2 0 0 1 0-4z\"/></svg>`\n\n", "\nexport function hueify(n: number) {\n\treturn n * 137.508\n}\n\n", "\nimport {html} from \"lit\"\nimport {lightView} from \"@e280/sly\"\nimport {Controls} from \"../../deck/controls/controls.js\"\n\nexport const ProfileSelectView = lightView((\n\t\tdeck: {controls: Controls},\n\t\tcurrentProfileKey: string,\n\t\tonChange: (key: string) => void,\n\t) => {\n\n\tconst {profiles} = deck.controls\n\n\tfunction handleChange(event: Event) {\n\t\tconst select = event.currentTarget as HTMLSelectElement\n\t\tonChange(select.value)\n\t}\n\n\treturn html`\n\t\t<select\n\t\t\tpart=select\n\t\t\ttheme-select\n\t\t\t.value=\"${currentProfileKey}\"\n\t\t\t@change=\"${handleChange}\">\n\n\t\t\t${profiles.presets.map(([key, profile]) => html`\n\t\t\t\t<option\n\t\t\t\t\tvalue=\"${key}\"\n\t\t\t\t\t?selected=\"${key === currentProfileKey}\">\n\t\t\t\t\t${profile.label}\n\t\t\t\t</option>\n\t\t\t`)}\n\n\t\t\t${profiles.customs.map(([key, profile]) => html`\n\t\t\t\t<option\n\t\t\t\t\tvalue=\"${key}\"\n\t\t\t\t\t?selected=\"${key === currentProfileKey}\">\n\t\t\t\t\t${profile.label}\n\t\t\t\t</option>\n\t\t\t`)}\n\t\t</select>\n\t`\n})\n\n", "\nimport {html} from \"lit\"\nimport {lightView} from \"@e280/sly\"\n\nimport gameControllerSvg from \"../../../icons/akar/game-controller.svg.js\"\nimport dragVerticalFillSvg from \"../../../icons/akar/drag-vertical-fill.svg.js\"\n\nimport {Context} from \"../../deck/types.js\"\nimport {hueify} from \"../../../../utils/hueify.js\"\nimport {Controller} from \"../../../../input/controller.js\"\nimport {ProfileSelectView} from \"../../profile-select/view.js\"\n\nexport const ControllerView = lightView((context: Context, controller: Controller) => {\n\tconst {deck, dnd} = context\n\tconst {controls} = deck\n\tconst dragzone = dnd.dragzone(() => ({controller}))\n\tconst currentProfileKey = controls.assignments.assignedProfileKeyOf(controller)\n\tconst meta = controls.meta(controller) ?? {\n\t\tid: 0,\n\t\ticon: gameControllerSvg,\n\t\thandle: \"controller\",\n\t\tname: \"controller\",\n\t\ttooltip: \"\",\n\t\tdefaultProfileKey: controls.fallbackProfileKey,\n\t}\n\n\tconst style = `--hue: ${hueify(meta?.id ?? 0)};`\n\n\treturn html`\n\t\t<div class=controller\n\t\t\tstyle=\"${style}\"\n\t\t\ttheme-card\n\t\t\t?data-dragging=\"${dnd.dragging?.controller === controller}\"\n\t\t\tdraggable=\"${dragzone.draggable}\"\n\t\t\t@dragstart=\"${dragzone.dragstart}\"\n\t\t\t@dragend=\"${dragzone.dragend}\">\n\n\t\t\t<div class=griptape>\n\t\t\t\t${dragVerticalFillSvg}\n\t\t\t</div>\n\n\t\t\t<h4 class=label title=\"${meta.tooltip}\">\n\t\t\t\t<span class=icon>${meta.icon}</span>\n\t\t\t\t<span class=name>${meta.name}</span>\n\t\t\t</h4>\n\n\t\t\t${ProfileSelectView(deck, currentProfileKey, key => {\n\t\t\t\tcontrols.assignments.assign(controller, key)\n\t\t\t})}\n\t\t</div>\n\t`\n})\n\n", "\nimport {html} from \"lit\"\nimport {when} from \"@e280/stz\"\nimport {lightView} from \"@e280/sly\"\n\nimport xSmallSvg from \"../../../icons/akar/x-small.svg.js\"\n\nimport {DropcardView} from \"./dropcard.js\"\nimport {Context} from \"../../deck/types.js\"\nimport {ControllerView} from \"./controller.js\"\n\nexport const PlayerView = lightView((context: Context, playerId: number, index: number) => {\n\tconst {hub} = context.deck\n\tconst deletePlayer = () => hub.deletePlayer(playerId)\n\tconst controllers = hub.controllers.assigned.get(playerId) ?? []\n\n\treturn DropcardView({\n\t\tclass: \"player\",\n\t\tplayerId: playerId,\n\t\tcontext,\n\t\tcontent: html`\n\t\t\t<h3>\n\t\t\t\t<span>player ${index + 1}</span>\n\n\t\t\t\t${when(hub.playerIds.length > 1, () => html`\n\t\t\t\t\t<button theme-button=\"naked angry\" @click=${deletePlayer}>\n\t\t\t\t\t\t${xSmallSvg}\n\t\t\t\t\t</button>\n\t\t\t\t`)}\n\t\t\t</h3>\n\n\t\t\t<div class=controllerlist>\n\t\t\t\t${controllers.map(c => ControllerView(context, c))}\n\t\t\t</div>\n\t\t`,\n\t})\n})\n\n", "\nimport {loot} from \"@e280/sly\"\nimport {Deck, PlayerId} from \"../../deck/types.js\"\nimport {Controller} from \"../../../input/controller.js\"\n\nexport const droppyNewPlayer = Symbol(\"droppyNewPlayer\")\n\nexport type DraggyController = {controller: Controller}\nexport type DroppyPort = {playerId: PlayerId | null | typeof droppyNewPlayer}\n\nexport type Context = {\n\tdeck: Deck\n\tdnd: loot.DragAndDrops<DraggyController, DroppyPort>\n}\n\n", "\nimport {html} from \"lit\"\nimport {isHappy, when} from \"@e280/stz\"\nimport {loot, shadowDuplex, useCss, useOnce} from \"@e280/sly\"\n\nimport styleCss from \"./style.css.js\"\nimport themeCss from \"../theme.css.js\"\nimport personAddSvg from \"../../icons/akar/person-add.svg.js\"\n\nimport {Deck} from \"../../deck/types.js\"\nimport {PlayerView} from \"./subviews/player.js\"\nimport {DropcardView} from \"./subviews/dropcard.js\"\nimport {ControllerView} from \"./subviews/controller.js\"\nimport {Context, droppyNewPlayer} from \"../deck/types.js\"\n\nexport const [ControllersView, makeControllersElement] = shadowDuplex((deck: Deck) => {\n\tuseCss(themeCss, styleCss)\n\n\tconst {hub} = deck\n\tconst controllers = hub.controllers\n\tconst clickCreatePlayer = () => deck.hub.createPlayer()\n\tconst renderPlayer = (p: number, i: number) => PlayerView(context, p, i)\n\n\tconst context: Context = useOnce(() => ({\n\t\tdeck,\n\t\tdnd: new loot.DragAndDrops({\n\t\t\tacceptDrop(_event, draggy, droppy) {\n\t\t\t\tif (droppy.playerId === droppyNewPlayer)\n\t\t\t\t\thub.plug(draggy.controller, hub.createPlayer())\n\t\t\t\telse if (isHappy(droppy.playerId))\n\t\t\t\t\thub.plug(draggy.controller, droppy.playerId)\n\t\t\t\telse\n\t\t\t\t\thub.unplug(draggy.controller)\n\t\t\t},\n\t\t}),\n\t}))\n\n\treturn html`\n\t\t<div class=plate ?data-drag-and-drop=\"${!!context.dnd.dragging}\">\n\t\t\t<div class=playerlist>\n\t\t\t\t${hub.playerIds.map(renderPlayer)}\n\n\t\t\t\t${when(hub.playerIds.length < deck.maxPlayers, () => DropcardView({\n\t\t\t\t\tclass: \"player new\",\n\t\t\t\t\tthemeCard: \"dull\",\n\t\t\t\t\tplayerId: droppyNewPlayer,\n\t\t\t\t\tcontext,\n\t\t\t\t\tcontent: html`\n\t\t\t\t\t\t<button theme-button=naked @click=\"${clickCreatePlayer}\">\n\t\t\t\t\t\t\t${personAddSvg}\n\t\t\t\t\t\t\t<span>add player</span>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t`,\n\t\t\t\t}))}\n\n\t\t\t\t${DropcardView({\n\t\t\t\t\tclass: \"player unassigned\",\n\t\t\t\t\tthemeCard: \"dull\",\n\t\t\t\t\tplayerId: null,\n\t\t\t\t\tcontext,\n\t\t\t\t\tcontent: html`\n\t\t\t\t\t\t<h3>unassigned</h3>\n\t\t\t\t\t\t<div class=controllerlist>\n\t\t\t\t\t\t\t${controllers.unassigned.map(c => ControllerView(context, c))}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`,\n\t\t\t\t})}\n\t\t\t</div>\n\t\t</div>\n\t`\n})\n\n", "\nimport {css} from \"lit\"\nexport default css`@layer view {\n\n.plate {\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.topbar {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tpadding: var(--pad) var(--space);\n\n\t[view=\"profile-select\"] {\n\t\tfont-size: 1.2em;\n\t}\n\n\t.corner {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\talign-items: center;\n\t\tgap: var(--pad);\n\n\t\tsmall {\n\t\t\tuser-select: none;\n\t\t\topacity: 0.5;\n\t\t\tfont-style: italic;\n\t\t\tborder: 1px solid;\n\t\t\tborder-radius: var(--round);\n\t\t\tpadding: var(--nib) var(--pad);\n\t\t}\n\t}\n\n\t.tools {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: var(--pad);\n\t\tflex: 1 1 auto;\n\t\tjustify-content: end;\n\n\t\tinput[type=\"text\"] {\n\t\t\twidth: 12em;\n\t\t}\n\t}\n}\n\n.bindings, .group {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: var(--nib);\n}\n\n.bindings {\n\tuser-select: none;\n\tcursor: default;\n\tpadding: var(--space);\n\n\tsummary {\n\t\tcolor: var(--prime);\n\t\twidth: max-content;\n\t\tfont-weight: bold;\n\t\tfont-size: 1.2em;\n\t\t&:is(:hover, :focus-visible) { filter: brightness(120%); }\n\t\t&:active { filter: brightness(90%); }\n\t}\n\n\t.expression {\n\t\tdisplay: flex;\n\t\talign-items: end;\n\t\tmargin-left: 0.5em;\n\t\tborder-bottom: 1px dashed oklch(from var(--prime) l c h / 30%);\n\t\tflex-wrap: wrap;\n\t\tgap: 0 var(--pad);\n\t\tpadding: var(--nib);\n\n\t\tmin-height: 3em;\n\n\t\t&:last-of-type {\n\t\t\tmargin-bottom: calc(var(--space) * 2);\n\t\t}\n\n\t\t> strong {\n\t\t\tfont-weight: normal;\n\t\t}\n\n\t\t> div {\n\t\t\tmargin-left: auto;\n\n\t\t\tinput {\n\t\t\t\tfont: inherit;\n\t\t\t\tcolor: inherit;\n\t\t\t\twidth: 8em;\n\n\t\t\t\t&[type=\"number\"] {\n\t\t\t\t\twidth: 5em;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdiv {\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\talign-items: stretch;\n\t\t\tgap: var(--nib);\n\t\t}\n\n\t\t.bracket {\n\t\t\talign-items: center;\n\t\t\tgap: var(--nib);\n\t\t\tpadding: 2px var(--nib);\n\t\t\tbackground: color-mix(in oklch, #aaa2, var(--slate) 80%);\n\t\t\tbox-shadow: 0.1em 0.2em 0.5em #0002;\n\t\t\tborder: 1px solid #fff4;\n\t\t\tborder-radius: 0.2em;\n\n\t\t\t&.mod {\n\t\t\t\tgap: var(--nib);\n\t\t\t}\n\t\t}\n\t}\n\n\t.children {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\n\t\tmargin-left: 0.3em;\n\t\tpadding-left: 0.5em;\n\t\tborder-left: 1px solid oklch(from var(--prime) l c h / 20%);\n\t}\n\n\t.expression .recorder {\n\t\tdisplay: flex;\n\t\tgap: var(--pad);\n\n\t\t&[data-recording] {\n\t\t\tcolor: var(--recording);\n\t\t}\n\t}\n}\n\n}`\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"ai ai-Copy\"><path d=\"M8 4v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7.242a2 2 0 0 0-.602-1.43L16.083 2.57A2 2 0 0 0 14.685 2H10a2 2 0 0 0-2 2z\"/><path d=\"M16 18v2a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h2\"/></svg>`\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"ai ai-TrashCan\"><path d=\"M4 6h16l-1.58 14.22A2 2 0 0 1 16.432 22H7.568a2 2 0 0 1-1.988-1.78L4 6z\"/><path d=\"M7.345 3.147A2 2 0 0 1 9.154 2h5.692a2 2 0 0 1 1.81 1.147L18 6H6l1.345-2.853z\"/><path d=\"M2 6h20\"/><path d=\"M10 11v5\"/><path d=\"M14 11v5\"/></svg>`\n\n", "\nimport {hex} from \"@e280/stz\"\n\nexport function makeId() {\n\treturn hex.random(16)\n}\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"ai ai-KeyCap\"><path d=\"M7 3s3 .5 5 .5 5-.5 5-.5l1 9s-3 1-6 1-6-1-6-1l1-9z\"/><path d=\"M3.869 8.147l-.862 10.294c-.03.366.04.733.205 1.06l.197.393A2.01 2.01 0 0 0 5.206 21h13.588a2.01 2.01 0 0 0 1.797-1.106l.197-.392c.165-.328.236-.695.205-1.06l-.862-10.295a3.99 3.99 0 0 0-.79-2.068L17 3s-3 .5-5 .5S6.978 3 6.978 3l-2.32 3.08a3.99 3.99 0 0 0-.79 2.067z\"/><path d=\"M6 12l-2.5 8M18 12l2.5 8\"/></svg>`\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"ai ai-Backspace\"><path d=\"M17 15l-6-6m6 0l-6 6\"/><path d=\"M7.4 4.8A2 2 0 0 1 9 4h11a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H9a2 2 0 0 1-1.6-.8l-4.5-6a2 2 0 0 1 0-2.4l4.5-6z\"/></svg>`\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"ai ai-Cross\"><path d=\"M20 20L4 4m16 0L4 20\"/></svg>`\n\n", "\nimport {ev} from \"@e280/stz\"\nimport {Expression} from \"../../../../input/expression.js\"\n\nexport function captureKeyChord(\n\t\tupdate: (code: Expression) => void,\n\t\tonDone: () => void,\n\t) {\n\n\tconst held = new Set<string>()\n\tconst seen = new Set<string>()\n\n\tfunction mod(code: string) {\n\t\tif (code === \"ShiftLeft\" || code === \"ShiftRight\") return \"shift\"\n\t\tif (code === \"ControlLeft\" || code === \"ControlRight\") return \"ctrl\"\n\t\tif (code === \"MetaLeft\" || code === \"MetaRight\") return \"meta\"\n\t\tif (code === \"AltLeft\" || code === \"AltRight\") return \"alt\"\n\t\treturn undefined\n\t}\n\n\tconst stop = ev(window, {\n\t\tblur: () => halt(),\n\t\tkeydown: (event: KeyboardEvent) => {\n\t\t\tevent.preventDefault()\n\n\t\t\tif (event.code === \"Escape\")\n\t\t\t\treturn halt()\n\n\t\t\theld.add(event.code)\n\t\t\tseen.add(event.code)\n\t\t},\n\t\tkeyup: (event: KeyboardEvent) => {\n\t\t\tevent.preventDefault()\n\n\t\t\theld.delete(event.code)\n\n\t\t\tif (held.size === 0) {\n\t\t\t\tconst codes = new Set<string>()\n\t\t\t\tconst mods = new Set<string>()\n\n\t\t\t\tfor (const code of seen) {\n\t\t\t\t\tconst m = mod(code)\n\t\t\t\t\tif (m) mods.add(m)\n\t\t\t\t\telse codes.add(code)\n\t\t\t\t}\n\n\t\t\t\tif (seen.size === 0)\n\t\t\t\t\tvoid 0\n\t\t\t\telse if (codes.size === 0)\n\t\t\t\t\tupdate([\"*\", ...seen])\n\t\t\t\telse if (mods.size > 0)\n\t\t\t\t\tupdate([\"*\", [\"mod\", ...mods as any], ...codes])\n\t\t\t\telse if (seen.size > 1)\n\t\t\t\t\tupdate([\"*\", ...seen])\n\t\t\t\telse\n\t\t\t\t\tupdate([...seen][0]!)\n\n\t\t\t\thalt()\n\t\t\t}\n\t\t},\n\t})\n\n\tconst halt = () => {\n\t\tstop()\n\t\tonDone()\n\t}\n\n\treturn halt\n}\n\n", "\nimport {cycle, disposer, ev, nap} from \"@e280/stz\"\nimport {Expression} from \"../../../../input/expression.js\"\nimport {onPad} from \"../../../../input/utils/pad/on-pad.js\"\nimport {GamepadSource} from \"../../../../input/sources/gamepad.js\"\n\nexport function captureGamepadChord(\n\t\tupdate: (code: Expression) => void,\n\t\tonDone: () => void,\n\t) {\n\n\tconst {dispose, schedule} = disposer()\n\tschedule(onDone)\n\n\tconst sourceSet = new Set<GamepadSource>()\n\tconst held = new Set<string>()\n\tconst seen = new Set<string>()\n\n\tschedule(ev(window, {blur: () => dispose()}))\n\n\tschedule(onPad(pad => {\n\t\tconst source = new GamepadSource(pad)\n\t\tsourceSet.add(source)\n\n\t\tsource.onSample(sample => {\n\t\t\tif (sample.code === \"gamepad.any\")\n\t\t\t\treturn undefined\n\n\t\t\tif (sample.value > 0.9) {\n\t\t\t\theld.add(sample.code)\n\t\t\t\tseen.add(sample.code)\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (!held.delete(sample.code))\n\t\t\t\t\treturn\n\t\t\t\tif (held.size === 0) {\n\t\t\t\t\tif (seen.size === 1) update([...seen][0])\n\t\t\t\t\telse if (seen.size > 1) update([\"*\", ...seen])\n\t\t\t\t\tdispose()\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\treturn () => {\n\t\t\tsource.dispose()\n\t\t\tsourceSet.delete(source)\n\t\t}\n\t}))\n\n\tschedule(cycle(async() => {\n\t\tfor (const source of sourceSet) {\n\t\t\tsource.poll()\n\t\t}\n\t\tawait nap(16.67)\n\t}))\n\n\treturn dispose\n}\n\n", "\nimport {disposer, ev} from \"@e280/stz\"\nimport {Expression} from \"../../../../input/expression.js\"\nimport {mouseButton} from \"../../../../input/utils/mouse-button.js\"\n\nexport function capturePointerChord(\n\t\tupdate: (code: Expression) => void,\n\t\tonDone: () => void,\n\t) {\n\n\tconst {dispose, schedule} = disposer()\n\tschedule(onDone)\n\n\tconst held = new Set<string>()\n\tconst seen = new Set<string>()\n\n\tconst isControl = (event: MouseEvent) => {\n\t\treturn event.composedPath().some(target =>\n\t\t\ttarget instanceof Element &&\n\t\t\ttarget.matches(\"button.record\")\n\t\t)\n\t}\n\n\tschedule(ev(window, {\n\t\tblur: () => dispose(),\n\t\tauxclick: (event: MouseEvent) => event.preventDefault(),\n\n\t\tmousedown: (event: MouseEvent) => {\n\t\t\tif (isControl(event)) return\n\t\t\tevent.preventDefault()\n\t\t\tconst code = mouseButton(event.button)\n\t\t\theld.add(code)\n\t\t\tseen.add(code)\n\t\t},\n\n\t\tmouseup: (event: MouseEvent) => {\n\t\t\tconst code = mouseButton(event.button)\n\t\t\tif (!held.delete(code)) return\n\t\t\tevent.preventDefault()\n\n\t\t\tif (held.size === 0) {\n\t\t\t\tif (seen.size === 1) update([...seen][0]!)\n\t\t\t\telse if (seen.size > 1) update([\"*\", ...seen])\n\t\t\t\tdispose()\n\t\t\t}\n\t\t},\n\n\t\tcontextmenu: (event: MouseEvent) => {\n\t\t\tevent.preventDefault()\n\t\t},\n\t}))\n\n\treturn dispose\n}\n\n", "\nimport {html} from \"lit\"\nimport {disposer} from \"@e280/stz\"\nimport {Content, lightView, useSignal, useUnmount} from \"@e280/sly\"\n\nimport keyCapSvg from \"../../../icons/akar/key-cap.svg.js\"\nimport backspaceSvg from \"../../../icons/akar/backspace.svg.js\"\n\nimport crossSvg from \"../../../icons/akar/cross.svg.js\"\nimport {Expression} from \"../../../../input/expression.js\"\nimport {captureKeyChord} from \"../parts/capture-key-chord.js\"\nimport {captureGamepadChord} from \"../parts/capture-gamepad-chord.js\"\nimport {capturePointerChord} from \"../parts/capture-pointer-chord.js\"\n\nexport const RecorderView = lightView((\n\t\tisReadonly: boolean,\n\t\tupdate: (e: Expression) => void,\n\t\treset: () => void,\n\t\tcontent: Content,\n\t) => {\n\n\tconst $recording = useSignal<null | (() => void)>(null)\n\n\tconst removeRecording = () => $recording(null)\n\n\tconst startRecording = () => {\n\t\tconst {dispose, schedule} = disposer()\n\t\tschedule(removeRecording)\n\t\tschedule(captureKeyChord(update, dispose))\n\t\tschedule(captureGamepadChord(update, dispose))\n\t\tschedule(capturePointerChord(update, dispose))\n\t\t$recording(dispose)\n\t}\n\n\tconst haltRecording = () => {\n\t\t$recording()?.()\n\t\tremoveRecording()\n\t}\n\n\tfunction toggleRecording() {\n\t\tif ($recording()) haltRecording()\n\t\telse startRecording()\n\t}\n\n\tfunction haltAndReset() {\n\t\thaltRecording()\n\t\treset()\n\t}\n\n\tuseUnmount(haltRecording)\n\n\treturn html`\n\t\t<div class=recorder ?data-recording=\"${!!$recording()}\">\n\t\t\t${content}\n\t\t\t${isReadonly ? null : html`\n\t\t\t\t<button\n\t\t\t\t\tclass=record\n\t\t\t\t\ttheme-button=naked\n\t\t\t\t\ttitle=\"record a keypress\"\n\t\t\t\t\t@click=${toggleRecording}>\n\t\t\t\t\t${$recording()\n\t\t\t\t\t\t? crossSvg\n\t\t\t\t\t\t: keyCapSvg}\n\t\t\t\t</button>\n\n\t\t\t\t<button\n\t\t\t\t\ttheme-button=naked\n\t\t\t\t\ttitle=\"reset to default\"\n\t\t\t\t\t@click=${haltAndReset}>\n\t\t\t\t\t${backspaceSvg}\n\t\t\t\t</button>\n\t\t\t`}\n\t\t</div>\n\t`\n})\n\n", "\nimport {html} from \"lit\"\nimport {Content, lightView} from \"@e280/sly\"\nimport {isArray, isHappy, isNumber, isString} from \"@e280/stz\"\n\nimport {Expression} from \"../../../../input/expression.js\"\nimport xSmallSvg from \"../../../icons/akar/x-small.svg.js\"\n\nexport const ExpressionView = lightView((\n\t\tisReadonly: boolean,\n\t\texpression: Expression,\n\t\tupdate: (expression: Expression) => void,\n\t): Content => {\n\n\tif (!isHappy(expression))\n\t\treturn html`\n\t\t\t<div class=null>unset</div>\n\t\t`\n\n\tif (isNumber(expression))\n\t\treturn html`\n\t\t\t<div class=number>\n\t\t\t\t<input\n\t\t\t\t\ttype=number\n\t\t\t\t\tstep=any\n\t\t\t\t\ttheme-input\n\t\t\t\t\t.value=\"${expression}\"\n\t\t\t\t\t?readonly=\"${isReadonly}\"\n\t\t\t\t\t@change=\"${(event: Event) => {\n\t\t\t\t\t\tconst input = event.currentTarget as HTMLInputElement\n\t\t\t\t\t\tconst value = input.valueAsNumber\n\t\t\t\t\t\tif (Number.isFinite(value))\n\t\t\t\t\t\t\tupdate(value)\n\t\t\t\t\t}}\"\n\t\t\t\t\t/>\n\t\t\t</div>\n\t\t`\n\n\tif (isString(expression))\n\t\treturn html`\n\t\t\t<input\n\t\t\t\ttype=text\n\t\t\t\ttheme-input\n\t\t\t\t.value=\"${expression}\"\n\t\t\t\t?readonly=\"${isReadonly}\"\n\t\t\t\t@change=\"${(event: Event) => {\n\t\t\t\tconst input = event.currentTarget as HTMLInputElement\n\t\t\t\tconst value = input.value\n\t\t\t\tupdate(value)\n\t\t\t}}\"/>\n\t\t`\n\n\tif (isArray(expression))\n\t\treturn (expression[0] === \"mod\") ? html`\n\t\t\t<div class=\"bracket mod\">\n\t\t\t\t${expression.slice(1).length === 0\n\t\t\t\t\t? \"unmodified\"\n\t\t\t\t\t: expression.slice(1).join(\"+\")}\n\n\t\t\t\t${!isReadonly && expression.slice(1).length > 0\n\t\t\t\t\t? html`\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttheme-button=naked\n\t\t\t\t\t\t\t@click=\"${() => update([expression[0]])}\">\n\t\t\t\t\t\t\t${xSmallSvg}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t`\n\t\t\t\t\t: null}\n\t\t\t</div>\n\t\t` : html`\n\t\t\t<div class=bracket>\n\t\t\t\t${expression[0] === \"*\" ? null : html`\n\t\t\t\t\t<strong>${expression[0]}</strong>\n\t\t\t\t`}\n\t\t\t\t${expression.slice(1).map((e, i) => {\n\t\t\t\t\treturn ExpressionView(isReadonly, e ?? null, fresh => {\n\t\t\t\t\t\tconst clone = structuredClone(expression) as any\n\t\t\t\t\t\tclone[i + 1] = fresh\n\t\t\t\t\t\tupdate(clone)\n\t\t\t\t\t})\n\t\t\t\t})}\n\t\t\t</div>\n\t\t`\n\n\telse\n\t\tthrow new Error(\"unknown expression\")\n})\n\n", "\nimport {html} from \"lit\"\nimport {Content} from \"@e280/sly\"\nimport {Bindings} from \"../../../../input/types.js\"\nimport {RecorderView} from \"../subviews/recorder.js\"\nimport {ExpressionView} from \"../subviews/expression.js\"\nimport {isExpression} from \"../../../../input/investigate/is-expression.js\"\n\nexport function renderBindings(\n\t\tisReadonly: boolean,\n\t\tbindings: Bindings,\n\t\toriginal: Bindings,\n\t\tupdate: (b: Bindings) => void,\n\t): Content {\n\n\tif (isExpression(bindings))\n\t\treturn ExpressionView(isReadonly, bindings, update)\n\n\treturn Object.entries(bindings).map(([key, child]) => (\n\t\tisExpression(child)\n\t\t\t? renderExpression(isReadonly, bindings, original as any, update, key)\n\t\t\t: renderGroup(isReadonly, bindings, original as any, update, key)\n\t))\n}\n\nfunction renderGroup(\n\t\tisReadonly: boolean,\n\t\tbindings: Record<string, Bindings>,\n\t\toriginal: Record<string, Bindings>,\n\t\tupdate: (b: Bindings) => void,\n\t\tkey: string,\n\t) {\n\n\treturn html`\n\t\t<details class=group open>\n\t\t\t<summary>${key}</summary>\n\t\t\t<div class=children>\n\t\t\t\t${renderBindings(\n\t\t\t\t\tisReadonly,\n\t\t\t\t\tbindings[key],\n\t\t\t\t\toriginal[key],\n\t\t\t\t\tfresh => update({...bindings, [key]: fresh}),\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</details>\n\t`\n}\n\nfunction renderExpression(\n\t\tisReadonly: boolean,\n\t\tbindings: Record<string, Bindings>,\n\t\toriginal: Record<string, Bindings>,\n\t\tupdate: (b: Bindings) => void,\n\t\tkey: string,\n\t) {\n\n\tconst up = (fresh: Bindings) => update({...bindings, [key]: fresh})\n\tconst reset = () => up(original[key])\n\n\treturn html`\n\t\t<div class=expression>\n\t\t\t<strong>${key}</strong>\n\t\t\t${RecorderView(isReadonly, up, reset, renderBindings(isReadonly, bindings[key], original[key], up))}\n\t\t</div>\n\t`\n}\n\n", "\nimport {html} from \"lit\"\nimport {given, when} from \"@e280/stz\"\nimport {shadowDuplex, useCss, useSignal} from \"@e280/sly\"\n\nimport styleCss from \"./style.css.js\"\nimport themeCss from \"../theme.css.js\"\n\nimport copySvg from \"../../icons/akar/copy.svg.js\"\nimport trashCanSvg from \"../../icons/akar/trash-can.svg.js\"\n\nimport {Bindings} from \"../../../input/types.js\"\nimport {makeId} from \"../../../utils/make-id.js\"\nimport {Controls} from \"../../deck/controls/controls.js\"\nimport {renderBindings} from \"./parts/render-bindings.js\"\nimport {ProfileSelectView} from \"../profile-select/view.js\"\n\nexport const [CustomizeView, makeCustomizeElement] = shadowDuplex((options: {controls: Controls}) => {\n\tuseCss(themeCss, styleCss)\n\tconst {controls, controls: {profiles}} = options\n\tconst $profileKey = useSignal(controls.fallbackProfileKey)\n\n\tconst profile = profiles.get($profileKey())\n\tconst isReadonly = profiles.isPreset($profileKey())\n\n\tconst baseline = profile.basedOn\n\t\t? profiles.get(profile.basedOn)\n\t\t: profile\n\n\tconst updateBindings = async(bindings: Bindings) => {\n\t\tlet key = $profileKey()\n\n\t\tif (profiles.isPreset(key)) {\n\t\t\tconst basedOn = key\n\t\t\tconst freshKey = makeId()\n\t\t\tkey = freshKey\n\t\t\tawait profiles.clone(freshKey, basedOn)\n\t\t}\n\n\t\tawait profiles.update(key, {bindings})\n\t\t$profileKey(key)\n\t}\n\n\tconst updateLabel = (profileKey: string, label: string) =>\n\t\tprofiles.update(profileKey, {label})\n\n\tconst clone = () => {\n\t\tconst key = makeId()\n\t\tprofiles.clone(key, $profileKey())\n\t\t$profileKey.set(key)\n\t}\n\n\tconst destroy = () => {\n\t\tprofiles.delete($profileKey())\n\t\t$profileKey(controls.fallbackProfileKey)\n\t}\n\n\treturn html`\n\t\t<div class=plate theme-card>\n\t\t\t<header class=topbar>\n\t\t\t\t<div class=corner>\n\t\t\t\t\t${ProfileSelectView(options, $profileKey(), $profileKey)}\n\n\t\t\t\t\t<button title=\"copy this profile\" theme-button=naked @click=\"${clone}\">\n\t\t\t\t\t\t${copySvg}\n\t\t\t\t\t</button>\n\n\t\t\t\t\t${isReadonly ? null : html`\n\t\t\t\t\t\t<button title=\"delete this profile\" theme-button=naked @click=\"${destroy}\">\n\t\t\t\t\t\t\t${trashCanSvg}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t`}\n\n\t\t\t\t\t${when(isReadonly, () => html`<small>readonly</small>`)}\n\t\t\t\t\t${given(profile.basedOn, basedOn => html`<small>based on ${profiles.get(basedOn).label}</small>`)}\n\t\t\t\t</div>\n\n\t\t\t\t<div class=tools>\n\t\t\t\t\t${isReadonly ? null : html`\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\ttype=text\n\t\t\t\t\t\t\ttheme-input\n\t\t\t\t\t\t\t.value=\"${profile.label}\"\n\t\t\t\t\t\t\t@change=\"${(event: Event) => {\n\t\t\t\t\t\t\t\tconst input = event.currentTarget as HTMLInputElement\n\t\t\t\t\t\t\t\tupdateLabel($profileKey(), input.value)\n\t\t\t\t\t\t\t}}\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t`}\n\t\t\t\t</div>\n\t\t\t</header>\n\n\t\t\t<div class=bindings>\n\t\t\t\t${renderBindings(\n\t\t\t\t\tfalse,\n\t\t\t\t\tprofile.bindings,\n\t\t\t\t\tbaseline.bindings,\n\t\t\t\t\tupdateBindings,\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t`\n})\n\n", "\nimport {html} from \"lit\"\nimport {ShinyTabs, TabsControl} from \"@e280/shiny\"\nimport {shadowDuplex, useCss, useOnce} from \"@e280/sly\"\n\nimport styleCss from \"./style.css.js\"\nimport themeCss from \"../theme.css.js\"\nimport gameControllerSvg from \"../../icons/akar/game-controller.svg.js\"\nimport settingsHorizontalSvg from \"../../icons/akar/settings-horizontal.svg.js\"\n\nimport {Deck} from \"../../deck/types.js\"\nimport {ControllersView} from \"../controllers/view.js\"\nimport {CustomizeView} from \"../customize/view.js\"\n\nexport const [DeckView, makeDeckElement] = shadowDuplex((deck: Deck) => {\n\tuseCss(themeCss, styleCss)\n\n\tconst attrs = {slot: \"panel\"}\n\tconst tabsControl = useOnce(() => new TabsControl())\n\n\t// TODO remove this\n\tuseOnce(() => {\n\t\tif (window.location.hash.includes(\"bindings\"))\n\t\t\ttabsControl.setIndex(1)\n\t})\n\n\treturn html`\n\t\t<div class=deck theme-card>\n\t\t\t${ShinyTabs.with({\n\t\t\t\tprops: [{control: tabsControl}],\n\t\t\t\tchildren: html`\n\t\t\t\t\t<button theme-button>\n\t\t\t\t\t\t${gameControllerSvg}\n\t\t\t\t\t\t<span>controllers</span>\n\t\t\t\t\t</button>\n\n\t\t\t\t\t<button theme-button>\n\t\t\t\t\t\t${settingsHorizontalSvg}\n\t\t\t\t\t\t<span>customize</span>\n\t\t\t\t\t</button>\n\n\t\t\t\t\t${ControllersView.with({attrs, props: [deck]})}\n\t\t\t\t\t${CustomizeView.with({attrs, props: [deck]})}\n\t\t\t\t`,\n\t\t\t})}\n\t\t</div>\n\t`\n})\n\n", "\nimport {css} from \"lit\"\nexport default css`@layer view {\n\n:host {\n\tdisplay: block;\n}\n\noutput {\n\topacity: 0.5;\n\tdisplay: block;\n\n\tfont-size: 1em;\n\theight: 8em;\n\n\toverflow: hidden;\n\toverflow-wrap: anywhere;\n\n\tfont-family: monospace;\n\tcolor: var(--prime);\n\ttext-overflow: ellipsis;\n}\n\n}`\n\n", "\nimport {html} from \"lit\"\nimport {shadowDuplex, useCss} from \"@e280/sly\"\n\nimport styleCss from \"./style.css.js\"\nimport themeCss from \"../theme.css.js\"\nimport {Visualizer} from \"./visualizer.js\"\n\nexport const [VisualizerView, makeVisualizerElement] = shadowDuplex((visualizer: Visualizer) => {\n\tuseCss(themeCss, styleCss)\n\n\treturn html`\n\t\t<slot></slot>\n\t\t<output class=viz>${visualizer.$hex()}</output>\n\t`\n})\n\n", "\nimport {svg} from \"lit\"\nexport default svg`<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"ai ai-Devices\"><path d=\"M10 15H4V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v2\"/><path d=\"M2 18h12\"/><path d=\"M14 9.2c0-.663.597-1.2 1.333-1.2h5.334C21.403 8 22 8.537 22 9.2v9.6c0 .663-.597 1.2-1.333 1.2h-5.334C14.597 20 14 19.463 14 18.8V9.2z\"/><path d=\"M18 17h.01\"/></svg>`\n\n", "\nimport {disposer} from \"@e280/stz\"\nimport {register} from \"@e280/sly\"\n\nimport {setupDeck} from \"./deck.js\"\nimport {SetupParams} from \"./types.js\"\nimport {Bindings} from \"../../../input/types.js\"\nimport {autoGamepads} from \"../auto-gamepads.js\"\nimport {ellipsis} from \"../../../utils/ellipsis.js\"\nimport {firstPreset} from \"../utils/first-preset.js\"\nimport {Controller} from \"../../../input/controller.js\"\nimport {Sources} from \"../../../input/sources/sources.js\"\nimport {Visualizer} from \"../../views/visualizer/visualizer.js\"\nimport {PointerSource} from \"../../../input/sources/pointer.js\"\nimport {KeyboardSource} from \"../../../input/sources/keyboard.js\"\n\nimport {makeDeckElement} from \"../../views/deck/view.js\"\nimport {makeCustomizeElement} from \"../../views/customize/view.js\"\nimport {makeVisualizerElement} from \"../../views/visualizer/view.js\"\nimport {makeControllersElement} from \"../../views/controllers/view.js\"\n\nimport devicesSvg from \"../../icons/akar/devices.svg.js\"\nimport gameControllerSvg from \"../../icons/akar/game-controller.svg.js\"\n\nexport async function setupTact<B extends Bindings>(params: SetupParams<B>) {\n\tconst {dispose, schedule, disposable} = disposer()\n\n\tconst deck = disposable(await setupDeck(params))\n\tconst first = firstPreset(deck.controls.presets)\n\tconst visualizer = new Visualizer()\n\n\tconst elements = {\n\t\tTactDeck: makeDeckElement(deck),\n\t\tTactCustomize: makeCustomizeElement(deck),\n\t\tTactControllers: makeControllersElement(deck),\n\t\tTactVisualizer: makeVisualizerElement(visualizer),\n\t}\n\n\tfunction gamepads(defaultProfileKey?: string) {\n\t\tconst stop = autoGamepads(deck.hub, (controller, source) => {\n\t\t\tconst handle = `${source.pad.gamepad.id} ${source.pad.gamepad.index + 1}`\n\t\t\tdeck.controls.attach(controller, {\n\t\t\t\ticon: gameControllerSvg,\n\t\t\t\thandle,\n\t\t\t\ttooltip: handle,\n\t\t\t\tname: ellipsis(handle, 32),\n\t\t\t\tdefaultProfileKey: defaultProfileKey ?? first.key,\n\t\t\t})\n\t\t\treturn () => deck.controls.detach(controller)\n\t\t})\n\t\tschedule(stop)\n\t\treturn stop\n\t}\n\n\tfunction mouseKeyboard() {\n\t\tconst {key, profile} = first\n\n\t\tconst controller = disposable(new Controller({\n\t\t\tbindings: profile.bindings,\n\t\t\tsource: disposable(new Sources(\n\t\t\t\tdisposable(new KeyboardSource()),\n\t\t\t\tdisposable(new PointerSource()),\n\t\t\t)),\n\t\t}))\n\n\t\tdeck.hub.plug(controller)\n\n\t\tdeck.controls.attach(controller, {\n\t\t\ticon: devicesSvg,\n\t\t\thandle: \"standard\",\n\t\t\tname: \"mouse/keyboard\",\n\t\t\ttooltip: \"\",\n\t\t\tdefaultProfileKey: key,\n\t\t})\n\n\t\tschedule(() => {\n\t\t\tdeck.hub.remove(controller)\n\t\t\tdeck.controls.detach(controller)\n\t\t})\n\n\t\treturn controller\n\t}\n\n\tfunction registerElements() {\n\t\tregister(elements)\n\t}\n\n\treturn {\n\t\tdeck,\n\t\tgamepads,\n\t\tmouseKeyboard,\n\t\tvisualizer,\n\t\telements,\n\t\tregisterElements,\n\t\tencodeAll: deck.hub.encodeAll.bind(deck.hub),\n\t\tdispose,\n\t}\n}\n\n", "\nimport {dom} from \"@e280/sly\"\nimport {cycle, nap} from \"@e280/stz\"\nimport {presets} from \"./presets.js\"\nimport {setupTact} from \"../lib/ui/deck/setup/tact.js\"\n\nconst tact = await setupTact({presets, maxPlayers: 4})\ntact.mouseKeyboard()\ntact.gamepads(\"gamer\")\ntact.registerElements()\n\ncycle(async() => {\n\tconst data = tact.deck.hub.encodeAll()\n\ttact.visualizer.update(data)\n\tawait nap(1000 / 60)\n})\n\n{\n\tconst input = dom<HTMLInputElement>('input[type=\"color\"]')\n\tinput.value = \"#ffbb00\"\n\tinput.oninput = () => document.body.style.setProperty(\"--tact-prime\", input.value)\n}\n\n"],
|
|
5
|
+
"mappings": "6FAEM,SAAUA,GAAQC,EAAa,CACpC,OAAOA,EAAM,QAAQ,uBAAwB,KAAK,EAAE,YAAW,CAChE,CCIM,SAAUC,GAAuCC,EAAaC,EAQ/D,CAAA,EAAE,CAEN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ACN3d,GAAM4d,GACN3d,GAAM4d,GACN3d,GAAM4d,GACN3d,GAAM4d,GACN3d,GAAM4d,GACN3d,GAAM4d,GACN3d,GAAM4d,GACN3d,GAAM4d,GACZ,GAAQte,KAAS,EAAO/E,IAAQ,EAAM,EAAI,CACtC+hB,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACN,SAASid,CACb,CACAX,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACN,MAAMid,CACV,CACA,IAAMte,GAAM2d,GACN1d,GAAM2d,GACN1d,GAAM2d,GACN1d,GAAM2d,GACN1d,GAAM2d,GACN1d,GAAM2d,GACN1d,GAAM2d,GACN1d,GAAM2d,GACN1d,GAAM2d,GACN1d,GAAM2d,GACN1d,GAAM2d,GACZrB,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,GACNid,GAAMhd,EACV,CACA,IAAMrB,GAAM2d,GACN1d,GAAM2d,GACN1d,GAAM2d,GACN1d,GAAM2d,GACN1d,GAAM2d,GACN1d,GAAM2d,GACN1d,GAAM2d,GACN1d,GAAM2d,GACN1d,GAAM2d,GACN1d,GAAM2d,GACN1d,GAAM2d,GACZ1B,GAAK3c,GACL4c,GAAK3c,GACL6c,GAAK5c,GACL6c,GAAK5c,GACL6c,GAAK5c,GACL8c,GAAK7c,GACL8c,GAAM7c,GACN8c,GAAM7c,GACNgd,GAAM/c,GACNgd,GAAM/c,GACNgd,GAAM/c,EACV,CACA,IAAM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AMqH,GACNpH,GAAM7d,GACN8d,GAAM7d,GACN8d,GAAM7d,GACN8d,GAAM7d,GACN8d,GAAM7d,GACN8d,GAAM7d,GACN8d,GAAM7d,GACN8d,GAAM7d,GACN,SAASoe,CACb,CACAf,GAAMqH,GACNpH,GAAM7d,GACN8d,GAAM7d,GACN8d,GAAM7d,GACN8d,GAAM7d,GACN8d,GAAM7d,GACN8d,GAAM7d,GACN8d,GAAM7d,GACN8d,GAAM7d,GACN,MAAMoe,CACV,CACA,IAAMrf,GAAMse,GACNre,GAAMse,GACNre,GAAMse,GACNre,GAAMse,GACNre,GAAMse,GACNre,GAAMse,GACNre,GAAMse,GACNre,GAAMse,GACNre,GAAMse,GACZlB,GAAM5d,GACN6d,GAAM5d,GACN8d,GAAM7d,GACN8d,GAAM7d,GACN8d,GAAM7d,GACN8d,GAAM7d,GACN8d,GAAM7d,GACN8d,GAAM7d,GACN8d,GAAM7d,EACV,CACA,IAAMjB,GAAMqe,GACNpe,GAAMqe,GACNpe,GAAMse,GACNre,GAAMse,GACNre,GAAMse,GACNre,GAAMse,GACNre,GAAMse,GACNre,GAAMse,GACNre,GAAMse,GACZtB,EAAKxd,GACLyd,EAAKxd,GACL0d,EAAKzd,GACL0d,EAAKzd,GACL0d,EAAKzd,GACL2d,EAAK1d,GACL2d,EAAM1d,GACN2d,EAAM1d,GACN6d,GAAM5d,EACV,CACA,IAAMhB,GAAMie,EACNhe,GAAMke,EACNje,GAAMke,EACNje,GAAMke,EACNje,GAAMme,EACNle,GAAMme,EACNle,GAAMme,EACNle,GAAMqe,GACNiI,GAAS,UAAYtoB,GAAO,GAAM,EACxCf,GAAcqpB,KAAU,GAAK,IAAO,CAAC,EAAI7mB,GACzC,IAAM8mB,GAAS,EAAID,GAAQ,EAC3BrpB,GAAcspB,KAAU,GAAK,IAAO,CAAC,EAAI7mB,GACzC,IAAM8mB,GAAS,EAAID,GAAQ,EAC3BtpB,GAAcupB,KAAU,GAAK,IAAO,CAAC,EAAI7mB,G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A,MAAO,CACN,KAAAN,EACA,SAAAW,EACA,cAAAS,EACA,WAAAhB,EACA,SAAAE,EACA,iBAAAsB,EACA,UAAW5B,EAAK,IAAI,UAAU,KAAKA,EAAK,GAAG,EAC3C,QAAAJ,EAEF,CC3FA,IAAMkC,GAAO,MAAMC,GAAU,CAAC,QAAAC,GAAS,WAAY,CAAC,CAAC,EACrDF,GAAK,cAAa,EAClBA,GAAK,SAAS,OAAO,EACrBA,GAAK,iBAAgB,EAErBG,GAAM,SAAU,CACf,IAAMC,EAAOJ,GAAK,KAAK,IAAI,UAAS,EACpCA,GAAK,WAAW,OAAOI,CAAI,EAC3B,MAAMC,GAAI,IAAO,EAAE,CACpB,CAAC,EAED,CACC,IAAMC,EAAQC,GAAsB,qBAAqB,EACzDD,EAAM,MAAQ,UACdA,EAAM,QAAU,IAAM,SAAS,KAAK,MAAM,YAAY,eAAgBA,EAAM,KAAK,CAClF",
|
|
6
|
+
"names": ["dashify", "camel", "register", "elements", "options", "soft", "upgrade", "name", "Element", "tag", "dashify", "already", "element", "global", "globalThis", "supportsAdoptingStyleSheets", "ShadowRoot", "ShadyCSS", "nativeShadow", "Document", "prototype", "CSSStyleSheet", "constructionToken", "Symbol", "cssTagCache", "WeakMap", "CSSResult", "cssText", "strings", "safeToken", "this", "Error", "_strings", "styleSheet", "_styleSheet", "cacheable", "length", "get", "replaceSync", "set", "toString", "unsafeCSS", "value", "String", "css", "values", "reduce", "acc", "v", "idx", "adoptStyles", "renderRoot", "styles", "adoptedStyleSheets", "map", "s", "style", "document", "createElement", "nonce", "setAttribute", "textContent", "appendChild", "getCompatibleStyle", "sheet", "rule", "cssRules", "is", "defineProperty", "getOwnPropertyDescriptor", "getOwnPropertyNames", "getOwnPropertySymbols", "getPrototypeOf", "Object", "global", "globalThis", "trustedTypes", "emptyStringForBooleanAttribute", "emptyScript", "polyfillSupport", "reactiveElementPolyfillSupport", "JSCompiler_renameProperty", "prop", "_obj", "defaultConverter", "value", "type", "Boolean", "Array", "JSON", "stringify", "fromValue", "Number", "parse", "e", "notEqual", "old", "defaultPropertyDeclaration", "attribute", "String", "converter", "reflect", "useDefault", "hasChanged", "Symbol", "metadata", "litPropertyMetadata", "WeakMap", "ReactiveElement", "HTMLElement", "initializer", "this", "__prepare", "_initializers", "push", "observedAttributes", "finalize", "__attributeToPropertyMap", "keys", "name", "options", "state", "prototype", "hasOwnProperty", "create", "wrapped", "elementProperties", "set", "noAccessor", "key", "descriptor", "getPropertyDescriptor", "get", "v", "oldValue", "call", "requestUpdate", "configurable", "enumerable", "superCtor", "Map", "finalized", "props", "properties", "propKeys", "p", "createProperty", "attr", "__attributeNameForProperty", "elementStyles", "finalizeStyles", "styles", "isArray", "Set", "flat", "Infinity", "reverse", "s", "unshift", "getCompatibleStyle", "toLowerCase", "constructor", "super", "__instanceProperties", "isUpdatePending", "hasUpdated", "__reflectingProperty", "__initialize", "__updatePromise", "Promise", "res", "enableUpdating", "_$changedProperties", "__saveInstanceProperties", "forEach", "i", "controller", "__controllers", "add", "renderRoot", "isConnected", "hostConnected", "delete", "instanceProperties", "size", "createRenderRoot", "shadowRoot", "attachShadow", "shadowRootOptions", "adoptStyles", "connectedCallback", "c", "_requestedUpdate", "disconnectedCallback", "hostDisconnected", "_old", "_$attributeToProperty", "attrValue", "toAttribute", "removeAttribute", "setAttribute", "ctor", "propName", "getPropertyOptions", "fromAttribute", "convertedValue", "__defaultValues", "useNewValue", "newValue", "hasAttribute", "_$changeProperty", "__enqueueUpdate", "initializeValue", "has", "__reflectingProperties", "reject", "result", "scheduleUpdate", "performUpdate", "shouldUpdate", "changedProperties", "willUpdate", "hostUpdate", "update", "__markUpdated", "_$didUpdate", "_changedProperties", "hostUpdated", "firstUpdated", "updated", "updateComplete", "getUpdateComplete", "__propertyToAttribute", "mode", "reactiveElementVersions", "global", "globalThis", "wrap", "node", "trustedTypes", "policy", "createPolicy", "createHTML", "s", "boundAttributeSuffix", "marker", "Math", "random", "toFixed", "slice", "markerMatch", "nodeMarker", "d", "document", "createMarker", "createComment", "isPrimitive", "value", "isArray", "Array", "isIterable", "Symbol", "iterator", "SPACE_CHAR", "textEndRegex", "commentEndRegex", "comment2EndRegex", "tagEndRegex", "RegExp", "singleQuoteAttrEndRegex", "doubleQuoteAttrEndRegex", "rawTextElement", "tag", "type", "strings", "values", "_$litType$", "html", "svg", "mathml", "noChange", "for", "nothing", "templateCache", "WeakMap", "walker", "createTreeWalker", "trustFromTemplateString", "tsa", "stringFromTSA", "hasOwnProperty", "Error", "getTemplateHtml", "l", "length", "attrNames", "rawTextEndRegex", "regex", "i", "attrName", "match", "attrNameEndIndex", "lastIndex", "exec", "test", "end", "startsWith", "push", "Template", "constructor", "options", "this", "parts", "nodeIndex", "attrNameIndex", "partCount", "el", "createElement", "currentNode", "content", "wrapper", "firstChild", "replaceWith", "childNodes", "nextNode", "nodeType", "hasAttributes", "name", "getAttributeNames", "endsWith", "realName", "statics", "getAttribute", "split", "m", "index", "ctor", "PropertyPart", "BooleanAttributePart", "EventPart", "AttributePart", "removeAttribute", "tagName", "textContent", "emptyScript", "append", "data", "indexOf", "_options", "innerHTML", "resolveDirective", "part", "parent", "attributeIndex", "currentDirective", "__directives", "__directive", "nextDirectiveConstructor", "_$initialize", "_$resolve", "TemplateInstance", "template", "_$parts", "_$disconnectableChildren", "_$template", "_$parent", "parentNode", "_$isConnected", "fragment", "creationScope", "importNode", "partIndex", "templatePart", "ChildPart", "nextSibling", "ElementPart", "_$setValue", "__isConnected", "startNode", "endNode", "_$committedValue", "_$startNode", "_$endNode", "isConnected", "directiveParent", "_$clear", "_commitText", "_commitTemplateResult", "_commitNode", "_commitIterable", "insertBefore", "_insert", "createTextNode", "result", "_$getTemplate", "h", "_update", "instance", "_clone", "get", "set", "itemParts", "itemPart", "item", "start", "from", "_$notifyConnectionChanged", "n", "remove", "element", "fill", "String", "valueIndex", "noCommit", "change", "v", "_commitValue", "setAttribute", "toggleAttribute", "super", "newListener", "oldListener", "shouldRemoveListener", "capture", "once", "passive", "shouldAddListener", "removeEventListener", "addEventListener", "event", "call", "host", "handleEvent", "_$LH", "_boundAttributeSuffix", "_marker", "_markerMatch", "_HTML_RESULT", "_getTemplateHtml", "_TemplateInstance", "_isIterable", "_resolveDirective", "_ChildPart", "_AttributePart", "_BooleanAttributePart", "_EventPart", "_PropertyPart", "_ElementPart", "polyfillSupport", "litHtmlPolyfillSupport", "litHtmlVersions", "render", "container", "partOwnerNode", "renderBefore", "global", "globalThis", "LitElement", "ReactiveElement", "constructor", "this", "renderOptions", "host", "__childPart", "createRenderRoot", "renderRoot", "super", "renderBefore", "firstChild", "changedProperties", "value", "render", "hasUpdated", "isConnected", "update", "connectedCallback", "setConnected", "disconnectedCallback", "noChange", "litElementHydrateSupport", "polyfillSupport", "litElementPolyfillSupport", "global", "litElementVersions", "push", "attrGet", "e", "key", "raw", "attrSet", "value", "element", "entries", "record", "el", "tagName", "attrs", "element", "attrSet", "mk", "template", "fragment", "D", "eve", "target", "events", "detachers", "eventName", "handler", "options", "fn", "d", "onAttrs", "element", "fn", "observer", "AttrProxies", "element", "_t", "key", "attrGet", "value", "attrSet", "attrSpec", "e", "spec", "options", "_target", "key", "attrGet", "value", "attrSet", "attrs", "element", "proxies", "AttrProxies", "fn", "onAttrs", "spec", "options", "attrSpec", "attrGet", "attrSet", "elmer", "tagName", "Elmer", "#attrs", "#children", "key", "value", "record", "elements", "element", "attrSet", "queryRequire", "selector", "container", "queryMaybe", "queryAll", "Dom", "_Dom", "#attrs", "element", "selectorOrElement", "queryRequire", "selector", "queryMaybe", "queryAll", "content", "D", "attrs", "spec", "eve", "dom", "selector", "container", "queryRequire", "selectorOrElement", "Dom", "queryMaybe", "queryAll", "el", "elmer", "mk", "eve", "attrs", "register", "content", "D", "index_barrel_exports", "__export", "DragAndDrops", "Drops", "files", "hasFiles", "outsideCurrentTarget", "bytes", "a", "b", "diff", "i", "count", "parts", "size", "part", "offset", "BaseX", "lexicon", "char", "i", "fn", "s", "bitsPerChar", "bitBuffer", "bitCount", "output", "val", "num", "base", "zeroCharacter", "leadingZeroBytes", "out", "writeIndex", "bytes", "byte", "index", "n", "negative", "value", "count", "hex", "BaseX", "base2", "base36", "base58", "base62", "base64", "base64url", "fromBytes", "bytes", "toBytes", "string", "txt", "debounce", "delay", "action", "latestArgs", "timeout", "waitingQueue", "reset", "args", "promise", "resolve", "reject", "r", "err", "defer", "resolve", "reject", "promise", "res", "rej", "other", "microbounce", "fn", "scheduled", "params", "defer", "deferred", "deepClone", "data", "refs", "copy", "d", "key", "val", "isHappy", "x", "isNumber", "x", "isString", "isObject", "x", "isArray", "happy", "x", "sad", "is", "deepEqual", "alpha", "bravo", "recurse", "parents", "isObject", "newParents", "key", "val", "item", "bItem", "keys1", "keys2", "deepFreeze", "item", "recurse", "x", "parents", "isObject", "newParents", "arr", "y", "gotOk", "result", "error", "gotErr", "got", "thing", "err", "guarantee", "map", "key", "make", "value", "setEntries", "entries", "arraylimit", "array", "limit", "collect", "iterable", "array", "item", "cycle", "fn", "timeout", "stopped", "stop", "tick", "dataViewFrom", "array", "disposer", "fns", "dispose", "doomed", "i", "d", "newFns", "x", "fn", "ev", "target", "fns", "entries", "name", "fn", "IdCounter", "count", "nap", "milliseconds", "resolve", "obmap", "transform", "key", "value", "obfilter", "predicate", "ob", "obMap", "obFilter", "o", "subby", "fn", "tools", "mk", "mk", "set", "waiter", "next", "defer", "resolveWaiter", "p", "ready", "fn", "templateString", "strings", "values", "lastIndex", "a", "b", "c", "when", "x", "yes", "no", "given", "isHappy", "Tracker", "#busy", "#observationLayers", "#subscriptions", "#batchDepth", "#batchPending", "item", "fns", "fn", "#flush", "seen", "value", "guarantee", "#run", "pending", "tracker", "Tracker", "signal", "value", "on", "sig", "tracker", "fn", "subby", "RMap", "tracker", "callbackFn", "key", "value", "ret", "RSet", "tracker", "callbackFn", "value", "item", "ret", "batch", "tracker", "immute", "s", "deepFreeze", "deepClone", "_optic", "CacheCell", "#dirty", "#value", "calculate", "Lens", "_Lens", "_optic", "#previous", "#stateCache", "#frozenCache", "#on", "subby", "optic", "deepClone", "CacheCell", "immute", "state", "deepEqual", "tracker", "fn", "selector", "lens", "waitGot", "wait", "gotOk", "waitGotErr", "wait", "gotErr", "isWaitPending", "state", "isWaitOk", "state", "waitSelect", "state", "select", "pending", "ok", "err", "isWaitPending", "isWaitOk", "waitGot", "waitGotErr", "hasFiles", "event", "files", "outsideCurrentTarget", "currentTarget", "relatedTarget", "DragAndDrops", "signal", "params", "getDraggy", "_", "getDroppy", "event", "outsideCurrentTarget", "acceptDrop", "draggy", "droppy", "Drops", "signal", "params", "event", "outsideCurrentTarget", "cssReset", "i", "SlyShadow", "_SlyShadow", "dom", "LightCx", "defer", "render", "ShadowCx", "host", "shadow", "Hooks", "#scopes", "scope", "position", "fn", "hooks", "Reactivity", "#stoppers", "stop", "fn", "rerender", "seen", "value", "tracker", "item", "Mounts", "#mounters", "#unmounters", "mount", "unmount", "Hookscope", "Mounts", "cx", "_ChildPart", "ChildPart", "_$LH", "isSingleExpression", "part", "strings", "PartType", "ATTRIBUTE", "CHILD", "PROPERTY", "BOOLEAN_ATTRIBUTE", "EVENT", "ELEMENT", "directive", "c", "values", "_$litDirective$", "Directive", "_partInfo", "_$isConnected", "this", "_$parent", "part", "parent", "attributeIndex", "__part", "__attributeIndex", "props", "update", "_part", "render", "notifyChildrenConnectedChanged", "parent", "isConnected", "children", "_$disconnectableChildren", "obj", "removeDisconnectableFromParent", "_$parent", "delete", "size", "addDisconnectableToParent", "Set", "has", "add", "installDisconnectAPI", "reparentDisconnectables", "newParent", "this", "notifyChildPartConnectedChanged", "isClearingValue", "fromPartIndex", "value", "_$committedValue", "Array", "isArray", "i", "length", "type", "PartType", "CHILD", "_$notifyConnectionChanged", "_$reparentDisconnectables", "AsyncDirective", "Directive", "constructor", "part", "attributeIndex", "super", "_$initialize", "_$isConnected", "isClearingDirective", "reconnected", "disconnected", "isSingleExpression", "__part", "_$setValue", "newValues", "__attributeIndex", "lightView", "view", "e", "f", "#props", "#cx", "LightCx", "microbounce", "content", "#hookscope", "Hookscope", "#reactivity", "Reactivity", "part", "props", "ret", "hooks", "applyAttrs", "element", "attrs", "name", "value", "applyAttr", "existing", "v", "coerce", "shadowSetup", "SlyShadow", "host", "shadow", "shadowView", "view", "rawShadow", "setup", "directiveFn", "e", "f", "#cx", "#hookscope", "#props", "#reactivity", "Reactivity", "part", "rerender", "microbounce", "content", "#renderContent", "D", "ShadowCx", "Hookscope", "props", "hooks", "children", "attrs", "applyAttrs", "shadowElement", "view", "#cx", "#hookscope", "#reactivity", "Reactivity", "#shadow", "rerender", "microbounce", "content", "#renderContent", "D", "ShadowCx", "Hookscope", "hooks", "shadowDuplex", "render", "shadowView", "p", "shadowElement", "useOnce", "fn", "scope", "position", "hooks", "guarantee", "useCx", "hooks", "useShadowCx", "cx", "useCx", "ShadowCx", "useHost", "useShadowCx", "useMount", "fn", "scope", "hooks", "useOnce", "useShadow", "useShadowCx", "applyStyles", "shadow", "styles", "S", "prepareStyles", "elementStyles", "set", "c", "useCss", "styles", "shadow", "useShadow", "useOnce", "applyStyles", "useName", "name", "host", "useHost", "useOnce", "useSignal", "value", "useOnce", "signal", "useStyles", "useCss", "useUnmount", "fn", "useMount", "makeAsciiAnim", "hz", "frames", "AsciiAnim", "shadowView", "useName", "useStyles", "cssReset", "style", "$frame", "useSignal", "useMount", "cycle", "nap", "next", "i", "ErrorDisplay", "shadowView", "error", "useName", "useStyles", "cssReset", "style", "b", "i", "makeSpinner", "pending", "err", "wait", "ok", "waitSelect", "dotsSpinner", "makeSpinner", "makeAsciiAnim", "ErrorDisplay", "earthSpinner", "makeSpinner", "makeAsciiAnim", "ErrorDisplay", "moonSpinner", "makeSpinner", "makeAsciiAnim", "ErrorDisplay", "spinner", "makeSpinner", "makeAsciiAnim", "ErrorDisplay", "waveSpinner", "makeSpinner", "makeAsciiAnim", "ErrorDisplay", "asBindings", "bindings", "asDeck", "deck", "asPresets", "presets", "bindings", "asBindings", "presets", "asPresets", "minihash", "hash", "encodeParcels", "parcels", "size", "total", "intents", "buffer", "view", "bytes", "cursor", "playerId", "encodeIntents", "minihash", "intents", "byteCount", "buffer", "dv", "cursor", "intent", "isLE", "assertLE", "littleEndian", "isBytes", "a", "anumber", "n", "title", "prefix", "abytes", "value", "length", "bytes", "isBytes", "len", "needsLen", "u8", "arr", "u32", "clean", "arrays", "i", "copyFast", "dst", "dstPos", "src", "srcPos", "len", "i", "copyBytes", "bytes", "abytes", "checkOpts", "defaults", "opts", "mkAsync", "cb_", "cb", "genSetup", "canReturn", "setupDone", "progressTotal", "done", "stateBytes", "state", "onSave", "_state", "onRestore", "onNextTick", "_opts", "rawOpts", "anumber", "onProgress", "inc", "callbackPer", "asyncTick", "_stateBytes", "save", "restore", "nextTick", "total", "k", "v", "needReturn", "ts", "diff", "progress", "res", "args", "setup", "g", "r", "onEnd", "setupMode", "checkParallelOutput", "opts", "count", "outputLen", "canXOF", "raw", "isBytes", "anumber", "dkLen", "i", "abytes", "out", "outPos", "slices", "pos", "BRAND", "brandSet", "mkHash", "modFn", "def_", "platform", "def", "outputLen", "blockLen", "suffix", "init", "canXOF", "oid", "outBlockLen", "hashImpl", "hashAsyncImpl", "chunksImpl", "chunksAsyncImpl", "parallelImpl", "parallelAsyncImpl", "createImpl", "cleanStateImpl", "inited", "lazyInit", "mod", "processBlocks", "processOutBlocks", "padding", "reset", "BUFFER", "STATE", "STATE_CHUNKS", "parallelChunks", "maxBlocks", "chunks", "maxOutBlocks", "prefixStates", "initHash", "opts", "batchPos", "rawOpts", "blocks", "streamOutputLen", "anumber", "i", "hash", "processMessage", "msg", "padBlocks", "pos", "take", "copyFast", "isLast", "left", "processMessages", "parts", "prefix", "cap", "prefixLen", "totalLen", "k", "idx", "off", "written", "n", "cur", "rem", "processMessageParallel", "chunkPos", "chunkLen", "msgLen", "copyLane", "dst", "lane", "j", "checkOutputOpts", "o", "bytes", "defaultLen", "raw", "abytes", "dkLen", "out", "outPos", "processOutput", "checked", "batch", "blocksTotal", "produced", "blocksLeft", "maxWritten", "takeBlocks", "emitted", "need", "takeBytes", "processOutputParallel", "outOffset", "stateBytes", "state", "isBytes", "prefixState", "StreamHash", "copyBytes", "msgPos", "msgFirstLen", "leftover", "outChecked", "res", "buf", "to", "hashSync", "chunksSync", "total", "p", "parallelSync", "maxGroups", "maxOutGroups", "groupLen", "checkParallelOutput", "t", "setupTick", "setup", "rawSetup", "_inc", "hashRun", "mkAsync", "setupMode", "tick", "chunksRun", "parallelRun", "clean", "chunksFn", "parallel", "BRAND", "brandSet", "SHA256_IV", "B3_Flags", "B3_IV", "SHA256_IV", "B3_IV_U8", "u8", "blake3", "batchPos", "_maxBlocks", "mod", "hash", "opts", "key", "context", "_keyContext", "anumber", "flags", "IV", "B3_IV_U8", "abytes", "B3_Flags", "u32", "init_module", "_imports", "pool", "_importsEmbed", "__buf", "memory", "memory_i32", "compressParents", "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", "v10", "v11", "v12", "v13", "v14", "v15", "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31", "v32", "v33", "v34", "v35", "v36", "v37", "v38", "v39", "v40", "v41", "v42", "v43", "v44", "v45", "v46", "v47", "v48", "v49", "v50", "v51", "v52", "v53", "v54", "v55", "v56", "v57", "v58", "v59", "v60", "v61", "v62", "v63", "v64", "v65", "v66", "v67", "v68", "v69", "v70", "v71", "v72", "v73", "v74", "v75", "v76", "v77", "v78", "v79", "v80", "v81", "v82", "v83", "v84", "v85", "v86", "v87", "v88", "v89", "v90", "v91", "v92", "v93", "v94", "v95", "v96", "v97", "v98", "v99", "v100", "v101", "v102", "v103", "v104", "v105", "v106", "v107", "v108", "v109", "v110", "v111", "v112", "v113", "v114", "v115", "v116", "v117", "v118", "v119", "v120", "v121", "v122", "v123", "v124", "v125", "v126", "v127", "v128", "v129", "v130", "v131", "v132", "v133", "v134", "v135", "v136", "v137", "v138", "v139", "v140", "v141", "v142", "v143", "v144", "v145", "v146", "v147", "v148", "v149", "v150", "v151", "v152", "v153", "v154", "v155", "v156", "v157", "v158", "v159", "v160", "v161", "v162", "v163", "v164", "v165", "v166", "v167", "v168", "v169", "v170", "v171", "v172", "v173", "v174", "v175", "v176", "v177", "v178", "v179", "v180", "v181", "v182", "v183", "v184", "v185", "v186", "v187", "v188", "v189", "v190", "v191", "v192", "v193", "v194", "v195", "v196", "v197", "v198", "v199", "v200", "v201", "v202", "v203", "v204", "v205", "v206", "v207", "v208", "v209", "v210", "v211", "v212", "v213", "v214", "v215", "v216", "v217", "v218", "v219", "v220", "v221", "v222", "v223", "v224", "v225", "v226", "v227", "v228", "v229", "v230", "v231", "v232", "v233", "v234", "v235", "v236", "v237", "v238", "v239", "v240", "v241", "v242", "v243", "v244", "v245", "v246", "v247", "v248", "v249", "v250", "v251", "v252", "v253", "v254", "v255", "v256", "v257", "v258", "v259", "v260", "v261", "v262", "v263", "v264", "v265", "v266", "v267", "v268", "v269", "v270", "v271", "v272", "v273", "v274", "v275", "v276", "v277", "v278", "v279", "v280", "v281", "v282", "v283", "v284", "v285", "v286", "v287", "v288", "v289", "v290", "v291", "v292", "v293", "v294", "v295", "v296", "v297", "v298", "v299", "v300", "v301", "v302", "v303", "v304", "v305", "v306", "v307", "v308", "v309", "v310", "v311", "v312", "v313", "v314", "v315", "v316", "v317", "v318", "v319", "v320", "v321", "v322", "v323", "v324", "v325", "v326", "v327", "v328", "v329", "v330", "v331", "v332", "v333", "v334", "v335", "v336", "v337", "v338", "v339", "v340", "v341", "v342", "v343", "v344", "v345", "v346", "v347", "v348", "v349", "v350", "v351", "v352", "v353", "v354", "v355", "v356", "v357", "v358", "v359", "v360", "v361", "v362", "v363", "v364", "v365", "v366", "v367", "v368", "v369", "v370", "v371", "v372", "v373", "v374", "v375", "v376", "v377", "v378", "v379", "v380", "v381", "v382", "v383", "v384", "v385", "v386", "v387", "v388", "v389", "v390", "v391", "v392", "v393", "v394", "v395", "v396", "v397", "v398", "v399", "v400", "v401", "v402", "v403", "v404", "v405", "v406", "v407", "v408", "v409", "v410", "v411", "v412", "v413", "v414", "v415", "v416", "v417", "v418", "v419", "v420", "v421", "v422", "v423", "v424", "v425", "v426", "v427", "v428", "v429", "v430", "v431", "v432", "v433", "v434", "v435", "v436", "v437", "v438", "v439", "v440", "v441", "v442", "v443", "v444", "v445", "v446", "v447", "v448", "v449", "v450", "v451", "v452", "v453", "v454", "v455", "v456", "v457", "v458", "v459", "v460", "v461", "v462", "v463", "v464", "v465", "v466", "v467", "v468", "v469", "v470", "v471", "v472", "v473", "v474", "v475", "v476", "v477", "v478", "v479", "v480", "v481", "v482", "v483", "v484", "v485", "v486", "v487", "v488", "v489", "v490", "v491", "v492", "v493", "v494", "v495", "v496", "v497", "v498", "v499", "v500", "v501", "v502", "v503", "v504", "v505", "v506", "v507", "v508", "v509", "v510", "v511", "compressParentsFull", "s0", "s1", "s2", "L0", "s3", "s4", "s5", "L1", "s6", "s7", "s8", "L2", "s9", "s10", "s11", "padding", "proccessChunksParallel", "s12", "s13", "s14", "L4", "s15", "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23", "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31", "s32", "s33", "s34", "s35", "s36", "L6", "s37", "s38", "s39", "s40", "s41", "s42", "s43", "s44", "s45", "s46", "s47", "s48", "s49", "s50", "s51", "s52", "s53", "s54", "s55", "L8", "s56", "s57", "s58", "s59", "s60", "s61", "s62", "s63", "s64", "s65", "s66", "s67", "s68", "s69", "s70", "s71", "s72", "s73", "s74", "s75", "s76", "s77", "L10", "v512", "v513", "v514", "v515", "v516", "v517", "v518", "v519", "v520", "v521", "v522", "v523", "v524", "v525", "v526", "v527", "v528", "v529", "v530", "v531", "v532", "v533", "v534", "v535", "v536", "v537", "v538", "v539", "v540", "v541", "v542", "v543", "v544", "v545", "v546", "v547", "v548", "v549", "v550", "v551", "v552", "v553", "v554", "v555", "v556", "v557", "v558", "v559", "v560", "v561", "v562", "v563", "v564", "v565", "v566", "v567", "v568", "v569", "v570", "v571", "v572", "v573", "v574", "v575", "v576", "v577", "v578", "v579", "v580", "v581", "v582", "v583", "v584", "v585", "v586", "v587", "v588", "v589", "v590", "v591", "v592", "v593", "v594", "v595", "v596", "v597", "v598", "v599", "v600", "v601", "v602", "v603", "v604", "v605", "v606", "v607", "v608", "v609", "v610", "v611", "v612", "v613", "v614", "v615", "v616", "v617", "v618", "v619", "v620", "v621", "v622", "v623", "v624", "v625", "v626", "L11", "v628", "v629", "v630", "v631", "v632", "v633", "v634", "v635", "L12", "L13", "v636", "v637", "v638", "v639", "v640", "v641", "v642", "proccessChunksSequential", "processBlocks", "L7", "L9", "L15", "L16", "L17", "L19", "L21", "L22", "processOutBlocks", "L5", "reset", "_exports", "buffer", "memoryExport", "segments", "_", "i", "_cache", "blake3", "blake3", "mkHash", "endian", "EntropyType", "hash", "entropy", "hasher", "blake3", "typeTag", "lengthTag", "lengthDataview", "dataViewFrom", "part", "bytes", "txt", "isExpression", "b", "isString", "isNumber", "isArray", "hashBindings", "bindings", "paths", "recurse", "b", "path", "isExpression", "key", "value", "hex", "hash", "Hub", "#minihash", "#ids", "IdCounter", "#unassigned", "RSet", "#players", "RMap", "bindings", "minihash", "hashBindings", "playerId", "port", "c", "controller", "got", "time", "intents", "controllers", "intent", "alpha", "changedIntents", "value", "id", "encodeIntents", "parcels", "encodeParcels", "idbRange", "start", "end", "isHappy", "idbWait", "request", "resolve", "reject", "idbTransactions", "db", "storeName", "setup", "mode", "fn", "tx", "store", "completed", "resolve", "reject", "result", "idbWait", "error", "IdbMagazine", "#tx", "idb", "idbTransactions", "ops", "store", "key", "value", "keys", "wait", "scan", "entries", "direction", "request", "idbRange", "cursor", "lexSort", "a", "b", "scanMatch", "key", "start", "end", "scanEntries", "scan", "entries", "matches", "key", "value", "scanMatch", "a", "b", "lexSort", "MemoryMagazine", "#map", "ops", "key", "value", "keys", "scan", "scanEntries", "idbOpen", "dbName", "storeName", "resolve", "reject", "request", "CellOperator", "#key", "#parent", "key", "parent", "value", "Cell", "kv", "key", "CellOperator", "value", "got", "consts", "deepFreeze", "prefixEnd", "prefix", "index", "code", "Subtree", "#magazine", "#scans", "magazine", "scopes", "pre", "consts", "divised", "delimited", "prefixEnd", "count", "scan", "_", "changes", "key", "Operator", "#prefixer", "prefixer", "key", "value", "divisor", "delimiter", "consts", "Prefixer", "#prefix", "#end", "options", "scopes", "prefixEnd", "key", "fullkey", "scan", "start", "end", "limit", "reverse", "validateScan", "scan", "limit", "validateScopes", "scopes", "scope", "forbidden", "illegal", "Kv", "_Kv", "#magazine", "#prefixer", "#preprocess", "#options", "magazine", "MemoryMagazine", "options", "validateScopes", "Prefixer", "Operator", "Subtree", "value", "key", "Cell", "scopes", "ops", "changes", "keys", "got", "values", "index", "scan", "validateScan", "key2", "count", "_", "consts", "setupKv", "namespace", "kv", "dispose", "idb", "idbOpen", "magazine", "IdbMagazine", "Kv", "getProfile", "data", "profileKey", "presets", "customs", "fallback", "got", "assignProfile", "controller", "kvs", "controllers", "assignments", "given", "handle", "isCompatible", "bindingsA", "bindingsB", "hashBindings", "Profiles", "#data", "data", "#ensureBindingsAreCompatible", "b", "isCompatible", "profileKey", "getProfile", "key", "profile", "kvs", "profiles", "basedOn", "label", "bindings", "assignments", "customs", "fallback", "controller", "controllerKey", "assignProfile", "changes", "staleProfile", "freshProfile", "makeControlsData", "options", "presets", "fallbackKey", "got", "fallbackProfile", "bindings", "kv", "hashBindings", "profiles", "RMap", "setEntries", "subby", "IdCounter", "Assignments", "#data", "data", "controller", "profileKey", "assignProfile", "assignments", "Controls", "#data", "options", "makeControlsData", "Profiles", "Assignments", "#rebind", "controller", "preferences", "assignments", "controllers", "meta", "got", "profileKey", "kvs", "customs", "setEntries", "collect", "id", "firstPreset", "presets", "key", "profile", "setupBroadcastChannel", "namespace", "broadcastChannel", "dispose", "bc", "setupDeck", "params", "dispose", "schedule", "disposable", "disposer", "namespace", "kv", "setupKv", "broadcastChannel", "setupBroadcastChannel", "maxPlayers", "bindings", "firstPreset", "hub", "Hub", "controls", "Controls", "ev", "asDeck", "error", "limit", "Sampler", "#source", "#samples", "source", "sample", "arraylimit", "samples", "min", "max", "abs", "sign", "floor", "ceil", "pow", "clamp", "x", "a", "b", "min", "max", "lerp", "fraction", "from", "to", "maxDelta", "delta", "abs", "sign", "unlerp", "x", "a", "b", "remap", "a1", "a2", "b1", "b2", "clamping", "clamp", "Vec2", "_Vec2", "x", "y", "value", "v", "vectors", "vecs", "radians", "n", "epsilon", "dot", "magnitudes", "ratio", "clamp", "max", "fn", "result", "min", "a", "delta", "coefficient", "divisor", "fraction", "dx", "dy", "cos", "sin", "isDown", "value", "evaluate", "context", "expression", "isNumber", "isString", "latest", "s", "peak", "code", "x", "sample", "ups", "was", "isDown", "downs", "condition", "yes", "no", "isHappy", "p", "c", "first", "rest", "value", "neg", "min", "max", "expr", "a", "b", "d", "remap", "ms", "subexpression", "down", "held", "taps", "now", "state", "guarantee", "pressed", "released", "result", "modifiers", "shift", "ctrl", "alt", "meta", "Clock", "time", "EvaluationContext", "Clock", "makeInput", "investigate", "bindings", "hash", "hashBindings", "leaves", "makeInputs", "b", "path", "isExpression", "input", "makeInput", "obmap", "value", "key", "inputs", "a", "minihash", "l", "Controller", "#sampler", "#bindings", "#investigation", "#context", "options", "deepFreeze", "investigate", "Sampler", "EvaluationContext", "b", "bindings", "fresh", "goodHash", "time", "samples", "code", "value", "id", "expression", "evaluate", "encodeIntents", "Pad", "get", "evergreen", "value", "fn", "cached", "next", "onPad", "fn", "known", "refresh", "addNew", "deleteOld", "gamepad", "get", "pad", "Pad", "evergreen", "dispose", "index", "unlisten", "ev", "PlainSource", "subby", "disposer", "GamepadSource", "PlainSource", "#values", "pad", "gamepad", "#pollButtons", "#pollAxes", "#publish", "code", "value", "previous", "any", "index", "button", "autoGamepads", "hub", "fn", "onPad", "pad", "source", "GamepadSource", "controller", "Controller", "dispose", "ellipsis", "s", "max", "Sources", "PlainSource", "#array", "sources", "source", "sample", "Visualizer", "signal", "debounce", "data", "hex", "mouseButton", "button", "PointerSource", "PlainSource", "Vec2", "target", "ev", "#listeners", "event", "mouseButton", "clientX", "clientY", "movementX", "movementY", "deltaX", "deltaY", "KeyboardSource", "PlainSource", "#down", "target", "ev", "#targetListeners", "#windowListeners", "event", "code", "coreString", "templateString", "varsString", "templateString", "renderVars", "renderVar", "name", "value", "varsObject", "resetString", "templateString", "themeString", "templateString", "varsString", "resetString", "coreString", "themeCss", "themeString", "TabsControl", "signal", "start", "index", "delta", "style_css_default", "i", "ShinyTabs", "shadow", "options", "useName", "useStyles", "themeCss", "style_css_default", "host", "useHost", "attrs", "useOnce", "dom", "control", "TabsControl", "$tabs", "useSignal", "$panels", "tabchange", "event", "slot", "panelchange", "isNeighborActive", "index", "delta", "nextIndex", "tab", "tabbed", "tabAttrs", "panel", "b", "style_css_default", "i", "theme_css_default", "i", "cssReset", "game_controller_svg_default", "w", "settings_horizontal_svg_default", "w", "style_css_default", "i", "person_add_svg_default", "w", "x_small_svg_default", "w", "DropcardView", "lightView", "dnd", "dropzone", "b", "drag_vertical_fill_svg_default", "w", "hueify", "n", "ProfileSelectView", "lightView", "deck", "currentProfileKey", "onChange", "profiles", "handleChange", "event", "select", "b", "key", "profile", "ControllerView", "lightView", "context", "controller", "deck", "dnd", "controls", "dragzone", "currentProfileKey", "meta", "game_controller_svg_default", "style", "hueify", "b", "drag_vertical_fill_svg_default", "ProfileSelectView", "key", "PlayerView", "lightView", "context", "playerId", "index", "hub", "deletePlayer", "controllers", "DropcardView", "b", "when", "x_small_svg_default", "ControllerView", "droppyNewPlayer", "ControllersView", "makeControllersElement", "shadowDuplex", "deck", "useCss", "theme_css_default", "style_css_default", "hub", "controllers", "clickCreatePlayer", "renderPlayer", "p", "PlayerView", "context", "useOnce", "index_barrel_exports", "_event", "draggy", "droppy", "droppyNewPlayer", "isHappy", "b", "when", "DropcardView", "person_add_svg_default", "ControllerView", "style_css_default", "i", "copy_svg_default", "w", "trash_can_svg_default", "w", "makeId", "hex", "key_cap_svg_default", "w", "backspace_svg_default", "w", "cross_svg_default", "w", "captureKeyChord", "update", "onDone", "held", "seen", "mod", "code", "stop", "ev", "halt", "event", "codes", "mods", "captureGamepadChord", "update", "onDone", "dispose", "schedule", "disposer", "sourceSet", "held", "seen", "ev", "onPad", "pad", "source", "GamepadSource", "sample", "cycle", "nap", "capturePointerChord", "update", "onDone", "dispose", "schedule", "disposer", "held", "seen", "isControl", "event", "target", "ev", "code", "mouseButton", "RecorderView", "lightView", "isReadonly", "update", "reset", "content", "$recording", "useSignal", "removeRecording", "startRecording", "dispose", "schedule", "disposer", "captureKeyChord", "captureGamepadChord", "capturePointerChord", "haltRecording", "toggleRecording", "haltAndReset", "useUnmount", "b", "cross_svg_default", "key_cap_svg_default", "backspace_svg_default", "ExpressionView", "lightView", "isReadonly", "expression", "update", "isHappy", "b", "isNumber", "event", "value", "isString", "isArray", "x_small_svg_default", "e", "i", "fresh", "clone", "renderBindings", "isReadonly", "bindings", "original", "update", "isExpression", "ExpressionView", "key", "child", "renderExpression", "renderGroup", "b", "fresh", "up", "RecorderView", "CustomizeView", "makeCustomizeElement", "shadowDuplex", "options", "useCss", "theme_css_default", "style_css_default", "controls", "profiles", "$profileKey", "useSignal", "profile", "isReadonly", "baseline", "updateBindings", "bindings", "key", "basedOn", "freshKey", "makeId", "updateLabel", "profileKey", "label", "clone", "destroy", "b", "ProfileSelectView", "copy_svg_default", "trash_can_svg_default", "when", "given", "event", "input", "renderBindings", "DeckView", "makeDeckElement", "shadowDuplex", "deck", "useCss", "theme_css_default", "style_css_default", "attrs", "tabsControl", "useOnce", "TabsControl", "b", "ShinyTabs", "game_controller_svg_default", "settings_horizontal_svg_default", "ControllersView", "CustomizeView", "style_css_default", "i", "VisualizerView", "makeVisualizerElement", "shadowDuplex", "visualizer", "useCss", "theme_css_default", "style_css_default", "b", "devices_svg_default", "w", "setupTact", "params", "dispose", "schedule", "disposable", "disposer", "deck", "setupDeck", "first", "firstPreset", "visualizer", "Visualizer", "elements", "makeDeckElement", "makeCustomizeElement", "makeControllersElement", "makeVisualizerElement", "gamepads", "defaultProfileKey", "stop", "autoGamepads", "controller", "source", "handle", "game_controller_svg_default", "ellipsis", "mouseKeyboard", "key", "profile", "Controller", "Sources", "KeyboardSource", "PointerSource", "devices_svg_default", "registerElements", "register", "tact", "setupTact", "presets", "cycle", "data", "nap", "input", "dom"]
|
|
7
7
|
}
|