@benev/tact 0.2.0-0 → 0.3.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 +48 -390
- package/package.json +25 -27
- package/s/_archive/README.md +435 -0
- package/s/_archive/deck/deck.ts +69 -0
- package/s/_archive/demo/main.bundle.ts +10 -0
- package/s/_archive/demo/main.css +85 -0
- package/s/_archive/index.html.ts +61 -0
- package/s/_archive/index.ts +8 -0
- package/s/_archive/tests.test.ts +6 -0
- package/s/_archive/utils/circular-clamp.ts +14 -0
- package/s/_archive/utils/evergreen.ts +10 -0
- package/s/_archive/utils/split-axis.ts +15 -0
- package/s/assets/b.png +0 -0
- package/s/core/atom/defaults.ts +32 -0
- package/s/core/atom/lens-algo.ts +84 -0
- package/s/core/atom/types.ts +44 -0
- package/s/core/bindings/normalize.ts +27 -0
- package/s/core/bindings/shape.ts +15 -0
- package/s/core/bindings/table.ts +22 -0
- package/s/core/intent/bucket.ts +28 -0
- package/s/core/intent/consts.ts +4 -0
- package/s/core/intent/decode.ts +23 -0
- package/s/core/intent/encode.ts +20 -0
- package/s/core/intent/merge.ts +15 -0
- package/s/core/parts/action.ts +36 -0
- package/s/core/parts/sample-map.ts +24 -0
- package/s/core/resolvers/actions.ts +30 -0
- package/s/core/resolvers/intents.ts +106 -0
- package/s/core/types.ts +40 -0
- package/s/deck/controller.ts +35 -0
- package/s/deck/deck.ts +76 -53
- package/s/deck/parts/profiles.ts +39 -0
- package/s/deck/parts/runtime.ts +11 -0
- package/s/deck/parts/settings.ts +30 -0
- package/s/deck/port.ts +35 -0
- package/s/deck/types.ts +16 -0
- package/s/demo/demo-app/element.ts +17 -0
- package/s/demo/demo-app/style.css.ts +10 -0
- package/s/demo/main.bundle.ts +67 -6
- package/s/demo/main.css +6 -8
- package/s/device/devices.ts +24 -0
- package/s/device/gamepad.ts +42 -0
- package/s/device/keyboard.ts +33 -0
- package/s/device/pad/on-pad.ts +50 -0
- package/s/device/pad/pad.ts +10 -0
- package/s/device/pointer.ts +97 -0
- package/s/device/sampler.ts +25 -0
- package/s/device/stick.ts +24 -0
- package/s/gamepad/gamepad-app/element.ts +65 -0
- package/s/gamepad/gamepad-app/style.css.ts +73 -0
- package/s/gamepad/index.html.ts +44 -0
- package/s/gamepad/main.bundle.ts +6 -0
- package/s/gamepad/main.css +60 -0
- package/s/index-ui.ts +3 -0
- package/s/index.html.ts +10 -17
- package/s/index.ts +28 -5
- package/s/test.ts +339 -0
- package/s/ui/views/desk/style.css.ts +70 -0
- package/s/ui/views/desk/view.ts +122 -0
- package/s/utils/circular-clamp.ts +2 -2
- package/s/utils/do-async.ts +5 -0
- package/s/utils/freeze-clone.ts +7 -0
- package/s/utils/identifier.ts +30 -0
- package/s/utils/insert.ts +6 -0
- package/s/utils/is-down.ts +5 -0
- package/s/utils/make-id.ts +7 -0
- package/s/utils/remap.ts +7 -0
- package/s/utils/shift-limit.ts +9 -0
- package/s/utils/sort-by-key.ts +7 -0
- package/s/utils/tmax.ts +7 -0
- package/s/utils/tmin.ts +7 -0
- package/x/_archive/demo/main.css +85 -0
- package/x/assets/b.png +0 -0
- package/x/core/{bindings/parts → atom}/defaults.d.ts +1 -1
- package/x/core/atom/defaults.js.map +1 -0
- package/x/core/{bindings/parts → atom}/lens-algo.d.ts +1 -1
- package/x/core/{bindings/parts → atom}/lens-algo.js +8 -8
- package/x/core/atom/lens-algo.js.map +1 -0
- package/x/core/{bindings → atom}/types.d.ts +1 -15
- package/x/core/{devices → atom}/types.js.map +1 -1
- package/x/core/bindings/normalize.d.ts +2 -0
- package/x/core/bindings/normalize.js +17 -0
- package/x/core/bindings/normalize.js.map +1 -0
- package/x/core/bindings/shape.d.ts +2 -0
- package/x/core/bindings/shape.js +10 -0
- package/x/core/bindings/shape.js.map +1 -0
- package/x/core/bindings/table.d.ts +2 -0
- package/x/core/bindings/table.js +15 -0
- package/x/core/bindings/table.js.map +1 -0
- package/x/core/intent/bucket.d.ts +7 -0
- package/x/core/intent/bucket.js +21 -0
- package/x/core/intent/bucket.js.map +1 -0
- package/x/core/intent/consts.d.ts +2 -0
- package/x/core/intent/consts.js +3 -0
- package/x/core/intent/consts.js.map +1 -0
- package/x/core/intent/decode.d.ts +3 -0
- package/x/core/intent/decode.js +18 -0
- package/x/core/intent/decode.js.map +1 -0
- package/x/core/intent/encode.d.ts +3 -0
- package/x/core/intent/encode.js +15 -0
- package/x/core/intent/encode.js.map +1 -0
- package/x/core/intent/merge.d.ts +3 -0
- package/x/core/intent/merge.js +10 -0
- package/x/core/intent/merge.js.map +1 -0
- package/x/core/{bindings → parts}/action.d.ts +5 -3
- package/x/core/parts/action.js +30 -0
- package/x/core/parts/action.js.map +1 -0
- package/x/core/parts/sample-map.d.ts +6 -0
- package/x/core/{bindings → parts}/sample-map.js +2 -3
- package/x/core/parts/sample-map.js.map +1 -0
- package/x/core/resolvers/actions.d.ts +2 -0
- package/x/core/resolvers/actions.js +23 -0
- package/x/core/resolvers/actions.js.map +1 -0
- package/x/core/resolvers/intents.d.ts +2 -0
- package/x/core/{bindings/resolver.js → resolvers/intents.js} +39 -43
- package/x/core/resolvers/intents.js.map +1 -0
- package/x/core/types.d.ts +43 -0
- package/x/core/types.js +2 -0
- package/x/core/types.js.map +1 -0
- package/x/deck/controller.d.ts +11 -0
- package/x/deck/controller.js +28 -0
- package/x/deck/controller.js.map +1 -0
- package/x/deck/deck.d.ts +30 -26
- package/x/deck/deck.js +64 -43
- package/x/deck/deck.js.map +1 -1
- package/x/deck/parts/profiles.d.ts +12 -0
- package/x/deck/parts/profiles.js +31 -0
- package/x/deck/parts/profiles.js.map +1 -0
- package/x/deck/parts/runtime.d.ts +8 -0
- package/x/deck/parts/runtime.js +7 -0
- package/x/deck/parts/runtime.js.map +1 -0
- package/x/deck/parts/settings.d.ts +11 -0
- package/x/deck/parts/settings.js +26 -0
- package/x/deck/parts/settings.js.map +1 -0
- package/x/deck/port.d.ts +10 -0
- package/x/deck/port.js +24 -0
- package/x/deck/port.js.map +1 -0
- package/x/deck/types.d.ts +11 -0
- package/x/deck/types.js +2 -0
- package/x/deck/types.js.map +1 -0
- package/x/demo/demo-app/element.d.ts +3 -0
- package/x/demo/demo-app/element.js +13 -0
- package/x/demo/demo-app/element.js.map +1 -0
- package/x/demo/demo-app/style.css.js +9 -0
- package/x/demo/demo-app/style.css.js.map +1 -0
- package/x/demo/main.bundle.js +53 -5
- package/x/demo/main.bundle.js.map +1 -1
- package/x/demo/main.bundle.min.js +107 -385
- package/x/demo/main.bundle.min.js.LEGAL.txt +33 -0
- package/x/demo/main.bundle.min.js.map +4 -4
- package/x/demo/main.css +6 -8
- package/x/device/devices.d.ts +7 -0
- package/x/device/devices.js +17 -0
- package/x/device/devices.js.map +1 -0
- package/x/device/gamepad.d.ts +9 -0
- package/x/device/gamepad.js +37 -0
- package/x/device/gamepad.js.map +1 -0
- package/x/{core/devices/standard → device}/keyboard.d.ts +1 -1
- package/x/{core/devices/standard → device}/keyboard.js +4 -2
- package/x/device/keyboard.js.map +1 -0
- package/x/device/pad/on-pad.d.ts +3 -0
- package/x/device/pad/on-pad.js +42 -0
- package/x/device/pad/on-pad.js.map +1 -0
- package/x/device/pad/pad.d.ts +6 -0
- package/x/device/pad/pad.js +11 -0
- package/x/device/pad/pad.js.map +1 -0
- package/x/{core/devices/standard → device}/pointer.d.ts +2 -2
- package/x/{core/devices/standard → device}/pointer.js +4 -4
- package/x/device/pointer.js.map +1 -0
- package/x/device/sampler.d.ts +9 -0
- package/x/device/sampler.js +19 -0
- package/x/device/sampler.js.map +1 -0
- package/x/{core/devices/standard → device}/stick.d.ts +2 -3
- package/x/{core/devices/standard → device}/stick.js +4 -6
- package/x/device/stick.js.map +1 -0
- package/x/gamepad/gamepad-app/element.d.ts +1 -0
- package/x/gamepad/gamepad-app/element.js +54 -0
- package/x/gamepad/gamepad-app/element.js.map +1 -0
- package/x/gamepad/gamepad-app/style.css.js +72 -0
- package/x/gamepad/gamepad-app/style.css.js.map +1 -0
- package/x/gamepad/index.html +35 -0
- package/x/gamepad/index.html.d.ts +2 -0
- package/x/gamepad/index.html.js +41 -0
- package/x/gamepad/index.html.js.map +1 -0
- package/x/gamepad/main.bundle.js +4 -0
- package/x/gamepad/main.bundle.js.map +1 -0
- package/x/gamepad/main.bundle.min.js +126 -0
- package/x/gamepad/main.bundle.min.js.LEGAL.txt +33 -0
- package/x/gamepad/main.bundle.min.js.map +7 -0
- package/x/gamepad/main.css +60 -0
- package/x/index-ui.d.ts +1 -0
- package/x/index-ui.js +2 -0
- package/x/index-ui.js.map +1 -0
- package/x/index.d.ts +27 -5
- package/x/index.html +17 -24
- package/x/index.html.js +10 -17
- package/x/index.html.js.map +1 -1
- package/x/index.js +27 -5
- package/x/index.js.map +1 -1
- package/x/test.d.ts +9 -0
- package/x/test.js +307 -0
- package/x/test.js.map +1 -0
- package/x/ui/views/desk/style.css.js +69 -0
- package/x/ui/views/desk/style.css.js.map +1 -0
- package/x/ui/views/desk/view.d.ts +7 -0
- package/x/ui/views/desk/view.js +102 -0
- package/x/ui/views/desk/view.js.map +1 -0
- package/x/utils/circular-clamp.js +2 -2
- package/x/utils/circular-clamp.js.map +1 -1
- package/x/utils/do-async.d.ts +1 -0
- package/x/utils/do-async.js +4 -0
- package/x/utils/do-async.js.map +1 -0
- package/x/utils/freeze-clone.d.ts +1 -0
- package/x/utils/freeze-clone.js +5 -0
- package/x/utils/freeze-clone.js.map +1 -0
- package/x/utils/identifier.d.ts +6 -0
- package/x/utils/identifier.js +25 -0
- package/x/utils/identifier.js.map +1 -0
- package/x/utils/insert.d.ts +1 -0
- package/x/utils/insert.js +5 -0
- package/x/utils/insert.js.map +1 -0
- package/x/utils/is-down.d.ts +1 -0
- package/x/utils/is-down.js +4 -0
- package/x/utils/is-down.js.map +1 -0
- package/x/utils/make-id.d.ts +1 -0
- package/x/utils/make-id.js +5 -0
- package/x/utils/make-id.js.map +1 -0
- package/x/utils/remap.d.ts +1 -0
- package/x/utils/remap.js +6 -0
- package/x/utils/remap.js.map +1 -0
- package/x/utils/shift-limit.d.ts +2 -0
- package/x/utils/shift-limit.js +7 -0
- package/x/utils/shift-limit.js.map +1 -0
- package/x/utils/sort-by-key.d.ts +1 -0
- package/x/utils/sort-by-key.js +6 -0
- package/x/utils/sort-by-key.js.map +1 -0
- package/x/utils/{quick-math.d.ts → tmax.d.ts} +0 -1
- package/x/utils/tmax.js +6 -0
- package/x/utils/tmax.js.map +1 -0
- package/x/utils/tmin.d.ts +1 -0
- package/x/utils/tmin.js +6 -0
- package/x/utils/tmin.js.map +1 -0
- package/s/tests.test.ts +0 -6
- package/x/core/bindings/action.js +0 -24
- package/x/core/bindings/action.js.map +0 -1
- package/x/core/bindings/parts/defaults.js.map +0 -1
- package/x/core/bindings/parts/is-pressed.d.ts +0 -1
- package/x/core/bindings/parts/is-pressed.js +0 -4
- package/x/core/bindings/parts/is-pressed.js.map +0 -1
- package/x/core/bindings/parts/lens-algo.js.map +0 -1
- package/x/core/bindings/parts/lookup-proxies.js +0 -19
- package/x/core/bindings/parts/lookup-proxies.js.map +0 -1
- package/x/core/bindings/resolver.d.ts +0 -9
- package/x/core/bindings/resolver.js.map +0 -1
- package/x/core/bindings/sample-map.d.ts +0 -7
- package/x/core/bindings/sample-map.js.map +0 -1
- package/x/core/bindings/types.js +0 -4
- package/x/core/bindings/types.js.map +0 -1
- package/x/core/core.test.d.ts +0 -13
- package/x/core/core.test.js +0 -138
- package/x/core/core.test.js.map +0 -1
- package/x/core/devices/auto-gamepads.d.ts +0 -2
- package/x/core/devices/auto-gamepads.js +0 -6
- package/x/core/devices/auto-gamepads.js.map +0 -1
- package/x/core/devices/device.d.ts +0 -5
- package/x/core/devices/device.js +0 -7
- package/x/core/devices/device.js.map +0 -1
- package/x/core/devices/infra/group.d.ts +0 -7
- package/x/core/devices/infra/group.js +0 -21
- package/x/core/devices/infra/group.js.map +0 -1
- package/x/core/devices/infra/sampler.d.ts +0 -9
- package/x/core/devices/infra/sampler.js +0 -18
- package/x/core/devices/infra/sampler.js.map +0 -1
- package/x/core/devices/standard/gamepad.d.ts +0 -11
- package/x/core/devices/standard/gamepad.js +0 -65
- package/x/core/devices/standard/gamepad.js.map +0 -1
- package/x/core/devices/standard/index.d.ts +0 -6
- package/x/core/devices/standard/index.js +0 -7
- package/x/core/devices/standard/index.js.map +0 -1
- package/x/core/devices/standard/keyboard.js.map +0 -1
- package/x/core/devices/standard/pointer.js.map +0 -1
- package/x/core/devices/standard/primary.d.ts +0 -10
- package/x/core/devices/standard/primary.js +0 -17
- package/x/core/devices/standard/primary.js.map +0 -1
- package/x/core/devices/standard/stick.js.map +0 -1
- package/x/core/devices/standard/vpad.d.ts +0 -7
- package/x/core/devices/standard/vpad.js +0 -20
- package/x/core/devices/standard/vpad.js.map +0 -1
- package/x/core/devices/types.d.ts +0 -1
- package/x/core/hub/hub.d.ts +0 -32
- package/x/core/hub/hub.js +0 -101
- package/x/core/hub/hub.js.map +0 -1
- package/x/core/hub/meta-bindings.d.ts +0 -2
- package/x/core/hub/meta-bindings.js +0 -21
- package/x/core/hub/meta-bindings.js.map +0 -1
- package/x/core/hub/parts/connected.d.ts +0 -14
- package/x/core/hub/parts/connected.js +0 -12
- package/x/core/hub/parts/connected.js.map +0 -1
- package/x/core/hub/port.d.ts +0 -9
- package/x/core/hub/port.js +0 -19
- package/x/core/hub/port.js.map +0 -1
- package/x/core/hub/types.d.ts +0 -9
- package/x/core/hub/types.js +0 -2
- package/x/core/hub/types.js.map +0 -1
- package/x/core/index.d.ts +0 -15
- package/x/core/index.js +0 -16
- package/x/core/index.js.map +0 -1
- package/x/core/testing/testing.d.ts +0 -52
- package/x/core/testing/testing.js +0 -45
- package/x/core/testing/testing.js.map +0 -1
- package/x/deck/index.d.ts +0 -9
- package/x/deck/index.js +0 -10
- package/x/deck/index.js.map +0 -1
- package/x/deck/parts/catalog.d.ts +0 -22
- package/x/deck/parts/catalog.js +0 -35
- package/x/deck/parts/catalog.js.map +0 -1
- package/x/deck/parts/db.d.ts +0 -17
- package/x/deck/parts/db.js +0 -52
- package/x/deck/parts/db.js.map +0 -1
- package/x/deck/parts/device-skins/device-icons.d.ts +0 -12
- package/x/deck/parts/device-skins/device-icons.js +0 -27
- package/x/deck/parts/device-skins/device-icons.js.map +0 -1
- package/x/deck/parts/device-skins/device-skin.d.ts +0 -14
- package/x/deck/parts/device-skins/device-skin.js +0 -22
- package/x/deck/parts/device-skins/device-skin.js.map +0 -1
- package/x/deck/parts/local-storage-kv.d.ts +0 -2
- package/x/deck/parts/local-storage-kv.js +0 -6
- package/x/deck/parts/local-storage-kv.js.map +0 -1
- package/x/deck/parts/merge-bindings.d.ts +0 -2
- package/x/deck/parts/merge-bindings.js +0 -15
- package/x/deck/parts/merge-bindings.js.map +0 -1
- package/x/deck/parts/overlay-visibility.d.ts +0 -18
- package/x/deck/parts/overlay-visibility.js +0 -35
- package/x/deck/parts/overlay-visibility.js.map +0 -1
- package/x/deck/views/bindings/style.css.js +0 -5
- package/x/deck/views/bindings/style.css.js.map +0 -1
- package/x/deck/views/bindings/view.d.ts +0 -2
- package/x/deck/views/bindings/view.js +0 -80
- package/x/deck/views/bindings/view.js.map +0 -1
- package/x/deck/views/overlay/style.css.js +0 -109
- package/x/deck/views/overlay/style.css.js.map +0 -1
- package/x/deck/views/overlay/view.d.ts +0 -2
- package/x/deck/views/overlay/view.js +0 -40
- package/x/deck/views/overlay/view.js.map +0 -1
- package/x/demo/game/game.d.ts +0 -17
- package/x/demo/game/game.js +0 -63
- package/x/demo/game/game.js.map +0 -1
- package/x/demo/game/parts/agent.d.ts +0 -7
- package/x/demo/game/parts/agent.js +0 -8
- package/x/demo/game/parts/agent.js.map +0 -1
- package/x/demo/game/parts/game-bindings.d.ts +0 -15
- package/x/demo/game/parts/game-bindings.js +0 -10
- package/x/demo/game/parts/game-bindings.js.map +0 -1
- package/x/demo/game/parts/logic.d.ts +0 -8
- package/x/demo/game/parts/logic.js +0 -21
- package/x/demo/game/parts/logic.js.map +0 -1
- package/x/demo/game/parts/player.d.ts +0 -14
- package/x/demo/game/parts/player.js +0 -26
- package/x/demo/game/parts/player.js.map +0 -1
- package/x/demo/game/parts/renderer.d.ts +0 -13
- package/x/demo/game/parts/renderer.js +0 -91
- package/x/demo/game/parts/renderer.js.map +0 -1
- package/x/demo/game/parts/state.d.ts +0 -8
- package/x/demo/game/parts/state.js +0 -20
- package/x/demo/game/parts/state.js.map +0 -1
- package/x/demo/game/parts/virtual-device.d.ts +0 -8
- package/x/demo/game/parts/virtual-device.js +0 -11
- package/x/demo/game/parts/virtual-device.js.map +0 -1
- package/x/demo/ui/theater/styles.css.d.ts +0 -1
- package/x/demo/ui/theater/styles.css.js +0 -57
- package/x/demo/ui/theater/styles.css.js.map +0 -1
- package/x/demo/ui/theater/view.d.ts +0 -2
- package/x/demo/ui/theater/view.js +0 -45
- package/x/demo/ui/theater/view.js.map +0 -1
- package/x/demo/ui/theater/virtual/style.css.js +0 -42
- package/x/demo/ui/theater/virtual/style.css.js.map +0 -1
- package/x/demo/ui/theater/virtual/view.d.ts +0 -4
- package/x/demo/ui/theater/virtual/view.js +0 -19
- package/x/demo/ui/theater/virtual/view.js.map +0 -1
- package/x/demo/ui/utils/loader.d.ts +0 -2
- package/x/demo/ui/utils/loader.js +0 -3
- package/x/demo/ui/utils/loader.js.map +0 -1
- package/x/nubs/index.d.ts +0 -3
- package/x/nubs/index.js +0 -4
- package/x/nubs/index.js.map +0 -1
- package/x/nubs/lookpad/styles.d.ts +0 -1
- package/x/nubs/lookpad/styles.js +0 -21
- package/x/nubs/lookpad/styles.js.map +0 -1
- package/x/nubs/lookpad/view.d.ts +0 -1
- package/x/nubs/lookpad/view.js +0 -33
- package/x/nubs/lookpad/view.js.map +0 -1
- package/x/nubs/stick/style.css.d.ts +0 -2
- package/x/nubs/stick/style.css.js +0 -69
- package/x/nubs/stick/style.css.js.map +0 -1
- package/x/nubs/stick/view.d.ts +0 -2
- package/x/nubs/stick/view.js +0 -95
- package/x/nubs/stick/view.js.map +0 -1
- package/x/nubs/vpad/styles.css.d.ts +0 -2
- package/x/nubs/vpad/styles.css.js +0 -133
- package/x/nubs/vpad/styles.css.js.map +0 -1
- package/x/nubs/vpad/utils/gamepad-inputs.d.ts +0 -29
- package/x/nubs/vpad/utils/gamepad-inputs.js +0 -31
- package/x/nubs/vpad/utils/gamepad-inputs.js.map +0 -1
- package/x/nubs/vpad/utils/prevent-default-touch-shenanigans.d.ts +0 -1
- package/x/nubs/vpad/utils/prevent-default-touch-shenanigans.js +0 -9
- package/x/nubs/vpad/utils/prevent-default-touch-shenanigans.js.map +0 -1
- package/x/nubs/vpad/utils/touch-tracking.d.ts +0 -6
- package/x/nubs/vpad/utils/touch-tracking.js +0 -55
- package/x/nubs/vpad/utils/touch-tracking.js.map +0 -1
- package/x/nubs/vpad/view.d.ts +0 -2
- package/x/nubs/vpad/view.js +0 -123
- package/x/nubs/vpad/view.js.map +0 -1
- package/x/tests.test.d.ts +0 -1
- package/x/tests.test.js +0 -4
- package/x/tests.test.js.map +0 -1
- package/x/utils/dispensers.d.ts +0 -7
- package/x/utils/dispensers.js +0 -16
- package/x/utils/dispensers.js.map +0 -1
- package/x/utils/gamepads.d.ts +0 -14
- package/x/utils/gamepads.js +0 -40
- package/x/utils/gamepads.js.map +0 -1
- package/x/utils/quick-math.js +0 -11
- package/x/utils/quick-math.js.map +0 -1
- /package/s/{core → _archive/core}/bindings/action.ts +0 -0
- /package/s/{core → _archive/core}/bindings/parts/defaults.ts +0 -0
- /package/s/{core → _archive/core}/bindings/parts/is-pressed.ts +0 -0
- /package/s/{core → _archive/core}/bindings/parts/lens-algo.ts +0 -0
- /package/s/{core → _archive/core}/bindings/parts/lookup-proxies.ts +0 -0
- /package/s/{core → _archive/core}/bindings/resolver.ts +0 -0
- /package/s/{core → _archive/core}/bindings/sample-map.ts +0 -0
- /package/s/{core → _archive/core}/bindings/types.ts +0 -0
- /package/s/{core → _archive/core}/core.test.ts +0 -0
- /package/s/{core → _archive/core}/devices/auto-gamepads.ts +0 -0
- /package/s/{core → _archive/core}/devices/device.ts +0 -0
- /package/s/{core → _archive/core}/devices/infra/group.ts +0 -0
- /package/s/{core → _archive/core}/devices/infra/sampler.ts +0 -0
- /package/s/{core → _archive/core}/devices/standard/gamepad.ts +0 -0
- /package/s/{core → _archive/core}/devices/standard/index.ts +0 -0
- /package/s/{core → _archive/core}/devices/standard/keyboard.ts +0 -0
- /package/s/{core → _archive/core}/devices/standard/pointer.ts +0 -0
- /package/s/{core → _archive/core}/devices/standard/primary.ts +0 -0
- /package/s/{core → _archive/core}/devices/standard/stick.ts +0 -0
- /package/s/{core → _archive/core}/devices/standard/vpad.ts +0 -0
- /package/s/{core → _archive/core}/devices/types.ts +0 -0
- /package/s/{core → _archive/core}/hub/hub.ts +0 -0
- /package/s/{core → _archive/core}/hub/meta-bindings.ts +0 -0
- /package/s/{core → _archive/core}/hub/parts/connected.ts +0 -0
- /package/s/{core → _archive/core}/hub/port.ts +0 -0
- /package/s/{core → _archive/core}/hub/types.ts +0 -0
- /package/s/{core → _archive/core}/index.ts +0 -0
- /package/s/{core → _archive/core}/testing/testing.ts +0 -0
- /package/s/{deck → _archive/deck}/index.ts +0 -0
- /package/s/{deck → _archive/deck}/parts/catalog.ts +0 -0
- /package/s/{deck → _archive/deck}/parts/db.ts +0 -0
- /package/s/{deck → _archive/deck}/parts/device-skins/device-icons.ts +0 -0
- /package/s/{deck → _archive/deck}/parts/device-skins/device-skin.ts +0 -0
- /package/s/{deck → _archive/deck}/parts/local-storage-kv.ts +0 -0
- /package/s/{deck → _archive/deck}/parts/merge-bindings.ts +0 -0
- /package/s/{deck → _archive/deck}/parts/overlay-visibility.ts +0 -0
- /package/s/{deck → _archive/deck}/views/bindings/style.css.ts +0 -0
- /package/s/{deck → _archive/deck}/views/bindings/view.ts +0 -0
- /package/s/{deck → _archive/deck}/views/overlay/style.css.ts +0 -0
- /package/s/{deck → _archive/deck}/views/overlay/view.ts +0 -0
- /package/s/{demo → _archive/demo}/game/game.ts +0 -0
- /package/s/{demo → _archive/demo}/game/parts/agent.ts +0 -0
- /package/s/{demo → _archive/demo}/game/parts/game-bindings.ts +0 -0
- /package/s/{demo → _archive/demo}/game/parts/logic.ts +0 -0
- /package/s/{demo → _archive/demo}/game/parts/player.ts +0 -0
- /package/s/{demo → _archive/demo}/game/parts/renderer.ts +0 -0
- /package/s/{demo → _archive/demo}/game/parts/state.ts +0 -0
- /package/s/{demo → _archive/demo}/game/parts/virtual-device.ts +0 -0
- /package/s/{demo → _archive/demo}/ui/theater/styles.css.ts +0 -0
- /package/s/{demo → _archive/demo}/ui/theater/view.ts +0 -0
- /package/s/{demo → _archive/demo}/ui/theater/virtual/style.css.ts +0 -0
- /package/s/{demo → _archive/demo}/ui/theater/virtual/view.ts +0 -0
- /package/s/{demo → _archive/demo}/ui/utils/loader.ts +0 -0
- /package/s/{nubs → _archive/nubs}/index.ts +0 -0
- /package/s/{nubs → _archive/nubs}/lookpad/styles.ts +0 -0
- /package/s/{nubs → _archive/nubs}/lookpad/view.ts +0 -0
- /package/s/{nubs → _archive/nubs}/stick/style.css.ts +0 -0
- /package/s/{nubs → _archive/nubs}/stick/view.ts +0 -0
- /package/s/{nubs → _archive/nubs}/vpad/styles.css.ts +0 -0
- /package/s/{nubs → _archive/nubs}/vpad/utils/gamepad-inputs.ts +0 -0
- /package/s/{nubs → _archive/nubs}/vpad/utils/prevent-default-touch-shenanigans.ts +0 -0
- /package/s/{nubs → _archive/nubs}/vpad/utils/touch-tracking.ts +0 -0
- /package/s/{nubs → _archive/nubs}/vpad/view.ts +0 -0
- /package/s/{utils → _archive/utils}/dispensers.ts +0 -0
- /package/s/{utils → _archive/utils}/gamepads.ts +0 -0
- /package/s/{utils → _archive/utils}/quick-math.ts +0 -0
- /package/x/core/{bindings/parts → atom}/defaults.js +0 -0
- /package/x/core/{devices → atom}/types.js +0 -0
- /package/x/{deck/views/bindings → demo/demo-app}/style.css.d.ts +0 -0
- /package/x/{deck/views/overlay → gamepad/gamepad-app}/style.css.d.ts +0 -0
- /package/x/{core/bindings/parts/lookup-proxies.d.ts → gamepad/main.bundle.d.ts} +0 -0
- /package/x/{demo/ui/theater/virtual → ui/views/desk}/style.css.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Vr=/'/g,Wr=/"/g,Kr=/^(?:script|style|textarea|title)$/i,br=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),w=br(1),Io=br(2),Uo=br(3),F=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),Gr=new WeakMap,nt=at.createTreeWalker(at,129);function Jr(r,t){if(!xr(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return qr!==void 0?qr.createHTML(t):t}var Yr=(r,t)=>{let e=r.length-1,s=[],o,i=t===2?"<svg>":t===3?"<math>":"",n=Ft;for(let a=0;a<e;a++){let c=r[a],l,h,u=-1,p=0;for(;p<c.length&&(n.lastIndex=p,h=n.exec(c),h!==null);)p=n.lastIndex,n===Ft?h[1]==="!--"?n=Ir:h[1]!==void 0?n=Ur:h[2]!==void 0?(Kr.test(h[2])&&(o=RegExp("</"+h[2],"g")),n=it):h[3]!==void 0&&(n=it):n===it?h[0]===">"?(n=o??Ft,u=-1):h[1]===void 0?u=-2:(u=n.lastIndex-h[2].length,l=h[1],n=h[3]===void 0?it:h[3]==='"'?Wr:Vr):n===Wr||n===Vr?n=it:n===Ir||n===Ur?n=Ft:(n=it,o=void 0);let f=n===it&&r[a+1].startsWith("/>")?" ":"";i+=n===Ft?c+io:u>=0?(s.push(l),c.slice(0,u)+gr+c.slice(u)+G+f):c+G+(u===-2?a:f)}return[Jr(r,i+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},Yt=class r{constructor({strings:t,_$litType$:e},s){let o;this.parts=[];let i=0,n=0,a=t.length-1,c=this.parts,[l,h]=Yr(t,e);if(this.el=r.createElement(l,s),nt.currentNode=this.el.content,e===2||e===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(o=nt.nextNode())!==null&&c.length<a;){if(o.nodeType===1){if(o.hasAttributes())for(let u of o.getAttributeNames())if(u.endsWith(gr)){let p=h[n++],f=o.getAttribute(u).split(G),d=/([.?@])?(.*)/.exec(p);c.push({type:1,index:i,name:d[2],strings:f,ctor:d[1]==="."?fe:d[1]==="?"?ge:d[1]==="@"?ye:lt}),o.removeAttribute(u)}else u.startsWith(G)&&(c.push({type:6,index:i}),o.removeAttribute(u));if(Kr.test(o.tagName)){let u=o.textContent.split(G),p=u.length-1;if(p>0){o.textContent=me?me.emptyScript:"";for(let f=0;f<p;f++)o.append(u[f],Kt()),nt.nextNode(),c.push({type:2,index:++i});o.append(u[p],Kt())}}}else if(o.nodeType===8)if(o.data===yr)c.push({type:2,index:i});else{let u=-1;for(;(u=o.data.indexOf(G,u+1))!==-1;)c.push({type:7,index:i}),u+=G.length-1}i++}}static createElement(t,e){let s=at.createElement("template");return s.innerHTML=t,s}};function ct(r,t,e=r,s){if(t===F)return t;let o=s!==void 0?e._$Co?.[s]:e._$Cl,i=Jt(t)?void 0:t._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),i===void 0?o=void 0:(o=new i(r),o._$AT(r,e,s)),s!==void 0?(e._$Co??=[])[s]=o:e._$Cl=o),o!==void 0&&(t=ct(r,o._$AS(r,t.values),o,s)),t}var de=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??at).importNode(e,!0);nt.currentNode=o;let i=nt.nextNode(),n=0,a=0,c=s[0];for(;c!==void 0;){if(n===c.index){let l;c.type===2?l=new wt(i,i.nextSibling,this,t):c.type===1?l=new c.ctor(i,c.name,c.strings,this,t):c.type===6&&(l=new xe(i,this,t)),this._$AV.push(l),c=s[++a]}n!==c?.index&&(i=nt.nextNode(),n++)}return nt.currentNode=at,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++}},wt=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,o){this.type=2,this._$AH=k,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=ct(this,t,e),Jt(t)?t===k||t==null||t===""?(this._$AH!==k&&this._$AR(),this._$AH=k):t!==this._$AH&&t!==F&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Fr(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!==k&&Jt(this._$AH)?this._$AA.nextSibling.data=t:this.T(at.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=Yt.createElement(Jr(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===o)this._$AH.p(e);else{let i=new de(o,this),n=i.u(this.options);i.p(e),this.T(n),this._$AH=i}}_$AC(t){let e=Gr.get(t.strings);return e===void 0&&Gr.set(t.strings,e=new Yt(t)),e}k(t){xr(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,o=0;for(let i of t)o===e.length?e.push(s=new r(this.O(Kt()),this.O(Kt()),this,this.options)):s=e[o],s._$AI(i),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=t.nextSibling;t.remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},lt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,o,i){this.type=1,this._$AH=k,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=i,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=k}_$AI(t,e=this,s,o){let i=this.strings,n=!1;if(i===void 0)t=ct(this,t,e,0),n=!Jt(t)||t!==this._$AH&&t!==F,n&&(this._$AH=t);else{let a=t,c,l;for(t=i[0],c=0;c<i.length-1;c++)l=ct(this,a[s+c],e,c),l===F&&(l=this._$AH[c]),n||=!Jt(l)||l!==this._$AH[c],l===k?t=k:t!==k&&(t+=(l??"")+i[c+1]),this._$AH[c]=l}n&&!o&&this.j(t)}j(t){t===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},fe=class extends lt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===k?void 0:t}},ge=class extends lt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==k)}},ye=class extends lt{constructor(t,e,s,o,i){super(t,e,s,o,i),this.type=5}_$AI(t,e=this){if((t=ct(this,t,e,0)??k)===F)return;let s=this._$AH,o=t===k&&s!==k||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,i=t!==k&&(s===k||o);o&&this.element.removeEventListener(this.name,this,s),i&&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)}},xe=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){ct(this,t)}},Xr={M:gr,P:G,A:yr,C:1,L:Yr,R:de,D:Fr,V:ct,I:wt,H:lt,N:ge,U:ye,B:fe,F:xe},no=fr.litHtmlPolyfillSupport;no?.(Yt,wt),(fr.litHtmlVersions??=[]).push("3.3.1");var C=(r,t,e)=>{let s=e?.renderBefore??t,o=s._$litPart$;if(o===void 0){let i=e?.renderBefore??null;s._$litPart$=o=new wt(t.insertBefore(Kt(),i),i,void 0,e??{})}return o._$AI(r),o};var wr=globalThis,vt=class extends W{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=C(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return F}};vt._$litElement$=!0,vt.finalized=!0,wr.litElementHydrateSupport?.({LitElement:vt});var ao=wr.litElementPolyfillSupport;ao?.({LitElement:vt});(wr.litElementVersions??=[]).push("4.2.1");var z={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},M={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)M.any(r,e,s)},record:(r,t)=>M.entries(r,Object.entries(t))};function Zr(r,t={}){let e=document.createElement(r);return M.record(e,t),e}function Qr(r){let t=document.createDocumentFragment();return C(r,t),t.firstElementChild}function be(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[i,n]=o;r.addEventListener(s,n,i),e.push(()=>r.removeEventListener(s,n))}return()=>e.forEach(s=>s())}function ts(r,t){let e=new MutationObserver(t);return e.observe(r,{attributes:!0}),()=>e.disconnect()}var we=class{element;constructor(t){this.element=t}strings=new Proxy({},{get:(t,e)=>z.string(this.element,e),set:(t,e,s)=>M.string(this.element,e,s)});numbers=new Proxy({},{get:(t,e)=>z.number(this.element,e),set:(t,e,s)=>M.number(this.element,e,s)});booleans=new Proxy({},{get:(t,e)=>z.boolean(this.element,e),set:(t,e,s)=>M.boolean(this.element,e,s)})};var es=(r,t,e={})=>new Proxy(t,{get:(s,o)=>{switch(t[o]){case String:return z.string(r,o);case Number:return z.number(r,o);case Boolean:return z.boolean(r,o);default:throw new Error(`invalid attribute type for "${o}"`)}},set:(s,o,i)=>{try{switch(e.beforeSet?.(o),t[o]){case String:return M.string(r,o,i);case Number:return M.number(r,o,i);case Boolean:return M.boolean(r,o,i);default:throw new Error(`invalid attribute type for "${o}"`)}}finally{e.afterSet?.(o)}}});function $t(r){let t=new we(r);return{strings:t.strings,numbers:t.numbers,booleans:t.booleans,on:e=>ts(r,e),spec:(e,s={})=>es(r,e,s)}}$t.get=z;$t.set=M;function rs(r){return new vr(r)}var vr=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 M.entries(t,this.#t),t.append(...this.#e),t}};function St(r,t=document){let e=t.querySelector(r);if(!e)throw new Error(`element not found (${r})`);return e}function ve(r,t=document){return t.querySelector(r)}function $e(r,t=document){return Array.from(t.querySelectorAll(r))}var Se=class r{element;#t;constructor(t){this.element=t}in(t){return new r(typeof t=="string"?St(t,this.element):t)}require(t){return St(t,this.element)}maybe(t){return ve(t,this.element)}all(t){return $e(t,this.element)}render(...t){return C(t,this.element)}get attrs(){return this.#t??=$t(this.element)}events(t){return be(this.element,t)}};function ss(r){return r.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function os(r,t={}){let{soft:e=!1,upgrade:s=!0}=t;for(let[o,i]of Object.entries(r)){let n=ss(o),a=customElements.get(n);e&&a||(customElements.define(n,i),s&&document.querySelectorAll(n).forEach(c=>{c.constructor===HTMLElement&&customElements.upgrade(c)}))}}function v(r,t=document){return St(r,t)}v.in=(r,t=document)=>new Se(t).in(r);v.require=St;v.maybe=ve;v.all=$e;v.el=Zr;v.elmer=rs;v.mk=Qr;v.events=be;v.attrs=$t;v.register=os;v.render=(r,...t)=>C(t,r);var kt=Object.freeze({eq(r,t){if(r.length!==t.length)return!1;let e=0;for(let s=0;s<r.length;s++)e|=r[s]^t[s];return e===0},random(r){return crypto.getRandomValues(new Uint8Array(r))}});var _=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((s,o)=>[s,o])),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 a=0,c=0,l=[];for(let h of t){if(h===this.lexicon.padding?.character)continue;let u=this.lookup[h];if(u===void 0)throw new Error(`Invalid character: ${h}`);for(a=a<<e|u,c+=e;c>=8;)c-=8,l.push(a>>c&255)}return new Uint8Array(l)}let s=0n,o=BigInt(this.lexicon.characters.length),i=!1;t.startsWith(this.negativePrefix)&&(t=t.slice(this.negativePrefix.length),i=!0);for(let a of t){let c=this.lookup[a];if(c===void 0)throw new Error(`Invalid character: ${a}`);s=s*o+BigInt(c)}let n=[];for(;s>0n;)n.unshift(Number(s%256n)),s=s/256n;return new Uint8Array(n)}fromBytes(t){let e=Math.log2(this.lexicon.characters.length);if(Number.isInteger(e)){let n=0,a=0,c="";for(let l of t)for(n=n<<8|l,a+=8;a>=e;){a-=e;let h=n>>a&(1<<e)-1;c+=this.lexicon.characters[h]}if(a>0){let l=n<<e-a&(1<<e)-1;c+=this.lexicon.characters[l]}if(this.lexicon.padding)for(;c.length%this.lexicon.padding.size!==0;)c+=this.lexicon.padding.character;return c}let s=0n;for(let n of t)s=(s<<8n)+BigInt(n);if(s===0n)return this.lexicon.characters[0];let o=BigInt(this.lexicon.characters.length),i="";for(;s>0n;)i=this.lexicon.characters[Number(s%o)]+i,s=s/o;return i}toInteger(t){if(!t)return 0;let e=0n,s=!1,o=BigInt(this.lexicon.characters.length);t.startsWith(this.negativePrefix)&&(t=t.slice(this.negativePrefix.length),s=!0);for(let i of t){let n=this.lookup[i];if(n===void 0)throw new Error(`Invalid character: ${i}`);e=e*o+BigInt(n)}return Number(s?-e:e)}fromInteger(t){t=Math.floor(t);let e=t<0,s=BigInt(e?-t:t);if(s===0n)return this.lexicon.characters[0];let o=BigInt(this.lexicon.characters.length),i="";for(;s>0n;)i=this.lexicon.characters[Number(s%o)]+i,s=s/o;return e?`${this.negativePrefix}${i}`:i}random(t=32){return this.fromBytes(kt.random(t))}};var $r=new _(_.lexicons.hex),Gi=new _(_.lexicons.base2),Fi=new _(_.lexicons.base36),Ki=new _(_.lexicons.base58),Ji=new _(_.lexicons.base62),Yi=new _(_.lexicons.base64),Xi=new _(_.lexicons.base64url);var Sr=["doz","mar","bin","wan","sam","lit","sig","hid","fid","lis","sog","dir","wac","sab","wis","sib","rig","sol","dop","mod","fog","lid","hop","dar","dor","lor","hod","fol","rin","tog","sil","mir","hol","pas","lac","rov","liv","dal","sat","lib","tab","han","tic","pid","tor","bol","fos","dot","los","dil","for","pil","ram","tir","win","tad","bic","dif","roc","wid","bis","das","mid","lop","ril","nar","dap","mol","san","loc","nov","sit","nid","tip","sic","rop","wit","nat","pan","min","rit","pod","mot","tam","tol","sav","pos","nap","nop","som","fin","fon","ban","mor","wor","sip","ron","nor","bot","wic","soc","wat","dol","mag","pic","dav","bid","bal","tim","tas","mal","lig","siv","tag","pad","sal","div","dac","tan","sid","fab","tar","mon","ran","nis","wol","mis","pal","las","dis","map","rab","tob","rol","lat","lon","nod","nav","fig","nom","nib","pag","sop","ral","bil","had","doc","rid","moc","pac","rav","rip","fal","tod","til","tin","hap","mic","fan","pat","tac","lab","mog","sim","son","pin","lom","ric","tap","fir","has","bos","bat","poc","hac","tid","hav","sap","lin","dib","hos","dab","bit","bar","rac","par","lod","dos","bor","toc","hil","mac","tom","dig","fil","fas","mit","hob","har","mig","hin","rad","mas","hal","rag","lag","fad","top","mop","hab","nil","nos","mil","fop","fam","dat","nol","din","hat","nac","ris","fot","rib","hoc","nim","lar","fit","wal","rap","sar","nal","mos","lan","don","dan","lad","dov","riv","bac","pol","lap","tal","pit","nam","bon","ros","ton","fod","pon","sov","noc","sor","lav","mat","mip","fip"];var kr=["zod","nec","bud","wes","sev","per","sut","let","ful","pen","syt","dur","wep","ser","wyl","sun","ryp","syx","dyr","nup","heb","peg","lup","dep","dys","put","lug","hec","ryt","tyv","syd","nex","lun","mep","lut","sep","pes","del","sul","ped","tem","led","tul","met","wen","byn","hex","feb","pyl","dul","het","mev","rut","tyl","wyd","tep","bes","dex","sef","wyc","bur","der","nep","pur","rys","reb","den","nut","sub","pet","rul","syn","reg","tyd","sup","sem","wyn","rec","meg","net","sec","mul","nym","tev","web","sum","mut","nyx","rex","teb","fus","hep","ben","mus","wyx","sym","sel","ruc","dec","wex","syr","wet","dyl","myn","mes","det","bet","bel","tux","tug","myr","pel","syp","ter","meb","set","dut","deg","tex","sur","fel","tud","nux","rux","ren","wyt","nub","med","lyt","dus","neb","rum","tyn","seg","lyx","pun","res","red","fun","rev","ref","mec","ted","rus","bex","leb","dux","ryn","num","pyx","ryg","ryx","fep","tyr","tus","tyc","leg","nem","fer","mer","ten","lus","nus","syl","tec","mex","pub","rym","tuc","fyl","lep","deb","ber","mug","hut","tun","byl","sud","pem","dev","lur","def","bus","bep","run","mel","pex","dyt","byt","typ","lev","myl","wed","duc","fur","fex","nul","luc","len","ner","lex","rup","ned","lec","ryd","lyd","fen","wel","nyd","hus","rel","rud","nes","hes","fet","des","ret","dun","ler","nyr","seb","hul","ryl","lud","rem","lys","fyn","wer","ryc","sug","nys","nyl","lyn","dyn","dem","lux","fed","sed","bec","mun","lyr","tes","mud","nyt","byr","sen","weg","fyr","mur","tel","rep","teg","pec","nel","nev","fes"];var ut={defaults:{groupSize:4,wordSeparator:".",groupSeparator:" "},random(r,t){let e=kt.random(r);return this.fromBytes(e,t)},fromBytes(r,t={}){let{groupSize:e=ut.defaults.groupSize,wordSeparator:s=ut.defaults.wordSeparator,groupSeparator:o=ut.defaults.groupSeparator}=t,i=[],n=[];r.forEach((c,l)=>{let h=l%2===0?Sr:kr;n.push(h[c]),n.length===2&&(i.push(n.join("")),n=[])}),n.length&&i.push(n.join(""));let a=[];for(let c=0;c<i.length;c+=e)a.push(i.slice(c,c+e).join(s));return a.join(o)},toBytes(r){let t=r.toLowerCase().replace(/[^a-z]/g,"");if(t.length/3%1!==0)throw new Error(`invalid triplet count, ${t.length} does not divide into triplets`);let s=[];for(let o=0;o<t.length;o+=3)s.push(t.slice(o,o+3));return new Uint8Array(s.map((o,i)=>{let a=(i%2===0?Sr:kr).findIndex(c=>c===o);if(a===-1)throw new Error(`unknown triplet ${o}`);return a}))},toHex(r){return $r.fromBytes(ut.toBytes(r))},fromHex(r,t){return ut.fromBytes($r.toBytes(r),t)}};var At=Object.freeze({fromBytes(r){return[...r].map(t=>t.toString(16).padStart(2,"0")).join("")},toBytes(r){if(r.length%2!==0)throw new Error("must have even number of hex characters");let t=new Uint8Array(r.length/2);for(let e=0;e<r.length;e+=2)t[e/2]=parseInt(r.slice(e,e+2),16);return t},random(r=32){return this.fromBytes(kt.random(r))},string(r){return At.fromBytes(r)},bytes(r){return At.toBytes(r)}});function ke(r,t){let e,s,o=[];function i(){e=[],s&&clearTimeout(s),s=void 0,o=[]}return i(),((...n)=>{e=n,s&&clearTimeout(s);let a=new Promise((c,l)=>{o.push({resolve:c,reject:l})});return s=setTimeout(()=>{Promise.resolve().then(()=>t(...e)).then(c=>{for(let{resolve:l}of o)l(c);i()}).catch(c=>{for(let{reject:l}of o)l(c);i()})},r),a})}function ht(){let r,t,e=new Promise((o,i)=>{r=o,t=i});function s(o){return o.then(r).catch(t),e}return{promise:e,resolve:r,reject:t,entangle:s}}function _t(r){let t=null;return((...e)=>(t?t.params=e:(t={params:e,deferred:ht()},queueMicrotask(()=>{let{params:s,deferred:o}=t;t=null,Promise.resolve(r(...s)).then(o.resolve).catch(o.reject)})),t.deferred.promise))}var B={};Ys(B,{clone:()=>Xt,equal:()=>co,freeze:()=>lo});function Xt(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=>Xt(s,new Set(t))):r.constructor===Object?e=Object.fromEntries(Object.entries(r).map(([s,o])=>[s,Xt(o,new Set(t))])):r instanceof Map?e=new Map(Array.from(r,([s,o])=>[s,Xt(o,new Set(t))])):r instanceof Set?e=new Set(Array.from(r,s=>Xt(s,new Set(t)))):r instanceof Date?e=new Date(r.getTime()):e=r,t.delete(r)):e=r,e}var Zt=Object.freeze({happy:r=>r!=null,sad:r=>r==null,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 co=(r,t)=>{function e(s,o,i){if(!Zt.object(s)||!Zt.object(o))return s===o;if(i.includes(s))throw new Error("forbidden circularity detected in deep equal comparison");let n=[...i,s];if(s instanceof Map&&o instanceof Map){if(s.size!==o.size)return!1;for(let[a,c]of s)if(!o.has(a)||!e(c,o.get(a),n))return!1}else if(s instanceof Set&&o instanceof Set){if(s.size!==o.size)return!1;for(let a of s)if(!Array.from(o).some(c=>e(a,c,n)))return!1}else{let a=Object.keys(s),c=Object.keys(o);if(a.length!==c.length)return!1;for(let l of a)if(!c.includes(l)||!e(s[l],o[l],n))return!1}return!0}return e(r,t,[])};function lo(r){function t(e,s){if(!Zt.object(e)||s.includes(e))return e;let o=[...s,e];if(e instanceof Map)for(let i of e.entries())for(let n of i)t(n,o);else if(e instanceof Set)for(let i of e)t(i,o);else if(Array.isArray(e))for(let i of e)t(i,o);else for(let i of Object.values(e))t(i,o);return Object.freeze(e)}return t(r,[])}var K=class r extends Map{static require(t,e){if(t.has(e))return t.get(e);throw new Error(`required key not found: "${e}"`)}static guarantee(t,e,s){if(t.has(e))return t.get(e);{let o=s();return t.set(e,o),o}}array(){return[...this]}require(t){return r.require(this,t)}guarantee(t,e){return r.guarantee(this,t,e)}},X=K;var Ar=class extends Set{array(){return[...this]}hasAll(...t){return t.every(e=>this.has(e))}adds(...t){for(let e of t)this.add(e);return this}deletes(...t){for(let e of t)this.delete(e);return this}clear(){return super.clear(),this}},Ae=Ar;var _r=class r extends WeakMap{static require(t,e){if(t.has(e))return t.get(e);throw new Error("required key not found")}static guarantee(t,e,s){if(t.has(e))return t.get(e);{let o=s();return t.set(e,o),o}}require(t){return r.require(this,t)}guarantee(t,e){return r.guarantee(this,t,e)}},is=_r;function ns(...r){return(...t)=>r.forEach(e=>e(...t))}function*uo(r){for(let t=0;t<r;t++)yield t}function _e(r){return[...uo(r)]}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 as=Mr;var Me=class{getRefill;#t=[];constructor(t){this.getRefill=t,this.#e()}get currentStock(){return[...this.#t]}#e(){if(this.#t.length===0&&(this.#t=[...this.getRefill()]),this.#t.length===0)throw new Error("dispenser's getRefill returned an empty array")}takeAll(){let t=this.#t;return this.#t=[...this.getRefill()],t}takeRandom(){this.#e();let t=Math.floor(Math.random()*this.#t.length),[e]=this.#t.splice(t,1);return e}takeFirst(){return this.#e(),this.#t.shift()}takeLast(){return this.#e(),this.#t.pop()}shift=this.takeFirst.bind(this);pop=this.takeLast.bind(this)};function D(){let r=[];function t(){for(let e of r)e();r=[]}return t.schedule=(...e)=>(r.push(...e),t),t}function pt(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)}}var Mt=(r=0)=>new Promise(t=>setTimeout(t,r));function ho(r){return{map:t=>Qt(r,t),filter:t=>cs(r,t)}}ho.pipe=Object.freeze({map:r=>(t=>Qt(t,r)),filter:r=>(t=>cs(t,r))});var Qt=(r,t)=>Object.fromEntries(Object.entries(r).map(([e,s])=>[e,t(s,e)])),cs=(r,t)=>Object.fromEntries(Object.entries(r).filter(([e,s])=>t(s,e)));function Pr(r){return new Er(r)}var Er=class r{#t;static with=Pr;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 ls(){let r=new Set;async function t(...c){await Promise.all([...r].map(l=>l(...c)))}function e(c){return r.add(c),()=>{r.delete(c)}}async function s(...c){return t(...c)}function o(c){return e(c)}async function i(c){let{promise:l,resolve:h}=ht(),u=o(async(...p)=>{c&&await c(...p),h(p),u()});return l}function n(){r.clear()}let a={pub:s,sub:o,publish:t,subscribe:e,on:e,next:i,clear:n};return Object.assign(o,a),Object.assign(s,a),a}function E(r){let t=ls();return r&&t.sub(r),t.sub}function us(r){let t=ls();return r&&t.sub(r),t.pub}var R=A`
|
|
1
|
+
var Ir=Object.defineProperty;var Vr=(r,t)=>{for(var e in t)Ir(r,e,{get:t[e],enumerable:!0})};var _t=globalThis,St=_t.ShadowRoot&&(_t.ShadyCSS===void 0||_t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,pe=Symbol(),Oe=new WeakMap,at=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==pe)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(St&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Oe.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Oe.set(e,t))}return t}toString(){return this.cssText}},Re=r=>new at(typeof r=="string"?r:r+"",void 0,pe),A=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,o,n)=>s+(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.")})(o)+r[n+1],r[0]);return new at(e,r,pe)},Et=(r,t)=>{if(St)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),o=_t.litNonce;o!==void 0&&s.setAttribute("nonce",o),s.textContent=e.cssText,r.appendChild(s)}},X=St?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Re(e)})(r):r;var{is:Wr,defineProperty:Kr,getOwnPropertyDescriptor:Gr,getOwnPropertyNames:Fr,getOwnPropertySymbols:Yr,getPrototypeOf:Jr}=Object,Ct=globalThis,Ne=Ct.trustedTypes,Xr=Ne?Ne.emptyScript:"",Qr=Ct.reactiveElementPolyfillSupport,ct=(r,t)=>r,he={toAttribute(r,t){switch(t){case Boolean:r=r?Xr: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}},De=(r,t)=>!Wr(r,t),Le={attribute:!0,type:String,converter:he,reflect:!1,useDefault:!1,hasChanged:De};Symbol.metadata??=Symbol("metadata"),Ct.litPropertyMetadata??=new WeakMap;var T=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=Le){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 s=Symbol(),o=this.getPropertyDescriptor(t,s,e);o!==void 0&&Kr(this.prototype,t,o)}}static getPropertyDescriptor(t,e,s){let{get:o,set:n}=Gr(this.prototype,t)??{get(){return this[e]},set(i){this[e]=i}};return{get:o,set(i){let c=o?.call(this);n?.call(this,i),this.requestUpdate(t,c,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Le}static _$Ei(){if(this.hasOwnProperty(ct("elementProperties")))return;let t=Jr(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(ct("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ct("properties"))){let e=this.properties,s=[...Fr(e),...Yr(e)];for(let o of s)this.createProperty(o,e[o])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,o]of e)this.elementProperties.set(s,o)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let o=this._$Eu(e,s);o!==void 0&&this._$Eh.set(o,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let o of s)e.unshift(X(o))}else t!==void 0&&e.push(X(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s: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 s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Et(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,s){this._$AK(t,s)}_$ET(t,e){let s=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,s);if(o!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:he).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(o):this.setAttribute(o,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,o=s._$Eh.get(t);if(o!==void 0&&this._$Em!==o){let n=s.getPropertyOptions(o),i=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:he;this._$Em=o;let c=i.fromAttribute(e,n.type);this[o]=c??this._$Ej?.get(o)??c,this._$Em=null}}requestUpdate(t,e,s,o=!1,n){if(t!==void 0){let i=this.constructor;if(o===!1&&(n=this[t]),s??=i.getPropertyOptions(t),!((s.hasChanged??De)(n,e)||s.useDefault&&s.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:o,wrapped:n},i){s&&!(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||s||(e=void 0),this._$AL.set(t,e)),o===!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[o,n]of this._$Ep)this[o]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[o,n]of s){let{wrapped:i}=n,c=this[o];i!==!0||this._$AL.has(o)||c===void 0||this.C(o,void 0,n,c)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}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){}};T.elementStyles=[],T.shadowRootOptions={mode:"open"},T[ct("elementProperties")]=new Map,T[ct("finalized")]=new Map,Qr?.({ReactiveElement:T}),(Ct.reactiveElementVersions??=[]).push("2.1.2");var fe=globalThis,je=r=>r,Mt=fe.trustedTypes,He=Mt?Mt.createPolicy("lit-html",{createHTML:r=>r}):void 0,me="$lit$",O=`lit$${Math.random().toFixed(9).slice(2)}$`,de="?"+O,Zr=`<${de}>`,q=document,pt=()=>q.createComment(""),ht=r=>r===null||typeof r!="object"&&typeof r!="function",ge=Array.isArray,Ve=r=>ge(r)||typeof r?.[Symbol.iterator]=="function",le=`[
|
|
2
|
+
\f\r]`,ut=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ze=/-->/g,Ue=/>/g,z=RegExp(`>|${le}(?:([^\\s"'>=/]+)(${le}*=${le}*(?:[^
|
|
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),zs=xe(2),Us=xe(3),B=Symbol.for("lit-noChange"),g=Symbol.for("lit-nothing"),Ie=new WeakMap,U=q.createTreeWalker(q,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=ut;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===ut?l[1]==="!--"?i=ze:l[1]!==void 0?i=Ue:l[2]!==void 0?(We.test(l[2])&&(o=RegExp("</"+l[2],"g")),i=z):l[3]!==void 0&&(i=z):i===z?l[0]===">"?(i=o??ut,h=-1):l[1]===void 0?h=-2:(h=i.lastIndex-l[2].length,u=l[1],i=l[3]===void 0?z:l[3]==='"'?Be:qe):i===Be||i===qe?i=z:i===ze||i===Ue?i=ut:(i=z,o=void 0);let m=i===z&&r[c+1].startsWith("/>")?" ":"";n+=i===ut?a+Zr: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]},lt=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:V}),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],pt()),U.nextNode(),a.push({type:2,index:++n});o.append(h[f],pt())}}}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=q.createElement("template");return s.innerHTML=t,s}};function I(r,t,e=r,s){if(t===B)return t;let o=s!==void 0?e._$Co?.[s]:e._$Cl,n=ht(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=I(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??q).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 Q(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=q,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++}},Q=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=I(this,t,e),ht(t)?t===g||t==null||t===""?(this._$AH!==g&&this._$AR(),this._$AH=g):t!==this._$AH&&t!==B&&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&&ht(this._$AH)?this._$AA.nextSibling.data=t:this.T(q.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=lt.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 lt(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(pt()),this.O(pt()),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=je(t).nextSibling;je(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},V=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=I(this,t,e,0),i=!ht(t)||t!==this._$AH&&t!==B,i&&(this._$AH=t);else{let c=t,a,u;for(t=n[0],a=0;a<n.length-1;a++)u=I(this,c[s+a],e,a),u===B&&(u=this._$AH[a]),i||=!ht(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 V{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===g?void 0:t}},Tt=class extends V{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==g)}},Ot=class extends V{constructor(t,e,s,o,n){super(t,e,s,o,n),this.type=5}_$AI(t,e=this){if((t=I(this,t,e,0)??g)===B)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){I(this,t)}},Fe={M:me,P:O,A:de,C:1,L:Ge,R:kt,D:Ve,V:I,I:Q,H:V,N:Tt,U:Ot,B:Pt,F:Rt},ts=fe.litHtmlPolyfillSupport;ts?.(lt,Q),(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 Q(t.insertBefore(pt(),n),n,void 0,e??{})}return o._$AI(r),o};var ye=globalThis,Z=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 B}};Z._$litElement$=!0,Z.finalized=!0,ye.litElementHydrateSupport?.({LitElement:Z});var es=ye.litElementPolyfillSupport;es?.({LitElement:Z});(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 Nt(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 Lt=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 tt(r){let t=new Lt(r);return{strings:t.strings,numbers:t.numbers,booleans:t.booleans,on:e=>Xe(r,e),spec:(e,s={})=>Qe(r,e,s)}}tt.get=E;tt.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 et(r,t=document){let e=t.querySelector(r);if(!e)throw new Error(`element not found (${r})`);return e}function Dt(r,t=document){return t.querySelector(r)}function jt(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"?et(t,this.element):t)}require(t){return et(t,this.element)}maybe(t){return Dt(t,this.element)}all(t){return jt(t,this.element)}render(...t){return x(t,this.element)}get attrs(){return this.#t??=tt(this.element)}events(t){return Nt(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 et(r,t)}w.in=(r,t=document)=>new Ht(t).in(r);w.need=et;w.maybe=Dt;w.all=jt;w.el=Ye;w.elmer=Ze;w.mk=Je;w.events=Nt;w.attrs=tt;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 W(){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 zt(r){let t=null;return((...e)=>(t?t.params=e:(t={params:e,deferred:W()},queueMicrotask(()=>{let{params:s,deferred:o}=t;t=null,Promise.resolve(r(...s)).then(o.resolve).catch(o.reject)})),t.deferred.promise))}var $={};Vr($,{clone:()=>ft,equal:()=>os,freeze:()=>ns});function ft(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=>ft(s,new Set(t))):r.constructor===Object?e=Object.fromEntries(Object.entries(r).map(([s,o])=>[s,ft(o,new Set(t))])):r instanceof Map?e=new Map(Array.from(r,([s,o])=>[s,ft(o,new Set(t))])):r instanceof Set?e=new Set(Array.from(r,s=>ft(s,new Set(t)))):r instanceof Date?e=new Date(r.getTime()):e=r,t.delete(r)):e=r,e}function rs(r){return r!=null}function ss(r){return r==null}var mt=Object.freeze({happy:rs,sad:ss,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 os=(r,t)=>{function e(s,o,n){if(!mt.object(s)||!mt.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 ns(r){function t(e,s){if(!mt.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 sr(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 or(r){if(r.ok)throw new Error("didn't get needed error");return r.error}function nr(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 N(r,t,e){if(r.has(t))return r.get(t);{let s=e();return r.set(t,s),s}}function dt(r,t){for(let[e,s]of t)r.set(e,s);return r}function ir(r){let t,e=!1,s=()=>{e=!0,clearTimeout(t)},o=async()=>{e||(await r(s),!e&&(t=setTimeout(o,0)))};return o(),s}function Ut(){let r=[];function t(){for(let e of r)e();r=[]}return t.schedule=(...e)=>(r.push(...e),t),t}function K(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)}}var ar=(r=0)=>new Promise(t=>setTimeout(t,r));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 is(){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}=W(),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 cr(r){let t=is();return r&&t.sub(r),t.sub}var qt=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=N(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 qt;function L(r){return function t(){return arguments.length===0?(p.read(t),r):(r=arguments[0],p.write(t),r)}}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 rt(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.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 gt=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 Dn=p.batch;function ur(r){return $.freeze($.clone(r))}var C=Symbol("optic");var xt=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 Bt=class r{[C];#t;#e;#r;constructor(t){this[C]=t,this.#t=$.clone(t.getState()),this.#e=new xt(()=>$.clone(t.getState())),this.#r=new xt(()=>ur(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 It=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 pr(r){if(!r.done)throw new Error("wait not done");return sr(r)}function hr(r){if(!r.done)throw new Error("wait not done");return or(r)}var lr=r=>!r.done;var ve=r=>r.done&&r.ok;function fr(r,t){let{pending:e=()=>{},ok:s=()=>{},err:o=()=>{}}=t;return lr(r)?e():ve(r)?s(pr(r)):o(hr(r))}var Vt=A`
|
|
4
4
|
* {
|
|
5
5
|
margin: 0;
|
|
6
6
|
padding: 0;
|
|
@@ -14,430 +14,152 @@ var Js=Object.defineProperty;var Ys=(r,t)=>{for(var e in t)Js(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 Wt=class r extends HTMLElement{static register(){w.register({SlyShadow:r},{soft:!0})}connectedCallback(){this.hasAttribute("view")||this.setAttribute("view","")}};var Kt=class{render;count=0;rendered=W();constructor(t){this.render=t}doneRender(){this.count++,this.rendered.resolve(),this.rendered=W()}},D=class extends Kt{host;shadow;constructor(t,e,s){super(t),this.host=e,this.shadow=s}};var _e=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()}}},v=globalThis[Symbol.for("e280.hooks")]??=new _e;var G=class{#t=[];clear(){this.#t.forEach(t=>t()),this.#t=[]}observe(t,e){let{seen:s,value:o}=p.observe(t);this.clear();for(let n of s){let i=p.subscribe(n,e);this.#t.push(i)}return o}};var Gt=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 F=class{cx;position=0;values=new Map;mounts=new Gt;constructor(t){this.cx=t}};var{I:Wa}=Fe;var mr=r=>r.strings===void 0;var dr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Yt=r=>(...t)=>({_$litDirective$:r,values:t}),Ft=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var yt=(r,t)=>{let e=r._$AN;if(e===void 0)return!1;for(let s of e)s._$AO?.(t,!1),yt(s,t);return!0},Jt=r=>{let t,e;do{if((t=r._$AM)===void 0)break;e=t._$AN,e.delete(r),r=t}while(e?.size===0)},gr=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),ms(t)}};function ls(r){this._$AN!==void 0?(Jt(this),this._$AM=r,gr(this)):this._$AM=r}function fs(r,t=!1,e=0){let s=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(t)if(Array.isArray(s))for(let n=e;n<s.length;n++)yt(s[n],!1),Jt(s[n]);else s!=null&&(yt(s,!1),Jt(s));else yt(this,r)}var ms=r=>{r.type==dr.CHILD&&(r._$AP??=fs,r._$AQ??=ls)},wt=class extends Ft{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),gr(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(yt(this,t),Jt(this))}setValue(t){if(mr(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 xr(r){return class extends HTMLElement{#t;#e;#r=new G;#o=this.attachShadow({mode:"open"});constructor(){super();let t=zt(()=>{if(!this.isConnected)return;let e=this.#s();x(e,this.#t.shadow),this.#t.doneRender()});this.#t=new D(t,this,this.#o),this.#e=new F(this.#t)}#s(){return this.#r.observe(()=>v.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.#r.clear()}}}function _(r){let{scope:t,position:e}=v.increment();return N(t.values,e,r)}function bt(){return v.increment().scope.cx}function Xt(){let r=bt();if(!(r instanceof D))throw new Error("this hook only works on shadow views (but was called in a light view)");return r}function Se(){return Xt().host}function st(r){let{scope:t}=v.increment();return _(()=>t.mounts.mount(r))}function wr(){return Xt().shadow}function br(r,t){Et(r,gs(t))}function gs(r){let t=[];if(Array.isArray(r)){let e=new Set(r.flat(1/0).reverse());for(let s of e)t.unshift(X(s))}else r!==void 0&&t.push(X(r));return t}function ot(...r){let t=wr();_(()=>br(t,r))}function nt(r=""){let t=Se();_(()=>t.setAttribute("view",r))}function $r(r){return _(()=>L(r))}var Qt=ot;function vr(r,t){for(let[e,s]of Object.entries(t))ys(r,e,s)}function ys(r,t,e){let s=r.getAttribute(t),o=ws(e);o!==s&&(o===null?r.removeAttribute(t):r.setAttribute(t,o))}function ws(r){return typeof r=="string"?r:typeof r=="number"?r.toString():r?"":null}function bs(){Wt.register();let r=document.createElement("sly-shadow"),t=r.attachShadow({mode:"open"});return{host:r,shadow:t}}function Y(r){return _r(bs,r)}Y.setup=r=>(t=>_r(r,t));function _r(r,t){let e=Yt(class extends wt{#t;#e;#r;#o=new G;constructor(o){super(o);let{host:n,shadow:i}=r(),c=zt(()=>{if(!this.#r)throw new Error("cannot render before props");if(!this.isConnected)return;let a=this.#s(this.#r);x(a,this.#t.shadow),this.#t.doneRender()});this.#t=new D(c,n,i),this.#e=new F(this.#t)}#s(o){return this.#r=o,this.#o.observe(()=>v.wrap(this.#e,()=>t(...this.#r)),this.#t.render)}render({props:o,children:n,attrs:i}){let{host:c}=this.#t;return this.isConnected&&(i&&vr(c,i),x(n,this.#t.host),x(this.#s(o),this.#t.shadow),this.#t.doneRender()),c}disconnected(){x(null,this.#t.shadow),x(null,this.#t.host),this.#e.mounts.unmountAll(),this.#o.clear()}reconnected(){this.#e.mounts.remountAll(),this.#t.render()}});function s(...o){return e({props:o})}return s.with=e,s}function M(r,t){return()=>$s({hz:r,frames:t})}var $s=Y(({hz:r,frames:t})=>{nt("loading"),Qt(Vt,As);let e=$r(0);return st(()=>ir(async()=>{await ar(1e3/r);let s=e()+1;e(s>=t.length?0:s)})),t.at(e())}),As=A`
|
|
18
18
|
:host {
|
|
19
19
|
font-family: monospace;
|
|
20
20
|
white-space: pre;
|
|
21
21
|
user-select: none;
|
|
22
22
|
}
|
|
23
|
-
`;var
|
|
23
|
+
`;var k=Y(r=>(nt("error"),Qt(Vt,vs),typeof r=="string"?r:r instanceof Error?b`<strong>${r.name}:</strong> <span>${r.message}</span>`:"error")),vs=A`
|
|
24
24
|
:host {
|
|
25
25
|
font-family: monospace;
|
|
26
26
|
color: red;
|
|
27
27
|
}
|
|
28
|
-
`;var y=class r{x;constructor(t){this.x=t}static new(t){return new this(t)}dup(){return new r(this.x)}set(t){return this.x=t,this}static isBetween(t,e=0,s=1){let o=Math.min(e,s),i=Math.max(e,s);return t>=o&&t<=i}isBetween(t=0,e=1){return r.isBetween(this.x,t,e)}static isNear(t,e,s=.01){return Math.abs(t-e)<=s}isNear(t,e=.01){return r.isNear(this.x,t,e)}static add(...t){let e=0;for(let s of t)e+=s;return e}add(...t){return this.x=r.add(this.x,...t),this}sub(...t){for(let e of t)this.x-=e;return this}static atLeast(t,e=0){return Math.max(t,e)}atLeast(t=0){return this.x=r.atLeast(this.x,t),this}static atMost(t,e=1){return Math.min(t,e)}atMost(t=1){return this.x=r.atMost(this.x,t),this}static clamp(t,e=0,s=1){return t=r.atLeast(t,Math.min(e,s)),t=r.atMost(t,Math.max(e,s)),t}clamp(t=0,e=1){return this.x=r.clamp(this.x,t,e),this}static lerp(t,e,s,o){let n=(e-t)*s;return o!==void 0&&Math.abs(n)>o&&(n=Math.sign(n)*o),t+n}lerp(t,e,s){return this.x=r.lerp(this.x,t,e,s),this}static step(t,e,s){let o=e-t;return Math.abs(o)<=s?e:t+Math.sign(o)*s}step(t,e){return this.x=r.step(this.x,t,e),this}static creep(t,e,s,o){let i=t*(1-Math.exp(-e*s));if(o!==void 0){let n=o*s;Math.abs(i)>n&&(i=Math.sign(i)*n)}return i}static approach(t,e,s,o,i){let n=e-t,a=this.creep(n,s,o,i);return t+a}approach(t,e,s,o){return this.x=r.approach(this.x,t,e,s,o),this}static wrap(t,e=0,s=1){let o=Math.min(e,s),n=Math.max(e,s)-o,a=t-o,c=a<0?n- -a%n:a%n;return o+c}wrap(t=0,e=1){return this.x=r.wrap(this.x,t,e),this}static constrainProximity(t,e,s){let o=e-t,i=Math.abs(o),n=i>s?s:i,a=o<0?-n:n;return t+a}constrainProximity(t,e){return this.x=r.constrainProximity(this.x,t,e),this}static inverse(t){return 1-t}inverse(){return this.x=r.inverse(this.x),this}static center(t){return t*2-1}center(){return this.x=r.center(this.x),this}static uncenter(t){return(t+1)/2}uncenter(){return this.x=r.uncenter(this.x),this}static map(t,e,s){let i=(s-e)*t;return e+i}map(t,e){return this.x=r.map(this.x,t,e),this}static remap(t,e,s,o=0,i=1,n=!1){let c=(t-e)/(s-e)*(i-o)+o;return n?r.clamp(c,o,i):c}remap(t,e,s=0,o=1,i=!1){return this.x=r.remap(this.x,t,e,s,o,i),this}static magnify(t){return 4*Math.pow(t-.5,3)+.5}magnify(){return this.x=r.magnify(this.x),this}static floor(t){return Math.floor(t)}floor(){return this.x=r.floor(this.x),this}static ceil(t){return Math.ceil(t)}ceil(){return this.x=r.ceil(this.x),this}static round(t){return Math.round(t)}round(){return this.x=r.round(this.x),this}static smooth(t,e,s){return s<=1?e:t+(e-t)/s}smooth(t,e){return this.x=r.smooth(this.x,t,e),this}};var b=class r{x;y;constructor(t,e){this.x=t,this.y=e}static new(t,e){return new this(t,e)}static zero(){return new this(0,0)}static all(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 this.zero().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 fromAngle(t){return new this(Math.cos(t),Math.sin(t))}dup(){return new r(this.x,this.y)}*[Symbol.iterator](){yield this.x,yield this.y}array(){return[this.x,this.y]}toJSON(){return this.array()}toString(){return`(Vec2 x${this.x.toFixed(2)}, y${this.y.toFixed(2)})`}set_(t,e){return this.x=t,this.y=e,this}set({x:t,y:e}){return this.x=t,this.y=e,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 i=y.clamp(s/o,-1,1);return Math.acos(i)}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=y.clamp(this.x,t.x,e.x),this.y=y.clamp(this.y,t.y,e.y),this}clampBy(t=0,e=1){return this.x=y.clamp(this.x,t,e),this.y=y.clamp(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}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({x:t,y:e},s){return this.lerp_(t,e,s)}approach_(t,e,s,o,i){return this.x=y.approach(this.x,t,s,o,i),this.y=y.approach(this.y,e,s,o,i),this}approach({x:t,y:e},s,o,i){return this.approach_(t,e,s,o,i)}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-t,i=this.y-e,n=Math.cos(s),a=Math.sin(s);return this.x=n*o-a*i+t,this.y=a*o+n*i+e,this}rotateAroundPoint({x:t,y:e},s){return this.rotateAroundPoint_(t,e,s)}smooth_(t,e,s){return this.x=y.smooth(this.x,t,s),this.y=y.smooth(this.y,e,s),this}smooth({x:t,y:e},s){return this.smooth_(t,e,s)}};var Ve=class{state;players;constructor(t,e){this.state=t,this.players=e}tick(){for(let t of this.players){let{agent:e,port:{actions:s}}=t,o=1;e.position.y+=o*s.gameplay.up.value,e.position.y-=o*s.gameplay.down.value,e.position.x-=o*s.gameplay.left.value,e.position.x+=o*s.gameplay.right.value,e.position.clamp(b.zero(),this.state.arenaSize)}}};var We=class{label="0";alive=!0;color="#444";position=b.zero()};var Ge=class{arenaSize=new b(200,100);agents=new Set;makeAgent(t){let e=new We;return e.label=t,e.position.set_(.5,.5).mul(this.arenaSize),this.agents.add(e),e}deleteAgent(t){return this.agents.delete(t),this}};var Nt=class{};function Lt(r,{start:t,end:e}){return!(t&&r<t||e&&r>e)}var Fe=class extends Nt{#t=new Map;async gets(...t){return t.map(e=>this.#t.get(e))}async hasKeys(...t){return t.map(e=>this.#t.has(e))}async*keys(t={}){if(t.limit===0)return;let e=0;for(let s of this.#t.keys())if(Lt(s,t)&&(yield s,e+=1),e>=(t.limit??1/0))break}async*entries(t={}){if(t.limit===0)return;let e=0;for(let[s,o]of this.#t.entries())if(Lt(s,t)&&(yield[s,o],e+=1),e>=(t.limit??1/0))break}async transaction(...t){for(let[e,s]of t)s===void 0?this.#t.delete(e):this.#t.set(e,s)}};function ks(r,t,e){let s=Object.entries(t);for(let[o,i]of s)r.addEventListener(o,i,e);return function(){for(let[i,n]of s)r.removeEventListener(i,n)}}var zt=class extends Nt{storage;static onStorageEvent=t=>ks(window,{storage:t});constructor(t=window.localStorage){super(),this.storage=t}async gets(...t){return t.map(e=>this.storage.getItem(e)??void 0)}async hasKeys(...t){return t.map(e=>this.storage.getItem(e)!==null)}async*keys(t={}){if(t.limit===0)return;let e=0;for(let s of Object.keys(this.storage))if(Lt(s,t)&&(yield s,e+=1),e>=(t.limit??1/0))break}async*entries(t={}){if(t.limit===0)return;let e=0;for(let[s,o]of Object.entries(this.storage))if(Lt(s,t)&&(yield[s,o],e+=1),e>=(t.limit??1/0))break}async transaction(...t){for(let[e,s]of t)s===void 0?this.storage.removeItem(e):this.storage.setItem(e,s)}};async function As(r){let t=[];for await(let e of r)t.push(e);return t}var Ke=class{kv;key;write;constructor(t,e){this.kv=t,this.key=e,this.write=new Br(t.write,e)}async set(t){return this.kv.set(this.key,t)}async get(){return this.kv.get(this.key)}async require(){return this.kv.require(this.key)}async guarantee(t){let e=await this.get();return e===void 0&&(e=await t(),await this.set(e)),e}},Br=class{key;#t;constructor(t,e){this.key=e,this.#t=t}set(t){return this.#t.set(this.key,t)}};var oe={parse:r=>JSON.parse(r),stringify:r=>JSON.stringify(r)};var Je=class{#t;constructor(t){this.#t=t}sets(...t){return t.map(([e,s])=>{let o=this.#t.prefix(e),i=s===void 0?void 0:oe.stringify(s);return[o,i]})}set(t,e){return this.sets([t,e])}del(...t){return t.map(e=>[this.#t.prefix(e),void 0])}};function*_s(r,t){if(r<=0)throw new Error("chunk size must be greater than zero");for(let e=0;e<t.length;e+=r)yield t.slice(e,e+r)}var Ye=class{#t;constructor(t){let{scopes:e,divisor:s,delimiter:o}=t;this.#t=e.length>0?e.join(s)+o:""}prefix=t=>this.#t+t;unprefix=t=>{let e=this.#t.length;return t.slice(e)};scan=t=>{let{limit:e}=t,s=this.#t+(t.start??""),o=this.#t+(t.end??"\xFF");return{limit:e,start:s,end:o}}};var Xe=class r{driver;static collect=As;write;#t;#e;constructor(t=new Fe,e={}){this.driver=t,this.#t={scopes:[],divisor:".",delimiter:":",chunkSize:1e4,...e},this.#e=new Ye(this.#t),this.write=new Je(this.#e)}async gets(...t){return(await this.driver.gets(...t.map(this.#e.prefix))).map(s=>s===void 0?s:oe.parse(s))}async get(t){let[e]=await this.gets(t);return e}async requires(...t){let e=await this.gets(...t);for(let s of e)if(s===void 0)throw new Error("required key not found");return e}async require(t){let[e]=await this.requires(t);return e}async hasKeys(...t){return this.driver.hasKeys(...t.map(this.#e.prefix))}async has(t){let[e]=await this.hasKeys(t);return e}async*keys(t={}){for await(let e of this.driver.keys(this.#e.scan(t)))yield this.#e.unprefix(e)}async clear(t={}){let e=[];for await(let s of this.keys(t))e.push(s);for(let s of _s(this.#t.chunkSize,e))await this.del(...s)}async*entries(t={}){for await(let[e,s]of this.driver.entries(this.#e.scan(t)))yield[this.#e.unprefix(e),oe.parse(s)]}async*values(t){for await(let[,e]of this.entries(t))yield e}async transaction(t){let e=t(this.write).flat();return this.driver.transaction(...e)}async set(t,e){return this.transaction(s=>[s.set(t,e)])}async sets(...t){return this.transaction(e=>[e.sets(...t)])}async del(...t){return this.transaction(e=>[e.del(...t)])}async guarantee(t,e){let s=await this.get(t);return s===void 0&&(s=await e(),await this.transaction(o=>[o.set(t,s)])),s}async versionMigration(t,e,s){let o=this,i=await o.get(t)??0;typeof i!="number"&&(i=0),i!==e&&(await s(i),await o.set(t,e))}store(t){return new Ke(this,t)}scope(t,e=this.#t.delimiter){return new r(this.driver,{...this.#t,delimiter:e,scopes:[...this.#t.scopes,t]})}flatten(){return new r(this.driver,{...this.#t,delimiter:""})}};var ie=class r{profiles=new X;portProfiles=[];metaBindings=null;constructor(t){if(t){for(let e of t.profiles)this.profiles.set(e.id,e);this.portProfiles=t.portProfiles.map(e=>e&&(this.profiles.has(e)?e:null)),this.metaBindings=t.metaBindings}}toJSON(){return B.clone({profiles:[...this.profiles.values()],portProfiles:this.portProfiles,metaBindings:this.metaBindings})}clone(){return new r(this.toJSON())}getProfile(t){return this.profiles.get(t)}getProfileForPort(t){let e=this.portProfiles.at(t);return e?this.getProfile(e):void 0}};var Ze=class{store;$catalog;static async load(t){let e=$(new ie(await t.get()));return new this(t,e)}dispose=D();constructor(t,e){this.store=t,this.$catalog=e,this.dispose.schedule(zt.onStorageEvent(async()=>this.reload()))}async reload(){let t=new ie(await this.store.get());await this.$catalog.set(t)}async save(t){await this.store.set(t.toJSON()),await this.$catalog(t)}async#t(t){let e=this.$catalog().clone(),s=t(e);return await this.store.set(e.toJSON()),await this.$catalog(e),s}async createProfile(t,e){return this.#t(s=>{let o=At.random(),i={id:o,label:t,bindings:e};return s.profiles.set(o,i),i})}async deleteProfile(t){return this.#t(e=>{e.profiles.delete(t)})}async assignPortProfile(t,e){return this.#t(s=>{s.portProfiles[t]=e})}};function T(r){return r>0}var Qe=class{on=E();onDown=E();#t=0;#e=0;get value(){return this.#t}set value(t){this.#e=this.#t,this.#t=t,this.on.publish(this),this.down&&this.onDown.publish(this)}get previous(){return this.#e}get changed(){return this.#t!==this.#e}get pressed(){return T(this.#t)}get down(){return!T(this.#e)&&T(this.#t)}get up(){return T(this.#e)&&!T(this.#t)}};var U=class extends X{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}mergeSample([t,e]){let s=this.get(t)??0;return e>s&&this.set(t,e),this}};function Ms([,,r],t){return{lastValue:0,holdStart:t,settings:Oo(r)}}function Bo(){return{scale:1,invert:!1,clamp:null,range:null,bottom:null,top:null,timing:["direct"]}}function Oo(r={}){return{...Bo(),...r}}var Es=(r,t,e)=>Pr(e).line(function(o){let{settings:i}=t;if(i.clamp){let[n,a]=i.clamp;o=y.clamp(o,n,a)}if(i.range){let[n,a]=i.range;o=y.isBetween(o,n,a)?y.remap(o,n,a,0,1,!0):0}return i.bottom&&(o=o<i.bottom?0:o),i.top&&(o=Math.min(i.top,o)),o},function(o){return t.settings.invert?1-o:o},function(o){return t.settings.scale*o},function(o){let{settings:i}=t,n=(i.timing[0]==="direct"?void 0:i.timing[1])??250,a=!T(t.lastValue)&&T(o),c=T(t.lastValue)&&!T(o);a&&(t.holdStart=r);let l=r-t.holdStart>=n;switch(t.lastValue=o,i.timing[0]){case"direct":return o;case"tap":return c&&!l?1:0;case"hold":return T(o)&&l?o:0;default:throw new Error("unknown bindings timing")}});function Ps(r){return r.length>0?Math.max(...r):0}function Cs(r){return r.length>0?Math.min(...r):0}var tr=class{bindings;actions;#t=new Set;#e=new U;#r=0;#s=new K;#o=us();constructor(t){this.bindings=t,this.actions=Qt(t,(e,s)=>Qt(e,o=>{let i=new Qe;return this.#o.subscribe(()=>{i.value=this.#t.has(s)?this.#n([])(o,s):0}),i}))}resolve(t,e,s){return this.#r=t,this.#t=e,this.#e=s,this.#o(),this.actions}#i(t,e,s){let o=this.#s.guarantee(t.join("/"),()=>Ms(["code",e,s],this.#r)),i=this.#e.get(e)??0;return Es(this.#r,o,i)}#n=t=>(e,s)=>{let o=[...t,String(s),typeof e=="string"?e:e[0]],i=this.#n(o);if(typeof e=="string")return this.#i(o,e);switch(e[0]){case"code":{let[,n,a]=e;return this.#i(o,n,a)}case"and":{let[,...n]=e,a=n.map(i);return Cs(a)}case"or":{let[,...n]=e,a=n.map(i);return Ps(a)}case"not":{let[,n]=e;return i(n,"subject")>0?0:1}case"cond":{let[,n,a]=e;return i(a,"guard")>0?i(n,"subject"):0}case"mods":{let[,n,a]=e,c=(h,...u)=>h?["or",...u]:["not",["or",...u]];return i(["cond",n,["and",c(a.ctrl??!1,"ControlLeft","ControlRight"),c(a.alt??!1,"AltLeft","AltRight"),c(a.meta??!1,"MetaLeft","MetaRight"),c(a.shift??!1,"ShiftLeft","ShiftRight")]],"guard")>0?i(n,"subject"):0}}}};var et=class{*[Symbol.iterator](){for(let t of this.samples())yield t}};var Ht=class extends et{devices=new Ae;#t=new U;constructor(...t){super(),this.devices.adds(...t)}*samples(){this.#t.zero();for(let t of this.devices)for(let e of t.samples())this.#t.mergeSample(e);yield*this.#t.entries()}};var rt=class extends tr{#t=new Ht;devices=this.#t.devices;modes=new Ae;constructor(t){super(t),this.modes.adds(...Object.keys(t))}resolve(t=Date.now()){let e=new U(this.#t.samples());return super.resolve(t,this.modes,e)}};var gt="meta";var qt=()=>({[gt]:{revealOverlay:["or","Backslash","gamepad.beta","gamepad.gamma"],shimmyNext:["or","BracketRight",["and",["or","gamepad.beta","gamepad.gamma"],"gamepad.right"],["and",["or","gamepad.beta","gamepad.gamma"],"gamepad.bumper.right"]],shimmyPrevious:["or","BracketLeft",["and",["or","gamepad.beta","gamepad.gamma"],"gamepad.left"],["and",["or","gamepad.beta","gamepad.gamma"],"gamepad.bumper.left"]]}});var er=class{device;metaPort;constructor(t,e=qt()){this.device=t,this.metaPort=new rt(e),this.metaPort.devices.add(t)}};var rr=class{ports;metaBindings;on=E();#t=new X;metaPort;constructor(t,e=qt()){this.ports=t,this.metaBindings=e,this.metaPort=new rt(e)}poll(t=Date.now()){return this.#r(t),this.#s(t),this.#o(t)}portByIndex(t){let e=this.ports.at(t);if(!e)throw new Error(`port ${t} not found`);return e}portByDevice(t){for(let e of this.ports)if(e.devices.has(t))return e}shimmy(t,e){let s=this.ports.findIndex(a=>a.devices.has(t)),o=Math.max(0,this.ports.length-1),i=y.clamp(s+e,0,o),n=this.portByIndex(i);return this.reassign(t,n),n}reassign(t,e=this.getLonelyPort()){this.ports.forEach(s=>s.devices.delete(t)),e.devices.add(t),this.#e()}unplug(t){this.ports.forEach(e=>e.devices.delete(t)),this.#t.delete(t),this.#e()}plug=(t,e=this.getLonelyPort())=>(this.unplug(t),this.#t.set(t,new er(t,this.metaBindings)),e.devices.add(t),this.#e(),()=>this.unplug(t));getLonelyPort(){let t=this.ports.at(0);for(let e of this.ports)e.devices.size<t.devices.size&&(t=e);return t}#e=ke(0,()=>this.on.publish());#r(t){this.metaPort.devices.clear(),this.metaPort.devices.adds(...this.#t.keys()),this.metaPort.resolve(t)}#s(t){for(let e of this.#t.values()){let s=e.metaPort.resolve(t);s[gt].shimmyNext.down&&this.shimmy(e.device,1),s[gt].shimmyPrevious.down&&this.shimmy(e.device,-1)}}#o(t){return this.ports.map(e=>(e.resolve(t),e))}};function Rs(r,t){let e=B.clone(r);if(!t)return e;for(let[s,o]of Object.entries(e))for(let i of Object.keys(o)){let n=t[s]?.[i];n&&(o[i]=n)}return e}function ne(r){return r>=0?[r,0]:[0,Math.abs(r)]}function ae(r){let[t,e]=ne(r.x),[s,o]=ne(r.y);return{up:o,down:s,left:e,right:t}}var yt=class extends et{channel;$vector=$(b.zero());$breakdown=dt(()=>ae(this.$vector.get()));constructor(t="stick"){super(),this.channel=t}samples(){let{channel:t}=this,{up:e,down:s,left:o,right:i}=this.$breakdown.get();return[[`${t}.up`,e],[`${t}.down`,s],[`${t}.left`,o],[`${t}.right`,i]]}};var V=class extends et{on=E();sampleMap=new U;setSample(t,e){return this.sampleMap.set(t,e),this.on.pub(t,e),this}*samples(){for(let t of this.sampleMap)yield t}};var It=class extends V{stickLeft=new yt;stickRight=new yt;samples(){let t=this.stickLeft.$breakdown();this.setSample("gamepad.stick.left.up",t.up),this.setSample("gamepad.stick.left.down",t.down),this.setSample("gamepad.stick.left.left",t.left),this.setSample("gamepad.stick.left.right",t.right);let e=this.stickRight.$breakdown();return this.setSample("gamepad.stick.right.up",e.up),this.setSample("gamepad.stick.right.down",e.down),this.setSample("gamepad.stick.right.left",e.left),this.setSample("gamepad.stick.right.right",e.right),super.samples()}};var sr=class r extends V{client=new b(0,0);movement=new b(0,0);dispose=D();constructor(t=window){super(),this.dispose.schedule(pt(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(){return this.#t(),super.samples()}#t(){let[t,e]=this.movement,[s,o]=ne(t),[i,n]=ne(e);t&&(t>=0?this.setSample("pointer.move.right",Math.abs(o)):this.setSample("pointer.move.left",Math.abs(s))),e&&(e>=0?this.setSample("pointer.move.up",Math.abs(n)):this.setSample("pointer.move.down",Math.abs(i))),this.movement.set_(0,0)}};var or=class extends V{dispose=D();constructor(t=window){super(),this.dispose.schedule(pt(t,this.#t)),this.dispose.schedule(pt(window,this.#e))}#t={keydown:t=>{if(t.repeat)return null;this.setSample(t.code,1)},keyup:t=>{if(t.repeat)return null;this.setSample(t.code,0)}};#e={blur:()=>{this.sampleMap.zero()}}};var st=class extends Ht{keyboard=new or;pointer=new sr;vpad=new It;constructor(){super(),this.devices.add(this.keyboard).add(this.pointer).add(this.vpad)}};function ce(r,t){let e=b.from(r),s=e.distance_(0,0),o=y.remap(s,t.x,t.y,0,1,!0);return e.normalize().mulBy(o)}var Do=["gamepad.a","gamepad.b","gamepad.x","gamepad.y","gamepad.bumper.left","gamepad.bumper.right","gamepad.trigger.left","gamepad.trigger.right","gamepad.alpha","gamepad.beta","gamepad.stick.left.click","gamepad.stick.right.click","gamepad.up","gamepad.down","gamepad.left","gamepad.right","gamepad.gamma"],Ut=class extends V{pad;range=new b(.2,.9);constructor(t){super(),this.pad=t}get gamepad(){return this.pad.gamepad}samples(){return this.#t(this.pad.gamepad),this.#e(this.pad.gamepad),super.samples()}#t(t){let e=0,s=o=>{e=Math.max(e,o)};for(let[o,i]of Do.entries()){let n=t.buttons.at(o)?.value??0;s(n),this.setSample(i,n)}this.setSample("gamepad.any",e)}#e(t){let[e=0,s=0,o=0,i=0]=t.axes,n=ae(ce(new b(e,s),this.range)),a=ae(ce(new b(o,i),this.range));this.setSample("gamepad.stick.left.up",n.up),this.setSample("gamepad.stick.left.down",n.down),this.setSample("gamepad.stick.left.left",n.left),this.setSample("gamepad.stick.left.right",n.right),this.setSample("gamepad.stick.right.up",a.up),this.setSample("gamepad.stick.right.down",a.down),this.setSample("gamepad.stick.right.left",a.left),this.setSample("gamepad.stick.right.right",a.right)}};var ir=class{fallback="\u2754";#t=new Map;constructor(t=[[st,"\u{1F4BB}"],[Ut,"\u{1F3AE}"],[It,"\u{1F4F1}"]]){this.add(...t)}get(t){return this.#t.get(t)??this.fallback}add(...t){for(let[e,s]of t)this.#t.set(e,s);return this}clear(){return this.#t.clear(),this}};var jo=r=>_e(r).map(t=>`hsl(${(t*(360/r)+180)%360}deg, 100%, 50%)`),nr=class extends Me{constructor(){super(()=>jo(12))}};var Or=class{icon;label;color;constructor(t,e,s){this.icon=t,this.label=e,this.color=s}},Vt=class{icons=new ir;#t=new is;#e=new nr;get(t){return this.#t.guarantee(t,()=>new Or(this.icons.get(t.constructor),At.random(4),this.#e.takeFirst()))}};var ar=class{hub;deviceSkins;auto=!0;dispose=D();#t=Date.now();#e=$(!1);$manual=$(!1);$visible=$.derived(()=>this.$manual()||this.auto&&this.#e());$showLabels=$(!1);constructor(t,e=new Vt){this.hub=t,this.deviceSkins=e,this.dispose.schedule(t.on(async()=>{Date.now()-this.#t>100&&await this.bump()}))}#r=ke(1500,()=>this.#e(!1));async bump(){await this.#e(!0),await this.#r()}async toggle(t=!this.$manual()){return this.$manual.set(t)}};var cr=class{baseBindings;baseMetaBindings;hub;db;static async load(t){let e=await Ze.load(t.kv.store("catalog")),s=_e(t.portCount).map(i=>e.$catalog().getProfileForPort(i)).map(i=>Rs(t.bindings,i?.bindings)).map(i=>new rt(i)),o=new rr(s,e.$catalog().metaBindings??t.metaBindings??qt());return new this(t.bindings,t.metaBindings,o,e)}dispose=D();deviceSkins=new Vt;primaryDevice=new st;overlayVisibility;constructor(t,e,s,o){this.baseBindings=t,this.baseMetaBindings=e,this.hub=s,this.db=o,this.overlayVisibility=new ar(s,this.deviceSkins),this.dispose.schedule(s.metaPort.actions[gt].revealOverlay.on(i=>{i.pressed&&this.overlayVisibility.bump()}))}get catalog(){return this.db.$catalog()}};var Dr=class{port;agent;constructor(t,e){this.port=t,this.agent=e}},lr=class{#t=new X;constructor(t,e){for(let[s,o]of t.ports.entries()){let i=(s+1).toString();this.#t.set(o,new Dr(o,e.makeAgent(i)))}}[Symbol.iterator](){return this.#t.values()}require(t){return this.#t.require(t)}};var ur=class{state;canvas=(()=>{let t=document.createElement("canvas");return t.width=200,t.height=100,t})();ctx=this.canvas.getContext("2d");constructor(t){this.state=t}percent(t){let e=Math.min(this.canvas.width,this.canvas.height);return Math.ceil(e*(t/100))}resolve(t){return t.dup().div(this.state.arenaSize).morph(e=>{e.y=1-e.y}).mul_(this.canvas.width,this.canvas.height)}render(){let{state:t}=this;this.#e();let e=[...t.agents].reverse(),s=e.filter(i=>!i.alive),o=e.filter(i=>i.alive);for(let i of s)this.#r(i);for(let i of o)this.#s(i)}#t(){let{ctx:t}=this;return t.imageSmoothingEnabled=!1,t.fillStyle="#000",t.strokeStyle="#000",t.lineWidth=1,t.font="10px sans-serif",t.textAlign="center",t.textBaseline="middle",t}#e(){let{canvas:t}=this,e=this.#t();e.fillStyle="#000",e.fillRect(0,0,t.width,t.height)}#r(t){let e=this.#t(),s=this.percent(10),{position:o}=t,[i,n]=this.resolve(o);e.font=`${s*1.3}px sans-serif`,e.textAlign="center",e.textBaseline="middle",e.fillStyle="#fff4",e.fillText(t.label,i,n)}#s(t){let e=this.#t(),s=this.percent(10),{color:o,position:i}=t,[n,a]=this.resolve(i);e.beginPath(),e.arc(n,a,s,0,Math.PI*2),e.fillStyle=o,e.fill(),e.lineWidth=this.percent(2),e.strokeStyle="#fff",e.stroke(),e.font=`${s*1.3}px sans-serif`,e.textAlign="center",e.textBaseline="middle",e.strokeStyle="#0004",e.strokeText(t.label,n,a),e.fillStyle="#fff",e.fillText(t.label,n,a)}};var ot=class extends yt{hub;constructor(t){super(),this.hub=t}shimmyNext=()=>this.hub.shimmy(this,1);shimmyPrevious=()=>this.hub.shimmy(this,-1)};var Bs={gameplay:{up:["or","KeyW","ArrowUp","stick.up","gamepad.stick.left.up","gamepad.stick.right.up"],down:["or","KeyS","ArrowDown","stick.down","gamepad.stick.left.down","gamepad.stick.right.down"],left:["or","KeyA","ArrowLeft","stick.left","gamepad.stick.left.left","gamepad.stick.right.left"],right:["or","KeyD","ArrowRight","stick.right","gamepad.stick.left.right","gamepad.stick.right.right"]}};function Os(r,t){let e=r;return()=>{let s=t();return s!=null&&(e=s),e}}var jr=class{get;constructor(t){this.get=t}get gamepad(){return this.get()}};function Ds(r){let t=new K;return pt(window,{gamepadconnected:({gamepad:e})=>{let s=()=>navigator.getGamepads().at(e.index),o=new jr(Os(e,s)),i=r(o);t.set(e.index,{pad:o,dispose:i})},gamepaddisconnected:({gamepad:e})=>{let s=t.get(e.index);s&&(t.delete(e.index),s.dispose())}})}function js(r){return Ds(t=>r(new Ut(t)))}function Ts(){let r=new zt(window.localStorage);return new Xe(r).scope("tact")}var hr=class{deck;static async load(){return new this(await cr.load({portCount:4,kv:Ts(),bindings:Bs}))}logic;dispose=D();state=new Ge;renderer=new ur(this.state);constructor(t){this.deck=t,this.deck.deviceSkins.icons.add([ot,"\u{1F518}"]),this.logic=new Ve(this.state,new lr(t.hub,this.state)),this.dispose.schedule(this.deck.hub.on(()=>{for(let e of this.logic.players){e.agent.alive=e.port.devices.size>0;let[s]=e.port.devices;e.agent.color=s?this.deck.deviceSkins.get(s).color:"#444"}})),this.plug(new st),this.plug(new ot(t.hub)),this.dispose.schedule(js(t.hub.plug))}plug(t){return this.deck.hub.plug(t),()=>this.unplug(t)}unplug(t){this.deck.hub.unplug(t)}loop(t){return as(async()=>{await Mt(1e3/t),this.deck.hub.poll(),this.logic.tick(),this.renderer.render()})}};var Ns=(r,t,e)=>{let s=new Map;for(let o=t;o<=e;o++)s.set(r[o],o);return s},Ls=Ot(class extends Bt{constructor(r){if(super(r),r.type!==He.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,t,e){let s;e===void 0?e=t:t!==void 0&&(s=t);let o=[],i=[],n=0;for(let a of r)o[n]=s?s(a,n):n,i[n]=e(a,n),n++;return{values:i,keys:o}}render(r,t,e){return this.dt(r,t,e).values}update(r,[t,e,s]){let o=fs(r),{values:i,keys:n}=this.dt(t,e,s);if(!Array.isArray(o))return this.ut=n,i;let a=this.ut??=[],c=[],l,h,u=0,p=o.length-1,f=0,d=i.length-1;for(;u<=p&&f<=d;)if(o[u]===null)u++;else if(o[p]===null)p--;else if(a[u]===n[f])c[f]=tt(o[u],i[f]),u++,f++;else if(a[p]===n[d])c[d]=tt(o[p],i[d]),p--,d--;else if(a[u]===n[d])c[d]=tt(o[u],i[d]),Rt(r,c[d+1],o[u]),u++,d--;else if(a[p]===n[f])c[f]=tt(o[p],i[f]),Rt(r,o[u],o[p]),p--,f++;else if(l===void 0&&(l=Ns(n,f,d),h=Ns(a,u,p)),l.has(a[u]))if(l.has(a[p])){let S=h.get(n[f]),N=S!==void 0?o[S]:null;if(N===null){let xt=Rt(r,o[u]);tt(xt,i[f]),c[f]=xt}else c[f]=tt(N,i[f]),Rt(r,o[u],N),o[S]=null;f++}else ze(o[p]),p--;else ze(o[u]),u++;for(;f<=d;){let S=Rt(r,c[d+1]);tt(S,i[f]),c[f++]=S}for(;u<=p;){let S=o[u++];S!==null&&ze(S)}return this.ut=n,ds(r,c),F}});var zs=A`
|
|
28
|
+
`;function P(r,t){return(e,s)=>fr(e,{pending:r,err:t,ok:s})}var Hp=P(M(10,[" "," ",". ",".. ","..."," .."," ."]),k);var Ip=P(M(3,["\u{1F30E}","\u{1F30F}","\u{1F30D}"]),k);var Fp=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 Zp=P(M(16,["|","/","-","\\"]),k);var oh=P(M(20,[":....",":....","::...",".::..","..::.","...::","....:","....:","...::","..::.",".::..","::..."]),k);var Zt=class{#t;#e;constructor(t){this.#t=t,this.#e=rt(()=>[...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 gt;controllers=new gt;portAssignments=new R};function Sr(r){return r.length>0?Math.max(...r):0}function Er(r){return r.length>0?Math.min(...r):0}function Cr([,,r],t){return{lastValue:0,holdStart:t,settings:Ss(r)}}function _s(){return{scale:1,invert:!1,clamp:null,range:null,bottom:null,top:null,timing:["direct"]}}function Ss(r={}){return{..._s(),...r}}function it(r){return r!==0}var{min:Es,max:Cs,abs:Ms,sign:ks,floor:Ph,ceil:Th,pow:Oh}=Math;function Mr(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=Es(r,e),r=Cs(r,t),r}function Ps(r,t,e,s){let n=(e-t)*r;return s!==void 0&&Ms(n)>s&&(n=ks(n)*s),t+n}function Ts(r,t,e){return(r-t)/(e-t)}function kr(r,t,e,s=0,o=1,n=!1){let i=Ts(r,t,e);return n&&(i=S(i)),Ps(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(0,0)}static all(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 this.zero().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 r(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`(Vec2 x${this.x.toFixed(2)}, y${this.y.toFixed(2)})`}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 Pr=(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=Mr(o,i,c)?kr(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=!it(t.lastValue)&&it(o),a=it(t.lastValue)&&!it(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 it(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 Tr(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=Tr(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=N(s,a.join("/"),()=>Cr(["code",u,l],c)),f=e.get(u)??0;return Pr(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 Er(d)}case"or":{let[,...m]=u,d=m.map(f);return Sr(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=(Br,...Te)=>Br?["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,dt(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)??nr(this.custom,t)}};function Me(r,t){for(;t.length>r;)t.shift();return t}var Or=256,se=class{store;profileAssignments=new R;customProfiles=new R;constructor(t){this.store=t}async save(){await this.store.set({customProfiles:Me(Or,[...this.customProfiles]),profileAssignments:Me(Or,[...this.profileAssignments])})}async load(){let t=await this.store.get();this.customProfiles.clear(),this.profileAssignments.clear(),dt(this.customProfiles,t?.customProfiles??[]),dt(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=N(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 Rr(r,t){let e=r;return()=>{let s=t();return s!=null&&(e=s),e}}function Nr(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(Rr(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=K(window,{gamepadconnected:e,gamepaddisconnected:e});return()=>{n();for(let{dispose:i}of t.values())i();t.clear()}}var H=class{on=cr();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 H{client=new $t(0,0);movement=new $t(0,0);dispose=Ut();constructor(t=window){super(),this.dispose.schedule(K(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[t,e]=this.movement,[s,o]=At(t),[n,i]=At(e);t&&(t>=0?this.setSample("pointer.move.right",Math.abs(o)):this.setSample("pointer.move.left",Math.abs(s))),e&&(e>=0?this.setSample("pointer.move.up",Math.abs(i)):this.setSample("pointer.move.down",Math.abs(n))),this.movement.set_(0,0)}};var ce=class extends H{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 Lr=A`
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
.plate {
|
|
31
|
+
background: black;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
`;var Dr=A`
|
|
35
|
+
|
|
36
|
+
.deck {
|
|
31
37
|
display: flex;
|
|
32
38
|
flex-direction: column;
|
|
33
|
-
|
|
39
|
+
gap: 0.5em;
|
|
34
40
|
|
|
35
|
-
|
|
41
|
+
> div {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-wrap: wrap;
|
|
44
|
+
gap: 0.5em;
|
|
45
|
+
}
|
|
36
46
|
}
|
|
37
47
|
|
|
38
|
-
.
|
|
39
|
-
|
|
40
|
-
width:
|
|
41
|
-
|
|
42
|
-
aspect-ratio: 2 / 1;
|
|
43
|
-
overflow: hidden;
|
|
48
|
+
.port {
|
|
49
|
+
background: grey;
|
|
50
|
+
width: 16em;
|
|
51
|
+
max-width: 100%;
|
|
44
52
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
53
|
+
header {
|
|
54
|
+
display: flex;
|
|
55
|
+
padding: 0.5em;
|
|
48
56
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
57
|
+
> span {
|
|
58
|
+
flex: 1 1 auto;
|
|
59
|
+
font-weight: bold;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
53
62
|
|
|
63
|
+
strong {
|
|
64
|
+
display: block;
|
|
54
65
|
width: 100%;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
image-rendering: pixelated;
|
|
58
|
-
outline: 1px solid red;
|
|
66
|
+
padding: 0.2em;
|
|
59
67
|
}
|
|
60
68
|
|
|
61
|
-
|
|
62
|
-
position: absolute;
|
|
63
|
-
top: 10%;
|
|
64
|
-
left: 0;
|
|
65
|
-
right: 0;
|
|
66
|
-
|
|
69
|
+
.controllerlist {
|
|
67
70
|
display: flex;
|
|
68
71
|
flex-direction: column;
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
padding: 0.5em;
|
|
73
|
+
gap: 0.5em;
|
|
71
74
|
}
|
|
72
75
|
}
|
|
73
76
|
|
|
74
|
-
.
|
|
77
|
+
.controller {
|
|
75
78
|
display: flex;
|
|
76
|
-
flex-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
background: green;
|
|
81
|
+
padding: 0.5em;
|
|
79
82
|
gap: 0.5em;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
`;var Hs=A`
|
|
83
|
-
|
|
84
|
-
:host {
|
|
85
|
-
--color: #aaa;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.box {
|
|
89
|
-
display: flex;
|
|
90
|
-
align-items: center;
|
|
91
|
-
justify-content: center;
|
|
92
|
-
|
|
93
|
-
gap: 0.2em;
|
|
94
|
-
padding: 0.2em;
|
|
95
|
-
padding-right: 0.5em;
|
|
96
|
-
|
|
97
|
-
border-radius: 2em;
|
|
98
|
-
background: color-mix(in srgb, #fff4, var(--color));
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
[view="nub-stick"] {
|
|
102
|
-
width: 2em;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.label {
|
|
106
|
-
font-size: 1.2em;
|
|
107
|
-
font-weight: bold;
|
|
108
|
-
|
|
109
|
-
padding: 0 0.5em;
|
|
110
|
-
text-align: center;
|
|
111
|
-
|
|
112
|
-
color: white;
|
|
113
|
-
text-shadow: 0.1em 0.1em 0.1em #0004;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
button {
|
|
117
|
-
font-size: 0.8em;
|
|
118
|
-
padding: 0.2em;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
`;var qs=A`
|
|
122
|
-
|
|
123
|
-
:host {
|
|
124
|
-
--nub-size: 60%;
|
|
125
|
-
--nub-color: #fff8;
|
|
126
|
-
|
|
127
|
-
position: relative;
|
|
128
|
-
display: block;
|
|
129
|
-
|
|
130
|
-
cursor: default;
|
|
131
|
-
user-select: none;
|
|
132
83
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
background: #0008;
|
|
138
|
-
border-radius: 100%;
|
|
139
|
-
outline: 1px solid color-mix(in srgb, transparent, var(--nub-color) 10%);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
:host * {
|
|
143
|
-
pointer-events: none;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.frame {
|
|
147
|
-
position: absolute;
|
|
148
|
-
inset: 0;
|
|
149
|
-
margin: auto;
|
|
150
|
-
|
|
151
|
-
width: 100%;
|
|
152
|
-
height: auto;
|
|
153
|
-
aspect-ratio: 1 / 1;
|
|
84
|
+
.buttons {
|
|
85
|
+
display: flex;
|
|
86
|
+
flex-wrap: wrap;
|
|
87
|
+
justify-content: space-between;
|
|
154
88
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
width: var(--nub-size);
|
|
160
|
-
height: auto;
|
|
161
|
-
aspect-ratio: 1 / 1;
|
|
162
|
-
border-radius: 100%;
|
|
89
|
+
> div {
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-wrap: wrap;
|
|
92
|
+
}
|
|
163
93
|
}
|
|
164
94
|
}
|
|
165
95
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
.outer {
|
|
171
|
-
outline: 1px solid color-mix(in srgb, transparent, var(--nub-color) 10%);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.stickbase {
|
|
175
|
-
display: none;
|
|
176
|
-
background: color-mix(in srgb, transparent, var(--nub-color) 25%);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
.stickunder {
|
|
180
|
-
background: color-mix(in srgb, transparent, var(--nub-color) 50%);
|
|
96
|
+
button[disabled] {
|
|
97
|
+
opacity: 0.2;
|
|
181
98
|
}
|
|
182
99
|
|
|
183
|
-
.
|
|
184
|
-
background: #fff8;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
`;var Is=P(({$vector:r})=>{j("nub-stick"),L(R,qs);let t=se(),e=O(()=>new b(.2,.8)),s=Dt(void 0);Y(()=>{function c(h){let u=t.getBoundingClientRect(),p=r.get();p.x=y.remap(h.clientX,u.left,u.right,-1,1),p.y=y.remap(h.clientY,u.top,u.bottom,-1,1),p.set(ce(p,e)),r.publish()}function l(){s.value!==void 0&&(r.get().set_(0,0),r.publish(),Mt(0).then(()=>{s.value!==void 0&&(t.releasePointerCapture(s.value),s.value=void 0)}))}return ns(v.events(document.body,{click:[{capture:!0},h=>{s.value!==void 0&&(h.preventDefault(),h.stopPropagation())}]}),v.events(t,{pointerdown:h=>{s.value===void 0&&(s.value=h.pointerId,t.setPointerCapture(s.value),c(h))},pointermove:[{},h=>{s.value!==void 0&&c(h)}],pointerup:l,pointercancel:l}))});let o=r.get(),i=`width: ${e.x*100}%;`,n=`width: ${e.y*100}%;`,a=c=>{let l=c*.5,h=l*o.x*100,u=l*o.y*100;return`
|
|
188
|
-
transform-origin: center center;
|
|
189
|
-
transform: translate(${h}%, ${u}%);
|
|
190
|
-
`};return w`
|
|
191
|
-
<div class=frame>
|
|
192
|
-
<div class=inner style="${i}"></div>
|
|
193
|
-
</div>
|
|
194
|
-
|
|
195
|
-
<div class=frame>
|
|
196
|
-
<div class=outer style="${n}"></div>
|
|
197
|
-
</div>
|
|
198
|
-
|
|
199
|
-
<div class=frame>
|
|
200
|
-
<div class=stickbase></div>
|
|
201
|
-
</div>
|
|
202
|
-
|
|
203
|
-
<div class=frame style="${a(.5)}">
|
|
204
|
-
<div class=stickunder></div>
|
|
205
|
-
</div>
|
|
206
|
-
|
|
207
|
-
<div class=frame style="${a(1)}">
|
|
208
|
-
<div class=stick></div>
|
|
209
|
-
</div>
|
|
210
|
-
`});var Us=P((r,t,e)=>{L(R,Hs),j("virtual-device");let s=()=>r.unplug(t);return w`
|
|
211
|
-
<div class=box>
|
|
212
|
-
${Is(t)}
|
|
213
|
-
|
|
214
|
-
<button @click="${t.shimmyPrevious}">👈</button>
|
|
215
|
-
<button @click="${s}">💀</button>
|
|
216
|
-
<button @click="${t.shimmyNext}">👉</button>
|
|
217
|
-
</div>
|
|
218
|
-
`});var Vs=A`
|
|
219
|
-
|
|
220
|
-
`;var Ws=P(r=>{L(R,Vs),j("deck-bindings");let{db:t,hub:e}=r,s=t.$catalog(),o={id:"default",label:"default",bindings:r.baseBindings},i=[o,...s.profiles.values()],n=Dt("default"),a=t.$catalog().getProfile(n())??o;function c(d,S){let N=s.getProfileForPort(S)??o;return w`
|
|
100
|
+
`;var jr=Y((r,t={})=>{nt("desk"),ot(Dr);function e(c,a){let u=r.ports,l=r.queryController(c),h=u.indexOf(l.port),f=S(h+a,0,u.length-1),m=u.at(f);m&&m.plug(c)}function s(c,a){return b`
|
|
221
101
|
<div class=port>
|
|
222
|
-
<
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
<
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
</select>
|
|
232
|
-
</div>
|
|
233
|
-
`}function l(d){let[S,N]=d;return w`
|
|
234
|
-
<div class=bracket>
|
|
235
|
-
<strong class=mode>${S}</strong>
|
|
236
|
-
<div>${Object.entries(N).map(h)}</div>
|
|
102
|
+
<header>
|
|
103
|
+
<span>P${a+1}</span>
|
|
104
|
+
<div class=buttons>
|
|
105
|
+
<button @click=${()=>r.deletePort(c)}>🚫</button>
|
|
106
|
+
</div>
|
|
107
|
+
</header>
|
|
108
|
+
<div class=controllerlist>
|
|
109
|
+
${c.controllers.map(n)}
|
|
110
|
+
</div>
|
|
237
111
|
</div>
|
|
238
|
-
`}function
|
|
239
|
-
<div class=
|
|
240
|
-
<
|
|
112
|
+
`}function o(c){return b`
|
|
113
|
+
<div class=port>
|
|
114
|
+
<header>
|
|
115
|
+
<span>unassigned</span>
|
|
116
|
+
</header>
|
|
117
|
+
<div class=controllerlist>
|
|
118
|
+
${c.map(n)}
|
|
119
|
+
</div>
|
|
241
120
|
</div>
|
|
242
|
-
`}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
121
|
+
`}function n(c){let{port:a,profileKey:u}=r.queryController(c);async function l(f){let d=f.currentTarget.value;await r.assignControllerProfile(c,d)}function h(f){(r.ports.at(0)??r.createPort()).plug(f)}return b`
|
|
122
|
+
<div class=controller>
|
|
123
|
+
<span>${t.getControllerLabel?.(c)??c.handle}</span>
|
|
124
|
+
|
|
125
|
+
<div class=buttons>
|
|
126
|
+
<div>
|
|
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>
|
|
257
145
|
</div>
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
cursor: default;
|
|
265
|
-
user-select: none;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
.portlist {
|
|
269
|
-
pointer-events: none;
|
|
270
|
-
|
|
271
|
-
display: flex;
|
|
272
|
-
align-items: start;
|
|
273
|
-
|
|
274
|
-
width: max-content;
|
|
275
|
-
gap: var(--gap);
|
|
276
|
-
padding: 0.5em;
|
|
277
|
-
|
|
278
|
-
color: #fff8;
|
|
279
|
-
background: #222a;
|
|
280
|
-
border-radius: 1em;
|
|
281
|
-
|
|
282
|
-
opacity: 0;
|
|
283
|
-
transition: opacity 300ms linear;
|
|
284
|
-
|
|
285
|
-
&[data-active] {
|
|
286
|
-
opacity: 1;
|
|
287
|
-
pointer-events: all;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
.port {
|
|
291
|
-
flex: 1 0 0;
|
|
292
|
-
display: flex;
|
|
293
|
-
flex-direction: column;
|
|
294
|
-
|
|
295
|
-
min-width: 6em;
|
|
296
|
-
gap: var(--gap);
|
|
297
|
-
|
|
298
|
-
> * {
|
|
299
|
-
color: white;
|
|
300
|
-
font-weight: bold;
|
|
301
|
-
text-shadow: 0.05em 0.05em 0.1em #0008;
|
|
302
|
-
text-transform: uppercase;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
header {
|
|
306
|
-
text-align: center;
|
|
307
|
-
color: #fff8;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
.device {
|
|
311
|
-
display: flex;
|
|
312
|
-
flex-direction: column;
|
|
313
|
-
gap: var(--gap);
|
|
314
|
-
|
|
315
|
-
box-shadow: 0.1em 0.2em 0.7em #0004;
|
|
316
|
-
background: color-mix(in srgb, #fffa, var(--color) 50%);
|
|
317
|
-
border-top: 2px solid #fff8;
|
|
318
|
-
border-bottom: 2px solid #0004;
|
|
319
|
-
border-radius: 0.5em;
|
|
320
|
-
|
|
321
|
-
.row {
|
|
322
|
-
display: flex;
|
|
323
|
-
align-items: center;
|
|
324
|
-
|
|
325
|
-
&.primary {
|
|
326
|
-
justify-content: space-between;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
&.secondary {
|
|
330
|
-
justify-content: center;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
.icon {
|
|
335
|
-
font-size: 1.5em;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
.label {
|
|
339
|
-
font-family: monospace;
|
|
340
|
-
font-size: 0.8em;
|
|
341
|
-
opacity: 0.5;
|
|
342
|
-
line-height: 0.9em;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
button {
|
|
346
|
-
opacity: 0.2;
|
|
347
|
-
cursor: pointer;
|
|
348
|
-
padding: 0 0.2em;
|
|
349
|
-
font-family: monospace;
|
|
350
|
-
font-size: 1.5em;
|
|
351
|
-
font-weight: bold;
|
|
352
|
-
|
|
353
|
-
background: transparent;
|
|
354
|
-
border: 1px solid transparent;
|
|
355
|
-
text-shadow: inherit;
|
|
356
|
-
|
|
357
|
-
&:is(:hover, :focus-visible) {
|
|
358
|
-
opacity: 1;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
`;var Fs=P(r=>{L(R,Gs),j("deck-overlay");let{hub:t,deviceSkins:e,overlayVisibility:{$visible:s,$showLabels:o}}=r;function i(n){let a=e.get(n),c=`--color: ${a.color};`,l=()=>t.shimmy(n,1);return w`
|
|
366
|
-
<div class=device style="${c}">
|
|
367
|
-
<div class="primary row">
|
|
368
|
-
<button @click="${()=>t.shimmy(n,-1)}"><</button>
|
|
369
|
-
<div class=icon>${a.icon}</div>
|
|
370
|
-
<button @click="${l}">></button>
|
|
146
|
+
`}let{unassignedControllers:i}=r;return b`
|
|
147
|
+
<div class=deck>
|
|
148
|
+
<div>
|
|
149
|
+
${r.ports.map(s)}
|
|
150
|
+
<div>
|
|
151
|
+
<button @click=${()=>r.createPort()}>✨add port</button>
|
|
371
152
|
</div>
|
|
153
|
+
</div>
|
|
372
154
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
<div class=label>${a.label}</div>
|
|
376
|
-
</div>
|
|
377
|
-
`:null}
|
|
155
|
+
<div>
|
|
156
|
+
${i.length>0?o(i):null}
|
|
378
157
|
</div>
|
|
379
|
-
`}return w`
|
|
380
|
-
<div class=portlist ?data-active="${s()}">
|
|
381
|
-
${t.ports.map((n,a)=>w`
|
|
382
|
-
<div class=port>
|
|
383
|
-
<header>P${a+1}</header>
|
|
384
|
-
${n.devices.array().map(i)}
|
|
385
|
-
</div>
|
|
386
|
-
`)}
|
|
387
|
-
</div>
|
|
388
|
-
`});var Ks=P(r=>{L(R,zs),Y(()=>r.loop(60));let t=Ie();Y(()=>r.deck.hub.on(t));let e=()=>r.plug(new ot(r.deck.hub)),s=()=>r.deck.overlayVisibility.bump(),o=r.deck.hub.ports.flatMap(i=>i.devices.array()).filter(i=>i instanceof ot).map(i=>({device:i,skin:r.deck.deviceSkins.get(i)})).sort((i,n)=>i.skin.label<n.skin.label?-1:1);return w`
|
|
389
|
-
<div class=surface>
|
|
390
|
-
${r.renderer.canvas}
|
|
391
|
-
${Fs(r.deck)}
|
|
392
158
|
</div>
|
|
393
|
-
|
|
394
|
-
<div class=
|
|
395
|
-
${
|
|
396
|
-
|
|
397
|
-
<button @click="${e}">
|
|
398
|
-
✨
|
|
399
|
-
</button>
|
|
400
|
-
|
|
401
|
-
<button @click="${s}">
|
|
402
|
-
👁️
|
|
403
|
-
</button>
|
|
159
|
+
`});var Hr=(r,t={})=>xr(()=>(ot(Lr),b`
|
|
160
|
+
<div class=plate>
|
|
161
|
+
${jr(r,t)}
|
|
404
162
|
</div>
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
`});var To=await hr.load();v.render(v("#demo-theater"),Ks(To));console.log("\u{1F3AE} tact");
|
|
408
|
-
/*! Bundled license information:
|
|
409
|
-
|
|
410
|
-
@lit/reactive-element/css-tag.js:
|
|
411
|
-
(**
|
|
412
|
-
* @license
|
|
413
|
-
* Copyright 2019 Google LLC
|
|
414
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
415
|
-
*)
|
|
416
|
-
|
|
417
|
-
@lit/reactive-element/reactive-element.js:
|
|
418
|
-
lit-html/lit-html.js:
|
|
419
|
-
lit-element/lit-element.js:
|
|
420
|
-
lit-html/directive.js:
|
|
421
|
-
lit-html/async-directive.js:
|
|
422
|
-
lit-html/directives/repeat.js:
|
|
423
|
-
(**
|
|
424
|
-
* @license
|
|
425
|
-
* Copyright 2017 Google LLC
|
|
426
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
427
|
-
*)
|
|
428
|
-
|
|
429
|
-
lit-html/is-server.js:
|
|
430
|
-
(**
|
|
431
|
-
* @license
|
|
432
|
-
* Copyright 2022 Google LLC
|
|
433
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
434
|
-
*)
|
|
435
|
-
|
|
436
|
-
lit-html/directive-helpers.js:
|
|
437
|
-
(**
|
|
438
|
-
* @license
|
|
439
|
-
* Copyright 2020 Google LLC
|
|
440
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
441
|
-
*)
|
|
442
|
-
*/
|
|
163
|
+
`));var ue=class extends H{dispose=Ut();constructor(t=window){super(),this.dispose.schedule(K(t,this.#t)),this.dispose.schedule(K(window,this.#e))}#t={keydown:t=>{if(t.repeat)return null;this.setSample(t.code,1),this.setSample("keyboard.any",1)},keyup:t=>{if(t.repeat)return null;this.setSample(t.code,0),this.setSample("keyboard.any",0)}};#e={blur:()=>{this.zero()}}};var Os=ke({play:{action:["or","Space","pointer.button.left","gamepad.button.1"],up:["or","KeyW","gamepad.axis.2.pos"],down:["or","KeyS","gamepad.axis.2.neg"],left:["or","KeyA","gamepad.axis.1.pos"],right:["or","KeyD","gamepad.axis.1.neg"]}}),zr=new It("tactDeck"),J=new oe({store:zr,stockProfiles:{standard:{label:"\u{1F4DC}standard",bindings:Os},micro:{label:"\u{1F9A0}micro",bindings:ke({play:{action:["or","Space","pointer.button.left","gamepad.button.1"],up:["or","KeyW","gamepad.axis.2.pos"],down:["or","KeyS","gamepad.axis.2.neg"],left:["or","KeyA","gamepad.axis.1.pos"],right:["or","KeyD","gamepad.axis.1.neg"]}})}}});await J.load();zr.onStorageEvent(()=>J.load());var Ur=J.createPort(),qr=J.createController("primary","standard",new ne(new ue,new ae));Ur.plug(qr);var Pe=new Map().set(qr,"\u2328\uFE0F\u{1F5B1}keyboard+mouse");Nr(r=>{let t=`(${r.gamepad.index+1}) ${r.gamepad.id}`,e=J.createController(t,"standard",new ce(r));return Pe.set(e,`\u{1F3AE}${t}`),Ur.plug(e),()=>J.deleteController(e)});w.register({DemoApp:Hr(J,{getControllerLabel:Pe.get.bind(Pe)})});
|
|
164
|
+
/*! For license information please see main.bundle.min.js.LEGAL.txt */
|
|
443
165
|
//# sourceMappingURL=main.bundle.min.js.map
|