@benev/tact 0.3.0-5 → 0.4.0-1
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 +98 -55
- package/package.json +20 -21
- package/s/demo/main.bundle.ts +19 -67
- package/s/demo/main.css +4 -3
- package/s/demo/presets.ts +54 -0
- package/s/gamepad/gamepad-app/element.ts +25 -15
- package/s/gamepad/gamepad-app/style.css.ts +5 -1
- package/s/gamepad/index.html.ts +1 -1
- package/s/gamepad/main.css +10 -1
- package/s/index.html.ts +13 -6
- package/s/lib/index.ts +29 -0
- package/s/lib/input/controller.ts +72 -0
- package/s/lib/input/data/endian.ts +3 -0
- package/s/lib/input/data/intent/decode.ts +26 -0
- package/s/lib/input/data/intent/encode.ts +25 -0
- package/s/lib/input/data/intent/sizes.ts +6 -0
- package/s/lib/input/data/intent/types.ts +6 -0
- package/s/lib/input/data/parcel/decode.ts +32 -0
- package/s/lib/input/data/parcel/encode.ts +30 -0
- package/s/lib/input/data/parcel/sizes.ts +5 -0
- package/s/lib/input/data/parcel/types.ts +8 -0
- package/s/lib/input/data/test.ts +23 -0
- package/s/lib/input/decoder.ts +46 -0
- package/s/lib/input/evaluate/context.ts +16 -0
- package/s/lib/input/evaluate/evaluate.ts +229 -0
- package/s/lib/input/expression.ts +44 -0
- package/s/lib/input/investigate/hash-bindings.ts +22 -0
- package/s/lib/input/investigate/investigate.ts +35 -0
- package/s/lib/input/investigate/is-compatible.ts +8 -0
- package/s/lib/input/investigate/is-expression.ts +13 -0
- package/s/lib/input/investigate/make-input.ts +7 -0
- package/s/lib/input/sources/gamepad.ts +49 -0
- package/s/lib/input/sources/keyboard.ts +46 -0
- package/s/lib/input/sources/plain.ts +9 -0
- package/s/lib/input/sources/pointer.ts +38 -0
- package/s/lib/input/sources/sources.ts +24 -0
- package/s/lib/input/sources/stick.ts +32 -0
- package/s/lib/input/test.ts +194 -0
- package/s/lib/input/testing/quickbind.ts +21 -0
- package/s/lib/input/types.ts +48 -0
- package/s/lib/input/utils/clock.ts +14 -0
- package/s/lib/input/utils/mouse-button.ts +5 -0
- package/s/lib/input/utils/sampler.ts +28 -0
- package/s/lib/test.ts +6 -0
- package/s/lib/ui/deck/auto-gamepads.ts +29 -0
- package/s/lib/ui/deck/collector.ts +52 -0
- package/s/lib/ui/deck/controls/controls.ts +76 -0
- package/s/lib/ui/deck/controls/internal/assignments.ts +24 -0
- package/s/lib/ui/deck/controls/internal/data.ts +51 -0
- package/s/lib/ui/deck/controls/internal/fns.ts +38 -0
- package/s/lib/ui/deck/controls/internal/profiles.ts +83 -0
- package/s/lib/ui/deck/controls/types.ts +23 -0
- package/s/lib/ui/deck/hub.ts +108 -0
- package/s/lib/ui/deck/setup/deck.ts +31 -0
- package/s/lib/ui/deck/setup/tact.ts +86 -0
- package/s/lib/ui/deck/setup/types.ts +12 -0
- package/s/lib/ui/deck/types.ts +26 -0
- package/s/lib/ui/deck/utils/first-preset.ts +9 -0
- package/s/lib/ui/icons/akar/LICENSE +23 -0
- package/s/lib/ui/icons/akar/backspace.svg.ts +4 -0
- package/s/lib/ui/icons/akar/circle-plus.svg.ts +4 -0
- package/s/lib/ui/icons/akar/copy.svg.ts +4 -0
- package/s/lib/ui/icons/akar/cross.svg.ts +4 -0
- package/s/lib/ui/icons/akar/devices.svg.ts +4 -0
- package/s/lib/ui/icons/akar/drag-vertical-fill.svg.ts +4 -0
- package/s/lib/ui/icons/akar/game-controller.svg.ts +4 -0
- package/s/lib/ui/icons/akar/key-cap.svg.ts +4 -0
- package/s/lib/ui/icons/akar/people-group.svg.ts +4 -0
- package/s/lib/ui/icons/akar/person-add.svg.ts +4 -0
- package/s/lib/ui/icons/akar/settings-horizontal.svg.ts +4 -0
- package/s/lib/ui/icons/akar/trash-can.svg.ts +4 -0
- package/s/lib/ui/icons/akar/x-small.svg.ts +4 -0
- package/s/lib/ui/views/controllers/style.css.ts +158 -0
- package/s/lib/ui/views/controllers/subviews/controller.ts +53 -0
- package/s/lib/ui/views/controllers/subviews/dropcard.ts +31 -0
- package/s/lib/ui/views/controllers/subviews/player.ts +38 -0
- package/s/lib/ui/views/controllers/view.ts +72 -0
- package/s/lib/ui/views/customize/parts/capture-gamepad-chord.ts +59 -0
- package/s/lib/ui/views/customize/parts/capture-key-chord.ts +70 -0
- package/s/lib/ui/views/customize/parts/capture-pointer-chord.ts +55 -0
- package/s/lib/ui/views/customize/parts/render-bindings.ts +67 -0
- package/s/lib/ui/views/customize/style.css.ts +144 -0
- package/s/lib/ui/views/customize/subviews/expression.ts +88 -0
- package/s/lib/ui/views/customize/subviews/recorder.ts +76 -0
- package/s/lib/ui/views/customize/view.ts +104 -0
- package/s/lib/ui/views/deck/style.css.ts +69 -0
- package/s/lib/ui/views/deck/types.ts +15 -0
- package/s/lib/ui/views/deck/view.ts +49 -0
- package/s/lib/ui/views/profile-select/view.ts +44 -0
- package/s/lib/ui/views/theme.css.ts +115 -0
- package/s/lib/ui/views/visualizer/style.css.ts +23 -0
- package/s/lib/ui/views/visualizer/view.ts +16 -0
- package/s/lib/ui/views/visualizer/visualizer.ts +17 -0
- package/s/lib/utils/ellipsis.ts +7 -0
- package/s/lib/utils/hueify.ts +5 -0
- package/x/demo/main.bundle.js +16 -52
- package/x/demo/main.bundle.js.map +1 -1
- package/x/demo/main.bundle.min.js +766 -93
- package/x/demo/main.bundle.min.js.map +4 -4
- package/x/demo/main.css +4 -3
- package/x/demo/presets.d.ts +30 -0
- package/x/demo/presets.js +51 -0
- package/x/demo/presets.js.map +1 -0
- package/x/gamepad/gamepad-app/element.js +21 -14
- package/x/gamepad/gamepad-app/element.js.map +1 -1
- package/x/gamepad/gamepad-app/style.css.js +5 -1
- package/x/gamepad/gamepad-app/style.css.js.map +1 -1
- package/x/gamepad/index.html +4 -4
- package/x/gamepad/index.html.js +1 -1
- package/x/gamepad/main.bundle.min.js +25 -21
- package/x/gamepad/main.bundle.min.js.map +4 -4
- package/x/gamepad/main.css +10 -1
- package/x/index.html +16 -9
- package/x/index.html.js +13 -6
- package/x/index.html.js.map +1 -1
- package/x/lib/index.d.ts +26 -0
- package/x/lib/index.js +27 -0
- package/x/lib/index.js.map +1 -0
- package/x/lib/input/controller.d.ts +15 -0
- package/x/lib/input/controller.js +55 -0
- package/x/lib/input/controller.js.map +1 -0
- package/x/lib/input/data/endian.d.ts +1 -0
- package/x/lib/input/data/endian.js +2 -0
- package/x/lib/input/data/endian.js.map +1 -0
- package/x/lib/input/data/intent/decode.d.ts +5 -0
- package/x/lib/input/data/intent/decode.js +18 -0
- package/x/lib/input/data/intent/decode.js.map +1 -0
- package/x/lib/input/data/intent/encode.d.ts +2 -0
- package/x/lib/input/data/intent/encode.js +18 -0
- package/x/lib/input/data/intent/encode.js.map +1 -0
- package/x/lib/input/data/intent/sizes.d.ts +4 -0
- package/x/lib/input/data/intent/sizes.js +5 -0
- package/x/lib/input/data/intent/sizes.js.map +1 -0
- package/x/lib/input/data/intent/types.d.ts +4 -0
- package/x/lib/input/data/intent/types.js.map +1 -0
- package/x/lib/input/data/parcel/decode.d.ts +2 -0
- package/x/lib/input/data/parcel/decode.js +22 -0
- package/x/lib/input/data/parcel/decode.js.map +1 -0
- package/x/lib/input/data/parcel/encode.d.ts +2 -0
- package/x/lib/input/data/parcel/encode.js +19 -0
- package/x/lib/input/data/parcel/encode.js.map +1 -0
- package/x/lib/input/data/parcel/sizes.d.ts +3 -0
- package/x/lib/input/data/parcel/sizes.js +4 -0
- package/x/lib/input/data/parcel/sizes.js.map +1 -0
- package/x/lib/input/data/parcel/types.d.ts +5 -0
- package/x/lib/input/data/parcel/types.js.map +1 -0
- package/x/lib/input/data/test.d.ts +6 -0
- package/x/lib/input/data/test.js +19 -0
- package/x/lib/input/data/test.js.map +1 -0
- package/x/lib/input/decoder.d.ts +7 -0
- package/x/lib/input/decoder.js +33 -0
- package/x/lib/input/decoder.js.map +1 -0
- package/x/lib/input/evaluate/context.d.ts +15 -0
- package/x/lib/input/evaluate/context.js +11 -0
- package/x/lib/input/evaluate/context.js.map +1 -0
- package/x/lib/input/evaluate/evaluate.d.ts +3 -0
- package/x/lib/input/evaluate/evaluate.js +175 -0
- package/x/lib/input/evaluate/evaluate.js.map +1 -0
- package/x/lib/input/expression.d.ts +1 -0
- package/x/lib/input/expression.js +2 -0
- package/x/lib/input/expression.js.map +1 -0
- package/x/lib/input/investigate/hash-bindings.d.ts +2 -0
- package/x/lib/input/investigate/hash-bindings.js +17 -0
- package/x/lib/input/investigate/hash-bindings.js.map +1 -0
- package/x/lib/input/investigate/investigate.d.ts +8 -0
- package/x/lib/input/investigate/investigate.js +28 -0
- package/x/lib/input/investigate/investigate.js.map +1 -0
- package/x/lib/input/investigate/is-compatible.d.ts +2 -0
- package/x/lib/input/investigate/is-compatible.js +5 -0
- package/x/lib/input/investigate/is-compatible.js.map +1 -0
- package/x/lib/input/investigate/is-expression.d.ts +3 -0
- package/x/lib/input/investigate/is-expression.js +13 -0
- package/x/lib/input/investigate/is-expression.js.map +1 -0
- package/x/lib/input/investigate/make-input.d.ts +2 -0
- package/x/lib/input/investigate/make-input.js +4 -0
- package/x/lib/input/investigate/make-input.js.map +1 -0
- package/x/lib/input/sources/gamepad.d.ts +9 -0
- package/x/lib/input/sources/gamepad.js +39 -0
- package/x/lib/input/sources/gamepad.js.map +1 -0
- package/x/lib/input/sources/keyboard.d.ts +5 -0
- package/x/lib/input/sources/keyboard.js +36 -0
- package/x/lib/input/sources/keyboard.js.map +1 -0
- package/x/lib/input/sources/plain.d.ts +5 -0
- package/x/lib/input/sources/plain.js +6 -0
- package/x/lib/input/sources/plain.js.map +1 -0
- package/x/lib/input/sources/pointer.d.ts +7 -0
- package/x/lib/input/sources/pointer.js +33 -0
- package/x/lib/input/sources/pointer.js.map +1 -0
- package/x/lib/input/sources/sources.d.ts +7 -0
- package/x/lib/input/sources/sources.js +15 -0
- package/x/lib/input/sources/sources.js.map +1 -0
- package/x/lib/input/sources/stick.d.ts +10 -0
- package/x/lib/input/sources/stick.js +25 -0
- package/x/lib/input/sources/stick.js.map +1 -0
- package/x/lib/input/test.d.ts +18 -0
- package/x/lib/input/test.js +143 -0
- package/x/lib/input/test.js.map +1 -0
- package/x/lib/input/testing/quickbind.d.ts +12 -0
- package/x/lib/input/testing/quickbind.js +13 -0
- package/x/lib/input/testing/quickbind.js.map +1 -0
- package/x/lib/input/types.d.ts +32 -0
- package/x/lib/input/types.js +2 -0
- package/x/lib/input/types.js.map +1 -0
- package/x/lib/input/utils/clock.d.ts +7 -0
- package/x/lib/input/utils/clock.js +14 -0
- package/x/lib/input/utils/clock.js.map +1 -0
- package/x/lib/input/utils/evergreen.js.map +1 -0
- package/x/lib/input/utils/is-down.js.map +1 -0
- package/x/lib/input/utils/mouse-button.d.ts +1 -0
- package/x/lib/input/utils/mouse-button.js +4 -0
- package/x/lib/input/utils/mouse-button.js.map +1 -0
- package/x/lib/input/utils/pad/on-pad.js.map +1 -0
- package/x/lib/input/utils/pad/pad.js.map +1 -0
- package/x/lib/input/utils/sampler.d.ts +7 -0
- package/x/lib/input/utils/sampler.js +23 -0
- package/x/lib/input/utils/sampler.js.map +1 -0
- package/x/lib/input/utils/split-axis.js.map +1 -0
- package/x/lib/test.d.ts +1 -0
- package/x/lib/test.js +4 -0
- package/x/lib/test.js.map +1 -0
- package/x/lib/ui/deck/auto-gamepads.d.ts +4 -0
- package/x/lib/ui/deck/auto-gamepads.js +19 -0
- package/x/lib/ui/deck/auto-gamepads.js.map +1 -0
- package/x/lib/ui/deck/collector.d.ts +13 -0
- package/x/lib/ui/deck/collector.js +35 -0
- package/x/lib/ui/deck/collector.js.map +1 -0
- package/x/lib/ui/deck/controls/controls.d.ts +19 -0
- package/x/lib/ui/deck/controls/controls.js +56 -0
- package/x/lib/ui/deck/controls/controls.js.map +1 -0
- package/x/lib/ui/deck/controls/internal/assignments.d.ts +9 -0
- package/x/lib/ui/deck/controls/internal/assignments.js +16 -0
- package/x/lib/ui/deck/controls/internal/assignments.js.map +1 -0
- package/x/lib/ui/deck/controls/internal/data.d.ts +29 -0
- package/x/lib/ui/deck/controls/internal/data.js +29 -0
- package/x/lib/ui/deck/controls/internal/data.js.map +1 -0
- package/x/lib/ui/deck/controls/internal/fns.d.ts +6 -0
- package/x/lib/ui/deck/controls/internal/fns.js +19 -0
- package/x/lib/ui/deck/controls/internal/fns.js.map +1 -0
- package/x/lib/ui/deck/controls/internal/profiles.d.ts +18 -0
- package/x/lib/ui/deck/controls/internal/profiles.js +59 -0
- package/x/lib/ui/deck/controls/internal/profiles.js.map +1 -0
- package/x/lib/ui/deck/controls/types.d.ts +17 -0
- package/x/lib/ui/deck/controls/types.js +2 -0
- package/x/lib/ui/deck/controls/types.js.map +1 -0
- package/x/lib/ui/deck/hub.d.ts +21 -0
- package/x/lib/ui/deck/hub.js +85 -0
- package/x/lib/ui/deck/hub.js.map +1 -0
- package/x/lib/ui/deck/setup/deck.d.ts +3 -0
- package/x/lib/ui/deck/setup/deck.js +20 -0
- package/x/lib/ui/deck/setup/deck.js.map +1 -0
- package/x/lib/ui/deck/setup/tact.d.ts +17 -0
- package/x/lib/ui/deck/setup/tact.js +67 -0
- package/x/lib/ui/deck/setup/tact.js.map +1 -0
- package/x/lib/ui/deck/setup/types.d.ts +9 -0
- package/x/lib/ui/deck/setup/types.js +2 -0
- package/x/lib/ui/deck/setup/types.js.map +1 -0
- package/x/lib/ui/deck/types.d.ts +18 -0
- package/x/lib/ui/deck/types.js +3 -0
- package/x/lib/ui/deck/types.js.map +1 -0
- package/x/lib/ui/deck/utils/first-preset.d.ts +6 -0
- package/x/lib/ui/deck/utils/first-preset.js +5 -0
- package/x/lib/ui/deck/utils/first-preset.js.map +1 -0
- package/x/lib/ui/icons/akar/backspace.svg.d.ts +2 -0
- package/x/lib/ui/icons/akar/backspace.svg.js +3 -0
- package/x/lib/ui/icons/akar/backspace.svg.js.map +1 -0
- package/x/lib/ui/icons/akar/circle-plus.svg.d.ts +2 -0
- package/x/lib/ui/icons/akar/circle-plus.svg.js +3 -0
- package/x/lib/ui/icons/akar/circle-plus.svg.js.map +1 -0
- package/x/lib/ui/icons/akar/copy.svg.d.ts +2 -0
- package/x/lib/ui/icons/akar/copy.svg.js +3 -0
- package/x/lib/ui/icons/akar/copy.svg.js.map +1 -0
- package/x/lib/ui/icons/akar/cross.svg.d.ts +2 -0
- package/x/lib/ui/icons/akar/cross.svg.js +3 -0
- package/x/lib/ui/icons/akar/cross.svg.js.map +1 -0
- package/x/lib/ui/icons/akar/devices.svg.d.ts +2 -0
- package/x/lib/ui/icons/akar/devices.svg.js +3 -0
- package/x/lib/ui/icons/akar/devices.svg.js.map +1 -0
- package/x/lib/ui/icons/akar/drag-vertical-fill.svg.d.ts +2 -0
- package/x/lib/ui/icons/akar/drag-vertical-fill.svg.js +3 -0
- package/x/lib/ui/icons/akar/drag-vertical-fill.svg.js.map +1 -0
- package/x/lib/ui/icons/akar/game-controller.svg.d.ts +2 -0
- package/x/lib/ui/icons/akar/game-controller.svg.js +3 -0
- package/x/lib/ui/icons/akar/game-controller.svg.js.map +1 -0
- package/x/lib/ui/icons/akar/key-cap.svg.d.ts +2 -0
- package/x/lib/ui/icons/akar/key-cap.svg.js +3 -0
- package/x/lib/ui/icons/akar/key-cap.svg.js.map +1 -0
- package/x/lib/ui/icons/akar/people-group.svg.d.ts +2 -0
- package/x/lib/ui/icons/akar/people-group.svg.js +3 -0
- package/x/lib/ui/icons/akar/people-group.svg.js.map +1 -0
- package/x/lib/ui/icons/akar/person-add.svg.d.ts +2 -0
- package/x/lib/ui/icons/akar/person-add.svg.js +3 -0
- package/x/lib/ui/icons/akar/person-add.svg.js.map +1 -0
- package/x/lib/ui/icons/akar/settings-horizontal.svg.d.ts +2 -0
- package/x/lib/ui/icons/akar/settings-horizontal.svg.js +3 -0
- package/x/lib/ui/icons/akar/settings-horizontal.svg.js.map +1 -0
- package/x/lib/ui/icons/akar/trash-can.svg.d.ts +2 -0
- package/x/lib/ui/icons/akar/trash-can.svg.js +3 -0
- package/x/lib/ui/icons/akar/trash-can.svg.js.map +1 -0
- package/x/lib/ui/icons/akar/x-small.svg.d.ts +2 -0
- package/x/lib/ui/icons/akar/x-small.svg.js +3 -0
- package/x/lib/ui/icons/akar/x-small.svg.js.map +1 -0
- package/x/lib/ui/views/controllers/style.css.js +157 -0
- package/x/lib/ui/views/controllers/style.css.js.map +1 -0
- package/x/lib/ui/views/controllers/subviews/controller.d.ts +3 -0
- package/x/lib/ui/views/controllers/subviews/controller.js +45 -0
- package/x/lib/ui/views/controllers/subviews/controller.js.map +1 -0
- package/x/lib/ui/views/controllers/subviews/dropcard.d.ts +9 -0
- package/x/lib/ui/views/controllers/subviews/dropcard.js +20 -0
- package/x/lib/ui/views/controllers/subviews/dropcard.js.map +1 -0
- package/x/lib/ui/views/controllers/subviews/player.d.ts +2 -0
- package/x/lib/ui/views/controllers/subviews/player.js +32 -0
- package/x/lib/ui/views/controllers/subviews/player.js.map +1 -0
- package/x/lib/ui/views/controllers/view.d.ts +2 -0
- package/x/lib/ui/views/controllers/view.js +64 -0
- package/x/lib/ui/views/controllers/view.js.map +1 -0
- package/x/lib/ui/views/customize/parts/capture-gamepad-chord.d.ts +2 -0
- package/x/lib/ui/views/customize/parts/capture-gamepad-chord.js +46 -0
- package/x/lib/ui/views/customize/parts/capture-gamepad-chord.js.map +1 -0
- package/x/lib/ui/views/customize/parts/capture-key-chord.d.ts +2 -0
- package/x/lib/ui/views/customize/parts/capture-key-chord.js +58 -0
- package/x/lib/ui/views/customize/parts/capture-key-chord.js.map +1 -0
- package/x/lib/ui/views/customize/parts/capture-pointer-chord.d.ts +2 -0
- package/x/lib/ui/views/customize/parts/capture-pointer-chord.js +42 -0
- package/x/lib/ui/views/customize/parts/capture-pointer-chord.js.map +1 -0
- package/x/lib/ui/views/customize/parts/render-bindings.d.ts +3 -0
- package/x/lib/ui/views/customize/parts/render-bindings.js +32 -0
- package/x/lib/ui/views/customize/parts/render-bindings.js.map +1 -0
- package/x/lib/ui/views/customize/style.css.js +143 -0
- package/x/lib/ui/views/customize/style.css.js.map +1 -0
- package/x/lib/ui/views/customize/subviews/expression.d.ts +2 -0
- package/x/lib/ui/views/customize/subviews/expression.js +75 -0
- package/x/lib/ui/views/customize/subviews/expression.js.map +1 -0
- package/x/lib/ui/views/customize/subviews/recorder.d.ts +3 -0
- package/x/lib/ui/views/customize/subviews/recorder.js +60 -0
- package/x/lib/ui/views/customize/subviews/recorder.js.map +1 -0
- package/x/lib/ui/views/customize/view.d.ts +6 -0
- package/x/lib/ui/views/customize/view.js +82 -0
- package/x/lib/ui/views/customize/view.js.map +1 -0
- package/x/lib/ui/views/deck/style.css.d.ts +2 -0
- package/x/lib/ui/views/deck/style.css.js +68 -0
- package/x/lib/ui/views/deck/style.css.js.map +1 -0
- package/x/lib/ui/views/deck/types.d.ts +14 -0
- package/x/lib/ui/views/deck/types.js +2 -0
- package/x/lib/ui/views/deck/types.js.map +1 -0
- package/x/lib/ui/views/deck/view.d.ts +2 -0
- package/x/lib/ui/views/deck/view.js +41 -0
- package/x/lib/ui/views/deck/view.js.map +1 -0
- package/x/lib/ui/views/profile-select/view.d.ts +4 -0
- package/x/lib/ui/views/profile-select/view.js +34 -0
- package/x/lib/ui/views/profile-select/view.js.map +1 -0
- package/x/lib/ui/views/theme.css.d.ts +2 -0
- package/x/lib/ui/views/theme.css.js +113 -0
- package/x/lib/ui/views/theme.css.js.map +1 -0
- package/x/lib/ui/views/visualizer/style.css.d.ts +2 -0
- package/x/lib/ui/views/visualizer/style.css.js +22 -0
- package/x/lib/ui/views/visualizer/style.css.js.map +1 -0
- package/x/lib/ui/views/visualizer/view.d.ts +2 -0
- package/x/lib/ui/views/visualizer/view.js +11 -0
- package/x/lib/ui/views/visualizer/view.js.map +1 -0
- package/x/lib/ui/views/visualizer/visualizer.d.ts +5 -0
- package/x/lib/ui/views/visualizer/visualizer.js +13 -0
- package/x/lib/ui/views/visualizer/visualizer.js.map +1 -0
- package/x/lib/utils/ellipsis.d.ts +1 -0
- package/x/lib/utils/ellipsis.js +6 -0
- package/x/lib/utils/ellipsis.js.map +1 -0
- package/x/lib/utils/hueify.d.ts +1 -0
- package/x/lib/utils/hueify.js +4 -0
- package/x/lib/utils/hueify.js.map +1 -0
- package/x/lib/utils/make-id.js.map +1 -0
- package/s/_archive/README.md +0 -435
- package/s/_archive/core/bindings/action.ts +0 -30
- package/s/_archive/core/bindings/parts/defaults.ts +0 -32
- package/s/_archive/core/bindings/parts/is-pressed.ts +0 -5
- package/s/_archive/core/bindings/parts/lens-algo.ts +0 -84
- package/s/_archive/core/bindings/parts/lookup-proxies.ts +0 -17
- package/s/_archive/core/bindings/resolver.ts +0 -103
- package/s/_archive/core/bindings/sample-map.ts +0 -25
- package/s/_archive/core/bindings/types.ts +0 -60
- package/s/_archive/core/core.test.ts +0 -155
- package/s/_archive/core/devices/auto-gamepads.ts +0 -8
- package/s/_archive/core/devices/device.ts +0 -12
- package/s/_archive/core/devices/infra/group.ts +0 -24
- package/s/_archive/core/devices/infra/sampler.ts +0 -22
- package/s/_archive/core/devices/standard/gamepad.ts +0 -83
- package/s/_archive/core/devices/standard/index.ts +0 -8
- package/s/_archive/core/devices/standard/keyboard.ts +0 -31
- package/s/_archive/core/devices/standard/pointer.ts +0 -97
- package/s/_archive/core/devices/standard/primary.ts +0 -20
- package/s/_archive/core/devices/standard/stick.ts +0 -27
- package/s/_archive/core/devices/standard/vpad.ts +0 -25
- package/s/_archive/core/devices/types.ts +0 -3
- package/s/_archive/core/hub/hub.ts +0 -118
- package/s/_archive/core/hub/meta-bindings.ts +0 -23
- package/s/_archive/core/hub/parts/connected.ts +0 -15
- package/s/_archive/core/hub/port.ts +0 -26
- package/s/_archive/core/hub/types.ts +0 -13
- package/s/_archive/core/index.ts +0 -19
- package/s/_archive/core/testing/testing.ts +0 -57
- package/s/_archive/deck/deck.ts +0 -69
- package/s/_archive/deck/index.ts +0 -13
- package/s/_archive/deck/parts/catalog.ts +0 -58
- package/s/_archive/deck/parts/db.ts +0 -65
- package/s/_archive/deck/parts/device-skins/device-icons.ts +0 -38
- package/s/_archive/deck/parts/device-skins/device-skin.ts +0 -29
- package/s/_archive/deck/parts/local-storage-kv.ts +0 -8
- package/s/_archive/deck/parts/merge-bindings.ts +0 -21
- package/s/_archive/deck/parts/overlay-visibility.ts +0 -49
- package/s/_archive/deck/views/bindings/style.css.ts +0 -6
- package/s/_archive/deck/views/bindings/view.ts +0 -95
- package/s/_archive/deck/views/overlay/style.css.ts +0 -110
- package/s/_archive/deck/views/overlay/view.ts +0 -46
- package/s/_archive/demo/game/game.ts +0 -85
- package/s/_archive/demo/game/parts/agent.ts +0 -10
- package/s/_archive/demo/game/parts/game-bindings.ts +0 -20
- package/s/_archive/demo/game/parts/logic.ts +0 -24
- package/s/_archive/demo/game/parts/player.ts +0 -32
- package/s/_archive/demo/game/parts/renderer.ts +0 -112
- package/s/_archive/demo/game/parts/state.ts +0 -23
- package/s/_archive/demo/game/parts/virtual-device.ts +0 -13
- package/s/_archive/demo/main.bundle.ts +0 -10
- package/s/_archive/demo/main.css +0 -85
- package/s/_archive/demo/ui/theater/styles.css.ts +0 -57
- package/s/_archive/demo/ui/theater/view.ts +0 -55
- package/s/_archive/demo/ui/theater/virtual/style.css.ts +0 -43
- package/s/_archive/demo/ui/theater/virtual/view.ts +0 -29
- package/s/_archive/demo/ui/utils/loader.ts +0 -5
- package/s/_archive/index.html.ts +0 -61
- package/s/_archive/index.ts +0 -8
- package/s/_archive/nubs/index.ts +0 -5
- package/s/_archive/nubs/lookpad/styles.ts +0 -21
- package/s/_archive/nubs/lookpad/view.ts +0 -39
- package/s/_archive/nubs/stick/style.css.ts +0 -70
- package/s/_archive/nubs/stick/view.ts +0 -108
- package/s/_archive/nubs/vpad/styles.css.ts +0 -134
- package/s/_archive/nubs/vpad/utils/gamepad-inputs.ts +0 -42
- package/s/_archive/nubs/vpad/utils/prevent-default-touch-shenanigans.ts +0 -12
- package/s/_archive/nubs/vpad/utils/touch-tracking.ts +0 -75
- package/s/_archive/nubs/vpad/view.ts +0 -141
- package/s/_archive/tests.test.ts +0 -6
- package/s/_archive/utils/circular-clamp.ts +0 -14
- package/s/_archive/utils/dispensers.ts +0 -20
- package/s/_archive/utils/gamepads.ts +0 -41
- package/s/_archive/utils/quick-math.ts +0 -13
- package/s/core/atom/defaults.ts +0 -32
- package/s/core/atom/lens-algo.ts +0 -84
- package/s/core/atom/types.ts +0 -44
- package/s/core/bindings/normalize.ts +0 -27
- package/s/core/bindings/shape.ts +0 -15
- package/s/core/bindings/table.ts +0 -22
- package/s/core/intent/bucket.ts +0 -28
- package/s/core/intent/consts.ts +0 -4
- package/s/core/intent/decode.ts +0 -23
- package/s/core/intent/encode.ts +0 -20
- package/s/core/intent/merge.ts +0 -15
- package/s/core/parts/action.ts +0 -36
- package/s/core/parts/sample-map.ts +0 -24
- package/s/core/resolvers/actions.ts +0 -30
- package/s/core/resolvers/intents.ts +0 -106
- package/s/core/types.ts +0 -40
- package/s/deck/controller.ts +0 -35
- package/s/deck/deck.ts +0 -92
- package/s/deck/parts/profiles.ts +0 -39
- package/s/deck/parts/runtime.ts +0 -11
- package/s/deck/parts/settings.ts +0 -30
- package/s/deck/port.ts +0 -35
- package/s/deck/types.ts +0 -16
- package/s/demo/demo-app/element.ts +0 -17
- package/s/demo/demo-app/style.css.ts +0 -10
- package/s/device/devices.ts +0 -24
- package/s/device/gamepad.ts +0 -42
- package/s/device/keyboard.ts +0 -33
- package/s/device/pointer.ts +0 -89
- package/s/device/sampler.ts +0 -25
- package/s/device/stick.ts +0 -24
- package/s/index-ui.ts +0 -3
- package/s/index.ts +0 -31
- package/s/test.ts +0 -339
- package/s/ui/views/desk/style.css.ts +0 -70
- package/s/ui/views/desk/view.ts +0 -122
- package/s/utils/circular-clamp.ts +0 -14
- package/s/utils/do-async.ts +0 -5
- package/s/utils/evergreen.ts +0 -10
- package/s/utils/freeze-clone.ts +0 -7
- package/s/utils/identifier.ts +0 -30
- package/s/utils/insert.ts +0 -6
- package/s/utils/remap.ts +0 -7
- package/s/utils/shift-limit.ts +0 -9
- package/s/utils/sort-by-key.ts +0 -7
- package/s/utils/split-axis.ts +0 -15
- package/s/utils/tmax.ts +0 -7
- package/s/utils/tmin.ts +0 -7
- package/x/_archive/demo/main.css +0 -85
- package/x/core/atom/defaults.d.ts +0 -3
- package/x/core/atom/defaults.js +0 -26
- package/x/core/atom/defaults.js.map +0 -1
- package/x/core/atom/lens-algo.d.ts +0 -2
- package/x/core/atom/lens-algo.js +0 -54
- package/x/core/atom/lens-algo.js.map +0 -1
- package/x/core/atom/types.d.ts +0 -27
- package/x/core/atom/types.js.map +0 -1
- package/x/core/bindings/normalize.d.ts +0 -2
- package/x/core/bindings/normalize.js +0 -17
- package/x/core/bindings/normalize.js.map +0 -1
- package/x/core/bindings/shape.d.ts +0 -2
- package/x/core/bindings/shape.js +0 -10
- package/x/core/bindings/shape.js.map +0 -1
- package/x/core/bindings/table.d.ts +0 -2
- package/x/core/bindings/table.js +0 -15
- package/x/core/bindings/table.js.map +0 -1
- package/x/core/intent/bucket.d.ts +0 -7
- package/x/core/intent/bucket.js +0 -21
- package/x/core/intent/bucket.js.map +0 -1
- package/x/core/intent/consts.d.ts +0 -2
- package/x/core/intent/consts.js +0 -3
- package/x/core/intent/consts.js.map +0 -1
- package/x/core/intent/decode.d.ts +0 -3
- package/x/core/intent/decode.js +0 -18
- package/x/core/intent/decode.js.map +0 -1
- package/x/core/intent/encode.d.ts +0 -3
- package/x/core/intent/encode.js +0 -15
- package/x/core/intent/encode.js.map +0 -1
- package/x/core/intent/merge.d.ts +0 -3
- package/x/core/intent/merge.js +0 -10
- package/x/core/intent/merge.js.map +0 -1
- package/x/core/parts/action.d.ts +0 -14
- package/x/core/parts/action.js +0 -30
- package/x/core/parts/action.js.map +0 -1
- package/x/core/parts/sample-map.d.ts +0 -6
- package/x/core/parts/sample-map.js +0 -21
- package/x/core/parts/sample-map.js.map +0 -1
- package/x/core/resolvers/actions.d.ts +0 -2
- package/x/core/resolvers/actions.js +0 -23
- package/x/core/resolvers/actions.js.map +0 -1
- package/x/core/resolvers/intents.d.ts +0 -2
- package/x/core/resolvers/intents.js +0 -89
- package/x/core/resolvers/intents.js.map +0 -1
- package/x/core/types.d.ts +0 -43
- package/x/core/types.js +0 -2
- package/x/core/types.js.map +0 -1
- package/x/deck/controller.d.ts +0 -11
- package/x/deck/controller.js +0 -28
- package/x/deck/controller.js.map +0 -1
- package/x/deck/deck.d.ts +0 -31
- package/x/deck/deck.js +0 -68
- package/x/deck/deck.js.map +0 -1
- package/x/deck/parts/profiles.d.ts +0 -12
- package/x/deck/parts/profiles.js +0 -31
- package/x/deck/parts/profiles.js.map +0 -1
- package/x/deck/parts/runtime.d.ts +0 -8
- package/x/deck/parts/runtime.js +0 -7
- package/x/deck/parts/runtime.js.map +0 -1
- package/x/deck/parts/settings.d.ts +0 -11
- package/x/deck/parts/settings.js +0 -26
- package/x/deck/parts/settings.js.map +0 -1
- package/x/deck/port.d.ts +0 -10
- package/x/deck/port.js +0 -24
- package/x/deck/port.js.map +0 -1
- package/x/deck/types.d.ts +0 -11
- package/x/deck/types.js.map +0 -1
- package/x/demo/demo-app/element.d.ts +0 -3
- package/x/demo/demo-app/element.js +0 -13
- package/x/demo/demo-app/element.js.map +0 -1
- package/x/demo/demo-app/style.css.js +0 -9
- package/x/demo/demo-app/style.css.js.map +0 -1
- package/x/device/devices.d.ts +0 -7
- package/x/device/devices.js +0 -17
- package/x/device/devices.js.map +0 -1
- package/x/device/gamepad.d.ts +0 -9
- package/x/device/gamepad.js +0 -37
- package/x/device/gamepad.js.map +0 -1
- package/x/device/keyboard.d.ts +0 -6
- package/x/device/keyboard.js +0 -30
- package/x/device/keyboard.js.map +0 -1
- package/x/device/pad/on-pad.js.map +0 -1
- package/x/device/pad/pad.js.map +0 -1
- package/x/device/pointer.d.ts +0 -12
- package/x/device/pointer.js +0 -73
- package/x/device/pointer.js.map +0 -1
- package/x/device/sampler.d.ts +0 -9
- package/x/device/sampler.js +0 -19
- package/x/device/sampler.js.map +0 -1
- package/x/device/stick.d.ts +0 -14
- package/x/device/stick.js +0 -22
- package/x/device/stick.js.map +0 -1
- package/x/index-ui.d.ts +0 -1
- package/x/index-ui.js +0 -2
- package/x/index-ui.js.map +0 -1
- package/x/index.d.ts +0 -27
- package/x/index.js +0 -28
- package/x/index.js.map +0 -1
- package/x/test.d.ts +0 -9
- package/x/test.js +0 -307
- package/x/test.js.map +0 -1
- package/x/ui/views/desk/style.css.js +0 -69
- package/x/ui/views/desk/style.css.js.map +0 -1
- package/x/ui/views/desk/view.d.ts +0 -7
- package/x/ui/views/desk/view.js +0 -102
- package/x/ui/views/desk/view.js.map +0 -1
- package/x/utils/circular-clamp.d.ts +0 -2
- package/x/utils/circular-clamp.js +0 -8
- package/x/utils/circular-clamp.js.map +0 -1
- package/x/utils/do-async.d.ts +0 -1
- package/x/utils/do-async.js +0 -4
- package/x/utils/do-async.js.map +0 -1
- package/x/utils/evergreen.js.map +0 -1
- package/x/utils/freeze-clone.d.ts +0 -1
- package/x/utils/freeze-clone.js +0 -5
- package/x/utils/freeze-clone.js.map +0 -1
- package/x/utils/identifier.d.ts +0 -6
- package/x/utils/identifier.js +0 -25
- package/x/utils/identifier.js.map +0 -1
- package/x/utils/insert.d.ts +0 -1
- package/x/utils/insert.js +0 -5
- package/x/utils/insert.js.map +0 -1
- package/x/utils/is-down.js.map +0 -1
- package/x/utils/make-id.js.map +0 -1
- package/x/utils/remap.d.ts +0 -1
- package/x/utils/remap.js +0 -6
- package/x/utils/remap.js.map +0 -1
- package/x/utils/shift-limit.d.ts +0 -2
- package/x/utils/shift-limit.js +0 -7
- package/x/utils/shift-limit.js.map +0 -1
- package/x/utils/sort-by-key.d.ts +0 -1
- package/x/utils/sort-by-key.js +0 -6
- package/x/utils/sort-by-key.js.map +0 -1
- package/x/utils/split-axis.js.map +0 -1
- package/x/utils/tmax.d.ts +0 -1
- package/x/utils/tmax.js +0 -6
- package/x/utils/tmax.js.map +0 -1
- package/x/utils/tmin.d.ts +0 -1
- package/x/utils/tmin.js +0 -6
- package/x/utils/tmin.js.map +0 -1
- /package/s/{_archive → lib/input}/utils/evergreen.ts +0 -0
- /package/s/{utils → lib/input/utils}/is-down.ts +0 -0
- /package/s/{device → lib/input/utils}/pad/on-pad.ts +0 -0
- /package/s/{device → lib/input/utils}/pad/pad.ts +0 -0
- /package/s/{_archive → lib/input}/utils/split-axis.ts +0 -0
- /package/s/{utils → lib/utils}/make-id.ts +0 -0
- /package/x/{core/atom → lib/input/data/intent}/types.js +0 -0
- /package/x/{deck → lib/input/data/parcel}/types.js +0 -0
- /package/x/{utils → lib/input/utils}/evergreen.d.ts +0 -0
- /package/x/{utils → lib/input/utils}/evergreen.js +0 -0
- /package/x/{utils → lib/input/utils}/is-down.d.ts +0 -0
- /package/x/{utils → lib/input/utils}/is-down.js +0 -0
- /package/x/{device → lib/input/utils}/pad/on-pad.d.ts +0 -0
- /package/x/{device → lib/input/utils}/pad/on-pad.js +0 -0
- /package/x/{device → lib/input/utils}/pad/pad.d.ts +0 -0
- /package/x/{device → lib/input/utils}/pad/pad.js +0 -0
- /package/x/{utils → lib/input/utils}/split-axis.d.ts +0 -0
- /package/x/{utils → lib/input/utils}/split-axis.js +0 -0
- /package/x/{demo/demo-app → lib/ui/views/controllers}/style.css.d.ts +0 -0
- /package/x/{ui/views/desk → lib/ui/views/customize}/style.css.d.ts +0 -0
- /package/x/{utils → lib/utils}/make-id.d.ts +0 -0
- /package/x/{utils → lib/utils}/make-id.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),qe=/'/g,Be=/"/g,We=/^(?:script|style|textarea|title)$/i,xe=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),b=xe(1),qs=xe(2),Bs=xe(3),q=Symbol.for("lit-noChange"),g=Symbol.for("lit-nothing"),Ie=new WeakMap,U=z.createTreeWalker(z,129);function Ke(r,t){if(!ge(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return He!==void 0?He.createHTML(t):t}var Ge=(r,t)=>{let e=r.length-1,s=[],o,n=t===2?"<svg>":t===3?"<math>":"",i=ct;for(let c=0;c<e;c++){let a=r[c],u,l,h=-1,f=0;for(;f<a.length&&(i.lastIndex=f,l=i.exec(a),l!==null);)f=i.lastIndex,i===ct?l[1]==="!--"?i=Ue:l[1]!==void 0?i=ze:l[2]!==void 0?(We.test(l[2])&&(o=RegExp("</"+l[2],"g")),i=H):l[3]!==void 0&&(i=H):i===H?l[0]===">"?(i=o??ct,h=-1):l[1]===void 0?h=-2:(h=i.lastIndex-l[2].length,u=l[1],i=l[3]===void 0?H:l[3]==='"'?Be:qe):i===Be||i===qe?i=H:i===Ue||i===ze?i=ct:(i=H,o=void 0);let m=i===H&&r[c+1].startsWith("/>")?" ":"";n+=i===ct?a+es:h>=0?(s.push(u),a.slice(0,h)+me+a.slice(h)+O+m):a+O+(h===-2?c:m)}return[Ke(r,n+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},ht=class r{constructor({strings:t,_$litType$:e},s){let o;this.parts=[];let n=0,i=0,c=t.length-1,a=this.parts,[u,l]=Ge(t,e);if(this.el=r.createElement(u,s),U.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(o=U.nextNode())!==null&&a.length<c;){if(o.nodeType===1){if(o.hasAttributes())for(let h of o.getAttributeNames())if(h.endsWith(me)){let f=l[i++],m=o.getAttribute(h).split(O),d=/([.?@])?(.*)/.exec(f);a.push({type:1,index:n,name:d[2],strings:m,ctor:d[1]==="."?Pt:d[1]==="?"?Tt:d[1]==="@"?Ot:I}),o.removeAttribute(h)}else h.startsWith(O)&&(a.push({type:6,index:n}),o.removeAttribute(h));if(We.test(o.tagName)){let h=o.textContent.split(O),f=h.length-1;if(f>0){o.textContent=Mt?Mt.emptyScript:"";for(let m=0;m<f;m++)o.append(h[m],ut()),U.nextNode(),a.push({type:2,index:++n});o.append(h[f],ut())}}}else if(o.nodeType===8)if(o.data===de)a.push({type:2,index:n});else{let h=-1;for(;(h=o.data.indexOf(O,h+1))!==-1;)a.push({type:7,index:n}),h+=O.length-1}n++}}static createElement(t,e){let s=z.createElement("template");return s.innerHTML=t,s}};function B(r,t,e=r,s){if(t===q)return t;let o=s!==void 0?e._$Co?.[s]:e._$Cl,n=pt(t)?void 0:t._$litDirective$;return o?.constructor!==n&&(o?._$AO?.(!1),n===void 0?o=void 0:(o=new n(r),o._$AT(r,e,s)),s!==void 0?(e._$Co??=[])[s]=o:e._$Cl=o),o!==void 0&&(t=B(r,o._$AS(r,t.values),o,s)),t}var kt=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,o=(t?.creationScope??z).importNode(e,!0);U.currentNode=o;let n=U.nextNode(),i=0,c=0,a=s[0];for(;a!==void 0;){if(i===a.index){let u;a.type===2?u=new J(n,n.nextSibling,this,t):a.type===1?u=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(u=new Rt(n,this,t)),this._$AV.push(u),a=s[++c]}i!==a?.index&&(n=U.nextNode(),i++)}return U.currentNode=z,o}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},J=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,o){this.type=2,this._$AH=g,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=B(this,t,e),pt(t)?t===g||t==null||t===""?(this._$AH!==g&&this._$AR(),this._$AH=g):t!==this._$AH&&t!==q&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ve(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==g&&pt(this._$AH)?this._$AA.nextSibling.data=t:this.T(z.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,o=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=ht.createElement(Ke(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===o)this._$AH.p(e);else{let n=new kt(o,this),i=n.u(this.options);n.p(e),this.T(i),this._$AH=n}}_$AC(t){let e=Ie.get(t.strings);return e===void 0&&Ie.set(t.strings,e=new ht(t)),e}k(t){ge(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,o=0;for(let n of t)o===e.length?e.push(s=new r(this.O(ut()),this.O(ut()),this,this.options)):s=e[o],s._$AI(n),o++;o<e.length&&(this._$AR(s&&s._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=De(t).nextSibling;De(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},I=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,o,n){this.type=1,this._$AH=g,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=g}_$AI(t,e=this,s,o){let n=this.strings,i=!1;if(n===void 0)t=B(this,t,e,0),i=!pt(t)||t!==this._$AH&&t!==q,i&&(this._$AH=t);else{let c=t,a,u;for(t=n[0],a=0;a<n.length-1;a++)u=B(this,c[s+a],e,a),u===q&&(u=this._$AH[a]),i||=!pt(u)||u!==this._$AH[a],u===g?t=g:t!==g&&(t+=(u??"")+n[a+1]),this._$AH[a]=u}i&&!o&&this.j(t)}j(t){t===g?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},Pt=class extends I{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===g?void 0:t}},Tt=class extends I{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==g)}},Ot=class extends I{constructor(t,e,s,o,n){super(t,e,s,o,n),this.type=5}_$AI(t,e=this){if((t=B(this,t,e,0)??g)===q)return;let s=this._$AH,o=t===g&&s!==g||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==g&&(s===g||o);o&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},Rt=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){B(this,t)}},Fe={M:me,P:O,A:de,C:1,L:Ge,R:kt,D:Ve,V:B,I:J,H:I,N:Tt,U:Ot,B:Pt,F:Rt},rs=fe.litHtmlPolyfillSupport;rs?.(ht,J),(fe.litHtmlVersions??=[]).push("3.3.3");var x=(r,t,e)=>{let s=e?.renderBefore??t,o=s._$litPart$;if(o===void 0){let n=e?.renderBefore??null;s._$litPart$=o=new J(t.insertBefore(ut(),n),n,void 0,e??{})}return o._$AI(r),o};var ye=globalThis,X=class extends T{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=x(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return q}};X._$litElement$=!0,X.finalized=!0,ye.litElementHydrateSupport?.({LitElement:X});var ss=ye.litElementPolyfillSupport;ss?.({LitElement:X});(ye.litElementVersions??=[]).push("4.2.2");var E={string:(r,t)=>r.getAttribute(t)??void 0,number:(r,t)=>{let e=r.getAttribute(t);return e===null||!e?void 0:Number(e)},boolean:(r,t)=>r.getAttribute(t)!==null},y={string:(r,t,e)=>(e===void 0?r.removeAttribute(t):r.setAttribute(t,e),!0),number:(r,t,e)=>(e===void 0?r.removeAttribute(t):r.setAttribute(t,e.toString()),!0),boolean:(r,t,e)=>(e?r.setAttribute(t,""):r.removeAttribute(t),!0),any:(r,t,e)=>{e==null?r.removeAttribute(t):typeof e=="string"?r.setAttribute(t,e):typeof e=="number"?r.setAttribute(t,e.toString()):typeof e=="boolean"?e===!0?r.setAttribute(t,""):r.removeAttribute(t):console.warn(`invalid attribute "${t}" type is "${typeof e}"`)},entries:(r,t)=>{for(let[e,s]of t)y.any(r,e,s)},record:(r,t)=>y.entries(r,Object.entries(t))};function Ye(r,t={}){let e=document.createElement(r);return y.record(e,t),e}function Je(r){let t=document.createDocumentFragment();return x(r,t),t.firstElementChild}function Lt(r,t){let e=[];for(let[s,o]of Object.entries(t))if(typeof o=="function")r.addEventListener(s,o),e.push(()=>r.removeEventListener(s,o));else{let[n,i]=o;r.addEventListener(s,i,n),e.push(()=>r.removeEventListener(s,i))}return()=>e.forEach(s=>s())}function Xe(r,t){let e=new MutationObserver(t);return e.observe(r,{attributes:!0}),()=>e.disconnect()}var Nt=class{element;constructor(t){this.element=t}strings=new Proxy({},{get:(t,e)=>E.string(this.element,e),set:(t,e,s)=>y.string(this.element,e,s)});numbers=new Proxy({},{get:(t,e)=>E.number(this.element,e),set:(t,e,s)=>y.number(this.element,e,s)});booleans=new Proxy({},{get:(t,e)=>E.boolean(this.element,e),set:(t,e,s)=>y.boolean(this.element,e,s)})};var Qe=(r,t,e={})=>new Proxy(t,{get:(s,o)=>{switch(t[o]){case String:return E.string(r,o);case Number:return E.number(r,o);case Boolean:return E.boolean(r,o);default:throw new Error(`invalid attribute type for "${o}"`)}},set:(s,o,n)=>{try{switch(e.beforeSet?.(o),t[o]){case String:return y.string(r,o,n);case Number:return y.number(r,o,n);case Boolean:return y.boolean(r,o,n);default:throw new Error(`invalid attribute type for "${o}"`)}}finally{e.afterSet?.(o)}}});function Q(r){let t=new Nt(r);return{strings:t.strings,numbers:t.numbers,booleans:t.booleans,on:e=>Xe(r,e),spec:(e,s={})=>Qe(r,e,s)}}Q.get=E;Q.set=y;function Ze(r){return new we(r)}var we=class{tagName;#t=new Map;#e=[];constructor(t){this.tagName=t}attr(t,e=!0){return this.#t.set(t,e),this}attrs(t){for(let[e,s]of Object.entries(t))this.attr(e,s);return this}children(...t){return this.#e.push(...t),this}done(){let t=document.createElement(this.tagName);return y.entries(t,this.#t),t.append(...this.#e),t}};function Z(r,t=document){let e=t.querySelector(r);if(!e)throw new Error(`element not found (${r})`);return e}function jt(r,t=document){return t.querySelector(r)}function Dt(r,t=document){return Array.from(t.querySelectorAll(r))}var Ht=class r{element;#t;constructor(t){this.element=t}in(t){return new r(typeof t=="string"?Z(t,this.element):t)}require(t){return Z(t,this.element)}maybe(t){return jt(t,this.element)}all(t){return Dt(t,this.element)}render(...t){return x(t,this.element)}get attrs(){return this.#t??=Q(this.element)}events(t){return Lt(this.element,t)}};function tr(r){return r.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function er(r,t={}){let{soft:e=!1,upgrade:s=!0}=t;for(let[o,n]of Object.entries(r)){let i=tr(o),c=customElements.get(i);e&&c||(customElements.define(i,n),s&&document.querySelectorAll(i).forEach(a=>{a.constructor===HTMLElement&&customElements.upgrade(a)}))}}function w(r,t=document){return Z(r,t)}w.in=(r,t=document)=>new Ht(t).in(r);w.need=Z;w.maybe=jt;w.all=Dt;w.el=Ye;w.elmer=Ze;w.mk=Je;w.events=Lt;w.attrs=Q;w.register=er;w.render=(r,...t)=>x(t,r);function rr(r,t){let e,s,o=[];function n(){e=[],s&&clearTimeout(s),s=void 0,o=[]}return n(),((...i)=>{e=i,s&&clearTimeout(s);let c=new Promise((a,u)=>{o.push({resolve:a,reject:u})});return s=setTimeout(()=>{Promise.resolve().then(()=>t(...e)).then(a=>{for(let{resolve:u}of o)u(a);n()}).catch(a=>{for(let{reject:u}of o)u(a);n()})},r),c})}function sr(){let r,t,e=new Promise((s,o)=>{r=s,t=o});return e.resolve=r,e.reject=t,e.promise=e,e.entangle=s=>(s.then(r,t),e),e}var $={};Kr($,{clone:()=>lt,equal:()=>is,freeze:()=>as});function lt(r,t=new Set){if(t.has(r))throw new Error("cannot clone circular reference");let e;return typeof r=="function"||r!==null&&typeof r=="object"?(t.add(r),Array.isArray(r)?e=r.map(s=>lt(s,new Set(t))):r.constructor===Object?e=Object.fromEntries(Object.entries(r).map(([s,o])=>[s,lt(o,new Set(t))])):r instanceof Map?e=new Map(Array.from(r,([s,o])=>[s,lt(o,new Set(t))])):r instanceof Set?e=new Set(Array.from(r,s=>lt(s,new Set(t)))):r instanceof Date?e=new Date(r.getTime()):e=r,t.delete(r)):e=r,e}function os(r){return r!=null}function ns(r){return r==null}var ft=Object.freeze({happy:os,sad:ns,boolean:r=>typeof r=="boolean",number:r=>typeof r=="number",string:r=>typeof r=="string",bigint:r=>typeof r=="bigint",object:r=>typeof r=="object"&&r!==null,array:r=>Array.isArray(r),fn:r=>typeof r=="function",symbol:r=>typeof r=="symbol"});var is=(r,t)=>{function e(s,o,n){if(!ft.object(s)||!ft.object(o))return s===o;if(n.includes(s))throw new Error("forbidden circularity detected in deep equal comparison");let i=[...n,s];if(s instanceof Map&&o instanceof Map){if(s.size!==o.size)return!1;for(let[c,a]of s)if(!o.has(c)||!e(a,o.get(c),i))return!1}else if(s instanceof Set&&o instanceof Set){if(s.size!==o.size)return!1;for(let c of s)if(!Array.from(o).some(a=>e(c,a,i)))return!1}else{let c=Object.keys(s),a=Object.keys(o);if(c.length!==a.length)return!1;for(let u of c)if(!a.includes(u)||!e(s[u],o[u],i))return!1}return!0}return e(r,t,[])};function as(r){function t(e,s){if(!ft.object(e)||s.includes(e))return e;let o=[...s,e];if(e instanceof Map)for(let n of e.entries())for(let i of n)t(i,o);else if(e instanceof Set)for(let n of e)t(n,o);else if(Array.isArray(e))for(let n of e)t(n,o);else for(let n of Object.values(e))t(n,o);return Object.freeze(e)}return t(r,[])}function or(r){if(r.ok)return r.value;let{error:t}=r;throw t instanceof Error?t:typeof t=="string"?new Error(t):new Error("unknown")}function nr(r){if(r.ok)throw new Error("didn't get needed error");return r.error}function ir(r,t,e=typeof t=="string"?`needed key not found "${t}"`:"needed key not found"){if(r.has(t))return r.get(t);throw new Error(e)}function tt(r,t,e){if(r.has(t))return r.get(t);{let s=e();return r.set(t,s),s}}function mt(r,t){for(let[e,s]of t)r.set(e,s);return r}function Ut(){let r=[];function t(){let e=r;r=[];for(let s=e.length-1;s>=0;s--)e[s]()}return t.schedule=(...e)=>(r.push(...e),t),t.own=(e,s)=>(r.push(()=>s(e)),e),t}function V(r,t){let e=Object.entries(t);for(let[s,o]of e)r.addEventListener(s,o);return()=>{for(let[s,o]of e)r.removeEventListener(s,o)}}function $e(r){return new be(r)}var be=class r{#t;static with=$e;constructor(t){this.#t=t}to(t){return new r(t(this.#t))}done(){return this.#t}line(...t){let e=this.#t;for(let s of t)e=s(e);return e}};function cs(){let r=new Set;async function t(...a){await Promise.all([...r].map(u=>u(...a)))}function e(a){return r.add(a),()=>{r.delete(a)}}async function s(...a){return t(...a)}function o(a){return e(a)}async function n(a){let{promise:u,resolve:l}=sr(),h=o(async(...f)=>{a&&await a(...f),l(f),h()});return u}function i(){r.clear()}let c={pub:s,sub:o,publish:t,subscribe:e,on:e,next:n,clear:i};return Object.assign(o,c),Object.assign(s,c),c}function ar(r){let t=cs();return r&&t.sub(r),t.sub}var zt=class{#t=new Set;#e=[];#r=new WeakMap;#o=0;#s=new Set;read(t){this.#e.at(-1)?.add(t)}write(t){let e=this.#r.get(t);if(e){for(let s of e)this.#s.add(s);this.#o===0&&this.#n()}}observe(t){let e=new Set;this.#e.push(e);try{let s=t();return{seen:e,value:s}}finally{this.#e.pop()}}subscribe(t,e){let s=tt(this.#r,t,()=>new Set);return s.add(e),()=>{s.delete(e),s.size===0&&this.#r.delete(t)}}batch=t=>{this.#o++;try{return t()}finally{this.#o--,this.#o===0&&this.#n()}};#i(t){if(this.#t.has(t))throw new Error("circularity forbidden");this.#t.add(t);try{t()}finally{this.#t.delete(t)}}#n(){for(;this.#s.size>0;){let t=[...this.#s];this.#s.clear();for(let e of t)this.#i(e)}}};var p=globalThis[Symbol.for("e280.tracker.2")]??=new zt;function L(r){function t(){return arguments.length===0?(p.read(t),r):(r=arguments[0],p.write(t),r)}return t.get=()=>t(),t.set=e=>t(e),t}function Ae(r,t){let{seen:e,value:s}=p.observe(r),o=[...e].map(i=>p.subscribe(i,t));return{value:s,dispose:()=>o.forEach(i=>i())}}function et(r){let t,e=!0,s=!1,o=!1,n=()=>{},i=()=>{n(),n=()=>{},e=!0},c=()=>{(!e||s)&&(e=!0,p.write(u))},a=()=>{if(o)throw new Error("derived circularity forbidden");o=!0;try{let l=Ae(r,()=>c());n(),n=l.dispose,t=l.value,e=!1,s=!1}catch(l){throw s=!0,l}finally{o=!1}};function u(){return p.read(u),e&&a(),t}return u.get=()=>u(),u.dispose=i,u}var R=class extends Map{get size(){return p.read(this),super.size}[Symbol.iterator](){return p.read(this),super[Symbol.iterator]()}forEach(t){p.read(this);for(let[e,s]of this)t(s,e,this);return this}keys(){return p.read(this),super.keys()}values(){return p.read(this),super.values()}entries(){return p.read(this),super.entries()}has(t){return p.read(this),super.has(t)}get(t){return p.read(this),super.get(t)}set(t,e){return super.set(t,e),p.write(this),this}delete(t){let e=super.delete(t);return p.write(this),e}clear(){return super.clear(),p.write(this),this}};var dt=class extends Set{get size(){return p.read(this),super.size}[Symbol.iterator](){return p.read(this),super[Symbol.iterator]()}forEach(t){p.read(this);for(let e of this)t(e,e,this);return this}values(){return p.read(this),super.values()}has(t){return p.read(this),super.has(t)}add(t){return super.add(t),p.write(this),this}delete(t){let e=super.delete(t);return p.write(this),e}clear(){return super.clear(),p.write(this),this}};var Ln=p.batch;function cr(r){return $.freeze($.clone(r))}var C=Symbol("optic");var gt=class{calculate;#t=!1;#e;constructor(t){this.calculate=t,this.#e=t()}get(){return this.#t&&(this.#t=!1,this.#e=this.calculate()),this.#e}invalidate(){this.#t=!0}};var qt=class r{[C];#t;#e;#r;constructor(t){this[C]=t,this.#t=$.clone(t.getState()),this.#e=new gt(()=>$.clone(t.getState())),this.#r=new gt(()=>cr(t.getState()))}update(){let t=this[C].getState();!$.equal(t,this.#t)&&(this.#e.invalidate(),this.#r.invalidate(),this.#t=$.clone(t),p.write(this))}get state(){return p.read(this),this.#e.get()}get frozen(){return p.read(this),this.#r.get()}mutate(t){return this[C].mutate(t)}lens(t){let e=new r({getState:()=>t(this[C].getState()),mutate:s=>this[C].mutate(o=>s(t(o))),registerLens:this[C].registerLens});return this[C].registerLens(e),e}};var Bt=class{key;storage;constructor(t,e=window.localStorage){this.key=t,this.storage=e}async get(){let t=this.storage.getItem(this.key);return t?JSON.parse(t):void 0}async set(t){let e=JSON.stringify(t);this.storage.setItem(this.key,e)}onStorageEvent(t){let e=s=>{s.storageArea===this.storage&&s.key===this.key&&t()};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}};function ur(r){if(!r.done)throw new Error("wait not done");return or(r)}function pr(r){if(!r.done)throw new Error("wait not done");return nr(r)}var hr=r=>!r.done;var ve=r=>r.done&&r.ok;function lr(r,t){let{pending:e=()=>{},ok:s=()=>{},err:o=()=>{}}=t;return hr(r)?e():ve(r)?s(ur(r)):o(pr(r))}function xt(){let r,t,e=new Promise((o,n)=>{r=o,t=n});function s(o){return o.then(r).catch(t),e}return{promise:e,resolve:r,reject:t,entangle:s}}function It(r){let t=null;return((...e)=>(t?t.params=e:(t={params:e,deferred:xt()},queueMicrotask(()=>{let{params:s,deferred:o}=t;t=null,Promise.resolve(r(...s)).then(o.resolve).catch(o.reject)})),t.deferred.promise))}function fr(r,t,e){if(r.has(t))return r.get(t);{let s=e();return r.set(t,s),s}}function mr(r){let t,e=!1,s=()=>{e=!0,clearTimeout(t)},o=async()=>{e||(await r(s),!e&&(t=setTimeout(o,0)))};return o(),s}var dr=(r=0)=>new Promise(t=>setTimeout(t,r));var Vt=A`
|
|
1
|
+
var _s=Object.defineProperty;var Cs=(r,t)=>{for(var e in t)_s(r,e,{get:t[e],enumerable:!0})};function Pr(r){return r.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function te(r,t={}){let{soft:e=!1,upgrade:o=!0}=t;for(let[s,n]of Object.entries(r)){let i=Pr(s),a=customElements.get(i);e&&a||(customElements.define(i,n),o&&document.querySelectorAll(i).forEach(c=>{c.constructor===HTMLElement&&customElements.upgrade(c)}))}}var ee=globalThis,re=ee.ShadowRoot&&(ee.ShadyCSS===void 0||ee.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,or=Symbol(),zr=new WeakMap,Bt=class{constructor(t,e,o){if(this._$cssResult$=!0,o!==or)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(re&&t===void 0){let o=e!==void 0&&e.length===1;o&&(t=zr.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),o&&zr.set(e,t))}return t}toString(){return this.cssText}},Or=r=>new Bt(typeof r=="string"?r:r+"",void 0,or),b=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((o,s,n)=>o+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+r[n+1],r[0]);return new Bt(e,r,or)},oe=(r,t)=>{if(re)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let o=document.createElement("style"),s=ee.litNonce;s!==void 0&&o.setAttribute("nonce",s),o.textContent=e.cssText,r.appendChild(o)}},pt=re?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let o of t.cssRules)e+=o.cssText;return Or(e)})(r):r;var{is:Es,defineProperty:Ms,getOwnPropertyDescriptor:Ps,getOwnPropertyNames:zs,getOwnPropertySymbols:Os,getPrototypeOf:Ts}=Object,se=globalThis,Tr=se.trustedTypes,Bs=Tr?Tr.emptyScript:"",js=se.reactiveElementPolyfillSupport,jt=(r,t)=>r,sr={toAttribute(r,t){switch(t){case Boolean:r=r?Bs:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},jr=(r,t)=>!Es(r,t),Br={attribute:!0,type:String,converter:sr,reflect:!1,useDefault:!1,hasChanged:jr};Symbol.metadata??=Symbol("metadata"),se.litPropertyMetadata??=new WeakMap;var N=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Br){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let o=Symbol(),s=this.getPropertyDescriptor(t,o,e);s!==void 0&&Ms(this.prototype,t,s)}}static getPropertyDescriptor(t,e,o){let{get:s,set:n}=Ps(this.prototype,t)??{get(){return this[e]},set(i){this[e]=i}};return{get:s,set(i){let a=s?.call(this);n?.call(this,i),this.requestUpdate(t,a,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Br}static _$Ei(){if(this.hasOwnProperty(jt("elementProperties")))return;let t=Ts(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(jt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(jt("properties"))){let e=this.properties,o=[...zs(e),...Os(e)];for(let s of o)this.createProperty(s,e[s])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[o,s]of e)this.elementProperties.set(o,s)}this._$Eh=new Map;for(let[e,o]of this.elementProperties){let s=this._$Eu(e,o);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let o=new Set(t.flat(1/0).reverse());for(let s of o)e.unshift(pt(s))}else t!==void 0&&e.push(pt(t));return e}static _$Eu(t,e){let o=e.attribute;return o===!1?void 0:typeof o=="string"?o:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let o of e.keys())this.hasOwnProperty(o)&&(t.set(o,this[o]),delete this[o]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return oe(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,o){this._$AK(t,o)}_$ET(t,e){let o=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,o);if(s!==void 0&&o.reflect===!0){let n=(o.converter?.toAttribute!==void 0?o.converter:sr).toAttribute(e,o.type);this._$Em=t,n==null?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(t,e){let o=this.constructor,s=o._$Eh.get(t);if(s!==void 0&&this._$Em!==s){let n=o.getPropertyOptions(s),i=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:sr;this._$Em=s;let a=i.fromAttribute(e,n.type);this[s]=a??this._$Ej?.get(s)??a,this._$Em=null}}requestUpdate(t,e,o,s=!1,n){if(t!==void 0){let i=this.constructor;if(s===!1&&(n=this[t]),o??=i.getPropertyOptions(t),!((o.hasChanged??jr)(n,e)||o.useDefault&&o.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,o))))return;this.C(t,e,o)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:o,reflect:s,wrapped:n},i){o&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),n!==!0||i!==void 0)||(this._$AL.has(t)||(this.hasUpdated||o||(e=void 0),this._$AL.set(t,e)),s===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[s,n]of this._$Ep)this[s]=n;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[s,n]of o){let{wrapped:i}=n,a=this[s];i!==!0||this._$AL.has(s)||a===void 0||this.C(s,void 0,n,a)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(o=>o.hostUpdate?.()),this.update(e)):this._$EM()}catch(o){throw t=!1,this._$EM(),o}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};N.elementStyles=[],N.shadowRootOptions={mode:"open"},N[jt("elementProperties")]=new Map,N[jt("finalized")]=new Map,js?.({ReactiveElement:N}),(se.reactiveElementVersions??=[]).push("2.1.2");var ir=globalThis,Dr=r=>r,ne=ir.trustedTypes,Rr=ne?ne.createPolicy("lit-html",{createHTML:r=>r}):void 0,ar="$lit$",I=`lit$${Math.random().toFixed(9).slice(2)}$`,cr="?"+I,Ds=`<${cr}>`,tt=document,Rt=()=>tt.createComment(""),Lt=r=>r===null||typeof r!="object"&&typeof r!="function",lr=Array.isArray,Ur=r=>lr(r)||typeof r?.[Symbol.iterator]=="function",nr=`[
|
|
2
|
+
\f\r]`,Dt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Lr=/-->/g,Nr=/>/g,X=RegExp(`>|${nr}(?:([^\\s"'>=/]+)(${nr}*=${nr}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ir=/'/g,Hr=/"/g,qr=/^(?:script|style|textarea|title)$/i,ur=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),h=ur(1),f=ur(2),On=ur(3),et=Symbol.for("lit-noChange"),w=Symbol.for("lit-nothing"),Vr=new WeakMap,Y=tt.createTreeWalker(tt,129);function Wr(r,t){if(!lr(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Rr!==void 0?Rr.createHTML(t):t}var Fr=(r,t)=>{let e=r.length-1,o=[],s,n=t===2?"<svg>":t===3?"<math>":"",i=Dt;for(let a=0;a<e;a++){let c=r[a],l,p,u=-1,m=0;for(;m<c.length&&(i.lastIndex=m,p=i.exec(c),p!==null);)m=i.lastIndex,i===Dt?p[1]==="!--"?i=Lr:p[1]!==void 0?i=Nr:p[2]!==void 0?(qr.test(p[2])&&(s=RegExp("</"+p[2],"g")),i=X):p[3]!==void 0&&(i=X):i===X?p[0]===">"?(i=s??Dt,u=-1):p[1]===void 0?u=-2:(u=i.lastIndex-p[2].length,l=p[1],i=p[3]===void 0?X:p[3]==='"'?Hr:Ir):i===Hr||i===Ir?i=X:i===Lr||i===Nr?i=Dt:(i=X,s=void 0);let _=i===X&&r[a+1].startsWith("/>")?" ":"";n+=i===Dt?c+Ds:u>=0?(o.push(l),c.slice(0,u)+ar+c.slice(u)+I+_):c+I+(u===-2?a:_)}return[Wr(r,n+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),o]},Nt=class r{constructor({strings:t,_$litType$:e},o){let s;this.parts=[];let n=0,i=0,a=t.length-1,c=this.parts,[l,p]=Fr(t,e);if(this.el=r.createElement(l,o),Y.currentNode=this.el.content,e===2||e===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(s=Y.nextNode())!==null&&c.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(let u of s.getAttributeNames())if(u.endsWith(ar)){let m=p[i++],_=s.getAttribute(u).split(I),Q=/([.?@])?(.*)/.exec(m);c.push({type:1,index:n,name:Q[2],strings:_,ctor:Q[1]==="."?ae:Q[1]==="?"?ce:Q[1]==="@"?le:ot}),s.removeAttribute(u)}else u.startsWith(I)&&(c.push({type:6,index:n}),s.removeAttribute(u));if(qr.test(s.tagName)){let u=s.textContent.split(I),m=u.length-1;if(m>0){s.textContent=ne?ne.emptyScript:"";for(let _=0;_<m;_++)s.append(u[_],Rt()),Y.nextNode(),c.push({type:2,index:++n});s.append(u[m],Rt())}}}else if(s.nodeType===8)if(s.data===cr)c.push({type:2,index:n});else{let u=-1;for(;(u=s.data.indexOf(I,u+1))!==-1;)c.push({type:7,index:n}),u+=I.length-1}n++}}static createElement(t,e){let o=tt.createElement("template");return o.innerHTML=t,o}};function rt(r,t,e=r,o){if(t===et)return t;let s=o!==void 0?e._$Co?.[o]:e._$Cl,n=Lt(t)?void 0:t._$litDirective$;return s?.constructor!==n&&(s?._$AO?.(!1),n===void 0?s=void 0:(s=new n(r),s._$AT(r,e,o)),o!==void 0?(e._$Co??=[])[o]=s:e._$Cl=s),s!==void 0&&(t=rt(r,s._$AS(r,t.values),s,o)),t}var ie=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:o}=this._$AD,s=(t?.creationScope??tt).importNode(e,!0);Y.currentNode=s;let n=Y.nextNode(),i=0,a=0,c=o[0];for(;c!==void 0;){if(i===c.index){let l;c.type===2?l=new ht(n,n.nextSibling,this,t):c.type===1?l=new c.ctor(n,c.name,c.strings,this,t):c.type===6&&(l=new ue(n,this,t)),this._$AV.push(l),c=o[++a]}i!==c?.index&&(n=Y.nextNode(),i++)}return Y.currentNode=tt,s}p(t){let e=0;for(let o of this._$AV)o!==void 0&&(o.strings!==void 0?(o._$AI(t,o,e),e+=o.strings.length-2):o._$AI(t[e])),e++}},ht=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,o,s){this.type=2,this._$AH=w,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=o,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=rt(this,t,e),Lt(t)?t===w||t==null||t===""?(this._$AH!==w&&this._$AR(),this._$AH=w):t!==this._$AH&&t!==et&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ur(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==w&&Lt(this._$AH)?this._$AA.nextSibling.data=t:this.T(tt.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:o}=t,s=typeof o=="number"?this._$AC(t):(o.el===void 0&&(o.el=Nt.createElement(Wr(o.h,o.h[0]),this.options)),o);if(this._$AH?._$AD===s)this._$AH.p(e);else{let n=new ie(s,this),i=n.u(this.options);n.p(e),this.T(i),this._$AH=n}}_$AC(t){let e=Vr.get(t.strings);return e===void 0&&Vr.set(t.strings,e=new Nt(t)),e}k(t){lr(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,o,s=0;for(let n of t)s===e.length?e.push(o=new r(this.O(Rt()),this.O(Rt()),this,this.options)):o=e[s],o._$AI(n),s++;s<e.length&&(this._$AR(o&&o._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let o=Dr(t).nextSibling;Dr(t).remove(),t=o}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},ot=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,o,s,n){this.type=1,this._$AH=w,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=n,o.length>2||o[0]!==""||o[1]!==""?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=w}_$AI(t,e=this,o,s){let n=this.strings,i=!1;if(n===void 0)t=rt(this,t,e,0),i=!Lt(t)||t!==this._$AH&&t!==et,i&&(this._$AH=t);else{let a=t,c,l;for(t=n[0],c=0;c<n.length-1;c++)l=rt(this,a[o+c],e,c),l===et&&(l=this._$AH[c]),i||=!Lt(l)||l!==this._$AH[c],l===w?t=w:t!==w&&(t+=(l??"")+n[c+1]),this._$AH[c]=l}i&&!s&&this.j(t)}j(t){t===w?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},ae=class extends ot{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===w?void 0:t}},ce=class extends ot{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==w)}},le=class extends ot{constructor(t,e,o,s,n){super(t,e,o,s,n),this.type=5}_$AI(t,e=this){if((t=rt(this,t,e,0)??w)===et)return;let o=this._$AH,s=t===w&&o!==w||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==w&&(o===w||s);s&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},ue=class{constructor(t,e,o){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(t){rt(this,t)}},Gr={M:ar,P:I,A:cr,C:1,L:Fr,R:ie,D:Ur,V:rt,I:ht,H:ot,N:ce,U:le,B:ae,F:ue},Rs=ir.litHtmlPolyfillSupport;Rs?.(Nt,ht),(ir.litHtmlVersions??=[]).push("3.3.3");var x=(r,t,e)=>{let o=e?.renderBefore??t,s=o._$litPart$;if(s===void 0){let n=e?.renderBefore??null;o._$litPart$=s=new ht(t.insertBefore(Rt(),n),n,void 0,e??{})}return s._$AI(r),s};var pr=globalThis,dt=class extends N{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=x(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return et}};dt._$litElement$=!0,dt.finalized=!0,pr.litElementHydrateSupport?.({LitElement:dt});var Ls=pr.litElementPolyfillSupport;Ls?.({LitElement:dt});(pr.litElementVersions??=[]).push("4.2.2");var P={string:(r,t)=>r.getAttribute(t)??void 0,number:(r,t)=>{let e=r.getAttribute(t);return e===null||!e?void 0:Number(e)},boolean:(r,t)=>r.getAttribute(t)!==null},$={string:(r,t,e)=>(e===void 0?r.removeAttribute(t):r.setAttribute(t,e),!0),number:(r,t,e)=>(e===void 0?r.removeAttribute(t):r.setAttribute(t,e.toString()),!0),boolean:(r,t,e)=>(e?r.setAttribute(t,""):r.removeAttribute(t),!0),any:(r,t,e)=>{e==null?r.removeAttribute(t):typeof e=="string"?r.setAttribute(t,e):typeof e=="number"?r.setAttribute(t,e.toString()):typeof e=="boolean"?e===!0?r.setAttribute(t,""):r.removeAttribute(t):console.warn(`invalid attribute "${t}" type is "${typeof e}"`)},entries:(r,t)=>{for(let[e,o]of t)$.any(r,e,o)},record:(r,t)=>$.entries(r,Object.entries(t))};function Kr(r,t={}){let e=document.createElement(r);return $.record(e,t),e}function Jr(r){let t=document.createDocumentFragment();return x(r,t),t.firstElementChild}function pe(r,t){let e=[];for(let[o,s]of Object.entries(t))if(typeof s=="function")r.addEventListener(o,s),e.push(()=>r.removeEventListener(o,s));else{let[n,i]=s;r.addEventListener(o,i,n),e.push(()=>r.removeEventListener(o,i))}return()=>e.forEach(o=>o())}function Zr(r,t){let e=new MutationObserver(t);return e.observe(r,{attributes:!0}),()=>e.disconnect()}var he=class{element;constructor(t){this.element=t}strings=new Proxy({},{get:(t,e)=>P.string(this.element,e),set:(t,e,o)=>$.string(this.element,e,o)});numbers=new Proxy({},{get:(t,e)=>P.number(this.element,e),set:(t,e,o)=>$.number(this.element,e,o)});booleans=new Proxy({},{get:(t,e)=>P.boolean(this.element,e),set:(t,e,o)=>$.boolean(this.element,e,o)})};var Qr=(r,t,e={})=>new Proxy(t,{get:(o,s)=>{switch(t[s]){case String:return P.string(r,s);case Number:return P.number(r,s);case Boolean:return P.boolean(r,s);default:throw new Error(`invalid attribute type for "${s}"`)}},set:(o,s,n)=>{try{switch(e.beforeSet?.(s),t[s]){case String:return $.string(r,s,n);case Number:return $.number(r,s,n);case Boolean:return $.boolean(r,s,n);default:throw new Error(`invalid attribute type for "${s}"`)}}finally{e.afterSet?.(s)}}});function mt(r){let t=new he(r);return{strings:t.strings,numbers:t.numbers,booleans:t.booleans,on:e=>Zr(r,e),spec:(e,o={})=>Qr(r,e,o)}}mt.get=P;mt.set=$;function Xr(r){return new hr(r)}var hr=class{tagName;#t=new Map;#e=[];constructor(t){this.tagName=t}attr(t,e=!0){return this.#t.set(t,e),this}attrs(t){for(let[e,o]of Object.entries(t))this.attr(e,o);return this}children(...t){return this.#e.push(...t),this}done(){let t=document.createElement(this.tagName);return $.entries(t,this.#t),t.append(...this.#e),t}};function ft(r,t=document){let e=t.querySelector(r);if(!e)throw new Error(`element not found (${r})`);return e}function de(r,t=document){return t.querySelector(r)}function me(r,t=document){return Array.from(t.querySelectorAll(r))}var fe=class r{element;#t;constructor(t){this.element=t}in(t){return new r(typeof t=="string"?ft(t,this.element):t)}require(t){return ft(t,this.element)}maybe(t){return de(t,this.element)}all(t){return me(t,this.element)}render(...t){return x(t,this.element)}get attrs(){return this.#t??=mt(this.element)}events(t){return pe(this.element,t)}};function g(r,t=document){return ft(r,t)}g.in=(r,t=document)=>new fe(t).in(r);g.need=ft;g.maybe=de;g.all=me;g.el=Kr;g.elmer=Xr;g.mk=Jr;g.events=pe;g.attrs=mt;g.register=te;g.render=(r,...t)=>x(t,r);var $e={};Cs($e,{DragAndDrops:()=>xr,Drops:()=>yr,files:()=>Gs,hasFiles:()=>Fs,outsideCurrentTarget:()=>qt});var Yr=Object.freeze({eq(r,t){if(r.length!==t.length)return!1;let e=0;for(let o=0;o<r.length;o++)e|=r[o]^t[o];return e===0},random(r){return crypto.getRandomValues(new Uint8Array(r))},concat(r){let t=0;for(let s of r)t+=s.byteLength;let e=new Uint8Array(t),o=0;for(let s of r)e.set(s,o),o+=s.byteLength;return e}});var v=class{lexicon;static lexicons=Object.freeze({base2:{characters:"01"},hex:{characters:"0123456789abcdef",caseInsensitive:!0},base36:{characters:"0123456789abcdefghijklmnopqrstuvwxyz"},base58:{characters:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"},base62:{characters:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"},base64url:{negativePrefix:"~",characters:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},base64:{characters:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",padding:{character:"=",size:4}}});lookup;negativePrefix;constructor(t){this.lexicon=t,this.lookup=Object.fromEntries([...t.characters].map((o,s)=>[o,s])),this.negativePrefix=t.negativePrefix??"-";let e=this.fromBytes.bind(this);return Object.setPrototypeOf(e,new.target.prototype),Object.assign(e,this),e}toBytes(t){this.lexicon.caseInsensitive&&(t=t.toLowerCase());let e=Math.log2(this.lexicon.characters.length);if(Number.isInteger(e)){let l=0,p=0,u=[];for(let m of t){if(m===this.lexicon.padding?.character)continue;let _=this.lookup[m];if(_===void 0)throw new Error(`Invalid character: ${m}`);for(l=l<<e|_,p+=e;p>=8;)p-=8,u.push(l>>p&255)}return new Uint8Array(u)}let o=0n,s=BigInt(this.lexicon.characters.length);t.startsWith(this.negativePrefix)&&(t=t.slice(this.negativePrefix.length));let n=this.lexicon.characters[0],i=0;for(;t[i]===n;)i++;t=t.slice(i);for(let l of t){let p=this.lookup[l];if(p===void 0)throw new Error(`Invalid character: ${l}`);o=o*s+BigInt(p)}let a=new Uint8Array(i+(o===0n?0:this.countBytes(o))),c=a.length;for(;o>0n;)a[--c]=Number(o%256n),o=o/256n;return a}fromBytes(t){let e=Math.log2(this.lexicon.characters.length);if(Number.isInteger(e)){let c=0,l=0,p="";for(let u of t)for(c=c<<8|u,l+=8;l>=e;){l-=e;let m=c>>l&(1<<e)-1;p+=this.lexicon.characters[m]}if(l>0){let u=c<<e-l&(1<<e)-1;p+=this.lexicon.characters[u]}if(this.lexicon.padding)for(;p.length%this.lexicon.padding.size!==0;)p+=this.lexicon.padding.character;return p}if(t.length===0)return"";let o=this.lexicon.characters[0],s=0;for(;t[s]===0;)s++;let n=0n;for(let c of t.slice(s))n=(n<<8n)+BigInt(c);if(n===0n)return o.repeat(s);let i=BigInt(this.lexicon.characters.length),a="";for(;n>0n;)a=this.lexicon.characters[Number(n%i)]+a,n=n/i;return o.repeat(s)+a}toInteger(t){if(!t)return 0;let e=0n,o=!1,s=BigInt(this.lexicon.characters.length);t.startsWith(this.negativePrefix)&&(t=t.slice(this.negativePrefix.length),o=!0);for(let n of t){let i=this.lookup[n];if(i===void 0)throw new Error(`Invalid character: ${n}`);e=e*s+BigInt(i)}return Number(o?-e:e)}fromInteger(t){t=Math.floor(t);let e=t<0,o=BigInt(e?-t:t);if(o===0n)return this.lexicon.characters[0];let s=BigInt(this.lexicon.characters.length),n="";for(;o>0n;)n=this.lexicon.characters[Number(o%s)]+n,o=o/s;return e?`${this.negativePrefix}${n}`:n}random(t=32){return this.fromBytes(Yr.random(t))}countBytes(t){let e=0;for(;t>0n;)e++,t=t/256n;return e}};var ge=new v(v.lexicons.hex),Li=new v(v.lexicons.base2),Ni=new v(v.lexicons.base36),Ii=new v(v.lexicons.base58),Hi=new v(v.lexicons.base62),Vi=new v(v.lexicons.base64),Ui=new v(v.lexicons.base64url);function to(r,t){let e,o,s=[];function n(){e=[],o&&clearTimeout(o),o=void 0,s=[]}return n(),((...i)=>{e=i,o&&clearTimeout(o);let a=new Promise((c,l)=>{s.push({resolve:c,reject:l})});return o=setTimeout(()=>{Promise.resolve().then(()=>t(...e)).then(c=>{for(let{resolve:l}of s)l(c);n()}).catch(c=>{for(let{reject:l}of s)l(c);n()})},r),a})}function st(){let r,t,e=new Promise((o,s)=>{r=o,t=s});return e.resolve=r,e.reject=t,e.promise=e,e.entangle=o=>(o.then(r,t),e),e}function gt(r){let t=null;return((...e)=>(t?t.params=e:(t={params:e,deferred:st()},queueMicrotask(()=>{let{params:o,deferred:s}=t;t=null,Promise.resolve(r(...o)).then(s.resolve).catch(s.reject)})),t.deferred.promise))}function z(r,t=new Set){if(t.has(r))throw new Error("cannot clone circular reference");let e;return typeof r=="function"||r!==null&&typeof r=="object"?(t.add(r),Array.isArray(r)?e=r.map(o=>z(o,new Set(t))):r.constructor===Object?e=Object.fromEntries(Object.entries(r).map(([o,s])=>[o,z(s,new Set(t))])):r instanceof Map?e=new Map(Array.from(r,([o,s])=>[o,z(s,new Set(t))])):r instanceof Set?e=new Set(Array.from(r,o=>z(o,new Set(t)))):r instanceof Date?e=new Date(r.getTime()):e=r,t.delete(r)):e=r,e}function C(r){return r!=null}var bt=r=>typeof r=="number",xt=r=>typeof r=="string";var It=r=>typeof r=="object"&&r!==null,be=r=>Array.isArray(r);function Ns(r){return r!=null}function Is(r){return r==null}var Zi=Object.freeze({happy:Ns,sad:Is,boolean:r=>typeof r=="boolean",number:r=>typeof r=="number",string:r=>typeof r=="string",bigint:r=>typeof r=="bigint",object:r=>typeof r=="object"&&r!==null,array:r=>Array.isArray(r),fn:r=>typeof r=="function",symbol:r=>typeof r=="symbol"});var eo=(r,t)=>{function e(o,s,n){if(!It(o)||!It(s))return o===s;if(n.includes(o))throw new Error("forbidden circularity detected in deep equal comparison");let i=[...n,o];if(o instanceof Map&&s instanceof Map){if(o.size!==s.size)return!1;for(let[a,c]of o)if(!s.has(a)||!e(c,s.get(a),i))return!1}else if(o instanceof Set&&s instanceof Set){if(o.size!==s.size)return!1;for(let a of o)if(!Array.from(s).some(c=>e(a,c,i)))return!1}else{let a=Object.keys(o),c=Object.keys(s);if(a.length!==c.length)return!1;for(let l of a)if(!c.includes(l)||!e(o[l],s[l],i))return!1}return!0}return e(r,t,[])};function nt(r){function t(e,o){if(!It(e)||o.includes(e))return e;let s=[...o,e];if(e instanceof Map)for(let n of e.entries())for(let i of n)t(i,s);else if(e instanceof Set)for(let n of e)t(n,s);else if(Array.isArray(e))for(let n of e)t(n,s);else for(let n of Object.values(e))t(n,s);return Object.freeze(e)}return t(r,[])}function ro(r){if(r.ok)return r.value;let{error:t}=r;throw t instanceof Error?t:typeof t=="string"?new Error(t):new Error("unknown")}function oo(r){if(r.ok)throw new Error("didn't get needed error");return r.error}var Hs=new TextEncoder;function dr(r){return r=Math.imul(r^r>>>15,r|1),r^=r+Math.imul(r^r>>>7,r|61),r^=r>>>14,r>>>0}function Vs(r){let t=2166136261;for(let e of Hs.encode(r))t^=e,t=Math.imul(t,16777619);return dr(t)}function so(...r){let t=2654435769;for(let e of r){let o=typeof e=="string"?Vs(e):e>>>0;t=t+1831565813>>>0,t^=dr(o),t=dr(t)}return t}function k(r,t="got failed"){if(r==null)throw new Error(t);return r}function yt(r,t,e){if(r.has(t))return r.get(t);{let o=e();return r.set(t,o),o}}function Ht(r,t){for(let[e,o]of t)r.set(e,o);return r}function xe(r,t){return t<=0?[]:r.length>t?r.slice(-t):r}async function mr(r){let t=[];for await(let e of r)t.push(e);return t}function wt(r){let t,e=!1,o=()=>{e=!0,clearTimeout(t)},s=async()=>{e||(await r(o),!e&&(t=setTimeout(s,0)))};return s(),o}function V(){let r=[],t=()=>{let o=r;r=[];for(let s=o.length-1;s>=0;s--)o[s]()};function e(){t()}return e.dispose=t,e.schedule=(...o)=>(r.push(...o),e),e.own=(o,s)=>(r.push(()=>s(o)),o),e.disposable=o=>(r.push(()=>o.dispose()),o),e.disposables=e.disposable,e}function E(r,t){let e=Object.entries(t);for(let[o,s]of e)r.addEventListener(o,s);return()=>{for(let[o,s]of e)r.removeEventListener(o,s)}}var vt=class{count;constructor(t=0){this.count=t}next(){return this.count++}};var $t=(r=0)=>new Promise(t=>setTimeout(t,r));var fr=(r,t)=>Object.fromEntries(Object.entries(r).map(([e,o])=>[e,t(o,e)])),Us=(r,t)=>Object.fromEntries(Object.entries(r).filter(([e,o])=>t(o,e)));function qs(r){return{map:t=>no(r,t),filter:t=>io(r,t)}}qs.pipe=Object.freeze({map:r=>(t=>no(t,r)),filter:r=>(t=>io(t,r))});var no=fr,io=Us;function U(r){let t=Ws(),e=o=>t.on(o);return Object.assign(e,t),r&&t.on(r),e}function Ws(){let r=new Set,t,e=()=>t??=st(),o=a=>{let c=t;t=void 0,c?.resolve(a)};return{set:r,on:a=>(r.add(a),()=>{r.delete(a)}),publish:(...a)=>{o(a);for(let c of[...r])c(...a)},publishAsync:async(...a)=>{o(a),await Promise.all([...r].map(async c=>c(...a)))},next:e}}function q(r,...t){let e=r.length-1;return r.slice(0,e).reduce((o,s,n)=>o+s+t[n],"")+r[e]}function kt(r,t,e){return r?t():e?.()}function ye(r,t,e){return C(r)?t(r):e?.()}var we=class{#t=new Set;#e=[];#o=new WeakMap;#r=0;#s=new Set;read(t){this.#e.at(-1)?.add(t)}write(t){let e=this.#o.get(t);if(e){for(let o of e)this.#s.add(o);this.#r===0&&this.#n()}}observe(t){let e=new Set;this.#e.push(e);try{let o=t();return{seen:e,value:o}}finally{this.#e.pop()}}subscribe(t,e){let o=yt(this.#o,t,()=>new Set);return o.add(e),()=>{o.delete(e),o.size===0&&this.#o.delete(t)}}batch=t=>{this.#r++;try{return t()}finally{this.#r--,this.#r===0&&this.#n()}};#i(t){if(this.#t.has(t))throw new Error("circularity forbidden");this.#t.add(t);try{t()}finally{this.#t.delete(t)}}#n(){for(;this.#s.size>0;){let t=[...this.#s];this.#s.clear();for(let e of t)this.#i(e)}}};var d=globalThis[Symbol.for("e280.tracker.2")]??=new we;function S(r){let t;function e(){return arguments.length===0?(d.read(e),r):(r=arguments[0],d.write(e),t?.publish(r),r)}return e.get=()=>e(),e.set=o=>e(o),e.on=o=>(t??=U())(o),e}var O=class extends Map{get size(){return d.read(this),super.size}[Symbol.iterator](){return d.read(this),super[Symbol.iterator]()}forEach(t){d.read(this);for(let[e,o]of this)t(o,e,this);return this}keys(){return d.read(this),super.keys()}values(){return d.read(this),super.values()}entries(){return d.read(this),super.entries()}has(t){return d.read(this),super.has(t)}get(t){return d.read(this),super.get(t)}set(t,e){return super.set(t,e),d.write(this),this}delete(t){let e=super.delete(t);return d.write(this),e}clear(){return super.clear(),d.write(this),this}};var Vt=class extends Set{get size(){return d.read(this),super.size}[Symbol.iterator](){return d.read(this),super[Symbol.iterator]()}forEach(t){d.read(this);for(let e of this)t(e,e,this);return this}values(){return d.read(this),super.values()}has(t){return d.read(this),super.has(t)}add(t){return super.add(t),d.write(this),this}delete(t){let e=super.delete(t);return d.write(this),e}clear(){return super.clear(),d.write(this),this}};var Fa=d.batch;function co(r){return nt(z(r))}var T=Symbol("optic");var Ut=class{calculate;#t=!1;#e;constructor(t){this.calculate=t,this.#e=t()}get(){return this.#t&&(this.#t=!1,this.#e=this.calculate()),this.#e}invalidate(){this.#t=!0}};var ve=class r{[T];#t;#e;#o;#r=U();constructor(t){this[T]=t,this.#t=z(t.getState()),this.#e=new Ut(()=>z(t.getState())),this.#o=new Ut(()=>co(t.getState()))}get on(){return this.#r.on}update(){let t=this[T].getState();!eo(t,this.#t)&&(this.#e.invalidate(),this.#o.invalidate(),this.#t=z(t),d.write(this),this.#r.set.size&&this.#r.publish(this.#e.get()))}get state(){return d.read(this),this.#e.get()}get frozen(){return d.read(this),this.#o.get()}mutate(t){return this[T].mutate(t)}lens(t){let e=new r({getState:()=>t(this[T].getState()),mutate:o=>this[T].mutate(s=>o(t(s))),registerLens:this[T].registerLens});return this[T].registerLens(e),e}};function lo(r){if(!r.done)throw new Error("wait not done");return ro(r)}function uo(r){if(!r.done)throw new Error("wait not done");return oo(r)}var po=r=>!r.done;var br=r=>r.done&&r.ok;function ho(r,t){let{pending:e=()=>{},ok:o=()=>{},err:s=()=>{}}=t;return po(r)?e():br(r)?o(lo(r)):s(uo(r))}function Fs(r){return!!(r.dataTransfer&&r.dataTransfer.types.includes("Files"))}function Gs(r){return r.dataTransfer?Array.from(r.dataTransfer.files):[]}function qt(r){let t=r.currentTarget,e=r.relatedTarget;return!t||!e||!t.contains(e)}var xr=class{params;$draggy=S(void 0);$droppy=S(void 0);constructor(t){this.params=t}get dragging(){return this.$draggy()}get hovering(){return this.$droppy()}dragzone=t=>({draggable:"true",dragstart:e=>{this.$draggy(t())},dragend:e=>{this.$draggy(void 0),this.$droppy(void 0)}});dropzone=t=>({dragenter:e=>{},dragover:e=>{e.preventDefault(),this.$draggy()?this.$droppy(t()):this.params.backchannelDrops?.dragover(e)},dragleave:e=>{qt(e)&&this.$droppy(void 0),this.params.backchannelDrops?.dragleave(e)},drop:e=>{e.preventDefault();let{acceptDrop:o}=this.params,s=this.$draggy(),n=this.$droppy();try{s&&n?o(e,s,n):this.params.backchannelDrops?.drop(e)}finally{this.$draggy(void 0),this.$droppy(void 0)}}})};var yr=class{params;$indicator=S(!1);constructor(t){this.params=t}dragover=t=>{t.preventDefault(),this.$indicator(this.params.predicate(t))};dragleave=t=>{qt(t)&&this.$indicator(!1)};drop=t=>{t.preventDefault(),this.$indicator(!1),this.params.predicate(t)&&this.params.acceptDrop(t)}};var St=b`
|
|
4
4
|
* {
|
|
5
5
|
margin: 0;
|
|
6
6
|
padding: 0;
|
|
@@ -14,152 +14,825 @@ var Wr=Object.defineProperty;var Kr=(r,t)=>{for(var e in t)Wr(r,e,{get:t[e],enum
|
|
|
14
14
|
::-webkit-scrollbar-track { background: transparent; }
|
|
15
15
|
::-webkit-scrollbar-thumb { background: #888; border-radius: 1em; }
|
|
16
16
|
::-webkit-scrollbar-thumb:hover { background: #999; }
|
|
17
|
-
`;var
|
|
17
|
+
`;var ke=class r extends HTMLElement{static register(){g.register({SlyShadow:r},{soft:!0})}connectedCallback(){this.hasAttribute("view")||this.setAttribute("view","")}};var Wt=class{render;count=0;rendered=st();constructor(t){this.render=t}doneRender(){this.count++,this.rendered.resolve(),this.rendered=st()}},W=class extends Wt{host;shadow;constructor(t,e,o){super(t),this.host=e,this.shadow=o}};var wr=class{#t=[];get scope(){let t=this.#t.at(-1);if(!t)throw new Error("hooks must be called within a render fn");return t}increment(){let t=this.scope,e=t.position++;return{scope:t,position:e}}wrap(t,e){t.position=0,this.#t.push(t);try{return e()}finally{this.#t.pop()}}},M=globalThis[Symbol.for("e280.hooks")]??=new wr;var F=class{#t=[];clear(){this.#t.forEach(t=>t()),this.#t=[]}observe(t,e){let{seen:o,value:s}=d.observe(t);this.clear();for(let n of o){let i=d.subscribe(n,e);this.#t.push(i)}return s}};var Se=class{#t=[];#e=[];mount(t){this.#t.push(t),this.#e.push(t())}unmountAll(){for(let t of this.#e)t();this.#e=[]}remountAll(){for(let t of this.#t)this.#e.push(t())}};var G=class{cx;position=0;values=new Map;mounts=new Se;constructor(t){this.cx=t}};var{I:eu}=Gr;var mo=r=>r.strings===void 0;var fo={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Ft=r=>(...t)=>({_$litDirective$:r,values:t}),Ae=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,o){this._$Ct=t,this._$AM=e,this._$Ci=o}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var Gt=(r,t)=>{let e=r._$AN;if(e===void 0)return!1;for(let o of e)o._$AO?.(t,!1),Gt(o,t);return!0},_e=r=>{let t,e;do{if((t=r._$AM)===void 0)break;e=t._$AN,e.delete(r),r=t}while(e?.size===0)},go=r=>{for(let t;t=r._$AM;r=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(r))break;e.add(r),Xs(t)}};function Zs(r){this._$AN!==void 0?(_e(this),this._$AM=r,go(this)):this._$AM=r}function Qs(r,t=!1,e=0){let o=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(t)if(Array.isArray(o))for(let n=e;n<o.length;n++)Gt(o[n],!1),_e(o[n]);else o!=null&&(Gt(o,!1),_e(o));else Gt(this,r)}var Xs=r=>{r.type==fo.CHILD&&(r._$AP??=Qs,r._$AQ??=Zs)},At=class extends Ae{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,o){super._$AT(t,e,o),go(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(Gt(this,t),_e(this))}setValue(t){if(mo(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};function A(r){return Ft(class extends At{#t;#e=new Wt(gt(()=>{if(!this.#t)throw new Error("cannot render before props");if(this.isConnected){let e=this.render(...this.#t);this.setValue(e),this.#e.doneRender()}}));#o=new G(this.#e);#r=new F;update(e,o){let s=super.update(e,o);return this.isConnected&&this.#e.doneRender(),s}render(...e){return this.#t=e,this.#r.observe(()=>M.wrap(this.#o,()=>r(...this.#t)),this.#e.render)}disconnected(){this.#o.mounts.unmountAll(),this.#r.clear()}reconnected(){this.#o.mounts.remountAll(),this.#e.render()}})}function bo(r,t){for(let[e,o]of Object.entries(t))Ys(r,e,o)}function Ys(r,t,e){let o=r.getAttribute(t),s=tn(e);s!==o&&(s===null?r.removeAttribute(t):r.setAttribute(t,s))}function tn(r){return typeof r=="string"?r:typeof r=="number"?r.toString():r?"":null}function en(){ke.register();let r=document.createElement("sly-shadow"),t=r.attachShadow({mode:"open"});return{host:r,shadow:t}}function K(r){return yo(en,r)}K.setup=r=>(t=>yo(r,t));var xo=K;function yo(r,t){let e=Ft(class extends At{#t;#e;#o;#r=new F;constructor(s){super(s);let{host:n,shadow:i}=r(),a=gt(()=>{if(!this.#o)throw new Error("cannot render before props");if(!this.isConnected)return;let c=this.#s(this.#o);x(c,this.#t.shadow),this.#t.doneRender()});this.#t=new W(a,n,i),this.#e=new G(this.#t)}#s(s){return this.#o=s,this.#r.observe(()=>M.wrap(this.#e,()=>t(...this.#o)),this.#t.render)}render({props:s,children:n,attrs:i}){let{host:a}=this.#t;return this.isConnected&&(i&&bo(a,i),x(n,this.#t.host),x(this.#s(s),this.#t.shadow),this.#t.doneRender()),a}disconnected(){x(null,this.#t.shadow),x(null,this.#t.host),this.#e.mounts.unmountAll(),this.#r.clear()}reconnected(){this.#e.mounts.remountAll(),this.#t.render()}});function o(...s){return e({props:s})}return o.with=e,o}function wo(r){return class extends HTMLElement{#t;#e;#o=new F;#r=this.attachShadow({mode:"open"});constructor(){super();let t=gt(()=>{if(!this.isConnected)return;let e=this.#s();x(e,this.#t.shadow),this.#t.doneRender()});this.#t=new W(t,this,this.#r),this.#e=new G(this.#t)}#s(){return this.#o.observe(()=>M.wrap(this.#e,()=>r()),this.#t.render)}render(){x(this.#s(),this.#t.shadow),this.#t.doneRender()}connectedCallback(){this.#e.mounts.remountAll(),this.#t.render()}disconnectedCallback(){this.#e.mounts.unmountAll(),this.#o.clear()}}}function J(r){return[K(r),(...o)=>wo(()=>r(...o))]}function y(r){let{scope:t,position:e}=M.increment();return yt(t.values,e,r)}function Kt(){return M.increment().scope.cx}function Ce(){let r=Kt();if(!(r instanceof W))throw new Error("this hook only works on shadow views (but was called in a light view)");return r}function Jt(){return Ce().host}function it(r){let{scope:t}=M.increment();return y(()=>t.mounts.mount(r))}function $o(){return Ce().shadow}function ko(r,t){oe(r,on(t))}function on(r){let t=[];if(Array.isArray(r)){let e=new Set(r.flat(1/0).reverse());for(let o of e)t.unshift(pt(o))}else r!==void 0&&t.push(pt(r));return t}function B(...r){let t=$o();y(()=>ko(t,r))}function _t(r=""){let t=Jt();y(()=>t.setAttribute("view",r))}function H(r){return y(()=>S(r))}var Ct=B;function So(r){return it(()=>r)}function j(r,t){return()=>nn({hz:r,frames:t})}var nn=K(({hz:r,frames:t})=>{_t("loading"),Ct(St,an);let e=H(0);return it(()=>wt(async()=>{await $t(1e3/r);let o=e()+1;e(o>=t.length?0:o)})),t.at(e())}),an=b`
|
|
18
18
|
:host {
|
|
19
19
|
font-family: monospace;
|
|
20
20
|
white-space: pre;
|
|
21
21
|
user-select: none;
|
|
22
22
|
}
|
|
23
|
-
`;var
|
|
23
|
+
`;var D=K(r=>(_t("error"),Ct(St,cn),typeof r=="string"?r:r instanceof Error?h`<strong>${r.name}:</strong> <span>${r.message}</span>`:"error")),cn=b`
|
|
24
24
|
:host {
|
|
25
25
|
font-family: monospace;
|
|
26
26
|
color: red;
|
|
27
27
|
}
|
|
28
|
-
`;function P(r,t){return(e,s)=>lr(e,{pending:r,err:t,ok:s})}var Bp=P(M(10,[" "," ",". ",".. ","..."," .."," ."]),k);var Gp=P(M(3,["\u{1F30E}","\u{1F30F}","\u{1F30D}"]),k);var Qp=P(M(10,["\u{1F312}","\u{1F313}","\u{1F314}","\u{1F315}","\u{1F316}","\u{1F317}","\u{1F318}","\u{1F311}","\u{1F311}","\u{1F311}"]),k);var sh=P(M(16,["|","/","-","\\"]),k);var ch=P(M(20,[":....",":....","::...",".::..","..::.","...::","....:","....:","...::","..::.",".::..","::..."]),k);var Zt=class{#t;#e;constructor(t){this.#t=t,this.#e=et(()=>[...this.#t.controllers].filter(e=>this.#t.portAssignments.get(e)===this))}get controllers(){return this.#e()}plug(t){this.#t.portAssignments.set(t,this)}unplug(t){this.#t.portAssignments.delete(t)}resolveIntents(t){return this.controllers.flatMap(e=>e.resolveIntents(t))}};var te=class{ports=new dt;controllers=new dt;portAssignments=new R};function Cr(r){return r.length>0?Math.max(...r):0}function Mr(r){return r.length>0?Math.min(...r):0}function kr([,,r],t){return{lastValue:0,holdStart:t,settings:Cs(r)}}function Es(){return{scale:1,invert:!1,clamp:null,range:null,bottom:null,top:null,timing:["direct"]}}function Cs(r={}){return{...Es(),...r}}function nt(r){return r!==0}var{min:Ms,max:ks,abs:Ps,sign:Ts,floor:Lh,ceil:Nh,pow:jh}=Math;function Pr(r,t=0,e=1){let s=Math.min(t,e),o=Math.max(t,e);return r>=s&&r<=o}function S(r,t=0,e=1){return r=Ms(r,e),r=ks(r,t),r}function Os(r,t,e,s){let n=(e-t)*r;return s!==void 0&&Ps(n)>s&&(n=Ts(n)*s),t+n}function Rs(r,t,e){return(r-t)/(e-t)}function Tr(r,t,e,s=0,o=1,n=!1){let i=Rs(r,t,e);return n&&(i=S(i)),Os(i,s,o)}var $t=class r{x;y;constructor(t=0,e=0){this.x=t,this.y=e}static new(t=0,e=0){return new this(t,e)}static zero(){return new this}static fill(t){return new this(t,t)}static from(t){return Array.isArray(t)?new this(...t):new this(t.x,t.y)}static magnitudeSquared(t,e){return t*t+e*e}static magnitude(t,e){return Math.sqrt(this.magnitudeSquared(t,e))}static average(...t){return new this().add(...t).divBy(t.length)}static min(...t){return new this(Math.min(...t.map(e=>e.x)),Math.min(...t.map(e=>e.y)))}static max(...t){return new this(Math.max(...t.map(e=>e.x)),Math.max(...t.map(e=>e.y)))}static rotation(t){return new this(Math.cos(t),Math.sin(t))}dup(){return new this.constructor(this.x,this.y)}*[Symbol.iterator](){yield this.x,yield this.y}array(){return[this.x,this.y]}tuple(){return this.array()}toJSON(){return this.array()}toString(){return`(${this.constructor.name} x${this.x.toFixed(2)}, y${this.y.toFixed(2)})`}fill(t){return this.x=t,this.y=t,this}zero(){return this.fill(0)}set_(t,e){return this.x=t,this.y=e,this}set({x:t,y:e}){return this.x=t,this.y=e,this}from(t){if(Array.isArray(t)){let[e,s]=t;this.x=e,this.y=s}else{let{x:e,y:s}=t;this.x=e,this.y=s}return this}magnitudeSquared(){return r.magnitudeSquared(this.x,this.y)}magnitude(){return r.magnitude(this.x,this.y)}rotation(){return Math.atan2(this.y,this.x)}equals_(t,e){return this.x===t&&this.y===e}equals(...t){return t.every(({x:e,y:s})=>this.equals_(e,s))}near_(t,e,s=1e-6){return Math.abs(this.x-t)<=s&&Math.abs(this.y-e)<=s}near({x:t,y:e},s=1e-6){return this.near_(t,e,s)}dot_(t,e){return this.x*t+this.y*e}dot({x:t,y:e}){return this.dot_(t,e)}distanceSquared_(t,e){return t=this.x-t,e=this.y-e,t*t+e*e}distanceSquared({x:t,y:e}){return this.distanceSquared_(t,e)}distance_(t,e){return Math.sqrt(this.distanceSquared_(t,e))}distance({x:t,y:e}){return this.distance_(t,e)}angleBetween_(t,e){let s=this.dot_(t,e),o=this.magnitude()*r.magnitude(t,e);if(o===0)return 0;let n=S(s/o,-1,1);return Math.acos(n)}angleBetween({x:t,y:e}){return this.angleBetween_(t,e)}normalize(){return this.divBy(this.magnitude())}half(){return this.divBy(2)}double(){return this.mulBy(2)}abs(){return this.map(t=>Math.abs(t))}rotate(t){let{x:e,y:s}=this;return this.x=e*Math.cos(t)-s*Math.sin(t),this.y=e*Math.sin(t)+s*Math.cos(t),this}perpendicular(){let{x:t,y:e}=this;return this.x=-e,this.y=t,this}clampMagnitude(t){return this.magnitude()>t&&this.normalize().mulBy(t),this}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}map(t){return this.x=t(this.x,0),this.y=t(this.y,1),this}morph(t){let e=t(this);return e&&e!==this&&this.set(e),this}clamp(t={x:0,y:0},e={x:1,y:1}){return this.x=S(this.x,t.x,e.x),this.y=S(this.y,t.y,e.y),this}clampBy(t=0,e=1){return this.x=S(this.x,t,e),this.y=S(this.y,t,e),this}negate(){return this.map(t=>t*-1)}addBy(t){return this.x+=t,this.y+=t,this}subBy(t){return this.x-=t,this.y-=t,this}mulBy(t){return this.x*=t,this.y*=t,this}scale(t){return this.x*=t,this.y*=t,this}divBy(t){return t===0?this:(this.x/=t,this.y/=t,this)}add_(t,e){return this.x+=t,this.y+=e,this}add(...t){for(let{x:e,y:s}of t)this.add_(e,s);return this}sub_(t,e){return this.x-=t,this.y-=e,this}sub(...t){for(let{x:e,y:s}of t)this.sub_(e,s);return this}mul_(t,e){return this.x*=t,this.y*=e,this}mul(...t){for(let{x:e,y:s}of t)this.mul_(e,s);return this}div_(t,e){return t!==0&&(this.x/=t),e!==0&&(this.y/=e),this}div(...t){for(let{x:e,y:s}of t)this.div_(e,s);return this}lerp_(t,e,s){return this.x+=(t-this.x)*s,this.y+=(e-this.y)*s,this}lerp(t,{x:e,y:s}){return this.lerp_(t,e,s)}reflect_(t,e){let s=2*this.dot_(t,e);return this.x-=s*t,this.y-=s*e,this}reflect({x:t,y:e}){return this.reflect_(t,e)}rotateAroundPoint_(t,e,s){let o=this.x-e,n=this.y-s,i=Math.cos(t),c=Math.sin(t);return this.x=i*o-c*n+e,this.y=c*o+i*n+s,this}rotateAroundPoint(t,{x:e,y:s}){return this.rotateAroundPoint_(t,e,s)}};var Or=(r,t,e)=>$e(e).line(function(o){let{settings:n}=t;if(n.clamp){let[i,c]=n.clamp;o=S(o,i,c)}if(n.range){let[i,c]=n.range;o=Pr(o,i,c)?Tr(o,i,c,0,1,!0):0}return n.bottom&&(o=o<n.bottom?0:o),n.top&&(o=Math.min(n.top,o)),o},function(o){return t.settings.invert?1-o:o},function(o){return t.settings.scale*o},function(o){let{settings:n}=t,i=(n.timing[0]==="direct"?void 0:n.timing[1])??250,c=!nt(t.lastValue)&&nt(o),a=nt(t.lastValue)&&!nt(o);c&&(t.holdStart=r);let u=r-t.holdStart>=i;switch(t.lastValue=o,n.timing[0]){case"direct":return o;case"tap":return a&&!u?1:0;case"hold":return nt(o)&&u?o:0;default:throw new Error("unknown bindings timing")}});var j=class extends Map{constructor(t){if(super(),t)for(let[e,s]of t)this.set(e,s)}zero(){for(let t of this.keys())this.set(t,0);return this}merge([t,e]){let s=this.get(t)??0;return e>s&&this.set(t,e),this}};function Ee([r],[t]){return r===t?0:r<t?-1:1}function Rr(r){r=structuredClone(r);let t=new Map;return Object.entries(r).sort(Ee).flatMap(([e,s])=>Object.entries(s).sort(Ee).map(([o,n])=>({mode:e,action:o,atom:n}))).forEach((e,s)=>{t.set(s,{...e,id:s})}),t}function Ce(r){let t=Rr(r),e=new j,s=new Map,o=new Map;for(let c of t.values())o.set(c.id,0);let n=(c,a,u,l)=>{let h=tt(s,a.join("/"),()=>kr(["code",u,l],c)),f=e.get(u)??0;return Or(c,h,f)},i=(c,a)=>(u,l)=>{let h=[...a,String(l),typeof u=="string"?u:u[0]],f=i(c,h);if(typeof u=="string")return n(c,h,u);switch(u[0]){case"code":{let[,m,d]=u;return n(c,h,m,d)}case"and":{let[,...m]=u,d=m.map(f);return Mr(d)}case"or":{let[,...m]=u,d=m.map(f);return Cr(d)}case"not":{let[,m]=u;return f(m,"subject")>0?0:1}case"cond":{let[,m,d]=u;return f(d,"guard")>0?f(m,"subject"):0}case"mods":{let[,m,d]=u,vt=(Vr,...Te)=>Vr?["or",...Te]:["not",["or",...Te]];return f(["cond",m,["and",vt(d.ctrl??!1,"ControlLeft","ControlRight"),vt(d.alt??!1,"AltLeft","AltRight"),vt(d.meta??!1,"MetaLeft","MetaRight"),vt(d.shift??!1,"ShiftLeft","ShiftRight")]],"guard")>0?f(m,"subject"):0}}};return(c,a)=>{e.zero();let u=[];for(let l of a)e.merge(l);for(let l of t.values()){let h=i(c,[])(l.atom,l.mode),f=o.get(l.id);h!==f&&(o.set(l.id,h),u.push([l.id,h]))}return u}}var ee=class{handle;device;#t;#e;constructor(t,e,s){this.handle=t,this.device=s,this.#t=e,this.#e=Ce(e)}get bindings(){return this.#t}set bindings(t){$.equal(this.#t,t)||(this.#t=t,this.#e=Ce(t))}resolveIntents(t){return this.#e(t,this.device.samples())}};var re=class{custom;stock;constructor(t,e){if(this.custom=e,this.stock=new R,mt(this.stock,Object.entries(t)),this.stock.size===0)throw new Error("must be at least one stock profile")}get all(){return[...this.stock,...this.custom]}normalizeKey(t){return t&&(this.stock.has(t)||this.custom.has(t))?t:this.defaultId}get defaultId(){return[...this.stock.keys()][0]}get(t){return this.need(this.normalizeKey(t))}need(t){return this.stock.get(t)??ir(this.custom,t)}};function Me(r,t){for(;t.length>r;)t.shift();return t}var Lr=256,se=class{store;profileAssignments=new R;customProfiles=new R;constructor(t){this.store=t}async save(){await this.store.set({customProfiles:Me(Lr,[...this.customProfiles]),profileAssignments:Me(Lr,[...this.profileAssignments])})}async load(){let t=await this.store.get();this.customProfiles.clear(),this.profileAssignments.clear(),mt(this.customProfiles,t?.customProfiles??[]),mt(this.profileAssignments,t?.profileAssignments??[])}};var oe=class{profiles;settings;#t=new te;constructor(t){this.settings=new se(t.store),this.profiles=new re(t.stockProfiles,this.settings.customProfiles)}async load(){await this.settings.load();for(let t of this.#t.controllers.keys())this.#r(t)}#e=rr(100,()=>this.settings.save());get ports(){return[...this.#t.ports]}get controllers(){return[...this.#t.controllers]}get unassignedControllers(){return[...this.#t.controllers].filter(t=>!this.#t.portAssignments.get(t))}createPort(){let t=new Zt(this.#t);return this.#t.ports.add(t),t}deletePort(t){for(let e of t.controllers)t.unplug(e);this.#t.ports.delete(t)}createController(t,e,s){let o=tt(this.settings.profileAssignments,t,()=>e),n=this.profiles.get(o),i=new ee(t,n.bindings,s);return this.#t.controllers.add(i),i}deleteController(t){this.#t.controllers.delete(t),this.#t.portAssignments.delete(t)}async assignControllerProfile(t,e){this.settings.profileAssignments.set(t.handle,e),this.#r(t),await this.#e()}queryController(t){let e=this.#t.portAssignments.get(t),s=this.settings.profileAssignments.get(t.handle),o=this.profiles.get(s);return{controller:t,port:e,profileKey:s,profile:o}}#r(t){let e=this.settings.profileAssignments.get(t.handle);t.bindings=this.profiles.get(e).bindings}};var ke=r=>r;var ne=class{set=new Set;#t=new j;constructor(...t){for(let e of t)this.set.add(e)}*samples(){this.#t.zero();for(let t of this.set)for(let e of t.samples())this.#t.merge(e);yield*this.#t}};var ie=class{get;constructor(t){this.get=t}get gamepad(){return this.get()}};function Nr(r,t){let e=r;return()=>{let s=t();return s!=null&&(e=s),e}}function jr(r){let t=new Map;function e(){s(),o()}function s(){for(let i of navigator.getGamepads())if(i?.connected&&!t.has(i.index)){let c=()=>navigator.getGamepads()[i.index],a=new ie(Nr(i,c)),u=r(a);t.set(i.index,{pad:a,dispose:u})}}function o(){for(let[i,{pad:c,dispose:a}]of t)navigator.getGamepads()[c.gamepad.index]?.connected||(a(),t.delete(i))}e();let n=V(window,{gamepadconnected:e,gamepaddisconnected:e});return()=>{n();for(let{dispose:i}of t.values())i();t.clear()}}var D=class{on=ar();sampleMap=new j;setSample(t,e){return this.sampleMap.set(t,e),this.on.pub(t,e),this}zero(){for(let t of this.sampleMap.keys())this.setSample(t,0)}*samples(){yield*this.sampleMap}};function At(r){return r>=0?[r,0]:[0,Math.abs(r)]}var ae=class r extends D{client=new $t;movement=new $t;dispose=Ut();constructor(t=window){super(),this.dispose.schedule(V(t,{pointerdown:e=>{let s=r.buttonCode(e);this.setSample(s,1)},pointerup:e=>{let s=r.buttonCode(e);this.setSample(s,0)},pointermove:e=>{this.client.x=e.clientX,this.client.y=e.clientY,this.movement.x+=e.movementX,this.movement.y+=e.movementY},wheel:e=>{this.sampleMap.set("pointer.wheel.right",0),this.sampleMap.set("pointer.wheel.left",0),this.sampleMap.set("pointer.wheel.up",0),this.sampleMap.set("pointer.wheel.down",0);for(let[s,o]of r.wheelCodes(e))this.setSample(s,o)}}))}static buttonCode(t){switch(t.button){case 0:return"pointer.button.left";case 1:return"pointer.button.middle";case 2:return"pointer.button.right";default:return`pointer.button.${t.button+1}`}}static wheelCodes(t){let e=[];return t.deltaX&&e.push([t.deltaX>0?"pointer.wheel.right":"pointer.wheel.left",t.deltaX]),t.deltaY&&e.push([t.deltaY>0?"pointer.wheel.down":"pointer.wheel.up",t.deltaY]),e}*samples(){this.#t(),yield*super.samples()}#t(){let{x:t,y:e}=this.movement,[s,o]=At(t),[n,i]=At(e);this.setSample("pointer.move.left",o),this.setSample("pointer.move.right",s),this.setSample("pointer.move.up",i),this.setSample("pointer.move.down",n),this.movement.set_(0,0)}};var ce=class extends D{pad;constructor(t){super(),this.pad=t}get gamepad(){return this.pad.gamepad}*samples(){this.#t(this.pad.gamepad),this.#e(this.pad.gamepad),yield*super.samples()}#t(t){let e=0;for(let[s,o]of t.buttons.entries()){let n=s+1,i=o.value;e=Math.max(e,i),this.setSample(`gamepad.button.${n}`,i)}this.setSample("gamepad.button.any",e)}#e(t){for(let[e,s]of t.axes.entries()){let o=e+1;this.setSample(`gamepad.axis.${o}`,s);let[n,i]=At(s);this.setSample(`gamepad.axis.${o}.neg`,n),this.setSample(`gamepad.axis.${o}.pos`,i)}}};var Dr=A`
|
|
28
|
+
`;function R(r,t){return(e,o)=>ho(e,{pending:r,err:t,ok:o})}var sd=R(j(10,[" "," ",". ",".. ","..."," .."," ."]),D);var ld=R(j(3,["\u{1F30E}","\u{1F30F}","\u{1F30D}"]),D);var md=R(j(10,["\u{1F312}","\u{1F313}","\u{1F314}","\u{1F315}","\u{1F316}","\u{1F317}","\u{1F318}","\u{1F311}","\u{1F311}","\u{1F311}"]),D);var yd=R(j(16,["|","/","-","\\"]),D);var Sd=R(j(20,[":....",":....","::...",".::..","..::.","...::","....:","....:","...::","..::.",".::..","::..."]),D);var _o=r=>r;var Co=r=>r,Eo=r=>r;var ln=_o({looking:{horizontal:["accumulate","pointer.x"],vertical:["accumulate","pointer.y"]},moving:{forward:"KeyW",backward:"KeyS",leftward:"KeyA",rightward:"KeyD"},interactions:{use:"KeyE"}}),Mo=Eo({standard:{label:"\u2328\uFE0Fstandard",bindings:ln},gamer:{label:"\u{1F3AE}gamer",bindings:{looking:{horizontal:["*",["dt"],"gamepad.axis.3",100],vertical:["*",["dt"],"gamepad.axis.4",100]},moving:{forward:["remap",0,-1,0,1,"gamepad.axis.2"],backward:["remap",0,1,0,1,"gamepad.axis.2"],leftward:["remap",0,-1,0,1,"gamepad.axis.1"],rightward:["remap",0,1,0,1,"gamepad.axis.1"]},interactions:{use:"gamepad.1"}}},micro:{label:"\u{1F9A0}micro",bindings:{looking:{horizontal:["*",["dt"],["+","gamepad.1",["-","gamepad.4"]],100],vertical:["*",["dt"],["+","gamepad.2",["-","gamepad.3"]],100]},moving:{forward:["remap",0,-1,0,1,"gamepad.axis.2"],backward:["remap",0,1,0,1,"gamepad.axis.2"],leftward:["remap",0,-1,0,1,"gamepad.axis.1"],rightward:["remap",0,1,0,1,"gamepad.axis.1"]},interactions:{use:["*","gamepad.5","gamepad.6"]}}}});function Po({start:r,end:t}){if(C(r)&&C(t))return IDBKeyRange.bound(r,t,!1,!0);if(C(r))return IDBKeyRange.lowerBound(r,!1);if(C(t))return IDBKeyRange.upperBound(t,!0)}async function zo(r){return new Promise((t,e)=>{r.onsuccess=()=>t(r.result),r.onerror=()=>e(r.error)})}function Oo({db:r,storeName:t}){let e=o=>(async s=>{let n=r.transaction(t,o),i=n.objectStore(t),a=new Promise((c,l)=>{n.onabort=()=>l(n.error??new Error("transaction aborted")),n.oncomplete=()=>c(void 0)});try{let c=await s(i,zo);return n.commit(),await a,c}catch(c){try{n.abort()}catch{}throw c}});return{readonly:e("readonly"),readwrite:e("readwrite")}}var Ee=class{#t;constructor(t){this.#t=Oo(t)}async commit(t){return this.#t.readwrite(async e=>{for(let[o,s]of t)s===void 0?e.delete(o):e.put(s,o)})}async getMany(t){return this.#t.readonly((e,o)=>Promise.all(t.map(s=>o(e.get(s)))))}async*entries(t={}){t.limit!==0&&(yield*await this.#t.readonly(async(e,o)=>{let s=[],n=t.reverse?"prev":"next",i=e.openCursor(Po(t),n),a=await o(i);for(;a&&(s.push([a.key,a.value]),!(t.limit!==void 0&&s.length>=t.limit));)a.continue(),a=await o(i);return s}))}};var To=(r,t)=>r<t?-1:r>t?1:0;function Bo(r,{start:t,end:e}){return!(t!==void 0&&r<t||e!==void 0&&r>=e)}function*vr(r,t){if(r.limit===0)return;let e=t.filter(([o,s])=>s!==void 0&&Bo(o,r)).sort(([o],[s])=>To(o,s));r.reverse&&e.reverse(),yield*e.slice(0,r.limit??1/0)}var Me=class{#t=new Map;async commit(t){for(let[e,o]of t)o===void 0?this.#t.delete(e):this.#t.set(e,structuredClone(o))}async getMany(t){return t.map(e=>structuredClone(this.#t.get(e)))}async*entries(t={}){yield*vr(t,[...this.#t.entries()].map(([e,o])=>[e,structuredClone(o)]))}};async function jo(r,t=r){return{db:await new Promise((o,s)=>{let n=indexedDB.open(r,1);n.onblocked=()=>s(new Error("idb blocked")),n.onerror=()=>s(n.error),n.onupgradeneeded=()=>n.result.createObjectStore(t),n.onsuccess=()=>o(n.result)}),storeName:t}}var Pe=class{#t;#e;constructor(t,e){this.#t=t,this.#e=e}set(t){return this.#e.set(this.#t,t)}delete(){return this.#e.delete(this.#t)}};var ze=class{kv;key;op;constructor(t,e){this.kv=t,this.key=e,this.op=new Pe(e,t.op)}async set(t){return this.kv.set(this.key,t)}async get(){return this.kv.get(this.key)}async has(){return await this.get()!==void 0}async need(){return k(await this.get(),`key not found "${this.key}"`)}async delete(){return this.kv.set(this.key,void 0)}};var Et=nt({divisor:".",delimiter:":",chunkSize:1024});function Zt(r){for(let t=r.length-1;t>=0;t--){let e=r.charCodeAt(t);if(e<65535)return r.slice(0,t)+String.fromCharCode(e+1)}}var Oe=class{#t;#e=[{}];constructor(t,e){if(this.#t=t,e.length){let o=e.join(Et.divisor),s=o+".",n=o+":";this.#e=[{start:n,end:Zt(n)},{start:s,end:Zt(s)}]}}async count(){let t=0;for(let e of this.#e)for await(let o of this.#t.entries(e))t++;return t}async clear(){let t=[];for(let e of this.#e)for await(let[o]of this.#t.entries(e))t.push([o,void 0]),t.length>=1024&&(await this.#t.commit(t),t=[]);t.length&&await this.#t.commit(t)}};var Te=class{#t;constructor(t){this.#t=t}set(t,e){return[this.#t.prefix(t),e]}delete(t){return[this.#t.prefix(t),void 0]}};var{divisor:pn,delimiter:hn}=Et,Be=class{#t;#e;constructor(t){let{scopes:e}=t;this.#t=e.join(pn)+hn,this.#e=Zt(this.#t)}prefix=t=>this.#t+t;unprefix=t=>t.slice(this.#t.length);scan=t=>{let{start:e,end:o,limit:s,reverse:n}=t;return{start:this.#t+(e??""),end:o===void 0?this.#e:this.#t+o,limit:s,reverse:n}}};function Do(r){let t=r.limit;if(t!==void 0){if(!Number.isInteger(t))throw new Error("scan limit must be integer");if(t<0)throw new Error("scan limit must be positive")}return r}function Lo(r){for(let t of r){if(t==="")throw new Error("invalid scope empty string");Ro(t,"."),Ro(t,":")}return r}function Ro(r,t){if(r.includes(t))throw new Error(`invalid scope "${r}" contains illegal "${t}"`)}var je=class r{op;subtree;#t;#e;#o;#r;constructor(t=new Me,e={}){this.#t=t,this.#r={strict:!1,scopes:[],...e},Lo(this.#r.scopes),this.#e=new Be(this.#r),this.op=new Te(this.#e),this.subtree=new Oe(this.#t,this.#r.scopes),this.#o=this.#r.strict?o=>JSON.parse(JSON.stringify(o)):o=>o}cell(t){return new ze(this,t)}scope(...t){return new r(this.#t,{...this.#r,scopes:[...this.#r.scopes,...t]})}async commit(t){await this.#t.commit(t.map(([e,o])=>[e,o===void 0?void 0:this.#o(o)]))}async set(t,e){return this.commit([this.op.set(t,e)])}async setMany(t){return this.commit(t.map(([e,o])=>this.op.set(e,o)))}async delete(...t){return this.commit(t.map(e=>this.op.delete(e)))}async getMany(t){return t=t.map(e=>this.#e.prefix(e)),(await this.#t.getMany(t)).map(e=>e===void 0?void 0:e)}async get(t){let[e]=await this.getMany([t]);return e}async has(t){return await this.get(t)!==void 0}async need(t){return k(await this.get(t),`key not found "${t}"`)}async needMany(t){let e=await this.getMany(t);for(let[o,s]of t.entries())k(e[o],`key not found "${s}"`);return e}async*entries(t={}){t=Do(this.#e.scan(t));for await(let[e,o]of this.#t.entries(t)){let s=this.#e.unprefix(e);o!==void 0&&(yield[s,o])}}[Symbol.asyncIterator](){return this.entries()}async*keys(t={}){for await(let[e]of this.entries(t))yield e}async*values(t={}){for await(let[,e]of this.entries(t))yield e}async count(t={}){let e=0;for await(let o of this.keys(t))e++;return e}async clear(t={}){let e=[];for await(let[o]of this.entries(t))e.push(this.op.delete(o)),e.length>=Et.chunkSize&&(await this.commit(e),e=[]);e.length&&await this.commit(e)}};function No(r){let e=r.reduce((a,{intents:c})=>a+8+c.byteLength,0),o=new ArrayBuffer(e),s=new DataView(o),n=new Uint8Array(o),i=0;for(let{playerId:a,intents:c}of r)s.setUint32(i,a,!1),i+=4,s.setUint32(i,c.byteLength,!1),i+=4,n.set(new Uint8Array(c),i),i+=c.byteLength;return o}function Re(r,t){let e=4+t.length*6,o=new ArrayBuffer(e),s=new DataView(o),n=0;s.setUint32(n,r,!1),n+=4;for(let i of t)s.setUint16(n,i.id,!1),n+=2,s.setFloat32(n,i.value,!1),n+=4;return o}function at(r){return!!(r===null||xt(r)||bt(r)||be(r))}function ct(r){let t=[];function e(o,s){if(at(o))t.push(s.join("."));else for(let[n,i]of Object.entries(o))e(i,[...s,n])}return e(r,["b"]),so(...t)}var Le=class{bindings;#t;#e=new vt;#o=new Vt;#r=new O;constructor(t){this.bindings=t,this.#t=ct(t)}get playerIds(){return[...this.#r.keys()]}get controllers(){return{unassigned:[...this.#o],assigned:new Map([...this.#r].map(([t,e])=>[t,[...e.controllers]]))}}createPlayer(){let t=this.#e.next();return this.#r.set(t,{controllers:new Vt}),t}deletePlayer(t){return this.#r.get(t)?.controllers.forEach(e=>this.#o.add(e)),this.#r.delete(t),this}add(t){return this.unplug(t),this}remove(t){return this.unplug(t),this.#o.delete(t),this}unplug(t){this.#o.add(t);for(let e of this.#r.values())e.controllers.delete(t);return this}plug(t,e){return e??=this.playerIds.at(-1)??this.createPlayer(),this.unplug(t),k(this.#r.get(e)).controllers.add(t),this.#o.delete(t),this}encode(t,e=performance.now()){let o=new Map,{controllers:s}=k(this.#r.get(t));for(let i of s)for(let a of i.evaluate(e)){let c=o.get(a.id)??0;o.set(a.id,c+a.value)}let n=[...o].filter(([,i])=>i!==0).map(([i,a])=>({id:i,value:a}));return Re(this.#t,n)}encodeAll(t=performance.now()){for(let o of this.#o)o.clear();let e=Array.from(this.#r.keys()).map(o=>({playerId:o,intents:this.encode(o,t)}));return No(e)}};function $r(r,t){let{presets:e,customs:o,fallback:s}=r.profiles;return t===void 0?s.profile:o.get(t)??e.get(t)??k(e.get(s.key))}async function Ne(r,t,e){let{kvs:o,controllers:s,assignments:n}=r;t.bindings=$r(r,e).bindings,n.set(t,e),await ye(s.get(t)?.handle,async i=>{r.preferences.set(i,e),await o.preferences.set(i,e)})}function Io(r,t){return ct(r)===ct(t)}var Ie=class{#t;constructor(t){this.#t=t}#e(t){if(!Io(t,this.#t.bindings))throw new Error("incompatible bindings")}get presets(){return[...this.#t.profiles.presets]}get customs(){return[...this.#t.profiles.customs]}isPreset(t){return this.#t.profiles.presets.has(t)}get(t){return $r(this.#t,t)}async create(t,e){let{kvs:o,profiles:s}=this.#t;this.#e(e.bindings),s.customs.set(t,e),await o.profiles.set(t,e),this.#t.subby.publish()}async clone(t,e){let{label:o,bindings:s}=this.get(e);await this.create(t,{basedOn:e,bindings:s,label:`${o} copy`})}async delete(t){let{kvs:e,assignments:o,profiles:{customs:s,fallback:n}}=this.#t;s.delete(t),await e.profiles.delete(t);for(let[i,a]of o)a===t&&await Ne(this.#t,i,n.key);this.#t.subby.publish()}async update(t,e){let{kvs:o,assignments:s,profiles:{customs:n}}=this.#t;e.bindings&&this.#e(e.bindings);let i=this.get(t),a={...structuredClone(i),...e};n.set(t,a);for(let[c,l]of s)l===t&&(c.bindings=a.bindings);await o.profiles.set(t,a),this.#t.subby.publish()}};function Ho({kv:r,presets:t}){let e=k(Object.keys(t)[0],"missing presets"),o=k(t[e]),s=o.bindings,n={presets:new O,customs:new O,fallback:{key:e,profile:o}};return Ht(n.presets,Object.entries(t)),{subby:U(),kv:r,presets:t,bindings:s,idCounter:new vt,profiles:n,controllers:new O,assignments:new O,preferences:new O,kvs:{profiles:r.scope("profiles"),preferences:r.scope("preferences")}}}var He=class{#t;constructor(t){this.#t=t}async assign(t,e){await Ne(this.#t,t,e),this.#t.subby.publish()}assignedProfileKeyOf(t){let{assignments:e}=this.#t;return e.get(t)??this.#t.profiles.fallback.key}};var Ve=class{#t;profiles;assignments;presets;constructor(t){this.#t=Ho(t),this.profiles=new Ie(this.#t),this.assignments=new He(this.#t),this.presets=t.presets}get on(){return this.#t.subby.on}#e(t){let{preferences:e,assignments:o,controllers:s}=this.#t,n=k(s.get(t)),i=o.get(t)??e.get(n.handle)??n.defaultProfileKey;t.bindings=this.profiles.get(i).bindings,o.set(t,i)}async load(){let{kvs:t,controllers:e,preferences:o,profiles:{customs:s}}=this.#t;s.clear(),Ht(s,await mr(t.profiles)),o.clear(),Ht(o,await mr(t.preferences));for(let n of e.keys())this.#e(n)}get controllers(){return[...this.#t.controllers.keys()]}get fallbackProfileKey(){return this.#t.profiles.fallback.key}meta(t){return this.#t.controllers.get(t)}attach(t,e){let o=this.#t.idCounter.next();this.#t.controllers.set(t,{...e,id:o}),this.#e(t)}detach(t){this.#t.controllers.delete(t),this.#t.assignments.delete(t)}};function Qt(r){let[t,e]=Object.entries(r)[0];return{key:t,profile:e}}async function Vo(r){let t=r.kv??new je(new Ee(await jo("tact","kv"))),e=r.broadcastChannel??new BroadcastChannel("tact"),{maxPlayers:o}=r,{bindings:s}=Qt(r.presets).profile,n=new Le(s),i=new Ve({...r,kv:t});return await i.load(),e.onmessage=()=>i.load(),i.on(()=>e.postMessage({})),Co({hub:n,controls:i,maxPlayers:o})}var kr=1024,Ue=class{dispose;#t;#e=[];constructor(t){this.#t=t,this.dispose=t.onSample(e=>{this.#e.push(e),this.#e.length>kr&&console.warn(`tact sampler exceeded limit ${kr}`),this.#e=xe(this.#e,kr)})}take(){this.#t.poll?.();let t=this.#e;return this.#e=[],t}};var{min:mn,max:fn,abs:gn,sign:bn,floor:Vf,ceil:Uf,pow:qf}=Math;function lt(r,t=0,e=1){return r=mn(r,e),r=fn(r,t),r}function xn(r,t,e,o){let n=(e-t)*r;return o!==void 0&&gn(n)>o&&(n=bn(n)*o),t+n}function yn(r,t,e){return(r-t)/(e-t)}function Uo(r,t,e,o=0,s=1,n=!1){let i=yn(r,t,e);return n&&(i=lt(i)),xn(i,o,s)}var qe=class r{x;y;constructor(t=0,e=0){this.x=t,this.y=e}static new(t=0,e=0){return new this(t,e)}static zero(){return new this}static fill(t){return new this(t,t)}static from(t){return Array.isArray(t)?new this(...t):new this(t.x,t.y)}static magnitudeSquared(t,e){return t*t+e*e}static magnitude(t,e){return Math.sqrt(this.magnitudeSquared(t,e))}static average(...t){return new this().add(...t).divBy(t.length)}static min(...t){return new this(Math.min(...t.map(e=>e.x)),Math.min(...t.map(e=>e.y)))}static max(...t){return new this(Math.max(...t.map(e=>e.x)),Math.max(...t.map(e=>e.y)))}static rotation(t){return new this(Math.cos(t),Math.sin(t))}dup(){return new this.constructor(this.x,this.y)}*[Symbol.iterator](){yield this.x,yield this.y}array(){return[this.x,this.y]}toJSON(){return this.array()}toString(){return`(${this.constructor.name} x${this.x.toFixed(2)}, y${this.y.toFixed(2)})`}fill(t){return this.x=t,this.y=t,this}zero(){return this.fill(0)}set_(t,e){return this.x=t,this.y=e,this}set({x:t,y:e}){return this.x=t,this.y=e,this}from(t){if(Array.isArray(t)){let[e,o]=t;this.x=e,this.y=o}else{let{x:e,y:o}=t;this.x=e,this.y=o}return this}magnitudeSquared(){return r.magnitudeSquared(this.x,this.y)}magnitude(){return r.magnitude(this.x,this.y)}rotation(){return Math.atan2(this.y,this.x)}equals_(t,e){return this.x===t&&this.y===e}equals(...t){return t.every(({x:e,y:o})=>this.equals_(e,o))}near_(t,e,o=1e-6){return Math.abs(this.x-t)<=o&&Math.abs(this.y-e)<=o}near({x:t,y:e},o=1e-6){return this.near_(t,e,o)}dot_(t,e){return this.x*t+this.y*e}dot({x:t,y:e}){return this.dot_(t,e)}distanceSquared_(t,e){return t=this.x-t,e=this.y-e,t*t+e*e}distanceSquared({x:t,y:e}){return this.distanceSquared_(t,e)}distance_(t,e){return Math.sqrt(this.distanceSquared_(t,e))}distance({x:t,y:e}){return this.distance_(t,e)}angleBetween_(t,e){let o=this.dot_(t,e),s=this.magnitude()*r.magnitude(t,e);if(s===0)return 0;let n=lt(o/s,-1,1);return Math.acos(n)}angleBetween({x:t,y:e}){return this.angleBetween_(t,e)}normalize(){return this.divBy(this.magnitude())}half(){return this.divBy(2)}double(){return this.mulBy(2)}abs(){return this.map(t=>Math.abs(t))}rotate(t){let{x:e,y:o}=this;return this.x=e*Math.cos(t)-o*Math.sin(t),this.y=e*Math.sin(t)+o*Math.cos(t),this}perpendicular(){let{x:t,y:e}=this;return this.x=-e,this.y=t,this}clampMagnitude(t){return this.magnitude()>t&&this.normalize().mulBy(t),this}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}map(t){return this.x=t(this.x,0),this.y=t(this.y,1),this}morph(t){let e=t(this);return e&&e!==this&&this.set(e),this}clamp(t={x:0,y:0},e={x:1,y:1}){return this.x=lt(this.x,t.x,e.x),this.y=lt(this.y,t.y,e.y),this}clampBy(t=0,e=1){return this.x=lt(this.x,t,e),this.y=lt(this.y,t,e),this}negate(){return this.map(t=>t*-1)}addBy(t){return this.x+=t,this.y+=t,this}subBy(t){return this.x-=t,this.y-=t,this}mulBy(t){return this.x*=t,this.y*=t,this}scale(t){return this.x*=t,this.y*=t,this}divBy(t){return t===0?this:(this.x/=t,this.y/=t,this)}add_(t,e){return this.x+=t,this.y+=e,this}add(...t){for(let{x:e,y:o}of t)this.add_(e,o);return this}sub_(t,e){return this.x-=t,this.y-=e,this}sub(...t){for(let{x:e,y:o}of t)this.sub_(e,o);return this}mul_(t,e){return this.x*=t,this.y*=e,this}mul(...t){for(let{x:e,y:o}of t)this.mul_(e,o);return this}div_(t,e){return t!==0&&(this.x/=t),e!==0&&(this.y/=e),this}div(...t){for(let{x:e,y:o}of t)this.div_(e,o);return this}lerp_(t,e,o){return this.x+=(t-this.x)*o,this.y+=(e-this.y)*o,this}lerp(t,{x:e,y:o}){return this.lerp_(t,e,o)}reflect_(t,e){let o=2*this.dot_(t,e);return this.x-=o*t,this.y-=o*e,this}reflect({x:t,y:e}){return this.reflect_(t,e)}rotateAroundPoint_(t,e,o){let s=this.x-e,n=this.y-o,i=Math.cos(t),a=Math.sin(t);return this.x=i*s-a*n+e,this.y=a*s+i*n+o,this}rotateAroundPoint(t,{x:e,y:o}){return this.rotateAroundPoint_(t,e,o)}};function ut(r){return r!==0}function Sr(r,t){let e=o=>Sr(r,o);if(t===null)return 0;if(bt(t))return t;if(xt(t)){let o=r.latestValues.get(t)??0;return r.recentSamples.filter(s=>s.code===t).reduce((s,n)=>Math.abs(n.value)>Math.abs(s)?n.value:s,o)}else switch(t[0]){case"accumulate":{let o=t[1],s=0;for(let n of r.recentSamples)n.code===o&&(s+=n.value);return s}case"up":{let o=t[1],s=0,n=r.previousValues.get(o)??0;for(let i of r.recentSamples)i.code===o&&(ut(n)&&!ut(i.value)&&s++,n=i.value);return s}case"down":{let o=t[1],s=0,n=r.previousValues.get(o)??0;for(let i of r.recentSamples)i.code===o&&(!ut(n)&&ut(i.value)&&s++,n=i.value);return s}case"was":{let o=t[1];return r.previousValues.get(o)??0}case"since":{let o=t[1],s=r.previousValues.get(o)??0;return(r.latestValues.get(o)??0)-s}case"if":{let[,o,s,n]=t;return e(o)?e(s):C(n)?e(n):0}case"min":return Math.min(...t.slice(1).map(e));case"max":return Math.max(...t.slice(1).map(e));case"+":return t.slice(1).map(e).reduce((o,s)=>o+s,0);case"*":return t.slice(1).map(e).reduce((o,s)=>o*s,1);case"==":return+(e(t[1])===e(t[2]));case"!=":return+(e(t[1])!==e(t[2]));case">":return+(e(t[1])>e(t[2]));case"<":return+(e(t[1])<e(t[2]));case">=":return+(e(t[1])>=e(t[2]));case"<=":return+(e(t[1])<=e(t[2]));case"!":return+(e(t[1])===0);case"!!":return+(e(t[1])!==0);case"-":{let[,o,...s]=t;if(s.length===0)return-e(o);let n=e(o);for(let i of s)n-=e(i);return n}case"clamp":{let[,o,s,n]=t,i=e(n);return Math.min(s===null?1/0:e(s),Math.max(o===null?-1/0:e(o),i))}case"remap":{let[o,s,n,i,a]=t.slice(1).map(e);return Uo(a,o,s,n,i)}case"dt":return r.dt;case"held":{let[,o,s]=t,n=ut(e(s)),i=r.holding.get(t);return n&&!i&&(i={start:r.clock.time},r.holding.set(t,i)),!n&&i&&(i=void 0,r.holding.delete(t)),i&&r.clock.time-i.start>=o?1:0}case"taps":{let[,o,s,n]=t,i=e(n),a=r.clock.time,c=yt(r.tapping,t,()=>({events:[]}));for(let l=0;l<i;l++)c.events.push(a);return c.events=xe(c.events.filter(l=>l>=a-s),128),c.events.length>=o?(c.events=[],1):0}case"mod":{let[,...o]=t,s=l=>ut(r.latestValues.get(l)??0),n=s("ShiftLeft")||s("ShiftRight"),i=s("ControlLeft")||s("ControlRight"),a=s("AltLeft")||s("AltRight"),c=s("MetaLeft")||s("MetaRight");return o.includes("shift")!==n||o.includes("ctrl")!==i||o.includes("alt")!==a||o.includes("meta")!==c?0:1}default:throw new Error("unknown expression")}}var We=class{time;since=0;last;constructor(t=performance.now()){this.time=t}update(t=performance.now()){this.since=t-(this.time??t),this.last=this.time,this.time=t}};var Fe=class{dt=0;clock=new We;recentSamples=[];latestValues=new Map;previousValues=new Map;holding=new Map;tapping=new Map};function qo(){return{value:0,was:0,sum:0}}function Ar(r){let t=ct(r),e=[],o=[];function s(i){if(at(i)){let a=qo();return e.push(a),o.push(i),a}else return fr(i,s)}let n=s(r);return{hash:t,inputs:n,inputList:e,rootList:o}}var Mt=class{#t;#e;#o;#r;constructor(t){this.#e=nt(structuredClone(t.bindings)),this.#o=Ar(this.#e),this.#t=new Ue(t.source),this.#r=new Fe}get bindings(){return this.#e}set bindings(t){let e=nt(structuredClone(t)),o=Ar(e),s=this.#o.hash;if(o.hash!==s)throw new Error("incompatible bindings");this.#e=e,this.#o.rootList=o.rootList}*evaluate(t=performance.now()){let e=this.#t.take();this.#r.clock.update(t),this.#r.recentSamples=e,this.#r.dt=this.#r.clock.since/1e3;for(let{code:o,value:s}of e)this.#r.latestValues.set(o,s);for(let[o,s]of this.#o.rootList.entries()){let n=Sr(this.#r,s);n!==0&&(yield{id:o,value:n})}for(let{code:o,value:s}of e)this.#r.previousValues.set(o,s)}encode(t=performance.now()){return Re(this.#o.hash,[...this.evaluate(t)])}clear(){this.#t.take()}dispose(){return this.#t.dispose()}};var Ge=class{get;constructor(t){this.get=t}get gamepad(){return this.get()}};function Wo(r,t){let e=r;return()=>{let o=t();return o!=null&&(e=o),e}}function Ke(r){let t=new Map;function e(){o(),s()}function o(){for(let i of navigator.getGamepads())if(i?.connected&&!t.has(i.index)){let a=()=>navigator.getGamepads()[i.index],c=new Ge(Wo(i,a)),l=r(c);t.set(i.index,{pad:c,dispose:l})}}function s(){for(let[i,{pad:a,dispose:c}]of t)navigator.getGamepads()[a.gamepad.index]?.connected||(c(),t.delete(i))}e();let n=E(window,{gamepadconnected:e,gamepaddisconnected:e});return()=>{n();for(let{dispose:i}of t.values())i();t.clear()}}var L=class{onSample=U();dispose=V()};var Pt=class extends L{pad;#t=new Map;constructor(t){super(),this.pad=t}get gamepad(){return this.pad.gamepad}poll(){let t=this.gamepad;this.#o(t),this.#r(t)}#e(t,e){let o=this.#t.get(t)??0;e!==o&&(this.#t.set(t,e),this.onSample.publish({code:t,value:e}))}#o(t){let e=0;for(let[o,s]of t.buttons.entries()){let n=s.value;this.#e(`gamepad.${o+1}`,n),e=Math.max(e,n)}this.#e("gamepad.any",e>=.9?1:0)}#r(t){for(let[e,o]of t.axes.entries())this.#e(`gamepad.axis.${e+1}`,o)}};function Fo(r,t){return Ke(e=>{let o=new Pt(e),s=new Mt({source:o,bindings:r.bindings});r.plug(s);let n=t?.(s,o);return()=>{r.remove(s),n?.()}})}var Je=class extends L{#t;constructor(...t){super(),this.#t=t;for(let e of t)this.dispose.schedule(e.onSample(o=>this.onSample.publish(o)))}poll(){for(let t of this.#t)t.poll?.()}};var Ze=class{$hex=S("");clear=to(250,()=>{this.$hex.set("")});update(t){this.$hex(ge(new Uint8Array(t))),this.clear()}};function zt(r){return`pointer.${r+1}`}var Qe=class extends L{client=new qe;constructor(t=window){super(),this.dispose.schedule(E(t,this.#t))}#t={pointerdown:t=>{this.onSample.publish({code:zt(t.button),value:1})},pointerup:t=>{this.onSample.publish({code:zt(t.button),value:0})},pointermove:({clientX:t,clientY:e,movementX:o,movementY:s})=>{this.client.set_(t,e),o&&this.onSample.publish({code:"pointer.x",value:o}),s&&this.onSample.publish({code:"pointer.y",value:s})},wheel:({deltaX:t,deltaY:e})=>{t&&this.onSample.publish({code:"pointer.wheel.x",value:t}),e&&this.onSample.publish({code:"pointer.wheel.y",value:e})}}};var Xe=class extends L{#t=new Set;constructor(t=window){super(),this.dispose.schedule(E(t,this.#e)),this.dispose.schedule(E(window,this.#o))}#e={keydown:t=>{t.repeat||(this.#t.size===0&&this.onSample.publish({code:"keyboard.any",value:1}),this.onSample.publish({code:t.code,value:1}),this.#t.add(t.code))},keyup:t=>{this.onSample.publish({code:t.code,value:0}),this.#t.delete(t.code),this.#t.size===0&&this.onSample.publish({code:"keyboard.any",value:0})}};#o={blur:()=>{for(let t of this.#t)this.onSample.publish({code:t,value:0});this.#t.size&&this.onSample.publish({code:"keyboard.any",value:0}),this.#t.clear()}}};var Go=q`@layer core {
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
::selection {
|
|
31
|
+
color: var(--selection);
|
|
32
|
+
background-color: var(--selection-bg);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
::-webkit-scrollbar { width: 8px; }
|
|
36
|
+
::-webkit-scrollbar-track { background: transparent; }
|
|
37
|
+
::-webkit-scrollbar-thumb { background: #444; border-radius: 1em; }
|
|
38
|
+
::-webkit-scrollbar-thumb:hover { background: #666; }
|
|
39
|
+
|
|
40
|
+
a {
|
|
41
|
+
color: var(--link);
|
|
42
|
+
text-decoration: none;
|
|
43
|
+
|
|
44
|
+
&:visited {
|
|
45
|
+
color: color-mix(in srgb, purple, var(--link) 70%);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:hover {
|
|
49
|
+
color: color-mix(in srgb, white, var(--link) 90%);
|
|
50
|
+
text-decoration: underline;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:active {
|
|
54
|
+
color: color-mix(in srgb, white, var(--link) 50%);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
}`;var Ko=q`@layer vars {
|
|
59
|
+
|
|
60
|
+
:is(:root, :host) {
|
|
61
|
+
${vn({bg:"#111",alpha:"#def",rounded:"0.5em",padding:"0.5em",prime:"#d068ff",code:"#3f1",link:"cyan",selection:"white","selection-bg":"#f70",lame:"#8888",angry:"#f50",zesty:"#cf0",happy:"#0fa",calm:"#0af",sad:"#74f",quirky:"#f49","inactive-opacity":"0.5","anim-duration":"150ms"})}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
}`;function wn([r,t]){return`--${r}: var(--shiny-${r}, ${t});`}function vn(r){return Object.entries(r).map(wn).join(`
|
|
65
|
+
`)}var Jo=q`@layer reset {
|
|
66
|
+
|
|
67
|
+
* {
|
|
68
|
+
margin: 0;
|
|
69
|
+
padding: 0;
|
|
70
|
+
box-sizing: border-box;
|
|
71
|
+
|
|
72
|
+
scrollbar-width: thin;
|
|
73
|
+
scrollbar-color: #888 transparent;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
::-webkit-scrollbar { width: 8px; }
|
|
77
|
+
::-webkit-scrollbar-track { background: transparent; }
|
|
78
|
+
::-webkit-scrollbar-thumb { background: #888; border-radius: 1em; }
|
|
79
|
+
::-webkit-scrollbar-thumb:hover { background: #999; }
|
|
80
|
+
|
|
81
|
+
}`;var Zo=q`
|
|
82
|
+
|
|
83
|
+
@layer vars, reset, core, underlay, view, overlay;
|
|
84
|
+
|
|
85
|
+
${Ko}
|
|
86
|
+
${Jo}
|
|
87
|
+
${Go}
|
|
88
|
+
|
|
89
|
+
`;var _r=new CSSStyleSheet;_r.replaceSync(Zo);var Ot=class{length=1;$index=S(0);constructor(t=0){this.$index(t)}clamp(t){return t=Math.min(t,this.length-1),t=Math.max(t,0),t}get index(){return this.clamp(this.$index())}async setIndex(t){return this.$index(t)}async shimmy(t){let e=this.clamp(this.index+t);return this.setIndex(e)}};var Qo=b`@layer view {
|
|
90
|
+
|
|
91
|
+
:host {
|
|
92
|
+
display: inline-flex;
|
|
93
|
+
flex-direction: column;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
slot[part="tabs"] {
|
|
97
|
+
display: flex;
|
|
98
|
+
flex-wrap: wrap;
|
|
99
|
+
|
|
100
|
+
&::slotted([data-tabbed]) {
|
|
101
|
+
opacity: 1;
|
|
102
|
+
color: currentColor;
|
|
103
|
+
text-decoration: underline;
|
|
104
|
+
}
|
|
32
105
|
}
|
|
33
106
|
|
|
34
|
-
|
|
107
|
+
slot[part="tabs"][data-snug] {
|
|
108
|
+
&::slotted(*) {
|
|
109
|
+
border-radius: var(--rounded);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&::slotted(:not([data-last], [data-next-is-tabbed])) {
|
|
113
|
+
border-right: none;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&::slotted([data-tabbed]:not([data-first])) {
|
|
117
|
+
border-left: none;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&::slotted(:not([data-last])) {
|
|
121
|
+
border-top-right-radius: 0;
|
|
122
|
+
border-bottom-right-radius: 0;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&::slotted(:not([data-first])) {
|
|
126
|
+
border-top-left-radius: 0;
|
|
127
|
+
border-bottom-left-radius: 0;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
} `;var Xo=xo((r={})=>{_t("shiny-tabs"),Ct(_r,Qo);let t=Jt(),e=y(()=>g.attrs(t).spec({index:Number})),o=y(()=>r.control??new Ot(e.index??0)),s=H([]),n=H([]);function i(l){let p=l.currentTarget;s(p.assignedElements())}function a(l){let p=l.currentTarget;n(p.assignedElements())}e.index=o.$index(),o.length=s().length;function c(l,p){let u=o.clamp(l+p);return u===l?!1:u===o.index}for(let[l,p]of s().entries()){let u=l===o.index,m=g.attrs(p);m.booleans.disabled=u,m.booleans["data-snug"]=r.snug,m.booleans["data-tabbed"]=u,m.booleans["data-first"]=l===0,m.booleans["data-last"]=l===o.length-1,m.booleans["data-next-is-tabbed"]=c(l,1),m.booleans["data-previous-is-tabbed"]=c(l,-1),p.onclick=()=>o.setIndex(l)}for(let[l,p]of n().entries()){let u=l===o.index;g.attrs(p).booleans["data-tabbed"]=u,g.attrs(p).booleans.hidden=!u}return h`
|
|
132
|
+
<slot part=tabs ?data-snug="${r.snug}" @slotchange="${i}"></slot>
|
|
133
|
+
<slot part=panels name=panel @slotchange="${a}"></slot>
|
|
134
|
+
`});var Yo=b`@layer view {
|
|
135
|
+
|
|
136
|
+
:host {
|
|
137
|
+
display: block;
|
|
138
|
+
width: min(50em, 100%);
|
|
139
|
+
|
|
140
|
+
color: var(--text);
|
|
141
|
+
text-shadow: var(--text-shadow);
|
|
142
|
+
}
|
|
35
143
|
|
|
36
144
|
.deck {
|
|
145
|
+
padding: var(--pad);
|
|
146
|
+
--tint: oklch(from var(--prime) l c h / 50%);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
[view="shiny-tabs"] {
|
|
150
|
+
--prime: inherit;
|
|
151
|
+
|
|
152
|
+
--tint: var(--prime);
|
|
153
|
+
--slate: color-mix(in oklch,
|
|
154
|
+
transparent,
|
|
155
|
+
color-mix(in oklch, var(--bg), var(--tint) 25%) 25%
|
|
156
|
+
);
|
|
157
|
+
--shimmer: color-mix(in oklch, transparent, var(--tint));
|
|
158
|
+
|
|
37
159
|
display: flex;
|
|
38
160
|
flex-direction: column;
|
|
161
|
+
align-items: center;
|
|
162
|
+
|
|
163
|
+
&::part(tabs) {
|
|
164
|
+
display: flex;
|
|
165
|
+
width: max-content;
|
|
166
|
+
justify-content: center;
|
|
167
|
+
padding: var(--nib);
|
|
168
|
+
|
|
169
|
+
background: var(--slate);
|
|
170
|
+
border: 1px solid var(--shimmer);
|
|
171
|
+
border-radius: var(--round);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&::part(panels) {
|
|
175
|
+
display: block;
|
|
176
|
+
width: 100%;
|
|
177
|
+
margin-top: var(--pad);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
button {
|
|
181
|
+
border: none;
|
|
182
|
+
background: transparent;
|
|
183
|
+
border-radius: var(--round);
|
|
184
|
+
border: 2px solid transparent;
|
|
185
|
+
text-shadow: var(--text-shadow);
|
|
186
|
+
|
|
187
|
+
&[data-tabbed] {
|
|
188
|
+
text-decoration: none;
|
|
189
|
+
color: var(--prime);
|
|
190
|
+
border-color: var(--prime);
|
|
191
|
+
background: color-mix(in oklch, var(--bg), var(--prime) 30%);
|
|
192
|
+
box-shadow:
|
|
193
|
+
inset 0 0 1.5em oklch(from var(--shimmer) l c h / 50%),
|
|
194
|
+
0 0 2em oklch(from var(--shimmer) l c h / 50%);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
}`;var Z=b`
|
|
200
|
+
@layer theme, view;
|
|
201
|
+
@layer theme {
|
|
202
|
+
|
|
203
|
+
${St}
|
|
204
|
+
|
|
205
|
+
:host {
|
|
206
|
+
--prime: var(--tact-prime, #fb0);
|
|
207
|
+
|
|
208
|
+
--text: var(--tact-text, #fffc);
|
|
209
|
+
--bg: var(--tact-bg, oklch(from var(--prime) calc(l * 0.3) calc(c * 0.1) h));
|
|
210
|
+
--droppy: var(--tact-droppy, oklch(from var(--prime) l c calc(h + 100)));
|
|
211
|
+
--recording: var(--tact-recording, oklch(from var(--prime) l c calc(h + 100)));
|
|
212
|
+
|
|
213
|
+
--round: var(--tact-round, 0.5em);
|
|
214
|
+
--pad: var(--tact-pad, 0.5em);
|
|
215
|
+
--nib: var(--tact-nib, 0.2em);
|
|
216
|
+
--space: var(--tact-space, 1em);
|
|
217
|
+
--box-shadow: var(--tact-box-shadow, 0.1em 0.2em 1em #0006);
|
|
218
|
+
--text-shadow: var(--tact-text-shadow, 0.02em 0.04em 0.1em #000a);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
[theme-card] {
|
|
222
|
+
--tint: var(--prime);
|
|
223
|
+
--slate: color-mix(in oklch,
|
|
224
|
+
transparent,
|
|
225
|
+
color-mix(in oklch, var(--bg), var(--tint) 25%) 25%
|
|
226
|
+
);
|
|
227
|
+
--shimmer: color-mix(in oklch, transparent, var(--tint));
|
|
228
|
+
|
|
229
|
+
border-radius: var(--round);
|
|
230
|
+
background: var(--slate);
|
|
231
|
+
border: 1px solid var(--shimmer);
|
|
232
|
+
box-shadow:
|
|
233
|
+
inset 0 0 3em color-mix(in oklch, transparent, var(--shimmer) 30%),
|
|
234
|
+
var(--box-shadow);
|
|
235
|
+
|
|
236
|
+
&[theme-card="dull"] {
|
|
237
|
+
--tint: #8888;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
[theme-button] {
|
|
242
|
+
display: flex;
|
|
243
|
+
align-items: center;
|
|
244
|
+
justify-content: center;
|
|
245
|
+
font: inherit;
|
|
246
|
+
color: inherit;
|
|
247
|
+
|
|
248
|
+
cursor: pointer;
|
|
249
|
+
user-select: none;
|
|
250
|
+
|
|
251
|
+
opacity: 0.8;
|
|
39
252
|
gap: 0.5em;
|
|
253
|
+
padding: 0.5em;
|
|
254
|
+
|
|
255
|
+
&:is(:hover, :focus-visible) { opacity: 1; }
|
|
256
|
+
&:active { opacity: 0.8; }
|
|
257
|
+
|
|
258
|
+
svg {
|
|
259
|
+
width: 1.2em;
|
|
260
|
+
height: 1.2em;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
&[theme-button~="naked"] {
|
|
264
|
+
padding: 0;
|
|
265
|
+
border: none;
|
|
266
|
+
background: transparent;
|
|
267
|
+
color: currentColor;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
&[theme-button~="angry"] {
|
|
271
|
+
&:is(:hover, :focus-visible) { color: red; }
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
[theme-select] {
|
|
276
|
+
--base: var(--tint, var(--prime));
|
|
277
|
+
font: inherit;
|
|
278
|
+
color: inherit;
|
|
279
|
+
background: transparent;
|
|
280
|
+
border: 1px solid var(--base);
|
|
281
|
+
border-radius: var(--round);
|
|
282
|
+
padding: var(--nib) var(--pad);
|
|
283
|
+
box-shadow: inset 0 0 1em oklch(from var(--base) l c h / 40%);
|
|
284
|
+
|
|
285
|
+
&:is(:hover, :focus-visible) {
|
|
286
|
+
filter: brightness(110%);
|
|
287
|
+
box-shadow: inset 0 0 1em oklch(from var(--base) l c h / 60%);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
&:active {
|
|
291
|
+
filter: brightness(90%);
|
|
292
|
+
box-shadow: inset 0 0 1em oklch(from var(--base) l c h / 40%);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
[theme-input] {
|
|
297
|
+
--base: var(--tint, var(--prime));
|
|
298
|
+
--chill: oklch(from var(--base) l c h / 50%);
|
|
299
|
+
font: inherit;
|
|
300
|
+
color: inherit;
|
|
301
|
+
background: transparent;
|
|
302
|
+
border: 1px solid var(--chill);
|
|
303
|
+
border-radius: var(--round);
|
|
304
|
+
padding: 0 var(--nib);
|
|
305
|
+
box-shadow: inset 0 0 1em oklch(from var(--chill) l c h / 20%);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
}`;var Tt=f`<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>`;var ts=f`<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>`;var es=b`@layer view {
|
|
309
|
+
|
|
310
|
+
.plate {
|
|
311
|
+
user-select: none;
|
|
312
|
+
display: flex;
|
|
313
|
+
flex-direction: column;
|
|
314
|
+
align-items: center;
|
|
315
|
+
gap: var(--pad);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
[data-drag-and-drop] {
|
|
319
|
+
.player[data-drop-candidate] {
|
|
320
|
+
outline: 2px dashed color-mix(in oklch, transparent, var(--droppy) 80%);
|
|
321
|
+
background: color-mix(in oklch, var(--slate), var(--droppy) 20%);
|
|
322
|
+
|
|
323
|
+
&[data-dropping] {
|
|
324
|
+
outline: 2px solid var(--droppy);
|
|
325
|
+
background: color-mix(in oklch, var(--slate), var(--droppy) 50%);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.playerlist {
|
|
331
|
+
display: grid;
|
|
332
|
+
grid-template-columns: repeat(
|
|
333
|
+
auto-fit,
|
|
334
|
+
minmax(min(100%, 20em), 1fr)
|
|
335
|
+
);
|
|
336
|
+
|
|
337
|
+
width: min(100%, calc(48em + var(--pad)));
|
|
338
|
+
gap: var(--pad);
|
|
339
|
+
|
|
340
|
+
> * {
|
|
341
|
+
min-width: 0;
|
|
342
|
+
min-height: 7em;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.player {
|
|
347
|
+
display: flex;
|
|
348
|
+
flex-direction: column;
|
|
349
|
+
|
|
350
|
+
&.new {
|
|
351
|
+
justify-content: center;
|
|
352
|
+
align-items: center;
|
|
353
|
+
padding: var(--pad);
|
|
354
|
+
|
|
355
|
+
border-style: dashed;
|
|
356
|
+
border-width: 2px;
|
|
357
|
+
border-color: oklch(from var(--text) l c h / 30%);
|
|
358
|
+
background: transparent;
|
|
359
|
+
box-shadow: none;
|
|
40
360
|
|
|
41
|
-
|
|
361
|
+
button {
|
|
362
|
+
display: flex;
|
|
363
|
+
flex-direction: column;
|
|
364
|
+
svg {
|
|
365
|
+
width: 2.5em;
|
|
366
|
+
height: 2.5em;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
h3 {
|
|
42
372
|
display: flex;
|
|
43
373
|
flex-wrap: wrap;
|
|
44
|
-
|
|
374
|
+
justify-content: space-between;
|
|
375
|
+
padding: var(--nib) var(--pad);
|
|
45
376
|
}
|
|
46
|
-
}
|
|
47
377
|
|
|
48
|
-
.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
378
|
+
.controllerlist {
|
|
379
|
+
display: flex;
|
|
380
|
+
flex: 1 1 auto;
|
|
381
|
+
flex-direction: column;
|
|
382
|
+
gap: var(--pad);
|
|
383
|
+
padding: var(--pad);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.controller {
|
|
387
|
+
--tint: oklch(0.7 0.3 var(--hue, 0));
|
|
388
|
+
background: color-mix(in oklch, transparent, var(--bg) 50%);
|
|
389
|
+
border: 2px solid var(--shimmer);
|
|
390
|
+
box-shadow:
|
|
391
|
+
inset 0 0 2em color-mix(in oklch, transparent, var(--shimmer)),
|
|
392
|
+
var(--box-shadow);
|
|
393
|
+
|
|
394
|
+
&:hover {
|
|
395
|
+
background: color-mix(in oklch, transparent, var(--bg) 70%);
|
|
396
|
+
filter: brightness(120%);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
[view="profile-select"]::part(select) {
|
|
400
|
+
--base: oklch(from var(--tint) l c h / 50%);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
52
403
|
|
|
53
|
-
|
|
404
|
+
.controller {
|
|
405
|
+
cursor: grab;
|
|
54
406
|
display: flex;
|
|
55
|
-
|
|
407
|
+
align-items: center;
|
|
408
|
+
|
|
409
|
+
gap: var(--pad);
|
|
410
|
+
padding: var(--nib);
|
|
411
|
+
|
|
412
|
+
border-radius: 0.5em;
|
|
413
|
+
overflow: clip;
|
|
414
|
+
|
|
415
|
+
.griptape {
|
|
416
|
+
display: flex;
|
|
417
|
+
justify-content: center;
|
|
418
|
+
align-items: center;
|
|
419
|
+
|
|
420
|
+
width: 1.5em;
|
|
421
|
+
flex: 0 0 auto;
|
|
422
|
+
|
|
423
|
+
svg {
|
|
424
|
+
opacity: 0.5;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.label {
|
|
429
|
+
display: flex;
|
|
430
|
+
align-items: center;
|
|
431
|
+
gap: var(--pad);
|
|
432
|
+
min-width: 0;
|
|
56
433
|
|
|
57
|
-
> span {
|
|
58
434
|
flex: 1 1 auto;
|
|
59
|
-
font-
|
|
435
|
+
font-size: 1em;
|
|
436
|
+
font-weight: normal;
|
|
437
|
+
|
|
438
|
+
.icon {
|
|
439
|
+
display: flex;
|
|
440
|
+
flex: 0 0 auto;
|
|
441
|
+
svg {
|
|
442
|
+
width: 2em;
|
|
443
|
+
height: 2em;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
.name {
|
|
448
|
+
min-width: 0;
|
|
449
|
+
line-height: 1.1;
|
|
450
|
+
font-size: 0.7em;
|
|
451
|
+
overflow: hidden;
|
|
452
|
+
text-overflow: ellipsis;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
select {
|
|
457
|
+
padding: var(--nib) var(--pad);
|
|
60
458
|
}
|
|
61
459
|
}
|
|
460
|
+
}
|
|
62
461
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
462
|
+
}`;var rs=f`<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>`;var Ye=f`<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>`;var Xt=A(r=>{let{dnd:t}=r.context,e=t.dropzone(()=>({playerId:r.playerId}));return h`
|
|
463
|
+
<div class="${r.class}"
|
|
464
|
+
theme-card="${r.themeCard??""}"
|
|
465
|
+
data-drop-candidate
|
|
466
|
+
?data-dropping="${t.hovering?.playerId===r.playerId}"
|
|
467
|
+
@dragenter="${e.dragenter}"
|
|
468
|
+
@dragleave="${e.dragleave}"
|
|
469
|
+
@dragover="${e.dragover}"
|
|
470
|
+
@drop="${e.drop}">
|
|
471
|
+
|
|
472
|
+
${r.content}
|
|
473
|
+
</div>
|
|
474
|
+
`});var os=f`<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>`;function ss(r){return r*137.508}var tr=A((r,t,e)=>{let{profiles:o}=r.controls;function s(n){let i=n.currentTarget;e(i.value)}return h`
|
|
475
|
+
<select
|
|
476
|
+
part=select
|
|
477
|
+
theme-select
|
|
478
|
+
.value="${t}"
|
|
479
|
+
@change="${s}">
|
|
480
|
+
|
|
481
|
+
${o.presets.map(([n,i])=>h`
|
|
482
|
+
<option
|
|
483
|
+
value="${n}"
|
|
484
|
+
?selected="${n===t}">
|
|
485
|
+
${i.label}
|
|
486
|
+
</option>
|
|
487
|
+
`)}
|
|
488
|
+
|
|
489
|
+
${o.customs.map(([n,i])=>h`
|
|
490
|
+
<option
|
|
491
|
+
value="${n}"
|
|
492
|
+
?selected="${n===t}">
|
|
493
|
+
${i.label}
|
|
494
|
+
</option>
|
|
495
|
+
`)}
|
|
496
|
+
</select>
|
|
497
|
+
`});var er=A((r,t)=>{let{deck:e,dnd:o}=r,{controls:s}=e,n=o.dragzone(()=>({controller:t})),i=s.assignments.assignedProfileKeyOf(t),a=s.meta(t)??{id:0,icon:Tt,handle:"controller",name:"controller",tooltip:"",defaultProfileKey:s.fallbackProfileKey},c=`--hue: ${ss(a?.id??0)};`;return h`
|
|
498
|
+
<div class=controller
|
|
499
|
+
style="${c}"
|
|
500
|
+
theme-card
|
|
501
|
+
?data-dragging="${o.dragging?.controller===t}"
|
|
502
|
+
draggable="${n.draggable}"
|
|
503
|
+
@dragstart="${n.dragstart}"
|
|
504
|
+
@dragend="${n.dragend}">
|
|
505
|
+
|
|
506
|
+
<div class=griptape>
|
|
507
|
+
${os}
|
|
508
|
+
</div>
|
|
509
|
+
|
|
510
|
+
<h4 class=label title="${a.tooltip}">
|
|
511
|
+
<span class=icon>${a.icon}</span>
|
|
512
|
+
<span class=name>${a.name}</span>
|
|
513
|
+
</h4>
|
|
514
|
+
|
|
515
|
+
${tr(e,i,l=>{s.assignments.assign(t,l)})}
|
|
516
|
+
</div>
|
|
517
|
+
`});var ns=A((r,t,e)=>{let{hub:o}=r.deck,s=()=>o.deletePlayer(t),n=o.controllers.assigned.get(t)??[];return Xt({class:"player",playerId:t,context:r,content:h`
|
|
518
|
+
<h3>
|
|
519
|
+
<span>player ${e+1}</span>
|
|
520
|
+
|
|
521
|
+
${kt(o.playerIds.length>1,()=>h`
|
|
522
|
+
<button theme-button="naked angry" @click=${s}>
|
|
523
|
+
${Ye}
|
|
524
|
+
</button>
|
|
525
|
+
`)}
|
|
526
|
+
</h3>
|
|
527
|
+
|
|
528
|
+
<div class=controllerlist>
|
|
529
|
+
${n.map(i=>er(r,i))}
|
|
530
|
+
</div>
|
|
531
|
+
`})});var Cr=Symbol("droppyNewPlayer");var[is,as]=J(r=>{B(Z,es);let{hub:t}=r,e=t.controllers,o=()=>r.hub.createPlayer(),s=(i,a)=>ns(n,i,a),n=y(()=>({deck:r,dnd:new $e.DragAndDrops({acceptDrop(i,a,c){c.playerId===Cr?t.plug(a.controller,t.createPlayer()):C(c.playerId)?t.plug(a.controller,c.playerId):t.unplug(a.controller)}})}));return h`
|
|
532
|
+
<div class=plate ?data-drag-and-drop="${!!n.dnd.dragging}">
|
|
533
|
+
<div class=playerlist>
|
|
534
|
+
${t.playerIds.map(s)}
|
|
535
|
+
|
|
536
|
+
${kt(t.playerIds.length<r.maxPlayers,()=>Xt({class:"player new",themeCard:"dull",playerId:Cr,context:n,content:h`
|
|
537
|
+
<button theme-button=naked @click="${o}">
|
|
538
|
+
${rs}
|
|
539
|
+
<span>add player</span>
|
|
540
|
+
</button>
|
|
541
|
+
`}))}
|
|
542
|
+
|
|
543
|
+
${Xt({class:"player unassigned",themeCard:"dull",playerId:null,context:n,content:h`
|
|
544
|
+
<h3>unassigned</h3>
|
|
545
|
+
<div class=controllerlist>
|
|
546
|
+
${e.unassigned.map(i=>er(n,i))}
|
|
547
|
+
</div>
|
|
548
|
+
`})}
|
|
549
|
+
</div>
|
|
550
|
+
</div>
|
|
551
|
+
`});var cs=b`@layer view {
|
|
552
|
+
|
|
553
|
+
.plate {
|
|
554
|
+
display: flex;
|
|
555
|
+
flex-direction: column;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
.topbar {
|
|
559
|
+
display: flex;
|
|
560
|
+
flex-wrap: wrap;
|
|
561
|
+
align-items: center;
|
|
562
|
+
padding: var(--pad) var(--space);
|
|
563
|
+
|
|
564
|
+
[view="profile-select"] {
|
|
565
|
+
font-size: 1.2em;
|
|
67
566
|
}
|
|
68
567
|
|
|
69
|
-
.
|
|
568
|
+
.corner {
|
|
70
569
|
display: flex;
|
|
71
|
-
flex-
|
|
72
|
-
|
|
73
|
-
gap:
|
|
570
|
+
flex-wrap: wrap;
|
|
571
|
+
align-items: center;
|
|
572
|
+
gap: var(--pad);
|
|
573
|
+
|
|
574
|
+
small {
|
|
575
|
+
user-select: none;
|
|
576
|
+
opacity: 0.5;
|
|
577
|
+
font-style: italic;
|
|
578
|
+
border: 1px solid;
|
|
579
|
+
border-radius: var(--round);
|
|
580
|
+
padding: var(--nib) var(--pad);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
.tools {
|
|
585
|
+
display: flex;
|
|
586
|
+
flex-wrap: wrap;
|
|
587
|
+
gap: var(--pad);
|
|
588
|
+
flex: 1 1 auto;
|
|
589
|
+
justify-content: end;
|
|
590
|
+
|
|
591
|
+
input[type="text"] {
|
|
592
|
+
width: 12em;
|
|
593
|
+
}
|
|
74
594
|
}
|
|
75
595
|
}
|
|
76
596
|
|
|
77
|
-
.
|
|
597
|
+
.bindings, .group {
|
|
78
598
|
display: flex;
|
|
79
599
|
flex-direction: column;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
600
|
+
gap: var(--nib);
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
.bindings {
|
|
604
|
+
user-select: none;
|
|
605
|
+
cursor: default;
|
|
606
|
+
padding: var(--space);
|
|
83
607
|
|
|
84
|
-
|
|
608
|
+
summary {
|
|
609
|
+
color: var(--prime);
|
|
610
|
+
width: max-content;
|
|
611
|
+
font-weight: bold;
|
|
612
|
+
font-size: 1.2em;
|
|
613
|
+
&:is(:hover, :focus-visible) { filter: brightness(120%); }
|
|
614
|
+
&:active { filter: brightness(90%); }
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
.expression {
|
|
85
618
|
display: flex;
|
|
619
|
+
align-items: end;
|
|
620
|
+
margin-left: 0.5em;
|
|
621
|
+
border-bottom: 1px dashed oklch(from var(--prime) l c h / 30%);
|
|
86
622
|
flex-wrap: wrap;
|
|
87
|
-
|
|
623
|
+
gap: 0 var(--pad);
|
|
624
|
+
padding: var(--nib);
|
|
625
|
+
|
|
626
|
+
min-height: 3em;
|
|
627
|
+
|
|
628
|
+
&:last-of-type {
|
|
629
|
+
margin-bottom: calc(var(--space) * 2);
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
> strong {
|
|
633
|
+
font-weight: normal;
|
|
634
|
+
}
|
|
88
635
|
|
|
89
636
|
> div {
|
|
637
|
+
margin-left: auto;
|
|
638
|
+
|
|
639
|
+
input {
|
|
640
|
+
font: inherit;
|
|
641
|
+
color: inherit;
|
|
642
|
+
width: 8em;
|
|
643
|
+
|
|
644
|
+
&[type="number"] {
|
|
645
|
+
width: 5em;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
div {
|
|
90
651
|
display: flex;
|
|
91
652
|
flex-wrap: wrap;
|
|
653
|
+
align-items: stretch;
|
|
654
|
+
gap: var(--nib);
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
.bracket {
|
|
658
|
+
align-items: center;
|
|
659
|
+
gap: var(--nib);
|
|
660
|
+
padding: 2px var(--nib);
|
|
661
|
+
background: color-mix(in oklch, #aaa2, var(--slate) 80%);
|
|
662
|
+
box-shadow: 0.1em 0.2em 0.5em #0002;
|
|
663
|
+
border: 1px solid #fff4;
|
|
664
|
+
border-radius: 0.2em;
|
|
665
|
+
|
|
666
|
+
&.mod {
|
|
667
|
+
gap: var(--nib);
|
|
668
|
+
}
|
|
92
669
|
}
|
|
93
670
|
}
|
|
94
|
-
}
|
|
95
671
|
|
|
96
|
-
|
|
97
|
-
|
|
672
|
+
.children {
|
|
673
|
+
display: flex;
|
|
674
|
+
flex-direction: column;
|
|
675
|
+
|
|
676
|
+
margin-left: 0.3em;
|
|
677
|
+
padding-left: 0.5em;
|
|
678
|
+
border-left: 1px solid oklch(from var(--prime) l c h / 20%);
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
.expression .recorder {
|
|
682
|
+
display: flex;
|
|
683
|
+
gap: var(--pad);
|
|
684
|
+
|
|
685
|
+
&[data-recording] {
|
|
686
|
+
color: var(--recording);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
98
689
|
}
|
|
99
690
|
|
|
100
|
-
`;var
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
${
|
|
110
|
-
</
|
|
691
|
+
}`;var ls=f`<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>`;var us=f`<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>`;function Er(){return ge.random(16)}var ps=f`<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>`;var hs=f`<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>`;var ds=f`<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>`;function ms(r,t){let e=new Set,o=new Set;function s(a){if(a==="ShiftLeft"||a==="ShiftRight")return"shift";if(a==="ControlLeft"||a==="ControlRight")return"ctrl";if(a==="MetaLeft"||a==="MetaRight")return"meta";if(a==="AltLeft"||a==="AltRight")return"alt"}let n=E(window,{blur:()=>i(),keydown:a=>{if(a.preventDefault(),a.code==="Escape")return i();e.add(a.code),o.add(a.code)},keyup:a=>{if(a.preventDefault(),e.delete(a.code),e.size===0){let c=new Set,l=new Set;for(let p of o){let u=s(p);u?l.add(u):c.add(p)}o.size===0||(c.size===0?r(["*",...o]):l.size>0?r(["*",["mod",...l],...c]):o.size>1?r(["*",...o]):r([...o][0])),i()}}}),i=()=>{n(),t()};return i}function fs(r,t){let{dispose:e,schedule:o}=V();o(t);let s=new Set,n=new Set,i=new Set;return o(E(window,{blur:()=>e()})),o(Ke(a=>{let c=new Pt(a);return s.add(c),c.onSample(l=>{if(l.code!=="gamepad.any")if(l.value>.9)n.add(l.code),i.add(l.code);else{if(!n.delete(l.code))return;n.size===0&&(i.size===1?r([...i][0]):i.size>1&&r(["*",...i]),e())}}),()=>{c.dispose(),s.delete(c)}})),o(wt(async()=>{for(let a of s)a.poll();await $t(16.67)})),e}function gs(r,t){let{dispose:e,schedule:o}=V();o(t);let s=new Set,n=new Set,i=a=>a.composedPath().some(c=>c instanceof Element&&c.matches("button.record"));return o(E(window,{blur:()=>e(),auxclick:a=>a.preventDefault(),mousedown:a=>{if(i(a))return;a.preventDefault();let c=zt(a.button);s.add(c),n.add(c)},mouseup:a=>{let c=zt(a.button);s.delete(c)&&(a.preventDefault(),s.size===0&&(n.size===1?r([...n][0]):n.size>1&&r(["*",...n]),e()))},contextmenu:a=>{a.preventDefault()}})),e}var bs=A((r,t,e,o)=>{let s=H(null),n=()=>s(null),i=()=>{let{dispose:p,schedule:u}=V();u(n),u(ms(t,p)),u(fs(t,p)),u(gs(t,p)),s(p)},a=()=>{s()?.(),n()};function c(){s()?a():i()}function l(){a(),e()}return So(a),h`
|
|
692
|
+
<div class=recorder ?data-recording="${!!s()}">
|
|
693
|
+
${o}
|
|
694
|
+
${r?null:h`
|
|
695
|
+
<button
|
|
696
|
+
class=record
|
|
697
|
+
theme-button=naked
|
|
698
|
+
title="record a keypress"
|
|
699
|
+
@click=${c}>
|
|
700
|
+
${s()?ds:ps}
|
|
701
|
+
</button>
|
|
702
|
+
|
|
703
|
+
<button
|
|
704
|
+
theme-button=naked
|
|
705
|
+
title="reset to default"
|
|
706
|
+
@click=${l}>
|
|
707
|
+
${hs}
|
|
708
|
+
</button>
|
|
709
|
+
`}
|
|
710
|
+
</div>
|
|
711
|
+
`});var Mr=A((r,t,e)=>{if(!C(t))return h`
|
|
712
|
+
<div class=null>unset</div>
|
|
713
|
+
`;if(bt(t))return h`
|
|
714
|
+
<div class=number>
|
|
715
|
+
<input
|
|
716
|
+
type=number
|
|
717
|
+
step=any
|
|
718
|
+
theme-input
|
|
719
|
+
.value="${t}"
|
|
720
|
+
?readonly="${r}"
|
|
721
|
+
@change="${o=>{let n=o.currentTarget.valueAsNumber;Number.isFinite(n)&&e(n)}}"
|
|
722
|
+
/>
|
|
111
723
|
</div>
|
|
112
|
-
|
|
113
|
-
<
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
724
|
+
`;if(xt(t))return h`
|
|
725
|
+
<input
|
|
726
|
+
type=text
|
|
727
|
+
theme-input
|
|
728
|
+
.value="${t}"
|
|
729
|
+
?readonly="${r}"
|
|
730
|
+
@change="${o=>{let n=o.currentTarget.value;e(n)}}"/>
|
|
731
|
+
`;if(be(t))return t[0]==="mod"?h`
|
|
732
|
+
<div class="bracket mod">
|
|
733
|
+
${t.slice(1).length===0?"unmodified":t.slice(1).join("+")}
|
|
734
|
+
|
|
735
|
+
${!r&&t.slice(1).length>0?h`
|
|
736
|
+
<button
|
|
737
|
+
theme-button=naked
|
|
738
|
+
@click="${()=>e([t[0]])}">
|
|
739
|
+
${Ye}
|
|
740
|
+
</button>
|
|
741
|
+
`:null}
|
|
120
742
|
</div>
|
|
121
|
-
|
|
122
|
-
<div class=
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
${a?b`
|
|
128
|
-
<button @click=${()=>e(c,-1)} ?disabled=${r.ports.indexOf(a)===0}>👈</button>
|
|
129
|
-
<button @click=${()=>a.unplug(c)}>⏏️</button>
|
|
130
|
-
<button @click=${()=>e(c,1)} ?disabled=${r.ports.indexOf(a)===r.ports.length-1}>👉</button>
|
|
131
|
-
`:b`
|
|
132
|
-
<button @click=${()=>h(c)}>🔌</button>
|
|
133
|
-
`}
|
|
134
|
-
</div>
|
|
135
|
-
<select @change=${l}>
|
|
136
|
-
${r.profiles.all.map(([f,m])=>b`
|
|
137
|
-
<option
|
|
138
|
-
.value=${f}
|
|
139
|
-
.selected=${f===u}>
|
|
140
|
-
${m.label}
|
|
141
|
-
</option>
|
|
142
|
-
`)}
|
|
143
|
-
</select>
|
|
144
|
-
</div>
|
|
743
|
+
`:h`
|
|
744
|
+
<div class=bracket>
|
|
745
|
+
${t[0]==="*"?null:h`
|
|
746
|
+
<strong>${t[0]}</strong>
|
|
747
|
+
`}
|
|
748
|
+
${t.slice(1).map((o,s)=>Mr(r,o??null,n=>{let i=structuredClone(t);i[s+1]=n,e(i)}))}
|
|
145
749
|
</div>
|
|
146
|
-
|
|
147
|
-
<
|
|
148
|
-
<
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
<button @click=${()=>r.createPort()}>✨add port</button>
|
|
152
|
-
</div>
|
|
750
|
+
`;throw new Error("unknown expression")});function rr(r,t,e,o){return at(t)?Mr(r,t,o):Object.entries(t).map(([s,n])=>at(n)?kn(r,t,e,o,s):$n(r,t,e,o,s))}function $n(r,t,e,o,s){return h`
|
|
751
|
+
<details class=group open>
|
|
752
|
+
<summary>${s}</summary>
|
|
753
|
+
<div class=children>
|
|
754
|
+
${rr(r,t[s],e[s],n=>o({...t,[s]:n}))}
|
|
153
755
|
</div>
|
|
756
|
+
</details>
|
|
757
|
+
`}function kn(r,t,e,o,s){let n=a=>o({...t,[s]:a});return h`
|
|
758
|
+
<div class=expression>
|
|
759
|
+
<strong>${s}</strong>
|
|
760
|
+
${bs(r,n,()=>n(e[s]),rr(r,t[s],e[s],n))}
|
|
761
|
+
</div>
|
|
762
|
+
`}var[xs,ys]=J(r=>{B(Z,cs);let{controls:t,controls:{profiles:e}}=r,o=H(t.fallbackProfileKey),s=e.get(o()),n=e.isPreset(o()),i=s.basedOn?e.get(s.basedOn):s,a=u=>{let m=o();if(e.isPreset(m)){let _=m,Q=Er();m=Q,e.clone(Q,_)}e.update(m,{bindings:u}),o(m)},c=(u,m)=>e.update(u,{label:m}),l=()=>{let u=Er();e.clone(u,o()),o.set(u)},p=()=>{e.delete(o()),o(t.fallbackProfileKey)};return h`
|
|
763
|
+
<div class=plate theme-card>
|
|
764
|
+
<header class=topbar>
|
|
765
|
+
<div class=corner>
|
|
766
|
+
${tr(r,o(),o)}
|
|
154
767
|
|
|
155
|
-
|
|
156
|
-
|
|
768
|
+
<button title="copy this profile" theme-button=naked @click="${l}">
|
|
769
|
+
${ls}
|
|
770
|
+
</button>
|
|
771
|
+
|
|
772
|
+
${n?null:h`
|
|
773
|
+
<button title="delete this profile" theme-button=naked @click="${p}">
|
|
774
|
+
${us}
|
|
775
|
+
</button>
|
|
776
|
+
`}
|
|
777
|
+
|
|
778
|
+
${kt(n,()=>h`<small>readonly</small>`)}
|
|
779
|
+
${ye(s.basedOn,u=>h`<small>based on ${e.get(u).label}</small>`)}
|
|
780
|
+
</div>
|
|
781
|
+
|
|
782
|
+
<div class=tools>
|
|
783
|
+
${n?null:h`
|
|
784
|
+
<input
|
|
785
|
+
type=text
|
|
786
|
+
theme-input
|
|
787
|
+
.value="${s.label}"
|
|
788
|
+
@change="${u=>{let m=u.currentTarget;c(o(),m.value)}}"
|
|
789
|
+
/>
|
|
790
|
+
`}
|
|
791
|
+
</div>
|
|
792
|
+
</header>
|
|
793
|
+
|
|
794
|
+
<div class=bindings>
|
|
795
|
+
${rr(!1,s.bindings,i.bindings,a)}
|
|
157
796
|
</div>
|
|
158
797
|
</div>
|
|
159
|
-
`});var
|
|
160
|
-
<div class=
|
|
161
|
-
${
|
|
798
|
+
`});var[by,ws]=J(r=>{B(Z,Yo);let t={slot:"panel"},e=y(()=>new Ot);return y(()=>{window.location.hash.includes("bindings")&&e.setIndex(1)}),h`
|
|
799
|
+
<div class=deck theme-card>
|
|
800
|
+
${Xo.with({props:[{control:e}],children:h`
|
|
801
|
+
<button theme-button>
|
|
802
|
+
${Tt}
|
|
803
|
+
<span>controllers</span>
|
|
804
|
+
</button>
|
|
805
|
+
|
|
806
|
+
<button theme-button>
|
|
807
|
+
${ts}
|
|
808
|
+
<span>customize</span>
|
|
809
|
+
</button>
|
|
810
|
+
|
|
811
|
+
${is.with({attrs:t,props:[r]})}
|
|
812
|
+
${xs.with({attrs:t,props:[r]})}
|
|
813
|
+
`})}
|
|
162
814
|
</div>
|
|
163
|
-
`
|
|
815
|
+
`});var vs=b`@layer view {
|
|
816
|
+
|
|
817
|
+
:host {
|
|
818
|
+
display: block;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
output {
|
|
822
|
+
opacity: 0.5;
|
|
823
|
+
color: var(--prime);
|
|
824
|
+
font-size: 1em;
|
|
825
|
+
font-family: monospace;
|
|
826
|
+
display: block;
|
|
827
|
+
overflow-wrap: anywhere;
|
|
828
|
+
text-overflow: ellipsis;
|
|
829
|
+
height: 8em;
|
|
830
|
+
padding: 0 4em;
|
|
831
|
+
overflow: hidden;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
}`;var[Ay,$s]=J(r=>(B(Z,vs),h`
|
|
835
|
+
<output class=viz>${r.$hex()}</output>
|
|
836
|
+
`));var ks=f`<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>`;function Ss(r,t){return r.length>t?r.slice(0,t)+"...":r}async function As(r){let t=await Vo(r),e=new Ze,o={TactDeck:ws(t),TactCustomize:ys(t),TactControllers:as(t),TactVisualizer:$s(e)};function s(a){return Fo(t.hub,(c,l)=>{let p=`${l.pad.gamepad.id} ${l.pad.gamepad.index+1}`;return t.controls.attach(c,{icon:Tt,handle:p,tooltip:p,name:Ss(p,32),defaultProfileKey:a??Qt(t.controls.presets).key}),()=>t.controls.detach(c)})}function n(){let{key:a,profile:c}=Qt(t.controls.presets),l=new Mt({bindings:c.bindings,source:new Je(new Xe,new Qe)});return t.hub.plug(l),t.controls.attach(l,{icon:ks,handle:"standard",name:"mouse/keyboard",tooltip:"",defaultProfileKey:a}),l}function i(){te(o)}return{deck:t,gamepads:s,mouseKeyboard:n,visualizer:e,elements:o,registerElements:i}}var Yt=await As({presets:Mo,maxPlayers:4});Yt.mouseKeyboard();Yt.gamepads("gamer");Yt.registerElements();wt(async()=>{let r=Yt.deck.hub.encodeAll();Yt.visualizer.update(r),await $t(1e3/60)});{let r=g('input[type="color"]');r.value="#ffbb00",r.oninput=()=>document.body.style.setProperty("--tact-prime",r.value)}
|
|
164
837
|
/*! For license information please see main.bundle.min.js.LEGAL.txt */
|
|
165
838
|
//# sourceMappingURL=main.bundle.min.js.map
|